@kne-components/react-file 0.1.19 → 0.1.20

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.
Files changed (37) hide show
  1. package/build/asset-manifest.json +20 -18
  2. package/build/index.html +1 -1
  3. package/build/remoteEntry.js +1 -1
  4. package/build/remoteEntry.js.map +1 -1
  5. package/build/static/css/784.b114183d.chunk.css +2 -0
  6. package/build/static/css/784.b114183d.chunk.css.map +1 -0
  7. package/build/static/css/813.7aed43b5.chunk.css +12 -0
  8. package/build/static/css/813.7aed43b5.chunk.css.map +1 -0
  9. package/build/static/js/257.76b6ccae.chunk.js +2 -0
  10. package/build/static/js/257.76b6ccae.chunk.js.map +1 -0
  11. package/build/static/js/612.a18f4128.chunk.js +3 -0
  12. package/build/static/js/612.a18f4128.chunk.js.map +1 -0
  13. package/build/static/js/638.469f0c5d.chunk.js +2 -0
  14. package/build/static/js/638.469f0c5d.chunk.js.map +1 -0
  15. package/build/static/js/689.2eced7a1.chunk.js +3 -0
  16. package/build/static/js/689.2eced7a1.chunk.js.map +1 -0
  17. package/build/static/js/{784.b6420626.chunk.js → 784.84b6856b.chunk.js} +2 -2
  18. package/build/static/js/{784.b6420626.chunk.js.map → 784.84b6856b.chunk.js.map} +1 -1
  19. package/build/static/js/{813.7c0e617a.chunk.js → 813.6c0ec6ea.chunk.js} +2 -2
  20. package/build/static/js/{813.7c0e617a.chunk.js.map → 813.6c0ec6ea.chunk.js.map} +1 -1
  21. package/build/static/js/main.9e610865.js +2 -0
  22. package/build/static/js/main.9e610865.js.map +1 -0
  23. package/package.json +1 -1
  24. package/build/static/css/784.621cbd66.chunk.css +0 -2
  25. package/build/static/css/784.621cbd66.chunk.css.map +0 -1
  26. package/build/static/css/813.e7152dd0.chunk.css +0 -12
  27. package/build/static/css/813.e7152dd0.chunk.css.map +0 -1
  28. package/build/static/js/612.c5eb6bcc.chunk.js +0 -3
  29. package/build/static/js/612.c5eb6bcc.chunk.js.map +0 -1
  30. package/build/static/js/689.e9664d55.chunk.js +0 -3
  31. package/build/static/js/689.e9664d55.chunk.js.map +0 -1
  32. package/build/static/js/969.a046887b.chunk.js +0 -2
  33. package/build/static/js/969.a046887b.chunk.js.map +0 -1
  34. package/build/static/js/main.3e42586a.js +0 -2
  35. package/build/static/js/main.3e42586a.js.map +0 -1
  36. /package/build/static/js/{612.c5eb6bcc.chunk.js.LICENSE.txt → 612.a18f4128.chunk.js.LICENSE.txt} +0 -0
  37. /package/build/static/js/{689.e9664d55.chunk.js.LICENSE.txt → 689.2eced7a1.chunk.js.LICENSE.txt} +0 -0
@@ -0,0 +1,3 @@
1
+ /*! For license information please see 689.2eced7a1.chunk.js.LICENSE.txt */
2
+ (self.webpackChunk_kne_components_react_file=self.webpackChunk_kne_components_react_file||[]).push([[379,689],{2683:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"};var r=i(80036);const o=s.forwardRef((function(t,e){return s.createElement(r.A,(0,n.A)({},t,{ref:e,icon:a}))}))},2899:(t,e,i)=>{var n=i(64579),s=i(2316),a=i(90931),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,h=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(a(t))return NaN;if(s(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=s(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=n(t);var i=o.test(t);return i||l.test(t)?h(t.slice(2),i?2:8):r.test(t)?NaN:+t}},3141:(t,e,i)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,s,a,r,o=[],l=!0,h=!1;try{if(a=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=a.call(i)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(t){h=!0,s=t}finally{try{if(!l&&null!=i.return&&(r=i.return(),Object(r)!==r))return}finally{if(h)throw s}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}i.d(e,{A:()=>s})},7717:(t,e,i)=>{"use strict";i.d(e,{A:()=>r});var n=i(3141),s=i(94922),a=i(78678);const r=function(t,e){e=Object.assign({},{defaultValue:"defaultValue",value:"value",onChange:"onChange"},e);var i=(0,s.useRef)(e.value in t),r=(0,s.useState)(t[e.defaultValue]),o=(0,n.A)(r,2),l=o[0],h=o[1],c=i.current?t[e.value]:l;return[c,(0,a.A)((function(n){for(var s="function"===typeof n?c=n(c):n,a=arguments.length,r=new Array(a>1?a-1:0),o=1;o<a;o++)r[o-1]=arguments[o];t[e.onChange]&&t[e.onChange].apply(t,[s].concat(r)),i.current||h(s)}))]}},9062:()=>{},12791:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"};var r=i(80036);const o=s.forwardRef((function(t,e){return s.createElement(r.A,(0,n.A)({},t,{ref:e,icon:a}))}))},13520:(t,e,i)=>{"use strict";i.d(e,{A:()=>k});var n=i(89261),s=i(94922),a=i(36294),r=i(63697),o=i(47215),l=i(64288),h=i(98677),c=Object.prototype.hasOwnProperty;function d(t,e,i){for(i of t.keys())if(u(i,e))return i}function u(t,e){var i,n,s;if(t===e)return!0;if(t&&e&&(i=t.constructor)===e.constructor){if(i===Date)return t.getTime()===e.getTime();if(i===RegExp)return t.toString()===e.toString();if(i===Array){if((n=t.length)===e.length)for(;n--&&u(t[n],e[n]););return-1===n}if(i===Set){if(t.size!==e.size)return!1;for(n of t){if((s=n)&&"object"===typeof s&&!(s=d(e,s)))return!1;if(!e.has(s))return!1}return!0}if(i===Map){if(t.size!==e.size)return!1;for(n of t){if((s=n[0])&&"object"===typeof s&&!(s=d(e,s)))return!1;if(!u(n[1],e.get(s)))return!1}return!0}if(i===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(i===DataView){if((n=t.byteLength)===e.byteLength)for(;n--&&t.getInt8(n)===e.getInt8(n););return-1===n}if(ArrayBuffer.isView(t)){if((n=t.byteLength)===e.byteLength)for(;n--&&t[n]===e[n];);return-1===n}if(!i||"object"===typeof t){for(i in n=0,t){if(c.call(t,i)&&++n&&!c.call(e,i))return!1;if(!(i in e)||!u(t[i],e[i]))return!1}return Object.keys(e).length===n}}return t!==t&&e!==e}var p=i(51938),f=i(85724),g=i(66499);class m{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise((e=>{(0,l.A)(this.pdfDocument,"PDF document not loaded."),(0,l.A)(t,"Destination is not specified."),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)})).then((t=>{(0,l.A)(Array.isArray(t),'"'.concat(t,'" is not a valid destination array.'));const e=t[0];new Promise((t=>{(0,l.A)(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then((e=>{t(e)})).catch((()=>{(0,l.A)(!1,'"'.concat(e,'" is not a valid page reference.'))})):"number"===typeof e?t(e):(0,l.A)(!1,'"'.concat(e,'" is not a valid destination reference.'))})).then((e=>{const i=e+1;(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,l.A)(i>=1&&i<=this.pagesCount,'"'.concat(i,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})}))}))}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,l.A)(t>=1&&t<=this.pagesCount,'"'.concat(t,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const v={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var b=i(42461),w=i(42166),y=function(t,e,i,n){return new(i||(i=Promise))((function(s,a){function r(t){try{l(n.next(t))}catch(e){a(e)}}function o(t){try{l(n.throw(t))}catch(e){a(e)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,o)}l((n=n.apply(t,e||[])).next())}))},A=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const{Tm:_}=p,x=(t,e)=>{switch(e){case v.NEED_PASSWORD:t(prompt("Enter the password to open this PDF file."));break;case v.INCORRECT_PASSWORD:t(prompt("Invalid password. Please try again."));break}};function E(t){return"object"===typeof t&&null!==t&&("data"in t||"range"in t||"url"in t)}const k=(0,s.forwardRef)((function(t,e){var{children:i,className:c,error:d="Failed to load PDF file.",externalLinkRel:v,externalLinkTarget:k,file:M,inputRef:S,imageResourcesPath:C,loading:T="Loading PDF\u2026",noData:R="No PDF file specified.",onItemClick:L,onLoadError:P,onLoadProgress:F,onLoadSuccess:I,onPassword:D=x,onSourceError:O,onSourceSuccess:N,options:W,renderMode:z,rotate:H}=t,B=A(t,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[j,V]=(0,w.A)(),{value:G,error:U}=j,[q,X]=(0,w.A)(),{value:Y,error:K}=q,J=(0,s.useRef)(new m),Q=(0,s.useRef)([]),Z=(0,s.useRef)(void 0),$=(0,s.useRef)(void 0);M&&M!==Z.current&&E(M)&&(h(!u(M,Z.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),Z.current=M),W&&W!==$.current&&(h(!u(W,$.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),$.current=W);const tt=(0,s.useRef)({scrollPageIntoView:t=>{const{dest:e,pageNumber:i,pageIndex:n=i-1}=t;if(L)return void L({dest:e,pageIndex:n,pageNumber:i});const s=Q.current[n];s?s.scrollIntoView():h(!1,"An internal link leading to page ".concat(i," was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>."))}});(0,s.useImperativeHandle)(e,(()=>({linkService:J,pages:Q,viewer:tt})),[]),(0,s.useEffect)((function(){V({type:"RESET"})}),[M,V]);const et=(0,s.useCallback)((()=>y(this,void 0,void 0,(function*(){if(!M)return null;if("string"===typeof M){if((0,b.zL)(M)){return{data:(0,b.jA)(M)}}return(0,b.qC)(),{url:M}}if(M instanceof _)return{range:M};if((0,b.mw)(M))return{data:M};if(b.Bd&&(0,b.qf)(M)){return{data:yield(0,b.h1)(M)}}if((0,l.A)("object"===typeof M,"Invalid parameter in file, need either Uint8Array, string or a parameter object"),(0,l.A)(E(M),"Invalid parameter object: need either .data, .range or .url"),"url"in M&&"string"===typeof M.url){if((0,b.zL)(M.url)){const{url:t}=M,e=A(M,["url"]),i=(0,b.jA)(t);return Object.assign({data:i},e)}(0,b.qC)()}return M}))),[M]);(0,s.useEffect)((()=>{const t=(0,r.A)(et());return t.promise.then((t=>{V({type:"RESOLVE",value:t})})).catch((t=>{V({type:"REJECT",error:t})})),()=>{(0,b.xL)(t)}}),[et,V]),(0,s.useEffect)((()=>{"undefined"!==typeof G&&(!1!==G?N&&N():U&&(h(!1,U.toString()),O&&O(U)))}),[G]),(0,s.useEffect)((function(){X({type:"RESET"})}),[X,G]),(0,s.useEffect)((function(){if(!G)return;const t=W?Object.assign(Object.assign({},G),W):G,e=p.YE(t);F&&(e.onProgress=F),D&&(e.onPassword=D);const i=e,n=i.promise.then((t=>{X({type:"RESOLVE",value:t})})).catch((t=>{i.destroyed||X({type:"REJECT",error:t})}));return()=>{n.finally((()=>i.destroy()))}}),[W,X,G]),(0,s.useEffect)((()=>{"undefined"!==typeof Y&&(!1!==Y?Y&&(I&&I(Y),Q.current=new Array(Y.numPages),J.current.setDocument(Y)):K&&(h(!1,K.toString()),P&&P(K)))}),[Y]),(0,s.useEffect)((function(){J.current.setViewer(tt.current),J.current.setExternalLinkRel(v),J.current.setExternalLinkTarget(k)}),[v,k]);const it=(0,s.useCallback)(((t,e)=>{Q.current[t]=e}),[]),nt=(0,s.useCallback)((t=>{delete Q.current[t]}),[]),st=(0,s.useMemo)((()=>({imageResourcesPath:C,linkService:J.current,onItemClick:L,pdf:Y,registerPage:it,renderMode:z,rotate:H,unregisterPage:nt})),[C,L,Y,it,z,H,nt]),at=(0,s.useMemo)((()=>(0,a.Ay)(B,(()=>Y))),[B,Y]);return(0,n.jsx)("div",Object.assign({className:(0,o.A)("react-pdf__Document",c),ref:S,style:{"--scale-factor":"1"}},at,{children:M?void 0===Y||null===Y?(0,n.jsx)(g.A,{type:"loading",children:"function"===typeof T?T():T}):!1===Y?(0,n.jsx)(g.A,{type:"error",children:"function"===typeof d?d():d}):(0,n.jsx)(f.A.Provider,{value:st,children:i}):(0,n.jsx)(g.A,{type:"no-data",children:"function"===typeof R?R():R})}))}))},15032:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"};var r=i(80036);const o=s.forwardRef((function(t,e){return s.createElement(r.A,(0,n.A)({},t,{ref:e,icon:a}))}))},15747:function(t,e,i){var n;"undefined"!=typeof self&&self,t.exports=(n=i(94922),function(){"use strict";var t={155:function(t){t.exports=n}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,i),a.exports}i.d=function(t,e){for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};i.r(s),i.d(s,{useReactToPrint:function(){return f}});var a=i(155);function r(t){let{level:e="error",messages:i,suppressErrors:n=!1}=t;n||("error"===e?console.error(i):"warning"===e?console.warn(i):console.debug(i))}function o(t,e){if(e||!t){const t=document.getElementById("printWindow");t&&document.body.removeChild(t)}}function l(t){return t instanceof Error?t:new Error("Unknown Error")}function h(t,e){const{documentTitle:i,onAfterPrint:n,onPrintError:s,preserveAfterPrint:a,print:h,suppressErrors:c}=e;setTimeout((()=>{var e,d;if(t.contentWindow){function u(){null==n||n(),o(a)}if(t.contentWindow.focus(),h)h(t).then(u).catch((t=>{s?s("print",l(t)):r({messages:["An error was thrown by the specified `print` function"],suppressErrors:c})}));else{if(t.contentWindow.print){const p=null!==(d=null===(e=t.contentDocument)||void 0===e?void 0:e.title)&&void 0!==d?d:"",f=t.ownerDocument.title;i&&(t.ownerDocument.title=i,t.contentDocument&&(t.contentDocument.title=i)),t.contentWindow.print(),i&&(t.ownerDocument.title=f,t.contentDocument&&(t.contentDocument.title=p))}else r({messages:["Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes."],suppressErrors:c});[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some((t=>{var e,i;return(null!==(i=null!==(e=navigator.userAgent)&&void 0!==e?e:navigator.vendor)&&void 0!==i?i:"opera"in window&&window.opera).match(t)}))?setTimeout(u,500):u()}}else r({messages:["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/MatthewHerbst/react-to-print/issues/"],suppressErrors:c})}),500)}function c(t){const e=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,null);let n=i.nextNode();for(;n;)e.push(n),n=i.nextNode();return e}function d(t,e,i){const n=c(t),s=c(e);if(n.length===s.length)for(let a=0;a<n.length;a++){const t=n[a],e=s[a],r=t.shadowRoot;if(null!==r){const t=e.attachShadow({mode:r.mode});t.innerHTML=r.innerHTML,d(r,t,i)}}else r({messages:["When cloning shadow root content, source and target elements have different size. `onBeforePrint` likely resolved too early.",t,e],suppressErrors:i})}const u='\n @page {\n /* Remove browser default header (title) and footer (url) */\n margin: 0;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n color-adjust: exact; /* Firefox. This is an older version of "print-color-adjust" */\n print-color-adjust: exact; /* Firefox/Safari */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n }\n }\n';function p(t,e,i,n){var s,a,o,c,p;const{contentNode:f,clonedContentNode:g,clonedImgNodes:m,clonedVideoNodes:v,numResourcesToLoad:b,originalCanvasNodes:w}=i,{bodyClass:y,fonts:A,ignoreGlobalStyles:_,pageStyle:x,nonce:E,suppressErrors:k,copyShadowRoots:M}=n;t.onload=null;const S=null!==(s=t.contentDocument)&&void 0!==s?s:null===(a=t.contentWindow)||void 0===a?void 0:a.document;if(S){const i=S.body.appendChild(g);M&&d(f,i,!!k),A&&((null===(o=t.contentDocument)||void 0===o?void 0:o.fonts)&&(null===(c=t.contentWindow)||void 0===c?void 0:c.FontFace)?A.forEach((i=>{const n=new FontFace(i.family,i.source,{weight:i.weight,style:i.style});t.contentDocument.fonts.add(n),n.loaded.then((()=>{e(n)})).catch((t=>{e(n,["Failed loading the font:",n,"Load error:",l(t)])}))})):(A.forEach((t=>{e(t)})),r({messages:['"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'],suppressErrors:k})));const n=null!=x?x:u,s=S.createElement("style");E&&(s.setAttribute("nonce",E),S.head.setAttribute("nonce",E)),s.appendChild(S.createTextNode(n)),S.head.appendChild(s),y&&S.body.classList.add(...y.split(" "));const a=S.querySelectorAll("canvas");for(let t=0;t<w.length;++t){const e=w[t],i=a[t];if(void 0===i){r({messages:["A canvas element could not be copied for printing, has it loaded? `onBeforePrint` likely resolved too early.",e],suppressErrors:k});continue}const n=i.getContext("2d");n&&n.drawImage(e,0,0)}for(let t=0;t<m.length;t++){const i=m[t],n=i.getAttribute("src");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,n,s,a,r)=>{e(i,["Error loading <img>",i,"Error",r])},t.src=n}else e(i,['Found an <img> tag with an empty "src" attribute. This prevents pre-loading it.',i])}for(let t=0;t<v.length;t++){const i=v[t];i.preload="auto";const n=i.getAttribute("poster");if(n){const t=new Image;t.onload=()=>{e(i)},t.onerror=(t,s,a,r,o)=>{e(i,["Error loading video poster",n,"for video",i,"Error:",o])},t.src=n}else i.readyState>=2?e(i):i.src?(i.onloadeddata=()=>{e(i)},i.onerror=(t,n,s,a,r)=>{e(i,["Error loading video",i,"Error",r])},i.onstalled=()=>{e(i,["Loading video stalled, skipping",i])}):e(i,["Error loading video, `src` is empty",i])}const h="select",b=f.querySelectorAll(h),C=S.querySelectorAll(h);for(let t=0;t<b.length;t++)C[t].value=b[t].value;if(!_){const i=document.querySelectorAll("style, link[rel~='stylesheet'], link[as='style']");for(let n=0,s=i.length;n<s;++n){const s=i[n];if("style"===s.tagName.toLowerCase()){const e=S.createElement(s.tagName),i=s.sheet;if(i){let a="";try{const t=i.cssRules.length;for(let e=0;e<t;++e)"string"==typeof i.cssRules[e].cssText&&(a+="".concat(i.cssRules[e].cssText,"\r\n"))}catch(t){r({messages:["A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/MatthewHerbst/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",s,"Original error: ".concat(l(t).message)],level:"warning"})}e.setAttribute("id","react-to-print-".concat(n)),E&&e.setAttribute("nonce",E),e.appendChild(S.createTextNode(a)),S.head.appendChild(e)}}else if(s.getAttribute("href"))if(s.hasAttribute("disabled"))r({messages:["`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",s],level:"warning"}),e(s);else{const t=S.createElement(s.tagName);for(let e=0,i=s.attributes.length;e<i;++e){const i=s.attributes[e];i&&t.setAttribute(i.nodeName,null!==(p=i.nodeValue)&&void 0!==p?p:"")}t.onload=()=>{e(t)},t.onerror=(i,n,s,a,r)=>{e(t,["Failed to load",t,"Error:",r])},E&&t.setAttribute("nonce",E),S.head.appendChild(t)}else r({messages:["`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",s],level:"warning"}),e(s)}}}0===b&&h(t,n)}function f(t){let{bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:c,ignoreGlobalStyles:d,nonce:u,onAfterPrint:f,onBeforePrint:g,onPrintError:m,pageStyle:v,preserveAfterPrint:b,print:w,suppressErrors:y}=t;return(0,a.useCallback)((t=>{function a(){const a={bodyClass:e,contentRef:i,copyShadowRoots:n,documentTitle:s,fonts:c,ignoreGlobalStyles:d,nonce:u,onAfterPrint:f,onBeforePrint:g,onPrintError:m,pageStyle:v,preserveAfterPrint:b,print:w,suppressErrors:y},o=function(){const t=document.createElement("iframe");return t.width="".concat(document.documentElement.clientWidth,"px"),t.height="".concat(document.documentElement.clientHeight,"px"),t.style.position="absolute",t.style.top="-".concat(document.documentElement.clientHeight+100,"px"),t.style.left="-".concat(document.documentElement.clientWidth+100,"px"),t.id="printWindow",t.srcdoc="<!DOCTYPE html>",t}(),l=function(t,e){const{contentRef:i,fonts:n,ignoreGlobalStyles:s,suppressErrors:a}=e,o=function(t){let{contentRef:e,optionalContent:i,suppressErrors:n}=t;return!i||i instanceof Event||(e&&r({level:"warning",messages:['"react-to-print" received a `contentRef` option and a optional-content param passed to its callback. The `contentRef` option will be ignored.']}),"function"!=typeof i)?e?e.current:void r({messages:['"react-to-print" did not receive a `contentRef` option or a optional-content param pass to its callback.'],suppressErrors:n}):i()}({contentRef:i,optionalContent:t,suppressErrors:a});if(!o)return;const l=o.cloneNode(!0),h=document.querySelectorAll("link[rel~='stylesheet'], link[as='style']"),c=l.querySelectorAll("img"),d=l.querySelectorAll("video"),u=n?n.length:0;return{contentNode:o,clonedContentNode:l,clonedImgNodes:c,clonedVideoNodes:d,numResourcesToLoad:(s?0:h.length)+c.length+d.length+u,originalCanvasNodes:o.querySelectorAll("canvas")}}(t,a);if(!l)return void r({messages:["There is nothing to print"],suppressErrors:y});const A=function(t,e,i){const{suppressErrors:n}=t,s=[],a=[];return function(o,l){s.includes(o)?r({level:"debug",messages:["Tried to mark a resource that has already been handled",o],suppressErrors:n}):(l?(r({messages:['"react-to-print" was unable to load a resource but will continue attempting to print the page',...l],suppressErrors:n}),a.push(o)):s.push(o),s.length+a.length===e&&h(i,t))}}(a,l.numResourcesToLoad,o);!function(t,e,i,n){t.onload=()=>{p(t,e,i,n)},document.body.appendChild(t)}(o,A,l,a)}o(b,!0),g?g().then((()=>{a()})).catch((t=>{null==m||m("onBeforePrint",l(t))})):a()}),[e,i,n,s,c,d,u,f,g,m,v,b,w,y])}return s}())},17666:(t,e,i)=>{"use strict";i.d(e,{ZF:()=>R,lV:()=>A});var n=i(94922),s=i.n(n),a=i(55199),r=i(78678),o=i(68102);const l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};var h=i(80036);const c=n.forwardRef((function(t,e){return n.createElement(h.A,(0,o.A)({},t,{ref:e,icon:l}))}));const d={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"};const u=n.forwardRef((function(t,e){return n.createElement(h.A,(0,o.A)({},t,{ref:e,icon:d}))}));var p=i(54159),f=i.n(p),g=i(20274),m=(i(16052),i(50805));function v(){return v=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},v.apply(null,arguments)}function b(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}const w=["onClick","children","loading"],y=t=>{const[e,i]=(0,n.useState)(!1),s=(0,r.A)((function(){return i(!0),Promise.resolve(t&&t(...arguments)).then((()=>{i(!1)})).catch((t=>{i(!1),console.error(t)}))}));return{isLoading:e,setIsLoading:i,callback:s}},A=t=>{let{onClick:e,children:i,loading:n}=t,r=b(t,w);const{isLoading:o,callback:l}=y(e);return s().createElement(a.Button,v({},r,{loading:n||o,onClick:l}),"function"===typeof i?i(n||o):i)};var _="_zIHFy",x="_R-IrF",E="_F1kMl",k="_Iee0d",M="_aGBVE",S="_0oW1K";const C={message:"\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f",confirm:"\u786e\u5b9a",delete:"\u5220\u9664",cancel:"\u53d6\u6d88",more:"\u66f4\u591a"},T=["title","message","isDelete","showCancel","cancelText","onCancel","isModal","okText","placement","children","onClick","getContainer","renderModal"],R=(0,g.createWithIntlProvider)("zh-CN",C,"button-group")((t=>{const{formatMessage:e}=(0,g.useIntl)(),i=Object.assign({},{isDelete:!0},t),{title:o,message:l,isDelete:h,showCancel:d,cancelText:u,onCancel:p,isModal:m,okText:w,placement:A,children:C,onClick:R,getContainer:L,renderModal:P}=i,F=b(i,T),[I,D]=(0,n.useState)(!1),{isLoading:O,callback:N}=y(R),W=(0,r.A)((()=>{D(!0)})),z=s().createElement(a.Flex,{className:E,vertical:!0,gap:8,onClick:t=>{t.stopPropagation()}},o&&s().createElement(a.Flex,{align:"flex-start",gap:8,className:k},h&&s().createElement(c,{className:"title-icon"}),o),s().createElement(a.Flex,{align:"flex-start",gap:8,className:f()(M,{[S]:o})},!o&&h?s().createElement(c,{className:"title-icon"}):null,l||e({id:"message"}))),H=()=>"function"===typeof C?C(v({},F,{onClick:W})):s().createElement(a.Button,v({},F,{loading:O,onClick:()=>{W()}}),C);if(m){const t={open:I,onCancel:()=>{D(!1),p&&p()},wrapClassName:x,okText:w||e(h?{id:"delete"}:{id:"confirm"}),cancelText:u||e({id:"cancel"}),onOk:t=>(D(!1),N(t)),closable:!1,okButtonProps:{danger:h},getContainer:L,children:z};return s().createElement(s().Fragment,null,"function"===typeof P?P(t):s().createElement(a.Modal,t),H())}return s().createElement(a.Popconfirm,{overlayClassName:f()(_),okButtonProps:{danger:h},title:z,open:I,getPopupContainer:L,onCancel:p,placement:A,showCancel:d,okText:w||e(h?{id:"delete"}:{id:"confirm"}),cancelText:u||e({id:"cancel"}),onOpenChange:D,onConfirm:t=>{N(t)}},H())}));var L=Array.isArray,P="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof i.g?i.g:"undefined"!==typeof self?self:{},F="object"==typeof P&&P&&P.Object===Object&&P,I="object"==typeof self&&self&&self.Object===Object&&self,D=F||I||Function("return this")(),O=D.Symbol,N=Object.prototype,W=N.hasOwnProperty,z=N.toString,H=O?O.toStringTag:void 0;var B=function(t){var e=W.call(t,H),i=t[H];try{t[H]=void 0;var n=!0}catch(a){}var s=z.call(t);return n&&(e?t[H]=i:delete t[H]),s},j=Object.prototype.toString;var V=function(t){return j.call(t)},G=O?O.toStringTag:void 0;var U=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":G&&G in Object(t)?B(t):V(t)};var q=function(t){return null!=t&&"object"==typeof t};var X=function(t){return"symbol"==typeof t||q(t)&&"[object Symbol]"==U(t)},Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,K=/^\w*$/;var J=function(t,e){if(L(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!X(t))||(K.test(t)||!Y.test(t)||null!=e&&t in Object(e))};var Q=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)};var Z=function(t){if(!Q(t))return!1;var e=U(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},$=D["__core-js_shared__"],tt=function(){var t=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var et=function(t){return!!tt&&tt in t},it=Function.prototype.toString;var nt=function(t){if(null!=t){try{return it.call(t)}catch(e){}try{return t+""}catch(e){}}return""},st=/^\[object .+?Constructor\]$/,at=Function.prototype,rt=Object.prototype,ot=at.toString,lt=rt.hasOwnProperty,ht=RegExp("^"+ot.call(lt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var ct=function(t){return!(!Q(t)||et(t))&&(Z(t)?ht:st).test(nt(t))};var dt=function(t,e){return null==t?void 0:t[e]};var ut=function(t,e){var i=dt(t,e);return ct(i)?i:void 0},pt=ut(Object,"create");var ft=function(){this.__data__=pt?pt(null):{},this.size=0};var gt=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},mt=Object.prototype.hasOwnProperty;var vt=function(t){var e=this.__data__;if(pt){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return mt.call(e,t)?e[t]:void 0},bt=Object.prototype.hasOwnProperty;var wt=function(t){var e=this.__data__;return pt?void 0!==e[t]:bt.call(e,t)};var yt=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=pt&&void 0===e?"__lodash_hash_undefined__":e,this};function At(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}At.prototype.clear=ft,At.prototype.delete=gt,At.prototype.get=vt,At.prototype.has=wt,At.prototype.set=yt;var _t=At;var xt=function(){this.__data__=[],this.size=0};var Et=function(t,e){return t===e||t!==t&&e!==e};var kt=function(t,e){for(var i=t.length;i--;)if(Et(t[i][0],e))return i;return-1},Mt=Array.prototype.splice;var St=function(t){var e=this.__data__,i=kt(e,t);return!(i<0)&&(i==e.length-1?e.pop():Mt.call(e,i,1),--this.size,!0)};var Ct=function(t){var e=this.__data__,i=kt(e,t);return i<0?void 0:e[i][1]};var Tt=function(t){return kt(this.__data__,t)>-1};var Rt=function(t,e){var i=this.__data__,n=kt(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this};function Lt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Lt.prototype.clear=xt,Lt.prototype.delete=St,Lt.prototype.get=Ct,Lt.prototype.has=Tt,Lt.prototype.set=Rt;var Pt=Lt,Ft=ut(D,"Map");var It=function(){this.size=0,this.__data__={hash:new _t,map:new(Ft||Pt),string:new _t}};var Dt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Ot=function(t,e){var i=t.__data__;return Dt(e)?i["string"==typeof e?"string":"hash"]:i.map};var Nt=function(t){var e=Ot(this,t).delete(t);return this.size-=e?1:0,e};var Wt=function(t){return Ot(this,t).get(t)};var zt=function(t){return Ot(this,t).has(t)};var Ht=function(t,e){var i=Ot(this,t),n=i.size;return i.set(t,e),this.size+=i.size==n?0:1,this};function Bt(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var n=t[e];this.set(n[0],n[1])}}Bt.prototype.clear=It,Bt.prototype.delete=Nt,Bt.prototype.get=Wt,Bt.prototype.has=zt,Bt.prototype.set=Ht;var jt=Bt;function Vt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var n=arguments,s=e?e.apply(this,n):n[0],a=i.cache;if(a.has(s))return a.get(s);var r=t.apply(this,n);return i.cache=a.set(s,r)||a,r};return i.cache=new(Vt.Cache||jt),i}Vt.Cache=jt;var Gt=Vt;var Ut=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qt=/\\(\\)?/g,Xt=function(t){var e=Gt(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ut,(function(t,i,n,s){e.push(n?s.replace(qt,"$1"):i||t)})),e}));var Yt=function(t,e){for(var i=-1,n=null==t?0:t.length,s=Array(n);++i<n;)s[i]=e(t[i],i,t);return s},Kt=O?O.prototype:void 0,Jt=Kt?Kt.toString:void 0;var Qt=function t(e){if("string"==typeof e)return e;if(L(e))return Yt(e,t)+"";if(X(e))return Jt?Jt.call(e):"";var i=e+"";return"0"==i&&1/e==-1/0?"-0":i};var Zt=function(t){return null==t?"":Qt(t)};var $t=function(t,e){return L(t)?t:J(t,e)?[t]:Xt(Zt(t))};var te=function(t){if("string"==typeof t||X(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var ee=function(t,e){for(var i=0,n=(e=$t(e,t)).length;null!=t&&i<n;)t=t[te(e[i++])];return i&&i==n?t:void 0},ie=function(){try{var t=ut(Object,"defineProperty");return t({},"",{}),t}catch(e){}}();var ne=function(t,e,i){"__proto__"==e&&ie?ie(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i},se=Object.prototype.hasOwnProperty;var ae=function(t,e,i){var n=t[e];se.call(t,e)&&Et(n,i)&&(void 0!==i||e in t)||ne(t,e,i)},re=/^(?:0|[1-9]\d*)$/;var oe=function(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&re.test(t))&&t>-1&&t%1==0&&t<e};var le=function(t,e,i,n){if(!Q(t))return t;for(var s=-1,a=(e=$t(e,t)).length,r=a-1,o=t;null!=o&&++s<a;){var l=te(e[s]),h=i;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(s!=r){var c=o[l];void 0===(h=n?n(c,l,o):void 0)&&(h=Q(c)?c:oe(e[s+1])?[]:{})}ae(o,l,h),o=o[l]}return t};var he=function(t,e,i){for(var n=-1,s=e.length,a={};++n<s;){var r=e[n],o=ee(t,r);i(o,r)&&le(a,$t(r,t),o)}return a};var ce=function(t,e){return null!=t&&e in Object(t)};var de=function(t){return q(t)&&"[object Arguments]"==U(t)},ue=Object.prototype,pe=ue.hasOwnProperty,fe=ue.propertyIsEnumerable,ge=de(function(){return arguments}())?de:function(t){return q(t)&&pe.call(t,"callee")&&!fe.call(t,"callee")};var me=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var ve=function(t,e,i){for(var n=-1,s=(e=$t(e,t)).length,a=!1;++n<s;){var r=te(e[n]);if(!(a=null!=t&&i(t,r)))break;t=t[r]}return a||++n!=s?a:!!(s=null==t?0:t.length)&&me(s)&&oe(r,s)&&(L(t)||ge(t))};var be=function(t,e){return null!=t&&ve(t,e,ce)};var we=function(t,e){return he(t,e,(function(e,i){return be(t,i)}))};var ye=function(t,e){for(var i=-1,n=e.length,s=t.length;++i<n;)t[s+i]=e[i];return t},Ae=O?O.isConcatSpreadable:void 0;var _e=function(t){return L(t)||ge(t)||!!(Ae&&t&&t[Ae])};var xe=function t(e,i,n,s,a){var r=-1,o=e.length;for(n||(n=_e),a||(a=[]);++r<o;){var l=e[r];i>0&&n(l)?i>1?t(l,i-1,n,s,a):ye(a,l):s||(a[a.length]=l)}return a};var Ee=function(t){return(null==t?0:t.length)?xe(t,1):[]};var ke=function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)},Me=Math.max;var Se=function(t,e,i){return e=Me(void 0===e?t.length-1:e,0),function(){for(var n=arguments,s=-1,a=Me(n.length-e,0),r=Array(a);++s<a;)r[s]=n[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=n[s];return o[e]=i(r),ke(t,this,o)}};var Ce=function(t){return function(){return t}};var Te=ie?function(t,e){return ie(t,"toString",{configurable:!0,enumerable:!1,value:Ce(e),writable:!0})}:function(t){return t},Re=Date.now;var Le=function(t){var e=0,i=0;return function(){var n=Re(),s=16-(n-i);if(i=n,s>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Te);var Pe=function(t){return Le(Se(t,void 0,Ee),t+"")}((function(t,e){return null==t?{}:we(t,e)}));const Fe=Gt((t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:a}=t;const r=a?0:["small","middle","large"].indexOf(s.size)>-1?8*(["small","middle","large"].indexOf(s.size)+1):Number.isInteger(s.size)?s.size:8;let o=0,l=0;for(;e>=l+n[o]+o*r&&o<n.length;)l+=n[o],o+=1;for(;e<l+(o-1)*r+(o<n.length?i+r:0)&&o>0;)l-=n[o-1],o-=1;return o}),(t=>{let{amountWidth:e,moreBtnWidth:i,buttonWidthList:n,spaceProps:s,compact:a}=t;return"".concat(e).concat(i).concat(n.join(",")).concat(Object.values(s).join(",")).concat(a&&a.toString())}));var Ie={"width-container":"_V58ju","hidden-container":"_XN3o6","hidden-inner":"_-depB","menu-list":"_juFTd"};const De=["list","more","compact","showLength","getPopupContainer","trigger"],Oe=["className","confirm","buttonComponent","tooltipProps"];(0,g.createWithIntlProvider)("zh-CN",C,"button-group")((t=>{const{formatMessage:e}=(0,g.useIntl)(),i=Object.assign({},{more:s().createElement(a.Button,null,e({id:"more"}),s().createElement(u,null))},t),{list:o,more:l,compact:h,showLength:c,getPopupContainer:d,trigger:p}=i,w=b(i,De),y=Pe(w,["size","split","align","style"]),[_,x]=(0,n.useState)(o.length&&1),E=Number.isInteger(c)?c:_,k=(0,r.A)((()=>{const t=S.current,e=C.current,i=M.current;if(!t)return;const s=t.querySelectorAll(".button-group-item");if(!s)return;if(0===s.length)return;const a=i.clientWidth,r=e.clientWidth,o=[].map.call(s,(t=>t.offsetWidth)),l=Fe({amountWidth:a,moreBtnWidth:r,buttonWidthList:o,spaceProps:y,compact:h});(0,n.startTransition)((()=>{x(l)}))})),M=(0,m.A)(k),S=(0,m.A)(k),C=(0,m.A)(k),T=o.slice(E),L=(t,e,i)=>{if("function"===typeof t)return t({key:e,className:f()("button-group-item",Ie["btn-item"])},{isDropdown:i});const{className:n,confirm:r,buttonComponent:o,tooltipProps:l}=t,h=b(t,Oe),c=r||h.message,d=o||(c?R:A),u=s().createElement(d,v({danger:c&&!1!==h.isDelete},Object.assign({},h,c&&(h.isModal||i)?{isModal:!0}:{}),{key:e,className:f()("button-group-item",n)}));return l?s().createElement(a.Tooltip,l,u):u},P=h?a.Space.Compact:a.Space;return s().createElement(s().Fragment,null,s().createElement("div",{className:Ie["width-container"],ref:M}),s().createElement("div",{className:Ie["hidden-container"]},s().createElement("div",{className:Ie["hidden-inner"],ref:C},l),s().createElement("div",{className:Ie["hidden-inner"],ref:S},s().createElement(P,y,o.map(L)))),s().createElement(P,y,o.slice(0,E).map(((t,e)=>L(t,e,!1))),T.length>0&&s().createElement(a.Dropdown,{getPopupContainer:d,trigger:p,rootClassName:Ie["menu-list"],menu:{items:T.map(((t,e)=>({key:e,label:L(t,e,!0)})))}},l)))}))},20816:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(82284);function s(t){var e=function(t,e){if("object"!=(0,n.A)(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,e||"default");if("object"!=(0,n.A)(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==(0,n.A)(e)?e:e+""}},36294:(t,e,i)=>{"use strict";i.d(e,{Ay:()=>a});var n=function(t,e,i){if(i||2===arguments.length)for(var n,s=0,a=e.length;s<a;s++)!n&&s in e||(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))},s=n(n(n(n(n(n(n(n(n(n(n(n(n(n(n(n(n(n([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function a(t,e){var i={};return s.forEach((function(n){var s=t[n];s&&(i[n]=e?function(t){return s(t,e(n))}:s)})),i}},36580:(t,e,i)=>{"use strict";i.d(e,{A:()=>H});var n,s=0,a=!1,r=!1,o="[iFrameSizer]",l=null,h=window.requestAnimationFrame,c=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),d={},u=null,p=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){y("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function f(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function g(t,e,i){t.addEventListener(e,i,!1)}function m(t,e,i){t.removeEventListener(e,i,!1)}function v(t){return o+"["+function(t){var e="Host page: "+t;return window.top!==window.self&&(e=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+t:"Nested host page: "+t),e}(t)+"]"}function b(t){return d[t]?d[t].log:a}function w(t,e){A("log",t,e,b(t))}function y(t,e){A("warn",t,e,!0)}function A(t,e,i,n){!0===n&&"object"===typeof window.console&&console[t](v(e),i)}function _(t){function e(){s("Height"),s("Width"),L((function(){R(_),S(E),f("onResized",_)}),_,"init")}function i(t){return"border-box"!==t.boxSizing?0:(t.paddingTop?parseInt(t.paddingTop,10):0)+(t.paddingBottom?parseInt(t.paddingBottom,10):0)}function n(t){return"border-box"!==t.boxSizing?0:(t.borderTopWidth?parseInt(t.borderTopWidth,10):0)+(t.borderBottomWidth?parseInt(t.borderBottomWidth,10):0)}function s(t){var e=Number(d[E]["max"+t]),i=Number(d[E]["min"+t]),n=t.toLowerCase(),s=Number(_[n]);w(E,"Checking "+n+" is in range "+i+"-"+e),s<i&&(s=i,w(E,"Set "+n+" to min value")),s>e&&(s=e,w(E,"Set "+n+" to max value")),_[n]=""+s}function a(t){return v.slice(v.indexOf(":")+7+t)}function r(t,e){var i,n,s;i=function(){P("Send Page Info","pageInfo:"+function(){var t=document.body.getBoundingClientRect(),e=_.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:e.height,iframeWidth:e.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(e.top-t.top,10),offsetLeft:parseInt(e.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}(),t,e)},n=32,O[s=e]||(O[s]=setTimeout((function(){O[s]=null,i()}),n))}function h(t){var e=t.getBoundingClientRect();return M(E),{x:Math.floor(Number(e.left)+Number(l.x)),y:Math.floor(Number(e.top)+Number(l.y))}}function c(t){var e=t?h(_.iframe):{x:0,y:0},i={x:Number(_.width)+e.x,y:Number(_.height)+e.y};w(E,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top===window.self?(l=i,u(),w(E,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](i.x,i.y):y(E,"Unable to scroll to requested position, window.parentIFrame not found")}function u(){!1===f("onScroll",l)?C():S(E)}function p(t){var e={};if(0===Number(_.width)&&0===Number(_.height)){var i=a(9).split(":");e={x:i[1],y:i[0]}}else e={x:_.width,y:_.height};f(t,{iframe:_.iframe,screenX:Number(e.x),screenY:Number(e.y),type:_.type})}function f(t,e){return x(E,t,e)}var v=t.data,_={},E=null;"[iFrameResizerChild]Ready"===v?function(){for(var t in d)P("iFrame requested init",F(t),d[t].iframe,t)}():o===(""+v).slice(0,13)&&v.slice(13).split(":")[0]in d?(_=function(){var t=v.slice(13).split(":"),e=t[1]?parseInt(t[1],10):0,s=d[t[0]]&&d[t[0]].iframe,a=getComputedStyle(s);return{iframe:s,id:t[0],height:e+i(a)+n(a),width:t[2],type:t[3]}}(),E=_.id,d[E]&&(d[E].loaded=!0),!function(){var t=_.type in{true:1,false:1,undefined:1};return t&&w(E,"Ignoring init message from meta parent page"),t}()&&function(t){var e=!0;return d[t]||(e=!1,y(_.type+" No settings for "+t+". Message was: "+v)),e}(E)&&(w(E,"Received: "+v),function(){var t=!0;return null===_.iframe&&(y(E,"IFrame ("+_.id+") not found"),t=!1),t}()&&function(){var e=t.origin,i=d[E]&&d[E].checkOrigin;if(i&&""+e!=="null"&&!(i.constructor===Array?function(){var t=0,n=!1;for(w(E,"Checking connection is from allowed list of origins: "+i);t<i.length;t++)if(i[t]===e){n=!0;break}return n}():function(){var t=d[E]&&d[E].remoteHost;return w(E,"Checking connection is from: "+t),e===t}()))throw new Error("Unexpected message received from: "+e+" for "+_.iframe.id+". Message was: "+t.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(d[E]&&d[E].firstRun&&d[E]&&(d[E].firstRun=!1),_.type){case"close":k(_.iframe);break;case"message":t=a(6),w(E,"onMessage passed: {iframe: "+_.iframe.id+", message: "+t+"}"),f("onMessage",{iframe:_.iframe,message:JSON.parse(t)}),w(E,"--");break;case"mouseenter":p("onMouseEnter");break;case"mouseleave":p("onMouseLeave");break;case"autoResize":d[E].autoResize=JSON.parse(a(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":r(d[E]&&d[E].iframe,E),function(){function t(t,n){function s(){d[i]?r(d[i].iframe,i):e()}["scroll","resize"].forEach((function(e){w(i,t+e+" listener for sendPageInfo"),n(window,e,s)}))}function e(){t("Remove ",m)}var i=E;t("Add ",g),d[i]&&(d[i].stopPageInfo=e)}();break;case"pageInfoStop":d[E]&&d[E].stopPageInfo&&(d[E].stopPageInfo(),delete d[E].stopPageInfo);break;case"inPageLink":!function(t){var e=t.split("#")[1]||"",i=decodeURIComponent(e),n=document.getElementById(i)||document.getElementsByName(i)[0];n?function(){var t=h(n);w(E,"Moving to in page link (#"+e+") at x: "+t.x+" y: "+t.y),l={x:t.x,y:t.y},u(),w(E,"--")}():window.top===window.self?w(E,"In page link #"+e+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(e):w(E,"In page link #"+e+" not found and window.parentIFrame not found")}(a(9));break;case"reset":T(_);break;case"init":e(),f("onInit",_.iframe);break;default:0===Number(_.width)&&0===Number(_.height)?y("Unsupported message received ("+_.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):e()}var t}())):function(t,e){A("info",t,e,b(t))}(E,"Ignored: "+v)}function x(t,e,i){var n=null,s=null;if(d[t]){if("function"!==typeof(n=d[t][e]))throw new TypeError(e+" on iFrame["+t+"] is not a function");s=n(i)}return s}function E(t){var e=t.id;delete d[e]}function k(t){var e=t.id;if(!1!==x(e,"onClose",e)){w(e,"Removing iFrame: "+e);try{t.parentNode&&t.parentNode.removeChild(t)}catch(i){y(i)}x(e,"onClosed",e),w(e,"--"),E(t),n&&(n.disconnect(),n=null)}else w(e,"Close iframe cancelled by onClose event")}function M(t){null===l&&w(t,"Get page position: "+(l={x:void 0===window.pageXOffset?document.documentElement.scrollLeft:window.pageXOffset,y:void 0===window.pageYOffset?document.documentElement.scrollTop:window.pageYOffset}).x+","+l.y)}function S(t){null!==l&&(window.scrollTo(l.x,l.y),w(t,"Set page position: "+l.x+","+l.y),C())}function C(){l=null}function T(t){w(t.id,"Size reset requested by "+("init"===t.type?"host page":"iFrame")),M(t.id),L((function(){R(t),P("reset","reset",t.iframe,t.id)}),t,"reset")}function R(t){function e(e){r||"0"!==t[e]||(r=!0,w(n,"Hidden iFrame detected, creating visibility listener"),function(){function t(){function t(t){function e(e){return"0px"===(d[t]&&d[t].iframe.style[e])}function i(t){return null!==t.offsetParent}d[t]&&i(d[t].iframe)&&(e("height")||e("width"))&&P("Visibility change","resize",d[t].iframe,t)}Object.keys(d).forEach((function(e){t(e)}))}function e(e){w("window","Mutation observed: "+e[0].target+" "+e[0].type),D(t,16)}function i(){var t=document.querySelector("body"),i={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0};new n(e).observe(t,i)}var n=f();n&&i()}())}function i(i){!function(e){t.id?(t.iframe.style[e]=t[e]+"px",w(t.id,"IFrame ("+n+") "+e+" set to "+t[e]+"px")):w("undefined","messageData id not set")}(i),e(i)}var n=t.iframe.id;d[n]&&(d[n].sizeHeight&&i("height"),d[n].sizeWidth&&i("width"))}function L(t,e,i){i!==e.type&&h&&!window.jasmine?(w(e.id,"Requesting animation frame"),h(t)):t()}function P(t,e,i,n,s){var a=!1;n=n||i.id,d[n]&&(i&&"contentWindow"in i&&null!==i.contentWindow?function(){var s=d[n]&&d[n].targetOrigin;w(n,"["+t+"] Sending msg to iframe["+n+"] ("+e+") targetOrigin: "+s),i.contentWindow.postMessage(o+e,s)}():y(n,"["+t+"] IFrame("+n+") not found"),s&&d[n]&&d[n].warningTimeout&&(d[n].msgTimeout=setTimeout((function(){!d[n]||d[n].loaded||a||(a=!0,y(n,"IFrame has not responded within "+d[n].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),d[n].warningTimeout)))}function F(t){return t+":"+d[t].bodyMarginV1+":"+d[t].sizeWidth+":"+d[t].log+":"+d[t].interval+":"+d[t].enablePublicMethods+":"+d[t].autoResize+":"+d[t].bodyMargin+":"+d[t].heightCalculationMethod+":"+d[t].bodyBackground+":"+d[t].bodyPadding+":"+d[t].tolerance+":"+d[t].inPageLinks+":"+d[t].resizeFrom+":"+d[t].widthCalculationMethod+":"+d[t].mouseEvents}function I(t,e){function i(t){var e=t.split("Callback");if(2===e.length){var i="on"+e[0].charAt(0).toUpperCase()+e[0].slice(1);this[i]=this[t],delete this[t],y(r,"Deprecated: '"+t+"' has been renamed '"+i+"'. The old method will be removed in the next major version.")}}var r=function(i){if("string"!==typeof i)throw new TypeError("Invaild id for iFrame. Expected String");return""===i&&(t.id=i=function(){var t=e&&e.id||p.id+s++;return null!==document.getElementById(t)&&(t+=s++),t}(),a=(e||{}).log,w(i,"Added missing iframe ID: "+i+" ("+t.src+")")),i}(t.id);r in d&&"iFrameResizer"in t?y(r,"Ignored iFrame, already setup."):(!function(e){var n;e=e||{},d[r]=Object.create(null),d[r].iframe=t,d[r].firstRun=!0,d[r].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(t){if("object"!==typeof t)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(i,e),function(t){for(var e in p)Object.prototype.hasOwnProperty.call(p,e)&&(d[r][e]=Object.prototype.hasOwnProperty.call(t,e)?t[e]:p[e])}(e),d[r]&&(d[r].targetOrigin=!0===d[r].checkOrigin?""===(n=d[r].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(e),function(){switch(w(r,"IFrame scrolling "+(d[r]&&d[r].scrolling?"enabled":"disabled")+" for "+r),t.style.overflow=!1===(d[r]&&d[r].scrolling)?"hidden":"auto",d[r]&&d[r].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=d[r]?d[r].scrolling:"no"}}(),function(){function e(e){var i=d[r][e];1/0!==i&&0!==i&&(t.style[e]="number"===typeof i?i+"px":i,w(r,"Set "+e+" = "+t.style[e]))}function i(t){if(d[r]["min"+t]>d[r]["max"+t])throw new Error("Value for min"+t+" can not be greater than max"+t)}i("Height"),i("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!==typeof(d[r]&&d[r].bodyMargin)&&"0"!==(d[r]&&d[r].bodyMargin)||(d[r].bodyMarginV1=d[r].bodyMargin,d[r].bodyMargin=d[r].bodyMargin+"px"),function(e){var i=f();i&&(n=function(e){if(!t.parentNode)return null;var i=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&k(t)}))}))}));return i.observe(t.parentNode,{childList:!0}),i}(i)),g(t,"load",(function(){P("iFrame.onload",e,t,void 0,!0),function(){var e=d[r]&&d[r].firstRun,i=d[r]&&d[r].heightCalculationMethod in c;!e&&i&&T({iframe:t,height:0,width:0,type:"init"})}()})),P("init",e,t,void 0,!0)}(F(r)),d[r]&&(d[r].iframe.iFrameResizer={close:k.bind(null,d[r].iframe),removeListeners:E.bind(null,d[r].iframe),resize:P.bind(null,"Window resize","resize",d[r].iframe),moveToAnchor:function(t){P("Move to anchor","moveToAnchor:"+t,d[r].iframe,r)},sendMessage:function(t){P("Send Message","message:"+(t=JSON.stringify(t)),d[r].iframe,r)}}))}function D(t,e){null===u&&(u=setTimeout((function(){u=null,t()}),e))}var O={};function N(){"hidden"!==document.visibilityState&&(w("document","Trigger event: Visibility change"),D((function(){W("Tab Visible","resize")}),16))}function W(t,e){Object.keys(d).forEach((function(i){(function(t){return d[t]&&"parent"===d[t].resizeFrom&&d[t].autoResize&&!d[t].firstRun})(i)&&P(t,e,d[i].iframe,i)}))}function z(){g(window,"message",_),g(window,"resize",(function(){var t;w("window","Trigger event: "+(t="resize")),D((function(){W("Window "+t,"resize")}),16)})),g(document,"visibilitychange",N),g(document,"-webkit-visibilitychange",N)}var H=function(){function t(t,i){i&&(!function(){if(!i.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==i.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+i.tagName+">")}(),I(i,t),e.push(i))}var e;return function(){var t,e=["moz","webkit","o","ms"];for(t=0;t<e.length&&!h;t+=1)h=window[e[t]+"RequestAnimationFrame"];h?h=h.bind(window):w("setup","RequestAnimationFrame not supported")}(),z(),function(i,n){switch(e=[],function(t){t&&t.enablePublicMethods&&y("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof n){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(n||"iframe"),t.bind(void 0,i));break;case"object":t(i,n);break;default:throw new TypeError("Unexpected data type ("+typeof n+")")}return e}}()},41481:()=>{},42166:(t,e,i)=>{"use strict";i.d(e,{A:()=>a});var n=i(94922);function s(t,e){switch(e.type){case"RESOLVE":return{value:e.value,error:void 0};case"REJECT":return{value:!1,error:e.error};case"RESET":return{value:void 0,error:void 0};default:return t}}function a(){return(0,n.useReducer)(s,{value:void 0,error:void 0})}},42461:(t,e,i)=>{"use strict";i.d(e,{Bd:()=>a,UT:()=>v,ci:()=>o,h1:()=>b,jA:()=>d,mZ:()=>u,mw:()=>l,qC:()=>f,qf:()=>h,vS:()=>m,xL:()=>g,zL:()=>c});var n=i(64288),s=i(98677);const a="undefined"!==typeof window,r=a&&"file:"===window.location.protocol;function o(t){return function(t){return"undefined"!==typeof t}(t)&&null!==t}function l(t){return t instanceof ArrayBuffer}function h(t){return(0,n.A)(a,"isBlob can only be used in a browser environment"),t instanceof Blob}function c(t){return function(t){return"string"===typeof t}(t)&&/^data:/.test(t)}function d(t){(0,n.A)(c(t),"Invalid data URI.");const[e="",i=""]=t.split(",");return-1!==e.split(";").indexOf("base64")?atob(i):unescape(i)}function u(){return a&&window.devicePixelRatio||1}const p="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function f(){s(!r,"Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ".concat(p))}function g(t){(null===t||void 0===t?void 0:t.cancel)&&t.cancel()}function m(t,e){return Object.defineProperty(t,"width",{get(){return this.view[2]*e},configurable:!0}),Object.defineProperty(t,"height",{get(){return this.view[3]*e},configurable:!0}),Object.defineProperty(t,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(t,"originalHeight",{get(){return this.view[3]},configurable:!0}),t}function v(t){return"RenderingCancelledException"===t.name}function b(t){return new Promise(((e,i)=>{const n=new FileReader;n.onload=()=>{if(!n.result)return i(new Error("Error while reading a file."));e(n.result)},n.onerror=t=>{if(!t.target)return i(new Error("Error while reading a file."));const{error:e}=t.target;if(!e)return i(new Error("Error while reading a file."));switch(e.code){case e.NOT_FOUND_ERR:return i(new Error("Error while reading a file: File not found."));case e.SECURITY_ERR:return i(new Error("Error while reading a file: Security error."));case e.ABORT_ERR:return i(new Error("Error while reading a file: Aborted."));default:return i(new Error("Error while reading a file."))}},n.readAsArrayBuffer(t)}))}},45816:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M820 436h-40c-4.4 0-8 3.6-8 8v40c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-40c0-4.4-3.6-8-8-8zm32-104H732V120c0-4.4-3.6-8-8-8H300c-4.4 0-8 3.6-8 8v212H172c-44.2 0-80 35.8-80 80v328c0 17.7 14.3 32 32 32h168v132c0 4.4 3.6 8 8 8h424c4.4 0 8-3.6 8-8V772h168c17.7 0 32-14.3 32-32V412c0-44.2-35.8-80-80-80zM360 180h304v152H360V180zm304 664H360V568h304v276zm200-140H732V500H292v204H160V412c0-6.6 5.4-12 12-12h680c6.6 0 12 5.4 12 12v292z"}}]},name:"printer",theme:"outlined"};var r=i(80036);const o=s.forwardRef((function(t,e){return s.createElement(r.A,(0,n.A)({},t,{ref:e,icon:a}))}))},47215:(t,e,i)=>{"use strict";function n(t){var e,i,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t)if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(i=n(t[e]))&&(s&&(s+=" "),s+=i)}else for(i in t)t[i]&&(s&&(s+=" "),s+=i);return s}i.d(e,{A:()=>s});const s=function(){for(var t,e,i=0,s="",a=arguments.length;i<a;i++)(t=arguments[i])&&(e=n(t))&&(s&&(s+=" "),s+=e);return s}},50805:(t,e,i)=>{"use strict";i.d(e,{A:()=>h});var n=i(94922),s=i(98771),a=i.n(s),r=i(95600),o=i.n(r),l=i(78678);const h=(t,e)=>{const i=(0,n.useRef)(null);i.current=Object.assign({},{time:500,isDebounce:!1},e);const s=(0,n.useRef)(null),r=(0,l.A)(t);return(0,n.useLayoutEffect)((()=>{const t=s.current,e=()=>window.requestAnimationFrame((()=>{t&&r(t)}));e();const n=new ResizeObserver((i.current.isDebounce?o():a())(e,i.current.time));return t&&n.observe(t),()=>{n.disconnect()}}),[r]),s}},51938:(t,e,i)=>{"use strict";i.d(e,{dU:()=>rf,ng:()=>of,EA:()=>lf,Tm:()=>hf,D6:()=>cf,YE:()=>df});var n=i(89379);function s(t,e,i){e||(e=[]);var n=e.length++;return Object.defineProperty({},"_",{set:function(s){e[n]=s,t.apply(i,e)}})}var a=i(53986);function r(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function o(t,e){r(t,e),e.add(t)}function l(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}function h(t,e,i){return i(l(t,e))}var c=i(64467);function d(t,e,i){r(t,e),e.set(t,i)}function u(t,e){return t.get(l(t,e))}function p(t,e,i){return t.set(l(t,e),i),i}const f=["textContentSource","container","viewport"];var g,m,v,b,w,y,A,_,x,E,k,M,S={d:(t,e)=>{for(var i in e)S.o(e,i)&&!S.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},C=globalThis.pdfjsLib={};S.d(C,{AbortException:()=>Ht,AnnotationEditorLayer:()=>Vp,AnnotationEditorParamsType:()=>j,AnnotationEditorType:()=>B,AnnotationEditorUIManager:()=>Fn,AnnotationLayer:()=>ec,AnnotationMode:()=>H,CMapCompressionType:()=>At,ColorPicker:()=>Td,DOMSVGFactory:()=>Ne,DrawLayer:()=>ef,FeatureTest:()=>Gt,GlobalWorkerOptions:()=>Ua,ImageKind:()=>J,InvalidPDFException:()=>Ot,MissingPDFException:()=>Nt,OPS:()=>_t,Outliner:()=>Rc,PDFDataRangeTransport:()=>jo,PDFDateString:()=>Ke,PDFWorker:()=>el,PasswordResponses:()=>xt,PermissionFlag:()=>V,PixelsPerInch:()=>ge,RenderingCancelledException:()=>ze,TextLayer:()=>wo,UnexpectedResponseException:()=>Wt,Util:()=>qt,VerbosityLevel:()=>yt,XfaLayer:()=>Cl,build:()=>El,createValidAbsoluteUrl:()=>Lt,fetchData:()=>Ie,getDocument:()=>Wo,getFilenameFromUrl:()=>je,getPdfFilenameFromUrl:()=>Ve,getXfaPageViewport:()=>Je,isDataScheme:()=>He,isPdfFile:()=>Be,noContextMenu:()=>qe,normalizeUnicode:()=>Qt,renderTextLayer:()=>Ro,setLayerDimensions:()=>ti,shadow:()=>Pt,updateTextLayer:()=>Lo,version:()=>xl});const T="object"===typeof process&&process+""==="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&"browser"!==process.type),R=[1,0,0,1,0,0],L=[.001,0,0,.001,0,0],P=1.35,F=1,I=2,D=4,O=16,N=32,W=64,z=256,H={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},B={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},j={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},V={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},G=0,U=1,q=2,X=3,Y=3,K=4,J={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Q=1,Z=2,$=3,tt=4,et=5,it=6,nt=7,st=8,at=9,rt=10,ot=11,lt=12,ht=13,ct=14,dt=15,ut=16,pt=17,ft=20,gt=1,mt=2,vt=3,bt=4,wt=5,yt={ERRORS:0,WARNINGS:1,INFOS:5},At={NONE:0,BINARY:1},_t={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},xt={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let Et=yt.WARNINGS;function kt(t){Number.isInteger(t)&&(Et=t)}function Mt(){return Et}function St(t){Et>=yt.INFOS&&console.log("Info: ".concat(t))}function Ct(t){Et>=yt.WARNINGS&&console.log("Warning: ".concat(t))}function Tt(t){throw new Error(t)}function Rt(t,e){t||Tt(e)}function Lt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(i&&"string"===typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);(null===e||void 0===e?void 0:e.length)>=2&&(t="http://".concat(t))}if(i.tryConvertEncoding)try{t=decodeURIComponent(escape(t))}catch(n){}}const s=e?new URL(t,e):new URL(t);if(function(t){switch(null===t||void 0===t?void 0:t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(s))return s}catch(s){}return null}function Pt(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object.defineProperty(t,e,{value:i,enumerable:!n,configurable:!0,writable:!1}),i}const Ft=function(){function t(e,i){this.constructor===t&&Tt("Cannot initialize BaseException."),this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();class It extends Ft{constructor(t,e){super(t,"PasswordException"),this.code=e}}class Dt extends Ft{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}}class Ot extends Ft{constructor(t){super(t,"InvalidPDFException")}}class Nt extends Ft{constructor(t){super(t,"MissingPDFException")}}class Wt extends Ft{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}}class zt extends Ft{constructor(t){super(t,"FormatError")}}class Ht extends Ft{constructor(t){super(t,"AbortException")}}function Bt(t){"object"===typeof t&&void 0!==(null===t||void 0===t?void 0:t.length)||Tt("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const n=[];for(let s=0;s<e;s+=i){const a=Math.min(s+i,e),r=t.subarray(s,a);n.push(String.fromCharCode.apply(null,r))}return n.join("")}function jt(t){"string"!==typeof t&&Tt("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let n=0;n<e;++n)i[n]=255&t.charCodeAt(n);return i}function Vt(t){const e=Object.create(null);for(const[i,n]of t)e[i]=n;return e}class Gt{static get isLittleEndian(){return Pt(this,"isLittleEndian",function(){const t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return Pt(this,"isEvalSupported",function(){try{return new Function(""),!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return Pt(this,"isOffscreenCanvasSupported","undefined"!==typeof OffscreenCanvas)}static get platform(){var t;return"undefined"!==typeof navigator&&"string"===typeof(null===(t=navigator)||void 0===t?void 0:t.platform)?Pt(this,"platform",{isMac:navigator.platform.includes("Mac")}):Pt(this,"platform",{isMac:!1})}static get isCSSRoundSupported(){var t,e;return Pt(this,"isCSSRoundSupported",null===(t=globalThis.CSS)||void 0===t||null===(e=t.supports)||void 0===e?void 0:e.call(t,"width: round(1.5px, 1px)"))}}const Ut=Array.from(Array(256).keys(),(t=>t.toString(16).padStart(2,"0")));class qt{static makeHexColor(t,e,i){return"#".concat(Ut[t]).concat(Ut[e]).concat(Ut[i])}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),n=this.applyTransform(t.slice(2,4),e),s=this.applyTransform([t[0],t[3]],e),a=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],n[0],s[0],a[0]),Math.min(i[1],n[1],s[1],a[1]),Math.max(i[0],n[0],s[0],a[0]),Math.max(i[1],n[1],s[1],a[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],n=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],a=t[2]*e[1]+t[3]*e[3],r=(i+a)/2,o=Math.sqrt((i+a)**2-4*(i*a-s*n))/2,l=r+o||1,h=r-o||1;return[Math.sqrt(l),Math.sqrt(h)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),n=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>n)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>a?null:[i,s,n,a]}static bezierBoundingBox(t,e,i,n,s,a,r,o,h){return h?(h[0]=Math.min(h[0],t,r),h[1]=Math.min(h[1],e,o),h[2]=Math.max(h[2],t,r),h[3]=Math.max(h[3],e,o)):h=[Math.min(t,r),Math.min(e,o),Math.max(t,r),Math.max(e,o)],l(qt,this,Yt).call(this,t,i,s,r,e,n,a,o,3*(3*(i-s)-t+r),6*(t-2*i+s),3*(i-t),h),l(qt,this,Yt).call(this,t,i,s,r,e,n,a,o,3*(3*(n-a)-e+o),6*(e-2*n+a),3*(n-e),h),h}}function Xt(t,e,i,n,s,a,r,o,l,h){if(l<=0||l>=1)return;const c=1-l,d=l*l,u=d*l,p=c*(c*(c*t+3*l*e)+3*d*i)+u*n,f=c*(c*(c*s+3*l*a)+3*d*r)+u*o;h[0]=Math.min(h[0],p),h[1]=Math.min(h[1],f),h[2]=Math.max(h[2],p),h[3]=Math.max(h[3],f)}function Yt(t,e,i,n,s,a,r,o,h,c,d,u){if(Math.abs(h)<1e-12)return void(Math.abs(c)>=1e-12&&l(g,this,Xt).call(this,t,e,i,n,s,a,r,o,-d/c,u));const p=c**2-4*d*h;if(p<0)return;const f=Math.sqrt(p),m=2*h;l(g,this,Xt).call(this,t,e,i,n,s,a,r,o,(-c+f)/m,u),l(g,this,Xt).call(this,t,e,i,n,s,a,r,o,(-c-f)/m,u)}g=qt;let Kt=null,Jt=null;function Qt(t){return Kt||(Kt=/([\xA0\xB5\u037E\u0EB3\u2000-\u200A\u202F\u2126\uFB00-\uFB04\uFB06\uFB20-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBA1\uFBA4-\uFBA9\uFBAE-\uFBB1\uFBD3-\uFBDC\uFBDE-\uFBE7\uFBEA-\uFBF8\uFBFC\uFBFD\uFC00-\uFC5D\uFC64-\uFCF1\uFCF5-\uFD3D\uFD88\uFDF4\uFDFA\uFDFB\uFE71\uFE77\uFE79\uFE7B\uFE7D]+)|(\uFB05+)/g,Jt=new Map([["\ufb05","\u017ft"]])),t.replaceAll(Kt,((t,e,i)=>e?e.normalize("NFKC"):Jt.get(i)))}const Zt="pdfjs_internal_id_",$t=0,te=1,ee=2,ie=3,ne=4,se=5,ae=6,re=7,oe=8;class le{constructor(){this.constructor===le&&Tt("Cannot initialize BaseFilterFactory.")}addFilter(t){return"none"}addHCMFilter(t,e){return"none"}addAlphaFilter(t){return"none"}addLuminosityFilter(t){return"none"}addHighlightHCMFilter(t,e,i,n,s){return"none"}destroy(){}}var he=new WeakMap;class ce{constructor(){let{enableHWA:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(this,he,!1),this.constructor===ce&&Tt("Cannot initialize BaseCanvasFactory."),p(he,this,t)}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d",{willReadFrequently:!u(he,this)})}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e,t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0,t.canvas.height=0,t.canvas=null,t.context=null}_createCanvas(t,e){Tt("Abstract method `_createCanvas` called.")}}class de{constructor(t){let{baseUrl:e=null,isCompressed:i=!0}=t;this.constructor===de&&Tt("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=e,this.isCompressed=i}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":""),n=this.isCompressed?At.BINARY:At.NONE;return this._fetchData(i,n).catch((t=>{throw new Error("Unable to load ".concat(this.isCompressed?"binary ":"","CMap at: ").concat(i))}))}_fetchData(t,e){Tt("Abstract method `_fetchData` called.")}}class ue{constructor(t){let{baseUrl:e=null}=t;this.constructor===ue&&Tt("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const i="".concat(this.baseUrl).concat(e);return this._fetchData(i).catch((t=>{throw new Error("Unable to load font data at: ".concat(i))}))}_fetchData(t){Tt("Abstract method `_fetchData` called.")}}class pe{constructor(){this.constructor===pe&&Tt("Cannot initialize BaseSVGFactory.")}create(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),i||(n.setAttribute("width","".concat(t,"px")),n.setAttribute("height","".concat(e,"px"))),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox","0 0 ".concat(t," ").concat(e)),n}createElement(t){if("string"!==typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){Tt("Abstract method `_createSVG` called.")}}const fe="http://www.w3.org/2000/svg";class ge{}m=ge,(0,c.A)(ge,"CSS",96),(0,c.A)(ge,"PDF",72),(0,c.A)(ge,"PDF_TO_CSS_UNITS",m.CSS/m.PDF);var me=new WeakMap,ve=new WeakMap,be=new WeakMap,we=new WeakMap,ye=new WeakMap,Ae=new WeakMap,_e=new WeakSet;function xe(t){return u(me,t)||p(me,t,new Map)}function Ee(t){return u(ye,t)||p(ye,t,new Map)}function ke(t){if(!u(ve,t)){const e=u(we,t).createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const n=u(we,t).createElementNS(fe,"svg");n.setAttribute("width",0),n.setAttribute("height",0),p(ve,t,u(we,t).createElementNS(fe,"defs")),e.append(n),n.append(u(ve,t)),u(we,t).body.append(e)}return u(ve,t)}function Me(t){if(1===t.length){const e=t[0],i=new Array(256);for(let t=0;t<256;t++)i[t]=e[t]/255;const n=i.join(",");return[n,n,n]}const[e,i,n]=t,s=new Array(256),a=new Array(256),r=new Array(256);for(let o=0;o<256;o++)s[o]=e[o]/255,a[o]=i[o]/255,r[o]=n[o]/255;return[s.join(","),a.join(","),r.join(",")]}function Se(t){const e=u(we,this).createElementNS(fe,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)}function Ce(t){const e=u(we,this).createElementNS(fe,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)}function Te(t){const e=u(we,this).createElementNS(fe,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),h(_e,this,ke).append(e),e}function Re(t,e,i){const n=u(we,this).createElementNS(fe,e);n.setAttribute("type","discrete"),n.setAttribute("tableValues",i),t.append(n)}function Le(t,e,i,n){const s=u(we,this).createElementNS(fe,"feComponentTransfer");n.append(s),l(_e,this,Re).call(this,s,"feFuncR",t),l(_e,this,Re).call(this,s,"feFuncG",e),l(_e,this,Re).call(this,s,"feFuncB",i)}function Pe(t,e){const i=u(we,this).createElementNS(fe,"feComponentTransfer");e.append(i),l(_e,this,Re).call(this,i,"feFuncA",t)}function Fe(t){return h(_e,this,ke).style.color=t,Qe(getComputedStyle(h(_e,this,ke)).getPropertyValue("color"))}async function Ie(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";if(Ue(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise(((i,n)=>{const s=new XMLHttpRequest;s.open("GET",t,!0),s.responseType=e,s.onreadystatechange=()=>{if(s.readyState===XMLHttpRequest.DONE)if(200!==s.status&&0!==s.status)n(new Error(s.statusText));else{switch(e){case"arraybuffer":case"blob":case"json":return void i(s.response)}i(s.responseText)}},s.send(null)}))}class De extends de{_fetchData(t,e){return Ie(t,this.isCompressed?"arraybuffer":"text").then((t=>({cMapData:t instanceof ArrayBuffer?new Uint8Array(t):jt(t),compressionType:e})))}}class Oe extends ue{_fetchData(t){return Ie(t,"arraybuffer").then((t=>new Uint8Array(t)))}}class Ne extends pe{_createSVG(t){return document.createElementNS(fe,t)}}class We{constructor(t){let{viewBox:e,scale:i,rotation:n,offsetX:s=0,offsetY:a=0,dontFlip:r=!1}=t;this.viewBox=e,this.scale=i,this.rotation=n,this.offsetX=s,this.offsetY=a;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let h,c,d,u,p,f,g,m;switch(n%=360,n<0&&(n+=360),n){case 180:h=-1,c=0,d=0,u=1;break;case 90:h=0,c=1,d=1,u=0;break;case 270:h=0,c=-1,d=-1,u=0;break;case 0:h=1,c=0,d=0,u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}r&&(d=-d,u=-u),0===h?(p=Math.abs(l-e[1])*i+s,f=Math.abs(o-e[0])*i+a,g=(e[3]-e[1])*i,m=(e[2]-e[0])*i):(p=Math.abs(o-e[0])*i+s,f=Math.abs(l-e[1])*i+a,g=(e[2]-e[0])*i,m=(e[3]-e[1])*i),this.transform=[h*i,c*i,d*i,u*i,p-h*i*o-d*i*l,f-c*i*o-u*i*l],this.width=g,this.height=m}get rawDims(){const{viewBox:t}=this;return Pt(this,"rawDims",{pageWidth:t[2]-t[0],pageHeight:t[3]-t[1],pageX:t[0],pageY:t[1]})}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:n=this.offsetY,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new We({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}convertToViewportPoint(t,e){return qt.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=qt.applyTransform([t[0],t[1]],this.transform),i=qt.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return qt.applyInverseTransform([t,e],this.transform)}}class ze extends Ft{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t,"RenderingCancelledException"),this.extraDelay=e}}function He(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}function Be(t){return"string"===typeof t&&/\.pdf$/i.test(t)}function je(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function Ve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!==typeof t)return e;if(He(t))return Ct('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(t);let s=i.exec(n[1])||i.exec(n[2])||i.exec(n[3]);if(s&&(s=s[0],s.includes("%")))try{s=i.exec(decodeURIComponent(s))[0]}catch(a){}return s||e}class Ge{constructor(){(0,c.A)(this,"started",Object.create(null)),(0,c.A)(this,"times",[])}time(t){t in this.started&&Ct("Timer is already running for ".concat(t)),this.started[t]=Date.now()}timeEnd(t){t in this.started||Ct("Timer has not been started for ".concat(t)),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t]}toString(){const t=[];let e=0;for(const{name:i}of this.times)e=Math.max(i.length,e);for(const{name:i,start:n,end:s}of this.times)t.push("".concat(i.padEnd(e)," ").concat(s-n,"ms\n"));return t.join("")}}function Ue(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch(i){return!1}}function qe(t){t.preventDefault()}function Xe(t){console.log("Deprecated API usage: "+t)}let Ye;class Ke{static toDateObject(t){if(!t||"string"!==typeof t)return null;Ye||(Ye=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=Ye.exec(t);if(!e)return null;const i=parseInt(e[1],10);let n=parseInt(e[2],10);n=n>=1&&n<=12?n-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let a=parseInt(e[4],10);a=a>=0&&a<=23?a:0;let r=parseInt(e[5],10);r=r>=0&&r<=59?r:0;let o=parseInt(e[6],10);o=o>=0&&o<=59?o:0;const l=e[7]||"Z";let h=parseInt(e[8],10);h=h>=0&&h<=23?h:0;let c=parseInt(e[9],10)||0;return c=c>=0&&c<=59?c:0,"-"===l?(a+=h,r+=c):"+"===l&&(a-=h,r-=c),new Date(Date.UTC(i,n,s,a,r,o))}}function Je(t,e){let{scale:i=1,rotation:n=0}=e;const{width:s,height:a}=t.attributes.style,r=[0,0,parseInt(s),parseInt(a)];return new We({viewBox:r,scale:i,rotation:n})}function Qe(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map((t=>parseInt(t))):t.startsWith("rgba(")?t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3):(Ct('Not a valid color format: "'.concat(t,'"')),[0,0,0])}function Ze(t){const{a:e,b:i,c:n,d:s,e:a,f:r}=t.getTransform();return[e,i,n,s,a,r]}function $e(t){const{a:e,b:i,c:n,d:s,e:a,f:r}=t.getTransform().invertSelf();return[e,i,n,s,a,r]}function ti(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(e instanceof We){const{pageWidth:n,pageHeight:s}=e.rawDims,{style:a}=t,r=Gt.isCSSRoundSupported,o="var(--scale-factor) * ".concat(n,"px"),l="var(--scale-factor) * ".concat(s,"px"),h=r?"round(".concat(o,", 1px)"):"calc(".concat(o,")"),c=r?"round(".concat(l,", 1px)"):"calc(".concat(l,")");i&&e.rotation%180!==0?(a.width=c,a.height=h):(a.width=h,a.height=c)}n&&t.setAttribute("data-main-rotation",e.rotation)}var ei=new WeakMap,ii=new WeakMap,ni=new WeakMap,si=new WeakMap,ai=new WeakSet;class ri{constructor(t){o(this,ai),d(this,ei,null),d(this,ii,null),d(this,ni,void 0),d(this,si,null),p(ni,this,t)}render(){const t=p(ei,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar");const e=u(ni,this)._uiManager._signal;t.addEventListener("contextmenu",qe,{signal:e}),t.addEventListener("pointerdown",oi,{signal:e});const i=p(si,this,document.createElement("div"));i.className="buttons",t.append(i);const n=u(ni,this).toolbarPosition;if(n){const{style:e}=t,i="ltr"===u(ni,this)._uiManager.direction?1-n[0]:n[0];e.insetInlineEnd="".concat(100*i,"%"),e.top="calc(".concat(100*n[1],"% + var(--editor-toolbar-vert-offset))")}return l(ai,this,di).call(this),t}hide(){var t;u(ei,this).classList.add("hidden"),null===(t=u(ii,this))||void 0===t||t.hideDropdown()}show(){u(ei,this).classList.remove("hidden")}addAltTextButton(t){l(ai,this,ci).call(this,t),u(si,this).prepend(t,h(ai,this,ui))}addColorPicker(t){p(ii,this,t);const e=t.renderButton();l(ai,this,ci).call(this,e),u(si,this).prepend(e,h(ai,this,ui))}remove(){var t;u(ei,this).remove(),null===(t=u(ii,this))||void 0===t||t.destroy(),p(ii,this,null)}}function oi(t){t.stopPropagation()}function li(t){u(ni,this)._focusEventsAllowed=!1,t.preventDefault(),t.stopPropagation()}function hi(t){u(ni,this)._focusEventsAllowed=!0,t.preventDefault(),t.stopPropagation()}function ci(t){const e=u(ni,this)._uiManager._signal;t.addEventListener("focusin",l(ai,this,li).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",l(ai,this,hi).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",qe,{signal:e})}function di(){const t=document.createElement("button");t.className="delete",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-editor-remove-".concat(u(ni,this).editorType,"-button")),l(ai,this,ci).call(this,t),t.addEventListener("click",(t=>{u(ni,this)._uiManager.delete()}),{signal:u(ni,this)._uiManager._signal}),u(si,this).append(t)}function ui(t){const e=document.createElement("div");return e.className="divider",e}var pi=new WeakMap,fi=new WeakMap,gi=new WeakMap,mi=new WeakSet;class vi{constructor(t){o(this,mi),d(this,pi,null),d(this,fi,null),d(this,gi,void 0),p(gi,this,t)}show(t,e,i){const[n,s]=l(mi,this,wi).call(this,e,i),{style:a}=u(fi,this)||p(fi,this,l(mi,this,bi).call(this));t.append(u(fi,this)),a.insetInlineEnd="".concat(100*n,"%"),a.top="calc(".concat(100*s,"% + var(--editor-toolbar-vert-offset))")}hide(){u(fi,this).remove()}}function bi(){const t=p(fi,this,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",qe,{signal:u(gi,this)._signal});const e=p(pi,this,document.createElement("div"));return e.className="buttons",t.append(e),l(mi,this,yi).call(this),t}function wi(t,e){let i=0,n=0;for(const s of t){const t=s.y+s.height;if(t<i)continue;const a=s.x+(e?s.width:0);t>i?(n=a,i=t):e?a>n&&(n=a):a<n&&(n=a)}return[e?1-n:n,i]}function yi(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=u(gi,this)._signal;t.addEventListener("contextmenu",qe,{signal:i}),t.addEventListener("click",(()=>{u(gi,this).highlightSelection("floating_button")}),{signal:i}),u(pi,this).append(t)}function Ai(t,e,i){for(const n of i)e.addEventListener(n,t[n].bind(t))}var _i=new WeakMap;class xi{constructor(){d(this,_i,0)}get id(){var t,e;return"".concat("pdfjs_internal_editor_").concat((p(_i,this,(t=u(_i,this),e=t++,t)),e))}}var Ei=new WeakMap,ki=new WeakMap,Mi=new WeakMap,Si=new WeakSet;class Ci{constructor(){o(this,Si),d(this,Ei,function(){var t,e;if("undefined"!==typeof crypto&&"function"===typeof(null===(t=crypto)||void 0===t?void 0:t.randomUUID))return crypto.randomUUID();const i=new Uint8Array(32);if("undefined"!==typeof crypto&&"function"===typeof(null===(e=crypto)||void 0===e?void 0:e.getRandomValues))crypto.getRandomValues(i);else for(let n=0;n<32;n++)i[n]=Math.floor(255*Math.random());return Bt(i)}()),d(this,ki,0),d(this,Mi,null)}static get _isSVGFittingCanvas(){const t=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),e=new Image;e.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';return Pt(this,"_isSVGFittingCanvas",e.decode().then((()=>(t.drawImage(e,0,0,1,1,0,0,1,3),0===new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]))))}async getFromFile(t){const{lastModified:e,name:i,size:n,type:s}=t;return l(Si,this,Ti).call(this,"".concat(e,"_").concat(i,"_").concat(n,"_").concat(s),t)}async getFromUrl(t){return l(Si,this,Ti).call(this,t,t)}async getFromId(t){u(Mi,this)||p(Mi,this,new Map);const e=u(Mi,this).get(t);return e?e.bitmap?(e.refCounter+=1,e):e.file?this.getFromFile(e.file):this.getFromUrl(e.url):null}getSvgUrl(t){const e=u(Mi,this).get(t);return null!==e&&void 0!==e&&e.isSvg?e.svgUrl:null}deleteId(t){u(Mi,this)||p(Mi,this,new Map);const e=u(Mi,this).get(t);e&&(e.refCounter-=1,0===e.refCounter&&(e.bitmap=null))}isValidId(t){return t.startsWith("image_".concat(u(Ei,this),"_"))}}async function Ti(t,e){var i;u(Mi,this)||p(Mi,this,new Map);let n=u(Mi,this).get(t);if(null===n)return null;if(null!==(i=n)&&void 0!==i&&i.bitmap)return n.refCounter+=1,n;try{var s,a;let t;if(n||(n={bitmap:null,id:"image_".concat(u(Ei,this),"_").concat((p(ki,this,(s=u(ki,this),a=s++,s)),a)),refCounter:0,isSvg:!1}),"string"===typeof e?(n.url=e,t=await Ie(e,"blob")):t=n.file=e,"image/svg+xml"===t.type){const e=v._isSVGFittingCanvas,i=new FileReader,s=new Image,a=new Promise(((t,a)=>{s.onload=()=>{n.bitmap=s,n.isSvg=!0,t()},i.onload=async()=>{const t=n.svgUrl=i.result;s.src=await e?"".concat(t,"#svgView(preserveAspectRatio(none))"):t},s.onerror=i.onerror=a}));i.readAsDataURL(t),await a}else n.bitmap=await createImageBitmap(t);n.refCounter=1}catch(r){console.error(r),n=null}return u(Mi,this).set(t,n),n&&u(Mi,this).set(n.id,n),n}v=Ci;var Ri=new WeakMap,Li=new WeakMap,Pi=new WeakMap,Fi=new WeakMap;class Ii{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;d(this,Ri,[]),d(this,Li,!1),d(this,Pi,void 0),d(this,Fi,-1),p(Pi,this,t)}add(t){let{cmd:e,undo:i,post:n,mustExec:s,type:a=NaN,overwriteIfSameType:r=!1,keepUndo:o=!1}=t;if(s&&e(),u(Li,this))return;const l={cmd:e,undo:i,post:n,type:a};if(-1===u(Fi,this))return u(Ri,this).length>0&&(u(Ri,this).length=0),p(Fi,this,0),void u(Ri,this).push(l);if(r&&u(Ri,this)[u(Fi,this)].type===a)return o&&(l.undo=u(Ri,this)[u(Fi,this)].undo),void(u(Ri,this)[u(Fi,this)]=l);const h=u(Fi,this)+1;h===u(Pi,this)?u(Ri,this).splice(0,1):(p(Fi,this,h),h<u(Ri,this).length&&u(Ri,this).splice(h)),u(Ri,this).push(l)}undo(){if(-1===u(Fi,this))return;p(Li,this,!0);const{undo:t,post:e}=u(Ri,this)[u(Fi,this)];t(),null===e||void 0===e||e(),p(Li,this,!1),p(Fi,this,u(Fi,this)-1)}redo(){if(u(Fi,this)<u(Ri,this).length-1){p(Fi,this,u(Fi,this)+1),p(Li,this,!0);const{cmd:t,post:e}=u(Ri,this)[u(Fi,this)];t(),null===e||void 0===e||e(),p(Li,this,!1)}}hasSomethingToUndo(){return-1!==u(Fi,this)}hasSomethingToRedo(){return u(Fi,this)<u(Ri,this).length-1}destroy(){p(Ri,this,null)}}var Di=new WeakSet;class Oi{constructor(t){o(this,Di),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:e}=Gt.platform;for(const[i,n,s={}]of t)for(const t of i){const i=t.startsWith("mac+");e&&i?(this.callbacks.set(t.slice(4),{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1))):e||i||(this.callbacks.set(t,{callback:n,options:s}),this.allKeys.add(t.split("+").at(-1)))}}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(l(Di,this,Ni).call(this,e));if(!i)return;const{callback:n,options:{bubbles:s=!1,args:a=[],checker:r=null}}=i;r&&!r(t,e)||(n.bind(t,...a,e)(),s||(e.stopPropagation(),e.preventDefault()))}}function Ni(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e}class Wi{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);return function(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;const n=window.getComputedStyle(e).color;t.set(i,Qe(n))}e.remove()}(t),Pt(this,"_colors",t)}convert(t){const e=Qe(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[i,n]of this._colors)if(n.every(((t,i)=>t===e[i])))return Wi._colorsMapping.get(i);return e}getHexCode(t){const e=this._colors.get(t);return e?qt.makeHexColor(...e):t}}(0,c.A)(Wi,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var zi=new WeakMap,Hi=new WeakMap,Bi=new WeakMap,ji=new WeakMap,Vi=new WeakMap,Gi=new WeakMap,Ui=new WeakMap,qi=new WeakMap,Xi=new WeakMap,Yi=new WeakMap,Ki=new WeakMap,Ji=new WeakMap,Qi=new WeakMap,Zi=new WeakMap,$i=new WeakMap,tn=new WeakMap,en=new WeakMap,nn=new WeakMap,sn=new WeakMap,an=new WeakMap,rn=new WeakMap,on=new WeakMap,ln=new WeakMap,hn=new WeakMap,cn=new WeakMap,dn=new WeakMap,un=new WeakMap,pn=new WeakMap,fn=new WeakMap,gn=new WeakMap,mn=new WeakMap,vn=new WeakMap,bn=new WeakMap,wn=new WeakMap,yn=new WeakMap,An=new WeakMap,_n=new WeakMap,xn=new WeakMap,En=new WeakMap,kn=new WeakMap,Mn=new WeakMap,Sn=new WeakMap,Cn=new WeakMap,Tn=new WeakMap,Rn=new WeakMap,Ln=new WeakMap,Pn=new WeakSet;class Fn{static get _keyboardManager(){const t=Fn.prototype,e=t=>u(Rn,t).contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&t.hasSomethingToControl(),i=(t,e)=>{let{target:i}=e;if(i instanceof HTMLInputElement){const{type:t}=i;return"text"!==t&&"number"!==t}return!0},n=this.TRANSLATE_SMALL,s=this.TRANSLATE_BIG;return Pt(this,"_keyboardManager",new Oi([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:i}],[["ctrl+z","mac+meta+z"],t.undo,{checker:i}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:i}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:i}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&u(Rn,t).contains(i)&&!t.isEnterHandled}}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(t,e)=>{let{target:i}=e;return!(i instanceof HTMLButtonElement)&&u(Rn,t).contains(document.activeElement)}}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-n,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[n,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-n],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:e}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,n],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:e}]]))}constructor(t,e,i,n,s,a,r,h,c){o(this,Pn),d(this,zi,new AbortController),d(this,Hi,null),d(this,Bi,new Map),d(this,ji,new Map),d(this,Vi,null),d(this,Gi,null),d(this,Ui,null),d(this,qi,new Ii),d(this,Xi,0),d(this,Yi,new Set),d(this,Ki,null),d(this,Ji,null),d(this,Qi,new Set),d(this,Zi,!1),d(this,$i,null),d(this,tn,null),d(this,en,null),d(this,nn,!1),d(this,sn,null),d(this,an,new xi),d(this,rn,!1),d(this,on,!1),d(this,ln,null),d(this,hn,null),d(this,cn,null),d(this,dn,B.NONE),d(this,un,new Set),d(this,pn,null),d(this,fn,null),d(this,gn,null),d(this,mn,this.blur.bind(this)),d(this,vn,this.focus.bind(this)),d(this,bn,this.copy.bind(this)),d(this,wn,this.cut.bind(this)),d(this,yn,this.paste.bind(this)),d(this,An,this.keydown.bind(this)),d(this,_n,this.keyup.bind(this)),d(this,xn,this.onEditingAction.bind(this)),d(this,En,this.onPageChanging.bind(this)),d(this,kn,this.onScaleChanging.bind(this)),d(this,Mn,this.onRotationChanging.bind(this)),d(this,Sn,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),d(this,Cn,[0,0]),d(this,Tn,null),d(this,Rn,null),d(this,Ln,null),this._signal=u(zi,this).signal,p(Rn,this,t),p(Ln,this,e),p(Vi,this,i),this._eventBus=n,this._eventBus._on("editingaction",u(xn,this)),this._eventBus._on("pagechanging",u(En,this)),this._eventBus._on("scalechanging",u(kn,this)),this._eventBus._on("rotationchanging",u(Mn,this)),l(Pn,this,Wn).call(this),l(Pn,this,Un).call(this),l(Pn,this,Bn).call(this),p(Gi,this,s.annotationStorage),p($i,this,s.filterFactory),p(fn,this,a),p(en,this,r||null),p(Zi,this,h),p(cn,this,c||null),this.viewParameters={realScale:ge.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){var t,e,i;null===(t=u(zi,this))||void 0===t||t.abort(),p(zi,this,null),this._signal=null,this._eventBus._off("editingaction",u(xn,this)),this._eventBus._off("pagechanging",u(En,this)),this._eventBus._off("scalechanging",u(kn,this)),this._eventBus._off("rotationchanging",u(Mn,this));for(const n of u(ji,this).values())n.destroy();u(ji,this).clear(),u(Bi,this).clear(),u(Qi,this).clear(),p(Hi,this,null),u(un,this).clear(),u(qi,this).destroy(),null===(e=u(Vi,this))||void 0===e||e.destroy(),null===(i=u(sn,this))||void 0===i||i.hide(),p(sn,this,null),u(tn,this)&&(clearTimeout(u(tn,this)),p(tn,this,null)),u(Tn,this)&&(clearTimeout(u(Tn,this)),p(Tn,this,null))}async mlGuess(t){var e;return(null===(e=u(cn,this))||void 0===e?void 0:e.guess(t))||null}get hasMLManager(){return!!u(cn,this)}get hcmFilter(){return Pt(this,"hcmFilter",u(fn,this)?u($i,this).addHCMFilter(u(fn,this).foreground,u(fn,this).background):"none")}get direction(){return Pt(this,"direction",getComputedStyle(u(Rn,this)).direction)}get highlightColors(){return Pt(this,"highlightColors",u(en,this)?new Map(u(en,this).split(",").map((t=>t.split("=").map((t=>t.trim()))))):null)}get highlightColorNames(){return Pt(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,(t=>t.reverse()))):null)}setMainHighlightColorPicker(t){p(hn,this,t)}editAltText(t){var e;null===(e=u(Vi,this))||void 0===e||e.editAltText(this,t)}onPageChanging(t){let{pageNumber:e}=t;p(Xi,this,e-1)}focusMainContainer(){u(Rn,this).focus()}findParent(t,e){for(const i of u(ji,this).values()){const{x:n,y:s,width:a,height:r}=i.div.getBoundingClientRect();if(t>=n&&t<=n+a&&e>=s&&e<=s+r)return i}return null}disableUserSelect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u(Ln,this).classList.toggle("noUserSelect",t)}addShouldRescale(t){u(Qi,this).add(t)}removeShouldRescale(t){u(Qi,this).delete(t)}onScaleChanging(t){let{scale:e}=t;this.commitOrRemove(),this.viewParameters.realScale=e*ge.PDF_TO_CSS_UNITS;for(const i of u(Qi,this))i.onScaleChanging()}onRotationChanging(t){let{pagesRotation:e}=t;this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const e=document.getSelection();if(!e||e.isCollapsed)return;const{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:a}=e,r=e.toString(),o=l(Pn,this,In).call(this,e).closest(".textLayer"),h=this.getSelectionBoxes(o);if(h){e.empty(),u(dn,this)===B.NONE&&(this._eventBus.dispatch("showannotationeditorui",{source:this,mode:B.HIGHLIGHT}),this.showAllEditors("highlight",!0,!0));for(const e of u(ji,this).values())if(e.hasTextLayer(o)){e.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:h,anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:a,text:r});break}}}addToAnnotationStorage(t){t.isEmpty()||!u(Gi,this)||u(Gi,this).has(t.id)||u(Gi,this).setValue(t.id,t)}blur(){if(this.isShiftKeyDown=!1,u(nn,this)&&(p(nn,this,!1),l(Pn,this,Nn).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:t}=document;for(const e of u(un,this))if(e.div.contains(t)){p(ln,this,[e,t]),e._focusEventsAllowed=!1;break}}focus(){if(!u(ln,this))return;const[t,e]=u(ln,this);p(ln,this,null),e.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:this._signal}),e.focus()}addEditListeners(){l(Pn,this,Bn).call(this),l(Pn,this,Vn).call(this)}removeEditListeners(){l(Pn,this,jn).call(this),l(Pn,this,Gn).call(this)}dragOver(t){for(const{type:e}of t.dataTransfer.items)for(const i of u(Ji,this))if(i.isHandlingMimeForPasting(e))return t.dataTransfer.dropEffect="copy",void t.preventDefault()}drop(t){for(const e of t.dataTransfer.items)for(const i of u(Ji,this))if(i.isHandlingMimeForPasting(e.type))return i.paste(e,this.currentLayer),void t.preventDefault()}copy(t){var e;if(t.preventDefault(),null===(e=u(Hi,this))||void 0===e||e.commitOrRemove(),!this.hasSelection)return;const i=[];for(const n of u(un,this)){const t=n.serialize(!0);t&&i.push(t)}0!==i.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}paste(t){t.preventDefault();const{clipboardData:e}=t;for(const a of e.items)for(const t of u(Ji,this))if(t.isHandlingMimeForPasting(a.type))return void t.paste(a,this.currentLayer);let i=e.getData("application/pdfjs");if(!i)return;try{i=JSON.parse(i)}catch(s){return void Ct('paste: "'.concat(s.message,'".'))}if(!Array.isArray(i))return;this.unselectAll();const n=this.currentLayer;try{const t=[];for(const a of i){const e=n.deserialize(a);if(!e)return;t.push(e)}const e=()=>{for(const e of t)l(Pn,this,Jn).call(this,e);l(Pn,this,$n).call(this,t)},s=()=>{for(const e of t)e.remove()};this.addCommands({cmd:e,undo:s,mustExec:!0})}catch(s){Ct('paste: "'.concat(s.message,'".'))}}keydown(t){this.isShiftKeyDown||"Shift"!==t.key||(this.isShiftKeyDown=!0),u(dn,this)===B.NONE||this.isEditorHandlingKeyboard||Fn._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&"Shift"===t.key&&(this.isShiftKeyDown=!1,u(nn,this)&&(p(nn,this,!1),l(Pn,this,Nn).call(this,"main_toolbar")))}onEditingAction(t){let{name:e}=t;switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu")}}setEditingState(t){t?(l(Pn,this,zn).call(this),l(Pn,this,Vn).call(this),l(Pn,this,qn).call(this,{isEditing:u(dn,this)!==B.NONE,isEmpty:l(Pn,this,Zn).call(this),hasSomethingToUndo:u(qi,this).hasSomethingToUndo(),hasSomethingToRedo:u(qi,this).hasSomethingToRedo(),hasSelectedEditor:!1})):(l(Pn,this,Hn).call(this),l(Pn,this,Gn).call(this),l(Pn,this,qn).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!u(Ji,this)){p(Ji,this,t);for(const t of u(Ji,this))l(Pn,this,Xn).call(this,t.defaultPropertiesToUpdate)}}getId(){return u(an,this).id}get currentLayer(){return u(ji,this).get(u(Xi,this))}getLayer(t){return u(ji,this).get(t)}get currentPageIndex(){return u(Xi,this)}addLayer(t){u(ji,this).set(t.pageIndex,t),u(rn,this)?t.enable():t.disable()}removeLayer(t){u(ji,this).delete(t.pageIndex)}updateMode(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(u(dn,this)!==t){if(p(dn,this,t),t===B.NONE)return this.setEditingState(!1),void l(Pn,this,Kn).call(this);this.setEditingState(!0),l(Pn,this,Yn).call(this),this.unselectAll();for(const e of u(ji,this).values())e.updateMode(t);if(e||!i){if(e)for(const t of u(Bi,this).values())if(t.annotationElementId===e){this.setSelected(t),t.enterInEditMode();break}}else this.addNewEditorFromKeyboard()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==u(dn,this)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){var i;if(u(Ji,this)){switch(t){case j.CREATE:return void this.currentLayer.addNewEditor();case j.HIGHLIGHT_DEFAULT_COLOR:null===(i=u(hn,this))||void 0===i||i.updateColor(e);break;case j.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(u(gn,this)||p(gn,this,new Map)).set(t,e),this.showAllEditors("highlight",e)}for(const i of u(un,this))i.updateParams(t,e);for(const i of u(Ji,this))i.updateDefaultParams(t,e)}}showAllEditors(t,e){var i,n;for(const s of u(Bi,this).values())s.editorType===t&&s.show(e);(null===(i=null===(n=u(gn,this))||void 0===n?void 0:n.get(j.HIGHLIGHT_SHOW_ALL))||void 0===i||i)!==e&&l(Pn,this,Xn).call(this,[[j.HIGHLIGHT_SHOW_ALL,e]])}enableWaiting(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(u(on,this)!==t){p(on,this,t);for(const e of u(ji,this).values())t?e.disableClick():e.enableClick(),e.div.classList.toggle("waiting",t)}}getEditors(t){const e=[];for(const i of u(Bi,this).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return u(Bi,this).get(t)}addEditor(t){u(Bi,this).set(t.id,t)}removeEditor(t){var e;(t.div.contains(document.activeElement)&&(u(tn,this)&&clearTimeout(u(tn,this)),p(tn,this,setTimeout((()=>{this.focusMainContainer(),p(tn,this,null)}),0))),u(Bi,this).delete(t.id),this.unselect(t),t.annotationElementId&&u(Yi,this).has(t.annotationElementId))||(null===(e=u(Gi,this))||void 0===e||e.remove(t.id))}addDeletedAnnotationElement(t){u(Yi,this).add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return u(Yi,this).has(t)}removeDeletedAnnotationElement(t){u(Yi,this).delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}setActiveEditor(t){u(Hi,this)!==t&&(p(Hi,this,t),t&&l(Pn,this,Xn).call(this,t.propertiesToUpdate))}updateUI(t){h(Pn,this,Qn)===t&&l(Pn,this,Xn).call(this,t.propertiesToUpdate)}toggleSelected(t){if(u(un,this).has(t))return u(un,this).delete(t),t.unselect(),void l(Pn,this,qn).call(this,{hasSelectedEditor:this.hasSelection});u(un,this).add(t),t.select(),l(Pn,this,Xn).call(this,t.propertiesToUpdate),l(Pn,this,qn).call(this,{hasSelectedEditor:!0})}setSelected(t){for(const e of u(un,this))e!==t&&e.unselect();u(un,this).clear(),u(un,this).add(t),t.select(),l(Pn,this,Xn).call(this,t.propertiesToUpdate),l(Pn,this,qn).call(this,{hasSelectedEditor:!0})}isSelected(t){return u(un,this).has(t)}get firstSelectedEditor(){return u(un,this).values().next().value}unselect(t){t.unselect(),u(un,this).delete(t),l(Pn,this,qn).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==u(un,this).size}get isEnterHandled(){return 1===u(un,this).size&&this.firstSelectedEditor.isEnterHandled}undo(){u(qi,this).undo(),l(Pn,this,qn).call(this,{hasSomethingToUndo:u(qi,this).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:l(Pn,this,Zn).call(this)})}redo(){u(qi,this).redo(),l(Pn,this,qn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:u(qi,this).hasSomethingToRedo(),isEmpty:l(Pn,this,Zn).call(this)})}addCommands(t){u(qi,this).add(t),l(Pn,this,qn).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:l(Pn,this,Zn).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const t=[...u(un,this)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)l(Pn,this,Jn).call(this,e)},mustExec:!0})}commitOrRemove(){var t;null===(t=u(Hi,this))||void 0===t||t.commitOrRemove()}hasSomethingToControl(){return u(Hi,this)||this.hasSelection}selectAll(){for(const t of u(un,this))t.commit();l(Pn,this,$n).call(this,u(Bi,this).values())}unselectAll(){if((!u(Hi,this)||(u(Hi,this).commitOrRemove(),u(dn,this)===B.NONE))&&this.hasSelection){for(const t of u(un,this))t.unselect();u(un,this).clear(),l(Pn,this,qn).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(t,e){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||this.commitOrRemove(),!this.hasSelection)return;u(Cn,this)[0]+=t,u(Cn,this)[1]+=e;const[i,n]=u(Cn,this),s=[...u(un,this)];u(Tn,this)&&clearTimeout(u(Tn,this)),p(Tn,this,setTimeout((()=>{p(Tn,this,null),u(Cn,this)[0]=u(Cn,this)[1]=0,this.addCommands({cmd:()=>{for(const t of s)u(Bi,this).has(t.id)&&t.translateInPage(i,n)},undo:()=>{for(const t of s)u(Bi,this).has(t.id)&&t.translateInPage(-i,-n)},mustExec:!1})}),1e3));for(const a of s)a.translateInPage(t,e)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),p(Ki,this,new Map);for(const t of u(un,this))u(Ki,this).set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!u(Ki,this))return!1;this.disableUserSelect(!1);const t=u(Ki,this);p(Ki,this,null);let e=!1;for(const[{x:n,y:s,pageIndex:a},r]of t)r.newX=n,r.newY=s,r.newPageIndex=a,e||(e=n!==r.savedX||s!==r.savedY||a!==r.savedPageIndex);if(!e)return!1;const i=(t,e,i,n)=>{if(u(Bi,this).has(t.id)){const s=u(ji,this).get(n);s?t._setParentAndPosition(s,e,i):(t.pageIndex=n,t.x=e,t.y=i)}};return this.addCommands({cmd:()=>{for(const[e,{newX:n,newY:s,newPageIndex:a}]of t)i(e,n,s,a)},undo:()=>{for(const[e,{savedX:n,savedY:s,savedPageIndex:a}]of t)i(e,n,s,a)},mustExec:!0}),!0}dragSelectedEditors(t,e){if(u(Ki,this))for(const i of u(Ki,this).keys())i.drag(t,e)}rebuild(t){if(null===t.parent){const e=this.getLayer(t.pageIndex);e?(e.changeParent(t),e.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){var t;return(null===(t=this.getActive())||void 0===t?void 0:t.shouldGetKeyboardEvents())||1===u(un,this).size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return u(Hi,this)===t}getActive(){return u(Hi,this)}getMode(){return u(dn,this)}get imageManager(){return Pt(this,"imageManager",new Ci)}getSelectionBoxes(t){if(!t)return null;const e=document.getSelection();for(let l=0,h=e.rangeCount;l<h;l++)if(!t.contains(e.getRangeAt(l).commonAncestorContainer))return null;const{x:i,y:n,width:s,height:a}=t.getBoundingClientRect();let r;switch(t.getAttribute("data-main-rotation")){case"90":r=(t,e,r,o)=>({x:(e-n)/a,y:1-(t+r-i)/s,width:o/a,height:r/s});break;case"180":r=(t,e,r,o)=>({x:1-(t+r-i)/s,y:1-(e+o-n)/a,width:r/s,height:o/a});break;case"270":r=(t,e,r,o)=>({x:1-(e+o-n)/a,y:(t-i)/s,width:o/a,height:r/s});break;default:r=(t,e,r,o)=>({x:(t-i)/s,y:(e-n)/a,width:r/s,height:o/a})}const o=[];for(let l=0,h=e.rangeCount;l<h;l++){const t=e.getRangeAt(l);if(!t.collapsed)for(const{x:e,y:i,width:n,height:s}of t.getClientRects())0!==n&&0!==s&&o.push(r(e,i,n,s))}return 0===o.length?null:o}addChangedExistingAnnotation(t){let{annotationElementId:e,id:i}=t;(u(Ui,this)||p(Ui,this,new Map)).set(e,i)}removeChangedExistingAnnotation(t){var e;let{annotationElementId:i}=t;null===(e=u(Ui,this))||void 0===e||e.delete(i)}renderAnnotationElement(t){var e;const i=null===(e=u(Ui,this))||void 0===e?void 0:e.get(t.data.id);if(!i)return;const n=u(Gi,this).getRawValue(i);n&&(u(dn,this)!==B.NONE||n.hasBeenModified)&&n.renderAnnotationElement(t)}}function In(t){let{anchorNode:e}=t;return e.nodeType===Node.TEXT_NODE?e.parentElement:e}function Dn(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=l(Pn,this,In).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(u(sn,this)||p(sn,this,new vi(this)),u(sn,this).show(e,i,"ltr"===this.direction))}function On(){var t;const e=document.getSelection();if(!e||e.isCollapsed){var i;if(u(pn,this))null===(i=u(sn,this))||void 0===i||i.hide(),p(pn,this,null),l(Pn,this,qn).call(this,{hasSelectedText:!1});return}const{anchorNode:n}=e;if(n===u(pn,this))return;var s;if(l(Pn,this,In).call(this,e).closest(".textLayer")){if(null===(t=u(sn,this))||void 0===t||t.hide(),p(pn,this,n),l(Pn,this,qn).call(this,{hasSelectedText:!0}),(u(dn,this)===B.HIGHLIGHT||u(dn,this)===B.NONE)&&(u(dn,this)===B.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),p(nn,this,this.isShiftKeyDown),!this.isShiftKeyDown)){const t=this._signal,e=t=>{"pointerup"===t.type&&0!==t.button||(window.removeEventListener("pointerup",e),window.removeEventListener("blur",e),"pointerup"===t.type&&l(Pn,this,Nn).call(this,"main_toolbar"))};window.addEventListener("pointerup",e,{signal:t}),window.addEventListener("blur",e,{signal:t})}}else u(pn,this)&&(null===(s=u(sn,this))||void 0===s||s.hide(),p(pn,this,null),l(Pn,this,qn).call(this,{hasSelectedText:!1}))}function Nn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";u(dn,this)===B.HIGHLIGHT?this.highlightSelection(t):u(Zi,this)&&l(Pn,this,Dn).call(this)}function Wn(){document.addEventListener("selectionchange",l(Pn,this,On).bind(this),{signal:this._signal})}function zn(){const t=this._signal;window.addEventListener("focus",u(vn,this),{signal:t}),window.addEventListener("blur",u(mn,this),{signal:t})}function Hn(){window.removeEventListener("focus",u(vn,this)),window.removeEventListener("blur",u(mn,this))}function Bn(){const t=this._signal;window.addEventListener("keydown",u(An,this),{signal:t}),window.addEventListener("keyup",u(_n,this),{signal:t})}function jn(){window.removeEventListener("keydown",u(An,this)),window.removeEventListener("keyup",u(_n,this))}function Vn(){const t=this._signal;document.addEventListener("copy",u(bn,this),{signal:t}),document.addEventListener("cut",u(wn,this),{signal:t}),document.addEventListener("paste",u(yn,this),{signal:t})}function Gn(){document.removeEventListener("copy",u(bn,this)),document.removeEventListener("cut",u(wn,this)),document.removeEventListener("paste",u(yn,this))}function Un(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}function qn(t){Object.entries(t).some((t=>{let[e,i]=t;return u(Sn,this)[e]!==i}))&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(u(Sn,this),t)}),u(dn,this)===B.HIGHLIGHT&&!1===t.hasSelectedEditor&&l(Pn,this,Xn).call(this,[[j.HIGHLIGHT_FREE,!0]]))}function Xn(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}function Yn(){if(!u(rn,this)){p(rn,this,!0);for(const t of u(ji,this).values())t.enable();for(const t of u(Bi,this).values())t.enable()}}function Kn(){if(this.unselectAll(),u(rn,this)){p(rn,this,!1);for(const t of u(ji,this).values())t.disable();for(const t of u(Bi,this).values())t.disable()}}function Jn(t){const e=u(ji,this).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}function Qn(t){let e=null;for(e of u(un,t));return e}function Zn(){if(0===u(Bi,this).size)return!0;if(1===u(Bi,this).size)for(const t of u(Bi,this).values())return t.isEmpty();return!1}function $n(t){for(const e of u(un,this))e.unselect();u(un,this).clear();for(const e of t)e.isEmpty()||(u(un,this).add(e),e.select());l(Pn,this,qn).call(this,{hasSelectedEditor:this.hasSelection})}(0,c.A)(Fn,"TRANSLATE_SMALL",1),(0,c.A)(Fn,"TRANSLATE_BIG",10);var ts=new WeakMap,es=new WeakMap,is=new WeakMap,ns=new WeakMap,ss=new WeakMap,as=new WeakMap,rs=new WeakMap,os=new WeakSet;class ls{constructor(t){o(this,os),d(this,ts,""),d(this,es,!1),d(this,is,null),d(this,ns,null),d(this,ss,null),d(this,as,!1),d(this,rs,null),p(rs,this,t)}static initialize(t){ls._l10nPromise||(ls._l10nPromise=t)}async render(){const t=p(is,this,document.createElement("button"));t.className="altText";const e=await ls._l10nPromise.get("pdfjs-editor-alt-text-button-label");t.textContent=e,t.setAttribute("aria-label",e),t.tabIndex="0";const i=u(rs,this)._uiManager._signal;t.addEventListener("contextmenu",qe,{signal:i}),t.addEventListener("pointerdown",(t=>t.stopPropagation()),{signal:i});const n=t=>{t.preventDefault(),u(rs,this)._uiManager.editAltText(u(rs,this))};return t.addEventListener("click",n,{capture:!0,signal:i}),t.addEventListener("keydown",(e=>{e.target===t&&"Enter"===e.key&&(p(as,this,!0),n(e))}),{signal:i}),await l(os,this,hs).call(this),t}finish(){u(is,this)&&(u(is,this).focus({focusVisible:u(as,this)}),p(as,this,!1))}isEmpty(){return!u(ts,this)&&!u(es,this)}get data(){return{altText:u(ts,this),decorative:u(es,this)}}set data(t){let{altText:e,decorative:i}=t;u(ts,this)===e&&u(es,this)===i||(p(ts,this,e),p(es,this,i),l(os,this,hs).call(this))}toggle(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];u(is,this)&&(!t&&u(ss,this)&&(clearTimeout(u(ss,this)),p(ss,this,null)),u(is,this).disabled=!t)}destroy(){var t;null===(t=u(is,this))||void 0===t||t.remove(),p(is,this,null),p(ns,this,null)}}async function hs(){const t=u(is,this);if(!t)return;var e;if(!u(ts,this)&&!u(es,this))return t.classList.remove("done"),void(null===(e=u(ns,this))||void 0===e||e.remove());t.classList.add("done"),b._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then((e=>{t.setAttribute("aria-label",e)}));let i=u(ns,this);if(!i){p(ns,this,i=document.createElement("span")),i.className="tooltip",i.setAttribute("role","tooltip");const e=i.id="alt-text-tooltip-".concat(u(rs,this).id);t.setAttribute("aria-describedby",e);const n=100,s=u(rs,this)._uiManager._signal;s.addEventListener("abort",(()=>{clearTimeout(u(ss,this)),p(ss,this,null)}),{once:!0}),t.addEventListener("mouseenter",(()=>{p(ss,this,setTimeout((()=>{p(ss,this,null),u(ns,this).classList.add("show"),u(rs,this)._reportTelemetry({action:"alt_text_tooltip"})}),n))}),{signal:s}),t.addEventListener("mouseleave",(()=>{var t;u(ss,this)&&(clearTimeout(u(ss,this)),p(ss,this,null)),null===(t=u(ns,this))||void 0===t||t.classList.remove("show")}),{signal:s})}i.innerText=u(es,this)?await b._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip"):u(ts,this),i.parentNode||t.append(i);const n=u(rs,this).getImageForAltText();null===n||void 0===n||n.setAttribute("aria-describedby",i.id)}b=ls,(0,c.A)(ls,"_l10nPromise",null);var cs=new WeakMap,ds=new WeakMap,us=new WeakMap,ps=new WeakMap,fs=new WeakMap,gs=new WeakMap,ms=new WeakMap,vs=new WeakMap,bs=new WeakMap,ws=new WeakMap,ys=new WeakMap,As=new WeakMap,_s=new WeakMap,xs=new WeakMap,Es=new WeakMap,ks=new WeakMap,Ms=new WeakMap,Ss=new WeakMap,Cs=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,Ls=new WeakMap,Ps=new WeakSet;class Fs{static get _resizerKeyboardManager(){const t=Fs.prototype._resizeWithKeyboard,e=Fn.TRANSLATE_SMALL,i=Fn.TRANSLATE_BIG;return Pt(this,"_resizerKeyboardManager",new Oi([[["ArrowLeft","mac+ArrowLeft"],t,{args:[-e,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],t,{args:[e,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],t,{args:[0,-e]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],t,{args:[0,e]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t,{args:[0,i]}],[["Escape","mac+Escape"],Fs.prototype._stopResizingWithKeyboard]]))}constructor(t){o(this,Ps),d(this,cs,null),d(this,ds,null),d(this,us,null),d(this,ps,!1),d(this,fs,!1),d(this,gs,null),d(this,ms,null),d(this,vs,this.focusin.bind(this)),d(this,bs,this.focusout.bind(this)),d(this,ws,null),d(this,ys,""),d(this,As,!1),d(this,_s,null),d(this,xs,!1),d(this,Es,!1),d(this,ks,!1),d(this,Ms,null),d(this,Ss,0),d(this,Cs,0),d(this,Ts,null),(0,c.A)(this,"_initialOptions",Object.create(null)),(0,c.A)(this,"_isVisible",!0),(0,c.A)(this,"_uiManager",null),(0,c.A)(this,"_focusEventsAllowed",!0),(0,c.A)(this,"_l10nPromise",null),d(this,Rs,!1),d(this,Ls,Fs._zIndex++),this.constructor===Fs&&Tt("Cannot initialize AnnotationEditor."),this.parent=t.parent,this.id=t.id,this.width=this.height=null,this.pageIndex=t.parent.pageIndex,this.name=t.name,this.div=null,this._uiManager=t.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=t.isCentered,this._structTreeParentId=null;const{rotation:e,rawDims:{pageWidth:i,pageHeight:n,pageX:s,pageY:a}}=this.parent.viewport;this.rotation=e,this.pageRotation=(360+e-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,n],this.pageTranslation=[s,a];const[r,l]=this.parentDimensions;this.x=t.x/r,this.y=t.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return Pt(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(t){const e=new Ys({id:t.parent.getNextId(),parent:t.parent,uiManager:t._uiManager});e.annotationElementId=t.annotationElementId,e.deleted=!0,e._uiManager.addToAnnotationStorage(e)}static initialize(t,e,i){if(Fs._l10nPromise||(Fs._l10nPromise=new Map(["pdfjs-editor-alt-text-button-label","pdfjs-editor-alt-text-edit-button-label","pdfjs-editor-alt-text-decorative-tooltip","pdfjs-editor-resizer-label-topLeft","pdfjs-editor-resizer-label-topMiddle","pdfjs-editor-resizer-label-topRight","pdfjs-editor-resizer-label-middleRight","pdfjs-editor-resizer-label-bottomRight","pdfjs-editor-resizer-label-bottomMiddle","pdfjs-editor-resizer-label-bottomLeft","pdfjs-editor-resizer-label-middleLeft"].map((e=>[e,t.get(e.replaceAll(/([A-Z])/g,(t=>"-".concat(t.toLowerCase()))))])))),null!==i&&void 0!==i&&i.strings)for(const s of i.strings)Fs._l10nPromise.set(s,t.get(s));if(-1!==Fs._borderLineWidth)return;const n=getComputedStyle(document.documentElement);Fs._borderLineWidth=parseFloat(n.getPropertyValue("--outline-width"))||0}static updateDefaultParams(t,e){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(t){return!1}static paste(t,e){Tt("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return u(Rs,this)}set _isDraggable(t){var e;p(Rs,this,t),null===(e=this.div)||void 0===e||e.classList.toggle("draggable",t)}get isEnterHandled(){return!0}center(){const[t,e]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*e/(2*t),this.y+=this.width*t/(2*e);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*e/(2*t),this.y-=this.width*t/(2*e);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(t){this._uiManager.addCommands(t)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=u(Ls,this)}setParent(t){null!==t?(this.pageIndex=t.pageIndex,this.pageDimensions=t.pageDimensions):l(Ps,this,Xs).call(this),this.parent=t}focusin(t){this._focusEventsAllowed&&(u(As,this)?p(As,this,!1):this.parent.setSelected(this))}focusout(t){var e;if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const i=t.relatedTarget;null!==i&&void 0!==i&&i.closest("#".concat(this.id))||(t.preventDefault(),null!==(e=this.parent)&&void 0!==e&&e.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(t,e,i,n){const[s,a]=this.parentDimensions;[i,n]=this.screenToPageTranslation(i,n),this.x=(t+i)/s,this.y=(e+n)/a,this.fixAndSetPosition()}translate(t,e){l(Ps,this,Is).call(this,this.parentDimensions,t,e)}translateInPage(t,e){u(_s,this)||p(_s,this,[this.x,this.y]),l(Ps,this,Is).call(this,this.pageDimensions,t,e),this.div.scrollIntoView({block:"nearest"})}drag(t,e){u(_s,this)||p(_s,this,[this.x,this.y]);const[i,n]=this.parentDimensions;if(this.x+=t/i,this.y+=e/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:t,y:e}=this.div.getBoundingClientRect();this.parent.findNewParent(this,t,e)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:a}=this;const[r,o]=this.getBaseTranslation();s+=r,a+=o,this.div.style.left="".concat((100*s).toFixed(2),"%"),this.div.style.top="".concat((100*a).toFixed(2),"%"),this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!u(_s,this)&&(u(_s,this)[0]!==this.x||u(_s,this)[1]!==this.y)}getBaseTranslation(){const[t,e]=this.parentDimensions,{_borderLineWidth:i}=Fs,n=i/t,s=i/e;switch(this.rotation){case 90:return[-n,s];case 180:return[n,s];case 270:return[n,-s];default:return[-n,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rotation;const[e,i]=this.pageDimensions;let{x:n,y:s,width:a,height:r}=this;if(a*=e,r*=i,n*=e,s*=i,this._mustFixPosition)switch(t){case 0:n=Math.max(0,Math.min(e-a,n)),s=Math.max(0,Math.min(i-r,s));break;case 90:n=Math.max(0,Math.min(e-r,n)),s=Math.min(i,Math.max(a,s));break;case 180:n=Math.min(e,Math.max(a,n)),s=Math.min(i,Math.max(r,s));break;case 270:n=Math.min(e,Math.max(r,n)),s=Math.max(0,Math.min(i-a,s))}this.x=n/=e,this.y=s/=i;const[o,l]=this.getBaseTranslation();n+=o,s+=l;const{style:h}=this.div;h.left="".concat((100*n).toFixed(2),"%"),h.top="".concat((100*s).toFixed(2),"%"),this.moveInDOM()}screenToPageTranslation(t,e){return Ds.call(Fs,t,e,this.parentRotation)}pageTranslationToScreen(t,e){return Ds.call(Fs,t,e,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:t,pageDimensions:[e,i]}=this,n=e*t,s=i*t;return Gt.isCSSRoundSupported?[Math.round(n),Math.round(s)]:[n,s]}setDims(t,e){const[i,n]=this.parentDimensions;this.div.style.width="".concat((100*t/i).toFixed(2),"%"),u(fs,this)||(this.div.style.height="".concat((100*e/n).toFixed(2),"%"))}fixDims(){const{style:t}=this.div,{height:e,width:i}=t,n=i.endsWith("%"),s=!u(fs,this)&&e.endsWith("%");if(n&&s)return;const[a,r]=this.parentDimensions;n||(t.width="".concat((100*parseFloat(i)/a).toFixed(2),"%")),u(fs,this)||s||(t.height="".concat((100*parseFloat(e)/r).toFixed(2),"%"))}getInitialTranslation(){return[0,0]}altTextFinish(){var t;null===(t=u(us,this))||void 0===t||t.finish()}async addEditToolbar(){return u(ws,this)||u(Es,this)||(p(ws,this,new ri(this)),this.div.append(u(ws,this).render()),u(us,this)&&u(ws,this).addAltTextButton(await u(us,this).render())),u(ws,this)}removeEditToolbar(){var t;u(ws,this)&&(u(ws,this).remove(),p(ws,this,null),null===(t=u(us,this))||void 0===t||t.destroy())}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){u(us,this)||(ls.initialize(Fs._l10nPromise),p(us,this,new ls(this)),u(cs,this)&&(u(us,this).data=u(cs,this),p(cs,this,null)),await this.addEditToolbar())}get altTextData(){var t;return null===(t=u(us,this))||void 0===t?void 0:t.data}set altTextData(t){u(us,this)&&(u(us,this).data=t)}hasAltText(){var t;return!(null!==(t=u(us,this))&&void 0!==t&&t.isEmpty())}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=u(ps,this)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground();const t=this._uiManager._signal;this.div.addEventListener("focusin",u(vs,this),{signal:t}),this.div.addEventListener("focusout",u(bs,this),{signal:t});const[e,i]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth="".concat((100*i/e).toFixed(2),"%"),this.div.style.maxHeight="".concat((100*e/i).toFixed(2),"%"));const[n,s]=this.getInitialTranslation();return this.translate(n,s),Ai(this,this.div,["pointerdown"]),this.div}pointerdown(t){const{isMac:e}=Gt.platform;0!==t.button||t.ctrlKey&&e?t.preventDefault():(p(As,this,!0),this._isDraggable?l(Ps,this,js).call(this,t):l(Ps,this,Bs).call(this,t))}moveInDOM(){u(Ms,this)&&clearTimeout(u(Ms,this)),p(Ms,this,setTimeout((()=>{var t;p(Ms,this,null),null===(t=this.parent)||void 0===t||t.moveEditorInDOM(this)}),0))}_setParentAndPosition(t,e,i){t.changeParent(this),this.x=e,this.y=i,this.fixAndSetPosition()}getRect(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.rotation;const n=this.parentScale,[s,a]=this.pageDimensions,[r,o]=this.pageTranslation,l=t/n,h=e/n,c=this.x*s,d=this.y*a,u=this.width*s,p=this.height*a;switch(i){case 0:return[c+l+r,a-d-h-p+o,c+l+u+r,a-d-h+o];case 90:return[c+h+r,a-d+l+o,c+h+p+r,a-d+l+u+o];case 180:return[c-l-u+r,a-d+h+o,c-l+r,a-d+h+p+o];case 270:return[c-h-p+r,a-d-l-u+o,c-h+r,a-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,n,s,a]=t,r=s-i,o=a-n;switch(this.rotation){case 0:return[i,e-a,r,o];case 90:return[i,e-n,o,r];case 180:return[s,e-n,r,o];case 270:return[s,e-a,o,r];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){p(Es,this,!0)}disableEditMode(){p(Es,this,!1)}isInEditMode(){return u(Es,this)}shouldGetKeyboardEvents(){return u(ks,this)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t,e;const i=this._uiManager._signal;null===(t=this.div)||void 0===t||t.addEventListener("focusin",u(vs,this),{signal:i}),null===(e=this.div)||void 0===e||e.addEventListener("focusout",u(bs,this),{signal:i})}rotate(t){}serialize(){Tt("An editor must be serializable")}static deserialize(t,e,i){const n=new this.prototype.constructor({parent:e,id:e.getNextId(),uiManager:i});n.rotation=t.rotation,p(cs,n,t.accessibilityData);const[s,a]=n.pageDimensions,[r,o,l,h]=n.getRectInCurrentCoords(t.rect,a);return n.x=r/s,n.y=o/a,n.width=l/s,n.height=h/a,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.div.removeEventListener("focusin",u(vs,this)),this.div.removeEventListener("focusout",u(bs,this)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),u(Ms,this)&&(clearTimeout(u(Ms,this)),p(Ms,this,null)),l(Ps,this,Xs).call(this),this.removeEditToolbar(),u(Ts,this)){for(const t of u(Ts,this).values())clearTimeout(t);p(Ts,this,null)}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(l(Ps,this,Ns).call(this),u(gs,this).classList.remove("hidden"),Ai(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(t){if(!this.isResizable||t.target!==this.div||"Enter"!==t.key)return;this._uiManager.setSelected(this),p(ms,this,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const e=u(gs,this).children;if(!u(ds,this)){p(ds,this,Array.from(e));const t=l(Ps,this,Vs).bind(this),i=l(Ps,this,Gs).bind(this),n=this._uiManager._signal;for(const e of u(ds,this)){const s=e.getAttribute("data-resizer-name");e.setAttribute("role","spinbutton"),e.addEventListener("keydown",t,{signal:n}),e.addEventListener("blur",i,{signal:n}),e.addEventListener("focus",l(Ps,this,Us).bind(this,s),{signal:n}),Fs._l10nPromise.get("pdfjs-editor-resizer-label-".concat(s)).then((t=>e.setAttribute("aria-label",t)))}}const i=u(ds,this)[0];let n=0;for(const a of e){if(a===i)break;n++}const s=(360-this.rotation+this.parentRotation)%360/90*(u(ds,this).length/4);if(s!==n){if(s<n)for(let e=0;e<n-s;e++)u(gs,this).append(u(gs,this).firstChild);else if(s>n)for(let e=0;e<s-n;e++)u(gs,this).firstChild.before(u(gs,this).lastChild);let t=0;for(const i of e){const e=u(ds,this)[t++].getAttribute("data-resizer-name");Fs._l10nPromise.get("pdfjs-editor-resizer-label-".concat(e)).then((t=>i.setAttribute("aria-label",t)))}}l(Ps,this,qs).call(this,0),p(ks,this,!0),u(gs,this).firstChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}_resizeWithKeyboard(t,e){u(ks,this)&&l(Ps,this,Hs).call(this,u(ys,this),{movementX:t,movementY:e})}_stopResizingWithKeyboard(){l(Ps,this,Xs).call(this),this.div.focus()}select(){var t,e;this.makeResizable(),null===(t=this.div)||void 0===t||t.classList.add("selectedEditor"),u(ws,this)?null===(e=u(ws,this))||void 0===e||e.show():this.addEditToolbar().then((()=>{var t,e;null!==(t=this.div)&&void 0!==t&&t.classList.contains("selectedEditor")&&(null===(e=u(ws,this))||void 0===e||e.show())}))}unselect(){var t,e,i,n;null===(t=u(gs,this))||void 0===t||t.classList.add("hidden"),null===(e=this.div)||void 0===e||e.classList.remove("selectedEditor"),null!==(i=this.div)&&void 0!==i&&i.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),null===(n=u(ws,this))||void 0===n||n.hide()}updateParams(t,e){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return u(xs,this)}set isEditing(t){p(xs,this,t),this.parent&&(t?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(t,e){p(fs,this,!0);const i=t/e,{style:n}=this.div;n.aspectRatio=i,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){u(Ts,this)||p(Ts,this,new Map);const{action:e}=t;let i=u(Ts,this).get(e);return i&&clearTimeout(i),i=setTimeout((()=>{this._reportTelemetry(t),u(Ts,this).delete(e),0===u(Ts,this).size&&p(Ts,this,null)}),Fs._telemetryTimeout),void u(Ts,this).set(e,i)}t.type||(t.type=this.editorType),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:t}})}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;this.div.classList.toggle("hidden",!t),this._isVisible=t}enable(){this.div&&(this.div.tabIndex=0),p(ps,this,!1)}disable(){this.div&&(this.div.tabIndex=-1),p(ps,this,!0)}renderAnnotationElement(t){let e=t.container.querySelector(".annotationContent");if(e){if("CANVAS"===e.nodeName){const t=e;e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.before(e)}}else e=document.createElement("div"),e.classList.add("annotationContent",this.editorType),t.container.prepend(e);return e}resetAnnotationElement(t){const{firstChild:e}=t.container;"DIV"===e.nodeName&&e.classList.contains("annotationContent")&&e.remove()}}function Is(t,e,i){let[n,s]=t;[e,i]=this.screenToPageTranslation(e,i),this.x+=e/n,this.y+=i/s,this.fixAndSetPosition()}function Ds(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}function Os(t){switch(t){case 90:{const[t,e]=this.pageDimensions;return[0,-t/e,e/t,0]}case 180:return[-1,0,0,-1];case 270:{const[t,e]=this.pageDimensions;return[0,t/e,-e/t,0]}default:return[1,0,0,1]}}function Ns(){if(u(gs,this))return;p(gs,this,document.createElement("div")),u(gs,this).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const t=document.createElement("div");u(gs,this).append(t),t.classList.add("resizer",i),t.setAttribute("data-resizer-name",i),t.addEventListener("pointerdown",l(Ps,this,Ws).bind(this,i),{signal:e}),t.addEventListener("contextmenu",qe,{signal:e}),t.tabIndex=-1}this.div.prepend(u(gs,this))}function Ws(t,e){var i;e.preventDefault();const{isMac:n}=Gt.platform;if(0!==e.button||e.ctrlKey&&n)return;null===(i=u(us,this))||void 0===i||i.toggle(!1);const s=l(Ps,this,Hs).bind(this,t),a=this._isDraggable;this._isDraggable=!1;const r=this._uiManager._signal,o={passive:!0,capture:!0,signal:r};this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",s,o),window.addEventListener("contextmenu",qe,{signal:r});const h=this.x,c=this.y,d=this.width,p=this.height,f=this.parent.div.style.cursor,g=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const m=()=>{var t;this.parent.togglePointerEvents(!0),null===(t=u(us,this))||void 0===t||t.toggle(!0),this._isDraggable=a,window.removeEventListener("pointerup",m),window.removeEventListener("blur",m),window.removeEventListener("pointermove",s,o),window.removeEventListener("contextmenu",qe),this.parent.div.style.cursor=f,this.div.style.cursor=g,l(Ps,this,zs).call(this,h,c,d,p)};window.addEventListener("pointerup",m,{signal:r}),window.addEventListener("blur",m,{signal:r})}function zs(t,e,i,n){const s=this.x,a=this.y,r=this.width,o=this.height;s===t&&a===e&&r===i&&o===n||this.addCommands({cmd:()=>{this.width=r,this.height=o,this.x=s,this.y=a;const[t,e]=this.parentDimensions;this.setDims(t*r,e*o),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=n,this.x=t,this.y=e;const[s,a]=this.parentDimensions;this.setDims(s*i,a*n),this.fixAndSetPosition()},mustExec:!0})}function Hs(t,e){const[i,n]=this.parentDimensions,s=this.x,a=this.y,r=this.width,o=this.height,h=w.MIN_SIZE/i,c=w.MIN_SIZE/n,d=t=>Math.round(1e4*t)/1e4,u=l(Ps,this,Os).call(this,this.rotation),p=(t,e)=>[u[0]*t+u[2]*e,u[1]*t+u[3]*e],f=l(Ps,this,Os).call(this,360-this.rotation);let g,m,v=!1,b=!1;switch(t){case"topLeft":v=!0,g=(t,e)=>[0,0],m=(t,e)=>[t,e];break;case"topMiddle":g=(t,e)=>[t/2,0],m=(t,e)=>[t/2,e];break;case"topRight":v=!0,g=(t,e)=>[t,0],m=(t,e)=>[0,e];break;case"middleRight":b=!0,g=(t,e)=>[t,e/2],m=(t,e)=>[0,e/2];break;case"bottomRight":v=!0,g=(t,e)=>[t,e],m=(t,e)=>[0,0];break;case"bottomMiddle":g=(t,e)=>[t/2,e],m=(t,e)=>[t/2,0];break;case"bottomLeft":v=!0,g=(t,e)=>[0,e],m=(t,e)=>[t,0];break;case"middleLeft":b=!0,g=(t,e)=>[0,e/2],m=(t,e)=>[t,e/2]}const y=g(r,o),A=m(r,o);let _=p(...A);const x=d(s+_[0]),E=d(a+_[1]);let k=1,M=1,[S,C]=this.screenToPageTranslation(e.movementX,e.movementY);var T,R;if([S,C]=(T=S/i,R=C/n,[f[0]*T+f[2]*R,f[1]*T+f[3]*R]),v){const t=Math.hypot(r,o);k=M=Math.max(Math.min(Math.hypot(A[0]-y[0]-S,A[1]-y[1]-C)/t,1/r,1/o),h/r,c/o)}else b?k=Math.max(h,Math.min(1,Math.abs(A[0]-y[0]-S)))/r:M=Math.max(c,Math.min(1,Math.abs(A[1]-y[1]-C)))/o;const L=d(r*k),P=d(o*M);_=p(...m(L,P));const F=x-_[0],I=E-_[1];this.width=L,this.height=P,this.x=F,this.y=I,this.setDims(i*L,n*P),this.fixAndSetPosition()}function Bs(t){const{isMac:e}=Gt.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)}function js(t){const e=this._uiManager.isSelected(this);let i,n;this._uiManager.setUpDragSession();const s=this._uiManager._signal;e&&(this.div.classList.add("moving"),i={passive:!0,capture:!0,signal:s},p(Ss,this,t.clientX),p(Cs,this,t.clientY),n=t=>{const{clientX:e,clientY:i}=t,[n,s]=this.screenToPageTranslation(e-u(Ss,this),i-u(Cs,this));p(Ss,this,e),p(Cs,this,i),this._uiManager.dragSelectedEditors(n,s)},window.addEventListener("pointermove",n,i));const a=()=>{window.removeEventListener("pointerup",a),window.removeEventListener("blur",a),e&&(this.div.classList.remove("moving"),window.removeEventListener("pointermove",n,i)),p(As,this,!1),this._uiManager.endDragSession()||l(Ps,this,Bs).call(this,t)};window.addEventListener("pointerup",a,{signal:s}),window.addEventListener("blur",a,{signal:s})}function Vs(t){w._resizerKeyboardManager.exec(this,t)}function Gs(t){var e;u(ks,this)&&(null===(e=t.relatedTarget)||void 0===e?void 0:e.parentNode)!==u(gs,this)&&l(Ps,this,Xs).call(this)}function Us(t){p(ys,this,u(ks,this)?t:"")}function qs(t){if(u(ds,this))for(const e of u(ds,this))e.tabIndex=t}function Xs(){if(p(ks,this,!1),l(Ps,this,qs).call(this,-1),u(ms,this)){const{savedX:t,savedY:e,savedWidth:i,savedHeight:n}=u(ms,this);l(Ps,this,zs).call(this,t,e,i,n),p(ms,this,null)}}w=Fs,(0,c.A)(Fs,"_borderLineWidth",-1),(0,c.A)(Fs,"_colorManager",new Wi),(0,c.A)(Fs,"_zIndex",1),(0,c.A)(Fs,"_telemetryTimeout",1e3);class Ys extends Fs{constructor(t){super(t),this.annotationElementId=t.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}const Ks=3285377520,Js=4294901760,Qs=65535;class Zs{constructor(t){this.h1=t?4294967295&t:Ks,this.h2=t?4294967295&t:Ks}update(t){let e,i;if("string"===typeof t){e=new Uint8Array(2*t.length),i=0;for(let n=0,s=t.length;n<s;n++){const s=t.charCodeAt(n);s<=255?e[i++]=s:(e[i++]=s>>>8,e[i++]=255&s)}}else{if(!ArrayBuffer.isView(t))throw new Error("Invalid data format, must be a string or TypedArray.");e=t.slice(),i=e.byteLength}const n=i>>2,s=i-4*n,a=new Uint32Array(e.buffer,0,n);let r=0,o=0,l=this.h1,h=this.h2;const c=3432918353,d=461845907,u=11601,p=13715;for(let f=0;f<n;f++)1&f?(r=a[f],r=r*c&Js|r*u&Qs,r=r<<15|r>>>17,r=r*d&Js|r*p&Qs,l^=r,l=l<<13|l>>>19,l=5*l+3864292196):(o=a[f],o=o*c&Js|o*u&Qs,o=o<<15|o>>>17,o=o*d&Js|o*p&Qs,h^=o,h=h<<13|h>>>19,h=5*h+3864292196);switch(r=0,s){case 3:r^=e[4*n+2]<<16;case 2:r^=e[4*n+1]<<8;case 1:r^=e[4*n],r=r*c&Js|r*u&Qs,r=r<<15|r>>>17,r=r*d&Js|r*p&Qs,1&n?l^=r:h^=r}this.h1=l,this.h2=h}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=3981806797*t&Js|36045*t&Qs,e=4283543511*e&Js|(2950163797*(e<<16|t>>>16)&Js)>>>16,t^=e>>>1,t=444984403*t&Js|60499*t&Qs,e=3301882366*e&Js|(3120437893*(e<<16|t>>>16)&Js)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}}const $s=Object.freeze({map:null,hash:"",transfer:void 0});var ta=new WeakMap,ea=new WeakMap,ia=new WeakSet;class na{constructor(){o(this,ia),d(this,ta,!1),d(this,ea,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(t,e){const i=u(ea,this).get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return u(ea,this).get(t)}remove(t){if(u(ea,this).delete(t),0===u(ea,this).size&&this.resetModified(),"function"===typeof this.onAnnotationEditor){for(const t of u(ea,this).values())if(t instanceof Fs)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=u(ea,this).get(t);let n=!1;if(void 0!==i)for(const[s,a]of Object.entries(e))i[s]!==a&&(n=!0,i[s]=a);else n=!0,u(ea,this).set(t,e);n&&l(ia,this,sa).call(this),e instanceof Fs&&"function"===typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return u(ea,this).has(t)}getAll(){return u(ea,this).size>0?Vt(u(ea,this)):null}setAll(t){for(const[e,i]of Object.entries(t))this.setValue(e,i)}get size(){return u(ea,this).size}resetModified(){u(ta,this)&&(p(ta,this,!1),"function"===typeof this.onResetModified&&this.onResetModified())}get print(){return new ra(this)}get serializable(){if(0===u(ea,this).size)return $s;const t=new Map,e=new Zs,i=[],n=Object.create(null);let s=!1;for(const[a,r]of u(ea,this)){const i=r instanceof Fs?r.serialize(!1,n):r;i&&(t.set(a,i),e.update("".concat(a,":").concat(JSON.stringify(i))),s||(s=!!i.bitmap))}if(s)for(const a of t.values())a.bitmap&&i.push(a.bitmap);return t.size>0?{map:t,hash:e.hexdigest(),transfer:i}:$s}get editorStats(){let t=null;const e=new Map;for(const s of u(ea,this).values()){var i;if(!(s instanceof Fs))continue;const a=s.telemetryFinalData;if(!a)continue;const{type:r}=a;e.has(r)||e.set(r,Object.getPrototypeOf(s).constructor),t||(t=Object.create(null));const o=(i=t)[r]||(i[r]=new Map);for(const[t,e]of Object.entries(a)){var n;if("type"===t)continue;let i=o.get(t);i||(i=new Map,o.set(t,i));const s=null!==(n=i.get(e))&&void 0!==n?n:0;i.set(e,s+1)}}for(const[s,a]of e)t[s]=a.computeTelemetryFinalData(t[s]);return t}}function sa(){u(ta,this)||(p(ta,this,!0),"function"===typeof this.onSetModified&&this.onSetModified())}var aa=new WeakMap;class ra extends na{constructor(t){super(),d(this,aa,void 0);const{map:e,hash:i,transfer:n}=t.serializable,s=structuredClone(e,n?{transfer:n}:null);p(aa,this,{map:s,hash:i,transfer:n})}get print(){Tt("Should not call PrintAnnotationStorage.print")}get serializable(){return u(aa,this)}}var oa=new WeakMap;class la{constructor(t){let{ownerDocument:e=globalThis.document,styleElement:i=null}=t;d(this,oa,new Set),this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.add(t),this._document.fonts.add(t)}removeNativeFontFace(t){this.nativeFontFaces.delete(t),this._document.fonts.delete(t)}insertRule(t){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const e=this.styleElement.sheet;e.insertRule(t,e.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.clear(),u(oa,this).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(t){let{systemFontInfo:e,_inspectFont:i}=t;if(e&&!u(oa,this).has(e.loadedName))if(Rt(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:t,src:s,style:a}=e,r=new FontFace(t,s,a);this.addNativeFontFace(r);try{await r.load(),u(oa,this).add(t),null===i||void 0===i||i(e)}catch(n){Ct("Cannot load system font: ".concat(e.baseFontName,", installing it could help to improve PDF rendering.")),this.removeNativeFontFace(r)}}else Tt("Not implemented: loadSystemFont without the Font Loading API.")}async bind(t){if(t.attached||t.missingFile&&!t.systemFontInfo)return;if(t.attached=!0,t.systemFontInfo)return void await this.loadSystemFont(t);if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){throw Ct("Failed to load font '".concat(e.family,"': '").concat(i,"'.")),t.disableFontFace=!0,i}}return}const e=t.createFontFaceRule();if(e){if(this.insertRule(e),this.isSyncFontLoadingSupported)return;await new Promise((e=>{const i=this._queueLoadingCallback(e);this._prepareFontLoadEvent(t,i)}))}}get isFontLoadingAPISupported(){var t;return Pt(this,"isFontLoadingAPISupported",!(null===(t=this._document)||void 0===t||!t.fonts))}get isSyncFontLoadingSupported(){var t;let e=!1;return(T||"undefined"!==typeof navigator&&"string"===typeof(null===(t=navigator)||void 0===t?void 0:t.userAgent)&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),Pt(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function(){for(Rt(!i.done,"completeRequest() cannot be called twice."),i.done=!0;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};return e.push(i),i}get _loadTestFont(){return Pt(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(t,e){function i(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function n(t,e,i,n){return t.substring(0,e)+n+t.substring(e+i)}let s,a;const r=this._document.createElement("canvas");r.width=1,r.height=1;const o=r.getContext("2d");let l=0;const h="lt".concat(Date.now()).concat(this.loadTestFontId++);let c=this._loadTestFont;c=n(c,976,h.length,h);const d=1482184792;let u=i(c,16);for(s=0,a=h.length-3;s<a;s+=4)u=u-d+i(h,s)|0;var p;s<h.length&&(u=u-d+i(h+"XXX",s)|0),c=n(c,16,4,(p=u,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const f="url(data:font/opentype;base64,".concat(btoa(c),");"),g='@font-face {font-family:"'.concat(h,'";src:').concat(f,"}");this.insertRule(g);const m=this._document.createElement("div");m.style.visibility="hidden",m.style.width=m.style.height="10px",m.style.position="absolute",m.style.top=m.style.left="0px";for(const v of[t.loadedName,h]){const t=this._document.createElement("span");t.textContent="Hi",t.style.fontFamily=v,m.append(t)}this._document.body.append(m),function t(e,i){if(++l>30)return Ct("Load test font never loaded."),void i();o.font="30px "+e,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?i():setTimeout(t.bind(null,e,i))}(h,(()=>{m.remove(),e.complete()}))}}class ha{constructor(t,e){let{disableFontFace:i=!1,inspectFont:n=null}=e;this.compiledGlyphs=Object.create(null);for(const s in t)this[s]=t[s];this.disableFontFace=!0===i,this._inspectFont=n}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return null===(t=this._inspectFont)||void 0===t||t.call(this,this),e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e=Bt(this.data),i="url(data:".concat(this.mimetype,";base64,").concat(btoa(e),");");let n;if(this.cssFontInfo){let t="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(t+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")),n='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(t,"src:").concat(i,"}")}else n='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(i,"}");return null===(t=this._inspectFont)||void 0===t||t.call(this,this,i),n}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(s){Ct('getPathGenerator - ignoring character: "'.concat(s,'".'))}if(!Array.isArray(i)||0===i.length)return this.compiledGlyphs[e]=function(t,e){};const n=[];for(let a=0,r=i.length;a<r;)switch(i[a++]){case $t:{const[t,e,s,r,o,l]=i.slice(a,a+6);n.push((i=>i.bezierCurveTo(t,e,s,r,o,l))),a+=6}break;case te:{const[t,e]=i.slice(a,a+2);n.push((i=>i.moveTo(t,e))),a+=2}break;case ee:{const[t,e]=i.slice(a,a+2);n.push((i=>i.lineTo(t,e))),a+=2}break;case ie:{const[t,e,s,r]=i.slice(a,a+4);n.push((i=>i.quadraticCurveTo(t,e,s,r))),a+=4}break;case ne:n.push((t=>t.restore()));break;case se:n.push((t=>t.save()));break;case ae:Rt(2===n.length,"Scale command is only valid at the third position.");break;case re:{const[t,e,s,r,o,l]=i.slice(a,a+6);n.push((i=>i.transform(t,e,s,r,o,l))),a+=6}break;case oe:{const[t,e]=i.slice(a,a+2);n.push((i=>i.translate(t,e))),a+=2}}return this.compiledGlyphs[e]=function(t,e){n[0](t),n[1](t),t.scale(e,-e);for(let i=2,s=n.length;i<s;i++)n[i](t)}}}if(T){var ca=Promise.withResolvers(),da=null;(async()=>{const t=await i.e(673).then(i.t.bind(i,21673,19)),e=await i.e(688).then(i.t.bind(i,42688,19)),n=await i.e(123).then(i.t.bind(i,40504,19)),s=await i.e(395).then(i.t.bind(i,79395,19));return new Map(Object.entries({fs:t,http:e,https:n,url:s,canvas:undefined,path2d:undefined}))})().then((t=>{da=t,ca.resolve()}),(t=>{Ct("loadPackages: ".concat(t)),da=new Map,ca.resolve()}))}class ua{static get promise(){return ca.promise}static get(t){var e;return null===(e=da)||void 0===e?void 0:e.get(t)}}const pa=function(t){return ua.get("fs").promises.readFile(t).then((t=>new Uint8Array(t)))};const fa="Fill",ga="Stroke",ma="Shading";function va(t,e){if(!e)return;const i=e[2]-e[0],n=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],i,n),t.clip(s)}class ba{constructor(){this.constructor===ba&&Tt("Cannot initialize BaseShadingPattern.")}getPattern(){Tt("Abstract method `getPattern` called.")}}class wa extends ba{constructor(t){super(),this._type=t[1],this._bbox=t[2],this._colorStops=t[3],this._p0=t[4],this._p1=t[5],this._r0=t[6],this._r1=t[7],this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const i of this._colorStops)e.addColorStop(i[0],i[1]);return e}getPattern(t,e,i,n){let s;if(n===ga||n===fa){const a=e.current.getClippedPathBoundingBox(n,Ze(t))||[0,0,0,0],r=Math.ceil(a[2]-a[0])||1,o=Math.ceil(a[3]-a[1])||1,l=e.cachedCanvases.getCanvas("pattern",r,o,!0),h=l.context;h.clearRect(0,0,h.canvas.width,h.canvas.height),h.beginPath(),h.rect(0,0,h.canvas.width,h.canvas.height),h.translate(-a[0],-a[1]),i=qt.transform(i,[1,0,0,1,a[0],a[1]]),h.transform(...e.baseTransform),this.matrix&&h.transform(...this.matrix),va(h,this._bbox),h.fillStyle=this._createGradient(h),h.fill(),s=t.createPattern(l.canvas,"no-repeat");const c=new DOMMatrix(i);s.setTransform(c)}else va(t,this._bbox),s=this._createGradient(t);return s}}function ya(t,e,i,n,s,a,r,o){const l=e.coords,h=e.colors,c=t.data,d=4*t.width;let u;l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=a,a=r,r=u),l[n+1]>l[s+1]&&(u=n,n=s,s=u,u=r,r=o,o=u),l[i+1]>l[n+1]&&(u=i,i=n,n=u,u=a,a=r,r=u);const p=(l[i]+e.offsetX)*e.scaleX,f=(l[i+1]+e.offsetY)*e.scaleY,g=(l[n]+e.offsetX)*e.scaleX,m=(l[n+1]+e.offsetY)*e.scaleY,v=(l[s]+e.offsetX)*e.scaleX,b=(l[s+1]+e.offsetY)*e.scaleY;if(f>=b)return;const w=h[a],y=h[a+1],A=h[a+2],_=h[r],x=h[r+1],E=h[r+2],k=h[o],M=h[o+1],S=h[o+2],C=Math.round(f),T=Math.round(b);let R,L,P,F,I,D,O,N;for(let W=C;W<=T;W++){if(W<m){const t=W<f?0:(f-W)/(f-m);R=p-(p-g)*t,L=w-(w-_)*t,P=y-(y-x)*t,F=A-(A-E)*t}else{let t;t=W>b?1:m===b?0:(m-W)/(m-b),R=g-(g-v)*t,L=_-(_-k)*t,P=x-(x-M)*t,F=E-(E-S)*t}let t;t=W<f?0:W>b?1:(f-W)/(f-b),I=p-(p-v)*t,D=w-(w-k)*t,O=y-(y-M)*t,N=A-(A-S)*t;const e=Math.round(Math.min(R,I)),i=Math.round(Math.max(R,I));let n=d*W+4*e;for(let s=e;s<=i;s++)t=(R-s)/(R-I),t<0?t=0:t>1&&(t=1),c[n++]=L-(L-D)*t|0,c[n++]=P-(P-O)*t|0,c[n++]=F-(F-N)*t|0,c[n++]=255}}function Aa(t,e,i){const n=e.coords,s=e.colors;let a,r;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(n.length/o)-1,h=o-1;for(a=0;a<l;a++){let e=a*o;for(let a=0;a<h;a++,e++)ya(t,i,n[e],n[e+1],n[e+o],s[e],s[e+1],s[e+o]),ya(t,i,n[e+o+1],n[e+1],n[e+o],s[e+o+1],s[e+1],s[e+o])}break;case"triangles":for(a=0,r=n.length;a<r;a+=3)ya(t,i,n[a],n[a+1],n[a+2],s[a],s[a+1],s[a+2]);break;default:throw new Error("illegal figure")}}class _a extends ba{constructor(t){super(),this._coords=t[2],this._colors=t[3],this._figures=t[4],this._bounds=t[5],this._bbox=t[7],this._background=t[8],this.matrix=null}_createMeshCanvas(t,e,i){const n=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-n,r=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(a*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(r*t[1]*1.1)),3e3),h=a/o,c=r/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-s,scaleX:1/h,scaleY:1/c},u=o+4,p=l+4,f=i.getCanvas("mesh",u,p,!1),g=f.context,m=g.createImageData(o,l);if(e){const t=m.data;for(let i=0,n=t.length;i<n;i+=4)t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=255}for(const v of this._figures)Aa(m,v,d);g.putImageData(m,2,2);return{canvas:f.canvas,offsetX:n-2*h,offsetY:s-2*c,scaleX:h,scaleY:c}}getPattern(t,e,i,n){let s;if(va(t,this._bbox),n===ma)s=qt.singularValueDecompose2dScale(Ze(t));else if(s=qt.singularValueDecompose2dScale(e.baseTransform),this.matrix){const t=qt.singularValueDecompose2dScale(this.matrix);s=[s[0]*t[0],s[1]*t[1]]}const a=this._createMeshCanvas(s,n===ma?null:this._background,e.cachedCanvases);return n!==ma&&(t.setTransform(...e.baseTransform),this.matrix&&t.transform(...this.matrix)),t.translate(a.offsetX,a.offsetY),t.scale(a.scaleX,a.scaleY),t.createPattern(a.canvas,"no-repeat")}}class xa extends ba{getPattern(){return"hotpink"}}const Ea=1,ka=2;class Ma{constructor(t,e,i,n,s){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.ctx=i,this.canvasGraphicsFactory=n,this.baseTransform=s}createPatternCanvas(t){const e=this.operatorList,i=this.bbox,n=this.xstep,s=this.ystep,a=this.paintType,r=this.tilingType,o=this.color,l=this.canvasGraphicsFactory;St("TilingType: "+r);const h=i[0],c=i[1],d=i[2],u=i[3],p=qt.singularValueDecompose2dScale(this.matrix),f=qt.singularValueDecompose2dScale(this.baseTransform),g=[p[0]*f[0],p[1]*f[1]],m=this.getSizeAndScale(n,this.ctx.canvas.width,g[0]),v=this.getSizeAndScale(s,this.ctx.canvas.height,g[1]),b=t.cachedCanvases.getCanvas("pattern",m.size,v.size,!0),w=b.context,y=l.createCanvasGraphics(w);y.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(y,a,o);let A=h,_=c,x=d,E=u;return h<0&&(A=0,x+=Math.abs(h)),c<0&&(_=0,E+=Math.abs(c)),w.translate(-m.scale*A,-v.scale*_),y.transform(m.scale,0,0,v.scale,0,0),w.save(),this.clipBbox(y,A,_,x,E),y.baseTransform=Ze(y.ctx),y.executeOperatorList(e),y.endDrawing(),{canvas:b.canvas,scaleX:m.scale,scaleY:v.scale,offsetX:A,offsetY:_}}getSizeAndScale(t,e,i){t=Math.abs(t);const n=Math.max(Ma.MAX_PATTERN_SIZE,e);let s=Math.ceil(t*i);return s>=n?s=n:i=s/t,{scale:i,size:s}}clipBbox(t,e,i,n,s){const a=n-e,r=s-i;t.ctx.rect(e,i,a,r),t.current.updateRectMinMax(Ze(t.ctx),[e,i,n,s]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const n=t.ctx,s=t.current;switch(e){case Ea:const t=this.ctx;n.fillStyle=t.fillStyle,n.strokeStyle=t.strokeStyle,s.fillColor=t.fillStyle,s.strokeColor=t.strokeStyle;break;case ka:const a=qt.makeHexColor(i[0],i[1],i[2]);n.fillStyle=a,n.strokeStyle=a,s.fillColor=a,s.strokeColor=a;break;default:throw new zt("Unsupported paint type: ".concat(e))}}getPattern(t,e,i,n){let s=i;n!==ma&&(s=qt.transform(s,e.baseTransform),this.matrix&&(s=qt.transform(s,this.matrix)));const a=this.createPatternCanvas(e);let r=new DOMMatrix(s);r=r.translate(a.offsetX,a.offsetY),r=r.scale(1/a.scaleX,1/a.scaleY);const o=t.createPattern(a.canvas,"repeat");return o.setTransform(r),o}}function Sa(t){let{src:e,srcPos:i=0,dest:n,width:s,height:a,nonBlackColor:r=4294967295,inverseDecode:o=!1}=t;const l=Gt.isLittleEndian?4278190080:255,[h,c]=o?[r,l]:[l,r],d=s>>3,u=7&s,p=e.length;n=new Uint32Array(n.buffer);let f=0;for(let g=0;g<a;g++){for(const s=i+d;i<s;i++){const t=i<p?e[i]:255;n[f++]=128&t?c:h,n[f++]=64&t?c:h,n[f++]=32&t?c:h,n[f++]=16&t?c:h,n[f++]=8&t?c:h,n[f++]=4&t?c:h,n[f++]=2&t?c:h,n[f++]=1&t?c:h}if(0===u)continue;const t=i<p?e[i++]:255;for(let e=0;e<u;e++)n[f++]=t&1<<7-e?c:h}return{srcPos:i,destPos:f}}(0,c.A)(Ma,"MAX_PATTERN_SIZE",3e3);const Ca=16;class Ta{constructor(t){this.canvasFactory=t,this.cache=Object.create(null)}getCanvas(t,e,i){let n;return void 0!==this.cache[t]?(n=this.cache[t],this.canvasFactory.reset(n,e,i)):(n=this.canvasFactory.create(e,i),this.cache[t]=n),n}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e),delete this.cache[t]}}}function Ra(t,e,i,n,s,a,r,o,l,h){const[c,d,u,p,f,g]=Ze(t);if(0===d&&0===u){const m=r*c+f,v=Math.round(m),b=o*p+g,w=Math.round(b),y=(r+l)*c+f,A=Math.abs(Math.round(y)-v)||1,_=(o+h)*p+g,x=Math.abs(Math.round(_)-w)||1;return t.setTransform(Math.sign(c),0,0,Math.sign(p),v,w),t.drawImage(e,i,n,s,a,0,0,A,x),t.setTransform(c,d,u,p,f,g),[A,x]}if(0===c&&0===p){const m=o*u+f,v=Math.round(m),b=r*d+g,w=Math.round(b),y=(o+h)*u+f,A=Math.abs(Math.round(y)-v)||1,_=(r+l)*d+g,x=Math.abs(Math.round(_)-w)||1;return t.setTransform(0,Math.sign(d),Math.sign(u),0,v,w),t.drawImage(e,i,n,s,a,0,0,x,A),t.setTransform(c,d,u,p,f,g),[x,A]}t.drawImage(e,i,n,s,a,r,o,l,h);return[Math.hypot(c,d)*l,Math.hypot(u,p)*h]}class La{constructor(t,e){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=R,this.textMatrixScale=1,this.fontMatrix=L,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=G,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);return t.clipBox=this.clipBox.slice(),t}setCurrentPoint(t,e){this.x=t,this.y=e}updatePathMinMax(t,e,i){[e,i]=qt.applyTransform([e,i],t),this.minX=Math.min(this.minX,e),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,e),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){const i=qt.applyTransform(e,t),n=qt.applyTransform(e.slice(2),t),s=qt.applyTransform([e[0],e[3]],t),a=qt.applyTransform([e[2],e[1]],t);this.minX=Math.min(this.minX,i[0],n[0],s[0],a[0]),this.minY=Math.min(this.minY,i[1],n[1],s[1],a[1]),this.maxX=Math.max(this.maxX,i[0],n[0],s[0],a[0]),this.maxY=Math.max(this.maxY,i[1],n[1],s[1],a[1])}updateScalingPathMinMax(t,e){qt.scaleMinMax(t,e),this.minX=Math.min(this.minX,e[0]),this.minY=Math.min(this.minY,e[1]),this.maxX=Math.max(this.maxX,e[2]),this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,n,s,a,r,o,l,h){const c=qt.bezierBoundingBox(e,i,n,s,a,r,o,l,h);h||this.updateRectMinMax(t,c)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fa,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===ga){e||Tt("Stroke bounding box must include transform.");const t=qt.singularValueDecompose2dScale(e),n=t[0]*this.lineWidth/2,s=t[1]*this.lineWidth/2;i[0]-=n,i[1]-=s,i[2]+=n,i[3]+=s}return i}updateClipFromPath(){const t=qt.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fa,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return qt.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function Pa(t,e){if("undefined"!==typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);const i=e.height,n=e.width,s=i%Ca,a=(i-s)/Ca,r=0===s?a:a+1,o=t.createImageData(n,Ca);let l,h=0;const c=e.data,d=o.data;let u,p,f,g;if(e.kind===J.GRAYSCALE_1BPP){const e=c.byteLength,i=new Uint32Array(d.buffer,0,d.byteLength>>2),g=i.length,m=n+7>>3,v=4294967295,b=Gt.isLittleEndian?4278190080:255;for(u=0;u<r;u++){for(f=u<a?Ca:s,l=0,p=0;p<f;p++){const t=e-h;let s=0;const a=t>m?n:8*t-7,r=-8&a;let o=0,d=0;for(;s<r;s+=8)d=c[h++],i[l++]=128&d?v:b,i[l++]=64&d?v:b,i[l++]=32&d?v:b,i[l++]=16&d?v:b,i[l++]=8&d?v:b,i[l++]=4&d?v:b,i[l++]=2&d?v:b,i[l++]=1&d?v:b;for(;s<a;s++)0===o&&(d=c[h++],o=128),i[l++]=d&o?v:b,o>>=1}for(;l<g;)i[l++]=0;t.putImageData(o,0,u*Ca)}}else if(e.kind===J.RGBA_32BPP){for(p=0,g=n*Ca*4,u=0;u<a;u++)d.set(c.subarray(h,h+g)),h+=g,t.putImageData(o,0,p),p+=Ca;u<r&&(g=n*s*4,d.set(c.subarray(h,h+g)),t.putImageData(o,0,p))}else{if(e.kind!==J.RGB_24BPP)throw new Error("bad image kind: ".concat(e.kind));for(f=Ca,g=n*f,u=0;u<r;u++){for(u>=a&&(f=s,g=n*f),l=0,p=g;p--;)d[l++]=c[h++],d[l++]=c[h++],d[l++]=c[h++],d[l++]=255;t.putImageData(o,0,u*Ca)}}}function Fa(t,e){if(e.bitmap)return void t.drawImage(e.bitmap,0,0);const i=e.height,n=e.width,s=i%Ca,a=(i-s)/Ca,r=0===s?a:a+1,o=t.createImageData(n,Ca);let l=0;const h=e.data,c=o.data;for(let d=0;d<r;d++){const e=d<a?Ca:s;({srcPos:l}=Sa({src:h,srcPos:l,dest:c,width:n,height:e,nonBlackColor:0})),t.putImageData(o,0,d*Ca)}}function Ia(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of i)void 0!==t[n]&&(e[n]=t[n]);void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function Da(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",void 0!==t.setLineDash&&(t.setLineDash([]),t.lineDashOffset=0),!T){const{filter:e}=t;"none"!==e&&""!==e&&(t.filter="none")}}function Oa(t,e){if(e)return!0;const i=qt.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*ge.PDF_TO_CSS_UNITS);return i[0]<=n&&i[1]<=n}const Na=["butt","round","square"],Wa=["miter","round","bevel"],za={},Ha={};var Ba=new WeakSet;class ja{constructor(t,e,i,n,s,a,r,l){let{optionalContentConfig:h,markedContentStack:c=null}=a;o(this,Ba),this.ctx=t,this.current=new La(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=i,this.canvasFactory=n,this.filterFactory=s,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=c||[],this.optionalContentConfig=h,this.cachedCanvases=new Ta(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=r,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"===typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:i,transparency:n=!1,background:s=null}=t;const a=this.ctx.canvas.width,r=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=s||"#ffffff",this.ctx.fillRect(0,0,a,r),this.ctx.fillStyle=o,n){const t=this.cachedCanvases.getCanvas("transparent",a,r);this.compositeCtx=this.ctx,this.transparentCanvas=t.canvas,this.ctx=t.context,this.ctx.save(),this.ctx.transform(...Ze(this.compositeCtx))}this.ctx.save(),Da(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=Ze(this.ctx)}executeOperatorList(t,e,i,n){const s=t.argsArray,a=t.fnArray;let r=e||0;const o=s.length;if(o===r)return r;const l=o-r>10&&"function"===typeof i,h=l?Date.now()+15:0;let c=0;const d=this.commonObjs,u=this.objs;let p;for(;;){if(void 0!==n&&r===n.nextBreakPoint)return n.breakIt(r,i),r;if(p=a[r],p!==_t.dependency)this[p].apply(this,s[r]);else for(const t of s[r]){const e=t.startsWith("g_")?d:u;if(!e.has(t))return e.get(t,i),r}if(r++,r===o)return r;if(l&&++c>10){if(Date.now()>h)return i(),r;c=0}}}endDrawing(){l(Ba,this,Va).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear(),l(Ba,this,Ga).call(this)}_scaleImage(t,e){const i=t.width,n=t.height;let s,a,r=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,h=n,c="prescale1";for(;r>2&&l>1||o>2&&h>1;){let e=l,i=h;r>2&&l>1&&(e=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),r/=l/e),o>2&&h>1&&(i=h>=16384?Math.floor(h/2)-1||1:Math.ceil(h)/2,o/=h/i),s=this.cachedCanvases.getCanvas(c,e,i),a=s.context,a.clearRect(0,0,e,i),a.drawImage(t,0,0,l,h,0,0,e,i),t=s.canvas,l=e,h=i,c="prescale1"===c?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:h}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,s=this.current.fillColor,a=this.current.patternFill,r=Ze(e);let o,l,h,c;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer;l=JSON.stringify(a?r:[r.slice(0,4),s]),o=this._cachedBitmapsMap.get(e),o||(o=new Map,this._cachedBitmapsMap.set(e,o));const i=o.get(l);if(i&&!a){return{canvas:i,offsetX:Math.round(Math.min(r[0],r[2])+r[4]),offsetY:Math.round(Math.min(r[1],r[3])+r[5])}}h=i}h||(c=this.cachedCanvases.getCanvas("maskCanvas",i,n),Fa(c.context,t));let d=qt.transform(r,[1/i,0,0,-1/n,0,0]);d=qt.transform(d,[1,0,0,1,0,-n]);const[u,p,f,g]=qt.getAxialAlignedBoundingBox([0,0,i,n],d),m=Math.round(f-u)||1,v=Math.round(g-p)||1,b=this.cachedCanvases.getCanvas("fillCanvas",m,v),w=b.context,y=u,A=p;w.translate(-y,-A),w.transform(...d),h||(h=this._scaleImage(c.canvas,$e(w)),h=h.img,o&&a&&o.set(l,h)),w.imageSmoothingEnabled=Oa(Ze(w),t.interpolate),Ra(w,h,0,0,h.width,h.height,0,0,i,n),w.globalCompositeOperation="source-in";const _=qt.transform($e(w),[1,0,0,1,-y,-A]);return w.fillStyle=a?s.getPattern(e,this,_,fa):s,w.fillRect(0,0,i,n),o&&!a&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,b.canvas)),{canvas:b.canvas,offsetX:Math.round(y),offsetY:Math.round(A)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=Na[t]}setLineJoin(t){this.ctx.lineJoin=Wa[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx,this.ctx=n.context;const s=this.ctx;s.setTransform(...Ze(this.suspendedCtx)),Ia(this.suspendedCtx,s),function(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(t,i){e.translate(t,i),this.__originalTranslate(t,i)},t.scale=function(t,i){e.scale(t,i),this.__originalScale(t,i)},t.transform=function(t,i,n,s,a,r){e.transform(t,i,n,s,a,r),this.__originalTransform(t,i,n,s,a,r)},t.setTransform=function(t,i,n,s,a,r){e.setTransform(t,i,n,s,a,r),this.__originalSetTransform(t,i,n,s,a,r)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(t){e.rotate(t),this.__originalRotate(t)},t.clip=function(t){e.clip(t),this.__originalClip(t)},t.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},t.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},t.bezierCurveTo=function(t,i,n,s,a,r){e.bezierCurveTo(t,i,n,s,a,r),this.__originalBezierCurveTo(t,i,n,s,a,r)},t.rect=function(t,i,n,s){e.rect(t,i,n,s),this.__originalRect(t,i,n,s)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Ia(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;t?(t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.ceil(t[2]),t[3]=Math.ceil(t[3])):t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,e,this.ctx,t),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(t,e,i,n){const s=n[0],a=n[1],r=n[2]-s,o=n[3]-a;0!==r&&0!==o&&(this.genericComposeSMask(e.context,i,r,o,e.subtype,e.backdrop,e.transferMap,s,a,e.offsetX,e.offsetY),t.save(),t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),t.drawImage(i.canvas,0,0),t.restore())}genericComposeSMask(t,e,i,n,s,a,r,o,l,h,c){let d=t.canvas,u=o-h,p=l-c;if(a)if(u<0||p<0||u+i>d.width||p+n>d.height){const t=this.cachedCanvases.getCanvas("maskExtension",i,n),e=t.context;e.drawImage(d,-u,-p),a.some((t=>0!==t))&&(e.globalCompositeOperation="destination-atop",e.fillStyle=qt.makeHexColor(...a),e.fillRect(0,0,i,n),e.globalCompositeOperation="source-over"),d=t.canvas,u=p=0}else if(a.some((t=>0!==t))){t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);const e=new Path2D;e.rect(u,p,i,n),t.clip(e),t.globalCompositeOperation="destination-atop",t.fillStyle=qt.makeHexColor(...a),t.fillRect(u,p,i,n),t.restore()}e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0),"Alpha"===s&&r?e.filter=this.filterFactory.addAlphaFilter(r):"Luminosity"===s&&(e.filter=this.filterFactory.addLuminosityFilter(r));const f=new Path2D;f.rect(o,l,i,n),e.clip(f),e.globalCompositeOperation="destination-in",e.drawImage(d,u,p,i,n,o,l,i,n),e.restore()}save(){this.inSMaskMode?(Ia(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const t=this.current;this.stateStack.push(t),this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Ia(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(t,e,i,n,s,a){this.ctx.transform(t,e,i,n,s,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const n=this.ctx,s=this.current;let a,r,o=s.x,l=s.y;const h=Ze(n),c=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],d=c?i.slice(0):null;for(let u=0,p=0,f=t.length;u<f;u++)switch(0|t[u]){case _t.rectangle:o=e[p++],l=e[p++];const t=e[p++],i=e[p++],u=o+t,f=l+i;n.moveTo(o,l),0===t||0===i?n.lineTo(u,f):(n.lineTo(u,l),n.lineTo(u,f),n.lineTo(o,f)),c||s.updateRectMinMax(h,[o,l,u,f]),n.closePath();break;case _t.moveTo:o=e[p++],l=e[p++],n.moveTo(o,l),c||s.updatePathMinMax(h,o,l);break;case _t.lineTo:o=e[p++],l=e[p++],n.lineTo(o,l),c||s.updatePathMinMax(h,o,l);break;case _t.curveTo:a=o,r=l,o=e[p+4],l=e[p+5],n.bezierCurveTo(e[p],e[p+1],e[p+2],e[p+3],o,l),s.updateCurvePathMinMax(h,a,r,e[p],e[p+1],e[p+2],e[p+3],o,l,d),p+=6;break;case _t.curveTo2:a=o,r=l,n.bezierCurveTo(o,l,e[p],e[p+1],e[p+2],e[p+3]),s.updateCurvePathMinMax(h,a,r,o,l,e[p],e[p+1],e[p+2],e[p+3],d),o=e[p+2],l=e[p+3],p+=4;break;case _t.curveTo3:a=o,r=l,o=e[p+2],l=e[p+3],n.bezierCurveTo(e[p],e[p+1],o,l,o,l),s.updateCurvePathMinMax(h,a,r,e[p],e[p+1],o,l,o,l,d),p+=4;break;case _t.closePath:n.closePath()}c&&s.updateScalingPathMinMax(h,d),s.setCurrentPoint(o,l)}closePath(){this.ctx.closePath()}stroke(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"===typeof i&&null!==i&&void 0!==i&&i.getPattern?(e.save(),e.strokeStyle=i.getPattern(e,this,$e(e),ga),this.rescaleAndStroke(!1),e.restore()):this.rescaleAndStroke(!0)),t&&this.consumePath(this.current.getClippedPathBoundingBox()),e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this.ctx,i=this.current.fillColor;let n=!1;this.current.patternFill&&(e.save(),e.fillStyle=i.getPattern(e,this,$e(e),fa),n=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==s&&(this.pendingEOFill?(e.fill("evenodd"),this.pendingEOFill=!1):e.fill()),n&&e.restore(),t&&this.consumePath(s)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=za}eoClip(){this.pendingClip=Ha}beginText(){this.current.textMatrix=R,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save(),e.beginPath();for(const i of t)e.setTransform(...i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize);e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){var i;const n=this.commonObjs.get(t),s=this.current;if(!n)throw new Error("Can't find font for ".concat(t));if(s.fontMatrix=n.fontMatrix||L,0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||Ct("Invalid font matrix for font "+t),e<0?(e=-e,s.fontDirection=-1):s.fontDirection=1,this.current.font=n,this.current.fontSize=e,n.isType3Font)return;const a=n.loadedName||"sans-serif",r=(null===(i=n.systemFontInfo)||void 0===i?void 0:i.css)||'"'.concat(a,'", ').concat(n.fallbackName);let o="normal";n.black?o="900":n.bold&&(o="bold");const l=n.italic?"italic":"normal";let h=e;e<16?h=16:e>100&&(h=100),this.current.fontSizeScale=e/h,this.ctx.font="".concat(l," ").concat(o," ").concat(h,"px ").concat(r)}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e),this.moveText(t,e)}setTextMatrix(t,e,i,n,s,a){this.current.textMatrix=[t,e,i,n,s,a],this.current.textMatrixScale=Math.hypot(t,e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,n){const s=this.ctx,a=this.current,r=a.font,o=a.textRenderingMode,l=a.fontSize/a.fontSizeScale,h=o&Y,c=!!(o&K),d=a.patternFill&&!r.missingFile;let u;if((r.disableFontFace||c||d)&&(u=r.getPathGenerator(this.commonObjs,t)),r.disableFontFace||d?(s.save(),s.translate(e,i),s.beginPath(),u(s,l),n&&s.setTransform(...n),h!==G&&h!==q||s.fill(),h!==U&&h!==q||s.stroke(),s.restore()):(h!==G&&h!==q||s.fillText(t,e,i),h!==U&&h!==q||s.strokeText(t,e,i)),c){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:Ze(s),x:e,y:i,fontSize:l,addToPath:u})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1),t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let n=3;n<e.length;n+=4)if(e[n]>0&&e[n]<255){i=!0;break}return Pt(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const s=this.ctx,a=e.fontSizeScale,r=e.charSpacing,o=e.wordSpacing,l=e.fontDirection,h=e.textHScale*l,c=t.length,d=i.vertical,u=d?1:-1,p=i.defaultVMetrics,f=n*e.fontMatrix[0],g=e.textRenderingMode===G&&!i.disableFontFace&&!e.patternFill;let m;if(s.save(),s.transform(...e.textMatrix),s.translate(e.x,e.y+e.textRise),l>0?s.scale(h,-1):s.scale(h,1),e.patternFill){s.save();const t=e.fillColor.getPattern(s,this,$e(s),fa);m=Ze(s),s.restore(),s.fillStyle=t}let v=e.lineWidth;const b=e.textMatrixScale;if(0===b||0===v){const t=e.textRenderingMode&Y;t!==U&&t!==q||(v=this.getSinglePixelWidth())}else v/=b;if(1!==a&&(s.scale(a,a),v/=a),s.lineWidth=v,i.isInvalidPDFjsFont){const i=[];let n=0;for(const e of t)i.push(e.unicode),n+=e.width;return s.fillText(i.join(""),0,0),e.x+=n*f*h,s.restore(),void this.compose()}let w,y=0;for(w=0;w<c;++w){const e=t[w];if("number"===typeof e){y+=u*e*n/1e3;continue}let h=!1;const c=(e.isSpace?o:0)+r,v=e.fontChar,b=e.accent;let A,_,x=e.width;if(d){const t=e.vmetric||p,i=-(e.vmetric?t[1]:.5*x)*f,n=t[2]*f;x=t?-t[0]:x,A=i/a,_=(y+n)/a}else A=y/a,_=0;if(i.remeasure&&x>0){const t=1e3*s.measureText(v).width/n*a;if(x<t&&this.isFontSubpixelAAEnabled){const e=x/t;h=!0,s.save(),s.scale(e,1),A/=e}else x!==t&&(A+=(x-t)/2e3*n/a)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(g&&!b)s.fillText(v,A,_);else if(this.paintChar(v,A,_,m),b){const t=A+n*b.offset.x/a,e=_-n*b.offset.y/a;this.paintChar(b.fontChar,t,e,m)}y+=d?x*f-c*l:x*f+c*l,h&&s.restore()}d?e.y-=y:e.x+=y*h,s.restore(),this.compose()}showType3Text(t){const e=this.ctx,i=this.current,n=i.font,s=i.fontSize,a=i.fontDirection,r=n.vertical?1:-1,o=i.charSpacing,l=i.wordSpacing,h=i.textHScale*a,c=i.fontMatrix||L,d=t.length;let u,p,f,g;if(!(i.textRenderingMode===X)&&0!==s){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,e.save(),e.transform(...i.textMatrix),e.translate(i.x,i.y),e.scale(h,a),u=0;u<d;++u){if(p=t[u],"number"===typeof p){g=r*p*s/1e3,this.ctx.translate(g,0),i.x+=g*h;continue}const a=(p.isSpace?l:0)+o,d=n.charProcOperatorList[p.operatorListId];if(!d){Ct('Type3 character "'.concat(p.operatorListId,'" is not available.'));continue}this.contentVisible&&(this.processingType3=p,this.save(),e.scale(s,s),e.transform(...c),this.executeOperatorList(d),this.restore());f=qt.applyTransform([p.width,0],c)[0]*s+a,e.translate(f,0),i.x+=f*h}e.restore(),this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,n,s,a){this.ctx.rect(i,n,s-i,a-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],n=this.baseTransform||Ze(this.ctx),s={createCanvasGraphics:t=>new ja(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};e=new Ma(t,i,this.ctx,s,n)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(t,e,i){const n=qt.makeHexColor(t,e,i);this.ctx.strokeStyle=n,this.current.strokeColor=n}setFillRGBColor(t,e,i){const n=qt.makeHexColor(t,e,i);this.ctx.fillStyle=n,this.current.fillColor=n,this.current.patternFill=!1}_getPattern(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.cachedPatterns.has(t)?e=this.cachedPatterns.get(t):(e=function(t){switch(t[0]){case"RadialAxial":return new wa(t);case"Mesh":return new _a(t);case"Dummy":return new xa}throw new Error("Unknown IR type: ".concat(t[0]))}(this.getObject(t)),this.cachedPatterns.set(t,e)),i&&(e.matrix=i),e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,$e(e),ma);const n=$e(e);if(n){const{width:t,height:i}=e.canvas,[s,a,r,o]=qt.getAxialAlignedBoundingBox([0,0,t,i],n);this.ctx.fillRect(s,a,r-s,o-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Tt("Should not call beginInlineImage")}beginImageData(){Tt("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),t&&this.transform(...t),this.baseTransform=Ze(this.ctx),e)){const t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i),this.current.updateRectMinMax(Ze(this.ctx),e),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(t){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const e=this.ctx;t.isolated||St("TODO: Support non-isolated groups."),t.knockout&&Ct("Knockout groups not supported.");const i=Ze(e);if(t.matrix&&e.transform(...t.matrix),!t.bbox)throw new Error("Bounding box is required.");let n=qt.getAxialAlignedBoundingBox(t.bbox,Ze(e));const s=[0,0,e.canvas.width,e.canvas.height];n=qt.intersect(n,s)||[0,0,0,0];const a=Math.floor(n[0]),r=Math.floor(n[1]),o=Math.max(Math.ceil(n[2])-a,1),l=Math.max(Math.ceil(n[3])-r,1);this.current.startNewPathAndClipBox([0,0,o,l]);let h="groupAt"+this.groupLevel;t.smask&&(h+="_smask_"+this.smaskCounter++%2);const c=this.cachedCanvases.getCanvas(h,o,l),d=c.context;d.translate(-a,-r),d.transform(...i),t.smask?this.smaskStack.push({canvas:c.canvas,context:d,offsetX:a,offsetY:r,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(a,r),e.save()),Ia(e,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,t.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const t=Ze(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...t);const i=qt.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0),this.ctx.restore(),this.compose(i)}}beginAnnotation(t,e,i,n,s){if(l(Ba,this,Va).call(this),Da(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),e){const n=e[2]-e[0],a=e[3]-e[1];if(s&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0],i[5]-=e[1],(e=e.slice())[0]=e[1]=0,e[2]=n,e[3]=a;const[s,r]=qt.singularValueDecompose2dScale(Ze(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),h=Math.ceil(a*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,h);const{canvas:c,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(t,c),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(s,0,0,-r,0,a*r),Da(this.ctx)}else Da(this.ctx),this.ctx.rect(e[0],e[1],n,a),this.ctx.clip(),this.endPath()}this.current=new La(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),l(Ba,this,Ga).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function(t){const{width:e,height:i}=t;if(e>1e3||i>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let a,r,o,l=new Uint8Array(s*(i+1));const h=e+7&-8;let c=new Uint8Array(h*i),d=0;for(const g of t.data){let t=128;for(;t>0;)c[d++]=g&t?0:255,t>>=1}let u=0;for(d=0,0!==c[d]&&(l[0]=1,++u),r=1;r<e;r++)c[d]!==c[d+1]&&(l[r]=c[d]?2:1,++u),d++;for(0!==c[d]&&(l[r]=2,++u),a=1;a<i;a++){d=a*h,o=a*s,c[d-h]!==c[d]&&(l[o]=c[d]?1:8,++u);let t=(c[d]?4:0)+(c[d-h]?8:0);for(r=1;r<e;r++)t=(t>>2)+(c[d+1]?4:0)+(c[d-h+1]?8:0),n[t]&&(l[o+r]=n[t],++u),d++;if(c[d-h]!==c[d]&&(l[o+r]=c[d]?2:4,++u),u>1e3)return null}for(d=h*(i-1),o=a*s,0!==c[d]&&(l[o]=8,++u),r=1;r<e;r++)c[d]!==c[d+1]&&(l[o+r]=c[d]?4:8,++u),d++;if(0!==c[d]&&(l[o+r]=4,++u),u>1e3)return null;const p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),f=new Path2D;for(a=0;u&&a<=i;a++){let t=a*s;const i=t+e;for(;t<i&&!l[t];)t++;if(t===i)continue;f.moveTo(t%s,a);const n=t;let r=l[t];do{const e=p[r];do{t+=e}while(!l[t]);const i=l[t];5!==i&&10!==i?(r=i,l[t]=0):(r=i&51*r>>4,l[t]&=r>>2|r<<2),f.lineTo(t%s,t/s|0),l[t]||--u}while(n!==t);--a}return c=null,l=null,function(t){t.save(),t.scale(1/e,-1/i),t.translate(0,-i),t.fill(f),t.beginPath(),t.restore()}}(t)),n.compiled))return void n.compiled(i);const s=this._createMaskCanvas(t),a=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(a,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const r=this.ctx;r.save();const o=Ze(r);r.transform(e,i,n,s,0,0);const l=this._createMaskCanvas(t);r.setTransform(1,0,0,1,l.offsetX-o[4],l.offsetY-o[5]);for(let h=0,c=a.length;h<c;h+=2){const t=qt.transform(o,[e,i,n,s,a[h],a[h+1]]),[c,d]=qt.applyTransform([0,0],t);r.drawImage(l.canvas,c,d)}r.restore(),this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,n=this.current.patternFill;for(const s of t){const{data:t,width:a,height:r,transform:o}=s,l=this.cachedCanvases.getCanvas("maskCanvas",a,r),h=l.context;h.save();Fa(h,this.getObject(t,s)),h.globalCompositeOperation="source-in",h.fillStyle=n?i.getPattern(h,this,$e(e),fa):i,h.fillRect(0,0,a,r),h.restore(),e.save(),e.transform(...o),e.scale(1,-1),Ra(e,l.canvas,0,0,a,r,0,-1,1,1),e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):Ct("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,n){if(!this.contentVisible)return;const s=this.getObject(t);if(!s)return void Ct("Dependent image isn't ready yet");const a=s.width,r=s.height,o=[];for(let l=0,h=n.length;l<h;l+=2)o.push({transform:[e,0,0,i,n[l],n[l+1]],x:0,y:0,w:a,h:r});this.paintInlineImageXObjectGroup(s,o)}applyTransferMapsToCanvas(t){return"none"!==this.current.transferMaps&&(t.filter=this.current.transferMaps,t.drawImage(t.canvas,0,0),t.filter="none"),t.canvas}applyTransferMapsToBitmap(t){if("none"===this.current.transferMaps)return t.bitmap;const{bitmap:e,width:i,height:n}=t,s=this.cachedCanvases.getCanvas("inlineImage",i,n),a=s.context;return a.filter=this.current.transferMaps,a.drawImage(e,0,0),a.filter="none",s.canvas}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,n=this.ctx;if(this.save(),!T){const{filter:t}=n;"none"!==t&&""!==t&&(n.filter="none")}let s;if(n.scale(1/e,-1/i),t.bitmap)s=this.applyTransferMapsToBitmap(t);else if("function"===typeof HTMLElement&&t instanceof HTMLElement||!t.data)s=t;else{const n=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Pa(n,t),s=this.applyTransferMapsToCanvas(n)}const a=this._scaleImage(s,$e(n));n.imageSmoothingEnabled=Oa(Ze(n),t.interpolate),Ra(n,a.img,0,0,a.paintWidth,a.paintHeight,0,-i,e,i),this.compose(),this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx;let n;if(t.bitmap)n=t.bitmap;else{const e=t.width,i=t.height,s=this.cachedCanvases.getCanvas("inlineImage",e,i).context;Pa(s,t),n=this.applyTransferMapsToCanvas(s)}for(const s of e)i.save(),i.transform(...s.transform),i.scale(1,-1),Ra(i,n,s.x,s.y,s.w,s.h,0,-1,1,1),i.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(t);const i=this.ctx;this.pendingClip&&(e||(this.pendingClip===Ha?i.clip("evenodd"):i.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=Ze(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),n=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,n)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:t}=this.current,{a:e,b:i,c:n,d:s}=this.ctx.getTransform();let a,r;if(0===i&&0===n){const i=Math.abs(e),n=Math.abs(s);if(i===n)if(0===t)a=r=1/i;else{const e=i*t;a=r=e<1?1/e:1}else if(0===t)a=1/i,r=1/n;else{const e=i*t,s=n*t;a=e<1?1/e:1,r=s<1?1/s:1}}else{const o=Math.abs(e*s-i*n),l=Math.hypot(e,i),h=Math.hypot(n,s);if(0===t)a=h/o,r=l/o;else{const e=t*o;a=h>e?h/e:1,r=l>e?l/e:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=r}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[n,s]=this.getScaleForStroking();if(e.lineWidth=i||1,1===n&&1===s)return void e.stroke();const a=e.getLineDash();if(t&&e.save(),e.scale(n,s),a.length>0){const t=Math.max(n,s);e.setLineDash(a.map((e=>e/t))),e.lineDashOffset/=t}e.stroke(),t&&e.restore()}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}function Va(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}function Ga(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==t){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}}for(const uf in _t)void 0!==ja.prototype[uf]&&(ja.prototype[_t[uf]]=ja.prototype[uf]);class Ua{static get workerPort(){return l(Ua,this,qa)._}static set workerPort(t){if(!("undefined"!==typeof Worker&&t instanceof Worker)&&null!==t)throw new Error("Invalid `workerPort` type.");qa._=l(Ua,this,t)}static get workerSrc(){return l(Ua,this,Xa)._}static set workerSrc(t){if("string"!==typeof t)throw new Error("Invalid `workerSrc` type.");Xa._=l(Ua,this,t)}}var qa={_:null},Xa={_:""};const Ya=1,Ka=2,Ja=1,Qa=2,Za=3,$a=4,tr=5,er=6,ir=7,nr=8;function sr(t){switch(t instanceof Error||"object"===typeof t&&null!==t||Tt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new Ht(t.message);case"MissingPDFException":return new Nt(t.message);case"PasswordException":return new It(t.message,t.code);case"UnexpectedResponseException":return new Wt(t.message,t.status);case"UnknownErrorException":return new Dt(t.message,t.details);default:return new Dt(t.message,t.toString())}}var ar=new WeakSet;class rr{constructor(t,e,i){o(this,ar),this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream)return void l(ar,this,lr).call(this,e);if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error("Cannot resolve callback ".concat(t));if(delete this.callbackCapabilities[t],e.callback===Ya)i.resolve(e.data);else{if(e.callback!==Ka)throw new Error("Unexpected callback case");i.reject(sr(e.reason))}return}const n=this.actionHandler[e.action];if(!n)throw new Error("Unknown action from worker: ".concat(e.action));if(e.callbackId){const t=this.sourceName,s=e.sourceName;new Promise((function(t){t(n(e.data))})).then((function(n){i.postMessage({sourceName:t,targetName:s,callback:Ya,callbackId:e.callbackId,data:n})}),(function(n){i.postMessage({sourceName:t,targetName:s,callback:Ka,callbackId:e.callbackId,reason:sr(n)})}))}else e.streamId?l(ar,this,or).call(this,e):n(e.data)},i.addEventListener("message",this._onComObjOnMessage)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error('There is already an actionName called "'.concat(t,'"'));i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const n=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[n]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:n,data:e},i)}catch(a){s.reject(a)}return s.promise}sendWithStream(t,e,i,n){const s=this.streamId++,a=this.sourceName,r=this.targetName,o=this.comObj;return new ReadableStream({start:i=>{const l=Promise.withResolvers();return this.streamControllers[s]={controller:i,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:a,targetName:r,action:t,streamId:s,data:e,desiredSize:i.desiredSize},n),l.promise},pull:t=>{const e=Promise.withResolvers();return this.streamControllers[s].pullCall=e,o.postMessage({sourceName:a,targetName:r,stream:er,streamId:s,desiredSize:t.desiredSize}),e.promise},cancel:t=>{Rt(t instanceof Error,"cancel must have a valid reason");const e=Promise.withResolvers();return this.streamControllers[s].cancelCall=e,this.streamControllers[s].isClosed=!0,o.postMessage({sourceName:a,targetName:r,stream:Ja,streamId:s,reason:sr(t)}),e.promise}},i)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}function or(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,a=this,r=this.actionHandler[t.action],o={enqueue(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=a,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:n,stream:$a,streamId:e,chunk:t},r)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:Za,streamId:e}),delete a.streamSinks[e])},error(t){Rt(t instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:n,stream:tr,streamId:e,reason:sr(t)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[e]=o,new Promise((function(e){e(r(t.data,o))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:nr,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:nr,streamId:e,reason:sr(t)})}))}function lr(t){const e=t.streamId,i=this.sourceName,n=t.sourceName,s=this.comObj,a=this.streamControllers[e],r=this.streamSinks[e];switch(t.stream){case nr:t.success?a.startCall.resolve():a.startCall.reject(sr(t.reason));break;case ir:t.success?a.pullCall.resolve():a.pullCall.reject(sr(t.reason));break;case er:if(!r){s.postMessage({sourceName:i,targetName:n,stream:ir,streamId:e,success:!0});break}r.desiredSize<=0&&t.desiredSize>0&&r.sinkCapability.resolve(),r.desiredSize=t.desiredSize,new Promise((function(t){var e;t(null===(e=r.onPull)||void 0===e?void 0:e.call(r))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:ir,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:ir,streamId:e,reason:sr(t)})}));break;case $a:if(Rt(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(t.chunk);break;case Za:if(Rt(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),l(ar,this,hr).call(this,a,e);break;case tr:Rt(a,"error should have stream controller"),a.controller.error(sr(t.reason)),l(ar,this,hr).call(this,a,e);break;case Qa:t.success?a.cancelCall.resolve():a.cancelCall.reject(sr(t.reason)),l(ar,this,hr).call(this,a,e);break;case Ja:if(!r)break;new Promise((function(e){var i;e(null===(i=r.onCancel)||void 0===i?void 0:i.call(r,sr(t.reason)))})).then((function(){s.postMessage({sourceName:i,targetName:n,stream:Qa,streamId:e,success:!0})}),(function(t){s.postMessage({sourceName:i,targetName:n,stream:Qa,streamId:e,reason:sr(t)})})),r.sinkCapability.reject(sr(t.reason)),r.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async function hr(t,e){var i,n,s;await Promise.allSettled([null===(i=t.startCall)||void 0===i?void 0:i.promise,null===(n=t.pullCall)||void 0===n?void 0:n.promise,null===(s=t.cancelCall)||void 0===s?void 0:s.promise]),delete this.streamControllers[e]}var cr=new WeakMap,dr=new WeakMap;class ur{constructor(t){let{parsedData:e,rawData:i}=t;d(this,cr,void 0),d(this,dr,void 0),p(cr,this,e),p(dr,this,i)}getRaw(){return u(dr,this)}get(t){var e;return null!==(e=u(cr,this).get(t))&&void 0!==e?e:null}getAll(){return Vt(u(cr,this))}has(t){return u(cr,this).has(t)}}const pr=Symbol("INTERNAL");var fr=new WeakMap,gr=new WeakMap,mr=new WeakMap,vr=new WeakMap;class br{constructor(t,e){let{name:i,intent:n,usage:s}=e;d(this,fr,!1),d(this,gr,!1),d(this,mr,!1),d(this,vr,!0),p(fr,this,!!(t&I)),p(gr,this,!!(t&D)),this.name=i,this.intent=n,this.usage=s}get visible(){if(u(mr,this))return u(vr,this);if(!u(vr,this))return!1;const{print:t,view:e}=this.usage;return u(fr,this)?"OFF"!==(null===e||void 0===e?void 0:e.viewState):!u(gr,this)||"OFF"!==(null===t||void 0===t?void 0:t.printState)}_setVisible(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t!==pr&&Tt("Internal method `_setVisible` called."),p(mr,this,i),p(vr,this,e)}}var wr=new WeakMap,yr=new WeakMap,Ar=new WeakMap,_r=new WeakMap,xr=new WeakSet;class Er{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I;if(o(this,xr),d(this,wr,null),d(this,yr,new Map),d(this,Ar,null),d(this,_r,null),this.renderingIntent=e,this.name=null,this.creator=null,null!==t){this.name=t.name,this.creator=t.creator,p(_r,this,t.order);for(const i of t.groups)u(yr,this).set(i.id,new br(e,i));if("OFF"===t.baseState)for(const t of u(yr,this).values())t._setVisible(pr,!1);for(const e of t.on)u(yr,this).get(e)._setVisible(pr,!0);for(const e of t.off)u(yr,this).get(e)._setVisible(pr,!1);p(Ar,this,this.getHash())}}isVisible(t){if(0===u(yr,this).size)return!0;if(!t)return St("Optional content group not defined."),!0;if("OCG"===t.type)return u(yr,this).has(t.id)?u(yr,this).get(t.id).visible:(Ct("Optional content group not found: ".concat(t.id)),!0);if("OCMD"===t.type){if(t.expression)return l(xr,this,kr).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!u(yr,this).has(e))return Ct("Optional content group not found: ".concat(e)),!0;if(u(yr,this).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!u(yr,this).has(e))return Ct("Optional content group not found: ".concat(e)),!0;if(!u(yr,this).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!u(yr,this).has(e))return Ct("Optional content group not found: ".concat(e)),!0;if(!u(yr,this).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!u(yr,this).has(e))return Ct("Optional content group not found: ".concat(e)),!0;if(u(yr,this).get(e).visible)return!1}return!0}return Ct("Unknown optional content policy ".concat(t.policy,".")),!0}return Ct("Unknown group type ".concat(t.type,".")),!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=u(yr,this).get(t);i?(i._setVisible(pr,!!e,!0),p(wr,this,null)):Ct("Optional content group not found: ".concat(t))}setOCGState(t){let e,{state:i,preserveRB:n}=t;for(const s of i){switch(s){case"ON":case"OFF":case"Toggle":e=s;continue}const t=u(yr,this).get(s);if(t)switch(e){case"ON":t._setVisible(pr,!0);break;case"OFF":t._setVisible(pr,!1);break;case"Toggle":t._setVisible(pr,!t.visible)}}p(wr,this,null)}get hasInitialVisibility(){return null===u(Ar,this)||this.getHash()===u(Ar,this)}getOrder(){return u(yr,this).size?u(_r,this)?u(_r,this).slice():[...u(yr,this).keys()]:null}getGroups(){return u(yr,this).size>0?Vt(u(yr,this)):null}getGroup(t){return u(yr,this).get(t)||null}getHash(){if(null!==u(wr,this))return u(wr,this);const t=new Zs;for(const[e,i]of u(yr,this))t.update("".concat(e,":").concat(i.visible));return p(wr,this,t.hexdigest())}}function kr(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let n=1;n<e;n++){const e=t[n];let s;if(Array.isArray(e))s=l(xr,this,kr).call(this,e);else{if(!u(yr,this).has(e))return Ct("Optional content group not found: ".concat(e)),!0;s=u(yr,this).get(e).visible}switch(i){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return"And"===i}class Mr{constructor(t,e){let{disableRange:i=!1,disableStream:n=!1}=e;Rt(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:s,initialData:a,progressiveDone:r,contentDispositionFilename:o}=t;if(this._queuedChunks=[],this._progressiveDone=r,this._contentDispositionFilename=o,(null===a||void 0===a?void 0:a.length)>0){const t=a instanceof Uint8Array&&a.byteLength===a.buffer.byteLength?a.buffer:new Uint8Array(a).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=t,this._isStreamingSupported=!n,this._isRangeSupported=!i,this._contentLength=s,this._fullRequestReader=null,this._rangeReaders=[],t.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})})),t.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})})),t.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})})),t.addProgressiveDoneListener((()=>{this._onProgressiveDone()})),t.transportReady()}_onReceiveData(t){let{begin:e,chunk:i}=t;const n=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{Rt(this._rangeReaders.some((function(t){return t._begin===e&&(t._enqueue(n),!0)})),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}_onProgress(t){var e,i,n,s;void 0===t.total?null===(e=this._rangeReaders[0])||void 0===e||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded}):null===(n=this._fullRequestReader)||void 0===n||null===(s=n.onProgress)||void 0===s||s.call(n,{loaded:t.loaded,total:t.total})}_onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){Rt(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;return this._queuedChunks=null,new Sr(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Cr(this,t,e);return this._pdfDataRangeTransport.requestDataRange(t,e),this._rangeReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeReaders.slice(0))i.cancel(t);this._pdfDataRangeTransport.abort()}}class Sr{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t,this._done=i||!1,this._filename=Be(n)?n:null,this._queuedChunks=e||[],this._loaded=0;for(const s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),t._fullRequestReader=this,this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Cr{constructor(t,e,i){this._stream=t,this._begin=e,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Tr(t){let{getResponseHeader:e,isHttp:i,rangeChunkSize:n,disableRange:s}=t;const a={allowRangeRequests:!1,suggestedLength:void 0},r=parseInt(e("Content-Length"),10);if(!Number.isInteger(r))return a;if(a.suggestedLength=r,r<=2*n)return a;if(s||!i)return a;if("bytes"!==e("Accept-Ranges"))return a;return"identity"!==(e("Content-Encoding")||"identity")||(a.allowRangeRequests=!0),a}function Rr(t){const e=t("Content-Disposition");if(e){let t=function(t){let e=!0,i=n("filename\\*","i").exec(t);if(i){i=i[1];let t=r(i);return t=unescape(t),t=o(t),t=l(t),a(t)}if(i=function(t){const e=[];let i;const s=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=s.exec(t));){let[,t,n,s]=i;if(t=parseInt(t,10),t in e){if(0===t)break}else e[t]=[n,s]}const a=[];for(let n=0;n<e.length&&n in e;++n){let[t,i]=e[n];i=r(i),t&&(i=unescape(i),0===n&&(i=o(i))),a.push(i)}return a.join("")}(t),i)return a(l(i));if(i=n("filename","i").exec(t),i){i=i[1];let t=r(i);return t=l(t),a(t)}function n(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function s(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const n=new TextDecoder(t,{fatal:!0}),s=jt(i);i=n.decode(s),e=!1}catch(n){}}return i}function a(t){return e&&/[\x80-\xff]/.test(t)&&(t=s("utf-8",t),e&&(t=s("iso-8859-1",t))),t}function r(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const i=e[t].indexOf('"');-1!==i&&(e[t]=e[t].slice(0,i),e.length=t+1),e[t]=e[t].replaceAll(/\\(.)/g,"$1")}t=e.join('"')}return t}function o(t){const e=t.indexOf("'");return-1===e?t:s(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function l(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,i,n){if("q"===i||"Q"===i)return s(e,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{n=atob(n)}catch(a){}return s(e,n)}))}return""}(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(i){}if(Be(t))return t}return null}function Lr(t,e){return 404===t||0===t&&e.startsWith("file:")?new Nt('Missing PDF "'+e+'".'):new Wt("Unexpected server response (".concat(t,') while retrieving PDF "').concat(e,'".'),t)}function Pr(t){return 200===t||206===t}function Fr(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Ir(t){const e=new Headers;for(const i in t){const n=t[i];void 0!==n&&e.append(i,n)}return e}function Dr(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(Ct("getArrayBuffer - unexpected data format: ".concat(t)),new Uint8Array(t).buffer)}class Or{constructor(t){this.source=t,this.isHttp=/^https?:/i.test(t.url),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return Rt(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Nr(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new Wr(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class Nr{constructor(t){this._stream=t,this._reader=null,this._loaded=0,this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1,this._contentLength=e.length,this._headersCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._headers=Ir(this._stream.httpHeaders);const i=e.url;fetch(i,Fr(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!Pr(t.status))throw Lr(t.status,i);this._reader=t.body.getReader(),this._headersCapability.resolve();const e=e=>t.headers.get(e),{allowRangeRequests:n,suggestedLength:s}=Tr({getResponseHeader:e,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Rr(e),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Ht("Streaming is disabled."))})).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._headersCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Dr(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class Wr{constructor(t,e,i){this._stream=t,this._reader=null,this._loaded=0;const n=t.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController,this._headers=Ir(this._stream.httpHeaders),this._headers.append("Range","bytes=".concat(e,"-").concat(i-1));const s=n.url;fetch(s,Fr(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!Pr(t.status))throw Lr(t.status,s);this._readCapability.resolve(),this._reader=t.body.getReader()})).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded}),{value:Dr(e),done:!1})}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t),this._abortController.abort()}}class zr{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t,this.isHttp=/^https?:/i.test(t),this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null),this.withCredentials=e.withCredentials||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(t,e,i){const n={begin:t,end:e};for(const s in i)n[s]=i[s];return this.request(n)}requestFull(t){return this.request(t)}request(t){const e=new XMLHttpRequest,i=this.currXhrId++,n=this.pendingRequests[i]={xhr:e};e.open("GET",this.url),e.withCredentials=this.withCredentials;for(const s in this.httpHeaders){const t=this.httpHeaders[s];void 0!==t&&e.setRequestHeader(s,t)}return this.isHttp&&"begin"in t&&"end"in t?(e.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1)),n.expectedStatus=206):n.expectedStatus=200,e.responseType="arraybuffer",t.onError&&(e.onerror=function(i){t.onError(e.status)}),e.onreadystatechange=this.onStateChange.bind(this,i),e.onprogress=this.onProgress.bind(this,i),n.onHeadersReceived=t.onHeadersReceived,n.onDone=t.onDone,n.onError=t.onError,n.onProgress=t.onProgress,e.send(null),i}onProgress(t,e){var i;const n=this.pendingRequests[t];n&&(null===(i=n.onProgress)||void 0===i||i.call(n,e))}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const n=i.xhr;if(n.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),4!==n.readyState)return;if(!(t in this.pendingRequests))return;var s;if(delete this.pendingRequests[t],0===n.status&&this.isHttp)return void(null===(s=i.onError)||void 0===s||s.call(i,n.status));const a=n.status||200;var r;if(!(200===a&&206===i.expectedStatus)&&a!==i.expectedStatus)return void(null===(r=i.onError)||void 0===r||r.call(i,n.status));const o=function(t){const e=t.response;return"string"!==typeof e?e:jt(e).buffer}(n);if(206===a){const t=n.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:o})}else if(o)i.onDone({begin:0,chunk:o});else{var l;null===(l=i.onError)||void 0===l||l.call(i,n.status)}}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t],e.abort()}}class Hr{constructor(t){this._source=t,this._manager=new zr(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials}),this._rangeChunkSize=t.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){return Rt(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new Br(this._manager,this._source),this._fullRequestReader}getRangeReader(t,e){const i=new jr(this._manager,t,e);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class Br{constructor(t,e){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._fullRequestId=t.requestFull(i),this._headersReceivedCapability=Promise.withResolvers(),this._disableRange=e.disableRange||!1,this._contentLength=e.length,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),i=t=>e.getResponseHeader(t),{allowRangeRequests:n,suggestedLength:s}=Tr({getResponseHeader:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=Rr(i),this._isRangeSupported&&this._manager.abortRequest(t),this._headersReceivedCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);if(this._done=!0,!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=Lr(t,this._url),this._headersReceivedCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(t){var e;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0,this._headersReceivedCapability.reject(t);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class jr{constructor(t,e,i){this._manager=t;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._requestId=t.requestRange(e,i,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(t){this._storedError=Lr(t,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(t){var e;this.isStreamingSupported||(null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded}))}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=Promise.withResolvers();return this._requests.push(t),t.promise}cancel(t){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const Vr=/^file:\/\/\/[a-zA-Z]:\//;class Gr{constructor(t){this.source=t,this.url=function(t){const e=ua.get("url"),i=e.parse(t);return"file:"===i.protocol||i.host?i:/^[a-z]:[/\\]/i.test(t)?e.parse("file:///".concat(t)):(i.host||(i.protocol="file:"),i)}(t.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.httpHeaders=this.isHttp&&t.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var t,e;return null!==(t=null===(e=this._fullRequestReader)||void 0===e?void 0:e._loaded)&&void 0!==t?t:0}getFullReader(){return Rt(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new Jr(this):new Yr(this),this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new Qr(this,t,e):new Kr(this,t,e);return this._rangeRequestReaders.push(i),i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const i of this._rangeRequestReaders.slice(0))i.cancel(t)}}class Ur{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null;const e=t.source;this._contentLength=e.length,this._loaded=0,this._filename=null,this._disableRange=e.disableRange||!1,this._rangeChunkSize=e.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Ht("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class qr{constructor(t){this._url=t.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t,this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t,t.on("readable",(()=>{this._readCapability.resolve()})),t.on("end",(()=>{t.destroy(),this._done=!0,this._readCapability.resolve()})),t.on("error",(t=>{this._error(t)})),this._storedError&&this._readableStream.destroy(this._storedError)}}function Xr(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class Yr extends Ur{constructor(t){super(t);const e=e=>{if(404===e.statusCode){const t=new Nt('Missing PDF "'.concat(this._url,'".'));return this._storedError=t,void this._headersCapability.reject(t)}this._headersCapability.resolve(),this._setReadableStream(e);const i=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:n,suggestedLength:s}=Tr({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=s||this._contentLength,this._filename=Rr(i)};if(this._request=null,"http:"===this._url.protocol){const i=ua.get("http");this._request=i.request(Xr(this._url,t.httpHeaders),e)}else{const i=ua.get("https");this._request=i.request(Xr(this._url,t.httpHeaders),e)}this._request.on("error",(t=>{this._storedError=t,this._headersCapability.reject(t)})),this._request.end()}}class Kr extends qr{constructor(t,e,i){super(t),this._httpHeaders={};for(const s in t.httpHeaders){const e=t.httpHeaders[s];void 0!==e&&(this._httpHeaders[s]=e)}this._httpHeaders.Range="bytes=".concat(e,"-").concat(i-1);const n=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new Nt('Missing PDF "'.concat(this._url,'".'));this._storedError=t}};if(this._request=null,"http:"===this._url.protocol){const t=ua.get("http");this._request=t.request(Xr(this._url,this._httpHeaders),n)}else{const t=ua.get("https");this._request=t.request(Xr(this._url,this._httpHeaders),n)}this._request.on("error",(t=>{this._storedError=t})),this._request.end()}}class Jr extends Ur{constructor(t){super(t);let e=decodeURIComponent(this._url.path);Vr.test(this._url.href)&&(e=e.replace(/^\//,""));const i=ua.get("fs");i.promises.lstat(e).then((t=>{this._contentLength=t.size,this._setReadableStream(i.createReadStream(e)),this._headersCapability.resolve()}),(t=>{"ENOENT"===t.code&&(t=new Nt('Missing PDF "'.concat(e,'".'))),this._storedError=t,this._headersCapability.reject(t)}))}}class Qr extends qr{constructor(t,e,i){super(t);let n=decodeURIComponent(this._url.path);Vr.test(this._url.href)&&(n=n.replace(/^\//,""));const s=ua.get("fs");this._setReadableStream(s.createReadStream(n,{start:e,end:i-1}))}}const Zr=30;var $r=new WeakMap,to=new WeakMap,eo=new WeakMap,io=new WeakMap,no=new WeakMap,so=new WeakMap,ao=new WeakMap,ro=new WeakMap,oo=new WeakMap,lo=new WeakMap,ho=new WeakMap,co=new WeakMap,uo=new WeakMap,po=new WeakMap,fo=new WeakMap,go=new WeakMap,mo=new WeakMap,vo=new WeakMap,bo=new WeakSet;class wo{constructor(t){var e;let{textContentSource:i,container:n,viewport:s}=t;if(o(this,bo),d(this,$r,Promise.withResolvers()),d(this,to,null),d(this,eo,!1),d(this,io,!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled)),d(this,no,null),d(this,so,null),d(this,ao,0),d(this,ro,0),d(this,oo,null),d(this,lo,null),d(this,ho,0),d(this,co,0),d(this,uo,Object.create(null)),d(this,po,[]),d(this,fo,null),d(this,go,[]),d(this,mo,new WeakMap),d(this,vo,null),i instanceof ReadableStream)p(fo,this,i);else{if("object"!==typeof i)throw new Error('No "textContentSource" parameter specified.');p(fo,this,new ReadableStream({start(t){t.enqueue(i),t.close()}}))}p(to,this,p(lo,this,n)),p(co,this,s.scale*(globalThis.devicePixelRatio||1)),p(ho,this,s.rotation),p(so,this,{prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:null});const{pageWidth:a,pageHeight:r,pageX:l,pageY:h}=s.rawDims;p(vo,this,[1,0,0,-1,-l,h+r]),p(ro,this,a),p(ao,this,r),Eo.call(wo),ti(n,s),u($r,this).promise.catch((()=>{})).then((()=>{To._.delete(this),p(so,this,null),p(uo,this,null)}))}render(){const t=()=>{u(oo,this).read().then((e=>{var i;let{value:n,done:s}=e;s?u($r,this).resolve():(null!==(i=u(no,this))&&void 0!==i||p(no,this,n.lang),Object.assign(u(uo,this),n.styles),l(bo,this,yo).call(this,n.items),t())}),u($r,this).reject)};return p(oo,this,u(fo,this).getReader()),To._.add(this),t(),u($r,this).promise}update(t){let{viewport:e,onBefore:i=null}=t;const n=e.scale*(globalThis.devicePixelRatio||1),s=e.rotation;if(s!==u(ho,this)&&(null===i||void 0===i||i(),p(ho,this,s),ti(u(lo,this),{rotation:s})),n!==u(co,this)){null===i||void 0===i||i(),p(co,this,n);const t={prevFontSize:null,prevFontFamily:null,div:null,properties:null,ctx:xo.call(wo,u(no,this))};for(const e of u(go,this))t.properties=u(mo,this).get(e),t.div=e,l(bo,this,_o).call(this,t)}}cancel(){var t;const e=new Ht("TextLayer task cancelled.");null===(t=u(oo,this))||void 0===t||t.cancel(e).catch((()=>{})),p(oo,this,null),u($r,this).reject(e)}get textDivs(){return u(go,this)}get textContentItemsStr(){return u(po,this)}static cleanup(){if(!(l(wo,this,To)._.size>0)){l(wo,this,Mo)._.clear();for(const{canvas:t}of l(wo,this,So)._.values())t.remove();l(wo,this,So)._.clear()}}}function yo(t){var e,i;if(u(eo,this))return;null!==(i=(e=u(so,this)).ctx)&&void 0!==i||(e.ctx=xo.call(y,u(no,this)));const n=u(go,this),s=u(po,this);for(const a of t){if(n.length>1e5)return Ct("Ignoring additional textDivs for performance reasons."),void p(eo,this,!0);if(void 0!==a.str)s.push(a.str),l(bo,this,Ao).call(this,a);else if("beginMarkedContentProps"===a.type||"beginMarkedContent"===a.type){const t=u(to,this);p(to,this,document.createElement("span")),u(to,this).classList.add("markedContent"),null!==a.id&&u(to,this).setAttribute("id","".concat(a.id)),t.append(u(to,this))}else"endMarkedContent"===a.type&&p(to,this,u(to,this).parentNode)}}function Ao(t){const e=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:""!==t.str,hasEOL:t.hasEOL,fontSize:0};u(go,this).push(e);const n=qt.transform(u(vo,this),t.transform);let s=Math.atan2(n[1],n[0]);const a=u(uo,this)[t.fontName];a.vertical&&(s+=Math.PI/2);const r=u(io,this)&&a.fontSubstitution||a.fontFamily,o=Math.hypot(n[2],n[3]),h=o*ko.call(y,r,u(no,this));let c,d;0===s?(c=n[4],d=n[5]-h):(c=n[4]+h*Math.sin(s),d=n[5]-h*Math.cos(s));const p="calc(var(--scale-factor)*",f=e.style;u(to,this)===u(lo,this)?(f.left="".concat((100*c/u(ro,this)).toFixed(2),"%"),f.top="".concat((100*d/u(ao,this)).toFixed(2),"%")):(f.left="".concat(p).concat(c.toFixed(2),"px)"),f.top="".concat(p).concat(d.toFixed(2),"px)")),f.fontSize="".concat(p).concat((Co._*o).toFixed(2),"px)"),f.fontFamily=r,i.fontSize=o,e.setAttribute("role","presentation"),e.textContent=t.str,e.dir=t.dir,u(io,this)&&(e.dataset.fontName=a.fontSubstitutionLoadedName||t.fontName),0!==s&&(i.angle=s*(180/Math.PI));let g=!1;if(t.str.length>1)g=!0;else if(" "!==t.str&&t.transform[0]!==t.transform[3]){const e=Math.abs(t.transform[0]),i=Math.abs(t.transform[3]);e!==i&&Math.max(e,i)/Math.min(e,i)>1.5&&(g=!0)}if(g&&(i.canvasWidth=a.vertical?t.height:t.width),u(mo,this).set(e,i),u(so,this).div=e,u(so,this).properties=i,l(bo,this,_o).call(this,u(so,this)),i.hasText&&u(to,this).append(e),i.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation"),u(to,this).append(t)}}function _o(t){const{div:e,properties:i,ctx:n,prevFontSize:s,prevFontFamily:a}=t,{style:r}=e;let o="";if(Co._>1&&(o="scale(".concat(1/Co._,")")),0!==i.canvasWidth&&i.hasText){const{fontFamily:l}=r,{canvasWidth:h,fontSize:c}=i;s===c&&a===l||(n.font="".concat(c*u(co,this),"px ").concat(l),t.prevFontSize=c,t.prevFontFamily=l);const{width:d}=n.measureText(e.textContent);d>0&&(o="scaleX(".concat(h*u(co,this)/d,") ").concat(o))}0!==i.angle&&(o="rotate(".concat(i.angle,"deg) ").concat(o)),o.length>0&&(r.transform=o)}function xo(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=l(y,this,So)._.get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),l(y,this,So)._.set(t,e)}return e}function Eo(){if(null!==l(y,this,Co)._)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.textContent="X",document.body.append(t),Co._=l(y,this,t.getBoundingClientRect().height),t.remove()}function ko(t,e){const i=l(y,this,Mo)._.get(t);if(i)return i;const n=l(y,this,xo).call(this,e),s=n.font;n.canvas.width=n.canvas.height=Zr,n.font="".concat(Zr,"px ").concat(t);const a=n.measureText("");let r=a.fontBoundingBoxAscent,o=Math.abs(a.fontBoundingBoxDescent);if(r){const e=r/(r+o);return l(y,this,Mo)._.set(t,e),n.canvas.width=n.canvas.height=0,n.font=s,e}n.strokeStyle="red",n.clearRect(0,0,Zr,Zr),n.strokeText("g",0,0);let h=n.getImageData(0,0,Zr,Zr).data;o=0;for(let l=h.length-1-3;l>=0;l-=4)if(h[l]>0){o=Math.ceil(l/4/Zr);break}n.clearRect(0,0,Zr,Zr),n.strokeText("A",0,Zr),h=n.getImageData(0,0,Zr,Zr).data,r=0;for(let l=0,d=h.length;l<d;l+=4)if(h[l]>0){r=Zr-Math.floor(l/4/Zr);break}n.canvas.width=n.canvas.height=0,n.font=s;const c=r?r/(r+o):.8;return l(y,this,Mo)._.set(t,c),c}y=wo;var Mo={_:new Map},So={_:new Map},Co={_:null},To={_:new Set};function Ro(){Xe("`renderTextLayer`, please use `TextLayer` instead.");const t=arguments[0],{textContentSource:e,container:i,viewport:n}=t,s=(0,a.A)(t,f),r=Object.keys(s);r.length>0&&Ct("Ignoring `renderTextLayer` parameters: "+r.join(", "));const o=new wo({textContentSource:e,container:i,viewport:n}),{textDivs:l,textContentItemsStr:h}=o;return{promise:o.render(),textDivs:l,textContentItemsStr:h}}function Lo(){Xe("`updateTextLayer`, please use `TextLayer` instead.")}class Po{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};return function t(i){var n;if(!i)return;let s=null;const a=i.name;if("#text"===a)s=i.value;else{if(!Po.shouldBuildText(a))return;null!==i&&void 0!==i&&null!==(n=i.attributes)&&void 0!==n&&n.textContent?s=i.attributes.textContent:i.value&&(s=i.value)}if(null!==s&&e.push({str:s}),i.children)for(const e of i.children)t(e)}(t),i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}const Fo=65536,Io=T?class extends ce{_createCanvas(t,e){return ua.get("canvas").createCanvas(t,e)}}:class extends ce{constructor(){let{ownerDocument:t=globalThis.document,enableHWA:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super({enableHWA:e}),this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");return i.width=t,i.height=e,i}},Do=T?class extends de{_fetchData(t,e){return pa(t).then((t=>({cMapData:t,compressionType:e})))}}:De,Oo=T?class extends le{}:class extends le{constructor(){let{docId:t,ownerDocument:e=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),o(this,_e),d(this,me,void 0),d(this,ve,void 0),d(this,be,void 0),d(this,we,void 0),d(this,ye,void 0),d(this,Ae,0),p(be,this,t),p(we,this,e)}addFilter(t){var e,i;if(!t)return"none";let n=h(_e,this,xe).get(t);if(n)return n;const[s,a,r]=l(_e,this,Me).call(this,t),o=1===t.length?s:"".concat(s).concat(a).concat(r);if(n=h(_e,this,xe).get(o),n)return h(_e,this,xe).set(t,n),n;const c="g_".concat(u(be,this),"_transfer_map_").concat((p(Ae,this,(e=u(Ae,this),i=e++,e)),i)),d="url(#".concat(c,")");h(_e,this,xe).set(t,d),h(_e,this,xe).set(o,d);const f=l(_e,this,Te).call(this,c);return l(_e,this,Le).call(this,s,a,r,f),d}addHCMFilter(t,e){var i;const n="".concat(t,"-").concat(e),s="base";let a=h(_e,this,Ee).get(s);if((null===(i=a)||void 0===i?void 0:i.key)===n)return a.url;var r;a?(null===(r=a.filter)||void 0===r||r.remove(),a.key=n,a.url="none",a.filter=null):(a={key:n,url:"none",filter:null},h(_e,this,Ee).set(s,a));if(!t||!e)return a.url;const o=l(_e,this,Fe).call(this,t);t=qt.makeHexColor(...o);const c=l(_e,this,Fe).call(this,e);if(e=qt.makeHexColor(...c),h(_e,this,ke).style.color="","#000000"===t&&"#ffffff"===e||t===e)return a.url;const d=new Array(256);for(let l=0;l<=255;l++){const t=l/255;d[l]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const p=d.join(","),f="g_".concat(u(be,this),"_hcm_filter"),g=a.filter=l(_e,this,Te).call(this,f);l(_e,this,Le).call(this,p,p,p,g),l(_e,this,Ce).call(this,g);const m=(t,e)=>{const i=o[t]/255,n=c[t]/255,s=new Array(e+1);for(let a=0;a<=e;a++)s[a]=i+a/e*(n-i);return s.join(",")};return l(_e,this,Le).call(this,m(0,5),m(1,5),m(2,5),g),a.url="url(#".concat(f,")"),a.url}addAlphaFilter(t){var e,i;let n=h(_e,this,xe).get(t);if(n)return n;const[s]=l(_e,this,Me).call(this,[t]),a="alpha_".concat(s);if(n=h(_e,this,xe).get(a),n)return h(_e,this,xe).set(t,n),n;const r="g_".concat(u(be,this),"_alpha_map_").concat((p(Ae,this,(e=u(Ae,this),i=e++,e)),i)),o="url(#".concat(r,")");h(_e,this,xe).set(t,o),h(_e,this,xe).set(a,o);const c=l(_e,this,Te).call(this,r);return l(_e,this,Pe).call(this,s,c),o}addLuminosityFilter(t){var e,i;let n,s,a=h(_e,this,xe).get(t||"luminosity");if(a)return a;if(t?([n]=l(_e,this,Me).call(this,[t]),s="luminosity_".concat(n)):s="luminosity",a=h(_e,this,xe).get(s),a)return h(_e,this,xe).set(t,a),a;const r="g_".concat(u(be,this),"_luminosity_map_").concat((p(Ae,this,(e=u(Ae,this),i=e++,e)),i)),o="url(#".concat(r,")");h(_e,this,xe).set(t,o),h(_e,this,xe).set(s,o);const c=l(_e,this,Te).call(this,r);return l(_e,this,Se).call(this,c),t&&l(_e,this,Pe).call(this,n,c),o}addHighlightHCMFilter(t,e,i,n,s){var a;const r="".concat(e,"-").concat(i,"-").concat(n,"-").concat(s);let o=h(_e,this,Ee).get(t);if((null===(a=o)||void 0===a?void 0:a.key)===r)return o.url;var c;o?(null===(c=o.filter)||void 0===c||c.remove(),o.key=r,o.url="none",o.filter=null):(o={key:r,url:"none",filter:null},h(_e,this,Ee).set(t,o));if(!e||!i)return o.url;const[d,p]=[e,i].map(l(_e,this,Fe).bind(this));let f=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),g=Math.round(.2126*p[0]+.7152*p[1]+.0722*p[2]),[m,v]=[n,s].map(l(_e,this,Fe).bind(this));g<f&&([f,g,m,v]=[g,f,v,m]),h(_e,this,ke).style.color="";const b=(t,e,i)=>{const n=new Array(256),s=(g-f)/i,a=t/255,r=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(f+l*s),e=a+l*r;for(let i=o;i<=t;i++)n[i]=e;o=t+1}for(let l=o;l<256;l++)n[l]=n[o-1];return n.join(",")},w="g_".concat(u(be,this),"_hcm_").concat(t,"_filter"),y=o.filter=l(_e,this,Te).call(this,w);return l(_e,this,Ce).call(this,y),l(_e,this,Le).call(this,b(m[0],v[0],5),b(m[1],v[1],5),b(m[2],v[2],5),y),o.url="url(#".concat(w,")"),o.url}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&0!==h(_e,this,Ee).size||(u(ve,this)&&(u(ve,this).parentNode.parentNode.remove(),p(ve,this,null)),u(me,this)&&(u(me,this).clear(),p(me,this,null)),p(Ae,this,0))}},No=T?class extends ue{_fetchData(t){return pa(t)}}:Oe;function Wo(){var t,e;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"===typeof i||i instanceof URL?i={url:i}:(i instanceof ArrayBuffer||ArrayBuffer.isView(i))&&(i={data:i});const n=new Ho,{docId:s}=n,a=i.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch(e){if(T&&"string"===typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(i.url):null,r=i.data?function(t){if(T&&"undefined"!==typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"===typeof t)return jt(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===typeof t&&!isNaN(null===t||void 0===t?void 0:t.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(i.data):null,o=i.httpHeaders||null,l=!0===i.withCredentials,h=null!==(t=i.password)&&void 0!==t?t:null,c=i.range instanceof jo?i.range:null,d=Number.isInteger(i.rangeChunkSize)&&i.rangeChunkSize>0?i.rangeChunkSize:Fo;let u=i.worker instanceof el?i.worker:null;const p=i.verbosity,f="string"!==typeof i.docBaseUrl||He(i.docBaseUrl)?null:i.docBaseUrl,g="string"===typeof i.cMapUrl?i.cMapUrl:null,m=!1!==i.cMapPacked,v=i.CMapReaderFactory||Do,b="string"===typeof i.standardFontDataUrl?i.standardFontDataUrl:null,w=i.StandardFontDataFactory||No,y=!0!==i.stopAtErrors,A=Number.isInteger(i.maxImageSize)&&i.maxImageSize>-1?i.maxImageSize:-1,_=!1!==i.isEvalSupported,x="boolean"===typeof i.isOffscreenCanvasSupported?i.isOffscreenCanvasSupported:!T,E=Number.isInteger(i.canvasMaxAreaInBytes)?i.canvasMaxAreaInBytes:-1,k="boolean"===typeof i.disableFontFace?i.disableFontFace:T,M=!0===i.fontExtraProperties,S=!0===i.enableXfa,C=i.ownerDocument||globalThis.document,R=!0===i.disableRange,L=!0===i.disableStream,P=!0===i.disableAutoFetch,F=!0===i.pdfBug,I=!0===i.enableHWA,D=c?c.length:null!==(e=i.length)&&void 0!==e?e:NaN,O="boolean"===typeof i.useSystemFonts?i.useSystemFonts:!T&&!k,N="boolean"===typeof i.useWorkerFetch?i.useWorkerFetch:v===De&&w===Oe&&g&&b&&Ue(g,document.baseURI)&&Ue(b,document.baseURI),W=i.canvasFactory||new Io({ownerDocument:C,enableHWA:I}),z=i.filterFactory||new Oo({docId:s,ownerDocument:C});kt(p);const H={canvasFactory:W,filterFactory:z};if(N||(H.cMapReaderFactory=new v({baseUrl:g,isCompressed:m}),H.standardFontDataFactory=new w({baseUrl:b})),!u){const t={verbosity:p,port:Ua.workerPort};u=t.port?el.fromPort(t):new el(t),n._worker=u}const B={docId:s,apiVersion:"4.4.168",data:r,password:h,disableAutoFetch:P,rangeChunkSize:d,length:D,docBaseUrl:f,enableXfa:S,evaluatorOptions:{maxImageSize:A,disableFontFace:k,ignoreErrors:y,isEvalSupported:_,isOffscreenCanvasSupported:x,canvasMaxAreaInBytes:E,fontExtraProperties:M,useSystemFonts:O,cMapUrl:N?g:null,standardFontDataUrl:N?b:null}},j={disableFontFace:k,fontExtraProperties:M,ownerDocument:C,pdfBug:F,styleElement:null,loadingParams:{disableAutoFetch:P,enableXfa:S}};return u.promise.then((function(){if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const t=u.messageHandler.sendWithPromise("GetDocRequest",B,r?[r.buffer]:null);let e;if(c)e=new Mr(c,{disableRange:R,disableStream:L});else if(!r){if(!a)throw new Error("getDocument - no `url` parameter provided.");e=(t=>{if(T){return function(){return"undefined"!==typeof fetch&&"undefined"!==typeof Response&&"body"in Response.prototype}()&&Ue(t.url)?new Or(t):new Gr(t)}return Ue(t.url)?new Or(t):new Hr(t)})({url:a,length:D,httpHeaders:o,withCredentials:l,rangeChunkSize:d,disableRange:R,disableStream:L})}return t.then((t=>{if(n.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const i=new rr(s,t,u.port),a=new dl(i,n,e,j,H);n._transport=a,i.send("Ready",null)}))})).catch(n._capability.reject),n}function zo(t){return"object"===typeof t&&Number.isInteger(null===t||void 0===t?void 0:t.num)&&t.num>=0&&Number.isInteger(null===t||void 0===t?void 0:t.gen)&&t.gen>=0}class Ho{constructor(){var t,e;this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d".concat((Bo._=(t=Bo._,e=t++,t),e)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{var t,e;null!==(t=this._worker)&&void 0!==t&&t.port&&(this._worker._pendingDestroy=!0),await(null===(e=this._transport)||void 0===e?void 0:e.destroy())}catch(n){var i;throw null!==(i=this._worker)&&void 0!==i&&i.port&&delete this._worker._pendingDestroy,n}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}var Bo={_:0};class jo{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const i of this._progressListeners)i(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){Tt("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class Vo{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Pt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var Go=new WeakMap,Uo=new WeakMap,qo=new WeakSet;class Xo{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];o(this,qo),d(this,Go,null),d(this,Uo,!1),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=n?new Ge:null,this._pdfBug=n,this.commonObjs=i.commonObjs,this.objs=new ml,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:n=0,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new We({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:n,dontFlip:s})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Pt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,i;let{canvasContext:n,viewport:s,intent:a="display",annotationMode:r=H.ENABLE,transform:o=null,background:h=null,optionalContentConfigPromise:c=null,annotationCanvasMap:d=null,pageColors:u=null,printAnnotationStorage:f=null}=t;null===(e=this._stats)||void 0===e||e.time("Overall");const g=this._transport.getRenderingIntent(a,r,f),{renderingIntent:m,cacheKey:v}=g;p(Uo,this,!1),l(qo,this,Ko).call(this),c||(c=this._transport.getOptionalContentConfig(m));let b=this._intentStates.get(v);b||(b=Object.create(null),this._intentStates.set(v,b)),b.streamReaderCancelTimeout&&(clearTimeout(b.streamReaderCancelTimeout),b.streamReaderCancelTimeout=null);const w=!!(m&D);var y;b.displayReadyCapability||(b.displayReadyCapability=Promise.withResolvers(),b.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(y=this._stats)||void 0===y||y.time("Page Request"),this._pumpOperatorList(g));const A=t=>{var e;(b.renderTasks.delete(_),(this._maybeCleanupAfterRender||w)&&p(Uo,this,!0),l(qo,this,Yo).call(this,!w),t?(_.capability.reject(t),this._abortOperatorList({intentState:b,reason:t instanceof Error?t:new Error(t)})):_.capability.resolve(),this._stats)&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!==(e=globalThis.Stats)&&void 0!==e&&e.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},_=new Al({callback:A,params:{canvasContext:n,viewport:s,transform:o,background:h},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:d,operatorList:b.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!w,pdfBug:this._pdfBug,pageColors:u});((i=b).renderTasks||(i.renderTasks=new Set)).add(_);const x=_.task;return Promise.all([b.displayReadyCapability.promise,c]).then((t=>{var e;let[i,n]=t;if(this.destroyed)A();else{if(null===(e=this._stats)||void 0===e||e.time("Rendering"),!(n.renderingIntent&m))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");_.initializeGraphics({transparency:i,optionalContentConfig:n}),_.operatorListChanged()}})).catch(A),x}getOperatorList(){let{intent:t="display",annotationMode:e=H.ENABLE,printAnnotationStorage:i=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=this._transport.getRenderingIntent(t,e,i,!0);let s,a=this._intentStates.get(n.cacheKey);var r,o;(a||(a=Object.create(null),this._intentStates.set(n.cacheKey,a)),a.opListReadCapability)||(s=Object.create(null),s.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(s))},a.opListReadCapability=Promise.withResolvers(),((r=a).renderTasks||(r.renderTasks=new Set)).add(s),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(o=this._stats)||void 0===o||o.time("Page Request"),this._pumpOperatorList(n));return a.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((t=>Po.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,i){const n=e.getReader(),s={items:[],styles:Object.create(null),lang:null};!function e(){n.read().then((function(i){var n;let{value:a,done:r}=i;r?t(s):(null!==(n=s.lang)&&void 0!==n||(s.lang=a.lang),Object.assign(s.styles,a.styles),s.items.push(...a.items),e())}),i)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),p(Uo,this,!1),l(qo,this,Ko).call(this),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];p(Uo,this,!0);const e=l(qo,this,Yo).call(this,!1);return t&&e&&this._stats&&(this._stats=new Ge),e}_startRenderPage(t,e){var i,n;const s=this._intentStates.get(e);s&&(null===(i=this._stats)||void 0===i||i.timeEnd("Page Request"),null===(n=s.displayReadyCapability)||void 0===n||n.resolve(t))}_renderPageChunk(t,e){for(let i=0,n=t.length;i<n;i++)e.operatorList.fnArray.push(t.fnArray[i]),e.operatorList.argsArray.push(t.argsArray[i]);e.operatorList.lastChunk=t.lastChunk,e.operatorList.separateAnnots=t.separateAnnots;for(const i of e.renderTasks)i.operatorListChanged();t.lastChunk&&l(qo,this,Yo).call(this,!0)}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:i,annotationStorageSerializable:n}=t;const{map:s,transfer:a}=n,r=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:s},a).getReader(),o=this._intentStates.get(i);o.streamReader=r;const h=()=>{r.read().then((t=>{let{value:e,done:i}=t;i?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,o),h())}),(t=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const t of o.renderTasks)t.operatorListChanged();l(qo,this,Yo).call(this,!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(t);else{if(!o.opListReadCapability)throw t;o.opListReadCapability.reject(t)}}}))};h()}_abortOperatorList(t){let{intentState:e,reason:i,force:n=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!n){if(e.renderTasks.size>0)return;if(i instanceof ze){let t=100;return i.extraDelay>0&&i.extraDelay<1e3&&(t+=i.extraDelay),void(e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})}),t))}}if(e.streamReader.cancel(new Ht(i.message)).catch((()=>{})),e.streamReader=null,!this._transport.destroyed){for(const[t,i]of this._intentStates)if(i===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}function Yo(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(l(qo,this,Ko).call(this),!u(Uo,this)||this.destroyed)return!1;if(t)return p(Go,this,setTimeout((()=>{p(Go,this,null),l(qo,this,Yo).call(this,!1)}),5e3)),!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),p(Uo,this,!1),!0}function Ko(){u(Go,this)&&(clearTimeout(u(Go,this)),p(Go,this,null))}var Jo=new WeakMap,Qo=new WeakMap;class Zo{constructor(){d(this,Jo,new Set),d(this,Qo,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};u(Qo,this).then((()=>{for(const t of u(Jo,this))t.call(this,i)}))}addEventListener(t,e){u(Jo,this).add(e)}removeEventListener(t,e){u(Jo,this).delete(e)}terminate(){u(Jo,this).clear()}}const $o={isWorkerDisabled:!1,fakeWorkerId:0};T&&($o.isWorkerDisabled=!0,Ua.workerSrc||(Ua.workerSrc="./pdf.worker.mjs")),$o.isSameOrigin=function(t,e){let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch(s){return!1}const n=new URL(e,i);return i.origin===n.origin},$o.createCDNWrapper=function(t){const e='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};var tl=new WeakSet;class el{constructor(){let{name:t=null,port:e=null,verbosity:i=Mt()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o(this,tl),this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){var n;if(null!==(n=sl._)&&void 0!==n&&n.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(sl._||(sl._=new WeakMap)).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return T?Promise.all([ua.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new rr("main","worker",t),this._messageHandler.on("ready",(function(){})),l(tl,this,il).call(this)}_initialize(){if($o.isWorkerDisabled||nl(el))return void this._setupFakeWorker();let{workerSrc:t}=el;try{$o.isSameOrigin(window.location.href,t)||(t=$o.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new rr("main","worker",e),n=()=>{s.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;e.addEventListener("error",(()=>{this._webWorker||n()}),{signal:s.signal}),i.on("test",(t=>{s.abort(),!this.destroyed&&t?(this._messageHandler=i,this._port=e,this._webWorker=e,l(tl,this,il).call(this)):n()})),i.on("ready",(t=>{if(s.abort(),this.destroyed)n();else try{a()}catch(e){this._setupFakeWorker()}}));const a=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void a()}catch(e){St("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){$o.isWorkerDisabled||(Ct("Setting up fake worker."),$o.isWorkerDisabled=!0),el._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new Zo;this._port=e;const i="fake".concat($o.fakeWorkerId++),n=new rr(i+"_worker",i,e);t.setup(n,e),this._messageHandler=new rr(i,i+"_worker",e),l(tl,this,il).call(this)})).catch((t=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))}))}destroy(){var t;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null===(t=sl._)||void 0===t||t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){var e;if(null===t||void 0===t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const i=null===(e=l(el,this,sl)._)||void 0===e?void 0:e.get(t.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new el(t)}static get workerSrc(){if(Ua.workerSrc)return Ua.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Pt(this,"_setupFakeWorkerGlobal",(async()=>{if(h(el,this,nl))return h(el,this,nl);return(await i(77724)(this.workerSrc)).WorkerMessageHandler})())}}function il(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}function nl(t){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch(i){return null}}var sl={_:void 0},al=new WeakMap,rl=new WeakMap,ol=new WeakMap,ll=new WeakMap,hl=new WeakMap,cl=new WeakSet;class dl{constructor(t,e,i,n,s){o(this,cl),d(this,al,new Map),d(this,rl,new Map),d(this,ol,new Map),d(this,ll,new Map),d(this,hl,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new ml,this.fontLoader=new la({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return Pt(this,"annotationStorage",new na)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=I,a=$s;switch(t){case"any":s=F;break;case"display":break;case"print":s=D;break;default:Ct("getRenderingIntent - invalid intent: ".concat(t))}switch(e){case H.DISABLE:s+=W;break;case H.ENABLE:break;case H.ENABLE_FORMS:s+=O;break;case H.ENABLE_STORAGE:s+=N;a=(s&D&&i instanceof ra?i:this.annotationStorage).serializable;break;default:Ct("getRenderingIntent - invalid annotationMode: ".concat(e))}return n&&(s+=z),{renderingIntent:s,cacheKey:"".concat(s,"_").concat(a.hash),annotationStorageSerializable:a}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null===(t=u(hl,this))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const n of u(rl,this).values())e.push(n._destroy());u(rl,this).clear(),u(ol,this).clear(),u(ll,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return e.push(i),Promise.all(e).then((()=>{var t;this.commonObjs.clear(),this.fontLoader.clear(),u(al,this).clear(),this.filterFactory.destroy(),wo.cleanup(),null===(t=this._networkStream)||void 0===t||t.cancelAllRequests(new Ht("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{Rt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then((function(t){let{value:i,done:n}=t;n?e.close():(Rt(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(t=>{const i=Promise.withResolvers(),n=this._fullReader;return n.headersReady.then((()=>{if(!n.isStreamingSupported||!n.isRangeSupported){var t;if(this._lastProgress)null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress);n.onProgress=t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}}i.resolve({isStreamingSupported:n.isStreamingSupported,isRangeSupported:n.isRangeSupported,contentLength:n.contentLength})}),i.reject),i.promise})),t.on("GetRangeReader",((t,e)=>{Rt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then((function(t){let{value:i,done:n}=t;n?e.close():(Rt(i instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{i.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}):e.close()})),t.on("GetDoc",(t=>{let{pdfInfo:i}=t;this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new Vo(i,this))})),t.on("DocException",(function(t){let i;switch(t.name){case"PasswordException":i=new It(t.message,t.code);break;case"InvalidPDFException":i=new Ot(t.message);break;case"MissingPDFException":i=new Nt(t.message);break;case"UnexpectedResponseException":i=new Wt(t.message,t.status);break;case"UnknownErrorException":i=new Dt(t.message,t.details);break;default:Tt("DocException - expected a valid Error.")}e._capability.reject(i)})),t.on("PasswordRequest",(t=>{if(p(hl,this,Promise.withResolvers()),e.onPassword){const n=t=>{t instanceof Error?u(hl,this).reject(t):u(hl,this).resolve({password:t})};try{e.onPassword(n,t.code)}catch(i){u(hl,this).reject(i)}}else u(hl,this).reject(new It(t.message,t.code));return u(hl,this).promise})),t.on("DataLoaded",(t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{if(this.destroyed)return;u(rl,this).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(e=>{var i;let[n,s,a]=e;if(this.destroyed)return null;if(this.commonObjs.has(n))return null;switch(s){case"Font":const{disableFontFace:e,fontExtraProperties:r,pdfBug:o}=this._params;if("error"in a){const t=a.error;Ct("Error during font loading: ".concat(t)),this.commonObjs.resolve(n,t);break}const l=o&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,h=new ha(a,{disableFontFace:e,inspectFont:l});this.fontLoader.bind(h).catch((()=>t.sendWithPromise("FontFallback",{id:n}))).finally((()=>{!r&&h.data&&(h.data=null),this.commonObjs.resolve(n,h)}));break;case"CopyLocalImage":const{imageRef:c}=a;Rt(c,"The imageRef must be defined.");for(const t of u(rl,this).values())for(const[,e]of t.objs)if((null===e||void 0===e?void 0:e.ref)===c)return e.dataLen?(this.commonObjs.resolve(n,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(n,a);break;default:throw new Error("Got unknown common object type ".concat(s))}return null})),t.on("obj",(t=>{let[e,i,n,s]=t;if(this.destroyed)return;const a=u(rl,this).get(i);var r;if(!a.objs.has(e))if(0!==a._intentStates.size)switch(n){case"Image":a.objs.resolve(e,s),(null===s||void 0===s?void 0:s.dataLen)>1e7&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(e,s);break;default:throw new Error("Got unknown object type ".concat(n))}else null===s||void 0===s||null===(r=s.bitmap)||void 0===r||r.close()})),t.on("DocProgress",(t=>{var i;this.destroyed||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})})),t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t,e;this.annotationStorage.size<=0&&Ct("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:n}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null},n).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=u(ol,this).get(e);if(i)return i;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&u(ll,this).set(i.refStr,t);const n=new Xo(e,i,this,this._params.pdfBug);return u(rl,this).set(e,n),n}));return u(ol,this).set(e,n),n}getPageIndex(t){return zo(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return l(cl,this,ul).call(this,"GetFieldObjects")}hasJSActions(){return l(cl,this,ul).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!==typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return l(cl,this,ul).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return l(cl,this,ul).call(this,"GetOptionalContentConfig").then((e=>new Er(e,t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=u(al,this).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then((t=>{var e,i,n,s;return{info:t[0],metadata:t[1]?new ur(t[1]):null,contentDispositionFilename:null!==(e=null===(i=this._fullReader)||void 0===i?void 0:i.filename)&&void 0!==e?e:null,contentLength:null!==(n=null===(s=this._fullReader)||void 0===s?void 0:s.contentLength)&&void 0!==n?n:null}}));return u(al,this).set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of u(rl,this).values()){if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."))}this.commonObjs.clear(),t||this.fontLoader.clear(),u(al,this).clear(),this.filterFactory.destroy(!0),wo.cleanup()}}cachedPageNumber(t){var e;if(!zo(t))return null;const i=0===t.gen?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return null!==(e=u(ll,this).get(i))&&void 0!==e?e:null}}function ul(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=u(al,this).get(t);if(i)return i;const n=this.messageHandler.sendWithPromise(t,e);return u(al,this).set(t,n),n}const pl=Symbol("INITIAL_DATA");var fl=new WeakMap,gl=new WeakSet;class ml{constructor(){o(this,gl),d(this,fl,Object.create(null))}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=l(gl,this,vl).call(this,t);return i.promise.then((()=>e(i.data))),null}const i=u(fl,this)[t];if(!i||i.data===pl)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}has(t){const e=u(fl,this)[t];return!!e&&e.data!==pl}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=l(gl,this,vl).call(this,t);i.data=e,i.resolve()}clear(){for(const e in u(fl,this)){var t;const{data:i}=u(fl,this)[e];null===i||void 0===i||null===(t=i.bitmap)||void 0===t||t.close()}p(fl,this,Object.create(null))}*[Symbol.iterator](){for(const t in u(fl,this)){const{data:e}=u(fl,this)[t];e!==pl&&(yield[t,e])}}}function vl(t){var e;return(e=u(fl,this))[t]||(e[t]=(0,n.A)((0,n.A)({},Promise.withResolvers()),{},{data:pl}))}var bl=new WeakMap;class wl{constructor(t){d(this,bl,null),p(bl,this,t),this.onContinue=null}get promise(){return u(bl,this).capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;u(bl,this).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=u(bl,this).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=u(bl,this);return t.form||t.canvas&&(null===e||void 0===e?void 0:e.size)>0}}var yl=new WeakMap;class Al{constructor(t){let{callback:e,params:i,objs:n,commonObjs:s,annotationCanvasMap:a,operatorList:r,pageIndex:o,canvasFactory:l,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:u=!1,pageColors:p=null}=t;d(this,yl,null),this.callback=e,this.params=i,this.objs=n,this.commonObjs=s,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=h,this._pdfBug=u,this.pageColors=p,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new wl(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){var e,i;let{transparency:n=!1,optionalContentConfig:s}=t;if(this.cancelled)return;if(this._canvas){if(_l._.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");_l._.add(this._canvas)}this._pdfBug&&null!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:a,viewport:r,transform:o,background:l}=this.params;this.gfx=new ja(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:s},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:r,transparency:n,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null===(i=this.graphicsReadyCallback)||void 0===i||i.call(this)}cancel(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(t=this.gfx)||void 0===t||t.endDrawing(),u(yl,this)&&(window.cancelAnimationFrame(u(yl,this)),p(yl,this,null)),_l._.delete(this._canvas),this.callback(e||new ze("Rendering cancelled, page ".concat(this._pageIndex+1),i))}operatorListChanged(){var t;this.graphicsReady?(null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?p(yl,this,window.requestAnimationFrame((()=>{p(yl,this,null),this._nextBound().catch(this._cancelBound)}))):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),_l._.delete(this._canvas),this.callback())))}}var _l={_:new WeakSet};const xl="4.4.168",El="19fbc8998";function kl(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function Ml(t){return Math.max(0,Math.min(255,255*t))}class Sl{static CMYK_G(t){let[e,i,n,s]=t;return["G",1-Math.min(1,.3*e+.59*n+.11*i+s)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_rgb(t){let[e]=t;return e=Ml(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=kl(e);return"#".concat(i).concat(i).concat(i)}static RGB_G(t){let[e,i,n]=t;return["G",.3*e+.59*i+.11*n]}static RGB_rgb(t){return t.map(Ml)}static RGB_HTML(t){return"#".concat(t.map(kl).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){let[e,i,n,s]=t;return["RGB",1-Math.min(1,e+s),1-Math.min(1,n+s),1-Math.min(1,i+s)]}static CMYK_rgb(t){let[e,i,n,s]=t;return[Ml(1-Math.min(1,e+s)),Ml(1-Math.min(1,n+s)),Ml(1-Math.min(1,i+s))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,i,n]=t;const s=1-e,a=1-i,r=1-n;return["CMYK",s,a,r,Math.min(s,a,r)]}}class Cl{static setupStorage(t,e,i,n,s){const a=n.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==a.value&&(t.textContent=a.value),"print"===s)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(a.value===i.attributes.xfaOn?t.setAttribute("checked",!0):a.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===s)break;t.addEventListener("change",(t=>{n.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{if(null!==a.value&&t.setAttribute("value",a.value),"print"===s)break;t.addEventListener("input",(t=>{n.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==a.value){t.setAttribute("value",a.value);for(const t of i.children)t.attributes.value===a.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",(t=>{const i=t.target.options,s=-1===i.selectedIndex?"":i[i.selectedIndex].value;n.setValue(e,{value:s})}))}}static setAttributes(t){let{html:e,element:i,storage:n=null,intent:s,linkService:a}=t;const{attributes:r}=i,o=e instanceof HTMLAnchorElement;"radio"===r.type&&(r.name="".concat(r.name,"-").concat(s));for(const[l,h]of Object.entries(r))if(null!==h&&void 0!==h)switch(l){case"class":h.length&&e.setAttribute(l,h.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",h);break;case"style":Object.assign(e.style,h);break;case"textContent":e.textContent=h;break;default:(!o||"href"!==l&&"newWindow"!==l)&&e.setAttribute(l,h)}o&&a.addLinkAttributes(e,r.href,r.newWindow),n&&r.dataId&&this.setupStorage(e,r.dataId,i,n)}static render(t){const e=t.annotationStorage,i=t.linkService,n=t.xfaHtml,s=t.intent||"display",a=document.createElement(n.name);n.attributes&&this.setAttributes({html:a,element:n,intent:s,linkService:i});const r="richText"!==s,o=t.div;if(o.append(a),t.viewport){const e="matrix(".concat(t.viewport.transform.join(","),")");o.style.transform=e}r&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const t=document.createTextNode(n.value);a.append(t),r&&Po.shouldBuildText(n.name)&&l.push(t)}return{textDivs:l}}const h=[[n,-1,a]];for(;h.length>0;){var c,d;const[t,n,a]=h.at(-1);if(n+1===t.children.length){h.pop();continue}const o=t.children[++h.at(-1)[1]];if(null===o)continue;const{name:u}=o;if("#text"===u){const t=document.createTextNode(o.value);l.push(t),a.append(t);continue}const p=null!==o&&void 0!==o&&null!==(c=o.attributes)&&void 0!==c&&c.xmlns?document.createElementNS(o.attributes.xmlns,u):document.createElement(u);if(a.append(p),o.attributes&&this.setAttributes({html:p,element:o,storage:e,intent:s,linkService:i}),(null===(d=o.children)||void 0===d?void 0:d.length)>0)h.push([o,-1,p]);else if(o.value){const t=document.createTextNode(o.value);r&&Po.shouldBuildText(u)&&l.push(t),p.append(t)}}for(const u of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=e,t.div.hidden=!1}}const Tl=1e3,Rl=new WeakSet;function Ll(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class Pl{static create(t){switch(t.data.annotationType){case Z:return new Hl(t);case Q:return new Gl(t);case ft:switch(t.data.fieldType){case"Tx":return new ql(t);case"Btn":return t.data.radioButton?new Kl(t):t.data.checkBox?new Yl(t):new Jl(t);case"Ch":return new Ql(t);case"Sig":return new Xl(t)}return new Ul(t);case ut:return new Zl(t);case $:return new Th(t);case tt:return new Lh(t);case et:return new Fh(t);case it:return new Dh(t);case st:return new Nh(t);case ct:return new zh(t);case dt:return new Bh(t);case nt:return new Wh(t);case at:return new jh(t);case rt:return new Vh(t);case ot:return new Gh(t);case lt:return new Uh(t);case ht:return new qh(t);case pt:return new Kh(t);default:return new Nl(t)}}}var Fl=new WeakMap,Il=new WeakMap,Dl=new WeakMap,Ol=new WeakSet;class Nl{constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,Ol),d(this,Fl,null),d(this,Il,!1),d(this,Dl,null),this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),n&&this._createQuadrilaterals()}static _hasPopupData(t){let{titleObj:e,contentsObj:i,richText:n}=t;return!!(null!==e&&void 0!==e&&e.str||null!==i&&void 0!==i&&i.str||null!==n&&void 0!==n&&n.str)}get hasPopupData(){return Nl._hasPopupData(this.data)}updateEdited(t){var e;if(!this.container)return;u(Fl,this)||p(Fl,this,{rect:this.data.rect.slice(0)});const{rect:i}=t;i&&l(Ol,this,Wl).call(this,i),null===(e=u(Dl,this))||void 0===e||e.popup.updateEdited(t)}resetEdited(){var t;u(Fl,this)&&(l(Ol,this,Wl).call(this,u(Fl,this).rect),null===(t=u(Dl,this))||void 0===t||t.popup.resetEdited(),p(Fl,this,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:n}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",e.id),this instanceof Ul||(s.tabIndex=Tl);const{style:a}=s;if(a.zIndex=this.parent.zIndex++,e.popupRef&&s.setAttribute("aria-haspopup","dialog"),e.alternativeText&&(s.title=e.alternativeText),e.noRotate&&s.classList.add("norotate"),!e.rect||this instanceof Zl){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,s),s}const{width:r,height:o}=Ll(e.rect);if(!t&&e.borderStyle.width>0){a.borderWidth="".concat(e.borderStyle.width,"px");const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e="calc(".concat(t,"px * var(--scale-factor)) / calc(").concat(i,"px * var(--scale-factor))");a.borderRadius=e}else if(this instanceof Kl){const t="calc(".concat(r,"px * var(--scale-factor)) / calc(").concat(o,"px * var(--scale-factor))");a.borderRadius=t}switch(e.borderStyle.style){case gt:a.borderStyle="solid";break;case mt:a.borderStyle="dashed";break;case vt:Ct("Unimplemented border style: beveled");break;case bt:Ct("Unimplemented border style: inset");break;case wt:a.borderBottomStyle="solid"}const n=e.borderColor||null;n?(p(Il,this,!0),a.borderColor=qt.makeHexColor(0|n[0],0|n[1],0|n[2])):a.borderWidth=0}const l=qt.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:h,pageHeight:c,pageX:d,pageY:u}=n.rawDims;a.left="".concat(100*(l[0]-d)/h,"%"),a.top="".concat(100*(l[1]-u)/c,"%");const{rotation:f}=e;return e.hasOwnCanvas||0===f?(a.width="".concat(100*r/h,"%"),a.height="".concat(100*o/c,"%")):this.setRotation(f,s),s}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:i,pageHeight:n}=this.parent.viewport.rawDims,{width:s,height:a}=Ll(this.data.rect);let r,o;t%180===0?(r=100*s/i,o=100*a/n):(r=100*a/i,o=100*s/n),e.style.width="".concat(r,"%"),e.style.height="".concat(o,"%"),e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,i)=>{const n=i.detail[t],s=n[0],a=n.slice(1);i.target.style[e]=Sl["".concat(s,"_HTML")](a),this.annotationStorage.setValue(this.data.id,{[e]:Sl["".concat(s,"_rgb")](a)})};return Pt(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const n of Object.keys(e.detail)){const s=t[n]||i[n];null===s||void 0===s||s(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[n,s]of Object.entries(e)){const a=i[n];if(a){a({detail:{[n]:s},target:t}),delete e[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,n,s]=this.data.rect.map((t=>Math.fround(t)));if(8===t.length){const[a,r,o,l]=t.subarray(2,6);if(n===a&&s===r&&e===o&&i===l)return}const{style:a}=this.container;let r;if(u(Il,this)){const{borderColor:t,borderWidth:e}=a;a.borderWidth=0,r=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">','<g fill="transparent" stroke="'.concat(t,'" stroke-width="').concat(e,'">')],this.container.classList.add("hasBorder")}const o=n-e,l=s-i,{svgFactory:h}=this,c=h.createElement("svg");c.classList.add("quadrilateralsContainer"),c.setAttribute("width",0),c.setAttribute("height",0);const d=h.createElement("defs");c.append(d);const p=h.createElement("clipPath"),f="clippath_".concat(this.data.id);p.setAttribute("id",f),p.setAttribute("clipPathUnits","objectBoundingBox"),d.append(p);for(let u=2,m=t.length;u<m;u+=8){var g;const i=t[u],n=t[u+1],a=t[u+2],c=t[u+3],d=h.createElement("rect"),f=(a-e)/o,m=(s-n)/l,v=(i-a)/o,b=(n-c)/l;d.setAttribute("x",f),d.setAttribute("y",m),d.setAttribute("width",v),d.setAttribute("height",b),p.append(d),null===(g=r)||void 0===g||g.push('<rect vector-effect="non-scaling-stroke" x="'.concat(f,'" y="').concat(m,'" width="').concat(v,'" height="').concat(b,'"/>'))}u(Il,this)&&(r.push("</g></svg>')"),a.backgroundImage=r.join("")),this.container.append(c),this.container.style.clipPath="url(#".concat(f,")")}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const i=p(Dl,this,new Zl({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_".concat(e.id),rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}render(){Tt("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[];if(this._fieldObjects){const n=this._fieldObjects[t];if(n)for(const{page:t,id:s,exportValues:a}of n){if(-1===t)continue;if(s===e)continue;const n="string"===typeof a?a:null,r=document.querySelector('[data-element-id="'.concat(s,'"]'));!r||Rl.has(r)?i.push({id:s,exportValue:n,domElement:r}):Ct("_getElementsByName - element not allowed: ".concat(s))}return i}for(const n of document.getElementsByName(t)){const{exportValue:t}=n,s=n.getAttribute("data-element-id");s!==e&&(Rl.has(n)&&i.push({id:s,exportValue:t,domElement:n}))}return i}show(){var t;this.container&&(this.container.hidden=!1),null===(t=this.popup)||void 0===t||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null===(t=this.popup)||void 0===t||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",(()=>{var i;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})}))}}function Wl(t){const{container:{style:e},data:{rect:i,rotation:n},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:a,pageX:r,pageY:o}}}}=this;null===i||void 0===i||i.splice(0,4,...t);const{width:l,height:h}=Ll(t);e.left="".concat(100*(t[0]-r)/s,"%"),e.top="".concat(100*(a-t[3]+o)/a,"%"),0===n?(e.width="".concat(100*l/s,"%"),e.height="".concat(100*h/a,"%")):this.setRotation(n)}var zl=new WeakSet;class Hl extends Nl{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null===e||void 0===e||!e.ignoreBorder),createQuadrilaterals:!0}),o(this,zl),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let n=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),n=!0):t.action?(this._bindNamedAction(i,t.action),n=!0):t.attachment?(l(zl,this,jl).call(this,i,t.attachment,t.attachmentDest),n=!0):t.setOCGState?(l(zl,this,Vl).call(this,i,t.setOCGState),n=!0):t.dest?(this._bindLink(i,t.dest),n=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),n=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(i,""),n=!0)),this.container.classList.add("linkAnnotation"),n&&this.container.append(i),this.container}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&l(zl,this,Bl).call(this)}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),l(zl,this,Bl).call(this)}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(e.actions)){const s=i.get(n);s&&(t[s]=()=>{var t;return null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:n}}),!1})}t.onclick||(t.onclick=()=>!1),l(zl,this,Bl).call(this)}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),l(zl,this,Bl).call(this),!this._fieldObjects)return Ct('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{null===i||void 0===i||i();const{fields:t,refs:n,include:s}=e,a=[];if(0!==t.length||0!==n.length){const e=new Set(n);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===s&&a.push(i)}else for(const e of Object.values(this._fieldObjects))a.push(...e);const r=this.annotationStorage,o=[];for(const e of a){const{id:t}=e;switch(o.push(t),e.type){case"text":{const i=e.defaultValue||"";r.setValue(t,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;r.setValue(t,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";r.setValue(t,{value:i});break}default:continue}const i=document.querySelector('[data-element-id="'.concat(t,'"]'));i&&(Rl.has(i)?i.dispatchEvent(new Event("resetform")):Ct("_bindResetFormAction - element not allowed: ".concat(t)))}var l;this.enableScripting&&(null===(l=this.linkService.eventBus)||void 0===l||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}));return!1}}}function Bl(){this.container.setAttribute("data-internal-link","")}function jl(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(e.content,e.filename,i),!1},l(zl,this,Bl).call(this)}function Vl(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),l(zl,this,Bl).call(this)}class Gl extends Nl{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class Ul extends Nl{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null===(e=t.previousSibling)||void 0===e?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Gt.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,n,s){i.includes("mouse")?t.addEventListener(i,(t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(i,(t=>{var a;if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}s&&(null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:s(t)}}))}))}_setEventListeners(t,e,i,n){for(const[o,l]of i){var s,a,r;if("Action"===l||null!==(s=this.data.actions)&&void 0!==s&&s[l])"Focus"!==l&&"Blur"!==l||e||(e={focused:!1}),this._setEventListener(t,e,o,l,n),"Focus"!==l||null!==(a=this.data.actions)&&void 0!==a&&a.Blur?"Blur"!==l||null!==(r=this.data.actions)&&void 0!==r&&r.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null)}}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":qt.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,s=t.style;let a;const r=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(P*n))||1);a=Math.min(n,r(e/P))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(n,r(t/P))}s.fontSize="calc(".concat(a,"px * var(--scale-factor))"),s.color=qt.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(s.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class ql extends Ul{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,n){const s=this.annotationStorage;for(const a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=i),s.setValue(a.id,{[n]:i})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){var n;const a=t.getValue(e,{value:this.data.fieldValue});let r=a.value||"";const o=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;o&&r.length>o&&(r=r.slice(0,o));let l=a.formattedValue||(null===(n=this.data.textContent)||void 0===n?void 0:n.join("\n"))||null;l&&this.data.comb&&(l=l.replaceAll(/\s+/g,""));const h={userValue:r,formattedValue:l,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=null!==l&&void 0!==l?l:r,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",null!==l&&void 0!==l?l:r),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Rl.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Tl,this._setRequired(i,this.data.required),o&&(i.maxLength=o),i.addEventListener("input",(n=>{t.setValue(e,{value:n.target.value}),this.setPropertyOnSiblings(i,"value",n.target.value,"value"),h.formattedValue=null})),i.addEventListener("resetform",(t=>{var e;const n=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";i.value=h.userValue=n,h.formattedValue=null}));let c=t=>{const{formattedValue:e}=h;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var s;i.addEventListener("focus",(t=>{var e;if(h.focused)return;const{target:i}=t;h.userValue&&(i.value=h.userValue),h.lastCommittedValue=i.value,h.commitKey=1,null!==(e=this.data.actions)&&void 0!==e&&e.Focus||(h.focused=!0)})),i.addEventListener("updatefromsandbox",(i=>{this.showElementAndHideCanvas(i.target);const n={value(i){var n;h.userValue=null!==(n=i.detail.value)&&void 0!==n?n:"",t.setValue(e,{value:h.userValue.toString()}),i.target.value=h.userValue},formattedValue(i){const{formattedValue:n}=i.detail;h.formattedValue=n,null!==n&&void 0!==n&&i.target!==document.activeElement&&(i.target.value=n),t.setValue(e,{formattedValue:n})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{var n;const{charLimit:s}=i.detail,{target:a}=i;if(0===s)return void a.removeAttribute("maxLength");a.setAttribute("maxLength",s);let r=h.userValue;!r||r.length<=s||(r=r.slice(0,s),a.value=h.userValue=r,t.setValue(e,{value:r}),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:a.selectionStart,selEnd:a.selectionEnd}}))}};this._dispatchEventFromSandbox(n,i)})),i.addEventListener("keydown",(t=>{var i;h.commitKey=1;let n=-1;if("Escape"===t.key?n=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(h.commitKey=3):n=2,-1===n)return;const{value:s}=t.target;h.lastCommittedValue!==s&&(h.lastCommittedValue=s,h.userValue=s,null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:n,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const n=c;c=null,i.addEventListener("blur",(t=>{var i;if(!h.focused||!t.relatedTarget)return;null!==(i=this.data.actions)&&void 0!==i&&i.Blur||(h.focused=!1);const{value:s}=t.target;var a;(h.userValue=s,h.lastCommittedValue!==s)&&(null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:h.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}));n(t)})),null!==(s=this.data.actions)&&void 0!==s&&s.Keystroke&&i.addEventListener("beforeinput",(t=>{var i;h.lastCommittedValue=null;const{data:n,target:s}=t,{value:a,selectionStart:r,selectionEnd:o}=s;let l=r,c=o;switch(t.inputType){case"deleteWordBackward":{const t=a.substring(0,r).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=a.substring(r).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":r===o&&(l-=1);break;case"deleteContentForward":r===o&&(c+=1)}t.preventDefault(),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,change:n||"",willCommit:!1,selStart:l,selEnd:c}})})),this._setEventListeners(i,h,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(c&&i.addEventListener("blur",c),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/o;i.classList.add("comb"),i.style.letterSpacing="calc(".concat(t,"px * var(--scale-factor) - 1ch)")}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Xl extends Ul{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class Yl extends Ul{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"===typeof n&&(n="Off"!==n,t.setValue(i,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const s=document.createElement("input");return Rl.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.setAttribute("exportValue",e.exportValue),s.tabIndex=Tl,s.addEventListener("change",(n=>{const{name:s,checked:a}=n.target;for(const r of this._getElementsByName(s,i)){const i=a&&r.exportValue===e.exportValue;r.domElement&&(r.domElement.checked=i),t.setValue(r.id,{value:i})}t.setValue(i,{value:a})})),s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue})),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",(e=>{const n={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(n,e)})),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Kl extends Ul{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let n=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"===typeof n&&(n=n!==e.buttonValue,t.setValue(i,{value:n})),n)for(const a of this._getElementsByName(e.fieldName,i))t.setValue(a.id,{value:!1});const s=document.createElement("input");if(Rl.add(s),s.setAttribute("data-element-id",i),s.disabled=e.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=e.fieldName,n&&s.setAttribute("checked",!0),s.tabIndex=Tl,s.addEventListener("change",(e=>{const{name:n,checked:s}=e.target;for(const a of this._getElementsByName(n,i))t.setValue(a.id,{value:!1});t.setValue(i,{value:s})})),s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue;t.target.checked=null!==i&&void 0!==i&&i===e.buttonValue})),this.enableScripting&&this.hasJSActions){const n=e.buttonValue;s.addEventListener("updatefromsandbox",(e=>{const s={value:e=>{const s=n===e.detail.value;for(const n of this._getElementsByName(e.target.name)){const e=s&&n.id===i;n.domElement&&(n.domElement.checked=e),t.setValue(n.id,{value:e})}}};this._dispatchEventFromSandbox(s,e)})),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Jl extends Hl{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))),t}}class Ql extends Ul{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),n=document.createElement("select");Rl.add(n),n.setAttribute("data-element-id",e),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=Tl;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const i of n.options)i.selected=i.value===e}));for(const h of this.data.options){const t=document.createElement("option");t.textContent=h.displayValue,t.value=h.exportValue,i.value.includes(h.exportValue)&&(t.setAttribute("selected",!0),s=!1),n.append(t)}let a=null;if(s){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),n.prepend(t),a=()=>{t.remove(),n.removeEventListener("input",a),a=null},n.addEventListener("input",a)}const r=t=>{const e=t?"value":"textContent",{options:i,multiple:s}=n;return s?Array.prototype.filter.call(i,(t=>t.selected)).map((t=>t[e])):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let o=r(!1);const l=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",(i=>{const s={value(i){var s;null===(s=a)||void 0===s||s();const l=i.detail.value,h=new Set(Array.isArray(l)?l:[l]);for(const t of n.options)t.selected=h.has(t.value);t.setValue(e,{value:r(!0)}),o=r(!1)},multipleSelection(t){n.multiple=!0},remove(i){const s=n.options,a=i.detail.remove;if(s[a].selected=!1,n.remove(a),s.length>0){-1===Array.prototype.findIndex.call(s,(t=>t.selected))&&(s[0].selected=!0)}t.setValue(e,{value:r(!0),items:l(i)}),o=r(!1)},clear(i){for(;0!==n.length;)n.remove(0);t.setValue(e,{value:null,items:[]}),o=r(!1)},insert(i){const{index:s,displayValue:a,exportValue:h}=i.detail.insert,c=n.children[s],d=document.createElement("option");d.textContent=a,d.value=h,c?c.before(d):n.append(d),t.setValue(e,{value:r(!0),items:l(i)}),o=r(!1)},items(i){const{items:s}=i.detail;for(;0!==n.length;)n.remove(0);for(const t of s){const{displayValue:e,exportValue:i}=t,s=document.createElement("option");s.textContent=e,s.value=i,n.append(s)}n.options.length>0&&(n.options[0].selected=!0),t.setValue(e,{value:r(!0),items:l(i)}),o=r(!1)},indices(i){const n=new Set(i.detail.indices);for(const t of i.target.options)t.selected=n.has(t.index);t.setValue(e,{value:r(!0)}),o=r(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,i)})),n.addEventListener("input",(i=>{var n;const s=r(!0),a=r(!1);t.setValue(e,{value:s}),i.preventDefault(),null===(n=this.linkService.eventBus)||void 0===n||n.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:a,changeEx:s,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))):n.addEventListener("input",(function(i){t.setValue(e,{value:r(!0)})})),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Zl extends Nl{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:Nl._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new wh({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const i of this.elements)i.popup=t,e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map((t=>"".concat(Zt).concat(t))).join(",")),this.container}}var $l=new WeakMap,th=new WeakMap,eh=new WeakMap,ih=new WeakMap,nh=new WeakMap,sh=new WeakMap,ah=new WeakMap,rh=new WeakMap,oh=new WeakMap,lh=new WeakMap,hh=new WeakMap,ch=new WeakMap,dh=new WeakMap,uh=new WeakMap,ph=new WeakMap,fh=new WeakMap,gh=new WeakMap,mh=new WeakMap,vh=new WeakMap,bh=new WeakSet;class wh{constructor(t){let{container:e,color:i,elements:n,titleObj:s,modificationDate:a,contentsObj:r,richText:h,parent:c,rect:f,parentRect:g,open:m}=t;o(this,bh),d(this,$l,l(bh,this,Eh).bind(this)),d(this,th,l(bh,this,Ch).bind(this)),d(this,eh,l(bh,this,Sh).bind(this)),d(this,ih,l(bh,this,Mh).bind(this)),d(this,nh,null),d(this,sh,null),d(this,ah,null),d(this,rh,null),d(this,oh,null),d(this,lh,null),d(this,hh,null),d(this,ch,!1),d(this,dh,null),d(this,uh,null),d(this,ph,null),d(this,fh,null),d(this,gh,null),d(this,mh,null),d(this,vh,!1),p(sh,this,e),p(gh,this,s),p(ah,this,r),p(fh,this,h),p(lh,this,c),p(nh,this,i),p(ph,this,f),p(hh,this,g),p(oh,this,n),p(rh,this,Ke.toDateObject(a)),this.trigger=n.flatMap((t=>t.getElementsToTriggerPopup()));for(const o of this.trigger)o.addEventListener("click",u(ih,this)),o.addEventListener("mouseenter",u(eh,this)),o.addEventListener("mouseleave",u(th,this)),o.classList.add("popupTriggerArea");for(const o of n){var v;null===(v=o.container)||void 0===v||v.addEventListener("keydown",u($l,this))}u(sh,this).hidden=!0,m&&l(bh,this,Mh).call(this)}render(){if(u(dh,this))return;const t=p(dh,this,document.createElement("div"));if(t.className="popup",u(nh,this)){const e=t.style.outlineColor=qt.makeHexColor(...u(nh,this));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))t.style.backgroundColor="color-mix(in srgb, ".concat(e," 30%, white)");else{const e=.7;t.style.backgroundColor=qt.makeHexColor(...u(nh,this).map((t=>Math.floor(e*(255-t)+t))))}}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=u(gh,this)),t.append(e),u(rh,this)){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),t.setAttribute("data-l10n-args",JSON.stringify({date:u(rh,this).toLocaleDateString(),time:u(rh,this).toLocaleTimeString()})),e.append(t)}const n=h(bh,this,yh);if(n)Cl.render({xfaHtml:n,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents(u(ah,this));t.append(e)}u(sh,this).append(t)}_formatContents(t){let{str:e,dir:i}=t;const n=document.createElement("p");n.classList.add("popupContent"),n.dir=i;const s=e.split(/(?:\r\n?|\n)/);for(let a=0,r=s.length;a<r;++a){const t=s[a];n.append(document.createTextNode(t)),a<r-1&&n.append(document.createElement("br"))}return n}updateEdited(t){var e;let{rect:i,popupContent:n}=t;u(mh,this)||p(mh,this,{contentsObj:u(ah,this),richText:u(fh,this)}),i&&p(uh,this,null),n&&(p(fh,this,l(bh,this,xh).call(this,n)),p(ah,this,null)),null===(e=u(dh,this))||void 0===e||e.remove(),p(dh,this,null)}resetEdited(){var t;u(mh,this)&&(({contentsObj:s(p,[ah,this])._,richText:s(p,[fh,this])._}=u(mh,this)),p(mh,this,null),null===(t=u(dh,this))||void 0===t||t.remove(),p(dh,this,null),p(uh,this,null))}forceHide(){p(vh,this,this.isVisible),u(vh,this)&&(u(sh,this).hidden=!0)}maybeShow(){u(vh,this)&&(u(dh,this)||l(bh,this,Sh).call(this),p(vh,this,!1),u(sh,this).hidden=!1)}get isVisible(){return!1===u(sh,this).hidden}}function yh(t){const e=u(fh,t),i=u(ah,t);return null===e||void 0===e||!e.str||null!==i&&void 0!==i&&i.str&&i.str!==e.str?null:u(fh,t).html||null}function Ah(t){var e;return(null===(e=h(bh,t,yh))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.fontSize)||0}function _h(t){var e;return(null===(e=h(bh,t,yh))||void 0===e||null===(e=e.attributes)||void 0===e||null===(e=e.style)||void 0===e?void 0:e.color)||null}function xh(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},n={style:{color:h(bh,this,_h),fontSize:h(bh,this,Ah)?"calc(".concat(h(bh,this,Ah),"px * var(--scale-factor))"):""}};for(const s of t.split("\n"))e.push({name:"span",value:s,attributes:n});return i}function Eh(t){t.altKey||t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key||"Escape"===t.key&&u(ch,this))&&l(bh,this,Mh).call(this)}function kh(){if(null!==u(uh,this))return;const{page:{view:t},viewport:{rawDims:{pageWidth:e,pageHeight:i,pageX:n,pageY:s}}}=u(lh,this);let a=!!u(hh,this),r=u(a?hh:ph,this);for(const p of u(oh,this))if(!r||null!==qt.intersect(p.data.rect,r)){r=p.data.rect,a=!0;break}const o=qt.normalizeRect([r[0],t[3]-r[1]+t[1],r[2],t[3]-r[3]+t[1]]),l=a?r[2]-r[0]+5:0,h=o[0]+l,c=o[1];p(uh,this,[100*(h-n)/e,100*(c-s)/i]);const{style:d}=u(sh,this);d.left="".concat(u(uh,this)[0],"%"),d.top="".concat(u(uh,this)[1],"%")}function Mh(){p(ch,this,!u(ch,this)),u(ch,this)?(l(bh,this,Sh).call(this),u(sh,this).addEventListener("click",u(ih,this)),u(sh,this).addEventListener("keydown",u($l,this))):(l(bh,this,Ch).call(this),u(sh,this).removeEventListener("click",u(ih,this)),u(sh,this).removeEventListener("keydown",u($l,this)))}function Sh(){u(dh,this)||this.render(),this.isVisible?u(ch,this)&&u(sh,this).classList.add("focused"):(l(bh,this,kh).call(this),u(sh,this).hidden=!1,u(sh,this).style.zIndex=parseInt(u(sh,this).style.zIndex)+1e3)}function Ch(){u(sh,this).classList.remove("focused"),!u(ch,this)&&this.isVisible&&(u(sh,this).hidden=!0,u(sh,this).style.zIndex=parseInt(u(sh,this).style.zIndex)-1e3)}class Th extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),this.textContent=t.data.textContent,this.textPosition=t.data.textPosition,this.annotationEditorType=B.FREETEXT}render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const t=document.createElement("div");t.classList.add("annotationTextContent"),t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e,t.append(i)}this.container.append(t)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}get _isEditable(){return this.data.hasOwnCanvas}}var Rh=new WeakMap;class Lh extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),d(this,Rh,null)}render(){this.container.classList.add("lineAnnotation");const t=this.data,{width:e,height:i}=Ll(t.rect),n=this.svgFactory.create(e,i,!0),s=p(Rh,this,this.svgFactory.createElement("svg:line"));return s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]),s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]),s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]),s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]),s.setAttribute("stroke-width",t.borderStyle.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),n.append(s),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return u(Rh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Ph=new WeakMap;class Fh extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),d(this,Ph,null)}render(){this.container.classList.add("squareAnnotation");const t=this.data,{width:e,height:i}=Ll(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,a=p(Ph,this,this.svgFactory.createElement("svg:rect"));return a.setAttribute("x",s/2),a.setAttribute("y",s/2),a.setAttribute("width",e-s),a.setAttribute("height",i-s),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return u(Ph,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Ih=new WeakMap;class Dh extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),d(this,Ih,null)}render(){this.container.classList.add("circleAnnotation");const t=this.data,{width:e,height:i}=Ll(t.rect),n=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,a=p(Ih,this,this.svgFactory.createElement("svg:ellipse"));return a.setAttribute("cx",e/2),a.setAttribute("cy",i/2),a.setAttribute("rx",e/2-s/2),a.setAttribute("ry",i/2-s/2),a.setAttribute("stroke-width",s||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!t.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return u(Ih,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}var Oh=new WeakMap;class Nh extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),d(this,Oh,null),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,vertices:e,borderStyle:i,popupRef:n}}=this;if(!e)return this.container;const{width:s,height:a}=Ll(t),r=this.svgFactory.create(s,a,!0);let o=[];for(let h=0,c=e.length;h<c;h+=2){const i=e[h]-t[0],n=t[3]-e[h+1];o.push("".concat(i,",").concat(n))}o=o.join(" ");const l=p(Oh,this,this.svgFactory.createElement(this.svgElementName));return l.setAttribute("points",o),l.setAttribute("stroke-width",i.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),r.append(l),this.container.append(r),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return u(Oh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class Wh extends Nh{constructor(t){super(t),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class zh extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var Hh=new WeakMap;class Bh extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0}),d(this,Hh,[]),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType=B.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:t,inkLists:e,borderStyle:i,popupRef:n}}=this,{width:s,height:a}=Ll(t),r=this.svgFactory.create(s,a,!0);for(const o of e){let e=[];for(let i=0,n=o.length;i<n;i+=2){const n=o[i]-t[0],s=t[3]-o[i+1];e.push("".concat(n,",").concat(s))}e=e.join(" ");const s=this.svgFactory.createElement(this.svgElementName);u(Hh,this).push(s),s.setAttribute("points",e),s.setAttribute("stroke-width",i.width||1),s.setAttribute("stroke","transparent"),s.setAttribute("fill","transparent"),!n&&this.hasPopupData&&this._createPopup(),r.append(s)}return this.container.append(r),this.container}getElementsToTriggerPopup(){return u(Hh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}class jh extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this.container}}class Vh extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class Gh extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class Uh extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class qh extends Nl{constructor(t){super(t,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("stampAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}var Xh=new WeakMap,Yh=new WeakSet;class Kh extends Nl{constructor(t){var e;super(t,{isRenderable:!0}),o(this,Yh),d(this,Xh,null);const{file:i}=this.data;this.filename=i.filename,this.content=i.content,null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",(0,n.A)({source:this},i))}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:t,data:e}=this;let i;e.hasAppearance||0===e.fillAlpha?i=document.createElement("div"):(i=document.createElement("img"),i.src="".concat(this.imageResourcesPath,"annotation-").concat(/paperclip/i.test(e.name)?"paperclip":"pushpin",".svg"),e.fillAlpha&&e.fillAlpha<1&&(i.style="filter: opacity(".concat(Math.round(100*e.fillAlpha),"%);"))),i.addEventListener("dblclick",l(Yh,this,Jh).bind(this)),p(Xh,this,i);const{isMac:n}=Gt.platform;return t.addEventListener("keydown",(t=>{"Enter"===t.key&&(n?t.metaKey:t.ctrlKey)&&l(Yh,this,Jh).call(this)})),!e.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),t.append(i),t}getElementsToTriggerPopup(){return u(Xh,this)}addHighlightArea(){this.container.classList.add("highlightArea")}}function Jh(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.content,this.filename)}var Qh=new WeakMap,Zh=new WeakMap,$h=new WeakMap,tc=new WeakSet;class ec{constructor(t){let{div:e,accessibilityManager:i,annotationCanvasMap:n,annotationEditorUIManager:s,page:a,viewport:r}=t;o(this,tc),d(this,Qh,null),d(this,Zh,null),d(this,$h,new Map),this.div=e,p(Qh,this,i),p(Zh,this,n),this.page=a,this.viewport=r,this.zIndex=0,this._annotationEditorUIManager=s}async render(t){const{annotations:e}=t,i=this.div;ti(i,this.viewport);const n=new Map,s={data:null,layer:i,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new Ne,annotationStorage:t.annotationStorage||new na,enableScripting:!0===t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,parent:this,elements:null};for(const r of e){if(r.noHTML)continue;const t=r.annotationType===ut;if(t){const t=n.get(r.id);if(!t)continue;s.elements=t}else{const{width:t,height:e}=Ll(r.rect);if(t<=0||e<=0)continue}s.data=r;const e=Pl.create(s);if(!e.isRenderable)continue;if(!t&&r.popupRef){const t=n.get(r.popupRef);t?t.push(e):n.set(r.popupRef,[e])}const i=e.render();var a;if(r.hidden&&(i.style.visibility="hidden"),l(tc,this,ic).call(this,i,r.id),e.annotationEditorType>0)u($h,this).set(e.data.id,e),null===(a=this._annotationEditorUIManager)||void 0===a||a.renderAnnotationElement(e)}l(tc,this,nc).call(this)}update(t){let{viewport:e}=t;const i=this.div;this.viewport=e,ti(i,{rotation:e.rotation}),l(tc,this,nc).call(this),i.hidden=!1}getEditableAnnotations(){return Array.from(u($h,this).values())}getEditableAnnotation(t){return u($h,this).get(t)}}function ic(t,e){var i;const n=t.firstChild||t;n.id="".concat(Zt).concat(e),this.div.append(t),null===(i=u(Qh,this))||void 0===i||i.moveElementInDOM(this.div,t,n,!1)}function nc(){if(!u(Zh,this))return;const t=this.div;for(const[e,i]of u(Zh,this)){const n=t.querySelector('[data-annotation-id="'.concat(e,'"]'));if(!n)continue;i.className="annotationContent";const{firstChild:s}=n;s?"CANVAS"===s.nodeName?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):n.append(i)}u(Zh,this).clear()}const sc=/\r\n?|\n/g;var ac=new WeakMap,rc=new WeakMap,oc=new WeakMap,lc=new WeakMap,hc=new WeakMap,cc=new WeakMap,dc=new WeakMap,uc=new WeakMap,pc=new WeakMap,fc=new WeakMap,gc=new WeakSet;class mc extends Fs{static get _keyboardManager(){const t=mc.prototype,e=t=>t.isEmpty(),i=Fn.TRANSLATE_SMALL,n=Fn.TRANSLATE_BIG;return Pt(this,"_keyboardManager",new Oi([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],t.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],t.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],t._translateEmpty,{args:[-i,0],checker:e}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t._translateEmpty,{args:[-n,0],checker:e}],[["ArrowRight","mac+ArrowRight"],t._translateEmpty,{args:[i,0],checker:e}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t._translateEmpty,{args:[n,0],checker:e}],[["ArrowUp","mac+ArrowUp"],t._translateEmpty,{args:[0,-i],checker:e}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t._translateEmpty,{args:[0,-n],checker:e}],[["ArrowDown","mac+ArrowDown"],t._translateEmpty,{args:[0,i],checker:e}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t._translateEmpty,{args:[0,n],checker:e}]]))}constructor(t){super((0,n.A)((0,n.A)({},t),{},{name:"freeTextEditor"})),o(this,gc),d(this,ac,this.editorDivBlur.bind(this)),d(this,rc,this.editorDivFocus.bind(this)),d(this,oc,this.editorDivInput.bind(this)),d(this,lc,this.editorDivKeydown.bind(this)),d(this,hc,this.editorDivPaste.bind(this)),d(this,cc,void 0),d(this,dc,""),d(this,uc,"".concat(this.id,"-editor")),d(this,pc,void 0),d(this,fc,null),p(cc,this,t.color||mc._defaultColor||Fs._defaultLineColor),p(pc,this,t.fontSize||mc._defaultFontSize)}static initialize(t,e){Fs.initialize(t,e,{strings:["pdfjs-free-text-default-content"]});const i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case j.FREETEXT_SIZE:mc._defaultFontSize=e;break;case j.FREETEXT_COLOR:mc._defaultColor=e}}updateParams(t,e){switch(t){case j.FREETEXT_SIZE:l(gc,this,vc).call(this,e);break;case j.FREETEXT_COLOR:l(gc,this,bc).call(this,e)}}static get defaultPropertiesToUpdate(){return[[j.FREETEXT_SIZE,mc._defaultFontSize],[j.FREETEXT_COLOR,mc._defaultColor||Fs._defaultLineColor]]}get propertiesToUpdate(){return[[j.FREETEXT_SIZE,u(pc,this)],[j.FREETEXT_COLOR,u(cc,this)]]}_translateEmpty(t,e){this._uiManager.translateSelectedEditors(t,e,!0)}getInitialTranslation(){const t=this.parentScale;return[-mc._internalPadding*t,-(mc._internalPadding+u(pc,this))*t]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(B.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant");const t=this._uiManager._signal;this.editorDiv.addEventListener("keydown",u(lc,this),{signal:t}),this.editorDiv.addEventListener("focus",u(rc,this),{signal:t}),this.editorDiv.addEventListener("blur",u(ac,this),{signal:t}),this.editorDiv.addEventListener("input",u(oc,this),{signal:t}),this.editorDiv.addEventListener("paste",u(hc,this),{signal:t})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",u(uc,this)),this._isDraggable=!0,this.editorDiv.removeEventListener("keydown",u(lc,this)),this.editorDiv.removeEventListener("focus",u(rc,this)),this.editorDiv.removeEventListener("blur",u(ac,this)),this.editorDiv.removeEventListener("input",u(oc,this)),this.editorDiv.removeEventListener("paste",u(hc,this)),this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),t.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){var t;this.width||(this.enableEditMode(),this.editorDiv.focus(),null!==(t=this._initialOptions)&&void 0!==t&&t.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const t=u(dc,this),e=p(dc,this,l(gc,this,wc).call(this).trimEnd());if(t===e)return;const i=t=>{p(dc,this,t),t?(l(gc,this,_c).call(this),this._uiManager.rebuild(this),l(gc,this,yc).call(this)):this.remove()};this.addCommands({cmd:()=>{i(e)},undo:()=>{i(t)},mustExec:!1}),l(gc,this,yc).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(t){this.enterInEditMode()}keydown(t){t.target===this.div&&"Enter"===t.key&&(this.enterInEditMode(),t.preventDefault())}editorDivKeydown(t){mc._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}editorDivInput(t){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",u(uc,this)),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text"),this.enableEditing(),Fs._l10nPromise.get("pdfjs-free-text-default-content").then((t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("default-content",t)})),this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;if(i.fontSize="calc(".concat(u(pc,this),"px * var(--scale-factor))"),i.color=u(cc,this),this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),Ai(this,this.div,["dblclick","keydown"]),this.width){const[i,n]=this.parentDimensions;if(this.annotationElementId){const{position:s}=u(fc,this);let[a,r]=this.getInitialTranslation();[a,r]=this.pageTranslationToScreen(a,r);const[o,l]=this.pageDimensions,[h,c]=this.pageTranslation;let d,p;switch(this.rotation){case 0:d=t+(s[0]-h)/o,p=e+this.height-(s[1]-c)/l;break;case 90:d=t+(s[0]-h)/o,p=e-(s[1]-c)/l,[a,r]=[r,-a];break;case 180:d=t-this.width+(s[0]-h)/o,p=e-(s[1]-c)/l,[a,r]=[-a,-r];break;case 270:d=t+(s[0]-h-this.height*l)/o,p=e+(s[1]-c-this.width*o)/l,[a,r]=[-r,a]}this.setAt(d*i,p*n,a,r)}else this.setAt(t*i,e*n,this.width*i,this.height*n);l(gc,this,_c).call(this),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}editorDivPaste(t){const e=t.clipboardData||window.clipboardData,{types:i}=e;if(1===i.length&&"text/plain"===i[0])return;t.preventDefault();const n=Ec.call(mc,e.getData("text")||"").replaceAll(sc,"\n");if(!n)return;const s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();const a=s.getRangeAt(0);if(!n.includes("\n"))return a.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void s.collapseToStart();const{startContainer:r,startOffset:o}=a,h=[],c=[];if(r.nodeType===Node.TEXT_NODE){const t=r.parentElement;if(c.push(r.nodeValue.slice(o).replaceAll(sc,"")),t!==this.editorDiv){let e=h;for(const i of this.editorDiv.childNodes)i!==t?e.push(Ac.call(mc,i)):e=c}h.push(r.nodeValue.slice(0,o).replaceAll(sc,""))}else if(r===this.editorDiv){let t=h,e=0;for(const i of this.editorDiv.childNodes)e++===o&&(t=c),t.push(Ac.call(mc,i))}p(dc,this,"".concat(h.join("\n")).concat(n).concat(c.join("\n"))),l(gc,this,_c).call(this);const d=new Range;let u=h.reduce(((t,e)=>t+e.length),0);for(const{firstChild:l}of this.editorDiv.childNodes)if(l.nodeType===Node.TEXT_NODE){const t=l.nodeValue.length;if(u<=t){d.setStart(l,u),d.setEnd(l,u);break}u-=t}s.removeAllRanges(),s.addRange(d)}get contentDiv(){return this.editorDiv}static deserialize(t,e,i){let n=null;if(t instanceof Th){const{data:{defaultAppearanceData:{fontSize:e,fontColor:i},rect:s,rotation:a,id:r},textContent:o,textPosition:l,parent:{page:{pageNumber:h}}}=t;if(!o||0===o.length)return null;n=t={annotationType:B.FREETEXT,color:Array.from(i),fontSize:e,value:o.join("\n"),position:l,pageIndex:h-1,rect:s.slice(0),rotation:a,id:r,deleted:!1}}const s=super.deserialize(t,e,i);return p(pc,s,t.fontSize),p(cc,s,qt.makeHexColor(...t.color)),p(dc,s,Ec.call(mc,t.value)),s.annotationElementId=t.id||null,p(fc,s,n),s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return null;if(this.deleted)return{pageIndex:this.pageIndex,id:this.annotationElementId,deleted:!0};const e=mc._internalPadding*this.parentScale,i=this.getRect(e,e),n=Fs._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:u(cc,this)),s={annotationType:B.FREETEXT,color:n,fontSize:u(pc,this),value:l(gc,this,xc).call(this),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return t?s:this.annotationElementId&&!l(gc,this,kc).call(this,s)?null:(s.id=this.annotationElementId,s)}renderAnnotationElement(t){const e=super.renderAnnotationElement(t);if(this.deleted)return e;const{style:i}=e;i.fontSize="calc(".concat(u(pc,this),"px * var(--scale-factor))"),i.color=u(cc,this),e.replaceChildren();for(const s of u(dc,this).split("\n")){const t=document.createElement("div");t.append(s?document.createTextNode(s):document.createElement("br")),e.append(t)}const n=mc._internalPadding*this.parentScale;return t.updateEdited({rect:this.getRect(n,n),popupContent:u(dc,this)}),e}resetAnnotationElement(t){super.resetAnnotationElement(t),t.resetEdited()}}function vc(t){const e=t=>{this.editorDiv.style.fontSize="calc(".concat(t,"px * var(--scale-factor))"),this.translate(0,-(t-u(pc,this))*this.parentScale),p(pc,this,t),l(gc,this,yc).call(this)},i=u(pc,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:j.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function bc(t){const e=t=>{p(cc,this,this.editorDiv.style.color=t)},i=u(cc,this);this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:j.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function wc(){const t=[];this.editorDiv.normalize();for(const e of this.editorDiv.childNodes)t.push(Ac.call(A,e));return t.join("\n")}function yc(){const[t,e]=this.parentDimensions;let i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{const{currentLayer:t,div:e}=this,n=e.style.display,s=e.classList.contains("hidden");e.classList.remove("hidden"),e.style.display="hidden",t.div.append(this.div),i=e.getBoundingClientRect(),e.remove(),e.style.display=n,e.classList.toggle("hidden",s)}this.rotation%180===this.parentRotation%180?(this.width=i.width/t,this.height=i.height/e):(this.width=i.height/t,this.height=i.width/e),this.fixAndSetPosition()}function Ac(t){return(t.nodeType===Node.TEXT_NODE?t.nodeValue:t.innerText).replaceAll(sc,"")}function _c(){if(this.editorDiv.replaceChildren(),u(dc,this))for(const t of u(dc,this).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br")),this.editorDiv.append(e)}}function xc(){return u(dc,this).replaceAll("\xa0"," ")}function Ec(t){return t.replaceAll(" ","\xa0")}function kc(t){const{value:e,fontSize:i,color:n,pageIndex:s}=u(fc,this);return this._hasBeenMoved||t.value!==e||t.fontSize!==i||t.color.some(((t,e)=>t!==n[e]))||t.pageIndex!==s}A=mc,(0,c.A)(mc,"_freeTextDefaultContent",""),(0,c.A)(mc,"_internalPadding",0),(0,c.A)(mc,"_defaultColor",null),(0,c.A)(mc,"_defaultFontSize",10),(0,c.A)(mc,"_type","freetext"),(0,c.A)(mc,"_editorType",B.FREETEXT);var Mc=new WeakMap,Sc=new WeakMap,Cc=new WeakMap,Tc=new WeakSet;class Rc{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];o(this,Tc),d(this,Mc,void 0),d(this,Sc,[]),d(this,Cc,[]);let s=1/0,a=-1/0,r=1/0,l=-1/0;const h=10**-4;for(const{x:o,y:d,width:p,height:w}of t){const t=Math.floor((o-e)/h)*h,i=Math.ceil((o+p+e)/h)*h,n=Math.floor((d-e)/h)*h,c=Math.ceil((d+w+e)/h)*h,f=[t,n,c,!0],g=[i,n,c,!1];u(Sc,this).push(f,g),s=Math.min(s,t),a=Math.max(a,i),r=Math.min(r,n),l=Math.max(l,c)}const c=a-s+2*i,f=l-r+2*i,g=s-i,m=r-i,v=u(Sc,this).at(n?-1:-2),b=[v[0],v[2]];for(const o of u(Sc,this)){const[t,e,i]=o;o[0]=(t-g)/c,o[1]=(e-m)/f,o[2]=(i-m)/f}p(Mc,this,{x:g,y:m,width:c,height:f,lastPoint:b})}getOutlines(){u(Sc,this).sort(((t,e)=>t[0]-e[0]||t[1]-e[1]||t[2]-e[2]));const t=[];for(const e of u(Sc,this))e[3]?(t.push(...l(Tc,this,Dc).call(this,e)),l(Tc,this,Fc).call(this,e)):(l(Tc,this,Ic).call(this,e),t.push(...l(Tc,this,Dc).call(this,e)));return l(Tc,this,Lc).call(this,t)}}function Lc(t){const e=[],i=new Set;for(const a of t){const[t,i,n]=a;e.push([t,i,a],[t,n,a])}e.sort(((t,e)=>t[1]-e[1]||t[0]-e[0]));for(let a=0,r=e.length;a<r;a+=2){const t=e[a][2],n=e[a+1][2];t.push(n),n.push(t),i.add(t),i.add(n)}const n=[];let s;for(;i.size>0;){const t=i.values().next().value;let[e,a,r,o,l]=t;i.delete(t);let h=e,c=a;for(s=[e,r],n.push(s);;){let t;if(i.has(o))t=o;else{if(!i.has(l))break;t=l}i.delete(t),[e,a,r,o,l]=t,h!==e&&(s.push(h,c,e,c===a?a:r),h=e),c=c===a?r:a}s.push(h,c)}return new zc(n,u(Mc,this))}function Pc(t){const e=u(Cc,this);let i=0,n=e.length-1;for(;i<=n;){const s=i+n>>1,a=e[s][0];if(a===t)return s;a<t?i=s+1:n=s-1}return n+1}function Fc(t){let[,e,i]=t;const n=l(Tc,this,Pc).call(this,e);u(Cc,this).splice(n,0,[e,i])}function Ic(t){let[,e,i]=t;const n=l(Tc,this,Pc).call(this,e);for(let s=n;s<u(Cc,this).length;s++){const[t,n]=u(Cc,this)[s];if(t!==e)break;if(t===e&&n===i)return void u(Cc,this).splice(s,1)}for(let s=n-1;s>=0;s--){const[t,n]=u(Cc,this)[s];if(t!==e)break;if(t===e&&n===i)return void u(Cc,this).splice(s,1)}}function Dc(t){const[e,i,n]=t,s=[[e,i,n]],a=l(Tc,this,Pc).call(this,n);for(let r=0;r<a;r++){const[t,i]=u(Cc,this)[r];for(let n=0,a=s.length;n<a;n++){const[,r,o]=s[n];if(!(i<=r||o<=t))if(r>=t)if(o>i)s[n][1]=i;else{if(1===a)return[];s.splice(n,1),n--,a--}else s[n][2]=t,o>i&&s.push([e,i,o])}}return s}class Oc{toSVGPath(){throw new Error("Abstract method `toSVGPath` must be implemented.")}get box(){throw new Error("Abstract getter `box` must be implemented.")}serialize(t,e){throw new Error("Abstract method `serialize` must be implemented.")}get free(){return this instanceof ud}}var Nc=new WeakMap,Wc=new WeakMap;class zc extends Oc{constructor(t,e){super(),d(this,Nc,void 0),d(this,Wc,void 0),p(Wc,this,t),p(Nc,this,e)}toSVGPath(){const t=[];for(const e of u(Wc,this)){let[i,n]=e;t.push("M".concat(i," ").concat(n));for(let s=2;s<e.length;s+=2){const a=e[s],r=e[s+1];a===i?(t.push("V".concat(r)),n=r):r===n&&(t.push("H".concat(a)),i=a)}t.push("Z")}return t.join(" ")}serialize(t,e){let[i,n,s,a]=t;const r=[],o=s-i,l=a-n;for(const h of u(Wc,this)){const t=new Array(h.length);for(let e=0;e<h.length;e+=2)t[e]=i+h[e]*o,t[e+1]=a-h[e+1]*l;r.push(t)}return r}get box(){return u(Nc,this)}}var Hc=new WeakMap,Bc=new WeakMap,jc=new WeakMap,Vc=new WeakMap,Gc=new WeakMap,Uc=new WeakMap,qc=new WeakMap,Xc=new WeakMap,Yc=new WeakMap,Kc=new WeakMap,Jc=new WeakMap,Qc=new WeakMap,Zc=new WeakMap,$c=new WeakSet;class td{constructor(t,e,i,n,s){let{x:a,y:r}=t,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;o(this,$c),d(this,Hc,void 0),d(this,Bc,[]),d(this,jc,void 0),d(this,Vc,void 0),d(this,Gc,[]),d(this,Uc,new Float64Array(18)),d(this,qc,void 0),d(this,Xc,void 0),d(this,Yc,void 0),d(this,Kc,void 0),d(this,Jc,void 0),d(this,Qc,void 0),d(this,Zc,[]),p(Hc,this,e),p(Qc,this,n*i),p(Vc,this,s),u(Uc,this).set([NaN,NaN,NaN,NaN,a,r],6),p(jc,this,l),p(Kc,this,id._*i),p(Yc,this,nd._*i),p(Jc,this,i),u(Zc,this).push(a,r)}get free(){return!0}isEmpty(){return isNaN(u(Uc,this)[8])}add(t){var e;let{x:i,y:n}=t;p(qc,this,i),p(Xc,this,n);const[s,a,r,o]=u(Hc,this);let[l,h,c,d]=u(Uc,this).subarray(8,12);const f=i-c,g=n-d,m=Math.hypot(f,g);if(m<u(Yc,this))return!1;const v=m-u(Kc,this),b=v/m,w=b*f,y=b*g;let A=l,_=h;l=c,h=d,c+=w,d+=y,null===(e=u(Zc,this))||void 0===e||e.push(i,n);const x=w/v,E=-y/v*u(Qc,this),k=x*u(Qc,this);if(u(Uc,this).set(u(Uc,this).subarray(2,8),0),u(Uc,this).set([c+E,d+k],4),u(Uc,this).set(u(Uc,this).subarray(14,18),12),u(Uc,this).set([c-E,d-k],16),isNaN(u(Uc,this)[6]))return 0===u(Gc,this).length&&(u(Uc,this).set([l+E,h+k],2),u(Gc,this).push(NaN,NaN,NaN,NaN,(l+E-s)/r,(h+k-a)/o),u(Uc,this).set([l-E,h-k],14),u(Bc,this).push(NaN,NaN,NaN,NaN,(l-E-s)/r,(h-k-a)/o)),u(Uc,this).set([A,_,l,h,c,d],6),!this.isEmpty();u(Uc,this).set([A,_,l,h,c,d],6);return Math.abs(Math.atan2(_-h,A-l)-Math.atan2(y,w))<Math.PI/2?([l,h,c,d]=u(Uc,this).subarray(2,6),u(Gc,this).push(NaN,NaN,NaN,NaN,((l+c)/2-s)/r,((h+d)/2-a)/o),[l,h,A,_]=u(Uc,this).subarray(14,18),u(Bc,this).push(NaN,NaN,NaN,NaN,((A+l)/2-s)/r,((_+h)/2-a)/o),!0):([A,_,l,h,c,d]=u(Uc,this).subarray(0,6),u(Gc,this).push(((A+5*l)/6-s)/r,((_+5*h)/6-a)/o,((5*l+c)/6-s)/r,((5*h+d)/6-a)/o,((l+c)/2-s)/r,((h+d)/2-a)/o),[c,d,l,h,A,_]=u(Uc,this).subarray(12,18),u(Bc,this).push(((A+5*l)/6-s)/r,((_+5*h)/6-a)/o,((5*l+c)/6-s)/r,((5*h+d)/6-a)/o,((l+c)/2-s)/r,((h+d)/2-a)/o),!0)}toSVGPath(){if(this.isEmpty())return"";const t=u(Gc,this),e=u(Bc,this),i=u(Uc,this).subarray(4,6),n=u(Uc,this).subarray(16,18),[s,a,r,o]=u(Hc,this),[h,c,d,p]=l($c,this,ed).call(this);if(isNaN(u(Uc,this)[6])&&!this.isEmpty())return"M".concat((u(Uc,this)[2]-s)/r," ").concat((u(Uc,this)[3]-a)/o," L").concat((u(Uc,this)[4]-s)/r," ").concat((u(Uc,this)[5]-a)/o," L").concat(h," ").concat(c," L").concat(d," ").concat(p," L").concat((u(Uc,this)[16]-s)/r," ").concat((u(Uc,this)[17]-a)/o," L").concat((u(Uc,this)[14]-s)/r," ").concat((u(Uc,this)[15]-a)/o," Z");const f=[];f.push("M".concat(t[4]," ").concat(t[5]));for(let l=6;l<t.length;l+=6)isNaN(t[l])?f.push("L".concat(t[l+4]," ").concat(t[l+5])):f.push("C".concat(t[l]," ").concat(t[l+1]," ").concat(t[l+2]," ").concat(t[l+3]," ").concat(t[l+4]," ").concat(t[l+5]));f.push("L".concat((i[0]-s)/r," ").concat((i[1]-a)/o," L").concat(h," ").concat(c," L").concat(d," ").concat(p," L").concat((n[0]-s)/r," ").concat((n[1]-a)/o));for(let l=e.length-6;l>=6;l-=6)isNaN(e[l])?f.push("L".concat(e[l+4]," ").concat(e[l+5])):f.push("C".concat(e[l]," ").concat(e[l+1]," ").concat(e[l+2]," ").concat(e[l+3]," ").concat(e[l+4]," ").concat(e[l+5]));return f.push("L".concat(e[4]," ").concat(e[5]," Z")),f.join(" ")}getOutlines(){var t,e;const i=u(Gc,this),n=u(Bc,this),s=u(Uc,this),a=s.subarray(4,6),r=s.subarray(16,18),[o,h,c,d]=u(Hc,this),p=new Float64Array((null!==(t=null===(e=u(Zc,this))||void 0===e?void 0:e.length)&&void 0!==t?t:0)+2);for(let l=0,y=p.length-2;l<y;l+=2)p[l]=(u(Zc,this)[l]-o)/c,p[l+1]=(u(Zc,this)[l+1]-h)/d;p[p.length-2]=(u(qc,this)-o)/c,p[p.length-1]=(u(Xc,this)-h)/d;const[f,g,m,v]=l($c,this,ed).call(this);if(isNaN(s[6])&&!this.isEmpty()){const t=new Float64Array(36);return t.set([NaN,NaN,NaN,NaN,(s[2]-o)/c,(s[3]-h)/d,NaN,NaN,NaN,NaN,(s[4]-o)/c,(s[5]-h)/d,NaN,NaN,NaN,NaN,f,g,NaN,NaN,NaN,NaN,m,v,NaN,NaN,NaN,NaN,(s[16]-o)/c,(s[17]-h)/d,NaN,NaN,NaN,NaN,(s[14]-o)/c,(s[15]-h)/d],0),new ud(t,p,u(Hc,this),u(Jc,this),u(jc,this),u(Vc,this))}const b=new Float64Array(u(Gc,this).length+24+u(Bc,this).length);let w=i.length;for(let l=0;l<w;l+=2)isNaN(i[l])?b[l]=b[l+1]=NaN:(b[l]=i[l],b[l+1]=i[l+1]);b.set([NaN,NaN,NaN,NaN,(a[0]-o)/c,(a[1]-h)/d,NaN,NaN,NaN,NaN,f,g,NaN,NaN,NaN,NaN,m,v,NaN,NaN,NaN,NaN,(r[0]-o)/c,(r[1]-h)/d],w),w+=24;for(let l=n.length-6;l>=6;l-=6)for(let t=0;t<6;t+=2)isNaN(n[l+t])?(b[w]=b[w+1]=NaN,w+=2):(b[w]=n[l+t],b[w+1]=n[l+t+1],w+=2);return b.set([NaN,NaN,NaN,NaN,n[4],n[5]],w),new ud(b,p,u(Hc,this),u(Jc,this),u(jc,this),u(Vc,this))}}function ed(){const t=u(Uc,this).subarray(4,6),e=u(Uc,this).subarray(16,18),[i,n,s,a]=u(Hc,this);return[(u(qc,this)+(t[0]-e[0])/2-i)/s,(u(Xc,this)+(t[1]-e[1])/2-n)/a,(u(qc,this)+(e[0]-t[0])/2-i)/s,(u(Xc,this)+(e[1]-t[1])/2-n)/a]}var id={_:8},nd={_:id._+2},sd=new WeakMap,ad=new WeakMap,rd=new WeakMap,od=new WeakMap,ld=new WeakMap,hd=new WeakMap,cd=new WeakMap,dd=new WeakSet;class ud extends Oc{constructor(t,e,i,n,s,a){super(),o(this,dd),d(this,sd,void 0),d(this,ad,null),d(this,rd,void 0),d(this,od,void 0),d(this,ld,void 0),d(this,hd,void 0),d(this,cd,void 0),p(cd,this,t),p(ld,this,e),p(sd,this,i),p(hd,this,n),p(rd,this,s),p(od,this,a),l(dd,this,gd).call(this,a);const{x:r,y:h,width:c,height:f}=u(ad,this);for(let o=0,l=t.length;o<l;o+=2)t[o]=(t[o]-r)/c,t[o+1]=(t[o+1]-h)/f;for(let o=0,l=e.length;o<l;o+=2)e[o]=(e[o]-r)/c,e[o+1]=(e[o+1]-h)/f}toSVGPath(){const t=["M".concat(u(cd,this)[4]," ").concat(u(cd,this)[5])];for(let e=6,i=u(cd,this).length;e<i;e+=6)isNaN(u(cd,this)[e])?t.push("L".concat(u(cd,this)[e+4]," ").concat(u(cd,this)[e+5])):t.push("C".concat(u(cd,this)[e]," ").concat(u(cd,this)[e+1]," ").concat(u(cd,this)[e+2]," ").concat(u(cd,this)[e+3]," ").concat(u(cd,this)[e+4]," ").concat(u(cd,this)[e+5]));return t.push("Z"),t.join(" ")}serialize(t,e){let[i,n,s,a]=t;const r=s-i,o=a-n;let h,c;switch(e){case 0:h=l(dd,this,pd).call(this,u(cd,this),i,a,r,-o),c=l(dd,this,pd).call(this,u(ld,this),i,a,r,-o);break;case 90:h=l(dd,this,fd).call(this,u(cd,this),i,n,r,o),c=l(dd,this,fd).call(this,u(ld,this),i,n,r,o);break;case 180:h=l(dd,this,pd).call(this,u(cd,this),s,n,-r,o),c=l(dd,this,pd).call(this,u(ld,this),s,n,-r,o);break;case 270:h=l(dd,this,fd).call(this,u(cd,this),s,a,-r,-o),c=l(dd,this,fd).call(this,u(ld,this),s,a,-r,-o)}return{outline:Array.from(h),points:[Array.from(c)]}}get box(){return u(ad,this)}getNewOutline(t,e){const{x:i,y:n,width:s,height:a}=u(ad,this),[r,o,l,h]=u(sd,this),c=s*l,d=a*h,p=i*l+r,f=n*h+o,g=new td({x:u(ld,this)[0]*c+p,y:u(ld,this)[1]*d+f},u(sd,this),u(hd,this),t,u(od,this),null!==e&&void 0!==e?e:u(rd,this));for(let m=2;m<u(ld,this).length;m+=2)g.add({x:u(ld,this)[m]*c+p,y:u(ld,this)[m+1]*d+f});return g.getOutlines()}}function pd(t,e,i,n,s){const a=new Float64Array(t.length);for(let r=0,o=t.length;r<o;r+=2)a[r]=e+t[r]*n,a[r+1]=i+t[r+1]*s;return a}function fd(t,e,i,n,s){const a=new Float64Array(t.length);for(let r=0,o=t.length;r<o;r+=2)a[r]=e+t[r+1]*n,a[r+1]=i+t[r]*s;return a}function gd(t){const e=u(cd,this);let i=e[4],n=e[5],s=i,a=n,r=i,o=n,l=i,h=n;const c=t?Math.max:Math.min;for(let u=6,p=e.length;u<p;u+=6){if(isNaN(e[u]))s=Math.min(s,e[u+4]),a=Math.min(a,e[u+5]),r=Math.max(r,e[u+4]),o=Math.max(o,e[u+5]),h<e[u+5]?(l=e[u+4],h=e[u+5]):h===e[u+5]&&(l=c(l,e[u+4]));else{const t=qt.bezierBoundingBox(i,n,...e.slice(u,u+6));s=Math.min(s,t[0]),a=Math.min(a,t[1]),r=Math.max(r,t[2]),o=Math.max(o,t[3]),h<t[3]?(l=t[2],h=t[3]):h===t[3]&&(l=c(l,t[2]))}i=e[u+4],n=e[u+5]}const d=s-u(rd,this),f=a-u(rd,this),g=r-s+2*u(rd,this),m=o-a+2*u(rd,this);p(ad,this,{x:d,y:f,width:g,height:m,lastPoint:[l,h]})}var md=new WeakMap,vd=new WeakMap,bd=new WeakMap,wd=new WeakMap,yd=new WeakMap,Ad=new WeakMap,_d=new WeakMap,xd=new WeakMap,Ed=new WeakMap,kd=new WeakMap,Md=new WeakMap,Sd=new WeakMap,Cd=new WeakSet;class Td{static get _keyboardManager(){return Pt(this,"_keyboardManager",new Oi([[["Escape","mac+Escape"],Td.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Td.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Td.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Td.prototype._moveToPrevious],[["Home","mac+Home"],Td.prototype._moveToBeginning],[["End","mac+End"],Td.prototype._moveToEnd]]))}constructor(t){var e;let{editor:i=null,uiManager:n=null}=t;o(this,Cd),d(this,md,l(Cd,this,Pd).bind(this)),d(this,vd,l(Cd,this,Id).bind(this)),d(this,bd,null),d(this,wd,null),d(this,yd,void 0),d(this,Ad,null),d(this,_d,!1),d(this,xd,!1),d(this,Ed,null),d(this,kd,void 0),d(this,Md,null),d(this,Sd,void 0),i?(p(xd,this,!1),p(Sd,this,j.HIGHLIGHT_COLOR),p(Ed,this,i)):(p(xd,this,!0),p(Sd,this,j.HIGHLIGHT_DEFAULT_COLOR)),p(Md,this,(null===i||void 0===i?void 0:i._uiManager)||n),p(kd,this,u(Md,this)._eventBus),p(yd,this,(null===i||void 0===i?void 0:i.color)||(null===(e=u(Md,this))||void 0===e?void 0:e.highlightColors.values().next().value)||"#FFFF98")}renderButton(){const t=p(bd,this,document.createElement("button"));t.className="colorPicker",t.tabIndex="0",t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),t.setAttribute("aria-haspopup",!0);const e=u(Md,this)._signal;t.addEventListener("click",l(Cd,this,Fd).bind(this),{signal:e}),t.addEventListener("keydown",u(md,this),{signal:e});const i=p(wd,this,document.createElement("span"));return i.className="swatch",i.setAttribute("aria-hidden",!0),i.style.backgroundColor=u(yd,this),t.append(i),t}renderMainDropdown(){const t=p(Ad,this,l(Cd,this,Rd).call(this));return t.setAttribute("aria-orientation","horizontal"),t.setAttribute("aria-labelledby","highlightColorPickerLabel"),t}_colorSelectFromKeyboard(t){if(t.target===u(bd,this))return void l(Cd,this,Fd).call(this,t);const e=t.target.getAttribute("data-color");e&&l(Cd,this,Ld).call(this,e,t)}_moveToNext(t){var e,i;h(Cd,this,Dd)?t.target!==u(bd,this)?null===(e=t.target.nextSibling)||void 0===e||e.focus():null===(i=u(Ad,this).firstChild)||void 0===i||i.focus():l(Cd,this,Fd).call(this,t)}_moveToPrevious(t){var e,i;t.target!==(null===(e=u(Ad,this))||void 0===e?void 0:e.firstChild)&&t.target!==u(bd,this)?(h(Cd,this,Dd)||l(Cd,this,Fd).call(this,t),null===(i=t.target.previousSibling)||void 0===i||i.focus()):h(Cd,this,Dd)&&this._hideDropdownFromKeyboard()}_moveToBeginning(t){var e;h(Cd,this,Dd)?null===(e=u(Ad,this).firstChild)||void 0===e||e.focus():l(Cd,this,Fd).call(this,t)}_moveToEnd(t){var e;h(Cd,this,Dd)?null===(e=u(Ad,this).lastChild)||void 0===e||e.focus():l(Cd,this,Fd).call(this,t)}hideDropdown(){var t;null===(t=u(Ad,this))||void 0===t||t.classList.add("hidden"),window.removeEventListener("pointerdown",u(vd,this))}_hideDropdownFromKeyboard(){var t;u(xd,this)||(h(Cd,this,Dd)?(this.hideDropdown(),u(bd,this).focus({preventScroll:!0,focusVisible:u(_d,this)})):null===(t=u(Ed,this))||void 0===t||t.unselect())}updateColor(t){if(u(wd,this)&&(u(wd,this).style.backgroundColor=t),!u(Ad,this))return;const e=u(Md,this).highlightColors.values();for(const i of u(Ad,this).children)i.setAttribute("aria-selected",e.next().value===t)}destroy(){var t,e;null===(t=u(bd,this))||void 0===t||t.remove(),p(bd,this,null),p(wd,this,null),null===(e=u(Ad,this))||void 0===e||e.remove(),p(Ad,this,null)}}function Rd(){const t=document.createElement("div"),e=u(Md,this)._signal;t.addEventListener("contextmenu",qe,{signal:e}),t.className="dropdown",t.role="listbox",t.setAttribute("aria-multiselectable",!1),t.setAttribute("aria-orientation","vertical"),t.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[i,n]of u(Md,this).highlightColors){const s=document.createElement("button");s.tabIndex="0",s.role="option",s.setAttribute("data-color",n),s.title=i,s.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-".concat(i));const a=document.createElement("span");s.append(a),a.className="swatch",a.style.backgroundColor=n,s.setAttribute("aria-selected",n===u(yd,this)),s.addEventListener("click",l(Cd,this,Ld).bind(this,n),{signal:e}),t.append(s)}return t.addEventListener("keydown",u(md,this),{signal:e}),t}function Ld(t,e){e.stopPropagation(),u(kd,this).dispatch("switchannotationeditorparams",{source:this,type:u(Sd,this),value:t})}function Pd(t){_._keyboardManager.exec(this,t)}function Fd(t){if(h(Cd,this,Dd))return void this.hideDropdown();if(p(_d,this,0===t.detail),window.addEventListener("pointerdown",u(vd,this),{signal:u(Md,this)._signal}),u(Ad,this))return void u(Ad,this).classList.remove("hidden");const e=p(Ad,this,l(Cd,this,Rd).call(this));u(bd,this).append(e)}function Id(t){var e;null!==(e=u(Ad,this))&&void 0!==e&&e.contains(t.target)||this.hideDropdown()}function Dd(t){return u(Ad,t)&&!u(Ad,t).classList.contains("hidden")}_=Td;var Od=new WeakMap,Nd=new WeakMap,Wd=new WeakMap,zd=new WeakMap,Hd=new WeakMap,Bd=new WeakMap,jd=new WeakMap,Vd=new WeakMap,Gd=new WeakMap,Ud=new WeakMap,qd=new WeakMap,Xd=new WeakMap,Yd=new WeakMap,Kd=new WeakMap,Jd=new WeakMap,Qd=new WeakMap,Zd=new WeakMap,$d=new WeakMap,tu=new WeakMap,eu=new WeakSet;class iu extends Fs{static get _keyboardManager(){const t=iu.prototype;return Pt(this,"_keyboardManager",new Oi([[["ArrowLeft","mac+ArrowLeft"],t._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],t._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],t._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],t._moveCaret,{args:[3]}]]))}constructor(t){super((0,n.A)((0,n.A)({},t),{},{name:"highlightEditor"})),o(this,eu),d(this,Od,null),d(this,Nd,0),d(this,Wd,void 0),d(this,zd,null),d(this,Hd,null),d(this,Bd,null),d(this,jd,null),d(this,Vd,0),d(this,Gd,null),d(this,Ud,null),d(this,qd,null),d(this,Xd,!1),d(this,Yd,l(eu,this,du).bind(this)),d(this,Kd,null),d(this,Jd,void 0),d(this,Qd,null),d(this,Zd,""),d(this,$d,void 0),d(this,tu,""),this.color=t.color||iu._defaultColor,p($d,this,t.thickness||iu._defaultThickness),p(Jd,this,t.opacity||iu._defaultOpacity),p(Wd,this,t.boxes||null),p(tu,this,t.methodOfCreation||""),p(Zd,this,t.text||""),this._isDraggable=!1,t.highlightId>-1?(p(Xd,this,!0),l(eu,this,su).call(this,t),l(eu,this,hu).call(this)):(p(Od,this,t.anchorNode),p(Nd,this,t.anchorOffset),p(jd,this,t.focusNode),p(Vd,this,t.focusOffset),l(eu,this,nu).call(this),l(eu,this,hu).call(this),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:u(Xd,this)?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:u($d,this),methodOfCreation:u(tu,this)}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(t){return{numberOfColors:t.get("color").size}}static initialize(t,e){var i;Fs.initialize(t,e),iu._defaultColor||(iu._defaultColor=(null===(i=e.highlightColors)||void 0===i?void 0:i.values().next().value)||"#fff066")}static updateDefaultParams(t,e){switch(t){case j.HIGHLIGHT_DEFAULT_COLOR:iu._defaultColor=e;break;case j.HIGHLIGHT_THICKNESS:iu._defaultThickness=e}}translateInPage(t,e){}get toolbarPosition(){return u(Kd,this)}updateParams(t,e){switch(t){case j.HIGHLIGHT_COLOR:l(eu,this,au).call(this,e);break;case j.HIGHLIGHT_THICKNESS:l(eu,this,ru).call(this,e)}}static get defaultPropertiesToUpdate(){return[[j.HIGHLIGHT_DEFAULT_COLOR,iu._defaultColor],[j.HIGHLIGHT_THICKNESS,iu._defaultThickness]]}get propertiesToUpdate(){return[[j.HIGHLIGHT_COLOR,this.color||iu._defaultColor],[j.HIGHLIGHT_THICKNESS,u($d,this)||iu._defaultThickness],[j.HIGHLIGHT_FREE,u(Xd,this)]]}async addEditToolbar(){const t=await super.addEditToolbar();return t?(this._uiManager.highlightColors&&(p(Hd,this,new Td({editor:this})),t.addColorPicker(u(Hd,this))),t):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(l(eu,this,pu).call(this))}getBaseTranslation(){return[0,0]}getRect(t,e){return super.getRect(t,e,l(eu,this,pu).call(this))}onceAdded(){this.parent.addUndoableEditor(this),this.div.focus()}remove(){l(eu,this,lu).call(this),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(l(eu,this,hu).call(this),this.isAttachedToDOM||this.parent.add(this)))}setParent(t){let e=!1;if(this.parent&&!t)l(eu,this,lu).call(this);else if(t){var i;l(eu,this,hu).call(this,t),e=!this.parent&&(null===(i=this.div)||void 0===i?void 0:i.classList.contains("selectedEditor"))}super.setParent(t),this.show(this._isVisible),e&&this.select()}rotate(t){const{drawLayer:e}=this.parent;let i;u(Xd,this)?(t=(t-this.rotation+360)%360,i=cu.call(iu,u(Ud,this).box,t)):i=cu.call(iu,this,t),e.rotate(u(qd,this),t),e.rotate(u(Qd,this),t),e.updateBox(u(qd,this),i),e.updateBox(u(Qd,this),cu.call(iu,u(Bd,this).box,t))}render(){if(this.div)return this.div;const t=super.render();u(Zd,this)&&(t.setAttribute("aria-label",u(Zd,this)),t.setAttribute("role","mark")),u(Xd,this)?t.classList.add("free"):this.div.addEventListener("keydown",u(Yd,this),{signal:this._uiManager._signal});const e=p(Gd,this,document.createElement("div"));t.append(e),e.setAttribute("aria-hidden","true"),e.className="internal",e.style.clipPath=u(zd,this);const[i,n]=this.parentDimensions;return this.setDims(this.width*i,this.height*n),Ai(this,u(Gd,this),["pointerover","pointerleave"]),this.enableEditing(),t}pointerover(){this.parent.drawLayer.addClass(u(Qd,this),"hovered")}pointerleave(){this.parent.drawLayer.removeClass(u(Qd,this),"hovered")}_moveCaret(t){switch(this.parent.unselect(this),t){case 0:case 2:l(eu,this,uu).call(this,!0);break;case 1:case 3:l(eu,this,uu).call(this,!1)}}select(){var t,e;super.select(),u(Qd,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.removeClass(u(Qd,this),"hovered"),null===(e=this.parent)||void 0===e||e.drawLayer.addClass(u(Qd,this),"selected"))}unselect(){var t;super.unselect(),u(Qd,this)&&(null===(t=this.parent)||void 0===t||t.drawLayer.removeClass(u(Qd,this),"selected"),u(Xd,this)||l(eu,this,uu).call(this,!1))}get _mustFixPosition(){return!u(Xd,this)}show(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._isVisible;super.show(t),this.parent&&(this.parent.drawLayer.show(u(qd,this),t),this.parent.drawLayer.show(u(Qd,this),t))}static startHighlighting(t,e,i){let{target:n,x:s,y:a}=i;const{x:r,y:o,width:h,height:c}=n.getBoundingClientRect(),d=e=>{l(iu,this,mu).call(this,t,e)},u=t._signal,p={capture:!0,passive:!1,signal:u},f=t=>{t.preventDefault(),t.stopPropagation()},g=e=>{n.removeEventListener("pointermove",d),window.removeEventListener("blur",g),window.removeEventListener("pointerup",g),window.removeEventListener("pointerdown",f,p),window.removeEventListener("contextmenu",qe),l(iu,this,vu).call(this,t,e)};window.addEventListener("blur",g,{signal:u}),window.addEventListener("pointerup",g,{signal:u}),window.addEventListener("pointerdown",f,p),window.addEventListener("contextmenu",qe,{signal:u}),n.addEventListener("pointermove",d,{signal:u}),this._freeHighlight=new td({x:s,y:a},[r,o,h,c],t.scale,this._defaultThickness/2,e,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=t.drawLayer.highlight(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static deserialize(t,e,i){const n=super.deserialize(t,e,i),{rect:[s,a,r,o],color:h,quadPoints:c}=t;n.color=qt.makeHexColor(...h),p(Jd,n,t.opacity);const[d,u]=n.pageDimensions;n.width=(r-s)/d,n.height=(o-a)/u;const f=p(Wd,n,[]);for(let l=0;l<c.length;l+=8)f.push({x:(c[4]-r)/d,y:(o-(1-c[l+5]))/u,width:(c[l+2]-c[l])/d,height:(c[l+5]-c[l+1])/u});return l(eu,n,nu).call(n),n}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty()||t)return null;const e=this.getRect(0,0),i=Fs._colorManager.convert(this.color);return{annotationType:B.HIGHLIGHT,color:i,opacity:u(Jd,this),thickness:u($d,this),quadPoints:l(eu,this,fu).call(this),outlines:l(eu,this,gu).call(this,e),pageIndex:this.pageIndex,rect:e,rotation:l(eu,this,pu).call(this),structTreeParentId:this._structTreeParentId}}static canCreateNewEmptyEditor(){return!1}}function nu(){const t=new Rc(u(Wd,this),.001);p(Ud,this,t.getOutlines()),({x:this.x,y:this.y,width:this.width,height:this.height}=u(Ud,this).box);const e=new Rc(u(Wd,this),.0025,.001,"ltr"===this._uiManager.direction);p(Bd,this,e.getOutlines());const{lastPoint:i}=u(Bd,this).box;p(Kd,this,[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height])}function su(t){let{highlightOutlines:e,highlightId:i,clipPathId:n}=t;p(Ud,this,e);if(p(Bd,this,e.getNewOutline(u($d,this)/2+1.5,.0025)),i>=0)p(qd,this,i),p(zd,this,n),this.parent.drawLayer.finalizeLine(i,e),p(Qd,this,this.parent.drawLayer.highlightOutline(u(Bd,this)));else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(u(qd,this),e),this.parent.drawLayer.updateBox(u(qd,this),cu.call(x,u(Ud,this).box,(t-this.rotation+360)%360)),this.parent.drawLayer.updateLine(u(Qd,this),u(Bd,this)),this.parent.drawLayer.updateBox(u(Qd,this),cu.call(x,u(Bd,this).box,t))}const{x:s,y:a,width:r,height:o}=e.box;switch(this.rotation){case 0:this.x=s,this.y=a,this.width=r,this.height=o;break;case 90:{const[t,e]=this.parentDimensions;this.x=a,this.y=1-s,this.width=r*e/t,this.height=o*t/e;break}case 180:this.x=1-s,this.y=1-a,this.width=r,this.height=o;break;case 270:{const[t,e]=this.parentDimensions;this.x=1-a,this.y=s,this.width=r*e/t,this.height=o*t/e;break}}const{lastPoint:l}=u(Bd,this).box;p(Kd,this,[(l[0]-s)/r,(l[1]-a)/o])}function au(t){const e=t=>{var e,i;this.color=t,null===(e=this.parent)||void 0===e||e.drawLayer.changeColor(u(qd,this),t),null===(i=u(Hd,this))||void 0===i||i.updateColor(t)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:j.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(t)},!0)}function ru(t){const e=u($d,this),i=t=>{p($d,this,t),l(eu,this,ou).call(this,t)};this.addCommands({cmd:i.bind(this,t),undo:i.bind(this,e),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:j.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:t},!0)}function ou(t){if(!u(Xd,this))return;l(eu,this,su).call(this,{highlightOutlines:u(Ud,this).getNewOutline(t/2)}),this.fixAndSetPosition();const[e,i]=this.parentDimensions;this.setDims(this.width*e,this.height*i)}function lu(){null!==u(qd,this)&&this.parent&&(this.parent.drawLayer.remove(u(qd,this)),p(qd,this,null),this.parent.drawLayer.remove(u(Qd,this)),p(Qd,this,null))}function hu(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.parent;null===u(qd,this)&&(({id:s(p,[qd,this])._,clipPathId:s(p,[zd,this])._}=t.drawLayer.highlight(u(Ud,this),this.color,u(Jd,this))),p(Qd,this,t.drawLayer.highlightOutline(u(Bd,this))),u(Gd,this)&&(u(Gd,this).style.clipPath=u(zd,this)))}function cu(t,e){let{x:i,y:n,width:s,height:a}=t;switch(e){case 90:return{x:1-n-a,y:i,width:a,height:s};case 180:return{x:1-i-s,y:1-n-a,width:s,height:a};case 270:return{x:n,y:1-i-s,width:a,height:s}}return{x:i,y:n,width:s,height:a}}function du(t){x._keyboardManager.exec(this,t)}function uu(t){if(!u(Od,this))return;const e=window.getSelection();t?e.setPosition(u(Od,this),u(Nd,this)):e.setPosition(u(jd,this),u(Vd,this))}function pu(){return u(Xd,this)?this.rotation:0}function fu(){if(u(Xd,this))return null;const[t,e]=this.pageDimensions,i=u(Wd,this),n=new Float32Array(8*i.length);let s=0;for(const{x:a,y:r,width:o,height:l}of i){const i=a*t,h=(1-r-l)*e;n[s]=n[s+4]=i,n[s+1]=n[s+3]=h,n[s+2]=n[s+6]=i+o*t,n[s+5]=n[s+7]=h+l*e,s+=8}return n}function gu(t){return u(Ud,this).serialize(t,l(eu,this,pu).call(this))}function mu(t,e){this._freeHighlight.add(e)&&t.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}function vu(t,e){this._freeHighlight.isEmpty()?t.drawLayer.removeFreeHighlight(this._freeHighlightId):t.createAndAddNewEditor(e,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}x=iu,(0,c.A)(iu,"_defaultColor",null),(0,c.A)(iu,"_defaultOpacity",1),(0,c.A)(iu,"_defaultThickness",12),(0,c.A)(iu,"_l10nPromise",void 0),(0,c.A)(iu,"_type","highlight"),(0,c.A)(iu,"_editorType",B.HIGHLIGHT),(0,c.A)(iu,"_freeHighlightId",-1),(0,c.A)(iu,"_freeHighlight",null),(0,c.A)(iu,"_freeHighlightClipId","");var bu=new WeakMap,wu=new WeakMap,yu=new WeakMap,Au=new WeakMap,_u=new WeakMap,xu=new WeakMap,Eu=new WeakMap,ku=new WeakMap,Mu=new WeakMap,Su=new WeakMap,Cu=new WeakMap,Tu=new WeakMap,Ru=new WeakMap,Lu=new WeakMap,Pu=new WeakMap,Fu=new WeakSet;class Iu extends Fs{constructor(t){super((0,n.A)((0,n.A)({},t),{},{name:"inkEditor"})),o(this,Fu),d(this,bu,0),d(this,wu,0),d(this,yu,this.canvasPointermove.bind(this)),d(this,Au,this.canvasPointerleave.bind(this)),d(this,_u,this.canvasPointerup.bind(this)),d(this,xu,this.canvasPointerdown.bind(this)),d(this,Eu,null),d(this,ku,new Path2D),d(this,Mu,!1),d(this,Su,!1),d(this,Cu,!1),d(this,Tu,null),d(this,Ru,0),d(this,Lu,0),d(this,Pu,null),this.color=t.color||null,this.thickness=t.thickness||null,this.opacity=t.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(t,e){Fs.initialize(t,e)}static updateDefaultParams(t,e){switch(t){case j.INK_THICKNESS:Iu._defaultThickness=e;break;case j.INK_COLOR:Iu._defaultColor=e;break;case j.INK_OPACITY:Iu._defaultOpacity=e/100}}updateParams(t,e){switch(t){case j.INK_THICKNESS:l(Fu,this,Du).call(this,e);break;case j.INK_COLOR:l(Fu,this,Ou).call(this,e);break;case j.INK_OPACITY:l(Fu,this,Nu).call(this,e)}}static get defaultPropertiesToUpdate(){return[[j.INK_THICKNESS,Iu._defaultThickness],[j.INK_COLOR,Iu._defaultColor||Fs._defaultLineColor],[j.INK_OPACITY,Math.round(100*Iu._defaultOpacity)]]}get propertiesToUpdate(){var t;return[[j.INK_THICKNESS,this.thickness||Iu._defaultThickness],[j.INK_COLOR,this.color||Iu._defaultColor||Fs._defaultLineColor],[j.INK_OPACITY,Math.round(100*(null!==(t=this.opacity)&&void 0!==t?t:Iu._defaultOpacity))]]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(l(Fu,this,Ku).call(this),l(Fu,this,Ju).call(this)),this.isAttachedToDOM||(this.parent.add(this),l(Fu,this,Qu).call(this)),l(Fu,this,rp).call(this)))}remove(){var t;null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,u(Eu,this)&&(clearTimeout(u(Eu,this)),p(Eu,this,null)),null===(t=u(Tu,this))||void 0===t||t.disconnect(),p(Tu,this,null),super.remove())}setParent(t){!this.parent&&t?this._uiManager.removeShouldRescale(this):this.parent&&null===t&&this._uiManager.addShouldRescale(this),super.setParent(t)}onScaleChanging(){const[t,e]=this.parentDimensions,i=this.width*t,n=this.height*e;this.setDimensions(i,n)}enableEditMode(){u(Mu,this)||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.canvas.addEventListener("pointerdown",u(xu,this),{signal:this._uiManager._signal}))}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.canvas.removeEventListener("pointerdown",u(xu,this)))}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){u(Mu,this)||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),p(Mu,this,!0),this.div.classList.add("disabled"),l(Fu,this,rp).call(this,!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(t){this._focusEventsAllowed&&(super.focusin(t),this.enableEditMode())}canvasPointerdown(t){0===t.button&&this.isInEditMode()&&!u(Mu,this)&&(this.setInForeground(),t.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),l(Fu,this,Hu).call(this,t.offsetX,t.offsetY))}canvasPointermove(t){t.preventDefault(),l(Fu,this,Bu).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){t.preventDefault(),l(Fu,this,Yu).call(this,t)}canvasPointerleave(t){l(Fu,this,Yu).call(this,t)}get isResizable(){return!this.isEmpty()&&u(Mu,this)}render(){if(this.div)return this.div;let t,e;this.width&&(t=this.x,e=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[i,n,s,a]=l(Fu,this,Wu).call(this);if(this.setAt(i,n,0,0),this.setDims(s,a),l(Fu,this,Ku).call(this),this.width){const[i,n]=this.parentDimensions;this.setAspectRatio(this.width*i,this.height*n),this.setAt(t*i,e*n,this.width*i,this.height*n),p(Cu,this,!0),l(Fu,this,Qu).call(this),this.setDims(this.width*i,this.height*n),l(Fu,this,Xu).call(this),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return l(Fu,this,Ju).call(this),this.div}setDimensions(t,e){const i=Math.round(t),n=Math.round(e);if(u(Ru,this)===i&&u(Lu,this)===n)return;p(Ru,this,i),p(Lu,this,n),this.canvas.style.visibility="hidden";const[s,a]=this.parentDimensions;this.width=t/s,this.height=e/a,this.fixAndSetPosition(),u(Mu,this)&&l(Fu,this,Zu).call(this,t,e),l(Fu,this,Qu).call(this),l(Fu,this,Xu).call(this),this.canvas.style.visibility="visible",this.fixDims()}static deserialize(t,e,i){if(t instanceof Bh)return null;const n=super.deserialize(t,e,i);n.thickness=t.thickness,n.color=qt.makeHexColor(...t.color),n.opacity=t.opacity;const[s,a]=n.pageDimensions,r=n.width*s,o=n.height*a,h=n.parentScale,c=t.thickness/2;p(Mu,n,!0),p(Ru,n,Math.round(r)),p(Lu,n,Math.round(o));const{paths:d,rect:u,rotation:f}=t;for(let{bezier:p}of d){p=ip.call(Iu,p,u,f);const t=[];n.paths.push(t);let e=h*(p[0]-c),i=h*(p[1]-c);for(let n=2,a=p.length;n<a;n+=6){const s=h*(p[n]-c),a=h*(p[n+1]-c),r=h*(p[n+2]-c),o=h*(p[n+3]-c),l=h*(p[n+4]-c),d=h*(p[n+5]-c);t.push([[e,i],[s,a],[r,o],[l,d]]),e=l,i=d}const s=l(Iu,this,tp).call(this,t);n.bezierPath2D.push(s)}const g=l(Fu,n,sp).call(n);return p(wu,n,Math.max(Fs.MIN_SIZE,g[2]-g[0])),p(bu,n,Math.max(Fs.MIN_SIZE,g[3]-g[1])),l(Fu,n,Zu).call(n,r,o),n}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=Fs._colorManager.convert(this.ctx.strokeStyle);return{annotationType:B.INK,color:e,thickness:this.thickness,opacity:this.opacity,paths:l(Fu,this,np).call(this,this.scaleFactor/this.parentScale,this.translationX,this.translationY,t),pageIndex:this.pageIndex,rect:t,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}function Du(t){const e=t=>{this.thickness=t,l(Fu,this,rp).call(this)},i=this.thickness;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:j.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function Ou(t){const e=t=>{this.color=t,l(Fu,this,Xu).call(this)},i=this.color;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:j.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function Nu(t){const e=t=>{this.opacity=t,l(Fu,this,Xu).call(this)};t/=100;const i=this.opacity;this.addCommands({cmd:e.bind(this,t),undo:e.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:j.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function Wu(){const{parentRotation:t,parentDimensions:[e,i]}=this;switch(t){case 90:return[0,i,i,e];case 180:return[e,i,e,i];case 270:return[e,0,i,e];default:return[0,0,e,i]}}function zu(){const{ctx:t,color:e,opacity:i,thickness:n,parentScale:s,scaleFactor:a}=this;t.lineWidth=n*s/a,t.lineCap="round",t.lineJoin="round",t.miterLimit=10,t.strokeStyle="".concat(e).concat(function(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")}(i))}function Hu(t,e){const i=this._uiManager._signal;var n;(this.canvas.addEventListener("contextmenu",qe,{signal:i}),this.canvas.addEventListener("pointerleave",u(Au,this),{signal:i}),this.canvas.addEventListener("pointermove",u(yu,this),{signal:i}),this.canvas.addEventListener("pointerup",u(_u,this),{signal:i}),this.canvas.removeEventListener("pointerdown",u(xu,this)),this.isEditing=!0,u(Cu,this))||(p(Cu,this,!0),l(Fu,this,Qu).call(this),this.thickness||(this.thickness=E._defaultThickness),this.color||(this.color=E._defaultColor||Fs._defaultLineColor),null!==(n=this.opacity)&&void 0!==n||(this.opacity=E._defaultOpacity));this.currentPath.push([t,e]),p(Su,this,!1),l(Fu,this,zu).call(this),p(Pu,this,(()=>{l(Fu,this,Gu).call(this),u(Pu,this)&&window.requestAnimationFrame(u(Pu,this))})),window.requestAnimationFrame(u(Pu,this))}function Bu(t,e){const[i,n]=this.currentPath.at(-1);if(this.currentPath.length>1&&t===i&&e===n)return;const s=this.currentPath;let a=u(ku,this);if(s.push([t,e]),p(Su,this,!0),s.length<=2)return a.moveTo(...s[0]),void a.lineTo(t,e);3===s.length&&(p(ku,this,a=new Path2D),a.moveTo(...s[0])),l(Fu,this,Uu).call(this,a,...s.at(-3),...s.at(-2),t,e)}function ju(){if(0===this.currentPath.length)return;const t=this.currentPath.at(-1);u(ku,this).lineTo(...t)}function Vu(t,e){let i;if(p(Pu,this,null),t=Math.min(Math.max(t,0),this.canvas.width),e=Math.min(Math.max(e,0),this.canvas.height),l(Fu,this,Bu).call(this,t,e),l(Fu,this,ju).call(this),1!==this.currentPath.length)i=l(Fu,this,qu).call(this);else{const n=[t,e];i=[[n,n.slice(),n.slice(),n]]}const n=u(ku,this),s=this.currentPath;this.currentPath=[],p(ku,this,new Path2D);this.addCommands({cmd:()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(n),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(l(Fu,this,Ku).call(this),l(Fu,this,Ju).call(this)),l(Fu,this,rp).call(this))},mustExec:!0})}function Gu(){if(!u(Su,this))return;p(Su,this,!1);const t=Math.ceil(this.thickness*this.parentScale),e=this.currentPath.slice(-3),i=e.map((t=>t[0])),n=e.map((t=>t[1])),{ctx:s}=(Math.min(...i),Math.max(...i),Math.min(...n),Math.max(...n),this);s.save(),s.clearRect(0,0,this.canvas.width,this.canvas.height);for(const a of this.bezierPath2D)s.stroke(a);s.stroke(u(ku,this)),s.restore()}function Uu(t,e,i,n,s,a,r){const o=(e+n)/2,l=(i+s)/2,h=(n+a)/2,c=(s+r)/2;t.bezierCurveTo(o+2*(n-o)/3,l+2*(s-l)/3,h+2*(n-h)/3,c+2*(s-c)/3,h,c)}function qu(){const t=this.currentPath;if(t.length<=2)return[[t[0],t[0],t.at(-1),t.at(-1)]];const e=[];let i,[n,s]=t[0];for(i=1;i<t.length-2;i++){const[a,r]=t[i],[o,l]=t[i+1],h=(a+o)/2,c=(r+l)/2,d=[n+2*(a-n)/3,s+2*(r-s)/3],u=[h+2*(a-h)/3,c+2*(r-c)/3];e.push([[n,s],d,u,[h,c]]),[n,s]=[h,c]}const[a,r]=t[i],[o,l]=t[i+1],h=[n+2*(a-n)/3,s+2*(r-s)/3],c=[o+2*(a-o)/3,l+2*(r-l)/3];return e.push([[n,s],h,c,[o,l]]),e}function Xu(){if(this.isEmpty())return void l(Fu,this,$u).call(this);l(Fu,this,zu).call(this);const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),l(Fu,this,$u).call(this);for(const i of this.bezierPath2D)e.stroke(i)}function Yu(t){this.canvas.removeEventListener("pointerleave",u(Au,this)),this.canvas.removeEventListener("pointermove",u(yu,this)),this.canvas.removeEventListener("pointerup",u(_u,this)),this.canvas.addEventListener("pointerdown",u(xu,this),{signal:this._uiManager._signal}),u(Eu,this)&&clearTimeout(u(Eu,this)),p(Eu,this,setTimeout((()=>{p(Eu,this,null),this.canvas.removeEventListener("contextmenu",qe)}),10)),l(Fu,this,Vu).call(this,t.offsetX,t.offsetY),this.addToAnnotationStorage(),this.setInBackground()}function Ku(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}function Ju(){p(Tu,this,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)}))),u(Tu,this).observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{var t;null===(t=u(Tu,this))||void 0===t||t.disconnect(),p(Tu,this,null)}),{once:!0})}function Qu(){if(!u(Cu,this))return;const[t,e]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*t),this.canvas.height=Math.ceil(this.height*e),l(Fu,this,$u).call(this)}function Zu(t,e){const i=l(Fu,this,ap).call(this),n=(t-i)/u(wu,this),s=(e-i)/u(bu,this);this.scaleFactor=Math.min(n,s)}function $u(){const t=l(Fu,this,ap).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function tp(t){const e=new Path2D;for(let i=0,n=t.length;i<n;i++){const[n,s,a,r]=t[i];0===i&&e.moveTo(...n),e.bezierCurveTo(s[0],s[1],a[0],a[1],r[0],r[1])}return e}function ep(t,e,i){const[n,s,a,r]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]+=n,t[e+1]=r-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]+n,t[e+1]=i+s}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=a-t[e],t[e+1]+=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=a-t[e+1],t[e+1]=r-i}break;default:throw new Error("Invalid rotation")}return t}function ip(t,e,i){const[n,s,a,r]=e;switch(i){case 0:for(let e=0,i=t.length;e<i;e+=2)t[e]-=n,t[e+1]=r-t[e+1];break;case 90:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=t[e+1]-s,t[e+1]=i-n}break;case 180:for(let e=0,i=t.length;e<i;e+=2)t[e]=a-t[e],t[e+1]-=s;break;case 270:for(let e=0,i=t.length;e<i;e+=2){const i=t[e];t[e]=r-t[e+1],t[e+1]=a-i}break;default:throw new Error("Invalid rotation")}return t}function np(t,e,i,n){const s=[],a=this.thickness/2,r=t*e+a,o=t*i+a;for(const l of this.paths){const e=[],i=[];for(let n=0,s=l.length;n<s;n++){const[a,h,c,d]=l[n];if(a[0]===d[0]&&a[1]===d[1]&&1===s){const n=t*a[0]+r,s=t*a[1]+o;e.push(n,s),i.push(n,s);break}const u=t*a[0]+r,p=t*a[1]+o,f=t*h[0]+r,g=t*h[1]+o,m=t*c[0]+r,v=t*c[1]+o,b=t*d[0]+r,w=t*d[1]+o;0===n&&(e.push(u,p),i.push(u,p)),e.push(f,g,m,v,b,w),i.push(f,g),n===s-1&&i.push(b,w)}s.push({bezier:ep.call(E,e,n,this.rotation),points:ep.call(E,i,n,this.rotation)})}return s}function sp(){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(const s of this.paths)for(const[a,r,o,l]of s){const s=qt.bezierBoundingBox(...a,...r,...o,...l);t=Math.min(t,s[0]),i=Math.min(i,s[1]),e=Math.max(e,s[2]),n=Math.max(n,s[3])}return[t,i,e,n]}function ap(){return u(Mu,this)?Math.ceil(this.thickness*this.parentScale):0}function rp(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!u(Mu,this))return void l(Fu,this,Xu).call(this);const e=l(Fu,this,sp).call(this),i=l(Fu,this,ap).call(this);p(wu,this,Math.max(Fs.MIN_SIZE,e[2]-e[0])),p(bu,this,Math.max(Fs.MIN_SIZE,e[3]-e[1]));const n=Math.ceil(i+u(wu,this)*this.scaleFactor),s=Math.ceil(i+u(bu,this)*this.scaleFactor),[a,r]=this.parentDimensions;this.width=n/a,this.height=s/r,this.setAspectRatio(n,s);const o=this.translationX,h=this.translationY;this.translationX=-e[0],this.translationY=-e[1],l(Fu,this,Qu).call(this),l(Fu,this,Xu).call(this),p(Ru,this,n),p(Lu,this,s),this.setDims(n,s);const c=t?i/this.scaleFactor/2:0;this.translate(o-this.translationX-c,h-this.translationY-c)}E=Iu,(0,c.A)(Iu,"_defaultColor",null),(0,c.A)(Iu,"_defaultOpacity",1),(0,c.A)(Iu,"_defaultThickness",1),(0,c.A)(Iu,"_type","ink"),(0,c.A)(Iu,"_editorType",B.INK);var op=new WeakMap,lp=new WeakMap,hp=new WeakMap,cp=new WeakMap,dp=new WeakMap,up=new WeakMap,pp=new WeakMap,fp=new WeakMap,gp=new WeakMap,mp=new WeakMap,vp=new WeakMap,bp=new WeakSet;class wp extends Fs{constructor(t){super((0,n.A)((0,n.A)({},t),{},{name:"stampEditor"})),o(this,bp),d(this,op,null),d(this,lp,null),d(this,hp,null),d(this,cp,null),d(this,dp,null),d(this,up,""),d(this,pp,null),d(this,fp,null),d(this,gp,null),d(this,mp,!1),d(this,vp,!1),p(cp,this,t.bitmapUrl),p(dp,this,t.bitmapFile)}static initialize(t,e){Fs.initialize(t,e)}static get supportedTypes(){return Pt(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((t=>"image/".concat(t))))}static get supportedTypesStr(){return Pt(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(B.STAMP,{bitmapFile:t.getAsFile()})}remove(){var t,e;u(lp,this)&&(p(op,this,null),this._uiManager.imageManager.deleteId(u(lp,this)),null===(t=u(pp,this))||void 0===t||t.remove(),p(pp,this,null),null===(e=u(fp,this))||void 0===e||e.disconnect(),p(fp,this,null),u(gp,this)&&(clearTimeout(u(gp,this)),p(gp,this,null)));super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(u(lp,this)&&null===u(pp,this)&&l(bp,this,_p).call(this),this.isAttachedToDOM||this.parent.add(this))):u(lp,this)&&l(bp,this,_p).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(u(hp,this)||u(op,this)||u(cp,this)||u(dp,this)||u(lp,this))}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),u(op,this)?l(bp,this,xp).call(this):l(bp,this,_p).call(this),this.width){const[i,n]=this.parentDimensions;this.setAt(t*i,e*n,this.width*i,this.height*n)}return this.div}getImageForAltText(){return u(pp,this)}static deserialize(t,e,i){if(t instanceof qh)return null;const n=super.deserialize(t,e,i),{rect:s,bitmapUrl:a,bitmapId:r,isSvg:o,accessibilityData:l}=t;r&&i.imageManager.isValidId(r)?p(lp,n,r):p(cp,n,a),p(mp,n,o);const[h,c]=n.pageDimensions;return n.width=(s[2]-s[0])/h,n.height=(s[3]-s[1])/c,l&&(n.altTextData=l),n}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;const i={annotationType:B.STAMP,bitmapId:u(lp,this),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:u(mp,this),structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=l(bp,this,Sp).call(this,!0),i.accessibilityData=this.altTextData,i;const{decorative:n,altText:s}=this.altTextData;if(!n&&s&&(i.accessibilityData={type:"Figure",alt:s}),null===e)return i;e.stamps||(e.stamps=new Map);const a=u(mp,this)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(u(lp,this))){if(u(mp,this)){const t=e.stamps.get(u(lp,this));a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=l(bp,this,Sp).call(this,!1))}}else e.stamps.set(u(lp,this),{area:a,serialized:i}),i.bitmap=l(bp,this,Sp).call(this,!1);return i}}function yp(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?(p(op,this,t.bitmap),e||(p(lp,this,t.id),p(mp,this,t.isSvg)),t.file&&p(up,this,t.file.name),l(bp,this,xp).call(this)):this.remove()}function Ap(){p(hp,this,null),this._uiManager.enableWaiting(!1),u(pp,this)&&this.div.focus()}function _p(){if(u(lp,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(u(lp,this)).then((t=>l(bp,this,yp).call(this,t,!0))).finally((()=>l(bp,this,Ap).call(this)));if(u(cp,this)){const t=u(cp,this);return p(cp,this,null),this._uiManager.enableWaiting(!0),void p(hp,this,this._uiManager.imageManager.getFromUrl(t).then((t=>l(bp,this,yp).call(this,t))).finally((()=>l(bp,this,Ap).call(this))))}if(u(dp,this)){const t=u(dp,this);return p(dp,this,null),this._uiManager.enableWaiting(!0),void p(hp,this,this._uiManager.imageManager.getFromFile(t).then((t=>l(bp,this,yp).call(this,t))).finally((()=>l(bp,this,Ap).call(this))))}const t=document.createElement("input");t.type="file",t.accept=k.supportedTypesStr;const e=this._uiManager._signal;p(hp,this,new Promise((i=>{t.addEventListener("change",(async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);l(bp,this,yp).call(this,e)}else this.remove();i()}),{signal:e}),t.addEventListener("cancel",(()=>{this.remove(),i()}),{signal:e})})).finally((()=>l(bp,this,Ap).call(this)))),t.click()}function xp(){const{div:t}=this;let{width:e,height:i}=u(op,this);const[n,s]=this.pageDimensions,a=.75;if(this.width)e=this.width*n,i=this.height*s;else if(e>a*n||i>a*s){const t=Math.min(a*n/e,a*s/i);e*=t,i*=t}const[r,o]=this.parentDimensions;this.setDims(e*r/n,i*o/s),this._uiManager.enableWaiting(!1);const h=p(pp,this,document.createElement("canvas"));t.append(h),t.hidden=!1,l(bp,this,Mp).call(this,e,i),l(bp,this,Cp).call(this),u(vp,this)||(this.parent.addUndoableEditor(this),p(vp,this,!0)),this._reportTelemetry({action:"inserted_image"}),u(up,this)&&h.setAttribute("aria-label",u(up,this))}function Ep(t,e){var i;const[n,s]=this.parentDimensions;this.width=t/n,this.height=e/s,this.setDims(t,e),null!==(i=this._initialOptions)&&void 0!==i&&i.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==u(gp,this)&&clearTimeout(u(gp,this));p(gp,this,setTimeout((()=>{p(gp,this,null),l(bp,this,Mp).call(this,t,e)}),200))}function kp(t,e){const{width:i,height:n}=u(op,this);let s=i,a=n,r=u(op,this);for(;s>2*t||a>2*e;){const i=s,n=a;s>2*t&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const o=new OffscreenCanvas(s,a);o.getContext("2d").drawImage(r,0,0,i,n,0,0,s,a),r=o.transferToImageBitmap()}return r}function Mp(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=u(pp,this);if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;const n=u(mp,this)?u(op,this):l(bp,this,kp).call(this,t,e);if(this._uiManager.hasMLManager&&!this.hasAltText()){const i=new OffscreenCanvas(t,e).getContext("2d");i.drawImage(n,0,0,n.width,n.height,0,0,t,e),this._uiManager.mlGuess({service:"image-to-text",request:{data:i.getImageData(0,0,t,e).data,width:t,height:e,channels:4}}).then((t=>{const e=(null===t||void 0===t?void 0:t.output)||"";this.parent&&e&&!this.hasAltText()&&(this.altTextData={altText:e,decorative:!1})}))}const s=i.getContext("2d");s.filter=this._uiManager.hcmFilter,s.drawImage(n,0,0,n.width,n.height,0,0,t,e)}function Sp(t){if(t){if(u(mp,this)){const t=this._uiManager.imageManager.getSvgUrl(u(lp,this));if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=u(op,this));return t.getContext("2d").drawImage(u(op,this),0,0),t.toDataURL()}if(u(mp,this)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*ge.PDF_TO_CSS_UNITS),n=Math.round(this.height*e*ge.PDF_TO_CSS_UNITS),s=new OffscreenCanvas(i,n);return s.getContext("2d").drawImage(u(op,this),0,0,u(op,this).width,u(op,this).height,0,0,i,n),s.transferToImageBitmap()}return structuredClone(u(op,this))}function Cp(){this._uiManager._signal&&(p(fp,this,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&l(bp,this,Ep).call(this,e.width,e.height)}))),u(fp,this).observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{var t;null===(t=u(fp,this))||void 0===t||t.disconnect(),p(fp,this,null)}),{once:!0}))}k=wp,(0,c.A)(wp,"_type","stamp"),(0,c.A)(wp,"_editorType",B.STAMP);var Tp=new WeakMap,Rp=new WeakMap,Lp=new WeakMap,Pp=new WeakMap,Fp=new WeakMap,Ip=new WeakMap,Dp=new WeakMap,Op=new WeakMap,Np=new WeakMap,Wp=new WeakMap,zp=new WeakMap,Hp=new WeakMap,Bp=new WeakMap,jp=new WeakSet;class Vp{constructor(t){let{uiManager:e,pageIndex:i,div:n,accessibilityManager:s,annotationLayer:a,drawLayer:r,textLayer:l,viewport:h,l10n:c}=t;o(this,jp),d(this,Tp,void 0),d(this,Rp,!1),d(this,Lp,null),d(this,Pp,null),d(this,Fp,null),d(this,Ip,null),d(this,Dp,null),d(this,Op,new Map),d(this,Np,!1),d(this,Wp,!1),d(this,zp,!1),d(this,Hp,null),d(this,Bp,void 0);const f=[...Kp._.values()];if(!Vp._initialized){Vp._initialized=!0;for(const t of f)t.initialize(c,e)}e.registerEditorTypes(f),p(Bp,this,e),this.pageIndex=i,this.div=n,p(Tp,this,s),p(Lp,this,a),this.viewport=h,p(Hp,this,l),this.drawLayer=r,u(Bp,this).addLayer(this)}get isEmpty(){return 0===u(Op,this).size}get isInvisible(){return this.isEmpty&&u(Bp,this).getMode()===B.NONE}updateToolbar(t){u(Bp,this).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u(Bp,this).getMode();switch(l(jp,this,Yp).call(this),t){case B.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case B.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case B.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of Kp._.values())e.toggle("".concat(i._type,"Editing"),t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===(null===(e=u(Hp,this))||void 0===e?void 0:e.div)}addInkEditorIfNeeded(t){if(u(Bp,this).getMode()!==B.INK)return;if(!t)for(const e of u(Op,this).values())if(e.isEmpty())return void e.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){u(Bp,this).setEditingState(t)}addCommands(t){u(Bp,this).addCommands(t)}togglePointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(){var t;let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=u(Lp,this))||void 0===t||t.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of u(Op,this).values())i.enableEditing(),i.show(!0),i.annotationElementId&&(u(Bp,this).removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!u(Lp,this))return;const e=u(Lp,this).getEditableAnnotations();for(const i of e){if(i.hide(),u(Bp,this).isDeletedAnnotationElement(i.data.id))continue;if(t.has(i.data.id))continue;const e=this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){p(zp,this,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,e=new Map;for(const s of u(Op,this).values()){var i;s.disableEditing(),s.annotationElementId&&(null===s.serialize()?(e.set(s.annotationElementId,s),null===(i=this.getEditableAnnotation(s.annotationElementId))||void 0===i||i.show(),s.remove()):t.set(s.annotationElementId,s))}if(u(Lp,this)){const i=u(Lp,this).getEditableAnnotations();for(const n of i){const{id:i}=n.data;if(u(Bp,this).isDeletedAnnotationElement(i))continue;let s=e.get(i);s?(s.resetAnnotationElement(n),s.show(!1),n.show()):(s=t.get(i),s&&(u(Bp,this).addChangedExistingAnnotation(s),s.renderAnnotationElement(n),s.show(!1)),n.show())}}l(jp,this,Yp).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:n}=this.div;for(const s of Kp._.values())n.remove("".concat(s._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),p(zp,this,!1)}getEditableAnnotation(t){var e;return(null===(e=u(Lp,this))||void 0===e?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){u(Bp,this).getActive()!==t&&u(Bp,this).setActiveEditor(t)}enableTextSelection(){var t;this.div.tabIndex=-1,null!==(t=u(Hp,this))&&void 0!==t&&t.div&&!u(Ip,this)&&(p(Ip,this,l(jp,this,Gp).bind(this)),u(Hp,this).div.addEventListener("pointerdown",u(Ip,this),{signal:u(Bp,this)._signal}),u(Hp,this).div.classList.add("highlighting"))}disableTextSelection(){var t;this.div.tabIndex=0,null!==(t=u(Hp,this))&&void 0!==t&&t.div&&u(Ip,this)&&(u(Hp,this).div.removeEventListener("pointerdown",u(Ip,this)),p(Ip,this,null),u(Hp,this).div.classList.remove("highlighting"))}enableClick(){if(u(Fp,this))return;const t=u(Bp,this)._signal;p(Fp,this,this.pointerdown.bind(this)),p(Pp,this,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",u(Fp,this),{signal:t}),this.div.addEventListener("pointerup",u(Pp,this),{signal:t})}disableClick(){u(Fp,this)&&(this.div.removeEventListener("pointerdown",u(Fp,this)),this.div.removeEventListener("pointerup",u(Pp,this)),p(Fp,this,null),p(Pp,this,null))}attach(t){u(Op,this).set(t.id,t);const{annotationElementId:e}=t;e&&u(Bp,this).isDeletedAnnotationElement(e)&&u(Bp,this).removeDeletedAnnotationElement(t)}detach(t){var e;u(Op,this).delete(t.id),null===(e=u(Tp,this))||void 0===e||e.removePointerInTextLayer(t.contentDiv),!u(zp,this)&&t.annotationElementId&&u(Bp,this).addDeletedAnnotationElement(t)}remove(t){this.detach(t),u(Bp,this).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,u(Wp,this)||this.addInkEditorIfNeeded(!1)}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(u(Bp,this).addDeletedAnnotationElement(t.annotationElementId),Fs.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),null===(e=t.parent)||void 0===e||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),u(Bp,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),u(Bp,this).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!u(Dp,this)&&(t._focusEventsAllowed=!1,p(Dp,this,setTimeout((()=>{p(Dp,this,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:u(Bp,this)._signal}),i.focus())}),0))),t._structTreeParentId=null===(e=u(Tp,this))||void 0===e?void 0:e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return u(Bp,this).getId()}get _signal(){return u(Bp,this)._signal}canCreateNewEmptyEditor(){var t;return null===(t=h(jp,this,Up))||void 0===t?void 0:t.canCreateNewEmptyEditor()}pasteEditor(t,e){u(Bp,this).updateToolbar(t),u(Bp,this).updateMode(t);const{offsetX:i,offsetY:s}=l(jp,this,Xp).call(this),a=this.getNextId(),r=l(jp,this,qp).call(this,(0,n.A)({parent:this,id:a,x:i,y:s,uiManager:u(Bp,this),isCentered:!0},e));r&&this.add(r)}deserialize(t){var e,i;return(null===(e=Kp._.get(null!==(i=t.annotationType)&&void 0!==i?i:t.annotationEditorType))||void 0===e?void 0:e.deserialize(t,this,u(Bp,this)))||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=this.getNextId(),a=l(jp,this,qp).call(this,(0,n.A)({parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:u(Bp,this),isCentered:e},i));return a&&this.add(a),a}addNewEditor(){this.createAndAddNewEditor(l(jp,this,Xp).call(this),!0)}setSelected(t){u(Bp,this).setSelected(t)}toggleSelected(t){u(Bp,this).toggleSelected(t)}isSelected(t){return u(Bp,this).isSelected(t)}unselect(t){u(Bp,this).unselect(t)}pointerup(t){const{isMac:e}=Gt.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&u(Np,this)&&(p(Np,this,!1),u(Rp,this)?u(Bp,this).getMode()!==B.STAMP?this.createAndAddNewEditor(t,!1):u(Bp,this).unselectAll():p(Rp,this,!0))}pointerdown(t){if(u(Bp,this).getMode()===B.HIGHLIGHT&&this.enableTextSelection(),u(Np,this))return void p(Np,this,!1);const{isMac:e}=Gt.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;p(Np,this,!0);const i=u(Bp,this).getActive();p(Rp,this,!i||i.isEmpty())}findNewParent(t,e,i){const n=u(Bp,this).findParent(e,i);return null!==n&&n!==this&&(n.changeParent(t),!0)}destroy(){var t;(null===(t=u(Bp,this).getActive())||void 0===t?void 0:t.parent)===this&&(u(Bp,this).commitOrRemove(),u(Bp,this).setActiveEditor(null)),u(Dp,this)&&(clearTimeout(u(Dp,this)),p(Dp,this,null));for(const i of u(Op,this).values()){var e;null===(e=u(Tp,this))||void 0===e||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove()}this.div=null,u(Op,this).clear(),u(Bp,this).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e,ti(this.div,e);for(const i of u(Bp,this).getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;u(Bp,this).commitOrRemove(),l(jp,this,Yp).call(this);const i=this.viewport.rotation,n=e.rotation;if(this.viewport=e,ti(this.div,{rotation:n}),i!==n)for(const s of u(Op,this).values())s.rotate(n);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return u(Bp,this).viewParameters.realScale}}function Gp(t){if(u(Bp,this).unselectAll(),t.target===u(Hp,this).div){const{isMac:e}=Gt.platform;if(0!==t.button||t.ctrlKey&&e)return;u(Bp,this).showAllEditors("highlight",!0,!0),u(Hp,this).div.classList.add("free"),iu.startHighlighting(this,"ltr"===u(Bp,this).direction,t),u(Hp,this).div.addEventListener("pointerup",(()=>{u(Hp,this).div.classList.remove("free")}),{once:!0,signal:u(Bp,this)._signal}),t.preventDefault()}}function Up(t){return Kp._.get(u(Bp,t).getMode())}function qp(t){const e=h(jp,this,Up);return e?new e.prototype.constructor(t):null}function Xp(){const{x:t,y:e,width:i,height:n}=this.div.getBoundingClientRect(),s=Math.max(0,t),a=Math.max(0,e),r=(s+Math.min(window.innerWidth,t+i))/2-t,o=(a+Math.min(window.innerHeight,e+n))/2-e,[l,h]=this.viewport.rotation%180===0?[r,o]:[o,r];return{offsetX:l,offsetY:h}}function Yp(){p(Wp,this,!0);for(const t of u(Op,this).values())t.isEmpty()&&t.remove();p(Wp,this,!1)}(0,c.A)(Vp,"_initialized",!1);var Kp={_:new Map([mc,Iu,wp,iu].map((t=>[t._editorType,t])))},Jp=new WeakMap,Qp=new WeakMap,Zp=new WeakMap,$p=new WeakMap,tf=new WeakSet;class ef{constructor(t){let{pageIndex:e}=t;o(this,tf),d(this,Jp,null),d(this,Qp,0),d(this,Zp,new Map),d(this,$p,new Map),this.pageIndex=e}setParent(t){if(u(Jp,this)){if(u(Jp,this)!==t){if(u(Zp,this).size>0)for(const e of u(Zp,this).values())e.remove(),t.append(e);p(Jp,this,t)}}else p(Jp,this,t)}static get _svgFactory(){return Pt(this,"_svgFactory",new Ne)}highlight(t,e,i){var n,s;let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=(p(Qp,this,(n=u(Qp,this),s=n++,n)),s),o=l(tf,this,sf).call(this,t.box);o.classList.add("highlight"),t.free&&o.classList.add("free");const h=ef._svgFactory.createElement("defs");o.append(h);const c=ef._svgFactory.createElement("path");h.append(c);const d="path_p".concat(this.pageIndex,"_").concat(r);c.setAttribute("id",d),c.setAttribute("d",t.toSVGPath()),a&&u($p,this).set(r,c);const f=l(tf,this,af).call(this,h,d),g=ef._svgFactory.createElement("use");return o.append(g),o.setAttribute("fill",e),o.setAttribute("fill-opacity",i),g.setAttribute("href","#".concat(d)),u(Zp,this).set(r,o),{id:r,clipPathId:"url(#".concat(f,")")}}highlightOutline(t){var e,i;const n=(p(Qp,this,(e=u(Qp,this),i=e++,e)),i),s=l(tf,this,sf).call(this,t.box);s.classList.add("highlightOutline");const a=ef._svgFactory.createElement("defs");s.append(a);const r=ef._svgFactory.createElement("path");a.append(r);const o="path_p".concat(this.pageIndex,"_").concat(n);let h;if(r.setAttribute("id",o),r.setAttribute("d",t.toSVGPath()),r.setAttribute("vector-effect","non-scaling-stroke"),t.free){s.classList.add("free");const t=ef._svgFactory.createElement("mask");a.append(t),h="mask_p".concat(this.pageIndex,"_").concat(n),t.setAttribute("id",h),t.setAttribute("maskUnits","objectBoundingBox");const e=ef._svgFactory.createElement("rect");t.append(e),e.setAttribute("width","1"),e.setAttribute("height","1"),e.setAttribute("fill","white");const i=ef._svgFactory.createElement("use");t.append(i),i.setAttribute("href","#".concat(o)),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const c=ef._svgFactory.createElement("use");s.append(c),c.setAttribute("href","#".concat(o)),h&&c.setAttribute("mask","url(#".concat(h,")"));const d=c.cloneNode();return s.append(d),c.classList.add("mainOutline"),d.classList.add("secondaryOutline"),u(Zp,this).set(n,s),n}finalizeLine(t,e){const i=u($p,this).get(t);u($p,this).delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){u(Zp,this).get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}removeFreeHighlight(t){this.remove(t),u($p,this).delete(t)}updatePath(t,e){u($p,this).get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){nf.call(ef,u(Zp,this).get(t),e)}show(t,e){u(Zp,this).get(t).classList.toggle("hidden",!e)}rotate(t,e){u(Zp,this).get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){u(Zp,this).get(t).setAttribute("fill",e)}changeOpacity(t,e){u(Zp,this).get(t).setAttribute("fill-opacity",e)}addClass(t,e){u(Zp,this).get(t).classList.add(e)}removeClass(t,e){u(Zp,this).get(t).classList.remove(e)}remove(t){null!==u(Jp,this)&&(u(Zp,this).get(t).remove(),u(Zp,this).delete(t))}destroy(){p(Jp,this,null);for(const t of u(Zp,this).values())t.remove();u(Zp,this).clear()}}function nf(t){let{x:e=0,y:i=0,width:n=1,height:s=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{style:a}=t;a.top="".concat(100*i,"%"),a.left="".concat(100*e,"%"),a.width="".concat(100*n,"%"),a.height="".concat(100*s,"%")}function sf(t){const e=M._svgFactory.create(1,1,!0);return u(Jp,this).append(e),e.setAttribute("aria-hidden",!0),nf.call(M,e,t),e}function af(t,e){const i=M._svgFactory.createElement("clipPath");t.append(i);const n="clip_".concat(e);i.setAttribute("id",n),i.setAttribute("clipPathUnits","objectBoundingBox");const s=M._svgFactory.createElement("use");return i.append(s),s.setAttribute("href","#".concat(e)),s.classList.add("clip"),n}M=ef;var rf=C.AnnotationLayer,of=C.AnnotationMode,lf=C.GlobalWorkerOptions,hf=C.PDFDataRangeTransport,cf=C.TextLayer,df=C.getDocument},53986:(t,e,i)=>{"use strict";function n(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)i=a[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}i.d(e,{A:()=>n})},54159:(t,e)=>{var i;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var t="",e=0;e<arguments.length;e++){var i=arguments[e];i&&(t=r(t,a(i)))}return t}function a(t){if("string"===typeof t||"number"===typeof t)return t;if("object"!==typeof t)return"";if(Array.isArray(t))return s.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var i in t)n.call(t,i)&&t[i]&&(e=r(e,i));return e}function r(t,e){return e?t?t+" "+e:t+e:t}t.exports?(s.default=s,t.exports=s):void 0===(i=function(){return s}.apply(e,[]))||(t.exports=i)}()},56859:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"};var r=i(80036);const o=s.forwardRef((function(t,e){return s.createElement(r.A,(0,n.A)({},t,{ref:e,icon:a}))}))},57325:(t,e,i)=>{var n=i(20907),s=0;t.exports=function(t){var e=++s;return n(t)+e}},58882:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"};var r=i(80036);const o=s.forwardRef((function(t,e){return s.createElement(r.A,(0,n.A)({},t,{ref:e,icon:a}))}))},63697:(t,e,i)=>{"use strict";function n(t){var e=!1;return{promise:new Promise((function(i,n){t.then((function(t){return!e&&i(t)})).catch((function(t){return!e&&n(t)}))})),cancel:function(){e=!0}}}i.d(e,{A:()=>n})},64288:(t,e,i)=>{"use strict";i.d(e,{A:()=>a});var n=!0,s="Invariant failed";function a(t,e){if(!t){if(n)throw new Error(s);var i="function"===typeof e?e():e,a=i?"".concat(s,": ").concat(i):s;throw new Error(a)}}},64467:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(20816);function s(t,e,i){return(e=(0,n.A)(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}},64579:(t,e,i)=>{var n=i(78913),s=/^\s+/;t.exports=function(t){return t?t.slice(0,n(t)+1).replace(s,""):t}},66499:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(89261);function s(t){let{children:e,type:i}=t;return(0,n.jsx)("div",{className:"react-pdf__message react-pdf__message--".concat(i),children:e})}},68102:(t,e,i)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},n.apply(null,arguments)}i.d(e,{A:()=>n})},70041:(t,e,i)=>{"use strict";i.d(e,{A:()=>I});var n=i(89261),s=i(94922),a=i(63697),r=i(36294),o=i(47215);function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=t.filter(Boolean);return i.length<=1?i[0]||null:function(t){i.forEach((function(e){"function"===typeof e?e(t):e&&(e.current=t)}))}}var h=i(64288),c=i(98677);const d=(0,s.createContext)(null);var u=i(66499),p=i(51938);const f={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},g=/^H(\d+)$/;function m(t){return"children"in t}function v(t){return!!m(t)&&(1===t.children.length&&0 in t.children&&"id"in t.children[0])}function b(t){const e={};if(m(t)){const{role:i}=t,n=i.match(g);if(n)e.role="heading",e["aria-level"]=Number(n[1]);else if(function(t){return t in f}(i)){const t=f[i];t&&(e.role=t)}}return e}function w(t){const e={};if(m(t)){if(void 0!==t.alt&&(e["aria-label"]=t.alt),void 0!==t.lang&&(e.lang=t.lang),v(t)){const[i]=t.children;if(i){const t=w(i);return Object.assign(Object.assign({},e),t)}}}else"id"in t&&(e["aria-owns"]=t.id);return e}function y(t){return t?Object.assign(Object.assign({},b(t)),w(t)):null}function A(t){let{className:e,node:i}=t;const a=(0,s.useMemo)((()=>y(i)),[i]),r=(0,s.useMemo)((()=>m(i)?v(i)?null:i.children.map(((t,e)=>(0,n.jsx)(A,{node:t},e))):null),[i]);return(0,n.jsx)("span",Object.assign({className:e},a,{children:r}))}function _(){return(0,s.useContext)(d)}var x=i(42166),E=i(42461);function k(){const t=_();(0,h.A)(t,"Unable to find Page context.");const{onGetStructTreeError:e,onGetStructTreeSuccess:i}=t,[r,o]=(0,x.A)(),{value:l,error:d}=r,{customTextRenderer:u,page:p}=t;return(0,s.useEffect)((function(){o({type:"RESET"})}),[o,p]),(0,s.useEffect)((function(){if(u)return;if(!p)return;const t=(0,a.A)(p.getStructTree()),e=t;return t.promise.then((t=>{o({type:"RESOLVE",value:t})})).catch((t=>{o({type:"REJECT",error:t})})),()=>(0,E.xL)(e)}),[u,p,o]),(0,s.useEffect)((()=>{void 0!==l&&(!1!==l?l&&i&&i(l):d&&(c(!1,d.toString()),e&&e(d)))}),[l]),l?(0,n.jsx)(A,{className:"react-pdf__Page__structTree structTree",node:l}):null}const M=p.ng;function S(t){const e=_();(0,h.A)(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},e),t),{_className:a,canvasBackground:r,devicePixelRatio:o=(0,E.mZ)(),onRenderError:d,onRenderSuccess:u,page:p,renderForms:f,renderTextLayer:g,rotate:m,scale:v}=i,{canvasRef:b}=t;(0,h.A)(p,"Attempted to render page canvas, but no page was specified.");const w=(0,s.useRef)(null);function y(t){(0,E.UT)(t)||(c(!1,t.toString()),d&&d(t))}const A=(0,s.useMemo)((()=>p.getViewport({scale:v*o,rotation:m})),[o,p,m,v]),x=(0,s.useMemo)((()=>p.getViewport({scale:v,rotation:m})),[p,m,v]);(0,s.useEffect)((function(){if(!p)return;p.cleanup();const{current:t}=w;if(!t)return;t.width=A.width,t.height=A.height,t.style.width="".concat(Math.floor(x.width),"px"),t.style.height="".concat(Math.floor(x.height),"px"),t.style.visibility="hidden";const e={annotationMode:f?M.ENABLE_FORMS:M.ENABLE,canvasContext:t.getContext("2d",{alpha:!1}),viewport:A};r&&(e.background=r);const i=p.render(e),n=i;return i.promise.then((()=>{t.style.visibility="",p&&u&&u((0,E.vS)(p,v))})).catch(y),()=>(0,E.xL)(n)}),[r,p,f,A,x]);const S=(0,s.useCallback)((()=>{const{current:t}=w;t&&(t.width=0,t.height=0)}),[]);return(0,s.useEffect)((()=>S),[S]),(0,n.jsx)("canvas",{className:"".concat(a,"__canvas"),dir:"ltr",ref:l(b,w),style:{display:"block",userSelect:"none"},children:g?(0,n.jsx)(k,{}):null})}function C(){const t=_();(0,h.A)(t,"Unable to find Page context.");const{customTextRenderer:e,onGetTextError:i,onGetTextSuccess:r,onRenderTextLayerError:l,onRenderTextLayerSuccess:d,page:u,pageIndex:f,pageNumber:g,rotate:m,scale:v}=t;(0,h.A)(u,"Attempted to load page text content, but no page was specified.");const[b,w]=(0,x.A)(),{value:y,error:A}=b,k=(0,s.useRef)(null),M=(0,s.useRef)(void 0);c(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),(0,s.useEffect)((function(){w({type:"RESET"})}),[u,w]),(0,s.useEffect)((function(){if(!u)return;const t=(0,a.A)(u.getTextContent()),e=t;return t.promise.then((t=>{w({type:"RESOLVE",value:t})})).catch((t=>{w({type:"REJECT",error:t})})),()=>(0,E.xL)(e)}),[u,w]),(0,s.useEffect)((()=>{void 0!==y&&(!1!==y?y&&r&&r(y):A&&(c(!1,A.toString()),i&&i(A)))}),[y]);const S=(0,s.useCallback)((()=>{d&&d()}),[d]),C=(0,s.useCallback)((t=>{c(!1,t.toString()),l&&l(t)}),[l]);const T=(0,s.useMemo)((()=>u.getViewport({scale:v,rotation:m})),[u,m,v]);return(0,s.useLayoutEffect)((function(){if(!u||!y)return;const{current:t}=k;if(!t)return;t.innerHTML="";const i=u.streamTextContent({includeMarkedContent:!0}),n={container:t,textContentSource:i,viewport:T},s=new p.D6(n),a=s;return s.render().then((()=>{const i=document.createElement("div");i.className="endOfContent",t.append(i),M.current=i;const n=t.querySelectorAll('[role="presentation"]');if(e){let t=0;y.items.forEach(((i,s)=>{if(!function(t){return"str"in t}(i))return;const a=n[t];if(!a)return;const r=e(Object.assign({pageIndex:f,pageNumber:g,itemIndex:s},i));a.innerHTML=r,t+=i.str&&i.hasEOL?2:1}))}S()})).catch(C),()=>(0,E.xL)(a)}),[e,C,S,u,f,g,y,T]),(0,n.jsx)("div",{className:(0,o.A)("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const t=M.current;t&&t.classList.remove("active")},onMouseDown:function(){const t=M.current;t&&t.classList.add("active")},ref:k})}var T=i(85724);function R(){return(0,s.useContext)(T.A)}function L(){const t=R(),e=_();(0,h.A)(e,"Unable to find Page context.");const i=Object.assign(Object.assign({},t),e),{imageResourcesPath:r,linkService:l,onGetAnnotationsError:d,onGetAnnotationsSuccess:u,onRenderAnnotationLayerError:f,onRenderAnnotationLayerSuccess:g,page:m,pdf:v,renderForms:b,rotate:w,scale:y=1}=i;(0,h.A)(v,"Attempted to load page annotations, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop."),(0,h.A)(m,"Attempted to load page annotations, but no page was specified."),(0,h.A)(l,"Attempted to load page annotations, but no linkService was specified.");const[A,k]=(0,x.A)(),{value:M,error:S}=A,C=(0,s.useRef)(null);c(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),(0,s.useEffect)((function(){k({type:"RESET"})}),[k,m]),(0,s.useEffect)((function(){if(!m)return;const t=(0,a.A)(m.getAnnotations()),e=t;return t.promise.then((t=>{k({type:"RESOLVE",value:t})})).catch((t=>{k({type:"REJECT",error:t})})),()=>{(0,E.xL)(e)}}),[k,m]),(0,s.useEffect)((()=>{void 0!==M&&(!1!==M?M&&u&&u(M):S&&(c(!1,S.toString()),d&&d(S)))}),[M]);const T=(0,s.useMemo)((()=>m.getViewport({scale:y,rotation:w})),[m,w,y]);return(0,s.useEffect)((function(){if(!v||!m||!l||!M)return;const{current:t}=C;if(!t)return;const e=T.clone({dontFlip:!0}),i={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:t,l10n:null,page:m,viewport:e},n={annotations:M,annotationStorage:v.annotationStorage,div:t,imageResourcesPath:r,linkService:l,page:m,renderForms:b,viewport:e};t.innerHTML="";try{new p.dU(i).render(n),g&&g()}catch(s){!function(t){c(!1,"".concat(t)),f&&f(t)}(s)}return()=>{}}),[M,r,l,m,v,b,T]),(0,n.jsx)("div",{className:(0,o.A)("react-pdf__Page__annotations","annotationLayer"),ref:C})}var P=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i};const F=1;function I(t){const e=R(),i=Object.assign(Object.assign({},e),t),{_className:p="react-pdf__Page",_enableRegisterUnregisterPage:f=!0,canvasBackground:g,canvasRef:m,children:v,className:b,customRenderer:w,customTextRenderer:y,devicePixelRatio:A,error:_="Failed to load the page.",height:k,inputRef:M,loading:T="Loading page\u2026",noData:I="No page specified.",onGetAnnotationsError:D,onGetAnnotationsSuccess:O,onGetStructTreeError:N,onGetStructTreeSuccess:W,onGetTextError:z,onGetTextSuccess:H,onLoadError:B,onLoadSuccess:j,onRenderAnnotationLayerError:V,onRenderAnnotationLayerSuccess:G,onRenderError:U,onRenderSuccess:q,onRenderTextLayerError:X,onRenderTextLayerSuccess:Y,pageIndex:K,pageNumber:J,pdf:Q,registerPage:Z,renderAnnotationLayer:$=!0,renderForms:tt=!1,renderMode:et="canvas",renderTextLayer:it=!0,rotate:nt,scale:st=F,unregisterPage:at,width:rt}=i,ot=P(i,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[lt,ht]=(0,x.A)(),{value:ct,error:dt}=lt,ut=(0,s.useRef)(null);(0,h.A)(Q,"Attempted to load a page, but no document was specified. Wrap <Page /> in a <Document /> or pass explicit `pdf` prop.");const pt=(0,E.ci)(J)?J-1:null!==K&&void 0!==K?K:null,ft=null!==J&&void 0!==J?J:(0,E.ci)(K)?K+1:null,gt=null!==nt&&void 0!==nt?nt:ct?ct.rotate:null,mt=(0,s.useMemo)((()=>{if(!ct)return null;let t=1;const e=null!==st&&void 0!==st?st:F;if(rt||k){const e=ct.getViewport({scale:1,rotation:gt});rt?t=rt/e.width:k&&(t=k/e.height)}return e*t}),[k,ct,gt,st,rt]);(0,s.useEffect)((function(){return()=>{(0,E.ci)(pt)&&f&&at&&at(pt)}}),[f,Q,pt,at]),(0,s.useEffect)((function(){ht({type:"RESET"})}),[ht,Q,pt]),(0,s.useEffect)((function(){if(!Q||!ft)return;const t=(0,a.A)(Q.getPage(ft)),e=t;return t.promise.then((t=>{ht({type:"RESOLVE",value:t})})).catch((t=>{ht({type:"REJECT",error:t})})),()=>(0,E.xL)(e)}),[ht,Q,ft]),(0,s.useEffect)((()=>{void 0!==ct&&(!1!==ct?function(){if(j){if(!ct||!mt)return;j((0,E.vS)(ct,mt))}if(f&&Z){if(!(0,E.ci)(pt)||!ut.current)return;Z(pt,ut.current)}}():dt&&(c(!1,dt.toString()),B&&B(dt)))}),[ct,mt]);const vt=(0,s.useMemo)((()=>ct&&(0,E.ci)(pt)&&ft&&(0,E.ci)(gt)&&(0,E.ci)(mt)?{_className:p,canvasBackground:g,customTextRenderer:y,devicePixelRatio:A,onGetAnnotationsError:D,onGetAnnotationsSuccess:O,onGetStructTreeError:N,onGetStructTreeSuccess:W,onGetTextError:z,onGetTextSuccess:H,onRenderAnnotationLayerError:V,onRenderAnnotationLayerSuccess:G,onRenderError:U,onRenderSuccess:q,onRenderTextLayerError:X,onRenderTextLayerSuccess:Y,page:ct,pageIndex:pt,pageNumber:ft,renderForms:tt,renderTextLayer:it,rotate:gt,scale:mt}:null),[p,g,y,A,D,O,N,W,z,H,V,G,U,q,X,Y,ct,pt,ft,tt,it,gt,mt]),bt=(0,s.useMemo)((()=>(0,r.Ay)(ot,(()=>ct?mt?(0,E.vS)(ct,mt):void 0:ct))),[ot,ct,mt]),wt="".concat(pt,"@").concat(mt,"/").concat(gt);function yt(){switch(et){case"custom":return(0,h.A)(w,'renderMode was set to "custom", but no customRenderer was passed.'),(0,n.jsx)(w,{},"".concat(wt,"_custom"));case"none":return null;default:return(0,n.jsx)(S,{canvasRef:m},"".concat(wt,"_canvas"))}}return(0,n.jsx)("div",Object.assign({className:(0,o.A)(p,b),"data-page-number":ft,ref:l(M,ut),style:{"--scale-factor":"".concat(mt),backgroundColor:g||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},bt,{children:ft?null===Q||void 0===ct||null===ct?(0,n.jsx)(u.A,{type:"loading",children:"function"===typeof T?T():T}):!1===Q||!1===ct?(0,n.jsx)(u.A,{type:"error",children:"function"===typeof _?_():_}):(0,n.jsxs)(d.Provider,{value:vt,children:[yt(),it?(0,n.jsx)(C,{},"".concat(wt,"_text")):null,$?(0,n.jsx)(L,{},"".concat(wt,"_annotations")):null,v]}):(0,n.jsx)(u.A,{type:"no-data",children:"function"===typeof I?I():I})}))}},74935:(t,e,i)=>{"use strict";var n=i(94922),s=Symbol.for("react.element"),a=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function h(t,e,i){var n,a={},h=null,c=null;for(n in void 0!==i&&(h=""+i),void 0!==e.key&&(h=""+e.key),void 0!==e.ref&&(c=e.ref),e)r.call(e,n)&&!l.hasOwnProperty(n)&&(a[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps)void 0===a[n]&&(a[n]=e[n]);return{$$typeof:s,type:t,key:h,ref:c,props:a,_owner:o.current}}e.jsx=h,e.jsxs=h},78678:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(94922);const s=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=(0,n.useRef)(t);return e||(i.current=t),(0,n.useCallback)((function(){return i.current&&i.current(...arguments)}),[])}},78913:t=>{var e=/\s/;t.exports=function(t){for(var i=t.length;i--&&e.test(t.charAt(i)););return i}},79111:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(68102),s=i(94922);const a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};var r=i(80036);const o=s.forwardRef((function(t,e){return s.createElement(r.A,(0,n.A)({},t,{ref:e,icon:a}))}))},79461:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n=t=>{const e=[];let i=0;const n=()=>{if(0!==e.length){if(i<t){const t=e.shift();i+=1,t().finally((()=>{i-=1,n()}))}}else i=0};return t=>new Promise((i=>{e.push((()=>{const e=Promise.resolve().then((()=>t()));return i(e),e})),n()}))}},80036:(t,e,i)=>{"use strict";i.d(e,{A:()=>St});var n=i(68102),s=i(3141);function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function r(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:e+""}function o(t,e,i){return(e=r(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function l(t,e){if(null==t)return{};var i,n,s=function(t,e){if(null==t)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;i[n]=t[n]}return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)i=a[n],-1===e.indexOf(i)&&{}.propertyIsEnumerable.call(t,i)&&(s[i]=t[i])}return s}var h=i(94922),c=i.n(h),d=i(54159),u=i.n(d);const p=Math.round;function f(t,e){const i=t.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],n=i.map((t=>parseFloat(t)));for(let s=0;s<3;s+=1)n[s]=e(n[s]||0,i[s]||"",s);return i[3]?n[3]=i[3].includes("%")?n[3]/100:n[3]:n[3]=1,n}const g=(t,e,i)=>0===i?t:t/100;function m(t,e){const i=e||255;return t>i?i:t<0?0:t}class v{constructor(t){function e(e){return e[0]in t&&e[1]in t&&e[2]in t}if(o(this,"isValid",!0),o(this,"r",0),o(this,"g",0),o(this,"b",0),o(this,"a",1),o(this,"_h",void 0),o(this,"_s",void 0),o(this,"_l",void 0),o(this,"_v",void 0),o(this,"_max",void 0),o(this,"_min",void 0),o(this,"_brightness",void 0),t)if("string"===typeof t){const i=t.trim();function n(t){return i.startsWith(t)}/^#?[A-F\d]{3,8}$/i.test(i)?this.fromHexString(i):n("rgb")?this.fromRgbString(i):n("hsl")?this.fromHslString(i):(n("hsv")||n("hsb"))&&this.fromHsvString(i)}else if(t instanceof v)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(e("rgb"))this.r=m(t.r),this.g=m(t.g),this.b=m(t.b),this.a="number"===typeof t.a?m(t.a,1):1;else if(e("hsl"))this.fromHsl(t);else{if(!e("hsv"))throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t));this.fromHsv(t)}else;}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const e=this.toHsv();return e.h=t,this._c(e)}getLuminance(){function t(t){const e=t/255;return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}return.2126*t(this.r)+.7152*t(this.g)+.0722*t(this.b)}getHue(){if("undefined"===typeof this._h){const t=this.getMax()-this.getMin();this._h=0===t?0:p(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/t+2:(this.r-this.g)/t+4))}return this._h}getSaturation(){if("undefined"===typeof this._s){const t=this.getMax()-this.getMin();this._s=0===t?0:t/this.getMax()}return this._s}getLightness(){return"undefined"===typeof this._l&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return"undefined"===typeof this._v&&(this._v=this.getMax()/255),this._v}getBrightness(){return"undefined"===typeof this._brightness&&(this._brightness=(299*this.r+587*this.g+114*this.b)/1e3),this._brightness}darken(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.getHue(),i=this.getSaturation();let n=this.getLightness()-t/100;return n<0&&(n=0),this._c({h:e,s:i,l:n,a:this.a})}lighten(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.getHue(),i=this.getSaturation();let n=this.getLightness()+t/100;return n>1&&(n=1),this._c({h:e,s:i,l:n,a:this.a})}mix(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;const i=this._c(t),n=e/100,s=t=>(i[t]-this[t])*n+this[t],a={r:p(s("r")),g:p(s("g")),b:p(s("b")),a:p(100*s("a"))/100};return this._c(a)}tint(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix({r:255,g:255,b:255,a:1},t)}shade(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const e=this._c(t),i=this.a+e.a*(1-this.a),n=t=>p((this[t]*this.a+e[t]*e.a*(1-this.a))/i);return this._c({r:n("r"),g:n("g"),b:n("b"),a:i})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const e=(this.r||0).toString(16);t+=2===e.length?e:"0"+e;const i=(this.g||0).toString(16);t+=2===i.length?i:"0"+i;const n=(this.b||0).toString(16);if(t+=2===n.length?n:"0"+n,"number"===typeof this.a&&this.a>=0&&this.a<1){const e=p(255*this.a).toString(16);t+=2===e.length?e:"0"+e}return t}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),e=p(100*this.getSaturation()),i=p(100*this.getLightness());return 1!==this.a?"hsla(".concat(t,",").concat(e,"%,").concat(i,"%,").concat(this.a,")"):"hsl(".concat(t,",").concat(e,"%,").concat(i,"%)")}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return 1!==this.a?"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")"):"rgb(".concat(this.r,",").concat(this.g,",").concat(this.b,")")}toString(){return this.toRgbString()}_sc(t,e,i){const n=this.clone();return n[t]=m(e,i),n}_c(t){return new this.constructor(t)}getMax(){return"undefined"===typeof this._max&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return"undefined"===typeof this._min&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const e=t.replace("#","");function i(t,i){return parseInt(e[t]+e[i||t],16)}e.length<6?(this.r=i(0),this.g=i(1),this.b=i(2),this.a=e[3]?i(3)/255:1):(this.r=i(0,1),this.g=i(2,3),this.b=i(4,5),this.a=e[6]?i(6,7)/255:1)}fromHsl(t){let{h:e,s:i,l:n,a:s}=t;if(this._h=e%360,this._s=i,this._l=n,this.a="number"===typeof s?s:1,i<=0){const t=p(255*n);this.r=t,this.g=t,this.b=t}let a=0,r=0,o=0;const l=e/60,h=(1-Math.abs(2*n-1))*i,c=h*(1-Math.abs(l%2-1));l>=0&&l<1?(a=h,r=c):l>=1&&l<2?(a=c,r=h):l>=2&&l<3?(r=h,o=c):l>=3&&l<4?(r=c,o=h):l>=4&&l<5?(a=c,o=h):l>=5&&l<6&&(a=h,o=c);const d=n-h/2;this.r=p(255*(a+d)),this.g=p(255*(r+d)),this.b=p(255*(o+d))}fromHsv(t){let{h:e,s:i,v:n,a:s}=t;this._h=e%360,this._s=i,this._v=n,this.a="number"===typeof s?s:1;const a=p(255*n);if(this.r=a,this.g=a,this.b=a,i<=0)return;const r=e/60,o=Math.floor(r),l=r-o,h=p(n*(1-i)*255),c=p(n*(1-i*l)*255),d=p(n*(1-i*(1-l))*255);switch(o){case 0:this.g=d,this.b=h;break;case 1:this.r=c,this.b=h;break;case 2:this.r=h,this.b=d;break;case 3:this.r=h,this.g=c;break;case 4:this.r=d,this.g=h;break;default:this.g=h,this.b=c}}fromHsvString(t){const e=f(t,g);this.fromHsv({h:e[0],s:e[1],v:e[2],a:e[3]})}fromHslString(t){const e=f(t,g);this.fromHsl({h:e[0],s:e[1],l:e[2],a:e[3]})}fromRgbString(t){const e=f(t,((t,e)=>e.includes("%")?p(t/100*255):t));this.r=e[0],this.g=e[1],this.b=e[2],this.a=e[3]}}var b=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function w(t,e,i){var n;return(n=Math.round(t.h)>=60&&Math.round(t.h)<=240?i?Math.round(t.h)-2*e:Math.round(t.h)+2*e:i?Math.round(t.h)+2*e:Math.round(t.h)-2*e)<0?n+=360:n>=360&&(n-=360),n}function y(t,e,i){return 0===t.h&&0===t.s?t.s:((n=i?t.s-.16*e:4===e?t.s+.16:t.s+.05*e)>1&&(n=1),i&&5===e&&n>.1&&(n=.1),n<.06&&(n=.06),Math.round(100*n)/100);var n}function A(t,e,i){var n;return n=i?t.v+.05*e:t.v-.15*e,n=Math.max(0,Math.min(1,n)),Math.round(100*n)/100}var _=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];_.primary=_[5];var x=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];x.primary=x[5];var E=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];E.primary=E[5];var k=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];k.primary=k[5];var M=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];M.primary=M[5];var S=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];S.primary=S[5];var C=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];C.primary=C[5];var T=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];T.primary=T[5];var R=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];R.primary=R[5];var L=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];L.primary=L[5];var P=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];P.primary=P[5];var F=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];F.primary=F[5];var I=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];I.primary=I[5];var D=["#2a1215","#431418","#58181c","#791a1f","#a61d24","#d32029","#e84749","#f37370","#f89f9a","#fac8c3"];D.primary=D[5];var O=["#2b1611","#441d12","#592716","#7c3118","#aa3e19","#d84a1b","#e87040","#f3956a","#f8b692","#fad4bc"];O.primary=O[5];var N=["#2b1d11","#442a11","#593815","#7c4a15","#aa6215","#d87a16","#e89a3c","#f3b765","#f8cf8d","#fae3b7"];N.primary=N[5];var W=["#2b2111","#443111","#594214","#7c5914","#aa7714","#d89614","#e8b339","#f3cc62","#f8df8b","#faedb5"];W.primary=W[5];var z=["#2b2611","#443b11","#595014","#7c6e14","#aa9514","#d8bd14","#e8d639","#f3ea62","#f8f48b","#fafab5"];z.primary=z[5];var H=["#1f2611","#2e3c10","#3e4f13","#536d13","#6f9412","#8bbb11","#a9d134","#c9e75d","#e4f88b","#f0fab5"];H.primary=H[5];var B=["#162312","#1d3712","#274916","#306317","#3c8618","#49aa19","#6abe39","#8fd460","#b2e58b","#d5f2bb"];B.primary=B[5];var j=["#112123","#113536","#144848","#146262","#138585","#13a8a8","#33bcb7","#58d1c9","#84e2d8","#b2f1e8"];j.primary=j[5];var V=["#111a2c","#112545","#15325b","#15417e","#1554ad","#1668dc","#3c89e8","#65a9f3","#8dc5f8","#b7dcfa"];V.primary=V[5];var G=["#131629","#161d40","#1c2755","#203175","#263ea0","#2b4acb","#5273e0","#7f9ef3","#a8c1f8","#d2e0fa"];G.primary=G[5];var U=["#1a1325","#24163a","#301c4d","#3e2069","#51258f","#642ab5","#854eca","#ab7ae0","#cda8f0","#ebd7fa"];U.primary=U[5];var q=["#291321","#40162f","#551c3b","#75204f","#a02669","#cb2b83","#e0529c","#f37fb7","#f8a8cc","#fad2e3"];q.primary=q[5];var X=["#151515","#1f1f1f","#2d2d2d","#393939","#494949","#5a5a5a","#6a6a6a","#7b7b7b","#888888","#969696"];X.primary=X[5];const Y=(0,h.createContext)({});function K(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function J(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?K(Object(i),!0).forEach((function(e){o(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):K(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Q="data-rc-order",Z="data-rc-priority",$=new Map;function tt(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).mark;return t?t.startsWith("data-")?t:"data-".concat(t):"rc-util-key"}function et(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function it(t){return Array.from(($.get(t)||t).children).filter((function(t){return"STYLE"===t.tagName}))}function nt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("undefined"===typeof window||!window.document||!window.document.createElement)return null;var i=e.csp,n=e.prepend,s=e.priority,a=void 0===s?0:s,r=function(t){return"queue"===t?"prependQueue":t?"prepend":"append"}(n),o="prependQueue"===r,l=document.createElement("style");l.setAttribute(Q,r),o&&a&&l.setAttribute(Z,"".concat(a)),null!==i&&void 0!==i&&i.nonce&&(l.nonce=null===i||void 0===i?void 0:i.nonce),l.innerHTML=t;var h=et(e),c=h.firstChild;if(n){if(o){var d=(e.styles||it(h)).filter((function(t){if(!["prepend","prependQueue"].includes(t.getAttribute(Q)))return!1;var e=Number(t.getAttribute(Z)||0);return a>=e}));if(d.length)return h.insertBefore(l,d[d.length-1].nextSibling),l}h.insertBefore(l,c)}else h.appendChild(l);return l}function st(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=et(e);return(e.styles||it(i)).find((function(i){return i.getAttribute(tt(e))===t}))}function at(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=et(i),s=it(n),a=J(J({},i),{},{styles:s});!function(t,e){var i=$.get(t);if(!i||!function(t,e){if(!t)return!1;if(t.contains)return t.contains(e);for(var i=e;i;){if(i===t)return!0;i=i.parentNode}return!1}(document,i)){var n=nt("",e),s=n.parentNode;$.set(t,s),t.removeChild(n)}}(n,a);var r=st(e,a);if(r){var o,l,h;if(null!==(o=a.csp)&&void 0!==o&&o.nonce&&r.nonce!==(null===(l=a.csp)||void 0===l?void 0:l.nonce))r.nonce=null===(h=a.csp)||void 0===h?void 0:h.nonce;return r.innerHTML!==t&&(r.innerHTML=t),r}var c=nt(t,a);return c.setAttribute(tt(a),e),c}function rt(t){var e;return null===t||void 0===t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}function ot(t){return function(t){return rt(t)instanceof ShadowRoot}(t)?rt(t):null}var lt={},ht=[];function ct(t,e){}function dt(t,e){}function ut(t,e,i){e||lt[i]||(t(!1,i),lt[i]=!0)}function pt(t,e){ut(ct,t,e)}pt.preMessage=function(t){ht.push(t)},pt.resetWarned=function(){lt={}},pt.noteOnce=function(t,e){ut(dt,t,e)};const ft=pt;function gt(t){return"object"===a(t)&&"string"===typeof t.name&&"string"===typeof t.theme&&("object"===a(t.icon)||"function"===typeof t.icon)}function mt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(t).reduce((function(e,i){var n,s=t[i];if("class"===i)e.className=s,delete e.class;else delete e[i],e[(n=i,n.replace(/-(.)/g,(function(t,e){return e.toUpperCase()})))]=s;return e}),{})}function vt(t,e,i){return i?c().createElement(t.tag,J(J({key:e},mt(t.attrs)),i),(t.children||[]).map((function(i,n){return vt(i,"".concat(e,"-").concat(t.tag,"-").concat(n))}))):c().createElement(t.tag,J({key:e},mt(t.attrs)),(t.children||[]).map((function(i,n){return vt(i,"".concat(e,"-").concat(t.tag,"-").concat(n))})))}function bt(t){return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[],n=new v(t),s=n.toHsv(),a=5;a>0;a-=1){var r=new v({h:w(s,a,!0),s:y(s,a,!0),v:A(s,a,!0)});i.push(r)}i.push(n);for(var o=1;o<=4;o+=1){var l=new v({h:w(s,o),s:y(s,o),v:A(s,o)});i.push(l)}return"dark"===e.theme?b.map((function(t){var n=t.index,s=t.amount;return new v(e.backgroundColor||"#141414").mix(i[n],s).toHexString()})):i.map((function(t){return t.toHexString()}))}(t)[0]}function wt(t){return t?Array.isArray(t)?t:[t]:[]}var yt=["icon","className","onClick","style","primaryColor","secondaryColor"],At={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};var _t=function(t){var e,i,n=t.icon,s=t.className,a=t.onClick,r=t.style,o=t.primaryColor,c=t.secondaryColor,d=l(t,yt),u=h.useRef(),p=At;if(o&&(p={primaryColor:o,secondaryColor:c||bt(o)}),function(t){var e=(0,h.useContext)(Y),i=e.csp,n=e.prefixCls,s=e.layer,a="\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";n&&(a=a.replace(/anticon/g,n)),s&&(a="@layer ".concat(s," {\n").concat(a,"\n}")),(0,h.useEffect)((function(){var e=ot(t.current);at(a,"@ant-design-icons",{prepend:!s,csp:i,attachTo:e})}),[])}(u),e=gt(n),i="icon should be icon definiton, but got ".concat(n),ft(e,"[@ant-design/icons] ".concat(i)),!gt(n))return null;var f=n;return f&&"function"===typeof f.icon&&(f=J(J({},f),{},{icon:f.icon(p.primaryColor,p.secondaryColor)})),vt(f.icon,"svg-".concat(f.name),J(J({className:s,onClick:a,style:r,"data-icon":f.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},d),{},{ref:u}))};_t.displayName="IconReact",_t.getTwoToneColors=function(){return J({},At)},_t.setTwoToneColors=function(t){var e=t.primaryColor,i=t.secondaryColor;At.primaryColor=e,At.secondaryColor=i||bt(e),At.calculated=!!i};const xt=_t;function Et(t){var e=wt(t),i=(0,s.A)(e,2),n=i[0],a=i[1];return xt.setTwoToneColors({primaryColor:n,secondaryColor:a})}var kt=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Et(R.primary);var Mt=h.forwardRef((function(t,e){var i=t.className,a=t.icon,r=t.spin,c=t.rotate,d=t.tabIndex,p=t.onClick,f=t.twoToneColor,g=l(t,kt),m=h.useContext(Y),v=m.prefixCls,b=void 0===v?"anticon":v,w=m.rootClassName,y=u()(w,b,o(o({},"".concat(b,"-").concat(a.name),!!a.name),"".concat(b,"-spin"),!!r||"loading"===a.name),i),A=d;void 0===A&&p&&(A=-1);var _=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,x=wt(f),E=(0,s.A)(x,2),k=E[0],M=E[1];return h.createElement("span",(0,n.A)({role:"img","aria-label":a.name},g,{ref:e,tabIndex:A,onClick:p,className:y}),h.createElement(xt,{icon:a,primaryColor:k,secondaryColor:M,style:_}))}));Mt.displayName="AntdIcon",Mt.getTwoToneColor=function(){var t=xt.getTwoToneColors();return t.calculated?[t.primaryColor,t.secondaryColor]:t.primaryColor},Mt.setTwoToneColor=Et;const St=Mt},82284:(t,e,i)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}i.d(e,{A:()=>n})},85724:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});const n=(0,i(94922).createContext)(null)},88406:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var n=i(94922),s=i.n(n);function a(){return a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},a.apply(this,arguments)}var r={doc:t=>n.createElement("svg",a({t:1646123881490,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1408,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1409}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1410}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1411}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#2C97FF","p-id":1412}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 16 16h48a64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m0 192h-32V576h32a32 32 0 0 1 32 32v96a32 32 0 0 1-32 32z m160-192a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m32 160a32 32 0 0 1-32 32 32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32z m128 32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32h32a64 64 0 0 0-64-64 64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64h-32a32 32 0 0 1-32 32z",fill:"#FFFFFF","p-id":1413})),docx:t=>n.createElement("svg",a({t:1646123881490,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1408,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1409}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1410}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1411}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#2C97FF","p-id":1412}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 16 16h48a64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m0 192h-32V576h32a32 32 0 0 1 32 32v96a32 32 0 0 1-32 32z m160-192a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64v-96a64 64 0 0 0-64-64z m32 160a32 32 0 0 1-32 32 32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32z m128 32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32 32 32 0 0 1 32 32h32a64 64 0 0 0-64-64 64 64 0 0 0-64 64v96a64 64 0 0 0 64 64 64 64 0 0 0 64-64h-32a32 32 0 0 1-32 32z",fill:"#FFFFFF","p-id":1413})),full:t=>n.createElement("svg",a({width:"1em",height:"1em",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),n.createElement("title",null,"\u5145\u6ee1"),n.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},n.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-145.000000, -1567.000000)",fill:"#222222",fillRule:"nonzero"},n.createElement("g",{id:"\\u5145\\u6EE1",transform:"translate(145.000000, 1567.000000)"},n.createElement("path",{d:"M12.09375,0 C12.35,0 12.6,0.05 12.8359375,0.15 C13.0640625,0.2453125 13.2671875,0.3828125 13.4421875,0.5578125 C13.6171875,0.7328125 13.7546875,0.9375 13.85,1.1640625 C13.95,1.4 14,1.65 14,1.90625 L14,1.90625 L14,12.09375 C14,12.35 13.95,12.6 13.85,12.8359375 C13.7546875,13.0640625 13.6171875,13.2671875 13.4421875,13.4421875 C13.2671875,13.6171875 13.0625,13.7546875 12.8359375,13.85 C12.6,13.95 12.35,14 12.09375,14 L12.09375,14 L1.90625,14 C1.65,14 1.4,13.95 1.1640625,13.85 C0.9359375,13.7546875 0.7328125,13.6171875 0.5578125,13.4421875 C0.3828125,13.2671875 0.2453125,13.0625 0.15,12.8359375 C0.05,12.6 0,12.35 0,12.09375 L0,12.09375 L0,1.90625 C0,1.65 0.05,1.4 0.15,1.1640625 C0.2453125,0.9359375 0.3828125,0.7328125 0.5578125,0.5578125 C0.7328125,0.3828125 0.9375,0.2453125 1.1640625,0.15 C1.4,0.05 1.65,0 1.90625,0 L1.90625,0 Z M12.09375,1.125 L1.90625,1.125 C1.475,1.125 1.125,1.475 1.125,1.90625 L1.125,1.90625 L1.125,12.09375 C1.125,12.525 1.475,12.875 1.90625,12.875 L1.90625,12.875 L12.09375,12.875 C12.525,12.875 12.875,12.525 12.875,12.09375 L12.875,12.09375 L12.875,1.90625 C12.875,1.475 12.525,1.125 12.09375,1.125 L12.09375,1.125 Z M2.5734375,7.484375 C2.878125,7.490625 3.125,7.740625 3.125,8.046875 L3.125,8.046875 L3.125,10.0640625 L5.1265625,8.0625 C5.3453125,7.84375 5.703125,7.84375 5.921875,8.0625 C6.140625,8.28125 6.140625,8.6390625 5.921875,8.8578125 L5.921875,8.8578125 L3.903125,10.875 L5.909375,10.875 C6.2265625,10.875 6.4890625,11.13125 6.484375,11.4484375 C6.478125,11.7546875 6.228125,12 5.921875,12 L5.921875,12 L2.5734375,12 C2.25625,12 2,11.74375 2,11.4265625 L2,11.4265625 L2,8.0578125 C2,7.740625 2.2578125,7.478125 2.5734375,7.484375 Z M11.4296875,2 C11.7453125,2 12,2.25625 12,2.5703125 L12,2.5703125 L12,5.940625 C12,6.2578125 11.7421875,6.5203125 11.4265625,6.5140625 C11.121875,6.5078125 10.875,6.2578125 10.875,5.9515625 L10.875,5.9515625 L10.875,3.9359375 L8.8734375,5.9375 C8.6546875,6.15625 8.296875,6.15625 8.078125,5.9375 C7.859375,5.71875 7.859375,5.3609375 8.078125,5.1421875 L8.078125,5.1421875 L10.0953125,3.125 L8.0890625,3.125 C7.771875,3.125 7.509375,2.86875 7.515625,2.5515625 C7.521875,2.2453125 7.771875,2 8.078125,2 L8.078125,2 Z",id:"\\u5F62\\u72B6\\u7ED3\\u5408"}))))),gif:t=>n.createElement("svg",a({t:1646123917228,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1827,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1828}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1829}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1830}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#CC7598","p-id":1831}),n.createElement("path",{d:"M288 672h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32z m96 80a16 16 0 0 1-16 16 16 16 0 0 1-16-16V560a16 16 0 0 1 16-16 16 16 0 0 1 16 16z m176-208h-96a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h48a16 16 0 0 0 0-32h-48v-64h80a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":1832})),jpg:t=>n.createElement("svg",a({t:1646123877293,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1269,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1270}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1271}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1272}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":1273}),n.createElement("path",{d:"M320 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m256 32h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32zM208 544a16 16 0 0 0-16 16v144a32 32 0 0 1-64 0v-16a16 16 0 0 0-32 0v16a64 64 0 0 0 128 0V560a16 16 0 0 0-16-16z",fill:"#FFFFFF","p-id":1274})),mp4:t=>n.createElement("svg",a({t:1646123927989,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1966,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192c-35.328 0-64 28.672-64 64v320h576c35.328 0 64 28.672 64 64v415.744c0 35.328-28.672 64-64 64H128v31.744c0 35.328 28.672 64 64 64h768c35.328 0 64-28.672 64-64v-640L704 0z",fill:"#EAEAEA","p-id":1967}),n.createElement("path",{d:"M704 0v256c0 35.328 28.672 64 64 64h256L704 0z",fill:"#434854","p-id":1968}),n.createElement("path",{d:"M768 320l256 256V320z",opacity:.1,"p-id":1969}),n.createElement("path",{d:"M704 832c0 17.92-14.336 31.744-31.744 31.744H31.744C13.824 863.744 0 849.408 0 832V480.256c0-17.92 14.336-31.744 31.744-31.744h640c17.92 0 31.744 14.336 31.744 31.744V832z",fill:"#724AE2","p-id":1970}),n.createElement("path",{d:"M537.088 547.84c9.728 0 14.336 4.608 14.336 13.824v132.608h18.944c9.728 0.512 14.336 4.608 14.336 13.312s-5.12 13.312-15.36 13.312h-18.432v37.888c-0.512 9.728-5.12 14.336-13.824 14.336s-13.312-5.12-13.312-15.36v-36.864h-79.36c-12.8-0.512-19.456-4.096-19.456-11.776 0-4.096 1.536-7.68 4.096-11.776l94.208-141.312 0.512-1.024c3.584-4.608 8.192-7.168 13.312-7.168z m-302.592-1.536c7.168 0 11.264 5.12 11.264 15.872v193.536c0 10.752-4.608 15.872-11.264 15.872s-11.264-5.12-11.264-15.872V622.08l-44.544 140.8c-2.048 6.144-8.192 8.704-12.288 8.704s-10.24-3.072-12.288-8.704l-46.08-140.8v133.632c0 10.752-6.144 15.872-12.8 15.872s-12.8-5.12-12.8-15.872V562.176c0-10.752 5.632-15.872 12.8-15.872 4.608 0 10.752 3.072 12.8 8.704L166.4 728.064l56.832-173.056c2.048-6.144 6.144-8.704 11.264-8.704z m121.856 0c35.328 0 63.488 28.672 63.488 64 0 34.816-27.648 62.976-62.464 64h-33.28v79.872c0 8.704-7.168 15.872-15.872 15.872-8.192 0-15.36-6.656-15.872-14.848V562.176c0-8.192 6.656-15.36 14.848-15.872h49.152z m166.912 58.368l-59.904 90.112h59.904v-90.112z m-166.912-26.624h-31.744v64h31.744c17.92 0 31.744-14.848 31.744-32.256s-13.824-31.744-31.744-31.744z",fill:"#FFFFFF","p-id":1971})),pdf:t=>n.createElement("svg",a({t:1646123842588,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1304,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192c-35.328 0-64 28.672-64 64v320h576c35.328 0 64 28.672 64 64v415.744c0 35.328-28.672 64-64 64H128v31.744c0 35.328 28.672 64 64 64h768c35.328 0 64-28.672 64-64v-640L704 0z",fill:"#EAEAEA","p-id":1305}),n.createElement("path",{d:"M704 0v256c0 35.328 28.672 64 64 64h256L704 0z",fill:"#434854","p-id":1306}),n.createElement("path",{d:"M768 320l256 256V320z",opacity:.1,"p-id":1307}),n.createElement("path",{d:"M704 832c0 17.92-14.336 31.744-31.744 31.744H31.744C13.824 863.744 0 849.408 0 832V480.256c0-17.92 14.336-31.744 31.744-31.744h640c17.92 0 31.744 14.336 31.744 31.744V832z",fill:"#CD4050","p-id":1308}),n.createElement("path",{d:"M192 544.256h-48.128c-8.704 0-15.872 7.168-15.872 15.872v192c0 8.704 7.168 15.872 15.872 15.872s15.872-7.168 15.872-15.872v-79.872h31.744c35.328 0 64-28.672 64-64s-28.16-64-63.488-64z m158.72 0c34.816 0 62.976 27.648 64 62.464v97.792c0 34.816-27.648 62.976-62.464 64h-49.664c-8.704 0-15.36-6.656-15.872-14.848V560.64c0-8.704 6.656-15.36 14.848-15.872h49.152z m227.328 0c8.704 0 15.872 7.168 15.872 15.872S586.752 576 578.048 576h-80.384v64h48.128c8.704 0 15.872 7.168 15.872 15.872s-7.168 15.872-15.872 15.872h-48.128v79.872c0 8.704-7.168 15.872-15.872 15.872s-15.872-7.168-15.872-15.872v-192c0-8.704 7.168-15.872 15.872-15.872h96.256zM350.72 576h-31.744v159.744h31.744c17.408 0 31.232-13.824 31.744-30.72v-97.28C382.976 590.336 368.64 576 350.72 576zM192 576c17.92 0 31.744 14.336 31.744 31.744S209.92 640 192 640h-31.744v-64H192z",fill:"#FFFFFF","p-id":1309})),png:t=>n.createElement("svg",a({t:1646123868693,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1130,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1131}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1132}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1133}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":1134}),n.createElement("path",{d:"M160 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m448 32h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32zM400 544a16 16 0 0 0-16 16v137.6l-98.88-146.56a7.36 7.36 0 0 0-2.24-2.24l-2.56-1.6h-16l-2.56 2.24v5.12a13.76 13.76 0 0 0 0 3.52v192a16 16 0 0 0 32 0v-137.6l96 142.08a15.68 15.68 0 0 0 32-3.2v-192A16 16 0 0 0 400 544z",fill:"#FFFFFF","p-id":1135})),ppt:t=>n.createElement("svg",a({t:1646123861524,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":991,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":992}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":993}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":994}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#F05264","p-id":995}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m160-96h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m240-96H464a16 16 0 0 0 0 32h48v176a16 16 0 0 0 32 0V576h48a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":996})),pptx:t=>n.createElement("svg",a({t:1646123861524,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":991,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":992}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":993}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":994}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#F05264","p-id":995}),n.createElement("path",{d:"M192 544h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m160-96h-48a16 16 0 0 0-16 16v192a16 16 0 0 0 32 0v-80h32a64 64 0 0 0 0-128z m0 96h-32v-64h32a32 32 0 0 1 0 64z m240-96H464a16 16 0 0 0 0 32h48v176a16 16 0 0 0 32 0V576h48a16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":996})),rar:t=>n.createElement("svg",a({t:1646123940344,className:"icon",viewBox:"0 0 1056 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2245,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M1.248 0h1024v1024h-1024z",fillOpacity:0,"p-id":2246}),n.createElement("path",{d:"M849.248 1024h-672c-41.6 0-76.8-35.2-73.6-80V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v710.4c0 41.6-32 76.8-73.6 76.8z",fill:"#F5F1EC","p-id":2247}),n.createElement("path",{d:"M922.848 313.6h-819.2V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v76.8z",fill:"#E0B773","p-id":2248}),n.createElement("path",{d:"M244.448 252.8v-57.6h25.6l25.6 54.4h25.6l-32-54.4c19.2-6.4 25.6-19.2 25.6-35.2 0-12.8-3.2-22.4-12.8-28.8-6.4-6.4-16-9.6-25.6-9.6h-51.2v131.2h19.2z m32-73.6h-32v-38.4h32c6.4 0 9.6 0 16 3.2 3.2 3.2 3.2 6.4 3.2 16 0 6.4-3.2 9.6-6.4 12.8 0 3.2-6.4 6.4-12.8 6.4z m83.2 73.6l9.6-28.8h48l9.6 28.8h22.4l-48-131.2h-16l-48 131.2h22.4z m54.4-48h-38.4l19.2-57.6 19.2 57.6z m86.4 48v-57.6h25.6l25.6 54.4h22.4l-28.8-54.4c16-6.4 25.6-19.2 25.6-35.2 0-12.8-3.2-22.4-12.8-28.8-6.4-6.4-16-9.6-25.6-9.6h-51.2v131.2h19.2z m28.8-73.6h-28.8v-38.4h32c6.4 0 9.6 0 16 3.2 3.2 3.2 6.4 6.4 6.4 16 0 6.4-3.2 9.6-6.4 12.8-6.4 3.2-12.8 6.4-19.2 6.4z",fill:"#FFFFFF","p-id":2249}),n.createElement("path",{d:"M922.848 236.8h-150.4c-41.6 0-76.8-35.2-73.6-80V0l112 118.4 112 118.4z",fill:"#F5F1EC","p-id":2250}),n.createElement("path",{d:"M426.848 464v409.6h172.8V464h-172.8z m150.4 140.8h-64v41.6h64v44.8h-64v41.6h64v44.8h-64v44.8h-64v-44.8h64v-44.8h-64v-41.6h64v-44.8h-64v-41.6h64v-41.6h-64v-44.8h64v44.8h64v41.6z",fill:"#E0B773","p-id":2251})),rotate:t=>n.createElement("svg",a({width:"1em",height:"1em",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},t),n.createElement("title",null,"\u65cb\u8f6c"),n.createElement("g",{id:"PC\\u7AEF",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},n.createElement("g",{id:"\\u56FE\\u6807",transform:"translate(-77.000000, -1567.000000)",fill:"#222222",fillRule:"nonzero"},n.createElement("g",{id:"\\u65CB\\u8F6C",transform:"translate(77.000000, 1567.000000)"},n.createElement("path",{d:"M9.16414904,5.6345426 C9.35110931,5.6345426 9.53041217,5.70881228 9.66261304,5.84101315 C9.79481391,5.97321402 9.86908359,6.15251688 9.86908359,6.33947715 L9.86908359,12.683888 C9.86908359,13.0732126 9.55347364,13.3888226 9.16414904,13.3888226 L0.704934547,13.3888226 C0.315609953,13.3888226 1.8189894e-12,13.0732126 1.8189894e-12,12.683888 L1.8189894e-12,6.33947715 C1.8189894e-12,6.15251688 0.0742696765,5.97321402 0.206470548,5.84101315 C0.33867142,5.70881228 0.517974281,5.6345426 0.704934547,5.6345426 L9.16414904,5.6345426 Z M8.4592145,7.04441168 L1.40986909,7.04441168 L1.40986909,11.9789535 L8.4592145,11.9789535 L8.4592145,7.04441168 Z M7.58258803,0.714885198 C7.63035214,0.738767256 7.66052367,0.787585825 7.66052367,0.840987728 L7.66052367,2.02739256 C11.1625178,2.03011634 14,4.86980822 14,8.37180343 C14,8.62367799 13.8656872,8.85643618 13.6475639,8.98238459 C13.4294405,9.108333 13.1606904,9.108333 12.942567,8.98238459 C12.7244437,8.85643618 12.5900924,8.62367799 12.5901309,8.37180343 C12.5901323,5.64845715 10.3838686,3.43998499 7.66052367,3.43726164 L7.66052367,4.50664733 C7.66052367,4.56004923 7.63035214,4.6088678 7.58258803,4.63274986 C7.53482391,4.65663192 7.47766614,4.65147801 7.43494462,4.61943686 L4.99093655,2.78660706 C4.95543522,2.75998107 4.93454178,2.71819419 4.93454178,2.67381753 C4.93454178,2.62944087 4.95543522,2.58765399 4.99093655,2.561028 L7.43494462,0.728198195 C7.47766614,0.696157053 7.53482391,0.691003139 7.58258803,0.714885198 Z",id:"\\u5F62\\u72B6\\u7ED3\\u5408"}))))),svg:t=>n.createElement("svg",a({t:1646123950101,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2385,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":2386}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":2387}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":2388}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#BAF1CD","p-id":2389}),n.createElement("path",{d:"M160 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m246.08-96a16 16 0 0 0-20.8 8.96l-64 155.84-64-155.84a16 16 0 1 0-29.44 11.84l77.76 192a24.96 24.96 0 0 0 3.2 4.8 12.8 12.8 0 0 0 4.8 3.2 12.8 12.8 0 0 0 4.8 0h5.76l3.2-2.24a13.12 13.12 0 0 0 5.44-6.4l77.76-192a15.68 15.68 0 0 0-4.48-20.16zM576 672h-80a16 16 0 0 0 0 32h48a32 32 0 0 1-32 32h-32a32 32 0 0 1-32-32v-96a32 32 0 0 1 32-32h32a32 32 0 0 1 32 32 16 16 0 0 0 32 0 64 64 0 0 0-64-64h-32a64 64 0 0 0-64 64v96a64 64 0 0 0 64 64h32a64 64 0 0 0 64-64 16 16 0 0 0 0-32z",fill:"#FFFFFF","p-id":2390})),unknow:t=>n.createElement("svg",a({t:1646123889587,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1551,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M914.92 287.344L697.718 81.474v128.338c0 43.554 34.968 79.189 77.706 79.189h141.99l-2.494-1.657z",fill:"#027AFF","p-id":1552}),n.createElement("path",{d:"M768.284 316.733c-54.48 0-99.056-48.997-99.056-108.882V66.223h-373.35c-30.593 0-55.624 27-55.624 60v348.869h490.802c37.476 0 68.137 33.073 68.137 73.496v207.894c0 40.424-30.661 73.497-68.137 73.497H240.254v70.128c0 33 25.031 60 55.625 60h563.637c30.594 0 55.625-27 55.625-60V316.733H768.284z",fill:"#027AFF","p-id":1553}),n.createElement("path",{d:"M699.302 519.057H156.028c-31.109 0-56.561 25.381-56.561 56.403v153.038c0 31.021 25.452 56.402 56.561 56.402h543.274c31.11 0 56.562-25.38 56.562-56.402V575.46c0-31.022-25.453-56.403-56.562-56.403z m-444.857 211.51c-4.902 4.135-10.558 6.203-16.874 6.203-6.41 0-12.066-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.451-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.545 11.28-7.636 15.417z m29.884-89.775c-2.263 2.068-9.993 6.957-23.379 14.571-3.865 2.256-6.222 4.136-7.07 5.64-0.566 0.846-0.849 2.82-0.849 6.016 0 4.7-1.508 8.367-4.619 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.84-3.29-3.489-2.632-5.186-6.392-5.186-11.28v-10.247c0-7.896 3.583-14.477 10.841-19.553 6.976-3.572 13.764-7.238 20.457-10.81 7.259-3.854 10.84-8.367 10.84-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.57 5.64-2.357 2.068-5.94 6.486-10.653 13.348-4.148 6.017-9.05 8.93-14.612 8.93-4.336 0-7.918-1.503-10.84-4.605-2.923-2.82-4.431-6.487-4.431-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.91-18.143 16.874 0 30.637 4.418 41.384 13.349 10.18 8.46 15.271 18.989 15.271 31.68 0 12.69-3.488 22.372-10.652 29.14zM442.7 730.566c-4.902 4.136-10.558 6.204-16.874 6.204-6.41 0-12.066-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.45-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.64 11.28-7.636 15.417z m29.884-89.774c-2.263 2.068-9.993 6.957-23.38 14.571-3.864 2.256-6.221 4.136-7.07 5.64-0.565 0.846-0.848 2.82-0.848 6.016 0 4.7-1.508 8.367-4.619 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.84-3.29-3.489-2.632-5.186-6.392-5.186-11.28v-10.247c0-7.896 3.583-14.477 10.841-19.553 6.976-3.572 13.764-7.238 20.457-10.81 7.258-3.854 10.84-8.367 10.84-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.57 5.64-2.358 2.068-5.94 6.486-10.653 13.348-4.148 6.017-9.05 8.93-14.612 8.93-4.336 0-7.919-1.503-10.841-4.605-2.922-2.82-4.43-6.487-4.43-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.91-18.143 16.873 0 30.637 4.418 41.383 13.349 10.181 8.46 15.272 18.989 15.272 31.68 0 12.69-3.582 22.372-10.652 29.14z m158.372 89.774c-4.902 4.136-10.558 6.204-16.874 6.204-6.41 0-12.067-2.068-16.874-6.204-4.902-4.042-7.353-9.118-7.353-15.417 0-6.204 2.45-11.468 7.353-15.604 4.902-4.042 10.558-6.016 16.874-6.016 6.41 0 12.16 1.974 17.157 6.016 4.902 4.136 7.353 9.4 7.353 15.604-0.094 6.11-2.64 11.28-7.636 15.417z m29.883-89.774c-2.262 2.068-9.992 6.957-23.378 14.571-3.865 2.256-6.222 4.136-7.07 5.64-0.566 0.846-0.85 2.82-0.85 6.016 0 4.7-1.507 8.367-4.618 10.81-2.828 2.539-6.222 3.761-10.464 3.761-4.43 0-8.107-1.128-10.841-3.29-3.488-2.632-5.185-6.392-5.185-11.28v-10.247c0-7.896 3.582-14.477 10.841-19.553 6.976-3.572 13.763-7.238 20.456-10.81 7.26-3.854 10.841-8.367 10.841-13.349 0-10.998-8.578-16.45-25.735-16.45-7.824 0-13.952 1.88-18.571 5.64-2.357 2.068-5.94 6.486-10.653 13.348-4.147 6.017-9.05 8.93-14.611 8.93-4.337 0-7.919-1.503-10.841-4.605-2.923-2.82-4.43-6.487-4.43-10.999 0-7.238 4.43-15.229 13.197-24.159 11.69-12.126 27.055-18.143 45.909-18.143 16.874 0 30.637 4.418 41.384 13.349 10.181 8.46 15.272 18.989 15.272 31.68 0 12.69-3.582 22.372-10.653 29.14z",fill:"#027AFF","p-id":1554})),xls:t=>n.createElement("svg",a({t:1646123896342,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1688,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1689}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1690}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1691}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#009688","p-id":1692}),n.createElement("path",{d:"M512 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m-112 96h-80V560a16 16 0 0 0-32 0v192a16 16 0 0 0 16 16h96a16 16 0 0 0 0-32z m-146.88 8.32l-57.6-91.84 52.8-84.16a15.36 15.36 0 0 0-6.08-21.76 18.56 18.56 0 0 0-23.68 5.76l-42.88 68.8-42.88-68.8a18.56 18.56 0 0 0-23.68-5.76 15.36 15.36 0 0 0-6.4 21.76l53.12 84.16-57.6 91.84a15.36 15.36 0 0 0 6.4 21.76A17.92 17.92 0 0 0 128 760l47.68-75.84L224 760a18.56 18.56 0 0 0 23.68 6.08 15.36 15.36 0 0 0 5.44-21.76z",fill:"#FFFFFF","p-id":1693})),xlsx:t=>n.createElement("svg",a({t:1646123896342,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":1688,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M704 0H192a64 64 0 0 0-64 64v320h576a64 64 0 0 1 64 64v416a64 64 0 0 1-64 64H128v32a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V320z",fill:"#EAEAEA","p-id":1689}),n.createElement("path",{d:"M704 0v256a64 64 0 0 0 64 64h256z",fill:"#434854","p-id":1690}),n.createElement("path",{d:"M768 320l256 256V320H768z",opacity:.1,"p-id":1691}),n.createElement("path",{d:"M704 832a32 32 0 0 1-32 32H32a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32z",fill:"#009688","p-id":1692}),n.createElement("path",{d:"M512 640a32 32 0 0 1 0-64h48a16 16 0 0 0 0-32h-48a64 64 0 0 0 0 128 32 32 0 0 1 0 64h-48a16 16 0 0 0 0 32h48a64 64 0 0 0 0-128z m-112 96h-80V560a16 16 0 0 0-32 0v192a16 16 0 0 0 16 16h96a16 16 0 0 0 0-32z m-146.88 8.32l-57.6-91.84 52.8-84.16a15.36 15.36 0 0 0-6.08-21.76 18.56 18.56 0 0 0-23.68 5.76l-42.88 68.8-42.88-68.8a18.56 18.56 0 0 0-23.68-5.76 15.36 15.36 0 0 0-6.4 21.76l53.12 84.16-57.6 91.84a15.36 15.36 0 0 0 6.4 21.76A17.92 17.92 0 0 0 128 760l47.68-75.84L224 760a18.56 18.56 0 0 0 23.68 6.08 15.36 15.36 0 0 0 5.44-21.76z",fill:"#FFFFFF","p-id":1693})),zip:t=>n.createElement("svg",a({t:1646123936994,className:"icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg","p-id":2105,xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em"},t),n.createElement("defs",null,n.createElement("style",{type:"text/css"})),n.createElement("path",{d:"M0 0h1024v1024H0z",fillOpacity:0,"p-id":2106}),n.createElement("path",{d:"M848 1024H176c-41.6 0-76.8-35.2-73.6-80V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v710.4c0 41.6-32 76.8-73.6 76.8z",fill:"#F5ECEC","p-id":2107}),n.createElement("path",{d:"M921.6 313.6H102.4V80c0-41.6 32-76.8 73.6-80h521.6l224 236.8v76.8z",fill:"#BC8585","p-id":2108}),n.createElement("path",{d:"M300.8 252.8v-19.2H240l57.6-96v-16h-80v16h57.6l-57.6 96v16h83.2z m70.4 0V121.6H352v131.2h19.2z m80 0v-51.2H480c12.8 0 22.4-3.2 32-12.8 6.4-6.4 9.6-16 9.6-25.6 0-6.4 0-12.8-3.2-19.2-3.2-6.4-6.4-9.6-9.6-12.8-6.4-3.2-9.6-6.4-16-6.4h-64V256h22.4z m28.8-70.4h-28.8v-41.6H480c6.4 0 9.6 0 12.8 3.2 3.2 0 3.2 3.2 6.4 6.4 0 3.2 3.2 6.4 3.2 9.6 0 6.4-3.2 9.6-6.4 12.8-3.2 6.4-9.6 9.6-16 9.6z",fill:"#FFFFFF","p-id":2109}),n.createElement("path",{d:"M921.6 236.8H771.2c-41.6 0-76.8-35.2-73.6-80V0l112 118.4 112 118.4z",fill:"#F5ECEC","p-id":2110}),n.createElement("path",{d:"M425.6 464v409.6h172.8V464H425.6zM576 604.8h-64v41.6h64v44.8h-64v41.6h64v44.8h-64v44.8h-64v-44.8h64v-44.8h-64v-41.6h64v-44.8h-64v-41.6h64v-41.6h-64v-44.8h64v44.8h64v41.6z",fill:"#BC8585","p-id":2111}))};const o=t=>{const{size:e,type:i}=Object.assign({},{size:40,type:"unknow"},t),n=r[i]||r.unknow;return s().createElement(n,{width:e,height:e})}},89261:(t,e,i)=>{"use strict";t.exports=i(74935)},89379:(t,e,i)=>{"use strict";i.d(e,{A:()=>a});var n=i(64467);function s(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function a(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach((function(e){(0,n.A)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}},93375:(t,e,i)=>{var n=i(36382);t.exports=function(){return n.Date.now()}},95600:(t,e,i)=>{var n=i(2316),s=i(93375),a=i(2899),r=Math.max,o=Math.min;t.exports=function(t,e,i){var l,h,c,d,u,p,f=0,g=!1,m=!1,v=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function b(e){var i=l,n=h;return l=h=void 0,f=e,d=t.apply(n,i)}function w(t){var i=t-p;return void 0===p||i>=e||i<0||m&&t-f>=c}function y(){var t=s();if(w(t))return A(t);u=setTimeout(y,function(t){var i=e-(t-p);return m?o(i,c-(t-f)):i}(t))}function A(t){return u=void 0,v&&l?b(t):(l=h=void 0,d)}function _(){var t=s(),i=w(t);if(l=arguments,h=this,p=t,i){if(void 0===u)return function(t){return f=t,u=setTimeout(y,e),g?b(t):d}(p);if(m)return clearTimeout(u),u=setTimeout(y,e),b(p)}return void 0===u&&(u=setTimeout(y,e)),d}return e=a(e)||0,n(i)&&(g=!!i.leading,c=(m="maxWait"in i)?r(a(i.maxWait)||0,e):c,v="trailing"in i?!!i.trailing:v),_.cancel=function(){void 0!==u&&clearTimeout(u),f=0,l=p=h=u=void 0},_.flush=function(){return void 0===u?d:A(s())},_}},98677:t=>{"use strict";var e=function(){};t.exports=e},98771:(t,e,i)=>{var n=i(95600),s=i(2316);t.exports=function(t,e,i){var a=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return s(i)&&(a="leading"in i?!!i.leading:a,r="trailing"in i?!!i.trailing:r),n(t,e,{leading:a,maxWait:e,trailing:r})}}}]);
3
+ //# sourceMappingURL=689.2eced7a1.chunk.js.map