From 7262693cdfc644a00ea1e096558ea88a4a9e9cc1 Mon Sep 17 00:00:00 2001 From: Watson Github Bot Date: Wed, 14 Feb 2024 16:52:18 +0000 Subject: [PATCH] chore: publish v5.0.2 [ci skip] --- CHANGELOG.md | 11 +++++++++++ ...TB9_z-m.js => CIDocument.stories-MuJ7xMMX.js} | 2 +- ...EI-N7NQjCtp.js => Color-6VNJS4EI-lBZZYQGi.js} | 2 +- ...bl.js => DiscoverySearch.stories-Tf5oSbDY.js} | 2 +- ...w0jG.js => DocsRenderer-NNNQARDV-k-JbY6La.js} | 2 +- ...Nj.js => DocumentPreview.stories-wDP-X5Lu.js} | 6 +++--- ...lKyATr.js => SearchInput.stories-8iSDtAS4.js} | 2 +- ...lts-M91Z8TUW.js => SearchResults-huRufqlh.js} | 16 ++++++++-------- ...h_tX.js => SearchResults.stories-9mgA_WJq.js} | 2 +- ...6pm_C.js => WithTooltip-V3YHNWJZ-5A2-LERo.js} | 2 +- ...SW_q4fo.js => formatter-SWP5E3XI-Nl3Uqdo1.js} | 2 +- .../assets/getDocumentTitle-51WyFHkN.js | 1 + .../assets/getDocumentTitle-Zh1PemE-.js | 1 - .../{iframe-_98K0_ok.js => iframe-mUD1hmuH.js} | 4 ++-- docs/storybook/assets/index-BxZ9LZUr.js | 8 ++++++++ docs/storybook/assets/index-Pr70vtH1.js | 8 -------- .../{index-yCoF09M4.js => index-lt-u4Ncf.js} | 10 +++++----- .../{preview-tdpRB_fr.js => preview-9rW2m5lX.js} | 4 ++-- .../{preview-PfHsUsqb.js => preview-rR4HDz8p.js} | 2 +- ...js => syntaxhighlighter-V7JZZA35-WSwIxwL6.js} | 2 +- ...LzdLkl6I.js => withErrorBoundary-Y3jy2SmJ.js} | 2 +- docs/storybook/iframe.html | 2 +- docs/storybook/project.json | 2 +- lerna.json | 2 +- packages/discovery-react-components/CHANGELOG.md | 11 +++++++++++ packages/discovery-react-components/package.json | 2 +- 26 files changed, 66 insertions(+), 44 deletions(-) rename docs/storybook/assets/{CIDocument.stories--TB9_z-m.js => CIDocument.stories-MuJ7xMMX.js} (99%) rename docs/storybook/assets/{Color-6VNJS4EI-N7NQjCtp.js => Color-6VNJS4EI-lBZZYQGi.js} (99%) rename docs/storybook/assets/{DiscoverySearch.stories-SfYZWCbl.js => DiscoverySearch.stories-Tf5oSbDY.js} (99%) rename docs/storybook/assets/{DocsRenderer-NNNQARDV-hJLew0jG.js => DocsRenderer-NNNQARDV-k-JbY6La.js} (92%) rename docs/storybook/assets/{DocumentPreview.stories-PobyqiNj.js => DocumentPreview.stories-wDP-X5Lu.js} (94%) rename docs/storybook/assets/{SearchInput.stories-9alKyATr.js => SearchInput.stories-8iSDtAS4.js} (98%) rename docs/storybook/assets/{SearchResults-M91Z8TUW.js => SearchResults-huRufqlh.js} (90%) rename docs/storybook/assets/{SearchResults.stories-vMiFh_tX.js => SearchResults.stories-9mgA_WJq.js} (97%) rename docs/storybook/assets/{WithTooltip-V3YHNWJZ--j86pm_C.js => WithTooltip-V3YHNWJZ-5A2-LERo.js} (77%) rename docs/storybook/assets/{formatter-SWP5E3XI--SW_q4fo.js => formatter-SWP5E3XI-Nl3Uqdo1.js} (99%) create mode 100644 docs/storybook/assets/getDocumentTitle-51WyFHkN.js delete mode 100644 docs/storybook/assets/getDocumentTitle-Zh1PemE-.js rename docs/storybook/assets/{iframe-_98K0_ok.js => iframe-mUD1hmuH.js} (80%) create mode 100644 docs/storybook/assets/index-BxZ9LZUr.js delete mode 100644 docs/storybook/assets/index-Pr70vtH1.js rename docs/storybook/assets/{index-yCoF09M4.js => index-lt-u4Ncf.js} (99%) rename docs/storybook/assets/{preview-tdpRB_fr.js => preview-9rW2m5lX.js} (64%) rename docs/storybook/assets/{preview-PfHsUsqb.js => preview-rR4HDz8p.js} (77%) rename docs/storybook/assets/{syntaxhighlighter-V7JZZA35-R57c9JcY.js => syntaxhighlighter-V7JZZA35-WSwIxwL6.js} (78%) rename docs/storybook/assets/{withErrorBoundary-LzdLkl6I.js => withErrorBoundary-Y3jy2SmJ.js} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7089440d6..d06762ae7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.0.2](https://github.com/watson-developer-cloud/discovery-components/compare/v5.0.1...v5.0.2) (2024-02-14) + + +### Bug Fixes + +* fixed error in search results due to document title ([#550](https://github.com/watson-developer-cloud/discovery-components/issues/550)) ([220798d](https://github.com/watson-developer-cloud/discovery-components/commit/220798d8d51ea380b16dab4c8330c6e93ea7de65)) + + + + + ## [5.0.1](https://github.com/watson-developer-cloud/discovery-components/compare/v5.0.0...v5.0.1) (2024-01-26) **Note:** Version bump only for package root diff --git a/docs/storybook/assets/CIDocument.stories--TB9_z-m.js b/docs/storybook/assets/CIDocument.stories-MuJ7xMMX.js similarity index 99% rename from docs/storybook/assets/CIDocument.stories--TB9_z-m.js rename to docs/storybook/assets/CIDocument.stories-MuJ7xMMX.js index 94fed7b1f..bdb4aea25 100644 --- a/docs/storybook/assets/CIDocument.stories--TB9_z-m.js +++ b/docs/storybook/assets/CIDocument.stories-MuJ7xMMX.js @@ -1,4 +1,4 @@ -import{j as g}from"./jsx-runtime-FsUICBgo.js";import{_ as Rr,a as Mr,b as kr,h as Cr,i as ui,d as to}from"./index-777x7qAF.js";import{r as f,R as E,g as oe}from"./index-RfLt4OUa.js";import{P as A,p as X}from"./index-4QtD-hFu.js";import{d as gi,c as Ee,s as re,m as bt,A as dt,o as ht,i as ut,f as Ar,S as jr,H as mi,p as yi,q as ao,P as Er,B as Xa}from"./Button-KibTbxDG.js";import{d as Or,_ as Dr}from"./_baseSlice-BktYtjHb.js";import{s as Fr}from"./wrapFocus-29tK3Ecs.js";import{d as no}from"./bucket-5-3bTeVNTN.js";import{r as Wr,h as Ur,t as Ir,j as Lr,a3 as On,g as ge}from"./callBound-4MCeDK1M.js";import{l as z,m as qr,k as De,T as Gr,h as io,j as zr,c as Qr,f as Xr,a as Vr,w as Hr,n as ba,o as Yr,q as Va,r as so,t as Zr,u as Jr,v as Kr,p as $r}from"./withErrorBoundary-LzdLkl6I.js";import{b as el,c as tl}from"./_baseUniq-2t0Y7xw1.js";import{c as _e}from"./index-tUYgphcS.js";import{L as Et}from"./Link-_yif9kZE.js";import{C as al,a as nl}from"./RadioButton-oUVXPi4-.js";import{S as oo}from"./getDocumentTitle-Zh1PemE-.js";import{r as Je}from"./index-miLrID2P.js";import{i as il}from"./ResizeObserver.es-lk2mK0C6.js";import{g as Xe}from"./pickBy-llkn_6s3.js";import{u as sl}from"./uniq-hAFl8ubt.js";import"./isPlainObject-g73re4jY.js";import"./index-xck8ovCi.js";import"./preview-errors-Ix78kkVy.js";import"./debounce-eWC8LGMf.js";import"./mergeRefs-uj14wjf3.js";import"./events-fK0UhkIE.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./uniqueId-3N0rOl1M.js";var ol=typeof window<"u"?f.useLayoutEffect:f.useEffect;function Rt(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rt=function(n){return typeof n}:Rt=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Rt(e)}var rl=["id","className","handleTabClick","handleTabKeyDown","disabled","href","index","label","selected","tabIndex","onClick","onKeyDown","renderAnchor","renderButton","renderContent"];function Ot(){return Ot=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function cl(e,t){if(e==null)return{};var n={},a=Object.keys(e),i,s;for(s=0;s=0)&&(n[i]=e[i]);return n}function pl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xi(e,t){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Dt(e){return Dt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Dt(e)}function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var je=re.prefix,He=function(e){dl(n,e);var t=hl(n);function n(){return pl(this,n),t.apply(this,arguments)}return bl(n,[{key:"render",value:function(){var i,s=this,o,r=this.props,l=r.id,c=r.className,b=r.handleTabClick,p=r.handleTabKeyDown,d=r.disabled,h=r.href,m=h===void 0?"#":h,y=r.index,_=r.label,x=r.selected,w=r.tabIndex,T=w===void 0?0:w,B=r.onClick,N=r.onKeyDown,v=r.renderAnchor,S=r.renderButton;r.renderContent;var u=ll(r,rl),P=Ee(c,"".concat(je,"--tabs--scrollable__nav-item"),(i={},V(i,"".concat(je,"--tabs__nav-item--disabled"),d),V(i,"".concat(je,"--tabs__nav-item--selected"),x),V(i,"".concat(je,"--tabs--scrollable__nav-item--disabled"),d),V(i,"".concat(je,"--tabs--scrollable__nav-item--selected"),x),i)),R=(o={},V(o,"aria-selected",x),V(o,"aria-disabled",d),V(o,"aria-controls",l&&"".concat(l,"__panel")),V(o,"id",l),V(o,"className","".concat(je,"--tabs--scrollable__nav-link")),V(o,"href",m),V(o,"tabIndex",d?-1:T),V(o,"ref",function(C){s.tabAnchor=C}),o),M=S||v;return E.createElement("li",Ot({},u,{className:P,onClick:function(C){d||(b&&b(y,C),B(C))},onKeyDown:function(C){d||(p&&p(y,C),N(C))},role:"presentation"}),M?M(R):E.createElement("button",Ot({type:"button",role:"tab"},R),_))}}]),n}(E.Component);V(He,"propTypes",{className:A.string,disabled:A.bool,handleTabClick:A.func,handleTabKeyDown:A.func,href:gi(A.string),id:A.string,index:A.number,label:A.node,onClick:A.func.isRequired,onKeyDown:A.func.isRequired,renderAnchor:gi(A.func),renderButton:A.func,renderContent:A.func,role:A.string.isRequired,selected:A.bool.isRequired,tabIndex:A.number});V(He,"defaultProps",{role:"presentation",label:"provide a label",selected:!1,onClick:function(){},onKeyDown:function(){}});var yl=["className","selected","children"];function Ya(){return Ya=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function fl(e,t){if(e==null)return{};var n={},a=Object.keys(e),i,s;for(s=0;s=0)&&(n[i]=e[i]);return n}function wl(e,t){return Pl(e)||Sl(e,t)||vl(e,t)||Tl()}function Tl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +import{j as g}from"./jsx-runtime-FsUICBgo.js";import{_ as Rr,a as Mr,b as kr,h as Cr,i as ui,d as to}from"./index-777x7qAF.js";import{r as f,R as E,g as oe}from"./index-RfLt4OUa.js";import{P as A,p as X}from"./index-4QtD-hFu.js";import{d as gi,c as Ee,s as re,m as bt,A as dt,o as ht,i as ut,f as Ar,S as jr,H as mi,p as yi,q as ao,P as Er,B as Xa}from"./Button-KibTbxDG.js";import{d as Or,_ as Dr}from"./_baseSlice-BktYtjHb.js";import{s as Fr}from"./wrapFocus-29tK3Ecs.js";import{d as no}from"./bucket-5-3bTeVNTN.js";import{r as Wr,h as Ur,t as Ir,j as Lr,a3 as On,g as ge}from"./callBound-4MCeDK1M.js";import{l as z,m as qr,k as De,T as Gr,h as io,j as zr,c as Qr,f as Xr,a as Vr,w as Hr,n as ba,o as Yr,q as Va,r as so,t as Zr,u as Jr,v as Kr,p as $r}from"./withErrorBoundary-Y3jy2SmJ.js";import{b as el,c as tl}from"./_baseUniq-2t0Y7xw1.js";import{c as _e}from"./index-tUYgphcS.js";import{L as Et}from"./Link-_yif9kZE.js";import{C as al,a as nl}from"./RadioButton-oUVXPi4-.js";import{S as oo}from"./getDocumentTitle-51WyFHkN.js";import{r as Je}from"./index-miLrID2P.js";import{i as il}from"./ResizeObserver.es-lk2mK0C6.js";import{g as Xe}from"./pickBy-llkn_6s3.js";import{u as sl}from"./uniq-hAFl8ubt.js";import"./isPlainObject-g73re4jY.js";import"./index-xck8ovCi.js";import"./preview-errors-Ix78kkVy.js";import"./debounce-eWC8LGMf.js";import"./mergeRefs-uj14wjf3.js";import"./events-fK0UhkIE.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./uniqueId-3N0rOl1M.js";var ol=typeof window<"u"?f.useLayoutEffect:f.useEffect;function Rt(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Rt=function(n){return typeof n}:Rt=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Rt(e)}var rl=["id","className","handleTabClick","handleTabKeyDown","disabled","href","index","label","selected","tabIndex","onClick","onKeyDown","renderAnchor","renderButton","renderContent"];function Ot(){return Ot=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function cl(e,t){if(e==null)return{};var n={},a=Object.keys(e),i,s;for(s=0;s=0)&&(n[i]=e[i]);return n}function pl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xi(e,t){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Dt(e){return Dt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Dt(e)}function V(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var je=re.prefix,He=function(e){dl(n,e);var t=hl(n);function n(){return pl(this,n),t.apply(this,arguments)}return bl(n,[{key:"render",value:function(){var i,s=this,o,r=this.props,l=r.id,c=r.className,b=r.handleTabClick,p=r.handleTabKeyDown,d=r.disabled,h=r.href,m=h===void 0?"#":h,y=r.index,_=r.label,x=r.selected,w=r.tabIndex,T=w===void 0?0:w,B=r.onClick,N=r.onKeyDown,v=r.renderAnchor,S=r.renderButton;r.renderContent;var u=ll(r,rl),P=Ee(c,"".concat(je,"--tabs--scrollable__nav-item"),(i={},V(i,"".concat(je,"--tabs__nav-item--disabled"),d),V(i,"".concat(je,"--tabs__nav-item--selected"),x),V(i,"".concat(je,"--tabs--scrollable__nav-item--disabled"),d),V(i,"".concat(je,"--tabs--scrollable__nav-item--selected"),x),i)),R=(o={},V(o,"aria-selected",x),V(o,"aria-disabled",d),V(o,"aria-controls",l&&"".concat(l,"__panel")),V(o,"id",l),V(o,"className","".concat(je,"--tabs--scrollable__nav-link")),V(o,"href",m),V(o,"tabIndex",d?-1:T),V(o,"ref",function(C){s.tabAnchor=C}),o),M=S||v;return E.createElement("li",Ot({},u,{className:P,onClick:function(C){d||(b&&b(y,C),B(C))},onKeyDown:function(C){d||(p&&p(y,C),N(C))},role:"presentation"}),M?M(R):E.createElement("button",Ot({type:"button",role:"tab"},R),_))}}]),n}(E.Component);V(He,"propTypes",{className:A.string,disabled:A.bool,handleTabClick:A.func,handleTabKeyDown:A.func,href:gi(A.string),id:A.string,index:A.number,label:A.node,onClick:A.func.isRequired,onKeyDown:A.func.isRequired,renderAnchor:gi(A.func),renderButton:A.func,renderContent:A.func,role:A.string.isRequired,selected:A.bool.isRequired,tabIndex:A.number});V(He,"defaultProps",{role:"presentation",label:"provide a label",selected:!1,onClick:function(){},onKeyDown:function(){}});var yl=["className","selected","children"];function Ya(){return Ya=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function fl(e,t){if(e==null)return{};var n={},a=Object.keys(e),i,s;for(s=0;s=0)&&(n[i]=e[i]);return n}function wl(e,t){return Pl(e)||Sl(e,t)||vl(e,t)||Tl()}function Tl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vl(e,t){if(e){if(typeof e=="string")return _i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _i(e,t)}}function _i(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}function Cl(e,t){if(e==null)return{};var n={},a=Object.keys(e),i,s;for(s=0;s=0)&&(n[i]=e[i]);return n}function Al(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fi(e,t){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ft(e){return Ft=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Ft(e)}function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ke=function(e){El(n,e);var t=Ol(n);function n(){var a;Al(this,n);for(var i=arguments.length,s=new Array(i),o=0;oc,tablistScrollWidth:p,tablistScrollLeft:b})}}),j(D(a),"_debouncedHandleWindowResize",null),j(D(a),"_handleWindowResize",a.handleScroll),j(D(a),"getEnabledTabs",function(){return E.Children.toArray(a.props.children).reduce(function(r,l,c){return l.props.disabled?r:r.concat(c)},[])}),j(D(a),"getNextIndex",function(r,l){var c=a.getEnabledTabs(),b=Math.max(c.indexOf(r)+l,-1),p=b>=0&&bh&&(a.tablist.current.scrollLeft+=a.OVERFLOW_BUTTON_OFFSET)}}),j(D(a),"selectTabAt",function(r,l){var c=l.index,b=l.onSelectionChange;a.scrollTabIntoView(r,{index:c}),a.state.selected!==c&&(a.setState({selected:c}),typeof b=="function"&&b(c))}),j(D(a),"handleTabKeyDown",function(r){return function(l,c){ut(c,[Ar,jr])&&a.selectTabAt(c,{index:l,onSelectionChange:r});var b=function(){if(ut(c,[dt,ht]))return a.getNextIndex(l,a.getDirection(c));if(bt(c,mi))return 0;if(bt(c,yi))return a.getEnabledTabs().pop()}(),p=a.getTabAt(b);if(ut(c,[dt,ht,mi,yi])){var d;c.preventDefault(),a.props.selectionMode!=="manual"?a.selectTabAt(c,{index:b,onSelectionChange:r}):a.scrollTabIntoView(c,{index:b}),p==null||(d=p.tabAnchor)===null||d===void 0||d.focus()}}}),j(D(a),"getTabs",function(){return E.Children.map(a.props.children,function(r){return r})}),j(D(a),"handleTabClick",function(r){return function(l,c){c.preventDefault(),a.selectTabAt(c,{index:l,onSelectionChange:r})}}),j(D(a),"setTabAt",function(r,l){a["tab".concat(r)]=l}),j(D(a),"overflowNavInterval",null),j(D(a),"handleOverflowNavClick",function(r,l){var c,b=l.direction,p=l.multiplier,d=p===void 0?10:p,h=(c=a.tablist)===null||c===void 0?void 0:c.current,m=h.clientWidth,y=h.scrollLeft,_=h.scrollWidth;b===1&&!y&&(a.tablist.current.scrollLeft+=a.OVERFLOW_BUTTON_OFFSET),a.tablist.current.scrollLeft+=b*d;var x=b===-1&&y=_-a.OVERFLOW_BUTTON_OFFSET;if(x||w){if(x){var T,B;(T=a.rightOverflowNavButton)===null||T===void 0||(B=T.current)===null||B===void 0||B.focus()}if(w){var N,v;(N=a.leftOverflowNavButton)===null||N===void 0||(v=N.current)===null||v===void 0||v.focus()}}}),j(D(a),"handleOverflowNavMouseDown",function(r,l){var c=l.direction;r.buttons===1&&(a.overflowNavInterval=setInterval(function(){var b,p=(b=a.tablist)===null||b===void 0?void 0:b.current,d=p.clientWidth,h=p.scrollLeft,m=p.scrollWidth,y=c===-1&&h=m-a.OVERFLOW_BUTTON_OFFSET;(y||_)&&clearInterval(a.overflowNavInterval),a.handleOverflowNavClick(r,{direction:c})}))}),j(D(a),"handleOverflowNavMouseUp",function(){clearInterval(a.overflowNavInterval)}),a}return jl(n,[{key:"componentDidMount",value:function(){var i;this._debouncedHandleWindowResize||(this._debouncedHandleWindowResize=Or(this._handleWindowResize,200)),this._handleWindowResize(),window.addEventListener("resize",this._debouncedHandleWindowResize);var s=((i=this.tablist)===null||i===void 0?void 0:i.current)||{},o=s.clientWidth,r=s.scrollLeft,l=s.scrollWidth,c=this.getTabAt(this.state.selected),b=l>o;if(b){var p,d,h,m=(c==null||(p=c.tabAnchor)===null||p===void 0?void 0:p.getBoundingClientRect().right)<(c==null||(d=c.tabAnchor)===null||d===void 0?void 0:d.offsetParent.getBoundingClientRect().right),y=r+o===l;this.props.scrollIntoView&&(c==null||(h=c.tabAnchor)===null||h===void 0||h.scrollIntoView({block:"nearest",inline:"nearest"})),!m&&!y&&(this.tablist.current.scrollLeft+=this.OVERFLOW_BUTTON_OFFSET*2)}}},{key:"componentWillUnmount",value:function(){this._debouncedHandleWindowResize&&this._debouncedHandleWindowResize.cancel(),window.removeEventListener("resize",this._debouncedHandleWindowResize)}},{key:"componentDidUpdate",value:function(i,s){var o=this.tablist.current,r=o.clientWidth,l=o.scrollLeft,c=o.scrollWidth,b=this.state,p=b.tablistClientWidth,d=b.tablistScrollLeft,h=b.tablistScrollWidth,m=b.selected;if((r!==p||l!==d||c!==h)&&this.setState({horizontalOverflow:c>r,tablistClientWidth:r,tablistScrollLeft:l,tablistScrollWidth:c}),this.props.scrollIntoView&&s.selected!==m){var y,_;(y=this.getTabAt(m))===null||y===void 0||(_=y.tabAnchor)===null||_===void 0||_.scrollIntoView({block:"nearest",inline:"nearest"})}}},{key:"render",value:function(){var i=this,s,o,r,l=this.props,c=l.className,b=l.type,p=l.light,d=l.onSelectionChange;l.scrollIntoView,l.selectionMode;var h=l.tabContentClassName,m=l.leftOverflowButtonProps,y=l.rightOverflowButtonProps,_=kl(l,Ml),x=this.context,w=this.getTabs().map(function(S,u){var P=u===i.state.selected?0:-1,R=E.cloneElement(S,{index:u,selected:u===i.state.selected,handleTabClick:i.handleTabClick(d),tabIndex:P,ref:function(k){i.setTabAt(u,k)},handleTabKeyDown:i.handleTabKeyDown(d)});return R}),T=E.Children.map(w,function(S){var u=S.props,P=u.id,R=u.children,M=u.selected,k=u.renderContent,C=k===void 0?Rl:k;return E.createElement(C,{id:P&&"".concat(P,"__panel"),className:h,hidden:!M,selected:M,"aria-labelledby":P},R)}),B=!this.state.horizontalOverflow||!this.state.tablistScrollLeft,N=!this.state.horizontalOverflow||this.state.tablistScrollLeft+this.state.tablistClientWidth===this.state.tablistScrollWidth,v={tabs:Ee(c,"".concat(x,"--tabs--scrollable"),(s={},j(s,"".concat(x,"--tabs--scrollable--container"),b==="container"),j(s,"".concat(x,"--tabs--scrollable--light"),p),s)),tablist:Ee("".concat(x,"--tabs--scrollable__nav")),leftOverflowButtonClasses:Ee((o={},j(o,"".concat(x,"--tab--overflow-nav-button"),this.state.horizontalOverflow),j(o,"".concat(x,"--tab--overflow-nav-button--hidden"),B),o)),rightOverflowButtonClasses:Ee((r={},j(r,"".concat(x,"--tab--overflow-nav-button"),this.state.horizontalOverflow),j(r,"".concat(x,"--tab--overflow-nav-button--hidden"),N),r))};return E.createElement(E.Fragment,null,E.createElement("div",Ye({},_,{className:v.tabs,onScroll:this.handleScroll}),E.createElement("button",Ye({"aria-hidden":"true","aria-label":"Scroll left",className:v.leftOverflowButtonClasses,onClick:function(u){return i.handleOverflowNavClick(u,{direction:-1})},onMouseDown:function(u){return i.handleOverflowNavMouseDown(u,{direction:-1})},onMouseUp:this.handleOverflowNavMouseUp,ref:this.leftOverflowNavButton,tabIndex:"-1",type:"button"},m),E.createElement(ao,null)),!B&&E.createElement("div",{className:"".concat(x,"--tabs__overflow-indicator--left")}),E.createElement("ul",{role:"tablist",tabIndex:-1,className:v.tablist,ref:this.tablist},w),!N&&E.createElement("div",{className:"".concat(x,"--tabs__overflow-indicator--right")}),E.createElement("button",Ye({"aria-hidden":"true","aria-label":"Scroll right",className:v.rightOverflowButtonClasses,onClick:function(u){return i.handleOverflowNavClick(u,{direction:1})},onMouseDown:function(u){return i.handleOverflowNavMouseDown(u,{direction:1})},onMouseUp:this.handleOverflowNavMouseUp,ref:this.rightOverflowNavButton,tabIndex:"-1",type:"button"},y),E.createElement(no,null))),T)}}],[{key:"getDerivedStateFromProps",value:function(i,s){var o=i.selected,r=s.prevSelected;return r===o?null:{selected:o,prevSelected:o}}}]),n}(E.Component);j(Ke,"propTypes",{children:A.node,className:A.string,hidden:A.bool,leftOverflowButtonProps:A.object,light:A.bool,onClick:A.func,onKeyDown:A.func,onSelectionChange:A.func,rightOverflowButtonProps:A.object,scrollIntoView:A.bool,selected:A.number,selectionMode:A.oneOf(["automatic","manual"]),tabContentClassName:A.string,type:A.oneOf(["default","container"])});j(Ke,"defaultProps",{type:"default",scrollIntoView:!0,selected:0,selectionMode:"automatic"});j(Ke,"contextType",Er);var Wl=Ur,Ul=el,Il=tl,Ll=Wr(),ql=Ir,Gl=Lr,zl=200;function Ql(e,t,n,a){var i=-1,s=Ul,o=!0,r=e.length,l=[],c=t.length;if(!r)return l;n&&(t=Ll(t,ql(n))),a?(s=Il,o=!1):t.length>=zl&&(s=Gl,o=!1,t=new Wl(t));e:for(;++i=a?e:$l(e,t,n)}var t0=e0,a0="\\ud800-\\udfff",n0="\\u0300-\\u036f",i0="\\ufe20-\\ufe2f",s0="\\u20d0-\\u20ff",o0=n0+i0+s0,r0="\\ufe0e\\ufe0f",l0="\\u200d",c0=RegExp("["+l0+a0+o0+r0+"]");function p0(e){return c0.test(e)}var ro=p0;function b0(e){return e.split("")}var d0=b0,lo="\\ud800-\\udfff",h0="\\u0300-\\u036f",u0="\\ufe20-\\ufe2f",g0="\\u20d0-\\u20ff",m0=h0+u0+g0,y0="\\ufe0e\\ufe0f",x0="["+lo+"]",Ja="["+m0+"]",Ka="\\ud83c[\\udffb-\\udfff]",_0="(?:"+Ja+"|"+Ka+")",co="[^"+lo+"]",po="(?:\\ud83c[\\udde6-\\uddff]){2}",bo="[\\ud800-\\udbff][\\udc00-\\udfff]",f0="\\u200d",ho=_0+"?",uo="["+y0+"]?",w0="(?:"+f0+"(?:"+[co,po,bo].join("|")+")"+uo+ho+")*",T0=uo+ho+w0,v0="(?:"+[co+Ja+"?",Ja,po,bo,x0].join("|")+")",S0=RegExp(Ka+"(?="+Ka+")|"+v0+T0,"g");function P0(e){return e.match(S0)||[]}var B0=P0,N0=d0,R0=ro,M0=B0;function k0(e){return R0(e)?M0(e):N0(e)}var C0=k0,A0=t0,j0=ro,E0=C0,O0=On;function D0(e){return function(t){t=O0(t);var n=j0(t)?E0(t):void 0,a=n?n[0]:t.charAt(0),i=n?A0(n,1).join(""):t.slice(1);return a[e]()+i}}var F0=D0,W0=F0,U0=W0("toUpperCase"),I0=U0,L0=On,q0=I0;function G0(e){return q0(L0(e).toLowerCase())}var z0=G0;const go=oe(z0),mo={amount:"Amount",bill_to:"Bill to",buyers:"Buyer",contract_amounts:"Contract amounts",contract_terms:"Contract terms",contract_types:"Contract types",currencies:"Currency",currency:"Currency",due_dates:"Due date",effective_dates:"Effective dates",invoice_dates:"Invoice date",invoice_numbers:"Invoice number",invoice_parts:"Invoice parts",invoice_to:"Invoice to",item_description:"Item description",line_items:"Line item",part_description:"Part description",payment_terms:"Payment terms",purchase_order_dates:"Purchase order date",purchase_order_numbers:"Purchase order number",quantity_ordered:"Quantity",ship_to:"Ship to",supplier_ids:"Supplier id",suppliers:"Suppliers",termination_dates:"Termination dates",total_amounts:"Total amount",totals_due:"Total due",unit_price:"Unit price"},Fn={noneLabel:"None",detailsTitle:"Details",noneSelectedMessage:"Nothing selected"},$a=({title:e,items:t,selectedLink:n,messages:a=Fn,onClick:i})=>{const s=()=>g.jsx("ul",{children:t.map(o=>o.link===!0?Q0(o,i,n,e):X0(o))});return g.jsxs("div",{className:"section","data-testid":"details-pane-"+e,children:[g.jsx("h3",{className:"sectionHeader",children:go(e)}),t&&t.length>0?s():a.noneLabel]})};function Q0({type:e,label:t,value:n},a,i,s){return g.jsxs("li",{className:"content",children:[n&&g.jsx("div",{className:"display-name",children:mo[e]}),g.jsx(Et,{className:_e({selected:i===e}),href:"#",onClick:o=>{o.preventDefault(),a({sectionTitle:s,type:e})},children:n&&n.label?n.label:t})]},e)}function X0(e){return g.jsx("li",{className:"content",children:V0(e)},e.label||e)}function V0(e){return e.label?e.label:mo[e]||e}try{$a.displayName="Details",$a.__docgenInfo={description:"",displayName:"Details",props:{title:{defaultValue:null,description:"",name:"title",required:!0,type:{name:"string"}},items:{defaultValue:null,description:"",name:"items",required:!0,type:{name:"Item[]"}},selectedLink:{defaultValue:null,description:"",name:"selectedLink",required:!1,type:{name:"string"}},messages:{defaultValue:{value:`{ noneLabel: 'None', detailsTitle: 'Details', diff --git a/docs/storybook/assets/Color-6VNJS4EI-N7NQjCtp.js b/docs/storybook/assets/Color-6VNJS4EI-lBZZYQGi.js similarity index 99% rename from docs/storybook/assets/Color-6VNJS4EI-N7NQjCtp.js rename to docs/storybook/assets/Color-6VNJS4EI-lBZZYQGi.js index 479db43b0..64e654791 100644 --- a/docs/storybook/assets/Color-6VNJS4EI-N7NQjCtp.js +++ b/docs/storybook/assets/Color-6VNJS4EI-lBZZYQGi.js @@ -1 +1 @@ -import{n as w,f as Z,T as me,F as pe,I as ve,g as ye}from"./index-yCoF09M4.js";import{R as f,r as b,g as ee}from"./index-RfLt4OUa.js";import{d as xe}from"./debounce-eWC8LGMf.js";import{c as we}from"./callBound-4MCeDK1M.js";import"./iframe-_98K0_ok.js";import"../sb-preview/runtime.js";import"./pickBy-llkn_6s3.js";import"./index-miLrID2P.js";import"./inheritsLoose-O2jMHMzR.js";import"./pickBy-lHA7W3rs.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./index-xck8ovCi.js";import"./index-I0bGnlnk.js";import"./assert-1o4ErrXT.js";function k(){return(k=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function T(e){var t=b.useRef(e),n=b.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var $=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:v.buttons>0)&&o.current?a(A(o.current,v,s.current)):E(!1)},j=function(){return E(!1)};function E(v){var m=c.current,x=L(o.current),N=v?x.addEventListener:x.removeEventListener;N(m?"touchmove":"mousemove",_),N(m?"touchend":"mouseup",j)}return[function(v){var m=v.nativeEvent,x=o.current;if(x&&(U(m),!function(ge,be){return be&&!O(ge)}(m,c.current)&&x)){if(O(m)){c.current=!0;var N=m.changedTouches||[];N.length&&(s.current=N[0].identifier)}x.focus(),a(A(x,m,s.current)),E(!0)}},function(v){var m=v.which||v.keyCode;m<37||m>40||(v.preventDefault(),l({left:m===39?.05:m===37?-.05:0,top:m===40?.05:m===38?-.05:0}))},E]},[l,a]),d=u[0],h=u[1],g=u[2];return b.useEffect(function(){return g},[g]),f.createElement("div",k({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:h,tabIndex:0,role:"slider"}))}),S=function(e){return e.filter(Boolean).join(" ")},W=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,a=S(["react-colorful__pointer",e.className]);return f.createElement("div",{className:a,style:{top:100*o+"%",left:100*n+"%"}},f.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},p=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},ke={grad:.9,turn:360,rad:360/(2*Math.PI)},_e=function(e){return re(X(e))},X=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?p(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?p(parseInt(e.substring(6,8),16)/255,2):1}},Ee=function(e,t){return t===void 0&&(t="deg"),Number(e)*(ke[t]||1)},Me=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?Ce({h:Ee(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},Ce=function(e){var t=e.s,n=e.l;return{h:e.h,s:(t*=(n<50?n:100-n)/100)>0?2*t/(n+t)*100:0,v:n+t,a:e.a}},$e=function(e){return Oe(ne(e))},te=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:p(e.h),s:p(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:p(o/2),a:p(r,2)}},B=function(e){var t=te(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},H=function(e){var t=te(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},ne=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),l=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),u=a%6;return{r:p(255*[r,s,l,l,c,r][u]),g:p(255*[c,r,r,s,l,l][u]),b:p(255*[l,l,c,r,r,s][u]),a:p(o,2)}},Ne=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?re({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},z=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Oe=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=o<1?z(p(255*o)):"";return"#"+z(t)+z(n)+z(r)+a},re=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=Math.max(t,n,r),l=a-Math.min(t,n,r),s=l?a===t?(n-r)/l:a===n?2+(r-t)/l:4+(t-n)/l:0;return{h:p(60*(s<0?s+6:s)),s:p(a?l/a*100:0),v:p(a/255*100),a:o}},oe=f.memo(function(e){var t=e.hue,n=e.onChange,r=S(["react-colorful__hue",e.className]);return f.createElement("div",{className:r},f.createElement(G,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:$(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":p(t),"aria-valuemax":"360","aria-valuemin":"0"},f.createElement(W,{className:"react-colorful__hue-pointer",left:t/360,color:B({h:t,s:100,v:100,a:1})})))}),ae=f.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:B({h:t.h,s:100,v:100,a:1})};return f.createElement("div",{className:"react-colorful__saturation",style:r},f.createElement(G,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:$(t.s+100*o.left,0,100),v:$(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+p(t.s)+"%, Brightness "+p(t.v)+"%"},f.createElement(W,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:B(t)})))}),le=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},se=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},Re=function(e,t){return e.toLowerCase()===t.toLowerCase()||le(X(e),X(t))};function ce(e,t,n){var r=T(n),o=b.useState(function(){return e.toHsva(t)}),a=o[0],l=o[1],s=b.useRef({color:t,hsva:a});b.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},l(u)}},[t,e]),b.useEffect(function(){var u;le(a,s.current.hsva)||e.equal(u=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:u},r(u))},[a,e,r]);var c=b.useCallback(function(u){l(function(d){return Object.assign({},d,u)})},[]);return[a,c]}var Se=typeof window<"u"?b.useLayoutEffect:b.useEffect,je=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Y=new Map,ie=function(e){Se(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Y.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Y.set(t,n);var r=je();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},ze=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=V(e,["className","colorModel","color","onChange"]),s=b.useRef(null);ie(s);var c=ce(n,o,a),u=c[0],d=c[1],h=S(["react-colorful",t]);return f.createElement("div",k({},l,{ref:s,className:h}),f.createElement(ae,{hsva:u,onChange:d}),f.createElement(oe,{hue:u.h,onChange:d,className:"react-colorful__last-control"}))},Ie={defaultColor:"000",toHsva:_e,fromHsva:function(e){return $e({h:e.h,s:e.s,v:e.v,a:1})},equal:Re},Fe=function(e){return f.createElement(ze,k({},e,{colorModel:Ie}))},He=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+H(Object.assign({},n,{a:0}))+", "+H(Object.assign({},n,{a:1}))+")"},a=S(["react-colorful__alpha",t]),l=p(100*n.a);return f.createElement("div",{className:a},f.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),f.createElement(G,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:$(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":l+"%","aria-valuenow":l,"aria-valuemin":"0","aria-valuemax":"100"},f.createElement(W,{className:"react-colorful__alpha-pointer",left:n.a,color:H(n)})))},ue=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=V(e,["className","colorModel","color","onChange"]),s=b.useRef(null);ie(s);var c=ce(n,o,a),u=c[0],d=c[1],h=S(["react-colorful",t]);return f.createElement("div",k({},l,{ref:s,className:h}),f.createElement(ae,{hsva:u,onChange:d}),f.createElement(oe,{hue:u.h,onChange:d}),f.createElement(He,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},Pe={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:Me,fromHsva:H,equal:se},qe=function(e){return f.createElement(ue,k({},e,{colorModel:Pe}))},Te={defaultColor:"rgba(0, 0, 0, 1)",toHsva:Ne,fromHsva:function(e){var t=ne(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:se},Le=function(e){return f.createElement(ue,k({},e,{colorModel:Te}))},Xe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const R=Xe,fe={};for(const e of Object.keys(R))fe[R[e]]=e;const i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var he=i;for(const e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:n})}i.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),a=Math.max(t,n,r),l=a-o;let s,c;a===o?s=0:t===a?s=(n-r)/l:n===a?s=2+(r-t)/l:r===a&&(s=4+(t-n)/l),s=Math.min(s*60,360),s<0&&(s+=360);const u=(o+a)/2;return a===o?c=0:u<=.5?c=l/(a+o):c=l/(2-a-o),[s,c*100,u*100]};i.rgb.hsv=function(e){let t,n,r,o,a;const l=e[0]/255,s=e[1]/255,c=e[2]/255,u=Math.max(l,s,c),d=u-Math.min(l,s,c),h=function(g){return(u-g)/6/d+1/2};return d===0?(o=0,a=0):(a=d/u,t=h(l),n=h(s),r=h(c),l===u?o=r-n:s===u?o=1/3+t-r:c===u&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[o*360,a*100,u*100]};i.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=i.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,a*100,r*100]};i.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),a=(1-t-o)/(1-o)||0,l=(1-n-o)/(1-o)||0,s=(1-r-o)/(1-o)||0;return[a*100,l*100,s*100,o*100]};function Be(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){const t=fe[e];if(t)return t;let n=1/0,r;for(const o of Object.keys(R)){const a=R[o],l=Be(e,a);l.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,l=t*.0193+n*.1192+r*.9505;return[o*100,a*100,l*100]};i.rgb.lab=function(e){const t=i.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const a=116*r-16,l=500*(n-r),s=200*(r-o);return[a,l,s]};i.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,a,l;if(n===0)return l=r*255,[l,l,l];r<.5?o=r*(1+n):o=r+n-r*n;const s=2*r-o,c=[0,0,0];for(let u=0;u<3;u++)a=t+1/3*-(u-1),a<0&&a++,a>1&&a--,6*a<1?l=s+(o-s)*6*a:2*a<1?l=o:3*a<2?l=s+(o-s)*(2/3-a)*6:l=s,c[u]=l*255;return c};i.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=a<=1?a:2-a;const l=(r+n)/2,s=r===0?2*o/(a+o):2*n/(r+n);return[t,s*100,l*100]};i.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,a=t-Math.floor(t),l=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,o){case 0:return[r,c,l];case 1:return[s,r,l];case 2:return[l,r,c];case 3:return[l,s,r];case 4:return[c,l,r];case 5:return[r,l,s]}};i.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let a,l;l=(2-n)*r;const s=(2-n)*o;return a=n*o,a/=s<=1?s:2-s,a=a||0,l/=2,[t,a*100,l*100]};i.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let a;o>1&&(n/=o,r/=o);const l=Math.floor(6*t),s=1-r;a=6*t-l,l&1&&(a=1-a);const c=n+a*(s-n);let u,d,h;switch(l){default:case 6:case 0:u=s,d=c,h=n;break;case 1:u=c,d=s,h=n;break;case 2:u=n,d=s,h=c;break;case 3:u=n,d=c,h=s;break;case 4:u=c,d=n,h=s;break;case 5:u=s,d=n,h=c;break}return[u*255,d*255,h*255]};i.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,a=1-Math.min(1,t*(1-o)+o),l=1-Math.min(1,n*(1-o)+o),s=1-Math.min(1,r*(1-o)+o);return[a*255,l*255,s*255]};i.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,a,l;return o=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,l=t*.0557+n*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),l=Math.min(Math.max(0,l),1),[o*255,a*255,l*255]};i.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16,a=500*(t-n),l=200*(n-r);return[o,a,l]};i.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,a,l;a=(t+16)/116,o=n/500+a,l=a-r/200;const s=a**3,c=o**3,u=l**3;return a=s>.008856?s:(a-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,l=u>.008856?u:(l-16/116)/7.787,o*=95.047,a*=100,l*=108.883,[o,a,l]};i.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const l=Math.sqrt(n*n+r*r);return[t,l,o]};i.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,a=n*Math.cos(o),l=n*Math.sin(o);return[t,a,l]};i.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let a=t===null?i.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let l=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(l+=60),l};i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])};i.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,a=(t>>2&1)*n*255;return[r,o,a]};i.ansi256.rgb=function(e){if(e>=232){const a=(e-232)*10+8;return[a,a,a]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]};i.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};i.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(s=>s+s).join(""));const r=parseInt(n,16),o=r>>16&255,a=r>>8&255,l=r&255;return[o,a,l]};i.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),l=o-a;let s,c;return l<1?s=a/(1-l):s=0,l<=0?c=0:o===t?c=(n-r)/l%6:o===n?c=2+(r-t)/l:c=4+(t-n)/l,c/=6,c%=1,[c*360,l*100,s*100]};i.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]};i.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]};i.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],a=t%1*6,l=a%1,s=1-l;let c=0;switch(Math.floor(a)){case 0:o[0]=1,o[1]=l,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=l;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=l,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return c=(1-n)*r,[(n*o[0]+c)*255,(n*o[1]+c)*255,(n*o[2]+c)*255]};i.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]};i.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]};i.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};i.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,o=r-t;let a=0;return o<1&&(a=(r-o)/(1-o)),[e[0],o*100,a*100]};i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};i.gray.hsl=function(e){return[0,0,e[0]]};i.gray.hsv=i.gray.hsl;i.gray.hwb=function(e){return[0,100,e[0]]};i.gray.cmyk=function(e){return[0,0,0,e[0]]};i.gray.lab=function(e){return[e[0],0,0]};i.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const P=he;function De(){const e={},t=Object.keys(P);for(let n=t.length,r=0;r1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function Je(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let a=o.length,l=0;l{M[e]={},Object.defineProperty(M[e],"channels",{value:D[e].channels}),Object.defineProperty(M[e],"labels",{value:D[e].labels});const t=Ae(e);Object.keys(t).forEach(r=>{const o=t[r];M[e][r]=Je(o),M[e][r].raw=Ye(o)})});var Qe=M;const y=ee(Qe);var Ze=xe,et=we,tt="Expected a function";function nt(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(tt);return et(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ze(e,t,{leading:r,maxWait:t,trailing:o})}var rt=nt;const ot=ee(rt);var at=w.div({position:"relative",maxWidth:250}),lt=w(Z)({position:"absolute",zIndex:1,top:4,left:4}),st=w.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),ct=w(me)(({theme:e})=>({fontFamily:e.typography.fonts.base})),it=w.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),ut=w.div(({theme:e,active:t})=>({width:16,height:16,boxShadow:t?`${e.appBorderColor} 0 0 0 1px inset, ${e.textMutedColor}50 0 0 0 4px`:`${e.appBorderColor} 0 0 0 1px inset`,borderRadius:e.appBorderRadius})),ft=`url('data:image/svg+xml;charset=utf-8,')`,J=({value:e,active:t,onClick:n,style:r,...o})=>{let a=`linear-gradient(${e}, ${e}), ${ft}, linear-gradient(#fff, #fff)`;return f.createElement(ut,{...o,active:t,onClick:n,style:{...r,backgroundImage:a}})},ht=w(pe.Input)(({theme:e})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:e.typography.fonts.base})),dt=w(ve)(({theme:e})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:e.input.color})),de=(e=>(e.RGB="rgb",e.HSL="hsl",e.HEX="hex",e))(de||{}),I=Object.values(de),gt=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,bt=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,mt=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,K=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,pt=/^\s*#?([0-9a-f]{3})\s*$/i,vt={hex:Fe,rgb:Le,hsl:qe},F={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},Q=e=>{let t=e==null?void 0:e.match(gt);if(!t)return[0,0,0,1];let[,n,r,o,a=1]=t;return[n,r,o,a].map(Number)},C=e=>{if(!e)return;let t=!0;if(bt.test(e)){let[l,s,c,u]=Q(e),[d,h,g]=y.rgb.hsl([l,s,c])||[0,0,0];return{valid:t,value:e,keyword:y.rgb.keyword([l,s,c]),colorSpace:"rgb",rgb:e,hsl:`hsla(${d}, ${h}%, ${g}%, ${u})`,hex:`#${y.rgb.hex([l,s,c]).toLowerCase()}`}}if(mt.test(e)){let[l,s,c,u]=Q(e),[d,h,g]=y.hsl.rgb([l,s,c])||[0,0,0];return{valid:t,value:e,keyword:y.hsl.keyword([l,s,c]),colorSpace:"hsl",rgb:`rgba(${d}, ${h}, ${g}, ${u})`,hsl:e,hex:`#${y.hsl.hex([l,s,c]).toLowerCase()}`}}let n=e.replace("#",""),r=y.keyword.rgb(n)||y.hex.rgb(n),o=y.rgb.hsl(r),a=e;if(/[^#a-f0-9]/i.test(e)?a=n:K.test(e)&&(a=`#${n}`),a.startsWith("#"))t=K.test(a);else try{y.keyword.hex(a)}catch{t=!1}return{valid:t,value:a,keyword:y.rgb.keyword(r),colorSpace:"hex",rgb:`rgba(${r[0]}, ${r[1]}, ${r[2]}, 1)`,hsl:`hsla(${o[0]}, ${o[1]}%, ${o[2]}%, 1)`,hex:a}},yt=(e,t,n)=>{if(!e||!(t!=null&&t.valid))return F[n];if(n!=="hex")return(t==null?void 0:t[n])||F[n];if(!t.hex.startsWith("#"))try{return`#${y.keyword.hex(t.hex)}`}catch{return F.hex}let r=t.hex.match(pt);if(!r)return K.test(t.hex)?t.hex:F.hex;let[o,a,l]=r[1].split("");return`#${o}${o}${a}${a}${l}${l}`},xt=(e,t)=>{let[n,r]=b.useState(e||""),[o,a]=b.useState(()=>C(n)),[l,s]=b.useState((o==null?void 0:o.colorSpace)||"hex");b.useEffect(()=>{let h=e||"",g=C(h);r(h),a(g),s((g==null?void 0:g.colorSpace)||"hex")},[e]);let c=b.useMemo(()=>yt(n,o,l).toLowerCase(),[n,o,l]),u=b.useCallback(h=>{let g=C(h),_=(g==null?void 0:g.value)||h||"";r(_),_===""&&(a(void 0),t(void 0)),g&&(a(g),s(g.colorSpace),t(g.value))},[t]),d=b.useCallback(()=>{let h=I.indexOf(l)+1;h>=I.length&&(h=0),s(I[h]);let g=(o==null?void 0:o[I[h]])||"";r(g),t(g)},[o,l,t]);return{value:n,realValue:c,updateValue:u,color:o,colorSpace:l,cycleColorSpace:d}},q=e=>e.replace(/\s*/,"").toLowerCase(),wt=(e,t,n)=>{let[r,o]=b.useState(t!=null&&t.valid?[t]:[]);b.useEffect(()=>{t===void 0&&o([])},[t]);let a=b.useMemo(()=>(e||[]).map(s=>typeof s=="string"?C(s):s.title?{...C(s.color),keyword:s.title}:C(s.color)).concat(r).filter(Boolean).slice(-27),[e,r]),l=b.useCallback(s=>{s!=null&&s.valid&&(a.some(c=>q(c[n])===q(s[n]))||o(c=>c.concat(s)))},[n,a]);return{presets:a,addPreset:l}},kt=({name:e,value:t,onChange:n,onFocus:r,onBlur:o,presetColors:a,startOpen:l=!1})=>{let s=b.useCallback(ot(n,200),[n]),{value:c,realValue:u,updateValue:d,color:h,colorSpace:g,cycleColorSpace:_}=xt(t,s),{presets:j,addPreset:E}=wt(a,h,g),v=vt[g];return f.createElement(at,null,f.createElement(lt,{startOpen:l,closeOnOutsideClick:!0,onVisibleChange:()=>E(h),tooltip:f.createElement(st,null,f.createElement(v,{color:u==="transparent"?"#000000":u,onChange:d,onFocus:r,onBlur:o}),j.length>0&&f.createElement(it,null,j.map((m,x)=>f.createElement(Z,{key:`${m.value}-${x}`,hasChrome:!1,tooltip:f.createElement(ct,{note:m.keyword||m.value})},f.createElement(J,{value:m[g],active:h&&q(m[g])===q(h[g]),onClick:()=>d(m.value)})))))},f.createElement(J,{value:u,style:{margin:4}})),f.createElement(ht,{id:ye(e),value:c,onChange:m=>d(m.target.value),onFocus:m=>m.target.select(),placeholder:"Choose color..."}),c?f.createElement(dt,{icon:"markup",onClick:_}):null)},Lt=kt;export{kt as ColorControl,Lt as default}; +import{n as w,f as Z,T as me,F as pe,I as ve,g as ye}from"./index-lt-u4Ncf.js";import{R as f,r as b,g as ee}from"./index-RfLt4OUa.js";import{d as xe}from"./debounce-eWC8LGMf.js";import{c as we}from"./callBound-4MCeDK1M.js";import"./iframe-mUD1hmuH.js";import"../sb-preview/runtime.js";import"./pickBy-llkn_6s3.js";import"./index-miLrID2P.js";import"./inheritsLoose-O2jMHMzR.js";import"./pickBy-lHA7W3rs.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./index-xck8ovCi.js";import"./index-I0bGnlnk.js";import"./assert-1o4ErrXT.js";function k(){return(k=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function T(e){var t=b.useRef(e),n=b.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var $=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:v.buttons>0)&&o.current?a(A(o.current,v,s.current)):E(!1)},j=function(){return E(!1)};function E(v){var m=c.current,x=L(o.current),N=v?x.addEventListener:x.removeEventListener;N(m?"touchmove":"mousemove",_),N(m?"touchend":"mouseup",j)}return[function(v){var m=v.nativeEvent,x=o.current;if(x&&(U(m),!function(ge,be){return be&&!O(ge)}(m,c.current)&&x)){if(O(m)){c.current=!0;var N=m.changedTouches||[];N.length&&(s.current=N[0].identifier)}x.focus(),a(A(x,m,s.current)),E(!0)}},function(v){var m=v.which||v.keyCode;m<37||m>40||(v.preventDefault(),l({left:m===39?.05:m===37?-.05:0,top:m===40?.05:m===38?-.05:0}))},E]},[l,a]),d=u[0],h=u[1],g=u[2];return b.useEffect(function(){return g},[g]),f.createElement("div",k({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:o,onKeyDown:h,tabIndex:0,role:"slider"}))}),S=function(e){return e.filter(Boolean).join(" ")},W=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,a=S(["react-colorful__pointer",e.className]);return f.createElement("div",{className:a,style:{top:100*o+"%",left:100*n+"%"}},f.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},p=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},ke={grad:.9,turn:360,rad:360/(2*Math.PI)},_e=function(e){return re(X(e))},X=function(e){return e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?p(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?p(parseInt(e.substring(6,8),16)/255,2):1}},Ee=function(e,t){return t===void 0&&(t="deg"),Number(e)*(ke[t]||1)},Me=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?Ce({h:Ee(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},Ce=function(e){var t=e.s,n=e.l;return{h:e.h,s:(t*=(n<50?n:100-n)/100)>0?2*t/(n+t)*100:0,v:n+t,a:e.a}},$e=function(e){return Oe(ne(e))},te=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:p(e.h),s:p(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:p(o/2),a:p(r,2)}},B=function(e){var t=te(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},H=function(e){var t=te(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},ne=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),l=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),u=a%6;return{r:p(255*[r,s,l,l,c,r][u]),g:p(255*[c,r,r,s,l,l][u]),b:p(255*[l,l,c,r,r,s][u]),a:p(o,2)}},Ne=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?re({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},z=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Oe=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=o<1?z(p(255*o)):"";return"#"+z(t)+z(n)+z(r)+a},re=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,a=Math.max(t,n,r),l=a-Math.min(t,n,r),s=l?a===t?(n-r)/l:a===n?2+(r-t)/l:4+(t-n)/l:0;return{h:p(60*(s<0?s+6:s)),s:p(a?l/a*100:0),v:p(a/255*100),a:o}},oe=f.memo(function(e){var t=e.hue,n=e.onChange,r=S(["react-colorful__hue",e.className]);return f.createElement("div",{className:r},f.createElement(G,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:$(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":p(t),"aria-valuemax":"360","aria-valuemin":"0"},f.createElement(W,{className:"react-colorful__hue-pointer",left:t/360,color:B({h:t,s:100,v:100,a:1})})))}),ae=f.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:B({h:t.h,s:100,v:100,a:1})};return f.createElement("div",{className:"react-colorful__saturation",style:r},f.createElement(G,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:$(t.s+100*o.left,0,100),v:$(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+p(t.s)+"%, Brightness "+p(t.v)+"%"},f.createElement(W,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:B(t)})))}),le=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},se=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},Re=function(e,t){return e.toLowerCase()===t.toLowerCase()||le(X(e),X(t))};function ce(e,t,n){var r=T(n),o=b.useState(function(){return e.toHsva(t)}),a=o[0],l=o[1],s=b.useRef({color:t,hsva:a});b.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},l(u)}},[t,e]),b.useEffect(function(){var u;le(a,s.current.hsva)||e.equal(u=e.fromHsva(a),s.current.color)||(s.current={hsva:a,color:u},r(u))},[a,e,r]);var c=b.useCallback(function(u){l(function(d){return Object.assign({},d,u)})},[]);return[a,c]}var Se=typeof window<"u"?b.useLayoutEffect:b.useEffect,je=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Y=new Map,ie=function(e){Se(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Y.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Y.set(t,n);var r=je();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},ze=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=V(e,["className","colorModel","color","onChange"]),s=b.useRef(null);ie(s);var c=ce(n,o,a),u=c[0],d=c[1],h=S(["react-colorful",t]);return f.createElement("div",k({},l,{ref:s,className:h}),f.createElement(ae,{hsva:u,onChange:d}),f.createElement(oe,{hue:u.h,onChange:d,className:"react-colorful__last-control"}))},Ie={defaultColor:"000",toHsva:_e,fromHsva:function(e){return $e({h:e.h,s:e.s,v:e.v,a:1})},equal:Re},Fe=function(e){return f.createElement(ze,k({},e,{colorModel:Ie}))},He=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+H(Object.assign({},n,{a:0}))+", "+H(Object.assign({},n,{a:1}))+")"},a=S(["react-colorful__alpha",t]),l=p(100*n.a);return f.createElement("div",{className:a},f.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),f.createElement(G,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:$(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":l+"%","aria-valuenow":l,"aria-valuemin":"0","aria-valuemax":"100"},f.createElement(W,{className:"react-colorful__alpha-pointer",left:n.a,color:H(n)})))},ue=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,a=e.onChange,l=V(e,["className","colorModel","color","onChange"]),s=b.useRef(null);ie(s);var c=ce(n,o,a),u=c[0],d=c[1],h=S(["react-colorful",t]);return f.createElement("div",k({},l,{ref:s,className:h}),f.createElement(ae,{hsva:u,onChange:d}),f.createElement(oe,{hue:u.h,onChange:d}),f.createElement(He,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},Pe={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:Me,fromHsva:H,equal:se},qe=function(e){return f.createElement(ue,k({},e,{colorModel:Pe}))},Te={defaultColor:"rgba(0, 0, 0, 1)",toHsva:Ne,fromHsva:function(e){var t=ne(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:se},Le=function(e){return f.createElement(ue,k({},e,{colorModel:Te}))},Xe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const R=Xe,fe={};for(const e of Object.keys(R))fe[R[e]]=e;const i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var he=i;for(const e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:n})}i.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),a=Math.max(t,n,r),l=a-o;let s,c;a===o?s=0:t===a?s=(n-r)/l:n===a?s=2+(r-t)/l:r===a&&(s=4+(t-n)/l),s=Math.min(s*60,360),s<0&&(s+=360);const u=(o+a)/2;return a===o?c=0:u<=.5?c=l/(a+o):c=l/(2-a-o),[s,c*100,u*100]};i.rgb.hsv=function(e){let t,n,r,o,a;const l=e[0]/255,s=e[1]/255,c=e[2]/255,u=Math.max(l,s,c),d=u-Math.min(l,s,c),h=function(g){return(u-g)/6/d+1/2};return d===0?(o=0,a=0):(a=d/u,t=h(l),n=h(s),r=h(c),l===u?o=r-n:s===u?o=1/3+t-r:c===u&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[o*360,a*100,u*100]};i.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=i.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,a*100,r*100]};i.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),a=(1-t-o)/(1-o)||0,l=(1-n-o)/(1-o)||0,s=(1-r-o)/(1-o)||0;return[a*100,l*100,s*100,o*100]};function Be(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){const t=fe[e];if(t)return t;let n=1/0,r;for(const o of Object.keys(R)){const a=R[o],l=Be(e,a);l.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,l=t*.0193+n*.1192+r*.9505;return[o*100,a*100,l*100]};i.rgb.lab=function(e){const t=i.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const a=116*r-16,l=500*(n-r),s=200*(r-o);return[a,l,s]};i.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,a,l;if(n===0)return l=r*255,[l,l,l];r<.5?o=r*(1+n):o=r+n-r*n;const s=2*r-o,c=[0,0,0];for(let u=0;u<3;u++)a=t+1/3*-(u-1),a<0&&a++,a>1&&a--,6*a<1?l=s+(o-s)*6*a:2*a<1?l=o:3*a<2?l=s+(o-s)*(2/3-a)*6:l=s,c[u]=l*255;return c};i.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=a<=1?a:2-a;const l=(r+n)/2,s=r===0?2*o/(a+o):2*n/(r+n);return[t,s*100,l*100]};i.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,a=t-Math.floor(t),l=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,o){case 0:return[r,c,l];case 1:return[s,r,l];case 2:return[l,r,c];case 3:return[l,s,r];case 4:return[c,l,r];case 5:return[r,l,s]}};i.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let a,l;l=(2-n)*r;const s=(2-n)*o;return a=n*o,a/=s<=1?s:2-s,a=a||0,l/=2,[t,a*100,l*100]};i.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let a;o>1&&(n/=o,r/=o);const l=Math.floor(6*t),s=1-r;a=6*t-l,l&1&&(a=1-a);const c=n+a*(s-n);let u,d,h;switch(l){default:case 6:case 0:u=s,d=c,h=n;break;case 1:u=c,d=s,h=n;break;case 2:u=n,d=s,h=c;break;case 3:u=n,d=c,h=s;break;case 4:u=c,d=n,h=s;break;case 5:u=s,d=n,h=c;break}return[u*255,d*255,h*255]};i.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,a=1-Math.min(1,t*(1-o)+o),l=1-Math.min(1,n*(1-o)+o),s=1-Math.min(1,r*(1-o)+o);return[a*255,l*255,s*255]};i.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,a,l;return o=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,l=t*.0557+n*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),l=Math.min(Math.max(0,l),1),[o*255,a*255,l*255]};i.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16,a=500*(t-n),l=200*(n-r);return[o,a,l]};i.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,a,l;a=(t+16)/116,o=n/500+a,l=a-r/200;const s=a**3,c=o**3,u=l**3;return a=s>.008856?s:(a-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,l=u>.008856?u:(l-16/116)/7.787,o*=95.047,a*=100,l*=108.883,[o,a,l]};i.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const l=Math.sqrt(n*n+r*r);return[t,l,o]};i.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,a=n*Math.cos(o),l=n*Math.sin(o);return[t,a,l]};i.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let a=t===null?i.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let l=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return a===2&&(l+=60),l};i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])};i.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,a=(t>>2&1)*n*255;return[r,o,a]};i.ansi256.rgb=function(e){if(e>=232){const a=(e-232)*10+8;return[a,a,a]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]};i.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};i.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(s=>s+s).join(""));const r=parseInt(n,16),o=r>>16&255,a=r>>8&255,l=r&255;return[o,a,l]};i.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),l=o-a;let s,c;return l<1?s=a/(1-l):s=0,l<=0?c=0:o===t?c=(n-r)/l%6:o===n?c=2+(r-t)/l:c=4+(t-n)/l,c/=6,c%=1,[c*360,l*100,s*100]};i.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]};i.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]};i.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],a=t%1*6,l=a%1,s=1-l;let c=0;switch(Math.floor(a)){case 0:o[0]=1,o[1]=l,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=l;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=l,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return c=(1-n)*r,[(n*o[0]+c)*255,(n*o[1]+c)*255,(n*o[2]+c)*255]};i.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]};i.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]};i.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};i.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,o=r-t;let a=0;return o<1&&(a=(r-o)/(1-o)),[e[0],o*100,a*100]};i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};i.gray.hsl=function(e){return[0,0,e[0]]};i.gray.hsv=i.gray.hsl;i.gray.hwb=function(e){return[0,100,e[0]]};i.gray.cmyk=function(e){return[0,0,0,e[0]]};i.gray.lab=function(e){return[e[0],0,0]};i.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const P=he;function De(){const e={},t=Object.keys(P);for(let n=t.length,r=0;r1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function Je(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let a=o.length,l=0;l{M[e]={},Object.defineProperty(M[e],"channels",{value:D[e].channels}),Object.defineProperty(M[e],"labels",{value:D[e].labels});const t=Ae(e);Object.keys(t).forEach(r=>{const o=t[r];M[e][r]=Je(o),M[e][r].raw=Ye(o)})});var Qe=M;const y=ee(Qe);var Ze=xe,et=we,tt="Expected a function";function nt(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(tt);return et(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Ze(e,t,{leading:r,maxWait:t,trailing:o})}var rt=nt;const ot=ee(rt);var at=w.div({position:"relative",maxWidth:250}),lt=w(Z)({position:"absolute",zIndex:1,top:4,left:4}),st=w.div({width:200,margin:5,".react-colorful__saturation":{borderRadius:"4px 4px 0 0"},".react-colorful__hue":{boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 5%)"},".react-colorful__last-control":{borderRadius:"0 0 4px 4px"}}),ct=w(me)(({theme:e})=>({fontFamily:e.typography.fonts.base})),it=w.div({display:"grid",gridTemplateColumns:"repeat(9, 16px)",gap:6,padding:3,marginTop:5,width:200}),ut=w.div(({theme:e,active:t})=>({width:16,height:16,boxShadow:t?`${e.appBorderColor} 0 0 0 1px inset, ${e.textMutedColor}50 0 0 0 4px`:`${e.appBorderColor} 0 0 0 1px inset`,borderRadius:e.appBorderRadius})),ft=`url('data:image/svg+xml;charset=utf-8,')`,J=({value:e,active:t,onClick:n,style:r,...o})=>{let a=`linear-gradient(${e}, ${e}), ${ft}, linear-gradient(#fff, #fff)`;return f.createElement(ut,{...o,active:t,onClick:n,style:{...r,backgroundImage:a}})},ht=w(pe.Input)(({theme:e})=>({width:"100%",paddingLeft:30,paddingRight:30,boxSizing:"border-box",fontFamily:e.typography.fonts.base})),dt=w(ve)(({theme:e})=>({position:"absolute",zIndex:1,top:6,right:7,width:20,height:20,padding:4,boxSizing:"border-box",cursor:"pointer",color:e.input.color})),de=(e=>(e.RGB="rgb",e.HSL="hsl",e.HEX="hex",e))(de||{}),I=Object.values(de),gt=/\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/,bt=/^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i,mt=/^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i,K=/^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i,pt=/^\s*#?([0-9a-f]{3})\s*$/i,vt={hex:Fe,rgb:Le,hsl:qe},F={hex:"transparent",rgb:"rgba(0, 0, 0, 0)",hsl:"hsla(0, 0%, 0%, 0)"},Q=e=>{let t=e==null?void 0:e.match(gt);if(!t)return[0,0,0,1];let[,n,r,o,a=1]=t;return[n,r,o,a].map(Number)},C=e=>{if(!e)return;let t=!0;if(bt.test(e)){let[l,s,c,u]=Q(e),[d,h,g]=y.rgb.hsl([l,s,c])||[0,0,0];return{valid:t,value:e,keyword:y.rgb.keyword([l,s,c]),colorSpace:"rgb",rgb:e,hsl:`hsla(${d}, ${h}%, ${g}%, ${u})`,hex:`#${y.rgb.hex([l,s,c]).toLowerCase()}`}}if(mt.test(e)){let[l,s,c,u]=Q(e),[d,h,g]=y.hsl.rgb([l,s,c])||[0,0,0];return{valid:t,value:e,keyword:y.hsl.keyword([l,s,c]),colorSpace:"hsl",rgb:`rgba(${d}, ${h}, ${g}, ${u})`,hsl:e,hex:`#${y.hsl.hex([l,s,c]).toLowerCase()}`}}let n=e.replace("#",""),r=y.keyword.rgb(n)||y.hex.rgb(n),o=y.rgb.hsl(r),a=e;if(/[^#a-f0-9]/i.test(e)?a=n:K.test(e)&&(a=`#${n}`),a.startsWith("#"))t=K.test(a);else try{y.keyword.hex(a)}catch{t=!1}return{valid:t,value:a,keyword:y.rgb.keyword(r),colorSpace:"hex",rgb:`rgba(${r[0]}, ${r[1]}, ${r[2]}, 1)`,hsl:`hsla(${o[0]}, ${o[1]}%, ${o[2]}%, 1)`,hex:a}},yt=(e,t,n)=>{if(!e||!(t!=null&&t.valid))return F[n];if(n!=="hex")return(t==null?void 0:t[n])||F[n];if(!t.hex.startsWith("#"))try{return`#${y.keyword.hex(t.hex)}`}catch{return F.hex}let r=t.hex.match(pt);if(!r)return K.test(t.hex)?t.hex:F.hex;let[o,a,l]=r[1].split("");return`#${o}${o}${a}${a}${l}${l}`},xt=(e,t)=>{let[n,r]=b.useState(e||""),[o,a]=b.useState(()=>C(n)),[l,s]=b.useState((o==null?void 0:o.colorSpace)||"hex");b.useEffect(()=>{let h=e||"",g=C(h);r(h),a(g),s((g==null?void 0:g.colorSpace)||"hex")},[e]);let c=b.useMemo(()=>yt(n,o,l).toLowerCase(),[n,o,l]),u=b.useCallback(h=>{let g=C(h),_=(g==null?void 0:g.value)||h||"";r(_),_===""&&(a(void 0),t(void 0)),g&&(a(g),s(g.colorSpace),t(g.value))},[t]),d=b.useCallback(()=>{let h=I.indexOf(l)+1;h>=I.length&&(h=0),s(I[h]);let g=(o==null?void 0:o[I[h]])||"";r(g),t(g)},[o,l,t]);return{value:n,realValue:c,updateValue:u,color:o,colorSpace:l,cycleColorSpace:d}},q=e=>e.replace(/\s*/,"").toLowerCase(),wt=(e,t,n)=>{let[r,o]=b.useState(t!=null&&t.valid?[t]:[]);b.useEffect(()=>{t===void 0&&o([])},[t]);let a=b.useMemo(()=>(e||[]).map(s=>typeof s=="string"?C(s):s.title?{...C(s.color),keyword:s.title}:C(s.color)).concat(r).filter(Boolean).slice(-27),[e,r]),l=b.useCallback(s=>{s!=null&&s.valid&&(a.some(c=>q(c[n])===q(s[n]))||o(c=>c.concat(s)))},[n,a]);return{presets:a,addPreset:l}},kt=({name:e,value:t,onChange:n,onFocus:r,onBlur:o,presetColors:a,startOpen:l=!1})=>{let s=b.useCallback(ot(n,200),[n]),{value:c,realValue:u,updateValue:d,color:h,colorSpace:g,cycleColorSpace:_}=xt(t,s),{presets:j,addPreset:E}=wt(a,h,g),v=vt[g];return f.createElement(at,null,f.createElement(lt,{startOpen:l,closeOnOutsideClick:!0,onVisibleChange:()=>E(h),tooltip:f.createElement(st,null,f.createElement(v,{color:u==="transparent"?"#000000":u,onChange:d,onFocus:r,onBlur:o}),j.length>0&&f.createElement(it,null,j.map((m,x)=>f.createElement(Z,{key:`${m.value}-${x}`,hasChrome:!1,tooltip:f.createElement(ct,{note:m.keyword||m.value})},f.createElement(J,{value:m[g],active:h&&q(m[g])===q(h[g]),onClick:()=>d(m.value)})))))},f.createElement(J,{value:u,style:{margin:4}})),f.createElement(ht,{id:ye(e),value:c,onChange:m=>d(m.target.value),onFocus:m=>m.target.select(),placeholder:"Choose color..."}),c?f.createElement(dt,{icon:"markup",onClick:_}):null)},Lt=kt;export{kt as ColorControl,Lt as default}; diff --git a/docs/storybook/assets/DiscoverySearch.stories-SfYZWCbl.js b/docs/storybook/assets/DiscoverySearch.stories-Tf5oSbDY.js similarity index 99% rename from docs/storybook/assets/DiscoverySearch.stories-SfYZWCbl.js rename to docs/storybook/assets/DiscoverySearch.stories-Tf5oSbDY.js index b4f843554..6def0cef2 100644 --- a/docs/storybook/assets/DiscoverySearch.stories-SfYZWCbl.js +++ b/docs/storybook/assets/DiscoverySearch.stories-Tf5oSbDY.js @@ -1,4 +1,4 @@ -import{j as jsxRuntimeExports}from"./jsx-runtime-FsUICBgo.js";import{c as commonjsGlobal,g as getDefaultExportFromCjs,a as getAugmentedNamespace,r as reactExports}from"./index-RfLt4OUa.js";import{a as streamBrowserify,b as browserExports,B as Buffer$7,r as requireSafeBuffer,p as punycodeExports,q as querystringExports,l as lib$3,h as httpsBrowserifyExports}from"./index-Pr70vtH1.js";import{O as process$1}from"./callBound-4MCeDK1M.js";import{g as require$$2,d as distExports}from"./index-777x7qAF.js";import{i as ieee754,b as buffer}from"./index-zqflMFO-.js";import{u as util$5}from"./assert-1o4ErrXT.js";import{D as DiscoverySearch,b as SearchApi,S as SearchContext}from"./chunk-WFFRPTHA-XxQL4zvM.js";import{D as DummySearchClient}from"./storybookUtils-P7YVKdto.js";import"./events-fK0UhkIE.js";import"./pickBy-llkn_6s3.js";import"./isPlainObject-g73re4jY.js";import"./index-xck8ovCi.js";import"./preview-errors-Ix78kkVy.js";import"./debounce-eWC8LGMf.js";import"./index-4QtD-hFu.js";import"./v4-yQnnJER4.js";var hasOwn=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray$3=function(c){return typeof Array.isArray=="function"?Array.isArray(c):toStr.call(c)==="[object Array]"},isPlainObject$3=function(c){if(!c||toStr.call(c)!=="[object Object]")return!1;var u=hasOwn.call(c,"constructor"),l=c.constructor&&c.constructor.prototype&&hasOwn.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!u&&!l)return!1;var p;for(p in c);return typeof p>"u"||hasOwn.call(c,p)},setProperty=function(c,u){defineProperty&&u.name==="__proto__"?defineProperty(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},getProperty=function(c,u){if(u==="__proto__")if(hasOwn.call(c,u)){if(gOPD)return gOPD(c,u).value}else return;return c[u]},extend$2=function a(){var c,u,l,p,g,v,x=arguments[0],k=1,b=arguments.length,j=!1;for(typeof x=="boolean"&&(j=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});k"u"||hasOwn.call(c,p)},setProperty=function(c,u){defineProperty&&u.name==="__proto__"?defineProperty(c,u.name,{enumerable:!0,configurable:!0,value:u.newValue,writable:!0}):c[u.name]=u.newValue},getProperty=function(c,u){if(u==="__proto__")if(hasOwn.call(c,u)){if(gOPD)return gOPD(c,u).value}else return;return c[u]},extend$2=function a(){var c,u,l,p,g,v,x=arguments[0],k=1,b=arguments.length,j=!1;for(typeof x=="boolean"&&(j=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});k{let n={..._,...r==null?void 0:r.components},s=x;return new Promise((m,i)=>{a(()=>import("./index-4YXVTraW.js"),__vite__mapDeps([0,1]),import.meta.url).then(({MDXProvider:p})=>l(e.createElement(D,{showException:i,key:Math.random()},e.createElement(p,{components:n},e.createElement(s,{context:t,docsParameter:r}))),o)).then(()=>m())})},this.unmount=t=>{u(t)}}};export{L as DocsRenderer,_ as defaultComponents}; +import{_ as a}from"./iframe-mUD1hmuH.js";import{R as e,r as c}from"./index-RfLt4OUa.js";import{r as l,u}from"./react-16-hgR7FrAp.js";import{C as h,A as E,H as d,D as x}from"./index-lt-u4Ncf.js";import"../sb-preview/runtime.js";import"./index-miLrID2P.js";import"./pickBy-llkn_6s3.js";import"./callBound-4MCeDK1M.js";import"./inheritsLoose-O2jMHMzR.js";import"./pickBy-lHA7W3rs.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./index-xck8ovCi.js";import"./index-I0bGnlnk.js";import"./assert-1o4ErrXT.js";var _={code:h,a:E,...d},D=class extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){let{showException:r}=this.props;r(t)}render(){let{hasError:t}=this.state,{children:r}=this.props;return t?null:e.createElement(e.Fragment,null,r)}},L=class{constructor(){this.render=async(t,r,o)=>{let n={..._,...r==null?void 0:r.components},s=x;return new Promise((m,i)=>{a(()=>import("./index-4YXVTraW.js"),__vite__mapDeps([0,1]),import.meta.url).then(({MDXProvider:p})=>l(e.createElement(D,{showException:i,key:Math.random()},e.createElement(p,{components:n},e.createElement(s,{context:t,docsParameter:r}))),o)).then(()=>m())})},this.unmount=t=>{u(t)}}};export{L as DocsRenderer,_ as defaultComponents}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = ["./index-4YXVTraW.js","./index-RfLt4OUa.js"] diff --git a/docs/storybook/assets/DocumentPreview.stories-PobyqiNj.js b/docs/storybook/assets/DocumentPreview.stories-wDP-X5Lu.js similarity index 94% rename from docs/storybook/assets/DocumentPreview.stories-PobyqiNj.js rename to docs/storybook/assets/DocumentPreview.stories-wDP-X5Lu.js index 0d7e3f36d..8fbaa3774 100644 --- a/docs/storybook/assets/DocumentPreview.stories-PobyqiNj.js +++ b/docs/storybook/assets/DocumentPreview.stories-wDP-X5Lu.js @@ -1,13 +1,13 @@ -var Ye=Object.defineProperty;var Ke=(i,e,n)=>e in i?Ye(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n;var ne=(i,e,n)=>(Ke(i,typeof e!="symbol"?e+"":e,n),n);import{j as jsxRuntimeExports}from"./jsx-runtime-FsUICBgo.js";import{e as require_baseEach,a as _baseFlatten,g as require$$2,c as require_createAggregator,i as isEqual,d as distExports}from"./index-777x7qAF.js";import{S as SearchContext,a as action}from"./chunk-WFFRPTHA-XxQL4zvM.js";import{R as React,r as reactExports,g as getDefaultExportFromCjs,c as commonjsGlobal}from"./index-RfLt4OUa.js";import{_ as _objectWithoutProperties$3,I as Icon,a as _extends$3,u as usePrefix,c as classNames,k as setupGetInstanceId,B as Button,s as settings_1,n as ChevronDown24}from"./Button-KibTbxDG.js";import{P as PropTypes}from"./index-4QtD-hFu.js";import{S as SkeletonText}from"./getDocumentTitle-Zh1PemE-.js";import{c as cx}from"./index-tUYgphcS.js";import{T as TextInput,o as omit}from"./omit-VaLeiQib.js";import{c as ChevronUp24}from"./bucket-5-3bTeVNTN.js";import{e as encodeHTML,c as clearNodeChildren,f as findOffsetInDOM,a as createFieldRects,s as spansIntersect,p as processDoc,d as decodeHTML,g as getTextNodeAndOffset,b as forEachRectInRange,i as initAction,T as TooltipHighlight,h as initOverlapMeta,j as calcToolTipContent,k as TooltipEvent,O as OVERLAP_ID,w as withErrorBoundary}from"./withErrorBoundary-LzdLkl6I.js";import{g as get,E as isArrayLike_1,r as require_arrayMap,J as _baseIteratee,x as isArray_1,O as process$1,d as isSymbol_1,B as _baseAssignValue}from"./callBound-4MCeDK1M.js";import{p as purify}from"./purify.es-29Q0w72t.js";import{B as Buffer,l as lib,s as streamHttp,h as httpsBrowserifyExports,u as urlExports,D as Debug}from"./index-Pr70vtH1.js";import{p as commonjsRequire}from"./pickBy-llkn_6s3.js";import{u as uniq}from"./uniq-hAFl8ubt.js";import{p as pickBy}from"./pickBy-lHA7W3rs.js";import"./isPlainObject-g73re4jY.js";import"./index-xck8ovCi.js";import"./preview-errors-Ix78kkVy.js";import"./debounce-eWC8LGMf.js";import"./v4-yQnnJER4.js";import"./bucket-29-VrKNGfP9.js";import"./_baseClone-6sJ_SjB4.js";import"./last-zLtIjBiu.js";import"./_baseSlice-BktYtjHb.js";import"./mergeRefs-uj14wjf3.js";import"./index-miLrID2P.js";import"./wrapFocus-29tK3Ecs.js";import"./_baseUniq-2t0Y7xw1.js";import"./events-fK0UhkIE.js";import"./cloneDeep-eaEuvD8i.js";import"./assert-1o4ErrXT.js";import"./index-zqflMFO-.js";var _path266,_excluded148=["children"],Reset24=React.forwardRef(function(e,n){var t=e.children,a=_objectWithoutProperties$3(e,_excluded148);return React.createElement(Icon,_extends$3({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:n},a),_path266||(_path266=React.createElement("path",{d:"M18,28A12,12,0,1,0,6,16v6.2L2.4,18.6,1,20l6,6,6-6-1.4-1.4L8,22.2V16H8A10,10,0,1,1,18,26Z"})),t)}),_path139,_path140,_path155,_path156,_excluded96=["children"],_excluded104=["children"],ZoomIn24=React.forwardRef(function(e,n){var t=e.children,a=_objectWithoutProperties$3(e,_excluded96);return React.createElement(Icon,_extends$3({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:n},a),_path139||(_path139=React.createElement("path",{d:"M18 12L14 12 14 8 12 8 12 12 8 12 8 14 12 14 12 18 14 18 14 14 18 14 18 12z"})),_path140||(_path140=React.createElement("path",{d:"M21.4479,20A10.856,10.856,0,0,0,24,13,11,11,0,1,0,13,24a10.856,10.856,0,0,0,7-2.5521L27.5859,29,29,27.5859ZM13,22a9,9,0,1,1,9-9A9.01,9.01,0,0,1,13,22Z"})),t)}),ZoomOut24=React.forwardRef(function(e,n){var t=e.children,a=_objectWithoutProperties$3(e,_excluded104);return React.createElement(Icon,_extends$3({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:n},a),_path155||(_path155=React.createElement("path",{d:"M8 12H18V14H8z"})),_path156||(_path156=React.createElement("path",{d:"M21.4479,20A10.856,10.856,0,0,0,24,13,11,11,0,1,0,13,24a10.856,10.856,0,0,0,7-2.5521L27.5859,29,29,27.5859ZM13,22a9,9,0,1,1,9-9A9.01,9.01,0,0,1,13,22Z"})),t)}),_excluded$2=["id","active","className","withOverlay","small","description"];function _extends$2(){return _extends$2=Object.assign||function(i){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(i,t)&&(n[t]=i[t])}return n}function _objectWithoutPropertiesLoose$2(i,e){if(i==null)return{};var n={},t=Object.keys(i),a,r;for(r=0;r=0)&&(n[a]=i[a]);return n}var getInstanceId=setupGetInstanceId();function Loading(i){var e,n,t=i.id,a=i.active,r=i.className,s=i.withOverlay,u=i.small,l=i.description,y=_objectWithoutProperties$2(i,_excluded$2),c=usePrefix(),M=reactExports.useRef(getInstanceId()),I=M.current,m=classNames(r,(e={},_defineProperty(e,"".concat(c,"--loading"),!0),_defineProperty(e,"".concat(c,"--loading--small"),u),_defineProperty(e,"".concat(c,"--loading--stop"),!a),e)),g=classNames((n={},_defineProperty(n,"".concat(c,"--loading-overlay"),!0),_defineProperty(n,"".concat(c,"--loading-overlay--stop"),!a),n)),f=t||"loading-id-".concat(I),C=React.createElement("div",_extends$2({},y,{"aria-atomic":"true","aria-labelledby":f,"aria-live":a?"assertive":"off",className:m}),React.createElement("label",{id:f,className:"".concat(c,"--visually-hidden")},l),React.createElement("svg",{className:"".concat(c,"--loading__svg"),viewBox:"0 0 100 100"},React.createElement("title",null,l),u?React.createElement("circle",{className:"".concat(c,"--loading__background"),cx:"50%",cy:"50%",r:"44"}):null,React.createElement("circle",{className:"".concat(c,"--loading__stroke"),cx:"50%",cy:"50%",r:"44"})));return s?React.createElement("div",{className:g},C):C}Loading.propTypes={active:PropTypes.bool,className:PropTypes.string,description:PropTypes.string,id:PropTypes.string,small:PropTypes.bool,withOverlay:PropTypes.bool};Loading.defaultProps={active:!0,withOverlay:!0,small:!1,description:"Active loading indicator"};var _excluded$1=["className","children"];function _extends$1(){return _extends$1=Object.assign||function(i){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(i,t)&&(n[t]=i[t])}return n}function _objectWithoutPropertiesLoose$1(i,e){if(i==null)return{};var n={},t=Object.keys(i),a,r;for(r=0;r=0)&&(n[a]=i[a]);return n}var Form=function(e){var n=e.className,t=e.children,a=_objectWithoutProperties$1(e,_excluded$1),r=usePrefix(),s=classNames("".concat(r,"--form"),n);return React.createElement("form",_extends$1({className:s},a)," ",t," ")};Form.propTypes={children:PropTypes.node,className:PropTypes.string};const Form$1=Form;var _excluded=["className","children","id"];function _extends(){return _extends=Object.assign||function(i){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(i,t)&&(n[t]=i[t])}return n}function _objectWithoutPropertiesLoose(i,e){if(i==null)return{};var n={},t=Object.keys(i),a,r;for(r=0;r=0)&&(n[a]=i[a]);return n}var FormLabel=function(e){var n=e.className,t=e.children,a=e.id,r=_objectWithoutProperties(e,_excluded),s=usePrefix(),u=classNames("".concat(s,"--label"),n);return React.createElement("label",_extends({htmlFor:a,className:u},r),t)};FormLabel.propTypes={children:PropTypes.node,className:PropTypes.string,id:PropTypes.string};const FormLabel$1=FormLabel,defaultMessages={noDataMessage:"No document data",errorMessage:"Error previewing document",formatTotalPages:i=>i===1?`${i} page`:`${i} pages`,previousPageLabel:"Previous page",nextPageLabel:"Next page",zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",resetZoomLabel:"Reset zoom"},ZOOM_IN$1="zoom-in",ZOOM_OUT$1="zoom-out",ZOOM_RESET="reset-zoom",base$1=`${settings_1.prefix}--preview-toolbar`,PreviewToolbar=({loading:i=!1,hideControls:e=!1,userActions:n=[],current:t,total:a,onZoom:r,onChange:s,messages:u})=>{const l=reactExports.useRef(null);reactExports.useEffect(()=>{l.current!=null&&(l.current.value=t.toString())},[t]);const y={...defaultMessages,...u};return jsxRuntimeExports.jsxs("div",{className:cx(base$1,{[`${base$1}__hidden`]:e&&n.length===0}),children:[jsxRuntimeExports.jsx("div",{className:`${base$1}__left`,children:!e&&jsxRuntimeExports.jsxs("div",{className:`${base$1}__nav`,children:[renderButton({renderIcon:ChevronUp24,iconDescription:y.previousPageLabel,onClick:()=>nextPrevButtonClicked(t,a,s,-1),disabled:i||t===1}),renderButton({renderIcon:ChevronDown24,iconDescription:y.nextPageLabel,onClick:()=>nextPrevButtonClicked(t,a,s,1),disabled:i||t===a}),jsxRuntimeExports.jsx(Form$1,{onSubmit:c=>currentPageChanged(c,s,l),autoComplete:"off",children:jsxRuntimeExports.jsx(TextInput,{id:"pageInput",defaultValue:t,type:"number",ref:l,min:1,max:a,className:`${base$1}__input`,onBlur:c=>currentPageChanged(c,s,l),labelText:"labelText",hideLabel:!0,disabled:i})}),jsxRuntimeExports.jsxs(FormLabel$1,{className:`${base$1}__pageLabel`,children:["/ ",y.formatTotalPages(a)]})]})}),jsxRuntimeExports.jsx("div",{className:`${base$1}__center ${base$1}__nav`}),jsxRuntimeExports.jsxs("div",{className:`${base$1}__right`,children:[!e&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[renderButton({renderIcon:ZoomIn24,iconDescription:y.zoomInLabel,onClick:()=>r(ZOOM_IN$1),disabled:i}),renderButton({renderIcon:ZoomOut24,iconDescription:y.zoomOutLabel,onClick:()=>r(ZOOM_OUT$1),disabled:i}),renderButton({renderIcon:Reset24,iconDescription:y.resetZoomLabel,onClick:()=>r(ZOOM_RESET),disabled:i})]}),n.map((c,M)=>renderUserAction({...c,key:`toolbar-action-${c.id||M}`}))]})]})};function renderUserAction(i){if(i!=null&&i.renderIcon)return renderButton(i);if(i!=null&&i.render){const{key:e,...n}=i,t=n.render;return jsxRuntimeExports.jsx(t,{},i.key)}return null}function renderButton(i){const{key:e,className:n,...t}=i;return jsxRuntimeExports.jsx(Button,{"data-testid":e,className:cx(`${base$1}__button`,n),size:"small",kind:"ghost",tooltipPosition:"bottom",tooltipAlignment:"center",hasIconOnly:!0,...t},e)}function nextPrevButtonClicked(i,e,n,t){const a=i+t;a>=1&&a<=e&&n(a)}function currentPageChanged(i,e,n){i.preventDefault();const t=Number(n.current.value);e(t)}const PrevToolbar=PreviewToolbar;PrevToolbar.ZOOM_IN=ZOOM_IN$1;PrevToolbar.ZOOM_OUT=ZOOM_OUT$1;PrevToolbar.ZOOM_RESET=ZOOM_RESET;function isPassage(i){return i&&"passage_text"in i}function isTable(i){var e;return!!((e=i==null?void 0:i.table)!=null&&e.location)}function getTextMappings(i){let e=get(i,"extracted_metadata.text_mappings");if(e&&typeof e=="string")try{e=JSON.parse(e)}catch(n){console.error("Failure parsing text_mappings",n),e=null}else e=null;return e}function isCsvFile(i){return get(i,"extracted_metadata.file_type")==="csv"}function isJsonFile(i){return get(i,"extracted_metadata.file_type")==="json"}function detectPreviewType(i,e,n,t){var M,I;const a=(M=i.extracted_metadata)==null?void 0:M.file_type,r=!!((I=i.extracted_metadata)!=null&&I.text_mappings),s=!!n,u=isPassage(n),l=isTable(n);if(a==="pdf"&&e&&!t&&(!s||r))return"PDF";const y=isJsonFile(i),c=isCsvFile(i);return i.html&&!y&&!c&&(!s||u&&r||l)?"HTML":"TEXT"}const SvgDocumentPreview=i=>reactExports.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",width:"1em",height:"1em",...i},reactExports.createElement("title",null,"document preview"),reactExports.createElement("g",{id:"analyze"},reactExports.createElement("g",{id:"analyze-2","data-name":"analyze"},reactExports.createElement("path",{d:"M24,46.86H9a.33.33,0,0,1-.25-.11l-7.5-7.5A.33.33,0,0,1,1.14,39V16.5a.36.36,0,0,1,.36-.36H8.64a15.36,15.36,0,1,1,26.47,11L46.75,38.75l-.5.5L34.6,27.61a15.24,15.24,0,0,1-10.24,4.25V46.5A.36.36,0,0,1,24,46.86ZM9.36,46.14H23.64V31.86a15.39,15.39,0,0,1-15-15H1.86V38.64H9a.36.36,0,0,1,.36.36Zm-7-6.78,6.27,6.27V39.36ZM24,1.86A14.64,14.64,0,1,0,38.64,16.5,14.66,14.66,0,0,0,24,1.86Z"}))),reactExports.createElement("path",{d:"M19.73,19.37a.76.76,0,0,1-.61-.22,1,1,0,0,1-.24-.55h-.05a1.31,1.31,0,0,1-.49.64,1.56,1.56,0,0,1-.91.23,1.69,1.69,0,0,1-1.15-.37,1.31,1.31,0,0,1-.42-1,1.2,1.2,0,0,1,.48-1,2.7,2.7,0,0,1,1.53-.35h.95v-.41a1,1,0,0,0-.27-.74,1.1,1.1,0,0,0-.79-.25,1.54,1.54,0,0,0-.75.17,1.38,1.38,0,0,0-.47.49L16,15.54a1.52,1.52,0,0,1,.25-.35,1.65,1.65,0,0,1,.39-.29,1.89,1.89,0,0,1,.52-.21,2.71,2.71,0,0,1,.66-.08,2,2,0,0,1,1.33.42,1.48,1.48,0,0,1,.49,1.19v2.45h.62v.7Zm-2.1-.55a1.4,1.4,0,0,0,.85-.24.67.67,0,0,0,.34-.58v-.72h-.94a1.69,1.69,0,0,0-.88.17.53.53,0,0,0-.28.49v.19a.61.61,0,0,0,.24.52A1.18,1.18,0,0,0,17.63,18.82Z"}),reactExports.createElement("path",{d:"M22.11,12.71H23V15.5h0a1.6,1.6,0,0,1,.56-.66,1.55,1.55,0,0,1,.86-.23,1.57,1.57,0,0,1,1.32.63,2.92,2.92,0,0,1,.49,1.8,2.92,2.92,0,0,1-.49,1.8,1.57,1.57,0,0,1-1.32.63,1.55,1.55,0,0,1-.86-.22,1.6,1.6,0,0,1-.56-.66h0v.78h-.84Zm2,6.05A1.2,1.2,0,0,0,25,18.4a1.44,1.44,0,0,0,.32-1v-.77a1.42,1.42,0,0,0-.32-1,1.2,1.2,0,0,0-.93-.37,1.42,1.42,0,0,0-.42.06,1,1,0,0,0-.36.18.83.83,0,0,0-.25.28.8.8,0,0,0-.09.39v1.62a.84.84,0,0,0,.09.4.75.75,0,0,0,.25.28.86.86,0,0,0,.36.17A1.42,1.42,0,0,0,24.07,18.76Z"}),reactExports.createElement("path",{d:"M30.22,19.47a2.17,2.17,0,0,1-.91-.17,1.75,1.75,0,0,1-.68-.49,2.33,2.33,0,0,1-.42-.76,3.44,3.44,0,0,1,0-2,2.23,2.23,0,0,1,.42-.76,1.88,1.88,0,0,1,.68-.5,2.33,2.33,0,0,1,.9-.17A1.76,1.76,0,0,1,32,15.7l-.66.36a1.1,1.1,0,0,0-.4-.54,1.33,1.33,0,0,0-1.63.18,1.36,1.36,0,0,0-.33.95v.79a1.37,1.37,0,0,0,.33.95,1.2,1.2,0,0,0,.95.37,1.22,1.22,0,0,0,.74-.21,1.57,1.57,0,0,0,.47-.57l.6.4a1.84,1.84,0,0,1-.66.78A2,2,0,0,1,30.22,19.47Z"})),ErrorState=({header:i,message:e})=>{const n=`${settings_1.prefix}--simple-document__error-view`;return jsxRuntimeExports.jsxs("div",{className:n,"data-testid":"error_state",children:[jsxRuntimeExports.jsx("div",{className:`${n}__icon`,children:jsxRuntimeExports.jsx(SvgDocumentPreview,{})}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{className:`${n}__header`,children:i}),jsxRuntimeExports.jsx("div",{className:`${n}__message`,children:e})]})]})};try{ErrorView.displayName="ErrorView",ErrorView.__docgenInfo={description:"",displayName:"ErrorView",props:{header:{defaultValue:null,description:"",name:"header",required:!0,type:{name:"ReactNode"}},message:{defaultValue:null,description:"",name:"message",required:!0,type:{name:"ReactNode"}}}}}catch{}const SimpleDocument=reactExports.forwardRef(({document:i,highlight:e,loading:n,setLoading:t,hideToolbarControls:a,setHideToolbarControls:r,fallbackComponent:s,cannotPreviewMessage:u="Can't preview document",cannotPreviewMessage2:l="Try the JSON tab for a different view of this document's data.",...y},c)=>{var v,b,h,o;const M=reactExports.useRef(null),I=reactExports.useRef(null),{componentSettings:m}=reactExports.useContext(SearchContext);let g,f=null;if(i){const d=isJsonFile(i)||isCsvFile(i);let p=((b=(v=m==null?void 0:m.fields_shown)==null?void 0:v.body)==null?void 0:b.field)??"text";if(d&&(!e||!isPassage(e))&&i[p]===void 0)g=null;else{e&&isPassage(e)?(f=e,p=f.field,p||(p="text",e=void 0)):p=((o=(h=m==null?void 0:m.fields_shown)==null?void 0:h.body)==null?void 0:o.field)||"text";let w;typeof i[p]>"u"?(w=i.text||"",f=null):w=i[p],Array.isArray(w)||(w=[w]);let x=0;g=w.map(D=>{const T=x+D.length-1,P=`

${encodeHTML(D)}

`;return x=T+1,P}).join(` +var Ye=Object.defineProperty;var Ke=(i,e,n)=>e in i?Ye(i,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[e]=n;var ne=(i,e,n)=>(Ke(i,typeof e!="symbol"?e+"":e,n),n);import{j as jsxRuntimeExports}from"./jsx-runtime-FsUICBgo.js";import{e as require_baseEach,a as _baseFlatten,g as require$$2,c as require_createAggregator,i as isEqual,d as distExports}from"./index-777x7qAF.js";import{S as SearchContext,a as action}from"./chunk-WFFRPTHA-XxQL4zvM.js";import{R as React,r as reactExports,g as getDefaultExportFromCjs,c as commonjsGlobal}from"./index-RfLt4OUa.js";import{_ as _objectWithoutProperties$3,I as Icon,a as _extends$3,u as usePrefix,c as classNames,k as setupGetInstanceId,B as Button,s as settings_1,n as ChevronDown24}from"./Button-KibTbxDG.js";import{P as PropTypes}from"./index-4QtD-hFu.js";import{S as SkeletonText}from"./getDocumentTitle-51WyFHkN.js";import{c as cx}from"./index-tUYgphcS.js";import{T as TextInput,o as omit}from"./omit-VaLeiQib.js";import{c as ChevronUp24}from"./bucket-5-3bTeVNTN.js";import{e as encodeHTML,c as clearNodeChildren,f as findOffsetInDOM,a as createFieldRects,s as spansIntersect,p as processDoc,d as decodeHTML,g as getTextNodeAndOffset,b as forEachRectInRange,i as initAction,T as TooltipHighlight,h as initOverlapMeta,j as calcToolTipContent,k as TooltipEvent,O as OVERLAP_ID,w as withErrorBoundary}from"./withErrorBoundary-Y3jy2SmJ.js";import{g as get,E as isArrayLike_1,r as require_arrayMap,J as _baseIteratee,x as isArray_1,O as process$1,d as isSymbol_1,B as _baseAssignValue}from"./callBound-4MCeDK1M.js";import{p as purify}from"./purify.es-29Q0w72t.js";import{r as requireStreamHttp,B as Buffer,l as lib,h as httpsBrowserifyExports,u as urlExports,D as Debug}from"./index-BxZ9LZUr.js";import{p as commonjsRequire}from"./pickBy-llkn_6s3.js";import{u as uniq}from"./uniq-hAFl8ubt.js";import{p as pickBy}from"./pickBy-lHA7W3rs.js";import"./isPlainObject-g73re4jY.js";import"./index-xck8ovCi.js";import"./preview-errors-Ix78kkVy.js";import"./debounce-eWC8LGMf.js";import"./v4-yQnnJER4.js";import"./bucket-29-VrKNGfP9.js";import"./_baseClone-6sJ_SjB4.js";import"./last-zLtIjBiu.js";import"./_baseSlice-BktYtjHb.js";import"./mergeRefs-uj14wjf3.js";import"./index-miLrID2P.js";import"./wrapFocus-29tK3Ecs.js";import"./_baseUniq-2t0Y7xw1.js";import"./events-fK0UhkIE.js";import"./cloneDeep-eaEuvD8i.js";import"./assert-1o4ErrXT.js";import"./index-zqflMFO-.js";var _path266,_excluded148=["children"],Reset24=React.forwardRef(function(e,n){var t=e.children,a=_objectWithoutProperties$3(e,_excluded148);return React.createElement(Icon,_extends$3({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:n},a),_path266||(_path266=React.createElement("path",{d:"M18,28A12,12,0,1,0,6,16v6.2L2.4,18.6,1,20l6,6,6-6-1.4-1.4L8,22.2V16H8A10,10,0,1,1,18,26Z"})),t)}),_path139,_path140,_path155,_path156,_excluded96=["children"],_excluded104=["children"],ZoomIn24=React.forwardRef(function(e,n){var t=e.children,a=_objectWithoutProperties$3(e,_excluded96);return React.createElement(Icon,_extends$3({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:n},a),_path139||(_path139=React.createElement("path",{d:"M18 12L14 12 14 8 12 8 12 12 8 12 8 14 12 14 12 18 14 18 14 14 18 14 18 12z"})),_path140||(_path140=React.createElement("path",{d:"M21.4479,20A10.856,10.856,0,0,0,24,13,11,11,0,1,0,13,24a10.856,10.856,0,0,0,7-2.5521L27.5859,29,29,27.5859ZM13,22a9,9,0,1,1,9-9A9.01,9.01,0,0,1,13,22Z"})),t)}),ZoomOut24=React.forwardRef(function(e,n){var t=e.children,a=_objectWithoutProperties$3(e,_excluded104);return React.createElement(Icon,_extends$3({width:24,height:24,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:n},a),_path155||(_path155=React.createElement("path",{d:"M8 12H18V14H8z"})),_path156||(_path156=React.createElement("path",{d:"M21.4479,20A10.856,10.856,0,0,0,24,13,11,11,0,1,0,13,24a10.856,10.856,0,0,0,7-2.5521L27.5859,29,29,27.5859ZM13,22a9,9,0,1,1,9-9A9.01,9.01,0,0,1,13,22Z"})),t)}),_excluded$2=["id","active","className","withOverlay","small","description"];function _extends$2(){return _extends$2=Object.assign||function(i){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(i,t)&&(n[t]=i[t])}return n}function _objectWithoutPropertiesLoose$2(i,e){if(i==null)return{};var n={},t=Object.keys(i),a,r;for(r=0;r=0)&&(n[a]=i[a]);return n}var getInstanceId=setupGetInstanceId();function Loading(i){var e,n,t=i.id,a=i.active,r=i.className,s=i.withOverlay,u=i.small,l=i.description,y=_objectWithoutProperties$2(i,_excluded$2),c=usePrefix(),M=reactExports.useRef(getInstanceId()),I=M.current,m=classNames(r,(e={},_defineProperty(e,"".concat(c,"--loading"),!0),_defineProperty(e,"".concat(c,"--loading--small"),u),_defineProperty(e,"".concat(c,"--loading--stop"),!a),e)),g=classNames((n={},_defineProperty(n,"".concat(c,"--loading-overlay"),!0),_defineProperty(n,"".concat(c,"--loading-overlay--stop"),!a),n)),f=t||"loading-id-".concat(I),C=React.createElement("div",_extends$2({},y,{"aria-atomic":"true","aria-labelledby":f,"aria-live":a?"assertive":"off",className:m}),React.createElement("label",{id:f,className:"".concat(c,"--visually-hidden")},l),React.createElement("svg",{className:"".concat(c,"--loading__svg"),viewBox:"0 0 100 100"},React.createElement("title",null,l),u?React.createElement("circle",{className:"".concat(c,"--loading__background"),cx:"50%",cy:"50%",r:"44"}):null,React.createElement("circle",{className:"".concat(c,"--loading__stroke"),cx:"50%",cy:"50%",r:"44"})));return s?React.createElement("div",{className:g},C):C}Loading.propTypes={active:PropTypes.bool,className:PropTypes.string,description:PropTypes.string,id:PropTypes.string,small:PropTypes.bool,withOverlay:PropTypes.bool};Loading.defaultProps={active:!0,withOverlay:!0,small:!1,description:"Active loading indicator"};var _excluded$1=["className","children"];function _extends$1(){return _extends$1=Object.assign||function(i){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(i,t)&&(n[t]=i[t])}return n}function _objectWithoutPropertiesLoose$1(i,e){if(i==null)return{};var n={},t=Object.keys(i),a,r;for(r=0;r=0)&&(n[a]=i[a]);return n}var Form=function(e){var n=e.className,t=e.children,a=_objectWithoutProperties$1(e,_excluded$1),r=usePrefix(),s=classNames("".concat(r,"--form"),n);return React.createElement("form",_extends$1({className:s},a)," ",t," ")};Form.propTypes={children:PropTypes.node,className:PropTypes.string};const Form$1=Form;var _excluded=["className","children","id"];function _extends(){return _extends=Object.assign||function(i){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(i,t)&&(n[t]=i[t])}return n}function _objectWithoutPropertiesLoose(i,e){if(i==null)return{};var n={},t=Object.keys(i),a,r;for(r=0;r=0)&&(n[a]=i[a]);return n}var FormLabel=function(e){var n=e.className,t=e.children,a=e.id,r=_objectWithoutProperties(e,_excluded),s=usePrefix(),u=classNames("".concat(s,"--label"),n);return React.createElement("label",_extends({htmlFor:a,className:u},r),t)};FormLabel.propTypes={children:PropTypes.node,className:PropTypes.string,id:PropTypes.string};const FormLabel$1=FormLabel,defaultMessages={noDataMessage:"No document data",errorMessage:"Error previewing document",formatTotalPages:i=>i===1?`${i} page`:`${i} pages`,previousPageLabel:"Previous page",nextPageLabel:"Next page",zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",resetZoomLabel:"Reset zoom"},ZOOM_IN$1="zoom-in",ZOOM_OUT$1="zoom-out",ZOOM_RESET="reset-zoom",base$1=`${settings_1.prefix}--preview-toolbar`,PreviewToolbar=({loading:i=!1,hideControls:e=!1,userActions:n=[],current:t,total:a,onZoom:r,onChange:s,messages:u})=>{const l=reactExports.useRef(null);reactExports.useEffect(()=>{l.current!=null&&(l.current.value=t.toString())},[t]);const y={...defaultMessages,...u};return jsxRuntimeExports.jsxs("div",{className:cx(base$1,{[`${base$1}__hidden`]:e&&n.length===0}),children:[jsxRuntimeExports.jsx("div",{className:`${base$1}__left`,children:!e&&jsxRuntimeExports.jsxs("div",{className:`${base$1}__nav`,children:[renderButton({renderIcon:ChevronUp24,iconDescription:y.previousPageLabel,onClick:()=>nextPrevButtonClicked(t,a,s,-1),disabled:i||t===1}),renderButton({renderIcon:ChevronDown24,iconDescription:y.nextPageLabel,onClick:()=>nextPrevButtonClicked(t,a,s,1),disabled:i||t===a}),jsxRuntimeExports.jsx(Form$1,{onSubmit:c=>currentPageChanged(c,s,l),autoComplete:"off",children:jsxRuntimeExports.jsx(TextInput,{id:"pageInput",defaultValue:t,type:"number",ref:l,min:1,max:a,className:`${base$1}__input`,onBlur:c=>currentPageChanged(c,s,l),labelText:"labelText",hideLabel:!0,disabled:i})}),jsxRuntimeExports.jsxs(FormLabel$1,{className:`${base$1}__pageLabel`,children:["/ ",y.formatTotalPages(a)]})]})}),jsxRuntimeExports.jsx("div",{className:`${base$1}__center ${base$1}__nav`}),jsxRuntimeExports.jsxs("div",{className:`${base$1}__right`,children:[!e&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[renderButton({renderIcon:ZoomIn24,iconDescription:y.zoomInLabel,onClick:()=>r(ZOOM_IN$1),disabled:i}),renderButton({renderIcon:ZoomOut24,iconDescription:y.zoomOutLabel,onClick:()=>r(ZOOM_OUT$1),disabled:i}),renderButton({renderIcon:Reset24,iconDescription:y.resetZoomLabel,onClick:()=>r(ZOOM_RESET),disabled:i})]}),n.map((c,M)=>renderUserAction({...c,key:`toolbar-action-${c.id||M}`}))]})]})};function renderUserAction(i){if(i!=null&&i.renderIcon)return renderButton(i);if(i!=null&&i.render){const{key:e,...n}=i,t=n.render;return jsxRuntimeExports.jsx(t,{},i.key)}return null}function renderButton(i){const{key:e,className:n,...t}=i;return jsxRuntimeExports.jsx(Button,{"data-testid":e,className:cx(`${base$1}__button`,n),size:"small",kind:"ghost",tooltipPosition:"bottom",tooltipAlignment:"center",hasIconOnly:!0,...t},e)}function nextPrevButtonClicked(i,e,n,t){const a=i+t;a>=1&&a<=e&&n(a)}function currentPageChanged(i,e,n){i.preventDefault();const t=Number(n.current.value);e(t)}const PrevToolbar=PreviewToolbar;PrevToolbar.ZOOM_IN=ZOOM_IN$1;PrevToolbar.ZOOM_OUT=ZOOM_OUT$1;PrevToolbar.ZOOM_RESET=ZOOM_RESET;function isPassage(i){return i&&"passage_text"in i}function isTable(i){var e;return!!((e=i==null?void 0:i.table)!=null&&e.location)}function getTextMappings(i){let e=get(i,"extracted_metadata.text_mappings");if(e&&typeof e=="string")try{e=JSON.parse(e)}catch(n){console.error("Failure parsing text_mappings",n),e=null}else e=null;return e}function isCsvFile(i){return get(i,"extracted_metadata.file_type")==="csv"}function isJsonFile(i){return get(i,"extracted_metadata.file_type")==="json"}function detectPreviewType(i,e,n,t){var M,I;const a=(M=i.extracted_metadata)==null?void 0:M.file_type,r=!!((I=i.extracted_metadata)!=null&&I.text_mappings),s=!!n,u=isPassage(n),l=isTable(n);if(a==="pdf"&&e&&!t&&(!s||r))return"PDF";const y=isJsonFile(i),c=isCsvFile(i);return i.html&&!y&&!c&&(!s||u&&r||l)?"HTML":"TEXT"}const SvgDocumentPreview=i=>reactExports.createElement("svg",{id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",width:"1em",height:"1em",...i},reactExports.createElement("title",null,"document preview"),reactExports.createElement("g",{id:"analyze"},reactExports.createElement("g",{id:"analyze-2","data-name":"analyze"},reactExports.createElement("path",{d:"M24,46.86H9a.33.33,0,0,1-.25-.11l-7.5-7.5A.33.33,0,0,1,1.14,39V16.5a.36.36,0,0,1,.36-.36H8.64a15.36,15.36,0,1,1,26.47,11L46.75,38.75l-.5.5L34.6,27.61a15.24,15.24,0,0,1-10.24,4.25V46.5A.36.36,0,0,1,24,46.86ZM9.36,46.14H23.64V31.86a15.39,15.39,0,0,1-15-15H1.86V38.64H9a.36.36,0,0,1,.36.36Zm-7-6.78,6.27,6.27V39.36ZM24,1.86A14.64,14.64,0,1,0,38.64,16.5,14.66,14.66,0,0,0,24,1.86Z"}))),reactExports.createElement("path",{d:"M19.73,19.37a.76.76,0,0,1-.61-.22,1,1,0,0,1-.24-.55h-.05a1.31,1.31,0,0,1-.49.64,1.56,1.56,0,0,1-.91.23,1.69,1.69,0,0,1-1.15-.37,1.31,1.31,0,0,1-.42-1,1.2,1.2,0,0,1,.48-1,2.7,2.7,0,0,1,1.53-.35h.95v-.41a1,1,0,0,0-.27-.74,1.1,1.1,0,0,0-.79-.25,1.54,1.54,0,0,0-.75.17,1.38,1.38,0,0,0-.47.49L16,15.54a1.52,1.52,0,0,1,.25-.35,1.65,1.65,0,0,1,.39-.29,1.89,1.89,0,0,1,.52-.21,2.71,2.71,0,0,1,.66-.08,2,2,0,0,1,1.33.42,1.48,1.48,0,0,1,.49,1.19v2.45h.62v.7Zm-2.1-.55a1.4,1.4,0,0,0,.85-.24.67.67,0,0,0,.34-.58v-.72h-.94a1.69,1.69,0,0,0-.88.17.53.53,0,0,0-.28.49v.19a.61.61,0,0,0,.24.52A1.18,1.18,0,0,0,17.63,18.82Z"}),reactExports.createElement("path",{d:"M22.11,12.71H23V15.5h0a1.6,1.6,0,0,1,.56-.66,1.55,1.55,0,0,1,.86-.23,1.57,1.57,0,0,1,1.32.63,2.92,2.92,0,0,1,.49,1.8,2.92,2.92,0,0,1-.49,1.8,1.57,1.57,0,0,1-1.32.63,1.55,1.55,0,0,1-.86-.22,1.6,1.6,0,0,1-.56-.66h0v.78h-.84Zm2,6.05A1.2,1.2,0,0,0,25,18.4a1.44,1.44,0,0,0,.32-1v-.77a1.42,1.42,0,0,0-.32-1,1.2,1.2,0,0,0-.93-.37,1.42,1.42,0,0,0-.42.06,1,1,0,0,0-.36.18.83.83,0,0,0-.25.28.8.8,0,0,0-.09.39v1.62a.84.84,0,0,0,.09.4.75.75,0,0,0,.25.28.86.86,0,0,0,.36.17A1.42,1.42,0,0,0,24.07,18.76Z"}),reactExports.createElement("path",{d:"M30.22,19.47a2.17,2.17,0,0,1-.91-.17,1.75,1.75,0,0,1-.68-.49,2.33,2.33,0,0,1-.42-.76,3.44,3.44,0,0,1,0-2,2.23,2.23,0,0,1,.42-.76,1.88,1.88,0,0,1,.68-.5,2.33,2.33,0,0,1,.9-.17A1.76,1.76,0,0,1,32,15.7l-.66.36a1.1,1.1,0,0,0-.4-.54,1.33,1.33,0,0,0-1.63.18,1.36,1.36,0,0,0-.33.95v.79a1.37,1.37,0,0,0,.33.95,1.2,1.2,0,0,0,.95.37,1.22,1.22,0,0,0,.74-.21,1.57,1.57,0,0,0,.47-.57l.6.4a1.84,1.84,0,0,1-.66.78A2,2,0,0,1,30.22,19.47Z"})),ErrorState=({header:i,message:e})=>{const n=`${settings_1.prefix}--simple-document__error-view`;return jsxRuntimeExports.jsxs("div",{className:n,"data-testid":"error_state",children:[jsxRuntimeExports.jsx("div",{className:`${n}__icon`,children:jsxRuntimeExports.jsx(SvgDocumentPreview,{})}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{className:`${n}__header`,children:i}),jsxRuntimeExports.jsx("div",{className:`${n}__message`,children:e})]})]})};try{ErrorView.displayName="ErrorView",ErrorView.__docgenInfo={description:"",displayName:"ErrorView",props:{header:{defaultValue:null,description:"",name:"header",required:!0,type:{name:"ReactNode"}},message:{defaultValue:null,description:"",name:"message",required:!0,type:{name:"ReactNode"}}}}}catch{}const SimpleDocument=reactExports.forwardRef(({document:i,highlight:e,loading:n,setLoading:t,hideToolbarControls:a,setHideToolbarControls:r,fallbackComponent:s,cannotPreviewMessage:u="Can't preview document",cannotPreviewMessage2:l="Try the JSON tab for a different view of this document's data.",...y},c)=>{var v,b,h,o;const M=reactExports.useRef(null),I=reactExports.useRef(null),{componentSettings:m}=reactExports.useContext(SearchContext);let g,f=null;if(i){const d=isJsonFile(i)||isCsvFile(i);let p=((b=(v=m==null?void 0:m.fields_shown)==null?void 0:v.body)==null?void 0:b.field)??"text";if(d&&(!e||!isPassage(e))&&i[p]===void 0)g=null;else{e&&isPassage(e)?(f=e,p=f.field,p||(p="text",e=void 0)):p=((o=(h=m==null?void 0:m.fields_shown)==null?void 0:h.body)==null?void 0:o.field)||"text";let w;typeof i[p]>"u"?(w=i.text||"",f=null):w=i[p],Array.isArray(w)||(w=[w]);let x=0;g=w.map(D=>{const T=x+D.length-1,P=`

${encodeHTML(D)}

`;return x=T+1,P}).join(` `)}}reactExports.useEffect(()=>{i&&(n&&t(!1),typeof r=="function"&&!a&&r(!0))},[i,a,n,r,t]),reactExports.useEffect(()=>{const d=M.current,p=I.current;if(p&&clearNodeChildren(p),!f||!d||!p)return;const{start_offset:w,end_offset:x}=f;if(!(typeof w>"u"||typeof x>"u"))try{const D=findOffsetInDOM(d,w,x),T=window.document.createDocumentFragment(),P=d.getBoundingClientRect();createFieldRects({fragment:T,parentRect:P,fieldType:"passage",fieldValue:"",fieldId:w.toString(),...D}),p.appendChild(T);const E=p.querySelector(".field--rect");E&&E.scrollIntoView({block:"center"})}catch(D){console.error("Error creating field rects",D)}},[f]);const C=`${settings_1.prefix}--simple-document`;return jsxRuntimeExports.jsx("div",{ref:c,className:C,...y,children:g?jsxRuntimeExports.jsxs("div",{className:`${C}__wrapper`,children:[jsxRuntimeExports.jsx("div",{ref:I}),jsxRuntimeExports.jsx("div",{className:`${C}__content`,dangerouslySetInnerHTML:{__html:g},ref:M})]}):s?jsxRuntimeExports.jsx(s,{document:i}):jsxRuntimeExports.jsx(ErrorState,{header:u,message:l})})});try{SimpleDocument.displayName="SimpleDocument",SimpleDocument.__docgenInfo={description:"",displayName:"SimpleDocument",props:{document:{defaultValue:null,description:"Document data returned by query",name:"document",required:!0,type:{name:"QueryResult"}},highlight:{defaultValue:null,description:"",name:"highlight",required:!1,type:{name:"QueryTableResult | QueryResultPassage"}},setLoading:{defaultValue:null,description:"Check to disable toolbar in parent",name:"setLoading",required:!0,type:{name:"(loading: boolean) => void"}},setHideToolbarControls:{defaultValue:null,description:"Callback which is invoked with whether to enable/disable toolbar controls",name:"setHideToolbarControls",required:!1,type:{name:"((disabled: boolean) => void)"}},fallbackComponent:{defaultValue:null,description:"React component rendered as a fallback when no preview is available.\nWhen specified, the default error component which displays `cannotPreviewMessage`\nwon't be displayed.",name:"fallbackComponent",required:!1,type:{name:"ComponentType"}},cannotPreviewMessage:{defaultValue:{value:"Can't preview document"},description:"Error title displayed when no preview can be displayed by this component.\nUnused when `fallbackComponent` is provided",name:"cannotPreviewMessage",required:!1,type:{name:"string"}},cannotPreviewMessage2:{defaultValue:{value:"Try the JSON tab for a different view of this document's data."},description:"Error message displayed when no preview can be displayed by this component.\nUnused when `fallbackComponent` is provided",name:"cannotPreviewMessage2",required:!1,type:{name:"string"}},loading:{defaultValue:null,description:"",name:"loading",required:!0,type:{name:"boolean"}},hideToolbarControls:{defaultValue:null,description:"",name:"hideToolbarControls",required:!0,type:{name:"boolean"}}}}}catch{}var baseEach=require_baseEach(),isArrayLike=isArrayLike_1;function baseMap$1(i,e){var n=-1,t=isArrayLike(i)?Array(i.length):[];return baseEach(i,function(a,r,s){t[++n]=e(a,r,s)}),t}var _baseMap=baseMap$1,arrayMap=require_arrayMap(),baseIteratee$1=_baseIteratee,baseMap=_baseMap,isArray=isArray_1;function map$1(i,e){var n=isArray(i)?arrayMap:baseMap;return n(i,baseIteratee$1(e))}var map_1=map$1,baseFlatten=_baseFlatten,map=map_1;function flatMap(i,e){return baseFlatten(map(i,e),1)}var flatMap_1=flatMap;const flatMap$1=getDefaultExportFromCjs(flatMap_1);function bboxesIntersect(i,e){const[n,t,a,r,s]=i,[u,l,y,c,M]=e;return!(u>=a||y<=n||l>=r||c<=t||s!==M)}const findMatchingBbox=(i,e)=>e.filter(n=>{const{left:t,top:a,right:r,bottom:s,page:u}=n,[l,y,c,M]=i.bbox;return bboxesIntersect([l,y,c,M,i.page_number],[t,a,r,s,u])}),START$1=0,END$1=1;function getPassagePageInfo(i,e){const{start_offset:n,end_offset:t,field:a}=e;return typeof n!="number"||typeof t!="number"?null:((i==null?void 0:i.text_mappings)||[]).filter(s=>{const{field:{name:u,span:l}}=s;return u===a&&spansIntersect({begin:l[START$1],end:l[END$1]},{begin:n,end:t})}).map(s=>s.page)}const canRenderHtmlView=i=>!!get(i,"html"),SANITIZE_CONFIG={ADD_TAGS:["bbox"],ADD_ATTR:["page"],FORBID_TAGS:["input","form","a","button","script","style"],FORBID_CONTENTS:["script","style"],KEEP_CONTENT:!0,WHOLE_DOCUMENT:!0},baseClassName=`${settings_1.prefix}--html`,HtmlView=reactExports.forwardRef(({document:i,highlight:e,setHideToolbarControls:n,setLoading:t,...a},r)=>{const s=reactExports.useRef(null),u=reactExports.useRef(null);reactExports.useEffect(()=>{n&&n(!0)},[n]);const[l,y]=reactExports.useState(null),[c,M]=reactExports.useState(null),[I,m]=reactExports.useState([]);return reactExports.useLayoutEffect(()=>(purify.addHook("afterSanitizeAttributes",function(g){g.tagName==="TABLE"&&g.setAttribute("role","presentation")}),()=>{purify.removeHook("afterSanitizeAttributes")}),[]),reactExports.useEffect(()=>{if(i){const g=i.html;g&&e?(async()=>{const C=await processDoc({...i,docHtml:g},{sections:!0,bbox:!0}),v=C.sections?C.sections.map(b=>b.html).join(""):"";M(C),y(purify.sanitize(v,SANITIZE_CONFIG)),t&&t(!1)})():(y(g?purify.sanitize(g,SANITIZE_CONFIG):""),t&&t(!1))}},[i,e,t]),reactExports.useEffect(()=>{var g;if(e){const f=getTextMappings(i);if(isPassage(e)&&f){const C=getPassagePageInfo(f,e);if(c&&c.bboxes&&C){const v=flatMap$1(C,b=>findMatchingBbox(b,c.bboxes)).map(b=>b.location);m(v)}}else{const C=(g=e==null?void 0:e.table)==null?void 0:g.location;m(C?[C]:[])}}},[i,e,c]),reactExports.useEffect(()=>{if(!l||!I)return;const g=s.current,f=u.current;if(f&&clearNodeChildren(f),!e||!g||!f)return;I.forEach(v=>{try{const{begin:b,end:h}=v;if(typeof b>"u"||typeof h>"u")return;const o=findOffsetInDOM(g,b,h),d=window.document.createDocumentFragment(),p=g.getBoundingClientRect();createFieldRects({fragment:d,parentRect:p,fieldType:"highlight",fieldValue:"",fieldId:b.toString(),...o}),f.appendChild(d)}catch(b){console.error("Error creating field rects",b)}});const C=f.querySelector(".field--rect");C&&C.scrollIntoView({block:"center"})},[e,l,I]),jsxRuntimeExports.jsxs("div",{ref:r,className:baseClassName,...a,children:[jsxRuntimeExports.jsx("div",{ref:u}),l&&jsxRuntimeExports.jsx("div",{className:`${baseClassName}__content`,dangerouslySetInnerHTML:{__html:l},ref:s})]})});try{canRenderHtmlView.displayName="canRenderHtmlView",canRenderHtmlView.__docgenInfo={description:"",displayName:"canRenderHtmlView",props:{}}}catch{}try{HtmlView.displayName="HtmlView",HtmlView.__docgenInfo={description:"",displayName:"HtmlView",props:{document:{defaultValue:null,description:"Document data returned by query",name:"document",required:!0,type:{name:"QueryResultWithOptionalMetadata"}},highlight:{defaultValue:null,description:"table to highlight in document. Reference to item with `document.table_results`",name:"highlight",required:!1,type:{name:"QueryTableResult | QueryResultPassage"}},setLoading:{defaultValue:null,description:"Check to disable toolbar in parent",name:"setLoading",required:!1,type:{name:"((loading: boolean) => void)"}},setHideToolbarControls:{defaultValue:null,description:"Callback which is invoked with whether to enable/disable toolbar controls",name:"setHideToolbarControls",required:!1,type:{name:"((disabled: boolean) => void)"}}}}}catch{}function nonEmpty(i){return i!=null}const START=0,END=1;function spanIntersects([i,e],[n,t]){return in}function spanGetText(i,e){return i&&(spanLen(e)===0?"":i.substring(e[START],e[END]))}function spanLen(i){return Math.max(0,i[END]-i[START])}function spanIncludesIndex([i,e],n){return i<=n&&nspansIntersect(l,{begin:r,end:s}));if(u)return u}return null}var pdf$1={exports:{}};(function(module,exports){(function(e,n){module.exports=n()})(commonjsGlobal,function(){return function(i){var e={};function n(t){if(e[t])return e[t].exports;var a=e[t]={i:t,l:!1,exports:{}};return i[t].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=i,n.c=e,n.d=function(t,a,r){n.o(t,a)||Object.defineProperty(t,a,{enumerable:!0,get:r})},n.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,a){if(a&1&&(t=n(t)),a&8||a&4&&typeof t=="object"&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),a&2&&typeof t!="string")for(var s in t)n.d(r,s,(function(u){return t[u]}).bind(null,s));return r},n.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(a,"a",a),a},n.o=function(t,a){return Object.prototype.hasOwnProperty.call(t,a)},n.p="",n(n.s=0)}([function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLinkAttributes",{enumerable:!0,get:function(){return t.addLinkAttributes}}),Object.defineProperty(e,"getFilenameFromUrl",{enumerable:!0,get:function(){return t.getFilenameFromUrl}}),Object.defineProperty(e,"LinkTarget",{enumerable:!0,get:function(){return t.LinkTarget}}),Object.defineProperty(e,"loadScript",{enumerable:!0,get:function(){return t.loadScript}}),Object.defineProperty(e,"PDFDateString",{enumerable:!0,get:function(){return t.PDFDateString}}),Object.defineProperty(e,"RenderingCancelledException",{enumerable:!0,get:function(){return t.RenderingCancelledException}}),Object.defineProperty(e,"build",{enumerable:!0,get:function(){return a.build}}),Object.defineProperty(e,"getDocument",{enumerable:!0,get:function(){return a.getDocument}}),Object.defineProperty(e,"LoopbackPort",{enumerable:!0,get:function(){return a.LoopbackPort}}),Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:!0,get:function(){return a.PDFDataRangeTransport}}),Object.defineProperty(e,"PDFWorker",{enumerable:!0,get:function(){return a.PDFWorker}}),Object.defineProperty(e,"version",{enumerable:!0,get:function(){return a.version}}),Object.defineProperty(e,"CMapCompressionType",{enumerable:!0,get:function(){return r.CMapCompressionType}}),Object.defineProperty(e,"createObjectURL",{enumerable:!0,get:function(){return r.createObjectURL}}),Object.defineProperty(e,"createPromiseCapability",{enumerable:!0,get:function(){return r.createPromiseCapability}}),Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return r.createValidAbsoluteUrl}}),Object.defineProperty(e,"InvalidPDFException",{enumerable:!0,get:function(){return r.InvalidPDFException}}),Object.defineProperty(e,"MissingPDFException",{enumerable:!0,get:function(){return r.MissingPDFException}}),Object.defineProperty(e,"OPS",{enumerable:!0,get:function(){return r.OPS}}),Object.defineProperty(e,"PasswordResponses",{enumerable:!0,get:function(){return r.PasswordResponses}}),Object.defineProperty(e,"PermissionFlag",{enumerable:!0,get:function(){return r.PermissionFlag}}),Object.defineProperty(e,"removeNullCharacters",{enumerable:!0,get:function(){return r.removeNullCharacters}}),Object.defineProperty(e,"shadow",{enumerable:!0,get:function(){return r.shadow}}),Object.defineProperty(e,"UnexpectedResponseException",{enumerable:!0,get:function(){return r.UnexpectedResponseException}}),Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return r.UNSUPPORTED_FEATURES}}),Object.defineProperty(e,"Util",{enumerable:!0,get:function(){return r.Util}}),Object.defineProperty(e,"VerbosityLevel",{enumerable:!0,get:function(){return r.VerbosityLevel}}),Object.defineProperty(e,"AnnotationLayer",{enumerable:!0,get:function(){return s.AnnotationLayer}}),Object.defineProperty(e,"apiCompatibilityParams",{enumerable:!0,get:function(){return u.apiCompatibilityParams}}),Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:!0,get:function(){return l.GlobalWorkerOptions}}),Object.defineProperty(e,"renderTextLayer",{enumerable:!0,get:function(){return y.renderTextLayer}}),Object.defineProperty(e,"SVGGraphics",{enumerable:!0,get:function(){return c.SVGGraphics}});var t=n(1),a=n(5),r=n(2),s=n(19),u=n(9),l=n(12),y=n(20),c=n(21);{const{isNodeJS:M}=n(4);if(M){const I=n(22).PDFNodeStream;(0,a.setPDFNetworkStreamFactory)(m=>new I(m))}else{const I=n(25).PDFNetworkStream;let m;(0,t.isFetchSupported)()&&(m=n(26).PDFFetchStream),(0,a.setPDFNetworkStreamFactory)(g=>m&&(0,t.isValidFetchUrl)(g.url)?new m(g):new I(g))}}},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.addLinkAttributes=g,e.getFilenameFromUrl=f,e.isFetchSupported=v,e.isValidFetchUrl=b,e.loadScript=h,e.deprecated=o,e.PDFDateString=e.StatTimer=e.DOMSVGFactory=e.DOMCMapReaderFactory=e.BaseCMapReaderFactory=e.DOMCanvasFactory=e.BaseCanvasFactory=e.DEFAULT_LINK_REL=e.LinkTarget=e.RenderingCancelledException=e.PageViewport=void 0;var t=n(2);const a="noopener noreferrer nofollow";e.DEFAULT_LINK_REL=a;const r="http://www.w3.org/2000/svg";class s{constructor(){this.constructor===s&&(0,t.unreachable)("Cannot initialize BaseCanvasFactory.")}create(x,D){(0,t.unreachable)("Abstract method `create` called.")}reset(x,D,T){if(!x.canvas)throw new Error("Canvas is not specified");if(D<=0||T<=0)throw new Error("Invalid canvas size");x.canvas.width=D,x.canvas.height=T}destroy(x){if(!x.canvas)throw new Error("Canvas is not specified");x.canvas.width=0,x.canvas.height=0,x.canvas=null,x.context=null}}e.BaseCanvasFactory=s;class u extends s{constructor({ownerDocument:x=globalThis.document}={}){super(),this._document=x}create(x,D){if(x<=0||D<=0)throw new Error("Invalid canvas size");const T=this._document.createElement("canvas"),P=T.getContext("2d");return T.width=x,T.height=D,{canvas:T,context:P}}}e.DOMCanvasFactory=u;class l{constructor({baseUrl:x=null,isCompressed:D=!1}){this.constructor===l&&(0,t.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=x,this.isCompressed=D}async fetch({name:x}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!x)throw new Error("CMap name must be specified.");const D=this.baseUrl+x+(this.isCompressed?".bcmap":""),T=this.isCompressed?t.CMapCompressionType.BINARY:t.CMapCompressionType.NONE;return this._fetchData(D,T).catch(P=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${D}`)})}_fetchData(x,D){(0,t.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=l;class y extends l{_fetchData(x,D){return v()&&b(x,document.baseURI)?fetch(x).then(async T=>{if(!T.ok)throw new Error(T.statusText);let P;return this.isCompressed?P=new Uint8Array(await T.arrayBuffer()):P=(0,t.stringToBytes)(await T.text()),{cMapData:P,compressionType:D}}):new Promise((T,P)=>{const E=new XMLHttpRequest;E.open("GET",x,!0),this.isCompressed&&(E.responseType="arraybuffer"),E.onreadystatechange=()=>{if(E.readyState===XMLHttpRequest.DONE){if(E.status===200||E.status===0){let B;if(this.isCompressed&&E.response?B=new Uint8Array(E.response):!this.isCompressed&&E.responseText&&(B=(0,t.stringToBytes)(E.responseText)),B){T({cMapData:B,compressionType:D});return}}P(new Error(E.statusText))}},E.send(null)})}}e.DOMCMapReaderFactory=y;class c{create(x,D){(0,t.assert)(x>0&&D>0,"Invalid SVG dimensions");const T=document.createElementNS(r,"svg:svg");return T.setAttribute("version","1.1"),T.setAttribute("width",x+"px"),T.setAttribute("height",D+"px"),T.setAttribute("preserveAspectRatio","none"),T.setAttribute("viewBox","0 0 "+x+" "+D),T}createElement(x){return(0,t.assert)(typeof x=="string","Invalid SVG element type"),document.createElementNS(r,x)}}e.DOMSVGFactory=c;class M{constructor({viewBox:x,scale:D,rotation:T,offsetX:P=0,offsetY:E=0,dontFlip:B=!1}){this.viewBox=x,this.scale=D,this.rotation=T,this.offsetX=P,this.offsetY=E;const L=(x[2]+x[0])/2,O=(x[3]+x[1])/2;let k,j,A,S;switch(T=T%360,T=T<0?T+360:T,T){case 180:k=-1,j=0,A=0,S=1;break;case 90:k=0,j=1,A=1,S=0;break;case 270:k=0,j=-1,A=-1,S=0;break;case 0:k=1,j=0,A=0,S=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}B&&(A=-A,S=-S);let R,N,U,F;k===0?(R=Math.abs(O-x[1])*D+P,N=Math.abs(L-x[0])*D+E,U=Math.abs(x[3]-x[1])*D,F=Math.abs(x[2]-x[0])*D):(R=Math.abs(L-x[0])*D+P,N=Math.abs(O-x[1])*D+E,U=Math.abs(x[2]-x[0])*D,F=Math.abs(x[3]-x[1])*D),this.transform=[k*D,j*D,A*D,S*D,R-k*D*L-A*D*O,N-j*D*L-S*D*O],this.width=U,this.height=F}clone({scale:x=this.scale,rotation:D=this.rotation,offsetX:T=this.offsetX,offsetY:P=this.offsetY,dontFlip:E=!1}={}){return new M({viewBox:this.viewBox.slice(),scale:x,rotation:D,offsetX:T,offsetY:P,dontFlip:E})}convertToViewportPoint(x,D){return t.Util.applyTransform([x,D],this.transform)}convertToViewportRectangle(x){const D=t.Util.applyTransform([x[0],x[1]],this.transform),T=t.Util.applyTransform([x[2],x[3]],this.transform);return[D[0],D[1],T[0],T[1]]}convertToPdfPoint(x,D){return t.Util.applyInverseTransform([x,D],this.transform)}}e.PageViewport=M;class I extends t.BaseException{constructor(x,D){super(x),this.type=D}}e.RenderingCancelledException=I;const m={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};e.LinkTarget=m;function g(w,{url:x,target:D,rel:T,enabled:P=!0}={}){(0,t.assert)(x&&typeof x=="string",'addLinkAttributes: A valid "url" parameter must provided.');const E=(0,t.removeNullCharacters)(x);P?w.href=w.title=E:(w.href="",w.title=`Disabled: ${E}`,w.onclick=()=>!1);let B="";switch(D){case m.NONE:break;case m.SELF:B="_self";break;case m.BLANK:B="_blank";break;case m.PARENT:B="_parent";break;case m.TOP:B="_top";break}w.target=B,w.rel=typeof T=="string"?T:a}function f(w){const x=w.indexOf("#"),D=w.indexOf("?"),T=Math.min(x>0?x:w.length,D>0?D:w.length);return w.substring(w.lastIndexOf("/",T)+1,T)}class C{constructor(){this.started=Object.create(null),this.times=[]}time(x){x in this.started&&(0,t.warn)(`Timer is already running for ${x}`),this.started[x]=Date.now()}timeEnd(x){x in this.started||(0,t.warn)(`Timer has not been started for ${x}`),this.times.push({name:x,start:this.started[x],end:Date.now()}),delete this.started[x]}toString(){const x=[];let D=0;for(const T of this.times){const P=T.name;P.length>D&&(D=P.length)}for(const T of this.times){const P=T.end-T.start;x.push(`${T.name.padEnd(D)} ${P}ms `)}return x.join("")}}e.StatTimer=C;function v(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype&&typeof ReadableStream<"u"}function b(w,x){try{const{protocol:D}=x?new URL(w,x):new URL(w);return D==="http:"||D==="https:"}catch{return!1}}function h(w){return new Promise((x,D)=>{const T=document.createElement("script");T.src=w,T.onload=x,T.onerror=function(){D(new Error(`Cannot load script at: ${T.src}`))},(document.head||document.documentElement).appendChild(T)})}function o(w){console.log("Deprecated API usage: "+w)}let d;class p{static toDateObject(x){if(!x||!(0,t.isString)(x))return null;d||(d=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const D=d.exec(x);if(!D)return null;const T=parseInt(D[1],10);let P=parseInt(D[2],10);P=P>=1&&P<=12?P-1:0;let E=parseInt(D[3],10);E=E>=1&&E<=31?E:1;let B=parseInt(D[4],10);B=B>=0&&B<=23?B:0;let L=parseInt(D[5],10);L=L>=0&&L<=59?L:0;let O=parseInt(D[6],10);O=O>=0&&O<=59?O:0;const k=D[7]||"Z";let j=parseInt(D[8],10);j=j>=0&&j<=23?j:0;let A=parseInt(D[9],10)||0;return A=A>=0&&A<=59?A:0,k==="-"?(B+=j,L+=A):k==="+"&&(B-=j,L-=A),new Date(Date.UTC(T,P,E,B,L,O))}}e.PDFDateString=p},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.arrayByteLength=H,e.arraysToBytes=J,e.assert=B,e.bytesToString=K,e.createPromiseCapability=ue,e.escapeString=de,e.getModificationDate=be,e.getVerbosityLevel=D,e.info=T,e.isArrayBuffer=xe,e.isArrayEqual=ye,e.isBool=ge,e.isNum=we,e.isString=Ae,e.isSameOrigin=L,e.createValidAbsoluteUrl=k,e.removeNullCharacters=V,e.setVerbosityLevel=x,e.shadow=j,e.string32=X,e.stringToBytes=Y,e.stringToPDFString=re,e.stringToUTF8String=Me,e.utf8StringToString=me,e.warn=P,e.unreachable=E,e.IsEvalSupportedCached=e.IsLittleEndianCached=e.createObjectURL=e.FormatError=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.TextRenderingMode=e.StreamType=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.MissingPDFException=e.InvalidPDFException=e.AbortException=e.CMapCompressionType=e.ImageKind=e.FontType=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationBorderStyleType=e.UNSUPPORTED_FEATURES=e.VerbosityLevel=e.OPS=e.IDENTITY_MATRIX=e.FONT_IDENTITY_MATRIX=e.BaseException=void 0,n(3);const t=[1,0,0,1,0,0];e.IDENTITY_MATRIX=t;const a=[.001,0,0,.001,0,0];e.FONT_IDENTITY_MATRIX=a;const r={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};e.PermissionFlag=r;const s={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};e.TextRenderingMode=s;const u={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.ImageKind=u;const l={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};e.AnnotationType=l;const y={MARKED:"Marked",REVIEW:"Review"};e.AnnotationStateModelType=y;const c={MARKED:"Marked",UNMARKED:"Unmarked"};e.AnnotationMarkedState=c;const M={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};e.AnnotationReviewState=M;const I={GROUP:"Group",REPLY:"R"};e.AnnotationReplyType=I;const m={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFlag=m;const g={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};e.AnnotationFieldFlag=g;const f={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.AnnotationBorderStyleType=f;const C={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};e.StreamType=C;const v={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};e.FontType=v;const b={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=b;const h={NONE:0,BINARY:1,STREAM:2};e.CMapCompressionType=h;const o={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,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.OPS=o;const d={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent"};e.UNSUPPORTED_FEATURES=d;const p={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};e.PasswordResponses=p;let w=b.WARNINGS;function x(q){Number.isInteger(q)&&(w=q)}function D(){return w}function T(q){w>=b.INFOS&&console.log(`Info: ${q}`)}function P(q){w>=b.WARNINGS&&console.log(`Warning: ${q}`)}function E(q){throw new Error(q)}function B(q,Q){q||E(Q)}function L(q,Q){let Z;try{if(Z=new URL(q),!Z.origin||Z.origin==="null")return!1}catch{return!1}const te=new URL(Q,Z);return Z.origin===te.origin}function O(q){if(!q)return!1;switch(q.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function k(q,Q){if(!q)return null;try{const Z=Q?new URL(q,Q):new URL(q);if(O(Z))return Z}catch{}return null}function j(q,Q,Z){return Object.defineProperty(q,Q,{value:Z,enumerable:!0,configurable:!0,writable:!1}),Z}const A=function(){function Q(Z){this.constructor===Q&&E("Cannot initialize BaseException."),this.message=Z,this.name=this.constructor.name}return Q.prototype=new Error,Q.constructor=Q,Q}();e.BaseException=A;class S extends A{constructor(Q,Z){super(Q),this.code=Z}}e.PasswordException=S;class R extends A{constructor(Q,Z){super(Q),this.details=Z}}e.UnknownErrorException=R;class N extends A{}e.InvalidPDFException=N;class U extends A{}e.MissingPDFException=U;class F extends A{constructor(Q,Z){super(Q),this.status=Z}}e.UnexpectedResponseException=F;class G extends A{}e.FormatError=G;class z extends A{}e.AbortException=z;const W=/\x00/g;function V(q){return typeof q!="string"?(P("The argument for removeNullCharacters must be a string."),q):q.replace(W,"")}function K(q){B(q!==null&&typeof q=="object"&&q.length!==void 0,"Invalid argument for bytesToString");const Q=q.length,Z=8192;if(Q>24&255,q>>16&255,q>>8&255,q&255)}function $(){const q=new Uint8Array(4);return q[0]=1,new Uint32Array(q.buffer,0,1)[0]===1}const ee={get value(){return j(this,"value",$())}};e.IsLittleEndianCached=ee;function _(){try{return new Function(""),!0}catch{return!1}}const ie={get value(){return j(this,"value",_())}};e.IsEvalSupportedCached=ie;const oe=["rgb(",0,",",0,",",0,")"];class le{static makeCssRgb(Q,Z,te){return oe[1]=Q,oe[3]=Z,oe[5]=te,oe.join("")}static transform(Q,Z){return[Q[0]*Z[0]+Q[2]*Z[1],Q[1]*Z[0]+Q[3]*Z[1],Q[0]*Z[2]+Q[2]*Z[3],Q[1]*Z[2]+Q[3]*Z[3],Q[0]*Z[4]+Q[2]*Z[5]+Q[4],Q[1]*Z[4]+Q[3]*Z[5]+Q[5]]}static applyTransform(Q,Z){const te=Q[0]*Z[0]+Q[1]*Z[2]+Z[4],ae=Q[0]*Z[1]+Q[1]*Z[3]+Z[5];return[te,ae]}static applyInverseTransform(Q,Z){const te=Z[0]*Z[3]-Z[1]*Z[2],ae=(Q[0]*Z[3]-Q[1]*Z[2]+Z[2]*Z[5]-Z[4]*Z[3])/te,ce=(-Q[0]*Z[1]+Q[1]*Z[0]+Z[4]*Z[1]-Z[5]*Z[0])/te;return[ae,ce]}static getAxialAlignedBoundingBox(Q,Z){const te=le.applyTransform(Q,Z),ae=le.applyTransform(Q.slice(2,4),Z),ce=le.applyTransform([Q[0],Q[3]],Z),he=le.applyTransform([Q[2],Q[1]],Z);return[Math.min(te[0],ae[0],ce[0],he[0]),Math.min(te[1],ae[1],ce[1],he[1]),Math.max(te[0],ae[0],ce[0],he[0]),Math.max(te[1],ae[1],ce[1],he[1])]}static inverseTransform(Q){const Z=Q[0]*Q[3]-Q[1]*Q[2];return[Q[3]/Z,-Q[1]/Z,-Q[2]/Z,Q[0]/Z,(Q[2]*Q[5]-Q[4]*Q[3])/Z,(Q[4]*Q[1]-Q[5]*Q[0])/Z]}static apply3dTransform(Q,Z){return[Q[0]*Z[0]+Q[1]*Z[1]+Q[2]*Z[2],Q[3]*Z[0]+Q[4]*Z[1]+Q[5]*Z[2],Q[6]*Z[0]+Q[7]*Z[1]+Q[8]*Z[2]]}static singularValueDecompose2dScale(Q){const Z=[Q[0],Q[2],Q[1],Q[3]],te=Q[0]*Z[0]+Q[1]*Z[2],ae=Q[0]*Z[1]+Q[1]*Z[3],ce=Q[2]*Z[0]+Q[3]*Z[2],he=Q[2]*Z[1]+Q[3]*Z[3],fe=(te+he)/2,ve=Math.sqrt((te+he)*(te+he)-4*(te*he-ce*ae))/2,Ce=fe+ve||1,De=fe-ve||1;return[Math.sqrt(Ce),Math.sqrt(De)]}static normalizeRect(Q){const Z=Q.slice(0);return Q[0]>Q[2]&&(Z[0]=Q[2],Z[2]=Q[0]),Q[1]>Q[3]&&(Z[1]=Q[3],Z[3]=Q[1]),Z}static intersect(Q,Z){function te(fe,ve){return fe-ve}const ae=[Q[0],Q[2],Z[0],Z[2]].sort(te),ce=[Q[1],Q[3],Z[1],Z[3]].sort(te),he=[];if(Q=le.normalizeRect(Q),Z=le.normalizeRect(Z),ae[0]===Q[0]&&ae[1]===Z[0]||ae[0]===Z[0]&&ae[1]===Q[0])he[0]=ae[1],he[2]=ae[2];else return null;if(ce[0]===Q[1]&&ce[1]===Z[1]||ce[0]===Z[1]&&ce[1]===Q[1])he[1]=ce[1],he[3]=ce[2];else return null;return he}}e.Util=le;const pe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function re(q){const Q=q.length,Z=[];if(q[0]==="þ"&&q[1]==="ÿ")for(let te=2;te>2,Qe=(Ce&3)<<4|De>>4,Ze=fe+1>6:64,Ve=fe+2"u"&&(t.ownerDocument=globalThis.document),typeof t.disableRange!="boolean"&&(t.disableRange=!1),typeof t.disableStream!="boolean"&&(t.disableStream=!1),typeof t.disableAutoFetch!="boolean"&&(t.disableAutoFetch=!1),(0,_util.setVerbosityLevel)(t.verbosity),!r){const u={verbosity:t.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};r=u.port?PDFWorker.fromPort(u):new PDFWorker(u),e._worker=r}const s=e.docId;return r.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");const u=_fetchDocument(r,t,a,s),l=new Promise(function(y){let c;a?c=new _transport_stream.PDFDataTransportStream({length:t.length,initialData:t.initialData,progressiveDone:t.progressiveDone,disableRange:t.disableRange,disableStream:t.disableStream},a):t.data||(c=createPDFNetworkStream({url:t.url,length:t.length,httpHeaders:t.httpHeaders,withCredentials:t.withCredentials,rangeChunkSize:t.rangeChunkSize,disableRange:t.disableRange,disableStream:t.disableStream})),y(c)});return Promise.all([u,l]).then(function([y,c]){if(e.destroyed)throw new Error("Loading aborted");const M=new _message_handler.MessageHandler(s,y,r.port);M.postMessageTransfers=r.postMessageTransfers;const I=new WorkerTransport(M,e,c,t);e._transport=I,M.send("Ready",null)})}).catch(e._capability.reject),e}function _fetchDocument(i,e,n,t){return i.destroyed?Promise.reject(new Error("Worker was destroyed")):(n&&(e.length=n.length,e.initialData=n.initialData,e.progressiveDone=n.progressiveDone),i.messageHandler.sendWithPromise("GetDocRequest",{docId:t,apiVersion:"2.6.347",source:{data:e.data,url:e.url,password:e.password,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize,length:e.length},maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,postMessageTransfers:i.postMessageTransfers,docBaseUrl:e.docBaseUrl,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties}).then(function(a){if(i.destroyed)throw new Error("Worker was destroyed");return a}))}const PDFDocumentLoadingTask=function(){let e=0;class n{constructor(){this._capability=(0,_util.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}destroy(){return this.destroyed=!0,(this._transport?this._transport.destroy():Promise.resolve()).then(()=>{this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)})}}return n}();class PDFDataRangeTransport{constructor(e,n,t=!1){this.length=e,this.initialData=n,this.progressiveDone=t,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util.createPromiseCapability)()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,n){for(const t of this._rangeListeners)t(e,n)}onDataProgress(e,n){this._readyCapability.promise.then(()=>{for(const t of this._progressListeners)t(e,n)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const n of this._progressiveReadListeners)n(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,n){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,n){this._pdfInfo=e,this._transport=n}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}get numPages(){return this._pdfInfo.numPages}get fingerprint(){return this._pdfInfo.fingerprint}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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()}getJavaScript(){return this._transport.getJavaScript()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getStats(){return this._transport.getStats()}cleanup(){return this._transport.startCleanup()}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}saveDocument(e){return this._transport.saveDocument(e)}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(e,n,t,a,r=!1){this._pageIndex=e,this._pageInfo=n,this._ownerDocument=a,this._transport=t,this._stats=r?new _display_utils.StatTimer:null,this._pdfBug=r,this.commonObjs=t.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!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({scale:e,rotation:n=this.rotate,offsetX:t=0,offsetY:a=0,dontFlip:r=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:e,rotation:n,offsetX:t,offsetY:a,dontFlip:r})}getAnnotations({intent:e=null}={}){return(!this.annotationsPromise||this.annotationsIntent!==e)&&(this.annotationsPromise=this._transport.getAnnotations(this._pageIndex,e),this.annotationsIntent=e),this.annotationsPromise}render({canvasContext:e,viewport:n,intent:t="display",enableWebGL:a=!1,renderInteractiveForms:r=!1,transform:s=null,imageLayer:u=null,canvasFactory:l=null,background:y=null,annotationStorage:c=null,optionalContentConfigPromise:M=null}){this._stats&&this._stats.time("Overall");const I=t==="print"?"print":"display";this.pendingCleanup=!1,M||(M=this._transport.getOptionalContentConfig());let m=this._intentStates.get(I);m||(m=Object.create(null),this._intentStates.set(I,m)),m.streamReaderCancelTimeout&&(clearTimeout(m.streamReaderCancelTimeout),m.streamReaderCancelTimeout=null);const g=l||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),f=new _webgl.WebGLContext({enable:a});m.displayReadyCapability||(m.displayReadyCapability=(0,_util.createPromiseCapability)(),m.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:I,renderInteractiveForms:r===!0,annotationStorage:c&&c.getAll()||null}));const C=h=>{const o=m.renderTasks.indexOf(v);o>=0&&m.renderTasks.splice(o,1),(this.cleanupAfterRender||I==="print")&&(this.pendingCleanup=!0),this._tryCleanup(),h?(v.capability.reject(h),this._abortOperatorList({intentState:m,reason:h})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},v=new InternalRenderTask({callback:C,params:{canvasContext:e,viewport:n,transform:s,imageLayer:u,background:y},objs:this.objs,commonObjs:this.commonObjs,operatorList:m.operatorList,pageIndex:this._pageIndex,canvasFactory:g,webGLContext:f,useRequestAnimationFrame:I!=="print",pdfBug:this._pdfBug});m.renderTasks||(m.renderTasks=[]),m.renderTasks.push(v);const b=v.task;return Promise.all([m.displayReadyCapability.promise,M]).then(([h,o])=>{if(this.pendingCleanup){C();return}this._stats&&this._stats.time("Rendering"),v.initializeGraphics({transparency:h,optionalContentConfig:o}),v.operatorListChanged()}).catch(C),b}getOperatorList(){function e(){if(t.operatorList.lastChunk){t.opListReadCapability.resolve(t.operatorList);const r=t.renderTasks.indexOf(a);r>=0&&t.renderTasks.splice(r,1)}}const n="oplist";let t=this._intentStates.get(n);t||(t=Object.create(null),this._intentStates.set(n,t));let a;return t.opListReadCapability||(a=Object.create(null),a.operatorListChanged=e,t.opListReadCapability=(0,_util.createPromiseCapability)(),t.renderTasks=[],t.renderTasks.push(a),t.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:n})),t.opListReadCapability.promise}streamTextContent({normalizeWhitespace:e=!1,disableCombineTextItems:n=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:e===!0,combineTextItems:n!==!0},{highWaterMark:100,size(a){return a.items.length}})}getTextContent(e={}){const n=this.streamTextContent(e);return new Promise(function(t,a){function r(){s.read().then(function({value:l,done:y}){if(y){t(u);return}Object.assign(u.styles,l.styles),u.items.push(...l.items),r()},a)}const s=n.getReader(),u={items:[],styles:Object.create(null)};r()})}_destroy(){this.destroyed=!0,this._transport.pageCache[this._pageIndex]=null;const e=[];for(const[n,t]of this._intentStates)if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),n!=="oplist")for(const a of t.renderTasks)e.push(a.completed),a.cancel();return this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(e)}cleanup(e=!1){return this.pendingCleanup=!0,this._tryCleanup(e)}_tryCleanup(e=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:n,operatorList:t}of this._intentStates.values())if(n.length!==0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.annotationsPromise=null,e&&this._stats&&(this._stats=new _display_utils.StatTimer),this.pendingCleanup=!1,!0}_startRenderPage(e,n){const t=this._intentStates.get(n);t&&(this._stats&&this._stats.timeEnd("Page Request"),t.displayReadyCapability&&t.displayReadyCapability.resolve(e))}_renderPageChunk(e,n){for(let t=0,a=e.length;t{t.read().then(({value:s,done:u})=>{if(u){a.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(s,a),r())},s=>{if(a.streamReader=null,!this._transport.destroyed){if(a.operatorList){a.operatorList.lastChunk=!0;for(let u=0;u{this._abortOperatorList({intentState:e,reason:n,force:!0}),e.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT);return}}if(e.streamReader.cancel(new _util.AbortException(n&&n.message)),e.streamReader=null,!this._transport.destroyed){for(const[a,r]of this._intentStates)if(r===e){this._intentStates.delete(a);break}this.cleanup()}}}get stats(){return this._stats}}exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(e=!0){this._listeners=[],this._defer=e,this._deferred=Promise.resolve(void 0)}postMessage(e,n){function t(s){if(typeof s!="object"||s===null)return s;if(a.has(s))return a.get(s);let u,l;if((u=s.buffer)&&(0,_util.isArrayBuffer)(u))return n&&n.includes(u)?l=new s.constructor(u,s.byteOffset,s.byteLength):l=new s.constructor(s),a.set(s,l),l;l=Array.isArray(s)?[]:{},a.set(s,l);for(const y in s){let c,M=s;for(;!(c=Object.getOwnPropertyDescriptor(M,y));)M=Object.getPrototypeOf(M);if(!(typeof c.value>"u")){if(typeof c.value=="function"){if(s.hasOwnProperty&&s.hasOwnProperty(y))throw new Error(`LoopbackPort.postMessage - cannot clone: ${s[y]}`);continue}l[y]=t(c.value)}}return l}if(!this._defer){this._listeners.forEach(s=>{s.call(this,{data:e})});return}const a=new WeakMap,r={data:t(e)};this._deferred.then(()=>{this._listeners.forEach(s=>{s.call(this,r)})})}addEventListener(e,n){this._listeners.push(n)}removeEventListener(e,n){const t=this._listeners.indexOf(n);this._listeners.splice(t,1)}terminate(){this._listeners.length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorker=function PDFWorkerClosure(){const pdfWorkerPorts=new WeakMap;let isWorkerDisabled=!1,fallbackWorkerSrc,nextFakeWorkerId=0,fakeWorkerCapability;if(_is_node.isNodeJS&&typeof commonjsRequire=="function")isWorkerDisabled=!0,fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"&&"currentScript"in document){const i=document.currentScript&&document.currentScript.src;i&&(fallbackWorkerSrc=i.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}function getWorkerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(typeof fallbackWorkerSrc<"u")return _is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function getMainThreadWorkerMessageHandler(){let i;try{i=globalThis.pdfjsWorker&&globalThis.pdfjsWorker.WorkerMessageHandler}catch{}return i||null}function setupFakeWorkerGlobal(){if(fakeWorkerCapability)return fakeWorkerCapability.promise;fakeWorkerCapability=(0,_util.createPromiseCapability)();const loader=async function(){const mainWorkerMessageHandler=getMainThreadWorkerMessageHandler();if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(getWorkerSrc());return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(getWorkerSrc()),window.pdfjsWorker.WorkerMessageHandler};return loader().then(fakeWorkerCapability.resolve,fakeWorkerCapability.reject),fakeWorkerCapability.promise}function createCDNWrapper(i){const e="importScripts('"+i+"');";return URL.createObjectURL(new Blob([e]))}class PDFWorker{constructor({name:e=null,port:n=null,verbosity:t=(0,_util.getVerbosityLevel)()}={}){if(n&&pdfWorkerPorts.has(n))throw new Error("Cannot use more than one PDFWorker per port");if(this.name=e,this.destroyed=!1,this.postMessageTransfers=!0,this.verbosity=t,this._readyCapability=(0,_util.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,n){pdfWorkerPorts.set(n,this),this._initializeFromPort(n);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()}_initialize(){if(typeof Worker<"u"&&!isWorkerDisabled&&!getMainThreadWorkerMessageHandler()){let e=getWorkerSrc();try{(0,_util.isSameOrigin)(window.location.href,e)||(e=createCDNWrapper(new URL(e,window.location).href));const n=new Worker(e),t=new _message_handler.MessageHandler("main","worker",n),a=()=>{n.removeEventListener("error",r),t.destroy(),n.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},r=()=>{this._webWorker||a()};n.addEventListener("error",r),t.on("test",u=>{if(n.removeEventListener("error",r),this.destroyed){a();return}u?(this._messageHandler=t,this._port=n,this._webWorker=n,u.supportTransfers||(this.postMessageTransfers=!1),this._readyCapability.resolve(),t.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),t.destroy(),n.terminate())}),t.on("ready",u=>{if(n.removeEventListener("error",r),this.destroyed){a();return}try{s()}catch{this._setupFakeWorker()}});const s=()=>{const u=new Uint8Array([this.postMessageTransfers?255:0]);try{t.send("test",u,[u.buffer])}catch{(0,_util.warn)("Cannot use postMessage transfers."),u[0]=0,t.send("test",u)}};s();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),isWorkerDisabled=!0),setupFakeWorkerGlobal().then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const n=new LoopbackPort;this._port=n;const t="fake"+nextFakeWorkerId++,a=new _message_handler.MessageHandler(t+"_worker",t,n);e.setup(a,n);const r=new _message_handler.MessageHandler(t,t+"_worker",n);this._messageHandler=r,this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),pdfWorkerPorts.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return pdfWorkerPorts.has(e.port)?pdfWorkerPorts.get(e.port):new PDFWorker(e)}static getWorkerSrc(){return getWorkerSrc()}}return PDFWorker}();exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(e,n,t,a){this.messageHandler=e,this.loadingTask=n,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:n.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:a.ownerDocument}),this._params=a,this.CMapReaderFactory=new a.CMapReaderFactory({baseUrl:a.cMapUrl,isCompressed:a.cMapPacked}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=t,this._fullReader=null,this._lastProgress=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,_util.createPromiseCapability)(),this.setupMessageHandler()}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];this.pageCache.forEach(function(t){t&&e.push(t._destroy())}),this.pageCache.length=0,this.pagePromises.length=0;const n=this.messageHandler.sendWithPromise("Terminate",null);return e.push(n),Promise.all(e).then(()=>{this.fontLoader.clear(),this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:n}=this;e.on("GetReader",(t,a)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=r=>{this._lastProgress={loaded:r.loaded,total:r.total}},a.onPull=()=>{this._fullReader.read().then(function({value:r,done:s}){if(s){a.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(r),"GetReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(r),1,[r])}).catch(r=>{a.error(r)})},a.onCancel=r=>{this._fullReader.cancel(r),a.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",t=>{const a=(0,_util.createPromiseCapability)(),r=this._fullReader;return r.headersReady.then(()=>{(!r.isStreamingSupported||!r.isRangeSupported)&&(this._lastProgress&&n.onProgress&&n.onProgress(this._lastProgress),r.onProgress=s=>{n.onProgress&&n.onProgress({loaded:s.loaded,total:s.total})}),a.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},a.reject),a.promise}),e.on("GetRangeReader",(t,a)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(t.begin,t.end);if(!r){a.close();return}a.onPull=()=>{r.read().then(function({value:s,done:u}){if(u){a.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(s),"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{a.error(s)})},a.onCancel=s=>{r.cancel(s),a.ready.catch(u=>{if(!this.destroyed)throw u})}}),e.on("GetDoc",({pdfInfo:t})=>{this._numPages=t.numPages,n._capability.resolve(new PDFDocumentProxy(t,this))}),e.on("DocException",function(t){let a;switch(t.name){case"PasswordException":a=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":a=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":a=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":a=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":a=new _util.UnknownErrorException(t.message,t.details);break}a instanceof Error||(0,_util.warn)("DocException - expected a valid Error."),n._capability.reject(a)}),e.on("PasswordRequest",t=>{if(this._passwordCapability=(0,_util.createPromiseCapability)(),n.onPassword){const a=r=>{this._passwordCapability.resolve({password:r})};try{n.onPassword(a,t.code)}catch(r){this._passwordCapability.reject(r)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.promise}),e.on("DataLoaded",t=>{n.onProgress&&n.onProgress({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),e.on("StartRenderPage",t=>{if(this.destroyed)return;this.pageCache[t.pageIndex]._startRenderPage(t.transparency,t.intent)}),e.on("commonobj",t=>{if(this.destroyed)return;const[a,r,s]=t;if(!this.commonObjs.has(a))switch(r){case"Font":const u=this._params;if("error"in s){const c=s.error;(0,_util.warn)(`Error during font loading: ${c}`),this.commonObjs.resolve(a,c);break}let l=null;u.pdfBug&&globalThis.FontInspector&&globalThis.FontInspector.enabled&&(l={registerFont(c,M){globalThis.FontInspector.fontAdded(c,M)}});const y=new _font_loader.FontFaceObject(s,{isEvalSupported:u.isEvalSupported,disableFontFace:u.disableFontFace,ignoreErrors:u.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:l});this.fontLoader.bind(y).catch(c=>e.sendWithPromise("FontFallback",{id:a})).finally(()=>{!u.fontExtraProperties&&y.data&&(y.data=null),this.commonObjs.resolve(a,y)});break;case"FontPath":case"Image":this.commonObjs.resolve(a,s);break;default:throw new Error(`Got unknown common object type ${r}`)}}),e.on("obj",t=>{if(this.destroyed)return;const[a,r,s,u]=t,l=this.pageCache[r];if(!l.objs.has(a))switch(s){case"Image":l.objs.resolve(a,u),u&&"data"in u&&u.data.length>8e6&&(l.cleanupAfterRender=!0);break;default:throw new Error(`Got unknown object type ${s}`)}}),e.on("DocProgress",t=>{this.destroyed||n.onProgress&&n.onProgress({loaded:t.loaded,total:t.total})}),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("FetchBuiltInCMap",(t,a)=>{if(this.destroyed){a.error(new Error("Worker was destroyed"));return}let r=!1;a.onPull=()=>{if(r){a.close();return}r=!0,this.CMapReaderFactory.fetch(t).then(function(s){a.enqueue(s,1,[s.cMapData.buffer])}).catch(function(s){a.error(s)})}})}_onUnsupportedFeature({featureId:e}){this.destroyed||this.loadingTask.onUnsupportedFeature&&this.loadingTask.onUnsupportedFeature(e)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request"));const n=e-1;if(n in this.pagePromises)return this.pagePromises[n];const t=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");const r=new PDFPageProxy(n,a,this,this._params.ownerDocument,this._params.pdfBug);return this.pageCache[n]=r,r});return this.pagePromises[n]=t,t}getPageIndex(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e}).catch(function(n){return Promise.reject(new Error(n))})}getAnnotations(e,n){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:n})}saveDocument(e){return this.messageHandler.sendWithPromise("SaveDocument",{numPages:this._numPages,annotationStorage:e&&e.getAll()||null,filename:this._fullReader?this._fullReader.filename:null}).finally(()=>{e&&e.resetModified()})}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(e=>new _optional_content_config.OptionalContentConfig(e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?this._fullReader.filename:null}))}getStats(){return this.messageHandler.sendWithPromise("GetStats",null)}startCleanup(){return this.messageHandler.sendWithPromise("Cleanup",null).then(()=>{for(let e=0,n=this.pageCache.length;e{this._nextBound().catch(this.cancel.bind(this))}):Promise.resolve().then(this._nextBound).catch(this.cancel.bind(this))}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(),this._canvas&&e.delete(this._canvas),this.callback())))}}return n}(),version="2.6.347";exports.version=version;const build="3be9c65f";exports.build=build},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.FontLoader=e.FontFaceObject=void 0;var t=n(2);class a{constructor({docId:l,onUnsupportedFeature:y,ownerDocument:c=globalThis.document}){this.constructor===a&&(0,t.unreachable)("Cannot initialize BaseFontLoader."),this.docId=l,this._onUnsupportedFeature=y,this._document=c,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(l){this.nativeFontFaces.push(l),this._document.fonts.add(l)}insertRule(l){let y=this.styleElement;y||(y=this.styleElement=this._document.createElement("style"),y.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,this._document.documentElement.getElementsByTagName("head")[0].appendChild(y));const c=y.sheet;c.insertRule(l,c.cssRules.length)}clear(){this.nativeFontFaces.forEach(l=>{this._document.fonts.delete(l)}),this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(l){if(l.attached||l.missingFile)return;if(l.attached=!0,this.isFontLoadingAPISupported){const c=l.createNativeFontFace();if(c){this.addNativeFontFace(c);try{await c.loaded}catch(M){throw this._onUnsupportedFeature({featureId:t.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,t.warn)(`Failed to load font '${c.family}': '${M}'.`),l.disableFontFace=!0,M}}return}const y=l.createFontFaceRule();if(y){if(this.insertRule(y),this.isSyncFontLoadingSupported)return;await new Promise(c=>{const M=this._queueLoadingCallback(c);this._prepareFontLoadEvent([y],[l],M)})}}_queueLoadingCallback(l){(0,t.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){const l=typeof this._document<"u"&&!!this._document.fonts;return(0,t.shadow)(this,"isFontLoadingAPISupported",l)}get isSyncFontLoadingSupported(){(0,t.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,t.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(l,y,c){(0,t.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let r;e.FontLoader=r,e.FontLoader=r=class extends a{constructor(l){super(l),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let l=!1;if(typeof navigator>"u")l=!0;else{const y=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);y&&y[1]>=14&&(l=!0)}return(0,t.shadow)(this,"isSyncFontLoadingSupported",l)}_queueLoadingCallback(l){function y(){for((0,t.assert)(!M.done,"completeRequest() cannot be called twice."),M.done=!0;c.requests.length>0&&c.requests[0].done;){const I=c.requests.shift();setTimeout(I.callback,0)}}const c=this.loadingContext,M={id:`pdfjs-font-loading-${c.nextRequestId++}`,done:!1,complete:y,callback:l};return c.requests.push(M),M}get _loadTestFont(){const l=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,t.shadow)(this,"_loadTestFont",l())}_prepareFontLoadEvent(l,y,c){function M(B,L){return B.charCodeAt(L)<<24|B.charCodeAt(L+1)<<16|B.charCodeAt(L+2)<<8|B.charCodeAt(L+3)&255}function I(B,L,O,k){const j=B.substring(0,L),A=B.substring(L+O);return j+k+A}let m,g;const f=this._document.createElement("canvas");f.width=1,f.height=1;const C=f.getContext("2d");let v=0;function b(B,L){if(v++,v>30){(0,t.warn)("Load test font never loaded."),L();return}if(C.font="30px "+B,C.fillText(".",0,20),C.getImageData(0,0,1,1).data[3]>0){L();return}setTimeout(b.bind(null,B,L))}const h=`lt${Date.now()}${this.loadTestFontId++}`;let o=this._loadTestFont;o=I(o,976,h.length,h);const p=16,w=1482184792;let x=M(o,p);for(m=0,g=h.length-3;m{this._document.body.removeChild(E),c.complete()})}};class s{constructor(l,{isEvalSupported:y=!0,disableFontFace:c=!1,ignoreErrors:M=!1,onUnsupportedFeature:I=null,fontRegistry:m=null}){this.compiledGlyphs=Object.create(null);for(const g in l)this[g]=l[g];this.isEvalSupported=y!==!1,this.disableFontFace=c===!0,this.ignoreErrors=M===!0,this._onUnsupportedFeature=I,this.fontRegistry=m}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;const l=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),l}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const l=(0,t.bytesToString)(new Uint8Array(this.data)),y=`url(data:${this.mimetype};base64,${btoa(l)});`,c=`@font-face {font-family:"${this.loadedName}";src:${y}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,y),c}getPathGenerator(l,y){if(this.compiledGlyphs[y]!==void 0)return this.compiledGlyphs[y];let c,M;try{c=l.get(this.loadedName+"_path_"+y)}catch(I){if(!this.ignoreErrors)throw I;return this._onUnsupportedFeature&&this._onUnsupportedFeature({featureId:t.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,t.warn)(`getPathGenerator - ignoring character: "${I}".`),this.compiledGlyphs[y]=function(m,g){}}if(this.isEvalSupported&&t.IsEvalSupportedCached.value){let I,m="";for(let g=0,f=c.length;g{require$$2.readFile(l,(m,g)=>{if(m||!g){M(new Error(m));return}c({cMapData:new Uint8Array(g),compressionType:y})})})}})},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.AnnotationStorage=void 0;class t{constructor(){this._storage=new Map,this._modified=!1,this.onSetModified=null,this.onResetModified=null}getOrCreateValue(r,s){return this._storage.has(r)?this._storage.get(r):(this._storage.set(r,s),s)}setValue(r,s){this._storage.get(r)!==s&&this._setModified(),this._storage.set(r,s)}getAll(){return this._storage.size===0?null:Object.fromEntries(this._storage)}get size(){return this._storage.size}_setModified(){this._modified||(this._modified=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this._modified&&(this._modified=!1,typeof this.onResetModified=="function"&&this.onResetModified())}}e.AnnotationStorage=t},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.apiCompatibilityParams=void 0;var t=n(4);const a=Object.create(null);(function(){t.isNodeJS&&(a.disableFontFace=!0)})();const r=Object.freeze(a);e.apiCompatibilityParams=r},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasGraphics=void 0;var t=n(2),a=n(11),r=16,s=100,u=4096,l=.65,y=1e3,c=16;function M(C){C.mozCurrentTransform||(C._originalSave=C.save,C._originalRestore=C.restore,C._originalRotate=C.rotate,C._originalScale=C.scale,C._originalTranslate=C.translate,C._originalTransform=C.transform,C._originalSetTransform=C.setTransform,C._transformMatrix=C._transformMatrix||[1,0,0,1,0,0],C._transformStack=[],Object.defineProperty(C,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(C,"mozCurrentTransformInverse",{get:function(){var b=this._transformMatrix,h=b[0],o=b[1],d=b[2],p=b[3],w=b[4],x=b[5],D=h*p-o*d,T=o*d-h*p;return[p/D,o/T,d/T,h/D,(p*w-d*x)/T,(o*w-h*x)/D]}}),C.save=function(){var b=this._transformMatrix;this._transformStack.push(b),this._transformMatrix=b.slice(0,6),this._originalSave()},C.restore=function(){var b=this._transformStack.pop();b&&(this._transformMatrix=b,this._originalRestore())},C.translate=function(b,h){var o=this._transformMatrix;o[4]=o[0]*b+o[2]*h+o[4],o[5]=o[1]*b+o[3]*h+o[5],this._originalTranslate(b,h)},C.scale=function(b,h){var o=this._transformMatrix;o[0]=o[0]*b,o[1]=o[1]*b,o[2]=o[2]*h,o[3]=o[3]*h,this._originalScale(b,h)},C.transform=function(b,h,o,d,p,w){var x=this._transformMatrix;this._transformMatrix=[x[0]*b+x[2]*h,x[1]*b+x[3]*h,x[0]*o+x[2]*d,x[1]*o+x[3]*d,x[0]*p+x[2]*w+x[4],x[1]*p+x[3]*w+x[5]],C._originalTransform(b,h,o,d,p,w)},C.setTransform=function(b,h,o,d,p,w){this._transformMatrix=[b,h,o,d,p,w],C._originalSetTransform(b,h,o,d,p,w)},C.rotate=function(b){var h=Math.cos(b),o=Math.sin(b),d=this._transformMatrix;this._transformMatrix=[d[0]*h+d[2]*o,d[1]*h+d[3]*o,d[0]*-o+d[2]*h,d[1]*-o+d[3]*h,d[4],d[5]],this._originalRotate(b)})}var I=function(){function v(b){this.canvasFactory=b,this.cache=Object.create(null)}return v.prototype={getCanvas:function(h,o,d,p){var w;return this.cache[h]!==void 0?(w=this.cache[h],this.canvasFactory.reset(w,o,d),w.context.setTransform(1,0,0,1,0,0)):(w=this.canvasFactory.create(o,d),this.cache[h]=w),p&&M(w.context),w},clear(){for(var b in this.cache){var h=this.cache[b];this.canvasFactory.destroy(h),delete this.cache[b]}}},v}();function m(C){var v=1e3,b=C.width,h=C.height,o,d,p,w=b+1,x=new Uint8Array(w*(h+1)),D=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),T=b+7&-8,P=C.data,E=new Uint8Array(T*h),B=0,L;for(o=0,L=P.length;o0;)E[B++]=k&O?0:255,O>>=1;var j=0;for(B=0,E[B]!==0&&(x[0]=1,++j),d=1;d>2)+(E[B+1]?4:0)+(E[B-T+1]?8:0),D[A]&&(x[p+d]=D[A],++j),B++;if(E[B-T]!==E[B]&&(x[p+d]=E[B]?2:4,++j),j>v)return null}for(B=T*(h-1),p=o*w,E[B]!==0&&(x[p]=8,++j),d=1;dv)return null;var S=new Int32Array([0,w,-1,0,-w,0,0,0,1]),R=[];for(o=0;j&&o<=h;o++){for(var N=o*w,U=N+b;N>4,x[N]&=G>>2|G<<2),F.push(N%w),F.push(N/w|0),x[N]||--j}while(z!==N);R.push(F),--o}}var K=function(Y){Y.save(),Y.scale(1/b,-1/h),Y.translate(0,-h),Y.beginPath();for(let J=0,X=R.length;J>2),de=re.length,Me=U+7>>3,me=4294967295,ge=t.IsLittleEndianCached.value?4278190080:255;for(le&&le[0]===255&&le[255]===0&&([me,ge]=[ge,me]),J=0;JMe?U:we*8-7,xe=Ae&-8,ye=0,be=0;ue>=1}for(;K=G&&($=F,ee=U*$),K=0,X=ee;X--;)H[K++]=Y[V++],H[K++]=Y[V++],H[K++]=Y[V++],H[K++]=255;if(ue)for(let se=0;se>=1}A.putImageData(z,0,Y*c)}}function p(A,S){for(var R=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],N=0,U=R.length;N>8,A[F-2]=A[F-2]*G+R*z>>8,A[F-1]=A[F-1]*G+N*z>>8}}}function D(A,S,R){for(var N=A.length,U=1/255,F=3;F>8]>>8:S[U]*F>>16}}function P(A,S,R,N,U,F,G){var z=!!F,W=z?F[0]:0,V=z?F[1]:0,K=z?F[2]:0,Y;U==="Luminosity"?Y=T:Y=D;for(var H=1048576,J=Math.min(N,Math.ceil(H/R)),X=0;Xb&&typeof N=="function",K=V?Date.now()+v:0,Y=0,H=this.commonObjs,J=this.objs,X;;){if(U!==void 0&&z===U.nextBreakPoint)return U.breakIt(z,N),z;if(X=G[z],X!==t.OPS.dependency)this[X].apply(this,F[z]);else for(const $ of F[z]){const ee=$.startsWith("g_")?H:J;if(!ee.has($))return ee.get($,N),z}if(z++,z===W)return z;if(V&&++Y>b){if(Date.now()>K)return N(),z;Y=0}}},endDrawing:function(){this.current.activeSMask!==null&&this.endSMaskGroup(),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),this.cachedCanvases.clear(),this.webGLContext.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(S){this.current.lineWidth=S,this.ctx.lineWidth=S},setLineCap:function(S){this.ctx.lineCap=B[S]},setLineJoin:function(S){this.ctx.lineJoin=L[S]},setMiterLimit:function(S){this.ctx.miterLimit=S},setDash:function(S,R){var N=this.ctx;N.setLineDash!==void 0&&(N.setLineDash(S),N.lineDashOffset=R)},setRenderingIntent(A){},setFlatness(A){},setGState:function(S){for(var R=0,N=S.length;R0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=G?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null;break;case"TR":this.current.transferMaps=G}}},beginSMaskGroup:function(){var S=this.current.activeSMask,R=S.canvas.width,N=S.canvas.height,U="smaskGroupAt"+this.groupLevel,F=this.cachedCanvases.getCanvas(U,R,N,!0),G=this.ctx,z=G.mozCurrentTransform;this.ctx.save();var W=F.context;W.scale(1/S.scaleX,1/S.scaleY),W.translate(-S.offsetX,-S.offsetY),W.transform.apply(W,z),S.startTransformInverse=W.mozCurrentTransformInverse,p(G,W),this.ctx=W,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(G),this.groupLevel++},suspendSMaskGroup:function(){var S=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),E(this.ctx,this.current.activeSMask,S,this.webGLContext),this.ctx.restore(),this.ctx.save(),p(S,this.ctx),this.current.resumeSMaskCtx=S;var R=t.Util.transform(this.current.activeSMask.startTransformInverse,S.mozCurrentTransform);this.ctx.transform.apply(this.ctx,R),S.save(),S.setTransform(1,0,0,1,0,0),S.clearRect(0,0,S.canvas.width,S.canvas.height),S.restore()},resumeSMaskGroup:function(){var S=this.current.resumeSMaskCtx,R=this.ctx;this.ctx=S,this.groupStack.push(R),this.groupLevel++},endSMaskGroup:function(){var S=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),E(this.ctx,this.current.activeSMask,S,this.webGLContext),this.ctx.restore(),p(S,this.ctx);var R=t.Util.transform(this.current.activeSMask.startTransformInverse,S.mozCurrentTransform);this.ctx.transform.apply(this.ctx,R)},save:function(){this.ctx.save();var S=this.current;this.stateStack.push(S),this.current=S.clone(),this.current.resumeSMaskCtx=null},restore:function(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),this.current.activeSMask!==null&&(this.stateStack.length===0||this.stateStack[this.stateStack.length-1].activeSMask!==this.current.activeSMask)&&this.endSMaskGroup(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null)},transform:function(S,R,N,U,F,G){this.ctx.transform(S,R,N,U,F,G),this._cachedGetSinglePixelWidth=null},constructPath:function(S,R){for(var N=this.ctx,U=this.current,F=U.x,G=U.y,z=0,W=0,V=S.length;zs&&(V=s),this.current.fontSizeScale=R/V,this.ctx.font=`${z} ${G} ${V}px ${W}`},setTextRenderingMode:function(S){this.current.textRenderingMode=S},setTextRise:function(S){this.current.textRise=S},moveText:function(S,R){this.current.x=this.current.lineX+=S,this.current.y=this.current.lineY+=R},setLeadingMoveText:function(S,R){this.setLeading(-R),this.moveText(S,R)},setTextMatrix:function(S,R,N,U,F,G){this.current.textMatrix=[S,R,N,U,F,G],this.current.textMatrixScale=Math.sqrt(S*S+R*R),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar(A,S,R,N){var U=this.ctx,F=this.current,G=F.font,z=F.textRenderingMode,W=F.fontSize/F.fontSizeScale,V=z&t.TextRenderingMode.FILL_STROKE_MASK,K=!!(z&t.TextRenderingMode.ADD_TO_PATH_FLAG);const Y=F.patternFill&&!G.missingFile;var H;if((G.disableFontFace||K||Y)&&(H=G.getPathGenerator(this.commonObjs,A)),G.disableFontFace||Y?(U.save(),U.translate(S,R),U.beginPath(),H(U,W),N&&U.setTransform.apply(U,N),(V===t.TextRenderingMode.FILL||V===t.TextRenderingMode.FILL_STROKE)&&U.fill(),(V===t.TextRenderingMode.STROKE||V===t.TextRenderingMode.FILL_STROKE)&&U.stroke(),U.restore()):((V===t.TextRenderingMode.FILL||V===t.TextRenderingMode.FILL_STROKE)&&U.fillText(A,S,R),(V===t.TextRenderingMode.STROKE||V===t.TextRenderingMode.FILL_STROKE)&&U.strokeText(A,S,R)),K){var J=this.pendingTextPaths||(this.pendingTextPaths=[]);J.push({transform:U.mozCurrentTransform,x:S,y:R,fontSize:W,addToPath:H})}},get isFontSubpixelAAEnabled(){const{context:A}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);A.scale(1.5,1),A.fillText("I",0,10);for(var S=A.getImageData(0,0,10,10).data,R=!1,N=3;N0&&S[N]<255){R=!0;break}return(0,t.shadow)(this,"isFontSubpixelAAEnabled",R)},showText:function(S){var R=this.current,N=R.font;if(N.isType3Font)return this.showType3Text(S);var U=R.fontSize;if(U===0)return;var F=this.ctx,G=R.fontSizeScale,z=R.charSpacing,W=R.wordSpacing,V=R.fontDirection,K=R.textHScale*V,Y=S.length,H=N.vertical,J=H?1:-1,X=N.defaultVMetrics,$=U*R.fontMatrix[0],ee=R.textRenderingMode===t.TextRenderingMode.FILL&&!N.disableFontFace&&!R.patternFill;F.save();let _;if(R.patternFill){F.save();const ce=R.fillColor.getPattern(F,this);_=F.mozCurrentTransform,F.restore(),F.fillStyle=ce}F.transform.apply(F,R.textMatrix),F.translate(R.x,R.y+R.textRise),V>0?F.scale(K,-1):F.scale(K,1);var ie=R.lineWidth,oe=R.textMatrixScale;if(oe===0||ie===0){var le=R.textRenderingMode&t.TextRenderingMode.FILL_STROKE_MASK;(le===t.TextRenderingMode.STROKE||le===t.TextRenderingMode.FILL_STROKE)&&(this._cachedGetSinglePixelWidth=null,ie=this.getSinglePixelWidth()*l)}else ie/=oe;G!==1&&(F.scale(G,G),ie/=G),F.lineWidth=ie;var pe=0,re;for(re=0;re0){var Z=F.measureText(ge).width*1e3/U*G;if(uenew h(G,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext)};R=new a.TilingPattern(S,N,this.ctx,F,U)}else R=(0,a.getShadingPatternFromIR)(S);return R},setStrokeColorN:function(){this.current.strokeColor=this.getColorN_Pattern(arguments)},setFillColorN:function(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0},setStrokeRGBColor:function(S,R,N){var U=t.Util.makeCssRgb(S,R,N);this.ctx.strokeStyle=U,this.current.strokeColor=U},setFillRGBColor:function(S,R,N){var U=t.Util.makeCssRgb(S,R,N);this.ctx.fillStyle=U,this.current.fillColor=U,this.current.patternFill=!1},shadingFill:function(S){if(this.contentVisible){var R=this.ctx;this.save();var N=(0,a.getShadingPatternFromIR)(S);R.fillStyle=N.getPattern(R,this,!0);var U=R.mozCurrentTransformInverse;if(U){var F=R.canvas,G=F.width,z=F.height,W=t.Util.applyTransform([0,0],U),V=t.Util.applyTransform([0,z],U),K=t.Util.applyTransform([G,0],U),Y=t.Util.applyTransform([G,z],U),H=Math.min(W[0],V[0],K[0],Y[0]),J=Math.min(W[1],V[1],K[1],Y[1]),X=Math.max(W[0],V[0],K[0],Y[0]),$=Math.max(W[1],V[1],K[1],Y[1]);this.ctx.fillRect(H,J,X-H,$-J)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()}},beginInlineImage:function(){(0,t.unreachable)("Should not call beginInlineImage")},beginImageData:function(){(0,t.unreachable)("Should not call beginImageData")},paintFormXObjectBegin:function(S,R){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(S)&&S.length===6&&this.transform.apply(this,S),this.baseTransform=this.ctx.mozCurrentTransform,R)){var N=R[2]-R[0],U=R[3]-R[1];this.ctx.rect(R[0],R[1],N,U),this.clip(),this.endPath()}},paintFormXObjectEnd:function(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())},beginGroup:function(S){if(this.contentVisible){this.save();var R=this.ctx;S.isolated||(0,t.info)("TODO: Support non-isolated groups."),S.knockout&&(0,t.warn)("Knockout groups not supported.");var N=R.mozCurrentTransform;if(S.matrix&&R.transform.apply(R,S.matrix),!S.bbox)throw new Error("Bounding box is required.");var U=t.Util.getAxialAlignedBoundingBox(S.bbox,R.mozCurrentTransform),F=[0,0,R.canvas.width,R.canvas.height];U=t.Util.intersect(U,F)||[0,0,0,0];var G=Math.floor(U[0]),z=Math.floor(U[1]),W=Math.max(Math.ceil(U[2])-G,1),V=Math.max(Math.ceil(U[3])-z,1),K=1,Y=1;W>u&&(K=W/u,W=u),V>u&&(Y=V/u,V=u);var H="groupAt"+this.groupLevel;S.smask&&(H+="_smask_"+this.smaskCounter++%2);var J=this.cachedCanvases.getCanvas(H,W,V,!0),X=J.context;X.scale(1/K,1/Y),X.translate(-G,-z),X.transform.apply(X,N),S.smask?this.smaskStack.push({canvas:J.canvas,context:X,offsetX:G,offsetY:z,scaleX:K,scaleY:Y,subtype:S.smask.subtype,backdrop:S.smask.backdrop,transferMap:S.smask.transferMap||null,startTransformInverse:null}):(R.setTransform(1,0,0,1,0,0),R.translate(G,z),R.scale(K,Y)),p(R,X),this.ctx=X,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(R),this.groupLevel++,this.current.activeSMask=null}},endGroup:function(S){if(this.contentVisible){this.groupLevel--;var R=this.ctx;this.ctx=this.groupStack.pop(),this.ctx.imageSmoothingEnabled!==void 0?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,S.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(R.canvas,0,0),this.restore()}},beginAnnotations:function(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(S,R,N){if(this.save(),w(this.ctx),this.current=new g,Array.isArray(S)&&S.length===4){var U=S[2]-S[0],F=S[3]-S[1];this.ctx.rect(S[0],S[1],U,F),this.clip(),this.endPath()}this.transform.apply(this,R),this.transform.apply(this,N)},endAnnotation:function(){this.restore()},paintImageMaskXObject:function(S){if(this.contentVisible){var R=this.ctx,N=S.width,U=S.height,F=this.current.fillColor,G=this.current.patternFill,z=this.processingType3;if(z&&z.compiled===void 0&&(N<=y&&U<=y?z.compiled=m({data:S.data,width:N,height:U}):z.compiled=null),z&&z.compiled){z.compiled(R);return}var W=this.cachedCanvases.getCanvas("maskCanvas",N,U),V=W.context;V.save(),d(V,S),V.globalCompositeOperation="source-in",V.fillStyle=G?F.getPattern(V,this):F,V.fillRect(0,0,N,U),V.restore(),this.paintInlineImageXObject(W.canvas)}},paintImageMaskXObjectRepeat(A,S,R=0,N=0,U,F){if(this.contentVisible){var G=A.width,z=A.height,W=this.current.fillColor,V=this.current.patternFill,K=this.cachedCanvases.getCanvas("maskCanvas",G,z),Y=K.context;Y.save(),d(Y,A),Y.globalCompositeOperation="source-in",Y.fillStyle=V?W.getPattern(Y,this):W,Y.fillRect(0,0,G,z),Y.restore();for(var H=this.ctx,J=0,X=F.length;J2&&$>1||Y>2&&ee>1;){var ie=$,oe=ee;W>2&&$>1&&(ie=Math.ceil($/2),W/=$/ie),Y>2&&ee>1&&(oe=Math.ceil(ee/2),Y/=ee/oe),J=this.cachedCanvases.getCanvas(_,ie,oe),X=J.context,X.clearRect(0,0,ie,oe),X.drawImage(H,0,0,$,ee,0,0,ie,oe),H=J.canvas,$=ie,ee=oe,_=_==="prescale1"?"prescale2":"prescale1"}if(U.drawImage(H,0,0,$,ee,0,-N,R,N),this.imageLayer){var le=this.getCanvasPosition(0,-N);this.imageLayer.appendImage({imgData:S,left:le[0],top:le[1],width:R/F[0],height:N/F[3]})}this.restore()}},paintInlineImageXObjectGroup:function(S,R){if(this.contentVisible){var N=this.ctx,U=S.width,F=S.height,G=this.cachedCanvases.getCanvas("inlineImage",U,F),z=G.context;o(z,S,this.current.transferMaps);for(var W=0,V=R.length;W=0;S--)if(!this.markedContentStack[S].visible)return!1;return!0}};for(var j in t.OPS)h.prototype[t.OPS[j]]=h.prototype[j];return h}();e.CanvasGraphics=f},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.getShadingPatternFromIR=u,e.TilingPattern=void 0;var t=n(2),a={};function r(y,c){if(!c||typeof Path2D>"u")return;const M=c[2]-c[0],I=c[3]-c[1],m=new Path2D;m.rect(c[0],c[1],M,I),y.clip(m)}a.RadialAxial={fromIR:function(c){var M=c[1],I=c[2],m=c[3],g=c[4],f=c[5],C=c[6],v=c[7];return{type:"Pattern",getPattern:function(h){r(h,I);var o;M==="axial"?o=h.createLinearGradient(g[0],g[1],f[0],f[1]):M==="radial"&&(o=h.createRadialGradient(g[0],g[1],C,f[0],f[1],v));for(var d=0,p=m.length;dd[C+1]&&(D=f,f=C,C=D,D=b,b=h,h=D),d[C+1]>d[v+1]&&(D=C,C=v,v=D,D=h,h=o,o=D),d[f+1]>d[C+1]&&(D=f,f=C,C=D,D=b,b=h,h=D);var T=(d[f]+g.offsetX)*g.scaleX,P=(d[f+1]+g.offsetY)*g.scaleY,E=(d[C]+g.offsetX)*g.scaleX,B=(d[C+1]+g.offsetY)*g.scaleY,L=(d[v]+g.offsetX)*g.scaleX,O=(d[v+1]+g.offsetY)*g.scaleY;if(!(P>=O))for(var k=p[b],j=p[b+1],A=p[b+2],S=p[h],R=p[h+1],N=p[h+2],U=p[o],F=p[o+1],G=p[o+2],z=Math.round(P),W=Math.round(O),V,K,Y,H,J,X,$,ee,_=z;_<=W;_++){if(_O?de=1:B===O?de=0:de=(B-_)/(B-O),V=E-(E-L)*de,K=S-(S-U)*de,Y=R-(R-F)*de,H=N-(N-G)*de}let re;_O?re=1:re=(P-_)/(P-O),J=T-(T-L)*re,X=k-(k-U)*re,$=j-(j-F)*re,ee=A-(A-G)*re;for(var ie=Math.round(Math.min(V,J)),oe=Math.round(Math.max(V,J)),le=x*_+ie*4,pe=ie;pe<=oe;pe++)re=(V-pe)/(V-J),re<0?re=0:re>1&&(re=1),w[le++]=K-(K-X)*re|0,w[le++]=Y-(Y-$)*re|0,w[le++]=H-(H-ee)*re|0,w[le++]=255}}function M(m,g,f){var C=g.coords,v=g.colors,b,h;switch(g.type){case"lattice":var o=g.verticesPerRow,d=Math.floor(C.length/o)-1,p=o-1;for(b=0;b=v?b=v:C=b/g,{scale:C,size:b}},clipBbox:function(g,f,C,v,b,h){if(Array.isArray(f)&&f.length===4){var o=b-C,d=h-v;g.ctx.rect(C,v,o,d),g.clip(),g.endPath()}},setFillAndStrokeStyleToContext:function(g,f,C){const v=g.ctx,b=g.current;switch(f){case c.COLORED:var h=this.ctx;v.fillStyle=h.fillStyle,v.strokeStyle=h.strokeStyle,b.fillColor=h.fillStyle,b.strokeColor=h.strokeStyle;break;case c.UNCOLORED:var o=t.Util.makeCssRgb(C[0],C[1],C[2]);v.fillStyle=o,v.strokeStyle=o,b.fillColor=o,b.strokeColor=o;break;default:throw new t.FormatError(`Unsupported paint type: ${f}`)}},getPattern:function(g,f){g=this.ctx,g.setTransform.apply(g,this.baseTransform),g.transform.apply(g,this.matrix);var C=this.createPatternCanvas(f);return g.createPattern(C,"repeat")}},I}();e.TilingPattern=l},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.GlobalWorkerOptions=void 0;const t=Object.create(null);e.GlobalWorkerOptions=t,t.workerPort=t.workerPort===void 0?null:t.workerPort,t.workerSrc=t.workerSrc===void 0?"":t.workerSrc},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;var t=n(2);const a={UNKNOWN:0,DATA:1,ERROR:2},r={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function s(l){if(typeof l!="object"||l===null)return l;switch(l.name){case"AbortException":return new t.AbortException(l.message);case"MissingPDFException":return new t.MissingPDFException(l.message);case"UnexpectedResponseException":return new t.UnexpectedResponseException(l.message,l.status);case"UnknownErrorException":return new t.UnknownErrorException(l.message,l.details);default:return new t.UnknownErrorException(l.message,l.toString())}}class u{constructor(y,c,M){this.sourceName=y,this.targetName=c,this.comObj=M,this.callbackId=1,this.streamId=1,this.postMessageTransfers=!0,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=I=>{const m=I.data;if(m.targetName!==this.sourceName)return;if(m.stream){this._processStreamMessage(m);return}if(m.callback){const f=m.callbackId,C=this.callbackCapabilities[f];if(!C)throw new Error(`Cannot resolve callback ${f}`);if(delete this.callbackCapabilities[f],m.callback===a.DATA)C.resolve(m.data);else if(m.callback===a.ERROR)C.reject(s(m.reason));else throw new Error("Unexpected callback case");return}const g=this.actionHandler[m.action];if(!g)throw new Error(`Unknown action from worker: ${m.action}`);if(m.callbackId){const f=this.sourceName,C=m.sourceName;new Promise(function(v){v(g(m.data))}).then(function(v){M.postMessage({sourceName:f,targetName:C,callback:a.DATA,callbackId:m.callbackId,data:v})},function(v){M.postMessage({sourceName:f,targetName:C,callback:a.ERROR,callbackId:m.callbackId,reason:s(v)})});return}if(m.streamId){this._createStreamSink(m);return}g(m.data)},M.addEventListener("message",this._onComObjOnMessage)}on(y,c){const M=this.actionHandler;if(M[y])throw new Error(`There is already an actionName called "${y}"`);M[y]=c}send(y,c,M){this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:y,data:c},M)}sendWithPromise(y,c,M){const I=this.callbackId++,m=(0,t.createPromiseCapability)();this.callbackCapabilities[I]=m;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:y,callbackId:I,data:c},M)}catch(g){m.reject(g)}return m.promise}sendWithStream(y,c,M,I){const m=this.streamId++,g=this.sourceName,f=this.targetName,C=this.comObj;return new ReadableStream({start:v=>{const b=(0,t.createPromiseCapability)();return this.streamControllers[m]={controller:v,startCall:b,pullCall:null,cancelCall:null,isClosed:!1},this._postMessage({sourceName:g,targetName:f,action:y,streamId:m,data:c,desiredSize:v.desiredSize},I),b.promise},pull:v=>{const b=(0,t.createPromiseCapability)();return this.streamControllers[m].pullCall=b,C.postMessage({sourceName:g,targetName:f,stream:r.PULL,streamId:m,desiredSize:v.desiredSize}),b.promise},cancel:v=>{(0,t.assert)(v instanceof Error,"cancel must have a valid reason");const b=(0,t.createPromiseCapability)();return this.streamControllers[m].cancelCall=b,this.streamControllers[m].isClosed=!0,C.postMessage({sourceName:g,targetName:f,stream:r.CANCEL,streamId:m,reason:s(v)}),b.promise}},M)}_createStreamSink(y){const c=this,M=this.actionHandler[y.action],I=y.streamId,m=this.sourceName,g=y.sourceName,f=this.comObj,C={enqueue(v,b=1,h){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=b,o>0&&this.desiredSize<=0&&(this.sinkCapability=(0,t.createPromiseCapability)(),this.ready=this.sinkCapability.promise),c._postMessage({sourceName:m,targetName:g,stream:r.ENQUEUE,streamId:I,chunk:v},h)},close(){this.isCancelled||(this.isCancelled=!0,f.postMessage({sourceName:m,targetName:g,stream:r.CLOSE,streamId:I}),delete c.streamSinks[I])},error(v){(0,t.assert)(v instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,f.postMessage({sourceName:m,targetName:g,stream:r.ERROR,streamId:I,reason:s(v)}))},sinkCapability:(0,t.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:y.desiredSize,ready:null};C.sinkCapability.resolve(),C.ready=C.sinkCapability.promise,this.streamSinks[I]=C,new Promise(function(v){v(M(y.data,C))}).then(function(){f.postMessage({sourceName:m,targetName:g,stream:r.START_COMPLETE,streamId:I,success:!0})},function(v){f.postMessage({sourceName:m,targetName:g,stream:r.START_COMPLETE,streamId:I,reason:s(v)})})}_processStreamMessage(y){const c=y.streamId,M=this.sourceName,I=y.sourceName,m=this.comObj;switch(y.stream){case r.START_COMPLETE:y.success?this.streamControllers[c].startCall.resolve():this.streamControllers[c].startCall.reject(s(y.reason));break;case r.PULL_COMPLETE:y.success?this.streamControllers[c].pullCall.resolve():this.streamControllers[c].pullCall.reject(s(y.reason));break;case r.PULL:if(!this.streamSinks[c]){m.postMessage({sourceName:M,targetName:I,stream:r.PULL_COMPLETE,streamId:c,success:!0});break}this.streamSinks[c].desiredSize<=0&&y.desiredSize>0&&this.streamSinks[c].sinkCapability.resolve(),this.streamSinks[c].desiredSize=y.desiredSize;const{onPull:g}=this.streamSinks[y.streamId];new Promise(function(C){C(g&&g())}).then(function(){m.postMessage({sourceName:M,targetName:I,stream:r.PULL_COMPLETE,streamId:c,success:!0})},function(C){m.postMessage({sourceName:M,targetName:I,stream:r.PULL_COMPLETE,streamId:c,reason:s(C)})});break;case r.ENQUEUE:if((0,t.assert)(this.streamControllers[c],"enqueue should have stream controller"),this.streamControllers[c].isClosed)break;this.streamControllers[c].controller.enqueue(y.chunk);break;case r.CLOSE:if((0,t.assert)(this.streamControllers[c],"close should have stream controller"),this.streamControllers[c].isClosed)break;this.streamControllers[c].isClosed=!0,this.streamControllers[c].controller.close(),this._deleteStreamController(c);break;case r.ERROR:(0,t.assert)(this.streamControllers[c],"error should have stream controller"),this.streamControllers[c].controller.error(s(y.reason)),this._deleteStreamController(c);break;case r.CANCEL_COMPLETE:y.success?this.streamControllers[c].cancelCall.resolve():this.streamControllers[c].cancelCall.reject(s(y.reason)),this._deleteStreamController(c);break;case r.CANCEL:if(!this.streamSinks[c])break;const{onCancel:f}=this.streamSinks[y.streamId];new Promise(function(C){C(f&&f(s(y.reason)))}).then(function(){m.postMessage({sourceName:M,targetName:I,stream:r.CANCEL_COMPLETE,streamId:c,success:!0})},function(C){m.postMessage({sourceName:M,targetName:I,stream:r.CANCEL_COMPLETE,streamId:c,reason:s(C)})}),this.streamSinks[c].sinkCapability.reject(s(y.reason)),this.streamSinks[c].isCancelled=!0,delete this.streamSinks[c];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(y){await Promise.allSettled([this.streamControllers[y].startCall,this.streamControllers[y].pullCall,this.streamControllers[y].cancelCall].map(function(c){return c&&c.promise})),delete this.streamControllers[y]}_postMessage(y,c){c&&this.postMessageTransfers?this.comObj.postMessage(y,c):this.comObj.postMessage(y)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}e.MessageHandler=u},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var t=n(2),a=n(15);class r{constructor(u){(0,t.assert)(typeof u=="string","Metadata: input is not a string"),u=this._repair(u);const y=new a.SimpleXMLParser().parseFromString(u);this._metadataMap=new Map,y&&this._parse(y)}_repair(u){return u.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,function(l,y){const c=y.replace(/\\([0-3])([0-7])([0-7])/g,function(I,m,g,f){return String.fromCharCode(m*64+g*8+f*1)}).replace(/&(amp|apos|gt|lt|quot);/g,function(I,m){switch(m){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${m} isn't defined.`)});let M="";for(let I=0,m=c.length;I=32&&g<127&&g!==60&&g!==62&&g!==38?M+=String.fromCharCode(g):M+="&#x"+(65536+g).toString(16).substring(1)+";"}return">"+M})}_parse(u){let l=u.documentElement;if(l.nodeName.toLowerCase()!=="rdf:rdf")for(l=l.firstChild;l&&l.nodeName.toLowerCase()!=="rdf:rdf";)l=l.nextSibling;const y=l?l.nodeName.toLowerCase():null;if(!l||y!=="rdf:rdf"||!l.hasChildNodes())return;const c=l.childNodes;for(let M=0,I=c.length;M{if(I.substring(0,2)==="#x")return String.fromCharCode(parseInt(I.substring(2),16));if(I.substring(0,1)==="#")return String.fromCharCode(parseInt(I.substring(1),10));switch(I){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"'}return this.onResolveEntity(I)})}_parseContent(c,M){const I=[];let m=M;function g(){for(;m"&&c[m]!=="/";)++m;const f=c.substring(M,m);for(g();m"&&c[m]!=="/"&&c[m]!=="?";){g();let C="",v="";for(;m"&&c[I]!=="/";)++I;const g=c.substring(M,I);m();const f=I;for(;I");)++I;const C=c.substring(f,I);return{name:g,value:C,parsed:I-M}}parseXml(c){let M=0;for(;M",m),f<0){this.onError(t.UnterminatedElement);return}this.onEndElement(c.substring(m,f)),m=f+1;break;case"?":++m;const C=this._parseProcessingInstruction(c,m);if(c.substring(m+C.parsed,m+C.parsed+2)!=="?>"){this.onError(t.UnterminatedXmlDeclaration);return}this.onPi(C.name,C.value),m+=C.parsed+2;break;case"!":if(c.substring(m+1,m+3)==="--"){if(f=c.indexOf("-->",m+3),f<0){this.onError(t.UnterminatedComment);return}this.onComment(c.substring(m+3,f)),m=f+3}else if(c.substring(m+1,m+8)==="[CDATA["){if(f=c.indexOf("]]>",m+8),f<0){this.onError(t.UnterminatedCdat);return}this.onCdata(c.substring(m+8,f)),m=f+3}else if(c.substring(m+1,m+8)==="DOCTYPE"){const h=c.indexOf("[",m+8);let o=!1;if(f=c.indexOf(">",m+8),f<0){this.onError(t.UnterminatedDoctypeDeclaration);return}if(h>0&&f>h){if(f=c.indexOf("]>",m+8),f<0){this.onError(t.UnterminatedDoctypeDeclaration);return}o=!0}const d=c.substring(m+8,f+(o?1:0));this.onDoctype(d),m=f+(o?2:1)}else{this.onError(t.MalformedElement);return}break;default:const v=this._parseContent(c,m);if(v===null){this.onError(t.MalformedElement);return}let b=!1;if(c.substring(m+v.parsed,m+v.parsed+2)==="/>")b=!0;else if(c.substring(m+v.parsed,m+v.parsed+1)!==">"){this.onError(t.UnterminatedElement);return}this.onBeginElement(v.name,v.attributes,b),m+=v.parsed+(b?2:1);break}}else{for(;m0}}class l extends s{constructor(){super(),this._currentFragment=null,this._stack=null,this._errorCode=t.NoError}parseFromString(c){if(this._currentFragment=[],this._stack=[],this._errorCode=t.NoError,this.parseXml(c),this._errorCode!==t.NoError)return;const[M]=this._currentFragment;if(M)return{documentElement:M}}onResolveEntity(c){switch(c){case"apos":return"'"}return super.onResolveEntity(c)}onText(c){if(r(c))return;const M=new u("#text",c);this._currentFragment.push(M)}onCdata(c){const M=new u("#text",c);this._currentFragment.push(M)}onBeginElement(c,M,I){const m=new u(c);m.childNodes=[],this._currentFragment.push(m),!I&&(this._stack.push(this._currentFragment),this._currentFragment=m.childNodes)}onEndElement(c){this._currentFragment=this._stack.pop()||[];const M=this._currentFragment[this._currentFragment.length-1];if(M)for(let I=0,m=M.childNodes.length;I0){const M=new Uint8Array(c).buffer;this._queuedChunks.push(M)}this._pdfDataRangeTransport=y,this._isStreamingSupported=!l.disableStream,this._isRangeSupported=!l.disableRange,this._contentLength=l.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((M,I)=>{this._onReceiveData({begin:M,chunk:I})}),this._pdfDataRangeTransport.addProgressListener((M,I)=>{this._onProgress({loaded:M,total:I})}),this._pdfDataRangeTransport.addProgressiveReadListener(M=>{this._onReceiveData({chunk:M})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(l){const y=new Uint8Array(l.chunk).buffer;if(l.begin===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(y):this._queuedChunks.push(y);else{const c=this._rangeReaders.some(function(M){return M._begin!==l.begin?!1:(M._enqueue(y),!0)});(0,t.assert)(c,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}_onProgress(l){if(l.total===void 0){const y=this._rangeReaders[0];y&&y.onProgress&&y.onProgress({loaded:l.loaded})}else{const y=this._fullRequestReader;y&&y.onProgress&&y.onProgress({loaded:l.loaded,total:l.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(l){const y=this._rangeReaders.indexOf(l);y>=0&&this._rangeReaders.splice(y,1)}getFullReader(){(0,t.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const l=this._queuedChunks;return this._queuedChunks=null,new r(this,l,this._progressiveDone)}getRangeReader(l,y){if(y<=this._progressiveDataLength)return null;const c=new s(this,l,y);return this._pdfDataRangeTransport.requestDataRange(l,y),this._rangeReaders.push(c),c}cancelAllRequests(l){this._fullRequestReader&&this._fullRequestReader.cancel(l),this._rangeReaders.slice(0).forEach(function(c){c.cancel(l)}),this._pdfDataRangeTransport.abort()}}e.PDFDataTransportStream=a;class r{constructor(l,y,c=!1){this._stream=l,this._done=c||!1,this._filename=null,this._queuedChunks=y||[],this._loaded=0;for(const M of this._queuedChunks)this._loaded+=M.byteLength;this._requests=[],this._headersReady=Promise.resolve(),l._fullRequestReader=this,this.onProgress=null}_enqueue(l){this._done||(this._requests.length>0?this._requests.shift().resolve({value:l,done:!1}):this._queuedChunks.push(l),this._loaded+=l.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 l=(0,t.createPromiseCapability)();return this._requests.push(l),l.promise}cancel(l){this._done=!0,this._requests.forEach(function(y){y.resolve({value:void 0,done:!0})}),this._requests=[]}progressiveDone(){this._done||(this._done=!0)}}class s{constructor(l,y,c){this._stream=l,this._begin=y,this._end=c,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(l){this._done||(this._requests.length===0?this._queuedChunk=l:(this._requests.shift().resolve({value:l,done:!1}),this._requests.forEach(function(c){c.resolve({value:void 0,done:!0})}),this._requests=[]),this._done=!0,this._stream._removeRangeReader(this))}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const y=this._queuedChunk;return this._queuedChunk=null,{value:y,done:!1}}if(this._done)return{value:void 0,done:!0};const l=(0,t.createPromiseCapability)();return this._requests.push(l),l.promise}cancel(l){this._done=!0,this._requests.forEach(function(y){y.resolve({value:void 0,done:!0})}),this._requests=[],this._stream._removeRangeReader(this)}}},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLContext=void 0;var t=n(2);class a{constructor({enable:u=!1}){this._enabled=u===!0}get isEnabled(){let u=this._enabled;return u&&(u=r.tryInitGL()),(0,t.shadow)(this,"isEnabled",u)}composeSMask({layer:u,mask:l,properties:y}){return r.composeSMask(u,l,y)}drawFigures({width:u,height:l,backgroundColor:y,figures:c,context:M}){return r.drawFigures(u,l,y,c,M)}clear(){r.cleanup()}}e.WebGLContext=a;var r=function(){function u(D,T,P){var E=D.createShader(P);D.shaderSource(E,T),D.compileShader(E);var B=D.getShaderParameter(E,D.COMPILE_STATUS);if(!B){var L=D.getShaderInfoLog(E);throw new Error("Error during shader compilation: "+L)}return E}function l(D,T){return u(D,T,D.VERTEX_SHADER)}function y(D,T){return u(D,T,D.FRAGMENT_SHADER)}function c(D,T){for(var P=D.createProgram(),E=0,B=T.length;E0){U.style.borderWidth=`${S.borderStyle.width}px`,S.borderStyle.style!==a.AnnotationBorderStyleType.UNDERLINE&&(F=F-2*S.borderStyle.width,G=G-2*S.borderStyle.width);const W=S.borderStyle.horizontalCornerRadius,V=S.borderStyle.verticalCornerRadius;if(W>0||V>0){const K=`${W}px / ${V}px`;U.style.borderRadius=K}switch(S.borderStyle.style){case a.AnnotationBorderStyleType.SOLID:U.style.borderStyle="solid";break;case a.AnnotationBorderStyleType.DASHED:U.style.borderStyle="dashed";break;case a.AnnotationBorderStyleType.BEVELED:(0,a.warn)("Unimplemented border style: beveled");break;case a.AnnotationBorderStyleType.INSET:(0,a.warn)("Unimplemented border style: inset");break;case a.AnnotationBorderStyleType.UNDERLINE:U.style.borderBottomStyle="solid";break}S.color?U.style.borderColor=a.Util.makeCssRgb(S.color[0]|0,S.color[1]|0,S.color[2]|0):U.style.borderWidth=0}return U.style.left=`${z[0]}px`,U.style.top=`${z[1]}px`,U.style.width=`${F}px`,U.style.height=`${G}px`,U}_createPopup(A,S,R){S||(S=document.createElement("div"),S.style.height=A.style.height,S.style.width=A.style.width,A.appendChild(S));const U=new v({container:A,trigger:S,color:R.color,title:R.title,modificationDate:R.modificationDate,contents:R.contents,hideWrapper:!0}).render();U.style.left=A.style.width,A.appendChild(U)}render(){(0,a.unreachable)("Abstract method `AnnotationElement.render` called")}}class l extends u{constructor(A){const S=!!(A.data.url||A.data.dest||A.data.action);super(A,S)}render(){this.container.className="linkAnnotation";const{data:A,linkService:S}=this,R=document.createElement("a");return A.url?(0,t.addLinkAttributes)(R,{url:A.url,target:A.newWindow?t.LinkTarget.BLANK:S.externalLinkTarget,rel:S.externalLinkRel,enabled:S.externalLinkEnabled}):A.action?this._bindNamedAction(R,A.action):this._bindLink(R,A.dest),this.container.appendChild(R),this.container}_bindLink(A,S){A.href=this.linkService.getDestinationHash(S),A.onclick=()=>(S&&this.linkService.navigateTo(S),!1),S&&(A.className="internalLink")}_bindNamedAction(A,S){A.href=this.linkService.getAnchorUrl(""),A.onclick=()=>(this.linkService.executeNamedAction(S),!1),A.className="internalLink"}}class y extends u{constructor(A){const S=!!(A.data.hasPopup||A.data.title||A.data.contents);super(A,S)}render(){this.container.className="textAnnotation";const A=document.createElement("img");return A.style.height=this.container.style.height,A.style.width=this.container.style.width,A.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",A.alt="[{{type}} Annotation]",A.dataset.l10nId="text_annotation_type",A.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,A,this.data),this.container.appendChild(A),this.container}}class c extends u{render(){return this.container}}class M extends c{constructor(A){const S=A.renderInteractiveForms||!A.data.hasAppearance&&!!A.data.fieldValue;super(A,S)}render(){const A=["left","center","right"],S=this.annotationStorage,R=this.data.id;this.container.className="textWidgetAnnotation";let N=null;if(this.renderInteractiveForms){const U=S.getOrCreateValue(R,this.data.fieldValue);if(this.data.multiLine?(N=document.createElement("textarea"),N.textContent=U):(N=document.createElement("input"),N.type="text",N.setAttribute("value",U)),N.addEventListener("input",function(F){S.setValue(R,F.target.value)}),N.disabled=this.data.readOnly,N.name=this.data.fieldName,this.data.maxLen!==null&&(N.maxLength=this.data.maxLen),this.data.comb){const G=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;N.classList.add("comb"),N.style.letterSpacing=`calc(${G}px - 1ch)`}}else{N=document.createElement("div"),N.textContent=this.data.fieldValue,N.style.verticalAlign="middle",N.style.display="table-cell";let U=null;this.data.fontRefName&&this.page.commonObjs.has(this.data.fontRefName)&&(U=this.page.commonObjs.get(this.data.fontRefName)),this._setTextStyle(N,U)}return this.data.textAlignment!==null&&(N.style.textAlign=A[this.data.textAlignment]),this.container.appendChild(N),this.container}_setTextStyle(A,S){const R=A.style;if(R.fontSize=`${this.data.fontSize}px`,R.direction=this.data.fontDirection<0?"rtl":"ltr",!S)return;let N="normal";S.black?N="900":S.bold&&(N="bold"),R.fontWeight=N,R.fontStyle=S.italic?"italic":"normal";const U=S.loadedName?`"${S.loadedName}", `:"",F=S.fallbackName||"Helvetica, sans-serif";R.fontFamily=U+F}}class I extends c{constructor(A){super(A,A.renderInteractiveForms)}render(){const A=this.annotationStorage,S=this.data,R=S.id,N=A.getOrCreateValue(R,S.fieldValue&&S.fieldValue!=="Off");this.container.className="buttonWidgetAnnotation checkBox";const U=document.createElement("input");return U.disabled=S.readOnly,U.type="checkbox",U.name=this.data.fieldName,N&&U.setAttribute("checked",!0),U.addEventListener("change",function(F){A.setValue(R,F.target.checked)}),this.container.appendChild(U),this.container}}class m extends c{constructor(A){super(A,A.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation radioButton";const A=this.annotationStorage,S=this.data,R=S.id,N=A.getOrCreateValue(R,S.fieldValue===S.buttonValue),U=document.createElement("input");return U.disabled=S.readOnly,U.type="radio",U.name=S.fieldName,N&&U.setAttribute("checked",!0),U.addEventListener("change",function(F){const G=F.target.name;for(const z of document.getElementsByName(G))z!==F.target&&A.setValue(z.parentNode.getAttribute("data-annotation-id"),!1);A.setValue(R,F.target.checked)}),this.container.appendChild(U),this.container}}class g extends l{render(){const A=super.render();return A.className="buttonWidgetAnnotation pushButton",A}}class f extends c{constructor(A){super(A,A.renderInteractiveForms)}render(){this.container.className="choiceWidgetAnnotation";const A=this.annotationStorage,S=this.data.id;A.getOrCreateValue(S,this.data.fieldValue.length>0?this.data.fieldValue[0]:null);const R=document.createElement("select");R.disabled=this.data.readOnly,R.name=this.data.fieldName,this.data.combo||(R.size=this.data.options.length,this.data.multiSelect&&(R.multiple=!0));for(const N of this.data.options){const U=document.createElement("option");U.textContent=N.displayValue,U.value=N.exportValue,this.data.fieldValue.includes(N.exportValue)&&U.setAttribute("selected",!0),R.appendChild(U)}return R.addEventListener("input",function(N){const U=N.target.options,F=U[U.selectedIndex].value;A.setValue(S,F)}),this.container.appendChild(R),this.container}}class C extends u{constructor(A){const S=!!(A.data.title||A.data.contents);super(A,S)}render(){const A=["Line","Square","Circle","PolyLine","Polygon","Ink"];if(this.container.className="popupAnnotation",A.includes(this.data.parentType))return this.container;const S=`[data-annotation-id="${this.data.parentId}"]`,R=this.layer.querySelector(S);if(!R)return this.container;const N=new v({container:this.container,trigger:R,color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),U=parseFloat(R.style.left),F=parseFloat(R.style.width);return this.container.style.transformOrigin=`-${U+F}px -${R.style.top}`,this.container.style.left=`${U+F}px`,this.container.appendChild(N.render()),this.container}}class v{constructor(A){this.container=A.container,this.trigger=A.trigger,this.color=A.color,this.title=A.title,this.modificationDate=A.modificationDate,this.contents=A.contents,this.hideWrapper=A.hideWrapper||!1,this.pinned=!1}render(){const S=document.createElement("div");S.className="popupWrapper",this.hideElement=this.hideWrapper?S:this.container,this.hideElement.setAttribute("hidden",!0);const R=document.createElement("div");R.className="popup";const N=this.color;if(N){const z=.7*(255-N[0])+N[0],W=.7*(255-N[1])+N[1],V=.7*(255-N[2])+N[2];R.style.backgroundColor=a.Util.makeCssRgb(z|0,W|0,V|0)}const U=document.createElement("h1");U.textContent=this.title,R.appendChild(U);const F=t.PDFDateString.toDateObject(this.modificationDate);if(F){const z=document.createElement("span");z.textContent="{{date}}, {{time}}",z.dataset.l10nId="annotation_date_string",z.dataset.l10nArgs=JSON.stringify({date:F.toLocaleDateString(),time:F.toLocaleTimeString()}),R.appendChild(z)}const G=this._formatContents(this.contents);return R.appendChild(G),this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),R.addEventListener("click",this._hide.bind(this,!0)),S.appendChild(R),S}_formatContents(A){const S=document.createElement("p"),R=A.split(/(?:\r\n?|\n)/);for(let N=0,U=R.length;N1)B=!0;else if(b.transform[0]!==b.transform[3]){const R=Math.abs(b.transform[0]),N=Math.abs(b.transform[3]);R!==N&&Math.max(R,N)/Math.min(R,N)>1.5&&(B=!0)}if(B&&(x.vertical?d.canvasWidth=b.height*v._viewport.scale:d.canvasWidth=b.width*v._viewport.scale),v._textDivProperties.set(o,d),v._textContentStream&&v._layoutText(o),v._enhanceTextSelection){var L=1,O=0;w!==0&&(L=Math.cos(w),O=Math.sin(w));var k=(x.vertical?b.height:b.width)*v._viewport.scale,j=D,A,S;w!==0?(A=[L,O,-O,L,P,E],S=t.Util.getAxialAlignedBoundingBox([0,0,k,j],A)):S=[P,E,P+k,E+j],v._bounds.push({left:S[0],top:S[1],right:S[2],bottom:S[3],div:o,size:[k,j],m:A})}}function c(v){if(!v._canceled){var b=v._textDivs,h=v._capability,o=b.length;if(o>s){v._renderingDone=!0,h.resolve();return}if(!v._textContentStream)for(var d=0;d0&&(o=o?Math.min(p,o):p)}return o}function I(v){for(var b=v._bounds,h=v._viewport,o=m(h.width,h.height,b),d=0;d=0&&o[w].start>=d.y2;)w--;var x,D,T,P,E=-1/0;for(T=p;T<=w;T++){x=o[T],D=x.boundary;var B;D.x2>d.x1?B=D.index>d.index?D.x1New:d.x1:D.x2New===void 0?B=(D.x2+d.x1)/2:B=D.x2New,B>E&&(E=B)}for(d.x1New=E,T=p;T<=w;T++)x=o[T],D=x.boundary,D.x2New===void 0?D.x2>d.x1?D.index>d.index&&(D.x2New=D.x2):D.x2New=E:D.x2New>E&&(D.x2New=Math.max(E,D.x2));var L=[],O=null;for(T=p;T<=w;T++){x=o[T],D=x.boundary;var k=D.x2>d.x2?D:d;O===k?L[L.length-1].end=x.end:(L.push({start:x.start,end:x.end,boundary:k}),O=k)}for(o[p].start=0&&o[P].start>=D.y1;P--)j=o[P].boundary===D;for(P=w+1;!j&&P{this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)}).catch(()=>{})}f.prototype={get promise(){return this._capability.promise},cancel:function(){this._canceled=!0,this._reader&&(this._reader.cancel(new t.AbortException("TextLayer task cancelled.")),this._reader=null),this._renderTimer!==null&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))},_processItems(v,b){for(let h=0,o=v.length;h0&&(b.scale=b.canvasWidth/p,h=`scaleX(${b.scale})`)}b.angle!==0&&(h=`rotate(${b.angle}deg) ${h}`),h.length>0&&(this._enhanceTextSelection&&(b.originalTransform=h),v.style.transform=h),this._textDivProperties.set(v,b),this._container.appendChild(v)},_render:function(b){const h=(0,t.createPromiseCapability)();let o=Object.create(null);const d=this._document.createElement("canvas");if(d.mozOpaque=!0,this._layoutTextCtx=d.getContext("2d",{alpha:!1}),this._textContent){const p=this._textContent.items,w=this._textContent.styles;this._processItems(p,w),h.resolve()}else if(this._textContentStream){const p=()=>{this._reader.read().then(({value:w,done:x})=>{if(x){h.resolve();return}Object.assign(o,w.styles),this._processItems(w.items,o),p()},h.reject)};this._reader=this._textContentStream.getReader(),p()}else throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');h.promise.then(()=>{o=null,b?this._renderTimer=setTimeout(()=>{c(this),this._renderTimer=null},b):c(this)},this._capability.reject)},expandTextDivs:function(b){if(!this._enhanceTextSelection||!this._renderingDone)return;this._bounds!==null&&(I(this),this._bounds=null);const h=[],o=[];for(var d=0,p=this._textDivs.length;d0?(o.push(`${x.paddingTop}px`),h.push(`translateY(${-x.paddingTop}px)`)):o.push(0),x.paddingRight>0?o.push(`${x.paddingRight/x.scale}px`):o.push(0),x.paddingBottom>0?o.push(`${x.paddingBottom}px`):o.push(0),x.paddingLeft>0?(o.push(`${x.paddingLeft/x.scale}px`),h.push(`translateX(${-x.paddingLeft/x.scale}px)`)):o.push(0),w.style.padding=o.join(" "),h.length&&(w.style.transform=h.join(" "))):(w.style.padding=null,w.style.transform=x.originalTransform))}}};function C(v){var b=new f({textContent:v.textContent,textContentStream:v.textContentStream,container:v.container,viewport:v.viewport,textDivs:v.textDivs,textContentItemsStr:v.textContentItemsStr,enhanceTextSelection:v.enhanceTextSelection});return b._render(v.timeout),b}return C}();e.renderTextLayer=a},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var t=n(2),a=n(1),r=n(4);let s=function(){throw new Error("Not implemented: SVGGraphics")};e.SVGGraphics=s;{let g=function(o){let d=[];const p=[];for(const w of o){if(w.fn==="save"){d.push({fnId:92,fn:"group",items:[]}),p.push(d),d=d[d.length-1].items;continue}w.fn==="restore"?d=p.pop():d.push(w)}return d},f=function(o){if(Number.isInteger(o))return o.toString();const d=o.toFixed(10);let p=d.length-1;if(d[p]!=="0")return d;do p--;while(d[p]==="0");return d.substring(0,d[p]==="."?p:p+1)},C=function(o){if(o[4]===0&&o[5]===0){if(o[1]===0&&o[2]===0)return o[0]===1&&o[3]===1?"":`scale(${f(o[0])} ${f(o[3])})`;if(o[0]===o[3]&&o[1]===-o[2]){const d=Math.acos(o[0])*180/Math.PI;return`rotate(${f(d)})`}}else if(o[0]===1&&o[1]===0&&o[2]===0&&o[3]===1)return`translate(${f(o[4])} ${f(o[5])})`;return`matrix(${f(o[0])} ${f(o[1])} ${f(o[2])} ${f(o[3])} ${f(o[4])} ${f(o[5])})`};const u={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",y="http://www.w3.org/1999/xlink",c=["butt","round","square"],M=["miter","round","bevel"],I=function(){const o=new Uint8Array([137,80,78,71,13,10,26,10]),d=12,p=new Int32Array(256);for(let B=0;B<256;B++){let L=B;for(let O=0;O<8;O++)L&1?L=3988292384^L>>1&2147483647:L=L>>1&2147483647;p[B]=L}function w(B,L,O){let k=-1;for(let j=L;j>>8^S}return k^-1}function x(B,L,O,k){let j=k;const A=L.length;O[j]=A>>24&255,O[j+1]=A>>16&255,O[j+2]=A>>8&255,O[j+3]=A&255,j+=4,O[j]=B.charCodeAt(0)&255,O[j+1]=B.charCodeAt(1)&255,O[j+2]=B.charCodeAt(2)&255,O[j+3]=B.charCodeAt(3)&255,j+=4,O.set(L,j),j+=L.length;const S=w(O,k+4,j);O[j]=S>>24&255,O[j+1]=S>>16&255,O[j+2]=S>>8&255,O[j+3]=S&255}function D(B,L,O){let k=1,j=0;for(let A=L;A=8?L=B:L=Buffer.from(B);const O=lib.deflateSync(L,{level:9});return O instanceof Uint8Array?O:new Uint8Array(O)}catch(L){(0,t.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+L)}return P(B)}function P(B){let L=B.length;const O=65535,k=Math.ceil(L/O),j=new Uint8Array(2+L+k*5+4);let A=0;j[A++]=120,j[A++]=156;let S=0;for(;L>O;)j[A++]=0,j[A++]=255,j[A++]=255,j[A++]=0,j[A++]=0,j.set(B.subarray(S,S+O),A),A+=O,S+=O,L-=O;j[A++]=1,j[A++]=L&255,j[A++]=L>>8&255,j[A++]=~L&65535&255,j[A++]=(~L&65535)>>8&255,j.set(B.subarray(S),A),A+=B.length-S;const R=D(B,0,B.length);return j[A++]=R>>24&255,j[A++]=R>>16&255,j[A++]=R>>8&255,j[A++]=R&255,j}function E(B,L,O,k){const j=B.width,A=B.height;let S,R,N;const U=B.data;switch(L){case t.ImageKind.GRAYSCALE_1BPP:R=0,S=1,N=j+7>>3;break;case t.ImageKind.RGB_24BPP:R=2,S=8,N=j*3;break;case t.ImageKind.RGBA_32BPP:R=6,S=8,N=j*4;break;default:throw new Error("invalid format")}const F=new Uint8Array((1+N)*A);let G=0,z=0;for(let J=0;J>24&255,j>>16&255,j>>8&255,j&255,A>>24&255,A>>16&255,A>>8&255,A&255,S,R,0,0,0]),V=T(F),K=o.length+d*3+W.length+V.length,Y=new Uint8Array(K);let H=0;return Y.set(o,H),H+=o.length,x("IHDR",W,Y,H),H+=d+W.length,x("IDATA",V,Y,H),H+=d+V.length,x("IEND",new Uint8Array(0),Y,H),(0,t.createObjectURL)(Y,"image/png",O)}return function(L,O,k){const j=L.kind===void 0?t.ImageKind.GRAYSCALE_1BPP:L.kind;return E(L,j,O,k)}}();class m{constructor(){this.fontSizeScale=1,this.fontWeight=u.fontWeight,this.fontSize=0,this.textMatrix=t.IDENTITY_MATRIX,this.fontMatrix=t.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=t.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=u.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(d,p){this.x=d,this.y=p}}let v=0,b=0,h=0;e.SVGGraphics=s=class{constructor(d,p,w=!1){this.svgFactory=new a.DOMSVGFactory,this.current=new m,this.transformMatrix=t.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=d,this.objs=p,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!w,this._operatorIdMapping=[];for(const x in t.OPS)this._operatorIdMapping[t.OPS[x]]=x}save(){this.transformStack.push(this.transformMatrix);const d=this.current;this.extraStack.push(d),this.current=d.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(d){this.save(),this.executeOpTree(d),this.restore()}loadDependencies(d){const p=d.fnArray,w=d.argsArray;for(let x=0,D=p.length;x{P.get(T,B)});this.current.dependencies.push(E)}return Promise.all(this.current.dependencies)}transform(d,p,w,x,D,T){const P=[d,p,w,x,D,T];this.transformMatrix=t.Util.transform(this.transformMatrix,P),this.tgrp=null}getSVG(d,p){this.viewport=p;const w=this._initialize(p);return this.loadDependencies(d).then(()=>(this.transformMatrix=t.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(d)),w))}convertOpList(d){const p=this._operatorIdMapping,w=d.argsArray,x=d.fnArray,D=[];for(let T=0,P=x.length;T0&&(this.current.lineWidth=d)}setLineCap(d){this.current.lineCap=c[d]}setLineJoin(d){this.current.lineJoin=M[d]}setMiterLimit(d){this.current.miterLimit=d}setStrokeAlpha(d){this.current.strokeAlpha=d}setStrokeRGBColor(d,p,w){this.current.strokeColor=t.Util.makeCssRgb(d,p,w)}setFillAlpha(d){this.current.fillAlpha=d}setFillRGBColor(d,p,w){this.current.fillColor=t.Util.makeCssRgb(d,p,w),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(d){this.current.strokeColor=this._makeColorN_Pattern(d)}setFillColorN(d){this.current.fillColor=this._makeColorN_Pattern(d)}shadingFill(d){const p=this.viewport.width,w=this.viewport.height,x=t.Util.inverseTransform(this.transformMatrix),D=t.Util.applyTransform([0,0],x),T=t.Util.applyTransform([0,w],x),P=t.Util.applyTransform([p,0],x),E=t.Util.applyTransform([p,w],x),B=Math.min(D[0],T[0],P[0],E[0]),L=Math.min(D[1],T[1],P[1],E[1]),O=Math.max(D[0],T[0],P[0],E[0]),k=Math.max(D[1],T[1],P[1],E[1]),j=this.svgFactory.createElement("svg:rect");j.setAttributeNS(null,"x",B),j.setAttributeNS(null,"y",L),j.setAttributeNS(null,"width",O-B),j.setAttributeNS(null,"height",k-L),j.setAttributeNS(null,"fill",this._makeShadingPattern(d)),this.current.fillAlpha<1&&j.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(j)}_makeColorN_Pattern(d){return d[0]==="TilingPattern"?this._makeTilingPattern(d):this._makeShadingPattern(d)}_makeTilingPattern(d){const p=d[1],w=d[2],x=d[3]||t.IDENTITY_MATRIX,[D,T,P,E]=d[4],B=d[5],L=d[6],O=d[7],k=`shading${h++}`,[j,A]=t.Util.applyTransform([D,T],x),[S,R]=t.Util.applyTransform([P,E],x),[N,U]=t.Util.singularValueDecompose2dScale(x),F=B*N,G=L*U,z=this.svgFactory.createElement("svg:pattern");z.setAttributeNS(null,"id",k),z.setAttributeNS(null,"patternUnits","userSpaceOnUse"),z.setAttributeNS(null,"width",F),z.setAttributeNS(null,"height",G),z.setAttributeNS(null,"x",`${j}`),z.setAttributeNS(null,"y",`${A}`);const W=this.svg,V=this.transformMatrix,K=this.current.fillColor,Y=this.current.strokeColor,H=this.svgFactory.create(S-j,R-A);if(this.svg=H,this.transformMatrix=x,O===2){const J=t.Util.makeCssRgb(...p);this.current.fillColor=J,this.current.strokeColor=J}return this.executeOpTree(this.convertOpList(w)),this.svg=W,this.transformMatrix=V,this.current.fillColor=K,this.current.strokeColor=Y,z.appendChild(H.childNodes[0]),this.defs.appendChild(z),`url(#${k})`}_makeShadingPattern(d){switch(d[0]){case"RadialAxial":const p=`shading${h++}`,w=d[3];let x;switch(d[1]){case"axial":const D=d[4],T=d[5];x=this.svgFactory.createElement("svg:linearGradient"),x.setAttributeNS(null,"id",p),x.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),x.setAttributeNS(null,"x1",D[0]),x.setAttributeNS(null,"y1",D[1]),x.setAttributeNS(null,"x2",T[0]),x.setAttributeNS(null,"y2",T[1]);break;case"radial":const P=d[4],E=d[5],B=d[6],L=d[7];x=this.svgFactory.createElement("svg:radialGradient"),x.setAttributeNS(null,"id",p),x.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),x.setAttributeNS(null,"cx",E[0]),x.setAttributeNS(null,"cy",E[1]),x.setAttributeNS(null,"r",L),x.setAttributeNS(null,"fx",P[0]),x.setAttributeNS(null,"fy",P[1]),x.setAttributeNS(null,"fr",B);break;default:throw new Error(`Unknown RadialAxial type: ${d[1]}`)}for(const D of w){const T=this.svgFactory.createElement("svg:stop");T.setAttributeNS(null,"offset",D[0]),T.setAttributeNS(null,"stop-color",D[1]),x.appendChild(T)}return this.defs.appendChild(x),`url(#${p})`;case"Mesh":return(0,t.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${d[0]}`)}}setDash(d,p){this.current.dashArray=d,this.current.dashPhase=p}constructPath(d,p){const w=this.current;let x=w.x,D=w.y,T=[],P=0;for(const E of d)switch(E|0){case t.OPS.rectangle:x=p[P++],D=p[P++];const B=p[P++],L=p[P++],O=x+B,k=D+L;T.push("M",f(x),f(D),"L",f(O),f(D),"L",f(O),f(k),"L",f(x),f(k),"Z");break;case t.OPS.moveTo:x=p[P++],D=p[P++],T.push("M",f(x),f(D));break;case t.OPS.lineTo:x=p[P++],D=p[P++],T.push("L",f(x),f(D));break;case t.OPS.curveTo:x=p[P+4],D=p[P+5],T.push("C",f(p[P]),f(p[P+1]),f(p[P+2]),f(p[P+3]),f(x),f(D)),P+=6;break;case t.OPS.curveTo2:T.push("C",f(x),f(D),f(p[P]),f(p[P+1]),f(p[P+2]),f(p[P+3])),x=p[P+2],D=p[P+3],P+=4;break;case t.OPS.curveTo3:x=p[P+2],D=p[P+3],T.push("C",f(p[P]),f(p[P+1]),f(x),f(D),f(x),f(D)),P+=4;break;case t.OPS.closePath:T.push("Z");break}T=T.join(" "),w.path&&d.length>0&&d[0]!==t.OPS.rectangle&&d[0]!==t.OPS.moveTo?T=w.path.getAttributeNS(null,"d")+T:(w.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(w.path)),w.path.setAttributeNS(null,"d",T),w.path.setAttributeNS(null,"fill","none"),w.element=w.path,w.setCurrentPoint(x,D)}endPath(){const d=this.current;if(d.path=null,!this.pendingClip)return;if(!d.element){this.pendingClip=null;return}const p=`clippath${v++}`,w=this.svgFactory.createElement("svg:clipPath");w.setAttributeNS(null,"id",p),w.setAttributeNS(null,"transform",C(this.transformMatrix));const x=d.element.cloneNode(!0);this.pendingClip==="evenodd"?x.setAttributeNS(null,"clip-rule","evenodd"):x.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,w.appendChild(x),this.defs.appendChild(w),d.activeClipUrl&&(d.clipGroup=null,this.extraStack.forEach(function(D){D.clipGroup=null}),w.setAttributeNS(null,"clip-path",d.activeClipUrl)),d.activeClipUrl=`url(#${p})`,this.tgrp=null}clip(d){this.pendingClip=d}closePath(){const d=this.current;if(d.path){const p=`${d.path.getAttributeNS(null,"d")}Z`;d.path.setAttributeNS(null,"d",p)}}setLeading(d){this.current.leading=-d}setTextRise(d){this.current.textRise=d}setTextRenderingMode(d){this.current.textRenderingMode=d}setHScale(d){this.current.textHScale=d/100}setRenderingIntent(d){}setFlatness(d){}setGState(d){for(const[p,w]of d)switch(p){case"LW":this.setLineWidth(w);break;case"LC":this.setLineCap(w);break;case"LJ":this.setLineJoin(w);break;case"ML":this.setMiterLimit(w);break;case"D":this.setDash(w[0],w[1]);break;case"RI":this.setRenderingIntent(w);break;case"FL":this.setFlatness(w);break;case"Font":this.setFont(w);break;case"CA":this.setStrokeAlpha(w);break;case"ca":this.setFillAlpha(w);break;default:(0,t.warn)(`Unimplemented graphic state operator ${p}`);break}}fill(){const d=this.current;d.element&&(d.element.setAttributeNS(null,"fill",d.fillColor),d.element.setAttributeNS(null,"fill-opacity",d.fillAlpha),this.endPath())}stroke(){const d=this.current;d.element&&(this._setStrokeAttributes(d.element),d.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(d,p=1){const w=this.current;let x=w.dashArray;p!==1&&x.length>0&&(x=x.map(function(D){return p*D})),d.setAttributeNS(null,"stroke",w.strokeColor),d.setAttributeNS(null,"stroke-opacity",w.strokeAlpha),d.setAttributeNS(null,"stroke-miterlimit",f(w.miterLimit)),d.setAttributeNS(null,"stroke-linecap",w.lineCap),d.setAttributeNS(null,"stroke-linejoin",w.lineJoin),d.setAttributeNS(null,"stroke-width",f(p*w.lineWidth)+"px"),d.setAttributeNS(null,"stroke-dasharray",x.map(f).join(" ")),d.setAttributeNS(null,"stroke-dashoffset",f(p*w.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const d=this.svgFactory.createElement("svg:rect");d.setAttributeNS(null,"x","0"),d.setAttributeNS(null,"y","0"),d.setAttributeNS(null,"width","1px"),d.setAttributeNS(null,"height","1px"),d.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(d)}paintImageXObject(d){const p=d.startsWith("g_")?this.commonObjs.get(d):this.objs.get(d);if(!p){(0,t.warn)(`Dependent image with object ID ${d} is not ready yet`);return}this.paintInlineImageXObject(p)}paintInlineImageXObject(d,p){const w=d.width,x=d.height,D=I(d,this.forceDataSchema,!!p),T=this.svgFactory.createElement("svg:rect");T.setAttributeNS(null,"x","0"),T.setAttributeNS(null,"y","0"),T.setAttributeNS(null,"width",f(w)),T.setAttributeNS(null,"height",f(x)),this.current.element=T,this.clip("nonzero");const P=this.svgFactory.createElement("svg:image");P.setAttributeNS(y,"xlink:href",D),P.setAttributeNS(null,"x","0"),P.setAttributeNS(null,"y",f(-x)),P.setAttributeNS(null,"width",f(w)+"px"),P.setAttributeNS(null,"height",f(x)+"px"),P.setAttributeNS(null,"transform",`scale(${f(1/w)} ${f(-1/x)})`),p?p.appendChild(P):this._ensureTransformGroup().appendChild(P)}paintImageMaskXObject(d){const p=this.current,w=d.width,x=d.height,D=p.fillColor;p.maskId=`mask${b++}`;const T=this.svgFactory.createElement("svg:mask");T.setAttributeNS(null,"id",p.maskId);const P=this.svgFactory.createElement("svg:rect");P.setAttributeNS(null,"x","0"),P.setAttributeNS(null,"y","0"),P.setAttributeNS(null,"width",f(w)),P.setAttributeNS(null,"height",f(x)),P.setAttributeNS(null,"fill",D),P.setAttributeNS(null,"mask",`url(#${p.maskId})`),this.defs.appendChild(T),this._ensureTransformGroup().appendChild(P),this.paintInlineImageXObject(d,T)}paintFormXObjectBegin(d,p){if(Array.isArray(d)&&d.length===6&&this.transform(d[0],d[1],d[2],d[3],d[4],d[5]),p){const w=p[2]-p[0],x=p[3]-p[1],D=this.svgFactory.createElement("svg:rect");D.setAttributeNS(null,"x",p[0]),D.setAttributeNS(null,"y",p[1]),D.setAttributeNS(null,"width",f(w)),D.setAttributeNS(null,"height",f(x)),this.current.element=D,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(d){const p=this.svgFactory.create(d.width,d.height),w=this.svgFactory.createElement("svg:defs");p.appendChild(w),this.defs=w;const x=this.svgFactory.createElement("svg:g");return x.setAttributeNS(null,"transform",C(d.transform)),p.appendChild(x),this.svg=x,p}_ensureClipGroup(){if(!this.current.clipGroup){const d=this.svgFactory.createElement("svg:g");d.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(d),this.current.clipGroup=d}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",C(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}}},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var t=n(2),a=n(23);const r=require$$2,s=streamHttp,u=httpsBrowserifyExports,l=urlExports,y=/^file:\/\/\/[a-zA-Z]:\//;function c(h){const o=l.parse(h);return o.protocol==="file:"||o.host?o:/^[a-z]:[/\\]/i.test(h)?l.parse(`file:///${h}`):(o.host||(o.protocol="file:"),o)}class M{constructor(o){this.source=o,this.url=c(o.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&o.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,t.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new v(this):new f(this),this._fullRequestReader}getRangeReader(o,d){if(d<=this._progressiveDataLength)return null;const p=this.isFsUrl?new b(this,o,d):new C(this,o,d);return this._rangeRequestReaders.push(p),p}cancelAllRequests(o){this._fullRequestReader&&this._fullRequestReader.cancel(o),this._rangeRequestReaders.slice(0).forEach(function(p){p.cancel(o)})}}e.PDFNodeStream=M;class I{constructor(o){this._url=o.url,this._done=!1,this._storedError=null,this.onProgress=null;const d=o.source;this._contentLength=d.length,this._loaded=0,this._filename=null,this._disableRange=d.disableRange||!1,this._rangeChunkSize=d.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!d.disableStream,this._isRangeSupported=!d.disableRange,this._readableStream=null,this._readCapability=(0,t.createPromiseCapability)(),this._headersCapability=(0,t.createPromiseCapability)()}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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const o=this._readableStream.read();return o===null?(this._readCapability=(0,t.createPromiseCapability)(),this.read()):(this._loaded+=o.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(o).buffer,done:!1})}cancel(o){if(!this._readableStream){this._error(o);return}this._readableStream.destroy(o)}_error(o){this._storedError=o,this._readCapability.resolve()}_setReadableStream(o){this._readableStream=o,o.on("readable",()=>{this._readCapability.resolve()}),o.on("end",()=>{o.destroy(),this._done=!0,this._readCapability.resolve()}),o.on("error",d=>{this._error(d)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new t.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class m{constructor(o){this._url=o.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,t.createPromiseCapability)();const d=o.source;this._isStreamingSupported=!d.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const o=this._readableStream.read();return o===null?(this._readCapability=(0,t.createPromiseCapability)(),this.read()):(this._loaded+=o.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(o).buffer,done:!1})}cancel(o){if(!this._readableStream){this._error(o);return}this._readableStream.destroy(o)}_error(o){this._storedError=o,this._readCapability.resolve()}_setReadableStream(o){this._readableStream=o,o.on("readable",()=>{this._readCapability.resolve()}),o.on("end",()=>{o.destroy(),this._done=!0,this._readCapability.resolve()}),o.on("error",d=>{this._error(d)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function g(h,o){return{protocol:h.protocol,auth:h.auth,host:h.hostname,port:h.port,path:h.path,method:"GET",headers:o}}class f extends I{constructor(o){super(o);const d=p=>{if(p.statusCode===404){const T=new t.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=T,this._headersCapability.reject(T);return}this._headersCapability.resolve(),this._setReadableStream(p);const w=T=>this._readableStream.headers[T.toLowerCase()],{allowRangeRequests:x,suggestedLength:D}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:w,isHttp:o.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=x,this._contentLength=D||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(w)};this._request=null,this._url.protocol==="http:"?this._request=s.request(g(this._url,o.httpHeaders),d):this._request=u.request(g(this._url,o.httpHeaders),d),this._request.on("error",p=>{this._storedError=p,this._headersCapability.reject(p)}),this._request.end()}}class C extends m{constructor(o,d,p){super(o),this._httpHeaders={};for(const x in o.httpHeaders){const D=o.httpHeaders[x];typeof D>"u"||(this._httpHeaders[x]=D)}this._httpHeaders.Range=`bytes=${d}-${p-1}`;const w=x=>{if(x.statusCode===404){const D=new t.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=D;return}this._setReadableStream(x)};this._request=null,this._url.protocol==="http:"?this._request=s.request(g(this._url,this._httpHeaders),w):this._request=u.request(g(this._url,this._httpHeaders),w),this._request.on("error",x=>{this._storedError=x}),this._request.end()}}class v extends I{constructor(o){super(o);let d=decodeURIComponent(this._url.path);y.test(this._url.href)&&(d=d.replace(/^\//,"")),r.lstat(d,(p,w)=>{if(p){p.code==="ENOENT"&&(p=new t.MissingPDFException(`Missing PDF "${d}".`)),this._storedError=p,this._headersCapability.reject(p);return}this._contentLength=w.size,this._setReadableStream(r.createReadStream(d)),this._headersCapability.resolve()})}}class b extends m{constructor(o,d,p){super(o);let w=decodeURIComponent(this._url.path);y.test(this._url.href)&&(w=w.replace(/^\//,"")),this._setReadableStream(r.createReadStream(w,{start:d,end:p-1}))}}},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=u,e.extractFilenameFromHeader=s,e.validateRangeRequestCapabilities=r,e.validateResponseStatus=l;var t=n(2),a=n(24);function r({getResponseHeader:y,isHttp:c,rangeChunkSize:M,disableRange:I}){(0,t.assert)(M>0,"Range chunk size must be larger than zero");const m={allowRangeRequests:!1,suggestedLength:void 0},g=parseInt(y("Content-Length"),10);return!Number.isInteger(g)||(m.suggestedLength=g,g<=2*M)||I||!c||y("Accept-Ranges")!=="bytes"||(y("Content-Encoding")||"identity")!=="identity"||(m.allowRangeRequests=!0),m}function s(y){const c=y("Content-Disposition");if(c){let M=(0,a.getFilenameFromContentDispositionHeader)(c);if(M.includes("%"))try{M=decodeURIComponent(M)}catch{}if(/\.pdf$/i.test(M))return M}return null}function u(y,c){return y===404||y===0&&c.startsWith("file:")?new t.MissingPDFException('Missing PDF "'+c+'".'):new t.UnexpectedResponseException("Unexpected server response ("+y+') while retrieving PDF "'+c+'".',y)}function l(y){return y===200||y===206}},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=t;function t(a){let r=!0,s=u("filename\\*","i").exec(a);if(s){s=s[1];let g=M(s);return g=unescape(g),g=I(g),g=m(g),y(g)}if(s=c(a),s){const g=m(s);return y(g)}if(s=u("filename","i").exec(a),s){s=s[1];let g=M(s);return g=m(g),y(g)}function u(g,f){return new RegExp("(?:^|;)\\s*"+g+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',f)}function l(g,f){if(g){if(!/^[\x00-\xFF]+$/.test(f))return f;try{const C=new TextDecoder(g,{fatal:!0}),v=Array.from(f,function(b){return b.charCodeAt(0)&255});f=C.decode(new Uint8Array(v)),r=!1}catch{if(/^utf-?8$/i.test(g))try{f=decodeURIComponent(escape(f)),r=!1}catch{}}}return f}function y(g){return r&&/[\x80-\xff]/.test(g)&&(g=l("utf-8",g),r&&(g=l("iso-8859-1",g))),g}function c(g){const f=[];let C;const v=u("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(C=v.exec(g))!==null;){let[,h,o,d]=C;if(h=parseInt(h,10),h in f){if(h===0)break;continue}f[h]=[o,d]}const b=[];for(let h=0;h"u"||g.setRequestHeader(v,b)}return this.isHttp&&"begin"in m&&"end"in m?(g.setRequestHeader("Range",`bytes=${m.begin}-${m.end-1}`),C.expectedStatus=s):C.expectedStatus=r,g.responseType="arraybuffer",m.onError&&(g.onerror=function(v){m.onError(g.status)}),g.onreadystatechange=this.onStateChange.bind(this,f),g.onprogress=this.onProgress.bind(this,f),C.onHeadersReceived=m.onHeadersReceived,C.onDone=m.onDone,C.onError=m.onError,C.onProgress=m.onProgress,g.send(null),f}onProgress(m,g){const f=this.pendingRequests[m];f&&f.onProgress&&f.onProgress(g)}onStateChange(m,g){const f=this.pendingRequests[m];if(!f)return;const C=f.xhr;if(C.readyState>=2&&f.onHeadersReceived&&(f.onHeadersReceived(),delete f.onHeadersReceived),C.readyState!==4||!(m in this.pendingRequests))return;if(delete this.pendingRequests[m],C.status===0&&this.isHttp){f.onError&&f.onError(C.status);return}const v=C.status||r;if(!(v===r&&f.expectedStatus===s)&&v!==f.expectedStatus){f.onError&&f.onError(C.status);return}const h=u(C);if(v===s){const o=C.getResponseHeader("Content-Range"),d=/bytes (\d+)-(\d+)\/(\d+)/.exec(o);f.onDone({begin:parseInt(d[1],10),chunk:h})}else h?f.onDone({begin:0,chunk:h}):f.onError&&f.onError(C.status)}getRequestXhr(m){return this.pendingRequests[m].xhr}isPendingRequest(m){return m in this.pendingRequests}abortRequest(m){const g=this.pendingRequests[m].xhr;delete this.pendingRequests[m],g.abort()}}class y{constructor(m){this._source=m,this._manager=new l(m.url,{httpHeaders:m.httpHeaders,withCredentials:m.withCredentials}),this._rangeChunkSize=m.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(m){const g=this._rangeRequestReaders.indexOf(m);g>=0&&this._rangeRequestReaders.splice(g,1)}getFullReader(){return(0,t.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new c(this._manager,this._source),this._fullRequestReader}getRangeReader(m,g){const f=new M(this._manager,m,g);return f.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(f),f}cancelAllRequests(m){this._fullRequestReader&&this._fullRequestReader.cancel(m),this._rangeRequestReaders.slice(0).forEach(function(f){f.cancel(m)})}}e.PDFNetworkStream=y;class c{constructor(m,g){this._manager=m;const f={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=g.url,this._fullRequestId=m.requestFull(f),this._headersReceivedCapability=(0,t.createPromiseCapability)(),this._disableRange=g.disableRange||!1,this._contentLength=g.length,this._rangeChunkSize=g.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 m=this._fullRequestId,g=this._manager.getRequestXhr(m),f=b=>g.getResponseHeader(b),{allowRangeRequests:C,suggestedLength:v}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:f,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});C&&(this._isRangeSupported=!0),this._contentLength=v||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(f),this._isRangeSupported&&this._manager.abortRequest(m),this._headersReceivedCapability.resolve()}_onDone(m){m&&(this._requests.length>0?this._requests.shift().resolve({value:m.chunk,done:!1}):this._cachedChunks.push(m.chunk)),this._done=!0,!(this._cachedChunks.length>0)&&(this._requests.forEach(function(g){g.resolve({value:void 0,done:!0})}),this._requests=[])}_onError(m){const g=this._url,f=(0,a.createResponseStatusError)(m,g);this._storedError=f,this._headersReceivedCapability.reject(f),this._requests.forEach(function(C){C.reject(f)}),this._requests=[],this._cachedChunks=[]}_onProgress(m){this.onProgress&&this.onProgress({loaded:m.loaded,total:m.lengthComputable?m.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 m=(0,t.createPromiseCapability)();return this._requests.push(m),m.promise}cancel(m){this._done=!0,this._headersReceivedCapability.reject(m),this._requests.forEach(function(g){g.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class M{constructor(m,g,f){this._manager=m;const C={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=m.requestRange(g,f,C),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}_close(){this.onClosed&&this.onClosed(this)}_onDone(m){const g=m.chunk;this._requests.length>0?this._requests.shift().resolve({value:g,done:!1}):this._queuedChunk=g,this._done=!0,this._requests.forEach(function(f){f.resolve({value:void 0,done:!0})}),this._requests=[],this._close()}_onProgress(m){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:m.loaded})}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk!==null){const g=this._queuedChunk;return this._queuedChunk=null,{value:g,done:!1}}if(this._done)return{value:void 0,done:!0};const m=(0,t.createPromiseCapability)();return this._requests.push(m),m.promise}cancel(m){this._done=!0,this._requests.forEach(function(g){g.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var t=n(2),a=n(23);function r(c,M,I){return{method:"GET",headers:c,signal:I&&I.signal,mode:"cors",credentials:M?"include":"same-origin",redirect:"follow"}}function s(c){const M=new Headers;for(const I in c){const m=c[I];typeof m>"u"||M.append(I,m)}return M}class u{constructor(M){this.source=M,this.isHttp=/^https?:/i.test(M.url),this.httpHeaders=this.isHttp&&M.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,t.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new l(this),this._fullRequestReader}getRangeReader(M,I){if(I<=this._progressiveDataLength)return null;const m=new y(this,M,I);return this._rangeRequestReaders.push(m),m}cancelAllRequests(M){this._fullRequestReader&&this._fullRequestReader.cancel(M),this._rangeRequestReaders.slice(0).forEach(function(m){m.cancel(M)})}}e.PDFFetchStream=u;class l{constructor(M){this._stream=M,this._reader=null,this._loaded=0,this._filename=null;const I=M.source;this._withCredentials=I.withCredentials||!1,this._contentLength=I.length,this._headersCapability=(0,t.createPromiseCapability)(),this._disableRange=I.disableRange||!1,this._rangeChunkSize=I.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),typeof AbortController<"u"&&(this._abortController=new AbortController),this._isStreamingSupported=!I.disableStream,this._isRangeSupported=!I.disableRange,this._headers=s(this._stream.httpHeaders);const m=I.url;fetch(m,r(this._headers,this._withCredentials,this._abortController)).then(g=>{if(!(0,a.validateResponseStatus)(g.status))throw(0,a.createResponseStatusError)(g.status,m);this._reader=g.body.getReader(),this._headersCapability.resolve();const f=b=>g.headers.get(b),{allowRangeRequests:C,suggestedLength:v}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:f,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=C,this._contentLength=v||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(f),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new t.AbortException("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(){await this._headersCapability.promise;const{value:M,done:I}=await this._reader.read();return I?{value:M,done:I}:(this._loaded+=M.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(M).buffer,done:!1})}cancel(M){this._reader&&this._reader.cancel(M),this._abortController&&this._abortController.abort()}}class y{constructor(M,I,m){this._stream=M,this._reader=null,this._loaded=0;const g=M.source;this._withCredentials=g.withCredentials||!1,this._readCapability=(0,t.createPromiseCapability)(),this._isStreamingSupported=!g.disableStream,typeof AbortController<"u"&&(this._abortController=new AbortController),this._headers=s(this._stream.httpHeaders),this._headers.append("Range",`bytes=${I}-${m-1}`);const f=g.url;fetch(f,r(this._headers,this._withCredentials,this._abortController)).then(C=>{if(!(0,a.validateResponseStatus)(C.status))throw(0,a.createResponseStatusError)(C.status,f);this._readCapability.resolve(),this._reader=C.body.getReader()}).catch(C=>{if(!(C&&C.name==="AbortError"))throw C}),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:M,done:I}=await this._reader.read();return I?{value:M,done:I}:(this._loaded+=M.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(M).buffer,done:!1})}cancel(M){this._reader&&this._reader.cancel(M),this._abortController&&this._abortController.abort()}}}])})})(pdf$1);var pdfExports=pdf$1.exports;const useSafeRef=()=>{const[i,e]=reactExports.useState(null);return{setRef:reactExports.useCallback(t=>{e(t)},[]),node:i}};var resizeObservers=[],hasActiveObservations=function(){return resizeObservers.some(function(i){return i.activeTargets.length>0})},hasSkippedObservations=function(){return resizeObservers.some(function(i){return i.skippedTargets.length>0})},msg="ResizeObserver loop completed with undelivered notifications.",deliverResizeLoopError=function(){var i;typeof ErrorEvent=="function"?i=new ErrorEvent("error",{message:msg}):(i=document.createEvent("Event"),i.initEvent("error",!1,!1),i.message=msg),window.dispatchEvent(i)},ResizeObserverBoxOptions;(function(i){i.BORDER_BOX="border-box",i.CONTENT_BOX="content-box",i.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(ResizeObserverBoxOptions||(ResizeObserverBoxOptions={}));var freeze=function(i){return Object.freeze(i)},ResizeObserverSize=function(){function i(e,n){this.inlineSize=e,this.blockSize=n,freeze(this)}return i}(),DOMRectReadOnly=function(){function i(e,n,t,a){return this.x=e,this.y=n,this.width=t,this.height=a,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,freeze(this)}return i.prototype.toJSON=function(){var e=this,n=e.x,t=e.y,a=e.top,r=e.right,s=e.bottom,u=e.left,l=e.width,y=e.height;return{x:n,y:t,top:a,right:r,bottom:s,left:u,width:l,height:y}},i.fromRect=function(e){return new i(e.x,e.y,e.width,e.height)},i}(),isSVG=function(i){return i instanceof SVGElement&&"getBBox"in i},isHidden=function(i){if(isSVG(i)){var e=i.getBBox(),n=e.width,t=e.height;return!n&&!t}var a=i,r=a.offsetWidth,s=a.offsetHeight;return!(r||s||i.getClientRects().length)},isElement=function(i){var e,n;if(i instanceof Element)return!0;var t=(n=(e=i)===null||e===void 0?void 0:e.ownerDocument)===null||n===void 0?void 0:n.defaultView;return!!(t&&i instanceof t.Element)},isReplacedElement=function(i){switch(i.tagName){case"INPUT":if(i.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},global=typeof window<"u"?window:{},cache=new WeakMap,scrollRegexp=/auto|scroll/,verticalRegexp=/^tb|vertical/,IE=/msie|trident/i.test(global.navigator&&global.navigator.userAgent),parseDimension=function(i){return parseFloat(i||"0")},size=function(i,e,n){return i===void 0&&(i=0),e===void 0&&(e=0),n===void 0&&(n=!1),new ResizeObserverSize((n?e:i)||0,(n?i:e)||0)},zeroBoxes=freeze({devicePixelContentBoxSize:size(),borderBoxSize:size(),contentBoxSize:size(),contentRect:new DOMRectReadOnly(0,0,0,0)}),calculateBoxSizes=function(i,e){if(e===void 0&&(e=!1),cache.has(i)&&!e)return cache.get(i);if(isHidden(i))return cache.set(i,zeroBoxes),zeroBoxes;var n=getComputedStyle(i),t=isSVG(i)&&i.ownerSVGElement&&i.getBBox(),a=!IE&&n.boxSizing==="border-box",r=verticalRegexp.test(n.writingMode||""),s=!t&&scrollRegexp.test(n.overflowY||""),u=!t&&scrollRegexp.test(n.overflowX||""),l=t?0:parseDimension(n.paddingTop),y=t?0:parseDimension(n.paddingRight),c=t?0:parseDimension(n.paddingBottom),M=t?0:parseDimension(n.paddingLeft),I=t?0:parseDimension(n.borderTopWidth),m=t?0:parseDimension(n.borderRightWidth),g=t?0:parseDimension(n.borderBottomWidth),f=t?0:parseDimension(n.borderLeftWidth),C=M+y,v=l+c,b=f+m,h=I+g,o=u?i.offsetHeight-h-i.clientHeight:0,d=s?i.offsetWidth-b-i.clientWidth:0,p=a?C+b:0,w=a?v+h:0,x=t?t.width:parseDimension(n.width)-p-d,D=t?t.height:parseDimension(n.height)-w-o,T=x+C+d+b,P=D+v+o+h,E=freeze({devicePixelContentBoxSize:size(Math.round(x*devicePixelRatio),Math.round(D*devicePixelRatio),r),borderBoxSize:size(T,P,r),contentBoxSize:size(x,D,r),contentRect:new DOMRectReadOnly(M,l,x,D)});return cache.set(i,E),E},calculateBoxSize=function(i,e,n){var t=calculateBoxSizes(i,n),a=t.borderBoxSize,r=t.contentBoxSize,s=t.devicePixelContentBoxSize;switch(e){case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:return s;case ResizeObserverBoxOptions.BORDER_BOX:return a;default:return r}},ResizeObserverEntry=function(){function i(e){var n=calculateBoxSizes(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=freeze([n.borderBoxSize]),this.contentBoxSize=freeze([n.contentBoxSize]),this.devicePixelContentBoxSize=freeze([n.devicePixelContentBoxSize])}return i}(),calculateDepthForNode=function(i){if(isHidden(i))return 1/0;for(var e=0,n=i.parentNode;n;)e+=1,n=n.parentNode;return e},broadcastActiveObservations=function(){var i=1/0,e=[];resizeObservers.forEach(function(s){if(s.activeTargets.length!==0){var u=[];s.activeTargets.forEach(function(y){var c=new ResizeObserverEntry(y.target),M=calculateDepthForNode(y.target);u.push(c),y.lastReportedSize=calculateBoxSize(y.target,y.observedBox),Mi?n.activeTargets.push(a):n.skippedTargets.push(a))})})},process=function(){var i=0;for(gatherActiveObservationsAtDepth(i);hasActiveObservations();)i=broadcastActiveObservations(),gatherActiveObservationsAtDepth(i);return hasSkippedObservations()&&deliverResizeLoopError(),i>0},trigger,callbacks=[],notify=function(){return callbacks.splice(0).forEach(function(i){return i()})},queueMicroTask=function(i){if(!trigger){var e=0,n=document.createTextNode(""),t={characterData:!0};new MutationObserver(function(){return notify()}).observe(n,t),trigger=function(){n.textContent=""+(e?e--:e++)}}callbacks.push(i),trigger()},queueResizeObserver=function(i){queueMicroTask(function(){requestAnimationFrame(i)})},watching=0,isWatching=function(){return!!watching},CATCH_PERIOD=250,observerConfig={attributes:!0,characterData:!0,childList:!0,subtree:!0},events=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],time=function(i){return i===void 0&&(i=0),Date.now()+i},scheduled=!1,Scheduler=function(){function i(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return i.prototype.run=function(e){var n=this;if(e===void 0&&(e=CATCH_PERIOD),!scheduled){scheduled=!0;var t=time(e);queueResizeObserver(function(){var a=!1;try{a=process()}finally{if(scheduled=!1,e=t-time(),!isWatching())return;a?n.run(1e3):e>0?n.run(e):n.start()}})}},i.prototype.schedule=function(){this.stop(),this.run()},i.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,observerConfig)};document.body?n():global.addEventListener("DOMContentLoaded",n)},i.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),events.forEach(function(n){return global.addEventListener(n,e.listener,!0)}))},i.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),events.forEach(function(n){return global.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},i}(),scheduler=new Scheduler,updateCount=function(i){!watching&&i>0&&scheduler.start(),watching+=i,!watching&&scheduler.stop()},skipNotifyOnElement=function(i){return!isSVG(i)&&!isReplacedElement(i)&&getComputedStyle(i).display==="inline"},ResizeObservation=function(){function i(e,n){this.target=e,this.observedBox=n||ResizeObserverBoxOptions.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return i.prototype.isActive=function(){var e=calculateBoxSize(this.target,this.observedBox,!0);return skipNotifyOnElement(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},i}(),ResizeObserverDetail=function(){function i(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return i}(),observerMap=new WeakMap,getObservationIndex=function(i,e){for(var n=0;n=0&&(r&&resizeObservers.splice(resizeObservers.indexOf(t),1),t.observationTargets.splice(a,1),updateCount(-1))},i.disconnect=function(e){var n=this,t=observerMap.get(e);t.observationTargets.slice().forEach(function(a){return n.unobserve(e,a.target)}),t.activeTargets.splice(0,t.activeTargets.length)},i}(),ResizeObserver$1=function(){function i(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ResizeObserverController.connect(this,e)}return i.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!isElement(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ResizeObserverController.observe(this,e,n)},i.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!isElement(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ResizeObserverController.unobserve(this,e)},i.prototype.disconnect=function(){ResizeObserverController.disconnect(this)},i.toString=function(){return"function ResizeObserver () { [polyfill code] }"},i}();const usePassiveLayoutEffect=React[typeof document<"u"&&document.createElement!==void 0?"useLayoutEffect":"useEffect"],useLatest=i=>{const e=reactExports.useRef(i);return reactExports.useEffect(()=>{e.current=i}),e},ResizeObserver=typeof window<"u"&&"ResizeObserver"in window?window.ResizeObserver:ResizeObserver$1;function _ref(){}function useResizeObserver(i,e){const n=getResizeObserver(),t=useLatest(e);return usePassiveLayoutEffect(()=>{let a=!1;const r=i&&"current"in i?i.current:i;if(!r)return _ref;function s(u,l){a||t.current(u,l)}return n.subscribe(r,s),()=>{a=!0,n.unsubscribe(r,s)}},[i,n,t]),n.observer}function createResizeObserver(){let i=!1,e=[];const n=new Map,t=new ResizeObserver((a,r)=>{e=e.concat(a);function s(){const u=new Set;for(let l=0;lc(e[l],r))}e=[],i=!1}i||window.requestAnimationFrame(s),i=!0});return{observer:t,subscribe(a,r){var s;t.observe(a);const u=(s=n.get(a))!==null&&s!==void 0?s:[];u.push(r),n.set(a,u)},unsubscribe(a,r){var s;const u=(s=n.get(a))!==null&&s!==void 0?s:[];if(u.length===1){t.unobserve(a),n.delete(a);return}const l=u.indexOf(r);l!==-1&&u.splice(l,1),n.set(a,u)}}}let _resizeObserver;const getResizeObserver=()=>_resizeObserver||(_resizeObserver=createResizeObserver()),useSize=i=>{const[e,n]=reactExports.useState(getCurrentSize(i));return reactExports.useLayoutEffect(()=>{n(getCurrentSize(i))},[i]),useResizeObserver(i,()=>{n(getCurrentSize(i))}),e};function getCurrentSize(i){const e=i==null?void 0:i.getBoundingClientRect();return{width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0}}function useAsyncFunctionCall(i){const[e,n]=reactExports.useState();return reactExports.useEffect(()=>{let t=!1;const a=new AbortController;return i(a.signal).then(r=>{t=!0,!a.signal.aborted&&r!==void 0&&n(r)}).catch(r=>{if(t=!0,!a.signal.aborted)throw r}),()=>{t||a.abort()}},[i]),e}const setPdfJsGlobalWorkerOptions=i=>{for(const[e,n]of Object.entries(i))pdfExports.GlobalWorkerOptions[e]=n};var ui_utils={};Object.defineProperty(ui_utils,"__esModule",{value:!0});ui_utils.isValidRotation=isValidRotation;ui_utils.isValidScrollMode=isValidScrollMode;ui_utils.isValidSpreadMode=isValidSpreadMode;ui_utils.isPortraitOrientation=isPortraitOrientation;ui_utils.clamp=clamp;ui_utils.getPDFFileNameFromURL=getPDFFileNameFromURL;ui_utils.noContextMenuHandler=noContextMenuHandler;ui_utils.parseQueryString=parseQueryString;ui_utils.backtrackBeforeAllVisibleElements=backtrackBeforeAllVisibleElements;ui_utils.getVisibleElements=getVisibleElements;ui_utils.roundToDivide=roundToDivide;ui_utils.getPageSizeInches=getPageSizeInches;ui_utils.approximateFraction=approximateFraction;ui_utils.getOutputScale=getOutputScale;ui_utils.scrollIntoView=scrollIntoView;ui_utils.watchScroll=watchScroll;ui_utils.binarySearchFirstItem=binarySearchFirstItem;ui_utils.normalizeWheelEventDirection=normalizeWheelEventDirection;ui_utils.normalizeWheelEventDelta=normalizeWheelEventDelta;ui_utils.waitOnEventOrTimeout=waitOnEventOrTimeout;ui_utils.moveToEndOfArray=moveToEndOfArray;ui_utils.WaitOnType=ui_utils.animationStarted=ui_utils.ProgressBar=EventBus_1=ui_utils.EventBus=ui_utils.NullL10n=ui_utils.SpreadMode=ui_utils.ScrollMode=ui_utils.TextLayerMode=ui_utils.RendererType=ui_utils.PresentationModeState=ui_utils.VERTICAL_PADDING=ui_utils.SCROLLBAR_PADDING=ui_utils.MAX_AUTO_SCALE=ui_utils.UNKNOWN_SCALE=ui_utils.MAX_SCALE=ui_utils.MIN_SCALE=ui_utils.DEFAULT_SCALE=ui_utils.DEFAULT_SCALE_VALUE=ui_utils.CSS_UNITS=ui_utils.AutoPrintRegExp=void 0;const CSS_UNITS=96/72;ui_utils.CSS_UNITS=CSS_UNITS;const DEFAULT_SCALE_VALUE="auto";ui_utils.DEFAULT_SCALE_VALUE=DEFAULT_SCALE_VALUE;const DEFAULT_SCALE=1;ui_utils.DEFAULT_SCALE=DEFAULT_SCALE;const MIN_SCALE=.1;ui_utils.MIN_SCALE=MIN_SCALE;const MAX_SCALE=10;ui_utils.MAX_SCALE=MAX_SCALE;const UNKNOWN_SCALE=0;ui_utils.UNKNOWN_SCALE=UNKNOWN_SCALE;const MAX_AUTO_SCALE=1.25;ui_utils.MAX_AUTO_SCALE=MAX_AUTO_SCALE;const SCROLLBAR_PADDING=40;ui_utils.SCROLLBAR_PADDING=SCROLLBAR_PADDING;const VERTICAL_PADDING=5;ui_utils.VERTICAL_PADDING=VERTICAL_PADDING;const PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};ui_utils.PresentationModeState=PresentationModeState;const RendererType={CANVAS:"canvas",SVG:"svg"};ui_utils.RendererType=RendererType;const TextLayerMode={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2};ui_utils.TextLayerMode=TextLayerMode;const ScrollMode={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2};ui_utils.ScrollMode=ScrollMode;const SpreadMode={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};ui_utils.SpreadMode=SpreadMode;const AutoPrintRegExp=/\bprint\s*\(/;ui_utils.AutoPrintRegExp=AutoPrintRegExp;function formatL10nValue(i,e){return e?i.replace(/\{\{\s*(\w+)\s*\}\}/g,(n,t)=>t in e?e[t]:"{{"+t+"}}"):i}const NullL10n={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(i,e,n){return formatL10nValue(n,e)},async translate(i){}};ui_utils.NullL10n=NullL10n;function getOutputScale(i){const e=window.devicePixelRatio||1,n=i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1,t=e/n;return{sx:t,sy:t,scaled:t!==1}}function scrollIntoView(i,e,n=!1){let t=i.offsetParent;if(!t){console.error("offsetParent is not set -- cannot scroll");return}let a=i.offsetTop+i.clientTop,r=i.offsetLeft+i.clientLeft;for(;t.clientHeight===t.scrollHeight&&t.clientWidth===t.scrollWidth||n&&getComputedStyle(t).overflow==="hidden";)if(t.dataset._scaleY&&(a/=t.dataset._scaleY,r/=t.dataset._scaleX),a+=t.offsetTop,r+=t.offsetLeft,t=t.offsetParent,!t)return;e&&(e.top!==void 0&&(a+=e.top),e.left!==void 0&&(r+=e.left,t.scrollLeft=r)),t.scrollTop=a}function watchScroll(i,e){const n=function(r){a||(a=window.requestAnimationFrame(function(){a=null;const u=i.scrollLeft,l=t.lastX;u!==l&&(t.right=u>l),t.lastX=u;const y=i.scrollTop,c=t.lastY;y!==c&&(t.down=y>c),t.lastY=y,e(t)}))},t={right:!0,down:!0,lastX:i.scrollLeft,lastY:i.scrollTop,_eventHandler:n};let a=null;return i.addEventListener("scroll",n,!0),t}function parseQueryString(i){const e=i.split("&"),n=Object.create(null);for(let t=0,a=e.length;t1?r[1]:null;n[decodeURIComponent(s)]=decodeURIComponent(u)}return n}function binarySearchFirstItem(i,e){let n=0,t=i.length-1;if(t<0||!e(i[t]))return i.length;if(e(i[n]))return n;for(;n>1,r=i[a];e(r)?t=a:n=a+1}return n}function approximateFraction(i){if(Math.floor(i)===i)return[i,1];const e=1/i,n=8;if(e>n)return[1,n];if(Math.floor(e)===e)return[1,e];const t=i>1?e:i;let a=0,r=1,s=1,u=1;for(;;){const y=a+s,c=r+u;if(c>n)break;t<=y/c?(s=y,u=c):(a=y,r=c)}let l;return t-a/r=n&&(t=e[i-1].div,a=t.offsetTop+t.clientTop);for(let r=i-2;r>=0&&(t=e[r].div,!(t.offsetTop+t.clientTop+t.clientHeight<=a));--r)i=r;return i}function getVisibleElements(i,e,n=!1,t=!1){const a=i.scrollTop,r=a+i.clientHeight,s=i.scrollLeft,u=s+i.clientWidth;function l(C){const v=C.div;return v.offsetTop+v.clientTop+v.clientHeight>a}function y(C){const v=C.div;return v.offsetLeft+v.clientLeft+v.clientWidth>s}const c=[],M=e.length;let I=M===0?0:binarySearchFirstItem(e,t?y:l);I>0&&I=r&&(m=x);else if((t?h:o)>m)break;if(x<=a||o>=r||w<=s||h>=u)continue;const D=Math.max(0,a-o)+Math.max(0,x-r),T=Math.max(0,s-h)+Math.max(0,w-u),P=(p-D)*(d-T)*100/p/d|0;c.push({id:v.id,x:h,y:o,view:v,percent:P})}const g=c[0],f=c[c.length-1];return n&&c.sort(function(C,v){const b=C.percent-v.percent;return Math.abs(b)>.001?-b:C.id-v.id}),{first:g,last:f,views:c}}function noContextMenuHandler(i){i.preventDefault()}function isDataSchema(i){let e=0;const n=i.length;for(;e=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function r(y){i instanceof EventBus?i._off(e,s):i.removeEventListener(e,s),l&&clearTimeout(l),t(y)}const s=r.bind(null,WaitOnType.EVENT);i instanceof EventBus?i._on(e,s):i.addEventListener(e,s);const u=r.bind(null,WaitOnType.TIMEOUT),l=setTimeout(u,n)})}const animationStarted=new Promise(function(i){window.requestAnimationFrame(i)});ui_utils.animationStarted=animationStarted;class EventBus{constructor(e){this._listeners=Object.create(null)}on(e,n){this._on(e,n,{external:!0})}off(e,n){this._off(e,n,{external:!0})}dispatch(e){const n=this._listeners[e];if(!n||n.length===0)return;const t=Array.prototype.slice.call(arguments,1);let a;n.slice(0).forEach(function({listener:r,external:s}){if(s){a||(a=[]),a.push(r);return}r.apply(null,t)}),a&&(a.forEach(function(r){r.apply(null,t)}),a=null)}_on(e,n,t=null){let a=this._listeners[e];a||(this._listeners[e]=a=[]),a.push({listener:n,external:(t&&t.external)===!0})}_off(e,n,t=null){const a=this._listeners[e];if(a){for(let r=0,s=a.length;r0&&(this.bar.style.width=`calc(100% - ${t}px)`)}hide(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"),document.body.classList.remove("loadingInProgress"))}show(){this.visible||(this.visible=!0,document.body.classList.add("loadingInProgress"),this.bar.classList.remove("hidden"))}}ui_utils.ProgressBar=ProgressBar;function moveToEndOfArray(i,e){const n=[],t=i.length;let a=0;for(let r=0;r=VerbosityLevel.INFOS&&console.log(`Info: ${i}`)}function warn(i){verbosity>=VerbosityLevel.WARNINGS&&console.log(`Warning: ${i}`)}function unreachable(i){throw new Error(i)}function assert(i,e){i||unreachable(e)}function isSameOrigin(i,e){let n;try{if(n=new URL(i),!n.origin||n.origin==="null")return!1}catch{return!1}const t=new URL(e,n);return n.origin===t.origin}function _isValidProtocol(i){if(!i)return!1;switch(i.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function createValidAbsoluteUrl(i,e){if(!i)return null;try{const n=e?new URL(i,e):new URL(i);if(_isValidProtocol(n))return n}catch{}return null}function shadow(i,e,n){return Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}const BaseException=function i(){function e(n){this.constructor===e&&unreachable("Cannot initialize BaseException."),this.message=n,this.name=this.constructor.name}return e.prototype=new Error,e.constructor=e,e}();util.BaseException=BaseException;class PasswordException extends BaseException{constructor(e,n){super(e),this.code=n}}util.PasswordException=PasswordException;class UnknownErrorException extends BaseException{constructor(e,n){super(e),this.details=n}}util.UnknownErrorException=UnknownErrorException;class InvalidPDFException extends BaseException{}util.InvalidPDFException=InvalidPDFException;class MissingPDFException extends BaseException{}util.MissingPDFException=MissingPDFException;class UnexpectedResponseException extends BaseException{constructor(e,n){super(e),this.status=n}}util.UnexpectedResponseException=UnexpectedResponseException;class FormatError extends BaseException{}util.FormatError=FormatError;class AbortException extends BaseException{}util.AbortException=AbortException;const NullCharactersRegExp=/\x00/g;function removeNullCharacters(i){return typeof i!="string"?(warn("The argument for removeNullCharacters must be a string."),i):i.replace(NullCharactersRegExp,"")}function bytesToString(i){assert(i!==null&&typeof i=="object"&&i.length!==void 0,"Invalid argument for bytesToString");const e=i.length,n=8192;if(e>24&255,i>>16&255,i>>8&255,i&255)}function isLittleEndian(){const i=new Uint8Array(4);return i[0]=1,new Uint32Array(i.buffer,0,1)[0]===1}const IsLittleEndianCached={get value(){return shadow(this,"value",isLittleEndian())}};util.IsLittleEndianCached=IsLittleEndianCached;function isEvalSupported(){try{return new Function(""),!0}catch{return!1}}const IsEvalSupportedCached={get value(){return shadow(this,"value",isEvalSupported())}};util.IsEvalSupportedCached=IsEvalSupportedCached;const rgbBuf=["rgb(",0,",",0,",",0,")"];class Util{static makeCssRgb(e,n,t){return rgbBuf[1]=e,rgbBuf[3]=n,rgbBuf[5]=t,rgbBuf.join("")}static transform(e,n){return[e[0]*n[0]+e[2]*n[1],e[1]*n[0]+e[3]*n[1],e[0]*n[2]+e[2]*n[3],e[1]*n[2]+e[3]*n[3],e[0]*n[4]+e[2]*n[5]+e[4],e[1]*n[4]+e[3]*n[5]+e[5]]}static applyTransform(e,n){const t=e[0]*n[0]+e[1]*n[2]+n[4],a=e[0]*n[1]+e[1]*n[3]+n[5];return[t,a]}static applyInverseTransform(e,n){const t=n[0]*n[3]-n[1]*n[2],a=(e[0]*n[3]-e[1]*n[2]+n[2]*n[5]-n[4]*n[3])/t,r=(-e[0]*n[1]+e[1]*n[0]+n[4]*n[1]-n[5]*n[0])/t;return[a,r]}static getAxialAlignedBoundingBox(e,n){const t=Util.applyTransform(e,n),a=Util.applyTransform(e.slice(2,4),n),r=Util.applyTransform([e[0],e[3]],n),s=Util.applyTransform([e[2],e[1]],n);return[Math.min(t[0],a[0],r[0],s[0]),Math.min(t[1],a[1],r[1],s[1]),Math.max(t[0],a[0],r[0],s[0]),Math.max(t[1],a[1],r[1],s[1])]}static inverseTransform(e){const n=e[0]*e[3]-e[1]*e[2];return[e[3]/n,-e[1]/n,-e[2]/n,e[0]/n,(e[2]*e[5]-e[4]*e[3])/n,(e[4]*e[1]-e[5]*e[0])/n]}static apply3dTransform(e,n){return[e[0]*n[0]+e[1]*n[1]+e[2]*n[2],e[3]*n[0]+e[4]*n[1]+e[5]*n[2],e[6]*n[0]+e[7]*n[1]+e[8]*n[2]]}static singularValueDecompose2dScale(e){const n=[e[0],e[2],e[1],e[3]],t=e[0]*n[0]+e[1]*n[2],a=e[0]*n[1]+e[1]*n[3],r=e[2]*n[0]+e[3]*n[2],s=e[2]*n[1]+e[3]*n[3],u=(t+s)/2,l=Math.sqrt((t+s)*(t+s)-4*(t*s-r*a))/2,y=u+l||1,c=u-l||1;return[Math.sqrt(y),Math.sqrt(c)]}static normalizeRect(e){const n=e.slice(0);return e[0]>e[2]&&(n[0]=e[2],n[2]=e[0]),e[1]>e[3]&&(n[1]=e[3],n[3]=e[1]),n}static intersect(e,n){function t(u,l){return u-l}const a=[e[0],e[2],n[0],n[2]].sort(t),r=[e[1],e[3],n[1],n[3]].sort(t),s=[];if(e=Util.normalizeRect(e),n=Util.normalizeRect(n),a[0]===e[0]&&a[1]===n[0]||a[0]===n[0]&&a[1]===e[0])s[0]=a[1],s[2]=a[2];else return null;if(r[0]===e[1]&&r[1]===n[1]||r[0]===n[1]&&r[1]===e[1])s[1]=r[1],s[3]=r[2];else return null;return s}}util.Util=Util;const PDFStringTranslateTable=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToPDFString(i){const e=i.length,n=[];if(i[0]==="þ"&&i[1]==="ÿ")for(let t=2;t>2,m=(y&3)<<4|c>>4,g=u+1>6:64,f=u+2{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)})}_fetchData(e,n){(0,_util$d.unreachable)("Abstract method `_fetchData` called.")}}display_utils.BaseCMapReaderFactory=BaseCMapReaderFactory;class DOMCMapReaderFactory extends BaseCMapReaderFactory{_fetchData(e,n){return isFetchSupported()&&isValidFetchUrl(e,document.baseURI)?fetch(e).then(async t=>{if(!t.ok)throw new Error(t.statusText);let a;return this.isCompressed?a=new Uint8Array(await t.arrayBuffer()):a=(0,_util$d.stringToBytes)(await t.text()),{cMapData:a,compressionType:n}}):new Promise((t,a)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),this.isCompressed&&(r.responseType="arraybuffer"),r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(r.status===200||r.status===0){let s;if(this.isCompressed&&r.response?s=new Uint8Array(r.response):!this.isCompressed&&r.responseText&&(s=(0,_util$d.stringToBytes)(r.responseText)),s){t({cMapData:s,compressionType:n});return}}a(new Error(r.statusText))}},r.send(null)})}}display_utils.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMSVGFactory{create(e,n){(0,_util$d.assert)(e>0&&n>0,"Invalid SVG dimensions");const t=document.createElementNS(SVG_NS,"svg:svg");return t.setAttribute("version","1.1"),t.setAttribute("width",e+"px"),t.setAttribute("height",n+"px"),t.setAttribute("preserveAspectRatio","none"),t.setAttribute("viewBox","0 0 "+e+" "+n),t}createElement(e){return(0,_util$d.assert)(typeof e=="string","Invalid SVG element type"),document.createElementNS(SVG_NS,e)}}display_utils.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor({viewBox:e,scale:n,rotation:t,offsetX:a=0,offsetY:r=0,dontFlip:s=!1}){this.viewBox=e,this.scale=n,this.rotation=t,this.offsetX=a,this.offsetY=r;const u=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let y,c,M,I;switch(t=t%360,t=t<0?t+360:t,t){case 180:y=-1,c=0,M=0,I=1;break;case 90:y=0,c=1,M=1,I=0;break;case 270:y=0,c=-1,M=-1,I=0;break;case 0:y=1,c=0,M=0,I=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}s&&(M=-M,I=-I);let m,g,f,C;y===0?(m=Math.abs(l-e[1])*n+a,g=Math.abs(u-e[0])*n+r,f=Math.abs(e[3]-e[1])*n,C=Math.abs(e[2]-e[0])*n):(m=Math.abs(u-e[0])*n+a,g=Math.abs(l-e[1])*n+r,f=Math.abs(e[2]-e[0])*n,C=Math.abs(e[3]-e[1])*n),this.transform=[y*n,c*n,M*n,I*n,m-y*n*u-M*n*l,g-c*n*u-I*n*l],this.width=f,this.height=C}clone({scale:e=this.scale,rotation:n=this.rotation,offsetX:t=this.offsetX,offsetY:a=this.offsetY,dontFlip:r=!1}={}){return new PageViewport({viewBox:this.viewBox.slice(),scale:e,rotation:n,offsetX:t,offsetY:a,dontFlip:r})}convertToViewportPoint(e,n){return _util$d.Util.applyTransform([e,n],this.transform)}convertToViewportRectangle(e){const n=_util$d.Util.applyTransform([e[0],e[1]],this.transform),t=_util$d.Util.applyTransform([e[2],e[3]],this.transform);return[n[0],n[1],t[0],t[1]]}convertToPdfPoint(e,n){return _util$d.Util.applyInverseTransform([e,n],this.transform)}}display_utils.PageViewport=PageViewport;class RenderingCancelledException extends _util$d.BaseException{constructor(e,n){super(e),this.type=n}}display_utils.RenderingCancelledException=RenderingCancelledException;const LinkTarget={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};display_utils.LinkTarget=LinkTarget;function addLinkAttributes(i,{url:e,target:n,rel:t,enabled:a=!0}={}){(0,_util$d.assert)(e&&typeof e=="string",'addLinkAttributes: A valid "url" parameter must provided.');const r=(0,_util$d.removeNullCharacters)(e);a?i.href=i.title=r:(i.href="",i.title=`Disabled: ${r}`,i.onclick=()=>!1);let s="";switch(n){case LinkTarget.NONE:break;case LinkTarget.SELF:s="_self";break;case LinkTarget.BLANK:s="_blank";break;case LinkTarget.PARENT:s="_parent";break;case LinkTarget.TOP:s="_top";break}i.target=s,i.rel=typeof t=="string"?t:DEFAULT_LINK_REL}function getFilenameFromUrl(i){const e=i.indexOf("#"),n=i.indexOf("?"),t=Math.min(e>0?e:i.length,n>0?n:i.length);return i.substring(i.lastIndexOf("/",t)+1,t)}class StatTimer{constructor(){this.started=Object.create(null),this.times=[]}time(e){e in this.started&&(0,_util$d.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,_util$d.warn)(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let n=0;for(const t of this.times){const a=t.name;a.length>n&&(n=a.length)}for(const t of this.times){const a=t.end-t.start;e.push(`${t.name.padEnd(n)} ${a}ms +`}setFont(d){const p=this.current,w=this.commonObjs.get(d[0]);let x=d[1];p.font=w,this.embedFonts&&!w.missingFile&&!this.embeddedFonts[w.loadedName]&&(this.addFontStyle(w),this.embeddedFonts[w.loadedName]=w),p.fontMatrix=w.fontMatrix?w.fontMatrix:t.FONT_IDENTITY_MATRIX;let D="normal";w.black?D="900":w.bold&&(D="bold");const T=w.italic?"italic":"normal";x<0?(x=-x,p.fontDirection=-1):p.fontDirection=1,p.fontSize=x,p.fontFamily=w.loadedName,p.fontWeight=D,p.fontStyle=T,p.tspan=this.svgFactory.createElement("svg:tspan"),p.tspan.setAttributeNS(null,"y",f(-p.y)),p.xcoords=[],p.ycoords=[]}endText(){const d=this.current;d.textRenderingMode&t.TextRenderingMode.ADD_TO_PATH_FLAG&&d.txtElement&&d.txtElement.hasChildNodes()&&(d.element=d.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(d){d>0&&(this.current.lineWidth=d)}setLineCap(d){this.current.lineCap=c[d]}setLineJoin(d){this.current.lineJoin=M[d]}setMiterLimit(d){this.current.miterLimit=d}setStrokeAlpha(d){this.current.strokeAlpha=d}setStrokeRGBColor(d,p,w){this.current.strokeColor=t.Util.makeCssRgb(d,p,w)}setFillAlpha(d){this.current.fillAlpha=d}setFillRGBColor(d,p,w){this.current.fillColor=t.Util.makeCssRgb(d,p,w),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(d){this.current.strokeColor=this._makeColorN_Pattern(d)}setFillColorN(d){this.current.fillColor=this._makeColorN_Pattern(d)}shadingFill(d){const p=this.viewport.width,w=this.viewport.height,x=t.Util.inverseTransform(this.transformMatrix),D=t.Util.applyTransform([0,0],x),T=t.Util.applyTransform([0,w],x),P=t.Util.applyTransform([p,0],x),E=t.Util.applyTransform([p,w],x),B=Math.min(D[0],T[0],P[0],E[0]),L=Math.min(D[1],T[1],P[1],E[1]),O=Math.max(D[0],T[0],P[0],E[0]),k=Math.max(D[1],T[1],P[1],E[1]),j=this.svgFactory.createElement("svg:rect");j.setAttributeNS(null,"x",B),j.setAttributeNS(null,"y",L),j.setAttributeNS(null,"width",O-B),j.setAttributeNS(null,"height",k-L),j.setAttributeNS(null,"fill",this._makeShadingPattern(d)),this.current.fillAlpha<1&&j.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(j)}_makeColorN_Pattern(d){return d[0]==="TilingPattern"?this._makeTilingPattern(d):this._makeShadingPattern(d)}_makeTilingPattern(d){const p=d[1],w=d[2],x=d[3]||t.IDENTITY_MATRIX,[D,T,P,E]=d[4],B=d[5],L=d[6],O=d[7],k=`shading${h++}`,[j,A]=t.Util.applyTransform([D,T],x),[S,R]=t.Util.applyTransform([P,E],x),[N,U]=t.Util.singularValueDecompose2dScale(x),F=B*N,G=L*U,z=this.svgFactory.createElement("svg:pattern");z.setAttributeNS(null,"id",k),z.setAttributeNS(null,"patternUnits","userSpaceOnUse"),z.setAttributeNS(null,"width",F),z.setAttributeNS(null,"height",G),z.setAttributeNS(null,"x",`${j}`),z.setAttributeNS(null,"y",`${A}`);const W=this.svg,V=this.transformMatrix,K=this.current.fillColor,Y=this.current.strokeColor,H=this.svgFactory.create(S-j,R-A);if(this.svg=H,this.transformMatrix=x,O===2){const J=t.Util.makeCssRgb(...p);this.current.fillColor=J,this.current.strokeColor=J}return this.executeOpTree(this.convertOpList(w)),this.svg=W,this.transformMatrix=V,this.current.fillColor=K,this.current.strokeColor=Y,z.appendChild(H.childNodes[0]),this.defs.appendChild(z),`url(#${k})`}_makeShadingPattern(d){switch(d[0]){case"RadialAxial":const p=`shading${h++}`,w=d[3];let x;switch(d[1]){case"axial":const D=d[4],T=d[5];x=this.svgFactory.createElement("svg:linearGradient"),x.setAttributeNS(null,"id",p),x.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),x.setAttributeNS(null,"x1",D[0]),x.setAttributeNS(null,"y1",D[1]),x.setAttributeNS(null,"x2",T[0]),x.setAttributeNS(null,"y2",T[1]);break;case"radial":const P=d[4],E=d[5],B=d[6],L=d[7];x=this.svgFactory.createElement("svg:radialGradient"),x.setAttributeNS(null,"id",p),x.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),x.setAttributeNS(null,"cx",E[0]),x.setAttributeNS(null,"cy",E[1]),x.setAttributeNS(null,"r",L),x.setAttributeNS(null,"fx",P[0]),x.setAttributeNS(null,"fy",P[1]),x.setAttributeNS(null,"fr",B);break;default:throw new Error(`Unknown RadialAxial type: ${d[1]}`)}for(const D of w){const T=this.svgFactory.createElement("svg:stop");T.setAttributeNS(null,"offset",D[0]),T.setAttributeNS(null,"stop-color",D[1]),x.appendChild(T)}return this.defs.appendChild(x),`url(#${p})`;case"Mesh":return(0,t.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${d[0]}`)}}setDash(d,p){this.current.dashArray=d,this.current.dashPhase=p}constructPath(d,p){const w=this.current;let x=w.x,D=w.y,T=[],P=0;for(const E of d)switch(E|0){case t.OPS.rectangle:x=p[P++],D=p[P++];const B=p[P++],L=p[P++],O=x+B,k=D+L;T.push("M",f(x),f(D),"L",f(O),f(D),"L",f(O),f(k),"L",f(x),f(k),"Z");break;case t.OPS.moveTo:x=p[P++],D=p[P++],T.push("M",f(x),f(D));break;case t.OPS.lineTo:x=p[P++],D=p[P++],T.push("L",f(x),f(D));break;case t.OPS.curveTo:x=p[P+4],D=p[P+5],T.push("C",f(p[P]),f(p[P+1]),f(p[P+2]),f(p[P+3]),f(x),f(D)),P+=6;break;case t.OPS.curveTo2:T.push("C",f(x),f(D),f(p[P]),f(p[P+1]),f(p[P+2]),f(p[P+3])),x=p[P+2],D=p[P+3],P+=4;break;case t.OPS.curveTo3:x=p[P+2],D=p[P+3],T.push("C",f(p[P]),f(p[P+1]),f(x),f(D),f(x),f(D)),P+=4;break;case t.OPS.closePath:T.push("Z");break}T=T.join(" "),w.path&&d.length>0&&d[0]!==t.OPS.rectangle&&d[0]!==t.OPS.moveTo?T=w.path.getAttributeNS(null,"d")+T:(w.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(w.path)),w.path.setAttributeNS(null,"d",T),w.path.setAttributeNS(null,"fill","none"),w.element=w.path,w.setCurrentPoint(x,D)}endPath(){const d=this.current;if(d.path=null,!this.pendingClip)return;if(!d.element){this.pendingClip=null;return}const p=`clippath${v++}`,w=this.svgFactory.createElement("svg:clipPath");w.setAttributeNS(null,"id",p),w.setAttributeNS(null,"transform",C(this.transformMatrix));const x=d.element.cloneNode(!0);this.pendingClip==="evenodd"?x.setAttributeNS(null,"clip-rule","evenodd"):x.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,w.appendChild(x),this.defs.appendChild(w),d.activeClipUrl&&(d.clipGroup=null,this.extraStack.forEach(function(D){D.clipGroup=null}),w.setAttributeNS(null,"clip-path",d.activeClipUrl)),d.activeClipUrl=`url(#${p})`,this.tgrp=null}clip(d){this.pendingClip=d}closePath(){const d=this.current;if(d.path){const p=`${d.path.getAttributeNS(null,"d")}Z`;d.path.setAttributeNS(null,"d",p)}}setLeading(d){this.current.leading=-d}setTextRise(d){this.current.textRise=d}setTextRenderingMode(d){this.current.textRenderingMode=d}setHScale(d){this.current.textHScale=d/100}setRenderingIntent(d){}setFlatness(d){}setGState(d){for(const[p,w]of d)switch(p){case"LW":this.setLineWidth(w);break;case"LC":this.setLineCap(w);break;case"LJ":this.setLineJoin(w);break;case"ML":this.setMiterLimit(w);break;case"D":this.setDash(w[0],w[1]);break;case"RI":this.setRenderingIntent(w);break;case"FL":this.setFlatness(w);break;case"Font":this.setFont(w);break;case"CA":this.setStrokeAlpha(w);break;case"ca":this.setFillAlpha(w);break;default:(0,t.warn)(`Unimplemented graphic state operator ${p}`);break}}fill(){const d=this.current;d.element&&(d.element.setAttributeNS(null,"fill",d.fillColor),d.element.setAttributeNS(null,"fill-opacity",d.fillAlpha),this.endPath())}stroke(){const d=this.current;d.element&&(this._setStrokeAttributes(d.element),d.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(d,p=1){const w=this.current;let x=w.dashArray;p!==1&&x.length>0&&(x=x.map(function(D){return p*D})),d.setAttributeNS(null,"stroke",w.strokeColor),d.setAttributeNS(null,"stroke-opacity",w.strokeAlpha),d.setAttributeNS(null,"stroke-miterlimit",f(w.miterLimit)),d.setAttributeNS(null,"stroke-linecap",w.lineCap),d.setAttributeNS(null,"stroke-linejoin",w.lineJoin),d.setAttributeNS(null,"stroke-width",f(p*w.lineWidth)+"px"),d.setAttributeNS(null,"stroke-dasharray",x.map(f).join(" ")),d.setAttributeNS(null,"stroke-dashoffset",f(p*w.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const d=this.svgFactory.createElement("svg:rect");d.setAttributeNS(null,"x","0"),d.setAttributeNS(null,"y","0"),d.setAttributeNS(null,"width","1px"),d.setAttributeNS(null,"height","1px"),d.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(d)}paintImageXObject(d){const p=d.startsWith("g_")?this.commonObjs.get(d):this.objs.get(d);if(!p){(0,t.warn)(`Dependent image with object ID ${d} is not ready yet`);return}this.paintInlineImageXObject(p)}paintInlineImageXObject(d,p){const w=d.width,x=d.height,D=I(d,this.forceDataSchema,!!p),T=this.svgFactory.createElement("svg:rect");T.setAttributeNS(null,"x","0"),T.setAttributeNS(null,"y","0"),T.setAttributeNS(null,"width",f(w)),T.setAttributeNS(null,"height",f(x)),this.current.element=T,this.clip("nonzero");const P=this.svgFactory.createElement("svg:image");P.setAttributeNS(y,"xlink:href",D),P.setAttributeNS(null,"x","0"),P.setAttributeNS(null,"y",f(-x)),P.setAttributeNS(null,"width",f(w)+"px"),P.setAttributeNS(null,"height",f(x)+"px"),P.setAttributeNS(null,"transform",`scale(${f(1/w)} ${f(-1/x)})`),p?p.appendChild(P):this._ensureTransformGroup().appendChild(P)}paintImageMaskXObject(d){const p=this.current,w=d.width,x=d.height,D=p.fillColor;p.maskId=`mask${b++}`;const T=this.svgFactory.createElement("svg:mask");T.setAttributeNS(null,"id",p.maskId);const P=this.svgFactory.createElement("svg:rect");P.setAttributeNS(null,"x","0"),P.setAttributeNS(null,"y","0"),P.setAttributeNS(null,"width",f(w)),P.setAttributeNS(null,"height",f(x)),P.setAttributeNS(null,"fill",D),P.setAttributeNS(null,"mask",`url(#${p.maskId})`),this.defs.appendChild(T),this._ensureTransformGroup().appendChild(P),this.paintInlineImageXObject(d,T)}paintFormXObjectBegin(d,p){if(Array.isArray(d)&&d.length===6&&this.transform(d[0],d[1],d[2],d[3],d[4],d[5]),p){const w=p[2]-p[0],x=p[3]-p[1],D=this.svgFactory.createElement("svg:rect");D.setAttributeNS(null,"x",p[0]),D.setAttributeNS(null,"y",p[1]),D.setAttributeNS(null,"width",f(w)),D.setAttributeNS(null,"height",f(x)),this.current.element=D,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(d){const p=this.svgFactory.create(d.width,d.height),w=this.svgFactory.createElement("svg:defs");p.appendChild(w),this.defs=w;const x=this.svgFactory.createElement("svg:g");return x.setAttributeNS(null,"transform",C(d.transform)),p.appendChild(x),this.svg=x,p}_ensureClipGroup(){if(!this.current.clipGroup){const d=this.svgFactory.createElement("svg:g");d.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(d),this.current.clipGroup=d}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",C(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}}},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.PDFNodeStream=void 0;var t=n(2),a=n(23);const r=require$$2,s=requireStreamHttp(),u=httpsBrowserifyExports,l=urlExports,y=/^file:\/\/\/[a-zA-Z]:\//;function c(h){const o=l.parse(h);return o.protocol==="file:"||o.host?o:/^[a-z]:[/\\]/i.test(h)?l.parse(`file:///${h}`):(o.host||(o.protocol="file:"),o)}class M{constructor(o){this.source=o,this.url=c(o.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&o.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,t.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new v(this):new f(this),this._fullRequestReader}getRangeReader(o,d){if(d<=this._progressiveDataLength)return null;const p=this.isFsUrl?new b(this,o,d):new C(this,o,d);return this._rangeRequestReaders.push(p),p}cancelAllRequests(o){this._fullRequestReader&&this._fullRequestReader.cancel(o),this._rangeRequestReaders.slice(0).forEach(function(p){p.cancel(o)})}}e.PDFNodeStream=M;class I{constructor(o){this._url=o.url,this._done=!1,this._storedError=null,this.onProgress=null;const d=o.source;this._contentLength=d.length,this._loaded=0,this._filename=null,this._disableRange=d.disableRange||!1,this._rangeChunkSize=d.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!d.disableStream,this._isRangeSupported=!d.disableRange,this._readableStream=null,this._readCapability=(0,t.createPromiseCapability)(),this._headersCapability=(0,t.createPromiseCapability)()}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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const o=this._readableStream.read();return o===null?(this._readCapability=(0,t.createPromiseCapability)(),this.read()):(this._loaded+=o.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(o).buffer,done:!1})}cancel(o){if(!this._readableStream){this._error(o);return}this._readableStream.destroy(o)}_error(o){this._storedError=o,this._readCapability.resolve()}_setReadableStream(o){this._readableStream=o,o.on("readable",()=>{this._readCapability.resolve()}),o.on("end",()=>{o.destroy(),this._done=!0,this._readCapability.resolve()}),o.on("error",d=>{this._error(d)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new t.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class m{constructor(o){this._url=o.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,t.createPromiseCapability)();const d=o.source;this._isStreamingSupported=!d.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const o=this._readableStream.read();return o===null?(this._readCapability=(0,t.createPromiseCapability)(),this.read()):(this._loaded+=o.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(o).buffer,done:!1})}cancel(o){if(!this._readableStream){this._error(o);return}this._readableStream.destroy(o)}_error(o){this._storedError=o,this._readCapability.resolve()}_setReadableStream(o){this._readableStream=o,o.on("readable",()=>{this._readCapability.resolve()}),o.on("end",()=>{o.destroy(),this._done=!0,this._readCapability.resolve()}),o.on("error",d=>{this._error(d)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function g(h,o){return{protocol:h.protocol,auth:h.auth,host:h.hostname,port:h.port,path:h.path,method:"GET",headers:o}}class f extends I{constructor(o){super(o);const d=p=>{if(p.statusCode===404){const T=new t.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=T,this._headersCapability.reject(T);return}this._headersCapability.resolve(),this._setReadableStream(p);const w=T=>this._readableStream.headers[T.toLowerCase()],{allowRangeRequests:x,suggestedLength:D}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:w,isHttp:o.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=x,this._contentLength=D||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(w)};this._request=null,this._url.protocol==="http:"?this._request=s.request(g(this._url,o.httpHeaders),d):this._request=u.request(g(this._url,o.httpHeaders),d),this._request.on("error",p=>{this._storedError=p,this._headersCapability.reject(p)}),this._request.end()}}class C extends m{constructor(o,d,p){super(o),this._httpHeaders={};for(const x in o.httpHeaders){const D=o.httpHeaders[x];typeof D>"u"||(this._httpHeaders[x]=D)}this._httpHeaders.Range=`bytes=${d}-${p-1}`;const w=x=>{if(x.statusCode===404){const D=new t.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=D;return}this._setReadableStream(x)};this._request=null,this._url.protocol==="http:"?this._request=s.request(g(this._url,this._httpHeaders),w):this._request=u.request(g(this._url,this._httpHeaders),w),this._request.on("error",x=>{this._storedError=x}),this._request.end()}}class v extends I{constructor(o){super(o);let d=decodeURIComponent(this._url.path);y.test(this._url.href)&&(d=d.replace(/^\//,"")),r.lstat(d,(p,w)=>{if(p){p.code==="ENOENT"&&(p=new t.MissingPDFException(`Missing PDF "${d}".`)),this._storedError=p,this._headersCapability.reject(p);return}this._contentLength=w.size,this._setReadableStream(r.createReadStream(d)),this._headersCapability.resolve()})}}class b extends m{constructor(o,d,p){super(o);let w=decodeURIComponent(this._url.path);y.test(this._url.href)&&(w=w.replace(/^\//,"")),this._setReadableStream(r.createReadStream(w,{start:d,end:p-1}))}}},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.createResponseStatusError=u,e.extractFilenameFromHeader=s,e.validateRangeRequestCapabilities=r,e.validateResponseStatus=l;var t=n(2),a=n(24);function r({getResponseHeader:y,isHttp:c,rangeChunkSize:M,disableRange:I}){(0,t.assert)(M>0,"Range chunk size must be larger than zero");const m={allowRangeRequests:!1,suggestedLength:void 0},g=parseInt(y("Content-Length"),10);return!Number.isInteger(g)||(m.suggestedLength=g,g<=2*M)||I||!c||y("Accept-Ranges")!=="bytes"||(y("Content-Encoding")||"identity")!=="identity"||(m.allowRangeRequests=!0),m}function s(y){const c=y("Content-Disposition");if(c){let M=(0,a.getFilenameFromContentDispositionHeader)(c);if(M.includes("%"))try{M=decodeURIComponent(M)}catch{}if(/\.pdf$/i.test(M))return M}return null}function u(y,c){return y===404||y===0&&c.startsWith("file:")?new t.MissingPDFException('Missing PDF "'+c+'".'):new t.UnexpectedResponseException("Unexpected server response ("+y+') while retrieving PDF "'+c+'".',y)}function l(y){return y===200||y===206}},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.getFilenameFromContentDispositionHeader=t;function t(a){let r=!0,s=u("filename\\*","i").exec(a);if(s){s=s[1];let g=M(s);return g=unescape(g),g=I(g),g=m(g),y(g)}if(s=c(a),s){const g=m(s);return y(g)}if(s=u("filename","i").exec(a),s){s=s[1];let g=M(s);return g=m(g),y(g)}function u(g,f){return new RegExp("(?:^|;)\\s*"+g+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',f)}function l(g,f){if(g){if(!/^[\x00-\xFF]+$/.test(f))return f;try{const C=new TextDecoder(g,{fatal:!0}),v=Array.from(f,function(b){return b.charCodeAt(0)&255});f=C.decode(new Uint8Array(v)),r=!1}catch{if(/^utf-?8$/i.test(g))try{f=decodeURIComponent(escape(f)),r=!1}catch{}}}return f}function y(g){return r&&/[\x80-\xff]/.test(g)&&(g=l("utf-8",g),r&&(g=l("iso-8859-1",g))),g}function c(g){const f=[];let C;const v=u("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(C=v.exec(g))!==null;){let[,h,o,d]=C;if(h=parseInt(h,10),h in f){if(h===0)break;continue}f[h]=[o,d]}const b=[];for(let h=0;h"u"||g.setRequestHeader(v,b)}return this.isHttp&&"begin"in m&&"end"in m?(g.setRequestHeader("Range",`bytes=${m.begin}-${m.end-1}`),C.expectedStatus=s):C.expectedStatus=r,g.responseType="arraybuffer",m.onError&&(g.onerror=function(v){m.onError(g.status)}),g.onreadystatechange=this.onStateChange.bind(this,f),g.onprogress=this.onProgress.bind(this,f),C.onHeadersReceived=m.onHeadersReceived,C.onDone=m.onDone,C.onError=m.onError,C.onProgress=m.onProgress,g.send(null),f}onProgress(m,g){const f=this.pendingRequests[m];f&&f.onProgress&&f.onProgress(g)}onStateChange(m,g){const f=this.pendingRequests[m];if(!f)return;const C=f.xhr;if(C.readyState>=2&&f.onHeadersReceived&&(f.onHeadersReceived(),delete f.onHeadersReceived),C.readyState!==4||!(m in this.pendingRequests))return;if(delete this.pendingRequests[m],C.status===0&&this.isHttp){f.onError&&f.onError(C.status);return}const v=C.status||r;if(!(v===r&&f.expectedStatus===s)&&v!==f.expectedStatus){f.onError&&f.onError(C.status);return}const h=u(C);if(v===s){const o=C.getResponseHeader("Content-Range"),d=/bytes (\d+)-(\d+)\/(\d+)/.exec(o);f.onDone({begin:parseInt(d[1],10),chunk:h})}else h?f.onDone({begin:0,chunk:h}):f.onError&&f.onError(C.status)}getRequestXhr(m){return this.pendingRequests[m].xhr}isPendingRequest(m){return m in this.pendingRequests}abortRequest(m){const g=this.pendingRequests[m].xhr;delete this.pendingRequests[m],g.abort()}}class y{constructor(m){this._source=m,this._manager=new l(m.url,{httpHeaders:m.httpHeaders,withCredentials:m.withCredentials}),this._rangeChunkSize=m.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(m){const g=this._rangeRequestReaders.indexOf(m);g>=0&&this._rangeRequestReaders.splice(g,1)}getFullReader(){return(0,t.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new c(this._manager,this._source),this._fullRequestReader}getRangeReader(m,g){const f=new M(this._manager,m,g);return f.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(f),f}cancelAllRequests(m){this._fullRequestReader&&this._fullRequestReader.cancel(m),this._rangeRequestReaders.slice(0).forEach(function(f){f.cancel(m)})}}e.PDFNetworkStream=y;class c{constructor(m,g){this._manager=m;const f={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=g.url,this._fullRequestId=m.requestFull(f),this._headersReceivedCapability=(0,t.createPromiseCapability)(),this._disableRange=g.disableRange||!1,this._contentLength=g.length,this._rangeChunkSize=g.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 m=this._fullRequestId,g=this._manager.getRequestXhr(m),f=b=>g.getResponseHeader(b),{allowRangeRequests:C,suggestedLength:v}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:f,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});C&&(this._isRangeSupported=!0),this._contentLength=v||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(f),this._isRangeSupported&&this._manager.abortRequest(m),this._headersReceivedCapability.resolve()}_onDone(m){m&&(this._requests.length>0?this._requests.shift().resolve({value:m.chunk,done:!1}):this._cachedChunks.push(m.chunk)),this._done=!0,!(this._cachedChunks.length>0)&&(this._requests.forEach(function(g){g.resolve({value:void 0,done:!0})}),this._requests=[])}_onError(m){const g=this._url,f=(0,a.createResponseStatusError)(m,g);this._storedError=f,this._headersReceivedCapability.reject(f),this._requests.forEach(function(C){C.reject(f)}),this._requests=[],this._cachedChunks=[]}_onProgress(m){this.onProgress&&this.onProgress({loaded:m.loaded,total:m.lengthComputable?m.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 m=(0,t.createPromiseCapability)();return this._requests.push(m),m.promise}cancel(m){this._done=!0,this._headersReceivedCapability.reject(m),this._requests.forEach(function(g){g.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class M{constructor(m,g,f){this._manager=m;const C={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=m.requestRange(g,f,C),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}_close(){this.onClosed&&this.onClosed(this)}_onDone(m){const g=m.chunk;this._requests.length>0?this._requests.shift().resolve({value:g,done:!1}):this._queuedChunk=g,this._done=!0,this._requests.forEach(function(f){f.resolve({value:void 0,done:!0})}),this._requests=[],this._close()}_onProgress(m){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:m.loaded})}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk!==null){const g=this._queuedChunk;return this._queuedChunk=null,{value:g,done:!1}}if(this._done)return{value:void 0,done:!0};const m=(0,t.createPromiseCapability)();return this._requests.push(m),m.promise}cancel(m){this._done=!0,this._requests.forEach(function(g){g.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}},function(i,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.PDFFetchStream=void 0;var t=n(2),a=n(23);function r(c,M,I){return{method:"GET",headers:c,signal:I&&I.signal,mode:"cors",credentials:M?"include":"same-origin",redirect:"follow"}}function s(c){const M=new Headers;for(const I in c){const m=c[I];typeof m>"u"||M.append(I,m)}return M}class u{constructor(M){this.source=M,this.isHttp=/^https?:/i.test(M.url),this.httpHeaders=this.isHttp&&M.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,t.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new l(this),this._fullRequestReader}getRangeReader(M,I){if(I<=this._progressiveDataLength)return null;const m=new y(this,M,I);return this._rangeRequestReaders.push(m),m}cancelAllRequests(M){this._fullRequestReader&&this._fullRequestReader.cancel(M),this._rangeRequestReaders.slice(0).forEach(function(m){m.cancel(M)})}}e.PDFFetchStream=u;class l{constructor(M){this._stream=M,this._reader=null,this._loaded=0,this._filename=null;const I=M.source;this._withCredentials=I.withCredentials||!1,this._contentLength=I.length,this._headersCapability=(0,t.createPromiseCapability)(),this._disableRange=I.disableRange||!1,this._rangeChunkSize=I.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),typeof AbortController<"u"&&(this._abortController=new AbortController),this._isStreamingSupported=!I.disableStream,this._isRangeSupported=!I.disableRange,this._headers=s(this._stream.httpHeaders);const m=I.url;fetch(m,r(this._headers,this._withCredentials,this._abortController)).then(g=>{if(!(0,a.validateResponseStatus)(g.status))throw(0,a.createResponseStatusError)(g.status,m);this._reader=g.body.getReader(),this._headersCapability.resolve();const f=b=>g.headers.get(b),{allowRangeRequests:C,suggestedLength:v}=(0,a.validateRangeRequestCapabilities)({getResponseHeader:f,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=C,this._contentLength=v||this._contentLength,this._filename=(0,a.extractFilenameFromHeader)(f),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new t.AbortException("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(){await this._headersCapability.promise;const{value:M,done:I}=await this._reader.read();return I?{value:M,done:I}:(this._loaded+=M.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(M).buffer,done:!1})}cancel(M){this._reader&&this._reader.cancel(M),this._abortController&&this._abortController.abort()}}class y{constructor(M,I,m){this._stream=M,this._reader=null,this._loaded=0;const g=M.source;this._withCredentials=g.withCredentials||!1,this._readCapability=(0,t.createPromiseCapability)(),this._isStreamingSupported=!g.disableStream,typeof AbortController<"u"&&(this._abortController=new AbortController),this._headers=s(this._stream.httpHeaders),this._headers.append("Range",`bytes=${I}-${m-1}`);const f=g.url;fetch(f,r(this._headers,this._withCredentials,this._abortController)).then(C=>{if(!(0,a.validateResponseStatus)(C.status))throw(0,a.createResponseStatusError)(C.status,f);this._readCapability.resolve(),this._reader=C.body.getReader()}).catch(C=>{if(!(C&&C.name==="AbortError"))throw C}),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:M,done:I}=await this._reader.read();return I?{value:M,done:I}:(this._loaded+=M.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(M).buffer,done:!1})}cancel(M){this._reader&&this._reader.cancel(M),this._abortController&&this._abortController.abort()}}}])})})(pdf$1);var pdfExports=pdf$1.exports;const useSafeRef=()=>{const[i,e]=reactExports.useState(null);return{setRef:reactExports.useCallback(t=>{e(t)},[]),node:i}};var resizeObservers=[],hasActiveObservations=function(){return resizeObservers.some(function(i){return i.activeTargets.length>0})},hasSkippedObservations=function(){return resizeObservers.some(function(i){return i.skippedTargets.length>0})},msg="ResizeObserver loop completed with undelivered notifications.",deliverResizeLoopError=function(){var i;typeof ErrorEvent=="function"?i=new ErrorEvent("error",{message:msg}):(i=document.createEvent("Event"),i.initEvent("error",!1,!1),i.message=msg),window.dispatchEvent(i)},ResizeObserverBoxOptions;(function(i){i.BORDER_BOX="border-box",i.CONTENT_BOX="content-box",i.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(ResizeObserverBoxOptions||(ResizeObserverBoxOptions={}));var freeze=function(i){return Object.freeze(i)},ResizeObserverSize=function(){function i(e,n){this.inlineSize=e,this.blockSize=n,freeze(this)}return i}(),DOMRectReadOnly=function(){function i(e,n,t,a){return this.x=e,this.y=n,this.width=t,this.height=a,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,freeze(this)}return i.prototype.toJSON=function(){var e=this,n=e.x,t=e.y,a=e.top,r=e.right,s=e.bottom,u=e.left,l=e.width,y=e.height;return{x:n,y:t,top:a,right:r,bottom:s,left:u,width:l,height:y}},i.fromRect=function(e){return new i(e.x,e.y,e.width,e.height)},i}(),isSVG=function(i){return i instanceof SVGElement&&"getBBox"in i},isHidden=function(i){if(isSVG(i)){var e=i.getBBox(),n=e.width,t=e.height;return!n&&!t}var a=i,r=a.offsetWidth,s=a.offsetHeight;return!(r||s||i.getClientRects().length)},isElement=function(i){var e,n;if(i instanceof Element)return!0;var t=(n=(e=i)===null||e===void 0?void 0:e.ownerDocument)===null||n===void 0?void 0:n.defaultView;return!!(t&&i instanceof t.Element)},isReplacedElement=function(i){switch(i.tagName){case"INPUT":if(i.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},global=typeof window<"u"?window:{},cache=new WeakMap,scrollRegexp=/auto|scroll/,verticalRegexp=/^tb|vertical/,IE=/msie|trident/i.test(global.navigator&&global.navigator.userAgent),parseDimension=function(i){return parseFloat(i||"0")},size=function(i,e,n){return i===void 0&&(i=0),e===void 0&&(e=0),n===void 0&&(n=!1),new ResizeObserverSize((n?e:i)||0,(n?i:e)||0)},zeroBoxes=freeze({devicePixelContentBoxSize:size(),borderBoxSize:size(),contentBoxSize:size(),contentRect:new DOMRectReadOnly(0,0,0,0)}),calculateBoxSizes=function(i,e){if(e===void 0&&(e=!1),cache.has(i)&&!e)return cache.get(i);if(isHidden(i))return cache.set(i,zeroBoxes),zeroBoxes;var n=getComputedStyle(i),t=isSVG(i)&&i.ownerSVGElement&&i.getBBox(),a=!IE&&n.boxSizing==="border-box",r=verticalRegexp.test(n.writingMode||""),s=!t&&scrollRegexp.test(n.overflowY||""),u=!t&&scrollRegexp.test(n.overflowX||""),l=t?0:parseDimension(n.paddingTop),y=t?0:parseDimension(n.paddingRight),c=t?0:parseDimension(n.paddingBottom),M=t?0:parseDimension(n.paddingLeft),I=t?0:parseDimension(n.borderTopWidth),m=t?0:parseDimension(n.borderRightWidth),g=t?0:parseDimension(n.borderBottomWidth),f=t?0:parseDimension(n.borderLeftWidth),C=M+y,v=l+c,b=f+m,h=I+g,o=u?i.offsetHeight-h-i.clientHeight:0,d=s?i.offsetWidth-b-i.clientWidth:0,p=a?C+b:0,w=a?v+h:0,x=t?t.width:parseDimension(n.width)-p-d,D=t?t.height:parseDimension(n.height)-w-o,T=x+C+d+b,P=D+v+o+h,E=freeze({devicePixelContentBoxSize:size(Math.round(x*devicePixelRatio),Math.round(D*devicePixelRatio),r),borderBoxSize:size(T,P,r),contentBoxSize:size(x,D,r),contentRect:new DOMRectReadOnly(M,l,x,D)});return cache.set(i,E),E},calculateBoxSize=function(i,e,n){var t=calculateBoxSizes(i,n),a=t.borderBoxSize,r=t.contentBoxSize,s=t.devicePixelContentBoxSize;switch(e){case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:return s;case ResizeObserverBoxOptions.BORDER_BOX:return a;default:return r}},ResizeObserverEntry=function(){function i(e){var n=calculateBoxSizes(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=freeze([n.borderBoxSize]),this.contentBoxSize=freeze([n.contentBoxSize]),this.devicePixelContentBoxSize=freeze([n.devicePixelContentBoxSize])}return i}(),calculateDepthForNode=function(i){if(isHidden(i))return 1/0;for(var e=0,n=i.parentNode;n;)e+=1,n=n.parentNode;return e},broadcastActiveObservations=function(){var i=1/0,e=[];resizeObservers.forEach(function(s){if(s.activeTargets.length!==0){var u=[];s.activeTargets.forEach(function(y){var c=new ResizeObserverEntry(y.target),M=calculateDepthForNode(y.target);u.push(c),y.lastReportedSize=calculateBoxSize(y.target,y.observedBox),Mi?n.activeTargets.push(a):n.skippedTargets.push(a))})})},process=function(){var i=0;for(gatherActiveObservationsAtDepth(i);hasActiveObservations();)i=broadcastActiveObservations(),gatherActiveObservationsAtDepth(i);return hasSkippedObservations()&&deliverResizeLoopError(),i>0},trigger,callbacks=[],notify=function(){return callbacks.splice(0).forEach(function(i){return i()})},queueMicroTask=function(i){if(!trigger){var e=0,n=document.createTextNode(""),t={characterData:!0};new MutationObserver(function(){return notify()}).observe(n,t),trigger=function(){n.textContent=""+(e?e--:e++)}}callbacks.push(i),trigger()},queueResizeObserver=function(i){queueMicroTask(function(){requestAnimationFrame(i)})},watching=0,isWatching=function(){return!!watching},CATCH_PERIOD=250,observerConfig={attributes:!0,characterData:!0,childList:!0,subtree:!0},events=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],time=function(i){return i===void 0&&(i=0),Date.now()+i},scheduled=!1,Scheduler=function(){function i(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return i.prototype.run=function(e){var n=this;if(e===void 0&&(e=CATCH_PERIOD),!scheduled){scheduled=!0;var t=time(e);queueResizeObserver(function(){var a=!1;try{a=process()}finally{if(scheduled=!1,e=t-time(),!isWatching())return;a?n.run(1e3):e>0?n.run(e):n.start()}})}},i.prototype.schedule=function(){this.stop(),this.run()},i.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,observerConfig)};document.body?n():global.addEventListener("DOMContentLoaded",n)},i.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),events.forEach(function(n){return global.addEventListener(n,e.listener,!0)}))},i.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),events.forEach(function(n){return global.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},i}(),scheduler=new Scheduler,updateCount=function(i){!watching&&i>0&&scheduler.start(),watching+=i,!watching&&scheduler.stop()},skipNotifyOnElement=function(i){return!isSVG(i)&&!isReplacedElement(i)&&getComputedStyle(i).display==="inline"},ResizeObservation=function(){function i(e,n){this.target=e,this.observedBox=n||ResizeObserverBoxOptions.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return i.prototype.isActive=function(){var e=calculateBoxSize(this.target,this.observedBox,!0);return skipNotifyOnElement(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},i}(),ResizeObserverDetail=function(){function i(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return i}(),observerMap=new WeakMap,getObservationIndex=function(i,e){for(var n=0;n=0&&(r&&resizeObservers.splice(resizeObservers.indexOf(t),1),t.observationTargets.splice(a,1),updateCount(-1))},i.disconnect=function(e){var n=this,t=observerMap.get(e);t.observationTargets.slice().forEach(function(a){return n.unobserve(e,a.target)}),t.activeTargets.splice(0,t.activeTargets.length)},i}(),ResizeObserver$1=function(){function i(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ResizeObserverController.connect(this,e)}return i.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!isElement(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ResizeObserverController.observe(this,e,n)},i.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!isElement(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ResizeObserverController.unobserve(this,e)},i.prototype.disconnect=function(){ResizeObserverController.disconnect(this)},i.toString=function(){return"function ResizeObserver () { [polyfill code] }"},i}();const usePassiveLayoutEffect=React[typeof document<"u"&&document.createElement!==void 0?"useLayoutEffect":"useEffect"],useLatest=i=>{const e=reactExports.useRef(i);return reactExports.useEffect(()=>{e.current=i}),e},ResizeObserver=typeof window<"u"&&"ResizeObserver"in window?window.ResizeObserver:ResizeObserver$1;function _ref(){}function useResizeObserver(i,e){const n=getResizeObserver(),t=useLatest(e);return usePassiveLayoutEffect(()=>{let a=!1;const r=i&&"current"in i?i.current:i;if(!r)return _ref;function s(u,l){a||t.current(u,l)}return n.subscribe(r,s),()=>{a=!0,n.unsubscribe(r,s)}},[i,n,t]),n.observer}function createResizeObserver(){let i=!1,e=[];const n=new Map,t=new ResizeObserver((a,r)=>{e=e.concat(a);function s(){const u=new Set;for(let l=0;lc(e[l],r))}e=[],i=!1}i||window.requestAnimationFrame(s),i=!0});return{observer:t,subscribe(a,r){var s;t.observe(a);const u=(s=n.get(a))!==null&&s!==void 0?s:[];u.push(r),n.set(a,u)},unsubscribe(a,r){var s;const u=(s=n.get(a))!==null&&s!==void 0?s:[];if(u.length===1){t.unobserve(a),n.delete(a);return}const l=u.indexOf(r);l!==-1&&u.splice(l,1),n.set(a,u)}}}let _resizeObserver;const getResizeObserver=()=>_resizeObserver||(_resizeObserver=createResizeObserver()),useSize=i=>{const[e,n]=reactExports.useState(getCurrentSize(i));return reactExports.useLayoutEffect(()=>{n(getCurrentSize(i))},[i]),useResizeObserver(i,()=>{n(getCurrentSize(i))}),e};function getCurrentSize(i){const e=i==null?void 0:i.getBoundingClientRect();return{width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0}}function useAsyncFunctionCall(i){const[e,n]=reactExports.useState();return reactExports.useEffect(()=>{let t=!1;const a=new AbortController;return i(a.signal).then(r=>{t=!0,!a.signal.aborted&&r!==void 0&&n(r)}).catch(r=>{if(t=!0,!a.signal.aborted)throw r}),()=>{t||a.abort()}},[i]),e}const setPdfJsGlobalWorkerOptions=i=>{for(const[e,n]of Object.entries(i))pdfExports.GlobalWorkerOptions[e]=n};var ui_utils={};Object.defineProperty(ui_utils,"__esModule",{value:!0});ui_utils.isValidRotation=isValidRotation;ui_utils.isValidScrollMode=isValidScrollMode;ui_utils.isValidSpreadMode=isValidSpreadMode;ui_utils.isPortraitOrientation=isPortraitOrientation;ui_utils.clamp=clamp;ui_utils.getPDFFileNameFromURL=getPDFFileNameFromURL;ui_utils.noContextMenuHandler=noContextMenuHandler;ui_utils.parseQueryString=parseQueryString;ui_utils.backtrackBeforeAllVisibleElements=backtrackBeforeAllVisibleElements;ui_utils.getVisibleElements=getVisibleElements;ui_utils.roundToDivide=roundToDivide;ui_utils.getPageSizeInches=getPageSizeInches;ui_utils.approximateFraction=approximateFraction;ui_utils.getOutputScale=getOutputScale;ui_utils.scrollIntoView=scrollIntoView;ui_utils.watchScroll=watchScroll;ui_utils.binarySearchFirstItem=binarySearchFirstItem;ui_utils.normalizeWheelEventDirection=normalizeWheelEventDirection;ui_utils.normalizeWheelEventDelta=normalizeWheelEventDelta;ui_utils.waitOnEventOrTimeout=waitOnEventOrTimeout;ui_utils.moveToEndOfArray=moveToEndOfArray;ui_utils.WaitOnType=ui_utils.animationStarted=ui_utils.ProgressBar=EventBus_1=ui_utils.EventBus=ui_utils.NullL10n=ui_utils.SpreadMode=ui_utils.ScrollMode=ui_utils.TextLayerMode=ui_utils.RendererType=ui_utils.PresentationModeState=ui_utils.VERTICAL_PADDING=ui_utils.SCROLLBAR_PADDING=ui_utils.MAX_AUTO_SCALE=ui_utils.UNKNOWN_SCALE=ui_utils.MAX_SCALE=ui_utils.MIN_SCALE=ui_utils.DEFAULT_SCALE=ui_utils.DEFAULT_SCALE_VALUE=ui_utils.CSS_UNITS=ui_utils.AutoPrintRegExp=void 0;const CSS_UNITS=96/72;ui_utils.CSS_UNITS=CSS_UNITS;const DEFAULT_SCALE_VALUE="auto";ui_utils.DEFAULT_SCALE_VALUE=DEFAULT_SCALE_VALUE;const DEFAULT_SCALE=1;ui_utils.DEFAULT_SCALE=DEFAULT_SCALE;const MIN_SCALE=.1;ui_utils.MIN_SCALE=MIN_SCALE;const MAX_SCALE=10;ui_utils.MAX_SCALE=MAX_SCALE;const UNKNOWN_SCALE=0;ui_utils.UNKNOWN_SCALE=UNKNOWN_SCALE;const MAX_AUTO_SCALE=1.25;ui_utils.MAX_AUTO_SCALE=MAX_AUTO_SCALE;const SCROLLBAR_PADDING=40;ui_utils.SCROLLBAR_PADDING=SCROLLBAR_PADDING;const VERTICAL_PADDING=5;ui_utils.VERTICAL_PADDING=VERTICAL_PADDING;const PresentationModeState={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};ui_utils.PresentationModeState=PresentationModeState;const RendererType={CANVAS:"canvas",SVG:"svg"};ui_utils.RendererType=RendererType;const TextLayerMode={DISABLE:0,ENABLE:1,ENABLE_ENHANCE:2};ui_utils.TextLayerMode=TextLayerMode;const ScrollMode={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2};ui_utils.ScrollMode=ScrollMode;const SpreadMode={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};ui_utils.SpreadMode=SpreadMode;const AutoPrintRegExp=/\bprint\s*\(/;ui_utils.AutoPrintRegExp=AutoPrintRegExp;function formatL10nValue(i,e){return e?i.replace(/\{\{\s*(\w+)\s*\}\}/g,(n,t)=>t in e?e[t]:"{{"+t+"}}"):i}const NullL10n={async getLanguage(){return"en-us"},async getDirection(){return"ltr"},async get(i,e,n){return formatL10nValue(n,e)},async translate(i){}};ui_utils.NullL10n=NullL10n;function getOutputScale(i){const e=window.devicePixelRatio||1,n=i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1,t=e/n;return{sx:t,sy:t,scaled:t!==1}}function scrollIntoView(i,e,n=!1){let t=i.offsetParent;if(!t){console.error("offsetParent is not set -- cannot scroll");return}let a=i.offsetTop+i.clientTop,r=i.offsetLeft+i.clientLeft;for(;t.clientHeight===t.scrollHeight&&t.clientWidth===t.scrollWidth||n&&getComputedStyle(t).overflow==="hidden";)if(t.dataset._scaleY&&(a/=t.dataset._scaleY,r/=t.dataset._scaleX),a+=t.offsetTop,r+=t.offsetLeft,t=t.offsetParent,!t)return;e&&(e.top!==void 0&&(a+=e.top),e.left!==void 0&&(r+=e.left,t.scrollLeft=r)),t.scrollTop=a}function watchScroll(i,e){const n=function(r){a||(a=window.requestAnimationFrame(function(){a=null;const u=i.scrollLeft,l=t.lastX;u!==l&&(t.right=u>l),t.lastX=u;const y=i.scrollTop,c=t.lastY;y!==c&&(t.down=y>c),t.lastY=y,e(t)}))},t={right:!0,down:!0,lastX:i.scrollLeft,lastY:i.scrollTop,_eventHandler:n};let a=null;return i.addEventListener("scroll",n,!0),t}function parseQueryString(i){const e=i.split("&"),n=Object.create(null);for(let t=0,a=e.length;t1?r[1]:null;n[decodeURIComponent(s)]=decodeURIComponent(u)}return n}function binarySearchFirstItem(i,e){let n=0,t=i.length-1;if(t<0||!e(i[t]))return i.length;if(e(i[n]))return n;for(;n>1,r=i[a];e(r)?t=a:n=a+1}return n}function approximateFraction(i){if(Math.floor(i)===i)return[i,1];const e=1/i,n=8;if(e>n)return[1,n];if(Math.floor(e)===e)return[1,e];const t=i>1?e:i;let a=0,r=1,s=1,u=1;for(;;){const y=a+s,c=r+u;if(c>n)break;t<=y/c?(s=y,u=c):(a=y,r=c)}let l;return t-a/r=n&&(t=e[i-1].div,a=t.offsetTop+t.clientTop);for(let r=i-2;r>=0&&(t=e[r].div,!(t.offsetTop+t.clientTop+t.clientHeight<=a));--r)i=r;return i}function getVisibleElements(i,e,n=!1,t=!1){const a=i.scrollTop,r=a+i.clientHeight,s=i.scrollLeft,u=s+i.clientWidth;function l(C){const v=C.div;return v.offsetTop+v.clientTop+v.clientHeight>a}function y(C){const v=C.div;return v.offsetLeft+v.clientLeft+v.clientWidth>s}const c=[],M=e.length;let I=M===0?0:binarySearchFirstItem(e,t?y:l);I>0&&I=r&&(m=x);else if((t?h:o)>m)break;if(x<=a||o>=r||w<=s||h>=u)continue;const D=Math.max(0,a-o)+Math.max(0,x-r),T=Math.max(0,s-h)+Math.max(0,w-u),P=(p-D)*(d-T)*100/p/d|0;c.push({id:v.id,x:h,y:o,view:v,percent:P})}const g=c[0],f=c[c.length-1];return n&&c.sort(function(C,v){const b=C.percent-v.percent;return Math.abs(b)>.001?-b:C.id-v.id}),{first:g,last:f,views:c}}function noContextMenuHandler(i){i.preventDefault()}function isDataSchema(i){let e=0;const n=i.length;for(;e=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");function r(y){i instanceof EventBus?i._off(e,s):i.removeEventListener(e,s),l&&clearTimeout(l),t(y)}const s=r.bind(null,WaitOnType.EVENT);i instanceof EventBus?i._on(e,s):i.addEventListener(e,s);const u=r.bind(null,WaitOnType.TIMEOUT),l=setTimeout(u,n)})}const animationStarted=new Promise(function(i){window.requestAnimationFrame(i)});ui_utils.animationStarted=animationStarted;class EventBus{constructor(e){this._listeners=Object.create(null)}on(e,n){this._on(e,n,{external:!0})}off(e,n){this._off(e,n,{external:!0})}dispatch(e){const n=this._listeners[e];if(!n||n.length===0)return;const t=Array.prototype.slice.call(arguments,1);let a;n.slice(0).forEach(function({listener:r,external:s}){if(s){a||(a=[]),a.push(r);return}r.apply(null,t)}),a&&(a.forEach(function(r){r.apply(null,t)}),a=null)}_on(e,n,t=null){let a=this._listeners[e];a||(this._listeners[e]=a=[]),a.push({listener:n,external:(t&&t.external)===!0})}_off(e,n,t=null){const a=this._listeners[e];if(a){for(let r=0,s=a.length;r0&&(this.bar.style.width=`calc(100% - ${t}px)`)}hide(){this.visible&&(this.visible=!1,this.bar.classList.add("hidden"),document.body.classList.remove("loadingInProgress"))}show(){this.visible||(this.visible=!0,document.body.classList.add("loadingInProgress"),this.bar.classList.remove("hidden"))}}ui_utils.ProgressBar=ProgressBar;function moveToEndOfArray(i,e){const n=[],t=i.length;let a=0;for(let r=0;r=VerbosityLevel.INFOS&&console.log(`Info: ${i}`)}function warn(i){verbosity>=VerbosityLevel.WARNINGS&&console.log(`Warning: ${i}`)}function unreachable(i){throw new Error(i)}function assert(i,e){i||unreachable(e)}function isSameOrigin(i,e){let n;try{if(n=new URL(i),!n.origin||n.origin==="null")return!1}catch{return!1}const t=new URL(e,n);return n.origin===t.origin}function _isValidProtocol(i){if(!i)return!1;switch(i.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function createValidAbsoluteUrl(i,e){if(!i)return null;try{const n=e?new URL(i,e):new URL(i);if(_isValidProtocol(n))return n}catch{}return null}function shadow(i,e,n){return Object.defineProperty(i,e,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}const BaseException=function i(){function e(n){this.constructor===e&&unreachable("Cannot initialize BaseException."),this.message=n,this.name=this.constructor.name}return e.prototype=new Error,e.constructor=e,e}();util.BaseException=BaseException;class PasswordException extends BaseException{constructor(e,n){super(e),this.code=n}}util.PasswordException=PasswordException;class UnknownErrorException extends BaseException{constructor(e,n){super(e),this.details=n}}util.UnknownErrorException=UnknownErrorException;class InvalidPDFException extends BaseException{}util.InvalidPDFException=InvalidPDFException;class MissingPDFException extends BaseException{}util.MissingPDFException=MissingPDFException;class UnexpectedResponseException extends BaseException{constructor(e,n){super(e),this.status=n}}util.UnexpectedResponseException=UnexpectedResponseException;class FormatError extends BaseException{}util.FormatError=FormatError;class AbortException extends BaseException{}util.AbortException=AbortException;const NullCharactersRegExp=/\x00/g;function removeNullCharacters(i){return typeof i!="string"?(warn("The argument for removeNullCharacters must be a string."),i):i.replace(NullCharactersRegExp,"")}function bytesToString(i){assert(i!==null&&typeof i=="object"&&i.length!==void 0,"Invalid argument for bytesToString");const e=i.length,n=8192;if(e>24&255,i>>16&255,i>>8&255,i&255)}function isLittleEndian(){const i=new Uint8Array(4);return i[0]=1,new Uint32Array(i.buffer,0,1)[0]===1}const IsLittleEndianCached={get value(){return shadow(this,"value",isLittleEndian())}};util.IsLittleEndianCached=IsLittleEndianCached;function isEvalSupported(){try{return new Function(""),!0}catch{return!1}}const IsEvalSupportedCached={get value(){return shadow(this,"value",isEvalSupported())}};util.IsEvalSupportedCached=IsEvalSupportedCached;const rgbBuf=["rgb(",0,",",0,",",0,")"];class Util{static makeCssRgb(e,n,t){return rgbBuf[1]=e,rgbBuf[3]=n,rgbBuf[5]=t,rgbBuf.join("")}static transform(e,n){return[e[0]*n[0]+e[2]*n[1],e[1]*n[0]+e[3]*n[1],e[0]*n[2]+e[2]*n[3],e[1]*n[2]+e[3]*n[3],e[0]*n[4]+e[2]*n[5]+e[4],e[1]*n[4]+e[3]*n[5]+e[5]]}static applyTransform(e,n){const t=e[0]*n[0]+e[1]*n[2]+n[4],a=e[0]*n[1]+e[1]*n[3]+n[5];return[t,a]}static applyInverseTransform(e,n){const t=n[0]*n[3]-n[1]*n[2],a=(e[0]*n[3]-e[1]*n[2]+n[2]*n[5]-n[4]*n[3])/t,r=(-e[0]*n[1]+e[1]*n[0]+n[4]*n[1]-n[5]*n[0])/t;return[a,r]}static getAxialAlignedBoundingBox(e,n){const t=Util.applyTransform(e,n),a=Util.applyTransform(e.slice(2,4),n),r=Util.applyTransform([e[0],e[3]],n),s=Util.applyTransform([e[2],e[1]],n);return[Math.min(t[0],a[0],r[0],s[0]),Math.min(t[1],a[1],r[1],s[1]),Math.max(t[0],a[0],r[0],s[0]),Math.max(t[1],a[1],r[1],s[1])]}static inverseTransform(e){const n=e[0]*e[3]-e[1]*e[2];return[e[3]/n,-e[1]/n,-e[2]/n,e[0]/n,(e[2]*e[5]-e[4]*e[3])/n,(e[4]*e[1]-e[5]*e[0])/n]}static apply3dTransform(e,n){return[e[0]*n[0]+e[1]*n[1]+e[2]*n[2],e[3]*n[0]+e[4]*n[1]+e[5]*n[2],e[6]*n[0]+e[7]*n[1]+e[8]*n[2]]}static singularValueDecompose2dScale(e){const n=[e[0],e[2],e[1],e[3]],t=e[0]*n[0]+e[1]*n[2],a=e[0]*n[1]+e[1]*n[3],r=e[2]*n[0]+e[3]*n[2],s=e[2]*n[1]+e[3]*n[3],u=(t+s)/2,l=Math.sqrt((t+s)*(t+s)-4*(t*s-r*a))/2,y=u+l||1,c=u-l||1;return[Math.sqrt(y),Math.sqrt(c)]}static normalizeRect(e){const n=e.slice(0);return e[0]>e[2]&&(n[0]=e[2],n[2]=e[0]),e[1]>e[3]&&(n[1]=e[3],n[3]=e[1]),n}static intersect(e,n){function t(u,l){return u-l}const a=[e[0],e[2],n[0],n[2]].sort(t),r=[e[1],e[3],n[1],n[3]].sort(t),s=[];if(e=Util.normalizeRect(e),n=Util.normalizeRect(n),a[0]===e[0]&&a[1]===n[0]||a[0]===n[0]&&a[1]===e[0])s[0]=a[1],s[2]=a[2];else return null;if(r[0]===e[1]&&r[1]===n[1]||r[0]===n[1]&&r[1]===e[1])s[1]=r[1],s[3]=r[2];else return null;return s}}util.Util=Util;const PDFStringTranslateTable=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToPDFString(i){const e=i.length,n=[];if(i[0]==="þ"&&i[1]==="ÿ")for(let t=2;t>2,m=(y&3)<<4|c>>4,g=u+1>6:64,f=u+2{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${n}`)})}_fetchData(e,n){(0,_util$d.unreachable)("Abstract method `_fetchData` called.")}}display_utils.BaseCMapReaderFactory=BaseCMapReaderFactory;class DOMCMapReaderFactory extends BaseCMapReaderFactory{_fetchData(e,n){return isFetchSupported()&&isValidFetchUrl(e,document.baseURI)?fetch(e).then(async t=>{if(!t.ok)throw new Error(t.statusText);let a;return this.isCompressed?a=new Uint8Array(await t.arrayBuffer()):a=(0,_util$d.stringToBytes)(await t.text()),{cMapData:a,compressionType:n}}):new Promise((t,a)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),this.isCompressed&&(r.responseType="arraybuffer"),r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(r.status===200||r.status===0){let s;if(this.isCompressed&&r.response?s=new Uint8Array(r.response):!this.isCompressed&&r.responseText&&(s=(0,_util$d.stringToBytes)(r.responseText)),s){t({cMapData:s,compressionType:n});return}}a(new Error(r.statusText))}},r.send(null)})}}display_utils.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMSVGFactory{create(e,n){(0,_util$d.assert)(e>0&&n>0,"Invalid SVG dimensions");const t=document.createElementNS(SVG_NS,"svg:svg");return t.setAttribute("version","1.1"),t.setAttribute("width",e+"px"),t.setAttribute("height",n+"px"),t.setAttribute("preserveAspectRatio","none"),t.setAttribute("viewBox","0 0 "+e+" "+n),t}createElement(e){return(0,_util$d.assert)(typeof e=="string","Invalid SVG element type"),document.createElementNS(SVG_NS,e)}}display_utils.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor({viewBox:e,scale:n,rotation:t,offsetX:a=0,offsetY:r=0,dontFlip:s=!1}){this.viewBox=e,this.scale=n,this.rotation=t,this.offsetX=a,this.offsetY=r;const u=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let y,c,M,I;switch(t=t%360,t=t<0?t+360:t,t){case 180:y=-1,c=0,M=0,I=1;break;case 90:y=0,c=1,M=1,I=0;break;case 270:y=0,c=-1,M=-1,I=0;break;case 0:y=1,c=0,M=0,I=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}s&&(M=-M,I=-I);let m,g,f,C;y===0?(m=Math.abs(l-e[1])*n+a,g=Math.abs(u-e[0])*n+r,f=Math.abs(e[3]-e[1])*n,C=Math.abs(e[2]-e[0])*n):(m=Math.abs(u-e[0])*n+a,g=Math.abs(l-e[1])*n+r,f=Math.abs(e[2]-e[0])*n,C=Math.abs(e[3]-e[1])*n),this.transform=[y*n,c*n,M*n,I*n,m-y*n*u-M*n*l,g-c*n*u-I*n*l],this.width=f,this.height=C}clone({scale:e=this.scale,rotation:n=this.rotation,offsetX:t=this.offsetX,offsetY:a=this.offsetY,dontFlip:r=!1}={}){return new PageViewport({viewBox:this.viewBox.slice(),scale:e,rotation:n,offsetX:t,offsetY:a,dontFlip:r})}convertToViewportPoint(e,n){return _util$d.Util.applyTransform([e,n],this.transform)}convertToViewportRectangle(e){const n=_util$d.Util.applyTransform([e[0],e[1]],this.transform),t=_util$d.Util.applyTransform([e[2],e[3]],this.transform);return[n[0],n[1],t[0],t[1]]}convertToPdfPoint(e,n){return _util$d.Util.applyInverseTransform([e,n],this.transform)}}display_utils.PageViewport=PageViewport;class RenderingCancelledException extends _util$d.BaseException{constructor(e,n){super(e),this.type=n}}display_utils.RenderingCancelledException=RenderingCancelledException;const LinkTarget={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};display_utils.LinkTarget=LinkTarget;function addLinkAttributes(i,{url:e,target:n,rel:t,enabled:a=!0}={}){(0,_util$d.assert)(e&&typeof e=="string",'addLinkAttributes: A valid "url" parameter must provided.');const r=(0,_util$d.removeNullCharacters)(e);a?i.href=i.title=r:(i.href="",i.title=`Disabled: ${r}`,i.onclick=()=>!1);let s="";switch(n){case LinkTarget.NONE:break;case LinkTarget.SELF:s="_self";break;case LinkTarget.BLANK:s="_blank";break;case LinkTarget.PARENT:s="_parent";break;case LinkTarget.TOP:s="_top";break}i.target=s,i.rel=typeof t=="string"?t:DEFAULT_LINK_REL}function getFilenameFromUrl(i){const e=i.indexOf("#"),n=i.indexOf("?"),t=Math.min(e>0?e:i.length,n>0?n:i.length);return i.substring(i.lastIndexOf("/",t)+1,t)}class StatTimer{constructor(){this.started=Object.create(null),this.times=[]}time(e){e in this.started&&(0,_util$d.warn)(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||(0,_util$d.warn)(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let n=0;for(const t of this.times){const a=t.name;a.length>n&&(n=a.length)}for(const t of this.times){const a=t.end-t.start;e.push(`${t.name.padEnd(n)} ${a}ms `)}return e.join("")}}display_utils.StatTimer=StatTimer;function isFetchSupported(){return typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype&&typeof ReadableStream<"u"}function isValidFetchUrl(i,e){try{const{protocol:n}=e?new URL(i,e):new URL(i);return n==="http:"||n==="https:"}catch{return!1}}function loadScript(i){return new Promise((e,n)=>{const t=document.createElement("script");t.src=i,t.onload=e,t.onerror=function(){n(new Error(`Cannot load script at: ${t.src}`))},(document.head||document.documentElement).appendChild(t)})}function deprecated(i){console.log("Deprecated API usage: "+i)}let pdfDateStringRegex;class PDFDateString{static toDateObject(e){if(!e||!(0,_util$d.isString)(e))return null;pdfDateStringRegex||(pdfDateStringRegex=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const n=pdfDateStringRegex.exec(e);if(!n)return null;const t=parseInt(n[1],10);let a=parseInt(n[2],10);a=a>=1&&a<=12?a-1:0;let r=parseInt(n[3],10);r=r>=1&&r<=31?r:1;let s=parseInt(n[4],10);s=s>=0&&s<=23?s:0;let u=parseInt(n[5],10);u=u>=0&&u<=59?u:0;let l=parseInt(n[6],10);l=l>=0&&l<=59?l:0;const y=n[7]||"Z";let c=parseInt(n[8],10);c=c>=0&&c<=23?c:0;let M=parseInt(n[9],10)||0;return M=M>=0&&M<=59?M:0,y==="-"?(s+=c,u+=M):y==="+"&&(s-=c,u-=M),new Date(Date.UTC(t,a,r,s,u,l))}}display_utils.PDFDateString=PDFDateString;var api={},font_loader={};Object.defineProperty(font_loader,"__esModule",{value:!0});font_loader.FontLoader=font_loader.FontFaceObject=void 0;var _util$c=util;class BaseFontLoader{constructor({docId:e,onUnsupportedFeature:n,ownerDocument:t=globalThis.document}){this.constructor===BaseFontLoader&&(0,_util$c.unreachable)("Cannot initialize BaseFontLoader."),this.docId=e,this._onUnsupportedFeature=n,this._document=t,this.nativeFontFaces=[],this.styleElement=null}addNativeFontFace(e){this.nativeFontFaces.push(e),this._document.fonts.add(e)}insertRule(e){let n=this.styleElement;n||(n=this.styleElement=this._document.createElement("style"),n.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`,this._document.documentElement.getElementsByTagName("head")[0].appendChild(n));const t=n.sheet;t.insertRule(e,t.cssRules.length)}clear(){this.nativeFontFaces.forEach(e=>{this._document.fonts.delete(e)}),this.nativeFontFaces.length=0,this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async bind(e){if(e.attached||e.missingFile)return;if(e.attached=!0,this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(a){throw this._onUnsupportedFeature({featureId:_util$c.UNSUPPORTED_FEATURES.errorFontLoadNative}),(0,_util$c.warn)(`Failed to load font '${t.family}': '${a}'.`),e.disableFontFace=!0,a}}return}const n=e.createFontFaceRule();if(n){if(this.insertRule(n),this.isSyncFontLoadingSupported)return;await new Promise(t=>{const a=this._queueLoadingCallback(t);this._prepareFontLoadEvent([n],[e],a)})}}_queueLoadingCallback(e){(0,_util$c.unreachable)("Abstract method `_queueLoadingCallback`.")}get isFontLoadingAPISupported(){const e=typeof this._document<"u"&&!!this._document.fonts;return(0,_util$c.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){(0,_util$c.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}get _loadTestFont(){(0,_util$c.unreachable)("Abstract method `_loadTestFont`.")}_prepareFontLoadEvent(e,n,t){(0,_util$c.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}let FontLoader;font_loader.FontLoader=FontLoader;font_loader.FontLoader=FontLoader=class extends BaseFontLoader{constructor(e){super(e),this.loadingContext={requests:[],nextRequestId:0},this.loadTestFontId=0}get isSyncFontLoadingSupported(){let e=!1;if(typeof navigator>"u")e=!0;else{const n=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);n&&n[1]>=14&&(e=!0)}return(0,_util$c.shadow)(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function n(){for((0,_util$c.assert)(!a.done,"completeRequest() cannot be called twice."),a.done=!0;t.requests.length>0&&t.requests[0].done;){const r=t.requests.shift();setTimeout(r.callback,0)}}const t=this.loadingContext,a={id:`pdfjs-font-loading-${t.nextRequestId++}`,done:!1,complete:n,callback:e};return t.requests.push(a),a}get _loadTestFont(){const e=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,_util$c.shadow)(this,"_loadTestFont",e())}_prepareFontLoadEvent(e,n,t){function a(p,w){return p.charCodeAt(w)<<24|p.charCodeAt(w+1)<<16|p.charCodeAt(w+2)<<8|p.charCodeAt(w+3)&255}function r(p,w,x,D){const T=p.substring(0,w),P=p.substring(w+x);return T+D+P}let s,u;const l=this._document.createElement("canvas");l.width=1,l.height=1;const y=l.getContext("2d");let c=0;function M(p,w){if(c++,c>30){(0,_util$c.warn)("Load test font never loaded."),w();return}if(y.font="30px "+p,y.fillText(".",0,20),y.getImageData(0,0,1,1).data[3]>0){w();return}setTimeout(M.bind(null,p,w))}const I=`lt${Date.now()}${this.loadTestFontId++}`;let m=this._loadTestFont;m=r(m,976,I.length,I);const f=16,C=1482184792;let v=a(m,f);for(s=0,u=I.length-3;s{this._document.body.removeChild(d),t.complete()})}};class FontFaceObject{constructor(e,{isEvalSupported:n=!0,disableFontFace:t=!1,ignoreErrors:a=!1,onUnsupportedFeature:r=null,fontRegistry:s=null}){this.compiledGlyphs=Object.create(null);for(const u in e)this[u]=e[u];this.isEvalSupported=n!==!1,this.disableFontFace=t===!0,this.ignoreErrors=a===!0,this._onUnsupportedFeature=r,this.fontRegistry=s}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;const e=new FontFace(this.loadedName,this.data,{});return this.fontRegistry&&this.fontRegistry.registerFont(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=(0,_util$c.bytesToString)(new Uint8Array(this.data)),n=`url(data:${this.mimetype};base64,${btoa(e)});`,t=`@font-face {font-family:"${this.loadedName}";src:${n}}`;return this.fontRegistry&&this.fontRegistry.registerFont(this,n),t}getPathGenerator(e,n){if(this.compiledGlyphs[n]!==void 0)return this.compiledGlyphs[n];let t,a;try{t=e.get(this.loadedName+"_path_"+n)}catch(r){if(!this.ignoreErrors)throw r;return this._onUnsupportedFeature&&this._onUnsupportedFeature({featureId:_util$c.UNSUPPORTED_FEATURES.errorFontGetPath}),(0,_util$c.warn)(`getPathGenerator - ignoring character: "${r}".`),this.compiledGlyphs[n]=function(s,u){}}if(this.isEvalSupported&&_util$c.IsEvalSupportedCached.value){let r,s="";for(let u=0,l=t.length;u{require$$2.readFile(i,(r,s)=>{if(r||!s){t(new Error(r));return}n({cMapData:new Uint8Array(s),compressionType:e})})})}});var annotation_storage={};Object.defineProperty(annotation_storage,"__esModule",{value:!0});annotation_storage.AnnotationStorage=void 0;class AnnotationStorage{constructor(){this._storage=new Map,this._modified=!1,this.onSetModified=null,this.onResetModified=null}getOrCreateValue(e,n){return this._storage.has(e)?this._storage.get(e):(this._storage.set(e,n),n)}setValue(e,n){this._storage.get(e)!==n&&this._setModified(),this._storage.set(e,n)}getAll(){return this._storage.size===0?null:Object.fromEntries(this._storage)}get size(){return this._storage.size}_setModified(){this._modified||(this._modified=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this._modified&&(this._modified=!1,typeof this.onResetModified=="function"&&this.onResetModified())}}annotation_storage.AnnotationStorage=AnnotationStorage;var api_compatibility={};Object.defineProperty(api_compatibility,"__esModule",{value:!0});api_compatibility.apiCompatibilityParams=void 0;var _is_node$2=is_node;const compatibilityParams=Object.create(null);(function(){_is_node$2.isNodeJS&&(compatibilityParams.disableFontFace=!0)})();const apiCompatibilityParams=Object.freeze(compatibilityParams);api_compatibility.apiCompatibilityParams=apiCompatibilityParams;var canvas={},pattern_helper={};Object.defineProperty(pattern_helper,"__esModule",{value:!0});pattern_helper.getShadingPatternFromIR=getShadingPatternFromIR;pattern_helper.TilingPattern=void 0;var _util$a=util,ShadingIRs={};function applyBoundingBox(i,e){if(!e||typeof Path2D>"u")return;const n=e[2]-e[0],t=e[3]-e[1],a=new Path2D;a.rect(e[0],e[1],n,t),i.clip(a)}ShadingIRs.RadialAxial={fromIR:function i(e){var n=e[1],t=e[2],a=e[3],r=e[4],s=e[5],u=e[6],l=e[7];return{type:"Pattern",getPattern:function(c){applyBoundingBox(c,t);var M;n==="axial"?M=c.createLinearGradient(r[0],r[1],s[0],s[1]):n==="radial"&&(M=c.createRadialGradient(r[0],r[1],u,s[0],s[1],l));for(var I=0,m=a.length;II[u+1]&&(C=s,s=u,u=C,C=y,y=c,c=C),I[u+1]>I[l+1]&&(C=u,u=l,l=C,C=c,c=M,M=C),I[s+1]>I[u+1]&&(C=s,s=u,u=C,C=y,y=c,c=C);var v=(I[s]+r.offsetX)*r.scaleX,b=(I[s+1]+r.offsetY)*r.scaleY,h=(I[u]+r.offsetX)*r.scaleX,o=(I[u+1]+r.offsetY)*r.scaleY,d=(I[l]+r.offsetX)*r.scaleX,p=(I[l+1]+r.offsetY)*r.scaleY;if(!(b>=p))for(var w=m[y],x=m[y+1],D=m[y+2],T=m[c],P=m[c+1],E=m[c+2],B=m[M],L=m[M+1],O=m[M+2],k=Math.round(b),j=Math.round(p),A,S,R,N,U,F,G,z,W=k;W<=j;W++){if(Wp?X=1:o===p?X=0:X=(o-W)/(o-p),A=h-(h-d)*X,S=T-(T-B)*X,R=P-(P-L)*X,N=E-(E-O)*X}let J;Wp?J=1:J=(b-W)/(b-p),U=v-(v-d)*J,F=w-(w-B)*J,G=x-(x-L)*J,z=D-(D-O)*J;for(var V=Math.round(Math.min(A,U)),K=Math.round(Math.max(A,U)),Y=f*W+V*4,H=V;H<=K;H++)J=(A-H)/(A-U),J<0?J=0:J>1&&(J=1),g[Y++]=S-(S-F)*J|0,g[Y++]=R-(R-G)*J|0,g[Y++]=N-(N-z)*J|0,g[Y++]=255}}function n(a,r,s){var u=r.coords,l=r.colors,y,c;switch(r.type){case"lattice":var M=r.verticesPerRow,I=Math.floor(u.length/M)-1,m=M-1;for(y=0;y=l?y=l:u=y/r,{scale:u,size:y}},clipBbox:function(r,s,u,l,y,c){if(Array.isArray(s)&&s.length===4){var M=y-u,I=c-l;r.ctx.rect(u,l,M,I),r.clip(),r.endPath()}},setFillAndStrokeStyleToContext:function(r,s,u){const l=r.ctx,y=r.current;switch(s){case e.COLORED:var c=this.ctx;l.fillStyle=c.fillStyle,l.strokeStyle=c.strokeStyle,y.fillColor=c.fillStyle,y.strokeColor=c.strokeStyle;break;case e.UNCOLORED:var M=_util$a.Util.makeCssRgb(u[0],u[1],u[2]);l.fillStyle=M,l.strokeStyle=M,y.fillColor=M,y.strokeColor=M;break;default:throw new _util$a.FormatError(`Unsupported paint type: ${s}`)}},getPattern:function(r,s){r=this.ctx,r.setTransform.apply(r,this.baseTransform),r.transform.apply(r,this.matrix);var u=this.createPatternCanvas(s);return r.createPattern(u,"repeat")}},t}();pattern_helper.TilingPattern=TilingPattern;Object.defineProperty(canvas,"__esModule",{value:!0});canvas.CanvasGraphics=void 0;var _util$9=util,_pattern_helper=pattern_helper,MIN_FONT_SIZE=16,MAX_FONT_SIZE=100,MAX_GROUP_SIZE=4096,MIN_WIDTH_FACTOR=.65,MAX_SIZE_TO_COMPILE=1e3,FULL_CHUNK_HEIGHT=16;function addContextCurrentTransform(i){i.mozCurrentTransform||(i._originalSave=i.save,i._originalRestore=i.restore,i._originalRotate=i.rotate,i._originalScale=i.scale,i._originalTranslate=i.translate,i._originalTransform=i.transform,i._originalSetTransform=i.setTransform,i._transformMatrix=i._transformMatrix||[1,0,0,1,0,0],i._transformStack=[],Object.defineProperty(i,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(i,"mozCurrentTransformInverse",{get:function(){var n=this._transformMatrix,t=n[0],a=n[1],r=n[2],s=n[3],u=n[4],l=n[5],y=t*s-a*r,c=a*r-t*s;return[s/y,a/c,r/c,t/y,(s*u-r*l)/c,(a*u-t*l)/y]}}),i.save=function(){var n=this._transformMatrix;this._transformStack.push(n),this._transformMatrix=n.slice(0,6),this._originalSave()},i.restore=function(){var n=this._transformStack.pop();n&&(this._transformMatrix=n,this._originalRestore())},i.translate=function(n,t){var a=this._transformMatrix;a[4]=a[0]*n+a[2]*t+a[4],a[5]=a[1]*n+a[3]*t+a[5],this._originalTranslate(n,t)},i.scale=function(n,t){var a=this._transformMatrix;a[0]=a[0]*n,a[1]=a[1]*n,a[2]=a[2]*t,a[3]=a[3]*t,this._originalScale(n,t)},i.transform=function(n,t,a,r,s,u){var l=this._transformMatrix;this._transformMatrix=[l[0]*n+l[2]*t,l[1]*n+l[3]*t,l[0]*a+l[2]*r,l[1]*a+l[3]*r,l[0]*s+l[2]*u+l[4],l[1]*s+l[3]*u+l[5]],i._originalTransform(n,t,a,r,s,u)},i.setTransform=function(n,t,a,r,s,u){this._transformMatrix=[n,t,a,r,s,u],i._originalSetTransform(n,t,a,r,s,u)},i.rotate=function(n){var t=Math.cos(n),a=Math.sin(n),r=this._transformMatrix;this._transformMatrix=[r[0]*t+r[2]*a,r[1]*t+r[3]*a,r[0]*-a+r[2]*t,r[1]*-a+r[3]*t,r[4],r[5]],this._originalRotate(n)})}var CachedCanvases=function i(){function e(n){this.canvasFactory=n,this.cache=Object.create(null)}return e.prototype={getCanvas:function(t,a,r,s){var u;return this.cache[t]!==void 0?(u=this.cache[t],this.canvasFactory.reset(u,a,r),u.context.setTransform(1,0,0,1,0,0)):(u=this.canvasFactory.create(a,r),this.cache[t]=u),s&&addContextCurrentTransform(u.context),u},clear(){for(var n in this.cache){var t=this.cache[n];this.canvasFactory.destroy(t),delete this.cache[n]}}},e}();function compileType3Glyph(i){var e=1e3,n=i.width,t=i.height,a,r,s,u=n+1,l=new Uint8Array(u*(t+1)),y=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),c=n+7&-8,M=i.data,I=new Uint8Array(c*t),m=0,g;for(a=0,g=M.length;a0;)I[m++]=C&f?0:255,f>>=1;var v=0;for(m=0,I[m]!==0&&(l[0]=1,++v),r=1;r>2)+(I[m+1]?4:0)+(I[m-c+1]?8:0),y[b]&&(l[s+r]=y[b],++v),m++;if(I[m-c]!==I[m]&&(l[s+r]=I[m]?2:4,++v),v>e)return null}for(m=c*(t-1),s=a*u,I[m]!==0&&(l[s]=8,++v),r=1;re)return null;var h=new Int32Array([0,u,-1,0,-u,0,0,0,1]),o=[];for(a=0;v&&a<=t;a++){for(var d=a*u,p=d+n;d>4,l[d]&=x>>2|x<<2),w.push(d%u),w.push(d/u|0),l[d]||--v}while(D!==d);o.push(w),--a}}var E=function(B){B.save(),B.scale(1/n,-1/t),B.translate(0,-t),B.beginPath();for(let O=0,k=o.length;O>2),z=G.length,W=p+7>>3,V=4294967295,K=_util$9.IsLittleEndianCached.value?4278190080:255;for(U&&U[0]===255&&U[255]===0&&([V,K]=[K,V]),O=0;OW?p:Y*8-7,J=H&-8,X=0,$=0;ee>=1}for(;E=x&&(j=w,A=p*j),E=0,k=A;k--;)L[E++]=B[P++],L[E++]=B[P++],L[E++]=B[P++],L[E++]=255;if(ee)for(let _=0;_>=1}b.putImageData(D,0,B*FULL_CHUNK_HEIGHT)}}function s(b,h){for(var o=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],d=0,p=o.length;d>8,b[w-2]=b[w-2]*x+o*D>>8,b[w-1]=b[w-1]*x+d*D>>8}}}function y(b,h,o){for(var d=b.length,p=1/255,w=3;w>8]>>8:h[p]*w>>16}}function M(b,h,o,d,p,w,x){var D=!!w,T=D?w[0]:0,P=D?w[1]:0,E=D?w[2]:0,B;p==="Luminosity"?B=c:B=y;for(var L=1048576,O=Math.min(d,Math.ceil(L/o)),k=0;kn&&typeof d=="function",E=P?Date.now()+e:0,B=0,L=this.commonObjs,O=this.objs,k;;){if(p!==void 0&&D===p.nextBreakPoint)return p.breakIt(D,d),D;if(k=x[D],k!==_util$9.OPS.dependency)this[k].apply(this,w[D]);else for(const j of w[D]){const A=j.startsWith("g_")?L:O;if(!A.has(j))return A.get(j,d),D}if(D++,D===T)return D;if(P&&++B>n){if(Date.now()>E)return d(),D;B=0}}},endDrawing:function(){this.current.activeSMask!==null&&this.endSMaskGroup(),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),this.cachedCanvases.clear(),this.webGLContext.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(h){this.current.lineWidth=h,this.ctx.lineWidth=h},setLineCap:function(h){this.ctx.lineCap=m[h]},setLineJoin:function(h){this.ctx.lineJoin=g[h]},setMiterLimit:function(h){this.ctx.miterLimit=h},setDash:function(h,o){var d=this.ctx;d.setLineDash!==void 0&&(d.setLineDash(h),d.lineDashOffset=o)},setRenderingIntent(b){},setFlatness(b){},setGState:function(h){for(var o=0,d=h.length;o0&&this.stateStack[this.stateStack.length-1].activeSMask===this.current.activeSMask?this.suspendSMaskGroup():this.endSMaskGroup()),this.current.activeSMask=x?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null;break;case"TR":this.current.transferMaps=x}}},beginSMaskGroup:function(){var h=this.current.activeSMask,o=h.canvas.width,d=h.canvas.height,p="smaskGroupAt"+this.groupLevel,w=this.cachedCanvases.getCanvas(p,o,d,!0),x=this.ctx,D=x.mozCurrentTransform;this.ctx.save();var T=w.context;T.scale(1/h.scaleX,1/h.scaleY),T.translate(-h.offsetX,-h.offsetY),T.transform.apply(T,D),h.startTransformInverse=T.mozCurrentTransformInverse,s(x,T),this.ctx=T,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(x),this.groupLevel++},suspendSMaskGroup:function(){var h=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),I(this.ctx,this.current.activeSMask,h,this.webGLContext),this.ctx.restore(),this.ctx.save(),s(h,this.ctx),this.current.resumeSMaskCtx=h;var o=_util$9.Util.transform(this.current.activeSMask.startTransformInverse,h.mozCurrentTransform);this.ctx.transform.apply(this.ctx,o),h.save(),h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,h.canvas.width,h.canvas.height),h.restore()},resumeSMaskGroup:function(){var h=this.current.resumeSMaskCtx,o=this.ctx;this.ctx=h,this.groupStack.push(o),this.groupLevel++},endSMaskGroup:function(){var h=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),I(this.ctx,this.current.activeSMask,h,this.webGLContext),this.ctx.restore(),s(h,this.ctx);var o=_util$9.Util.transform(this.current.activeSMask.startTransformInverse,h.mozCurrentTransform);this.ctx.transform.apply(this.ctx,o)},save:function(){this.ctx.save();var h=this.current;this.stateStack.push(h),this.current=h.clone(),this.current.resumeSMaskCtx=null},restore:function(){this.current.resumeSMaskCtx&&this.resumeSMaskGroup(),this.current.activeSMask!==null&&(this.stateStack.length===0||this.stateStack[this.stateStack.length-1].activeSMask!==this.current.activeSMask)&&this.endSMaskGroup(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.ctx.restore(),this.pendingClip=null,this._cachedGetSinglePixelWidth=null)},transform:function(h,o,d,p,w,x){this.ctx.transform(h,o,d,p,w,x),this._cachedGetSinglePixelWidth=null},constructPath:function(h,o){for(var d=this.ctx,p=this.current,w=p.x,x=p.y,D=0,T=0,P=h.length;DMAX_FONT_SIZE&&(P=MAX_FONT_SIZE),this.current.fontSizeScale=o/P,this.ctx.font=`${D} ${x} ${P}px ${T}`},setTextRenderingMode:function(h){this.current.textRenderingMode=h},setTextRise:function(h){this.current.textRise=h},moveText:function(h,o){this.current.x=this.current.lineX+=h,this.current.y=this.current.lineY+=o},setLeadingMoveText:function(h,o){this.setLeading(-o),this.moveText(h,o)},setTextMatrix:function(h,o,d,p,w,x){this.current.textMatrix=[h,o,d,p,w,x],this.current.textMatrixScale=Math.sqrt(h*h+o*o),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar(b,h,o,d){var p=this.ctx,w=this.current,x=w.font,D=w.textRenderingMode,T=w.fontSize/w.fontSizeScale,P=D&_util$9.TextRenderingMode.FILL_STROKE_MASK,E=!!(D&_util$9.TextRenderingMode.ADD_TO_PATH_FLAG);const B=w.patternFill&&!x.missingFile;var L;if((x.disableFontFace||E||B)&&(L=x.getPathGenerator(this.commonObjs,b)),x.disableFontFace||B?(p.save(),p.translate(h,o),p.beginPath(),L(p,T),d&&p.setTransform.apply(p,d),(P===_util$9.TextRenderingMode.FILL||P===_util$9.TextRenderingMode.FILL_STROKE)&&p.fill(),(P===_util$9.TextRenderingMode.STROKE||P===_util$9.TextRenderingMode.FILL_STROKE)&&p.stroke(),p.restore()):((P===_util$9.TextRenderingMode.FILL||P===_util$9.TextRenderingMode.FILL_STROKE)&&p.fillText(b,h,o),(P===_util$9.TextRenderingMode.STROKE||P===_util$9.TextRenderingMode.FILL_STROKE)&&p.strokeText(b,h,o)),E){var O=this.pendingTextPaths||(this.pendingTextPaths=[]);O.push({transform:p.mozCurrentTransform,x:h,y:o,fontSize:T,addToPath:L})}},get isFontSubpixelAAEnabled(){const{context:b}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);b.scale(1.5,1),b.fillText("I",0,10);for(var h=b.getImageData(0,0,10,10).data,o=!1,d=3;d0&&h[d]<255){o=!0;break}return(0,_util$9.shadow)(this,"isFontSubpixelAAEnabled",o)},showText:function(h){var o=this.current,d=o.font;if(d.isType3Font)return this.showType3Text(h);var p=o.fontSize;if(p===0)return;var w=this.ctx,x=o.fontSizeScale,D=o.charSpacing,T=o.wordSpacing,P=o.fontDirection,E=o.textHScale*P,B=h.length,L=d.vertical,O=L?1:-1,k=d.defaultVMetrics,j=p*o.fontMatrix[0],A=o.textRenderingMode===_util$9.TextRenderingMode.FILL&&!d.disableFontFace&&!o.patternFill;w.save();let S;if(o.patternFill){w.save();const de=o.fillColor.getPattern(w,this);S=w.mozCurrentTransform,w.restore(),w.fillStyle=de}w.transform.apply(w,o.textMatrix),w.translate(o.x,o.y+o.textRise),P>0?w.scale(E,-1):w.scale(E,1);var R=o.lineWidth,N=o.textMatrixScale;if(N===0||R===0){var U=o.textRenderingMode&_util$9.TextRenderingMode.FILL_STROKE_MASK;(U===_util$9.TextRenderingMode.STROKE||U===_util$9.TextRenderingMode.FILL_STROKE)&&(this._cachedGetSinglePixelWidth=null,R=this.getSinglePixelWidth()*MIN_WIDTH_FACTOR)}else R/=N;x!==1&&(w.scale(x,x),R/=x),w.lineWidth=R;var F=0,G;for(G=0;G0){var le=w.measureText(K).width*1e3/p*x;if(eenew t(x,this.commonObjs,this.objs,this.canvasFactory,this.webGLContext)};o=new _pattern_helper.TilingPattern(h,d,this.ctx,w,p)}else o=(0,_pattern_helper.getShadingPatternFromIR)(h);return o},setStrokeColorN:function(){this.current.strokeColor=this.getColorN_Pattern(arguments)},setFillColorN:function(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0},setStrokeRGBColor:function(h,o,d){var p=_util$9.Util.makeCssRgb(h,o,d);this.ctx.strokeStyle=p,this.current.strokeColor=p},setFillRGBColor:function(h,o,d){var p=_util$9.Util.makeCssRgb(h,o,d);this.ctx.fillStyle=p,this.current.fillColor=p,this.current.patternFill=!1},shadingFill:function(h){if(this.contentVisible){var o=this.ctx;this.save();var d=(0,_pattern_helper.getShadingPatternFromIR)(h);o.fillStyle=d.getPattern(o,this,!0);var p=o.mozCurrentTransformInverse;if(p){var w=o.canvas,x=w.width,D=w.height,T=_util$9.Util.applyTransform([0,0],p),P=_util$9.Util.applyTransform([0,D],p),E=_util$9.Util.applyTransform([x,0],p),B=_util$9.Util.applyTransform([x,D],p),L=Math.min(T[0],P[0],E[0],B[0]),O=Math.min(T[1],P[1],E[1],B[1]),k=Math.max(T[0],P[0],E[0],B[0]),j=Math.max(T[1],P[1],E[1],B[1]);this.ctx.fillRect(L,O,k-L,j-O)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()}},beginInlineImage:function(){(0,_util$9.unreachable)("Should not call beginInlineImage")},beginImageData:function(){(0,_util$9.unreachable)("Should not call beginImageData")},paintFormXObjectBegin:function(h,o){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),Array.isArray(h)&&h.length===6&&this.transform.apply(this,h),this.baseTransform=this.ctx.mozCurrentTransform,o)){var d=o[2]-o[0],p=o[3]-o[1];this.ctx.rect(o[0],o[1],d,p),this.clip(),this.endPath()}},paintFormXObjectEnd:function(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())},beginGroup:function(h){if(this.contentVisible){this.save();var o=this.ctx;h.isolated||(0,_util$9.info)("TODO: Support non-isolated groups."),h.knockout&&(0,_util$9.warn)("Knockout groups not supported.");var d=o.mozCurrentTransform;if(h.matrix&&o.transform.apply(o,h.matrix),!h.bbox)throw new Error("Bounding box is required.");var p=_util$9.Util.getAxialAlignedBoundingBox(h.bbox,o.mozCurrentTransform),w=[0,0,o.canvas.width,o.canvas.height];p=_util$9.Util.intersect(p,w)||[0,0,0,0];var x=Math.floor(p[0]),D=Math.floor(p[1]),T=Math.max(Math.ceil(p[2])-x,1),P=Math.max(Math.ceil(p[3])-D,1),E=1,B=1;T>MAX_GROUP_SIZE&&(E=T/MAX_GROUP_SIZE,T=MAX_GROUP_SIZE),P>MAX_GROUP_SIZE&&(B=P/MAX_GROUP_SIZE,P=MAX_GROUP_SIZE);var L="groupAt"+this.groupLevel;h.smask&&(L+="_smask_"+this.smaskCounter++%2);var O=this.cachedCanvases.getCanvas(L,T,P,!0),k=O.context;k.scale(1/E,1/B),k.translate(-x,-D),k.transform.apply(k,d),h.smask?this.smaskStack.push({canvas:O.canvas,context:k,offsetX:x,offsetY:D,scaleX:E,scaleY:B,subtype:h.smask.subtype,backdrop:h.smask.backdrop,transferMap:h.smask.transferMap||null,startTransformInverse:null}):(o.setTransform(1,0,0,1,0,0),o.translate(x,D),o.scale(E,B)),s(o,k),this.ctx=k,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(o),this.groupLevel++,this.current.activeSMask=null}},endGroup:function(h){if(this.contentVisible){this.groupLevel--;var o=this.ctx;this.ctx=this.groupStack.pop(),this.ctx.imageSmoothingEnabled!==void 0?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,h.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(o.canvas,0,0),this.restore()}},beginAnnotations:function(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(h,o,d){if(this.save(),u(this.ctx),this.current=new CanvasExtraState,Array.isArray(h)&&h.length===4){var p=h[2]-h[0],w=h[3]-h[1];this.ctx.rect(h[0],h[1],p,w),this.clip(),this.endPath()}this.transform.apply(this,o),this.transform.apply(this,d)},endAnnotation:function(){this.restore()},paintImageMaskXObject:function(h){if(this.contentVisible){var o=this.ctx,d=h.width,p=h.height,w=this.current.fillColor,x=this.current.patternFill,D=this.processingType3;if(D&&D.compiled===void 0&&(d<=MAX_SIZE_TO_COMPILE&&p<=MAX_SIZE_TO_COMPILE?D.compiled=compileType3Glyph({data:h.data,width:d,height:p}):D.compiled=null),D&&D.compiled){D.compiled(o);return}var T=this.cachedCanvases.getCanvas("maskCanvas",d,p),P=T.context;P.save(),r(P,h),P.globalCompositeOperation="source-in",P.fillStyle=x?w.getPattern(P,this):w,P.fillRect(0,0,d,p),P.restore(),this.paintInlineImageXObject(T.canvas)}},paintImageMaskXObjectRepeat(b,h,o=0,d=0,p,w){if(this.contentVisible){var x=b.width,D=b.height,T=this.current.fillColor,P=this.current.patternFill,E=this.cachedCanvases.getCanvas("maskCanvas",x,D),B=E.context;B.save(),r(B,b),B.globalCompositeOperation="source-in",B.fillStyle=P?T.getPattern(B,this):T,B.fillRect(0,0,x,D),B.restore();for(var L=this.ctx,O=0,k=w.length;O2&&j>1||B>2&&A>1;){var R=j,N=A;T>2&&j>1&&(R=Math.ceil(j/2),T/=j/R),B>2&&A>1&&(N=Math.ceil(A/2),B/=A/N),O=this.cachedCanvases.getCanvas(S,R,N),k=O.context,k.clearRect(0,0,R,N),k.drawImage(L,0,0,j,A,0,0,R,N),L=O.canvas,j=R,A=N,S=S==="prescale1"?"prescale2":"prescale1"}if(p.drawImage(L,0,0,j,A,0,-d,o,d),this.imageLayer){var U=this.getCanvasPosition(0,-d);this.imageLayer.appendImage({imgData:h,left:U[0],top:U[1],width:o/w[0],height:d/w[3]})}this.restore()}},paintInlineImageXObjectGroup:function(h,o){if(this.contentVisible){var d=this.ctx,p=h.width,w=h.height,x=this.cachedCanvases.getCanvas("inlineImage",p,w),D=x.context;a(D,h,this.current.transferMaps);for(var T=0,P=o.length;T=0;h--)if(!this.markedContentStack[h].visible)return!1;return!0}};for(var v in _util$9.OPS)t.prototype[_util$9.OPS[v]]=t.prototype[v];return t}();canvas.CanvasGraphics=CanvasGraphics;var worker_options={};Object.defineProperty(worker_options,"__esModule",{value:!0});worker_options.GlobalWorkerOptions=void 0;const GlobalWorkerOptions=Object.create(null);worker_options.GlobalWorkerOptions=GlobalWorkerOptions;GlobalWorkerOptions.workerPort=GlobalWorkerOptions.workerPort===void 0?null:GlobalWorkerOptions.workerPort;GlobalWorkerOptions.workerSrc=GlobalWorkerOptions.workerSrc===void 0?"":GlobalWorkerOptions.workerSrc;var message_handler={};Object.defineProperty(message_handler,"__esModule",{value:!0});message_handler.MessageHandler=void 0;var _util$8=util;const CallbackKind={UNKNOWN:0,DATA:1,ERROR:2},StreamKind={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function wrapReason(i){if(typeof i!="object"||i===null)return i;switch(i.name){case"AbortException":return new _util$8.AbortException(i.message);case"MissingPDFException":return new _util$8.MissingPDFException(i.message);case"UnexpectedResponseException":return new _util$8.UnexpectedResponseException(i.message,i.status);case"UnknownErrorException":return new _util$8.UnknownErrorException(i.message,i.details);default:return new _util$8.UnknownErrorException(i.message,i.toString())}}class MessageHandler{constructor(e,n,t){this.sourceName=e,this.targetName=n,this.comObj=t,this.callbackId=1,this.streamId=1,this.postMessageTransfers=!0,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=a=>{const r=a.data;if(r.targetName!==this.sourceName)return;if(r.stream){this._processStreamMessage(r);return}if(r.callback){const u=r.callbackId,l=this.callbackCapabilities[u];if(!l)throw new Error(`Cannot resolve callback ${u}`);if(delete this.callbackCapabilities[u],r.callback===CallbackKind.DATA)l.resolve(r.data);else if(r.callback===CallbackKind.ERROR)l.reject(wrapReason(r.reason));else throw new Error("Unexpected callback case");return}const s=this.actionHandler[r.action];if(!s)throw new Error(`Unknown action from worker: ${r.action}`);if(r.callbackId){const u=this.sourceName,l=r.sourceName;new Promise(function(y){y(s(r.data))}).then(function(y){t.postMessage({sourceName:u,targetName:l,callback:CallbackKind.DATA,callbackId:r.callbackId,data:y})},function(y){t.postMessage({sourceName:u,targetName:l,callback:CallbackKind.ERROR,callbackId:r.callbackId,reason:wrapReason(y)})});return}if(r.streamId){this._createStreamSink(r);return}s(r.data)},t.addEventListener("message",this._onComObjOnMessage)}on(e,n){const t=this.actionHandler;if(t[e])throw new Error(`There is already an actionName called "${e}"`);t[e]=n}send(e,n,t){this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:n},t)}sendWithPromise(e,n,t){const a=this.callbackId++,r=(0,_util$8.createPromiseCapability)();this.callbackCapabilities[a]=r;try{this._postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:a,data:n},t)}catch(s){r.reject(s)}return r.promise}sendWithStream(e,n,t,a){const r=this.streamId++,s=this.sourceName,u=this.targetName,l=this.comObj;return new ReadableStream({start:y=>{const c=(0,_util$8.createPromiseCapability)();return this.streamControllers[r]={controller:y,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},this._postMessage({sourceName:s,targetName:u,action:e,streamId:r,data:n,desiredSize:y.desiredSize},a),c.promise},pull:y=>{const c=(0,_util$8.createPromiseCapability)();return this.streamControllers[r].pullCall=c,l.postMessage({sourceName:s,targetName:u,stream:StreamKind.PULL,streamId:r,desiredSize:y.desiredSize}),c.promise},cancel:y=>{(0,_util$8.assert)(y instanceof Error,"cancel must have a valid reason");const c=(0,_util$8.createPromiseCapability)();return this.streamControllers[r].cancelCall=c,this.streamControllers[r].isClosed=!0,l.postMessage({sourceName:s,targetName:u,stream:StreamKind.CANCEL,streamId:r,reason:wrapReason(y)}),c.promise}},t)}_createStreamSink(e){const n=this,t=this.actionHandler[e.action],a=e.streamId,r=this.sourceName,s=e.sourceName,u=this.comObj,l={enqueue(y,c=1,M){if(this.isCancelled)return;const I=this.desiredSize;this.desiredSize-=c,I>0&&this.desiredSize<=0&&(this.sinkCapability=(0,_util$8.createPromiseCapability)(),this.ready=this.sinkCapability.promise),n._postMessage({sourceName:r,targetName:s,stream:StreamKind.ENQUEUE,streamId:a,chunk:y},M)},close(){this.isCancelled||(this.isCancelled=!0,u.postMessage({sourceName:r,targetName:s,stream:StreamKind.CLOSE,streamId:a}),delete n.streamSinks[a])},error(y){(0,_util$8.assert)(y instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,u.postMessage({sourceName:r,targetName:s,stream:StreamKind.ERROR,streamId:a,reason:wrapReason(y)}))},sinkCapability:(0,_util$8.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[a]=l,new Promise(function(y){y(t(e.data,l))}).then(function(){u.postMessage({sourceName:r,targetName:s,stream:StreamKind.START_COMPLETE,streamId:a,success:!0})},function(y){u.postMessage({sourceName:r,targetName:s,stream:StreamKind.START_COMPLETE,streamId:a,reason:wrapReason(y)})})}_processStreamMessage(e){const n=e.streamId,t=this.sourceName,a=e.sourceName,r=this.comObj;switch(e.stream){case StreamKind.START_COMPLETE:e.success?this.streamControllers[n].startCall.resolve():this.streamControllers[n].startCall.reject(wrapReason(e.reason));break;case StreamKind.PULL_COMPLETE:e.success?this.streamControllers[n].pullCall.resolve():this.streamControllers[n].pullCall.reject(wrapReason(e.reason));break;case StreamKind.PULL:if(!this.streamSinks[n]){r.postMessage({sourceName:t,targetName:a,stream:StreamKind.PULL_COMPLETE,streamId:n,success:!0});break}this.streamSinks[n].desiredSize<=0&&e.desiredSize>0&&this.streamSinks[n].sinkCapability.resolve(),this.streamSinks[n].desiredSize=e.desiredSize;const{onPull:s}=this.streamSinks[e.streamId];new Promise(function(l){l(s&&s())}).then(function(){r.postMessage({sourceName:t,targetName:a,stream:StreamKind.PULL_COMPLETE,streamId:n,success:!0})},function(l){r.postMessage({sourceName:t,targetName:a,stream:StreamKind.PULL_COMPLETE,streamId:n,reason:wrapReason(l)})});break;case StreamKind.ENQUEUE:if((0,_util$8.assert)(this.streamControllers[n],"enqueue should have stream controller"),this.streamControllers[n].isClosed)break;this.streamControllers[n].controller.enqueue(e.chunk);break;case StreamKind.CLOSE:if((0,_util$8.assert)(this.streamControllers[n],"close should have stream controller"),this.streamControllers[n].isClosed)break;this.streamControllers[n].isClosed=!0,this.streamControllers[n].controller.close(),this._deleteStreamController(n);break;case StreamKind.ERROR:(0,_util$8.assert)(this.streamControllers[n],"error should have stream controller"),this.streamControllers[n].controller.error(wrapReason(e.reason)),this._deleteStreamController(n);break;case StreamKind.CANCEL_COMPLETE:e.success?this.streamControllers[n].cancelCall.resolve():this.streamControllers[n].cancelCall.reject(wrapReason(e.reason)),this._deleteStreamController(n);break;case StreamKind.CANCEL:if(!this.streamSinks[n])break;const{onCancel:u}=this.streamSinks[e.streamId];new Promise(function(l){l(u&&u(wrapReason(e.reason)))}).then(function(){r.postMessage({sourceName:t,targetName:a,stream:StreamKind.CANCEL_COMPLETE,streamId:n,success:!0})},function(l){r.postMessage({sourceName:t,targetName:a,stream:StreamKind.CANCEL_COMPLETE,streamId:n,reason:wrapReason(l)})}),this.streamSinks[n].sinkCapability.reject(wrapReason(e.reason)),this.streamSinks[n].isCancelled=!0,delete this.streamSinks[n];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e){await Promise.allSettled([this.streamControllers[e].startCall,this.streamControllers[e].pullCall,this.streamControllers[e].cancelCall].map(function(n){return n&&n.promise})),delete this.streamControllers[e]}_postMessage(e,n){n&&this.postMessageTransfers?this.comObj.postMessage(e,n):this.comObj.postMessage(e)}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}message_handler.MessageHandler=MessageHandler;var metadata$2={},xml_parser={};Object.defineProperty(xml_parser,"__esModule",{value:!0});xml_parser.SimpleXMLParser=void 0;const XMLParserErrorCode={NoError:0,EndOfDocument:-1,UnterminatedCdat:-2,UnterminatedXmlDeclaration:-3,UnterminatedDoctypeDeclaration:-4,UnterminatedComment:-5,MalformedElement:-6,OutOfMemory:-7,UnterminatedAttributeValue:-8,UnterminatedElement:-9,ElementNeverBegun:-10};function isWhitespace(i,e){const n=i[e];return n===" "||n===` `||n==="\r"||n===" "}function isWhitespaceString(i){for(let e=0,n=i.length;e{if(t.substring(0,2)==="#x")return String.fromCharCode(parseInt(t.substring(2),16));if(t.substring(0,1)==="#")return String.fromCharCode(parseInt(t.substring(1),10));switch(t){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"'}return this.onResolveEntity(t)})}_parseContent(e,n){const t=[];let a=n;function r(){for(;a"&&e[a]!=="/";)++a;const s=e.substring(n,a);for(r();a"&&e[a]!=="/"&&e[a]!=="?";){r();let u="",l="";for(;a"&&e[t]!=="/";)++t;const r=e.substring(n,t);a();const s=t;for(;t");)++t;const u=e.substring(s,t);return{name:r,value:u,parsed:t-n}}parseXml(e){let n=0;for(;n",a),s<0){this.onError(XMLParserErrorCode.UnterminatedElement);return}this.onEndElement(e.substring(a,s)),a=s+1;break;case"?":++a;const u=this._parseProcessingInstruction(e,a);if(e.substring(a+u.parsed,a+u.parsed+2)!=="?>"){this.onError(XMLParserErrorCode.UnterminatedXmlDeclaration);return}this.onPi(u.name,u.value),a+=u.parsed+2;break;case"!":if(e.substring(a+1,a+3)==="--"){if(s=e.indexOf("-->",a+3),s<0){this.onError(XMLParserErrorCode.UnterminatedComment);return}this.onComment(e.substring(a+3,s)),a=s+3}else if(e.substring(a+1,a+8)==="[CDATA["){if(s=e.indexOf("]]>",a+8),s<0){this.onError(XMLParserErrorCode.UnterminatedCdat);return}this.onCdata(e.substring(a+8,s)),a=s+3}else if(e.substring(a+1,a+8)==="DOCTYPE"){const c=e.indexOf("[",a+8);let M=!1;if(s=e.indexOf(">",a+8),s<0){this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration);return}if(c>0&&s>c){if(s=e.indexOf("]>",a+8),s<0){this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration);return}M=!0}const I=e.substring(a+8,s+(M?1:0));this.onDoctype(I),a=s+(M?2:1)}else{this.onError(XMLParserErrorCode.MalformedElement);return}break;default:const l=this._parseContent(e,a);if(l===null){this.onError(XMLParserErrorCode.MalformedElement);return}let y=!1;if(e.substring(a+l.parsed,a+l.parsed+2)==="/>")y=!0;else if(e.substring(a+l.parsed,a+l.parsed+1)!==">"){this.onError(XMLParserErrorCode.UnterminatedElement);return}this.onBeginElement(l.name,l.attributes,y),a+=l.parsed+(y?2:1);break}}else{for(;a0}}class SimpleXMLParser extends XMLParserBase{constructor(){super(),this._currentFragment=null,this._stack=null,this._errorCode=XMLParserErrorCode.NoError}parseFromString(e){if(this._currentFragment=[],this._stack=[],this._errorCode=XMLParserErrorCode.NoError,this.parseXml(e),this._errorCode!==XMLParserErrorCode.NoError)return;const[n]=this._currentFragment;if(n)return{documentElement:n}}onResolveEntity(e){switch(e){case"apos":return"'"}return super.onResolveEntity(e)}onText(e){if(isWhitespaceString(e))return;const n=new SimpleDOMNode("#text",e);this._currentFragment.push(n)}onCdata(e){const n=new SimpleDOMNode("#text",e);this._currentFragment.push(n)}onBeginElement(e,n,t){const a=new SimpleDOMNode(e);a.childNodes=[],this._currentFragment.push(a),!t&&(this._stack.push(this._currentFragment),this._currentFragment=a.childNodes)}onEndElement(e){this._currentFragment=this._stack.pop()||[];const n=this._currentFragment[this._currentFragment.length-1];if(n)for(let t=0,a=n.childNodes.length;t\\376\\377([^<]+)/g,function(n,t){const a=t.replace(/\\([0-3])([0-7])([0-7])/g,function(s,u,l,y){return String.fromCharCode(u*64+l*8+y*1)}).replace(/&(amp|apos|gt|lt|quot);/g,function(s,u){switch(u){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${u} isn't defined.`)});let r="";for(let s=0,u=a.length;s=32&&l<127&&l!==60&&l!==62&&l!==38?r+=String.fromCharCode(l):r+="&#x"+(65536+l).toString(16).substring(1)+";"}return">"+r})}_parse(e){let n=e.documentElement;if(n.nodeName.toLowerCase()!=="rdf:rdf")for(n=n.firstChild;n&&n.nodeName.toLowerCase()!=="rdf:rdf";)n=n.nextSibling;const t=n?n.nodeName.toLowerCase():null;if(!n||t!=="rdf:rdf"||!n.hasChildNodes())return;const a=n.childNodes;for(let r=0,s=a.length;r0){const a=new Uint8Array(t).buffer;this._queuedChunks.push(a)}this._pdfDataRangeTransport=n,this._isStreamingSupported=!e.disableStream,this._isRangeSupported=!e.disableRange,this._contentLength=e.length,this._fullRequestReader=null,this._rangeReaders=[],this._pdfDataRangeTransport.addRangeListener((a,r)=>{this._onReceiveData({begin:a,chunk:r})}),this._pdfDataRangeTransport.addProgressListener((a,r)=>{this._onProgress({loaded:a,total:r})}),this._pdfDataRangeTransport.addProgressiveReadListener(a=>{this._onReceiveData({chunk:a})}),this._pdfDataRangeTransport.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),this._pdfDataRangeTransport.transportReady()}_onReceiveData(e){const n=new Uint8Array(e.chunk).buffer;if(e.begin===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(n):this._queuedChunks.push(n);else{const t=this._rangeReaders.some(function(a){return a._begin!==e.begin?!1:(a._enqueue(n),!0)});(0,_util$5.assert)(t,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}_onProgress(e){if(e.total===void 0){const n=this._rangeReaders[0];n&&n.onProgress&&n.onProgress({loaded:e.loaded})}else{const n=this._fullRequestReader;n&&n.onProgress&&n.onProgress({loaded:e.loaded,total:e.total})}}_onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const n=this._rangeReaders.indexOf(e);n>=0&&this._rangeReaders.splice(n,1)}getFullReader(){(0,_util$5.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new PDFDataTransportStreamReader(this,e,this._progressiveDone)}getRangeReader(e,n){if(n<=this._progressiveDataLength)return null;const t=new PDFDataTransportStreamRangeReader(this,e,n);return this._pdfDataRangeTransport.requestDataRange(e,n),this._rangeReaders.push(t),t}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e),this._rangeReaders.slice(0).forEach(function(t){t.cancel(e)}),this._pdfDataRangeTransport.abort()}}transport_stream.PDFDataTransportStream=PDFDataTransportStream;class PDFDataTransportStreamReader{constructor(e,n,t=!1){this._stream=e,this._done=t||!1,this._filename=null,this._queuedChunks=n||[],this._loaded=0;for(const a of this._queuedChunks)this._loaded+=a.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.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 e=(0,_util$5.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._requests.forEach(function(n){n.resolve({value:void 0,done:!0})}),this._requests=[]}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{constructor(e,n,t){this._stream=e,this._begin=n,this._end=t,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){this._done||(this._requests.length===0?this._queuedChunk=e:(this._requests.shift().resolve({value:e,done:!1}),this._requests.forEach(function(t){t.resolve({value:void 0,done:!0})}),this._requests=[]),this._done=!0,this._stream._removeRangeReader(this))}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const n=this._queuedChunk;return this._queuedChunk=null,{value:n,done:!1}}if(this._done)return{value:void 0,done:!0};const e=(0,_util$5.createPromiseCapability)();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._requests.forEach(function(n){n.resolve({value:void 0,done:!0})}),this._requests=[],this._stream._removeRangeReader(this)}}var webgl={};Object.defineProperty(webgl,"__esModule",{value:!0});webgl.WebGLContext=void 0;var _util$4=util;class WebGLContext{constructor({enable:e=!1}){this._enabled=e===!0}get isEnabled(){let e=this._enabled;return e&&(e=WebGLUtils.tryInitGL()),(0,_util$4.shadow)(this,"isEnabled",e)}composeSMask({layer:e,mask:n,properties:t}){return WebGLUtils.composeSMask(e,n,t)}drawFigures({width:e,height:n,backgroundColor:t,figures:a,context:r}){return WebGLUtils.drawFigures(e,n,t,a,r)}clear(){WebGLUtils.cleanup()}}webgl.WebGLContext=WebGLContext;var WebGLUtils=function i(){function e(h,o,d){var p=h.createShader(d);h.shaderSource(p,o),h.compileShader(p);var w=h.getShaderParameter(p,h.COMPILE_STATUS);if(!w){var x=h.getShaderInfoLog(p);throw new Error("Error during shader compilation: "+x)}return p}function n(h,o){return e(h,o,h.VERTEX_SHADER)}function t(h,o){return e(h,o,h.FRAGMENT_SHADER)}function a(h,o){for(var d=h.createProgram(),p=0,w=o.length;p"u"&&(t.ownerDocument=globalThis.document),typeof t.disableRange!="boolean"&&(t.disableRange=!1),typeof t.disableStream!="boolean"&&(t.disableStream=!1),typeof t.disableAutoFetch!="boolean"&&(t.disableAutoFetch=!1),(0,_util$3.setVerbosityLevel)(t.verbosity),!r){const u={verbosity:t.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};r=u.port?PDFWorker.fromPort(u):new PDFWorker(u),e._worker=r}const s=e.docId;return r.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");const u=_fetchDocument(r,t,a,s),l=new Promise(function(y){let c;a?c=new _transport_stream.PDFDataTransportStream({length:t.length,initialData:t.initialData,progressiveDone:t.progressiveDone,disableRange:t.disableRange,disableStream:t.disableStream},a):t.data||(c=createPDFNetworkStream({url:t.url,length:t.length,httpHeaders:t.httpHeaders,withCredentials:t.withCredentials,rangeChunkSize:t.rangeChunkSize,disableRange:t.disableRange,disableStream:t.disableStream})),y(c)});return Promise.all([u,l]).then(function([y,c]){if(e.destroyed)throw new Error("Loading aborted");const M=new _message_handler.MessageHandler(s,y,r.port);M.postMessageTransfers=r.postMessageTransfers;const I=new WorkerTransport(M,e,c,t);e._transport=I,M.send("Ready",null)})}).catch(e._capability.reject),e}function _fetchDocument(i,e,n,t){return i.destroyed?Promise.reject(new Error("Worker was destroyed")):(n&&(e.length=n.length,e.initialData=n.initialData,e.progressiveDone=n.progressiveDone),i.messageHandler.sendWithPromise("GetDocRequest",{docId:t,apiVersion:"2.6.347",source:{data:e.data,url:e.url,password:e.password,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize,length:e.length},maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,postMessageTransfers:i.postMessageTransfers,docBaseUrl:e.docBaseUrl,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties}).then(function(a){if(i.destroyed)throw new Error("Worker was destroyed");return a}))}const PDFDocumentLoadingTask=function i(){let e=0;class n{constructor(){this._capability=(0,_util$3.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}destroy(){return this.destroyed=!0,(this._transport?this._transport.destroy():Promise.resolve()).then(()=>{this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)})}}return n}();class PDFDataRangeTransport{constructor(e,n,t=!1){this.length=e,this.initialData=n,this.progressiveDone=t,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,_util$3.createPromiseCapability)()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,n){for(const t of this._rangeListeners)t(e,n)}onDataProgress(e,n){this._readyCapability.promise.then(()=>{for(const t of this._progressListeners)t(e,n)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const n of this._progressiveReadListeners)n(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,n){(0,_util$3.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}api.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(e,n){this._pdfInfo=e,this._transport=n}get annotationStorage(){return(0,_util$3.shadow)(this,"annotationStorage",new _annotation_storage$1.AnnotationStorage)}get numPages(){return this._pdfInfo.numPages}get fingerprint(){return this._pdfInfo.fingerprint}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}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()}getJavaScript(){return this._transport.getJavaScript()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}getStats(){return this._transport.getStats()}cleanup(){return this._transport.startCleanup()}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}saveDocument(e){return this._transport.saveDocument(e)}}api.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(e,n,t,a,r=!1){this._pageIndex=e,this._pageInfo=n,this._ownerDocument=a,this._transport=t,this._stats=r?new _display_utils$2.StatTimer:null,this._pdfBug=r,this.commonObjs=t.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingCleanup=!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({scale:e,rotation:n=this.rotate,offsetX:t=0,offsetY:a=0,dontFlip:r=!1}={}){return new _display_utils$2.PageViewport({viewBox:this.view,scale:e,rotation:n,offsetX:t,offsetY:a,dontFlip:r})}getAnnotations({intent:e=null}={}){return(!this.annotationsPromise||this.annotationsIntent!==e)&&(this.annotationsPromise=this._transport.getAnnotations(this._pageIndex,e),this.annotationsIntent=e),this.annotationsPromise}render({canvasContext:e,viewport:n,intent:t="display",enableWebGL:a=!1,renderInteractiveForms:r=!1,transform:s=null,imageLayer:u=null,canvasFactory:l=null,background:y=null,annotationStorage:c=null,optionalContentConfigPromise:M=null}){this._stats&&this._stats.time("Overall");const I=t==="print"?"print":"display";this.pendingCleanup=!1,M||(M=this._transport.getOptionalContentConfig());let m=this._intentStates.get(I);m||(m=Object.create(null),this._intentStates.set(I,m)),m.streamReaderCancelTimeout&&(clearTimeout(m.streamReaderCancelTimeout),m.streamReaderCancelTimeout=null);const g=l||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),f=new _webgl.WebGLContext({enable:a});m.displayReadyCapability||(m.displayReadyCapability=(0,_util$3.createPromiseCapability)(),m.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:I,renderInteractiveForms:r===!0,annotationStorage:c&&c.getAll()||null}));const C=h=>{const o=m.renderTasks.indexOf(v);o>=0&&m.renderTasks.splice(o,1),(this.cleanupAfterRender||I==="print")&&(this.pendingCleanup=!0),this._tryCleanup(),h?(v.capability.reject(h),this._abortOperatorList({intentState:m,reason:h})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},v=new InternalRenderTask({callback:C,params:{canvasContext:e,viewport:n,transform:s,imageLayer:u,background:y},objs:this.objs,commonObjs:this.commonObjs,operatorList:m.operatorList,pageIndex:this._pageIndex,canvasFactory:g,webGLContext:f,useRequestAnimationFrame:I!=="print",pdfBug:this._pdfBug});m.renderTasks||(m.renderTasks=[]),m.renderTasks.push(v);const b=v.task;return Promise.all([m.displayReadyCapability.promise,M]).then(([h,o])=>{if(this.pendingCleanup){C();return}this._stats&&this._stats.time("Rendering"),v.initializeGraphics({transparency:h,optionalContentConfig:o}),v.operatorListChanged()}).catch(C),b}getOperatorList(){function e(){if(t.operatorList.lastChunk){t.opListReadCapability.resolve(t.operatorList);const r=t.renderTasks.indexOf(a);r>=0&&t.renderTasks.splice(r,1)}}const n="oplist";let t=this._intentStates.get(n);t||(t=Object.create(null),this._intentStates.set(n,t));let a;return t.opListReadCapability||(a=Object.create(null),a.operatorListChanged=e,t.opListReadCapability=(0,_util$3.createPromiseCapability)(),t.renderTasks=[],t.renderTasks.push(a),t.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList({pageIndex:this._pageIndex,intent:n})),t.opListReadCapability.promise}streamTextContent({normalizeWhitespace:e=!1,disableCombineTextItems:n=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:e===!0,combineTextItems:n!==!0},{highWaterMark:100,size(a){return a.items.length}})}getTextContent(e={}){const n=this.streamTextContent(e);return new Promise(function(t,a){function r(){s.read().then(function({value:l,done:y}){if(y){t(u);return}Object.assign(u.styles,l.styles),u.items.push(...l.items),r()},a)}const s=n.getReader(),u={items:[],styles:Object.create(null)};r()})}_destroy(){this.destroyed=!0,this._transport.pageCache[this._pageIndex]=null;const e=[];for(const[n,t]of this._intentStates)if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),n!=="oplist")for(const a of t.renderTasks)e.push(a.completed),a.cancel();return this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(e)}cleanup(e=!1){return this.pendingCleanup=!0,this._tryCleanup(e)}_tryCleanup(e=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:n,operatorList:t}of this._intentStates.values())if(n.length!==0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.annotationsPromise=null,e&&this._stats&&(this._stats=new _display_utils$2.StatTimer),this.pendingCleanup=!1,!0}_startRenderPage(e,n){const t=this._intentStates.get(n);t&&(this._stats&&this._stats.timeEnd("Page Request"),t.displayReadyCapability&&t.displayReadyCapability.resolve(e))}_renderPageChunk(e,n){for(let t=0,a=e.length;t{t.read().then(({value:s,done:u})=>{if(u){a.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(s,a),r())},s=>{if(a.streamReader=null,!this._transport.destroyed){if(a.operatorList){a.operatorList.lastChunk=!0;for(let u=0;u{this._abortOperatorList({intentState:e,reason:n,force:!0}),e.streamReaderCancelTimeout=null},RENDERING_CANCELLED_TIMEOUT);return}}if(e.streamReader.cancel(new _util$3.AbortException(n&&n.message)),e.streamReader=null,!this._transport.destroyed){for(const[a,r]of this._intentStates)if(r===e){this._intentStates.delete(a);break}this.cleanup()}}}get stats(){return this._stats}}api.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(e=!0){this._listeners=[],this._defer=e,this._deferred=Promise.resolve(void 0)}postMessage(e,n){function t(s){if(typeof s!="object"||s===null)return s;if(a.has(s))return a.get(s);let u,l;if((u=s.buffer)&&(0,_util$3.isArrayBuffer)(u))return n&&n.includes(u)?l=new s.constructor(u,s.byteOffset,s.byteLength):l=new s.constructor(s),a.set(s,l),l;l=Array.isArray(s)?[]:{},a.set(s,l);for(const y in s){let c,M=s;for(;!(c=Object.getOwnPropertyDescriptor(M,y));)M=Object.getPrototypeOf(M);if(!(typeof c.value>"u")){if(typeof c.value=="function"){if(s.hasOwnProperty&&s.hasOwnProperty(y))throw new Error(`LoopbackPort.postMessage - cannot clone: ${s[y]}`);continue}l[y]=t(c.value)}}return l}if(!this._defer){this._listeners.forEach(s=>{s.call(this,{data:e})});return}const a=new WeakMap,r={data:t(e)};this._deferred.then(()=>{this._listeners.forEach(s=>{s.call(this,r)})})}addEventListener(e,n){this._listeners.push(n)}removeEventListener(e,n){const t=this._listeners.indexOf(n);this._listeners.splice(t,1)}terminate(){this._listeners.length=0}}api.LoopbackPort=LoopbackPort;const PDFWorker=function PDFWorkerClosure(){const pdfWorkerPorts=new WeakMap;let isWorkerDisabled=!1,fallbackWorkerSrc,nextFakeWorkerId=0,fakeWorkerCapability;if(_is_node$1.isNodeJS&&typeof commonjsRequire=="function")isWorkerDisabled=!0,fallbackWorkerSrc="../pdf.worker.js";else if(typeof document=="object"&&"currentScript"in document){const i=document.currentScript&&document.currentScript.src;i&&(fallbackWorkerSrc=i.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}function getWorkerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(typeof fallbackWorkerSrc<"u")return _is_node$1.isNodeJS||(0,_display_utils$2.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}function getMainThreadWorkerMessageHandler(){let i;try{i=globalThis.pdfjsWorker&&globalThis.pdfjsWorker.WorkerMessageHandler}catch{}return i||null}function setupFakeWorkerGlobal(){if(fakeWorkerCapability)return fakeWorkerCapability.promise;fakeWorkerCapability=(0,_util$3.createPromiseCapability)();const loader=async function(){const mainWorkerMessageHandler=getMainThreadWorkerMessageHandler();if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node$1.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(getWorkerSrc());return worker.WorkerMessageHandler}return await(0,_display_utils$2.loadScript)(getWorkerSrc()),window.pdfjsWorker.WorkerMessageHandler};return loader().then(fakeWorkerCapability.resolve,fakeWorkerCapability.reject),fakeWorkerCapability.promise}function createCDNWrapper(i){const e="importScripts('"+i+"');";return URL.createObjectURL(new Blob([e]))}class PDFWorker{constructor({name:e=null,port:n=null,verbosity:t=(0,_util$3.getVerbosityLevel)()}={}){if(n&&pdfWorkerPorts.has(n))throw new Error("Cannot use more than one PDFWorker per port");if(this.name=e,this.destroyed=!1,this.postMessageTransfers=!0,this.verbosity=t,this._readyCapability=(0,_util$3.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,n){pdfWorkerPorts.set(n,this),this._initializeFromPort(n);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new _message_handler.MessageHandler("main","worker",e),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()}_initialize(){if(typeof Worker<"u"&&!isWorkerDisabled&&!getMainThreadWorkerMessageHandler()){let e=getWorkerSrc();try{(0,_util$3.isSameOrigin)(window.location.href,e)||(e=createCDNWrapper(new URL(e,window.location).href));const n=new Worker(e),t=new _message_handler.MessageHandler("main","worker",n),a=()=>{n.removeEventListener("error",r),t.destroy(),n.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},r=()=>{this._webWorker||a()};n.addEventListener("error",r),t.on("test",u=>{if(n.removeEventListener("error",r),this.destroyed){a();return}u?(this._messageHandler=t,this._port=n,this._webWorker=n,u.supportTransfers||(this.postMessageTransfers=!1),this._readyCapability.resolve(),t.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),t.destroy(),n.terminate())}),t.on("ready",u=>{if(n.removeEventListener("error",r),this.destroyed){a();return}try{s()}catch{this._setupFakeWorker()}});const s=()=>{const u=new Uint8Array([this.postMessageTransfers?255:0]);try{t.send("test",u,[u.buffer])}catch{(0,_util$3.warn)("Cannot use postMessage transfers."),u[0]=0,t.send("test",u)}};s();return}catch{(0,_util$3.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){isWorkerDisabled||((0,_util$3.warn)("Setting up fake worker."),isWorkerDisabled=!0),setupFakeWorkerGlobal().then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const n=new LoopbackPort;this._port=n;const t="fake"+nextFakeWorkerId++,a=new _message_handler.MessageHandler(t+"_worker",t,n);e.setup(a,n);const r=new _message_handler.MessageHandler(t,t+"_worker",n);this._messageHandler=r,this._readyCapability.resolve(),r.send("configure",{verbosity:this.verbosity})}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),pdfWorkerPorts.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e||!e.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return pdfWorkerPorts.has(e.port)?pdfWorkerPorts.get(e.port):new PDFWorker(e)}static getWorkerSrc(){return getWorkerSrc()}}return PDFWorker}();api.PDFWorker=PDFWorker;class WorkerTransport{constructor(e,n,t,a){this.messageHandler=e,this.loadingTask=n,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({docId:n.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:a.ownerDocument}),this._params=a,this.CMapReaderFactory=new a.CMapReaderFactory({baseUrl:a.cMapUrl,isCompressed:a.cMapPacked}),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=t,this._fullReader=null,this._lastProgress=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=(0,_util$3.createPromiseCapability)(),this.setupMessageHandler()}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,_util$3.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];this.pageCache.forEach(function(t){t&&e.push(t._destroy())}),this.pageCache.length=0,this.pagePromises.length=0;const n=this.messageHandler.sendWithPromise("Terminate",null);return e.push(n),Promise.all(e).then(()=>{this.fontLoader.clear(),this._networkStream&&this._networkStream.cancelAllRequests(new _util$3.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:n}=this;e.on("GetReader",(t,a)=>{(0,_util$3.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=r=>{this._lastProgress={loaded:r.loaded,total:r.total}},a.onPull=()=>{this._fullReader.read().then(function({value:r,done:s}){if(s){a.close();return}(0,_util$3.assert)((0,_util$3.isArrayBuffer)(r),"GetReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(r),1,[r])}).catch(r=>{a.error(r)})},a.onCancel=r=>{this._fullReader.cancel(r),a.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",t=>{const a=(0,_util$3.createPromiseCapability)(),r=this._fullReader;return r.headersReady.then(()=>{(!r.isStreamingSupported||!r.isRangeSupported)&&(this._lastProgress&&n.onProgress&&n.onProgress(this._lastProgress),r.onProgress=s=>{n.onProgress&&n.onProgress({loaded:s.loaded,total:s.total})}),a.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})},a.reject),a.promise}),e.on("GetRangeReader",(t,a)=>{(0,_util$3.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(t.begin,t.end);if(!r){a.close();return}a.onPull=()=>{r.read().then(function({value:s,done:u}){if(u){a.close();return}(0,_util$3.assert)((0,_util$3.isArrayBuffer)(s),"GetRangeReader - expected an ArrayBuffer."),a.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{a.error(s)})},a.onCancel=s=>{r.cancel(s),a.ready.catch(u=>{if(!this.destroyed)throw u})}}),e.on("GetDoc",({pdfInfo:t})=>{this._numPages=t.numPages,n._capability.resolve(new PDFDocumentProxy(t,this))}),e.on("DocException",function(t){let a;switch(t.name){case"PasswordException":a=new _util$3.PasswordException(t.message,t.code);break;case"InvalidPDFException":a=new _util$3.InvalidPDFException(t.message);break;case"MissingPDFException":a=new _util$3.MissingPDFException(t.message);break;case"UnexpectedResponseException":a=new _util$3.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":a=new _util$3.UnknownErrorException(t.message,t.details);break}a instanceof Error||(0,_util$3.warn)("DocException - expected a valid Error."),n._capability.reject(a)}),e.on("PasswordRequest",t=>{if(this._passwordCapability=(0,_util$3.createPromiseCapability)(),n.onPassword){const a=r=>{this._passwordCapability.resolve({password:r})};try{n.onPassword(a,t.code)}catch(r){this._passwordCapability.reject(r)}}else this._passwordCapability.reject(new _util$3.PasswordException(t.message,t.code));return this._passwordCapability.promise}),e.on("DataLoaded",t=>{n.onProgress&&n.onProgress({loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)}),e.on("StartRenderPage",t=>{if(this.destroyed)return;this.pageCache[t.pageIndex]._startRenderPage(t.transparency,t.intent)}),e.on("commonobj",t=>{if(this.destroyed)return;const[a,r,s]=t;if(!this.commonObjs.has(a))switch(r){case"Font":const u=this._params;if("error"in s){const c=s.error;(0,_util$3.warn)(`Error during font loading: ${c}`),this.commonObjs.resolve(a,c);break}let l=null;u.pdfBug&&globalThis.FontInspector&&globalThis.FontInspector.enabled&&(l={registerFont(c,M){globalThis.FontInspector.fontAdded(c,M)}});const y=new _font_loader.FontFaceObject(s,{isEvalSupported:u.isEvalSupported,disableFontFace:u.disableFontFace,ignoreErrors:u.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:l});this.fontLoader.bind(y).catch(c=>e.sendWithPromise("FontFallback",{id:a})).finally(()=>{!u.fontExtraProperties&&y.data&&(y.data=null),this.commonObjs.resolve(a,y)});break;case"FontPath":case"Image":this.commonObjs.resolve(a,s);break;default:throw new Error(`Got unknown common object type ${r}`)}}),e.on("obj",t=>{if(this.destroyed)return;const[a,r,s,u]=t,l=this.pageCache[r];if(!l.objs.has(a))switch(s){case"Image":l.objs.resolve(a,u),u&&"data"in u&&u.data.length>8e6&&(l.cleanupAfterRender=!0);break;default:throw new Error(`Got unknown object type ${s}`)}}),e.on("DocProgress",t=>{this.destroyed||n.onProgress&&n.onProgress({loaded:t.loaded,total:t.total})}),e.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),e.on("FetchBuiltInCMap",(t,a)=>{if(this.destroyed){a.error(new Error("Worker was destroyed"));return}let r=!1;a.onPull=()=>{if(r){a.close();return}r=!0,this.CMapReaderFactory.fetch(t).then(function(s){a.enqueue(s,1,[s.cMapData.buffer])}).catch(function(s){a.error(s)})}})}_onUnsupportedFeature({featureId:e}){this.destroyed||this.loadingTask.onUnsupportedFeature&&this.loadingTask.onUnsupportedFeature(e)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request"));const n=e-1;if(n in this.pagePromises)return this.pagePromises[n];const t=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(a=>{if(this.destroyed)throw new Error("Transport destroyed");const r=new PDFPageProxy(n,a,this,this._params.ownerDocument,this._params.pdfBug);return this.pageCache[n]=r,r});return this.pagePromises[n]=t,t}getPageIndex(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e}).catch(function(n){return Promise.reject(new Error(n))})}getAnnotations(e,n){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:n})}saveDocument(e){return this.messageHandler.sendWithPromise("SaveDocument",{numPages:this._numPages,annotationStorage:e&&e.getAll()||null,filename:this._fullReader?this._fullReader.filename:null}).finally(()=>{e&&e.resetModified()})}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}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)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(e=>new _optional_content_config.OptionalContentConfig(e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(e=>({info:e[0],metadata:e[1]?new _metadata.Metadata(e[1]):null,contentDispositionFilename:this._fullReader?this._fullReader.filename:null}))}getStats(){return this.messageHandler.sendWithPromise("GetStats",null)}startCleanup(){return this.messageHandler.sendWithPromise("Cleanup",null).then(()=>{for(let e=0,n=this.pageCache.length;e{this._nextBound().catch(this.cancel.bind(this))}):Promise.resolve().then(this._nextBound).catch(this.cancel.bind(this))}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(),this._canvas&&e.delete(this._canvas),this.callback())))}}return n}(),version="2.6.347";api.version=version;const build="3be9c65f";api.build=build;var annotation_layer={};Object.defineProperty(annotation_layer,"__esModule",{value:!0});annotation_layer.AnnotationLayer=void 0;var _display_utils$1=display_utils,_util$2=util,_annotation_storage=annotation_storage;class AnnotationElementFactory{static create(e){switch(e.data.annotationType){case _util$2.AnnotationType.LINK:return new LinkAnnotationElement(e);case _util$2.AnnotationType.TEXT:return new TextAnnotationElement(e);case _util$2.AnnotationType.WIDGET:switch(e.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(e);case"Btn":return e.data.radioButton?new RadioButtonWidgetAnnotationElement(e):e.data.checkBox?new CheckboxWidgetAnnotationElement(e):new PushButtonWidgetAnnotationElement(e);case"Ch":return new ChoiceWidgetAnnotationElement(e)}return new WidgetAnnotationElement(e);case _util$2.AnnotationType.POPUP:return new PopupAnnotationElement(e);case _util$2.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(e);case _util$2.AnnotationType.LINE:return new LineAnnotationElement(e);case _util$2.AnnotationType.SQUARE:return new SquareAnnotationElement(e);case _util$2.AnnotationType.CIRCLE:return new CircleAnnotationElement(e);case _util$2.AnnotationType.POLYLINE:return new PolylineAnnotationElement(e);case _util$2.AnnotationType.CARET:return new CaretAnnotationElement(e);case _util$2.AnnotationType.INK:return new InkAnnotationElement(e);case _util$2.AnnotationType.POLYGON:return new PolygonAnnotationElement(e);case _util$2.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(e);case _util$2.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(e);case _util$2.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(e);case _util$2.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(e);case _util$2.AnnotationType.STAMP:return new StampAnnotationElement(e);case _util$2.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(e);default:return new AnnotationElement(e)}}}class AnnotationElement{constructor(e,n=!1,t=!1){this.isRenderable=n,this.data=e.data,this.layer=e.layer,this.page=e.page,this.viewport=e.viewport,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderInteractiveForms=e.renderInteractiveForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,n&&(this.container=this._createContainer(t))}_createContainer(e=!1){const n=this.data,t=this.page,a=this.viewport,r=document.createElement("section");let s=n.rect[2]-n.rect[0],u=n.rect[3]-n.rect[1];r.setAttribute("data-annotation-id",n.id);const l=_util$2.Util.normalizeRect([n.rect[0],t.view[3]-n.rect[1]+t.view[1],n.rect[2],t.view[3]-n.rect[3]+t.view[1]]);if(r.style.transform=`matrix(${a.transform.join(",")})`,r.style.transformOrigin=`-${l[0]}px -${l[1]}px`,!e&&n.borderStyle.width>0){r.style.borderWidth=`${n.borderStyle.width}px`,n.borderStyle.style!==_util$2.AnnotationBorderStyleType.UNDERLINE&&(s=s-2*n.borderStyle.width,u=u-2*n.borderStyle.width);const y=n.borderStyle.horizontalCornerRadius,c=n.borderStyle.verticalCornerRadius;if(y>0||c>0){const M=`${y}px / ${c}px`;r.style.borderRadius=M}switch(n.borderStyle.style){case _util$2.AnnotationBorderStyleType.SOLID:r.style.borderStyle="solid";break;case _util$2.AnnotationBorderStyleType.DASHED:r.style.borderStyle="dashed";break;case _util$2.AnnotationBorderStyleType.BEVELED:(0,_util$2.warn)("Unimplemented border style: beveled");break;case _util$2.AnnotationBorderStyleType.INSET:(0,_util$2.warn)("Unimplemented border style: inset");break;case _util$2.AnnotationBorderStyleType.UNDERLINE:r.style.borderBottomStyle="solid";break}n.color?r.style.borderColor=_util$2.Util.makeCssRgb(n.color[0]|0,n.color[1]|0,n.color[2]|0):r.style.borderWidth=0}return r.style.left=`${l[0]}px`,r.style.top=`${l[1]}px`,r.style.width=`${s}px`,r.style.height=`${u}px`,r}_createPopup(e,n,t){n||(n=document.createElement("div"),n.style.height=e.style.height,n.style.width=e.style.width,e.appendChild(n));const r=new PopupElement({container:e,trigger:n,color:t.color,title:t.title,modificationDate:t.modificationDate,contents:t.contents,hideWrapper:!0}).render();r.style.left=e.style.width,e.appendChild(r)}render(){(0,_util$2.unreachable)("Abstract method `AnnotationElement.render` called")}}class LinkAnnotationElement extends AnnotationElement{constructor(e){const n=!!(e.data.url||e.data.dest||e.data.action);super(e,n)}render(){this.container.className="linkAnnotation";const{data:e,linkService:n}=this,t=document.createElement("a");return e.url?(0,_display_utils$1.addLinkAttributes)(t,{url:e.url,target:e.newWindow?_display_utils$1.LinkTarget.BLANK:n.externalLinkTarget,rel:n.externalLinkRel,enabled:n.externalLinkEnabled}):e.action?this._bindNamedAction(t,e.action):this._bindLink(t,e.dest),this.container.appendChild(t),this.container}_bindLink(e,n){e.href=this.linkService.getDestinationHash(n),e.onclick=()=>(n&&this.linkService.navigateTo(n),!1),n&&(e.className="internalLink")}_bindNamedAction(e,n){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(n),!1),e.className="internalLink"}}class TextAnnotationElement extends AnnotationElement{constructor(e){const n=!!(e.data.hasPopup||e.data.title||e.data.contents);super(e,n)}render(){this.container.className="textAnnotation";const e=document.createElement("img");return e.style.height=this.container.style.height,e.style.width=this.container.style.width,e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.alt="[{{type}} Annotation]",e.dataset.l10nId="text_annotation_type",e.dataset.l10nArgs=JSON.stringify({type:this.data.name}),this.data.hasPopup||this._createPopup(this.container,e,this.data),this.container.appendChild(e),this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){return this.container}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){const n=e.renderInteractiveForms||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,n)}render(){const e=["left","center","right"],n=this.annotationStorage,t=this.data.id;this.container.className="textWidgetAnnotation";let a=null;if(this.renderInteractiveForms){const r=n.getOrCreateValue(t,this.data.fieldValue);if(this.data.multiLine?(a=document.createElement("textarea"),a.textContent=r):(a=document.createElement("input"),a.type="text",a.setAttribute("value",r)),a.addEventListener("input",function(s){n.setValue(t,s.target.value)}),a.disabled=this.data.readOnly,a.name=this.data.fieldName,this.data.maxLen!==null&&(a.maxLength=this.data.maxLen),this.data.comb){const u=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;a.classList.add("comb"),a.style.letterSpacing=`calc(${u}px - 1ch)`}}else{a=document.createElement("div"),a.textContent=this.data.fieldValue,a.style.verticalAlign="middle",a.style.display="table-cell";let r=null;this.data.fontRefName&&this.page.commonObjs.has(this.data.fontRefName)&&(r=this.page.commonObjs.get(this.data.fontRefName)),this._setTextStyle(a,r)}return this.data.textAlignment!==null&&(a.style.textAlign=e[this.data.textAlignment]),this.container.appendChild(a),this.container}_setTextStyle(e,n){const t=e.style;if(t.fontSize=`${this.data.fontSize}px`,t.direction=this.data.fontDirection<0?"rtl":"ltr",!n)return;let a="normal";n.black?a="900":n.bold&&(a="bold"),t.fontWeight=a,t.fontStyle=n.italic?"italic":"normal";const r=n.loadedName?`"${n.loadedName}", `:"",s=n.fallbackName||"Helvetica, sans-serif";t.fontFamily=r+s}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,e.renderInteractiveForms)}render(){const e=this.annotationStorage,n=this.data,t=n.id,a=e.getOrCreateValue(t,n.fieldValue&&n.fieldValue!=="Off");this.container.className="buttonWidgetAnnotation checkBox";const r=document.createElement("input");return r.disabled=n.readOnly,r.type="checkbox",r.name=this.data.fieldName,a&&r.setAttribute("checked",!0),r.addEventListener("change",function(s){e.setValue(t,s.target.checked)}),this.container.appendChild(r),this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,e.renderInteractiveForms)}render(){this.container.className="buttonWidgetAnnotation radioButton";const e=this.annotationStorage,n=this.data,t=n.id,a=e.getOrCreateValue(t,n.fieldValue===n.buttonValue),r=document.createElement("input");return r.disabled=n.readOnly,r.type="radio",r.name=n.fieldName,a&&r.setAttribute("checked",!0),r.addEventListener("change",function(s){const u=s.target.name;for(const l of document.getElementsByName(u))l!==s.target&&e.setValue(l.parentNode.getAttribute("data-annotation-id"),!1);e.setValue(t,s.target.checked)}),this.container.appendChild(r),this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{render(){const e=super.render();return e.className="buttonWidgetAnnotation pushButton",e}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(e){super(e,e.renderInteractiveForms)}render(){this.container.className="choiceWidgetAnnotation";const e=this.annotationStorage,n=this.data.id;e.getOrCreateValue(n,this.data.fieldValue.length>0?this.data.fieldValue[0]:null);const t=document.createElement("select");t.disabled=this.data.readOnly,t.name=this.data.fieldName,this.data.combo||(t.size=this.data.options.length,this.data.multiSelect&&(t.multiple=!0));for(const a of this.data.options){const r=document.createElement("option");r.textContent=a.displayValue,r.value=a.exportValue,this.data.fieldValue.includes(a.exportValue)&&r.setAttribute("selected",!0),t.appendChild(r)}return t.addEventListener("input",function(a){const r=a.target.options,s=r[r.selectedIndex].value;e.setValue(n,s)}),this.container.appendChild(t),this.container}}class PopupAnnotationElement extends AnnotationElement{constructor(e){const n=!!(e.data.title||e.data.contents);super(e,n)}render(){const e=["Line","Square","Circle","PolyLine","Polygon","Ink"];if(this.container.className="popupAnnotation",e.includes(this.data.parentType))return this.container;const n=`[data-annotation-id="${this.data.parentId}"]`,t=this.layer.querySelector(n);if(!t)return this.container;const a=new PopupElement({container:this.container,trigger:t,color:this.data.color,title:this.data.title,modificationDate:this.data.modificationDate,contents:this.data.contents}),r=parseFloat(t.style.left),s=parseFloat(t.style.width);return this.container.style.transformOrigin=`-${r+s}px -${t.style.top}`,this.container.style.left=`${r+s}px`,this.container.appendChild(a.render()),this.container}}class PopupElement{constructor(e){this.container=e.container,this.trigger=e.trigger,this.color=e.color,this.title=e.title,this.modificationDate=e.modificationDate,this.contents=e.contents,this.hideWrapper=e.hideWrapper||!1,this.pinned=!1}render(){const n=document.createElement("div");n.className="popupWrapper",this.hideElement=this.hideWrapper?n:this.container,this.hideElement.setAttribute("hidden",!0);const t=document.createElement("div");t.className="popup";const a=this.color;if(a){const l=.7*(255-a[0])+a[0],y=.7*(255-a[1])+a[1],c=.7*(255-a[2])+a[2];t.style.backgroundColor=_util$2.Util.makeCssRgb(l|0,y|0,c|0)}const r=document.createElement("h1");r.textContent=this.title,t.appendChild(r);const s=_display_utils$1.PDFDateString.toDateObject(this.modificationDate);if(s){const l=document.createElement("span");l.textContent="{{date}}, {{time}}",l.dataset.l10nId="annotation_date_string",l.dataset.l10nArgs=JSON.stringify({date:s.toLocaleDateString(),time:s.toLocaleTimeString()}),t.appendChild(l)}const u=this._formatContents(this.contents);return t.appendChild(u),this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),t.addEventListener("click",this._hide.bind(this,!0)),n.appendChild(t),n}_formatContents(e){const n=document.createElement("p"),t=e.split(/(?:\r\n?|\n)/);for(let a=0,r=t.length;a1)x=!0;else if(m.transform[0]!==m.transform[3]){const O=Math.abs(m.transform[0]),k=Math.abs(m.transform[3]);O!==k&&Math.max(O,k)/Math.min(O,k)>1.5&&(x=!0)}if(x&&(h.vertical?C.canvasWidth=m.height*I._viewport.scale:C.canvasWidth=m.width*I._viewport.scale),I._textDivProperties.set(f,C),I._textContentStream&&I._layoutText(f),I._enhanceTextSelection){var D=1,T=0;b!==0&&(D=Math.cos(b),T=Math.sin(b));var P=(h.vertical?m.height:m.width)*I._viewport.scale,E=o,B,L;b!==0?(B=[D,T,-T,D,p,w],L=_util$1.Util.getAxialAlignedBoundingBox([0,0,P,E],B)):L=[p,w,p+P,w+E],I._bounds.push({left:L[0],top:L[1],right:L[2],bottom:L[3],div:f,size:[P,E],m:B})}}function r(I){if(!I._canceled){var m=I._textDivs,g=I._capability,f=m.length;if(f>e){I._renderingDone=!0,g.resolve();return}if(!I._textContentStream)for(var C=0;C0&&(f=f?Math.min(v,f):v)}return f}function u(I){for(var m=I._bounds,g=I._viewport,f=l(g.width,g.height,m),C=0;C=0&&f[b].start>=C.y2;)b--;var h,o,d,p,w=-1/0;for(d=v;d<=b;d++){h=f[d],o=h.boundary;var x;o.x2>C.x1?x=o.index>C.index?o.x1New:C.x1:o.x2New===void 0?x=(o.x2+C.x1)/2:x=o.x2New,x>w&&(w=x)}for(C.x1New=w,d=v;d<=b;d++)h=f[d],o=h.boundary,o.x2New===void 0?o.x2>C.x1?o.index>C.index&&(o.x2New=o.x2):o.x2New=w:o.x2New>w&&(o.x2New=Math.max(w,o.x2));var D=[],T=null;for(d=v;d<=b;d++){h=f[d],o=h.boundary;var P=o.x2>C.x2?o:C;T===P?D[D.length-1].end=h.end:(D.push({start:h.start,end:h.end,boundary:P}),T=P)}for(f[v].start=0&&f[p].start>=o.y1;p--)E=f[p].boundary===o;for(p=b+1;!E&&p{this._layoutTextCtx&&(this._layoutTextCtx.canvas.width=0,this._layoutTextCtx.canvas.height=0,this._layoutTextCtx=null)}).catch(()=>{})}c.prototype={get promise(){return this._capability.promise},cancel:function(){this._canceled=!0,this._reader&&(this._reader.cancel(new _util$1.AbortException("TextLayer task cancelled.")),this._reader=null),this._renderTimer!==null&&(clearTimeout(this._renderTimer),this._renderTimer=null),this._capability.reject(new Error("TextLayer task cancelled."))},_processItems(I,m){for(let g=0,f=I.length;g0&&(m.scale=m.canvasWidth/v,g=`scaleX(${m.scale})`)}m.angle!==0&&(g=`rotate(${m.angle}deg) ${g}`),g.length>0&&(this._enhanceTextSelection&&(m.originalTransform=g),I.style.transform=g),this._textDivProperties.set(I,m),this._container.appendChild(I)},_render:function(m){const g=(0,_util$1.createPromiseCapability)();let f=Object.create(null);const C=this._document.createElement("canvas");if(C.mozOpaque=!0,this._layoutTextCtx=C.getContext("2d",{alpha:!1}),this._textContent){const v=this._textContent.items,b=this._textContent.styles;this._processItems(v,b),g.resolve()}else if(this._textContentStream){const v=()=>{this._reader.read().then(({value:b,done:h})=>{if(h){g.resolve();return}Object.assign(f,b.styles),this._processItems(b.items,f),v()},g.reject)};this._reader=this._textContentStream.getReader(),v()}else throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');g.promise.then(()=>{f=null,m?this._renderTimer=setTimeout(()=>{r(this),this._renderTimer=null},m):r(this)},this._capability.reject)},expandTextDivs:function(m){if(!this._enhanceTextSelection||!this._renderingDone)return;this._bounds!==null&&(u(this),this._bounds=null);const g=[],f=[];for(var C=0,v=this._textDivs.length;C0?(f.push(`${h.paddingTop}px`),g.push(`translateY(${-h.paddingTop}px)`)):f.push(0),h.paddingRight>0?f.push(`${h.paddingRight/h.scale}px`):f.push(0),h.paddingBottom>0?f.push(`${h.paddingBottom}px`):f.push(0),h.paddingLeft>0?(f.push(`${h.paddingLeft/h.scale}px`),g.push(`translateX(${-h.paddingLeft/h.scale}px)`)):f.push(0),b.style.padding=f.join(" "),g.length&&(b.style.transform=g.join(" "))):(b.style.padding=null,b.style.transform=h.originalTransform))}}};function M(I){var m=new c({textContent:I.textContent,textContentStream:I.textContentStream,container:I.container,viewport:I.viewport,textDivs:I.textDivs,textContentItemsStr:I.textContentItemsStr,enhanceTextSelection:I.enhanceTextSelection});return m._render(I.timeout),m}return M}();text_layer.renderTextLayer=renderTextLayer;var svg={};Object.defineProperty(svg,"__esModule",{value:!0});svg.SVGGraphics=void 0;var _util=util,_display_utils=display_utils,_is_node=is_node;let SVGGraphics=function(){throw new Error("Not implemented: SVGGraphics")};svg.SVGGraphics=SVGGraphics;{let u=function(m){let g=[];const f=[];for(const C of m){if(C.fn==="save"){g.push({fnId:92,fn:"group",items:[]}),f.push(g),g=g[g.length-1].items;continue}C.fn==="restore"?g=f.pop():g.push(C)}return g},l=function(m){if(Number.isInteger(m))return m.toString();const g=m.toFixed(10);let f=g.length-1;if(g[f]!=="0")return g;do f--;while(g[f]==="0");return g.substring(0,g[f]==="."?f:f+1)},y=function(m){if(m[4]===0&&m[5]===0){if(m[1]===0&&m[2]===0)return m[0]===1&&m[3]===1?"":`scale(${l(m[0])} ${l(m[3])})`;if(m[0]===m[3]&&m[1]===-m[2]){const g=Math.acos(m[0])*180/Math.PI;return`rotate(${l(g)})`}}else if(m[0]===1&&m[1]===0&&m[2]===0&&m[3]===1)return`translate(${l(m[4])} ${l(m[5])})`;return`matrix(${l(m[0])} ${l(m[1])} ${l(m[2])} ${l(m[3])} ${l(m[4])} ${l(m[5])})`};const i={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},e="http://www.w3.org/XML/1998/namespace",n="http://www.w3.org/1999/xlink",t=["butt","round","square"],a=["miter","round","bevel"],r=function(){const m=new Uint8Array([137,80,78,71,13,10,26,10]),g=12,f=new Int32Array(256);for(let p=0;p<256;p++){let w=p;for(let x=0;x<8;x++)w&1?w=3988292384^w>>1&2147483647:w=w>>1&2147483647;f[p]=w}function C(p,w,x){let D=-1;for(let T=w;T>>8^E}return D^-1}function v(p,w,x,D){let T=D;const P=w.length;x[T]=P>>24&255,x[T+1]=P>>16&255,x[T+2]=P>>8&255,x[T+3]=P&255,T+=4,x[T]=p.charCodeAt(0)&255,x[T+1]=p.charCodeAt(1)&255,x[T+2]=p.charCodeAt(2)&255,x[T+3]=p.charCodeAt(3)&255,T+=4,x.set(w,T),T+=w.length;const E=C(x,D+4,T);x[T]=E>>24&255,x[T+1]=E>>16&255,x[T+2]=E>>8&255,x[T+3]=E&255}function b(p,w,x){let D=1,T=0;for(let P=w;P=8?w=p:w=Buffer.from(p);const x=lib.deflateSync(w,{level:9});return x instanceof Uint8Array?x:new Uint8Array(x)}catch(w){(0,_util.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+w)}return o(p)}function o(p){let w=p.length;const x=65535,D=Math.ceil(w/x),T=new Uint8Array(2+w+D*5+4);let P=0;T[P++]=120,T[P++]=156;let E=0;for(;w>x;)T[P++]=0,T[P++]=255,T[P++]=255,T[P++]=0,T[P++]=0,T.set(p.subarray(E,E+x),P),P+=x,E+=x,w-=x;T[P++]=1,T[P++]=w&255,T[P++]=w>>8&255,T[P++]=~w&65535&255,T[P++]=(~w&65535)>>8&255,T.set(p.subarray(E),P),P+=p.length-E;const B=b(p,0,p.length);return T[P++]=B>>24&255,T[P++]=B>>16&255,T[P++]=B>>8&255,T[P++]=B&255,T}function d(p,w,x,D){const T=p.width,P=p.height;let E,B,L;const O=p.data;switch(w){case _util.ImageKind.GRAYSCALE_1BPP:B=0,E=1,L=T+7>>3;break;case _util.ImageKind.RGB_24BPP:B=2,E=8,L=T*3;break;case _util.ImageKind.RGBA_32BPP:B=6,E=8,L=T*4;break;default:throw new Error("invalid format")}const k=new Uint8Array((1+L)*P);let j=0,A=0;for(let G=0;G>24&255,T>>16&255,T>>8&255,T&255,P>>24&255,P>>16&255,P>>8&255,P&255,E,B,0,0,0]),R=h(k),N=m.length+g*3+S.length+R.length,U=new Uint8Array(N);let F=0;return U.set(m,F),F+=m.length,v("IHDR",S,U,F),F+=g+S.length,v("IDATA",R,U,F),F+=g+R.length,v("IEND",new Uint8Array(0),U,F),(0,_util.createObjectURL)(U,"image/png",x)}return function(w,x,D){const T=w.kind===void 0?_util.ImageKind.GRAYSCALE_1BPP:w.kind;return d(w,T,x,D)}}();class s{constructor(){this.fontSizeScale=1,this.fontWeight=i.fontWeight,this.fontSize=0,this.textMatrix=_util.IDENTITY_MATRIX,this.fontMatrix=_util.FONT_IDENTITY_MATRIX,this.leading=0,this.textRenderingMode=_util.TextRenderingMode.FILL,this.textMatrixScale=1,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=i.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.activeClipUrl=null,this.clipGroup=null,this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(g,f){this.x=g,this.y=f}}let c=0,M=0,I=0;svg.SVGGraphics=SVGGraphics=class{constructor(g,f,C=!1){this.svgFactory=new _display_utils.DOMSVGFactory,this.current=new s,this.transformMatrix=_util.IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=g,this.objs=f,this.pendingClip=null,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts=Object.create(null),this.cssStyle=null,this.forceDataSchema=!!C,this._operatorIdMapping=[];for(const v in _util.OPS)this._operatorIdMapping[_util.OPS[v]]=v}save(){this.transformStack.push(this.transformMatrix);const g=this.current;this.extraStack.push(g),this.current=g.clone()}restore(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.pendingClip=null,this.tgrp=null}group(g){this.save(),this.executeOpTree(g),this.restore()}loadDependencies(g){const f=g.fnArray,C=g.argsArray;for(let v=0,b=f.length;v{o.get(h,p)});this.current.dependencies.push(d)}return Promise.all(this.current.dependencies)}transform(g,f,C,v,b,h){const o=[g,f,C,v,b,h];this.transformMatrix=_util.Util.transform(this.transformMatrix,o),this.tgrp=null}getSVG(g,f){this.viewport=f;const C=this._initialize(f);return this.loadDependencies(g).then(()=>(this.transformMatrix=_util.IDENTITY_MATRIX,this.executeOpTree(this.convertOpList(g)),C))}convertOpList(g){const f=this._operatorIdMapping,C=g.argsArray,v=g.fnArray,b=[];for(let h=0,o=v.length;h0&&(this.current.lineWidth=g)}setLineCap(g){this.current.lineCap=t[g]}setLineJoin(g){this.current.lineJoin=a[g]}setMiterLimit(g){this.current.miterLimit=g}setStrokeAlpha(g){this.current.strokeAlpha=g}setStrokeRGBColor(g,f,C){this.current.strokeColor=_util.Util.makeCssRgb(g,f,C)}setFillAlpha(g){this.current.fillAlpha=g}setFillRGBColor(g,f,C){this.current.fillColor=_util.Util.makeCssRgb(g,f,C),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(g){this.current.strokeColor=this._makeColorN_Pattern(g)}setFillColorN(g){this.current.fillColor=this._makeColorN_Pattern(g)}shadingFill(g){const f=this.viewport.width,C=this.viewport.height,v=_util.Util.inverseTransform(this.transformMatrix),b=_util.Util.applyTransform([0,0],v),h=_util.Util.applyTransform([0,C],v),o=_util.Util.applyTransform([f,0],v),d=_util.Util.applyTransform([f,C],v),p=Math.min(b[0],h[0],o[0],d[0]),w=Math.min(b[1],h[1],o[1],d[1]),x=Math.max(b[0],h[0],o[0],d[0]),D=Math.max(b[1],h[1],o[1],d[1]),T=this.svgFactory.createElement("svg:rect");T.setAttributeNS(null,"x",p),T.setAttributeNS(null,"y",w),T.setAttributeNS(null,"width",x-p),T.setAttributeNS(null,"height",D-w),T.setAttributeNS(null,"fill",this._makeShadingPattern(g)),this.current.fillAlpha<1&&T.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(T)}_makeColorN_Pattern(g){return g[0]==="TilingPattern"?this._makeTilingPattern(g):this._makeShadingPattern(g)}_makeTilingPattern(g){const f=g[1],C=g[2],v=g[3]||_util.IDENTITY_MATRIX,[b,h,o,d]=g[4],p=g[5],w=g[6],x=g[7],D=`shading${I++}`,[T,P]=_util.Util.applyTransform([b,h],v),[E,B]=_util.Util.applyTransform([o,d],v),[L,O]=_util.Util.singularValueDecompose2dScale(v),k=p*L,j=w*O,A=this.svgFactory.createElement("svg:pattern");A.setAttributeNS(null,"id",D),A.setAttributeNS(null,"patternUnits","userSpaceOnUse"),A.setAttributeNS(null,"width",k),A.setAttributeNS(null,"height",j),A.setAttributeNS(null,"x",`${T}`),A.setAttributeNS(null,"y",`${P}`);const S=this.svg,R=this.transformMatrix,N=this.current.fillColor,U=this.current.strokeColor,F=this.svgFactory.create(E-T,B-P);if(this.svg=F,this.transformMatrix=v,x===2){const G=_util.Util.makeCssRgb(...f);this.current.fillColor=G,this.current.strokeColor=G}return this.executeOpTree(this.convertOpList(C)),this.svg=S,this.transformMatrix=R,this.current.fillColor=N,this.current.strokeColor=U,A.appendChild(F.childNodes[0]),this.defs.appendChild(A),`url(#${D})`}_makeShadingPattern(g){switch(g[0]){case"RadialAxial":const f=`shading${I++}`,C=g[3];let v;switch(g[1]){case"axial":const b=g[4],h=g[5];v=this.svgFactory.createElement("svg:linearGradient"),v.setAttributeNS(null,"id",f),v.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),v.setAttributeNS(null,"x1",b[0]),v.setAttributeNS(null,"y1",b[1]),v.setAttributeNS(null,"x2",h[0]),v.setAttributeNS(null,"y2",h[1]);break;case"radial":const o=g[4],d=g[5],p=g[6],w=g[7];v=this.svgFactory.createElement("svg:radialGradient"),v.setAttributeNS(null,"id",f),v.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),v.setAttributeNS(null,"cx",d[0]),v.setAttributeNS(null,"cy",d[1]),v.setAttributeNS(null,"r",w),v.setAttributeNS(null,"fx",o[0]),v.setAttributeNS(null,"fy",o[1]),v.setAttributeNS(null,"fr",p);break;default:throw new Error(`Unknown RadialAxial type: ${g[1]}`)}for(const b of C){const h=this.svgFactory.createElement("svg:stop");h.setAttributeNS(null,"offset",b[0]),h.setAttributeNS(null,"stop-color",b[1]),v.appendChild(h)}return this.defs.appendChild(v),`url(#${f})`;case"Mesh":return(0,_util.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${g[0]}`)}}setDash(g,f){this.current.dashArray=g,this.current.dashPhase=f}constructPath(g,f){const C=this.current;let v=C.x,b=C.y,h=[],o=0;for(const d of g)switch(d|0){case _util.OPS.rectangle:v=f[o++],b=f[o++];const p=f[o++],w=f[o++],x=v+p,D=b+w;h.push("M",l(v),l(b),"L",l(x),l(b),"L",l(x),l(D),"L",l(v),l(D),"Z");break;case _util.OPS.moveTo:v=f[o++],b=f[o++],h.push("M",l(v),l(b));break;case _util.OPS.lineTo:v=f[o++],b=f[o++],h.push("L",l(v),l(b));break;case _util.OPS.curveTo:v=f[o+4],b=f[o+5],h.push("C",l(f[o]),l(f[o+1]),l(f[o+2]),l(f[o+3]),l(v),l(b)),o+=6;break;case _util.OPS.curveTo2:h.push("C",l(v),l(b),l(f[o]),l(f[o+1]),l(f[o+2]),l(f[o+3])),v=f[o+2],b=f[o+3],o+=4;break;case _util.OPS.curveTo3:v=f[o+2],b=f[o+3],h.push("C",l(f[o]),l(f[o+1]),l(v),l(b),l(v),l(b)),o+=4;break;case _util.OPS.closePath:h.push("Z");break}h=h.join(" "),C.path&&g.length>0&&g[0]!==_util.OPS.rectangle&&g[0]!==_util.OPS.moveTo?h=C.path.getAttributeNS(null,"d")+h:(C.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(C.path)),C.path.setAttributeNS(null,"d",h),C.path.setAttributeNS(null,"fill","none"),C.element=C.path,C.setCurrentPoint(v,b)}endPath(){const g=this.current;if(g.path=null,!this.pendingClip)return;if(!g.element){this.pendingClip=null;return}const f=`clippath${c++}`,C=this.svgFactory.createElement("svg:clipPath");C.setAttributeNS(null,"id",f),C.setAttributeNS(null,"transform",y(this.transformMatrix));const v=g.element.cloneNode(!0);this.pendingClip==="evenodd"?v.setAttributeNS(null,"clip-rule","evenodd"):v.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,C.appendChild(v),this.defs.appendChild(C),g.activeClipUrl&&(g.clipGroup=null,this.extraStack.forEach(function(b){b.clipGroup=null}),C.setAttributeNS(null,"clip-path",g.activeClipUrl)),g.activeClipUrl=`url(#${f})`,this.tgrp=null}clip(g){this.pendingClip=g}closePath(){const g=this.current;if(g.path){const f=`${g.path.getAttributeNS(null,"d")}Z`;g.path.setAttributeNS(null,"d",f)}}setLeading(g){this.current.leading=-g}setTextRise(g){this.current.textRise=g}setTextRenderingMode(g){this.current.textRenderingMode=g}setHScale(g){this.current.textHScale=g/100}setRenderingIntent(g){}setFlatness(g){}setGState(g){for(const[f,C]of g)switch(f){case"LW":this.setLineWidth(C);break;case"LC":this.setLineCap(C);break;case"LJ":this.setLineJoin(C);break;case"ML":this.setMiterLimit(C);break;case"D":this.setDash(C[0],C[1]);break;case"RI":this.setRenderingIntent(C);break;case"FL":this.setFlatness(C);break;case"Font":this.setFont(C);break;case"CA":this.setStrokeAlpha(C);break;case"ca":this.setFillAlpha(C);break;default:(0,_util.warn)(`Unimplemented graphic state operator ${f}`);break}}fill(){const g=this.current;g.element&&(g.element.setAttributeNS(null,"fill",g.fillColor),g.element.setAttributeNS(null,"fill-opacity",g.fillAlpha),this.endPath())}stroke(){const g=this.current;g.element&&(this._setStrokeAttributes(g.element),g.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(g,f=1){const C=this.current;let v=C.dashArray;f!==1&&v.length>0&&(v=v.map(function(b){return f*b})),g.setAttributeNS(null,"stroke",C.strokeColor),g.setAttributeNS(null,"stroke-opacity",C.strokeAlpha),g.setAttributeNS(null,"stroke-miterlimit",l(C.miterLimit)),g.setAttributeNS(null,"stroke-linecap",C.lineCap),g.setAttributeNS(null,"stroke-linejoin",C.lineJoin),g.setAttributeNS(null,"stroke-width",l(f*C.lineWidth)+"px"),g.setAttributeNS(null,"stroke-dasharray",v.map(l).join(" ")),g.setAttributeNS(null,"stroke-dashoffset",l(f*C.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const g=this.svgFactory.createElement("svg:rect");g.setAttributeNS(null,"x","0"),g.setAttributeNS(null,"y","0"),g.setAttributeNS(null,"width","1px"),g.setAttributeNS(null,"height","1px"),g.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(g)}paintImageXObject(g){const f=g.startsWith("g_")?this.commonObjs.get(g):this.objs.get(g);if(!f){(0,_util.warn)(`Dependent image with object ID ${g} is not ready yet`);return}this.paintInlineImageXObject(f)}paintInlineImageXObject(g,f){const C=g.width,v=g.height,b=r(g,this.forceDataSchema,!!f),h=this.svgFactory.createElement("svg:rect");h.setAttributeNS(null,"x","0"),h.setAttributeNS(null,"y","0"),h.setAttributeNS(null,"width",l(C)),h.setAttributeNS(null,"height",l(v)),this.current.element=h,this.clip("nonzero");const o=this.svgFactory.createElement("svg:image");o.setAttributeNS(n,"xlink:href",b),o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y",l(-v)),o.setAttributeNS(null,"width",l(C)+"px"),o.setAttributeNS(null,"height",l(v)+"px"),o.setAttributeNS(null,"transform",`scale(${l(1/C)} ${l(-1/v)})`),f?f.appendChild(o):this._ensureTransformGroup().appendChild(o)}paintImageMaskXObject(g){const f=this.current,C=g.width,v=g.height,b=f.fillColor;f.maskId=`mask${M++}`;const h=this.svgFactory.createElement("svg:mask");h.setAttributeNS(null,"id",f.maskId);const o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",l(C)),o.setAttributeNS(null,"height",l(v)),o.setAttributeNS(null,"fill",b),o.setAttributeNS(null,"mask",`url(#${f.maskId})`),this.defs.appendChild(h),this._ensureTransformGroup().appendChild(o),this.paintInlineImageXObject(g,h)}paintFormXObjectBegin(g,f){if(Array.isArray(g)&&g.length===6&&this.transform(g[0],g[1],g[2],g[3],g[4],g[5]),f){const C=f[2]-f[0],v=f[3]-f[1],b=this.svgFactory.createElement("svg:rect");b.setAttributeNS(null,"x",f[0]),b.setAttributeNS(null,"y",f[1]),b.setAttributeNS(null,"width",l(C)),b.setAttributeNS(null,"height",l(v)),this.current.element=b,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(g){const f=this.svgFactory.create(g.width,g.height),C=this.svgFactory.createElement("svg:defs");f.appendChild(C),this.defs=C;const v=this.svgFactory.createElement("svg:g");return v.setAttributeNS(null,"transform",y(g.transform)),f.appendChild(v),this.svg=v,f}_ensureClipGroup(){if(!this.current.clipGroup){const g=this.svgFactory.createElement("svg:g");g.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(g),this.current.clipGroup=g}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",y(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}}var network={},network_utils={},content_disposition={},hasRequiredContent_disposition;function requireContent_disposition(){if(hasRequiredContent_disposition)return content_disposition;hasRequiredContent_disposition=1,Object.defineProperty(content_disposition,"__esModule",{value:!0}),content_disposition.getFilenameFromContentDispositionHeader=i;function i(e){let n=!0,t=a("filename\\*","i").exec(e);if(t){t=t[1];let M=l(t);return M=unescape(M),M=y(M),M=c(M),s(M)}if(t=u(e),t){const M=c(t);return s(M)}if(t=a("filename","i").exec(e),t){t=t[1];let M=l(t);return M=c(M),s(M)}function a(M,I){return new RegExp("(?:^|;)\\s*"+M+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',I)}function r(M,I){if(M){if(!/^[\x00-\xFF]+$/.test(I))return I;try{const m=new TextDecoder(M,{fatal:!0}),g=Array.from(I,function(f){return f.charCodeAt(0)&255});I=m.decode(new Uint8Array(g)),n=!1}catch{if(/^utf-?8$/i.test(M))try{I=decodeURIComponent(escape(I)),n=!1}catch{}}}return I}function s(M){return n&&/[\x80-\xff]/.test(M)&&(M=r("utf-8",M),n&&(M=r("iso-8859-1",M))),M}function u(M){const I=[];let m;const g=a("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(m=g.exec(M))!==null;){let[,C,v,b]=m;if(C=parseInt(C,10),C in I){if(C===0)break;continue}I[C]=[v,b]}const f=[];for(let C=0;C0,"Range chunk size must be larger than zero");const c={allowRangeRequests:!1,suggestedLength:void 0},M=parseInt(s("Content-Length"),10);return!Number.isInteger(M)||(c.suggestedLength=M,M<=2*l)||y||!u||s("Accept-Ranges")!=="bytes"||(s("Content-Encoding")||"identity")!=="identity"||(c.allowRangeRequests=!0),c}function t(s){const u=s("Content-Disposition");if(u){let l=(0,e.getFilenameFromContentDispositionHeader)(u);if(l.includes("%"))try{l=decodeURIComponent(l)}catch{}if(/\.pdf$/i.test(l))return l}return null}function a(s,u){return s===404||s===0&&u.startsWith("file:")?new i.MissingPDFException('Missing PDF "'+u+'".'):new i.UnexpectedResponseException("Unexpected server response ("+s+') while retrieving PDF "'+u+'".',s)}function r(s){return s===200||s===206}return network_utils}var hasRequiredNetwork;function requireNetwork(){if(hasRequiredNetwork)return network;hasRequiredNetwork=1,Object.defineProperty(network,"__esModule",{value:!0}),network.PDFNetworkStream=void 0;var i=util,e=requireNetwork_utils();const n=200,t=206;function a(y){const c=y.response;return typeof c!="string"?c:(0,i.stringToBytes)(c).buffer}class r{constructor(c,M){this.url=c,M=M||{},this.isHttp=/^https?:/i.test(c),this.httpHeaders=this.isHttp&&M.httpHeaders||{},this.withCredentials=M.withCredentials||!1,this.getXhr=M.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(c,M,I){const m={begin:c,end:M};for(const g in I)m[g]=I[g];return this.request(m)}requestFull(c){return this.request(c)}request(c){const M=this.getXhr(),I=this.currXhrId++,m=this.pendingRequests[I]={xhr:M};M.open("GET",this.url),M.withCredentials=this.withCredentials;for(const g in this.httpHeaders){const f=this.httpHeaders[g];typeof f>"u"||M.setRequestHeader(g,f)}return this.isHttp&&"begin"in c&&"end"in c?(M.setRequestHeader("Range",`bytes=${c.begin}-${c.end-1}`),m.expectedStatus=t):m.expectedStatus=n,M.responseType="arraybuffer",c.onError&&(M.onerror=function(g){c.onError(M.status)}),M.onreadystatechange=this.onStateChange.bind(this,I),M.onprogress=this.onProgress.bind(this,I),m.onHeadersReceived=c.onHeadersReceived,m.onDone=c.onDone,m.onError=c.onError,m.onProgress=c.onProgress,M.send(null),I}onProgress(c,M){const I=this.pendingRequests[c];I&&I.onProgress&&I.onProgress(M)}onStateChange(c,M){const I=this.pendingRequests[c];if(!I)return;const m=I.xhr;if(m.readyState>=2&&I.onHeadersReceived&&(I.onHeadersReceived(),delete I.onHeadersReceived),m.readyState!==4||!(c in this.pendingRequests))return;if(delete this.pendingRequests[c],m.status===0&&this.isHttp){I.onError&&I.onError(m.status);return}const g=m.status||n;if(!(g===n&&I.expectedStatus===t)&&g!==I.expectedStatus){I.onError&&I.onError(m.status);return}const C=a(m);if(g===t){const v=m.getResponseHeader("Content-Range"),b=/bytes (\d+)-(\d+)\/(\d+)/.exec(v);I.onDone({begin:parseInt(b[1],10),chunk:C})}else C?I.onDone({begin:0,chunk:C}):I.onError&&I.onError(m.status)}getRequestXhr(c){return this.pendingRequests[c].xhr}isPendingRequest(c){return c in this.pendingRequests}abortRequest(c){const M=this.pendingRequests[c].xhr;delete this.pendingRequests[c],M.abort()}}class s{constructor(c){this._source=c,this._manager=new r(c.url,{httpHeaders:c.httpHeaders,withCredentials:c.withCredentials}),this._rangeChunkSize=c.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(c){const M=this._rangeRequestReaders.indexOf(c);M>=0&&this._rangeRequestReaders.splice(M,1)}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new u(this._manager,this._source),this._fullRequestReader}getRangeReader(c,M){const I=new l(this._manager,c,M);return I.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(I),I}cancelAllRequests(c){this._fullRequestReader&&this._fullRequestReader.cancel(c),this._rangeRequestReaders.slice(0).forEach(function(I){I.cancel(c)})}}network.PDFNetworkStream=s;class u{constructor(c,M){this._manager=c;const I={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=M.url,this._fullRequestId=c.requestFull(I),this._headersReceivedCapability=(0,i.createPromiseCapability)(),this._disableRange=M.disableRange||!1,this._contentLength=M.length,this._rangeChunkSize=M.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 c=this._fullRequestId,M=this._manager.getRequestXhr(c),I=f=>M.getResponseHeader(f),{allowRangeRequests:m,suggestedLength:g}=(0,e.validateRangeRequestCapabilities)({getResponseHeader:I,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});m&&(this._isRangeSupported=!0),this._contentLength=g||this._contentLength,this._filename=(0,e.extractFilenameFromHeader)(I),this._isRangeSupported&&this._manager.abortRequest(c),this._headersReceivedCapability.resolve()}_onDone(c){c&&(this._requests.length>0?this._requests.shift().resolve({value:c.chunk,done:!1}):this._cachedChunks.push(c.chunk)),this._done=!0,!(this._cachedChunks.length>0)&&(this._requests.forEach(function(M){M.resolve({value:void 0,done:!0})}),this._requests=[])}_onError(c){const M=this._url,I=(0,e.createResponseStatusError)(c,M);this._storedError=I,this._headersReceivedCapability.reject(I),this._requests.forEach(function(m){m.reject(I)}),this._requests=[],this._cachedChunks=[]}_onProgress(c){this.onProgress&&this.onProgress({loaded:c.loaded,total:c.lengthComputable?c.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 c=(0,i.createPromiseCapability)();return this._requests.push(c),c.promise}cancel(c){this._done=!0,this._headersReceivedCapability.reject(c),this._requests.forEach(function(M){M.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class l{constructor(c,M,I){this._manager=c;const m={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=c.requestRange(M,I,m),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}_close(){this.onClosed&&this.onClosed(this)}_onDone(c){const M=c.chunk;this._requests.length>0?this._requests.shift().resolve({value:M,done:!1}):this._queuedChunk=M,this._done=!0,this._requests.forEach(function(I){I.resolve({value:void 0,done:!0})}),this._requests=[],this._close()}_onProgress(c){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:c.loaded})}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk!==null){const M=this._queuedChunk;return this._queuedChunk=null,{value:M,done:!1}}if(this._done)return{value:void 0,done:!0};const c=(0,i.createPromiseCapability)();return this._requests.push(c),c.promise}cancel(c){this._done=!0,this._requests.forEach(function(M){M.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}return network}var fetch_stream={},hasRequiredFetch_stream;function requireFetch_stream(){if(hasRequiredFetch_stream)return fetch_stream;hasRequiredFetch_stream=1,Object.defineProperty(fetch_stream,"__esModule",{value:!0}),fetch_stream.PDFFetchStream=void 0;var i=util,e=requireNetwork_utils();function n(u,l,y){return{method:"GET",headers:u,signal:y&&y.signal,mode:"cors",credentials:l?"include":"same-origin",redirect:"follow"}}function t(u){const l=new Headers;for(const y in u){const c=u[y];typeof c>"u"||l.append(y,c)}return l}class a{constructor(l){this.source=l,this.isHttp=/^https?:/i.test(l.url),this.httpHeaders=this.isHttp&&l.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new r(this),this._fullRequestReader}getRangeReader(l,y){if(y<=this._progressiveDataLength)return null;const c=new s(this,l,y);return this._rangeRequestReaders.push(c),c}cancelAllRequests(l){this._fullRequestReader&&this._fullRequestReader.cancel(l),this._rangeRequestReaders.slice(0).forEach(function(c){c.cancel(l)})}}fetch_stream.PDFFetchStream=a;class r{constructor(l){this._stream=l,this._reader=null,this._loaded=0,this._filename=null;const y=l.source;this._withCredentials=y.withCredentials||!1,this._contentLength=y.length,this._headersCapability=(0,i.createPromiseCapability)(),this._disableRange=y.disableRange||!1,this._rangeChunkSize=y.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),typeof AbortController<"u"&&(this._abortController=new AbortController),this._isStreamingSupported=!y.disableStream,this._isRangeSupported=!y.disableRange,this._headers=t(this._stream.httpHeaders);const c=y.url;fetch(c,n(this._headers,this._withCredentials,this._abortController)).then(M=>{if(!(0,e.validateResponseStatus)(M.status))throw(0,e.createResponseStatusError)(M.status,c);this._reader=M.body.getReader(),this._headersCapability.resolve();const I=f=>M.headers.get(f),{allowRangeRequests:m,suggestedLength:g}=(0,e.validateRangeRequestCapabilities)({getResponseHeader:I,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=m,this._contentLength=g||this._contentLength,this._filename=(0,e.extractFilenameFromHeader)(I),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new i.AbortException("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(){await this._headersCapability.promise;const{value:l,done:y}=await this._reader.read();return y?{value:l,done:y}:(this._loaded+=l.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(l).buffer,done:!1})}cancel(l){this._reader&&this._reader.cancel(l),this._abortController&&this._abortController.abort()}}class s{constructor(l,y,c){this._stream=l,this._reader=null,this._loaded=0;const M=l.source;this._withCredentials=M.withCredentials||!1,this._readCapability=(0,i.createPromiseCapability)(),this._isStreamingSupported=!M.disableStream,typeof AbortController<"u"&&(this._abortController=new AbortController),this._headers=t(this._stream.httpHeaders),this._headers.append("Range",`bytes=${y}-${c-1}`);const I=M.url;fetch(I,n(this._headers,this._withCredentials,this._abortController)).then(m=>{if(!(0,e.validateResponseStatus)(m.status))throw(0,e.createResponseStatusError)(m.status,I);this._readCapability.resolve(),this._reader=m.body.getReader()}).catch(m=>{if(!(m&&m.name==="AbortError"))throw m}),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:l,done:y}=await this._reader.read();return y?{value:l,done:y}:(this._loaded+=l.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(l).buffer,done:!1})}cancel(l){this._reader&&this._reader.cancel(l),this._abortController&&this._abortController.abort()}}return fetch_stream}var node_stream={},hasRequiredNode_stream;function requireNode_stream(){if(hasRequiredNode_stream)return node_stream;hasRequiredNode_stream=1,Object.defineProperty(node_stream,"__esModule",{value:!0}),node_stream.PDFNodeStream=void 0;var i=util,e=requireNetwork_utils();const n=require$$2,t=streamHttp,a=httpsBrowserifyExports,r=urlExports,s=/^file:\/\/\/[a-zA-Z]:\//;function u(C){const v=r.parse(C);return v.protocol==="file:"||v.host?v:/^[a-z]:[/\\]/i.test(C)?r.parse(`file:///${C}`):(v.host||(v.protocol="file:"),v)}class l{constructor(v){this.source=v,this.url=u(v.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&v.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new g(this):new I(this),this._fullRequestReader}getRangeReader(v,b){if(b<=this._progressiveDataLength)return null;const h=this.isFsUrl?new f(this,v,b):new m(this,v,b);return this._rangeRequestReaders.push(h),h}cancelAllRequests(v){this._fullRequestReader&&this._fullRequestReader.cancel(v),this._rangeRequestReaders.slice(0).forEach(function(h){h.cancel(v)})}}node_stream.PDFNodeStream=l;class y{constructor(v){this._url=v.url,this._done=!1,this._storedError=null,this.onProgress=null;const b=v.source;this._contentLength=b.length,this._loaded=0,this._filename=null,this._disableRange=b.disableRange||!1,this._rangeChunkSize=b.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!b.disableStream,this._isRangeSupported=!b.disableRange,this._readableStream=null,this._readCapability=(0,i.createPromiseCapability)(),this._headersCapability=(0,i.createPromiseCapability)()}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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const v=this._readableStream.read();return v===null?(this._readCapability=(0,i.createPromiseCapability)(),this.read()):(this._loaded+=v.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(v).buffer,done:!1})}cancel(v){if(!this._readableStream){this._error(v);return}this._readableStream.destroy(v)}_error(v){this._storedError=v,this._readCapability.resolve()}_setReadableStream(v){this._readableStream=v,v.on("readable",()=>{this._readCapability.resolve()}),v.on("end",()=>{v.destroy(),this._done=!0,this._readCapability.resolve()}),v.on("error",b=>{this._error(b)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class c{constructor(v){this._url=v.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,i.createPromiseCapability)();const b=v.source;this._isStreamingSupported=!b.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const v=this._readableStream.read();return v===null?(this._readCapability=(0,i.createPromiseCapability)(),this.read()):(this._loaded+=v.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(v).buffer,done:!1})}cancel(v){if(!this._readableStream){this._error(v);return}this._readableStream.destroy(v)}_error(v){this._storedError=v,this._readCapability.resolve()}_setReadableStream(v){this._readableStream=v,v.on("readable",()=>{this._readCapability.resolve()}),v.on("end",()=>{v.destroy(),this._done=!0,this._readCapability.resolve()}),v.on("error",b=>{this._error(b)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function M(C,v){return{protocol:C.protocol,auth:C.auth,host:C.hostname,port:C.port,path:C.path,method:"GET",headers:v}}class I extends y{constructor(v){super(v);const b=h=>{if(h.statusCode===404){const w=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=w,this._headersCapability.reject(w);return}this._headersCapability.resolve(),this._setReadableStream(h);const o=w=>this._readableStream.headers[w.toLowerCase()],{allowRangeRequests:d,suggestedLength:p}=(0,e.validateRangeRequestCapabilities)({getResponseHeader:o,isHttp:v.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=d,this._contentLength=p||this._contentLength,this._filename=(0,e.extractFilenameFromHeader)(o)};this._request=null,this._url.protocol==="http:"?this._request=t.request(M(this._url,v.httpHeaders),b):this._request=a.request(M(this._url,v.httpHeaders),b),this._request.on("error",h=>{this._storedError=h,this._headersCapability.reject(h)}),this._request.end()}}class m extends c{constructor(v,b,h){super(v),this._httpHeaders={};for(const d in v.httpHeaders){const p=v.httpHeaders[d];typeof p>"u"||(this._httpHeaders[d]=p)}this._httpHeaders.Range=`bytes=${b}-${h-1}`;const o=d=>{if(d.statusCode===404){const p=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=p;return}this._setReadableStream(d)};this._request=null,this._url.protocol==="http:"?this._request=t.request(M(this._url,this._httpHeaders),o):this._request=a.request(M(this._url,this._httpHeaders),o),this._request.on("error",d=>{this._storedError=d}),this._request.end()}}class g extends y{constructor(v){super(v);let b=decodeURIComponent(this._url.path);s.test(this._url.href)&&(b=b.replace(/^\//,"")),n.lstat(b,(h,o)=>{if(h){h.code==="ENOENT"&&(h=new i.MissingPDFException(`Missing PDF "${b}".`)),this._storedError=h,this._headersCapability.reject(h);return}this._contentLength=o.size,this._setReadableStream(n.createReadStream(b)),this._headersCapability.resolve()})}}class f extends c{constructor(v,b,h){super(v);let o=decodeURIComponent(this._url.path);s.test(this._url.href)&&(o=o.replace(/^\//,"")),this._setReadableStream(n.createReadStream(o,{start:b,end:h-1}))}}return node_stream}(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addLinkAttributes",{enumerable:!0,get:function(){return e.addLinkAttributes}}),Object.defineProperty(i,"getFilenameFromUrl",{enumerable:!0,get:function(){return e.getFilenameFromUrl}}),Object.defineProperty(i,"LinkTarget",{enumerable:!0,get:function(){return e.LinkTarget}}),Object.defineProperty(i,"loadScript",{enumerable:!0,get:function(){return e.loadScript}}),Object.defineProperty(i,"PDFDateString",{enumerable:!0,get:function(){return e.PDFDateString}}),Object.defineProperty(i,"RenderingCancelledException",{enumerable:!0,get:function(){return e.RenderingCancelledException}}),Object.defineProperty(i,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(i,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(i,"LoopbackPort",{enumerable:!0,get:function(){return n.LoopbackPort}}),Object.defineProperty(i,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(i,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(i,"version",{enumerable:!0,get:function(){return n.version}}),Object.defineProperty(i,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}}),Object.defineProperty(i,"createObjectURL",{enumerable:!0,get:function(){return t.createObjectURL}}),Object.defineProperty(i,"createPromiseCapability",{enumerable:!0,get:function(){return t.createPromiseCapability}}),Object.defineProperty(i,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}}),Object.defineProperty(i,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),Object.defineProperty(i,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}}),Object.defineProperty(i,"OPS",{enumerable:!0,get:function(){return t.OPS}}),Object.defineProperty(i,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}}),Object.defineProperty(i,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}}),Object.defineProperty(i,"removeNullCharacters",{enumerable:!0,get:function(){return t.removeNullCharacters}}),Object.defineProperty(i,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(i,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}}),Object.defineProperty(i,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return t.UNSUPPORTED_FEATURES}}),Object.defineProperty(i,"Util",{enumerable:!0,get:function(){return t.Util}}),Object.defineProperty(i,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}}),Object.defineProperty(i,"AnnotationLayer",{enumerable:!0,get:function(){return a.AnnotationLayer}}),Object.defineProperty(i,"apiCompatibilityParams",{enumerable:!0,get:function(){return r.apiCompatibilityParams}}),Object.defineProperty(i,"GlobalWorkerOptions",{enumerable:!0,get:function(){return s.GlobalWorkerOptions}}),Object.defineProperty(i,"renderTextLayer",{enumerable:!0,get:function(){return u.renderTextLayer}}),Object.defineProperty(i,"SVGGraphics",{enumerable:!0,get:function(){return l.SVGGraphics}});var e=display_utils,n=api,t=util,a=annotation_layer,r=api_compatibility,s=worker_options,u=text_layer,l=svg;{const{isNodeJS:y}=is_node;if(y){const c=requireNode_stream().PDFNodeStream;(0,n.setPDFNetworkStreamFactory)(M=>new c(M))}else{const c=requireNetwork().PDFNetworkStream;let M;(0,e.isFetchSupported)()&&(M=requireFetch_stream().PDFFetchStream),(0,n.setPDFNetworkStreamFactory)(I=>M&&(0,e.isValidFetchUrl)(I.url)?new M(I):new c(I))}}})(pdf);Object.defineProperty(text_layer_builder,"__esModule",{value:!0});text_layer_builder.DefaultTextLayerFactory=TextLayerBuilder_1=text_layer_builder.TextLayerBuilder=void 0;var _pdf=pdf;const EXPAND_DIVS_TIMEOUT=300;class TextLayerBuilder{constructor({textLayerDiv:e,eventBus:n,pageIndex:t,viewport:a,findController:r=null,enhanceTextSelection:s=!1}){this.textLayerDiv=e,this.eventBus=n,this.textContent=null,this.textContentItemsStr=[],this.textContentStream=null,this.renderingDone=!1,this.pageIdx=t,this.pageNumber=this.pageIdx+1,this.matches=[],this.viewport=a,this.textDivs=[],this.findController=r,this.textLayerRenderTask=null,this.enhanceTextSelection=s,this._onUpdateTextLayerMatches=null,this._bindMouse()}_finishRendering(){if(this.renderingDone=!0,!this.enhanceTextSelection){const e=document.createElement("div");e.className="endOfContent",this.textLayerDiv.appendChild(e)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})}render(e=0){if(!(this.textContent||this.textContentStream)||this.renderingDone)return;this.cancel(),this.textDivs=[];const n=document.createDocumentFragment();this.textLayerRenderTask=(0,_pdf.renderTextLayer)({textContent:this.textContent,textContentStream:this.textContentStream,container:n,viewport:this.viewport,textDivs:this.textDivs,textContentItemsStr:this.textContentItemsStr,timeout:e,enhanceTextSelection:this.enhanceTextSelection}),this.textLayerRenderTask.promise.then(()=>{this.textLayerDiv.appendChild(n),this._finishRendering(),this._updateMatches()},function(t){}),this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=t=>{(t.pageIndex===this.pageIdx||t.pageIndex===-1)&&this._updateMatches()},this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches))}cancel(){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this._onUpdateTextLayerMatches&&(this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null)}setTextContentStream(e){this.cancel(),this.textContentStream=e}setTextContent(e){this.cancel(),this.textContent=e}_convertMatches(e,n){if(!e)return[];const{findController:t,textContentItemsStr:a}=this;let r=0,s=0;const u=a.length-1,l=t.state.query.length,y=[];for(let c=0,M=e.length;c=s+a[r].length;)s+=a[r].length,r++;r===a.length&&console.error("Could not find a matching mapping");const m={begin:{divIdx:r,offset:I-s}};for(n?I+=n[c]:I+=l;r!==u&&I>s+a[r].length;)s+=a[r].length,r++;m.end={divIdx:r,offset:I-s},y.push(m)}return y}_renderMatches(e){if(e.length===0)return;const{findController:n,pageIdx:t,textContentItemsStr:a,textDivs:r}=this,s=t===n.selected.pageIdx,u=n.selected.matchIdx,l=n.state.highlightAll;let y=null;const c={divIdx:-1,offset:void 0};function M(f,C){const v=f.divIdx;r[v].textContent="",I(v,0,f.offset,C)}function I(f,C,v,b){const h=r[f],o=a[f].substring(C,v),d=document.createTextNode(o);if(b){const p=document.createElement("span");p.className=b,p.appendChild(d),h.appendChild(p);return}h.appendChild(d)}let m=u,g=m+1;if(l)m=0,g=e.length;else if(!s)return;for(let f=m;f{if(this.enhanceTextSelection&&this.textLayerRenderTask){this.textLayerRenderTask.expandTextDivs(!0),n&&(clearTimeout(n),n=null);return}const a=e.querySelector(".endOfContent");if(!a)return;let r=t.target!==e;if(r=r&&window.getComputedStyle(a).getPropertyValue("-moz-user-select")!=="none",r){const s=e.getBoundingClientRect(),u=Math.max(0,(t.pageY-s.top)/s.height);a.style.top=(u*100).toFixed(2)+"%"}a.classList.add("active")}),e.addEventListener("mouseup",()=>{if(this.enhanceTextSelection&&this.textLayerRenderTask){n=setTimeout(()=>{this.textLayerRenderTask&&this.textLayerRenderTask.expandTextDivs(!1),n=null},EXPAND_DIVS_TIMEOUT);return}const t=e.querySelector(".endOfContent");t&&(t.style.top="",t.classList.remove("active"))})}}var TextLayerBuilder_1=text_layer_builder.TextLayerBuilder=TextLayerBuilder;class DefaultTextLayerFactory{createTextLayerBuilder(e,n,t,a=!1,r){return new TextLayerBuilder({textLayerDiv:e,pageIndex:n,viewport:t,enhanceTextSelection:a,eventBus:r})}}text_layer_builder.DefaultTextLayerFactory=DefaultTextLayerFactory;const PdfViewerTextLayer=({className:i,loadedPage:e,scale:n=1,setRenderedText:t=()=>{}})=>{var y,c;const a=reactExports.useRef(null),r=a.current,s=useAsyncFunctionCall(reactExports.useCallback(async()=>{if(e){const M=e.getViewport({scale:n});return{textContent:await e.getTextContent(),viewport:M,page:e.pageNumber,scale:n}}return null},[e,n])),u=useAsyncFunctionCall(reactExports.useCallback(async M=>{if(r&&s){const{textContent:I,viewport:m,scale:g,page:f}=s,C=new TextLayerBuilder_1({textLayerDiv:r,viewport:m,eventBus:new EventBus_1,pageIndex:f-1});return M.addEventListener("abort",()=>C.cancel()),await _renderTextLayer(C,I,r,g),{textContent:I,viewport:m,page:f,textDivs:C.textDivs}}},[s,r]));reactExports.useEffect(()=>{u!==void 0&&t(u)},[u,t]);const l=cx(i,"textLayer");return jsxRuntimeExports.jsx("div",{className:l,ref:a,style:{width:`${((y=s==null?void 0:s.viewport)==null?void 0:y.width)??0}px`,height:`${((c=s==null?void 0:s.viewport)==null?void 0:c.height)??0}px`}})};async function _renderTextLayer(i,e,n,t){i.setTextContent(e),n.innerHTML="";const a=new Promise(r=>{const s=()=>{r(),i==null||i.eventBus.off("textlayerrendered",s)};i==null||i.eventBus.on("textlayerrendered",s)});i.render(),await a,_adjustTextDivs(i.textDivs,e.items,t)}function _adjustTextDivs(i,e,n){const t=/scaleX\(([\d.]+)\)/;(i||[]).forEach((a,r)=>{const s=e==null?void 0:e[r];if(!s)return;const u=s.width*n,l=a.getBoundingClientRect().width;function y(M){var m;const I=(m=M.style.transform)==null?void 0:m.match(t);return I?parseFloat(I[1]):null}const c=y(a);if(c&&!isNaN(c)){const M=`scaleX(${u/l*c})`;a.style.transform=a.style.transform.replace(t,M)}else{const M=`scaleX(${u/l})`;a.style.transform=M}})}try{PdfViewerTextLayer.displayName="PdfViewerTextLayer",PdfViewerTextLayer.__docgenInfo={description:"",displayName:"PdfViewerTextLayer",props:{scale:{defaultValue:{value:"1"},description:"Zoom factor, where `1` is equal to 100%",name:"scale",required:!1,type:{name:"number"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},loadedPage:{defaultValue:null,description:"PDF page from pdfjs",name:"loadedPage",required:!0,type:{name:"PDFPageProxy | null | undefined"}},setRenderedText:{defaultValue:{value:"() => {}"},description:"Callback for text layer info",name:"setRenderedText",required:!1,type:{name:"((info: PdfRenderedText | null) => any)"}}}}}catch(i){}function toPDFSource(i){return typeof i=="string"||i instanceof ArrayBuffer||ArrayBuffer.isView(i)?{data:i}:i}const PdfViewer=reactExports.forwardRef(({className:i,file:e,page:n,scale:t,document:a,textLayerClassName:r,disableTextLayer:s=!1,setPageCount:u,setLoading:l,setHideToolbarControls:y,setRenderedText:c,setIsPdfRenderError:M,pdfWorkerUrl:I,children:m,...g},f)=>{const C=reactExports.useRef(null),{node:v,setRef:b}=useSafeRef();reactExports.useImperativeHandle(f,()=>v,[v]);const[h,o]=reactExports.useState(null);reactExports.useEffect(()=>{I&&setupPdfjs(I)},[I]);const d=useAsyncFunctionCall(reactExports.useCallback(async()=>{try{var P=e?await _loadPdf(e):null;return P}catch(E){return M==null||M(!0),console.error(`Failed to load pdf file: ${E}`),null}},[e,M])),p=useAsyncFunctionCall(reactExports.useCallback(async()=>{try{return d&&n>0?await _loadPage(d,n):null}catch(P){return console.error(`Failed to load pdf page ${n}: ${P}`),null}},[d,n])),{width:w}=useSize(v);reactExports.useEffect(()=>{o(getCanvasInfo(p,t,w))},[p,t,w]),useAsyncFunctionCall(reactExports.useCallback(async P=>{if(p&&!p.then&&h){const E=_renderPage(p,C.current,h);P.addEventListener("abort",()=>E==null?void 0:E.cancel()),await(E==null?void 0:E.promise),l(!1)}},[h,p,l]));const x=usePageCount({loadedFile:d,document:a});reactExports.useEffect(()=>{u&&x!==null&&u(x)},[x,u]),reactExports.useEffect(()=>{y&&y(!1)},[y]);const D=(h==null?void 0:h.fitToWidthRatio)||1,T=`${settings_1.prefix}--document-preview-pdf-viewer`;return jsxRuntimeExports.jsx("div",{ref:b,className:cx(T,i),...g,children:jsxRuntimeExports.jsxs("div",{className:`${T}__wrapper`,children:[jsxRuntimeExports.jsx("canvas",{ref:C,className:`${T}__canvas`,style:{width:`${(h==null?void 0:h.width)??0}px`,height:`${(h==null?void 0:h.height)??0}px`},width:h==null?void 0:h.canvasWidth,height:h==null?void 0:h.canvasHeight}),!s&&jsxRuntimeExports.jsx(PdfViewerTextLayer,{className:cx(`${T}__text`,r),loadedPage:p,scale:t*D,setRenderedText:c}),typeof m=="function"?m({fitToWidthRatio:D}):m]})})});PdfViewer.defaultProps={page:1,scale:1};function usePageCount({loadedFile:i,document:e}){const n=reactExports.useMemo(()=>{const a=getTextMappings(e);if(a){const r=a.text_mappings.length-1;return(a==null?void 0:a.text_mappings[r].page.page_number)??1}return 0},[e]);return reactExports.useMemo(()=>i&&i.numPages>0?i.numPages:n>0?n:null,[i,n])}function _loadPdf(i){const e=toPDFSource(i);return pdfExports.getDocument(e).promise}function _loadPage(i,e){return i.getPage(e)}function _renderPage(i,e,n){const t=e.getContext("2d");return t?(t.resetTransform(),i.render({canvasContext:t,viewport:n.viewport})):null}let currentPdfWorkerUrl=null;function setupPdfjs(i){if(i&&i!==currentPdfWorkerUrl&&typeof Worker<"u"){const e=new Worker(i);setPdfJsGlobalWorkerOptions({workerPort:e}),currentPdfWorkerUrl=i}}function getCanvasInfo(i,e,n){if(i){const t=n*e,a=i.view[2]-i.view[0],r=n/a,s=window.devicePixelRatio??1,u=i.getViewport({scale:e*r*s}),{width:l,height:y}=u,c=y/l,M=t*c;return{width:t,height:M,canvasWidth:l,canvasHeight:y,fitToWidthRatio:r,viewport:u}}return null}try{PdfViewer.displayName="PdfViewer",PdfViewer.__docgenInfo={description:"",displayName:"PdfViewer",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},file:{defaultValue:null,description:'PDF file data as a "binary" string (array buffer) or PDFSource',name:"file",required:!0,type:{name:"DocumentFile"}},document:{defaultValue:null,description:"Optionally takes a query result document for page count calculation",name:"document",required:!1,type:{name:"QueryResult | null"}},textLayerClassName:{defaultValue:null,description:"Text layer class name",name:"textLayerClassName",required:!1,type:{name:"string"}},disableTextLayer:{defaultValue:{value:"false"},description:"Disable the text layer overlay (defaults to `false`)",name:"disableTextLayer",required:!1,type:{name:"boolean"}},setPageCount:{defaultValue:null,description:"Callback invoked with page count, once `file` has been parsed",name:"setPageCount",required:!1,type:{name:"((count: number) => void)"}},setLoading:{defaultValue:null,description:"Check if document is loading",name:"setLoading",required:!0,type:{name:"(loading: boolean) => void"}},setHideToolbarControls:{defaultValue:null,description:"Callback which is invoked with whether to enable/disable toolbar controls",name:"setHideToolbarControls",required:!1,type:{name:"((disabled: boolean) => void)"}},setRenderedText:{defaultValue:null,description:"Callback for text layer info",name:"setRenderedText",required:!1,type:{name:"((info: PdfRenderedText | null) => any)"}},setIsPdfRenderError:{defaultValue:null,description:"Callback any errors on render",name:"setIsPdfRenderError",required:!1,type:{name:"((isError: boolean) => void)"}},pdfWorkerUrl:{defaultValue:null,description:"URL of hosted PDF worker",name:"pdfWorkerUrl",required:!1,type:{name:"string"}},page:{defaultValue:{value:"1"},description:"Page number, starting at 1",name:"page",required:!1,type:{name:"number"}},scale:{defaultValue:{value:"1"},description:"Zoom factor, where `1` is equal to 100%",name:"scale",required:!1,type:{name:"number"}}}}}catch(i){}var isSymbol=isSymbol_1;function baseExtremum$1(i,e,n){for(var t=-1,a=i.length;++t"",regexString:"\0"},SPACES={normal:i=>" ",regexString:"\\s+"},DOUBLE_QUOTE={normal:i=>'"',regexString:`[${["«","»","“","”","„","‟","❝","❞","⹂","〝","〞","〟","""].join("")}]`},QUOTE={normal:i=>"'",regexString:`[${["‹","›","’","❮","❯","‘","‚","‛","❛","❜","❟"].join("")}]`},SURROGATE_PAIR={normal:i=>"_",regexString:"[\uD800-\uDBFF][\uDC00-\uDFFF]"},DIACRITICAL_MARK={normal:i=>"",regexString:"[̀-ͯ]"},DIACRITICAL_MARK_REGEX=new RegExp(DIACRITICAL_MARK.regexString,"g");function normalizeDiacriticalMarks(i,e=!1){const n=i.normalize("NFD").replace(DIACRITICAL_MARK_REGEX,DIACRITICAL_MARK.normal).normalize("NFC");return e&&n.length!==i.length?n.substring(0,i.length).padEnd(i.length," "):n}const NORMALIZATIONS=[NULL_CHAR,SPACES,DOUBLE_QUOTE,QUOTE,SURROGATE_PAIR,DIACRITICAL_MARK].map(i=>({...i,regex:new RegExp(i.regexString,"g")})),NORMALIZATIONS_REGEX=new RegExp(NORMALIZATIONS.map(i=>`(${i.regexString})`).join("|"),"g");function normalizeText(i){const e=NORMALIZATIONS.reduce((n,t)=>n.replace(t.regex,a=>t.normal(a)),i);return normalizeDiacriticalMarks(e)}class TextNormalizer{constructor(e){ne(this,"rawText");ne(this,"normalizedText");ne(this,"normalizationMappings");this.rawText=e;let n="";const t=l=>{n+=normalizeDiacriticalMarks(l,!0)},a=[],r=NORMALIZATIONS_REGEX;let s=0,u=r.exec(this.rawText);for(;u!=null;){const l=u[0];let y=u[0];for(let M=0;Ms){const M=this.rawText.substring(s,u.index);if(c){const I=[s,u.index],m=[n.length,n.length+M.length];a.push({rawSpan:I,normalizedSpan:m}),t(M),s+=M.length}}if(c){const M=y,I=[u.index,u.index+u[0].length],m=[n.length,n.length+M.length];a.push({rawSpan:I,normalizedSpan:m}),t(M),s=r.lastIndex}u=r.exec(this.rawText)}if(s{if(r<0)return r;const s=this.normalizationMappings.findIndex(({rawSpan:l})=>r=0){const{rawSpan:l,normalizedSpan:y}=this.normalizationMappings[s];return mapCharIndexOnSpans(r,{from:l,to:y})}const u=this.normalizationMappings[this.normalizationMappings.length-1];return r-u.rawSpan[END]+u.normalizedSpan[END]};return[a(n),a(t)]}toRaw(e){const[n,t]=e,a=r=>{if(r<0)return r;const s=this.normalizationMappings.findIndex(({normalizedSpan:l})=>r=0){const{rawSpan:l,normalizedSpan:y}=this.normalizationMappings[s];return mapCharIndexOnSpans(r,{from:y,to:l})}const u=this.normalizationMappings[this.normalizationMappings.length-1];return r-u.normalizedSpan[END]+u.rawSpan[END]};return[a(n),a(t)]}normalize(e){return normalizeText(e)}isBlank(e){return e.length===0||e.trim().length===0||!!e.match(/^\s*$/)}}function mapCharIndexOnSpans(i,{from:e,to:n}){return spanLen(e)===spanLen(n)?n[START]+(i-e[START]):n[START]+Math.round((i-e[START])*(spanLen(n)/spanLen(e)))}function optimizeSpanMappings(i){const e=t=>spanLen(t.normalizedSpan)===spanLen(t.rawSpan),n=(t,a)=>a.normalizedSpan[START]-t.normalizedSpan[START]===a.rawSpan[START]-t.rawSpan[START];return i.reduce((t,a)=>{const r=t.length>0?t[t.length-1]:null;return e(a)&&r&&e(r)&&n(r,a)?(r.normalizedSpan[END]=a.normalizedSpan[END],r.rawSpan[END]=a.rawSpan[END],t):(t.push(a),t)},[])}function findLargestIndex(i,e,n,t){if(e-i<1)return null;const a=t?i+Math.floor((e-i)/2):e-1,r=n(a);if(r!=null)if(e-(a+1)>0){const s=findLargestIndex(a+1,e,n,!0);return s||{index:a,value:r}}else return{index:a,value:r};else if(a-i>0){const s=findLargestIndex(i,a,n,!0);return s||null}else return null}const MAX_HISTORY=3;class TextProvider{constructor(e){ne(this,"fieldText");ne(this,"remainingSpans");ne(this,"history",[0]);this.fieldText=e,this.remainingSpans=[[0,e.length]]}getMatches(e,n={}){const{minLength:t=1,maxLength:a=e.length,searchSpan:r}=n,s=findLargestIndex(t,a+1,u=>{const l=u,y=e.substring(0,l),c=[];for(const M of this.remainingSpans){const I=r?spanIntersection(r,M):M;if(spanLen(I)<=0)continue;const[m,g]=I,f=this.fieldText.slice(m,g),C=f.indexOf(y);if(C>=0){const v=m+C,b=v+y.length,h=this.history.map(d=>{const p=v-d;return p>=0?p:Number.MAX_SAFE_INTEGER}),o=M[0]{const p=spanIntersection([b,this.fieldText.length],d);return spanGetText(this.fieldText,p)}).join("")})}}return c.length>0?c:null});return s?s.value:[]}consume(e){const n=[];this.remainingSpans.forEach(a=>{spanIntersects(e,a)?(a[START]!(spanIncludesIndex(e,a)||!this.remainingSpans.some(r=>spanIncludesIndex(r,a))));this.history=t.slice(0,MAX_HISTORY)}}const debugOut$4=Debug("pdf:mapping:MappingSourceTextProvider");function debug$4(...i){debugOut$4==null||debugOut$4.apply(null,i)}class MappingSourceTextProvider{constructor(e){ne(this,"cell");ne(this,"normalizer");ne(this,"provider");this.cell=e,this.normalizer=new TextNormalizer(e.text),this.provider=new TextProvider(this.normalizer.normalizedText)}getMatch(e,n={}){const{minLength:t=1,searchSpan:a}=n,r=this.normalizer.normalize(e),s=a&&this.normalizer.toNormalized(a);debug$4('getMatch "%s", normalized "%s", minLength = %d',e,r,t);const u=this.provider.getMatches(r,{minLength:t,searchSpan:s});debug$4("normalized matches: %o",u);const l=minBy$1(u,I=>I.minHistoryDistance);if(!l)return debug$4("getMatch result: null"),null;const y=this.normalizer.toRaw(l.span),c=this.normalizer.toRaw([l.span[START]-l.skipText.length,l.span[START]]),M={span:y,skipText:spanGetText(this.cell.text,c),score:spanLen(y)-l.minHistoryDistance,approxLenAfterEnd:l.textAfterEnd.length};return debug$4("getMatch result: %o",M),M}consume(e){const n=this.normalizer.toNormalized(e);this.provider.consume(n),debug$4("text span consumed %o",e)}isBlank(e){return this.normalizer.isBlank(e)}}function bboxGetSpanByRatio(i,e,n){const t=spanIntersection([0,e],n);if(e===0||spanLen(t)<=0)return[i[0],i[1],i[0],i[3]];const[a,r]=n,[s,u,l,y]=i,c=l-s,M=s+c/e*a,I=s+c/e*r;return[M,u,I,y]}function isNextToEachOther(i,e){const[t,a,r,s]=i,[u,l,y,c]=e,M=s-a,I=c-l;if(!(M*.8t.text),nextCellIndex:this.cursor}}consume(e){const n=[];if(e<=0)return n;let t=e;const a=[...this.cells];for(;t>0&&this.cursor0){const u=new TextNormalizer(s);return this.current={nextCellIndex:t,normalizer:u,leadingSpaces:r},!0}this.cellProvider.skip()}return this.current=null,!1}getNextInfo(){return{text:this.current.normalizer.normalizedText,index:this.current.nextCellIndex}}consume(e){const n=this.current.normalizer.toRaw([0,e]),t=this.current.leadingSpaces+n[END];return this.current=null,this.cellProvider.consume(t)}skip(){this.current=null,this.cellProvider.skip()}rewind(){this.current=null,this.cellProvider.rewind()}}var baseAssignValue=_baseAssignValue,createAggregator=require_createAggregator(),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,groupBy=createAggregator(function(i,e,n){hasOwnProperty.call(i,n)?i[n].push(e):baseAssignValue(i,n,[e])}),groupBy_1=groupBy;const groupBy$1=getDefaultExportFromCjs(groupBy_1),debugOut$3=Debug("pdf:mapping:TextBoxMapping");function debug$3(...i){debugOut$3==null||debugOut$3.apply(null,i)}class TextBoxMappingImpl{constructor(e){ne(this,"mappingEntryMap");this.mappingEntryMap=groupBy$1(e,n=>n.text.cell.id),Object.values(this.mappingEntryMap).forEach(n=>{n.sort((t,a)=>spanCompare(t.text.span,a.text.span))}),debug$3("TextBoxMapping created"),debug$3(this)}getEntries(e,n){return(this.mappingEntryMap[e.id]||[]).filter(t=>spanIntersects(t.text.span,n))}apply(e,n){const t=n||[0,e.text.length],{cell:a,span:r}=e.getNormalized(),s=r?spanFromSubSpan(r,t):t;debug$3("applying TextBoxMapping"),debug$3(e,t);const l=this.getEntries(a,s).map(y=>{if(y.box){let c;if(equalsSpanText(y.text.cell,y.text.span,e,s))c=spanGetSubSpan(y.text.span,s);else{const M=new TextNormalizer(y.text.cell.text),I=spanGetSubSpan(M.toNormalized(y.text.span),M.toNormalized(s));c=new TextNormalizer(y.box.cell.text).toRaw(I)}return{cell:y.box.cell.getPartial(c),sourceSpan:spanIntersection(y.text.span,s)}}else return{cell:null,sourceSpan:y.text.span}});return debug$3("applying TextBoxMapping - result"),debug$3(l),l}}class TextBoxMappingBuilder{constructor(){ne(this,"mappingEntries",[])}addMapping(e,n){this.mappingEntries.push({text:e,box:n}),debug$3(">> added a new mapping entry (%o) => (cell: %o)",e,e,n==null?void 0:n.cell)}toTextBoxMapping(){return new TextBoxMappingImpl(this.mappingEntries)}}function equalsSpanText(i,e,n,t){const a=i.text.substring(...e),r=n.text.substring(...t);return a===r}const debugOut$2=Debug("pdf:mapping:getTextBoxMapping");function debug$2(...i){debugOut$2==null||debugOut$2.apply(null,i)}function getTextBoxMappings(i,e){debug$2("getTextBoxMapping: enter");const n=new Target(e),t=new Source(i,e),a=new TextBoxMappingBuilder;for(const r of[27,9,3,1])debug$2("getTextBoxMapping: processText with minMatchLength: %d",r),n.processText((s,u,l)=>{if(u.length{const I=y.markSourceAsMapped(M.text);I&&a.addMapping({cell:y.cell,span:I},{cell:M})}),y.markAsMapped())});return a.toTextBoxMapping()}class Target{constructor(e){ne(this,"targetProvider");this.targetProvider=new MappingTargetBoxProvider(e.cells)}processText(e){for(;this.targetProvider.hasNext();){const{index:n,text:t}=this.targetProvider.getNextInfo();debug$2("> find match at index %d, text: %s",n,t);let a=!1;e(n,t,s=>{if(s>0){a=!0;const u=this.targetProvider.consume(s);return debug$2("> raw target cells for matched length: %d",s),debug$2(u),u.map(l=>l.trim()).filter(l=>l.text.length>0)}return[]}),a||this.targetProvider.skip()}this.targetProvider.rewind()}}class Source{constructor(e,n){ne(this,"sourceProviders");ne(this,"targetIndexToSources");this.sourceProviders=e.cells.map(t=>new MappingSourceTextProvider(t)),this.targetIndexToSources=n.cells.map(t=>{const a=e.cells.map((r,s)=>bboxesIntersect(r.bbox,t.bbox)?{cell:r,provider:this.sourceProviders[s]}:null).filter(nonEmpty);return a.some(({cell:r})=>r.isInHtmlBbox)?a.filter(({cell:r})=>r.isInHtmlBbox):a})}findMatch(e,n,t=1){const a=this.targetIndexToSources[e],r=Source.findBestMatch(a,n,t);if(debug$2("> source cell(s) matched: %o",r),!(r!=null&&r.match)||spanLen(r.match.span){const c=l.getMatch(y,{searchSpan:u});return c!=null&&c.span&&l.consume(c.span),debug$2(">> target cell %o to source %o",y,c),c==null?void 0:c.span},markAsMapped:()=>{l.consume(u)}}}static findBestMatch(e,n,t){const a=e.map(l=>{const y=l.provider.getMatch(n,{minLength:t});return{...l,match:y}});let r=0;const s=a.map(l=>{const{match:y}=l,c=y?r+y.skipText.length-spanLen(y.span):Number.MAX_SAFE_INTEGER;return r+=(y==null?void 0:y.approxLenAfterEnd)??0,{...l,cost:c}});return minBy$1(s,l=>l.cost)}}class BaseTextLayoutCell{constructor({parent:e,id:n,pageNum:t,bbox:a,text:r}){ne(this,"parent");ne(this,"id");ne(this,"pageNum");ne(this,"bbox");ne(this,"text");this.parent=e,this.id=n,this.pageNum=t,this.bbox=a,this.text=r}getPartial(e){return new PartialTextLayoutCell(this,e)}getNormalized(){return{cell:this}}getBboxForTextSpan(e,n){return n!=null&&n.useRatio?bboxGetSpanByRatio(this.bbox,this.text.length,e):null}trim(){return trimCell(this)}}class PartialTextLayoutCell{constructor(e,n){ne(this,"base");ne(this,"span");this.base=e,this.span=spanIntersection([0,e.text.length],n)}get text(){return spanGetText(this.base.text,this.span)}getPartial(e){const n=spanIntersection(this.span,spanOffset(e,this.span[START]));return new PartialTextLayoutCell(this.base,n)}getNormalized(){return{cell:this.base,span:this.span}}trim(){return trimCell(this)}}function trimCell(i){const e=i.text,n=e.match(/^\s*/)[0].length,t=e.match(/\s*$/)[0].length;return n===0&&t===0?i:e.length>n+t?i.getPartial([n,e.length-t]):i.getPartial([0,0])}class HtmlBboxTextLayout{constructor(e,n){ne(this,"bboxInfo");ne(this,"cells");var t;this.bboxInfo=e,this.cells=((t=e.bboxes)==null?void 0:t.filter(a=>a.page===n).map((a,r)=>new HtmlBboxTextLayoutCell(this,r,a)))??[]}cellAt(e){return this.cells[e]}installStyle(){this.bboxInfo.styles}}class HtmlBboxTextLayoutCell extends BaseTextLayoutCell{constructor(n,t,a){const r=t,s=a.page,u=[a.left,a.top,a.right,a.bottom],l=decodeHTML(a.innerTextSource??"");super({parent:n,id:r,pageNum:s,bbox:u,text:l});ne(this,"processedBbox");this.processedBbox=a}getBboxForTextSpan(n,t){return this.processedBbox!=null,super.getBboxForTextSpan(n,t)}}const debugOut$1=Debug("pdf:textLayout:dom");function debug$1(...i){debugOut$1==null||debugOut$1.apply(null,i)}function getAdjustedCellByOffsetByDom(i,e,n,t){var s;if(!(n.firstChild instanceof Text)||!(n.lastChild instanceof Text))return debug$1("unexpected. span dont have text node"),null;const a=e[START],r=Math.min(i.text.length,e[END]);try{const{textNode:u,textOffset:l}=a>0?getTextNodeAndOffset(n,a):{textNode:n.firstChild,textOffset:0},{textNode:y,textOffset:c}=r>0?getTextNodeAndOffset(n,r):{textNode:n.lastChild,textOffset:n.lastChild.length};debug$1("finding text node for: ",i.text),debug$1(" textContent: ",u.textContent),debug$1(" beginOffset: ",l),debug$1(" textContent: ",y.textContent),debug$1(" endOffset: ",c);let[M,I,m,g]=i.bbox;const f=(s=n.parentElement)==null?void 0:s.getBoundingClientRect();return forEachRectInRange(u,l,y,c,C=>{M=(C.left-f.left)/t,m=M+C.width/t}),[M,I,m,g]}catch(u){debug$1("Caught exception on calculating bbox from DOM: ",u)}return null}class PdfTextContentTextLayout{constructor(e,n,t){ne(this,"textContentInfo");ne(this,"cells");ne(this,"divs");this.textContentInfo=e;const a=e.textContent.items;this.cells=a.map((r,s)=>{var y;const u=getBbox(r,this.viewport);let l=!1;return(y=t==null?void 0:t.bboxes)!=null&&y.length&&(l=t.bboxes.some(c=>bboxesIntersect(u,[c.left,c.top,c.right,c.bottom]))),new PdfTextContentTextLayoutCell(this,s,r,n,u,l)})}get viewport(){return this.textContentInfo.viewport}cellAt(e){return this.cells[e]}setDivs(e){this.divs=e}divAt(e){var n;return(n=this.divs)==null?void 0:n[e]}}class PdfTextContentTextLayoutCell extends BaseTextLayoutCell{constructor(n,t,a,r,s,u){const l=t,y=a.str;super({parent:n,id:l,pageNum:r,bbox:s,text:y});ne(this,"isInHtmlBbox");this.isInHtmlBbox=u}getBboxForTextSpan(n,t){const a=this.parent.divAt(this.id);if(a&&a.parentNode){const r=this.parent.viewport.scale,s=getAdjustedCellByOffsetByDom(this,n,a,r);if(s)return s}return super.getBboxForTextSpan(n,t)}}function getBbox(i,e){const{transform:n}=i,t=e,a=t.rotation%180!==0,[r,,s,u,l,y]=n,[c,M,,I]=t.viewBox,m=a?l+s+M:I-(y+u),g=a?y-c:l-c,f=m+r,C=r*.2;return[g,m+C,g+i.width,f+C]}function getDocFieldValue(i,e,n,t){let a;const r=i[e];if(!Array.isArray(r)&&!n?a=r:a=r==null?void 0:r[n??0],e==="table"&&typeof a=="object"&&typeof(a==null?void 0:a.table_text)=="string")return a.table_text;if(typeof a=="string")return t?Array.isArray(t)?a.substring(t[0],t[1]):a.substring(t.begin,t.end):a}async function extractDocumentInfo(i,e={}){const n=i.html,t=getTextMappings(i)??void 0,a=await processDoc({...i,docHtml:n},{sections:!0,bbox:!0,bboxInnerText:!0,...e});if(!a.bboxes)throw Error("Unexpected result from processDoc");return{processedDoc:a,textMappings:t}}class TextMappingsTextLayout{constructor(e,n){ne(this,"cells");const{textMappings:t,document:a}=e;this.cells=t.text_mappings.filter(r=>r.page.page_number===n).map((r,s)=>new TextMappingsTextLayoutCell(this,s,a,r))}cellAt(e){return this.cells[e]}getHighlight(e){const n=[e.location.begin,e.location.end];return this.cells.filter(a=>{const{cellField:r}=a;return r.name===e.field&&r.index===e.fieldIndex&&spanIntersects(r.span,n)}).map(a=>{const{cellField:r}=a,s=spanIntersection(r.span,n);if(spanContains(n,r.span))return{cell:a,sourceSpan:s};const u=spanGetSubSpan(r.span,s);return{cell:a.getPartial(u),sourceSpan:s}})}}class TextMappingsTextLayoutCell extends BaseTextLayoutCell{constructor(n,t,a,r){const s=t,u=r.page.page_number,l=r.page.bbox,y=getDocFieldValue(a,r.field.name,r.field.index,r.field.span)??"";super({parent:n,id:s,pageNum:u,bbox:l,text:y});ne(this,"cellField");this.cellField=r.field}}const debugOut=Debug("pdf:Highlighter");function debug(...i){debugOut==null||debugOut.apply(null,i)}class Highlighter{constructor({document:e,textMappings:n,pageNum:t,htmlBboxInfo:a,pdfTextContentInfo:r}){ne(this,"pageNum");ne(this,"textMappingsLayout");ne(this,"pdfTextContentLayout",null);ne(this,"textToHtmlBboxMappings",null);ne(this,"textToPdfTextItemMappings",null);this.pageNum=t,this.textMappingsLayout=new TextMappingsTextLayout({document:e,textMappings:n},t),a&&this.setHtmlBboxInfo(a),r&&this.setTextContentItems(r.textContent,r.viewport,r.spans,a)}setHtmlBboxInfo(e){const n=new HtmlBboxTextLayout(e,this.pageNum);this.textToHtmlBboxMappings=getTextBoxMappings(this.textMappingsLayout,n)}setTextContentItems(e,n,t,a){this.pdfTextContentLayout=new PdfTextContentTextLayout({textContent:e,viewport:n},this.pageNum,a),this.textToPdfTextItemMappings=getTextBoxMappings(this.textMappingsLayout,this.pdfTextContentLayout),this.setTextContentDivs(t)}setTextContentDivs(e){var n;(n=this.pdfTextContentLayout)==null||n.setDivs(e)}getHighlight(e){debug("getHighlight: %o",e);const{id:n,field:t,fieldIndex:a,location:r,className:s,facetId:u,value:l,...y}=e,c=this.getHighlightTextMappingResult({field:t,fieldIndex:a,location:r});debug("getHighlight - items: %o",c);const M=c.map((I,m)=>{var C;const{cell:g,span:f}=((C=I.cell)==null?void 0:C.getNormalized())||{};if(g){let v=g.bbox;return f&&(v=g.getBboxForTextSpan(f)||g.getBboxForTextSpan(f,{useRatio:!0})||g.bbox),debug("getHighlight - cell(%i): %o",I.cell),debug(" box: %o",v),{bbox:v,isStart:m===0,isEnd:m===c.length-1}}return debug("getHighlight - cell(%i) is not mapped. source span: %o",I.sourceSpan),null}).filter(nonEmpty);return{highlightId:Highlighter.getId(e),boxes:Highlighter.optimizeHighlightBoxes(M),className:s,facetId:u,value:l,...y}}getHighlightTextMappingResult(e){let n=this.textMappingsLayout.getHighlight(e);const t=(s,u,l,y)=>flatMap$1(s,c=>{if(c.cell){const{cell:M}=c.cell.getNormalized();if(M.parent===l){const I=u.apply(c.cell);return I.length===0&&(y!=null&&y.retainUnmapped)?[c]:I.map(({cell:m,sourceSpan:g})=>({cell:m,sourceSpan:spanOffset(g,c.sourceSpan[START])}))}return c}return[]}),{textToPdfTextItemMappings:a,textToHtmlBboxMappings:r}=this;return a&&(n=t(n,a,this.textMappingsLayout,{retainUnmapped:!0})),r&&(n=t(n,r,this.textMappingsLayout)),n}static optimizeHighlightBoxes(e){return e.reduce((n,t)=>{const a=n.length===0?null:n[n.length-1];if(a&&isNextToEachOther(a.bbox,t.bbox)){const[r,s,u,l]=a.bbox,[y,c,M,I]=t.bbox;a.bbox=[Math.min(r,y),Math.min(s,c),Math.max(u,M),Math.max(l,I)]}else n.push(t);return n},[])}static getId(e){return e.id?e.id:`${e.field}[${e.fieldIndex}]___${e.location.begin}_${e.location.end}`}}const DEFAULT_HIGHLIGHT_ID="highlight";function getIndexForOffset(i,e){let n=!1,t=0;for(;!n&&t({page:u,bbox:[t,r,a,s]}))}]}function getShapeFromBboxHighlight(i,e){return i.map(n=>{const t=n.bboxes.filter(a=>a.page===e).map((a,r,s)=>({bbox:a.bbox,isStart:r===0,isEnd:r===s.length-1}));return t.length>0?{highlightId:n.id||`${t[0].bbox[0]}__${t[0].bbox[1]}`,className:n.className,boxes:t}:null}).filter(nonEmpty)}const base=`${settings_1.prefix}--document-preview-pdf-viewer-highlight`,baseHighlightColor=`${settings_1.prefix}--category`,baseHighlightColorActive=`${settings_1.prefix}--active`,baseOverlapHighlight=`${settings_1.prefix}--overlap-highlight`,basePassThroughActive=`${settings_1.prefix}--overlap-active-pass-through`,PdfHighlight=({className:i,highlightClassName:e,activeHighlightClassName:n,document:t,parsedDocument:a,page:r,highlights:s,boxHighlights:u,activeIds:l,pdfRenderedText:y,scale:c,facetInfoMap:M={},overlapMeta:I=initOverlapMeta(),_useHtmlBbox:m=!0,_usePdfTextItem:g=!0})=>{const f=useHighlighter({document:t,textMappings:a==null?void 0:a.textMappings,processedDoc:m?a==null?void 0:a.processedDoc:void 0,pdfRenderedText:g&&y||void 0,pageNum:r,isReady:!!a&&!!s&&(!g||(y==null?void 0:y.page)===r)}),{textDivs:C}=y||{},v=reactExports.useMemo(()=>u?getShapeFromBboxHighlight(u,r):(f==null||f.setTextContentDivs(C),f?(s||[]).map(p=>f.getHighlight(p)):[]),[u,f,s,r,C]),[b,h]=reactExports.useState(initAction()),o=reactExports.useCallback(p=>{h(p)},[h]),d=reactExports.useRef(null);return useScrollIntoActiveHighlight(d,v,l),jsxRuntimeExports.jsxs("div",{ref:d,className:cx(base,i),children:[jsxRuntimeExports.jsx(TooltipHighlight,{parentDiv:d,tooltipAction:b}),v.map(p=>{const w=l==null?void 0:l.includes(p.highlightId);return jsxRuntimeExports.jsx(Highlight,{className:e,activeClassName:n,shape:p,scale:c,active:w,onTooltipShow:o,facetInfoMap:M,overlapMeta:I},p.highlightId)})]})},Highlight=({className:i,activeClassName:e,shape:n,scale:t,onTooltipShow:a,facetInfoMap:r={},overlapMeta:s=initOverlapMeta(),active:u})=>{const l=reactExports.useRef(null);if((n==null?void 0:n.boxes.length)===0)return null;const y=m=>{var o;const g=m.target,f=g.getAttribute("data-value")||"",C=((o=g.parentElement)==null?void 0:o.getAttribute("data-highlight-id"))||"",v=g.getAttribute("data-facetid")||"",b=l.current,h=calcToolTipContent(r,s,v,f,C);a({tooltipEvent:TooltipEvent.ENTER,rectActiveElement:b==null?void 0:b.getBoundingClientRect(),...h&&{tooltipContent:h}})},c=()=>{a({tooltipEvent:TooltipEvent.LEAVE})},M=s.fieldIdWithOverlap.has(n.highlightId);let I=[`${base}__item`,i,n.className,u&&`${base}__item--active`,u&&e];return n.facetId&&(M?I.push(baseOverlapHighlight,u&&baseHighlightColorActive,u&&`${baseHighlightColor}-${n.facetId} highlight`,u&&basePassThroughActive):I.push(`${baseHighlightColor}-${n.facetId} highlight`,u&&baseHighlightColorActive)),I=I.filter(m=>typeof m=="string"),jsxRuntimeExports.jsx("div",{"data-highlight-id":n.highlightId,"data-testid":n.highlightId,children:n==null?void 0:n.boxes.map(m=>jsxRuntimeExports.jsx("div",{className:I.join(" "),style:{...getPositionStyle(m.bbox,t)},onMouseEnter:y,onMouseLeave:c,ref:l,"data-value":n.value||"","data-facetid":n.facetId||""},`${m.bbox[0].toFixed(2)}_${m.bbox[1].toFixed(2)}`))})};function getPositionStyle(i,e,n=0){const[t,a,r,s]=i;return{left:`${(t-n)*e}px`,top:`${(a-n)*e}px`,width:`${(r-t+n)*e}px`,height:`${(s-a+n)*e}px`}}const useHighlighter=({document:i,textMappings:e,processedDoc:n,pdfRenderedText:t,pageNum:a,isReady:r})=>reactExports.useMemo(()=>r&&i&&e?new Highlighter({document:i,textMappings:e,pageNum:a,htmlBboxInfo:n&&{bboxes:n.bboxes,styles:n.styles},pdfTextContentInfo:t!=null&&t.textContent&&(t!=null&&t.viewport)?t:void 0}):null,[i,r,a,t,n,e]);function useScrollIntoActiveHighlight(i,e,n){reactExports.useEffect(()=>{if(!i.current)return;const t=e.find(a=>(a==null?void 0:a.highlightId)&&(n==null?void 0:n.includes(a.highlightId)));if(t){let a=setTimeout(()=>{var u;a=null;const r=i.current;if(!r)return;const s=r==null?void 0:r.querySelector(`[data-highlight-id=${t.highlightId}]`);(u=s==null?void 0:s.firstElementChild)==null||u.scrollIntoView({block:"nearest",inline:"nearest"})},0);return()=>{a&&clearTimeout(a)}}},[n,i,e])}try{PdfHighlight.displayName="PdfHighlight",PdfHighlight.__docgenInfo={description:"Text highlight layer for PdfViewer",displayName:"PdfHighlight",props:{page:{defaultValue:null,description:"Page number, starting at 1",name:"page",required:!0,type:{name:"number"}},scale:{defaultValue:null,description:"Zoom factor, where `1` is equal to 100%",name:"scale",required:!0,type:{name:"number"}},highlightClassName:{defaultValue:null,description:"Class name to style each highlight",name:"highlightClassName",required:!1,type:{name:"string"}},activeHighlightClassName:{defaultValue:null,description:"Class name to style each active highlight",name:"activeHighlightClassName",required:!1,type:{name:"string"}},document:{defaultValue:null,description:"Document data returned by query",name:"document",required:!1,type:{name:"QueryResult"}},highlights:{defaultValue:null,description:"Highlight spans on fields in document",name:"highlights",required:!1,type:{name:"DocumentFieldHighlight[]"}},activeIds:{defaultValue:null,description:"Active highlight IDs",name:"activeIds",required:!1,type:{name:"string[]"}},setCurrentPage:{defaultValue:null,description:"callback to be notified page change by scrollIntoActiveId",name:"setCurrentPage",required:!1,type:{name:"((page: number) => any)"}},_useHtmlBbox:{defaultValue:{value:"true"},description:`Consider bboxes in HTML field to highlight. +`}setFont(g){const f=this.current,C=this.commonObjs.get(g[0]);let v=g[1];f.font=C,this.embedFonts&&!C.missingFile&&!this.embeddedFonts[C.loadedName]&&(this.addFontStyle(C),this.embeddedFonts[C.loadedName]=C),f.fontMatrix=C.fontMatrix?C.fontMatrix:_util.FONT_IDENTITY_MATRIX;let b="normal";C.black?b="900":C.bold&&(b="bold");const h=C.italic?"italic":"normal";v<0?(v=-v,f.fontDirection=-1):f.fontDirection=1,f.fontSize=v,f.fontFamily=C.loadedName,f.fontWeight=b,f.fontStyle=h,f.tspan=this.svgFactory.createElement("svg:tspan"),f.tspan.setAttributeNS(null,"y",l(-f.y)),f.xcoords=[],f.ycoords=[]}endText(){const g=this.current;g.textRenderingMode&_util.TextRenderingMode.ADD_TO_PATH_FLAG&&g.txtElement&&g.txtElement.hasChildNodes()&&(g.element=g.txtElement,this.clip("nonzero"),this.endPath())}setLineWidth(g){g>0&&(this.current.lineWidth=g)}setLineCap(g){this.current.lineCap=t[g]}setLineJoin(g){this.current.lineJoin=a[g]}setMiterLimit(g){this.current.miterLimit=g}setStrokeAlpha(g){this.current.strokeAlpha=g}setStrokeRGBColor(g,f,C){this.current.strokeColor=_util.Util.makeCssRgb(g,f,C)}setFillAlpha(g){this.current.fillAlpha=g}setFillRGBColor(g,f,C){this.current.fillColor=_util.Util.makeCssRgb(g,f,C),this.current.tspan=this.svgFactory.createElement("svg:tspan"),this.current.xcoords=[],this.current.ycoords=[]}setStrokeColorN(g){this.current.strokeColor=this._makeColorN_Pattern(g)}setFillColorN(g){this.current.fillColor=this._makeColorN_Pattern(g)}shadingFill(g){const f=this.viewport.width,C=this.viewport.height,v=_util.Util.inverseTransform(this.transformMatrix),b=_util.Util.applyTransform([0,0],v),h=_util.Util.applyTransform([0,C],v),o=_util.Util.applyTransform([f,0],v),d=_util.Util.applyTransform([f,C],v),p=Math.min(b[0],h[0],o[0],d[0]),w=Math.min(b[1],h[1],o[1],d[1]),x=Math.max(b[0],h[0],o[0],d[0]),D=Math.max(b[1],h[1],o[1],d[1]),T=this.svgFactory.createElement("svg:rect");T.setAttributeNS(null,"x",p),T.setAttributeNS(null,"y",w),T.setAttributeNS(null,"width",x-p),T.setAttributeNS(null,"height",D-w),T.setAttributeNS(null,"fill",this._makeShadingPattern(g)),this.current.fillAlpha<1&&T.setAttributeNS(null,"fill-opacity",this.current.fillAlpha),this._ensureTransformGroup().appendChild(T)}_makeColorN_Pattern(g){return g[0]==="TilingPattern"?this._makeTilingPattern(g):this._makeShadingPattern(g)}_makeTilingPattern(g){const f=g[1],C=g[2],v=g[3]||_util.IDENTITY_MATRIX,[b,h,o,d]=g[4],p=g[5],w=g[6],x=g[7],D=`shading${I++}`,[T,P]=_util.Util.applyTransform([b,h],v),[E,B]=_util.Util.applyTransform([o,d],v),[L,O]=_util.Util.singularValueDecompose2dScale(v),k=p*L,j=w*O,A=this.svgFactory.createElement("svg:pattern");A.setAttributeNS(null,"id",D),A.setAttributeNS(null,"patternUnits","userSpaceOnUse"),A.setAttributeNS(null,"width",k),A.setAttributeNS(null,"height",j),A.setAttributeNS(null,"x",`${T}`),A.setAttributeNS(null,"y",`${P}`);const S=this.svg,R=this.transformMatrix,N=this.current.fillColor,U=this.current.strokeColor,F=this.svgFactory.create(E-T,B-P);if(this.svg=F,this.transformMatrix=v,x===2){const G=_util.Util.makeCssRgb(...f);this.current.fillColor=G,this.current.strokeColor=G}return this.executeOpTree(this.convertOpList(C)),this.svg=S,this.transformMatrix=R,this.current.fillColor=N,this.current.strokeColor=U,A.appendChild(F.childNodes[0]),this.defs.appendChild(A),`url(#${D})`}_makeShadingPattern(g){switch(g[0]){case"RadialAxial":const f=`shading${I++}`,C=g[3];let v;switch(g[1]){case"axial":const b=g[4],h=g[5];v=this.svgFactory.createElement("svg:linearGradient"),v.setAttributeNS(null,"id",f),v.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),v.setAttributeNS(null,"x1",b[0]),v.setAttributeNS(null,"y1",b[1]),v.setAttributeNS(null,"x2",h[0]),v.setAttributeNS(null,"y2",h[1]);break;case"radial":const o=g[4],d=g[5],p=g[6],w=g[7];v=this.svgFactory.createElement("svg:radialGradient"),v.setAttributeNS(null,"id",f),v.setAttributeNS(null,"gradientUnits","userSpaceOnUse"),v.setAttributeNS(null,"cx",d[0]),v.setAttributeNS(null,"cy",d[1]),v.setAttributeNS(null,"r",w),v.setAttributeNS(null,"fx",o[0]),v.setAttributeNS(null,"fy",o[1]),v.setAttributeNS(null,"fr",p);break;default:throw new Error(`Unknown RadialAxial type: ${g[1]}`)}for(const b of C){const h=this.svgFactory.createElement("svg:stop");h.setAttributeNS(null,"offset",b[0]),h.setAttributeNS(null,"stop-color",b[1]),v.appendChild(h)}return this.defs.appendChild(v),`url(#${f})`;case"Mesh":return(0,_util.warn)("Unimplemented pattern Mesh"),null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${g[0]}`)}}setDash(g,f){this.current.dashArray=g,this.current.dashPhase=f}constructPath(g,f){const C=this.current;let v=C.x,b=C.y,h=[],o=0;for(const d of g)switch(d|0){case _util.OPS.rectangle:v=f[o++],b=f[o++];const p=f[o++],w=f[o++],x=v+p,D=b+w;h.push("M",l(v),l(b),"L",l(x),l(b),"L",l(x),l(D),"L",l(v),l(D),"Z");break;case _util.OPS.moveTo:v=f[o++],b=f[o++],h.push("M",l(v),l(b));break;case _util.OPS.lineTo:v=f[o++],b=f[o++],h.push("L",l(v),l(b));break;case _util.OPS.curveTo:v=f[o+4],b=f[o+5],h.push("C",l(f[o]),l(f[o+1]),l(f[o+2]),l(f[o+3]),l(v),l(b)),o+=6;break;case _util.OPS.curveTo2:h.push("C",l(v),l(b),l(f[o]),l(f[o+1]),l(f[o+2]),l(f[o+3])),v=f[o+2],b=f[o+3],o+=4;break;case _util.OPS.curveTo3:v=f[o+2],b=f[o+3],h.push("C",l(f[o]),l(f[o+1]),l(v),l(b),l(v),l(b)),o+=4;break;case _util.OPS.closePath:h.push("Z");break}h=h.join(" "),C.path&&g.length>0&&g[0]!==_util.OPS.rectangle&&g[0]!==_util.OPS.moveTo?h=C.path.getAttributeNS(null,"d")+h:(C.path=this.svgFactory.createElement("svg:path"),this._ensureTransformGroup().appendChild(C.path)),C.path.setAttributeNS(null,"d",h),C.path.setAttributeNS(null,"fill","none"),C.element=C.path,C.setCurrentPoint(v,b)}endPath(){const g=this.current;if(g.path=null,!this.pendingClip)return;if(!g.element){this.pendingClip=null;return}const f=`clippath${c++}`,C=this.svgFactory.createElement("svg:clipPath");C.setAttributeNS(null,"id",f),C.setAttributeNS(null,"transform",y(this.transformMatrix));const v=g.element.cloneNode(!0);this.pendingClip==="evenodd"?v.setAttributeNS(null,"clip-rule","evenodd"):v.setAttributeNS(null,"clip-rule","nonzero"),this.pendingClip=null,C.appendChild(v),this.defs.appendChild(C),g.activeClipUrl&&(g.clipGroup=null,this.extraStack.forEach(function(b){b.clipGroup=null}),C.setAttributeNS(null,"clip-path",g.activeClipUrl)),g.activeClipUrl=`url(#${f})`,this.tgrp=null}clip(g){this.pendingClip=g}closePath(){const g=this.current;if(g.path){const f=`${g.path.getAttributeNS(null,"d")}Z`;g.path.setAttributeNS(null,"d",f)}}setLeading(g){this.current.leading=-g}setTextRise(g){this.current.textRise=g}setTextRenderingMode(g){this.current.textRenderingMode=g}setHScale(g){this.current.textHScale=g/100}setRenderingIntent(g){}setFlatness(g){}setGState(g){for(const[f,C]of g)switch(f){case"LW":this.setLineWidth(C);break;case"LC":this.setLineCap(C);break;case"LJ":this.setLineJoin(C);break;case"ML":this.setMiterLimit(C);break;case"D":this.setDash(C[0],C[1]);break;case"RI":this.setRenderingIntent(C);break;case"FL":this.setFlatness(C);break;case"Font":this.setFont(C);break;case"CA":this.setStrokeAlpha(C);break;case"ca":this.setFillAlpha(C);break;default:(0,_util.warn)(`Unimplemented graphic state operator ${f}`);break}}fill(){const g=this.current;g.element&&(g.element.setAttributeNS(null,"fill",g.fillColor),g.element.setAttributeNS(null,"fill-opacity",g.fillAlpha),this.endPath())}stroke(){const g=this.current;g.element&&(this._setStrokeAttributes(g.element),g.element.setAttributeNS(null,"fill","none"),this.endPath())}_setStrokeAttributes(g,f=1){const C=this.current;let v=C.dashArray;f!==1&&v.length>0&&(v=v.map(function(b){return f*b})),g.setAttributeNS(null,"stroke",C.strokeColor),g.setAttributeNS(null,"stroke-opacity",C.strokeAlpha),g.setAttributeNS(null,"stroke-miterlimit",l(C.miterLimit)),g.setAttributeNS(null,"stroke-linecap",C.lineCap),g.setAttributeNS(null,"stroke-linejoin",C.lineJoin),g.setAttributeNS(null,"stroke-width",l(f*C.lineWidth)+"px"),g.setAttributeNS(null,"stroke-dasharray",v.map(l).join(" ")),g.setAttributeNS(null,"stroke-dashoffset",l(f*C.dashPhase)+"px")}eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fill()}fillStroke(){this.stroke(),this.fill()}eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()}closeStroke(){this.closePath(),this.stroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.closePath(),this.eoFillStroke()}paintSolidColorImageMask(){const g=this.svgFactory.createElement("svg:rect");g.setAttributeNS(null,"x","0"),g.setAttributeNS(null,"y","0"),g.setAttributeNS(null,"width","1px"),g.setAttributeNS(null,"height","1px"),g.setAttributeNS(null,"fill",this.current.fillColor),this._ensureTransformGroup().appendChild(g)}paintImageXObject(g){const f=g.startsWith("g_")?this.commonObjs.get(g):this.objs.get(g);if(!f){(0,_util.warn)(`Dependent image with object ID ${g} is not ready yet`);return}this.paintInlineImageXObject(f)}paintInlineImageXObject(g,f){const C=g.width,v=g.height,b=r(g,this.forceDataSchema,!!f),h=this.svgFactory.createElement("svg:rect");h.setAttributeNS(null,"x","0"),h.setAttributeNS(null,"y","0"),h.setAttributeNS(null,"width",l(C)),h.setAttributeNS(null,"height",l(v)),this.current.element=h,this.clip("nonzero");const o=this.svgFactory.createElement("svg:image");o.setAttributeNS(n,"xlink:href",b),o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y",l(-v)),o.setAttributeNS(null,"width",l(C)+"px"),o.setAttributeNS(null,"height",l(v)+"px"),o.setAttributeNS(null,"transform",`scale(${l(1/C)} ${l(-1/v)})`),f?f.appendChild(o):this._ensureTransformGroup().appendChild(o)}paintImageMaskXObject(g){const f=this.current,C=g.width,v=g.height,b=f.fillColor;f.maskId=`mask${M++}`;const h=this.svgFactory.createElement("svg:mask");h.setAttributeNS(null,"id",f.maskId);const o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y","0"),o.setAttributeNS(null,"width",l(C)),o.setAttributeNS(null,"height",l(v)),o.setAttributeNS(null,"fill",b),o.setAttributeNS(null,"mask",`url(#${f.maskId})`),this.defs.appendChild(h),this._ensureTransformGroup().appendChild(o),this.paintInlineImageXObject(g,h)}paintFormXObjectBegin(g,f){if(Array.isArray(g)&&g.length===6&&this.transform(g[0],g[1],g[2],g[3],g[4],g[5]),f){const C=f[2]-f[0],v=f[3]-f[1],b=this.svgFactory.createElement("svg:rect");b.setAttributeNS(null,"x",f[0]),b.setAttributeNS(null,"y",f[1]),b.setAttributeNS(null,"width",l(C)),b.setAttributeNS(null,"height",l(v)),this.current.element=b,this.clip("nonzero"),this.endPath()}}paintFormXObjectEnd(){}_initialize(g){const f=this.svgFactory.create(g.width,g.height),C=this.svgFactory.createElement("svg:defs");f.appendChild(C),this.defs=C;const v=this.svgFactory.createElement("svg:g");return v.setAttributeNS(null,"transform",y(g.transform)),f.appendChild(v),this.svg=v,f}_ensureClipGroup(){if(!this.current.clipGroup){const g=this.svgFactory.createElement("svg:g");g.setAttributeNS(null,"clip-path",this.current.activeClipUrl),this.svg.appendChild(g),this.current.clipGroup=g}return this.current.clipGroup}_ensureTransformGroup(){return this.tgrp||(this.tgrp=this.svgFactory.createElement("svg:g"),this.tgrp.setAttributeNS(null,"transform",y(this.transformMatrix)),this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)),this.tgrp}}}var network={},network_utils={},content_disposition={},hasRequiredContent_disposition;function requireContent_disposition(){if(hasRequiredContent_disposition)return content_disposition;hasRequiredContent_disposition=1,Object.defineProperty(content_disposition,"__esModule",{value:!0}),content_disposition.getFilenameFromContentDispositionHeader=i;function i(e){let n=!0,t=a("filename\\*","i").exec(e);if(t){t=t[1];let M=l(t);return M=unescape(M),M=y(M),M=c(M),s(M)}if(t=u(e),t){const M=c(t);return s(M)}if(t=a("filename","i").exec(e),t){t=t[1];let M=l(t);return M=c(M),s(M)}function a(M,I){return new RegExp("(?:^|;)\\s*"+M+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',I)}function r(M,I){if(M){if(!/^[\x00-\xFF]+$/.test(I))return I;try{const m=new TextDecoder(M,{fatal:!0}),g=Array.from(I,function(f){return f.charCodeAt(0)&255});I=m.decode(new Uint8Array(g)),n=!1}catch{if(/^utf-?8$/i.test(M))try{I=decodeURIComponent(escape(I)),n=!1}catch{}}}return I}function s(M){return n&&/[\x80-\xff]/.test(M)&&(M=r("utf-8",M),n&&(M=r("iso-8859-1",M))),M}function u(M){const I=[];let m;const g=a("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(m=g.exec(M))!==null;){let[,C,v,b]=m;if(C=parseInt(C,10),C in I){if(C===0)break;continue}I[C]=[v,b]}const f=[];for(let C=0;C0,"Range chunk size must be larger than zero");const c={allowRangeRequests:!1,suggestedLength:void 0},M=parseInt(s("Content-Length"),10);return!Number.isInteger(M)||(c.suggestedLength=M,M<=2*l)||y||!u||s("Accept-Ranges")!=="bytes"||(s("Content-Encoding")||"identity")!=="identity"||(c.allowRangeRequests=!0),c}function t(s){const u=s("Content-Disposition");if(u){let l=(0,e.getFilenameFromContentDispositionHeader)(u);if(l.includes("%"))try{l=decodeURIComponent(l)}catch{}if(/\.pdf$/i.test(l))return l}return null}function a(s,u){return s===404||s===0&&u.startsWith("file:")?new i.MissingPDFException('Missing PDF "'+u+'".'):new i.UnexpectedResponseException("Unexpected server response ("+s+') while retrieving PDF "'+u+'".',s)}function r(s){return s===200||s===206}return network_utils}var hasRequiredNetwork;function requireNetwork(){if(hasRequiredNetwork)return network;hasRequiredNetwork=1,Object.defineProperty(network,"__esModule",{value:!0}),network.PDFNetworkStream=void 0;var i=util,e=requireNetwork_utils();const n=200,t=206;function a(y){const c=y.response;return typeof c!="string"?c:(0,i.stringToBytes)(c).buffer}class r{constructor(c,M){this.url=c,M=M||{},this.isHttp=/^https?:/i.test(c),this.httpHeaders=this.isHttp&&M.httpHeaders||{},this.withCredentials=M.withCredentials||!1,this.getXhr=M.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(c,M,I){const m={begin:c,end:M};for(const g in I)m[g]=I[g];return this.request(m)}requestFull(c){return this.request(c)}request(c){const M=this.getXhr(),I=this.currXhrId++,m=this.pendingRequests[I]={xhr:M};M.open("GET",this.url),M.withCredentials=this.withCredentials;for(const g in this.httpHeaders){const f=this.httpHeaders[g];typeof f>"u"||M.setRequestHeader(g,f)}return this.isHttp&&"begin"in c&&"end"in c?(M.setRequestHeader("Range",`bytes=${c.begin}-${c.end-1}`),m.expectedStatus=t):m.expectedStatus=n,M.responseType="arraybuffer",c.onError&&(M.onerror=function(g){c.onError(M.status)}),M.onreadystatechange=this.onStateChange.bind(this,I),M.onprogress=this.onProgress.bind(this,I),m.onHeadersReceived=c.onHeadersReceived,m.onDone=c.onDone,m.onError=c.onError,m.onProgress=c.onProgress,M.send(null),I}onProgress(c,M){const I=this.pendingRequests[c];I&&I.onProgress&&I.onProgress(M)}onStateChange(c,M){const I=this.pendingRequests[c];if(!I)return;const m=I.xhr;if(m.readyState>=2&&I.onHeadersReceived&&(I.onHeadersReceived(),delete I.onHeadersReceived),m.readyState!==4||!(c in this.pendingRequests))return;if(delete this.pendingRequests[c],m.status===0&&this.isHttp){I.onError&&I.onError(m.status);return}const g=m.status||n;if(!(g===n&&I.expectedStatus===t)&&g!==I.expectedStatus){I.onError&&I.onError(m.status);return}const C=a(m);if(g===t){const v=m.getResponseHeader("Content-Range"),b=/bytes (\d+)-(\d+)\/(\d+)/.exec(v);I.onDone({begin:parseInt(b[1],10),chunk:C})}else C?I.onDone({begin:0,chunk:C}):I.onError&&I.onError(m.status)}getRequestXhr(c){return this.pendingRequests[c].xhr}isPendingRequest(c){return c in this.pendingRequests}abortRequest(c){const M=this.pendingRequests[c].xhr;delete this.pendingRequests[c],M.abort()}}class s{constructor(c){this._source=c,this._manager=new r(c.url,{httpHeaders:c.httpHeaders,withCredentials:c.withCredentials}),this._rangeChunkSize=c.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(c){const M=this._rangeRequestReaders.indexOf(c);M>=0&&this._rangeRequestReaders.splice(M,1)}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new u(this._manager,this._source),this._fullRequestReader}getRangeReader(c,M){const I=new l(this._manager,c,M);return I.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(I),I}cancelAllRequests(c){this._fullRequestReader&&this._fullRequestReader.cancel(c),this._rangeRequestReaders.slice(0).forEach(function(I){I.cancel(c)})}}network.PDFNetworkStream=s;class u{constructor(c,M){this._manager=c;const I={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=M.url,this._fullRequestId=c.requestFull(I),this._headersReceivedCapability=(0,i.createPromiseCapability)(),this._disableRange=M.disableRange||!1,this._contentLength=M.length,this._rangeChunkSize=M.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 c=this._fullRequestId,M=this._manager.getRequestXhr(c),I=f=>M.getResponseHeader(f),{allowRangeRequests:m,suggestedLength:g}=(0,e.validateRangeRequestCapabilities)({getResponseHeader:I,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});m&&(this._isRangeSupported=!0),this._contentLength=g||this._contentLength,this._filename=(0,e.extractFilenameFromHeader)(I),this._isRangeSupported&&this._manager.abortRequest(c),this._headersReceivedCapability.resolve()}_onDone(c){c&&(this._requests.length>0?this._requests.shift().resolve({value:c.chunk,done:!1}):this._cachedChunks.push(c.chunk)),this._done=!0,!(this._cachedChunks.length>0)&&(this._requests.forEach(function(M){M.resolve({value:void 0,done:!0})}),this._requests=[])}_onError(c){const M=this._url,I=(0,e.createResponseStatusError)(c,M);this._storedError=I,this._headersReceivedCapability.reject(I),this._requests.forEach(function(m){m.reject(I)}),this._requests=[],this._cachedChunks=[]}_onProgress(c){this.onProgress&&this.onProgress({loaded:c.loaded,total:c.lengthComputable?c.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 c=(0,i.createPromiseCapability)();return this._requests.push(c),c.promise}cancel(c){this._done=!0,this._headersReceivedCapability.reject(c),this._requests.forEach(function(M){M.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class l{constructor(c,M,I){this._manager=c;const m={onDone:this._onDone.bind(this),onProgress:this._onProgress.bind(this)};this._requestId=c.requestRange(M,I,m),this._requests=[],this._queuedChunk=null,this._done=!1,this.onProgress=null,this.onClosed=null}_close(){this.onClosed&&this.onClosed(this)}_onDone(c){const M=c.chunk;this._requests.length>0?this._requests.shift().resolve({value:M,done:!1}):this._queuedChunk=M,this._done=!0,this._requests.forEach(function(I){I.resolve({value:void 0,done:!0})}),this._requests=[],this._close()}_onProgress(c){!this.isStreamingSupported&&this.onProgress&&this.onProgress({loaded:c.loaded})}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk!==null){const M=this._queuedChunk;return this._queuedChunk=null,{value:M,done:!1}}if(this._done)return{value:void 0,done:!0};const c=(0,i.createPromiseCapability)();return this._requests.push(c),c.promise}cancel(c){this._done=!0,this._requests.forEach(function(M){M.resolve({value:void 0,done:!0})}),this._requests=[],this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}return network}var fetch_stream={},hasRequiredFetch_stream;function requireFetch_stream(){if(hasRequiredFetch_stream)return fetch_stream;hasRequiredFetch_stream=1,Object.defineProperty(fetch_stream,"__esModule",{value:!0}),fetch_stream.PDFFetchStream=void 0;var i=util,e=requireNetwork_utils();function n(u,l,y){return{method:"GET",headers:u,signal:y&&y.signal,mode:"cors",credentials:l?"include":"same-origin",redirect:"follow"}}function t(u){const l=new Headers;for(const y in u){const c=u[y];typeof c>"u"||l.append(y,c)}return l}class a{constructor(l){this.source=l,this.isHttp=/^https?:/i.test(l.url),this.httpHeaders=this.isHttp&&l.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new r(this),this._fullRequestReader}getRangeReader(l,y){if(y<=this._progressiveDataLength)return null;const c=new s(this,l,y);return this._rangeRequestReaders.push(c),c}cancelAllRequests(l){this._fullRequestReader&&this._fullRequestReader.cancel(l),this._rangeRequestReaders.slice(0).forEach(function(c){c.cancel(l)})}}fetch_stream.PDFFetchStream=a;class r{constructor(l){this._stream=l,this._reader=null,this._loaded=0,this._filename=null;const y=l.source;this._withCredentials=y.withCredentials||!1,this._contentLength=y.length,this._headersCapability=(0,i.createPromiseCapability)(),this._disableRange=y.disableRange||!1,this._rangeChunkSize=y.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),typeof AbortController<"u"&&(this._abortController=new AbortController),this._isStreamingSupported=!y.disableStream,this._isRangeSupported=!y.disableRange,this._headers=t(this._stream.httpHeaders);const c=y.url;fetch(c,n(this._headers,this._withCredentials,this._abortController)).then(M=>{if(!(0,e.validateResponseStatus)(M.status))throw(0,e.createResponseStatusError)(M.status,c);this._reader=M.body.getReader(),this._headersCapability.resolve();const I=f=>M.headers.get(f),{allowRangeRequests:m,suggestedLength:g}=(0,e.validateRangeRequestCapabilities)({getResponseHeader:I,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=m,this._contentLength=g||this._contentLength,this._filename=(0,e.extractFilenameFromHeader)(I),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new i.AbortException("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(){await this._headersCapability.promise;const{value:l,done:y}=await this._reader.read();return y?{value:l,done:y}:(this._loaded+=l.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(l).buffer,done:!1})}cancel(l){this._reader&&this._reader.cancel(l),this._abortController&&this._abortController.abort()}}class s{constructor(l,y,c){this._stream=l,this._reader=null,this._loaded=0;const M=l.source;this._withCredentials=M.withCredentials||!1,this._readCapability=(0,i.createPromiseCapability)(),this._isStreamingSupported=!M.disableStream,typeof AbortController<"u"&&(this._abortController=new AbortController),this._headers=t(this._stream.httpHeaders),this._headers.append("Range",`bytes=${y}-${c-1}`);const I=M.url;fetch(I,n(this._headers,this._withCredentials,this._abortController)).then(m=>{if(!(0,e.validateResponseStatus)(m.status))throw(0,e.createResponseStatusError)(m.status,I);this._readCapability.resolve(),this._reader=m.body.getReader()}).catch(m=>{if(!(m&&m.name==="AbortError"))throw m}),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:l,done:y}=await this._reader.read();return y?{value:l,done:y}:(this._loaded+=l.byteLength,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(l).buffer,done:!1})}cancel(l){this._reader&&this._reader.cancel(l),this._abortController&&this._abortController.abort()}}return fetch_stream}var node_stream={},hasRequiredNode_stream;function requireNode_stream(){if(hasRequiredNode_stream)return node_stream;hasRequiredNode_stream=1,Object.defineProperty(node_stream,"__esModule",{value:!0}),node_stream.PDFNodeStream=void 0;var i=util,e=requireNetwork_utils();const n=require$$2,t=requireStreamHttp(),a=httpsBrowserifyExports,r=urlExports,s=/^file:\/\/\/[a-zA-Z]:\//;function u(C){const v=r.parse(C);return v.protocol==="file:"||v.host?v:/^[a-z]:[/\\]/i.test(C)?r.parse(`file:///${C}`):(v.host||(v.protocol="file:"),v)}class l{constructor(v){this.source=v,this.url=u(v.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.httpHeaders=this.isHttp&&v.httpHeaders||{},this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?this._fullRequestReader._loaded:0}getFullReader(){return(0,i.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new g(this):new I(this),this._fullRequestReader}getRangeReader(v,b){if(b<=this._progressiveDataLength)return null;const h=this.isFsUrl?new f(this,v,b):new m(this,v,b);return this._rangeRequestReaders.push(h),h}cancelAllRequests(v){this._fullRequestReader&&this._fullRequestReader.cancel(v),this._rangeRequestReaders.slice(0).forEach(function(h){h.cancel(v)})}}node_stream.PDFNodeStream=l;class y{constructor(v){this._url=v.url,this._done=!1,this._storedError=null,this.onProgress=null;const b=v.source;this._contentLength=b.length,this._loaded=0,this._filename=null,this._disableRange=b.disableRange||!1,this._rangeChunkSize=b.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!b.disableStream,this._isRangeSupported=!b.disableRange,this._readableStream=null,this._readCapability=(0,i.createPromiseCapability)(),this._headersCapability=(0,i.createPromiseCapability)()}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(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const v=this._readableStream.read();return v===null?(this._readCapability=(0,i.createPromiseCapability)(),this.read()):(this._loaded+=v.length,this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(v).buffer,done:!1})}cancel(v){if(!this._readableStream){this._error(v);return}this._readableStream.destroy(v)}_error(v){this._storedError=v,this._readCapability.resolve()}_setReadableStream(v){this._readableStream=v,v.on("readable",()=>{this._readCapability.resolve()}),v.on("end",()=>{v.destroy(),this._done=!0,this._readCapability.resolve()}),v.on("error",b=>{this._error(b)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new i.AbortException("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class c{constructor(v){this._url=v.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=(0,i.createPromiseCapability)();const b=v.source;this._isStreamingSupported=!b.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const v=this._readableStream.read();return v===null?(this._readCapability=(0,i.createPromiseCapability)(),this.read()):(this._loaded+=v.length,this.onProgress&&this.onProgress({loaded:this._loaded}),{value:new Uint8Array(v).buffer,done:!1})}cancel(v){if(!this._readableStream){this._error(v);return}this._readableStream.destroy(v)}_error(v){this._storedError=v,this._readCapability.resolve()}_setReadableStream(v){this._readableStream=v,v.on("readable",()=>{this._readCapability.resolve()}),v.on("end",()=>{v.destroy(),this._done=!0,this._readCapability.resolve()}),v.on("error",b=>{this._error(b)}),this._storedError&&this._readableStream.destroy(this._storedError)}}function M(C,v){return{protocol:C.protocol,auth:C.auth,host:C.hostname,port:C.port,path:C.path,method:"GET",headers:v}}class I extends y{constructor(v){super(v);const b=h=>{if(h.statusCode===404){const w=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=w,this._headersCapability.reject(w);return}this._headersCapability.resolve(),this._setReadableStream(h);const o=w=>this._readableStream.headers[w.toLowerCase()],{allowRangeRequests:d,suggestedLength:p}=(0,e.validateRangeRequestCapabilities)({getResponseHeader:o,isHttp:v.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=d,this._contentLength=p||this._contentLength,this._filename=(0,e.extractFilenameFromHeader)(o)};this._request=null,this._url.protocol==="http:"?this._request=t.request(M(this._url,v.httpHeaders),b):this._request=a.request(M(this._url,v.httpHeaders),b),this._request.on("error",h=>{this._storedError=h,this._headersCapability.reject(h)}),this._request.end()}}class m extends c{constructor(v,b,h){super(v),this._httpHeaders={};for(const d in v.httpHeaders){const p=v.httpHeaders[d];typeof p>"u"||(this._httpHeaders[d]=p)}this._httpHeaders.Range=`bytes=${b}-${h-1}`;const o=d=>{if(d.statusCode===404){const p=new i.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=p;return}this._setReadableStream(d)};this._request=null,this._url.protocol==="http:"?this._request=t.request(M(this._url,this._httpHeaders),o):this._request=a.request(M(this._url,this._httpHeaders),o),this._request.on("error",d=>{this._storedError=d}),this._request.end()}}class g extends y{constructor(v){super(v);let b=decodeURIComponent(this._url.path);s.test(this._url.href)&&(b=b.replace(/^\//,"")),n.lstat(b,(h,o)=>{if(h){h.code==="ENOENT"&&(h=new i.MissingPDFException(`Missing PDF "${b}".`)),this._storedError=h,this._headersCapability.reject(h);return}this._contentLength=o.size,this._setReadableStream(n.createReadStream(b)),this._headersCapability.resolve()})}}class f extends c{constructor(v,b,h){super(v);let o=decodeURIComponent(this._url.path);s.test(this._url.href)&&(o=o.replace(/^\//,"")),this._setReadableStream(n.createReadStream(o,{start:b,end:h-1}))}}return node_stream}(function(i){Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"addLinkAttributes",{enumerable:!0,get:function(){return e.addLinkAttributes}}),Object.defineProperty(i,"getFilenameFromUrl",{enumerable:!0,get:function(){return e.getFilenameFromUrl}}),Object.defineProperty(i,"LinkTarget",{enumerable:!0,get:function(){return e.LinkTarget}}),Object.defineProperty(i,"loadScript",{enumerable:!0,get:function(){return e.loadScript}}),Object.defineProperty(i,"PDFDateString",{enumerable:!0,get:function(){return e.PDFDateString}}),Object.defineProperty(i,"RenderingCancelledException",{enumerable:!0,get:function(){return e.RenderingCancelledException}}),Object.defineProperty(i,"build",{enumerable:!0,get:function(){return n.build}}),Object.defineProperty(i,"getDocument",{enumerable:!0,get:function(){return n.getDocument}}),Object.defineProperty(i,"LoopbackPort",{enumerable:!0,get:function(){return n.LoopbackPort}}),Object.defineProperty(i,"PDFDataRangeTransport",{enumerable:!0,get:function(){return n.PDFDataRangeTransport}}),Object.defineProperty(i,"PDFWorker",{enumerable:!0,get:function(){return n.PDFWorker}}),Object.defineProperty(i,"version",{enumerable:!0,get:function(){return n.version}}),Object.defineProperty(i,"CMapCompressionType",{enumerable:!0,get:function(){return t.CMapCompressionType}}),Object.defineProperty(i,"createObjectURL",{enumerable:!0,get:function(){return t.createObjectURL}}),Object.defineProperty(i,"createPromiseCapability",{enumerable:!0,get:function(){return t.createPromiseCapability}}),Object.defineProperty(i,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return t.createValidAbsoluteUrl}}),Object.defineProperty(i,"InvalidPDFException",{enumerable:!0,get:function(){return t.InvalidPDFException}}),Object.defineProperty(i,"MissingPDFException",{enumerable:!0,get:function(){return t.MissingPDFException}}),Object.defineProperty(i,"OPS",{enumerable:!0,get:function(){return t.OPS}}),Object.defineProperty(i,"PasswordResponses",{enumerable:!0,get:function(){return t.PasswordResponses}}),Object.defineProperty(i,"PermissionFlag",{enumerable:!0,get:function(){return t.PermissionFlag}}),Object.defineProperty(i,"removeNullCharacters",{enumerable:!0,get:function(){return t.removeNullCharacters}}),Object.defineProperty(i,"shadow",{enumerable:!0,get:function(){return t.shadow}}),Object.defineProperty(i,"UnexpectedResponseException",{enumerable:!0,get:function(){return t.UnexpectedResponseException}}),Object.defineProperty(i,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return t.UNSUPPORTED_FEATURES}}),Object.defineProperty(i,"Util",{enumerable:!0,get:function(){return t.Util}}),Object.defineProperty(i,"VerbosityLevel",{enumerable:!0,get:function(){return t.VerbosityLevel}}),Object.defineProperty(i,"AnnotationLayer",{enumerable:!0,get:function(){return a.AnnotationLayer}}),Object.defineProperty(i,"apiCompatibilityParams",{enumerable:!0,get:function(){return r.apiCompatibilityParams}}),Object.defineProperty(i,"GlobalWorkerOptions",{enumerable:!0,get:function(){return s.GlobalWorkerOptions}}),Object.defineProperty(i,"renderTextLayer",{enumerable:!0,get:function(){return u.renderTextLayer}}),Object.defineProperty(i,"SVGGraphics",{enumerable:!0,get:function(){return l.SVGGraphics}});var e=display_utils,n=api,t=util,a=annotation_layer,r=api_compatibility,s=worker_options,u=text_layer,l=svg;{const{isNodeJS:y}=is_node;if(y){const c=requireNode_stream().PDFNodeStream;(0,n.setPDFNetworkStreamFactory)(M=>new c(M))}else{const c=requireNetwork().PDFNetworkStream;let M;(0,e.isFetchSupported)()&&(M=requireFetch_stream().PDFFetchStream),(0,n.setPDFNetworkStreamFactory)(I=>M&&(0,e.isValidFetchUrl)(I.url)?new M(I):new c(I))}}})(pdf);Object.defineProperty(text_layer_builder,"__esModule",{value:!0});text_layer_builder.DefaultTextLayerFactory=TextLayerBuilder_1=text_layer_builder.TextLayerBuilder=void 0;var _pdf=pdf;const EXPAND_DIVS_TIMEOUT=300;class TextLayerBuilder{constructor({textLayerDiv:e,eventBus:n,pageIndex:t,viewport:a,findController:r=null,enhanceTextSelection:s=!1}){this.textLayerDiv=e,this.eventBus=n,this.textContent=null,this.textContentItemsStr=[],this.textContentStream=null,this.renderingDone=!1,this.pageIdx=t,this.pageNumber=this.pageIdx+1,this.matches=[],this.viewport=a,this.textDivs=[],this.findController=r,this.textLayerRenderTask=null,this.enhanceTextSelection=s,this._onUpdateTextLayerMatches=null,this._bindMouse()}_finishRendering(){if(this.renderingDone=!0,!this.enhanceTextSelection){const e=document.createElement("div");e.className="endOfContent",this.textLayerDiv.appendChild(e)}this.eventBus.dispatch("textlayerrendered",{source:this,pageNumber:this.pageNumber,numTextDivs:this.textDivs.length})}render(e=0){if(!(this.textContent||this.textContentStream)||this.renderingDone)return;this.cancel(),this.textDivs=[];const n=document.createDocumentFragment();this.textLayerRenderTask=(0,_pdf.renderTextLayer)({textContent:this.textContent,textContentStream:this.textContentStream,container:n,viewport:this.viewport,textDivs:this.textDivs,textContentItemsStr:this.textContentItemsStr,timeout:e,enhanceTextSelection:this.enhanceTextSelection}),this.textLayerRenderTask.promise.then(()=>{this.textLayerDiv.appendChild(n),this._finishRendering(),this._updateMatches()},function(t){}),this._onUpdateTextLayerMatches||(this._onUpdateTextLayerMatches=t=>{(t.pageIndex===this.pageIdx||t.pageIndex===-1)&&this._updateMatches()},this.eventBus._on("updatetextlayermatches",this._onUpdateTextLayerMatches))}cancel(){this.textLayerRenderTask&&(this.textLayerRenderTask.cancel(),this.textLayerRenderTask=null),this._onUpdateTextLayerMatches&&(this.eventBus._off("updatetextlayermatches",this._onUpdateTextLayerMatches),this._onUpdateTextLayerMatches=null)}setTextContentStream(e){this.cancel(),this.textContentStream=e}setTextContent(e){this.cancel(),this.textContent=e}_convertMatches(e,n){if(!e)return[];const{findController:t,textContentItemsStr:a}=this;let r=0,s=0;const u=a.length-1,l=t.state.query.length,y=[];for(let c=0,M=e.length;c=s+a[r].length;)s+=a[r].length,r++;r===a.length&&console.error("Could not find a matching mapping");const m={begin:{divIdx:r,offset:I-s}};for(n?I+=n[c]:I+=l;r!==u&&I>s+a[r].length;)s+=a[r].length,r++;m.end={divIdx:r,offset:I-s},y.push(m)}return y}_renderMatches(e){if(e.length===0)return;const{findController:n,pageIdx:t,textContentItemsStr:a,textDivs:r}=this,s=t===n.selected.pageIdx,u=n.selected.matchIdx,l=n.state.highlightAll;let y=null;const c={divIdx:-1,offset:void 0};function M(f,C){const v=f.divIdx;r[v].textContent="",I(v,0,f.offset,C)}function I(f,C,v,b){const h=r[f],o=a[f].substring(C,v),d=document.createTextNode(o);if(b){const p=document.createElement("span");p.className=b,p.appendChild(d),h.appendChild(p);return}h.appendChild(d)}let m=u,g=m+1;if(l)m=0,g=e.length;else if(!s)return;for(let f=m;f{if(this.enhanceTextSelection&&this.textLayerRenderTask){this.textLayerRenderTask.expandTextDivs(!0),n&&(clearTimeout(n),n=null);return}const a=e.querySelector(".endOfContent");if(!a)return;let r=t.target!==e;if(r=r&&window.getComputedStyle(a).getPropertyValue("-moz-user-select")!=="none",r){const s=e.getBoundingClientRect(),u=Math.max(0,(t.pageY-s.top)/s.height);a.style.top=(u*100).toFixed(2)+"%"}a.classList.add("active")}),e.addEventListener("mouseup",()=>{if(this.enhanceTextSelection&&this.textLayerRenderTask){n=setTimeout(()=>{this.textLayerRenderTask&&this.textLayerRenderTask.expandTextDivs(!1),n=null},EXPAND_DIVS_TIMEOUT);return}const t=e.querySelector(".endOfContent");t&&(t.style.top="",t.classList.remove("active"))})}}var TextLayerBuilder_1=text_layer_builder.TextLayerBuilder=TextLayerBuilder;class DefaultTextLayerFactory{createTextLayerBuilder(e,n,t,a=!1,r){return new TextLayerBuilder({textLayerDiv:e,pageIndex:n,viewport:t,enhanceTextSelection:a,eventBus:r})}}text_layer_builder.DefaultTextLayerFactory=DefaultTextLayerFactory;const PdfViewerTextLayer=({className:i,loadedPage:e,scale:n=1,setRenderedText:t=()=>{}})=>{var y,c;const a=reactExports.useRef(null),r=a.current,s=useAsyncFunctionCall(reactExports.useCallback(async()=>{if(e){const M=e.getViewport({scale:n});return{textContent:await e.getTextContent(),viewport:M,page:e.pageNumber,scale:n}}return null},[e,n])),u=useAsyncFunctionCall(reactExports.useCallback(async M=>{if(r&&s){const{textContent:I,viewport:m,scale:g,page:f}=s,C=new TextLayerBuilder_1({textLayerDiv:r,viewport:m,eventBus:new EventBus_1,pageIndex:f-1});return M.addEventListener("abort",()=>C.cancel()),await _renderTextLayer(C,I,r,g),{textContent:I,viewport:m,page:f,textDivs:C.textDivs}}},[s,r]));reactExports.useEffect(()=>{u!==void 0&&t(u)},[u,t]);const l=cx(i,"textLayer");return jsxRuntimeExports.jsx("div",{className:l,ref:a,style:{width:`${((y=s==null?void 0:s.viewport)==null?void 0:y.width)??0}px`,height:`${((c=s==null?void 0:s.viewport)==null?void 0:c.height)??0}px`}})};async function _renderTextLayer(i,e,n,t){i.setTextContent(e),n.innerHTML="";const a=new Promise(r=>{const s=()=>{r(),i==null||i.eventBus.off("textlayerrendered",s)};i==null||i.eventBus.on("textlayerrendered",s)});i.render(),await a,_adjustTextDivs(i.textDivs,e.items,t)}function _adjustTextDivs(i,e,n){const t=/scaleX\(([\d.]+)\)/;(i||[]).forEach((a,r)=>{const s=e==null?void 0:e[r];if(!s)return;const u=s.width*n,l=a.getBoundingClientRect().width;function y(M){var m;const I=(m=M.style.transform)==null?void 0:m.match(t);return I?parseFloat(I[1]):null}const c=y(a);if(c&&!isNaN(c)){const M=`scaleX(${u/l*c})`;a.style.transform=a.style.transform.replace(t,M)}else{const M=`scaleX(${u/l})`;a.style.transform=M}})}try{PdfViewerTextLayer.displayName="PdfViewerTextLayer",PdfViewerTextLayer.__docgenInfo={description:"",displayName:"PdfViewerTextLayer",props:{scale:{defaultValue:{value:"1"},description:"Zoom factor, where `1` is equal to 100%",name:"scale",required:!1,type:{name:"number"}},className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},loadedPage:{defaultValue:null,description:"PDF page from pdfjs",name:"loadedPage",required:!0,type:{name:"PDFPageProxy | null | undefined"}},setRenderedText:{defaultValue:{value:"() => {}"},description:"Callback for text layer info",name:"setRenderedText",required:!1,type:{name:"((info: PdfRenderedText | null) => any)"}}}}}catch(i){}function toPDFSource(i){return typeof i=="string"||i instanceof ArrayBuffer||ArrayBuffer.isView(i)?{data:i}:i}const PdfViewer=reactExports.forwardRef(({className:i,file:e,page:n,scale:t,document:a,textLayerClassName:r,disableTextLayer:s=!1,setPageCount:u,setLoading:l,setHideToolbarControls:y,setRenderedText:c,setIsPdfRenderError:M,pdfWorkerUrl:I,children:m,...g},f)=>{const C=reactExports.useRef(null),{node:v,setRef:b}=useSafeRef();reactExports.useImperativeHandle(f,()=>v,[v]);const[h,o]=reactExports.useState(null);reactExports.useEffect(()=>{I&&setupPdfjs(I)},[I]);const d=useAsyncFunctionCall(reactExports.useCallback(async()=>{try{var P=e?await _loadPdf(e):null;return P}catch(E){return M==null||M(!0),console.error(`Failed to load pdf file: ${E}`),null}},[e,M])),p=useAsyncFunctionCall(reactExports.useCallback(async()=>{try{return d&&n>0?await _loadPage(d,n):null}catch(P){return console.error(`Failed to load pdf page ${n}: ${P}`),null}},[d,n])),{width:w}=useSize(v);reactExports.useEffect(()=>{o(getCanvasInfo(p,t,w))},[p,t,w]),useAsyncFunctionCall(reactExports.useCallback(async P=>{if(p&&!p.then&&h){const E=_renderPage(p,C.current,h);P.addEventListener("abort",()=>E==null?void 0:E.cancel()),await(E==null?void 0:E.promise),l(!1)}},[h,p,l]));const x=usePageCount({loadedFile:d,document:a});reactExports.useEffect(()=>{u&&x!==null&&u(x)},[x,u]),reactExports.useEffect(()=>{y&&y(!1)},[y]);const D=(h==null?void 0:h.fitToWidthRatio)||1,T=`${settings_1.prefix}--document-preview-pdf-viewer`;return jsxRuntimeExports.jsx("div",{ref:b,className:cx(T,i),...g,children:jsxRuntimeExports.jsxs("div",{className:`${T}__wrapper`,children:[jsxRuntimeExports.jsx("canvas",{ref:C,className:`${T}__canvas`,style:{width:`${(h==null?void 0:h.width)??0}px`,height:`${(h==null?void 0:h.height)??0}px`},width:h==null?void 0:h.canvasWidth,height:h==null?void 0:h.canvasHeight}),!s&&jsxRuntimeExports.jsx(PdfViewerTextLayer,{className:cx(`${T}__text`,r),loadedPage:p,scale:t*D,setRenderedText:c}),typeof m=="function"?m({fitToWidthRatio:D}):m]})})});PdfViewer.defaultProps={page:1,scale:1};function usePageCount({loadedFile:i,document:e}){const n=reactExports.useMemo(()=>{const a=getTextMappings(e);if(a){const r=a.text_mappings.length-1;return(a==null?void 0:a.text_mappings[r].page.page_number)??1}return 0},[e]);return reactExports.useMemo(()=>i&&i.numPages>0?i.numPages:n>0?n:null,[i,n])}function _loadPdf(i){const e=toPDFSource(i);return pdfExports.getDocument(e).promise}function _loadPage(i,e){return i.getPage(e)}function _renderPage(i,e,n){const t=e.getContext("2d");return t?(t.resetTransform(),i.render({canvasContext:t,viewport:n.viewport})):null}let currentPdfWorkerUrl=null;function setupPdfjs(i){if(i&&i!==currentPdfWorkerUrl&&typeof Worker<"u"){const e=new Worker(i);setPdfJsGlobalWorkerOptions({workerPort:e}),currentPdfWorkerUrl=i}}function getCanvasInfo(i,e,n){if(i){const t=n*e,a=i.view[2]-i.view[0],r=n/a,s=window.devicePixelRatio??1,u=i.getViewport({scale:e*r*s}),{width:l,height:y}=u,c=y/l,M=t*c;return{width:t,height:M,canvasWidth:l,canvasHeight:y,fitToWidthRatio:r,viewport:u}}return null}try{PdfViewer.displayName="PdfViewer",PdfViewer.__docgenInfo={description:"",displayName:"PdfViewer",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},file:{defaultValue:null,description:'PDF file data as a "binary" string (array buffer) or PDFSource',name:"file",required:!0,type:{name:"DocumentFile"}},document:{defaultValue:null,description:"Optionally takes a query result document for page count calculation",name:"document",required:!1,type:{name:"QueryResult | null"}},textLayerClassName:{defaultValue:null,description:"Text layer class name",name:"textLayerClassName",required:!1,type:{name:"string"}},disableTextLayer:{defaultValue:{value:"false"},description:"Disable the text layer overlay (defaults to `false`)",name:"disableTextLayer",required:!1,type:{name:"boolean"}},setPageCount:{defaultValue:null,description:"Callback invoked with page count, once `file` has been parsed",name:"setPageCount",required:!1,type:{name:"((count: number) => void)"}},setLoading:{defaultValue:null,description:"Check if document is loading",name:"setLoading",required:!0,type:{name:"(loading: boolean) => void"}},setHideToolbarControls:{defaultValue:null,description:"Callback which is invoked with whether to enable/disable toolbar controls",name:"setHideToolbarControls",required:!1,type:{name:"((disabled: boolean) => void)"}},setRenderedText:{defaultValue:null,description:"Callback for text layer info",name:"setRenderedText",required:!1,type:{name:"((info: PdfRenderedText | null) => any)"}},setIsPdfRenderError:{defaultValue:null,description:"Callback any errors on render",name:"setIsPdfRenderError",required:!1,type:{name:"((isError: boolean) => void)"}},pdfWorkerUrl:{defaultValue:null,description:"URL of hosted PDF worker",name:"pdfWorkerUrl",required:!1,type:{name:"string"}},page:{defaultValue:{value:"1"},description:"Page number, starting at 1",name:"page",required:!1,type:{name:"number"}},scale:{defaultValue:{value:"1"},description:"Zoom factor, where `1` is equal to 100%",name:"scale",required:!1,type:{name:"number"}}}}}catch(i){}var isSymbol=isSymbol_1;function baseExtremum$1(i,e,n){for(var t=-1,a=i.length;++t"",regexString:"\0"},SPACES={normal:i=>" ",regexString:"\\s+"},DOUBLE_QUOTE={normal:i=>'"',regexString:`[${["«","»","“","”","„","‟","❝","❞","⹂","〝","〞","〟","""].join("")}]`},QUOTE={normal:i=>"'",regexString:`[${["‹","›","’","❮","❯","‘","‚","‛","❛","❜","❟"].join("")}]`},SURROGATE_PAIR={normal:i=>"_",regexString:"[\uD800-\uDBFF][\uDC00-\uDFFF]"},DIACRITICAL_MARK={normal:i=>"",regexString:"[̀-ͯ]"},DIACRITICAL_MARK_REGEX=new RegExp(DIACRITICAL_MARK.regexString,"g");function normalizeDiacriticalMarks(i,e=!1){const n=i.normalize("NFD").replace(DIACRITICAL_MARK_REGEX,DIACRITICAL_MARK.normal).normalize("NFC");return e&&n.length!==i.length?n.substring(0,i.length).padEnd(i.length," "):n}const NORMALIZATIONS=[NULL_CHAR,SPACES,DOUBLE_QUOTE,QUOTE,SURROGATE_PAIR,DIACRITICAL_MARK].map(i=>({...i,regex:new RegExp(i.regexString,"g")})),NORMALIZATIONS_REGEX=new RegExp(NORMALIZATIONS.map(i=>`(${i.regexString})`).join("|"),"g");function normalizeText(i){const e=NORMALIZATIONS.reduce((n,t)=>n.replace(t.regex,a=>t.normal(a)),i);return normalizeDiacriticalMarks(e)}class TextNormalizer{constructor(e){ne(this,"rawText");ne(this,"normalizedText");ne(this,"normalizationMappings");this.rawText=e;let n="";const t=l=>{n+=normalizeDiacriticalMarks(l,!0)},a=[],r=NORMALIZATIONS_REGEX;let s=0,u=r.exec(this.rawText);for(;u!=null;){const l=u[0];let y=u[0];for(let M=0;Ms){const M=this.rawText.substring(s,u.index);if(c){const I=[s,u.index],m=[n.length,n.length+M.length];a.push({rawSpan:I,normalizedSpan:m}),t(M),s+=M.length}}if(c){const M=y,I=[u.index,u.index+u[0].length],m=[n.length,n.length+M.length];a.push({rawSpan:I,normalizedSpan:m}),t(M),s=r.lastIndex}u=r.exec(this.rawText)}if(s{if(r<0)return r;const s=this.normalizationMappings.findIndex(({rawSpan:l})=>r=0){const{rawSpan:l,normalizedSpan:y}=this.normalizationMappings[s];return mapCharIndexOnSpans(r,{from:l,to:y})}const u=this.normalizationMappings[this.normalizationMappings.length-1];return r-u.rawSpan[END]+u.normalizedSpan[END]};return[a(n),a(t)]}toRaw(e){const[n,t]=e,a=r=>{if(r<0)return r;const s=this.normalizationMappings.findIndex(({normalizedSpan:l})=>r=0){const{rawSpan:l,normalizedSpan:y}=this.normalizationMappings[s];return mapCharIndexOnSpans(r,{from:y,to:l})}const u=this.normalizationMappings[this.normalizationMappings.length-1];return r-u.normalizedSpan[END]+u.rawSpan[END]};return[a(n),a(t)]}normalize(e){return normalizeText(e)}isBlank(e){return e.length===0||e.trim().length===0||!!e.match(/^\s*$/)}}function mapCharIndexOnSpans(i,{from:e,to:n}){return spanLen(e)===spanLen(n)?n[START]+(i-e[START]):n[START]+Math.round((i-e[START])*(spanLen(n)/spanLen(e)))}function optimizeSpanMappings(i){const e=t=>spanLen(t.normalizedSpan)===spanLen(t.rawSpan),n=(t,a)=>a.normalizedSpan[START]-t.normalizedSpan[START]===a.rawSpan[START]-t.rawSpan[START];return i.reduce((t,a)=>{const r=t.length>0?t[t.length-1]:null;return e(a)&&r&&e(r)&&n(r,a)?(r.normalizedSpan[END]=a.normalizedSpan[END],r.rawSpan[END]=a.rawSpan[END],t):(t.push(a),t)},[])}function findLargestIndex(i,e,n,t){if(e-i<1)return null;const a=t?i+Math.floor((e-i)/2):e-1,r=n(a);if(r!=null)if(e-(a+1)>0){const s=findLargestIndex(a+1,e,n,!0);return s||{index:a,value:r}}else return{index:a,value:r};else if(a-i>0){const s=findLargestIndex(i,a,n,!0);return s||null}else return null}const MAX_HISTORY=3;class TextProvider{constructor(e){ne(this,"fieldText");ne(this,"remainingSpans");ne(this,"history",[0]);this.fieldText=e,this.remainingSpans=[[0,e.length]]}getMatches(e,n={}){const{minLength:t=1,maxLength:a=e.length,searchSpan:r}=n,s=findLargestIndex(t,a+1,u=>{const l=u,y=e.substring(0,l),c=[];for(const M of this.remainingSpans){const I=r?spanIntersection(r,M):M;if(spanLen(I)<=0)continue;const[m,g]=I,f=this.fieldText.slice(m,g),C=f.indexOf(y);if(C>=0){const v=m+C,b=v+y.length,h=this.history.map(d=>{const p=v-d;return p>=0?p:Number.MAX_SAFE_INTEGER}),o=M[0]{const p=spanIntersection([b,this.fieldText.length],d);return spanGetText(this.fieldText,p)}).join("")})}}return c.length>0?c:null});return s?s.value:[]}consume(e){const n=[];this.remainingSpans.forEach(a=>{spanIntersects(e,a)?(a[START]!(spanIncludesIndex(e,a)||!this.remainingSpans.some(r=>spanIncludesIndex(r,a))));this.history=t.slice(0,MAX_HISTORY)}}const debugOut$4=Debug("pdf:mapping:MappingSourceTextProvider");function debug$4(...i){debugOut$4==null||debugOut$4.apply(null,i)}class MappingSourceTextProvider{constructor(e){ne(this,"cell");ne(this,"normalizer");ne(this,"provider");this.cell=e,this.normalizer=new TextNormalizer(e.text),this.provider=new TextProvider(this.normalizer.normalizedText)}getMatch(e,n={}){const{minLength:t=1,searchSpan:a}=n,r=this.normalizer.normalize(e),s=a&&this.normalizer.toNormalized(a);debug$4('getMatch "%s", normalized "%s", minLength = %d',e,r,t);const u=this.provider.getMatches(r,{minLength:t,searchSpan:s});debug$4("normalized matches: %o",u);const l=minBy$1(u,I=>I.minHistoryDistance);if(!l)return debug$4("getMatch result: null"),null;const y=this.normalizer.toRaw(l.span),c=this.normalizer.toRaw([l.span[START]-l.skipText.length,l.span[START]]),M={span:y,skipText:spanGetText(this.cell.text,c),score:spanLen(y)-l.minHistoryDistance,approxLenAfterEnd:l.textAfterEnd.length};return debug$4("getMatch result: %o",M),M}consume(e){const n=this.normalizer.toNormalized(e);this.provider.consume(n),debug$4("text span consumed %o",e)}isBlank(e){return this.normalizer.isBlank(e)}}function bboxGetSpanByRatio(i,e,n){const t=spanIntersection([0,e],n);if(e===0||spanLen(t)<=0)return[i[0],i[1],i[0],i[3]];const[a,r]=n,[s,u,l,y]=i,c=l-s,M=s+c/e*a,I=s+c/e*r;return[M,u,I,y]}function isNextToEachOther(i,e){const[t,a,r,s]=i,[u,l,y,c]=e,M=s-a,I=c-l;if(!(M*.8t.text),nextCellIndex:this.cursor}}consume(e){const n=[];if(e<=0)return n;let t=e;const a=[...this.cells];for(;t>0&&this.cursor0){const u=new TextNormalizer(s);return this.current={nextCellIndex:t,normalizer:u,leadingSpaces:r},!0}this.cellProvider.skip()}return this.current=null,!1}getNextInfo(){return{text:this.current.normalizer.normalizedText,index:this.current.nextCellIndex}}consume(e){const n=this.current.normalizer.toRaw([0,e]),t=this.current.leadingSpaces+n[END];return this.current=null,this.cellProvider.consume(t)}skip(){this.current=null,this.cellProvider.skip()}rewind(){this.current=null,this.cellProvider.rewind()}}var baseAssignValue=_baseAssignValue,createAggregator=require_createAggregator(),objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,groupBy=createAggregator(function(i,e,n){hasOwnProperty.call(i,n)?i[n].push(e):baseAssignValue(i,n,[e])}),groupBy_1=groupBy;const groupBy$1=getDefaultExportFromCjs(groupBy_1),debugOut$3=Debug("pdf:mapping:TextBoxMapping");function debug$3(...i){debugOut$3==null||debugOut$3.apply(null,i)}class TextBoxMappingImpl{constructor(e){ne(this,"mappingEntryMap");this.mappingEntryMap=groupBy$1(e,n=>n.text.cell.id),Object.values(this.mappingEntryMap).forEach(n=>{n.sort((t,a)=>spanCompare(t.text.span,a.text.span))}),debug$3("TextBoxMapping created"),debug$3(this)}getEntries(e,n){return(this.mappingEntryMap[e.id]||[]).filter(t=>spanIntersects(t.text.span,n))}apply(e,n){const t=n||[0,e.text.length],{cell:a,span:r}=e.getNormalized(),s=r?spanFromSubSpan(r,t):t;debug$3("applying TextBoxMapping"),debug$3(e,t);const l=this.getEntries(a,s).map(y=>{if(y.box){let c;if(equalsSpanText(y.text.cell,y.text.span,e,s))c=spanGetSubSpan(y.text.span,s);else{const M=new TextNormalizer(y.text.cell.text),I=spanGetSubSpan(M.toNormalized(y.text.span),M.toNormalized(s));c=new TextNormalizer(y.box.cell.text).toRaw(I)}return{cell:y.box.cell.getPartial(c),sourceSpan:spanIntersection(y.text.span,s)}}else return{cell:null,sourceSpan:y.text.span}});return debug$3("applying TextBoxMapping - result"),debug$3(l),l}}class TextBoxMappingBuilder{constructor(){ne(this,"mappingEntries",[])}addMapping(e,n){this.mappingEntries.push({text:e,box:n}),debug$3(">> added a new mapping entry (%o) => (cell: %o)",e,e,n==null?void 0:n.cell)}toTextBoxMapping(){return new TextBoxMappingImpl(this.mappingEntries)}}function equalsSpanText(i,e,n,t){const a=i.text.substring(...e),r=n.text.substring(...t);return a===r}const debugOut$2=Debug("pdf:mapping:getTextBoxMapping");function debug$2(...i){debugOut$2==null||debugOut$2.apply(null,i)}function getTextBoxMappings(i,e){debug$2("getTextBoxMapping: enter");const n=new Target(e),t=new Source(i,e),a=new TextBoxMappingBuilder;for(const r of[27,9,3,1])debug$2("getTextBoxMapping: processText with minMatchLength: %d",r),n.processText((s,u,l)=>{if(u.length{const I=y.markSourceAsMapped(M.text);I&&a.addMapping({cell:y.cell,span:I},{cell:M})}),y.markAsMapped())});return a.toTextBoxMapping()}class Target{constructor(e){ne(this,"targetProvider");this.targetProvider=new MappingTargetBoxProvider(e.cells)}processText(e){for(;this.targetProvider.hasNext();){const{index:n,text:t}=this.targetProvider.getNextInfo();debug$2("> find match at index %d, text: %s",n,t);let a=!1;e(n,t,s=>{if(s>0){a=!0;const u=this.targetProvider.consume(s);return debug$2("> raw target cells for matched length: %d",s),debug$2(u),u.map(l=>l.trim()).filter(l=>l.text.length>0)}return[]}),a||this.targetProvider.skip()}this.targetProvider.rewind()}}class Source{constructor(e,n){ne(this,"sourceProviders");ne(this,"targetIndexToSources");this.sourceProviders=e.cells.map(t=>new MappingSourceTextProvider(t)),this.targetIndexToSources=n.cells.map(t=>{const a=e.cells.map((r,s)=>bboxesIntersect(r.bbox,t.bbox)?{cell:r,provider:this.sourceProviders[s]}:null).filter(nonEmpty);return a.some(({cell:r})=>r.isInHtmlBbox)?a.filter(({cell:r})=>r.isInHtmlBbox):a})}findMatch(e,n,t=1){const a=this.targetIndexToSources[e],r=Source.findBestMatch(a,n,t);if(debug$2("> source cell(s) matched: %o",r),!(r!=null&&r.match)||spanLen(r.match.span){const c=l.getMatch(y,{searchSpan:u});return c!=null&&c.span&&l.consume(c.span),debug$2(">> target cell %o to source %o",y,c),c==null?void 0:c.span},markAsMapped:()=>{l.consume(u)}}}static findBestMatch(e,n,t){const a=e.map(l=>{const y=l.provider.getMatch(n,{minLength:t});return{...l,match:y}});let r=0;const s=a.map(l=>{const{match:y}=l,c=y?r+y.skipText.length-spanLen(y.span):Number.MAX_SAFE_INTEGER;return r+=(y==null?void 0:y.approxLenAfterEnd)??0,{...l,cost:c}});return minBy$1(s,l=>l.cost)}}class BaseTextLayoutCell{constructor({parent:e,id:n,pageNum:t,bbox:a,text:r}){ne(this,"parent");ne(this,"id");ne(this,"pageNum");ne(this,"bbox");ne(this,"text");this.parent=e,this.id=n,this.pageNum=t,this.bbox=a,this.text=r}getPartial(e){return new PartialTextLayoutCell(this,e)}getNormalized(){return{cell:this}}getBboxForTextSpan(e,n){return n!=null&&n.useRatio?bboxGetSpanByRatio(this.bbox,this.text.length,e):null}trim(){return trimCell(this)}}class PartialTextLayoutCell{constructor(e,n){ne(this,"base");ne(this,"span");this.base=e,this.span=spanIntersection([0,e.text.length],n)}get text(){return spanGetText(this.base.text,this.span)}getPartial(e){const n=spanIntersection(this.span,spanOffset(e,this.span[START]));return new PartialTextLayoutCell(this.base,n)}getNormalized(){return{cell:this.base,span:this.span}}trim(){return trimCell(this)}}function trimCell(i){const e=i.text,n=e.match(/^\s*/)[0].length,t=e.match(/\s*$/)[0].length;return n===0&&t===0?i:e.length>n+t?i.getPartial([n,e.length-t]):i.getPartial([0,0])}class HtmlBboxTextLayout{constructor(e,n){ne(this,"bboxInfo");ne(this,"cells");var t;this.bboxInfo=e,this.cells=((t=e.bboxes)==null?void 0:t.filter(a=>a.page===n).map((a,r)=>new HtmlBboxTextLayoutCell(this,r,a)))??[]}cellAt(e){return this.cells[e]}installStyle(){this.bboxInfo.styles}}class HtmlBboxTextLayoutCell extends BaseTextLayoutCell{constructor(n,t,a){const r=t,s=a.page,u=[a.left,a.top,a.right,a.bottom],l=decodeHTML(a.innerTextSource??"");super({parent:n,id:r,pageNum:s,bbox:u,text:l});ne(this,"processedBbox");this.processedBbox=a}getBboxForTextSpan(n,t){return this.processedBbox!=null,super.getBboxForTextSpan(n,t)}}const debugOut$1=Debug("pdf:textLayout:dom");function debug$1(...i){debugOut$1==null||debugOut$1.apply(null,i)}function getAdjustedCellByOffsetByDom(i,e,n,t){var s;if(!(n.firstChild instanceof Text)||!(n.lastChild instanceof Text))return debug$1("unexpected. span dont have text node"),null;const a=e[START],r=Math.min(i.text.length,e[END]);try{const{textNode:u,textOffset:l}=a>0?getTextNodeAndOffset(n,a):{textNode:n.firstChild,textOffset:0},{textNode:y,textOffset:c}=r>0?getTextNodeAndOffset(n,r):{textNode:n.lastChild,textOffset:n.lastChild.length};debug$1("finding text node for: ",i.text),debug$1(" textContent: ",u.textContent),debug$1(" beginOffset: ",l),debug$1(" textContent: ",y.textContent),debug$1(" endOffset: ",c);let[M,I,m,g]=i.bbox;const f=(s=n.parentElement)==null?void 0:s.getBoundingClientRect();return forEachRectInRange(u,l,y,c,C=>{M=(C.left-f.left)/t,m=M+C.width/t}),[M,I,m,g]}catch(u){debug$1("Caught exception on calculating bbox from DOM: ",u)}return null}class PdfTextContentTextLayout{constructor(e,n,t){ne(this,"textContentInfo");ne(this,"cells");ne(this,"divs");this.textContentInfo=e;const a=e.textContent.items;this.cells=a.map((r,s)=>{var y;const u=getBbox(r,this.viewport);let l=!1;return(y=t==null?void 0:t.bboxes)!=null&&y.length&&(l=t.bboxes.some(c=>bboxesIntersect(u,[c.left,c.top,c.right,c.bottom]))),new PdfTextContentTextLayoutCell(this,s,r,n,u,l)})}get viewport(){return this.textContentInfo.viewport}cellAt(e){return this.cells[e]}setDivs(e){this.divs=e}divAt(e){var n;return(n=this.divs)==null?void 0:n[e]}}class PdfTextContentTextLayoutCell extends BaseTextLayoutCell{constructor(n,t,a,r,s,u){const l=t,y=a.str;super({parent:n,id:l,pageNum:r,bbox:s,text:y});ne(this,"isInHtmlBbox");this.isInHtmlBbox=u}getBboxForTextSpan(n,t){const a=this.parent.divAt(this.id);if(a&&a.parentNode){const r=this.parent.viewport.scale,s=getAdjustedCellByOffsetByDom(this,n,a,r);if(s)return s}return super.getBboxForTextSpan(n,t)}}function getBbox(i,e){const{transform:n}=i,t=e,a=t.rotation%180!==0,[r,,s,u,l,y]=n,[c,M,,I]=t.viewBox,m=a?l+s+M:I-(y+u),g=a?y-c:l-c,f=m+r,C=r*.2;return[g,m+C,g+i.width,f+C]}function getDocFieldValue(i,e,n,t){let a;const r=i[e];if(!Array.isArray(r)&&!n?a=r:a=r==null?void 0:r[n??0],e==="table"&&typeof a=="object"&&typeof(a==null?void 0:a.table_text)=="string")return a.table_text;if(typeof a=="string")return t?Array.isArray(t)?a.substring(t[0],t[1]):a.substring(t.begin,t.end):a}async function extractDocumentInfo(i,e={}){const n=i.html,t=getTextMappings(i)??void 0,a=await processDoc({...i,docHtml:n},{sections:!0,bbox:!0,bboxInnerText:!0,...e});if(!a.bboxes)throw Error("Unexpected result from processDoc");return{processedDoc:a,textMappings:t}}class TextMappingsTextLayout{constructor(e,n){ne(this,"cells");const{textMappings:t,document:a}=e;this.cells=t.text_mappings.filter(r=>r.page.page_number===n).map((r,s)=>new TextMappingsTextLayoutCell(this,s,a,r))}cellAt(e){return this.cells[e]}getHighlight(e){const n=[e.location.begin,e.location.end];return this.cells.filter(a=>{const{cellField:r}=a;return r.name===e.field&&r.index===e.fieldIndex&&spanIntersects(r.span,n)}).map(a=>{const{cellField:r}=a,s=spanIntersection(r.span,n);if(spanContains(n,r.span))return{cell:a,sourceSpan:s};const u=spanGetSubSpan(r.span,s);return{cell:a.getPartial(u),sourceSpan:s}})}}class TextMappingsTextLayoutCell extends BaseTextLayoutCell{constructor(n,t,a,r){const s=t,u=r.page.page_number,l=r.page.bbox,y=getDocFieldValue(a,r.field.name,r.field.index,r.field.span)??"";super({parent:n,id:s,pageNum:u,bbox:l,text:y});ne(this,"cellField");this.cellField=r.field}}const debugOut=Debug("pdf:Highlighter");function debug(...i){debugOut==null||debugOut.apply(null,i)}class Highlighter{constructor({document:e,textMappings:n,pageNum:t,htmlBboxInfo:a,pdfTextContentInfo:r}){ne(this,"pageNum");ne(this,"textMappingsLayout");ne(this,"pdfTextContentLayout",null);ne(this,"textToHtmlBboxMappings",null);ne(this,"textToPdfTextItemMappings",null);this.pageNum=t,this.textMappingsLayout=new TextMappingsTextLayout({document:e,textMappings:n},t),a&&this.setHtmlBboxInfo(a),r&&this.setTextContentItems(r.textContent,r.viewport,r.spans,a)}setHtmlBboxInfo(e){const n=new HtmlBboxTextLayout(e,this.pageNum);this.textToHtmlBboxMappings=getTextBoxMappings(this.textMappingsLayout,n)}setTextContentItems(e,n,t,a){this.pdfTextContentLayout=new PdfTextContentTextLayout({textContent:e,viewport:n},this.pageNum,a),this.textToPdfTextItemMappings=getTextBoxMappings(this.textMappingsLayout,this.pdfTextContentLayout),this.setTextContentDivs(t)}setTextContentDivs(e){var n;(n=this.pdfTextContentLayout)==null||n.setDivs(e)}getHighlight(e){debug("getHighlight: %o",e);const{id:n,field:t,fieldIndex:a,location:r,className:s,facetId:u,value:l,...y}=e,c=this.getHighlightTextMappingResult({field:t,fieldIndex:a,location:r});debug("getHighlight - items: %o",c);const M=c.map((I,m)=>{var C;const{cell:g,span:f}=((C=I.cell)==null?void 0:C.getNormalized())||{};if(g){let v=g.bbox;return f&&(v=g.getBboxForTextSpan(f)||g.getBboxForTextSpan(f,{useRatio:!0})||g.bbox),debug("getHighlight - cell(%i): %o",I.cell),debug(" box: %o",v),{bbox:v,isStart:m===0,isEnd:m===c.length-1}}return debug("getHighlight - cell(%i) is not mapped. source span: %o",I.sourceSpan),null}).filter(nonEmpty);return{highlightId:Highlighter.getId(e),boxes:Highlighter.optimizeHighlightBoxes(M),className:s,facetId:u,value:l,...y}}getHighlightTextMappingResult(e){let n=this.textMappingsLayout.getHighlight(e);const t=(s,u,l,y)=>flatMap$1(s,c=>{if(c.cell){const{cell:M}=c.cell.getNormalized();if(M.parent===l){const I=u.apply(c.cell);return I.length===0&&(y!=null&&y.retainUnmapped)?[c]:I.map(({cell:m,sourceSpan:g})=>({cell:m,sourceSpan:spanOffset(g,c.sourceSpan[START])}))}return c}return[]}),{textToPdfTextItemMappings:a,textToHtmlBboxMappings:r}=this;return a&&(n=t(n,a,this.textMappingsLayout,{retainUnmapped:!0})),r&&(n=t(n,r,this.textMappingsLayout)),n}static optimizeHighlightBoxes(e){return e.reduce((n,t)=>{const a=n.length===0?null:n[n.length-1];if(a&&isNextToEachOther(a.bbox,t.bbox)){const[r,s,u,l]=a.bbox,[y,c,M,I]=t.bbox;a.bbox=[Math.min(r,y),Math.min(s,c),Math.max(u,M),Math.max(l,I)]}else n.push(t);return n},[])}static getId(e){return e.id?e.id:`${e.field}[${e.fieldIndex}]___${e.location.begin}_${e.location.end}`}}const DEFAULT_HIGHLIGHT_ID="highlight";function getIndexForOffset(i,e){let n=!1,t=0;for(;!n&&t({page:u,bbox:[t,r,a,s]}))}]}function getShapeFromBboxHighlight(i,e){return i.map(n=>{const t=n.bboxes.filter(a=>a.page===e).map((a,r,s)=>({bbox:a.bbox,isStart:r===0,isEnd:r===s.length-1}));return t.length>0?{highlightId:n.id||`${t[0].bbox[0]}__${t[0].bbox[1]}`,className:n.className,boxes:t}:null}).filter(nonEmpty)}const base=`${settings_1.prefix}--document-preview-pdf-viewer-highlight`,baseHighlightColor=`${settings_1.prefix}--category`,baseHighlightColorActive=`${settings_1.prefix}--active`,baseOverlapHighlight=`${settings_1.prefix}--overlap-highlight`,basePassThroughActive=`${settings_1.prefix}--overlap-active-pass-through`,PdfHighlight=({className:i,highlightClassName:e,activeHighlightClassName:n,document:t,parsedDocument:a,page:r,highlights:s,boxHighlights:u,activeIds:l,pdfRenderedText:y,scale:c,facetInfoMap:M={},overlapMeta:I=initOverlapMeta(),_useHtmlBbox:m=!0,_usePdfTextItem:g=!0})=>{const f=useHighlighter({document:t,textMappings:a==null?void 0:a.textMappings,processedDoc:m?a==null?void 0:a.processedDoc:void 0,pdfRenderedText:g&&y||void 0,pageNum:r,isReady:!!a&&!!s&&(!g||(y==null?void 0:y.page)===r)}),{textDivs:C}=y||{},v=reactExports.useMemo(()=>u?getShapeFromBboxHighlight(u,r):(f==null||f.setTextContentDivs(C),f?(s||[]).map(p=>f.getHighlight(p)):[]),[u,f,s,r,C]),[b,h]=reactExports.useState(initAction()),o=reactExports.useCallback(p=>{h(p)},[h]),d=reactExports.useRef(null);return useScrollIntoActiveHighlight(d,v,l),jsxRuntimeExports.jsxs("div",{ref:d,className:cx(base,i),children:[jsxRuntimeExports.jsx(TooltipHighlight,{parentDiv:d,tooltipAction:b}),v.map(p=>{const w=l==null?void 0:l.includes(p.highlightId);return jsxRuntimeExports.jsx(Highlight,{className:e,activeClassName:n,shape:p,scale:c,active:w,onTooltipShow:o,facetInfoMap:M,overlapMeta:I},p.highlightId)})]})},Highlight=({className:i,activeClassName:e,shape:n,scale:t,onTooltipShow:a,facetInfoMap:r={},overlapMeta:s=initOverlapMeta(),active:u})=>{const l=reactExports.useRef(null);if((n==null?void 0:n.boxes.length)===0)return null;const y=m=>{var o;const g=m.target,f=g.getAttribute("data-value")||"",C=((o=g.parentElement)==null?void 0:o.getAttribute("data-highlight-id"))||"",v=g.getAttribute("data-facetid")||"",b=l.current,h=calcToolTipContent(r,s,v,f,C);a({tooltipEvent:TooltipEvent.ENTER,rectActiveElement:b==null?void 0:b.getBoundingClientRect(),...h&&{tooltipContent:h}})},c=()=>{a({tooltipEvent:TooltipEvent.LEAVE})},M=s.fieldIdWithOverlap.has(n.highlightId);let I=[`${base}__item`,i,n.className,u&&`${base}__item--active`,u&&e];return n.facetId&&(M?I.push(baseOverlapHighlight,u&&baseHighlightColorActive,u&&`${baseHighlightColor}-${n.facetId} highlight`,u&&basePassThroughActive):I.push(`${baseHighlightColor}-${n.facetId} highlight`,u&&baseHighlightColorActive)),I=I.filter(m=>typeof m=="string"),jsxRuntimeExports.jsx("div",{"data-highlight-id":n.highlightId,"data-testid":n.highlightId,children:n==null?void 0:n.boxes.map(m=>jsxRuntimeExports.jsx("div",{className:I.join(" "),style:{...getPositionStyle(m.bbox,t)},onMouseEnter:y,onMouseLeave:c,ref:l,"data-value":n.value||"","data-facetid":n.facetId||""},`${m.bbox[0].toFixed(2)}_${m.bbox[1].toFixed(2)}`))})};function getPositionStyle(i,e,n=0){const[t,a,r,s]=i;return{left:`${(t-n)*e}px`,top:`${(a-n)*e}px`,width:`${(r-t+n)*e}px`,height:`${(s-a+n)*e}px`}}const useHighlighter=({document:i,textMappings:e,processedDoc:n,pdfRenderedText:t,pageNum:a,isReady:r})=>reactExports.useMemo(()=>r&&i&&e?new Highlighter({document:i,textMappings:e,pageNum:a,htmlBboxInfo:n&&{bboxes:n.bboxes,styles:n.styles},pdfTextContentInfo:t!=null&&t.textContent&&(t!=null&&t.viewport)?t:void 0}):null,[i,r,a,t,n,e]);function useScrollIntoActiveHighlight(i,e,n){reactExports.useEffect(()=>{if(!i.current)return;const t=e.find(a=>(a==null?void 0:a.highlightId)&&(n==null?void 0:n.includes(a.highlightId)));if(t){let a=setTimeout(()=>{var u;a=null;const r=i.current;if(!r)return;const s=r==null?void 0:r.querySelector(`[data-highlight-id=${t.highlightId}]`);(u=s==null?void 0:s.firstElementChild)==null||u.scrollIntoView({block:"nearest",inline:"nearest"})},0);return()=>{a&&clearTimeout(a)}}},[n,i,e])}try{PdfHighlight.displayName="PdfHighlight",PdfHighlight.__docgenInfo={description:"Text highlight layer for PdfViewer",displayName:"PdfHighlight",props:{page:{defaultValue:null,description:"Page number, starting at 1",name:"page",required:!0,type:{name:"number"}},scale:{defaultValue:null,description:"Zoom factor, where `1` is equal to 100%",name:"scale",required:!0,type:{name:"number"}},highlightClassName:{defaultValue:null,description:"Class name to style each highlight",name:"highlightClassName",required:!1,type:{name:"string"}},activeHighlightClassName:{defaultValue:null,description:"Class name to style each active highlight",name:"activeHighlightClassName",required:!1,type:{name:"string"}},document:{defaultValue:null,description:"Document data returned by query",name:"document",required:!1,type:{name:"QueryResult"}},highlights:{defaultValue:null,description:"Highlight spans on fields in document",name:"highlights",required:!1,type:{name:"DocumentFieldHighlight[]"}},activeIds:{defaultValue:null,description:"Active highlight IDs",name:"activeIds",required:!1,type:{name:"string[]"}},setCurrentPage:{defaultValue:null,description:"callback to be notified page change by scrollIntoActiveId",name:"setCurrentPage",required:!1,type:{name:"((page: number) => any)"}},_useHtmlBbox:{defaultValue:{value:"true"},description:`Consider bboxes in HTML field to highlight. True by default. This is for testing purpose.`,name:"_useHtmlBbox",required:!1,type:{name:"boolean"}},_usePdfTextItem:{defaultValue:{value:"true"},description:`Flag to whether to use PDF text items for finding bbox for highlighting. True by default. This is for testing and debugging purpose.`,name:"_usePdfTextItem",required:!1,type:{name:"boolean"}},className:{defaultValue:null,description:"Class name to style highlight layer",name:"className",required:!1,type:{name:"string"}},parsedDocument:{defaultValue:null,description:"Parsed document information",name:"parsedDocument",required:!0,type:{name:"ExtractedDocumentInfo | null"}},pdfRenderedText:{defaultValue:null,description:"PDF text content information in a page from parsed PDF",name:"pdfRenderedText",required:!0,type:{name:"PdfRenderedText | null"}},boxHighlights:{defaultValue:null,description:"Highlight bboxes. This overrides `highlights` props",name:"boxHighlights",required:!1,type:{name:"DocumentBboxHighlight[]"}},facetInfoMap:{defaultValue:{value:"{}"},description:"Meta-data on facets",name:"facetInfoMap",required:!1,type:{name:"FacetInfoMap"}},overlapMeta:{defaultValue:{value:"initOverlapMeta()"},description:"Overlap information used by tooltip",name:"overlapMeta",required:!1,type:{name:"OverlapMeta"}}}}}catch(i){}const PdfViewerWithHighlight=reactExports.forwardRef(({highlightClassName:i,activeHighlightClassName:e,document:n,page:t,highlight:a,highlights:r,activeIds:s,facetInfoMap:u,overlapMeta:l,_useHtmlBbox:y,_usePdfTextItem:c,_isPdfRenderError:M=!1,setCurrentPage:I,setIsPdfRenderError:m,...g},f)=>{const C=`${settings_1.prefix}--category`,{scale:v}=g,b={highlightClassName:i,activeHighlightClassName:e,document:n,_useHtmlBbox:y,_usePdfTextItem:c},h=10,[o,d]=reactExports.useState(null),p=isTable(a),[w,x]=reactExports.useState(void 0);reactExports.useEffect(()=>{async function L(){if(n){const O=await extractDocumentInfo(n,{tables:p});x(O)}}L()},[n,p]);const D=useHighlightState({queryHighlight:a,fieldHighlights:r,activeIds:s,document:n,documentInfo:w}),T=useMovePageToActiveHighlight(t,D.activePages,D.activeIds,I),P=useIsPfdError(M,m),E=Object.values(u||{}).map(L=>{const O=L.facetId.localeCompare(OVERLAP_ID)===0?`z-index: ${h};`:"";return` .${C}-${L.facetId}.highlight { diff --git a/docs/storybook/assets/SearchInput.stories-9alKyATr.js b/docs/storybook/assets/SearchInput.stories-8iSDtAS4.js similarity index 98% rename from docs/storybook/assets/SearchInput.stories-9alKyATr.js rename to docs/storybook/assets/SearchInput.stories-8iSDtAS4.js index bc9d76377..3bc9734d3 100644 --- a/docs/storybook/assets/SearchInput.stories-9alKyATr.js +++ b/docs/storybook/assets/SearchInput.stories-8iSDtAS4.js @@ -1,4 +1,4 @@ -import{j as t}from"./jsx-runtime-FsUICBgo.js";import{d as c}from"./index-777x7qAF.js";import{r as s}from"./index-RfLt4OUa.js";import{S as fe,a as Se}from"./Search-TSjiQ7A7.js";import{L as Q}from"./index-o5OFstPD.js";import{w as xe,F as ye,o as Ce,S as Ae,b as be,u as je,D as G,a as we}from"./chunk-WFFRPTHA-XxQL4zvM.js";import{v as _e}from"./v4-yQnnJER4.js";import{s as M}from"./Button-KibTbxDG.js";import{S as ve}from"./SearchResults-M91Z8TUW.js";import{S as J,D as Te,c as De}from"./storybookUtils-P7YVKdto.js";import"./callBound-4MCeDK1M.js";import"./pickBy-llkn_6s3.js";import"./isPlainObject-g73re4jY.js";import"./index-xck8ovCi.js";import"./preview-errors-Ix78kkVy.js";import"./debounce-eWC8LGMf.js";import"./index-4QtD-hFu.js";import"./bucket-5-3bTeVNTN.js";import"./index-tUYgphcS.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./getDocumentTitle-Zh1PemE-.js";import"./Link-_yif9kZE.js";import"./purify.es-29Q0w72t.js";import"./bucket-25-SwNT5LZP.js";import"./formatMessage-wl7oTduw.js";const Ie=(a,r)=>{const[n,l]=s.useState(a);return s.useEffect(()=>{const p=window.setTimeout(()=>{l(a)},r);return()=>{window.clearTimeout(p)}},[r,a]),n},E={placeholderText:"Search",closeButtonLabelText:"Clear search input"},Ee=({className:a,id:r,splitSearchQuerySelector:n=" ",completionsCount:l=5,showAutocomplete:p,minCharsToAutocomplete:g=0,spellingSuggestions:$,messages:Z=E,autocompleteDelay:ee=200,placeHolderText:$e,labelText:Le,closeButtonLabelText:Pe,onChange:L,...P})=>{const b={...E,...Z},f=s.useMemo(()=>r||`search-input__${_e()}`,[r]),m=`${M.prefix}--search-autocompletion`,te=[a,`${M.prefix}--search-input--discovery`],{searchResponseStore:{parameters:d},autocompletionStore:{data:B},componentSettings:j}=s.useContext(Ae),w={showAutocomplete:p??(j==null?void 0:j.autocomplete)??!0},{performSearch:oe,fetchAutocompletions:N,setAutocompletionOptions:F,setSearchParameters:S}=s.useContext(be),[u,_]=s.useState(d.naturalLanguageQuery||""),v=B&&B.completions||[],h=u.split(n).pop(),[se,re]=s.useState(!1),[ne,k]=s.useState(!1);let i=null;s.useEffect(()=>{_(d.naturalLanguageQuery||"")},[d.naturalLanguageQuery]);const ae=e=>{const o=e.currentTarget;_(o?o.value:"")},R=e=>{const o=u.split(n),D=o.pop(),I=v?v[e]:D;o.push(I||""),_(`${o.join(n)}${n}`);const O=document.getElementById(`${f}_input_field`);O!==null&&O.focus()},ce=je(e=>({...d,naturalLanguageQuery:e,offset:0,filter:""}),[d]),le=e=>o=>{o.key==="Enter"&&R(e)},ue=e=>()=>{R(e)},ie=e=>{oe(ce(e)),L&&L(e);const o=document.getElementById(`${f}_input_field`);o!==null&&o.blur()},T=Ie(u,ee);s.useEffect(()=>{S(e=>({...e,naturalLanguageQuery:T})),se?re(!1):N(T)},[T,N,S]),s.useEffect(()=>{F({updateAutocompletions:w.showAutocomplete,completionsCount:l,minCharsToAutocomplete:g,splitSearchQuerySelector:n})},[w.showAutocomplete,l,g,n,F]),s.useEffect(()=>{S(e=>({...e,spellingSuggestions:!!$}))},[S,$]);const pe=e=>{e.key==="Enter"&&ie(u)};s.useEffect(()=>function(){i&&clearTimeout(i)},[i]);const me=()=>{i&&clearTimeout(i),k(!0)},de=()=>{i=setTimeout(()=>{k(!1)},0)},he=h!==""&&w.showAutocomplete&&ne,ge=v.map((e,o)=>{const D=u.slice(0,u.length-h.length);if(e.startsWith(h)){const I=e.slice(h.length);return t.jsx(Q,{className:`${m}__wrapper`,children:t.jsxs(Q.Field,{role:"listitem",id:`autocompletion_${o}_field`,tabIndex:"0",className:`${m}__item`,onClick:ue(o),onKeyUp:le(o),children:[t.jsx("div",{className:`${m}__icon`,children:t.jsx(fe,{})}),t.jsxs("div",{className:`${m}__term`,children:[D,t.jsx("strong",{children:h}),I]})]})},`autocompletion_${o}`)}return null});return t.jsx("div",{className:te.join(" "),id:f,"data-testid":"search-input-test-id",onBlur:de,children:t.jsxs("div",{onFocus:me,children:[t.jsx(Se,{onKeyUp:pe,onChange:ae,value:u,id:`${f}_input_field`,labelText:P.labelText||b.placeholderText,placeholder:b.placeholderText,closeButtonLabelText:b.closeButtonLabelText,...P}),he&&t.jsx("div",{className:m,"data-testid":"completions-dropdown-test-id",children:ge})]})})},W=xe(Ee,ye("SearchInput"),Ce),C=()=>({className:c.text("Classname to pass in your own styling (className)",""),id:c.text("Html element ID (id)",""),splitSearchQuerySelector:c.text("String to split words on for autocompletion (splitSearchQuerySelector)"," "),spellingSuggestions:c.boolean("Fetch spelling suggestions (spellingSuggestions)",!0),completionsCount:c.number("Number of autocompletion results to show (completionsCount)",5),showAutocomplete:c.boolean("Show dropdown of autocomplete suggestions (showAutocomplete)",!0),minCharsToAutocomplete:c.number("Minimum characters in last word before showing autocomplete suggestions (minCharsToAutocomplete)",1),messages:c.object("Default messages for the component's text strings",E),autocompleteDelay:c.number("Milliseconds to delay the autocomplete API requests (autocompleteDelay)",200)});let A=[];const X=(a,r)=>{const n=[];for(let l=0;l({searchClient:new We,projectId:c.text("Project ID","project-id"),overrideAutocompletionResults:{completions:A}}),ct={title:"SearchInput",parameters:{component:W}},x={render:()=>(A=X(C().completionsCount,""),t.jsx(J,{children:t.jsx(G,{...Y(),children:t.jsx(W,{...C()})})})),name:"default"},y={render:()=>{const a={...Y(),overrideQueryParameters:{naturalLanguageQuery:"Waston"},overrideSearchResults:{suggested_query:"Watson"}};return t.jsx(J,{children:t.jsxs(G,{...a,children:[t.jsx(W,{...C()}),t.jsx(ve,{})]})})},name:"with spelling suggestions"};var V,H,K;x.parameters={...x.parameters,docs:{...(V=x.parameters)==null?void 0:V.docs,source:{originalSource:`{ +import{j as t}from"./jsx-runtime-FsUICBgo.js";import{d as c}from"./index-777x7qAF.js";import{r as s}from"./index-RfLt4OUa.js";import{S as fe,a as Se}from"./Search-TSjiQ7A7.js";import{L as Q}from"./index-o5OFstPD.js";import{w as xe,F as ye,o as Ce,S as Ae,b as be,u as je,D as G,a as we}from"./chunk-WFFRPTHA-XxQL4zvM.js";import{v as _e}from"./v4-yQnnJER4.js";import{s as M}from"./Button-KibTbxDG.js";import{S as ve}from"./SearchResults-huRufqlh.js";import{S as J,D as Te,c as De}from"./storybookUtils-P7YVKdto.js";import"./callBound-4MCeDK1M.js";import"./pickBy-llkn_6s3.js";import"./isPlainObject-g73re4jY.js";import"./index-xck8ovCi.js";import"./preview-errors-Ix78kkVy.js";import"./debounce-eWC8LGMf.js";import"./index-4QtD-hFu.js";import"./bucket-5-3bTeVNTN.js";import"./index-tUYgphcS.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./getDocumentTitle-51WyFHkN.js";import"./Link-_yif9kZE.js";import"./purify.es-29Q0w72t.js";import"./bucket-25-SwNT5LZP.js";import"./formatMessage-wl7oTduw.js";const Ie=(a,r)=>{const[n,l]=s.useState(a);return s.useEffect(()=>{const p=window.setTimeout(()=>{l(a)},r);return()=>{window.clearTimeout(p)}},[r,a]),n},E={placeholderText:"Search",closeButtonLabelText:"Clear search input"},Ee=({className:a,id:r,splitSearchQuerySelector:n=" ",completionsCount:l=5,showAutocomplete:p,minCharsToAutocomplete:g=0,spellingSuggestions:$,messages:Z=E,autocompleteDelay:ee=200,placeHolderText:$e,labelText:Le,closeButtonLabelText:Pe,onChange:L,...P})=>{const b={...E,...Z},f=s.useMemo(()=>r||`search-input__${_e()}`,[r]),m=`${M.prefix}--search-autocompletion`,te=[a,`${M.prefix}--search-input--discovery`],{searchResponseStore:{parameters:d},autocompletionStore:{data:B},componentSettings:j}=s.useContext(Ae),w={showAutocomplete:p??(j==null?void 0:j.autocomplete)??!0},{performSearch:oe,fetchAutocompletions:N,setAutocompletionOptions:F,setSearchParameters:S}=s.useContext(be),[u,_]=s.useState(d.naturalLanguageQuery||""),v=B&&B.completions||[],h=u.split(n).pop(),[se,re]=s.useState(!1),[ne,k]=s.useState(!1);let i=null;s.useEffect(()=>{_(d.naturalLanguageQuery||"")},[d.naturalLanguageQuery]);const ae=e=>{const o=e.currentTarget;_(o?o.value:"")},R=e=>{const o=u.split(n),D=o.pop(),I=v?v[e]:D;o.push(I||""),_(`${o.join(n)}${n}`);const O=document.getElementById(`${f}_input_field`);O!==null&&O.focus()},ce=je(e=>({...d,naturalLanguageQuery:e,offset:0,filter:""}),[d]),le=e=>o=>{o.key==="Enter"&&R(e)},ue=e=>()=>{R(e)},ie=e=>{oe(ce(e)),L&&L(e);const o=document.getElementById(`${f}_input_field`);o!==null&&o.blur()},T=Ie(u,ee);s.useEffect(()=>{S(e=>({...e,naturalLanguageQuery:T})),se?re(!1):N(T)},[T,N,S]),s.useEffect(()=>{F({updateAutocompletions:w.showAutocomplete,completionsCount:l,minCharsToAutocomplete:g,splitSearchQuerySelector:n})},[w.showAutocomplete,l,g,n,F]),s.useEffect(()=>{S(e=>({...e,spellingSuggestions:!!$}))},[S,$]);const pe=e=>{e.key==="Enter"&&ie(u)};s.useEffect(()=>function(){i&&clearTimeout(i)},[i]);const me=()=>{i&&clearTimeout(i),k(!0)},de=()=>{i=setTimeout(()=>{k(!1)},0)},he=h!==""&&w.showAutocomplete&&ne,ge=v.map((e,o)=>{const D=u.slice(0,u.length-h.length);if(e.startsWith(h)){const I=e.slice(h.length);return t.jsx(Q,{className:`${m}__wrapper`,children:t.jsxs(Q.Field,{role:"listitem",id:`autocompletion_${o}_field`,tabIndex:"0",className:`${m}__item`,onClick:ue(o),onKeyUp:le(o),children:[t.jsx("div",{className:`${m}__icon`,children:t.jsx(fe,{})}),t.jsxs("div",{className:`${m}__term`,children:[D,t.jsx("strong",{children:h}),I]})]})},`autocompletion_${o}`)}return null});return t.jsx("div",{className:te.join(" "),id:f,"data-testid":"search-input-test-id",onBlur:de,children:t.jsxs("div",{onFocus:me,children:[t.jsx(Se,{onKeyUp:pe,onChange:ae,value:u,id:`${f}_input_field`,labelText:P.labelText||b.placeholderText,placeholder:b.placeholderText,closeButtonLabelText:b.closeButtonLabelText,...P}),he&&t.jsx("div",{className:m,"data-testid":"completions-dropdown-test-id",children:ge})]})})},W=xe(Ee,ye("SearchInput"),Ce),C=()=>({className:c.text("Classname to pass in your own styling (className)",""),id:c.text("Html element ID (id)",""),splitSearchQuerySelector:c.text("String to split words on for autocompletion (splitSearchQuerySelector)"," "),spellingSuggestions:c.boolean("Fetch spelling suggestions (spellingSuggestions)",!0),completionsCount:c.number("Number of autocompletion results to show (completionsCount)",5),showAutocomplete:c.boolean("Show dropdown of autocomplete suggestions (showAutocomplete)",!0),minCharsToAutocomplete:c.number("Minimum characters in last word before showing autocomplete suggestions (minCharsToAutocomplete)",1),messages:c.object("Default messages for the component's text strings",E),autocompleteDelay:c.number("Milliseconds to delay the autocomplete API requests (autocompleteDelay)",200)});let A=[];const X=(a,r)=>{const n=[];for(let l=0;l({searchClient:new We,projectId:c.text("Project ID","project-id"),overrideAutocompletionResults:{completions:A}}),ct={title:"SearchInput",parameters:{component:W}},x={render:()=>(A=X(C().completionsCount,""),t.jsx(J,{children:t.jsx(G,{...Y(),children:t.jsx(W,{...C()})})})),name:"default"},y={render:()=>{const a={...Y(),overrideQueryParameters:{naturalLanguageQuery:"Waston"},overrideSearchResults:{suggested_query:"Watson"}};return t.jsx(J,{children:t.jsxs(G,{...a,children:[t.jsx(W,{...C()}),t.jsx(ve,{})]})})},name:"with spelling suggestions"};var V,H,K;x.parameters={...x.parameters,docs:{...(V=x.parameters)==null?void 0:V.docs,source:{originalSource:`{ render: () => { autocompletions = generateCompletionsArray(props().completionsCount, ''); return diff --git a/docs/storybook/assets/SearchResults-M91Z8TUW.js b/docs/storybook/assets/SearchResults-huRufqlh.js similarity index 90% rename from docs/storybook/assets/SearchResults-M91Z8TUW.js rename to docs/storybook/assets/SearchResults-huRufqlh.js index f67e67c50..3edfe8a8d 100644 --- a/docs/storybook/assets/SearchResults-M91Z8TUW.js +++ b/docs/storybook/assets/SearchResults-huRufqlh.js @@ -1,19 +1,19 @@ -import{j as T}from"./jsx-runtime-FsUICBgo.js";import{R as v,r as m,g as Nt}from"./index-RfLt4OUa.js";import{c as Qt}from"./index-tUYgphcS.js";import{g as Q}from"./callBound-4MCeDK1M.js";import{u as ze}from"./uniq-hAFl8ubt.js";import{L as Gt,g as Zt,S as $t}from"./getDocumentTitle-Zh1PemE-.js";import{b as ve,S as Fe,u as Xt,w as Yt,F as Jt,o as en,c as It}from"./chunk-WFFRPTHA-XxQL4zvM.js";import{P as p}from"./index-4QtD-hFu.js";import{b as tn,u as de,c as A,d as B,g as jt,h as Dt,P as le,i as fe,f as ie,S as pe,e as Pe,C as Ft,j as be,s as ae,k as nn,m as rn,B as At}from"./Button-KibTbxDG.js";import{i as an}from"./index-777x7qAF.js";import{L as Bt}from"./Link-_yif9kZE.js";import{p as qe}from"./purify.es-29Q0w72t.js";import{T as ln}from"./bucket-25-SwNT5LZP.js";import{f as on}from"./formatMessage-wl7oTduw.js";function vt(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,t)}return r}function ke(e){for(var n=1;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ne(e){return Ne=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ne(e)}function Qe(e,n){return Tn(e)||Cn(e,n)||_n(e,n)||xn()}function xn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _n(e,n){if(e){if(typeof e=="string")return xt(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xt(e,n)}}function xt(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);r=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function wn(e,n){if(e==null)return{};var r={},t=Object.keys(e),a,l;for(l=0;l=0)&&(r[a]=e[a]);return r}var at=v.forwardRef(function(n,r){var t=n.children,a=n.className,l=n.light,o=l===void 0?!1:l,i=Ae(n,un),f=de(),s=A("".concat(f,"--tile"),D({},"".concat(f,"--tile--light"),o),a);return v.createElement("div",se({className:s,ref:r},i),t)});at.displayName="Tile";at.propTypes={children:p.node,className:p.string,light:B(p.bool)};var lt=v.forwardRef(function(n,r){var t,a=n.children,l=n.className,o=n.clicked,i=o===void 0?!1:o,f=n.handleClick,s=n.handleKeyDown,c=n.href,u=n.light,d=u===void 0?!1:u,h=n.onClick,_=h===void 0?function(){}:h,g=n.onKeyDown,x=g===void 0?function(){}:g,y=Ae(n,dn),b=de(),S=A("".concat(b,"--tile"),"".concat(b,"--tile--clickable"),(t={},D(t,"".concat(b,"--tile--is-clicked"),i),D(t,"".concat(b,"--tile--light"),d),t),l),w=m.useState(i),k=Qe(w,2),O=k[0],C=k[1],R=f||_,H=s||x;function F(P){P.persist(),C(!O),R(P)}function K(P){P.persist(),fe(P,[ie,pe])&&(P.preventDefault(),C(!O),H(P)),H(P)}return v.createElement(Bt,se({className:S,href:c,onClick:F,onKeyDown:K,ref:r},y),a)});lt.displayName="ClickableTile";lt.propTypes={children:p.node,className:p.string,clicked:p.bool,handleClick:B(p.func),handleKeyDown:B(p.func),href:p.string,light:B(p.bool),onClick:p.func,onKeyDown:p.func,rel:p.string};var it=v.forwardRef(function(n,r){var t,a=n.children,l=n.className,o=n.disabled,i=n.handleClick,f=n.handleKeyDown;n.iconDescription;var s=n.id,c=n.light,u=c===void 0?!1:c,d=n.name,h=n.onClick,_=h===void 0?function(){}:h,g=n.onChange,x=g===void 0?function(){}:g,y=n.onKeyDown,b=y===void 0?function(){}:y,S=n.selected,w=S===void 0?!1:S,k=n.tabIndex,O=k===void 0?0:k,C=n.title,R=C===void 0?"title":C,H=n.value,F=H===void 0?"value":H,K=Ae(n,fn),P=de(),V=i||_,L=f||b,N=m.useState(w),ne=Qe(N,2),j=ne[0],Z=ne[1],re=m.useState(w),$=Qe(re,2),Y=$[0],X=$[1],J=A("".concat(P,"--tile"),"".concat(P,"--tile--selectable"),(t={},D(t,"".concat(P,"--tile--is-selected"),j),D(t,"".concat(P,"--tile--light"),u),D(t,"".concat(P,"--tile--disabled"),o),t),l),Ue=A("".concat(P,"--tile-input"),D({},"".concat(P,"--tile-input--checked"),j));function ge(U){U.preventDefault(),U.persist(),Z(!j),V(U),x(U)}function zt(U){U.persist(),fe(U,[ie,pe])&&(U.preventDefault(),Z(!j),x(U)),L(U)}function Wt(U){Z(U.target.checked),x(U)}return w!==Y&&(Z(w),X(w)),v.createElement(v.Fragment,null,v.createElement("input",{checked:j,className:Ue,disabled:o,id:s,name:d,onChange:o?null:Wt,ref:r,tabIndex:-1,title:R,type:"checkbox",value:F}),v.createElement("label",se({className:J,htmlFor:s,onClick:o?null:ge,onKeyDown:o?null:zt,tabIndex:o?null:O},K),v.createElement("span",{className:"".concat(P,"--tile__checkmark ").concat(P,"--tile__checkmark--persistent")},j?v.createElement(jt,null):v.createElement(Dt,null)),v.createElement("span",{className:"".concat(P,"--tile-content")},a)))});it.displayName="SelectableTile";it.propTypes={children:p.node,className:p.string,disabled:p.bool,handleClick:B(p.func),handleKeyDown:B(p.func),iconDescription:B(p.string),id:p.string,light:B(p.bool),name:p.string,onChange:p.func,onClick:p.func,onKeyDown:p.func,selected:p.bool,tabIndex:p.number,title:p.string,value:p.oneOfType([p.string,p.number]).isRequired};var ot=function(e){mn(r,e);var n=yn(r);function r(){var t;hn(this,r);for(var a=arguments.length,l=new Array(a),o=0;oe.length)&&(n=e.length);for(var r=0,t=new Array(n);r=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function In(e,n){if(e==null)return{};var r={},t=Object.keys(e),a,l;for(l=0;l=0)&&(r[a]=e[a]);return r}function xe(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Ct(e,n){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $e(e){return $e=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},$e(e)}function E(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}var He=function(e){Ce(r,e);var n=Te(r);function r(){return xe(this,r),n.apply(this,arguments)}return _e(r,[{key:"render",value:function(){var a=this.context,l=this.props,o=l.children,i=l.className,f=l.light,s=Be(l,kn),c=A("".concat(a,"--tile"),E({},"".concat(a,"--tile--light"),f),i);return v.createElement("div",ce({className:c},s),o)}}]),r}(m.Component);E(He,"propTypes",{children:p.node,className:p.string,light:p.bool});E(He,"contextType",le);E(He,"defaultProps",{light:!1});var Me=function(e){Ce(r,e);var n=Te(r);function r(){var t;xe(this,r);for(var a=arguments.length,l=new Array(a),o=0;o"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ne(e){return Ne=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ne(e)}function Qe(e,n){return Tn(e)||Cn(e,n)||_n(e,n)||xn()}function xn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _n(e,n){if(e){if(typeof e=="string")return xt(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xt(e,n)}}function xt(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);r=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function wn(e,n){if(e==null)return{};var r={},t=Object.keys(e),a,l;for(l=0;l=0)&&(r[a]=e[a]);return r}var at=v.forwardRef(function(n,r){var t=n.children,a=n.className,l=n.light,o=l===void 0?!1:l,i=Ae(n,un),f=de(),s=F("".concat(f,"--tile"),D({},"".concat(f,"--tile--light"),o),a);return v.createElement("div",se({className:s,ref:r},i),t)});at.displayName="Tile";at.propTypes={children:p.node,className:p.string,light:A(p.bool)};var lt=v.forwardRef(function(n,r){var t,a=n.children,l=n.className,o=n.clicked,i=o===void 0?!1:o,f=n.handleClick,s=n.handleKeyDown,c=n.href,u=n.light,d=u===void 0?!1:u,h=n.onClick,_=h===void 0?function(){}:h,g=n.onKeyDown,x=g===void 0?function(){}:g,y=Ae(n,dn),b=de(),S=F("".concat(b,"--tile"),"".concat(b,"--tile--clickable"),(t={},D(t,"".concat(b,"--tile--is-clicked"),i),D(t,"".concat(b,"--tile--light"),d),t),l),w=m.useState(i),k=Qe(w,2),O=k[0],C=k[1],R=f||_,B=s||x;function M(P){P.persist(),C(!O),R(P)}function K(P){P.persist(),fe(P,[ie,pe])&&(P.preventDefault(),C(!O),B(P)),B(P)}return v.createElement(Bt,se({className:S,href:c,onClick:M,onKeyDown:K,ref:r},y),a)});lt.displayName="ClickableTile";lt.propTypes={children:p.node,className:p.string,clicked:p.bool,handleClick:A(p.func),handleKeyDown:A(p.func),href:p.string,light:A(p.bool),onClick:p.func,onKeyDown:p.func,rel:p.string};var it=v.forwardRef(function(n,r){var t,a=n.children,l=n.className,o=n.disabled,i=n.handleClick,f=n.handleKeyDown;n.iconDescription;var s=n.id,c=n.light,u=c===void 0?!1:c,d=n.name,h=n.onClick,_=h===void 0?function(){}:h,g=n.onChange,x=g===void 0?function(){}:g,y=n.onKeyDown,b=y===void 0?function(){}:y,S=n.selected,w=S===void 0?!1:S,k=n.tabIndex,O=k===void 0?0:k,C=n.title,R=C===void 0?"title":C,B=n.value,M=B===void 0?"value":B,K=Ae(n,fn),P=de(),V=i||_,L=f||b,N=m.useState(w),ne=Qe(N,2),j=ne[0],Z=ne[1],re=m.useState(w),$=Qe(re,2),Y=$[0],X=$[1],J=F("".concat(P,"--tile"),"".concat(P,"--tile--selectable"),(t={},D(t,"".concat(P,"--tile--is-selected"),j),D(t,"".concat(P,"--tile--light"),u),D(t,"".concat(P,"--tile--disabled"),o),t),l),Ue=F("".concat(P,"--tile-input"),D({},"".concat(P,"--tile-input--checked"),j));function ge(U){U.preventDefault(),U.persist(),Z(!j),V(U),x(U)}function zt(U){U.persist(),fe(U,[ie,pe])&&(U.preventDefault(),Z(!j),x(U)),L(U)}function Wt(U){Z(U.target.checked),x(U)}return w!==Y&&(Z(w),X(w)),v.createElement(v.Fragment,null,v.createElement("input",{checked:j,className:Ue,disabled:o,id:s,name:d,onChange:o?null:Wt,ref:r,tabIndex:-1,title:R,type:"checkbox",value:M}),v.createElement("label",se({className:J,htmlFor:s,onClick:o?null:ge,onKeyDown:o?null:zt,tabIndex:o?null:O},K),v.createElement("span",{className:"".concat(P,"--tile__checkmark ").concat(P,"--tile__checkmark--persistent")},j?v.createElement(jt,null):v.createElement(Dt,null)),v.createElement("span",{className:"".concat(P,"--tile-content")},a)))});it.displayName="SelectableTile";it.propTypes={children:p.node,className:p.string,disabled:p.bool,handleClick:A(p.func),handleKeyDown:A(p.func),iconDescription:A(p.string),id:p.string,light:A(p.bool),name:p.string,onChange:p.func,onClick:p.func,onKeyDown:p.func,selected:p.bool,tabIndex:p.number,title:p.string,value:p.oneOfType([p.string,p.number]).isRequired};var ot=function(e){mn(r,e);var n=yn(r);function r(){var t;hn(this,r);for(var a=arguments.length,l=new Array(a),o=0;oe.length)&&(n=e.length);for(var r=0,t=new Array(n);r=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function In(e,n){if(e==null)return{};var r={},t=Object.keys(e),a,l;for(l=0;l=0)&&(r[a]=e[a]);return r}function xe(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Ct(e,n){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $e(e){return $e=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},$e(e)}function E(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}var He=function(e){Ce(r,e);var n=Te(r);function r(){return xe(this,r),n.apply(this,arguments)}return _e(r,[{key:"render",value:function(){var a=this.context,l=this.props,o=l.children,i=l.className,f=l.light,s=Be(l,kn),c=F("".concat(a,"--tile"),E({},"".concat(a,"--tile--light"),f),i);return v.createElement("div",ce({className:c},s),o)}}]),r}(m.Component);E(He,"propTypes",{children:p.node,className:p.string,light:p.bool});E(He,"contextType",le);E(He,"defaultProps",{light:!1});var Me=function(e){Ce(r,e);var n=Te(r);function r(){var t;xe(this,r);for(var a=arguments.length,l=new Array(a),o=0;oe.length)&&(n=e.length);for(var r=0,t=new Array(n);re.length)&&(n=e.length);for(var r=0,t=new Array(n);r=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function Zn(e,n){if(e==null)return{};var r={},t=Object.keys(e),a,l;for(l=0;l=0)&&(r[a]=e[a]);return r}var z=ae.prefix;function Mt(e){var n=e.className,r=e.defaultToggled,t=r===void 0?!1:r,a=e.disabled,l=a===void 0?!1:a,o=e.hideLabel,i=o===void 0?!1:o,f=e.id,s=e.labelA,c=s===void 0?"Off":s,u=e.labelB,d=u===void 0?"On":u,h=e.labelText,_=e.onClick,g=e.onToggle,x=e.size,y=x===void 0?"md":x,b=e.toggled,S=Gn(e,Un),w=Ln(b,g,t),k=qn(w,2),O=k[0],C=k[1];function R(N){C(!O),_&&_(N)}var H=y==="sm",F=i?h:O?d:c,K=A("".concat(z,"--toggle"),Ee({},"".concat(z,"--toggle--disabled"),l),n),P=A("".concat(z,"--toggle__label-text"),Ee({},"".concat(z,"--visually-hidden"),i)),V=A("".concat(z,"--toggle__appearance"),Ee({},"".concat(z,"--toggle__appearance--sm"),H)),L=A("".concat(z,"--toggle__switch"),Ee({},"".concat(z,"--toggle__switch--checked"),O));return v.createElement("div",{className:K},v.createElement("button",Ze({},S,{id:f,className:"".concat(z,"--toggle__button"),role:"switch",type:"button","aria-checked":O,disabled:l,onClick:R})),v.createElement("label",{htmlFor:f,className:"".concat(z,"--toggle__label")},v.createElement("span",{className:P},h),v.createElement("div",{className:V},v.createElement("div",{className:L},H&&v.createElement("svg",{className:"".concat(z,"--toggle__check"),width:"6px",height:"5px",viewBox:"0 0 6 5"},v.createElement("path",{d:"M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z"}))),v.createElement("span",{className:"".concat(z,"--toggle__text"),"aria-hidden":"true"},F))))}Mt.propTypes={className:p.string,defaultToggled:p.bool,disabled:p.bool,hideLabel:p.bool,id:p.string.isRequired,labelA:p.node,labelB:p.node,labelText:p.node.isRequired,onClick:p.func,onToggle:p.func,size:p.oneOf(["sm","md"]),toggled:p.bool};function Re(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Re=function(r){return typeof r}:Re=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Re(e)}var q,oe,Xn=["className","defaultToggled","toggled","onChange","onToggle","id","labelText","labelA","labelB","size"];function Xe(){return Xe=Object.assign||function(e){for(var n=1;n=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function Jn(e,n){if(e==null)return{};var r={},t=Object.keys(e),a,l;for(l=0;l=0)&&(r[a]=e[a]);return r}function er(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function kt(e,n){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ie(e){return Ie=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ie(e)}function I(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}var or=nn(),Ke=function(e){nr(r,e);var n=rr(r);function r(){return er(this,r),n.apply(this,arguments)}return tr(r,[{key:"render",value:function(){var a=this.context,l=this.props,o=l.className,i=l.defaultToggled,f=l.toggled,s=l.onChange,c=l.onToggle,u=l.id,d=u===void 0?this.inputId=this.inputId||"__carbon-toggle_".concat(or()):u,h=l.labelText,_=l.labelA,g=l.labelB,x=l.size,y=Yn(l,Xn),b,S=A("".concat(a,"--form-item"),I({},o,o)),w=A("".concat(a,"--toggle-input"),I({},"".concat(a,"--toggle-input--small"),x==="sm")),k={};return typeof f<"u"?k.checked=f:k.defaultChecked=i,v.createElement("div",{className:S},v.createElement("input",Xe({},y,k,{"aria-label":null,type:"checkbox",id:d,className:w,onChange:function(C){s&&s(C),c(b.checked,d,C)},ref:function(C){b=C},onKeyUp:function(C){rn(C,ie)&&(b.checked=!b.checked,s&&s(C),c(b.checked,d,C))}})),v.createElement("label",{className:"".concat(a,"--toggle-input__label"),htmlFor:d,"aria-label":typeof h=="string"?null:this.props["aria-label"]},h,v.createElement("span",{className:"".concat(a,"--toggle__switch")},x&&v.createElement("svg",{className:"".concat(a,"--toggle__check"),width:"6px",height:"5px",viewBox:"0 0 6 5"},v.createElement("path",{d:"M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z"})),v.createElement("span",{className:"".concat(a,"--toggle__text--off"),"aria-hidden":"true"},_),v.createElement("span",{className:"".concat(a,"--toggle__text--on"),"aria-hidden":"true"},g))))}}]),r}(v.Component);I(Ke,"propTypes",(q={},I(q,"aria-label",p.string.isRequired),I(q,"className",p.string),I(q,"defaultToggled",p.bool),I(q,"id",p.string.isRequired),I(q,"labelA",p.node.isRequired),I(q,"labelB",p.node.isRequired),I(q,"labelText",p.node),I(q,"onChange",p.func),I(q,"onToggle",p.func),I(q,"size",p.oneOf(["sm","md"])),I(q,"toggled",p.bool),q));I(Ke,"contextType",le);I(Ke,"defaultProps",(oe={defaultToggled:!1},I(oe,"aria-label","Toggle"),I(oe,"labelA","Off"),I(oe,"labelB","On"),I(oe,"onToggle",function(){}),oe));const sr=Ke;var cr=cn({name:"Toggle",next:Mt,classic:sr});const ur=cr;function dr(e){for(var n=-1,r=e==null?0:e.length,t=0,a=[];++nm.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em",viewBox:"0 0 80 80",...e},m.createElement("defs",null,m.createElement("style",null,".a{fill:none;}.b{fill:url(#a);}.c{fill:url(#b);}.d{fill:url(#c);}.e{opacity:0.5;fill:url(#d);}.f{fill:url(#e);}.g{opacity:0.6;}.h{fill:url(#f);}.i{fill:url(#g);}"),m.createElement("linearGradient",{id:"a",x1:2.6,y1:-12.81,x2:43.48,y2:58,gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#f4f4f4"}),m.createElement("stop",{offset:.69,stopColor:"#e0e0e0"}),m.createElement("stop",{offset:.94,stopColor:"#c4c4c4"}),m.createElement("stop",{offset:1,stopColor:"#a8a8a8"})),m.createElement("linearGradient",{id:"b",x1:48.57,y1:57.07,x2:67.31,y2:57.07,gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#a8a8a8"}),m.createElement("stop",{offset:1,stopColor:"#c6c6c6"})),m.createElement("linearGradient",{id:"c",x1:15.1,y1:10.36,x2:41.51,y2:56.09,gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#bdbdbd"}),m.createElement("stop",{offset:1,stopColor:"#a3a3a3"})),m.createElement("linearGradient",{id:"d",x1:34.92,y1:-46.56,x2:34.92,y2:97.82,gradientTransform:"translate(18.46 -13.77) rotate(30)",gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#6e6e6e"}),m.createElement("stop",{offset:.48,stopColor:"#787878",stopOpacity:.69}),m.createElement("stop",{offset:.72,stopColor:"#818181",stopOpacity:.41}),m.createElement("stop",{offset:1,stopColor:"#8c8c8c",stopOpacity:.1})),m.createElement("linearGradient",{id:"e",x1:26.4,y1:71.67,x2:55.54,y2:54.85,gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#565656",stopOpacity:.05}),m.createElement("stop",{offset:1,stopColor:"#171717",stopOpacity:.1})),m.createElement("linearGradient",{id:"f",x1:24.56,y1:9.61,x2:50.36,y2:54.3,gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#fff",stopOpacity:0}),m.createElement("stop",{offset:.12,stopColor:"#fff",stopOpacity:.01}),m.createElement("stop",{offset:.22,stopColor:"#fff",stopOpacity:.05}),m.createElement("stop",{offset:.31,stopColor:"#fff",stopOpacity:.12}),m.createElement("stop",{offset:.4,stopColor:"#fff",stopOpacity:.21}),m.createElement("stop",{offset:.48,stopColor:"#fff",stopOpacity:.34}),m.createElement("stop",{offset:.56,stopColor:"#fff",stopOpacity:.49}),m.createElement("stop",{offset:.64,stopColor:"#fff",stopOpacity:.66}),m.createElement("stop",{offset:.71,stopColor:"#fff",stopOpacity:.86}),m.createElement("stop",{offset:.73,stopColor:"#fff",stopOpacity:.92}),m.createElement("stop",{offset:1,stopColor:"#fff"})),m.createElement("linearGradient",{id:"g",x1:15.86,y1:-20.5,x2:56.75,y2:50.32,xlinkHref:"#a"})),m.createElement("rect",{className:"a",width:80,height:80}),m.createElement("path",{className:"b",d:"M12.69,18c0,12,8.75,26.84,19.56,33.08,5.64,3.26,10.73,3.52,14.3,1.32h0l4.83-2.79-1.19-1.93c-3.25,1.73-7.72,1.38-12.67-1.48C27.62,40.46,19.6,26.88,19.6,15.85c0-5.09,1.71-8.75,4.53-10.65l-1.2-1.95L18.1,6h0C14.75,8,12.69,12.12,12.69,18"}),m.createElement("path",{className:"c",d:"M67.31,64.92s.11.86-1.89,2.24-2.73,1.18-2.73,1.18L48.57,49.22l4.62-3.42Z"}),m.createElement("path",{className:"d",d:"M37.68,46.05c-9.9-5.71-17.93-19.29-17.93-30.32,0-3.79.95-6.78,2.6-8.85-4.87.76-8.09,5-8.09,12,0,11,8,24.61,17.93,30.32,6.5,3.75,12.19,3.19,15.33-.76-2.82.44-6.21-.31-9.84-2.41"}),m.createElement("ellipse",{className:"e",cx:34.92,cy:27.57,rx:14.55,ry:25.2,transform:"translate(-9.11 21.16) rotate(-30)"}),m.createElement("path",{className:"f",d:"M67.1,75,54.26,67.59c1.1-1.15,1.1-2.36-.77-3.44l-.05,0L26.17,48.4l-.09-.06c-2.59-1.49-5.82-1.05-8.42.45s-3.57,3.48-1,5L44.09,69.58a7.2,7.2,0,0,0,5.5.53l13,7.51h0C63.82,78.34,68.35,75.73,67.1,75Z"}),m.createElement("g",{className:"g"},m.createElement("path",{className:"h",d:"M42.88,50.79a16.42,16.42,0,0,1-8.06-2.47c-9.88-5.7-17.92-19.63-17.92-31,0-5.57,1.89-9.73,5.32-11.72S30.2,4,35,6.81C44.91,12.52,53,26.45,53,37.86c0,5.57-1.89,9.73-5.32,11.71A9.31,9.31,0,0,1,42.88,50.79ZM27,4.76a9,9,0,0,0-4.54,1.17c-3.3,1.9-5.12,5.93-5.12,11.35,0,11.28,8,25,17.72,30.68,4.69,2.71,9.09,3.16,12.39,1.25s5.12-5.94,5.12-11.35c0-11.28-7.95-25-17.72-30.69A16,16,0,0,0,27,4.76Z"})),m.createElement("path",{className:"i",d:"M57,37.5c0-12-8.75-26.85-19.56-33.08C31.82,1.16,26.73.89,23.16,3.09h0L18.33,5.87l1.19,1.94c3.25-1.74,7.72-1.38,12.67,1.47C42.09,15,50.11,28.57,50.11,39.6,50.11,44.46,48.56,48,46,50c-.12.1-1.17.73-1.31.82l2.12,1.42,4.83-2.79h0C55,47.44,57,43.34,57,37.5"})),Je=({setShowTablesOnlyResults:e,showTablesOnlyResults:n,showTablesOnlyToggle:r,messages:t})=>{const{setIsResultsPaginationComponentHidden:a}=m.useContext(ve),l=()=>{e(!n),a(!n)},o=`${ae.prefix}--search-result--toggle`;return T.jsx(T.Fragment,{children:r&&T.jsx(ur,{size:"sm","aria-label":t.tablesOnlyToggleLabelText,className:o,id:`${ae.prefix}--tables-only-toggle`,labelText:t.tablesOnlyToggleLabelText,onToggle:l,toggled:n})})};try{Je.displayName="TablesOnlyToggle",Je.__docgenInfo={description:"",displayName:"TablesOnlyToggle",props:{setShowTablesOnlyResults:{defaultValue:null,description:"used to set the showTablesOnlyResults state when toggled",name:"setShowTablesOnlyResults",required:!0,type:{name:"(value: boolean) => void"}},showTablesOnlyResults:{defaultValue:null,description:"specifies whether tables only results or regular search results should be shown",name:"showTablesOnlyResults",required:!0,type:{name:"boolean"}},showTablesOnlyToggle:{defaultValue:null,description:"specify whether to display a toggle option for showing table search results only",name:"showTablesOnlyToggle",required:!0,type:{name:"boolean"}},messages:{defaultValue:null,description:"override default messages for the component by specifying custom and/or internationalized text strings",name:"messages",required:!0,type:{name:"Messages"}}}}}catch{}/*! +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zn(e,n){if(e){if(typeof e=="string")return wt(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wt(e,n)}}function wt(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);r=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function Zn(e,n){if(e==null)return{};var r={},t=Object.keys(e),a,l;for(l=0;l=0)&&(r[a]=e[a]);return r}var z=ae.prefix;function Mt(e){var n=e.className,r=e.defaultToggled,t=r===void 0?!1:r,a=e.disabled,l=a===void 0?!1:a,o=e.hideLabel,i=o===void 0?!1:o,f=e.id,s=e.labelA,c=s===void 0?"Off":s,u=e.labelB,d=u===void 0?"On":u,h=e.labelText,_=e.onClick,g=e.onToggle,x=e.size,y=x===void 0?"md":x,b=e.toggled,S=Gn(e,Un),w=Ln(b,g,t),k=qn(w,2),O=k[0],C=k[1];function R(N){C(!O),_&&_(N)}var B=y==="sm",M=i?h:O?d:c,K=F("".concat(z,"--toggle"),Ee({},"".concat(z,"--toggle--disabled"),l),n),P=F("".concat(z,"--toggle__label-text"),Ee({},"".concat(z,"--visually-hidden"),i)),V=F("".concat(z,"--toggle__appearance"),Ee({},"".concat(z,"--toggle__appearance--sm"),B)),L=F("".concat(z,"--toggle__switch"),Ee({},"".concat(z,"--toggle__switch--checked"),O));return v.createElement("div",{className:K},v.createElement("button",Ze({},S,{id:f,className:"".concat(z,"--toggle__button"),role:"switch",type:"button","aria-checked":O,disabled:l,onClick:R})),v.createElement("label",{htmlFor:f,className:"".concat(z,"--toggle__label")},v.createElement("span",{className:P},h),v.createElement("div",{className:V},v.createElement("div",{className:L},B&&v.createElement("svg",{className:"".concat(z,"--toggle__check"),width:"6px",height:"5px",viewBox:"0 0 6 5"},v.createElement("path",{d:"M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z"}))),v.createElement("span",{className:"".concat(z,"--toggle__text"),"aria-hidden":"true"},M))))}Mt.propTypes={className:p.string,defaultToggled:p.bool,disabled:p.bool,hideLabel:p.bool,id:p.string.isRequired,labelA:p.node,labelB:p.node,labelText:p.node.isRequired,onClick:p.func,onToggle:p.func,size:p.oneOf(["sm","md"]),toggled:p.bool};function Re(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Re=function(r){return typeof r}:Re=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Re(e)}var q,oe,Xn=["className","defaultToggled","toggled","onChange","onToggle","id","labelText","labelA","labelB","size"];function Xe(){return Xe=Object.assign||function(e){for(var n=1;n=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}function Jn(e,n){if(e==null)return{};var r={},t=Object.keys(e),a,l;for(l=0;l=0)&&(r[a]=e[a]);return r}function er(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function kt(e,n){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ie(e){return Ie=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ie(e)}function I(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}var or=nn(),Ke=function(e){nr(r,e);var n=rr(r);function r(){return er(this,r),n.apply(this,arguments)}return tr(r,[{key:"render",value:function(){var a=this.context,l=this.props,o=l.className,i=l.defaultToggled,f=l.toggled,s=l.onChange,c=l.onToggle,u=l.id,d=u===void 0?this.inputId=this.inputId||"__carbon-toggle_".concat(or()):u,h=l.labelText,_=l.labelA,g=l.labelB,x=l.size,y=Yn(l,Xn),b,S=F("".concat(a,"--form-item"),I({},o,o)),w=F("".concat(a,"--toggle-input"),I({},"".concat(a,"--toggle-input--small"),x==="sm")),k={};return typeof f<"u"?k.checked=f:k.defaultChecked=i,v.createElement("div",{className:S},v.createElement("input",Xe({},y,k,{"aria-label":null,type:"checkbox",id:d,className:w,onChange:function(C){s&&s(C),c(b.checked,d,C)},ref:function(C){b=C},onKeyUp:function(C){rn(C,ie)&&(b.checked=!b.checked,s&&s(C),c(b.checked,d,C))}})),v.createElement("label",{className:"".concat(a,"--toggle-input__label"),htmlFor:d,"aria-label":typeof h=="string"?null:this.props["aria-label"]},h,v.createElement("span",{className:"".concat(a,"--toggle__switch")},x&&v.createElement("svg",{className:"".concat(a,"--toggle__check"),width:"6px",height:"5px",viewBox:"0 0 6 5"},v.createElement("path",{d:"M2.2 2.7L5 0 6 1 2.2 5 0 2.7 1 1.5z"})),v.createElement("span",{className:"".concat(a,"--toggle__text--off"),"aria-hidden":"true"},_),v.createElement("span",{className:"".concat(a,"--toggle__text--on"),"aria-hidden":"true"},g))))}}]),r}(v.Component);I(Ke,"propTypes",(q={},I(q,"aria-label",p.string.isRequired),I(q,"className",p.string),I(q,"defaultToggled",p.bool),I(q,"id",p.string.isRequired),I(q,"labelA",p.node.isRequired),I(q,"labelB",p.node.isRequired),I(q,"labelText",p.node),I(q,"onChange",p.func),I(q,"onToggle",p.func),I(q,"size",p.oneOf(["sm","md"])),I(q,"toggled",p.bool),q));I(Ke,"contextType",le);I(Ke,"defaultProps",(oe={defaultToggled:!1},I(oe,"aria-label","Toggle"),I(oe,"labelA","Off"),I(oe,"labelB","On"),I(oe,"onToggle",function(){}),oe));const sr=Ke;var cr=cn({name:"Toggle",next:Mt,classic:sr});const ur=cr;function dr(e){for(var n=-1,r=e==null?0:e.length,t=0,a=[];++nm.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:"1em",height:"1em",viewBox:"0 0 80 80",...e},m.createElement("defs",null,m.createElement("style",null,".a{fill:none;}.b{fill:url(#a);}.c{fill:url(#b);}.d{fill:url(#c);}.e{opacity:0.5;fill:url(#d);}.f{fill:url(#e);}.g{opacity:0.6;}.h{fill:url(#f);}.i{fill:url(#g);}"),m.createElement("linearGradient",{id:"a",x1:2.6,y1:-12.81,x2:43.48,y2:58,gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#f4f4f4"}),m.createElement("stop",{offset:.69,stopColor:"#e0e0e0"}),m.createElement("stop",{offset:.94,stopColor:"#c4c4c4"}),m.createElement("stop",{offset:1,stopColor:"#a8a8a8"})),m.createElement("linearGradient",{id:"b",x1:48.57,y1:57.07,x2:67.31,y2:57.07,gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#a8a8a8"}),m.createElement("stop",{offset:1,stopColor:"#c6c6c6"})),m.createElement("linearGradient",{id:"c",x1:15.1,y1:10.36,x2:41.51,y2:56.09,gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#bdbdbd"}),m.createElement("stop",{offset:1,stopColor:"#a3a3a3"})),m.createElement("linearGradient",{id:"d",x1:34.92,y1:-46.56,x2:34.92,y2:97.82,gradientTransform:"translate(18.46 -13.77) rotate(30)",gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#6e6e6e"}),m.createElement("stop",{offset:.48,stopColor:"#787878",stopOpacity:.69}),m.createElement("stop",{offset:.72,stopColor:"#818181",stopOpacity:.41}),m.createElement("stop",{offset:1,stopColor:"#8c8c8c",stopOpacity:.1})),m.createElement("linearGradient",{id:"e",x1:26.4,y1:71.67,x2:55.54,y2:54.85,gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#565656",stopOpacity:.05}),m.createElement("stop",{offset:1,stopColor:"#171717",stopOpacity:.1})),m.createElement("linearGradient",{id:"f",x1:24.56,y1:9.61,x2:50.36,y2:54.3,gradientUnits:"userSpaceOnUse"},m.createElement("stop",{offset:0,stopColor:"#fff",stopOpacity:0}),m.createElement("stop",{offset:.12,stopColor:"#fff",stopOpacity:.01}),m.createElement("stop",{offset:.22,stopColor:"#fff",stopOpacity:.05}),m.createElement("stop",{offset:.31,stopColor:"#fff",stopOpacity:.12}),m.createElement("stop",{offset:.4,stopColor:"#fff",stopOpacity:.21}),m.createElement("stop",{offset:.48,stopColor:"#fff",stopOpacity:.34}),m.createElement("stop",{offset:.56,stopColor:"#fff",stopOpacity:.49}),m.createElement("stop",{offset:.64,stopColor:"#fff",stopOpacity:.66}),m.createElement("stop",{offset:.71,stopColor:"#fff",stopOpacity:.86}),m.createElement("stop",{offset:.73,stopColor:"#fff",stopOpacity:.92}),m.createElement("stop",{offset:1,stopColor:"#fff"})),m.createElement("linearGradient",{id:"g",x1:15.86,y1:-20.5,x2:56.75,y2:50.32,xlinkHref:"#a"})),m.createElement("rect",{className:"a",width:80,height:80}),m.createElement("path",{className:"b",d:"M12.69,18c0,12,8.75,26.84,19.56,33.08,5.64,3.26,10.73,3.52,14.3,1.32h0l4.83-2.79-1.19-1.93c-3.25,1.73-7.72,1.38-12.67-1.48C27.62,40.46,19.6,26.88,19.6,15.85c0-5.09,1.71-8.75,4.53-10.65l-1.2-1.95L18.1,6h0C14.75,8,12.69,12.12,12.69,18"}),m.createElement("path",{className:"c",d:"M67.31,64.92s.11.86-1.89,2.24-2.73,1.18-2.73,1.18L48.57,49.22l4.62-3.42Z"}),m.createElement("path",{className:"d",d:"M37.68,46.05c-9.9-5.71-17.93-19.29-17.93-30.32,0-3.79.95-6.78,2.6-8.85-4.87.76-8.09,5-8.09,12,0,11,8,24.61,17.93,30.32,6.5,3.75,12.19,3.19,15.33-.76-2.82.44-6.21-.31-9.84-2.41"}),m.createElement("ellipse",{className:"e",cx:34.92,cy:27.57,rx:14.55,ry:25.2,transform:"translate(-9.11 21.16) rotate(-30)"}),m.createElement("path",{className:"f",d:"M67.1,75,54.26,67.59c1.1-1.15,1.1-2.36-.77-3.44l-.05,0L26.17,48.4l-.09-.06c-2.59-1.49-5.82-1.05-8.42.45s-3.57,3.48-1,5L44.09,69.58a7.2,7.2,0,0,0,5.5.53l13,7.51h0C63.82,78.34,68.35,75.73,67.1,75Z"}),m.createElement("g",{className:"g"},m.createElement("path",{className:"h",d:"M42.88,50.79a16.42,16.42,0,0,1-8.06-2.47c-9.88-5.7-17.92-19.63-17.92-31,0-5.57,1.89-9.73,5.32-11.72S30.2,4,35,6.81C44.91,12.52,53,26.45,53,37.86c0,5.57-1.89,9.73-5.32,11.71A9.31,9.31,0,0,1,42.88,50.79ZM27,4.76a9,9,0,0,0-4.54,1.17c-3.3,1.9-5.12,5.93-5.12,11.35,0,11.28,8,25,17.72,30.68,4.69,2.71,9.09,3.16,12.39,1.25s5.12-5.94,5.12-11.35c0-11.28-7.95-25-17.72-30.69A16,16,0,0,0,27,4.76Z"})),m.createElement("path",{className:"i",d:"M57,37.5c0-12-8.75-26.85-19.56-33.08C31.82,1.16,26.73.89,23.16,3.09h0L18.33,5.87l1.19,1.94c3.25-1.74,7.72-1.38,12.67,1.47C42.09,15,50.11,28.57,50.11,39.6,50.11,44.46,48.56,48,46,50c-.12.1-1.17.73-1.31.82l2.12,1.42,4.83-2.79h0C55,47.44,57,43.34,57,37.5"})),Je=({setShowTablesOnlyResults:e,showTablesOnlyResults:n,showTablesOnlyToggle:r,messages:t})=>{const{setIsResultsPaginationComponentHidden:a}=m.useContext(ve),l=()=>{e(!n),a(!n)},o=`${ae.prefix}--search-result--toggle`;return T.jsx(T.Fragment,{children:r&&T.jsx(ur,{size:"sm","aria-label":t.tablesOnlyToggleLabelText,className:o,id:`${ae.prefix}--tables-only-toggle`,labelText:t.tablesOnlyToggleLabelText,onToggle:l,toggled:n})})};try{Je.displayName="TablesOnlyToggle",Je.__docgenInfo={description:"",displayName:"TablesOnlyToggle",props:{setShowTablesOnlyResults:{defaultValue:null,description:"used to set the showTablesOnlyResults state when toggled",name:"setShowTablesOnlyResults",required:!0,type:{name:"(value: boolean) => void"}},showTablesOnlyResults:{defaultValue:null,description:"specifies whether tables only results or regular search results should be shown",name:"showTablesOnlyResults",required:!0,type:{name:"boolean"}},showTablesOnlyToggle:{defaultValue:null,description:"specify whether to display a toggle option for showing table search results only",name:"showTablesOnlyToggle",required:!0,type:{name:"boolean"}},messages:{defaultValue:null,description:"override default messages for the component by specifying custom and/or internationalized text strings",name:"messages",required:!0,type:{name:"Messages"}}}}}catch{}/*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */var hr=Object.prototype.toString,he=Array.isArray||function(n){return hr.call(n)==="[object Array]"};function ht(e){return typeof e=="function"}function gr(e){return he(e)?"array":typeof e}function Ve(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Et(e,n){return e!=null&&typeof e=="object"&&n in e}function mr(e,n){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(n)}var yr=RegExp.prototype.test;function vr(e,n){return yr.call(e,n)}var br=/\S/;function xr(e){return!vr(br,e)}var _r={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Cr(e){return String(e).replace(/[&<>"'`=\/]/g,function(r){return _r[r]})}var Tr=/\s*/,wr=/\s+/,St=/\s*=/,kr=/\s*\}/,Er=/#|\^|\/|>|\{|&|=|!/;function Sr(e,n){if(!e)return[];var r=!1,t=[],a=[],l=[],o=!1,i=!1,f="",s=0;function c(){if(o&&!i)for(;l.length;)delete a[l.pop()];else l=[];o=!1,i=!1}var u,d,h;function _(R){if(typeof R=="string"&&(R=R.split(wr,2)),!he(R)||R.length!==2)throw new Error("Invalid tags: "+R);u=new RegExp(Ve(R[0])+"\\s*"),d=new RegExp("\\s*"+Ve(R[1])),h=new RegExp("\\s*"+Ve("}"+R[1]))}_(n||G.tags);for(var g=new we(e),x,y,b,S,w,k;!g.eos();){if(x=g.pos,b=g.scanUntil(u),b)for(var O=0,C=b.length;O"?w=[y,b,x,g.pos,f,s,r]:w=[y,b,x,g.pos],s++,a.push(w),y==="#"||y==="^")t.push(w);else if(y==="/"){if(k=t.pop(),!k)throw new Error('Unopened section "'+b+'" at '+x);if(k[1]!==b)throw new Error('Unclosed section "'+k[1]+'" at '+x)}else y==="name"||y==="{"||y==="&"?i=!0:y==="="&&_(b)}if(c(),k=t.pop(),k)throw new Error('Unclosed section "'+k[1]+'" at '+g.pos);return Rr(Or(a))}function Or(e){for(var n=[],r,t,a=0,l=e.length;a0?t[t.length-1][4]:n;break;default:r.push(a)}return n}function we(e){this.string=e,this.tail=e,this.pos=0}we.prototype.eos=function(){return this.tail===""};we.prototype.scan=function(n){var r=this.tail.match(n);if(!r||r.index!==0)return"";var t=r[0];return this.tail=this.tail.substring(t.length),this.pos+=t.length,t};we.prototype.scanUntil=function(n){var r=this.tail.search(n),t;switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t};function ue(e,n){this.view=e,this.cache={".":this.view},this.parent=n}ue.prototype.push=function(n){return new ue(n,this)};ue.prototype.lookup=function(n){var r=this.cache,t;if(r.hasOwnProperty(n))t=r[n];else{for(var a=this,l,o,i,f=!1;a;){if(n.indexOf(".")>0)for(l=a.view,o=n.split("."),i=0;l!=null&&i"?s=this.renderPartial(i,r,t,l):f==="&"?s=this.unescapedValue(i,r):f==="name"?s=this.escapedValue(i,r,l):f==="text"&&(s=this.rawValue(i)),s!==void 0&&(o+=s);return o};M.prototype.renderSection=function(n,r,t,a,l){var o=this,i="",f=r.lookup(n[1]);function s(d){return o.render(d,r,t,l)}if(f){if(he(f))for(var c=0,u=f.length;c"?w=[y,b,x,g.pos,f,s,r]:w=[y,b,x,g.pos],s++,a.push(w),y==="#"||y==="^")t.push(w);else if(y==="/"){if(k=t.pop(),!k)throw new Error('Unopened section "'+b+'" at '+x);if(k[1]!==b)throw new Error('Unclosed section "'+k[1]+'" at '+x)}else y==="name"||y==="{"||y==="&"?i=!0:y==="="&&_(b)}if(c(),k=t.pop(),k)throw new Error('Unclosed section "'+k[1]+'" at '+g.pos);return Rr(Or(a))}function Or(e){for(var n=[],r,t,a=0,l=e.length;a0?t[t.length-1][4]:n;break;default:r.push(a)}return n}function we(e){this.string=e,this.tail=e,this.pos=0}we.prototype.eos=function(){return this.tail===""};we.prototype.scan=function(n){var r=this.tail.match(n);if(!r||r.index!==0)return"";var t=r[0];return this.tail=this.tail.substring(t.length),this.pos+=t.length,t};we.prototype.scanUntil=function(n){var r=this.tail.search(n),t;switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t};function ue(e,n){this.view=e,this.cache={".":this.view},this.parent=n}ue.prototype.push=function(n){return new ue(n,this)};ue.prototype.lookup=function(n){var r=this.cache,t;if(r.hasOwnProperty(n))t=r[n];else{for(var a=this,l,o,i,f=!1;a;){if(n.indexOf(".")>0)for(l=a.view,o=n.split("."),i=0;l!=null&&i"?s=this.renderPartial(i,r,t,l):f==="&"?s=this.unescapedValue(i,r):f==="name"?s=this.escapedValue(i,r,l):f==="text"&&(s=this.rawValue(i)),s!==void 0&&(o+=s);return o};H.prototype.renderSection=function(n,r,t,a,l){var o=this,i="",f=r.lookup(n[1]);function s(d){return o.render(d,r,t,l)}if(f){if(he(f))for(var c=0,u=f.length;c0||!t)&&(l[o]=a+l[o]);return l.join(` -`)};M.prototype.renderPartial=function(n,r,t,a){if(t){var l=this.getConfigTags(a),o=ht(t)?t(n[1]):t[n[1]];if(o!=null){var i=n[6],f=n[5],s=n[4],c=o;f==0&&s&&(c=this.indentPartial(o,s,i));var u=this.parse(c,l);return this.renderTokens(u,r,t,c,a)}}};M.prototype.unescapedValue=function(n,r){var t=r.lookup(n[1]);if(t!=null)return t};M.prototype.escapedValue=function(n,r,t){var a=this.getConfigEscape(t)||G.escape,l=r.lookup(n[1]);if(l!=null)return typeof l=="number"&&a===G.escape?String(l):a(l)};M.prototype.rawValue=function(n){return n[1]};M.prototype.getConfigTags=function(n){return he(n)?n:n&&typeof n=="object"?n.tags:void 0};M.prototype.getConfigEscape=function(n){if(n&&typeof n=="object"&&!he(n))return n.escape};var G={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){ye.templateCache=e},get templateCache(){return ye.templateCache}},ye=new M;G.clearCache=function(){return ye.clearCache()};G.parse=function(n,r){return ye.parse(n,r)};G.render=function(n,r,t,a){if(typeof n!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+gr(n)+'" was given as the first argument for mustache#render(template, view, partials)');return ye.render(n,r,t,a)};G.escape=Cr;G.Scanner=we;G.Context=ue;G.Writer=M;var Lt={exports:{}},Ut={exports:{}};(function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(r,t){return r<>>32-t},rotr:function(r,t){return r<<32-t|r>>>t},endian:function(r){if(r.constructor==Number)return n.rotl(r,8)&16711935|n.rotl(r,24)&4278255360;for(var t=0;t0;r--)t.push(Math.floor(Math.random()*256));return t},bytesToWords:function(r){for(var t=[],a=0,l=0;a>>5]|=r[a]<<24-l%32;return t},wordsToBytes:function(r){for(var t=[],a=0;a>>5]>>>24-a%32&255);return t},bytesToHex:function(r){for(var t=[],a=0;a>>4).toString(16)),t.push((r[a]&15).toString(16));return t.join("")},hexToBytes:function(r){for(var t=[],a=0;a>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/ig,"");for(var t=[],a=0,l=0;a>>6-l*2);return t}};Ut.exports=n})();var Pr=Ut.exports,et={utf8:{stringToBytes:function(e){return et.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(et.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],r=0;r>>32-t},rotr:function(r,t){return r<<32-t|r>>>t},endian:function(r){if(r.constructor==Number)return n.rotl(r,8)&16711935|n.rotl(r,24)&4278255360;for(var t=0;t0;r--)t.push(Math.floor(Math.random()*256));return t},bytesToWords:function(r){for(var t=[],a=0,l=0;a>>5]|=r[a]<<24-l%32;return t},wordsToBytes:function(r){for(var t=[],a=0;a>>5]>>>24-a%32&255);return t},bytesToHex:function(r){for(var t=[],a=0;a>>4).toString(16)),t.push((r[a]&15).toString(16));return t.join("")},hexToBytes:function(r){for(var t=[],a=0;a>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/ig,"");for(var t=[],a=0,l=0;a>>6-l*2);return t}};Ut.exports=n})();var Pr=Ut.exports,et={utf8:{stringToBytes:function(e){return et.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(et.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],r=0;r * @license MIT - */var Nr=function(e){return e!=null&&(qt(e)||$r(e)||!!e._isBuffer)};function qt(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function $r(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&qt(e.slice(0,0))}(function(){var e=Pr,n=Ot.utf8,r=Nr,t=Ot.bin,a=function(l,o){l.constructor==String?o&&o.encoding==="binary"?l=t.stringToBytes(l):l=n.stringToBytes(l):r(l)?l=Array.prototype.slice.call(l,0):!Array.isArray(l)&&l.constructor!==Uint8Array&&(l=l.toString());for(var i=e.bytesToWords(l),f=l.length*8,s=1732584193,c=-271733879,u=-1732584194,d=271733878,h=0;h>>24)&16711935|(i[h]<<24|i[h]>>>8)&4278255360;i[f>>>5]|=128<>>9<<4)+14]=f;for(var _=a._ff,g=a._gg,x=a._hh,y=a._ii,h=0;h>>0,c=c+S>>>0,u=u+w>>>0,d=d+k>>>0}return e.endian([s,c,u,d])};a._ff=function(l,o,i,f,s,c,u){var d=l+(o&i|~o&f)+(s>>>0)+u;return(d<>>32-c)+o},a._gg=function(l,o,i,f,s,c,u){var d=l+(o&f|i&~f)+(s>>>0)+u;return(d<>>32-c)+o},a._hh=function(l,o,i,f,s,c,u){var d=l+(o^i^f)+(s>>>0)+u;return(d<>>32-c)+o},a._ii=function(l,o,i,f,s,c,u){var d=l+(i^(o|~f))+(s>>>0)+u;return(d<>>32-c)+o},a._blocksize=16,a._digestsize=16,Lt.exports=function(l,o){if(l==null)throw new Error("Illegal argument "+l);var i=e.wordsToBytes(a(l,o));return o&&o.asBytes?i:o&&o.asString?t.bytesToString(i):e.bytesToHex(i)}})();var Ir=Lt.exports;const jr=Nt(Ir),Le=`${ae.prefix}--search-results`,Dr=`${Le}__list`,Vt=`${Le}__header`,gt=`${Vt}__title`,Fr=`${gt}__text`,Ar=`${gt}__query`,mt=`${Le}__empty-list`,Br=`${mt}__title`,Hr=`${mt}__text`,te=`${ae.prefix}--search-result`,Mr=`${te}--selected`,Kr=`${te}--loading`,Lr=`${te}_curation`,tt=`${te}__content-wrapper`,je=`${tt}__body`,Ur=`${je}__button`,qr=`${je}--passage__highlights`,yt=`${te}__footer`,Vr=`${yt}__title`,zr=`${yt}__collection-name`,me=({body:e,buttonText:n="View document",element:r=null,elementType:t=null,elementLabel:a,handleSelectResult:l,passageTextClassName:o,hasResult:i,dangerouslyRenderHtml:f})=>{const s=[je];t&&s.push(`${je}--${t}`),t==="passage"&&(o?s.push(o):s.push(qr));const c=t==="table"?ln:Gt,u={className:s.join(" "),"data-testid":`search-result-element-body-${t}`,"aria-label":a,...t==="table"?{role:"article"}:{}};return m.useLayoutEffect(()=>(t==="table"&&qe.addHook("afterSanitizeAttributes",function(d){d.tagName==="TABLE"&&d.setAttribute("role","presentation")}),()=>{t==="table"&&qe.removeHook("afterSanitizeAttributes")}),[t]),T.jsxs(Fn,{children:[f?T.jsx("div",{...u,dangerouslySetInnerHTML:{__html:qe.sanitize(e)}}):T.jsx("div",{...u,children:e}),T.jsx(At,{className:Ur,onClick:l(r,t),kind:"ghost",renderIcon:c,disabled:!i,"data-testid":"search-result-element-preview-button",children:T.jsx("span",{children:n})})]})};try{me.displayName="ResultElement",me.__docgenInfo={description:"",displayName:"ResultElement",props:{body:{defaultValue:null,description:"body of the result element. Table html if a table element. Otherwise, first passage text or bodyField.",name:"body",required:!0,type:{name:"string"}},buttonText:{defaultValue:{value:"View document"},description:"CTA text for viewing the result element in the document",name:"buttonText",required:!1,type:{name:"string"}},element:{defaultValue:{value:"null"},description:"the result element object",name:"element",required:!1,type:{name:"QueryTableResult | QueryResultPassage | null"}},elementType:{defaultValue:{value:"null"},description:"type of result element",name:"elementType",required:!1,type:{name:'"table" | "passage" | null'}},handleSelectResult:{defaultValue:null,description:"handler for selecting the result element to view in the document",name:"handleSelectResult",required:!0,type:{name:'(element: QueryTableResult | QueryResultPassage | null | undefined, elementType: "table" | "passage" | null | undefined) => (event: MouseEvent) => void'}},passageTextClassName:{defaultValue:null,description:"specify a className for styling passage text and highlights",name:"passageTextClassName",required:!1,type:{name:"string"}},hasResult:{defaultValue:null,description:"specifies whether or not there is a Queryresult object corresponding with this ResultElement",name:"hasResult",required:!0,type:{name:"boolean"}},dangerouslyRenderHtml:{defaultValue:null,description:"specifies whether to use dangerouslySetInnerHtml when rendering this result element",name:"dangerouslyRenderHtml",required:!1,type:{name:"boolean"}},elementLabel:{defaultValue:null,description:"label used to describe the element",name:"elementLabel",required:!1,type:{name:"string"}}}}}catch{}const De=({bodyField:e,collectionName:n,passageTextClassName:r,result:t,resultLinkField:a,resultLinkTemplate:l,resultTitleField:o,showTablesOnlyResults:i,table:f,dangerouslyRenderHtml:s,usePassages:c,onSelectResult:u,messages:d})=>{var N,ne;const{setSelectedResult:h}=m.useContext(ve),{selectedResult:_,fetchDocumentsResponseStore:{isLoading:g}}=m.useContext(Fe),x=((N=t==null?void 0:t.document_passages)==null?void 0:N.filter(j=>!!(j!=null&&j.passage_text)))||[],y=(x==null?void 0:x.map(j=>j.passage_text))||[],b=c&&!!y&&y.length>0;let S=Q(t,e)?[Q(t,e)]:void 0,w=null,k=null;b&&(S=y,w=x,k="passage");const O=b||s,C=f==null?void 0:f.table_html,H=!(S&&!i||C);if(!i&&C&&!S)return null;let F=Zt(t,o);Array.isArray(F)&&(F=F[0]);const K=[te];an(t,_.document)&&K.push(Mr),((ne=t==null?void 0:t.result_metadata)==null?void 0:ne.document_retrieval_source)==="curation"&&K.push(Lr);const V=[tt],L=(j,Z)=>re=>{if(re.preventDefault(),a||l){const $=a?Q(t,a):G.render(l,t);window.open($)}else t&&(h({document:t,element:j,elementType:Z}),u&&u({document:t}))};return T.jsxs("div",{className:K.join(" "),children:[T.jsx("div",{className:V.join(" "),"data-testid":tt,children:H?T.jsx(me,{body:d.emptyResultContentBodyText,handleSelectResult:L,hasResult:!!t}):T.jsxs(T.Fragment,{children:[S&&!i&&S.map((j,Z)=>{const re=w==null?void 0:w[Z];return T.jsx(me,{body:j,buttonText:b?d.viewExcerptInDocumentButtonText:void 0,element:re,elementType:k,handleSelectResult:L,passageTextClassName:r,hasResult:!!t,dangerouslyRenderHtml:O},jr(j+Z))}),C&&T.jsx(me,{body:C,buttonText:d.viewTableInDocumentButtonText,element:f,elementType:"table",handleSelectResult:L,hasResult:!!t,dangerouslyRenderHtml:!0,elementLabel:d.elementTableLabel?on(d.elementTableLabel,{documentName:F},!1).join(""):void 0})]})}),(n||t)&&T.jsxs("div",{className:yt,children:[g||!t?T.jsx($t,{width:"30%","data-testid":"result-title-skeleton"}):T.jsx("div",{className:Vr,title:F,children:F}),n&&T.jsxs("div",{className:zr,title:n,children:[d.collectionLabel," ",n]})]})]})};try{De.displayName="Result",De.__docgenInfo={description:"",displayName:"Result",props:{bodyField:{defaultValue:null,description:"specify a field on the result object that will be displayed if there is no passage or usePassages is set to false",name:"bodyField",required:!0,type:{name:"string"}},collectionName:{defaultValue:null,description:"collection name to render on each search result",name:"collectionName",required:!1,type:{name:"string"}},passageTextClassName:{defaultValue:null,description:"specify a className for styling passage text and highlights",name:"passageTextClassName",required:!1,type:{name:"string"}},result:{defaultValue:null,description:"the query result document associated with the search result",name:"result",required:!1,type:{name:"QueryResult"}},resultLinkField:{defaultValue:null,description:`specify a field on the result object to pull the result link from + */var Nr=function(e){return e!=null&&(qt(e)||$r(e)||!!e._isBuffer)};function qt(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function $r(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&qt(e.slice(0,0))}(function(){var e=Pr,n=Ot.utf8,r=Nr,t=Ot.bin,a=function(l,o){l.constructor==String?o&&o.encoding==="binary"?l=t.stringToBytes(l):l=n.stringToBytes(l):r(l)?l=Array.prototype.slice.call(l,0):!Array.isArray(l)&&l.constructor!==Uint8Array&&(l=l.toString());for(var i=e.bytesToWords(l),f=l.length*8,s=1732584193,c=-271733879,u=-1732584194,d=271733878,h=0;h>>24)&16711935|(i[h]<<24|i[h]>>>8)&4278255360;i[f>>>5]|=128<>>9<<4)+14]=f;for(var _=a._ff,g=a._gg,x=a._hh,y=a._ii,h=0;h>>0,c=c+S>>>0,u=u+w>>>0,d=d+k>>>0}return e.endian([s,c,u,d])};a._ff=function(l,o,i,f,s,c,u){var d=l+(o&i|~o&f)+(s>>>0)+u;return(d<>>32-c)+o},a._gg=function(l,o,i,f,s,c,u){var d=l+(o&f|i&~f)+(s>>>0)+u;return(d<>>32-c)+o},a._hh=function(l,o,i,f,s,c,u){var d=l+(o^i^f)+(s>>>0)+u;return(d<>>32-c)+o},a._ii=function(l,o,i,f,s,c,u){var d=l+(i^(o|~f))+(s>>>0)+u;return(d<>>32-c)+o},a._blocksize=16,a._digestsize=16,Lt.exports=function(l,o){if(l==null)throw new Error("Illegal argument "+l);var i=e.wordsToBytes(a(l,o));return o&&o.asBytes?i:o&&o.asString?t.bytesToString(i):e.bytesToHex(i)}})();var Ir=Lt.exports;const jr=Nt(Ir),Le=`${ae.prefix}--search-results`,Dr=`${Le}__list`,Vt=`${Le}__header`,gt=`${Vt}__title`,Fr=`${gt}__text`,Ar=`${gt}__query`,mt=`${Le}__empty-list`,Br=`${mt}__title`,Hr=`${mt}__text`,te=`${ae.prefix}--search-result`,Mr=`${te}--selected`,Kr=`${te}--loading`,Lr=`${te}_curation`,tt=`${te}__content-wrapper`,je=`${tt}__body`,Ur=`${je}__button`,qr=`${je}--passage__highlights`,yt=`${te}__footer`,Vr=`${yt}__title`,zr=`${yt}__collection-name`,me=({body:e,buttonText:n="View document",element:r=null,elementType:t=null,elementLabel:a,handleSelectResult:l,passageTextClassName:o,hasResult:i,dangerouslyRenderHtml:f})=>{const s=[je];t&&s.push(`${je}--${t}`),t==="passage"&&(o?s.push(o):s.push(qr));const c=t==="table"?ln:Gt,u={className:s.join(" "),"data-testid":`search-result-element-body-${t}`,"aria-label":a,...t==="table"?{role:"article"}:{}};return m.useLayoutEffect(()=>(t==="table"&&qe.addHook("afterSanitizeAttributes",function(d){d.tagName==="TABLE"&&d.setAttribute("role","presentation")}),()=>{t==="table"&&qe.removeHook("afterSanitizeAttributes")}),[t]),T.jsxs(Fn,{children:[f?T.jsx("div",{...u,dangerouslySetInnerHTML:{__html:qe.sanitize(e)}}):T.jsx("div",{...u,children:e}),T.jsx(At,{className:Ur,onClick:l(r,t),kind:"ghost",renderIcon:c,disabled:!i,"data-testid":"search-result-element-preview-button",children:T.jsx("span",{children:n})})]})};try{me.displayName="ResultElement",me.__docgenInfo={description:"",displayName:"ResultElement",props:{body:{defaultValue:null,description:"body of the result element. Table html if a table element. Otherwise, first passage text or bodyField.",name:"body",required:!0,type:{name:"string"}},buttonText:{defaultValue:{value:"View document"},description:"CTA text for viewing the result element in the document",name:"buttonText",required:!1,type:{name:"string"}},element:{defaultValue:{value:"null"},description:"the result element object",name:"element",required:!1,type:{name:"QueryTableResult | QueryResultPassage | null"}},elementType:{defaultValue:{value:"null"},description:"type of result element",name:"elementType",required:!1,type:{name:'"table" | "passage" | null'}},handleSelectResult:{defaultValue:null,description:"handler for selecting the result element to view in the document",name:"handleSelectResult",required:!0,type:{name:'(element: QueryTableResult | QueryResultPassage | null | undefined, elementType: "table" | "passage" | null | undefined) => (event: MouseEvent) => void'}},passageTextClassName:{defaultValue:null,description:"specify a className for styling passage text and highlights",name:"passageTextClassName",required:!1,type:{name:"string"}},hasResult:{defaultValue:null,description:"specifies whether or not there is a Queryresult object corresponding with this ResultElement",name:"hasResult",required:!0,type:{name:"boolean"}},dangerouslyRenderHtml:{defaultValue:null,description:"specifies whether to use dangerouslySetInnerHtml when rendering this result element",name:"dangerouslyRenderHtml",required:!1,type:{name:"boolean"}},elementLabel:{defaultValue:null,description:"label used to describe the element",name:"elementLabel",required:!1,type:{name:"string"}}}}}catch{}const De=({bodyField:e,collectionName:n,passageTextClassName:r,result:t,resultLinkField:a,resultLinkTemplate:l,resultTitleField:o,showTablesOnlyResults:i,table:f,dangerouslyRenderHtml:s,usePassages:c,onSelectResult:u,messages:d})=>{var N,ne;const{setSelectedResult:h}=m.useContext(ve),{selectedResult:_,fetchDocumentsResponseStore:{isLoading:g}}=m.useContext(Fe),x=((N=t==null?void 0:t.document_passages)==null?void 0:N.filter(j=>!!(j!=null&&j.passage_text)))||[],y=(x==null?void 0:x.map(j=>j.passage_text))||[],b=c&&!!y&&y.length>0;let S=Q(t,e)?[Q(t,e)]:void 0,w=null,k=null;b&&(S=y,w=x,k="passage");const O=b||s,C=f==null?void 0:f.table_html,B=!(S&&!i||C);if(!i&&C&&!S)return null;let M=Zt(t,o);const K=[te];an(t,_.document)&&K.push(Mr),((ne=t==null?void 0:t.result_metadata)==null?void 0:ne.document_retrieval_source)==="curation"&&K.push(Lr);const V=[tt],L=(j,Z)=>re=>{if(re.preventDefault(),a||l){const $=a?Q(t,a):G.render(l,t);window.open($)}else t&&(h({document:t,element:j,elementType:Z}),u&&u({document:t}))};return T.jsxs("div",{className:K.join(" "),children:[T.jsx("div",{className:V.join(" "),"data-testid":tt,children:B?T.jsx(me,{body:d.emptyResultContentBodyText,handleSelectResult:L,hasResult:!!t}):T.jsxs(T.Fragment,{children:[S&&!i&&S.map((j,Z)=>{const re=w==null?void 0:w[Z];return T.jsx(me,{body:j,buttonText:b?d.viewExcerptInDocumentButtonText:void 0,element:re,elementType:k,handleSelectResult:L,passageTextClassName:r,hasResult:!!t,dangerouslyRenderHtml:O},jr(j+Z))}),C&&T.jsx(me,{body:C,buttonText:d.viewTableInDocumentButtonText,element:f,elementType:"table",handleSelectResult:L,hasResult:!!t,dangerouslyRenderHtml:!0,elementLabel:d.elementTableLabel?on(d.elementTableLabel,{documentName:M},!1).join(""):void 0})]})}),(n||t)&&T.jsxs("div",{className:yt,children:[g||!t?T.jsx($t,{width:"30%","data-testid":"result-title-skeleton"}):T.jsx("div",{className:Vr,title:M,children:M}),n&&T.jsxs("div",{className:zr,title:n,children:[d.collectionLabel," ",n]})]})]})};try{De.displayName="Result",De.__docgenInfo={description:"",displayName:"Result",props:{bodyField:{defaultValue:null,description:"specify a field on the result object that will be displayed if there is no passage or usePassages is set to false",name:"bodyField",required:!0,type:{name:"string"}},collectionName:{defaultValue:null,description:"collection name to render on each search result",name:"collectionName",required:!1,type:{name:"string"}},passageTextClassName:{defaultValue:null,description:"specify a className for styling passage text and highlights",name:"passageTextClassName",required:!1,type:{name:"string"}},result:{defaultValue:null,description:"the query result document associated with the search result",name:"result",required:!1,type:{name:"QueryResult"}},resultLinkField:{defaultValue:null,description:`specify a field on the result object to pull the result link from This will disable the "View passage in document" button and instead take the user to the corresponding link when clicked.`,name:"resultLinkField",required:!1,type:{name:"string"}},resultLinkTemplate:{defaultValue:null,description:`specify a string template using mustache templating syntax https://github.com/janl/mustache.js to create the result link from each result object This will disable the "View passage in document" button and instead take the user to the corresponding link when clicked.`,name:"resultLinkTemplate",required:!1,type:{name:"string"}},resultTitleField:{defaultValue:null,description:`specify a field on the result object to pull the result title from -if this field does not contain a valid title, document_id will be used`,name:"resultTitleField",required:!0,type:{name:"string"}},showTablesOnlyResults:{defaultValue:null,description:"specifies whether to show tables only results or regular search results",name:"showTablesOnlyResults",required:!1,type:{name:"boolean"}},table:{defaultValue:null,description:"the table result element for the search result",name:"table",required:!1,type:{name:"QueryTableResult"}},dangerouslyRenderHtml:{defaultValue:null,description:"specify whether or not any html in passages should be cleaned of html element tags",name:"dangerouslyRenderHtml",required:!1,type:{name:"boolean"}},usePassages:{defaultValue:null,description:"specify whether or not passages should be displayed in the search results",name:"usePassages",required:!1,type:{name:"boolean"}},messages:{defaultValue:null,description:"override default messages for the component by specifying custom and/or internationalized text strings",name:"messages",required:!0,type:{name:"Partial"}},onSelectResult:{defaultValue:null,description:"callback function from the component for sending document",name:"onSelectResult",required:!1,type:{name:"((document: { document: QueryResult; }) => void)"}}}}}catch{}const nt=({spellingSuggestionPrefix:e,onChange:n})=>{const r=`${ae.prefix}--spelling-suggestion`,t=`${ae.prefix}--spelling-suggestion__wrapper`,{searchResponseStore:{parameters:a,data:l}}=m.useContext(Fe),{performSearch:o}=m.useContext(ve),i=l&&l.suggested_query,f=Xt(c=>({...a,naturalLanguageQuery:c,offset:0,filter:""}),[a]),s=c=>{c.preventDefault(),i&&(o(f(i)),n&&n(i))};return T.jsx(T.Fragment,{children:!!i&&T.jsxs("div",{className:t,children:[e,T.jsx(At,{className:r,onClick:s,kind:"ghost",size:"small",children:i})]})})};try{nt.displayName="SpellingSuggestion",nt.__docgenInfo={description:"",displayName:"SpellingSuggestion",props:{spellingSuggestionPrefix:{defaultValue:null,description:"Message prefix used when displaying spelling suggestion",name:"spellingSuggestionPrefix",required:!1,type:{name:"string"}},onChange:{defaultValue:null,description:"custom handler invoked when any input element changes in the SearchResults component",name:"onChange",required:!1,type:{name:"((searchValue: string) => void)"}}}}}catch{}const Rt=(e,n)=>{const r=Q(n,"result_metadata.collection_id")||Q(n,"collection_id"),a=Q(e,"collections",[]).find(l=>l.collection_id===r);return Q(a,"name",r)},Wr=(e,n=null)=>({resultTitleField:e.resultTitleField||Q(n,"fields_shown.title.field","title"),bodyField:e.bodyField||Q(n,"fields_shown.body.field","text"),usePassages:e.usePassages===void 0?Q(n,"fields_shown.body.use_passage",!0):e.usePassages}),Qr=(e,n)=>e.filter(t=>!n.find(l=>t.source_document_id===l.document_id&&t.collection_id===Q(l,"result_metadata.collection_id"))),Pt={collectionLabel:"Collection:",viewExcerptInDocumentButtonText:"View passage in document",viewTableInDocumentButtonText:"View table in document",searchResultsTitle:"Search results for",tablesOnlyToggleLabelText:"Show table results only",spellingSuggestionsPrefix:"Did you mean:",emptyResultContentBodyText:"Excerpt unavailable.",noResultsFoundTitle:"No results found",noResultsFoundText:"Try making your search criteria less specific.",elementTableLabel:"Table snippet extracted from {documentName}"},Gr=3,Zr=["document_id","document_passages","extracted_metadata.filename","extracted_metadata.title","highlight","result_metadata"],Xr=({resultLinkField:e,resultLinkTemplate:n,resultTitleField:r,bodyField:t,dangerouslyRenderHtml:a=!1,usePassages:l,passageLength:o,passageTextClassName:i,showTablesOnlyToggle:f,showTablesOnly:s=!1,messages:c=Pt,onSelectResult:u,onChange:d,onTablesOnlyToggle:h})=>{const _={...Pt,...c},{searchResponseStore:{data:g,isLoading:x,parameters:y},collectionsResults:b,componentSettings:S}=m.useContext(Fe),[w,k]=m.useState(s),[O,C]=m.useState(!1),R=Wr({resultTitleField:r,bodyField:t,usePassages:l},S),{setSearchParameters:H,fetchDocuments:F}=m.useContext(ve),K=g&&g.matching_results||0,P=g&&g.results||[],V=g&&g.table_results||[],L=V&&V.length>0,N=K&&K>0,ne=w?L:N,[j,Z]=m.useState(typeof f>"u"?L:f);rt({displaySettings:R,resultLinkField:e}),m.useEffect(()=>{o&&H($=>({...$,passages:{characters:o,enabled:!0}}))},[o,H]),m.useEffect(()=>{k(s)},[s]),m.useEffect(()=>{h&&h(w)},[w,h]),m.useEffect(()=>{C(!1)},[y.naturalLanguageQuery]),m.useEffect(()=>{Z(typeof f>"u"?L:f)},[f,L]),It(()=>{const $=g&&g.table_results||[],Y=g&&g.results||[],X=Qr($,Y);if(!O&&w&&X&&X.length){const J="document_id::"+ze(X.map(ge=>ge.source_document_id)).join("|"),Ue=ze(Kt(X.map(ge=>ge.collection_id)));F(J,Ue,g||void 0),C(!0)}},[g,F,O,w]);const re=m.useMemo(()=>{const $=[te,Kr],Y=Math.min(y.count||10,Gr);return Array.from(Array(Y).keys()).map(J=>T.jsx("div",{"data-testid":"skeleton_text",className:$.join(" "),children:T.jsx($t,{paragraph:!0,width:"85%"})},J.toString()))},[y.count]);return T.jsxs("div",{className:Le,children:[T.jsxs("div",{className:Vt,"data-testid":"search_results_header",children:[T.jsxs("div",{className:gt,children:[T.jsxs("div",{className:Fr,children:[_.searchResultsTitle,T.jsx("span",{className:Ar,children:y.naturalLanguageQuery})]}),T.jsx(nt,{spellingSuggestionPrefix:_.spellingSuggestionsPrefix,onChange:d})]}),T.jsx(Je,{setShowTablesOnlyResults:k,showTablesOnlyToggle:j,showTablesOnlyResults:w,messages:_})]}),x?re:ne?T.jsx("div",{className:Dr,children:w?V.map($=>{const Y=Rt(b,$),X=P.find(J=>J.document_id===$.source_document_id);return T.jsx(De,{bodyField:R.bodyField,collectionName:Y,result:X,resultLinkField:e,resultLinkTemplate:n,resultTitleField:R.resultTitleField,showTablesOnlyResults:w,table:$,messages:_,onSelectResult:u},`${$.collection_id}_${$.table_id}`)}):P.map($=>{const Y=V.find(J=>J.source_document_id===$.document_id),X=Rt(b,$);return T.jsx(De,{bodyField:R.bodyField,collectionName:X,passageTextClassName:i,result:$,resultLinkField:e,resultLinkTemplate:n,resultTitleField:R.resultTitleField,table:Y,usePassages:R.usePassages,dangerouslyRenderHtml:a,messages:_,onSelectResult:u},`${Q($,"result_metadata.collection_id")}_${$.document_id}`)})}):g&&T.jsxs("div",{className:Qt(te,mt),children:[T.jsx(pr,{}),T.jsx("div",{className:Br,children:_.noResultsFoundTitle}),T.jsx("div",{className:Hr,children:_.noResultsFoundText})]})]})};function rt({displaySettings:e,resultLinkField:n}){const{searchResponseStore:{parameters:r}}=m.useContext(Fe),{setSearchParameters:t}=m.useContext(ve);It(()=>{const{bodyField:a,resultTitleField:l}=e;t(o=>{const i=o._return;return{...o,_return:ze(Kt([...i||[],...Zr,a,l,n]))}})},[e,r,n,t])}const fa=Yt(Xr,Jt("SearchResults"),en);try{rt.displayName="useUpdateQueryReturnParam",rt.__docgenInfo={description:"Hook to update search parameters' `return` param with the fields\nthat are necessary to render this component.",displayName:"useUpdateQueryReturnParam",props:{displaySettings:{defaultValue:null,description:"",name:"displaySettings",required:!0,type:{name:"DisplaySettingsParams"}},resultLinkField:{defaultValue:null,description:"",name:"resultLinkField",required:!1,type:{name:"string"}}}}}catch{}export{fa as S,Pt as d}; +if this field does not contain a valid title, document_id will be used`,name:"resultTitleField",required:!0,type:{name:"string"}},showTablesOnlyResults:{defaultValue:null,description:"specifies whether to show tables only results or regular search results",name:"showTablesOnlyResults",required:!1,type:{name:"boolean"}},table:{defaultValue:null,description:"the table result element for the search result",name:"table",required:!1,type:{name:"QueryTableResult"}},dangerouslyRenderHtml:{defaultValue:null,description:"specify whether or not any html in passages should be cleaned of html element tags",name:"dangerouslyRenderHtml",required:!1,type:{name:"boolean"}},usePassages:{defaultValue:null,description:"specify whether or not passages should be displayed in the search results",name:"usePassages",required:!1,type:{name:"boolean"}},messages:{defaultValue:null,description:"override default messages for the component by specifying custom and/or internationalized text strings",name:"messages",required:!0,type:{name:"Partial"}},onSelectResult:{defaultValue:null,description:"callback function from the component for sending document",name:"onSelectResult",required:!1,type:{name:"((document: { document: QueryResult; }) => void)"}}}}}catch{}const nt=({spellingSuggestionPrefix:e,onChange:n})=>{const r=`${ae.prefix}--spelling-suggestion`,t=`${ae.prefix}--spelling-suggestion__wrapper`,{searchResponseStore:{parameters:a,data:l}}=m.useContext(Fe),{performSearch:o}=m.useContext(ve),i=l&&l.suggested_query,f=Xt(c=>({...a,naturalLanguageQuery:c,offset:0,filter:""}),[a]),s=c=>{c.preventDefault(),i&&(o(f(i)),n&&n(i))};return T.jsx(T.Fragment,{children:!!i&&T.jsxs("div",{className:t,children:[e,T.jsx(At,{className:r,onClick:s,kind:"ghost",size:"small",children:i})]})})};try{nt.displayName="SpellingSuggestion",nt.__docgenInfo={description:"",displayName:"SpellingSuggestion",props:{spellingSuggestionPrefix:{defaultValue:null,description:"Message prefix used when displaying spelling suggestion",name:"spellingSuggestionPrefix",required:!1,type:{name:"string"}},onChange:{defaultValue:null,description:"custom handler invoked when any input element changes in the SearchResults component",name:"onChange",required:!1,type:{name:"((searchValue: string) => void)"}}}}}catch{}const Rt=(e,n)=>{const r=Q(n,"result_metadata.collection_id")||Q(n,"collection_id"),a=Q(e,"collections",[]).find(l=>l.collection_id===r);return Q(a,"name",r)},Wr=(e,n=null)=>({resultTitleField:e.resultTitleField||Q(n,"fields_shown.title.field","title"),bodyField:e.bodyField||Q(n,"fields_shown.body.field","text"),usePassages:e.usePassages===void 0?Q(n,"fields_shown.body.use_passage",!0):e.usePassages}),Qr=(e,n)=>e.filter(t=>!n.find(l=>t.source_document_id===l.document_id&&t.collection_id===Q(l,"result_metadata.collection_id"))),Pt={collectionLabel:"Collection:",viewExcerptInDocumentButtonText:"View passage in document",viewTableInDocumentButtonText:"View table in document",searchResultsTitle:"Search results for",tablesOnlyToggleLabelText:"Show table results only",spellingSuggestionsPrefix:"Did you mean:",emptyResultContentBodyText:"Excerpt unavailable.",noResultsFoundTitle:"No results found",noResultsFoundText:"Try making your search criteria less specific.",elementTableLabel:"Table snippet extracted from {documentName}"},Gr=3,Zr=["document_id","document_passages","extracted_metadata.filename","extracted_metadata.title","highlight","result_metadata"],Xr=({resultLinkField:e,resultLinkTemplate:n,resultTitleField:r,bodyField:t,dangerouslyRenderHtml:a=!1,usePassages:l,passageLength:o,passageTextClassName:i,showTablesOnlyToggle:f,showTablesOnly:s=!1,messages:c=Pt,onSelectResult:u,onChange:d,onTablesOnlyToggle:h})=>{const _={...Pt,...c},{searchResponseStore:{data:g,isLoading:x,parameters:y},collectionsResults:b,componentSettings:S}=m.useContext(Fe),[w,k]=m.useState(s),[O,C]=m.useState(!1),R=Wr({resultTitleField:r,bodyField:t,usePassages:l},S),{setSearchParameters:B,fetchDocuments:M}=m.useContext(ve),K=g&&g.matching_results||0,P=g&&g.results||[],V=g&&g.table_results||[],L=V&&V.length>0,N=K&&K>0,ne=w?L:N,[j,Z]=m.useState(typeof f>"u"?L:f);rt({displaySettings:R,resultLinkField:e}),m.useEffect(()=>{o&&B($=>({...$,passages:{characters:o,enabled:!0}}))},[o,B]),m.useEffect(()=>{k(s)},[s]),m.useEffect(()=>{h&&h(w)},[w,h]),m.useEffect(()=>{C(!1)},[y.naturalLanguageQuery]),m.useEffect(()=>{Z(typeof f>"u"?L:f)},[f,L]),It(()=>{const $=g&&g.table_results||[],Y=g&&g.results||[],X=Qr($,Y);if(!O&&w&&X&&X.length){const J="document_id::"+ze(X.map(ge=>ge.source_document_id)).join("|"),Ue=ze(Kt(X.map(ge=>ge.collection_id)));M(J,Ue,g||void 0),C(!0)}},[g,M,O,w]);const re=m.useMemo(()=>{const $=[te,Kr],Y=Math.min(y.count||10,Gr);return Array.from(Array(Y).keys()).map(J=>T.jsx("div",{"data-testid":"skeleton_text",className:$.join(" "),children:T.jsx($t,{paragraph:!0,width:"85%"})},J.toString()))},[y.count]);return T.jsxs("div",{className:Le,children:[T.jsxs("div",{className:Vt,"data-testid":"search_results_header",children:[T.jsxs("div",{className:gt,children:[T.jsxs("div",{className:Fr,children:[_.searchResultsTitle,T.jsx("span",{className:Ar,children:y.naturalLanguageQuery})]}),T.jsx(nt,{spellingSuggestionPrefix:_.spellingSuggestionsPrefix,onChange:d})]}),T.jsx(Je,{setShowTablesOnlyResults:k,showTablesOnlyToggle:j,showTablesOnlyResults:w,messages:_})]}),x?re:ne?T.jsx("div",{className:Dr,children:w?V.map($=>{const Y=Rt(b,$),X=P.find(J=>J.document_id===$.source_document_id);return T.jsx(De,{bodyField:R.bodyField,collectionName:Y,result:X,resultLinkField:e,resultLinkTemplate:n,resultTitleField:R.resultTitleField,showTablesOnlyResults:w,table:$,messages:_,onSelectResult:u},`${$.collection_id}_${$.table_id}`)}):P.map($=>{const Y=V.find(J=>J.source_document_id===$.document_id),X=Rt(b,$);return T.jsx(De,{bodyField:R.bodyField,collectionName:X,passageTextClassName:i,result:$,resultLinkField:e,resultLinkTemplate:n,resultTitleField:R.resultTitleField,table:Y,usePassages:R.usePassages,dangerouslyRenderHtml:a,messages:_,onSelectResult:u},`${Q($,"result_metadata.collection_id")}_${$.document_id}`)})}):g&&T.jsxs("div",{className:Qt(te,mt),children:[T.jsx(pr,{}),T.jsx("div",{className:Br,children:_.noResultsFoundTitle}),T.jsx("div",{className:Hr,children:_.noResultsFoundText})]})]})};function rt({displaySettings:e,resultLinkField:n}){const{searchResponseStore:{parameters:r}}=m.useContext(Fe),{setSearchParameters:t}=m.useContext(ve);It(()=>{const{bodyField:a,resultTitleField:l}=e;t(o=>{const i=o._return;return{...o,_return:ze(Kt([...i||[],...Zr,a,l,n]))}})},[e,r,n,t])}const fa=Yt(Xr,Jt("SearchResults"),en);try{rt.displayName="useUpdateQueryReturnParam",rt.__docgenInfo={description:"Hook to update search parameters' `return` param with the fields\nthat are necessary to render this component.",displayName:"useUpdateQueryReturnParam",props:{displaySettings:{defaultValue:null,description:"",name:"displaySettings",required:!0,type:{name:"DisplaySettingsParams"}},resultLinkField:{defaultValue:null,description:"",name:"resultLinkField",required:!1,type:{name:"string"}}}}}catch{}export{fa as S,Pt as d}; diff --git a/docs/storybook/assets/SearchResults.stories-vMiFh_tX.js b/docs/storybook/assets/SearchResults.stories-9mgA_WJq.js similarity index 97% rename from docs/storybook/assets/SearchResults.stories-vMiFh_tX.js rename to docs/storybook/assets/SearchResults.stories-9mgA_WJq.js index 5eecb2ec0..40b7ad991 100644 --- a/docs/storybook/assets/SearchResults.stories-vMiFh_tX.js +++ b/docs/storybook/assets/SearchResults.stories-9mgA_WJq.js @@ -1,4 +1,4 @@ -import{j as o}from"./jsx-runtime-FsUICBgo.js";import{d as e}from"./index-777x7qAF.js";import{S as _,D as y,c as x}from"./storybookUtils-P7YVKdto.js";import{D as S,a as v}from"./chunk-WFFRPTHA-XxQL4zvM.js";import{S as f,d as M}from"./SearchResults-M91Z8TUW.js";import{g as m}from"./callBound-4MCeDK1M.js";import{c as w}from"./cloneDeep-eaEuvD8i.js";import"./index-RfLt4OUa.js";import"./pickBy-llkn_6s3.js";import"./isPlainObject-g73re4jY.js";import"./index-xck8ovCi.js";import"./preview-errors-Ix78kkVy.js";import"./debounce-eWC8LGMf.js";import"./index-4QtD-hFu.js";import"./v4-yQnnJER4.js";import"./index-tUYgphcS.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./getDocumentTitle-Zh1PemE-.js";import"./Button-KibTbxDG.js";import"./Link-_yif9kZE.js";import"./purify.es-29Q0w72t.js";import"./bucket-25-SwNT5LZP.js";import"./formatMessage-wl7oTduw.js";import"./_baseClone-6sJ_SjB4.js";const s="8713a92b-28aa-b291-0000-016ddc68aa2a",b={collections:[{collection_id:s,name:"IBM Docs"}]},T={matching_results:20967,retrieval_details:{document_retrieval_strategy:"untrained"},results:[{document_id:"d1dadc06c2b0855289c728b2c3819514",linkField:"http://example.com",result_metadata:{collection_id:s},title:"Alternate title",document_passages:[{passage_text:"Machine-learning techniques are required to improve the accuracy of predictive models. Depending on the nature of the business problem being addressed, there are different approaches based on the type and volume of the data."}],extracted_metadata:{title:"IBM_Analytics_Machine_Learning.pdf"}},{document_id:"59ee2403f45647091eafe392664588cd",linkField:"http://example.com",result_metadata:{collection_id:s},title:"Alternate title",document_passages:[{passage_text:"Deep learning is a specific method of machine learning that incorporates neural networks in successive layers from data in an iterative manner."},{passage_text:"Deep learning is especially useful when you're trying to learn patterns from unstructured data."}],extracted_metadata:{title:"IBM_Analytics_Machine_Learning.pdf"}},{document_id:"79953f3b6f304adef09b4707627495ca",linkField:"http://example.com",result_metadata:{collection_id:s},extracted_metadata:{title:"IBM_Analytics_Machine_Learning.pdf"},title:"Alternate title",text:"Machine learning trains a model from patterns in your data, exploring a space of possible models defined by parameters. If your parameter space is too big, you’ll overfit to your training data and train a model that doesn’t generalize beyond it. A detailed explanation requires more math, but as a rule you should keep your models as simple as possible."},{document_id:"79953f3b6f304adef09b470762567435",linkField:"http://example.com",result_metadata:{collection_id:s},title:"Alternate title",extracted_metadata:{title:"IBM_Analytics_Machine_Learning.pdf"}}],table_results:[{table_id:"558ada041262d5b0aa02a05429d798c9",source_document_id:"59ee2403f45647091eafe392664588cd",collection_id:"8713a92b-28aa-b291-0000-016ddc68aa2a",table_html:'
Supervised LearningUnsupervised Learning
Support Vector MachinesK-Means
Nearest NeighborHidden Markov Model
'},{table_id:"558ada041262d5b0aa02a05429d798c7",source_document_id:"66666603f45647091eafe392664588cd",collection_id:"8713a92b-28aa-b291-0000-016ddc68aa2a",table_html:'
Supervised LearningUnsupervised Learning
Support Vector MachinesK-Means
Nearest NeighborHidden Markov Model
'}]},F=(t,a,n)=>(a<50||a>2e3||t.results.forEach((d,c)=>{let r=m(d,`${n}`),l=m(d,"document_passages[0].passage_text");r&&(r=r.substr(0,a),t.results[c][n]=r),l&&(l=l.substr(0,a),t.results[c].document_passages[0].passage_text=l)}),t),p=()=>({bodyField:e.text("Field on the result that will be displayed if there is no passage or usePassages is set to false (bodyField)","text"),resultTitleField:e.select("Field on the result that will be used for the title (resultTitleField)",{"extractedMetadata.title":"extracted_metadata.title",title:"title"},"extracted_metadata.title"),resultLinkField:e.select("Field on the result that will be used for the result link (resultLinkField)",{"Select Field":void 0,linkField:"linkField"},void 0),resultLinkTemplate:e.text("Field on the result that will be used for the title (resultLinkTemplate)","http://example.com/subdomain/{{document_id}}"),showTablesOnlyToggle:e.boolean("Display a toggle for showing table results only (showTablesOnlyToggle)",!1),showTablesOnly:e.boolean("Override to show table results only (showTablesOnly)",!1),usePassages:e.boolean("Use passages when rendering the results (usePassages)",!0),passageLength:e.number("Passage length, between 50 and 2000 (passageLength)",400),dangerouslyRenderHtml:e.boolean("Render passages as HTML (dangerouslyRenderHtml)",!1),passageTextClassName:e.select("ClassName for styling passage text and highlights (passageTextClassName)",{null:"","Yellow passage highlights":"yellow","Red passage highlights":"red","Green passage highlights":"green"},""),messages:e.object("Default messages for the component's text strings",M)});class L extends y{async listCollections(a){return v("listCollection")(a),x(b)}}const k=t=>{const a=F(w(T),t.passageLength,t.bodyField);return{searchClient:new L,projectId:e.text("Project ID","project-id"),overrideSearchResults:a,overrideCollectionsResults:b}},ee={title:"SearchResults",parameters:{component:f}},i={render:()=>o.jsx(_,{children:o.jsxs(S,{...k(p()),children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:` +import{j as o}from"./jsx-runtime-FsUICBgo.js";import{d as e}from"./index-777x7qAF.js";import{S as _,D as y,c as x}from"./storybookUtils-P7YVKdto.js";import{D as S,a as v}from"./chunk-WFFRPTHA-XxQL4zvM.js";import{S as f,d as M}from"./SearchResults-huRufqlh.js";import{g as m}from"./callBound-4MCeDK1M.js";import{c as w}from"./cloneDeep-eaEuvD8i.js";import"./index-RfLt4OUa.js";import"./pickBy-llkn_6s3.js";import"./isPlainObject-g73re4jY.js";import"./index-xck8ovCi.js";import"./preview-errors-Ix78kkVy.js";import"./debounce-eWC8LGMf.js";import"./index-4QtD-hFu.js";import"./v4-yQnnJER4.js";import"./index-tUYgphcS.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./getDocumentTitle-51WyFHkN.js";import"./Button-KibTbxDG.js";import"./Link-_yif9kZE.js";import"./purify.es-29Q0w72t.js";import"./bucket-25-SwNT5LZP.js";import"./formatMessage-wl7oTduw.js";import"./_baseClone-6sJ_SjB4.js";const s="8713a92b-28aa-b291-0000-016ddc68aa2a",b={collections:[{collection_id:s,name:"IBM Docs"}]},T={matching_results:20967,retrieval_details:{document_retrieval_strategy:"untrained"},results:[{document_id:"d1dadc06c2b0855289c728b2c3819514",linkField:"http://example.com",result_metadata:{collection_id:s},title:"Alternate title",document_passages:[{passage_text:"Machine-learning techniques are required to improve the accuracy of predictive models. Depending on the nature of the business problem being addressed, there are different approaches based on the type and volume of the data."}],extracted_metadata:{title:"IBM_Analytics_Machine_Learning.pdf"}},{document_id:"59ee2403f45647091eafe392664588cd",linkField:"http://example.com",result_metadata:{collection_id:s},title:"Alternate title",document_passages:[{passage_text:"Deep learning is a specific method of machine learning that incorporates neural networks in successive layers from data in an iterative manner."},{passage_text:"Deep learning is especially useful when you're trying to learn patterns from unstructured data."}],extracted_metadata:{title:"IBM_Analytics_Machine_Learning.pdf"}},{document_id:"79953f3b6f304adef09b4707627495ca",linkField:"http://example.com",result_metadata:{collection_id:s},extracted_metadata:{title:"IBM_Analytics_Machine_Learning.pdf"},title:"Alternate title",text:"Machine learning trains a model from patterns in your data, exploring a space of possible models defined by parameters. If your parameter space is too big, you’ll overfit to your training data and train a model that doesn’t generalize beyond it. A detailed explanation requires more math, but as a rule you should keep your models as simple as possible."},{document_id:"79953f3b6f304adef09b470762567435",linkField:"http://example.com",result_metadata:{collection_id:s},title:"Alternate title",extracted_metadata:{title:"IBM_Analytics_Machine_Learning.pdf"}}],table_results:[{table_id:"558ada041262d5b0aa02a05429d798c9",source_document_id:"59ee2403f45647091eafe392664588cd",collection_id:"8713a92b-28aa-b291-0000-016ddc68aa2a",table_html:'
Supervised LearningUnsupervised Learning
Support Vector MachinesK-Means
Nearest NeighborHidden Markov Model
'},{table_id:"558ada041262d5b0aa02a05429d798c7",source_document_id:"66666603f45647091eafe392664588cd",collection_id:"8713a92b-28aa-b291-0000-016ddc68aa2a",table_html:'
Supervised LearningUnsupervised Learning
Support Vector MachinesK-Means
Nearest NeighborHidden Markov Model
'}]},F=(t,a,n)=>(a<50||a>2e3||t.results.forEach((d,c)=>{let r=m(d,`${n}`),l=m(d,"document_passages[0].passage_text");r&&(r=r.substr(0,a),t.results[c][n]=r),l&&(l=l.substr(0,a),t.results[c].document_passages[0].passage_text=l)}),t),p=()=>({bodyField:e.text("Field on the result that will be displayed if there is no passage or usePassages is set to false (bodyField)","text"),resultTitleField:e.select("Field on the result that will be used for the title (resultTitleField)",{"extractedMetadata.title":"extracted_metadata.title",title:"title"},"extracted_metadata.title"),resultLinkField:e.select("Field on the result that will be used for the result link (resultLinkField)",{"Select Field":void 0,linkField:"linkField"},void 0),resultLinkTemplate:e.text("Field on the result that will be used for the title (resultLinkTemplate)","http://example.com/subdomain/{{document_id}}"),showTablesOnlyToggle:e.boolean("Display a toggle for showing table results only (showTablesOnlyToggle)",!1),showTablesOnly:e.boolean("Override to show table results only (showTablesOnly)",!1),usePassages:e.boolean("Use passages when rendering the results (usePassages)",!0),passageLength:e.number("Passage length, between 50 and 2000 (passageLength)",400),dangerouslyRenderHtml:e.boolean("Render passages as HTML (dangerouslyRenderHtml)",!1),passageTextClassName:e.select("ClassName for styling passage text and highlights (passageTextClassName)",{null:"","Yellow passage highlights":"yellow","Red passage highlights":"red","Green passage highlights":"green"},""),messages:e.object("Default messages for the component's text strings",M)});class L extends y{async listCollections(a){return v("listCollection")(a),x(b)}}const k=t=>{const a=F(w(T),t.passageLength,t.bodyField);return{searchClient:new L,projectId:e.text("Project ID","project-id"),overrideSearchResults:a,overrideCollectionsResults:b}},ee={title:"SearchResults",parameters:{component:f}},i={render:()=>o.jsx(_,{children:o.jsxs(S,{...k(p()),children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:` .red em { background-color: #ff9191 } .yellow em { background-color: yellow } .green em { background-color: #a1ffb7 } diff --git a/docs/storybook/assets/WithTooltip-V3YHNWJZ--j86pm_C.js b/docs/storybook/assets/WithTooltip-V3YHNWJZ-5A2-LERo.js similarity index 77% rename from docs/storybook/assets/WithTooltip-V3YHNWJZ--j86pm_C.js rename to docs/storybook/assets/WithTooltip-V3YHNWJZ-5A2-LERo.js index 806ee22e6..dda3ed815 100644 --- a/docs/storybook/assets/WithTooltip-V3YHNWJZ--j86pm_C.js +++ b/docs/storybook/assets/WithTooltip-V3YHNWJZ-5A2-LERo.js @@ -1 +1 @@ -import{W as S,W as b,a as c}from"./index-yCoF09M4.js";import"./iframe-_98K0_ok.js";import"../sb-preview/runtime.js";import"./pickBy-llkn_6s3.js";import"./callBound-4MCeDK1M.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./inheritsLoose-O2jMHMzR.js";import"./pickBy-lHA7W3rs.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./index-xck8ovCi.js";import"./index-I0bGnlnk.js";import"./assert-1o4ErrXT.js";export{S as WithToolTipState,b as WithTooltip,c as WithTooltipPure}; +import{W as S,W as b,a as c}from"./index-lt-u4Ncf.js";import"./iframe-mUD1hmuH.js";import"../sb-preview/runtime.js";import"./pickBy-llkn_6s3.js";import"./callBound-4MCeDK1M.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./inheritsLoose-O2jMHMzR.js";import"./pickBy-lHA7W3rs.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./index-xck8ovCi.js";import"./index-I0bGnlnk.js";import"./assert-1o4ErrXT.js";export{S as WithToolTipState,b as WithTooltip,c as WithTooltipPure}; diff --git a/docs/storybook/assets/formatter-SWP5E3XI--SW_q4fo.js b/docs/storybook/assets/formatter-SWP5E3XI-Nl3Uqdo1.js similarity index 99% rename from docs/storybook/assets/formatter-SWP5E3XI--SW_q4fo.js rename to docs/storybook/assets/formatter-SWP5E3XI-Nl3Uqdo1.js index 9f54f867d..a69888bc9 100644 --- a/docs/storybook/assets/formatter-SWP5E3XI--SW_q4fo.js +++ b/docs/storybook/assets/formatter-SWP5E3XI-Nl3Uqdo1.js @@ -1,4 +1,4 @@ -import{m as cl,g as Dn}from"./pickBy-llkn_6s3.js";import{_ as ta,b as ra}from"./index-yCoF09M4.js";import"./callBound-4MCeDK1M.js";import"./index-RfLt4OUa.js";import"./iframe-_98K0_ok.js";import"../sb-preview/runtime.js";import"./index-miLrID2P.js";import"./inheritsLoose-O2jMHMzR.js";import"./pickBy-lHA7W3rs.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./index-xck8ovCi.js";import"./index-I0bGnlnk.js";import"./assert-1o4ErrXT.js";var Dl=ra({"node_modules/prettier/parser-html.js"(Jr,Xr){(function(Ae){if(typeof Jr=="object"&&typeof Xr=="object")Xr.exports=Ae();else if(typeof define=="function"&&define.amd)define(Ae);else{var Yt=typeof globalThis<"u"?globalThis:typeof Dn<"u"?Dn:typeof self<"u"?self:this||{};Yt.prettierPlugins=Yt.prettierPlugins||{},Yt.prettierPlugins.html=Ae()}})(function(){var Ae=(ot,Ne)=>()=>(Ne||ot((Ne={exports:{}}).exports,Ne),Ne.exports),Yt=Ae((ot,Ne)=>{var Se=function(Oe){return Oe&&Oe.Math==Math&&Oe};Ne.exports=Se(typeof globalThis=="object"&&globalThis)||Se(typeof window=="object"&&window)||Se(typeof self=="object"&&self)||Se(typeof Dn=="object"&&Dn)||function(){return this}()||Function("return this")()}),hr=Ae((ot,Ne)=>{Ne.exports=function(Se){try{return!!Se()}catch{return!0}}}),br=Ae((ot,Ne)=>{var Se=hr();Ne.exports=!Se(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})}),Hr=Ae((ot,Ne)=>{var Se=hr();Ne.exports=!Se(function(){var Oe=(function(){}).bind();return typeof Oe!="function"||Oe.hasOwnProperty("prototype")})}),gr=Ae((ot,Ne)=>{var Se=Hr(),Oe=Function.prototype.call;Ne.exports=Se?Oe.bind(Oe):function(){return Oe.apply(Oe,arguments)}}),dn=Ae(ot=>{var Ne={}.propertyIsEnumerable,Se=Object.getOwnPropertyDescriptor,Oe=Se&&!Ne.call({1:2},1);ot.f=Oe?function(ee){var V=Se(this,ee);return!!V&&V.enumerable}:Ne}),Lr=Ae((ot,Ne)=>{Ne.exports=function(Se,Oe){return{enumerable:!(Se&1),configurable:!(Se&2),writable:!(Se&4),value:Oe}}}),Dr=Ae((ot,Ne)=>{var Se=Hr(),Oe=Function.prototype,ee=Oe.call,V=Se&&Oe.bind.bind(ee,ee);Ne.exports=Se?V:function(W){return function(){return ee.apply(W,arguments)}}}),Br=Ae((ot,Ne)=>{var Se=Dr(),Oe=Se({}.toString),ee=Se("".slice);Ne.exports=function(V){return ee(Oe(V),8,-1)}}),Zr=Ae((ot,Ne)=>{var Se=Dr(),Oe=hr(),ee=Br(),V=Object,W=Se("".split);Ne.exports=Oe(function(){return!V("z").propertyIsEnumerable(0)})?function(Z){return ee(Z)=="String"?W(Z,""):V(Z)}:V}),nn=Ae((ot,Ne)=>{Ne.exports=function(Se){return Se==null}}),Vn=Ae((ot,Ne)=>{var Se=nn(),Oe=TypeError;Ne.exports=function(ee){if(Se(ee))throw Oe("Can't call method on "+ee);return ee}}),fn=Ae((ot,Ne)=>{var Se=Zr(),Oe=Vn();Ne.exports=function(ee){return Se(Oe(ee))}}),Un=Ae((ot,Ne)=>{var Se=typeof document=="object"&&document.all,Oe=typeof Se>"u"&&Se!==void 0;Ne.exports={all:Se,IS_HTMLDDA:Oe}}),dr=Ae((ot,Ne)=>{var Se=Un(),Oe=Se.all;Ne.exports=Se.IS_HTMLDDA?function(ee){return typeof ee=="function"||ee===Oe}:function(ee){return typeof ee=="function"}}),Or=Ae((ot,Ne)=>{var Se=dr(),Oe=Un(),ee=Oe.all;Ne.exports=Oe.IS_HTMLDDA?function(V){return typeof V=="object"?V!==null:Se(V)||V===ee}:function(V){return typeof V=="object"?V!==null:Se(V)}}),un=Ae((ot,Ne)=>{var Se=Yt(),Oe=dr(),ee=function(V){return Oe(V)?V:void 0};Ne.exports=function(V,W){return arguments.length<2?ee(Se[V]):Se[V]&&Se[V][W]}}),Gn=Ae((ot,Ne)=>{var Se=Dr();Ne.exports=Se({}.isPrototypeOf)}),si=Ae((ot,Ne)=>{var Se=un();Ne.exports=Se("navigator","userAgent")||""}),ai=Ae((ot,Ne)=>{var Se=Yt(),Oe=si(),ee=Se.process,V=Se.Deno,W=ee&&ee.versions||V&&V.version,Z=W&&W.v8,Y,ne;Z&&(Y=Z.split("."),ne=Y[0]>0&&Y[0]<4?1:+(Y[0]+Y[1])),!ne&&Oe&&(Y=Oe.match(/Edge\/(\d+)/),(!Y||Y[1]>=74)&&(Y=Oe.match(/Chrome\/(\d+)/),Y&&(ne=+Y[1]))),Ne.exports=ne}),Jn=Ae((ot,Ne)=>{var Se=ai(),Oe=hr();Ne.exports=!!Object.getOwnPropertySymbols&&!Oe(function(){var ee=Symbol();return!String(ee)||!(Object(ee)instanceof Symbol)||!Symbol.sham&&Se&&Se<41})}),Xn=Ae((ot,Ne)=>{var Se=Jn();Ne.exports=Se&&!Symbol.sham&&typeof Symbol.iterator=="symbol"}),Wn=Ae((ot,Ne)=>{var Se=un(),Oe=dr(),ee=Gn(),V=Xn(),W=Object;Ne.exports=V?function(Z){return typeof Z=="symbol"}:function(Z){var Y=Se("Symbol");return Oe(Y)&&ee(Y.prototype,W(Z))}}),mn=Ae((ot,Ne)=>{var Se=String;Ne.exports=function(Oe){try{return Se(Oe)}catch{return"Object"}}}),sn=Ae((ot,Ne)=>{var Se=dr(),Oe=mn(),ee=TypeError;Ne.exports=function(V){if(Se(V))return V;throw ee(Oe(V)+" is not a function")}}),hn=Ae((ot,Ne)=>{var Se=sn(),Oe=nn();Ne.exports=function(ee,V){var W=ee[V];return Oe(W)?void 0:Se(W)}}),oi=Ae((ot,Ne)=>{var Se=gr(),Oe=dr(),ee=Or(),V=TypeError;Ne.exports=function(W,Z){var Y,ne;if(Z==="string"&&Oe(Y=W.toString)&&!ee(ne=Se(Y,W))||Oe(Y=W.valueOf)&&!ee(ne=Se(Y,W))||Z!=="string"&&Oe(Y=W.toString)&&!ee(ne=Se(Y,W)))return ne;throw V("Can't convert object to primitive value")}}),li=Ae((ot,Ne)=>{Ne.exports=!1}),gn=Ae((ot,Ne)=>{var Se=Yt(),Oe=Object.defineProperty;Ne.exports=function(ee,V){try{Oe(Se,ee,{value:V,configurable:!0,writable:!0})}catch{Se[ee]=V}return V}}),yn=Ae((ot,Ne)=>{var Se=Yt(),Oe=gn(),ee="__core-js_shared__",V=Se[ee]||Oe(ee,{});Ne.exports=V}),zn=Ae((ot,Ne)=>{var Se=li(),Oe=yn();(Ne.exports=function(ee,V){return Oe[ee]||(Oe[ee]=V!==void 0?V:{})})("versions",[]).push({version:"3.26.1",mode:Se?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"})}),xn=Ae((ot,Ne)=>{var Se=Vn(),Oe=Object;Ne.exports=function(ee){return Oe(Se(ee))}}),kr=Ae((ot,Ne)=>{var Se=Dr(),Oe=xn(),ee=Se({}.hasOwnProperty);Ne.exports=Object.hasOwn||function(V,W){return ee(Oe(V),W)}}),Hn=Ae((ot,Ne)=>{var Se=Dr(),Oe=0,ee=Math.random(),V=Se(1 .toString);Ne.exports=function(W){return"Symbol("+(W===void 0?"":W)+")_"+V(++Oe+ee,36)}}),$r=Ae((ot,Ne)=>{var Se=Yt(),Oe=zn(),ee=kr(),V=Hn(),W=Jn(),Z=Xn(),Y=Oe("wks"),ne=Se.Symbol,Fe=ne&&ne.for,je=Z?ne:ne&&ne.withoutSetter||V;Ne.exports=function(he){if(!ee(Y,he)||!(W||typeof Y[he]=="string")){var qe="Symbol."+he;W&&ee(ne,he)?Y[he]=ne[he]:Z&&Fe?Y[he]=Fe(qe):Y[he]=je(qe)}return Y[he]}}),pi=Ae((ot,Ne)=>{var Se=gr(),Oe=Or(),ee=Wn(),V=hn(),W=oi(),Z=$r(),Y=TypeError,ne=Z("toPrimitive");Ne.exports=function(Fe,je){if(!Oe(Fe)||ee(Fe))return Fe;var he=V(Fe,ne),qe;if(he){if(je===void 0&&(je="default"),qe=Se(he,Fe,je),!Oe(qe)||ee(qe))return qe;throw Y("Can't convert object to primitive value")}return je===void 0&&(je="number"),W(Fe,je)}}),En=Ae((ot,Ne)=>{var Se=pi(),Oe=Wn();Ne.exports=function(ee){var V=Se(ee,"string");return Oe(V)?V:V+""}}),ci=Ae((ot,Ne)=>{var Se=Yt(),Oe=Or(),ee=Se.document,V=Oe(ee)&&Oe(ee.createElement);Ne.exports=function(W){return V?ee.createElement(W):{}}}),Yn=Ae((ot,Ne)=>{var Se=br(),Oe=hr(),ee=ci();Ne.exports=!Se&&!Oe(function(){return Object.defineProperty(ee("div"),"a",{get:function(){return 7}}).a!=7})}),Kn=Ae(ot=>{var Ne=br(),Se=gr(),Oe=dn(),ee=Lr(),V=fn(),W=En(),Z=kr(),Y=Yn(),ne=Object.getOwnPropertyDescriptor;ot.f=Ne?ne:function(Fe,je){if(Fe=V(Fe),je=W(je),Y)try{return ne(Fe,je)}catch{}if(Z(Fe,je))return ee(!Se(Oe.f,Fe,je),Fe[je])}}),Di=Ae((ot,Ne)=>{var Se=br(),Oe=hr();Ne.exports=Se&&Oe(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})}),Wr=Ae((ot,Ne)=>{var Se=Or(),Oe=String,ee=TypeError;Ne.exports=function(V){if(Se(V))return V;throw ee(Oe(V)+" is not an object")}}),en=Ae(ot=>{var Ne=br(),Se=Yn(),Oe=Di(),ee=Wr(),V=En(),W=TypeError,Z=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,ne="enumerable",Fe="configurable",je="writable";ot.f=Ne?Oe?function(he,qe,et){if(ee(he),qe=V(qe),ee(et),typeof he=="function"&&qe==="prototype"&&"value"in et&&je in et&&!et[je]){var Ze=Y(he,qe);Ze&&Ze[je]&&(he[qe]=et.value,et={configurable:Fe in et?et[Fe]:Ze[Fe],enumerable:ne in et?et[ne]:Ze[ne],writable:!1})}return Z(he,qe,et)}:Z:function(he,qe,et){if(ee(he),qe=V(qe),ee(et),Se)try{return Z(he,qe,et)}catch{}if("get"in et||"set"in et)throw W("Accessors not supported");return"value"in et&&(he[qe]=et.value),he}}),Qn=Ae((ot,Ne)=>{var Se=br(),Oe=en(),ee=Lr();Ne.exports=Se?function(V,W,Z){return Oe.f(V,W,ee(1,Z))}:function(V,W,Z){return V[W]=Z,V}}),di=Ae((ot,Ne)=>{var Se=br(),Oe=kr(),ee=Function.prototype,V=Se&&Object.getOwnPropertyDescriptor,W=Oe(ee,"name"),Z=W&&(function(){}).name==="something",Y=W&&(!Se||Se&&V(ee,"name").configurable);Ne.exports={EXISTS:W,PROPER:Z,CONFIGURABLE:Y}}),Zn=Ae((ot,Ne)=>{var Se=Dr(),Oe=dr(),ee=yn(),V=Se(Function.toString);Oe(ee.inspectSource)||(ee.inspectSource=function(W){return V(W)}),Ne.exports=ee.inspectSource}),fi=Ae((ot,Ne)=>{var Se=Yt(),Oe=dr(),ee=Se.WeakMap;Ne.exports=Oe(ee)&&/native code/.test(String(ee))}),mi=Ae((ot,Ne)=>{var Se=zn(),Oe=Hn(),ee=Se("keys");Ne.exports=function(V){return ee[V]||(ee[V]=Oe(V))}}),eu=Ae((ot,Ne)=>{Ne.exports={}}),hi=Ae((ot,Ne)=>{var Se=fi(),Oe=Yt(),ee=Or(),V=Qn(),W=kr(),Z=yn(),Y=mi(),ne=eu(),Fe="Object already initialized",je=Oe.TypeError,he=Oe.WeakMap,qe,et,Ze,nt=function(At){return Ze(At)?et(At):qe(At,{})},rt=function(At){return function(Lt){var qt;if(!ee(Lt)||(qt=et(Lt)).type!==At)throw je("Incompatible receiver, "+At+" required");return qt}};Se||Z.state?($=Z.state||(Z.state=new he),$.get=$.get,$.has=$.has,$.set=$.set,qe=function(At,Lt){if($.has(At))throw je(Fe);return Lt.facade=At,$.set(At,Lt),Lt},et=function(At){return $.get(At)||{}},Ze=function(At){return $.has(At)}):(Ft=Y("state"),ne[Ft]=!0,qe=function(At,Lt){if(W(At,Ft))throw je(Fe);return Lt.facade=At,V(At,Ft,Lt),Lt},et=function(At){return W(At,Ft)?At[Ft]:{}},Ze=function(At){return W(At,Ft)});var $,Ft;Ne.exports={set:qe,get:et,has:Ze,enforce:nt,getterFor:rt}}),yu=Ae((ot,Ne)=>{var Se=hr(),Oe=dr(),ee=kr(),V=br(),W=di().CONFIGURABLE,Z=Zn(),Y=hi(),ne=Y.enforce,Fe=Y.get,je=Object.defineProperty,he=V&&!Se(function(){return je(function(){},"length",{value:8}).length!==8}),qe=String(String).split("String"),et=Ne.exports=function(Ze,nt,rt){String(nt).slice(0,7)==="Symbol("&&(nt="["+String(nt).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),rt&&rt.getter&&(nt="get "+nt),rt&&rt.setter&&(nt="set "+nt),(!ee(Ze,"name")||W&&Ze.name!==nt)&&(V?je(Ze,"name",{value:nt,configurable:!0}):Ze.name=nt),he&&rt&&ee(rt,"arity")&&Ze.length!==rt.arity&&je(Ze,"length",{value:rt.arity});try{rt&&ee(rt,"constructor")&&rt.constructor?V&&je(Ze,"prototype",{writable:!1}):Ze.prototype&&(Ze.prototype=void 0)}catch{}var $=ne(Ze);return ee($,"source")||($.source=qe.join(typeof nt=="string"?nt:"")),Ze};Function.prototype.toString=et(function(){return Oe(this)&&Fe(this).source||Z(this)},"toString")}),gi=Ae((ot,Ne)=>{var Se=dr(),Oe=en(),ee=yu(),V=gn();Ne.exports=function(W,Z,Y,ne){ne||(ne={});var Fe=ne.enumerable,je=ne.name!==void 0?ne.name:Z;if(Se(Y)&&ee(Y,je,ne),ne.global)Fe?W[Z]=Y:V(Z,Y);else{try{ne.unsafe?W[Z]&&(Fe=!0):delete W[Z]}catch{}Fe?W[Z]=Y:Oe.f(W,Z,{value:Y,enumerable:!1,configurable:!ne.nonConfigurable,writable:!ne.nonWritable})}return W}}),yi=Ae((ot,Ne)=>{var Se=Math.ceil,Oe=Math.floor;Ne.exports=Math.trunc||function(ee){var V=+ee;return(V>0?Oe:Se)(V)}}),Tn=Ae((ot,Ne)=>{var Se=yi();Ne.exports=function(Oe){var ee=+Oe;return ee!==ee||ee===0?0:Se(ee)}}),Ei=Ae((ot,Ne)=>{var Se=Tn(),Oe=Math.max,ee=Math.min;Ne.exports=function(V,W){var Z=Se(V);return Z<0?Oe(Z+W,0):ee(Z,W)}}),Ci=Ae((ot,Ne)=>{var Se=Tn(),Oe=Math.min;Ne.exports=function(ee){return ee>0?Oe(Se(ee),9007199254740991):0}}),tn=Ae((ot,Ne)=>{var Se=Ci();Ne.exports=function(Oe){return Se(Oe.length)}}),Fi=Ae((ot,Ne)=>{var Se=fn(),Oe=Ei(),ee=tn(),V=function(W){return function(Z,Y,ne){var Fe=Se(Z),je=ee(Fe),he=Oe(ne,je),qe;if(W&&Y!=Y){for(;je>he;)if(qe=Fe[he++],qe!=qe)return!0}else for(;je>he;he++)if((W||he in Fe)&&Fe[he]===Y)return W||he||0;return!W&&-1}};Ne.exports={includes:V(!0),indexOf:V(!1)}}),Ai=Ae((ot,Ne)=>{var Se=Dr(),Oe=kr(),ee=fn(),V=Fi().indexOf,W=eu(),Z=Se([].push);Ne.exports=function(Y,ne){var Fe=ee(Y),je=0,he=[],qe;for(qe in Fe)!Oe(W,qe)&&Oe(Fe,qe)&&Z(he,qe);for(;ne.length>je;)Oe(Fe,qe=ne[je++])&&(~V(he,qe)||Z(he,qe));return he}}),vi=Ae((ot,Ne)=>{Ne.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),bi=Ae(ot=>{var Ne=Ai(),Se=vi(),Oe=Se.concat("length","prototype");ot.f=Object.getOwnPropertyNames||function(ee){return Ne(ee,Oe)}}),Si=Ae(ot=>{ot.f=Object.getOwnPropertySymbols}),xi=Ae((ot,Ne)=>{var Se=un(),Oe=Dr(),ee=bi(),V=Si(),W=Wr(),Z=Oe([].concat);Ne.exports=Se("Reflect","ownKeys")||function(Y){var ne=ee.f(W(Y)),Fe=V.f;return Fe?Z(ne,Fe(Y)):ne}}),Ti=Ae((ot,Ne)=>{var Se=kr(),Oe=xi(),ee=Kn(),V=en();Ne.exports=function(W,Z,Y){for(var ne=Oe(Z),Fe=V.f,je=ee.f,he=0;he{var Se=hr(),Oe=dr(),ee=/#|\.prototype\./,V=function(Fe,je){var he=Z[W(Fe)];return he==ne?!0:he==Y?!1:Oe(je)?Se(je):!!je},W=V.normalize=function(Fe){return String(Fe).replace(ee,".").toLowerCase()},Z=V.data={},Y=V.NATIVE="N",ne=V.POLYFILL="P";Ne.exports=V}),an=Ae((ot,Ne)=>{var Se=Yt(),Oe=Kn().f,ee=Qn(),V=gi(),W=gn(),Z=Ti(),Y=Bi();Ne.exports=function(ne,Fe){var je=ne.target,he=ne.global,qe=ne.stat,et,Ze,nt,rt,$,Ft;if(he?Ze=Se:qe?Ze=Se[je]||W(je,{}):Ze=(Se[je]||{}).prototype,Ze)for(nt in Fe){if($=Fe[nt],ne.dontCallGetSet?(Ft=Oe(Ze,nt),rt=Ft&&Ft.value):rt=Ze[nt],et=Y(he?nt:je+(qe?".":"#")+nt,ne.forced),!et&&rt!==void 0){if(typeof $==typeof rt)continue;Z($,rt)}(ne.sham||rt&&rt.sham)&&ee($,"sham",!0),V(Ze,nt,$,ne)}}}),Eu=Ae(()=>{var ot=an(),Ne=Yt();ot({global:!0,forced:Ne.globalThis!==Ne},{globalThis:Ne})}),wi=Ae(()=>{Eu()}),Cu=Ae((ot,Ne)=>{var Se=Br();Ne.exports=Array.isArray||function(Oe){return Se(Oe)=="Array"}}),Fu=Ae((ot,Ne)=>{var Se=TypeError,Oe=9007199254740991;Ne.exports=function(ee){if(ee>Oe)throw Se("Maximum allowed index exceeded");return ee}}),Au=Ae((ot,Ne)=>{var Se=Br(),Oe=Dr();Ne.exports=function(ee){if(Se(ee)==="Function")return Oe(ee)}}),vu=Ae((ot,Ne)=>{var Se=Au(),Oe=sn(),ee=Hr(),V=Se(Se.bind);Ne.exports=function(W,Z){return Oe(W),Z===void 0?W:ee?V(W,Z):function(){return W.apply(Z,arguments)}}}),bu=Ae((ot,Ne)=>{var Se=Cu(),Oe=tn(),ee=Fu(),V=vu(),W=function(Z,Y,ne,Fe,je,he,qe,et){for(var Ze=je,nt=0,rt=qe?V(qe,et):!1,$,Ft;nt0&&Se($)?(Ft=Oe($),Ze=W(Z,Y,$,Ft,Ze,he-1)-1):(ee(Ze+1),Z[Ze]=$),Ze++),nt++;return Ze};Ne.exports=W}),Ni=Ae((ot,Ne)=>{var Se=$r(),Oe=Se("toStringTag"),ee={};ee[Oe]="z",Ne.exports=String(ee)==="[object z]"}),Su=Ae((ot,Ne)=>{var Se=Ni(),Oe=dr(),ee=Br(),V=$r(),W=V("toStringTag"),Z=Object,Y=ee(function(){return arguments}())=="Arguments",ne=function(Fe,je){try{return Fe[je]}catch{}};Ne.exports=Se?ee:function(Fe){var je,he,qe;return Fe===void 0?"Undefined":Fe===null?"Null":typeof(he=ne(je=Z(Fe),W))=="string"?he:Y?ee(je):(qe=ee(je))=="Object"&&Oe(je.callee)?"Arguments":qe}}),xu=Ae((ot,Ne)=>{var Se=Dr(),Oe=hr(),ee=dr(),V=Su(),W=un(),Z=Zn(),Y=function(){},ne=[],Fe=W("Reflect","construct"),je=/^\s*(?:class|function)\b/,he=Se(je.exec),qe=!je.exec(Y),et=function(nt){if(!ee(nt))return!1;try{return Fe(Y,ne,nt),!0}catch{return!1}},Ze=function(nt){if(!ee(nt))return!1;switch(V(nt)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return qe||!!he(je,Z(nt))}catch{return!0}};Ze.sham=!0,Ne.exports=!Fe||Oe(function(){var nt;return et(et.call)||!et(Object)||!et(function(){nt=!0})||nt})?Ze:et}),_i=Ae((ot,Ne)=>{var Se=Cu(),Oe=xu(),ee=Or(),V=$r(),W=V("species"),Z=Array;Ne.exports=function(Y){var ne;return Se(Y)&&(ne=Y.constructor,Oe(ne)&&(ne===Z||Se(ne.prototype))?ne=void 0:ee(ne)&&(ne=ne[W],ne===null&&(ne=void 0))),ne===void 0?Z:ne}}),Tu=Ae((ot,Ne)=>{var Se=_i();Ne.exports=function(Oe,ee){return new(Se(Oe))(ee===0?0:ee)}}),ki=Ae(()=>{var ot=an(),Ne=bu(),Se=sn(),Oe=xn(),ee=tn(),V=Tu();ot({target:"Array",proto:!0},{flatMap:function(W){var Z=Oe(this),Y=ee(Z),ne;return Se(W),ne=V(Z,0),ne.length=Ne(ne,Z,Z,Y,0,1,W,arguments.length>1?arguments[1]:void 0),ne}})}),tu=Ae((ot,Ne)=>{Ne.exports={}}),Pi=Ae((ot,Ne)=>{var Se=$r(),Oe=tu(),ee=Se("iterator"),V=Array.prototype;Ne.exports=function(W){return W!==void 0&&(Oe.Array===W||V[ee]===W)}}),Bu=Ae((ot,Ne)=>{var Se=Su(),Oe=hn(),ee=nn(),V=tu(),W=$r(),Z=W("iterator");Ne.exports=function(Y){if(!ee(Y))return Oe(Y,Z)||Oe(Y,"@@iterator")||V[Se(Y)]}}),Ii=Ae((ot,Ne)=>{var Se=gr(),Oe=sn(),ee=Wr(),V=mn(),W=Bu(),Z=TypeError;Ne.exports=function(Y,ne){var Fe=arguments.length<2?W(Y):ne;if(Oe(Fe))return ee(Se(Fe,Y));throw Z(V(Y)+" is not iterable")}}),ji=Ae((ot,Ne)=>{var Se=gr(),Oe=Wr(),ee=hn();Ne.exports=function(V,W,Z){var Y,ne;Oe(V);try{if(Y=ee(V,"return"),!Y){if(W==="throw")throw Z;return Z}Y=Se(Y,V)}catch(Fe){ne=!0,Y=Fe}if(W==="throw")throw Z;if(ne)throw Y;return Oe(Y),Z}}),Li=Ae((ot,Ne)=>{var Se=vu(),Oe=gr(),ee=Wr(),V=mn(),W=Pi(),Z=tn(),Y=Gn(),ne=Ii(),Fe=Bu(),je=ji(),he=TypeError,qe=function(Ze,nt){this.stopped=Ze,this.result=nt},et=qe.prototype;Ne.exports=function(Ze,nt,rt){var $=rt&&rt.that,Ft=!!(rt&&rt.AS_ENTRIES),At=!!(rt&&rt.IS_RECORD),Lt=!!(rt&&rt.IS_ITERATOR),qt=!!(rt&&rt.INTERRUPTED),Zt=Se(nt,$),ue,yr,Pr,zr,fr,Rr,mr,rn=function(Fr){return ue&&je(ue,"normal",Fr),new qe(!0,Fr)},wr=function(Fr){return Ft?(ee(Fr),qt?Zt(Fr[0],Fr[1],rn):Zt(Fr[0],Fr[1])):qt?Zt(Fr,rn):Zt(Fr)};if(At)ue=Ze.iterator;else if(Lt)ue=Ze;else{if(yr=Fe(Ze),!yr)throw he(V(Ze)+" is not iterable");if(W(yr)){for(Pr=0,zr=Z(Ze);zr>Pr;Pr++)if(fr=wr(Ze[Pr]),fr&&Y(et,fr))return fr;return new qe(!1)}ue=ne(Ze,yr)}for(Rr=At?Ze.next:ue.next;!(mr=Oe(Rr,ue)).done;){try{fr=wr(mr.value)}catch(Fr){je(ue,"throw",Fr)}if(typeof fr=="object"&&fr&&Y(et,fr))return fr}return new qe(!1)}}),Oi=Ae((ot,Ne)=>{var Se=En(),Oe=en(),ee=Lr();Ne.exports=function(V,W,Z){var Y=Se(W);Y in V?Oe.f(V,Y,ee(0,Z)):V[Y]=Z}}),$i=Ae(()=>{var ot=an(),Ne=Li(),Se=Oi();ot({target:"Object",stat:!0},{fromEntries:function(Oe){var ee={};return Ne(Oe,function(V,W){Se(ee,V,W)},{AS_ENTRIES:!0}),ee}})}),Ri=Ae((ot,Ne)=>{var Se=["cliName","cliCategory","cliDescription"];function Oe(L,re){if(L==null)return{};var ge=ee(L,re),Ee,Pe;if(Object.getOwnPropertySymbols){var ie=Object.getOwnPropertySymbols(L);for(Pe=0;Pe=0)&&Object.prototype.propertyIsEnumerable.call(L,Ee)&&(ge[Ee]=L[Ee])}return ge}function ee(L,re){if(L==null)return{};var ge={},Ee=Object.keys(L),Pe,ie;for(ie=0;ie=0)&&(ge[Pe]=L[Pe]);return ge}wi(),ki(),$i();var V=Object.create,W=Object.defineProperty,Z=Object.getOwnPropertyDescriptor,Y=Object.getOwnPropertyNames,ne=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty,je=(L,re)=>function(){return L&&(re=(0,L[Y(L)[0]])(L=0)),re},he=(L,re)=>function(){return re||(0,L[Y(L)[0]])((re={exports:{}}).exports,re),re.exports},qe=(L,re)=>{for(var ge in re)W(L,ge,{get:re[ge],enumerable:!0})},et=(L,re,ge,Ee)=>{if(re&&typeof re=="object"||typeof re=="function")for(let Pe of Y(re))!Fe.call(L,Pe)&&Pe!==ge&&W(L,Pe,{get:()=>re[Pe],enumerable:!(Ee=Z(re,Pe))||Ee.enumerable});return L},Ze=(L,re,ge)=>(ge=L!=null?V(ne(L)):{},et(re||!L||!L.__esModule?W(ge,"default",{value:L,enumerable:!0}):ge,L)),nt=L=>et(W({},"__esModule",{value:!0}),L),rt,$=je({""(){rt={env:{},argv:[]}}}),Ft=he({"node_modules/angular-html-parser/lib/compiler/src/chars.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0}),L.$EOF=0,L.$BSPACE=8,L.$TAB=9,L.$LF=10,L.$VTAB=11,L.$FF=12,L.$CR=13,L.$SPACE=32,L.$BANG=33,L.$DQ=34,L.$HASH=35,L.$$=36,L.$PERCENT=37,L.$AMPERSAND=38,L.$SQ=39,L.$LPAREN=40,L.$RPAREN=41,L.$STAR=42,L.$PLUS=43,L.$COMMA=44,L.$MINUS=45,L.$PERIOD=46,L.$SLASH=47,L.$COLON=58,L.$SEMICOLON=59,L.$LT=60,L.$EQ=61,L.$GT=62,L.$QUESTION=63,L.$0=48,L.$7=55,L.$9=57,L.$A=65,L.$E=69,L.$F=70,L.$X=88,L.$Z=90,L.$LBRACKET=91,L.$BACKSLASH=92,L.$RBRACKET=93,L.$CARET=94,L.$_=95,L.$a=97,L.$b=98,L.$e=101,L.$f=102,L.$n=110,L.$r=114,L.$t=116,L.$u=117,L.$v=118,L.$x=120,L.$z=122,L.$LBRACE=123,L.$BAR=124,L.$RBRACE=125,L.$NBSP=160,L.$PIPE=124,L.$TILDA=126,L.$AT=64,L.$BT=96;function re(Ue){return Ue>=L.$TAB&&Ue<=L.$SPACE||Ue==L.$NBSP}L.isWhitespace=re;function ge(Ue){return L.$0<=Ue&&Ue<=L.$9}L.isDigit=ge;function Ee(Ue){return Ue>=L.$a&&Ue<=L.$z||Ue>=L.$A&&Ue<=L.$Z}L.isAsciiLetter=Ee;function Pe(Ue){return Ue>=L.$a&&Ue<=L.$f||Ue>=L.$A&&Ue<=L.$F||ge(Ue)}L.isAsciiHexDigit=Pe;function ie(Ue){return Ue===L.$LF||Ue===L.$CR}L.isNewLine=ie;function de(Ue){return L.$0<=Ue&&Ue<=L.$7}L.isOctalDigit=de}}),At=he({"node_modules/angular-html-parser/lib/compiler/src/aot/static_symbol.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=class{constructor(Ee,Pe,ie){this.filePath=Ee,this.name=Pe,this.members=ie}assertNoMembers(){if(this.members.length)throw new Error(`Illegal state: symbol without members expected, but got ${JSON.stringify(this)}.`)}};L.StaticSymbol=re;var ge=class{constructor(){this.cache=new Map}get(Ee,Pe,ie){ie=ie||[];let de=ie.length?`.${ie.join(".")}`:"",Ue=`"${Ee}".${Pe}${de}`,Ge=this.cache.get(Ue);return Ge||(Ge=new re(Ee,Pe,ie),this.cache.set(Ue,Ge)),Ge}};L.StaticSymbolCache=ge}}),Lt=he({"node_modules/angular-html-parser/lib/compiler/src/util.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=/-+([a-z0-9])/g;function ge(le){return le.replace(re,function(){for(var We=arguments.length,Me=new Array(We),at=0;atde(Me,this,We))}visitStringMap(le,We){let Me={};return Object.keys(le).forEach(at=>{Me[at]=de(le[at],this,We)}),Me}visitPrimitive(le,We){return le}visitOther(le,We){return le}};L.ValueTransformer=gt,L.SyncAsync={assertSync:le=>{if(st(le))throw new Error("Illegal state: value cannot be a promise");return le},then:(le,We)=>st(le)?le.then(We):We(le),all:le=>le.some(st)?Promise.all(le):le};function ce(le){throw new Error(`Internal Error: ${le}`)}L.error=ce;function ve(le,We){let Me=Error(le);return Me[Ve]=!0,We&&(Me[He]=We),Me}L.syntaxError=ve;var Ve="ngSyntaxError",He="ngParseErrors";function Je(le){return le[Ve]}L.isSyntaxError=Je;function Qe(le){return le[He]||[]}L.getParseErrors=Qe;function yt(le){return le.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}L.escapeRegExp=yt;var _t=Object.getPrototypeOf({});function ct(le){return typeof le=="object"&&le!==null&&Object.getPrototypeOf(le)===_t}function kt(le){let We="";for(let Me=0;Me=55296&&at<=56319&&le.length>Me+1){let Jt=le.charCodeAt(Me+1);Jt>=56320&&Jt<=57343&&(Me++,at=(at-55296<<10)+Jt-56320+65536)}at<=127?We+=String.fromCharCode(at):at<=2047?We+=String.fromCharCode(at>>6&31|192,at&63|128):at<=65535?We+=String.fromCharCode(at>>12|224,at>>6&63|128,at&63|128):at<=2097151&&(We+=String.fromCharCode(at>>18&7|240,at>>12&63|128,at>>6&63|128,at&63|128))}return We}L.utf8Encode=kt;function $t(le){if(typeof le=="string")return le;if(le instanceof Array)return"["+le.map($t).join(", ")+"]";if(le==null)return""+le;if(le.overriddenName)return`${le.overriddenName}`;if(le.name)return`${le.name}`;if(!le.toString)return"object";let We=le.toString();if(We==null)return""+We;let Me=We.indexOf(` +import{m as cl,g as Dn}from"./pickBy-llkn_6s3.js";import{_ as ta,b as ra}from"./index-lt-u4Ncf.js";import"./callBound-4MCeDK1M.js";import"./index-RfLt4OUa.js";import"./iframe-mUD1hmuH.js";import"../sb-preview/runtime.js";import"./index-miLrID2P.js";import"./inheritsLoose-O2jMHMzR.js";import"./pickBy-lHA7W3rs.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./index-xck8ovCi.js";import"./index-I0bGnlnk.js";import"./assert-1o4ErrXT.js";var Dl=ra({"node_modules/prettier/parser-html.js"(Jr,Xr){(function(Ae){if(typeof Jr=="object"&&typeof Xr=="object")Xr.exports=Ae();else if(typeof define=="function"&&define.amd)define(Ae);else{var Yt=typeof globalThis<"u"?globalThis:typeof Dn<"u"?Dn:typeof self<"u"?self:this||{};Yt.prettierPlugins=Yt.prettierPlugins||{},Yt.prettierPlugins.html=Ae()}})(function(){var Ae=(ot,Ne)=>()=>(Ne||ot((Ne={exports:{}}).exports,Ne),Ne.exports),Yt=Ae((ot,Ne)=>{var Se=function(Oe){return Oe&&Oe.Math==Math&&Oe};Ne.exports=Se(typeof globalThis=="object"&&globalThis)||Se(typeof window=="object"&&window)||Se(typeof self=="object"&&self)||Se(typeof Dn=="object"&&Dn)||function(){return this}()||Function("return this")()}),hr=Ae((ot,Ne)=>{Ne.exports=function(Se){try{return!!Se()}catch{return!0}}}),br=Ae((ot,Ne)=>{var Se=hr();Ne.exports=!Se(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})}),Hr=Ae((ot,Ne)=>{var Se=hr();Ne.exports=!Se(function(){var Oe=(function(){}).bind();return typeof Oe!="function"||Oe.hasOwnProperty("prototype")})}),gr=Ae((ot,Ne)=>{var Se=Hr(),Oe=Function.prototype.call;Ne.exports=Se?Oe.bind(Oe):function(){return Oe.apply(Oe,arguments)}}),dn=Ae(ot=>{var Ne={}.propertyIsEnumerable,Se=Object.getOwnPropertyDescriptor,Oe=Se&&!Ne.call({1:2},1);ot.f=Oe?function(ee){var V=Se(this,ee);return!!V&&V.enumerable}:Ne}),Lr=Ae((ot,Ne)=>{Ne.exports=function(Se,Oe){return{enumerable:!(Se&1),configurable:!(Se&2),writable:!(Se&4),value:Oe}}}),Dr=Ae((ot,Ne)=>{var Se=Hr(),Oe=Function.prototype,ee=Oe.call,V=Se&&Oe.bind.bind(ee,ee);Ne.exports=Se?V:function(W){return function(){return ee.apply(W,arguments)}}}),Br=Ae((ot,Ne)=>{var Se=Dr(),Oe=Se({}.toString),ee=Se("".slice);Ne.exports=function(V){return ee(Oe(V),8,-1)}}),Zr=Ae((ot,Ne)=>{var Se=Dr(),Oe=hr(),ee=Br(),V=Object,W=Se("".split);Ne.exports=Oe(function(){return!V("z").propertyIsEnumerable(0)})?function(Z){return ee(Z)=="String"?W(Z,""):V(Z)}:V}),nn=Ae((ot,Ne)=>{Ne.exports=function(Se){return Se==null}}),Vn=Ae((ot,Ne)=>{var Se=nn(),Oe=TypeError;Ne.exports=function(ee){if(Se(ee))throw Oe("Can't call method on "+ee);return ee}}),fn=Ae((ot,Ne)=>{var Se=Zr(),Oe=Vn();Ne.exports=function(ee){return Se(Oe(ee))}}),Un=Ae((ot,Ne)=>{var Se=typeof document=="object"&&document.all,Oe=typeof Se>"u"&&Se!==void 0;Ne.exports={all:Se,IS_HTMLDDA:Oe}}),dr=Ae((ot,Ne)=>{var Se=Un(),Oe=Se.all;Ne.exports=Se.IS_HTMLDDA?function(ee){return typeof ee=="function"||ee===Oe}:function(ee){return typeof ee=="function"}}),Or=Ae((ot,Ne)=>{var Se=dr(),Oe=Un(),ee=Oe.all;Ne.exports=Oe.IS_HTMLDDA?function(V){return typeof V=="object"?V!==null:Se(V)||V===ee}:function(V){return typeof V=="object"?V!==null:Se(V)}}),un=Ae((ot,Ne)=>{var Se=Yt(),Oe=dr(),ee=function(V){return Oe(V)?V:void 0};Ne.exports=function(V,W){return arguments.length<2?ee(Se[V]):Se[V]&&Se[V][W]}}),Gn=Ae((ot,Ne)=>{var Se=Dr();Ne.exports=Se({}.isPrototypeOf)}),si=Ae((ot,Ne)=>{var Se=un();Ne.exports=Se("navigator","userAgent")||""}),ai=Ae((ot,Ne)=>{var Se=Yt(),Oe=si(),ee=Se.process,V=Se.Deno,W=ee&&ee.versions||V&&V.version,Z=W&&W.v8,Y,ne;Z&&(Y=Z.split("."),ne=Y[0]>0&&Y[0]<4?1:+(Y[0]+Y[1])),!ne&&Oe&&(Y=Oe.match(/Edge\/(\d+)/),(!Y||Y[1]>=74)&&(Y=Oe.match(/Chrome\/(\d+)/),Y&&(ne=+Y[1]))),Ne.exports=ne}),Jn=Ae((ot,Ne)=>{var Se=ai(),Oe=hr();Ne.exports=!!Object.getOwnPropertySymbols&&!Oe(function(){var ee=Symbol();return!String(ee)||!(Object(ee)instanceof Symbol)||!Symbol.sham&&Se&&Se<41})}),Xn=Ae((ot,Ne)=>{var Se=Jn();Ne.exports=Se&&!Symbol.sham&&typeof Symbol.iterator=="symbol"}),Wn=Ae((ot,Ne)=>{var Se=un(),Oe=dr(),ee=Gn(),V=Xn(),W=Object;Ne.exports=V?function(Z){return typeof Z=="symbol"}:function(Z){var Y=Se("Symbol");return Oe(Y)&&ee(Y.prototype,W(Z))}}),mn=Ae((ot,Ne)=>{var Se=String;Ne.exports=function(Oe){try{return Se(Oe)}catch{return"Object"}}}),sn=Ae((ot,Ne)=>{var Se=dr(),Oe=mn(),ee=TypeError;Ne.exports=function(V){if(Se(V))return V;throw ee(Oe(V)+" is not a function")}}),hn=Ae((ot,Ne)=>{var Se=sn(),Oe=nn();Ne.exports=function(ee,V){var W=ee[V];return Oe(W)?void 0:Se(W)}}),oi=Ae((ot,Ne)=>{var Se=gr(),Oe=dr(),ee=Or(),V=TypeError;Ne.exports=function(W,Z){var Y,ne;if(Z==="string"&&Oe(Y=W.toString)&&!ee(ne=Se(Y,W))||Oe(Y=W.valueOf)&&!ee(ne=Se(Y,W))||Z!=="string"&&Oe(Y=W.toString)&&!ee(ne=Se(Y,W)))return ne;throw V("Can't convert object to primitive value")}}),li=Ae((ot,Ne)=>{Ne.exports=!1}),gn=Ae((ot,Ne)=>{var Se=Yt(),Oe=Object.defineProperty;Ne.exports=function(ee,V){try{Oe(Se,ee,{value:V,configurable:!0,writable:!0})}catch{Se[ee]=V}return V}}),yn=Ae((ot,Ne)=>{var Se=Yt(),Oe=gn(),ee="__core-js_shared__",V=Se[ee]||Oe(ee,{});Ne.exports=V}),zn=Ae((ot,Ne)=>{var Se=li(),Oe=yn();(Ne.exports=function(ee,V){return Oe[ee]||(Oe[ee]=V!==void 0?V:{})})("versions",[]).push({version:"3.26.1",mode:Se?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"})}),xn=Ae((ot,Ne)=>{var Se=Vn(),Oe=Object;Ne.exports=function(ee){return Oe(Se(ee))}}),kr=Ae((ot,Ne)=>{var Se=Dr(),Oe=xn(),ee=Se({}.hasOwnProperty);Ne.exports=Object.hasOwn||function(V,W){return ee(Oe(V),W)}}),Hn=Ae((ot,Ne)=>{var Se=Dr(),Oe=0,ee=Math.random(),V=Se(1 .toString);Ne.exports=function(W){return"Symbol("+(W===void 0?"":W)+")_"+V(++Oe+ee,36)}}),$r=Ae((ot,Ne)=>{var Se=Yt(),Oe=zn(),ee=kr(),V=Hn(),W=Jn(),Z=Xn(),Y=Oe("wks"),ne=Se.Symbol,Fe=ne&&ne.for,je=Z?ne:ne&&ne.withoutSetter||V;Ne.exports=function(he){if(!ee(Y,he)||!(W||typeof Y[he]=="string")){var qe="Symbol."+he;W&&ee(ne,he)?Y[he]=ne[he]:Z&&Fe?Y[he]=Fe(qe):Y[he]=je(qe)}return Y[he]}}),pi=Ae((ot,Ne)=>{var Se=gr(),Oe=Or(),ee=Wn(),V=hn(),W=oi(),Z=$r(),Y=TypeError,ne=Z("toPrimitive");Ne.exports=function(Fe,je){if(!Oe(Fe)||ee(Fe))return Fe;var he=V(Fe,ne),qe;if(he){if(je===void 0&&(je="default"),qe=Se(he,Fe,je),!Oe(qe)||ee(qe))return qe;throw Y("Can't convert object to primitive value")}return je===void 0&&(je="number"),W(Fe,je)}}),En=Ae((ot,Ne)=>{var Se=pi(),Oe=Wn();Ne.exports=function(ee){var V=Se(ee,"string");return Oe(V)?V:V+""}}),ci=Ae((ot,Ne)=>{var Se=Yt(),Oe=Or(),ee=Se.document,V=Oe(ee)&&Oe(ee.createElement);Ne.exports=function(W){return V?ee.createElement(W):{}}}),Yn=Ae((ot,Ne)=>{var Se=br(),Oe=hr(),ee=ci();Ne.exports=!Se&&!Oe(function(){return Object.defineProperty(ee("div"),"a",{get:function(){return 7}}).a!=7})}),Kn=Ae(ot=>{var Ne=br(),Se=gr(),Oe=dn(),ee=Lr(),V=fn(),W=En(),Z=kr(),Y=Yn(),ne=Object.getOwnPropertyDescriptor;ot.f=Ne?ne:function(Fe,je){if(Fe=V(Fe),je=W(je),Y)try{return ne(Fe,je)}catch{}if(Z(Fe,je))return ee(!Se(Oe.f,Fe,je),Fe[je])}}),Di=Ae((ot,Ne)=>{var Se=br(),Oe=hr();Ne.exports=Se&&Oe(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})}),Wr=Ae((ot,Ne)=>{var Se=Or(),Oe=String,ee=TypeError;Ne.exports=function(V){if(Se(V))return V;throw ee(Oe(V)+" is not an object")}}),en=Ae(ot=>{var Ne=br(),Se=Yn(),Oe=Di(),ee=Wr(),V=En(),W=TypeError,Z=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,ne="enumerable",Fe="configurable",je="writable";ot.f=Ne?Oe?function(he,qe,et){if(ee(he),qe=V(qe),ee(et),typeof he=="function"&&qe==="prototype"&&"value"in et&&je in et&&!et[je]){var Ze=Y(he,qe);Ze&&Ze[je]&&(he[qe]=et.value,et={configurable:Fe in et?et[Fe]:Ze[Fe],enumerable:ne in et?et[ne]:Ze[ne],writable:!1})}return Z(he,qe,et)}:Z:function(he,qe,et){if(ee(he),qe=V(qe),ee(et),Se)try{return Z(he,qe,et)}catch{}if("get"in et||"set"in et)throw W("Accessors not supported");return"value"in et&&(he[qe]=et.value),he}}),Qn=Ae((ot,Ne)=>{var Se=br(),Oe=en(),ee=Lr();Ne.exports=Se?function(V,W,Z){return Oe.f(V,W,ee(1,Z))}:function(V,W,Z){return V[W]=Z,V}}),di=Ae((ot,Ne)=>{var Se=br(),Oe=kr(),ee=Function.prototype,V=Se&&Object.getOwnPropertyDescriptor,W=Oe(ee,"name"),Z=W&&(function(){}).name==="something",Y=W&&(!Se||Se&&V(ee,"name").configurable);Ne.exports={EXISTS:W,PROPER:Z,CONFIGURABLE:Y}}),Zn=Ae((ot,Ne)=>{var Se=Dr(),Oe=dr(),ee=yn(),V=Se(Function.toString);Oe(ee.inspectSource)||(ee.inspectSource=function(W){return V(W)}),Ne.exports=ee.inspectSource}),fi=Ae((ot,Ne)=>{var Se=Yt(),Oe=dr(),ee=Se.WeakMap;Ne.exports=Oe(ee)&&/native code/.test(String(ee))}),mi=Ae((ot,Ne)=>{var Se=zn(),Oe=Hn(),ee=Se("keys");Ne.exports=function(V){return ee[V]||(ee[V]=Oe(V))}}),eu=Ae((ot,Ne)=>{Ne.exports={}}),hi=Ae((ot,Ne)=>{var Se=fi(),Oe=Yt(),ee=Or(),V=Qn(),W=kr(),Z=yn(),Y=mi(),ne=eu(),Fe="Object already initialized",je=Oe.TypeError,he=Oe.WeakMap,qe,et,Ze,nt=function(At){return Ze(At)?et(At):qe(At,{})},rt=function(At){return function(Lt){var qt;if(!ee(Lt)||(qt=et(Lt)).type!==At)throw je("Incompatible receiver, "+At+" required");return qt}};Se||Z.state?($=Z.state||(Z.state=new he),$.get=$.get,$.has=$.has,$.set=$.set,qe=function(At,Lt){if($.has(At))throw je(Fe);return Lt.facade=At,$.set(At,Lt),Lt},et=function(At){return $.get(At)||{}},Ze=function(At){return $.has(At)}):(Ft=Y("state"),ne[Ft]=!0,qe=function(At,Lt){if(W(At,Ft))throw je(Fe);return Lt.facade=At,V(At,Ft,Lt),Lt},et=function(At){return W(At,Ft)?At[Ft]:{}},Ze=function(At){return W(At,Ft)});var $,Ft;Ne.exports={set:qe,get:et,has:Ze,enforce:nt,getterFor:rt}}),yu=Ae((ot,Ne)=>{var Se=hr(),Oe=dr(),ee=kr(),V=br(),W=di().CONFIGURABLE,Z=Zn(),Y=hi(),ne=Y.enforce,Fe=Y.get,je=Object.defineProperty,he=V&&!Se(function(){return je(function(){},"length",{value:8}).length!==8}),qe=String(String).split("String"),et=Ne.exports=function(Ze,nt,rt){String(nt).slice(0,7)==="Symbol("&&(nt="["+String(nt).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),rt&&rt.getter&&(nt="get "+nt),rt&&rt.setter&&(nt="set "+nt),(!ee(Ze,"name")||W&&Ze.name!==nt)&&(V?je(Ze,"name",{value:nt,configurable:!0}):Ze.name=nt),he&&rt&&ee(rt,"arity")&&Ze.length!==rt.arity&&je(Ze,"length",{value:rt.arity});try{rt&&ee(rt,"constructor")&&rt.constructor?V&&je(Ze,"prototype",{writable:!1}):Ze.prototype&&(Ze.prototype=void 0)}catch{}var $=ne(Ze);return ee($,"source")||($.source=qe.join(typeof nt=="string"?nt:"")),Ze};Function.prototype.toString=et(function(){return Oe(this)&&Fe(this).source||Z(this)},"toString")}),gi=Ae((ot,Ne)=>{var Se=dr(),Oe=en(),ee=yu(),V=gn();Ne.exports=function(W,Z,Y,ne){ne||(ne={});var Fe=ne.enumerable,je=ne.name!==void 0?ne.name:Z;if(Se(Y)&&ee(Y,je,ne),ne.global)Fe?W[Z]=Y:V(Z,Y);else{try{ne.unsafe?W[Z]&&(Fe=!0):delete W[Z]}catch{}Fe?W[Z]=Y:Oe.f(W,Z,{value:Y,enumerable:!1,configurable:!ne.nonConfigurable,writable:!ne.nonWritable})}return W}}),yi=Ae((ot,Ne)=>{var Se=Math.ceil,Oe=Math.floor;Ne.exports=Math.trunc||function(ee){var V=+ee;return(V>0?Oe:Se)(V)}}),Tn=Ae((ot,Ne)=>{var Se=yi();Ne.exports=function(Oe){var ee=+Oe;return ee!==ee||ee===0?0:Se(ee)}}),Ei=Ae((ot,Ne)=>{var Se=Tn(),Oe=Math.max,ee=Math.min;Ne.exports=function(V,W){var Z=Se(V);return Z<0?Oe(Z+W,0):ee(Z,W)}}),Ci=Ae((ot,Ne)=>{var Se=Tn(),Oe=Math.min;Ne.exports=function(ee){return ee>0?Oe(Se(ee),9007199254740991):0}}),tn=Ae((ot,Ne)=>{var Se=Ci();Ne.exports=function(Oe){return Se(Oe.length)}}),Fi=Ae((ot,Ne)=>{var Se=fn(),Oe=Ei(),ee=tn(),V=function(W){return function(Z,Y,ne){var Fe=Se(Z),je=ee(Fe),he=Oe(ne,je),qe;if(W&&Y!=Y){for(;je>he;)if(qe=Fe[he++],qe!=qe)return!0}else for(;je>he;he++)if((W||he in Fe)&&Fe[he]===Y)return W||he||0;return!W&&-1}};Ne.exports={includes:V(!0),indexOf:V(!1)}}),Ai=Ae((ot,Ne)=>{var Se=Dr(),Oe=kr(),ee=fn(),V=Fi().indexOf,W=eu(),Z=Se([].push);Ne.exports=function(Y,ne){var Fe=ee(Y),je=0,he=[],qe;for(qe in Fe)!Oe(W,qe)&&Oe(Fe,qe)&&Z(he,qe);for(;ne.length>je;)Oe(Fe,qe=ne[je++])&&(~V(he,qe)||Z(he,qe));return he}}),vi=Ae((ot,Ne)=>{Ne.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]}),bi=Ae(ot=>{var Ne=Ai(),Se=vi(),Oe=Se.concat("length","prototype");ot.f=Object.getOwnPropertyNames||function(ee){return Ne(ee,Oe)}}),Si=Ae(ot=>{ot.f=Object.getOwnPropertySymbols}),xi=Ae((ot,Ne)=>{var Se=un(),Oe=Dr(),ee=bi(),V=Si(),W=Wr(),Z=Oe([].concat);Ne.exports=Se("Reflect","ownKeys")||function(Y){var ne=ee.f(W(Y)),Fe=V.f;return Fe?Z(ne,Fe(Y)):ne}}),Ti=Ae((ot,Ne)=>{var Se=kr(),Oe=xi(),ee=Kn(),V=en();Ne.exports=function(W,Z,Y){for(var ne=Oe(Z),Fe=V.f,je=ee.f,he=0;he{var Se=hr(),Oe=dr(),ee=/#|\.prototype\./,V=function(Fe,je){var he=Z[W(Fe)];return he==ne?!0:he==Y?!1:Oe(je)?Se(je):!!je},W=V.normalize=function(Fe){return String(Fe).replace(ee,".").toLowerCase()},Z=V.data={},Y=V.NATIVE="N",ne=V.POLYFILL="P";Ne.exports=V}),an=Ae((ot,Ne)=>{var Se=Yt(),Oe=Kn().f,ee=Qn(),V=gi(),W=gn(),Z=Ti(),Y=Bi();Ne.exports=function(ne,Fe){var je=ne.target,he=ne.global,qe=ne.stat,et,Ze,nt,rt,$,Ft;if(he?Ze=Se:qe?Ze=Se[je]||W(je,{}):Ze=(Se[je]||{}).prototype,Ze)for(nt in Fe){if($=Fe[nt],ne.dontCallGetSet?(Ft=Oe(Ze,nt),rt=Ft&&Ft.value):rt=Ze[nt],et=Y(he?nt:je+(qe?".":"#")+nt,ne.forced),!et&&rt!==void 0){if(typeof $==typeof rt)continue;Z($,rt)}(ne.sham||rt&&rt.sham)&&ee($,"sham",!0),V(Ze,nt,$,ne)}}}),Eu=Ae(()=>{var ot=an(),Ne=Yt();ot({global:!0,forced:Ne.globalThis!==Ne},{globalThis:Ne})}),wi=Ae(()=>{Eu()}),Cu=Ae((ot,Ne)=>{var Se=Br();Ne.exports=Array.isArray||function(Oe){return Se(Oe)=="Array"}}),Fu=Ae((ot,Ne)=>{var Se=TypeError,Oe=9007199254740991;Ne.exports=function(ee){if(ee>Oe)throw Se("Maximum allowed index exceeded");return ee}}),Au=Ae((ot,Ne)=>{var Se=Br(),Oe=Dr();Ne.exports=function(ee){if(Se(ee)==="Function")return Oe(ee)}}),vu=Ae((ot,Ne)=>{var Se=Au(),Oe=sn(),ee=Hr(),V=Se(Se.bind);Ne.exports=function(W,Z){return Oe(W),Z===void 0?W:ee?V(W,Z):function(){return W.apply(Z,arguments)}}}),bu=Ae((ot,Ne)=>{var Se=Cu(),Oe=tn(),ee=Fu(),V=vu(),W=function(Z,Y,ne,Fe,je,he,qe,et){for(var Ze=je,nt=0,rt=qe?V(qe,et):!1,$,Ft;nt0&&Se($)?(Ft=Oe($),Ze=W(Z,Y,$,Ft,Ze,he-1)-1):(ee(Ze+1),Z[Ze]=$),Ze++),nt++;return Ze};Ne.exports=W}),Ni=Ae((ot,Ne)=>{var Se=$r(),Oe=Se("toStringTag"),ee={};ee[Oe]="z",Ne.exports=String(ee)==="[object z]"}),Su=Ae((ot,Ne)=>{var Se=Ni(),Oe=dr(),ee=Br(),V=$r(),W=V("toStringTag"),Z=Object,Y=ee(function(){return arguments}())=="Arguments",ne=function(Fe,je){try{return Fe[je]}catch{}};Ne.exports=Se?ee:function(Fe){var je,he,qe;return Fe===void 0?"Undefined":Fe===null?"Null":typeof(he=ne(je=Z(Fe),W))=="string"?he:Y?ee(je):(qe=ee(je))=="Object"&&Oe(je.callee)?"Arguments":qe}}),xu=Ae((ot,Ne)=>{var Se=Dr(),Oe=hr(),ee=dr(),V=Su(),W=un(),Z=Zn(),Y=function(){},ne=[],Fe=W("Reflect","construct"),je=/^\s*(?:class|function)\b/,he=Se(je.exec),qe=!je.exec(Y),et=function(nt){if(!ee(nt))return!1;try{return Fe(Y,ne,nt),!0}catch{return!1}},Ze=function(nt){if(!ee(nt))return!1;switch(V(nt)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return qe||!!he(je,Z(nt))}catch{return!0}};Ze.sham=!0,Ne.exports=!Fe||Oe(function(){var nt;return et(et.call)||!et(Object)||!et(function(){nt=!0})||nt})?Ze:et}),_i=Ae((ot,Ne)=>{var Se=Cu(),Oe=xu(),ee=Or(),V=$r(),W=V("species"),Z=Array;Ne.exports=function(Y){var ne;return Se(Y)&&(ne=Y.constructor,Oe(ne)&&(ne===Z||Se(ne.prototype))?ne=void 0:ee(ne)&&(ne=ne[W],ne===null&&(ne=void 0))),ne===void 0?Z:ne}}),Tu=Ae((ot,Ne)=>{var Se=_i();Ne.exports=function(Oe,ee){return new(Se(Oe))(ee===0?0:ee)}}),ki=Ae(()=>{var ot=an(),Ne=bu(),Se=sn(),Oe=xn(),ee=tn(),V=Tu();ot({target:"Array",proto:!0},{flatMap:function(W){var Z=Oe(this),Y=ee(Z),ne;return Se(W),ne=V(Z,0),ne.length=Ne(ne,Z,Z,Y,0,1,W,arguments.length>1?arguments[1]:void 0),ne}})}),tu=Ae((ot,Ne)=>{Ne.exports={}}),Pi=Ae((ot,Ne)=>{var Se=$r(),Oe=tu(),ee=Se("iterator"),V=Array.prototype;Ne.exports=function(W){return W!==void 0&&(Oe.Array===W||V[ee]===W)}}),Bu=Ae((ot,Ne)=>{var Se=Su(),Oe=hn(),ee=nn(),V=tu(),W=$r(),Z=W("iterator");Ne.exports=function(Y){if(!ee(Y))return Oe(Y,Z)||Oe(Y,"@@iterator")||V[Se(Y)]}}),Ii=Ae((ot,Ne)=>{var Se=gr(),Oe=sn(),ee=Wr(),V=mn(),W=Bu(),Z=TypeError;Ne.exports=function(Y,ne){var Fe=arguments.length<2?W(Y):ne;if(Oe(Fe))return ee(Se(Fe,Y));throw Z(V(Y)+" is not iterable")}}),ji=Ae((ot,Ne)=>{var Se=gr(),Oe=Wr(),ee=hn();Ne.exports=function(V,W,Z){var Y,ne;Oe(V);try{if(Y=ee(V,"return"),!Y){if(W==="throw")throw Z;return Z}Y=Se(Y,V)}catch(Fe){ne=!0,Y=Fe}if(W==="throw")throw Z;if(ne)throw Y;return Oe(Y),Z}}),Li=Ae((ot,Ne)=>{var Se=vu(),Oe=gr(),ee=Wr(),V=mn(),W=Pi(),Z=tn(),Y=Gn(),ne=Ii(),Fe=Bu(),je=ji(),he=TypeError,qe=function(Ze,nt){this.stopped=Ze,this.result=nt},et=qe.prototype;Ne.exports=function(Ze,nt,rt){var $=rt&&rt.that,Ft=!!(rt&&rt.AS_ENTRIES),At=!!(rt&&rt.IS_RECORD),Lt=!!(rt&&rt.IS_ITERATOR),qt=!!(rt&&rt.INTERRUPTED),Zt=Se(nt,$),ue,yr,Pr,zr,fr,Rr,mr,rn=function(Fr){return ue&&je(ue,"normal",Fr),new qe(!0,Fr)},wr=function(Fr){return Ft?(ee(Fr),qt?Zt(Fr[0],Fr[1],rn):Zt(Fr[0],Fr[1])):qt?Zt(Fr,rn):Zt(Fr)};if(At)ue=Ze.iterator;else if(Lt)ue=Ze;else{if(yr=Fe(Ze),!yr)throw he(V(Ze)+" is not iterable");if(W(yr)){for(Pr=0,zr=Z(Ze);zr>Pr;Pr++)if(fr=wr(Ze[Pr]),fr&&Y(et,fr))return fr;return new qe(!1)}ue=ne(Ze,yr)}for(Rr=At?Ze.next:ue.next;!(mr=Oe(Rr,ue)).done;){try{fr=wr(mr.value)}catch(Fr){je(ue,"throw",Fr)}if(typeof fr=="object"&&fr&&Y(et,fr))return fr}return new qe(!1)}}),Oi=Ae((ot,Ne)=>{var Se=En(),Oe=en(),ee=Lr();Ne.exports=function(V,W,Z){var Y=Se(W);Y in V?Oe.f(V,Y,ee(0,Z)):V[Y]=Z}}),$i=Ae(()=>{var ot=an(),Ne=Li(),Se=Oi();ot({target:"Object",stat:!0},{fromEntries:function(Oe){var ee={};return Ne(Oe,function(V,W){Se(ee,V,W)},{AS_ENTRIES:!0}),ee}})}),Ri=Ae((ot,Ne)=>{var Se=["cliName","cliCategory","cliDescription"];function Oe(L,re){if(L==null)return{};var ge=ee(L,re),Ee,Pe;if(Object.getOwnPropertySymbols){var ie=Object.getOwnPropertySymbols(L);for(Pe=0;Pe=0)&&Object.prototype.propertyIsEnumerable.call(L,Ee)&&(ge[Ee]=L[Ee])}return ge}function ee(L,re){if(L==null)return{};var ge={},Ee=Object.keys(L),Pe,ie;for(ie=0;ie=0)&&(ge[Pe]=L[Pe]);return ge}wi(),ki(),$i();var V=Object.create,W=Object.defineProperty,Z=Object.getOwnPropertyDescriptor,Y=Object.getOwnPropertyNames,ne=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty,je=(L,re)=>function(){return L&&(re=(0,L[Y(L)[0]])(L=0)),re},he=(L,re)=>function(){return re||(0,L[Y(L)[0]])((re={exports:{}}).exports,re),re.exports},qe=(L,re)=>{for(var ge in re)W(L,ge,{get:re[ge],enumerable:!0})},et=(L,re,ge,Ee)=>{if(re&&typeof re=="object"||typeof re=="function")for(let Pe of Y(re))!Fe.call(L,Pe)&&Pe!==ge&&W(L,Pe,{get:()=>re[Pe],enumerable:!(Ee=Z(re,Pe))||Ee.enumerable});return L},Ze=(L,re,ge)=>(ge=L!=null?V(ne(L)):{},et(re||!L||!L.__esModule?W(ge,"default",{value:L,enumerable:!0}):ge,L)),nt=L=>et(W({},"__esModule",{value:!0}),L),rt,$=je({""(){rt={env:{},argv:[]}}}),Ft=he({"node_modules/angular-html-parser/lib/compiler/src/chars.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0}),L.$EOF=0,L.$BSPACE=8,L.$TAB=9,L.$LF=10,L.$VTAB=11,L.$FF=12,L.$CR=13,L.$SPACE=32,L.$BANG=33,L.$DQ=34,L.$HASH=35,L.$$=36,L.$PERCENT=37,L.$AMPERSAND=38,L.$SQ=39,L.$LPAREN=40,L.$RPAREN=41,L.$STAR=42,L.$PLUS=43,L.$COMMA=44,L.$MINUS=45,L.$PERIOD=46,L.$SLASH=47,L.$COLON=58,L.$SEMICOLON=59,L.$LT=60,L.$EQ=61,L.$GT=62,L.$QUESTION=63,L.$0=48,L.$7=55,L.$9=57,L.$A=65,L.$E=69,L.$F=70,L.$X=88,L.$Z=90,L.$LBRACKET=91,L.$BACKSLASH=92,L.$RBRACKET=93,L.$CARET=94,L.$_=95,L.$a=97,L.$b=98,L.$e=101,L.$f=102,L.$n=110,L.$r=114,L.$t=116,L.$u=117,L.$v=118,L.$x=120,L.$z=122,L.$LBRACE=123,L.$BAR=124,L.$RBRACE=125,L.$NBSP=160,L.$PIPE=124,L.$TILDA=126,L.$AT=64,L.$BT=96;function re(Ue){return Ue>=L.$TAB&&Ue<=L.$SPACE||Ue==L.$NBSP}L.isWhitespace=re;function ge(Ue){return L.$0<=Ue&&Ue<=L.$9}L.isDigit=ge;function Ee(Ue){return Ue>=L.$a&&Ue<=L.$z||Ue>=L.$A&&Ue<=L.$Z}L.isAsciiLetter=Ee;function Pe(Ue){return Ue>=L.$a&&Ue<=L.$f||Ue>=L.$A&&Ue<=L.$F||ge(Ue)}L.isAsciiHexDigit=Pe;function ie(Ue){return Ue===L.$LF||Ue===L.$CR}L.isNewLine=ie;function de(Ue){return L.$0<=Ue&&Ue<=L.$7}L.isOctalDigit=de}}),At=he({"node_modules/angular-html-parser/lib/compiler/src/aot/static_symbol.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=class{constructor(Ee,Pe,ie){this.filePath=Ee,this.name=Pe,this.members=ie}assertNoMembers(){if(this.members.length)throw new Error(`Illegal state: symbol without members expected, but got ${JSON.stringify(this)}.`)}};L.StaticSymbol=re;var ge=class{constructor(){this.cache=new Map}get(Ee,Pe,ie){ie=ie||[];let de=ie.length?`.${ie.join(".")}`:"",Ue=`"${Ee}".${Pe}${de}`,Ge=this.cache.get(Ue);return Ge||(Ge=new re(Ee,Pe,ie),this.cache.set(Ue,Ge)),Ge}};L.StaticSymbolCache=ge}}),Lt=he({"node_modules/angular-html-parser/lib/compiler/src/util.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=/-+([a-z0-9])/g;function ge(le){return le.replace(re,function(){for(var We=arguments.length,Me=new Array(We),at=0;atde(Me,this,We))}visitStringMap(le,We){let Me={};return Object.keys(le).forEach(at=>{Me[at]=de(le[at],this,We)}),Me}visitPrimitive(le,We){return le}visitOther(le,We){return le}};L.ValueTransformer=gt,L.SyncAsync={assertSync:le=>{if(st(le))throw new Error("Illegal state: value cannot be a promise");return le},then:(le,We)=>st(le)?le.then(We):We(le),all:le=>le.some(st)?Promise.all(le):le};function ce(le){throw new Error(`Internal Error: ${le}`)}L.error=ce;function ve(le,We){let Me=Error(le);return Me[Ve]=!0,We&&(Me[He]=We),Me}L.syntaxError=ve;var Ve="ngSyntaxError",He="ngParseErrors";function Je(le){return le[Ve]}L.isSyntaxError=Je;function Qe(le){return le[He]||[]}L.getParseErrors=Qe;function yt(le){return le.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}L.escapeRegExp=yt;var _t=Object.getPrototypeOf({});function ct(le){return typeof le=="object"&&le!==null&&Object.getPrototypeOf(le)===_t}function kt(le){let We="";for(let Me=0;Me=55296&&at<=56319&&le.length>Me+1){let Jt=le.charCodeAt(Me+1);Jt>=56320&&Jt<=57343&&(Me++,at=(at-55296<<10)+Jt-56320+65536)}at<=127?We+=String.fromCharCode(at):at<=2047?We+=String.fromCharCode(at>>6&31|192,at&63|128):at<=65535?We+=String.fromCharCode(at>>12|224,at>>6&63|128,at&63|128):at<=2097151&&(We+=String.fromCharCode(at>>18&7|240,at>>12&63|128,at>>6&63|128,at&63|128))}return We}L.utf8Encode=kt;function $t(le){if(typeof le=="string")return le;if(le instanceof Array)return"["+le.map($t).join(", ")+"]";if(le==null)return""+le;if(le.overriddenName)return`${le.overriddenName}`;if(le.name)return`${le.name}`;if(!le.toString)return"object";let We=le.toString();if(We==null)return""+We;let Me=We.indexOf(` `);return Me===-1?We:We.substring(0,Me)}L.stringify=$t;function ir(le){return typeof le=="function"&&le.hasOwnProperty("__forward_ref__")?le():le}L.resolveForwardRef=ir;function st(le){return!!le&&typeof le.then=="function"}L.isPromise=st;var Ot=class{constructor(le){this.full=le;let We=le.split(".");this.major=We[0],this.minor=We[1],this.patch=We.slice(2).join(".")}};L.Version=Ot;var Vt=typeof window<"u"&&window,Ut=typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&self,rr=typeof globalThis<"u"&&globalThis,z=rr||Vt||Ut;L.global=z}}),qt=he({"node_modules/angular-html-parser/lib/compiler/src/compile_metadata.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=At(),ge=Lt(),Ee=/^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))|(\@[-\w]+)$/;function Pe(Me){return Me.replace(/\W/g,"_")}L.sanitizeIdentifier=Pe;var ie=0;function de(Me){if(!Me||!Me.reference)return null;let at=Me.reference;if(at instanceof re.StaticSymbol)return at.name;if(at.__anonymousType)return at.__anonymousType;let Jt=ge.stringify(at);return Jt.indexOf("(")>=0?(Jt=`anonymous_${ie++}`,at.__anonymousType=Jt):Jt=Pe(Jt),Jt}L.identifierName=de;function Ue(Me){let at=Me.reference;return at instanceof re.StaticSymbol?at.filePath:`./${ge.stringify(at)}`}L.identifierModuleUrl=Ue;function Ge(Me,at){return`View_${de({reference:Me})}_${at}`}L.viewClassName=Ge;function gt(Me){return`RenderType_${de({reference:Me})}`}L.rendererTypeName=gt;function ce(Me){return`HostView_${de({reference:Me})}`}L.hostViewClassName=ce;function ve(Me){return`${de({reference:Me})}NgFactory`}L.componentFactoryName=ve;var Ve;(function(Me){Me[Me.Pipe=0]="Pipe",Me[Me.Directive=1]="Directive",Me[Me.NgModule=2]="NgModule",Me[Me.Injectable=3]="Injectable"})(Ve=L.CompileSummaryKind||(L.CompileSummaryKind={}));function He(Me){return Me.value!=null?Pe(Me.value):de(Me.identifier)}L.tokenName=He;function Je(Me){return Me.identifier!=null?Me.identifier.reference:Me.value}L.tokenReference=Je;var Qe=class{constructor(){let{moduleUrl:Me,styles:at,styleUrls:Jt}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.moduleUrl=Me||null,this.styles=st(at),this.styleUrls=st(Jt)}};L.CompileStylesheetMetadata=Qe;var yt=class{constructor(Me){let{encapsulation:at,template:Jt,templateUrl:er,htmlAst:Ar,styles:Er,styleUrls:_r,externalStylesheets:xr,animations:Ir,ngContentSelectors:Mr,interpolation:or,isInline:lt,preserveWhitespaces:mt}=Me;if(this.encapsulation=at,this.template=Jt,this.templateUrl=er,this.htmlAst=Ar,this.styles=st(Er),this.styleUrls=st(_r),this.externalStylesheets=st(xr),this.animations=Ir?Vt(Ir):[],this.ngContentSelectors=Mr||[],or&&or.length!=2)throw new Error("'interpolation' should have a start and an end symbol.");this.interpolation=or,this.isInline=lt,this.preserveWhitespaces=mt}toSummary(){return{ngContentSelectors:this.ngContentSelectors,encapsulation:this.encapsulation,styles:this.styles,animations:this.animations}}};L.CompileTemplateMetadata=yt;var _t=class{static create(Me){let{isHost:at,type:Jt,isComponent:er,selector:Ar,exportAs:Er,changeDetection:_r,inputs:xr,outputs:Ir,host:Mr,providers:or,viewProviders:lt,queries:mt,guards:St,viewQueries:xt,entryComponents:Kt,template:sr,componentViewType:lr,rendererType:Qt,componentFactory:Kr}=Me,In={},jn={},Yu={};Mr!=null&&Object.keys(Mr).forEach(vr=>{let Qr=Mr[vr],cn=vr.match(Ee);cn===null?Yu[vr]=Qr:cn[1]!=null?jn[cn[1]]=Qr:cn[2]!=null&&(In[cn[2]]=Qr)});let Ku={};xr==null||xr.forEach(vr=>{let Qr=ge.splitAtColon(vr,[vr,vr]);Ku[Qr[0]]=Qr[1]});let Qu={};return Ir==null||Ir.forEach(vr=>{let Qr=ge.splitAtColon(vr,[vr,vr]);Qu[Qr[0]]=Qr[1]}),new _t({isHost:at,type:Jt,isComponent:!!er,selector:Ar,exportAs:Er,changeDetection:_r,inputs:Ku,outputs:Qu,hostListeners:In,hostProperties:jn,hostAttributes:Yu,providers:or,viewProviders:lt,queries:mt,guards:St,viewQueries:xt,entryComponents:Kt,template:sr,componentViewType:lr,rendererType:Qt,componentFactory:Kr})}constructor(Me){let{isHost:at,type:Jt,isComponent:er,selector:Ar,exportAs:Er,changeDetection:_r,inputs:xr,outputs:Ir,hostListeners:Mr,hostProperties:or,hostAttributes:lt,providers:mt,viewProviders:St,queries:xt,guards:Kt,viewQueries:sr,entryComponents:lr,template:Qt,componentViewType:Kr,rendererType:In,componentFactory:jn}=Me;this.isHost=!!at,this.type=Jt,this.isComponent=er,this.selector=Ar,this.exportAs=Er,this.changeDetection=_r,this.inputs=xr,this.outputs=Ir,this.hostListeners=Mr,this.hostProperties=or,this.hostAttributes=lt,this.providers=st(mt),this.viewProviders=st(St),this.queries=st(xt),this.guards=Kt,this.viewQueries=st(sr),this.entryComponents=st(lr),this.template=Qt,this.componentViewType=Kr,this.rendererType=In,this.componentFactory=jn}toSummary(){return{summaryKind:Ve.Directive,type:this.type,isComponent:this.isComponent,selector:this.selector,exportAs:this.exportAs,inputs:this.inputs,outputs:this.outputs,hostListeners:this.hostListeners,hostProperties:this.hostProperties,hostAttributes:this.hostAttributes,providers:this.providers,viewProviders:this.viewProviders,queries:this.queries,guards:this.guards,viewQueries:this.viewQueries,entryComponents:this.entryComponents,changeDetection:this.changeDetection,template:this.template&&this.template.toSummary(),componentViewType:this.componentViewType,rendererType:this.rendererType,componentFactory:this.componentFactory}}};L.CompileDirectiveMetadata=_t;var ct=class{constructor(Me){let{type:at,name:Jt,pure:er}=Me;this.type=at,this.name=Jt,this.pure=!!er}toSummary(){return{summaryKind:Ve.Pipe,type:this.type,name:this.name,pure:this.pure}}};L.CompilePipeMetadata=ct;var kt=class{};L.CompileShallowModuleMetadata=kt;var $t=class{constructor(Me){let{type:at,providers:Jt,declaredDirectives:er,exportedDirectives:Ar,declaredPipes:Er,exportedPipes:_r,entryComponents:xr,bootstrapComponents:Ir,importedModules:Mr,exportedModules:or,schemas:lt,transitiveModule:mt,id:St}=Me;this.type=at||null,this.declaredDirectives=st(er),this.exportedDirectives=st(Ar),this.declaredPipes=st(Er),this.exportedPipes=st(_r),this.providers=st(Jt),this.entryComponents=st(xr),this.bootstrapComponents=st(Ir),this.importedModules=st(Mr),this.exportedModules=st(or),this.schemas=st(lt),this.id=St||null,this.transitiveModule=mt||null}toSummary(){let Me=this.transitiveModule;return{summaryKind:Ve.NgModule,type:this.type,entryComponents:Me.entryComponents,providers:Me.providers,modules:Me.modules,exportedDirectives:Me.exportedDirectives,exportedPipes:Me.exportedPipes}}};L.CompileNgModuleMetadata=$t;var ir=class{constructor(){this.directivesSet=new Set,this.directives=[],this.exportedDirectivesSet=new Set,this.exportedDirectives=[],this.pipesSet=new Set,this.pipes=[],this.exportedPipesSet=new Set,this.exportedPipes=[],this.modulesSet=new Set,this.modules=[],this.entryComponentsSet=new Set,this.entryComponents=[],this.providers=[]}addProvider(Me,at){this.providers.push({provider:Me,module:at})}addDirective(Me){this.directivesSet.has(Me.reference)||(this.directivesSet.add(Me.reference),this.directives.push(Me))}addExportedDirective(Me){this.exportedDirectivesSet.has(Me.reference)||(this.exportedDirectivesSet.add(Me.reference),this.exportedDirectives.push(Me))}addPipe(Me){this.pipesSet.has(Me.reference)||(this.pipesSet.add(Me.reference),this.pipes.push(Me))}addExportedPipe(Me){this.exportedPipesSet.has(Me.reference)||(this.exportedPipesSet.add(Me.reference),this.exportedPipes.push(Me))}addModule(Me){this.modulesSet.has(Me.reference)||(this.modulesSet.add(Me.reference),this.modules.push(Me))}addEntryComponent(Me){this.entryComponentsSet.has(Me.componentType)||(this.entryComponentsSet.add(Me.componentType),this.entryComponents.push(Me))}};L.TransitiveCompileNgModuleMetadata=ir;function st(Me){return Me||[]}var Ot=class{constructor(Me,at){let{useClass:Jt,useValue:er,useExisting:Ar,useFactory:Er,deps:_r,multi:xr}=at;this.token=Me,this.useClass=Jt||null,this.useValue=er,this.useExisting=Ar,this.useFactory=Er||null,this.dependencies=_r||null,this.multi=!!xr}};L.ProviderMeta=Ot;function Vt(Me){return Me.reduce((at,Jt)=>{let er=Array.isArray(Jt)?Vt(Jt):Jt;return at.concat(er)},[])}L.flatten=Vt;function Ut(Me){return Me.replace(/(\w+:\/\/[\w:-]+)?(\/+)?/,"ng:///")}function rr(Me,at,Jt){let er;return Jt.isInline?at.type.reference instanceof re.StaticSymbol?er=`${at.type.reference.filePath}.${at.type.reference.name}.html`:er=`${de(Me)}/${de(at.type)}.html`:er=Jt.templateUrl,at.type.reference instanceof re.StaticSymbol?er:Ut(er)}L.templateSourceUrl=rr;function z(Me,at){let Jt=Me.moduleUrl.split(/\/\\/g),er=Jt[Jt.length-1];return Ut(`css/${at}${er}.ngstyle.js`)}L.sharedStylesheetJitUrl=z;function le(Me){return Ut(`${de(Me.type)}/module.ngfactory.js`)}L.ngModuleJitUrl=le;function We(Me,at){return Ut(`${de(Me)}/${de(at.type)}.ngfactory.js`)}L.templateJitUrl=We}}),Zt=he({"node_modules/angular-html-parser/lib/compiler/src/parse_util.js"(L){$(),Object.defineProperty(L,"__esModule",{value:!0});var re=Ft(),ge=qt(),Ee=class{constructor(ce,ve,Ve,He){this.file=ce,this.offset=ve,this.line=Ve,this.col=He}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(ce){let ve=this.file.content,Ve=ve.length,He=this.offset,Je=this.line,Qe=this.col;for(;He>0&&ce<0;)if(He--,ce++,ve.charCodeAt(He)==re.$LF){Je--;let yt=ve.substr(0,He-1).lastIndexOf(String.fromCharCode(re.$LF));Qe=yt>0?He-yt:He}else Qe--;for(;He0;){let yt=ve.charCodeAt(He);He++,ce--,yt==re.$LF?(Je++,Qe=0):Qe++}return new Ee(this.file,He,Je,Qe)}getContext(ce,ve){let Ve=this.file.content,He=this.offset;if(He!=null){He>Ve.length-1&&(He=Ve.length-1);let Je=He,Qe=0,yt=0;for(;Qe0&&(He--,Qe++,!(Ve[He]==` `&&++yt==ve)););for(Qe=0,yt=0;Qe2&&arguments[2]!==void 0?arguments[2]:null;this.start=ce,this.end=ve,this.details=Ve}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}};L.ParseSourceSpan=ie,L.EMPTY_PARSE_LOCATION=new Ee(new Pe("",""),0,0,0),L.EMPTY_SOURCE_SPAN=new ie(L.EMPTY_PARSE_LOCATION,L.EMPTY_PARSE_LOCATION);var de;(function(ce){ce[ce.WARNING=0]="WARNING",ce[ce.ERROR=1]="ERROR"})(de=L.ParseErrorLevel||(L.ParseErrorLevel={}));var Ue=class{constructor(ce,ve){let Ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:de.ERROR;this.span=ce,this.msg=ve,this.level=Ve}contextualMessage(){let ce=this.span.start.getContext(100,3);return ce?`${this.msg} ("${ce.before}[${de[this.level]} ->]${ce.after}")`:this.msg}toString(){let ce=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${ce}`}};L.ParseError=Ue;function Ge(ce,ve){let Ve=ge.identifierModuleUrl(ve),He=Ve!=null?`in ${ce} ${ge.identifierName(ve)} in ${Ve}`:`in ${ce} ${ge.identifierName(ve)}`,Je=new Pe("",He);return new ie(new Ee(Je,-1,-1,-1),new Ee(Je,-1,-1,-1))}L.typeSourceSpan=Ge;function gt(ce,ve,Ve){let He=`in ${ce} ${ve} in ${Ve}`,Je=new Pe("",He);return new ie(new Ee(Je,-1,-1,-1),new Ee(Je,-1,-1,-1))}L.r3JitTypeSourceSpan=gt}}),ue=he({"src/utils/front-matter/parse.js"(L,re){$();var ge=new RegExp("^(?-{3}|\\+{3})(?[^\\n]*)\\n(?:|(?.*?)\\n)(?\\k|\\.{3})[^\\S\\n]*(?:\\n|$)","s");function Ee(Pe){let ie=Pe.match(ge);if(!ie)return{content:Pe};let{startDelimiter:de,language:Ue,value:Ge="",endDelimiter:gt}=ie.groups,ce=Ue.trim()||"yaml";if(de==="+++"&&(ce="toml"),ce!=="yaml"&&de!==gt)return{content:Pe};let[ve]=ie;return{frontMatter:{type:"front-matter",lang:ce,value:Ge,startDelimiter:de,endDelimiter:gt,raw:ve.replace(/\n$/,"")},content:ve.replace(/[^\n]/g," ")+Pe.slice(ve.length)}}re.exports=Ee}}),yr=he({"src/utils/get-last.js"(L,re){$();var ge=Ee=>Ee[Ee.length-1];re.exports=ge}}),Pr=he({"src/common/parser-create-error.js"(L,re){$();function ge(Ee,Pe){let ie=new SyntaxError(Ee+" ("+Pe.start.line+":"+Pe.start.column+")");return ie.loc=Pe,ie}re.exports=ge}}),zr={};qe(zr,{default:()=>fr});function fr(L){if(typeof L!="string")throw new TypeError("Expected a string");return L.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Rr=je({"node_modules/escape-string-regexp/index.js"(){$()}}),mr=he({"node_modules/semver/internal/debug.js"(L,re){$();var ge=typeof rt=="object"&&rt.env&&rt.env.NODE_DEBUG&&/\bsemver\b/i.test(rt.env.NODE_DEBUG)?function(){for(var Ee=arguments.length,Pe=new Array(Ee),ie=0;ie{};re.exports=ge}}),rn=he({"node_modules/semver/internal/constants.js"(L,re){$();var ge="2.0.0",Ee=256,Pe=Number.MAX_SAFE_INTEGER||9007199254740991,ie=16;re.exports={SEMVER_SPEC_VERSION:ge,MAX_LENGTH:Ee,MAX_SAFE_INTEGER:Pe,MAX_SAFE_COMPONENT_LENGTH:ie}}}),wr=he({"node_modules/semver/internal/re.js"(L,re){$();var{MAX_SAFE_COMPONENT_LENGTH:ge}=rn(),Ee=mr();L=re.exports={};var Pe=L.re=[],ie=L.src=[],de=L.t={},Ue=0,Ge=(gt,ce,ve)=>{let Ve=Ue++;Ee(gt,Ve,ce),de[gt]=Ve,ie[Ve]=ce,Pe[Ve]=new RegExp(ce,ve?"g":void 0)};Ge("NUMERICIDENTIFIER","0|[1-9]\\d*"),Ge("NUMERICIDENTIFIERLOOSE","[0-9]+"),Ge("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),Ge("MAINVERSION",`(${ie[de.NUMERICIDENTIFIER]})\\.(${ie[de.NUMERICIDENTIFIER]})\\.(${ie[de.NUMERICIDENTIFIER]})`),Ge("MAINVERSIONLOOSE",`(${ie[de.NUMERICIDENTIFIERLOOSE]})\\.(${ie[de.NUMERICIDENTIFIERLOOSE]})\\.(${ie[de.NUMERICIDENTIFIERLOOSE]})`),Ge("PRERELEASEIDENTIFIER",`(?:${ie[de.NUMERICIDENTIFIER]}|${ie[de.NONNUMERICIDENTIFIER]})`),Ge("PRERELEASEIDENTIFIERLOOSE",`(?:${ie[de.NUMERICIDENTIFIERLOOSE]}|${ie[de.NONNUMERICIDENTIFIER]})`),Ge("PRERELEASE",`(?:-(${ie[de.PRERELEASEIDENTIFIER]}(?:\\.${ie[de.PRERELEASEIDENTIFIER]})*))`),Ge("PRERELEASELOOSE",`(?:-?(${ie[de.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${ie[de.PRERELEASEIDENTIFIERLOOSE]})*))`),Ge("BUILDIDENTIFIER","[0-9A-Za-z-]+"),Ge("BUILD",`(?:\\+(${ie[de.BUILDIDENTIFIER]}(?:\\.${ie[de.BUILDIDENTIFIER]})*))`),Ge("FULLPLAIN",`v?${ie[de.MAINVERSION]}${ie[de.PRERELEASE]}?${ie[de.BUILD]}?`),Ge("FULL",`^${ie[de.FULLPLAIN]}$`),Ge("LOOSEPLAIN",`[v=\\s]*${ie[de.MAINVERSIONLOOSE]}${ie[de.PRERELEASELOOSE]}?${ie[de.BUILD]}?`),Ge("LOOSE",`^${ie[de.LOOSEPLAIN]}$`),Ge("GTLT","((?:<|>)?=?)"),Ge("XRANGEIDENTIFIERLOOSE",`${ie[de.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),Ge("XRANGEIDENTIFIER",`${ie[de.NUMERICIDENTIFIER]}|x|X|\\*`),Ge("XRANGEPLAIN",`[v=\\s]*(${ie[de.XRANGEIDENTIFIER]})(?:\\.(${ie[de.XRANGEIDENTIFIER]})(?:\\.(${ie[de.XRANGEIDENTIFIER]})(?:${ie[de.PRERELEASE]})?${ie[de.BUILD]}?)?)?`),Ge("XRANGEPLAINLOOSE",`[v=\\s]*(${ie[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ie[de.XRANGEIDENTIFIERLOOSE]})(?:\\.(${ie[de.XRANGEIDENTIFIERLOOSE]})(?:${ie[de.PRERELEASELOOSE]})?${ie[de.BUILD]}?)?)?`),Ge("XRANGE",`^${ie[de.GTLT]}\\s*${ie[de.XRANGEPLAIN]}$`),Ge("XRANGELOOSE",`^${ie[de.GTLT]}\\s*${ie[de.XRANGEPLAINLOOSE]}$`),Ge("COERCE",`(^|[^\\d])(\\d{1,${ge}})(?:\\.(\\d{1,${ge}}))?(?:\\.(\\d{1,${ge}}))?(?:$|[^\\d])`),Ge("COERCERTL",ie[de.COERCE],!0),Ge("LONETILDE","(?:~>?)"),Ge("TILDETRIM",`(\\s*)${ie[de.LONETILDE]}\\s+`,!0),L.tildeTrimReplace="$1~",Ge("TILDE",`^${ie[de.LONETILDE]}${ie[de.XRANGEPLAIN]}$`),Ge("TILDELOOSE",`^${ie[de.LONETILDE]}${ie[de.XRANGEPLAINLOOSE]}$`),Ge("LONECARET","(?:\\^)"),Ge("CARETTRIM",`(\\s*)${ie[de.LONECARET]}\\s+`,!0),L.caretTrimReplace="$1^",Ge("CARET",`^${ie[de.LONECARET]}${ie[de.XRANGEPLAIN]}$`),Ge("CARETLOOSE",`^${ie[de.LONECARET]}${ie[de.XRANGEPLAINLOOSE]}$`),Ge("COMPARATORLOOSE",`^${ie[de.GTLT]}\\s*(${ie[de.LOOSEPLAIN]})$|^$`),Ge("COMPARATOR",`^${ie[de.GTLT]}\\s*(${ie[de.FULLPLAIN]})$|^$`),Ge("COMPARATORTRIM",`(\\s*)${ie[de.GTLT]}\\s*(${ie[de.LOOSEPLAIN]}|${ie[de.XRANGEPLAIN]})`,!0),L.comparatorTrimReplace="$1$2$3",Ge("HYPHENRANGE",`^\\s*(${ie[de.XRANGEPLAIN]})\\s+-\\s+(${ie[de.XRANGEPLAIN]})\\s*$`),Ge("HYPHENRANGELOOSE",`^\\s*(${ie[de.XRANGEPLAINLOOSE]})\\s+-\\s+(${ie[de.XRANGEPLAINLOOSE]})\\s*$`),Ge("STAR","(<|>)?=?\\s*\\*"),Ge("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),Ge("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}}),Fr=he({"node_modules/semver/internal/parse-options.js"(L,re){$();var ge=["includePrerelease","loose","rtl"],Ee=Pe=>Pe?typeof Pe!="object"?{loose:!0}:ge.filter(ie=>Pe[ie]).reduce((ie,de)=>(ie[de]=!0,ie),{}):{};re.exports=Ee}}),Bn=he({"node_modules/semver/internal/identifiers.js"(L,re){$();var ge=/^[0-9]+$/,Ee=(ie,de)=>{let Ue=ge.test(ie),Ge=ge.test(de);return Ue&&Ge&&(ie=+ie,de=+de),ie===de?0:Ue&&!Ge?-1:Ge&&!Ue?1:ieEe(de,ie);re.exports={compareIdentifiers:Ee,rcompareIdentifiers:Pe}}}),wn=he({"node_modules/semver/classes/semver.js"(L,re){$();var ge=mr(),{MAX_LENGTH:Ee,MAX_SAFE_INTEGER:Pe}=rn(),{re:ie,t:de}=wr(),Ue=Fr(),{compareIdentifiers:Ge}=Bn(),gt=class{constructor(ce,ve){if(ve=Ue(ve),ce instanceof gt){if(ce.loose===!!ve.loose&&ce.includePrerelease===!!ve.includePrerelease)return ce;ce=ce.version}else if(typeof ce!="string")throw new TypeError(`Invalid Version: ${ce}`);if(ce.length>Ee)throw new TypeError(`version is longer than ${Ee} characters`);ge("SemVer",ce,ve),this.options=ve,this.loose=!!ve.loose,this.includePrerelease=!!ve.includePrerelease;let Ve=ce.trim().match(ve.loose?ie[de.LOOSE]:ie[de.FULL]);if(!Ve)throw new TypeError(`Invalid Version: ${ce}`);if(this.raw=ce,this.major=+Ve[1],this.minor=+Ve[2],this.patch=+Ve[3],this.major>Pe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Pe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Pe||this.patch<0)throw new TypeError("Invalid patch version");Ve[4]?this.prerelease=Ve[4].split(".").map(He=>{if(/^[0-9]+$/.test(He)){let Je=+He;if(Je>=0&&Je=0;)typeof this.prerelease[Ve]=="number"&&(this.prerelease[Ve]++,Ve=-2);Ve===-1&&this.prerelease.push(0)}ve&&(Ge(this.prerelease[0],ve)===0?isNaN(this.prerelease[1])&&(this.prerelease=[ve,0]):this.prerelease=[ve,0]);break;default:throw new Error(`invalid increment argument: ${ce}`)}return this.format(),this.raw=this.version,this}};re.exports=gt}}),on=he({"node_modules/semver/functions/compare.js"(L,re){$();var ge=wn(),Ee=(Pe,ie,de)=>new ge(Pe,de).compare(new ge(ie,de));re.exports=Ee}}),Nr=he({"node_modules/semver/functions/lt.js"(L,re){$();var ge=on(),Ee=(Pe,ie,de)=>ge(Pe,ie,de)<0;re.exports=Ee}}),wu=he({"node_modules/semver/functions/gte.js"(L,re){$();var ge=on(),Ee=(Pe,ie,de)=>ge(Pe,ie,de)>=0;re.exports=Ee}}),Mi=he({"src/utils/arrayify.js"(L,re){$(),re.exports=(ge,Ee)=>Object.entries(ge).map(Pe=>{let[ie,de]=Pe;return Object.assign({[Ee]:ie},de)})}}),Nu=he({"package.json"(L,re){re.exports={version:"2.8.8"}}}),qi=he({"node_modules/outdent/lib/index.js"(L,re){$(),Object.defineProperty(L,"__esModule",{value:!0}),L.outdent=void 0;function ge(){for(var ct=[],kt=0;kt=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(e[a]=t[a])}return e}function B(t,r){if(t==null)return{};var e={},a=Object.keys(t),n,i;for(i=0;i=0)&&(e[n]=t[n]);return e}var H=[.973051493507435,.15334737213558558,.5671034553053769];function E(t,r,e){return Math.floor(H[e%3]*(r-t+1))+t}var m=function(r){var e,a=r.paragraph,n=r.lineCount,i=r.width,I=r.heading,v=r.className,u=A(r,$),g=L(),d=j((e={},f(e,"".concat(g,"--skeleton__text"),!0),f(e,"".concat(g,"--skeleton__heading"),I),f(e,v,v),e)),w=parseInt(i,10),k=i.includes("px"),M=i.includes("%");if(M&&a){for(var x=[],h=0;h{if(t){let e=s(t,r)||s(t,"extracted_metadata.title")||s(t,"extracted_metadata.filename")||t.document_id;return Array.isArray(e)?e=e[0]:typeof e=="object"&&(e.hasOwnProperty("text")&&typeof s(e,"text")=="string"?e=s(e,"text"):e=e.toString()),e}return""};export{G as I,J as L,K as S,Q as g}; diff --git a/docs/storybook/assets/getDocumentTitle-Zh1PemE-.js b/docs/storybook/assets/getDocumentTitle-Zh1PemE-.js deleted file mode 100644 index 4ec666007..000000000 --- a/docs/storybook/assets/getDocumentTitle-Zh1PemE-.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as C,I as N,a as S,u as L,c as R}from"./Button-KibTbxDG.js";import{R as l}from"./index-RfLt4OUa.js";import{P as o}from"./index-4QtD-hFu.js";import{g as d}from"./callBound-4MCeDK1M.js";var b,P,_,E,j=["children"],W=["children"],G=l.forwardRef(function(t,r){var a=t.children,n=C(t,j);return l.createElement(N,S({width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:r},n),b||(b=l.createElement("path",{d:"M8.5 11L8.5 6.5 6.5 6.5 6.5 7.5 7.5 7.5 7.5 11 6 11 6 12 10 12 10 11zM8 3.5c-.4 0-.8.3-.8.8S7.6 5 8 5c.4 0 .8-.3.8-.8S8.4 3.5 8 3.5z"})),P||(P=l.createElement("path",{d:"M8,15c-3.9,0-7-3.1-7-7s3.1-7,7-7s7,3.1,7,7S11.9,15,8,15z M8,2C4.7,2,2,4.7,2,8s2.7,6,6,6s6-2.7,6-6S11.3,2,8,2z"})),a)}),J=l.forwardRef(function(t,r){var a=t.children,n=C(t,W);return l.createElement(N,S({width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",ref:r},n),_||(_=l.createElement("path",{d:"M13,14H3c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h5v1H3v10h10V8h1v5C14,13.6,13.6,14,13,14z"})),E||(E=l.createElement("path",{d:"M10 1L10 2 13.3 2 9 6.3 9.7 7 14 2.7 14 6 15 6 15 1z"})),a)}),$=["paragraph","lineCount","width","heading","className"];function s(){return s=Object.assign||function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function H(e,t){if(e==null)return{};var r={},a=Object.keys(e),n,i;for(i=0;i=0)&&(r[n]=e[n]);return r}var V=[.973051493507435,.15334737213558558,.5671034553053769];function O(e,t,r){return Math.floor(V[r%3]*(t-e+1))+e}var m=function(t){var r,a=t.paragraph,n=t.lineCount,i=t.width,I=t.heading,v=t.className,p=B(t,$),g=L(),u=R((r={},f(r,"".concat(g,"--skeleton__text"),!0),f(r,"".concat(g,"--skeleton__heading"),I),f(r,v,v),r)),w=parseInt(i,10),k=i.includes("px"),M=i.includes("%");if(M&&a){for(var x=[],c=0;ce?d(e,t)||d(e,"extracted_metadata.title")||d(e,"extracted_metadata.filename")||e.document_id:"";export{G as I,J as L,K as S,Q as g}; diff --git a/docs/storybook/assets/iframe-_98K0_ok.js b/docs/storybook/assets/iframe-mUD1hmuH.js similarity index 80% rename from docs/storybook/assets/iframe-_98K0_ok.js rename to docs/storybook/assets/iframe-mUD1hmuH.js index 91b1623f1..d36f5d466 100644 --- a/docs/storybook/assets/iframe-_98K0_ok.js +++ b/docs/storybook/assets/iframe-mUD1hmuH.js @@ -1,7 +1,7 @@ -import"../sb-preview/runtime.js";(function(){const _=document.createElement("link").relList;if(_&&_.supports&&_.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))c(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const r of t.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&c(r)}).observe(document,{childList:!0,subtree:!0});function n(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?t.credentials="include":e.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function c(e){if(e.ep)return;e.ep=!0;const t=n(e);fetch(e.href,t)}})();const d="modulepreload",p=function(s,_){return new URL(s,_).href},O={},o=function(_,n,c){let e=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link");e=Promise.all(n.map(r=>{if(r=p(r,c),r in O)return;O[r]=!0;const a=r.endsWith(".css"),E=a?'[rel="stylesheet"]':"";if(!!c)for(let u=t.length-1;u>=0;u--){const l=t[u];if(l.href===r&&(!a||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${E}`))return;const i=document.createElement("link");if(i.rel=a?"stylesheet":d,a||(i.as="script",i.crossOrigin=""),i.href=r,document.head.appendChild(i),a)return new Promise((u,l)=>{i.addEventListener("load",u),i.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${r}`)))})}))}return e.then(()=>_()).catch(t=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=t,window.dispatchEvent(r),!r.defaultPrevented)throw t})},{createBrowserChannel:R}=__STORYBOOK_MODULE_CHANNELS__,{addons:f}=__STORYBOOK_MODULE_PREVIEW_API__,m=R({page:"preview"});f.setChannel(m);window.__STORYBOOK_ADDONS_CHANNEL__=m;window.CONFIG_TYPE==="DEVELOPMENT"&&(window.__STORYBOOK_SERVER_CHANNEL__=m);const P={"./src/components/CIDocument/components/CIDocument/__stories__/CIDocument.stories.tsx":async()=>o(()=>import("./CIDocument.stories--TB9_z-m.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]),import.meta.url),"./src/components/DiscoverySearch/__stories__/DiscoverySearch.stories.tsx":async()=>o(()=>import("./DiscoverySearch.stories-SfYZWCbl.js"),__vite__mapDeps([29,1,2,30,4,31,32,21,3,5,6,7,8,9,33,10,34,35]),import.meta.url),"./src/components/DocumentPreview/__stories__/DocumentPreview.stories.tsx":async()=>o(()=>import("./DocumentPreview.stories-PobyqiNj.js"),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,33,10,34,11,19,16,37,38,23,39,12,14,15,17,18,13,20,21,22,40,30,31,32,28,41]),import.meta.url),"./src/components/ResultsPagination/__stories__/ResultsPagination.stories.tsx":async()=>o(()=>import("./ResultsPagination.stories-tVFtlsg4.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,8,9,33,10,34,35,16,43,11,38]),import.meta.url),"./src/components/SearchFacets/__stories__/SearchFacets.stories.tsx":async()=>o(()=>import("./SearchFacets.stories--wjVhEJJ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,8,9,11,10,33,34,20,39,45,46,17,14,47,38,22,23,32,25,26,43,13,48,35]),import.meta.url),"./src/components/SearchInput/__stories__/SearchInput.stories.tsx":async()=>o(()=>import("./SearchInput.stories-9alKyATr.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,8,9,48,10,11,14,47,33,34,50,16,28,20,19,24,40,51,43,35]),import.meta.url),"./src/components/SearchResults/__stories__/SearchResults.stories.tsx":async()=>o(()=>import("./SearchResults.stories-vMiFh_tX.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,8,9,35,33,10,34,50,16,28,20,19,11,24,40,51,43,22,23]),import.meta.url),"./src/components/StructuredQuery/__stories__/StructuredQuery.stories.tsx":async()=>o(()=>import("./StructuredQuery.stories-WP9MWJT3.js"),__vite__mapDeps([53,1,2,3,4,5,6,7,8,9,35,33,10,34,11,27,12,26,45,46,17,14,47,38,43,37,23,39,51]),import.meta.url)};async function w(s){return P[s]()}const{composeConfigs:S,PreviewWeb:T,ClientApi:h}=__STORYBOOK_MODULE_PREVIEW_API__,I=async()=>{const s=await Promise.all([o(()=>import("./addDecorator-tc_83hP0.js").then(_=>_.a),__vite__mapDeps([54,3,4,2,5,6,7,8,9]),import.meta.url),o(()=>import("./entry-preview-TGgN7-T4.js"),__vite__mapDeps([55,2,56,18]),import.meta.url),o(()=>import("./entry-preview-docs-8AYtQ8o9.js"),__vite__mapDeps([57,58,4,2,31,10,7,6]),import.meta.url),o(()=>import("./preview-AKHunSk0.js"),__vite__mapDeps([59,8,7,34]),import.meta.url),o(()=>import("./preview-tdpRB_fr.js"),__vite__mapDeps([]),import.meta.url),o(()=>import("./preview-PfHsUsqb.js"),__vite__mapDeps([60,61,5,4,2,18,46,41,28,20,22,23,7,58,31,62]),import.meta.url)]);return S(s)};window.__STORYBOOK_PREVIEW__=window.__STORYBOOK_PREVIEW__||new T;window.__STORYBOOK_STORY_STORE__=window.__STORYBOOK_STORY_STORE__||window.__STORYBOOK_PREVIEW__.storyStore;window.__STORYBOOK_CLIENT_API__=window.__STORYBOOK_CLIENT_API__||new h({storyStore:window.__STORYBOOK_PREVIEW__.storyStore});window.__STORYBOOK_PREVIEW__.initialize({importFn:w,getProjectAnnotations:I});export{o as _}; +import"../sb-preview/runtime.js";(function(){const _=document.createElement("link").relList;if(_&&_.supports&&_.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))c(e);new MutationObserver(e=>{for(const t of e)if(t.type==="childList")for(const r of t.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&c(r)}).observe(document,{childList:!0,subtree:!0});function n(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?t.credentials="include":e.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function c(e){if(e.ep)return;e.ep=!0;const t=n(e);fetch(e.href,t)}})();const d="modulepreload",p=function(s,_){return new URL(s,_).href},O={},o=function(_,n,c){let e=Promise.resolve();if(n&&n.length>0){const t=document.getElementsByTagName("link");e=Promise.all(n.map(r=>{if(r=p(r,c),r in O)return;O[r]=!0;const a=r.endsWith(".css"),E=a?'[rel="stylesheet"]':"";if(!!c)for(let u=t.length-1;u>=0;u--){const l=t[u];if(l.href===r&&(!a||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${E}`))return;const i=document.createElement("link");if(i.rel=a?"stylesheet":d,a||(i.as="script",i.crossOrigin=""),i.href=r,document.head.appendChild(i),a)return new Promise((u,l)=>{i.addEventListener("load",u),i.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${r}`)))})}))}return e.then(()=>_()).catch(t=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=t,window.dispatchEvent(r),!r.defaultPrevented)throw t})},{createBrowserChannel:R}=__STORYBOOK_MODULE_CHANNELS__,{addons:f}=__STORYBOOK_MODULE_PREVIEW_API__,m=R({page:"preview"});f.setChannel(m);window.__STORYBOOK_ADDONS_CHANNEL__=m;window.CONFIG_TYPE==="DEVELOPMENT"&&(window.__STORYBOOK_SERVER_CHANNEL__=m);const P={"./src/components/CIDocument/components/CIDocument/__stories__/CIDocument.stories.tsx":async()=>o(()=>import("./CIDocument.stories-MuJ7xMMX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]),import.meta.url),"./src/components/DiscoverySearch/__stories__/DiscoverySearch.stories.tsx":async()=>o(()=>import("./DiscoverySearch.stories-Tf5oSbDY.js"),__vite__mapDeps([29,1,2,30,4,31,32,21,3,5,6,7,8,9,33,10,34,35]),import.meta.url),"./src/components/DocumentPreview/__stories__/DocumentPreview.stories.tsx":async()=>o(()=>import("./DocumentPreview.stories-wDP-X5Lu.js"),__vite__mapDeps([36,1,2,3,4,5,6,7,8,9,33,10,34,11,19,16,37,38,23,39,12,14,15,17,18,13,20,21,22,40,30,31,32,28,41]),import.meta.url),"./src/components/ResultsPagination/__stories__/ResultsPagination.stories.tsx":async()=>o(()=>import("./ResultsPagination.stories-tVFtlsg4.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,8,9,33,10,34,35,16,43,11,38]),import.meta.url),"./src/components/SearchFacets/__stories__/SearchFacets.stories.tsx":async()=>o(()=>import("./SearchFacets.stories--wjVhEJJ.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,8,9,11,10,33,34,20,39,45,46,17,14,47,38,22,23,32,25,26,43,13,48,35]),import.meta.url),"./src/components/SearchInput/__stories__/SearchInput.stories.tsx":async()=>o(()=>import("./SearchInput.stories-8iSDtAS4.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,8,9,48,10,11,14,47,33,34,50,16,28,20,19,24,40,51,43,35]),import.meta.url),"./src/components/SearchResults/__stories__/SearchResults.stories.tsx":async()=>o(()=>import("./SearchResults.stories-9mgA_WJq.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,8,9,35,33,10,34,50,16,28,20,19,11,24,40,51,43,22,23]),import.meta.url),"./src/components/StructuredQuery/__stories__/StructuredQuery.stories.tsx":async()=>o(()=>import("./StructuredQuery.stories-WP9MWJT3.js"),__vite__mapDeps([53,1,2,3,4,5,6,7,8,9,35,33,10,34,11,27,12,26,45,46,17,14,47,38,43,37,23,39,51]),import.meta.url)};async function w(s){return P[s]()}const{composeConfigs:S,PreviewWeb:T,ClientApi:h}=__STORYBOOK_MODULE_PREVIEW_API__,I=async()=>{const s=await Promise.all([o(()=>import("./addDecorator-tc_83hP0.js").then(_=>_.a),__vite__mapDeps([54,3,4,2,5,6,7,8,9]),import.meta.url),o(()=>import("./entry-preview-TGgN7-T4.js"),__vite__mapDeps([55,2,56,18]),import.meta.url),o(()=>import("./entry-preview-docs-8AYtQ8o9.js"),__vite__mapDeps([57,58,4,2,31,10,7,6]),import.meta.url),o(()=>import("./preview-AKHunSk0.js"),__vite__mapDeps([59,8,7,34]),import.meta.url),o(()=>import("./preview-9rW2m5lX.js"),__vite__mapDeps([]),import.meta.url),o(()=>import("./preview-rR4HDz8p.js"),__vite__mapDeps([60,61,5,4,2,18,46,41,28,20,22,23,7,58,31,62]),import.meta.url)]);return S(s)};window.__STORYBOOK_PREVIEW__=window.__STORYBOOK_PREVIEW__||new T;window.__STORYBOOK_STORY_STORE__=window.__STORYBOOK_STORY_STORE__||window.__STORYBOOK_PREVIEW__.storyStore;window.__STORYBOOK_CLIENT_API__=window.__STORYBOOK_CLIENT_API__||new h({storyStore:window.__STORYBOOK_PREVIEW__.storyStore});window.__STORYBOOK_PREVIEW__.initialize({importFn:w,getProjectAnnotations:I});export{o as _}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./CIDocument.stories--TB9_z-m.js","./jsx-runtime-FsUICBgo.js","./index-RfLt4OUa.js","./index-777x7qAF.js","./callBound-4MCeDK1M.js","./pickBy-llkn_6s3.js","./isPlainObject-g73re4jY.js","./index-xck8ovCi.js","./preview-errors-Ix78kkVy.js","./debounce-eWC8LGMf.js","./index-4QtD-hFu.js","./Button-KibTbxDG.js","./_baseSlice-BktYtjHb.js","./wrapFocus-29tK3Ecs.js","./bucket-5-3bTeVNTN.js","./withErrorBoundary-LzdLkl6I.js","./index-tUYgphcS.js","./mergeRefs-uj14wjf3.js","./index-miLrID2P.js","./getDocumentTitle-Zh1PemE-.js","./_baseUniq-2t0Y7xw1.js","./events-fK0UhkIE.js","./cloneDeep-eaEuvD8i.js","./_baseClone-6sJ_SjB4.js","./Link-_yif9kZE.js","./RadioButton-oUVXPi4-.js","./uniqueId-3N0rOl1M.js","./ResizeObserver.es-lk2mK0C6.js","./uniq-hAFl8ubt.js","./DiscoverySearch.stories-SfYZWCbl.js","./index-Pr70vtH1.js","./assert-1o4ErrXT.js","./index-zqflMFO-.js","./chunk-WFFRPTHA-XxQL4zvM.js","./v4-yQnnJER4.js","./storybookUtils-P7YVKdto.js","./DocumentPreview.stories-PobyqiNj.js","./omit-VaLeiQib.js","./bucket-29-VrKNGfP9.js","./last-zLtIjBiu.js","./purify.es-29Q0w72t.js","./pickBy-lHA7W3rs.js","./ResultsPagination.stories-tVFtlsg4.js","./formatMessage-wl7oTduw.js","./SearchFacets.stories--wjVhEJJ.js","./createPropAdapter-rri3PPhE.js","./inheritsLoose-O2jMHMzR.js","./index-o5OFstPD.js","./Search-TSjiQ7A7.js","./SearchInput.stories-9alKyATr.js","./SearchResults-M91Z8TUW.js","./bucket-25-SwNT5LZP.js","./SearchResults.stories-vMiFh_tX.js","./StructuredQuery.stories-WP9MWJT3.js","./addDecorator-tc_83hP0.js","./entry-preview-TGgN7-T4.js","./react-16-hgR7FrAp.js","./entry-preview-docs-8AYtQ8o9.js","./index-I0bGnlnk.js","./preview-AKHunSk0.js","./preview-PfHsUsqb.js","./index-yCoF09M4.js","./preview-rkgGnYVB.css"] + __vite__mapDeps.viteFileDeps = ["./CIDocument.stories-MuJ7xMMX.js","./jsx-runtime-FsUICBgo.js","./index-RfLt4OUa.js","./index-777x7qAF.js","./callBound-4MCeDK1M.js","./pickBy-llkn_6s3.js","./isPlainObject-g73re4jY.js","./index-xck8ovCi.js","./preview-errors-Ix78kkVy.js","./debounce-eWC8LGMf.js","./index-4QtD-hFu.js","./Button-KibTbxDG.js","./_baseSlice-BktYtjHb.js","./wrapFocus-29tK3Ecs.js","./bucket-5-3bTeVNTN.js","./withErrorBoundary-Y3jy2SmJ.js","./index-tUYgphcS.js","./mergeRefs-uj14wjf3.js","./index-miLrID2P.js","./getDocumentTitle-51WyFHkN.js","./_baseUniq-2t0Y7xw1.js","./events-fK0UhkIE.js","./cloneDeep-eaEuvD8i.js","./_baseClone-6sJ_SjB4.js","./Link-_yif9kZE.js","./RadioButton-oUVXPi4-.js","./uniqueId-3N0rOl1M.js","./ResizeObserver.es-lk2mK0C6.js","./uniq-hAFl8ubt.js","./DiscoverySearch.stories-Tf5oSbDY.js","./index-BxZ9LZUr.js","./assert-1o4ErrXT.js","./index-zqflMFO-.js","./chunk-WFFRPTHA-XxQL4zvM.js","./v4-yQnnJER4.js","./storybookUtils-P7YVKdto.js","./DocumentPreview.stories-wDP-X5Lu.js","./omit-VaLeiQib.js","./bucket-29-VrKNGfP9.js","./last-zLtIjBiu.js","./purify.es-29Q0w72t.js","./pickBy-lHA7W3rs.js","./ResultsPagination.stories-tVFtlsg4.js","./formatMessage-wl7oTduw.js","./SearchFacets.stories--wjVhEJJ.js","./createPropAdapter-rri3PPhE.js","./inheritsLoose-O2jMHMzR.js","./index-o5OFstPD.js","./Search-TSjiQ7A7.js","./SearchInput.stories-8iSDtAS4.js","./SearchResults-huRufqlh.js","./bucket-25-SwNT5LZP.js","./SearchResults.stories-9mgA_WJq.js","./StructuredQuery.stories-WP9MWJT3.js","./addDecorator-tc_83hP0.js","./entry-preview-TGgN7-T4.js","./react-16-hgR7FrAp.js","./entry-preview-docs-8AYtQ8o9.js","./index-I0bGnlnk.js","./preview-AKHunSk0.js","./preview-rR4HDz8p.js","./index-lt-u4Ncf.js","./preview-rkgGnYVB.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/docs/storybook/assets/index-BxZ9LZUr.js b/docs/storybook/assets/index-BxZ9LZUr.js new file mode 100644 index 000000000..8d826d0d7 --- /dev/null +++ b/docs/storybook/assets/index-BxZ9LZUr.js @@ -0,0 +1,8 @@ +import{O as se}from"./callBound-4MCeDK1M.js";import{c as Ee,g as ba}from"./index-RfLt4OUa.js";import{u as ei,i as ft,r as Sn}from"./assert-1o4ErrXT.js";import{b as Rt}from"./index-zqflMFO-.js";import{e as ti}from"./events-fK0UhkIE.js";import{f as ya}from"./index-777x7qAF.js";var Tn={},nr={};nr.byteLength=Ra;nr.toByteArray=Ta;nr.fromByteArray=Ia;var je=[],Fe=[],ma=typeof Uint8Array<"u"?Uint8Array:Array,cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var wt=0,Ea=cr.length;wt0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=a);var r=t===a?0:4-t%4;return[t,r]}function Ra(e){var a=xn(e),t=a[0],r=a[1];return(t+r)*3/4-r}function Sa(e,a,t){return(a+t)*3/4-t}function Ta(e){var a,t=xn(e),r=t[0],c=t[1],l=new ma(Sa(e,r,c)),u=0,s=c>0?r-4:r,v;for(v=0;v>16&255,l[u++]=a>>8&255,l[u++]=a&255;return c===2&&(a=Fe[e.charCodeAt(v)]<<2|Fe[e.charCodeAt(v+1)]>>4,l[u++]=a&255),c===1&&(a=Fe[e.charCodeAt(v)]<<10|Fe[e.charCodeAt(v+1)]<<4|Fe[e.charCodeAt(v+2)]>>2,l[u++]=a>>8&255,l[u++]=a&255),l}function xa(e){return je[e>>18&63]+je[e>>12&63]+je[e>>6&63]+je[e&63]}function Aa(e,a,t){for(var r,c=[],l=a;ls?s:u+l));return r===1?(a=e[t-1],c.push(je[a>>2]+je[a<<4&63]+"==")):r===2&&(a=(e[t-2]<<8)+e[t-1],c.push(je[a>>10]+je[a>>4&63]+je[a<<2&63]+"=")),c.join("")}var ri={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ri.read=function(e,a,t,r,c){var l,u,s=c*8-r-1,v=(1<>1,n=-7,d=t?c-1:0,b=t?-1:1,y=e[a+d];for(d+=b,l=y&(1<<-n)-1,y>>=-n,n+=s;n>0;l=l*256+e[a+d],d+=b,n-=8);for(u=l&(1<<-n)-1,l>>=-n,n+=r;n>0;u=u*256+e[a+d],d+=b,n-=8);if(l===0)l=1-f;else{if(l===v)return u?NaN:(y?-1:1)*(1/0);u=u+Math.pow(2,r),l=l-f}return(y?-1:1)*u*Math.pow(2,l-r)};ri.write=function(e,a,t,r,c,l){var u,s,v,f=l*8-c-1,n=(1<>1,b=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=r?0:l-1,I=r?1:-1,F=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(s=isNaN(a)?1:0,u=n):(u=Math.floor(Math.log(a)/Math.LN2),a*(v=Math.pow(2,-u))<1&&(u--,v*=2),u+d>=1?a+=b/v:a+=b*Math.pow(2,1-d),a*v>=2&&(u++,v/=2),u+d>=n?(s=0,u=n):u+d>=1?(s=(a*v-1)*Math.pow(2,c),u=u+d):(s=a*Math.pow(2,d-1)*Math.pow(2,c),u=0));c>=8;e[t+y]=s&255,y+=I,s/=256,c-=8);for(u=u<0;e[t+y]=u&255,y+=I,u/=256,f-=8);e[t+y-I]|=F*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(e){const a=nr,t=ri,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=n,e.SlowBuffer=L,e.INSPECT_MAX_BYTES=50;const c=2147483647;e.kMaxLength=c;const{Uint8Array:l,ArrayBuffer:u,SharedArrayBuffer:s}=globalThis;n.TYPED_ARRAY_SUPPORT=v(),!n.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function v(){try{const h=new l(1),i={foo:function(){return 42}};return Object.setPrototypeOf(i,l.prototype),Object.setPrototypeOf(h,i),h.foo()===42}catch{return!1}}Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.buffer}}),Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.byteOffset}});function f(h){if(h>c)throw new RangeError('The value "'+h+'" is invalid for option "size"');const i=new l(h);return Object.setPrototypeOf(i,n.prototype),i}function n(h,i,o){if(typeof h=="number"){if(typeof i=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return I(h)}return d(h,i,o)}n.poolSize=8192;function d(h,i,o){if(typeof h=="string")return F(h,i);if(u.isView(h))return w(h);if(h==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof h);if(q(h,u)||h&&q(h.buffer,u)||typeof s<"u"&&(q(h,s)||h&&q(h.buffer,s)))return x(h,i,o);if(typeof h=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const _=h.valueOf&&h.valueOf();if(_!=null&&_!==h)return n.from(_,i,o);const m=N(h);if(m)return m;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof h[Symbol.toPrimitive]=="function")return n.from(h[Symbol.toPrimitive]("string"),i,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof h)}n.from=function(h,i,o){return d(h,i,o)},Object.setPrototypeOf(n.prototype,l.prototype),Object.setPrototypeOf(n,l);function b(h){if(typeof h!="number")throw new TypeError('"size" argument must be of type number');if(h<0)throw new RangeError('The value "'+h+'" is invalid for option "size"')}function y(h,i,o){return b(h),h<=0?f(h):i!==void 0?typeof o=="string"?f(h).fill(i,o):f(h).fill(i):f(h)}n.alloc=function(h,i,o){return y(h,i,o)};function I(h){return b(h),f(h<0?0:B(h)|0)}n.allocUnsafe=function(h){return I(h)},n.allocUnsafeSlow=function(h){return I(h)};function F(h,i){if((typeof i!="string"||i==="")&&(i="utf8"),!n.isEncoding(i))throw new TypeError("Unknown encoding: "+i);const o=z(h,i)|0;let _=f(o);const m=_.write(h,i);return m!==o&&(_=_.slice(0,m)),_}function S(h){const i=h.length<0?0:B(h.length)|0,o=f(i);for(let _=0;_=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return h|0}function L(h){return+h!=h&&(h=0),n.alloc(+h)}n.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==n.prototype},n.compare=function(i,o){if(q(i,l)&&(i=n.from(i,i.offset,i.byteLength)),q(o,l)&&(o=n.from(o,o.offset,o.byteLength)),!n.isBuffer(i)||!n.isBuffer(o))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===o)return 0;let _=i.length,m=o.length;for(let k=0,O=Math.min(_,m);km.length?(n.isBuffer(O)||(O=n.from(O)),O.copy(m,k)):l.prototype.set.call(m,O,k);else if(n.isBuffer(O))O.copy(m,k);else throw new TypeError('"list" argument must be an Array of Buffers');k+=O.length}return m};function z(h,i){if(n.isBuffer(h))return h.length;if(u.isView(h)||q(h,u))return h.byteLength;if(typeof h!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof h);const o=h.length,_=arguments.length>2&&arguments[2]===!0;if(!_&&o===0)return 0;let m=!1;for(;;)switch(i){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":return Ye(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return Xe(h).length;default:if(m)return _?-1:Ye(h).length;i=(""+i).toLowerCase(),m=!0}}n.byteLength=z;function $(h,i,o){let _=!1;if((i===void 0||i<0)&&(i=0),i>this.length||((o===void 0||o>this.length)&&(o=this.length),o<=0)||(o>>>=0,i>>>=0,o<=i))return"";for(h||(h="utf8");;)switch(h){case"hex":return ie(this,i,o);case"utf8":case"utf-8":return he(this,i,o);case"ascii":return H(this,i,o);case"latin1":case"binary":return X(this,i,o);case"base64":return we(this,i,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return le(this,i,o);default:if(_)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),_=!0}}n.prototype._isBuffer=!0;function Z(h,i,o){const _=h[i];h[i]=h[o],h[o]=_}n.prototype.swap16=function(){const i=this.length;if(i%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let o=0;oo&&(i+=" ... "),""},r&&(n.prototype[r]=n.prototype.inspect),n.prototype.compare=function(i,o,_,m,k){if(q(i,l)&&(i=n.from(i,i.offset,i.byteLength)),!n.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(o===void 0&&(o=0),_===void 0&&(_=i?i.length:0),m===void 0&&(m=0),k===void 0&&(k=this.length),o<0||_>i.length||m<0||k>this.length)throw new RangeError("out of range index");if(m>=k&&o>=_)return 0;if(m>=k)return-1;if(o>=_)return 1;if(o>>>=0,_>>>=0,m>>>=0,k>>>=0,this===i)return 0;let O=k-m,K=_-o;const ve=Math.min(O,K),be=this.slice(m,k),ue=i.slice(o,_);for(let pe=0;pe2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,A(o)&&(o=m?0:h.length-1),o<0&&(o=h.length+o),o>=h.length){if(m)return-1;o=h.length-1}else if(o<0)if(m)o=0;else return-1;if(typeof i=="string"&&(i=n.from(i,_)),n.isBuffer(i))return i.length===0?-1:re(h,i,o,_,m);if(typeof i=="number")return i=i&255,typeof l.prototype.indexOf=="function"?m?l.prototype.indexOf.call(h,i,o):l.prototype.lastIndexOf.call(h,i,o):re(h,[i],o,_,m);throw new TypeError("val must be string, number or Buffer")}function re(h,i,o,_,m){let k=1,O=h.length,K=i.length;if(_!==void 0&&(_=String(_).toLowerCase(),_==="ucs2"||_==="ucs-2"||_==="utf16le"||_==="utf-16le")){if(h.length<2||i.length<2)return-1;k=2,O/=2,K/=2,o/=2}function ve(ue,pe){return k===1?ue[pe]:ue.readUInt16BE(pe*k)}let be;if(m){let ue=-1;for(be=o;beO&&(o=O-K),be=o;be>=0;be--){let ue=!0;for(let pe=0;pem&&(_=m)):_=m;const k=i.length;_>k/2&&(_=k/2);let O;for(O=0;O<_;++O){const K=parseInt(i.substr(O*2,2),16);if(A(K))return O;h[o+O]=K}return O}function E(h,i,o,_){return R(Ye(i,h.length-o),h,o,_)}function U(h,i,o,_){return R(vt(i),h,o,_)}function G(h,i,o,_){return R(Xe(i),h,o,_)}function te(h,i,o,_){return R(lt(i,h.length-o),h,o,_)}n.prototype.write=function(i,o,_,m){if(o===void 0)m="utf8",_=this.length,o=0;else if(_===void 0&&typeof o=="string")m=o,_=this.length,o=0;else if(isFinite(o))o=o>>>0,isFinite(_)?(_=_>>>0,m===void 0&&(m="utf8")):(m=_,_=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const k=this.length-o;if((_===void 0||_>k)&&(_=k),i.length>0&&(_<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");m||(m="utf8");let O=!1;for(;;)switch(m){case"hex":return Y(this,i,o,_);case"utf8":case"utf-8":return E(this,i,o,_);case"ascii":case"latin1":case"binary":return U(this,i,o,_);case"base64":return G(this,i,o,_);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,i,o,_);default:if(O)throw new TypeError("Unknown encoding: "+m);m=(""+m).toLowerCase(),O=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function we(h,i,o){return i===0&&o===h.length?a.fromByteArray(h):a.fromByteArray(h.slice(i,o))}function he(h,i,o){o=Math.min(h.length,o);const _=[];let m=i;for(;m239?4:k>223?3:k>191?2:1;if(m+K<=o){let ve,be,ue,pe;switch(K){case 1:k<128&&(O=k);break;case 2:ve=h[m+1],(ve&192)===128&&(pe=(k&31)<<6|ve&63,pe>127&&(O=pe));break;case 3:ve=h[m+1],be=h[m+2],(ve&192)===128&&(be&192)===128&&(pe=(k&15)<<12|(ve&63)<<6|be&63,pe>2047&&(pe<55296||pe>57343)&&(O=pe));break;case 4:ve=h[m+1],be=h[m+2],ue=h[m+3],(ve&192)===128&&(be&192)===128&&(ue&192)===128&&(pe=(k&15)<<18|(ve&63)<<12|(be&63)<<6|ue&63,pe>65535&&pe<1114112&&(O=pe))}}O===null?(O=65533,K=1):O>65535&&(O-=65536,_.push(O>>>10&1023|55296),O=56320|O&1023),_.push(O),m+=K}return me(_)}const fe=4096;function me(h){const i=h.length;if(i<=fe)return String.fromCharCode.apply(String,h);let o="",_=0;for(;__)&&(o=_);let m="";for(let k=i;k_&&(i=_),o<0?(o+=_,o<0&&(o=0)):o>_&&(o=_),oo)throw new RangeError("Trying to access beyond buffer length")}n.prototype.readUintLE=n.prototype.readUIntLE=function(i,o,_){i=i>>>0,o=o>>>0,_||Q(i,o,this.length);let m=this[i],k=1,O=0;for(;++O>>0,o=o>>>0,_||Q(i,o,this.length);let m=this[i+--o],k=1;for(;o>0&&(k*=256);)m+=this[i+--o]*k;return m},n.prototype.readUint8=n.prototype.readUInt8=function(i,o){return i=i>>>0,o||Q(i,1,this.length),this[i]},n.prototype.readUint16LE=n.prototype.readUInt16LE=function(i,o){return i=i>>>0,o||Q(i,2,this.length),this[i]|this[i+1]<<8},n.prototype.readUint16BE=n.prototype.readUInt16BE=function(i,o){return i=i>>>0,o||Q(i,2,this.length),this[i]<<8|this[i+1]},n.prototype.readUint32LE=n.prototype.readUInt32LE=function(i,o){return i=i>>>0,o||Q(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+this[i+3]*16777216},n.prototype.readUint32BE=n.prototype.readUInt32BE=function(i,o){return i=i>>>0,o||Q(i,4,this.length),this[i]*16777216+(this[i+1]<<16|this[i+2]<<8|this[i+3])},n.prototype.readBigUInt64LE=ne(function(i){i=i>>>0,ee(i,"offset");const o=this[i],_=this[i+7];(o===void 0||_===void 0)&&_e(i,this.length-8);const m=o+this[++i]*2**8+this[++i]*2**16+this[++i]*2**24,k=this[++i]+this[++i]*2**8+this[++i]*2**16+_*2**24;return BigInt(m)+(BigInt(k)<>>0,ee(i,"offset");const o=this[i],_=this[i+7];(o===void 0||_===void 0)&&_e(i,this.length-8);const m=o*2**24+this[++i]*2**16+this[++i]*2**8+this[++i],k=this[++i]*2**24+this[++i]*2**16+this[++i]*2**8+_;return(BigInt(m)<>>0,o=o>>>0,_||Q(i,o,this.length);let m=this[i],k=1,O=0;for(;++O=k&&(m-=Math.pow(2,8*o)),m},n.prototype.readIntBE=function(i,o,_){i=i>>>0,o=o>>>0,_||Q(i,o,this.length);let m=o,k=1,O=this[i+--m];for(;m>0&&(k*=256);)O+=this[i+--m]*k;return k*=128,O>=k&&(O-=Math.pow(2,8*o)),O},n.prototype.readInt8=function(i,o){return i=i>>>0,o||Q(i,1,this.length),this[i]&128?(255-this[i]+1)*-1:this[i]},n.prototype.readInt16LE=function(i,o){i=i>>>0,o||Q(i,2,this.length);const _=this[i]|this[i+1]<<8;return _&32768?_|4294901760:_},n.prototype.readInt16BE=function(i,o){i=i>>>0,o||Q(i,2,this.length);const _=this[i+1]|this[i]<<8;return _&32768?_|4294901760:_},n.prototype.readInt32LE=function(i,o){return i=i>>>0,o||Q(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24},n.prototype.readInt32BE=function(i,o){return i=i>>>0,o||Q(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]},n.prototype.readBigInt64LE=ne(function(i){i=i>>>0,ee(i,"offset");const o=this[i],_=this[i+7];(o===void 0||_===void 0)&&_e(i,this.length-8);const m=this[i+4]+this[i+5]*2**8+this[i+6]*2**16+(_<<24);return(BigInt(m)<>>0,ee(i,"offset");const o=this[i],_=this[i+7];(o===void 0||_===void 0)&&_e(i,this.length-8);const m=(o<<24)+this[++i]*2**16+this[++i]*2**8+this[++i];return(BigInt(m)<>>0,o||Q(i,4,this.length),t.read(this,i,!0,23,4)},n.prototype.readFloatBE=function(i,o){return i=i>>>0,o||Q(i,4,this.length),t.read(this,i,!1,23,4)},n.prototype.readDoubleLE=function(i,o){return i=i>>>0,o||Q(i,8,this.length),t.read(this,i,!0,52,8)},n.prototype.readDoubleBE=function(i,o){return i=i>>>0,o||Q(i,8,this.length),t.read(this,i,!1,52,8)};function ae(h,i,o,_,m,k){if(!n.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(i>m||ih.length)throw new RangeError("Index out of range")}n.prototype.writeUintLE=n.prototype.writeUIntLE=function(i,o,_,m){if(i=+i,o=o>>>0,_=_>>>0,!m){const K=Math.pow(2,8*_)-1;ae(this,i,o,_,K,0)}let k=1,O=0;for(this[o]=i&255;++O<_&&(k*=256);)this[o+O]=i/k&255;return o+_},n.prototype.writeUintBE=n.prototype.writeUIntBE=function(i,o,_,m){if(i=+i,o=o>>>0,_=_>>>0,!m){const K=Math.pow(2,8*_)-1;ae(this,i,o,_,K,0)}let k=_-1,O=1;for(this[o+k]=i&255;--k>=0&&(O*=256);)this[o+k]=i/O&255;return o+_},n.prototype.writeUint8=n.prototype.writeUInt8=function(i,o,_){return i=+i,o=o>>>0,_||ae(this,i,o,1,255,0),this[o]=i&255,o+1},n.prototype.writeUint16LE=n.prototype.writeUInt16LE=function(i,o,_){return i=+i,o=o>>>0,_||ae(this,i,o,2,65535,0),this[o]=i&255,this[o+1]=i>>>8,o+2},n.prototype.writeUint16BE=n.prototype.writeUInt16BE=function(i,o,_){return i=+i,o=o>>>0,_||ae(this,i,o,2,65535,0),this[o]=i>>>8,this[o+1]=i&255,o+2},n.prototype.writeUint32LE=n.prototype.writeUInt32LE=function(i,o,_){return i=+i,o=o>>>0,_||ae(this,i,o,4,4294967295,0),this[o+3]=i>>>24,this[o+2]=i>>>16,this[o+1]=i>>>8,this[o]=i&255,o+4},n.prototype.writeUint32BE=n.prototype.writeUInt32BE=function(i,o,_){return i=+i,o=o>>>0,_||ae(this,i,o,4,4294967295,0),this[o]=i>>>24,this[o+1]=i>>>16,this[o+2]=i>>>8,this[o+3]=i&255,o+4};function C(h,i,o,_,m){ce(i,_,m,h,o,7);let k=Number(i&BigInt(4294967295));h[o++]=k,k=k>>8,h[o++]=k,k=k>>8,h[o++]=k,k=k>>8,h[o++]=k;let O=Number(i>>BigInt(32)&BigInt(4294967295));return h[o++]=O,O=O>>8,h[o++]=O,O=O>>8,h[o++]=O,O=O>>8,h[o++]=O,o}function T(h,i,o,_,m){ce(i,_,m,h,o,7);let k=Number(i&BigInt(4294967295));h[o+7]=k,k=k>>8,h[o+6]=k,k=k>>8,h[o+5]=k,k=k>>8,h[o+4]=k;let O=Number(i>>BigInt(32)&BigInt(4294967295));return h[o+3]=O,O=O>>8,h[o+2]=O,O=O>>8,h[o+1]=O,O=O>>8,h[o]=O,o+8}n.prototype.writeBigUInt64LE=ne(function(i,o=0){return C(this,i,o,BigInt(0),BigInt("0xffffffffffffffff"))}),n.prototype.writeBigUInt64BE=ne(function(i,o=0){return T(this,i,o,BigInt(0),BigInt("0xffffffffffffffff"))}),n.prototype.writeIntLE=function(i,o,_,m){if(i=+i,o=o>>>0,!m){const ve=Math.pow(2,8*_-1);ae(this,i,o,_,ve-1,-ve)}let k=0,O=1,K=0;for(this[o]=i&255;++k<_&&(O*=256);)i<0&&K===0&&this[o+k-1]!==0&&(K=1),this[o+k]=(i/O>>0)-K&255;return o+_},n.prototype.writeIntBE=function(i,o,_,m){if(i=+i,o=o>>>0,!m){const ve=Math.pow(2,8*_-1);ae(this,i,o,_,ve-1,-ve)}let k=_-1,O=1,K=0;for(this[o+k]=i&255;--k>=0&&(O*=256);)i<0&&K===0&&this[o+k+1]!==0&&(K=1),this[o+k]=(i/O>>0)-K&255;return o+_},n.prototype.writeInt8=function(i,o,_){return i=+i,o=o>>>0,_||ae(this,i,o,1,127,-128),i<0&&(i=255+i+1),this[o]=i&255,o+1},n.prototype.writeInt16LE=function(i,o,_){return i=+i,o=o>>>0,_||ae(this,i,o,2,32767,-32768),this[o]=i&255,this[o+1]=i>>>8,o+2},n.prototype.writeInt16BE=function(i,o,_){return i=+i,o=o>>>0,_||ae(this,i,o,2,32767,-32768),this[o]=i>>>8,this[o+1]=i&255,o+2},n.prototype.writeInt32LE=function(i,o,_){return i=+i,o=o>>>0,_||ae(this,i,o,4,2147483647,-2147483648),this[o]=i&255,this[o+1]=i>>>8,this[o+2]=i>>>16,this[o+3]=i>>>24,o+4},n.prototype.writeInt32BE=function(i,o,_){return i=+i,o=o>>>0,_||ae(this,i,o,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[o]=i>>>24,this[o+1]=i>>>16,this[o+2]=i>>>8,this[o+3]=i&255,o+4},n.prototype.writeBigInt64LE=ne(function(i,o=0){return C(this,i,o,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),n.prototype.writeBigInt64BE=ne(function(i,o=0){return T(this,i,o,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function P(h,i,o,_,m,k){if(o+_>h.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function W(h,i,o,_,m){return i=+i,o=o>>>0,m||P(h,i,o,4),t.write(h,i,o,_,23,4),o+4}n.prototype.writeFloatLE=function(i,o,_){return W(this,i,o,!0,_)},n.prototype.writeFloatBE=function(i,o,_){return W(this,i,o,!1,_)};function V(h,i,o,_,m){return i=+i,o=o>>>0,m||P(h,i,o,8),t.write(h,i,o,_,52,8),o+8}n.prototype.writeDoubleLE=function(i,o,_){return V(this,i,o,!0,_)},n.prototype.writeDoubleBE=function(i,o,_){return V(this,i,o,!1,_)},n.prototype.copy=function(i,o,_,m){if(!n.isBuffer(i))throw new TypeError("argument should be a Buffer");if(_||(_=0),!m&&m!==0&&(m=this.length),o>=i.length&&(o=i.length),o||(o=0),m>0&&m<_&&(m=_),m===_||i.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(_<0||_>=this.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("sourceEnd out of bounds");m>this.length&&(m=this.length),i.length-o>>0,_=_===void 0?this.length:_>>>0,i||(i=0);let k;if(typeof i=="number")for(k=o;k<_;++k)this[k]=i;else{const O=n.isBuffer(i)?i:n.from(i,m),K=O.length;if(K===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(k=0;k<_-o;++k)this[k+o]=O[k%K]}return this};const p={};function g(h,i,o){p[h]=class extends o{constructor(){super(),Object.defineProperty(this,"message",{value:i.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${h}]`,this.stack,delete this.name}get code(){return h}set code(m){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:m,writable:!0})}toString(){return`${this.name} [${h}]: ${this.message}`}}}g("ERR_BUFFER_OUT_OF_BOUNDS",function(h){return h?`${h} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),g("ERR_INVALID_ARG_TYPE",function(h,i){return`The "${h}" argument must be of type number. Received type ${typeof i}`},TypeError),g("ERR_OUT_OF_RANGE",function(h,i,o){let _=`The value of "${h}" is out of range.`,m=o;return Number.isInteger(o)&&Math.abs(o)>2**32?m=M(String(o)):typeof o=="bigint"&&(m=String(o),(o>BigInt(2)**BigInt(32)||o<-(BigInt(2)**BigInt(32)))&&(m=M(m)),m+="n"),_+=` It must be ${i}. Received ${m}`,_},RangeError);function M(h){let i="",o=h.length;const _=h[0]==="-"?1:0;for(;o>=_+4;o-=3)i=`_${h.slice(o-3,o)}${i}`;return`${h.slice(0,o)}${i}`}function j(h,i,o){ee(i,"offset"),(h[i]===void 0||h[i+o]===void 0)&&_e(i,h.length-(o+1))}function ce(h,i,o,_,m,k){if(h>o||h3?i===0||i===BigInt(0)?K=`>= 0${O} and < 2${O} ** ${(k+1)*8}${O}`:K=`>= -(2${O} ** ${(k+1)*8-1}${O}) and < 2 ** ${(k+1)*8-1}${O}`:K=`>= ${i}${O} and <= ${o}${O}`,new p.ERR_OUT_OF_RANGE("value",K,h)}j(_,m,k)}function ee(h,i){if(typeof h!="number")throw new p.ERR_INVALID_ARG_TYPE(i,"number",h)}function _e(h,i,o){throw Math.floor(h)!==h?(ee(h,o),new p.ERR_OUT_OF_RANGE(o||"offset","an integer",h)):i<0?new p.ERR_BUFFER_OUT_OF_BOUNDS:new p.ERR_OUT_OF_RANGE(o||"offset",`>= ${o?1:0} and <= ${i}`,h)}const Oe=/[^+/0-9A-Za-z-_]/g;function Ke(h){if(h=h.split("=")[0],h=h.trim().replace(Oe,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function Ye(h,i){i=i||1/0;let o;const _=h.length;let m=null;const k=[];for(let O=0;O<_;++O){if(o=h.charCodeAt(O),o>55295&&o<57344){if(!m){if(o>56319){(i-=3)>-1&&k.push(239,191,189);continue}else if(O+1===_){(i-=3)>-1&&k.push(239,191,189);continue}m=o;continue}if(o<56320){(i-=3)>-1&&k.push(239,191,189),m=o;continue}o=(m-55296<<10|o-56320)+65536}else m&&(i-=3)>-1&&k.push(239,191,189);if(m=null,o<128){if((i-=1)<0)break;k.push(o)}else if(o<2048){if((i-=2)<0)break;k.push(o>>6|192,o&63|128)}else if(o<65536){if((i-=3)<0)break;k.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((i-=4)<0)break;k.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return k}function vt(h){const i=[];for(let o=0;o>8,m=o%256,k.push(m),k.push(_);return k}function Xe(h){return a.toByteArray(Ke(h))}function R(h,i,o,_){let m;for(m=0;m<_&&!(m+o>=i.length||m>=h.length);++m)i[m+o]=h[m];return m}function q(h,i){return h instanceof i||h!=null&&h.constructor!=null&&h.constructor.name!=null&&h.constructor.name===i.name}function A(h){return h!==h}const J=function(){const h="0123456789abcdef",i=new Array(256);for(let o=0;o<16;++o){const _=o*16;for(let m=0;m<16;++m)i[_+m]=h[o]+h[m]}return i}();function ne(h){return typeof BigInt>"u"?xe:h}function xe(){throw new Error("BigInt not supported")}})(Tn);const rt=Tn.Buffer;var dr,hi;function An(){return hi||(hi=1,dr=ti.EventEmitter),dr}var _r,ci;function Ca(){if(ci)return _r;ci=1;function e(I,F){var S=Object.keys(I);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(I);F&&(w=w.filter(function(x){return Object.getOwnPropertyDescriptor(I,x).enumerable})),S.push.apply(S,w)}return S}function a(I){for(var F=1;F0?this.tail.next=w:this.head=w,this.tail=w,++this.length}},{key:"unshift",value:function(S){var w={data:S,next:this.head};this.length===0&&(this.tail=w),this.head=w,++this.length}},{key:"shift",value:function(){if(this.length!==0){var S=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,S}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(S){if(this.length===0)return"";for(var w=this.head,x=""+w.data;w=w.next;)x+=S+w.data;return x}},{key:"concat",value:function(S){if(this.length===0)return f.alloc(0);for(var w=f.allocUnsafe(S>>>0),x=this.head,N=0;x;)y(x.data,w,N),N+=x.data.length,x=x.next;return w}},{key:"consume",value:function(S,w){var x;return SB.length?B.length:S;if(L===B.length?N+=B:N+=B.slice(0,S),S-=L,S===0){L===B.length?(++x,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=B.slice(L));break}++x}return this.length-=x,N}},{key:"_getBuffer",value:function(S){var w=f.allocUnsafe(S),x=this.head,N=1;for(x.data.copy(w),S-=x.data.length;x=x.next;){var B=x.data,L=S>B.length?B.length:S;if(B.copy(w,w.length-S,0,L),S-=L,S===0){L===B.length?(++N,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=B.slice(L));break}++N}return this.length-=N,w}},{key:b,value:function(S,w){return d(this,a(a({},w),{},{depth:0,customInspect:!1}))}}]),I}(),_r}var pr,di;function In(){if(di)return pr;di=1;function e(u,s){var v=this,f=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return f||n?(s?s(u):u&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,se.nextTick(c,this,u)):se.nextTick(c,this,u)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(u||null,function(d){!s&&d?v._writableState?v._writableState.errorEmitted?se.nextTick(t,v):(v._writableState.errorEmitted=!0,se.nextTick(a,v,d)):se.nextTick(a,v,d):s?(se.nextTick(t,v),s(d)):se.nextTick(t,v)}),this)}function a(u,s){c(u,s),t(u)}function t(u){u._writableState&&!u._writableState.emitClose||u._readableState&&!u._readableState.emitClose||u.emit("close")}function r(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function c(u,s){u.emit("error",s)}function l(u,s){var v=u._readableState,f=u._writableState;v&&v.autoDestroy||f&&f.autoDestroy?u.destroy(s):u.emit("error",s)}return pr={destroy:e,undestroy:r,errorOrDestroy:l},pr}var vr={},_i;function St(){if(_i)return vr;_i=1;function e(s,v){s.prototype=Object.create(v.prototype),s.prototype.constructor=s,s.__proto__=v}var a={};function t(s,v,f){f||(f=Error);function n(b,y,I){return typeof v=="string"?v:v(b,y,I)}var d=function(b){e(y,b);function y(I,F,S){return b.call(this,n(I,F,S))||this}return y}(f);d.prototype.name=f.name,d.prototype.code=s,a[s]=d}function r(s,v){if(Array.isArray(s)){var f=s.length;return s=s.map(function(n){return String(n)}),f>2?"one of ".concat(v," ").concat(s.slice(0,f-1).join(", "),", or ")+s[f-1]:f===2?"one of ".concat(v," ").concat(s[0]," or ").concat(s[1]):"of ".concat(v," ").concat(s[0])}else return"of ".concat(v," ").concat(String(s))}function c(s,v,f){return s.substr(!f||f<0?0:+f,v.length)===v}function l(s,v,f){return(f===void 0||f>s.length)&&(f=s.length),s.substring(f-v.length,f)===v}function u(s,v,f){return typeof f!="number"&&(f=0),f+v.length>s.length?!1:s.indexOf(v,f)!==-1}return t("ERR_INVALID_OPT_VALUE",function(s,v){return'The value "'+v+'" is invalid for option "'+s+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(s,v,f){var n;typeof v=="string"&&c(v,"not ")?(n="must not be",v=v.replace(/^not /,"")):n="must be";var d;if(l(s," argument"))d="The ".concat(s," ").concat(n," ").concat(r(v,"type"));else{var b=u(s,".")?"property":"argument";d='The "'.concat(s,'" ').concat(b," ").concat(n," ").concat(r(v,"type"))}return d+=". Received type ".concat(typeof f),d},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),vr.codes=a,vr}var gr,pi;function Cn(){if(pi)return gr;pi=1;var e=St().codes.ERR_INVALID_OPT_VALUE;function a(r,c,l){return r.highWaterMark!=null?r.highWaterMark:c?r[l]:null}function t(r,c,l,u){var s=a(c,u,l);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var v=u?l:"highWaterMark";throw new e(v,s)}return Math.floor(s)}return r.objectMode?16:16*1024}return gr={getHighWaterMark:t},gr}var wr,vi;function ii(){if(vi)return wr;vi=1,wr=Z;function e(C){var T=this;this.next=null,this.entry=null,this.finish=function(){ae(T,C)}}var a;Z.WritableState=z;var t={deprecate:ya()},r=An(),c=Rt.Buffer,l=(typeof Ee<"u"?Ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u(C){return c.from(C)}function s(C){return c.isBuffer(C)||C instanceof l}var v=In(),f=Cn(),n=f.getHighWaterMark,d=St().codes,b=d.ERR_INVALID_ARG_TYPE,y=d.ERR_METHOD_NOT_IMPLEMENTED,I=d.ERR_MULTIPLE_CALLBACK,F=d.ERR_STREAM_CANNOT_PIPE,S=d.ERR_STREAM_DESTROYED,w=d.ERR_STREAM_NULL_VALUES,x=d.ERR_STREAM_WRITE_AFTER_END,N=d.ERR_UNKNOWN_ENCODING,B=v.errorOrDestroy;ft(Z,r);function L(){}function z(C,T,P){a=a||ht(),C=C||{},typeof P!="boolean"&&(P=T instanceof a),this.objectMode=!!C.objectMode,P&&(this.objectMode=this.objectMode||!!C.writableObjectMode),this.highWaterMark=n(this,C,"writableHighWaterMark",P),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var W=C.decodeStrings===!1;this.decodeStrings=!W,this.defaultEncoding=C.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(V){we(T,V)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=C.emitClose!==!1,this.autoDestroy=!!C.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}z.prototype.getBuffer=function(){for(var T=this.bufferedRequest,P=[];T;)P.push(T),T=T.next;return P},function(){try{Object.defineProperty(z.prototype,"buffer",{get:t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var $;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?($=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z,Symbol.hasInstance,{value:function(T){return $.call(this,T)?!0:this!==Z?!1:T&&T._writableState instanceof z}})):$=function(T){return T instanceof this};function Z(C){a=a||ht();var T=this instanceof a;if(!T&&!$.call(Z,this))return new Z(C);this._writableState=new z(C,this,T),this.writable=!0,C&&(typeof C.write=="function"&&(this._write=C.write),typeof C.writev=="function"&&(this._writev=C.writev),typeof C.destroy=="function"&&(this._destroy=C.destroy),typeof C.final=="function"&&(this._final=C.final)),r.call(this)}Z.prototype.pipe=function(){B(this,new F)};function D(C,T){var P=new x;B(C,P),se.nextTick(T,P)}function re(C,T,P,W){var V;return P===null?V=new w:typeof P!="string"&&!T.objectMode&&(V=new b("chunk",["string","Buffer"],P)),V?(B(C,V),se.nextTick(W,V),!1):!0}Z.prototype.write=function(C,T,P){var W=this._writableState,V=!1,p=!W.objectMode&&s(C);return p&&!c.isBuffer(C)&&(C=u(C)),typeof T=="function"&&(P=T,T=null),p?T="buffer":T||(T=W.defaultEncoding),typeof P!="function"&&(P=L),W.ending?D(this,P):(p||re(this,W,C,P))&&(W.pendingcb++,V=E(this,W,p,C,T,P)),V},Z.prototype.cork=function(){this._writableState.corked++},Z.prototype.uncork=function(){var C=this._writableState;C.corked&&(C.corked--,!C.writing&&!C.corked&&!C.bufferProcessing&&C.bufferedRequest&&me(this,C))},Z.prototype.setDefaultEncoding=function(T){if(typeof T=="string"&&(T=T.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((T+"").toLowerCase())>-1))throw new N(T);return this._writableState.defaultEncoding=T,this},Object.defineProperty(Z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Y(C,T,P){return!C.objectMode&&C.decodeStrings!==!1&&typeof T=="string"&&(T=c.from(T,P)),T}Object.defineProperty(Z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function E(C,T,P,W,V,p){if(!P){var g=Y(T,W,V);W!==g&&(P=!0,V="buffer",W=g)}var M=T.objectMode?1:W.length;T.length+=M;var j=T.length */var wi;function Fa(){return wi||(wi=1,function(e,a){var t=Rt,r=t.Buffer;function c(u,s){for(var v in u)s[v]=u[v]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=t:(c(t,a),a.Buffer=l);function l(u,s,v){return r(u,s,v)}l.prototype=Object.create(r.prototype),c(r,l),l.from=function(u,s,v){if(typeof u=="number")throw new TypeError("Argument must not be a number");return r(u,s,v)},l.alloc=function(u,s,v){if(typeof u!="number")throw new TypeError("Argument must be a number");var f=r(u);return s!==void 0?typeof v=="string"?f.fill(s,v):f.fill(s):f.fill(0),f},l.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r(u)},l.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(u)}}(Ht,Ht.exports)),Ht.exports}var bi;function yi(){if(bi)return yr;bi=1;var e=Fa().Buffer,a=e.isEncoding||function(w){switch(w=""+w,w&&w.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(w){if(!w)return"utf8";for(var x;;)switch(w){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return w;default:if(x)return;w=(""+w).toLowerCase(),x=!0}}function r(w){var x=t(w);if(typeof x!="string"&&(e.isEncoding===a||!a(w)))throw new Error("Unknown encoding: "+w);return x||w}yr.StringDecoder=c;function c(w){this.encoding=r(w);var x;switch(this.encoding){case"utf16le":this.text=d,this.end=b,x=4;break;case"utf8":this.fillLast=v,x=4;break;case"base64":this.text=y,this.end=I,x=3;break;default:this.write=F,this.end=S;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(x)}c.prototype.write=function(w){if(w.length===0)return"";var x,N;if(this.lastNeed){if(x=this.fillLast(w),x===void 0)return"";N=this.lastNeed,this.lastNeed=0}else N=0;return N>5===6?2:w>>4===14?3:w>>3===30?4:w>>6===2?-1:-2}function u(w,x,N){var B=x.length-1;if(B=0?(L>0&&(w.lastNeed=L-1),L):--B=0?(L>0&&(w.lastNeed=L-2),L):--B=0?(L>0&&(L===2?L=0:w.lastNeed=L-3),L):0))}function s(w,x,N){if((x[0]&192)!==128)return w.lastNeed=0,"�";if(w.lastNeed>1&&x.length>1){if((x[1]&192)!==128)return w.lastNeed=1,"�";if(w.lastNeed>2&&x.length>2&&(x[2]&192)!==128)return w.lastNeed=2,"�"}}function v(w){var x=this.lastTotal-this.lastNeed,N=s(this,w);if(N!==void 0)return N;if(this.lastNeed<=w.length)return w.copy(this.lastChar,x,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);w.copy(this.lastChar,x,0,w.length),this.lastNeed-=w.length}function f(w,x){var N=u(this,w,x);if(!this.lastNeed)return w.toString("utf8",x);this.lastTotal=N;var B=w.length-(N-this.lastNeed);return w.copy(this.lastChar,0,B),w.toString("utf8",x,B)}function n(w){var x=w&&w.length?this.write(w):"";return this.lastNeed?x+"�":x}function d(w,x){if((w.length-x)%2===0){var N=w.toString("utf16le",x);if(N){var B=N.charCodeAt(N.length-1);if(B>=55296&&B<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1],N.slice(0,-1)}return N}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=w[w.length-1],w.toString("utf16le",x,w.length-1)}function b(w){var x=w&&w.length?this.write(w):"";if(this.lastNeed){var N=this.lastTotal-this.lastNeed;return x+this.lastChar.toString("utf16le",0,N)}return x}function y(w,x){var N=(w.length-x)%3;return N===0?w.toString("base64",x):(this.lastNeed=3-N,this.lastTotal=3,N===1?this.lastChar[0]=w[w.length-1]:(this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1]),w.toString("base64",x,w.length-N))}function I(w){var x=w&&w.length?this.write(w):"";return this.lastNeed?x+this.lastChar.toString("base64",0,3-this.lastNeed):x}function F(w){return w.toString(this.encoding)}function S(w){return w&&w.length?this.write(w):""}return yr}var mr,mi;function ar(){if(mi)return mr;mi=1;var e=St().codes.ERR_STREAM_PREMATURE_CLOSE;function a(l){var u=!1;return function(){if(!u){u=!0;for(var s=arguments.length,v=new Array(s),f=0;f0)if(typeof g!="string"&&!ee.objectMode&&Object.getPrototypeOf(g)!==r.prototype&&(g=l(g)),j)ee.endEmitted?L(p,new w):Y(p,ee,g,!0);else if(ee.ended)L(p,new F);else{if(ee.destroyed)return!1;ee.reading=!1,ee.decoder&&!M?(g=ee.decoder.write(g),ee.objectMode||g.length!==0?Y(p,ee,g,!1):me(p,ee)):Y(p,ee,g,!1)}else j||(ee.reading=!1,me(p,ee))}return!ee.ended&&(ee.length=U?p=U:(p--,p|=p>>>1,p|=p>>>2,p|=p>>>4,p|=p>>>8,p|=p>>>16,p++),p}function te(p,g){return p<=0||g.length===0&&g.ended?0:g.objectMode?1:p!==p?g.flowing&&g.length?g.buffer.head.data.length:g.length:(p>g.highWaterMark&&(g.highWaterMark=G(p)),p<=g.length?p:g.ended?g.length:(g.needReadable=!0,0))}D.prototype.read=function(p){v("read",p),p=parseInt(p,10);var g=this._readableState,M=p;if(p!==0&&(g.emittedReadable=!1),p===0&&g.needReadable&&((g.highWaterMark!==0?g.length>=g.highWaterMark:g.length>0)||g.ended))return v("read: emitReadable",g.length,g.ended),g.length===0&&g.ended?P(this):he(this),null;if(p=te(p,g),p===0&&g.ended)return g.length===0&&P(this),null;var j=g.needReadable;v("need readable",j),(g.length===0||g.length-p0?ce=T(p,g):ce=null,ce===null?(g.needReadable=g.length<=g.highWaterMark,p=0):(g.length-=p,g.awaitDrain=0),g.length===0&&(g.ended||(g.needReadable=!0),M!==p&&g.ended&&P(this)),ce!==null&&this.emit("data",ce),ce};function we(p,g){if(v("onEofChunk"),!g.ended){if(g.decoder){var M=g.decoder.end();M&&M.length&&(g.buffer.push(M),g.length+=g.objectMode?1:M.length)}g.ended=!0,g.sync?he(p):(g.needReadable=!1,g.emittedReadable||(g.emittedReadable=!0,fe(p)))}}function he(p){var g=p._readableState;v("emitReadable",g.needReadable,g.emittedReadable),g.needReadable=!1,g.emittedReadable||(v("emitReadable",g.flowing),g.emittedReadable=!0,se.nextTick(fe,p))}function fe(p){var g=p._readableState;v("emitReadable_",g.destroyed,g.length,g.ended),!g.destroyed&&(g.length||g.ended)&&(p.emit("readable"),g.emittedReadable=!1),g.needReadable=!g.flowing&&!g.ended&&g.length<=g.highWaterMark,C(p)}function me(p,g){g.readingMore||(g.readingMore=!0,se.nextTick(H,p,g))}function H(p,g){for(;!g.reading&&!g.ended&&(g.length1&&V(j.pipes,p)!==-1)&&!Ye&&(v("false write response, pause",j.awaitDrain),j.awaitDrain++),M.pause())}function Xe(J){v("onerror",J),A(),p.removeListener("error",Xe),a(p,"error")===0&&L(p,J)}$(p,"error",Xe);function R(){p.removeListener("finish",q),A()}p.once("close",R);function q(){v("onfinish"),p.removeListener("close",R),A()}p.once("finish",q);function A(){v("unpipe"),M.unpipe(p)}return p.emit("pipe",M),j.flowing||(v("pipe resume"),M.resume()),p};function X(p){return function(){var M=p._readableState;v("pipeOnDrain",M.awaitDrain),M.awaitDrain&&M.awaitDrain--,M.awaitDrain===0&&a(p,"data")&&(M.flowing=!0,C(p))}}D.prototype.unpipe=function(p){var g=this._readableState,M={hasUnpiped:!1};if(g.pipesCount===0)return this;if(g.pipesCount===1)return p&&p!==g.pipes?this:(p||(p=g.pipes),g.pipes=null,g.pipesCount=0,g.flowing=!1,p&&p.emit("unpipe",this,M),this);if(!p){var j=g.pipes,ce=g.pipesCount;g.pipes=null,g.pipesCount=0,g.flowing=!1;for(var ee=0;ee0,j.flowing!==!1&&this.resume()):p==="readable"&&!j.endEmitted&&!j.readableListening&&(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,v("on readable",j.length,j.reading),j.length?he(this):j.reading||se.nextTick(le,this)),M},D.prototype.addListener=D.prototype.on,D.prototype.removeListener=function(p,g){var M=t.prototype.removeListener.call(this,p,g);return p==="readable"&&se.nextTick(ie,this),M},D.prototype.removeAllListeners=function(p){var g=t.prototype.removeAllListeners.apply(this,arguments);return(p==="readable"||p===void 0)&&se.nextTick(ie,this),g};function ie(p){var g=p._readableState;g.readableListening=p.listenerCount("readable")>0,g.resumeScheduled&&!g.paused?g.flowing=!0:p.listenerCount("data")>0&&p.resume()}function le(p){v("readable nexttick read 0"),p.read(0)}D.prototype.resume=function(){var p=this._readableState;return p.flowing||(v("resume"),p.flowing=!p.readableListening,Q(this,p)),p.paused=!1,this};function Q(p,g){g.resumeScheduled||(g.resumeScheduled=!0,se.nextTick(ae,p,g))}function ae(p,g){v("resume",g.reading),g.reading||p.read(0),g.resumeScheduled=!1,p.emit("resume"),C(p),g.flowing&&!g.reading&&p.read(0)}D.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function C(p){var g=p._readableState;for(v("flow",g.flowing);g.flowing&&p.read()!==null;);}D.prototype.wrap=function(p){var g=this,M=this._readableState,j=!1;p.on("end",function(){if(v("wrapped end"),M.decoder&&!M.ended){var _e=M.decoder.end();_e&&_e.length&&g.push(_e)}g.push(null)}),p.on("data",function(_e){if(v("wrapped data"),M.decoder&&(_e=M.decoder.write(_e)),!(M.objectMode&&_e==null)&&!(!M.objectMode&&(!_e||!_e.length))){var Oe=g.push(_e);Oe||(j=!0,p.pause())}});for(var ce in p)this[ce]===void 0&&typeof p[ce]=="function"&&(this[ce]=function(Oe){return function(){return p[Oe].apply(p,arguments)}}(ce));for(var ee=0;ee=g.length?(g.decoder?M=g.buffer.join(""):g.buffer.length===1?M=g.buffer.first():M=g.buffer.concat(g.length),g.buffer.clear()):M=g.buffer.consume(p,g.decoder),M}function P(p){var g=p._readableState;v("endReadable",g.endEmitted),g.endEmitted||(g.ended=!0,se.nextTick(W,g,p))}function W(p,g){if(v("endReadableNT",p.endEmitted,p.length),!p.endEmitted&&p.length===0&&(p.endEmitted=!0,g.readable=!1,g.emit("end"),p.autoDestroy)){var M=g._writableState;(!M||M.autoDestroy&&M.finished)&&g.destroy()}}typeof Symbol=="function"&&(D.from=function(p,g){return B===void 0&&(B=ka()),B(D,p,g)});function V(p,g){for(var M=0,j=p.length;M0;return s(x,B,L,function(z){S||(S=z),z&&w.forEach(v),!B&&(w.forEach(v),F(S))})});return y.reduce(f)}return Ar=d,Ar}var Ba=Be,oi=ti.EventEmitter,Na=ft;Na(Be,oi);Be.Readable=ni();Be.Writable=ii();Be.Duplex=ht();Be.Transform=ai();Be.PassThrough=Fn();Be.finished=ar();Be.pipeline=Ln();Be.Stream=Be;function Be(){oi.call(this)}Be.prototype.pipe=function(e,a){var t=this;function r(n){e.writable&&e.write(n)===!1&&t.pause&&t.pause()}t.on("data",r);function c(){t.readable&&t.resume&&t.resume()}e.on("drain",c),!e._isStdio&&(!a||a.end!==!1)&&(t.on("end",u),t.on("close",s));var l=!1;function u(){l||(l=!0,e.end())}function s(){l||(l=!0,typeof e.destroy=="function"&&e.destroy())}function v(n){if(f(),oi.listenerCount(this,"error")===0)throw n}t.on("error",v),e.on("error",v);function f(){t.removeListener("data",r),e.removeListener("drain",c),t.removeListener("end",u),t.removeListener("close",s),t.removeListener("error",v),e.removeListener("error",v),t.removeListener("end",f),t.removeListener("close",f),e.removeListener("close",f)}return t.on("end",f),t.on("close",f),e.on("close",f),e.emit("pipe",t),e};var Wr={exports:{}},Ir,Ii;function Oa(){if(Ii)return Ir;Ii=1;var e=1e3,a=e*60,t=a*60,r=t*24,c=r*7,l=r*365.25;Ir=function(n,d){d=d||{};var b=typeof n;if(b==="string"&&n.length>0)return u(n);if(b==="number"&&isFinite(n))return d.long?v(n):s(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function u(n){if(n=String(n),!(n.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(d){var b=parseFloat(d[1]),y=(d[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return b*l;case"weeks":case"week":case"w":return b*c;case"days":case"day":case"d":return b*r;case"hours":case"hour":case"hrs":case"hr":case"h":return b*t;case"minutes":case"minute":case"mins":case"min":case"m":return b*a;case"seconds":case"second":case"secs":case"sec":case"s":return b*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function s(n){var d=Math.abs(n);return d>=r?Math.round(n/r)+"d":d>=t?Math.round(n/t)+"h":d>=a?Math.round(n/a)+"m":d>=e?Math.round(n/e)+"s":n+"ms"}function v(n){var d=Math.abs(n);return d>=r?f(n,d,r,"day"):d>=t?f(n,d,t,"hour"):d>=a?f(n,d,a,"minute"):d>=e?f(n,d,e,"second"):n+" ms"}function f(n,d,b,y){var I=d>=b*1.5;return Math.round(n/b)+" "+y+(I?"s":"")}return Ir}function Ma(e){t.debug=t,t.default=t,t.coerce=v,t.disable=l,t.enable=c,t.enabled=u,t.humanize=Oa(),t.destroy=f,Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={};function a(n){let d=0;for(let b=0;b{if(z==="%%")return"%";B++;const Z=t.formatters[$];if(typeof Z=="function"){const D=S[B];z=Z.call(w,D),S.splice(B,1),B--}return z}),t.formatArgs.call(w,S),(w.log||t.log).apply(w,S)}return F.namespace=n,F.useColors=t.useColors(),F.color=t.selectColor(n),F.extend=r,F.destroy=t.destroy,Object.defineProperty(F,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(y!==t.namespaces&&(y=t.namespaces,I=t.enabled(n)),I),set:S=>{b=S}}),typeof t.init=="function"&&t.init(F),F}function r(n,d){const b=t(this.namespace+(typeof d>"u"?":":d)+n);return b.log=this.log,b}function c(n){t.save(n),t.namespaces=n,t.names=[],t.skips=[];let d;const b=(typeof n=="string"?n:"").split(/[\s,]+/),y=b.length;for(d=0;d"-"+d)].join(",");return t.enable(""),n}function u(n){if(n[n.length-1]==="*")return!0;let d,b;for(d=0,b=t.skips.length;d{let f=!1;return()=>{f||(f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function c(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;f.splice(1,0,n,"color: inherit");let d=0,b=0;f[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(d++,y==="%c"&&(b=d))}),f.splice(b,0,n)}a.log=console.debug||console.log||(()=>{});function l(f){try{f?a.storage.setItem("debug",f):a.storage.removeItem("debug")}catch{}}function u(){let f;try{f=a.storage.getItem("debug")}catch{}return!f&&typeof se<"u"&&"env"in se&&(f=t.DEBUG),f}function s(){try{return localStorage}catch{}}e.exports=Da(a);const{formatters:v}=e.exports;v.j=function(f){try{return JSON.stringify(f)}catch(n){return"[UnexpectedJSONParseError]: "+n.message}}})(Wr,Wr.exports);var Ua=Wr.exports;const Pf=ba(Ua);var kn={exports:{}},Cr={},Fr={exports:{}},Lr={},Ci;function Bn(){return Ci||(Ci=1,function(e){e.fetch=c(Ee.fetch)&&c(Ee.ReadableStream),e.writableStream=c(Ee.WritableStream),e.abortController=c(Ee.AbortController);var a;function t(){if(a!==void 0)return a;if(Ee.XMLHttpRequest){a=new Ee.XMLHttpRequest;try{a.open("GET",Ee.XDomainRequest?"/":"https://example.com")}catch{a=null}}else a=null;return a}function r(l){var u=t();if(!u)return!1;try{return u.responseType=l,u.responseType===l}catch{}return!1}e.arraybuffer=e.fetch||r("arraybuffer"),e.msstream=!e.fetch&&r("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&r("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||(t()?c(t().overrideMimeType):!1);function c(l){return typeof l=="function"}a=null}(Lr)),Lr}var jt={},$t={exports:{}},Fi;function Nn(){return Fi||(Fi=1,function(e,a){a=e.exports=ni(),a.Stream=a,a.Readable=a,a.Writable=ii(),a.Duplex=ht(),a.Transform=ai(),a.PassThrough=Fn(),a.finished=ar(),a.pipeline=Ln()}($t,$t.exports)),$t.exports}var Li;function On(){if(Li)return jt;Li=1;var e=Bn(),a=ft,t=Nn(),r=jt.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=jt.IncomingMessage=function(l,u,s,v){var f=this;if(t.Readable.call(f),f._mode=s,f.headers={},f.rawHeaders=[],f.trailers={},f.rawTrailers=[],f.on("end",function(){se.nextTick(function(){f.emit("close")})}),s==="fetch"){let F=function(){d.read().then(function(S){if(!f._destroyed){if(v(S.done),S.done){f.push(null);return}f.push(rt.from(S.value)),F()}}).catch(function(S){v(!0),f._destroyed||f.emit("error",S)})};if(f._fetchResponse=u,f.url=u.url,f.statusCode=u.status,f.statusMessage=u.statusText,u.headers.forEach(function(S,w){f.headers[w.toLowerCase()]=S,f.rawHeaders.push(w,S)}),e.writableStream){var n=new WritableStream({write:function(S){return v(!1),new Promise(function(w,x){f._destroyed?x():f.push(rt.from(S))?w():f._resumeFetch=w})},close:function(){v(!0),f._destroyed||f.push(null)},abort:function(S){v(!0),f._destroyed||f.emit("error",S)}});try{u.body.pipeTo(n).catch(function(S){v(!0),f._destroyed||f.emit("error",S)});return}catch{}}var d=u.body.getReader();F()}else{f._xhr=l,f._pos=0,f.url=l.responseURL,f.statusCode=l.status,f.statusMessage=l.statusText;var b=l.getAllResponseHeaders().split(/\r?\n/);if(b.forEach(function(F){var S=F.match(/^([^:]+):\s*(.*)/);if(S){var w=S[1].toLowerCase();w==="set-cookie"?(f.headers[w]===void 0&&(f.headers[w]=[]),f.headers[w].push(S[2])):f.headers[w]!==void 0?f.headers[w]+=", "+S[2]:f.headers[w]=S[2],f.rawHeaders.push(S[1],S[2])}}),f._charset="x-user-defined",!e.overrideMimeType){var y=f.rawHeaders["mime-type"];if(y){var I=y.match(/;\s*charset=([^;])(;|$)/);I&&(f._charset=I[1].toLowerCase())}f._charset||(f._charset="utf-8")}}};return a(c,t.Readable),c.prototype._read=function(){var l=this,u=l._resumeFetch;u&&(l._resumeFetch=null,u())},c.prototype._onXHRProgress=function(l){var u=this,s=u._xhr,v=null;switch(u._mode){case"text":if(v=s.responseText,v.length>u._pos){var f=v.substr(u._pos);if(u._charset==="x-user-defined"){for(var n=rt.alloc(f.length),d=0;du._pos&&(u.push(rt.from(new Uint8Array(b.result.slice(u._pos)))),u._pos=b.result.byteLength)},b.onload=function(){l(!0),u.push(null)},b.readAsArrayBuffer(v);break}u._xhr.readyState===r.DONE&&u._mode!=="ms-stream"&&(l(!0),u.push(null))},jt}var ki;function Pa(){if(ki)return Fr.exports;ki=1;var e=Bn(),a=ft,t=On(),r=Nn(),c=t.IncomingMessage,l=t.readyStates;function u(n,d){return e.fetch&&d?"fetch":e.mozchunkedarraybuffer?"moz-chunked-arraybuffer":e.msstream?"ms-stream":e.arraybuffer&&n?"arraybuffer":"text"}var s=Fr.exports=function(n){var d=this;r.Writable.call(d),d._opts=n,d._body=[],d._headers={},n.auth&&d.setHeader("Authorization","Basic "+rt.from(n.auth).toString("base64")),Object.keys(n.headers).forEach(function(I){d.setHeader(I,n.headers[I])});var b,y=!0;if(n.mode==="disable-fetch"||"requestTimeout"in n&&!e.abortController)y=!1,b=!0;else if(n.mode==="prefer-streaming")b=!1;else if(n.mode==="allow-wrong-content-type")b=!e.overrideMimeType;else if(!n.mode||n.mode==="default"||n.mode==="prefer-fast")b=!0;else throw new Error("Invalid value for opts.mode");d._mode=u(b,y),d._fetchTimer=null,d._socketTimeout=null,d._socketTimer=null,d.on("finish",function(){d._onFinish()})};a(s,r.Writable),s.prototype.setHeader=function(n,d){var b=this,y=n.toLowerCase();f.indexOf(y)===-1&&(b._headers[y]={name:n,value:d})},s.prototype.getHeader=function(n){var d=this._headers[n.toLowerCase()];return d?d.value:null},s.prototype.removeHeader=function(n){var d=this;delete d._headers[n.toLowerCase()]},s.prototype._onFinish=function(){var n=this;if(!n._destroyed){var d=n._opts;"timeout"in d&&d.timeout!==0&&n.setTimeout(d.timeout);var b=n._headers,y=null;d.method!=="GET"&&d.method!=="HEAD"&&(y=new Blob(n._body,{type:(b["content-type"]||{}).value||""}));var I=[];if(Object.keys(b).forEach(function(x){var N=b[x].name,B=b[x].value;Array.isArray(B)?B.forEach(function(L){I.push([N,L])}):I.push([N,B])}),n._mode==="fetch"){var F=null;if(e.abortController){var S=new AbortController;F=S.signal,n._fetchAbortController=S,"requestTimeout"in d&&d.requestTimeout!==0&&(n._fetchTimer=Ee.setTimeout(function(){n.emit("requestTimeout"),n._fetchAbortController&&n._fetchAbortController.abort()},d.requestTimeout))}Ee.fetch(n._opts.url,{method:n._opts.method,headers:I,body:y||void 0,mode:"cors",credentials:d.withCredentials?"include":"same-origin",signal:F}).then(function(x){n._fetchResponse=x,n._resetTimers(!1),n._connect()},function(x){n._resetTimers(!0),n._destroyed||n.emit("error",x)})}else{var w=n._xhr=new Ee.XMLHttpRequest;try{w.open(n._opts.method,n._opts.url,!0)}catch(x){se.nextTick(function(){n.emit("error",x)});return}"responseType"in w&&(w.responseType=n._mode),"withCredentials"in w&&(w.withCredentials=!!d.withCredentials),n._mode==="text"&&"overrideMimeType"in w&&w.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in d&&(w.timeout=d.requestTimeout,w.ontimeout=function(){n.emit("requestTimeout")}),I.forEach(function(x){w.setRequestHeader(x[0],x[1])}),n._response=null,w.onreadystatechange=function(){switch(w.readyState){case l.LOADING:case l.DONE:n._onXHRProgress();break}},n._mode==="moz-chunked-arraybuffer"&&(w.onprogress=function(){n._onXHRProgress()}),w.onerror=function(){n._destroyed||(n._resetTimers(!0),n.emit("error",new Error("XHR error")))};try{w.send(y)}catch(x){se.nextTick(function(){n.emit("error",x)});return}}}};function v(n){try{var d=n.status;return d!==null&&d!==0}catch{return!1}}s.prototype._onXHRProgress=function(){var n=this;n._resetTimers(!1),!(!v(n._xhr)||n._destroyed)&&(n._response||n._connect(),n._response._onXHRProgress(n._resetTimers.bind(n)))},s.prototype._connect=function(){var n=this;n._destroyed||(n._response=new c(n._xhr,n._fetchResponse,n._mode,n._resetTimers.bind(n)),n._response.on("error",function(d){n.emit("error",d)}),n.emit("response",n._response))},s.prototype._write=function(n,d,b){var y=this;y._body.push(n),b()},s.prototype._resetTimers=function(n){var d=this;Ee.clearTimeout(d._socketTimer),d._socketTimer=null,n?(Ee.clearTimeout(d._fetchTimer),d._fetchTimer=null):d._socketTimeout&&(d._socketTimer=Ee.setTimeout(function(){d.emit("timeout")},d._socketTimeout))},s.prototype.abort=s.prototype.destroy=function(n){var d=this;d._destroyed=!0,d._resetTimers(!0),d._response&&(d._response._destroyed=!0),d._xhr?d._xhr.abort():d._fetchAbortController&&d._fetchAbortController.abort(),n&&d.emit("error",n)},s.prototype.end=function(n,d,b){var y=this;typeof n=="function"&&(b=n,n=void 0),r.Writable.prototype.end.call(y,n,d,b)},s.prototype.setTimeout=function(n,d){var b=this;d&&b.once("timeout",d),b._socketTimeout=n,b._resetTimers(!1)},s.prototype.flushHeaders=function(){},s.prototype.setNoDelay=function(){},s.prototype.setSocketKeepAlive=function(){};var f=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return Fr.exports}var kr,Bi;function Za(){if(Bi)return kr;Bi=1,kr=a;var e=Object.prototype.hasOwnProperty;function a(){for(var t={},r=0;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},B=v-f,L=Math.floor,z=String.fromCharCode,$;function Z(H){throw new RangeError(N[H])}function D(H,X){for(var ie=H.length,le=[];ie--;)le[ie]=X(H[ie]);return le}function re(H,X){var ie=H.split("@"),le="";ie.length>1&&(le=ie[0]+"@",H=ie[1]),H=H.replace(x,".");var Q=H.split("."),ae=D(Q,X).join(".");return le+ae}function Y(H){for(var X=[],ie=0,le=H.length,Q,ae;ie=55296&&Q<=56319&&ie65535&&(X-=65536,ie+=z(X>>>10&1023|55296),X=56320|X&1023),ie+=z(X),ie}).join("")}function U(H){return H-48<10?H-22:H-65<26?H-65:H-97<26?H-97:v}function G(H,X){return H+22+75*(H<26)-((X!=0)<<5)}function te(H,X,ie){var le=0;for(H=ie?L(H/b):H>>1,H+=L(H/X);H>B*n>>1;le+=v)H=L(H/B);return L(le+(B+1)*H/(H+d))}function we(H){var X=[],ie=H.length,le,Q=0,ae=I,C=y,T,P,W,V,p,g,M,j,ce;for(T=H.lastIndexOf(F),T<0&&(T=0),P=0;P=128&&Z("not-basic"),X.push(H.charCodeAt(P));for(W=T>0?T+1:0;W=ie&&Z("invalid-input"),M=U(H.charCodeAt(W++)),(M>=v||M>L((s-Q)/p))&&Z("overflow"),Q+=M*p,j=g<=C?f:g>=C+n?n:g-C,!(ML(s/ce)&&Z("overflow"),p*=ce;le=X.length+1,C=te(Q-V,le,V==0),L(Q/le)>s-ae&&Z("overflow"),ae+=L(Q/le),Q%=le,X.splice(Q++,0,ae)}return E(X)}function he(H){var X,ie,le,Q,ae,C,T,P,W,V,p,g=[],M,j,ce,ee;for(H=Y(H),M=H.length,X=I,ie=0,ae=y,C=0;C=X&&pL((s-ie)/j)&&Z("overflow"),ie+=(T-X)*j,X=T,C=0;Cs&&Z("overflow"),p==X){for(P=ie,W=v;V=W<=ae?f:W>=ae+n?n:W-ae,!(P0&&s>u&&(s=u);for(var v=0;v=0?(d=f.substr(0,n),b=f.substr(n+1)):(d=f,b=""),y=decodeURIComponent(d),I=decodeURIComponent(b),Ha(c,y)?$a(c[y])?c[y].push(I):c[y]=[c[y],I]:c[y]=I}return c},$a=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},Ct=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},Wa=function(e,a,t,r){return a=a||"&",t=t||"=",e===null&&(e=void 0),typeof e=="object"?Oi(Ka(e),function(c){var l=encodeURIComponent(Ct(c))+t;return Ga(e[c])?Oi(e[c],function(u){return l+encodeURIComponent(Ct(u))}).join(a):l+encodeURIComponent(Ct(e[c]))}).join(a):r?encodeURIComponent(Ct(r))+t+encodeURIComponent(Ct(e)):""},Ga=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function Oi(e,a){if(e.map)return e.map(a);for(var t=[],r=0;r",'"',"`"," ","\r",` +`," "],B=["{","}","|","\\","^","`"].concat(N),L=["'"].concat(B),z=["%","/","?",";","#"].concat(L),$=["/","?","#"],Z=255,D=/^[+a-z0-9A-Z_-]{0,63}$/,re=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Y={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},U={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},G=u.default;function te(R,q,A){if(R&&f.isObject(R)&&R instanceof F)return R;var J=new F;return J.parse(R,q,A),J}F.prototype.parse=function(R,q,A){if(!f.isString(R))throw new TypeError("Parameter 'url' must be a string, not "+typeof R);var J=R.indexOf("?"),ne=J!==-1&&J127?Me+="x":Me+=Ze[De];if(!Me.match(D)){var Qe=oe.slice(0,K),ze=oe.slice(K+1),gt=Ze.match(re);gt&&(Qe.push(gt[1]),ze.unshift(gt[2])),ze.length&&(i="/"+ze.join(".")+i),this.hostname=Qe.join(".");break}}}this.hostname.length>Z?this.hostname="":this.hostname=this.hostname.toLowerCase(),pe||(this.hostname=v.toASCII(this.hostname));var ur=this.port?":"+this.port:"",ga=this.hostname||"";this.host=ga+ur,this.href+=this.host,pe&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),i[0]!=="/"&&(i="/"+i))}if(!Y[m])for(var K=0,Re=L.length;K0?A.host.split("@"):!1;Me&&(A.auth=Me.shift(),A.host=A.hostname=Me.shift())}return A.search=R.search,A.query=R.query,(!f.isNull(A.pathname)||!f.isNull(A.search))&&(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.href=A.format(),A}if(!oe.length)return A.pathname=null,A.search?A.path="/"+A.search:A.path=null,A.href=A.format(),A;for(var De=oe.slice(-1)[0],lr=(A.host||R.host||oe.length>1)&&(De==="."||De==="..")||De==="",Qe=0,ze=oe.length;ze>=0;ze--)De=oe[ze],De==="."?oe.splice(ze,1):De===".."?(oe.splice(ze,1),Qe++):Qe&&(oe.splice(ze,1),Qe--);if(!ue&&!pe)for(;Qe--;Qe)oe.unshift("..");ue&&oe[0]!==""&&(!oe[0]||oe[0].charAt(0)!=="/")&&oe.unshift(""),lr&&oe.join("/").substr(-1)!=="/"&&oe.push("");var gt=oe[0]===""||oe[0]&&oe[0].charAt(0)==="/";if(Ze){A.hostname=A.host=gt?"":oe.length?oe.shift():"";var Me=A.host&&A.host.indexOf("@")>0?A.host.split("@"):!1;Me&&(A.auth=Me.shift(),A.host=A.hostname=Me.shift())}return ue=ue||A.host&&oe.length,ue&&!gt&&oe.unshift(""),oe.length?A.pathname=oe.join("/"):(A.pathname=null,A.path=null),(!f.isNull(A.pathname)||!f.isNull(A.search))&&(A.path=(A.pathname?A.pathname:"")+(A.search?A.search:"")),A.auth=R.auth||A.auth,A.slashes=A.slashes||R.slashes,A.href=A.format(),A},F.prototype.parseHost=function(){var R=this.host,q=w.exec(R);q&&(q=q[0],q!==":"&&(this.port=q.substr(1)),R=R.substr(0,R.length-q.length)),R&&(this.hostname=R)};function me(R,q){for(var A=0,J=R.length-1;J>=0;J--){var ne=R[J];ne==="."?R.splice(J,1):ne===".."?(R.splice(J,1),A++):A&&(R.splice(J,1),A--)}if(q)for(;A--;A)R.unshift("..");return R}function H(){for(var R="",q=!1,A=arguments.length-1;A>=-1&&!q;A--){var J=A>=0?arguments[A]:"/";if(typeof J!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!J)continue;R=J+"/"+R,q=J.charAt(0)==="/"}return R=me(X(R.split("/"),function(ne){return!!ne}),!q).join("/"),(q?"/":"")+R||"."}function X(R,q){if(R.filter)return R.filter(q);for(var A=[],J=0;J"u")throw new TypeError('The "domain" argument must be specified');return new T("http://"+q).hostname},Ke=function(q){if(typeof q>"u")throw new TypeError('The "domain" argument must be specified');return new T("http://"+q).hostname},Ye=function(q){var A=new T("file://"),J=H(q),ne=q.charCodeAt(q.length-1);return ne===j&&J[J.length-1]!=="/"&&(J+="/"),A.pathname=_e(J),A},vt=function(q){if(!ce(q)&&typeof q!="string")throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type '+typeof q+" ("+q+")");var A=new T(q);if(A.protocol!=="file:")throw new TypeError("The URL must be of scheme file");return ee(A)},lt=function(q,A){var J,ne,xe;if(A===void 0&&(A={}),!(q instanceof T))return le(q);if(typeof A!="object"||A===null)throw new TypeError('The "options" argument must be of type object.');var h=(J=A.auth)!=null?J:!0,i=(ne=A.fragment)!=null?ne:!0,o=(xe=A.search)!=null?xe:!0,_=new T(q.toString());return h||(_.username="",_.password=""),i||(_.hash=""),o||(_.search=""),_.toString()},Xe={format:lt,parse:Q,resolve:ae,resolveObject:b,Url:C,URL:T,URLSearchParams:P,domainToASCII:Oe,domainToUnicode:Ke,pathToFileURL:Ye,fileURLToPath:vt};a.URL=T,a.URLSearchParams=P,a.Url=C,a.default=Xe,a.domainToASCII=Oe,a.domainToUnicode=Ke,a.fileURLToPath=vt,a.format=lt,a.parse=Q,a.pathToFileURL=Ye,a.resolve=ae,a.resolveObject=b,a=e.exports=Xe})(Gr,Gr.exports);var Mn=Gr.exports,Mi;function Xa(){return Mi||(Mi=1,function(e){var a=Pa(),t=On(),r=Za(),c=za(),l=Mn,u=e;u.request=function(s,v){typeof s=="string"?s=l.parse(s):s=r(s);var f=Ee.location.protocol.search(/^https?:$/)===-1?"http:":"",n=s.protocol||f,d=s.hostname||s.host,b=s.port,y=s.path||"/";d&&d.indexOf(":")!==-1&&(d="["+d+"]"),s.url=(d?n+"//"+d:"")+(b?":"+b:"")+y,s.method=(s.method||"GET").toUpperCase(),s.headers=s.headers||{};var I=new a(s);return v&&I.on("response",v),I},u.get=function(v,f){var n=u.request(v,f);return n.end(),n},u.ClientRequest=a,u.IncomingMessage=t.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=c,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}(Cr)),Cr}(function(e){var a=Xa(),t=Mn,r=e.exports;for(var c in a)a.hasOwnProperty(c)&&(r[c]=a[c]);r.request=function(u,s){return u=l(u),a.request.call(this,u,s)},r.get=function(u,s){return u=l(u),a.get.call(this,u,s)};function l(u){if(typeof u=="string"&&(u=t.parse(u)),u.protocol||(u.protocol="https:"),u.protocol!=="https:")throw new Error('Protocol "'+u.protocol+'" not supported. Expected "https:"');return u}})(kn);var Zf=kn.exports,Va={},Dn={};function Ja(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Qa=Ja,Ge={},Pt={};(function(e){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(l,u){return Object.prototype.hasOwnProperty.call(l,u)}e.assign=function(l){for(var u=Array.prototype.slice.call(arguments,1);u.length;){var s=u.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var v in s)t(s,v)&&(l[v]=s[v])}}return l},e.shrinkBuf=function(l,u){return l.length===u?l:l.subarray?l.subarray(0,u):(l.length=u,l)};var r={arraySet:function(l,u,s,v,f){if(u.subarray&&l.subarray){l.set(u.subarray(s,s+v),f);return}for(var n=0;n=0;)e[a]=0}var io=0,Un=1,no=2,ao=3,oo=258,fi=29,Zt=256,Ot=Zt+1+fi,Et=30,li=19,Pn=2*Ot+1,ut=15,Nr=16,fo=7,ui=256,Zn=16,zn=17,qn=18,Yr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Vt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],lo=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Hn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],uo=512,Je=new Array((Ot+2)*2);xt(Je);var kt=new Array(Et*2);xt(kt);var Mt=new Array(uo);xt(Mt);var Dt=new Array(oo-ao+1);xt(Dt);var si=new Array(fi);xt(si);var rr=new Array(Et);xt(rr);function Or(e,a,t,r,c){this.static_tree=e,this.extra_bits=a,this.extra_base=t,this.elems=r,this.max_length=c,this.has_stree=e&&e.length}var jn,$n,Wn;function Mr(e,a){this.dyn_tree=e,this.max_code=0,this.stat_desc=a}function Gn(e){return e<256?Mt[e]:Mt[256+(e>>>7)]}function Ut(e,a){e.pending_buf[e.pending++]=a&255,e.pending_buf[e.pending++]=a>>>8&255}function Ie(e,a,t){e.bi_valid>Nr-t?(e.bi_buf|=a<>Nr-e.bi_valid,e.bi_valid+=t-Nr):(e.bi_buf|=a<>>=1,t<<=1;while(--a>0);return t>>>1}function so(e){e.bi_valid===16?(Ut(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function ho(e,a){var t=a.dyn_tree,r=a.max_code,c=a.stat_desc.static_tree,l=a.stat_desc.has_stree,u=a.stat_desc.extra_bits,s=a.stat_desc.extra_base,v=a.stat_desc.max_length,f,n,d,b,y,I,F=0;for(b=0;b<=ut;b++)e.bl_count[b]=0;for(t[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;fv&&(b=v,F++),t[n*2+1]=b,!(n>r)&&(e.bl_count[b]++,y=0,n>=s&&(y=u[n-s]),I=t[n*2],e.opt_len+=I*(b+y),l&&(e.static_len+=I*(c[n*2+1]+y)));if(F!==0){do{for(b=v-1;e.bl_count[b]===0;)b--;e.bl_count[b]--,e.bl_count[b+1]+=2,e.bl_count[v]--,F-=2}while(F>0);for(b=v;b!==0;b--)for(n=e.bl_count[b];n!==0;)d=e.heap[--f],!(d>r)&&(t[d*2+1]!==b&&(e.opt_len+=(b-t[d*2+1])*t[d*2],t[d*2+1]=b),n--)}}function Yn(e,a,t){var r=new Array(ut+1),c=0,l,u;for(l=1;l<=ut;l++)r[l]=c=c+t[l-1]<<1;for(u=0;u<=a;u++){var s=e[u*2+1];s!==0&&(e[u*2]=Kn(r[s]++,s))}}function co(){var e,a,t,r,c,l=new Array(ut+1);for(t=0,r=0;r>=7;r8?Ut(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function _o(e,a,t,r){Vn(e),r&&(Ut(e,t),Ut(e,~t)),eo.arraySet(e.pending_buf,e.window,a,t,e.pending),e.pending+=t}function Pi(e,a,t,r){var c=a*2,l=t*2;return e[c]>1;u>=1;u--)Dr(e,t,u);f=l;do u=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Dr(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=u,e.heap[--e.heap_max]=s,t[f*2]=t[u*2]+t[s*2],e.depth[f]=(e.depth[u]>=e.depth[s]?e.depth[u]:e.depth[s])+1,t[u*2+1]=t[s*2+1]=f,e.heap[1]=f++,Dr(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],ho(e,a),Yn(t,v,e.bl_count)}function zi(e,a,t){var r,c=-1,l,u=a[0*2+1],s=0,v=7,f=4;for(u===0&&(v=138,f=3),a[(t+1)*2+1]=65535,r=0;r<=t;r++)l=u,u=a[(r+1)*2+1],!(++s=3&&e.bl_tree[Hn[a]*2+1]===0;a--);return e.opt_len+=3*(a+1)+5+5+4,a}function vo(e,a,t,r){var c;for(Ie(e,a-257,5),Ie(e,t-1,5),Ie(e,r-4,4),c=0;c>>=1)if(a&1&&e.dyn_ltree[t*2]!==0)return Di;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Ui;for(t=32;t0?(e.strm.data_type===ro&&(e.strm.data_type=go(e)),Xr(e,e.l_desc),Xr(e,e.d_desc),u=po(e),c=e.opt_len+3+7>>>3,l=e.static_len+3+7>>>3,l<=c&&(c=l)):c=l=t+5,t+4<=c&&a!==-1?Jn(e,a,t,r):e.strategy===to||l===c?(Ie(e,(Un<<1)+(r?1:0),3),Zi(e,Je,kt)):(Ie(e,(no<<1)+(r?1:0),3),vo(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),Zi(e,e.dyn_ltree,e.dyn_dtree)),Xn(e),r&&Vn(e)}function mo(e,a,t){return e.pending_buf[e.d_buf+e.last_lit*2]=a>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=a&255,e.pending_buf[e.l_buf+e.last_lit]=t&255,e.last_lit++,a===0?e.dyn_ltree[t*2]++:(e.matches++,a--,e.dyn_ltree[(Dt[t]+Zt+1)*2]++,e.dyn_dtree[Gn(a)*2]++),e.last_lit===e.lit_bufsize-1}Tt._tr_init=wo;Tt._tr_stored_block=Jn;Tt._tr_flush_block=yo;Tt._tr_tally=mo;Tt._tr_align=bo;function Eo(e,a,t,r){for(var c=e&65535|0,l=e>>>16&65535|0,u=0;t!==0;){u=t>2e3?2e3:t,t-=u;do c=c+a[r++]|0,l=l+c|0;while(--u);c%=65521,l%=65521}return c|l<<16|0}var Qn=Eo;function Ro(){for(var e,a=[],t=0;t<256;t++){e=t;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;a[t]=e}return a}var So=Ro();function To(e,a,t,r){var c=So,l=r+t;e^=-1;for(var u=r;u>>8^c[(e^a[u])&255];return e^-1}var ea=To,xo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ae=Pt,Le=Tt,ta=Qn,et=ea,Ao=xo,pt=0,Io=1,Co=3,ot=4,ji=5,We=0,$i=1,ke=-2,Fo=-3,Ur=-5,Lo=-1,ko=1,Wt=2,Bo=3,No=4,Oo=0,Mo=2,or=8,Do=9,Uo=15,Po=8,Zo=29,zo=256,Vr=zo+1+Zo,qo=30,Ho=19,jo=2*Vr+1,$o=15,de=3,nt=258,Ue=nt+de+1,Wo=32,fr=42,Jr=69,Jt=73,Qt=91,er=103,st=113,Lt=666,Se=1,zt=2,ct=3,At=4,Go=3;function at(e,a){return e.msg=Ao[a],a}function Wi(e){return(e<<1)-(e>4?9:0)}function it(e){for(var a=e.length;--a>=0;)e[a]=0}function tt(e){var a=e.state,t=a.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(Ae.arraySet(e.output,a.pending_buf,a.pending_out,t,e.next_out),e.next_out+=t,a.pending_out+=t,e.total_out+=t,e.avail_out-=t,a.pending-=t,a.pending===0&&(a.pending_out=0))}function Te(e,a){Le._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,a),e.block_start=e.strstart,tt(e.strm)}function ge(e,a){e.pending_buf[e.pending++]=a}function Ft(e,a){e.pending_buf[e.pending++]=a>>>8&255,e.pending_buf[e.pending++]=a&255}function Ko(e,a,t,r){var c=e.avail_in;return c>r&&(c=r),c===0?0:(e.avail_in-=c,Ae.arraySet(a,e.input,e.next_in,c,t),e.state.wrap===1?e.adler=ta(e.adler,a,c,t):e.state.wrap===2&&(e.adler=et(e.adler,a,c,t)),e.next_in+=c,e.total_in+=c,c)}function ra(e,a){var t=e.max_chain_length,r=e.strstart,c,l,u=e.prev_length,s=e.nice_match,v=e.strstart>e.w_size-Ue?e.strstart-(e.w_size-Ue):0,f=e.window,n=e.w_mask,d=e.prev,b=e.strstart+nt,y=f[r+u-1],I=f[r+u];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(c=a,!(f[c+u]!==I||f[c+u-1]!==y||f[c]!==f[r]||f[++c]!==f[r+1])){r+=2,c++;do;while(f[++r]===f[++c]&&f[++r]===f[++c]&&f[++r]===f[++c]&&f[++r]===f[++c]&&f[++r]===f[++c]&&f[++r]===f[++c]&&f[++r]===f[++c]&&f[++r]===f[++c]&&ru){if(e.match_start=a,u=l,l>=s)break;y=f[r+u-1],I=f[r+u]}}while((a=d[a&n])>v&&--t!==0);return u<=e.lookahead?u:e.lookahead}function dt(e){var a=e.w_size,t,r,c,l,u;do{if(l=e.window_size-e.lookahead-e.strstart,e.strstart>=a+(a-Ue)){Ae.arraySet(e.window,e.window,a,a,0),e.match_start-=a,e.strstart-=a,e.block_start-=a,r=e.hash_size,t=r;do c=e.head[--t],e.head[t]=c>=a?c-a:0;while(--r);r=a,t=r;do c=e.prev[--t],e.prev[t]=c>=a?c-a:0;while(--r);l+=a}if(e.strm.avail_in===0)break;if(r=Ko(e.strm,e.window,e.strstart+e.lookahead,l),e.lookahead+=r,e.lookahead+e.insert>=de)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(dt(e),e.lookahead===0&&a===pt)return Se;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+t;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Te(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Ue&&(Te(e,!1),e.strm.avail_out===0))return Se}return e.insert=0,a===ot?(Te(e,!0),e.strm.avail_out===0?ct:At):(e.strstart>e.block_start&&(Te(e,!1),e.strm.avail_out===0),Se)}function Pr(e,a){for(var t,r;;){if(e.lookahead=de&&(e.ins_h=(e.ins_h<=de)if(r=Le._tr_tally(e,e.strstart-e.match_start,e.match_length-de),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=de){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<=de&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=de-1)),e.prev_length>=de&&e.match_length<=e.prev_length){c=e.strstart+e.lookahead-de,r=Le._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-de),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=c&&(e.ins_h=(e.ins_h<=de&&e.strstart>0&&(c=e.strstart-1,r=u[c],r===u[++c]&&r===u[++c]&&r===u[++c])){l=e.strstart+nt;do;while(r===u[++c]&&r===u[++c]&&r===u[++c]&&r===u[++c]&&r===u[++c]&&r===u[++c]&&r===u[++c]&&r===u[++c]&&ce.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=de?(t=Le._tr_tally(e,1,e.match_length-de),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=Le._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(Te(e,!1),e.strm.avail_out===0))return Se}return e.insert=0,a===ot?(Te(e,!0),e.strm.avail_out===0?ct:At):e.last_lit&&(Te(e,!1),e.strm.avail_out===0)?Se:zt}function Vo(e,a){for(var t;;){if(e.lookahead===0&&(dt(e),e.lookahead===0)){if(a===pt)return Se;break}if(e.match_length=0,t=Le._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(Te(e,!1),e.strm.avail_out===0))return Se}return e.insert=0,a===ot?(Te(e,!0),e.strm.avail_out===0?ct:At):e.last_lit&&(Te(e,!1),e.strm.avail_out===0)?Se:zt}function qe(e,a,t,r,c){this.good_length=e,this.max_lazy=a,this.nice_length=t,this.max_chain=r,this.func=c}var mt;mt=[new qe(0,0,0,0,Yo),new qe(4,4,8,4,Pr),new qe(4,5,16,8,Pr),new qe(4,6,32,32,Pr),new qe(4,4,16,16,bt),new qe(8,16,32,32,bt),new qe(8,16,128,128,bt),new qe(8,32,128,256,bt),new qe(32,128,258,1024,bt),new qe(32,258,258,4096,bt)];function Jo(e){e.window_size=2*e.w_size,it(e.head),e.max_lazy_match=mt[e.level].max_lazy,e.good_match=mt[e.level].good_length,e.nice_match=mt[e.level].nice_length,e.max_chain_length=mt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=de-1,e.match_available=0,e.ins_h=0}function Qo(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=or,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Ae.Buf16(jo*2),this.dyn_dtree=new Ae.Buf16((2*qo+1)*2),this.bl_tree=new Ae.Buf16((2*Ho+1)*2),it(this.dyn_ltree),it(this.dyn_dtree),it(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ae.Buf16($o+1),this.heap=new Ae.Buf16(2*Vr+1),it(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ae.Buf16(2*Vr+1),it(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ia(e){var a;return!e||!e.state?at(e,ke):(e.total_in=e.total_out=0,e.data_type=Mo,a=e.state,a.pending=0,a.pending_out=0,a.wrap<0&&(a.wrap=-a.wrap),a.status=a.wrap?fr:st,e.adler=a.wrap===2?0:1,a.last_flush=pt,Le._tr_init(a),We)}function na(e){var a=ia(e);return a===We&&Jo(e.state),a}function ef(e,a){return!e||!e.state||e.state.wrap!==2?ke:(e.state.gzhead=a,We)}function aa(e,a,t,r,c,l){if(!e)return ke;var u=1;if(a===Lo&&(a=6),r<0?(u=0,r=-r):r>15&&(u=2,r-=16),c<1||c>Do||t!==or||r<8||r>15||a<0||a>9||l<0||l>No)return at(e,ke);r===8&&(r=9);var s=new Qo;return e.state=s,s.strm=e,s.wrap=u,s.gzhead=null,s.w_bits=r,s.w_size=1<ji||a<0)return e?at(e,ke):ke;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===Lt&&a!==ot)return at(e,e.avail_out===0?Ur:ke);if(r.strm=e,t=r.last_flush,r.last_flush=a,r.status===fr)if(r.wrap===2)e.adler=0,ge(r,31),ge(r,139),ge(r,8),r.gzhead?(ge(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ge(r,r.gzhead.time&255),ge(r,r.gzhead.time>>8&255),ge(r,r.gzhead.time>>16&255),ge(r,r.gzhead.time>>24&255),ge(r,r.level===9?2:r.strategy>=Wt||r.level<2?4:0),ge(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ge(r,r.gzhead.extra.length&255),ge(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=et(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Jr):(ge(r,0),ge(r,0),ge(r,0),ge(r,0),ge(r,0),ge(r,r.level===9?2:r.strategy>=Wt||r.level<2?4:0),ge(r,Go),r.status=st);else{var u=or+(r.w_bits-8<<4)<<8,s=-1;r.strategy>=Wt||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,u|=s<<6,r.strstart!==0&&(u|=Wo),u+=31-u%31,r.status=st,Ft(r,u),r.strstart!==0&&(Ft(r,e.adler>>>16),Ft(r,e.adler&65535)),e.adler=1}if(r.status===Jr)if(r.gzhead.extra){for(c=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>c&&(e.adler=et(e.adler,r.pending_buf,r.pending-c,c)),tt(e),c=r.pending,r.pending===r.pending_buf_size));)ge(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>c&&(e.adler=et(e.adler,r.pending_buf,r.pending-c,c)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Jt)}else r.status=Jt;if(r.status===Jt)if(r.gzhead.name){c=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>c&&(e.adler=et(e.adler,r.pending_buf,r.pending-c,c)),tt(e),c=r.pending,r.pending===r.pending_buf_size)){l=1;break}r.gzindexc&&(e.adler=et(e.adler,r.pending_buf,r.pending-c,c)),l===0&&(r.gzindex=0,r.status=Qt)}else r.status=Qt;if(r.status===Qt)if(r.gzhead.comment){c=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>c&&(e.adler=et(e.adler,r.pending_buf,r.pending-c,c)),tt(e),c=r.pending,r.pending===r.pending_buf_size)){l=1;break}r.gzindexc&&(e.adler=et(e.adler,r.pending_buf,r.pending-c,c)),l===0&&(r.status=er)}else r.status=er;if(r.status===er&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&tt(e),r.pending+2<=r.pending_buf_size&&(ge(r,e.adler&255),ge(r,e.adler>>8&255),e.adler=0,r.status=st)):r.status=st),r.pending!==0){if(tt(e),e.avail_out===0)return r.last_flush=-1,We}else if(e.avail_in===0&&Wi(a)<=Wi(t)&&a!==ot)return at(e,Ur);if(r.status===Lt&&e.avail_in!==0)return at(e,Ur);if(e.avail_in!==0||r.lookahead!==0||a!==pt&&r.status!==Lt){var v=r.strategy===Wt?Vo(r,a):r.strategy===Bo?Xo(r,a):mt[r.level].func(r,a);if((v===ct||v===At)&&(r.status=Lt),v===Se||v===ct)return e.avail_out===0&&(r.last_flush=-1),We;if(v===zt&&(a===Io?Le._tr_align(r):a!==ji&&(Le._tr_stored_block(r,0,0,!1),a===Co&&(it(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),tt(e),e.avail_out===0))return r.last_flush=-1,We}return a!==ot?We:r.wrap<=0?$i:(r.wrap===2?(ge(r,e.adler&255),ge(r,e.adler>>8&255),ge(r,e.adler>>16&255),ge(r,e.adler>>24&255),ge(r,e.total_in&255),ge(r,e.total_in>>8&255),ge(r,e.total_in>>16&255),ge(r,e.total_in>>24&255)):(Ft(r,e.adler>>>16),Ft(r,e.adler&65535)),tt(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?We:$i)}function nf(e){var a;return!e||!e.state?ke:(a=e.state.status,a!==fr&&a!==Jr&&a!==Jt&&a!==Qt&&a!==er&&a!==st&&a!==Lt?at(e,ke):(e.state=null,a===st?at(e,Fo):We))}function af(e,a){var t=a.length,r,c,l,u,s,v,f,n;if(!e||!e.state||(r=e.state,u=r.wrap,u===2||u===1&&r.status!==fr||r.lookahead))return ke;for(u===1&&(e.adler=ta(e.adler,a,t,0)),r.wrap=0,t>=r.w_size&&(u===0&&(it(r.head),r.strstart=0,r.block_start=0,r.insert=0),n=new Ae.Buf8(r.w_size),Ae.arraySet(n,a,t-r.w_size,r.w_size,0),a=n,t=r.w_size),s=e.avail_in,v=e.next_in,f=e.input,e.avail_in=t,e.next_in=0,e.input=a,dt(r);r.lookahead>=de;){c=r.strstart,l=r.lookahead-(de-1);do r.ins_h=(r.ins_h<>>24,I>>>=L,F-=L,L=B>>>16&255,L===0)Y[u++]=B&65535;else if(L&16){z=B&65535,L&=15,L&&(F>>=L,F-=L),F<15&&(I+=re[c++]<>>24,I>>>=L,F-=L,L=B>>>16&255,L&16){if($=B&65535,L&=15,Ff){a.msg="invalid distance too far back",r.mode=Gt;break e}if(I>>>=L,F-=L,L=u-s,$>L){if(L=$-L,L>d&&r.sane){a.msg="invalid distance too far back",r.mode=Gt;break e}if(Z=0,D=y,b===0){if(Z+=n-L,L2;)Y[u++]=D[Z++],Y[u++]=D[Z++],Y[u++]=D[Z++],z-=3;z&&(Y[u++]=D[Z++],z>1&&(Y[u++]=D[Z++]))}else{Z=u-$;do Y[u++]=Y[Z++],Y[u++]=Y[Z++],Y[u++]=Y[Z++],z-=3;while(z>2);z&&(Y[u++]=Y[Z++],z>1&&(Y[u++]=Y[Z++]))}}else if(L&64){a.msg="invalid distance code",r.mode=Gt;break e}else{B=w[(B&65535)+(I&(1<>3,c-=z,F-=z<<3,I&=(1<=1&&E[y]===0;y--);if(I>y&&(I=y),y===0)return l[u++]=1<<24|64<<16|0,l[u++]=1<<24|64<<16|0,v.bits=1,0;for(b=1;b0&&(a===Xi||y!==1))return-1;for(U[1]=0,n=1;nKi||a===Vi&&x>Yi)return 1;for(;;){we=n-S,s[d]Y?(he=G[te+s[d]],fe=D[re+s[d]]):(he=96,fe=0),B=1<>S)+L]=we<<24|he<<16|fe|0;while(L!==0);for(B=1<>=1;if(B!==0?(N&=B-1,N+=B):N=0,d++,--E[n]===0){if(n===y)break;n=t[r+s[d]]}if(n>I&&(N&$)!==z){for(S===0&&(S=I),Z+=b,F=n-S,w=1<Ki||a===Vi&&x>Yi)return 1;z=N&$,l[z]=I<<24|F<<16|Z-u|0}}return N!==0&&(l[Z+N]=n-S<<24|64<<16|0),v.bits=I,0},Ce=Pt,Qr=Qn,He=ea,df=ff,Bt=cf,_f=0,oa=1,fa=2,Ji=4,pf=5,Kt=6,_t=0,vf=1,gf=2,Ne=-2,la=-3,ua=-4,wf=-5,Qi=8,sa=1,en=2,tn=3,rn=4,nn=5,an=6,on=7,fn=8,ln=9,un=10,ir=11,Ve=12,zr=13,sn=14,qr=15,hn=16,cn=17,dn=18,_n=19,Yt=20,Xt=21,pn=22,vn=23,gn=24,wn=25,bn=26,Hr=27,yn=28,mn=29,ye=30,ha=31,bf=32,yf=852,mf=592,Ef=15,Rf=Ef;function En(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function Sf(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Ce.Buf16(320),this.work=new Ce.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ca(e){var a;return!e||!e.state?Ne:(a=e.state,e.total_in=e.total_out=a.total=0,e.msg="",a.wrap&&(e.adler=a.wrap&1),a.mode=sa,a.last=0,a.havedict=0,a.dmax=32768,a.head=null,a.hold=0,a.bits=0,a.lencode=a.lendyn=new Ce.Buf32(yf),a.distcode=a.distdyn=new Ce.Buf32(mf),a.sane=1,a.back=-1,_t)}function da(e){var a;return!e||!e.state?Ne:(a=e.state,a.wsize=0,a.whave=0,a.wnext=0,ca(e))}function _a(e,a){var t,r;return!e||!e.state||(r=e.state,a<0?(t=0,a=-a):(t=(a>>4)+1,a<48&&(a&=15)),a&&(a<8||a>15))?Ne:(r.window!==null&&r.wbits!==a&&(r.window=null),r.wrap=t,r.wbits=a,da(e))}function pa(e,a){var t,r;return e?(r=new Sf,e.state=r,r.window=null,t=_a(e,a),t!==_t&&(e.state=null),t):Ne}function Tf(e){return pa(e,Rf)}var Rn=!0,jr,$r;function xf(e){if(Rn){var a;for(jr=new Ce.Buf32(512),$r=new Ce.Buf32(32),a=0;a<144;)e.lens[a++]=8;for(;a<256;)e.lens[a++]=9;for(;a<280;)e.lens[a++]=7;for(;a<288;)e.lens[a++]=8;for(Bt(oa,e.lens,0,288,jr,0,e.work,{bits:9}),a=0;a<32;)e.lens[a++]=5;Bt(fa,e.lens,0,32,$r,0,e.work,{bits:5}),Rn=!1}e.lencode=jr,e.lenbits=9,e.distcode=$r,e.distbits=5}function va(e,a,t,r){var c,l=e.state;return l.window===null&&(l.wsize=1<=l.wsize?(Ce.arraySet(l.window,a,t-l.wsize,l.wsize,0),l.wnext=0,l.whave=l.wsize):(c=l.wsize-l.wnext,c>r&&(c=r),Ce.arraySet(l.window,a,t-r,c,l.wnext),r-=c,r?(Ce.arraySet(l.window,a,t-r,r,0),l.wnext=r,l.whave=l.wsize):(l.wnext+=c,l.wnext===l.wsize&&(l.wnext=0),l.whave>>8&255,t.check=He(t.check,D,2,0),f=0,n=0,t.mode=en;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",t.mode=ye;break}if((f&15)!==Qi){e.msg="unknown compression method",t.mode=ye;break}if(f>>>=4,n-=4,$=(f&15)+8,t.wbits===0)t.wbits=$;else if($>t.wbits){e.msg="invalid window size",t.mode=ye;break}t.dmax=1<<$,e.adler=t.check=1,t.mode=f&512?un:Ve,f=0,n=0;break;case en:for(;n<16;){if(s===0)break e;s--,f+=r[l++]<>8&1),t.flags&512&&(D[0]=f&255,D[1]=f>>>8&255,t.check=He(t.check,D,2,0)),f=0,n=0,t.mode=tn;case tn:for(;n<32;){if(s===0)break e;s--,f+=r[l++]<>>8&255,D[2]=f>>>16&255,D[3]=f>>>24&255,t.check=He(t.check,D,4,0)),f=0,n=0,t.mode=rn;case rn:for(;n<16;){if(s===0)break e;s--,f+=r[l++]<>8),t.flags&512&&(D[0]=f&255,D[1]=f>>>8&255,t.check=He(t.check,D,2,0)),f=0,n=0,t.mode=nn;case nn:if(t.flags&1024){for(;n<16;){if(s===0)break e;s--,f+=r[l++]<>>8&255,t.check=He(t.check,D,2,0)),f=0,n=0}else t.head&&(t.head.extra=null);t.mode=an;case an:if(t.flags&1024&&(y=t.length,y>s&&(y=s),y&&(t.head&&($=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),Ce.arraySet(t.head.extra,r,l,y,$)),t.flags&512&&(t.check=He(t.check,r,y,l)),s-=y,l+=y,t.length-=y),t.length))break e;t.length=0,t.mode=on;case on:if(t.flags&2048){if(s===0)break e;y=0;do $=r[l+y++],t.head&&$&&t.length<65536&&(t.head.name+=String.fromCharCode($));while($&&y>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=Ve;break;case un:for(;n<32;){if(s===0)break e;s--,f+=r[l++]<>>=n&7,n-=n&7,t.mode=Hr;break}for(;n<3;){if(s===0)break e;s--,f+=r[l++]<>>=1,n-=1,f&3){case 0:t.mode=sn;break;case 1:if(xf(t),t.mode=Yt,a===Kt){f>>>=2,n-=2;break e}break;case 2:t.mode=cn;break;case 3:e.msg="invalid block type",t.mode=ye}f>>>=2,n-=2;break;case sn:for(f>>>=n&7,n-=n&7;n<32;){if(s===0)break e;s--,f+=r[l++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=ye;break}if(t.length=f&65535,f=0,n=0,t.mode=qr,a===Kt)break e;case qr:t.mode=hn;case hn:if(y=t.length,y){if(y>s&&(y=s),y>v&&(y=v),y===0)break e;Ce.arraySet(c,r,l,y,u),s-=y,l+=y,v-=y,u+=y,t.length-=y;break}t.mode=Ve;break;case cn:for(;n<14;){if(s===0)break e;s--,f+=r[l++]<>>=5,n-=5,t.ndist=(f&31)+1,f>>>=5,n-=5,t.ncode=(f&15)+4,f>>>=4,n-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=ye;break}t.have=0,t.mode=dn;case dn:for(;t.have>>=3,n-=3}for(;t.have<19;)t.lens[E[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,re={bits:t.lenbits},Z=Bt(_f,t.lens,0,19,t.lencode,0,t.work,re),t.lenbits=re.bits,Z){e.msg="invalid code lengths set",t.mode=ye;break}t.have=0,t.mode=_n;case _n:for(;t.have>>24,x=S>>>16&255,N=S&65535,!(w<=n);){if(s===0)break e;s--,f+=r[l++]<>>=w,n-=w,t.lens[t.have++]=N;else{if(N===16){for(Y=w+2;n>>=w,n-=w,t.have===0){e.msg="invalid bit length repeat",t.mode=ye;break}$=t.lens[t.have-1],y=3+(f&3),f>>>=2,n-=2}else if(N===17){for(Y=w+3;n>>=w,n-=w,$=0,y=3+(f&7),f>>>=3,n-=3}else{for(Y=w+7;n>>=w,n-=w,$=0,y=11+(f&127),f>>>=7,n-=7}if(t.have+y>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=ye;break}for(;y--;)t.lens[t.have++]=$}}if(t.mode===ye)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=ye;break}if(t.lenbits=9,re={bits:t.lenbits},Z=Bt(oa,t.lens,0,t.nlen,t.lencode,0,t.work,re),t.lenbits=re.bits,Z){e.msg="invalid literal/lengths set",t.mode=ye;break}if(t.distbits=6,t.distcode=t.distdyn,re={bits:t.distbits},Z=Bt(fa,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,re),t.distbits=re.bits,Z){e.msg="invalid distances set",t.mode=ye;break}if(t.mode=Yt,a===Kt)break e;case Yt:t.mode=Xt;case Xt:if(s>=6&&v>=258){e.next_out=u,e.avail_out=v,e.next_in=l,e.avail_in=s,t.hold=f,t.bits=n,df(e,b),u=e.next_out,c=e.output,v=e.avail_out,l=e.next_in,r=e.input,s=e.avail_in,f=t.hold,n=t.bits,t.mode===Ve&&(t.back=-1);break}for(t.back=0;S=t.lencode[f&(1<>>24,x=S>>>16&255,N=S&65535,!(w<=n);){if(s===0)break e;s--,f+=r[l++]<>B)],w=S>>>24,x=S>>>16&255,N=S&65535,!(B+w<=n);){if(s===0)break e;s--,f+=r[l++]<>>=B,n-=B,t.back+=B}if(f>>>=w,n-=w,t.back+=w,t.length=N,x===0){t.mode=bn;break}if(x&32){t.back=-1,t.mode=Ve;break}if(x&64){e.msg="invalid literal/length code",t.mode=ye;break}t.extra=x&15,t.mode=pn;case pn:if(t.extra){for(Y=t.extra;n>>=t.extra,n-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=vn;case vn:for(;S=t.distcode[f&(1<>>24,x=S>>>16&255,N=S&65535,!(w<=n);){if(s===0)break e;s--,f+=r[l++]<>B)],w=S>>>24,x=S>>>16&255,N=S&65535,!(B+w<=n);){if(s===0)break e;s--,f+=r[l++]<>>=B,n-=B,t.back+=B}if(f>>>=w,n-=w,t.back+=w,x&64){e.msg="invalid distance code",t.mode=ye;break}t.offset=N,t.extra=x&15,t.mode=gn;case gn:if(t.extra){for(Y=t.extra;n>>=t.extra,n-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=ye;break}t.mode=wn;case wn:if(v===0)break e;if(y=b-v,t.offset>y){if(y=t.offset-y,y>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=ye;break}y>t.wnext?(y-=t.wnext,I=t.wsize-y):I=t.wnext-y,y>t.length&&(y=t.length),F=t.window}else F=c,I=u-t.offset,y=t.length;y>v&&(y=v),v-=y,t.length-=y;do c[u++]=F[I++];while(--y);t.length===0&&(t.mode=Xt);break;case bn:if(v===0)break e;c[u++]=t.length,v--,t.mode=Xt;break;case Hr:if(t.wrap){for(;n<32;){if(s===0)break e;s--,f|=r[l++]<e.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=n,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}f.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,a(this.init_done,"close before init"),a(this.mode<=e.UNZIP),this.mode===e.DEFLATE||this.mode===e.GZIP||this.mode===e.DEFLATERAW?r.deflateEnd(this.strm):(this.mode===e.INFLATE||this.mode===e.GUNZIP||this.mode===e.INFLATERAW||this.mode===e.UNZIP)&&c.inflateEnd(this.strm),this.mode=e.NONE,this.dictionary=null},f.prototype.write=function(n,d,b,y,I,F,S){return this._write(!0,n,d,b,y,I,F,S)},f.prototype.writeSync=function(n,d,b,y,I,F,S){return this._write(!1,n,d,b,y,I,F,S)},f.prototype._write=function(n,d,b,y,I,F,S,w){if(a.equal(arguments.length,8),a(this.init_done,"write before init"),a(this.mode!==e.NONE,"already finalized"),a.equal(!1,this.write_in_progress,"write already in progress"),a.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,a.equal(!1,d===void 0,"must provide flush value"),this.write_in_progress=!0,d!==e.Z_NO_FLUSH&&d!==e.Z_PARTIAL_FLUSH&&d!==e.Z_SYNC_FLUSH&&d!==e.Z_FULL_FLUSH&&d!==e.Z_FINISH&&d!==e.Z_BLOCK)throw new Error("Invalid flush value");if(b==null&&(b=rt.alloc(0),I=0,y=0),this.strm.avail_in=I,this.strm.input=b,this.strm.next_in=y,this.strm.avail_out=w,this.strm.output=F,this.strm.next_out=S,this.flush=d,!n)return this._process(),this._checkError()?this._afterSync():void 0;var x=this;return se.nextTick(function(){x._process(),x._after()}),this},f.prototype._afterSync=function(){var n=this.strm.avail_out,d=this.strm.avail_in;return this.write_in_progress=!1,[d,n]},f.prototype._process=function(){var n=null;switch(this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=r.deflate(this.strm,this.flush);break;case e.UNZIP:switch(this.strm.avail_in>0&&(n=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(n===null)break;if(this.strm.input[n]===s){if(this.gzip_id_bytes_read=1,n++,this.strm.avail_in===1)break}else{this.mode=e.INFLATE;break}case 1:if(n===null)break;this.strm.input[n]===v?(this.gzip_id_bytes_read=2,this.mode=e.GUNZIP):this.mode=e.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:for(this.err=c.inflate(this.strm,this.flush),this.err===e.Z_NEED_DICT&&this.dictionary&&(this.err=c.inflateSetDictionary(this.strm,this.dictionary),this.err===e.Z_OK?this.err=c.inflate(this.strm,this.flush):this.err===e.Z_DATA_ERROR&&(this.err=e.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===e.GUNZIP&&this.err===e.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=c.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},f.prototype._checkError=function(){switch(this.err){case e.Z_OK:case e.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===e.Z_FINISH)return this._error("unexpected end of file"),!1;break;case e.Z_STREAM_END:break;case e.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},f.prototype._after=function(){if(this._checkError()){var n=this.strm.avail_out,d=this.strm.avail_in;this.write_in_progress=!1,this.callback(d,n),this.pending_close&&this.close()}},f.prototype._error=function(n){this.strm.msg&&(n=this.strm.msg),this.onerror(n,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},f.prototype.init=function(n,d,b,y,I){a(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),a(n>=8&&n<=15,"invalid windowBits"),a(d>=-1&&d<=9,"invalid compression level"),a(b>=1&&b<=9,"invalid memlevel"),a(y===e.Z_FILTERED||y===e.Z_HUFFMAN_ONLY||y===e.Z_RLE||y===e.Z_FIXED||y===e.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(d,n,b,y,I),this._setDictionary()},f.prototype.params=function(){throw new Error("deflateParams Not supported")},f.prototype.reset=function(){this._reset(),this._setDictionary()},f.prototype._init=function(n,d,b,y,I){switch(this.level=n,this.windowBits=d,this.memLevel=b,this.strategy=y,this.flush=e.Z_NO_FLUSH,this.err=e.Z_OK,(this.mode===e.GZIP||this.mode===e.GUNZIP)&&(this.windowBits+=16),this.mode===e.UNZIP&&(this.windowBits+=32),(this.mode===e.DEFLATERAW||this.mode===e.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new t,this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=r.deflateInit2(this.strm,this.level,e.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:case e.UNZIP:this.err=c.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==e.Z_OK&&this._error("Init error"),this.dictionary=I,this.write_in_progress=!1,this.init_done=!0},f.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:this.err=r.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==e.Z_OK&&this._error("Failed to set dictionary")}},f.prototype._reset=function(){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:case e.GZIP:this.err=r.deflateReset(this.strm);break;case e.INFLATE:case e.INFLATERAW:case e.GUNZIP:this.err=c.inflateReset(this.strm);break}this.err!==e.Z_OK&&this._error("Failed to reset stream")},e.Zlib=f})(Dn);(function(e){var a=Rt.Buffer,t=Ba.Transform,r=Dn,c=ei,l=Sn().ok,u=Rt.kMaxLength,s="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";r.Z_MIN_WINDOWBITS=8,r.Z_MAX_WINDOWBITS=15,r.Z_DEFAULT_WINDOWBITS=15,r.Z_MIN_CHUNK=64,r.Z_MAX_CHUNK=1/0,r.Z_DEFAULT_CHUNK=16*1024,r.Z_MIN_MEMLEVEL=1,r.Z_MAX_MEMLEVEL=9,r.Z_DEFAULT_MEMLEVEL=8,r.Z_MIN_LEVEL=-1,r.Z_MAX_LEVEL=9,r.Z_DEFAULT_LEVEL=r.Z_DEFAULT_COMPRESSION;for(var v=Object.keys(r),f=0;f=u?X=new RangeError(s):H=a.concat(te,we),te=[],E.close(),G(X,H)}}function S(E,U){if(typeof U=="string"&&(U=a.from(U)),!a.isBuffer(U))throw new TypeError("Not a string or buffer");var G=E._finishFlushFlag;return E._processChunk(U,G)}function w(E){if(!(this instanceof w))return new w(E);D.call(this,E,r.DEFLATE)}function x(E){if(!(this instanceof x))return new x(E);D.call(this,E,r.INFLATE)}function N(E){if(!(this instanceof N))return new N(E);D.call(this,E,r.GZIP)}function B(E){if(!(this instanceof B))return new B(E);D.call(this,E,r.GUNZIP)}function L(E){if(!(this instanceof L))return new L(E);D.call(this,E,r.DEFLATERAW)}function z(E){if(!(this instanceof z))return new z(E);D.call(this,E,r.INFLATERAW)}function $(E){if(!(this instanceof $))return new $(E);D.call(this,E,r.UNZIP)}function Z(E){return E===r.Z_NO_FLUSH||E===r.Z_PARTIAL_FLUSH||E===r.Z_SYNC_FLUSH||E===r.Z_FULL_FLUSH||E===r.Z_FINISH||E===r.Z_BLOCK}function D(E,U){var G=this;if(this._opts=E=E||{},this._chunkSize=E.chunkSize||e.Z_DEFAULT_CHUNK,t.call(this,E),E.flush&&!Z(E.flush))throw new Error("Invalid flush flag: "+E.flush);if(E.finishFlush&&!Z(E.finishFlush))throw new Error("Invalid flush flag: "+E.finishFlush);if(this._flushFlag=E.flush||r.Z_NO_FLUSH,this._finishFlushFlag=typeof E.finishFlush<"u"?E.finishFlush:r.Z_FINISH,E.chunkSize&&(E.chunkSizee.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+E.chunkSize);if(E.windowBits&&(E.windowBitse.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+E.windowBits);if(E.level&&(E.levele.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+E.level);if(E.memLevel&&(E.memLevele.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+E.memLevel);if(E.strategy&&E.strategy!=e.Z_FILTERED&&E.strategy!=e.Z_HUFFMAN_ONLY&&E.strategy!=e.Z_RLE&&E.strategy!=e.Z_FIXED&&E.strategy!=e.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+E.strategy);if(E.dictionary&&!a.isBuffer(E.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new r.Zlib(U);var te=this;this._hadError=!1,this._handle.onerror=function(fe,me){re(te),te._hadError=!0;var H=new Error(fe);H.errno=me,H.code=e.codes[me],te.emit("error",H)};var we=e.Z_DEFAULT_COMPRESSION;typeof E.level=="number"&&(we=E.level);var he=e.Z_DEFAULT_STRATEGY;typeof E.strategy=="number"&&(he=E.strategy),this._handle.init(E.windowBits||e.Z_DEFAULT_WINDOWBITS,we,E.memLevel||e.Z_DEFAULT_MEMLEVEL,he,E.dictionary),this._buffer=a.allocUnsafe(this._chunkSize),this._offset=0,this._level=we,this._strategy=he,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!G._handle},configurable:!0,enumerable:!0})}c.inherits(D,t),D.prototype.params=function(E,U,G){if(Ee.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+E);if(U!=e.Z_FILTERED&&U!=e.Z_HUFFMAN_ONLY&&U!=e.Z_RLE&&U!=e.Z_FIXED&&U!=e.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+U);if(this._level!==E||this._strategy!==U){var te=this;this.flush(r.Z_SYNC_FLUSH,function(){l(te._handle,"zlib binding closed"),te._handle.params(E,U),te._hadError||(te._level=E,te._strategy=U,G&&G())})}else se.nextTick(G)},D.prototype.reset=function(){return l(this._handle,"zlib binding closed"),this._handle.reset()},D.prototype._flush=function(E){this._transform(a.alloc(0),"",E)},D.prototype.flush=function(E,U){var G=this,te=this._writableState;(typeof E=="function"||E===void 0&&!U)&&(U=E,E=r.Z_FULL_FLUSH),te.ended?U&&se.nextTick(U):te.ending?U&&this.once("end",U):te.needDrain?U&&this.once("drain",function(){return G.flush(E,U)}):(this._flushFlag=E,this.write(a.alloc(0),"",U))},D.prototype.close=function(E){re(this,E),se.nextTick(Y,this)};function re(E,U){U&&se.nextTick(U),E._handle&&(E._handle.close(),E._handle=null)}function Y(E){E.emit("close")}D.prototype._transform=function(E,U,G){var te,we=this._writableState,he=we.ending||we.ended,fe=he&&(!E||we.length===E.length);if(E!==null&&!a.isBuffer(E))return G(new Error("invalid input"));if(!this._handle)return G(new Error("zlib binding closed"));fe?te=this._finishFlushFlag:(te=this._flushFlag,E.length>=we.length&&(this._flushFlag=this._opts.flush||r.Z_NO_FLUSH)),this._processChunk(E,te,G)},D.prototype._processChunk=function(E,U,G){var te=E&&E.length,we=this._chunkSize-this._offset,he=0,fe=this,me=typeof G=="function";if(!me){var H=[],X=0,ie;this.on("error",function(T){ie=T}),l(this._handle,"zlib binding closed");do var le=this._handle.writeSync(U,E,he,te,this._buffer,this._offset,we);while(!this._hadError&&C(le[0],le[1]));if(this._hadError)throw ie;if(X>=u)throw re(this),new RangeError(s);var Q=a.concat(H,X);return re(this),Q}l(this._handle,"zlib binding closed");var ae=this._handle.write(U,E,he,te,this._buffer,this._offset,we);ae.buffer=E,ae.callback=C;function C(T,P){if(this&&(this.buffer=null,this.callback=null),!fe._hadError){var W=we-P;if(l(W>=0,"have should not go down"),W>0){var V=fe._buffer.slice(fe._offset,fe._offset+W);fe._offset+=W,me?fe.push(V):(H.push(V),X+=V.length)}if((P===0||fe._offset>=fe._chunkSize)&&(we=fe._chunkSize,fe._offset=0,fe._buffer=a.allocUnsafe(fe._chunkSize)),P===0){if(he+=te-T,te=T,!me)return!0;var p=fe._handle.write(U,E,he,te,fe._buffer,fe._offset,fe._chunkSize);p.callback=C,p.buffer=E;return}if(!me)return!1;G()}}},c.inherits(w,D),c.inherits(x,D),c.inherits(N,D),c.inherits(B,D),c.inherits(L,D),c.inherits(z,D),c.inherits($,D)})(Va);export{rt as B,Pf as D,Fa as a,Ua as b,Zf as h,Va as l,qa as p,Ya as q,Xa as r,Ba as s,Mn as u}; diff --git a/docs/storybook/assets/index-Pr70vtH1.js b/docs/storybook/assets/index-Pr70vtH1.js deleted file mode 100644 index 8efbffd17..000000000 --- a/docs/storybook/assets/index-Pr70vtH1.js +++ /dev/null @@ -1,8 +0,0 @@ -import{O as se}from"./callBound-4MCeDK1M.js";import{c as Ee,g as ga}from"./index-RfLt4OUa.js";import{u as Jr,i as lt,r as yn}from"./assert-1o4ErrXT.js";import{b as Tt}from"./index-zqflMFO-.js";import{e as Qr}from"./events-fK0UhkIE.js";import{f as wa}from"./index-777x7qAF.js";var mn={},ar={};ar.byteLength=ma;ar.toByteArray=Ra;ar.fromByteArray=xa;var $e=[],Le=[],ba=typeof Uint8Array<"u"?Uint8Array:Array,_r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var yt=0,ya=_r.length;yt0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=i);var r=t===i?0:4-t%4;return[t,r]}function ma(e){var i=En(e),t=i[0],r=i[1];return(t+r)*3/4-r}function Ea(e,i,t){return(i+t)*3/4-t}function Ra(e){var i,t=En(e),r=t[0],u=t[1],f=new ba(Ea(e,r,u)),l=0,s=u>0?r-4:r,p;for(p=0;p>16&255,f[l++]=i>>8&255,f[l++]=i&255;return u===2&&(i=Le[e.charCodeAt(p)]<<2|Le[e.charCodeAt(p+1)]>>4,f[l++]=i&255),u===1&&(i=Le[e.charCodeAt(p)]<<10|Le[e.charCodeAt(p+1)]<<4|Le[e.charCodeAt(p+2)]>>2,f[l++]=i>>8&255,f[l++]=i&255),f}function Sa(e){return $e[e>>18&63]+$e[e>>12&63]+$e[e>>6&63]+$e[e&63]}function Ta(e,i,t){for(var r,u=[],f=i;fs?s:l+f));return r===1?(i=e[t-1],u.push($e[i>>2]+$e[i<<4&63]+"==")):r===2&&(i=(e[t-2]<<8)+e[t-1],u.push($e[i>>10]+$e[i>>4&63]+$e[i<<2&63]+"=")),u.join("")}var ei={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ei.read=function(e,i,t,r,u){var f,l,s=u*8-r-1,p=(1<>1,o=-7,g=t?u-1:0,b=t?-1:1,m=e[i+g];for(g+=b,f=m&(1<<-o)-1,m>>=-o,o+=s;o>0;f=f*256+e[i+g],g+=b,o-=8);for(l=f&(1<<-o)-1,f>>=-o,o+=r;o>0;l=l*256+e[i+g],g+=b,o-=8);if(f===0)f=1-h;else{if(f===p)return l?NaN:(m?-1:1)*(1/0);l=l+Math.pow(2,r),f=f-h}return(m?-1:1)*l*Math.pow(2,f-r)};ei.write=function(e,i,t,r,u,f){var l,s,p,h=f*8-u-1,o=(1<>1,b=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:f-1,I=r?1:-1,C=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(s=isNaN(i)?1:0,l=o):(l=Math.floor(Math.log(i)/Math.LN2),i*(p=Math.pow(2,-l))<1&&(l--,p*=2),l+g>=1?i+=b/p:i+=b*Math.pow(2,1-g),i*p>=2&&(l++,p/=2),l+g>=o?(s=0,l=o):l+g>=1?(s=(i*p-1)*Math.pow(2,u),l=l+g):(s=i*Math.pow(2,g-1)*Math.pow(2,u),l=0));u>=8;e[t+m]=s&255,m+=I,s/=256,u-=8);for(l=l<0;e[t+m]=l&255,m+=I,l/=256,h-=8);e[t+m-I]|=C*128};/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */(function(e){const i=ar,t=ei,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=F,e.INSPECT_MAX_BYTES=50;const u=2147483647;e.kMaxLength=u;const{Uint8Array:f,ArrayBuffer:l,SharedArrayBuffer:s}=globalThis;o.TYPED_ARRAY_SUPPORT=p(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function p(){try{const c=new f(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,f.prototype),Object.setPrototypeOf(c,n),c.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function h(c){if(c>u)throw new RangeError('The value "'+c+'" is invalid for option "size"');const n=new f(c);return Object.setPrototypeOf(n,o.prototype),n}function o(c,n,a){if(typeof c=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return I(c)}return g(c,n,a)}o.poolSize=8192;function g(c,n,a){if(typeof c=="string")return C(c,n);if(l.isView(c))return w(c);if(c==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof c);if(q(c,l)||c&&q(c.buffer,l)||typeof s<"u"&&(q(c,s)||c&&q(c.buffer,s)))return A(c,n,a);if(typeof c=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const d=c.valueOf&&c.valueOf();if(d!=null&&d!==c)return o.from(d,n,a);const y=O(c);if(y)return y;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof c[Symbol.toPrimitive]=="function")return o.from(c[Symbol.toPrimitive]("string"),n,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof c)}o.from=function(c,n,a){return g(c,n,a)},Object.setPrototypeOf(o.prototype,f.prototype),Object.setPrototypeOf(o,f);function b(c){if(typeof c!="number")throw new TypeError('"size" argument must be of type number');if(c<0)throw new RangeError('The value "'+c+'" is invalid for option "size"')}function m(c,n,a){return b(c),c<=0?h(c):n!==void 0?typeof a=="string"?h(c).fill(n,a):h(c).fill(n):h(c)}o.alloc=function(c,n,a){return m(c,n,a)};function I(c){return b(c),h(c<0?0:B(c)|0)}o.allocUnsafe=function(c){return I(c)},o.allocUnsafeSlow=function(c){return I(c)};function C(c,n){if((typeof n!="string"||n==="")&&(n="utf8"),!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);const a=z(c,n)|0;let d=h(a);const y=d.write(c,n);return y!==a&&(d=d.slice(0,y)),d}function L(c){const n=c.length<0?0:B(c.length)|0,a=h(n);for(let d=0;d=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return c|0}function F(c){return+c!=c&&(c=0),o.alloc(+c)}o.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==o.prototype},o.compare=function(n,a){if(q(n,f)&&(n=o.from(n,n.offset,n.byteLength)),q(a,f)&&(a=o.from(a,a.offset,a.byteLength)),!o.isBuffer(n)||!o.isBuffer(a))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===a)return 0;let d=n.length,y=a.length;for(let k=0,N=Math.min(d,y);ky.length?(o.isBuffer(N)||(N=o.from(N)),N.copy(y,k)):f.prototype.set.call(y,N,k);else if(o.isBuffer(N))N.copy(y,k);else throw new TypeError('"list" argument must be an Array of Buffers');k+=N.length}return y};function z(c,n){if(o.isBuffer(c))return c.length;if(l.isView(c)||q(c,l))return c.byteLength;if(typeof c!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof c);const a=c.length,d=arguments.length>2&&arguments[2]===!0;if(!d&&a===0)return 0;let y=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return Xe(c).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return Ve(c).length;default:if(y)return d?-1:Xe(c).length;n=(""+n).toLowerCase(),y=!0}}o.byteLength=z;function $(c,n,a){let d=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((a===void 0||a>this.length)&&(a=this.length),a<=0)||(a>>>=0,n>>>=0,a<=n))return"";for(c||(c="utf8");;)switch(c){case"hex":return ie(this,n,a);case"utf8":case"utf-8":return he(this,n,a);case"ascii":return H(this,n,a);case"latin1":case"binary":return X(this,n,a);case"base64":return we(this,n,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return le(this,n,a);default:if(d)throw new TypeError("Unknown encoding: "+c);c=(c+"").toLowerCase(),d=!0}}o.prototype._isBuffer=!0;function Z(c,n,a){const d=c[n];c[n]=c[a],c[a]=d}o.prototype.swap16=function(){const n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let a=0;aa&&(n+=" ... "),""},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(n,a,d,y,k){if(q(n,f)&&(n=o.from(n,n.offset,n.byteLength)),!o.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(a===void 0&&(a=0),d===void 0&&(d=n?n.length:0),y===void 0&&(y=0),k===void 0&&(k=this.length),a<0||d>n.length||y<0||k>this.length)throw new RangeError("out of range index");if(y>=k&&a>=d)return 0;if(y>=k)return-1;if(a>=d)return 1;if(a>>>=0,d>>>=0,y>>>=0,k>>>=0,this===n)return 0;let N=k-y,K=d-a;const ve=Math.min(N,K),be=this.slice(y,k),ue=n.slice(a,d);for(let pe=0;pe2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,T(a)&&(a=y?0:c.length-1),a<0&&(a=c.length+a),a>=c.length){if(y)return-1;a=c.length-1}else if(a<0)if(y)a=0;else return-1;if(typeof n=="string"&&(n=o.from(n,d)),o.isBuffer(n))return n.length===0?-1:re(c,n,a,d,y);if(typeof n=="number")return n=n&255,typeof f.prototype.indexOf=="function"?y?f.prototype.indexOf.call(c,n,a):f.prototype.lastIndexOf.call(c,n,a):re(c,[n],a,d,y);throw new TypeError("val must be string, number or Buffer")}function re(c,n,a,d,y){let k=1,N=c.length,K=n.length;if(d!==void 0&&(d=String(d).toLowerCase(),d==="ucs2"||d==="ucs-2"||d==="utf16le"||d==="utf-16le")){if(c.length<2||n.length<2)return-1;k=2,N/=2,K/=2,a/=2}function ve(ue,pe){return k===1?ue[pe]:ue.readUInt16BE(pe*k)}let be;if(y){let ue=-1;for(be=a;beN&&(a=N-K),be=a;be>=0;be--){let ue=!0;for(let pe=0;pey&&(d=y)):d=y;const k=n.length;d>k/2&&(d=k/2);let N;for(N=0;N>>0,isFinite(d)?(d=d>>>0,y===void 0&&(y="utf8")):(y=d,d=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const k=this.length-a;if((d===void 0||d>k)&&(d=k),n.length>0&&(d<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");y||(y="utf8");let N=!1;for(;;)switch(y){case"hex":return Y(this,n,a,d);case"utf8":case"utf-8":return E(this,n,a,d);case"ascii":case"latin1":case"binary":return U(this,n,a,d);case"base64":return G(this,n,a,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return te(this,n,a,d);default:if(N)throw new TypeError("Unknown encoding: "+y);y=(""+y).toLowerCase(),N=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function we(c,n,a){return n===0&&a===c.length?i.fromByteArray(c):i.fromByteArray(c.slice(n,a))}function he(c,n,a){a=Math.min(c.length,a);const d=[];let y=n;for(;y239?4:k>223?3:k>191?2:1;if(y+K<=a){let ve,be,ue,pe;switch(K){case 1:k<128&&(N=k);break;case 2:ve=c[y+1],(ve&192)===128&&(pe=(k&31)<<6|ve&63,pe>127&&(N=pe));break;case 3:ve=c[y+1],be=c[y+2],(ve&192)===128&&(be&192)===128&&(pe=(k&15)<<12|(ve&63)<<6|be&63,pe>2047&&(pe<55296||pe>57343)&&(N=pe));break;case 4:ve=c[y+1],be=c[y+2],ue=c[y+3],(ve&192)===128&&(be&192)===128&&(ue&192)===128&&(pe=(k&15)<<18|(ve&63)<<12|(be&63)<<6|ue&63,pe>65535&&pe<1114112&&(N=pe))}}N===null?(N=65533,K=1):N>65535&&(N-=65536,d.push(N>>>10&1023|55296),N=56320|N&1023),d.push(N),y+=K}return me(d)}const fe=4096;function me(c){const n=c.length;if(n<=fe)return String.fromCharCode.apply(String,c);let a="",d=0;for(;dd)&&(a=d);let y="";for(let k=n;kd&&(n=d),a<0?(a+=d,a<0&&(a=0)):a>d&&(a=d),aa)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(n,a,d){n=n>>>0,a=a>>>0,d||Q(n,a,this.length);let y=this[n],k=1,N=0;for(;++N>>0,a=a>>>0,d||Q(n,a,this.length);let y=this[n+--a],k=1;for(;a>0&&(k*=256);)y+=this[n+--a]*k;return y},o.prototype.readUint8=o.prototype.readUInt8=function(n,a){return n=n>>>0,a||Q(n,1,this.length),this[n]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(n,a){return n=n>>>0,a||Q(n,2,this.length),this[n]|this[n+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(n,a){return n=n>>>0,a||Q(n,2,this.length),this[n]<<8|this[n+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(n,a){return n=n>>>0,a||Q(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(n,a){return n=n>>>0,a||Q(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},o.prototype.readBigUInt64LE=ne(function(n){n=n>>>0,ee(n,"offset");const a=this[n],d=this[n+7];(a===void 0||d===void 0)&&_e(n,this.length-8);const y=a+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,k=this[++n]+this[++n]*2**8+this[++n]*2**16+d*2**24;return BigInt(y)+(BigInt(k)<>>0,ee(n,"offset");const a=this[n],d=this[n+7];(a===void 0||d===void 0)&&_e(n,this.length-8);const y=a*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],k=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+d;return(BigInt(y)<>>0,a=a>>>0,d||Q(n,a,this.length);let y=this[n],k=1,N=0;for(;++N=k&&(y-=Math.pow(2,8*a)),y},o.prototype.readIntBE=function(n,a,d){n=n>>>0,a=a>>>0,d||Q(n,a,this.length);let y=a,k=1,N=this[n+--y];for(;y>0&&(k*=256);)N+=this[n+--y]*k;return k*=128,N>=k&&(N-=Math.pow(2,8*a)),N},o.prototype.readInt8=function(n,a){return n=n>>>0,a||Q(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},o.prototype.readInt16LE=function(n,a){n=n>>>0,a||Q(n,2,this.length);const d=this[n]|this[n+1]<<8;return d&32768?d|4294901760:d},o.prototype.readInt16BE=function(n,a){n=n>>>0,a||Q(n,2,this.length);const d=this[n+1]|this[n]<<8;return d&32768?d|4294901760:d},o.prototype.readInt32LE=function(n,a){return n=n>>>0,a||Q(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},o.prototype.readInt32BE=function(n,a){return n=n>>>0,a||Q(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},o.prototype.readBigInt64LE=ne(function(n){n=n>>>0,ee(n,"offset");const a=this[n],d=this[n+7];(a===void 0||d===void 0)&&_e(n,this.length-8);const y=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(d<<24);return(BigInt(y)<>>0,ee(n,"offset");const a=this[n],d=this[n+7];(a===void 0||d===void 0)&&_e(n,this.length-8);const y=(a<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(y)<>>0,a||Q(n,4,this.length),t.read(this,n,!0,23,4)},o.prototype.readFloatBE=function(n,a){return n=n>>>0,a||Q(n,4,this.length),t.read(this,n,!1,23,4)},o.prototype.readDoubleLE=function(n,a){return n=n>>>0,a||Q(n,8,this.length),t.read(this,n,!0,52,8)},o.prototype.readDoubleBE=function(n,a){return n=n>>>0,a||Q(n,8,this.length),t.read(this,n,!1,52,8)};function ae(c,n,a,d,y,k){if(!o.isBuffer(c))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>y||nc.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(n,a,d,y){if(n=+n,a=a>>>0,d=d>>>0,!y){const K=Math.pow(2,8*d)-1;ae(this,n,a,d,K,0)}let k=1,N=0;for(this[a]=n&255;++N>>0,d=d>>>0,!y){const K=Math.pow(2,8*d)-1;ae(this,n,a,d,K,0)}let k=d-1,N=1;for(this[a+k]=n&255;--k>=0&&(N*=256);)this[a+k]=n/N&255;return a+d},o.prototype.writeUint8=o.prototype.writeUInt8=function(n,a,d){return n=+n,a=a>>>0,d||ae(this,n,a,1,255,0),this[a]=n&255,a+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(n,a,d){return n=+n,a=a>>>0,d||ae(this,n,a,2,65535,0),this[a]=n&255,this[a+1]=n>>>8,a+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(n,a,d){return n=+n,a=a>>>0,d||ae(this,n,a,2,65535,0),this[a]=n>>>8,this[a+1]=n&255,a+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(n,a,d){return n=+n,a=a>>>0,d||ae(this,n,a,4,4294967295,0),this[a+3]=n>>>24,this[a+2]=n>>>16,this[a+1]=n>>>8,this[a]=n&255,a+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(n,a,d){return n=+n,a=a>>>0,d||ae(this,n,a,4,4294967295,0),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4};function x(c,n,a,d,y){ce(n,d,y,c,a,7);let k=Number(n&BigInt(4294967295));c[a++]=k,k=k>>8,c[a++]=k,k=k>>8,c[a++]=k,k=k>>8,c[a++]=k;let N=Number(n>>BigInt(32)&BigInt(4294967295));return c[a++]=N,N=N>>8,c[a++]=N,N=N>>8,c[a++]=N,N=N>>8,c[a++]=N,a}function S(c,n,a,d,y){ce(n,d,y,c,a,7);let k=Number(n&BigInt(4294967295));c[a+7]=k,k=k>>8,c[a+6]=k,k=k>>8,c[a+5]=k,k=k>>8,c[a+4]=k;let N=Number(n>>BigInt(32)&BigInt(4294967295));return c[a+3]=N,N=N>>8,c[a+2]=N,N=N>>8,c[a+1]=N,N=N>>8,c[a]=N,a+8}o.prototype.writeBigUInt64LE=ne(function(n,a=0){return x(this,n,a,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=ne(function(n,a=0){return S(this,n,a,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(n,a,d,y){if(n=+n,a=a>>>0,!y){const ve=Math.pow(2,8*d-1);ae(this,n,a,d,ve-1,-ve)}let k=0,N=1,K=0;for(this[a]=n&255;++k>0)-K&255;return a+d},o.prototype.writeIntBE=function(n,a,d,y){if(n=+n,a=a>>>0,!y){const ve=Math.pow(2,8*d-1);ae(this,n,a,d,ve-1,-ve)}let k=d-1,N=1,K=0;for(this[a+k]=n&255;--k>=0&&(N*=256);)n<0&&K===0&&this[a+k+1]!==0&&(K=1),this[a+k]=(n/N>>0)-K&255;return a+d},o.prototype.writeInt8=function(n,a,d){return n=+n,a=a>>>0,d||ae(this,n,a,1,127,-128),n<0&&(n=255+n+1),this[a]=n&255,a+1},o.prototype.writeInt16LE=function(n,a,d){return n=+n,a=a>>>0,d||ae(this,n,a,2,32767,-32768),this[a]=n&255,this[a+1]=n>>>8,a+2},o.prototype.writeInt16BE=function(n,a,d){return n=+n,a=a>>>0,d||ae(this,n,a,2,32767,-32768),this[a]=n>>>8,this[a+1]=n&255,a+2},o.prototype.writeInt32LE=function(n,a,d){return n=+n,a=a>>>0,d||ae(this,n,a,4,2147483647,-2147483648),this[a]=n&255,this[a+1]=n>>>8,this[a+2]=n>>>16,this[a+3]=n>>>24,a+4},o.prototype.writeInt32BE=function(n,a,d){return n=+n,a=a>>>0,d||ae(this,n,a,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4},o.prototype.writeBigInt64LE=ne(function(n,a=0){return x(this,n,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=ne(function(n,a=0){return S(this,n,a,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function P(c,n,a,d,y,k){if(a+d>c.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function W(c,n,a,d,y){return n=+n,a=a>>>0,y||P(c,n,a,4),t.write(c,n,a,d,23,4),a+4}o.prototype.writeFloatLE=function(n,a,d){return W(this,n,a,!0,d)},o.prototype.writeFloatBE=function(n,a,d){return W(this,n,a,!1,d)};function V(c,n,a,d,y){return n=+n,a=a>>>0,y||P(c,n,a,8),t.write(c,n,a,d,52,8),a+8}o.prototype.writeDoubleLE=function(n,a,d){return V(this,n,a,!0,d)},o.prototype.writeDoubleBE=function(n,a,d){return V(this,n,a,!1,d)},o.prototype.copy=function(n,a,d,y){if(!o.isBuffer(n))throw new TypeError("argument should be a Buffer");if(d||(d=0),!y&&y!==0&&(y=this.length),a>=n.length&&(a=n.length),a||(a=0),y>0&&y=this.length)throw new RangeError("Index out of range");if(y<0)throw new RangeError("sourceEnd out of bounds");y>this.length&&(y=this.length),n.length-a>>0,d=d===void 0?this.length:d>>>0,n||(n=0);let k;if(typeof n=="number")for(k=a;k2**32?y=M(String(a)):typeof a=="bigint"&&(y=String(a),(a>BigInt(2)**BigInt(32)||a<-(BigInt(2)**BigInt(32)))&&(y=M(y)),y+="n"),d+=` It must be ${n}. Received ${y}`,d},RangeError);function M(c){let n="",a=c.length;const d=c[0]==="-"?1:0;for(;a>=d+4;a-=3)n=`_${c.slice(a-3,a)}${n}`;return`${c.slice(0,a)}${n}`}function j(c,n,a){ee(n,"offset"),(c[n]===void 0||c[n+a]===void 0)&&_e(n,c.length-(a+1))}function ce(c,n,a,d,y,k){if(c>a||c3?n===0||n===BigInt(0)?K=`>= 0${N} and < 2${N} ** ${(k+1)*8}${N}`:K=`>= -(2${N} ** ${(k+1)*8-1}${N}) and < 2 ** ${(k+1)*8-1}${N}`:K=`>= ${n}${N} and <= ${a}${N}`,new _.ERR_OUT_OF_RANGE("value",K,c)}j(d,y,k)}function ee(c,n){if(typeof c!="number")throw new _.ERR_INVALID_ARG_TYPE(n,"number",c)}function _e(c,n,a){throw Math.floor(c)!==c?(ee(c,a),new _.ERR_OUT_OF_RANGE(a||"offset","an integer",c)):n<0?new _.ERR_BUFFER_OUT_OF_BOUNDS:new _.ERR_OUT_OF_RANGE(a||"offset",`>= ${a?1:0} and <= ${n}`,c)}const Me=/[^+/0-9A-Za-z-_]/g;function Ye(c){if(c=c.split("=")[0],c=c.trim().replace(Me,""),c.length<2)return"";for(;c.length%4!==0;)c=c+"=";return c}function Xe(c,n){n=n||1/0;let a;const d=c.length;let y=null;const k=[];for(let N=0;N55295&&a<57344){if(!y){if(a>56319){(n-=3)>-1&&k.push(239,191,189);continue}else if(N+1===d){(n-=3)>-1&&k.push(239,191,189);continue}y=a;continue}if(a<56320){(n-=3)>-1&&k.push(239,191,189),y=a;continue}a=(y-55296<<10|a-56320)+65536}else y&&(n-=3)>-1&&k.push(239,191,189);if(y=null,a<128){if((n-=1)<0)break;k.push(a)}else if(a<2048){if((n-=2)<0)break;k.push(a>>6|192,a&63|128)}else if(a<65536){if((n-=3)<0)break;k.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((n-=4)<0)break;k.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return k}function wt(c){const n=[];for(let a=0;a>8,y=a%256,k.push(y),k.push(d);return k}function Ve(c){return i.toByteArray(Ye(c))}function R(c,n,a,d){let y;for(y=0;y=n.length||y>=c.length);++y)n[y+a]=c[y];return y}function q(c,n){return c instanceof n||c!=null&&c.constructor!=null&&c.constructor.name!=null&&c.constructor.name===n.name}function T(c){return c!==c}const J=function(){const c="0123456789abcdef",n=new Array(256);for(let a=0;a<16;++a){const d=a*16;for(let y=0;y<16;++y)n[d+y]=c[a]+c[y]}return n}();function ne(c){return typeof BigInt>"u"?Ae:c}function Ae(){throw new Error("BigInt not supported")}})(mn);const nt=mn.Buffer;var pr,ci;function Rn(){return ci||(ci=1,pr=Qr.EventEmitter),pr}var vr,di;function Aa(){if(di)return vr;di=1;function e(I,C){var L=Object.keys(I);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(I);C&&(w=w.filter(function(A){return Object.getOwnPropertyDescriptor(I,A).enumerable})),L.push.apply(L,w)}return L}function i(I){for(var C=1;C0?this.tail.next=w:this.head=w,this.tail=w,++this.length}},{key:"unshift",value:function(L){var w={data:L,next:this.head};this.length===0&&(this.tail=w),this.head=w,++this.length}},{key:"shift",value:function(){if(this.length!==0){var L=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,L}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(L){if(this.length===0)return"";for(var w=this.head,A=""+w.data;w=w.next;)A+=L+w.data;return A}},{key:"concat",value:function(L){if(this.length===0)return h.alloc(0);for(var w=h.allocUnsafe(L>>>0),A=this.head,O=0;A;)m(A.data,w,O),O+=A.data.length,A=A.next;return w}},{key:"consume",value:function(L,w){var A;return LB.length?B.length:L;if(F===B.length?O+=B:O+=B.slice(0,L),L-=F,L===0){F===B.length?(++A,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=B.slice(F));break}++A}return this.length-=A,O}},{key:"_getBuffer",value:function(L){var w=h.allocUnsafe(L),A=this.head,O=1;for(A.data.copy(w),L-=A.data.length;A=A.next;){var B=A.data,F=L>B.length?B.length:L;if(B.copy(w,w.length-L,0,F),L-=F,L===0){F===B.length?(++O,A.next?this.head=A.next:this.head=this.tail=null):(this.head=A,A.data=B.slice(F));break}++O}return this.length-=O,w}},{key:b,value:function(L,w){return g(this,i(i({},w),{},{depth:0,customInspect:!1}))}}]),I}(),vr}var gr,_i;function Sn(){if(_i)return gr;_i=1;function e(l,s){var p=this,h=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return h||o?(s?s(l):l&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,se.nextTick(u,this,l)):se.nextTick(u,this,l)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(l||null,function(g){!s&&g?p._writableState?p._writableState.errorEmitted?se.nextTick(t,p):(p._writableState.errorEmitted=!0,se.nextTick(i,p,g)):se.nextTick(i,p,g):s?(se.nextTick(t,p),s(g)):se.nextTick(t,p)}),this)}function i(l,s){u(l,s),t(l)}function t(l){l._writableState&&!l._writableState.emitClose||l._readableState&&!l._readableState.emitClose||l.emit("close")}function r(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function u(l,s){l.emit("error",s)}function f(l,s){var p=l._readableState,h=l._writableState;p&&p.autoDestroy||h&&h.autoDestroy?l.destroy(s):l.emit("error",s)}return gr={destroy:e,undestroy:r,errorOrDestroy:f},gr}var wr={},pi;function xt(){if(pi)return wr;pi=1;function e(s,p){s.prototype=Object.create(p.prototype),s.prototype.constructor=s,s.__proto__=p}var i={};function t(s,p,h){h||(h=Error);function o(b,m,I){return typeof p=="string"?p:p(b,m,I)}var g=function(b){e(m,b);function m(I,C,L){return b.call(this,o(I,C,L))||this}return m}(h);g.prototype.name=h.name,g.prototype.code=s,i[s]=g}function r(s,p){if(Array.isArray(s)){var h=s.length;return s=s.map(function(o){return String(o)}),h>2?"one of ".concat(p," ").concat(s.slice(0,h-1).join(", "),", or ")+s[h-1]:h===2?"one of ".concat(p," ").concat(s[0]," or ").concat(s[1]):"of ".concat(p," ").concat(s[0])}else return"of ".concat(p," ").concat(String(s))}function u(s,p,h){return s.substr(!h||h<0?0:+h,p.length)===p}function f(s,p,h){return(h===void 0||h>s.length)&&(h=s.length),s.substring(h-p.length,h)===p}function l(s,p,h){return typeof h!="number"&&(h=0),h+p.length>s.length?!1:s.indexOf(p,h)!==-1}return t("ERR_INVALID_OPT_VALUE",function(s,p){return'The value "'+p+'" is invalid for option "'+s+'"'},TypeError),t("ERR_INVALID_ARG_TYPE",function(s,p,h){var o;typeof p=="string"&&u(p,"not ")?(o="must not be",p=p.replace(/^not /,"")):o="must be";var g;if(f(s," argument"))g="The ".concat(s," ").concat(o," ").concat(r(p,"type"));else{var b=l(s,".")?"property":"argument";g='The "'.concat(s,'" ').concat(b," ").concat(o," ").concat(r(p,"type"))}return g+=". Received type ".concat(typeof h),g},TypeError),t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),t("ERR_METHOD_NOT_IMPLEMENTED",function(s){return"The "+s+" method is not implemented"}),t("ERR_STREAM_PREMATURE_CLOSE","Premature close"),t("ERR_STREAM_DESTROYED",function(s){return"Cannot call "+s+" after a stream was destroyed"}),t("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),t("ERR_STREAM_WRITE_AFTER_END","write after end"),t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),t("ERR_UNKNOWN_ENCODING",function(s){return"Unknown encoding: "+s},TypeError),t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),wr.codes=i,wr}var br,vi;function Tn(){if(vi)return br;vi=1;var e=xt().codes.ERR_INVALID_OPT_VALUE;function i(r,u,f){return r.highWaterMark!=null?r.highWaterMark:u?r[f]:null}function t(r,u,f,l){var s=i(u,l,f);if(s!=null){if(!(isFinite(s)&&Math.floor(s)===s)||s<0){var p=l?f:"highWaterMark";throw new e(p,s)}return Math.floor(s)}return r.objectMode?16:16*1024}return br={getHighWaterMark:t},br}var yr,gi;function ti(){if(gi)return yr;gi=1,yr=Z;function e(x){var S=this;this.next=null,this.entry=null,this.finish=function(){ae(S,x)}}var i;Z.WritableState=z;var t={deprecate:wa()},r=Rn(),u=Tt.Buffer,f=(typeof Ee<"u"?Ee:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function l(x){return u.from(x)}function s(x){return u.isBuffer(x)||x instanceof f}var p=Sn(),h=Tn(),o=h.getHighWaterMark,g=xt().codes,b=g.ERR_INVALID_ARG_TYPE,m=g.ERR_METHOD_NOT_IMPLEMENTED,I=g.ERR_MULTIPLE_CALLBACK,C=g.ERR_STREAM_CANNOT_PIPE,L=g.ERR_STREAM_DESTROYED,w=g.ERR_STREAM_NULL_VALUES,A=g.ERR_STREAM_WRITE_AFTER_END,O=g.ERR_UNKNOWN_ENCODING,B=p.errorOrDestroy;lt(Z,r);function F(){}function z(x,S,P){i=i||dt(),x=x||{},typeof P!="boolean"&&(P=S instanceof i),this.objectMode=!!x.objectMode,P&&(this.objectMode=this.objectMode||!!x.writableObjectMode),this.highWaterMark=o(this,x,"writableHighWaterMark",P),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var W=x.decodeStrings===!1;this.decodeStrings=!W,this.defaultEncoding=x.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(V){we(S,V)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=x.emitClose!==!1,this.autoDestroy=!!x.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}z.prototype.getBuffer=function(){for(var S=this.bufferedRequest,P=[];S;)P.push(S),S=S.next;return P},function(){try{Object.defineProperty(z.prototype,"buffer",{get:t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var $;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?($=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z,Symbol.hasInstance,{value:function(S){return $.call(this,S)?!0:this!==Z?!1:S&&S._writableState instanceof z}})):$=function(S){return S instanceof this};function Z(x){i=i||dt();var S=this instanceof i;if(!S&&!$.call(Z,this))return new Z(x);this._writableState=new z(x,this,S),this.writable=!0,x&&(typeof x.write=="function"&&(this._write=x.write),typeof x.writev=="function"&&(this._writev=x.writev),typeof x.destroy=="function"&&(this._destroy=x.destroy),typeof x.final=="function"&&(this._final=x.final)),r.call(this)}Z.prototype.pipe=function(){B(this,new C)};function D(x,S){var P=new A;B(x,P),se.nextTick(S,P)}function re(x,S,P,W){var V;return P===null?V=new w:typeof P!="string"&&!S.objectMode&&(V=new b("chunk",["string","Buffer"],P)),V?(B(x,V),se.nextTick(W,V),!1):!0}Z.prototype.write=function(x,S,P){var W=this._writableState,V=!1,_=!W.objectMode&&s(x);return _&&!u.isBuffer(x)&&(x=l(x)),typeof S=="function"&&(P=S,S=null),_?S="buffer":S||(S=W.defaultEncoding),typeof P!="function"&&(P=F),W.ending?D(this,P):(_||re(this,W,x,P))&&(W.pendingcb++,V=E(this,W,_,x,S,P)),V},Z.prototype.cork=function(){this._writableState.corked++},Z.prototype.uncork=function(){var x=this._writableState;x.corked&&(x.corked--,!x.writing&&!x.corked&&!x.bufferProcessing&&x.bufferedRequest&&me(this,x))},Z.prototype.setDefaultEncoding=function(S){if(typeof S=="string"&&(S=S.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((S+"").toLowerCase())>-1))throw new O(S);return this._writableState.defaultEncoding=S,this},Object.defineProperty(Z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Y(x,S,P){return!x.objectMode&&x.decodeStrings!==!1&&typeof S=="string"&&(S=u.from(S,P)),S}Object.defineProperty(Z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function E(x,S,P,W,V,_){if(!P){var v=Y(S,W,V);W!==v&&(P=!0,V="buffer",W=v)}var M=S.objectMode?1:W.length;S.length+=M;var j=S.length */var bi;function Ia(){return bi||(bi=1,function(e,i){var t=Tt,r=t.Buffer;function u(l,s){for(var p in l)s[p]=l[p]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=t:(u(t,i),i.Buffer=f);function f(l,s,p){return r(l,s,p)}f.prototype=Object.create(r.prototype),u(r,f),f.from=function(l,s,p){if(typeof l=="number")throw new TypeError("Argument must not be a number");return r(l,s,p)},f.alloc=function(l,s,p){if(typeof l!="number")throw new TypeError("Argument must be a number");var h=r(l);return s!==void 0?typeof p=="string"?h.fill(s,p):h.fill(s):h.fill(0),h},f.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return r(l)},f.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(l)}}($t,$t.exports)),$t.exports}var yi;function mi(){if(yi)return Er;yi=1;var e=Ia().Buffer,i=e.isEncoding||function(w){switch(w=""+w,w&&w.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(w){if(!w)return"utf8";for(var A;;)switch(w){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return w;default:if(A)return;w=(""+w).toLowerCase(),A=!0}}function r(w){var A=t(w);if(typeof A!="string"&&(e.isEncoding===i||!i(w)))throw new Error("Unknown encoding: "+w);return A||w}Er.StringDecoder=u;function u(w){this.encoding=r(w);var A;switch(this.encoding){case"utf16le":this.text=g,this.end=b,A=4;break;case"utf8":this.fillLast=p,A=4;break;case"base64":this.text=m,this.end=I,A=3;break;default:this.write=C,this.end=L;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(A)}u.prototype.write=function(w){if(w.length===0)return"";var A,O;if(this.lastNeed){if(A=this.fillLast(w),A===void 0)return"";O=this.lastNeed,this.lastNeed=0}else O=0;return O>5===6?2:w>>4===14?3:w>>3===30?4:w>>6===2?-1:-2}function l(w,A,O){var B=A.length-1;if(B=0?(F>0&&(w.lastNeed=F-1),F):--B=0?(F>0&&(w.lastNeed=F-2),F):--B=0?(F>0&&(F===2?F=0:w.lastNeed=F-3),F):0))}function s(w,A,O){if((A[0]&192)!==128)return w.lastNeed=0,"�";if(w.lastNeed>1&&A.length>1){if((A[1]&192)!==128)return w.lastNeed=1,"�";if(w.lastNeed>2&&A.length>2&&(A[2]&192)!==128)return w.lastNeed=2,"�"}}function p(w){var A=this.lastTotal-this.lastNeed,O=s(this,w);if(O!==void 0)return O;if(this.lastNeed<=w.length)return w.copy(this.lastChar,A,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);w.copy(this.lastChar,A,0,w.length),this.lastNeed-=w.length}function h(w,A){var O=l(this,w,A);if(!this.lastNeed)return w.toString("utf8",A);this.lastTotal=O;var B=w.length-(O-this.lastNeed);return w.copy(this.lastChar,0,B),w.toString("utf8",A,B)}function o(w){var A=w&&w.length?this.write(w):"";return this.lastNeed?A+"�":A}function g(w,A){if((w.length-A)%2===0){var O=w.toString("utf16le",A);if(O){var B=O.charCodeAt(O.length-1);if(B>=55296&&B<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1],O.slice(0,-1)}return O}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=w[w.length-1],w.toString("utf16le",A,w.length-1)}function b(w){var A=w&&w.length?this.write(w):"";if(this.lastNeed){var O=this.lastTotal-this.lastNeed;return A+this.lastChar.toString("utf16le",0,O)}return A}function m(w,A){var O=(w.length-A)%3;return O===0?w.toString("base64",A):(this.lastNeed=3-O,this.lastTotal=3,O===1?this.lastChar[0]=w[w.length-1]:(this.lastChar[0]=w[w.length-2],this.lastChar[1]=w[w.length-1]),w.toString("base64",A,w.length-O))}function I(w){var A=w&&w.length?this.write(w):"";return this.lastNeed?A+this.lastChar.toString("base64",0,3-this.lastNeed):A}function C(w){return w.toString(this.encoding)}function L(w){return w&&w.length?this.write(w):""}return Er}var Rr,Ei;function or(){if(Ei)return Rr;Ei=1;var e=xt().codes.ERR_STREAM_PREMATURE_CLOSE;function i(f){var l=!1;return function(){if(!l){l=!0;for(var s=arguments.length,p=new Array(s),h=0;h0)if(typeof v!="string"&&!ee.objectMode&&Object.getPrototypeOf(v)!==r.prototype&&(v=f(v)),j)ee.endEmitted?F(_,new w):Y(_,ee,v,!0);else if(ee.ended)F(_,new C);else{if(ee.destroyed)return!1;ee.reading=!1,ee.decoder&&!M?(v=ee.decoder.write(v),ee.objectMode||v.length!==0?Y(_,ee,v,!1):me(_,ee)):Y(_,ee,v,!1)}else j||(ee.reading=!1,me(_,ee))}return!ee.ended&&(ee.length=U?_=U:(_--,_|=_>>>1,_|=_>>>2,_|=_>>>4,_|=_>>>8,_|=_>>>16,_++),_}function te(_,v){return _<=0||v.length===0&&v.ended?0:v.objectMode?1:_!==_?v.flowing&&v.length?v.buffer.head.data.length:v.length:(_>v.highWaterMark&&(v.highWaterMark=G(_)),_<=v.length?_:v.ended?v.length:(v.needReadable=!0,0))}D.prototype.read=function(_){p("read",_),_=parseInt(_,10);var v=this._readableState,M=_;if(_!==0&&(v.emittedReadable=!1),_===0&&v.needReadable&&((v.highWaterMark!==0?v.length>=v.highWaterMark:v.length>0)||v.ended))return p("read: emitReadable",v.length,v.ended),v.length===0&&v.ended?P(this):he(this),null;if(_=te(_,v),_===0&&v.ended)return v.length===0&&P(this),null;var j=v.needReadable;p("need readable",j),(v.length===0||v.length-_0?ce=S(_,v):ce=null,ce===null?(v.needReadable=v.length<=v.highWaterMark,_=0):(v.length-=_,v.awaitDrain=0),v.length===0&&(v.ended||(v.needReadable=!0),M!==_&&v.ended&&P(this)),ce!==null&&this.emit("data",ce),ce};function we(_,v){if(p("onEofChunk"),!v.ended){if(v.decoder){var M=v.decoder.end();M&&M.length&&(v.buffer.push(M),v.length+=v.objectMode?1:M.length)}v.ended=!0,v.sync?he(_):(v.needReadable=!1,v.emittedReadable||(v.emittedReadable=!0,fe(_)))}}function he(_){var v=_._readableState;p("emitReadable",v.needReadable,v.emittedReadable),v.needReadable=!1,v.emittedReadable||(p("emitReadable",v.flowing),v.emittedReadable=!0,se.nextTick(fe,_))}function fe(_){var v=_._readableState;p("emitReadable_",v.destroyed,v.length,v.ended),!v.destroyed&&(v.length||v.ended)&&(_.emit("readable"),v.emittedReadable=!1),v.needReadable=!v.flowing&&!v.ended&&v.length<=v.highWaterMark,x(_)}function me(_,v){v.readingMore||(v.readingMore=!0,se.nextTick(H,_,v))}function H(_,v){for(;!v.reading&&!v.ended&&(v.length1&&V(j.pipes,_)!==-1)&&!Xe&&(p("false write response, pause",j.awaitDrain),j.awaitDrain++),M.pause())}function Ve(J){p("onerror",J),T(),_.removeListener("error",Ve),i(_,"error")===0&&F(_,J)}$(_,"error",Ve);function R(){_.removeListener("finish",q),T()}_.once("close",R);function q(){p("onfinish"),_.removeListener("close",R),T()}_.once("finish",q);function T(){p("unpipe"),M.unpipe(_)}return _.emit("pipe",M),j.flowing||(p("pipe resume"),M.resume()),_};function X(_){return function(){var M=_._readableState;p("pipeOnDrain",M.awaitDrain),M.awaitDrain&&M.awaitDrain--,M.awaitDrain===0&&i(_,"data")&&(M.flowing=!0,x(_))}}D.prototype.unpipe=function(_){var v=this._readableState,M={hasUnpiped:!1};if(v.pipesCount===0)return this;if(v.pipesCount===1)return _&&_!==v.pipes?this:(_||(_=v.pipes),v.pipes=null,v.pipesCount=0,v.flowing=!1,_&&_.emit("unpipe",this,M),this);if(!_){var j=v.pipes,ce=v.pipesCount;v.pipes=null,v.pipesCount=0,v.flowing=!1;for(var ee=0;ee0,j.flowing!==!1&&this.resume()):_==="readable"&&!j.endEmitted&&!j.readableListening&&(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,p("on readable",j.length,j.reading),j.length?he(this):j.reading||se.nextTick(le,this)),M},D.prototype.addListener=D.prototype.on,D.prototype.removeListener=function(_,v){var M=t.prototype.removeListener.call(this,_,v);return _==="readable"&&se.nextTick(ie,this),M},D.prototype.removeAllListeners=function(_){var v=t.prototype.removeAllListeners.apply(this,arguments);return(_==="readable"||_===void 0)&&se.nextTick(ie,this),v};function ie(_){var v=_._readableState;v.readableListening=_.listenerCount("readable")>0,v.resumeScheduled&&!v.paused?v.flowing=!0:_.listenerCount("data")>0&&_.resume()}function le(_){p("readable nexttick read 0"),_.read(0)}D.prototype.resume=function(){var _=this._readableState;return _.flowing||(p("resume"),_.flowing=!_.readableListening,Q(this,_)),_.paused=!1,this};function Q(_,v){v.resumeScheduled||(v.resumeScheduled=!0,se.nextTick(ae,_,v))}function ae(_,v){p("resume",v.reading),v.reading||_.read(0),v.resumeScheduled=!1,_.emit("resume"),x(_),v.flowing&&!v.reading&&_.read(0)}D.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function x(_){var v=_._readableState;for(p("flow",v.flowing);v.flowing&&_.read()!==null;);}D.prototype.wrap=function(_){var v=this,M=this._readableState,j=!1;_.on("end",function(){if(p("wrapped end"),M.decoder&&!M.ended){var _e=M.decoder.end();_e&&_e.length&&v.push(_e)}v.push(null)}),_.on("data",function(_e){if(p("wrapped data"),M.decoder&&(_e=M.decoder.write(_e)),!(M.objectMode&&_e==null)&&!(!M.objectMode&&(!_e||!_e.length))){var Me=v.push(_e);Me||(j=!0,_.pause())}});for(var ce in _)this[ce]===void 0&&typeof _[ce]=="function"&&(this[ce]=function(Me){return function(){return _[Me].apply(_,arguments)}}(ce));for(var ee=0;ee=v.length?(v.decoder?M=v.buffer.join(""):v.buffer.length===1?M=v.buffer.first():M=v.buffer.concat(v.length),v.buffer.clear()):M=v.buffer.consume(_,v.decoder),M}function P(_){var v=_._readableState;p("endReadable",v.endEmitted),v.endEmitted||(v.ended=!0,se.nextTick(W,v,_))}function W(_,v){if(p("endReadableNT",_.endEmitted,_.length),!_.endEmitted&&_.length===0&&(_.endEmitted=!0,v.readable=!1,v.emit("end"),_.autoDestroy)){var M=v._writableState;(!M||M.autoDestroy&&M.finished)&&v.destroy()}}typeof Symbol=="function"&&(D.from=function(_,v){return B===void 0&&(B=Fa()),B(D,_,v)});function V(_,v){for(var M=0,j=_.length;M0;return s(A,B,F,function(z){L||(L=z),z&&w.forEach(p),!B&&(w.forEach(p),C(L))})});return m.reduce(h)}return Cr=g,Cr}var La=Ne,ni=Qr.EventEmitter,ka=lt;ka(Ne,ni);Ne.Readable=ri();Ne.Writable=ti();Ne.Duplex=dt();Ne.Transform=ii();Ne.PassThrough=xn();Ne.finished=or();Ne.pipeline=An();Ne.Stream=Ne;function Ne(){ni.call(this)}Ne.prototype.pipe=function(e,i){var t=this;function r(o){e.writable&&e.write(o)===!1&&t.pause&&t.pause()}t.on("data",r);function u(){t.readable&&t.resume&&t.resume()}e.on("drain",u),!e._isStdio&&(!i||i.end!==!1)&&(t.on("end",l),t.on("close",s));var f=!1;function l(){f||(f=!0,e.end())}function s(){f||(f=!0,typeof e.destroy=="function"&&e.destroy())}function p(o){if(h(),ni.listenerCount(this,"error")===0)throw o}t.on("error",p),e.on("error",p);function h(){t.removeListener("data",r),e.removeListener("drain",u),t.removeListener("end",l),t.removeListener("close",s),t.removeListener("error",p),e.removeListener("error",p),t.removeListener("end",h),t.removeListener("close",h),e.removeListener("close",h)}return t.on("end",h),t.on("close",h),e.on("close",h),e.emit("pipe",t),e};var Hr={exports:{}},Fr,Ci;function Ba(){if(Ci)return Fr;Ci=1;var e=1e3,i=e*60,t=i*60,r=t*24,u=r*7,f=r*365.25;Fr=function(o,g){g=g||{};var b=typeof o;if(b==="string"&&o.length>0)return l(o);if(b==="number"&&isFinite(o))return g.long?p(o):s(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function l(o){if(o=String(o),!(o.length>100)){var g=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(g){var b=parseFloat(g[1]),m=(g[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return b*f;case"weeks":case"week":case"w":return b*u;case"days":case"day":case"d":return b*r;case"hours":case"hour":case"hrs":case"hr":case"h":return b*t;case"minutes":case"minute":case"mins":case"min":case"m":return b*i;case"seconds":case"second":case"secs":case"sec":case"s":return b*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function s(o){var g=Math.abs(o);return g>=r?Math.round(o/r)+"d":g>=t?Math.round(o/t)+"h":g>=i?Math.round(o/i)+"m":g>=e?Math.round(o/e)+"s":o+"ms"}function p(o){var g=Math.abs(o);return g>=r?h(o,g,r,"day"):g>=t?h(o,g,t,"hour"):g>=i?h(o,g,i,"minute"):g>=e?h(o,g,e,"second"):o+" ms"}function h(o,g,b,m){var I=g>=b*1.5;return Math.round(o/b)+" "+m+(I?"s":"")}return Fr}function Na(e){t.debug=t,t.default=t,t.coerce=p,t.disable=f,t.enable=u,t.enabled=l,t.humanize=Ba(),t.destroy=h,Object.keys(e).forEach(o=>{t[o]=e[o]}),t.names=[],t.skips=[],t.formatters={};function i(o){let g=0;for(let b=0;b{if(z==="%%")return"%";B++;const Z=t.formatters[$];if(typeof Z=="function"){const D=L[B];z=Z.call(w,D),L.splice(B,1),B--}return z}),t.formatArgs.call(w,L),(w.log||t.log).apply(w,L)}return C.namespace=o,C.useColors=t.useColors(),C.color=t.selectColor(o),C.extend=r,C.destroy=t.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(m!==t.namespaces&&(m=t.namespaces,I=t.enabled(o)),I),set:L=>{b=L}}),typeof t.init=="function"&&t.init(C),C}function r(o,g){const b=t(this.namespace+(typeof g>"u"?":":g)+o);return b.log=this.log,b}function u(o){t.save(o),t.namespaces=o,t.names=[],t.skips=[];let g;const b=(typeof o=="string"?o:"").split(/[\s,]+/),m=b.length;for(g=0;g"-"+g)].join(",");return t.enable(""),o}function l(o){if(o[o.length-1]==="*")return!0;let g,b;for(g=0,b=t.skips.length;g{let h=!1;return()=>{h||(h=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),i.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function u(h){if(h[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+h[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const o="color: "+this.color;h.splice(1,0,o,"color: inherit");let g=0,b=0;h[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(g++,m==="%c"&&(b=g))}),h.splice(b,0,o)}i.log=console.debug||console.log||(()=>{});function f(h){try{h?i.storage.setItem("debug",h):i.storage.removeItem("debug")}catch{}}function l(){let h;try{h=i.storage.getItem("debug")}catch{}return!h&&typeof se<"u"&&"env"in se&&(h=t.DEBUG),h}function s(){try{return localStorage}catch{}}e.exports=Oa(i);const{formatters:p}=e.exports;p.j=function(h){try{return JSON.stringify(h)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}}})(Hr,Hr.exports);var Ma=Hr.exports;const jf=ga(Ma);var In={exports:{}},Cn={},Fn={exports:{}},ai={};(function(e){e.fetch=u(Ee.fetch)&&u(Ee.ReadableStream),e.writableStream=u(Ee.WritableStream),e.abortController=u(Ee.AbortController);var i;function t(){if(i!==void 0)return i;if(Ee.XMLHttpRequest){i=new Ee.XMLHttpRequest;try{i.open("GET",Ee.XDomainRequest?"/":"https://example.com")}catch{i=null}}else i=null;return i}function r(f){var l=t();if(!l)return!1;try{return l.responseType=f,l.responseType===f}catch{}return!1}e.arraybuffer=e.fetch||r("arraybuffer"),e.msstream=!e.fetch&&r("ms-stream"),e.mozchunkedarraybuffer=!e.fetch&&r("moz-chunked-arraybuffer"),e.overrideMimeType=e.fetch||(t()?u(t().overrideMimeType):!1);function u(f){return typeof f=="function"}i=null})(ai);var fr={},jr={exports:{}};(function(e,i){i=e.exports=ri(),i.Stream=i,i.Readable=i,i.Writable=ti(),i.Duplex=dt(),i.Transform=ii(),i.PassThrough=xn(),i.finished=or(),i.pipeline=An()})(jr,jr.exports);var Ln=jr.exports,Fi=ai,Da=lt,kn=Ln,Wt=fr.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},oi=fr.IncomingMessage=function(e,i,t,r){var u=this;if(kn.Readable.call(u),u._mode=t,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",function(){se.nextTick(function(){u.emit("close")})}),t==="fetch"){let o=function(){l.read().then(function(g){if(!u._destroyed){if(r(g.done),g.done){u.push(null);return}u.push(nt.from(g.value)),o()}}).catch(function(g){r(!0),u._destroyed||u.emit("error",g)})};if(u._fetchResponse=i,u.url=i.url,u.statusCode=i.status,u.statusMessage=i.statusText,i.headers.forEach(function(g,b){u.headers[b.toLowerCase()]=g,u.rawHeaders.push(b,g)}),Fi.writableStream){var f=new WritableStream({write:function(g){return r(!1),new Promise(function(b,m){u._destroyed?m():u.push(nt.from(g))?b():u._resumeFetch=b})},close:function(){r(!0),u._destroyed||u.push(null)},abort:function(g){r(!0),u._destroyed||u.emit("error",g)}});try{i.body.pipeTo(f).catch(function(g){r(!0),u._destroyed||u.emit("error",g)});return}catch{}}var l=i.body.getReader();o()}else{u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText;var s=e.getAllResponseHeaders().split(/\r?\n/);if(s.forEach(function(o){var g=o.match(/^([^:]+):\s*(.*)/);if(g){var b=g[1].toLowerCase();b==="set-cookie"?(u.headers[b]===void 0&&(u.headers[b]=[]),u.headers[b].push(g[2])):u.headers[b]!==void 0?u.headers[b]+=", "+g[2]:u.headers[b]=g[2],u.rawHeaders.push(g[1],g[2])}}),u._charset="x-user-defined",!Fi.overrideMimeType){var p=u.rawHeaders["mime-type"];if(p){var h=p.match(/;\s*charset=([^;])(;|$)/);h&&(u._charset=h[1].toLowerCase())}u._charset||(u._charset="utf-8")}}};Da(oi,kn.Readable);oi.prototype._read=function(){var e=this,i=e._resumeFetch;i&&(e._resumeFetch=null,i())};oi.prototype._onXHRProgress=function(e){var i=this,t=i._xhr,r=null;switch(i._mode){case"text":if(r=t.responseText,r.length>i._pos){var u=r.substr(i._pos);if(i._charset==="x-user-defined"){for(var f=nt.alloc(u.length),l=0;li._pos&&(i.push(nt.from(new Uint8Array(s.result.slice(i._pos)))),i._pos=s.result.byteLength)},s.onload=function(){e(!0),i.push(null)},s.readAsArrayBuffer(r);break}i._xhr.readyState===Wt.DONE&&i._mode!=="ms-stream"&&(e(!0),i.push(null))};var st=ai,Ua=lt,Bn=fr,fi=Ln,Pa=Bn.IncomingMessage,Li=Bn.readyStates;function Za(e,i){return st.fetch&&i?"fetch":st.mozchunkedarraybuffer?"moz-chunked-arraybuffer":st.msstream?"ms-stream":st.arraybuffer&&e?"arraybuffer":"text"}var xe=Fn.exports=function(e){var i=this;fi.Writable.call(i),i._opts=e,i._body=[],i._headers={},e.auth&&i.setHeader("Authorization","Basic "+nt.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(u){i.setHeader(u,e.headers[u])});var t,r=!0;if(e.mode==="disable-fetch"||"requestTimeout"in e&&!st.abortController)r=!1,t=!0;else if(e.mode==="prefer-streaming")t=!1;else if(e.mode==="allow-wrong-content-type")t=!st.overrideMimeType;else if(!e.mode||e.mode==="default"||e.mode==="prefer-fast")t=!0;else throw new Error("Invalid value for opts.mode");i._mode=Za(t,r),i._fetchTimer=null,i._socketTimeout=null,i._socketTimer=null,i.on("finish",function(){i._onFinish()})};Ua(xe,fi.Writable);xe.prototype.setHeader=function(e,i){var t=this,r=e.toLowerCase();qa.indexOf(r)===-1&&(t._headers[r]={name:e,value:i})};xe.prototype.getHeader=function(e){var i=this._headers[e.toLowerCase()];return i?i.value:null};xe.prototype.removeHeader=function(e){var i=this;delete i._headers[e.toLowerCase()]};xe.prototype._onFinish=function(){var e=this;if(!e._destroyed){var i=e._opts;"timeout"in i&&i.timeout!==0&&e.setTimeout(i.timeout);var t=e._headers,r=null;i.method!=="GET"&&i.method!=="HEAD"&&(r=new Blob(e._body,{type:(t["content-type"]||{}).value||""}));var u=[];if(Object.keys(t).forEach(function(p){var h=t[p].name,o=t[p].value;Array.isArray(o)?o.forEach(function(g){u.push([h,g])}):u.push([h,o])}),e._mode==="fetch"){var f=null;if(st.abortController){var l=new AbortController;f=l.signal,e._fetchAbortController=l,"requestTimeout"in i&&i.requestTimeout!==0&&(e._fetchTimer=Ee.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},i.requestTimeout))}Ee.fetch(e._opts.url,{method:e._opts.method,headers:u,body:r||void 0,mode:"cors",credentials:i.withCredentials?"include":"same-origin",signal:f}).then(function(p){e._fetchResponse=p,e._resetTimers(!1),e._connect()},function(p){e._resetTimers(!0),e._destroyed||e.emit("error",p)})}else{var s=e._xhr=new Ee.XMLHttpRequest;try{s.open(e._opts.method,e._opts.url,!0)}catch(p){se.nextTick(function(){e.emit("error",p)});return}"responseType"in s&&(s.responseType=e._mode),"withCredentials"in s&&(s.withCredentials=!!i.withCredentials),e._mode==="text"&&"overrideMimeType"in s&&s.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in i&&(s.timeout=i.requestTimeout,s.ontimeout=function(){e.emit("requestTimeout")}),u.forEach(function(p){s.setRequestHeader(p[0],p[1])}),e._response=null,s.onreadystatechange=function(){switch(s.readyState){case Li.LOADING:case Li.DONE:e._onXHRProgress();break}},e._mode==="moz-chunked-arraybuffer"&&(s.onprogress=function(){e._onXHRProgress()}),s.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{s.send(r)}catch(p){se.nextTick(function(){e.emit("error",p)});return}}}};function za(e){try{var i=e.status;return i!==null&&i!==0}catch{return!1}}xe.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),!(!za(e._xhr)||e._destroyed)&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))};xe.prototype._connect=function(){var e=this;e._destroyed||(e._response=new Pa(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",function(i){e.emit("error",i)}),e.emit("response",e._response))};xe.prototype._write=function(e,i,t){var r=this;r._body.push(e),t()};xe.prototype._resetTimers=function(e){var i=this;Ee.clearTimeout(i._socketTimer),i._socketTimer=null,e?(Ee.clearTimeout(i._fetchTimer),i._fetchTimer=null):i._socketTimeout&&(i._socketTimer=Ee.setTimeout(function(){i.emit("timeout")},i._socketTimeout))};xe.prototype.abort=xe.prototype.destroy=function(e){var i=this;i._destroyed=!0,i._resetTimers(!0),i._response&&(i._response._destroyed=!0),i._xhr?i._xhr.abort():i._fetchAbortController&&i._fetchAbortController.abort(),e&&i.emit("error",e)};xe.prototype.end=function(e,i,t){var r=this;typeof e=="function"&&(t=e,e=void 0),fi.Writable.prototype.end.call(r,e,i,t)};xe.prototype.setTimeout=function(e,i){var t=this;i&&t.once("timeout",i),t._socketTimeout=e,t._resetTimers(!1)};xe.prototype.flushHeaders=function(){};xe.prototype.setNoDelay=function(){};xe.prototype.setSocketKeepAlive=function(){};var qa=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],Ha=Fn.exports,ja=Wa,$a=Object.prototype.hasOwnProperty;function Wa(){for(var e={},i=0;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},B=p-h,F=Math.floor,z=String.fromCharCode,$;function Z(H){throw new RangeError(O[H])}function D(H,X){for(var ie=H.length,le=[];ie--;)le[ie]=X(H[ie]);return le}function re(H,X){var ie=H.split("@"),le="";ie.length>1&&(le=ie[0]+"@",H=ie[1]),H=H.replace(A,".");var Q=H.split("."),ae=D(Q,X).join(".");return le+ae}function Y(H){for(var X=[],ie=0,le=H.length,Q,ae;ie=55296&&Q<=56319&&ie65535&&(X-=65536,ie+=z(X>>>10&1023|55296),X=56320|X&1023),ie+=z(X),ie}).join("")}function U(H){return H-48<10?H-22:H-65<26?H-65:H-97<26?H-97:p}function G(H,X){return H+22+75*(H<26)-((X!=0)<<5)}function te(H,X,ie){var le=0;for(H=ie?F(H/b):H>>1,H+=F(H/X);H>B*o>>1;le+=p)H=F(H/B);return F(le+(B+1)*H/(H+g))}function we(H){var X=[],ie=H.length,le,Q=0,ae=I,x=m,S,P,W,V,_,v,M,j,ce;for(S=H.lastIndexOf(C),S<0&&(S=0),P=0;P=128&&Z("not-basic"),X.push(H.charCodeAt(P));for(W=S>0?S+1:0;W=ie&&Z("invalid-input"),M=U(H.charCodeAt(W++)),(M>=p||M>F((s-Q)/_))&&Z("overflow"),Q+=M*_,j=v<=x?h:v>=x+o?o:v-x,!(MF(s/ce)&&Z("overflow"),_*=ce;le=X.length+1,x=te(Q-V,le,V==0),F(Q/le)>s-ae&&Z("overflow"),ae+=F(Q/le),Q%=le,X.splice(Q++,0,ae)}return E(X)}function he(H){var X,ie,le,Q,ae,x,S,P,W,V,_,v=[],M,j,ce,ee;for(H=Y(H),M=H.length,X=I,ie=0,ae=m,x=0;x=X&&_F((s-ie)/j)&&Z("overflow"),ie+=(S-X)*j,X=S,x=0;xs&&Z("overflow"),_==X){for(P=ie,W=p;V=W<=ae?h:W>=ae+o?o:W-ae,!(P0&&s>l&&(s=l);for(var p=0;p=0?(g=h.substr(0,o),b=h.substr(o+1)):(g=h,b=""),m=decodeURIComponent(g),I=decodeURIComponent(b),Ya(u,m)?Va(u[m])?u[m].push(I):u[m]=[u[m],I]:u[m]=I}return u},Va=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},Lt=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},Ja=function(e,i,t,r){return i=i||"&",t=t||"=",e===null&&(e=void 0),typeof e=="object"?ki(eo(e),function(u){var f=encodeURIComponent(Lt(u))+t;return Qa(e[u])?ki(e[u],function(l){return f+encodeURIComponent(Lt(l))}).join(i):f+encodeURIComponent(Lt(e[u]))}).join(i):r?encodeURIComponent(Lt(r))+t+encodeURIComponent(Lt(e)):""},Qa=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function ki(e,i){if(e.map)return e.map(i);for(var t=[],r=0;r",'"',"`"," ","\r",` -`," "],B=["{","}","|","\\","^","`"].concat(O),F=["'"].concat(B),z=["%","/","?",";","#"].concat(F),$=["/","?","#"],Z=255,D=/^[+a-z0-9A-Z_-]{0,63}$/,re=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Y={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},U={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},G=l.default;function te(R,q,T){if(R&&h.isObject(R)&&R instanceof C)return R;var J=new C;return J.parse(R,q,T),J}C.prototype.parse=function(R,q,T){if(!h.isString(R))throw new TypeError("Parameter 'url' must be a string, not "+typeof R);var J=R.indexOf("?"),ne=J!==-1&&J127?De+="x":De+=ze[Ue];if(!De.match(D)){var et=oe.slice(0,K),qe=oe.slice(K+1),bt=ze.match(re);bt&&(et.push(bt[1]),qe.unshift(bt[2])),qe.length&&(n="/"+qe.join(".")+n),this.hostname=et.join(".");break}}}this.hostname.length>Z?this.hostname="":this.hostname=this.hostname.toLowerCase(),pe||(this.hostname=p.toASCII(this.hostname));var hr=this.port?":"+this.port:"",pa=this.hostname||"";this.host=pa+hr,this.href+=this.host,pe&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),n[0]!=="/"&&(n="/"+n))}if(!Y[y])for(var K=0,Re=F.length;K0?T.host.split("@"):!1;De&&(T.auth=De.shift(),T.host=T.hostname=De.shift())}return T.search=R.search,T.query=R.query,(!h.isNull(T.pathname)||!h.isNull(T.search))&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.href=T.format(),T}if(!oe.length)return T.pathname=null,T.search?T.path="/"+T.search:T.path=null,T.href=T.format(),T;for(var Ue=oe.slice(-1)[0],sr=(T.host||R.host||oe.length>1)&&(Ue==="."||Ue==="..")||Ue==="",et=0,qe=oe.length;qe>=0;qe--)Ue=oe[qe],Ue==="."?oe.splice(qe,1):Ue===".."?(oe.splice(qe,1),et++):et&&(oe.splice(qe,1),et--);if(!ue&&!pe)for(;et--;et)oe.unshift("..");ue&&oe[0]!==""&&(!oe[0]||oe[0].charAt(0)!=="/")&&oe.unshift(""),sr&&oe.join("/").substr(-1)!=="/"&&oe.push("");var bt=oe[0]===""||oe[0]&&oe[0].charAt(0)==="/";if(ze){T.hostname=T.host=bt?"":oe.length?oe.shift():"";var De=T.host&&T.host.indexOf("@")>0?T.host.split("@"):!1;De&&(T.auth=De.shift(),T.host=T.hostname=De.shift())}return ue=ue||T.host&&oe.length,ue&&!bt&&oe.unshift(""),oe.length?T.pathname=oe.join("/"):(T.pathname=null,T.path=null),(!h.isNull(T.pathname)||!h.isNull(T.search))&&(T.path=(T.pathname?T.pathname:"")+(T.search?T.search:"")),T.auth=R.auth||T.auth,T.slashes=T.slashes||R.slashes,T.href=T.format(),T},C.prototype.parseHost=function(){var R=this.host,q=w.exec(R);q&&(q=q[0],q!==":"&&(this.port=q.substr(1)),R=R.substr(0,R.length-q.length)),R&&(this.hostname=R)};function me(R,q){for(var T=0,J=R.length-1;J>=0;J--){var ne=R[J];ne==="."?R.splice(J,1):ne===".."?(R.splice(J,1),T++):T&&(R.splice(J,1),T--)}if(q)for(;T--;T)R.unshift("..");return R}function H(){for(var R="",q=!1,T=arguments.length-1;T>=-1&&!q;T--){var J=T>=0?arguments[T]:"/";if(typeof J!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!J)continue;R=J+"/"+R,q=J.charAt(0)==="/"}return R=me(X(R.split("/"),function(ne){return!!ne}),!q).join("/"),(q?"/":"")+R||"."}function X(R,q){if(R.filter)return R.filter(q);for(var T=[],J=0;J"u")throw new TypeError('The "domain" argument must be specified');return new S("http://"+q).hostname},Ye=function(q){if(typeof q>"u")throw new TypeError('The "domain" argument must be specified');return new S("http://"+q).hostname},Xe=function(q){var T=new S("file://"),J=H(q),ne=q.charCodeAt(q.length-1);return ne===j&&J[J.length-1]!=="/"&&(J+="/"),T.pathname=_e(J),T},wt=function(q){if(!ce(q)&&typeof q!="string")throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type '+typeof q+" ("+q+")");var T=new S(q);if(T.protocol!=="file:")throw new TypeError("The URL must be of scheme file");return ee(T)},ut=function(q,T){var J,ne,Ae;if(T===void 0&&(T={}),!(q instanceof S))return le(q);if(typeof T!="object"||T===null)throw new TypeError('The "options" argument must be of type object.');var c=(J=T.auth)!=null?J:!0,n=(ne=T.fragment)!=null?ne:!0,a=(Ae=T.search)!=null?Ae:!0,d=new S(q.toString());return c||(d.username="",d.password=""),n||(d.hash=""),a||(d.search=""),d.toString()},Ve={format:ut,parse:Q,resolve:ae,resolveObject:b,Url:x,URL:S,URLSearchParams:P,domainToASCII:Me,domainToUnicode:Ye,pathToFileURL:Xe,fileURLToPath:wt};i.URL=S,i.URLSearchParams=P,i.Url=x,i.default=Ve,i.domainToASCII=Me,i.domainToUnicode=Ye,i.fileURLToPath=wt,i.format=ut,i.parse=Q,i.pathToFileURL=Xe,i.resolve=ae,i.resolveObject=b,i=e.exports=Ve})($r,$r.exports);var Nn=$r.exports;(function(e){var i=Ha,t=fr,r=ja,u=Ga,f=Nn,l=e;l.request=function(s,p){typeof s=="string"?s=f.parse(s):s=r(s);var h=Ee.location.protocol.search(/^https?:$/)===-1?"http:":"",o=s.protocol||h,g=s.hostname||s.host,b=s.port,m=s.path||"/";g&&g.indexOf(":")!==-1&&(g="["+g+"]"),s.url=(g?o+"//"+g:"")+(b?":"+b:"")+m,s.method=(s.method||"GET").toUpperCase(),s.headers=s.headers||{};var I=new i(s);return p&&I.on("response",p),I},l.get=function(p,h){var o=l.request(p,h);return o.end(),o},l.ClientRequest=i,l.IncomingMessage=t.IncomingMessage,l.Agent=function(){},l.Agent.defaultMaxSockets=4,l.globalAgent=new l.Agent,l.STATUS_CODES=u,l.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]})(Cn);(function(e){var i=Cn,t=Nn,r=e.exports;for(var u in i)i.hasOwnProperty(u)&&(r[u]=i[u]);r.request=function(l,s){return l=f(l),i.request.call(this,l,s)},r.get=function(l,s){return l=f(l),i.get.call(this,l,s)};function f(l){if(typeof l=="string"&&(l=t.parse(l)),l.protocol||(l.protocol="https:"),l.protocol!=="https:")throw new Error('Protocol "'+l.protocol+'" not supported. Expected "https:"');return l}})(In);var $f=In.exports,ro={},On={};function io(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var no=io,Ke={},zt={};(function(e){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(f,l){return Object.prototype.hasOwnProperty.call(f,l)}e.assign=function(f){for(var l=Array.prototype.slice.call(arguments,1);l.length;){var s=l.shift();if(s){if(typeof s!="object")throw new TypeError(s+"must be non-object");for(var p in s)t(s,p)&&(f[p]=s[p])}}return f},e.shrinkBuf=function(f,l){return f.length===l?f:f.subarray?f.subarray(0,l):(f.length=l,f)};var r={arraySet:function(f,l,s,p,h){if(l.subarray&&f.subarray){f.set(l.subarray(s,s+p),h);return}for(var o=0;o=0;)e[i]=0}var lo=0,Mn=1,uo=2,so=3,ho=258,li=29,qt=256,Dt=qt+1+li,St=30,ui=19,Dn=2*Dt+1,ht=15,Lr=16,co=7,si=256,Un=16,Pn=17,Zn=18,Gr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Jt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],zn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],po=512,Qe=new Array((Dt+2)*2);It(Qe);var Nt=new Array(St*2);It(Nt);var Ut=new Array(po);It(Ut);var Pt=new Array(ho-so+1);It(Pt);var hi=new Array(li);It(hi);var ir=new Array(St);It(ir);function kr(e,i,t,r,u){this.static_tree=e,this.extra_bits=i,this.extra_base=t,this.elems=r,this.max_length=u,this.has_stree=e&&e.length}var qn,Hn,jn;function Br(e,i){this.dyn_tree=e,this.max_code=0,this.stat_desc=i}function $n(e){return e<256?Ut[e]:Ut[256+(e>>>7)]}function Zt(e,i){e.pending_buf[e.pending++]=i&255,e.pending_buf[e.pending++]=i>>>8&255}function Ce(e,i,t){e.bi_valid>Lr-t?(e.bi_buf|=i<>Lr-e.bi_valid,e.bi_valid+=t-Lr):(e.bi_buf|=i<>>=1,t<<=1;while(--i>0);return t>>>1}function vo(e){e.bi_valid===16?(Zt(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function go(e,i){var t=i.dyn_tree,r=i.max_code,u=i.stat_desc.static_tree,f=i.stat_desc.has_stree,l=i.stat_desc.extra_bits,s=i.stat_desc.extra_base,p=i.stat_desc.max_length,h,o,g,b,m,I,C=0;for(b=0;b<=ht;b++)e.bl_count[b]=0;for(t[e.heap[e.heap_max]*2+1]=0,h=e.heap_max+1;hp&&(b=p,C++),t[o*2+1]=b,!(o>r)&&(e.bl_count[b]++,m=0,o>=s&&(m=l[o-s]),I=t[o*2],e.opt_len+=I*(b+m),f&&(e.static_len+=I*(u[o*2+1]+m)));if(C!==0){do{for(b=p-1;e.bl_count[b]===0;)b--;e.bl_count[b]--,e.bl_count[b+1]+=2,e.bl_count[p]--,C-=2}while(C>0);for(b=p;b!==0;b--)for(o=e.bl_count[b];o!==0;)g=e.heap[--h],!(g>r)&&(t[g*2+1]!==b&&(e.opt_len+=(b-t[g*2+1])*t[g*2],t[g*2+1]=b),o--)}}function Gn(e,i,t){var r=new Array(ht+1),u=0,f,l;for(f=1;f<=ht;f++)r[f]=u=u+t[f-1]<<1;for(l=0;l<=i;l++){var s=e[l*2+1];s!==0&&(e[l*2]=Wn(r[s]++,s))}}function wo(){var e,i,t,r,u,f=new Array(ht+1);for(t=0,r=0;r>=7;r8?Zt(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function bo(e,i,t,r){Yn(e),r&&(Zt(e,t),Zt(e,~t)),ao.arraySet(e.pending_buf,e.window,i,t,e.pending),e.pending+=t}function Oi(e,i,t,r){var u=i*2,f=t*2;return e[u]>1;l>=1;l--)Nr(e,t,l);h=f;do l=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Nr(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=l,e.heap[--e.heap_max]=s,t[h*2]=t[l*2]+t[s*2],e.depth[h]=(e.depth[l]>=e.depth[s]?e.depth[l]:e.depth[s])+1,t[l*2+1]=t[s*2+1]=h,e.heap[1]=h++,Nr(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],go(e,i),Gn(t,p,e.bl_count)}function Di(e,i,t){var r,u=-1,f,l=i[0*2+1],s=0,p=7,h=4;for(l===0&&(p=138,h=3),i[(t+1)*2+1]=65535,r=0;r<=t;r++)f=l,l=i[(r+1)*2+1],!(++s=3&&e.bl_tree[zn[i]*2+1]===0;i--);return e.opt_len+=3*(i+1)+5+5+4,i}function mo(e,i,t,r){var u;for(Ce(e,i-257,5),Ce(e,t-1,5),Ce(e,r-4,4),u=0;u>>=1)if(i&1&&e.dyn_ltree[t*2]!==0)return Bi;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Ni;for(t=32;t0?(e.strm.data_type===fo&&(e.strm.data_type=Eo(e)),Kr(e,e.l_desc),Kr(e,e.d_desc),l=yo(e),u=e.opt_len+3+7>>>3,f=e.static_len+3+7>>>3,f<=u&&(u=f)):u=f=t+5,t+4<=u&&i!==-1?Xn(e,i,t,r):e.strategy===oo||f===u?(Ce(e,(Mn<<1)+(r?1:0),3),Mi(e,Qe,Nt)):(Ce(e,(uo<<1)+(r?1:0),3),mo(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),Mi(e,e.dyn_ltree,e.dyn_dtree)),Kn(e),r&&Yn(e)}function xo(e,i,t){return e.pending_buf[e.d_buf+e.last_lit*2]=i>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=i&255,e.pending_buf[e.l_buf+e.last_lit]=t&255,e.last_lit++,i===0?e.dyn_ltree[t*2]++:(e.matches++,i--,e.dyn_ltree[(Pt[t]+qt+1)*2]++,e.dyn_dtree[$n(i)*2]++),e.last_lit===e.lit_bufsize-1}At._tr_init=Ro;At._tr_stored_block=Xn;At._tr_flush_block=To;At._tr_tally=xo;At._tr_align=So;function Ao(e,i,t,r){for(var u=e&65535|0,f=e>>>16&65535|0,l=0;t!==0;){l=t>2e3?2e3:t,t-=l;do u=u+i[r++]|0,f=f+u|0;while(--l);u%=65521,f%=65521}return u|f<<16|0}var Vn=Ao;function Io(){for(var e,i=[],t=0;t<256;t++){e=t;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;i[t]=e}return i}var Co=Io();function Fo(e,i,t,r){var u=Co,f=r+t;e^=-1;for(var l=r;l>>8^u[(e^i[l])&255];return e^-1}var Jn=Fo,Lo={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ie=zt,ke=At,Qn=Vn,tt=Jn,ko=Lo,gt=0,Bo=1,No=3,ft=4,Zi=5,Ge=0,zi=1,Be=-2,Oo=-3,Or=-5,Mo=-1,Do=1,Gt=2,Uo=3,Po=4,Zo=0,zo=2,lr=8,qo=9,Ho=15,jo=8,$o=29,Wo=256,Yr=Wo+1+$o,Go=30,Ko=19,Yo=2*Yr+1,Xo=15,de=3,at=258,Pe=at+de+1,Vo=32,ur=42,Xr=69,Qt=73,er=91,tr=103,ct=113,Bt=666,Se=1,Ht=2,_t=3,Ct=4,Jo=3;function ot(e,i){return e.msg=ko[i],i}function qi(e){return(e<<1)-(e>4?9:0)}function it(e){for(var i=e.length;--i>=0;)e[i]=0}function rt(e){var i=e.state,t=i.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(Ie.arraySet(e.output,i.pending_buf,i.pending_out,t,e.next_out),e.next_out+=t,i.pending_out+=t,e.total_out+=t,e.avail_out-=t,i.pending-=t,i.pending===0&&(i.pending_out=0))}function Te(e,i){ke._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,i),e.block_start=e.strstart,rt(e.strm)}function ge(e,i){e.pending_buf[e.pending++]=i}function kt(e,i){e.pending_buf[e.pending++]=i>>>8&255,e.pending_buf[e.pending++]=i&255}function Qo(e,i,t,r){var u=e.avail_in;return u>r&&(u=r),u===0?0:(e.avail_in-=u,Ie.arraySet(i,e.input,e.next_in,u,t),e.state.wrap===1?e.adler=Qn(e.adler,i,u,t):e.state.wrap===2&&(e.adler=tt(e.adler,i,u,t)),e.next_in+=u,e.total_in+=u,u)}function ea(e,i){var t=e.max_chain_length,r=e.strstart,u,f,l=e.prev_length,s=e.nice_match,p=e.strstart>e.w_size-Pe?e.strstart-(e.w_size-Pe):0,h=e.window,o=e.w_mask,g=e.prev,b=e.strstart+at,m=h[r+l-1],I=h[r+l];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(u=i,!(h[u+l]!==I||h[u+l-1]!==m||h[u]!==h[r]||h[++u]!==h[r+1])){r+=2,u++;do;while(h[++r]===h[++u]&&h[++r]===h[++u]&&h[++r]===h[++u]&&h[++r]===h[++u]&&h[++r]===h[++u]&&h[++r]===h[++u]&&h[++r]===h[++u]&&h[++r]===h[++u]&&rl){if(e.match_start=i,l=f,f>=s)break;m=h[r+l-1],I=h[r+l]}}while((i=g[i&o])>p&&--t!==0);return l<=e.lookahead?l:e.lookahead}function pt(e){var i=e.w_size,t,r,u,f,l;do{if(f=e.window_size-e.lookahead-e.strstart,e.strstart>=i+(i-Pe)){Ie.arraySet(e.window,e.window,i,i,0),e.match_start-=i,e.strstart-=i,e.block_start-=i,r=e.hash_size,t=r;do u=e.head[--t],e.head[t]=u>=i?u-i:0;while(--r);r=i,t=r;do u=e.prev[--t],e.prev[t]=u>=i?u-i:0;while(--r);f+=i}if(e.strm.avail_in===0)break;if(r=Qo(e.strm,e.window,e.strstart+e.lookahead,f),e.lookahead+=r,e.lookahead+e.insert>=de)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(pt(e),e.lookahead===0&&i===gt)return Se;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+t;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Te(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-Pe&&(Te(e,!1),e.strm.avail_out===0))return Se}return e.insert=0,i===ft?(Te(e,!0),e.strm.avail_out===0?_t:Ct):(e.strstart>e.block_start&&(Te(e,!1),e.strm.avail_out===0),Se)}function Mr(e,i){for(var t,r;;){if(e.lookahead=de&&(e.ins_h=(e.ins_h<=de)if(r=ke._tr_tally(e,e.strstart-e.match_start,e.match_length-de),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=de){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<=de&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=de-1)),e.prev_length>=de&&e.match_length<=e.prev_length){u=e.strstart+e.lookahead-de,r=ke._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-de),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=u&&(e.ins_h=(e.ins_h<=de&&e.strstart>0&&(u=e.strstart-1,r=l[u],r===l[++u]&&r===l[++u]&&r===l[++u])){f=e.strstart+at;do;while(r===l[++u]&&r===l[++u]&&r===l[++u]&&r===l[++u]&&r===l[++u]&&r===l[++u]&&r===l[++u]&&r===l[++u]&&ue.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=de?(t=ke._tr_tally(e,1,e.match_length-de),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=ke._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(Te(e,!1),e.strm.avail_out===0))return Se}return e.insert=0,i===ft?(Te(e,!0),e.strm.avail_out===0?_t:Ct):e.last_lit&&(Te(e,!1),e.strm.avail_out===0)?Se:Ht}function rf(e,i){for(var t;;){if(e.lookahead===0&&(pt(e),e.lookahead===0)){if(i===gt)return Se;break}if(e.match_length=0,t=ke._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(Te(e,!1),e.strm.avail_out===0))return Se}return e.insert=0,i===ft?(Te(e,!0),e.strm.avail_out===0?_t:Ct):e.last_lit&&(Te(e,!1),e.strm.avail_out===0)?Se:Ht}function He(e,i,t,r,u){this.good_length=e,this.max_lazy=i,this.nice_length=t,this.max_chain=r,this.func=u}var Rt;Rt=[new He(0,0,0,0,ef),new He(4,4,8,4,Mr),new He(4,5,16,8,Mr),new He(4,6,32,32,Mr),new He(4,4,16,16,mt),new He(8,16,32,32,mt),new He(8,16,128,128,mt),new He(8,32,128,256,mt),new He(32,128,258,1024,mt),new He(32,258,258,4096,mt)];function nf(e){e.window_size=2*e.w_size,it(e.head),e.max_lazy_match=Rt[e.level].max_lazy,e.good_match=Rt[e.level].good_length,e.nice_match=Rt[e.level].nice_length,e.max_chain_length=Rt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=de-1,e.match_available=0,e.ins_h=0}function af(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=lr,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Ie.Buf16(Yo*2),this.dyn_dtree=new Ie.Buf16((2*Go+1)*2),this.bl_tree=new Ie.Buf16((2*Ko+1)*2),it(this.dyn_ltree),it(this.dyn_dtree),it(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ie.Buf16(Xo+1),this.heap=new Ie.Buf16(2*Yr+1),it(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ie.Buf16(2*Yr+1),it(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ta(e){var i;return!e||!e.state?ot(e,Be):(e.total_in=e.total_out=0,e.data_type=zo,i=e.state,i.pending=0,i.pending_out=0,i.wrap<0&&(i.wrap=-i.wrap),i.status=i.wrap?ur:ct,e.adler=i.wrap===2?0:1,i.last_flush=gt,ke._tr_init(i),Ge)}function ra(e){var i=ta(e);return i===Ge&&nf(e.state),i}function of(e,i){return!e||!e.state||e.state.wrap!==2?Be:(e.state.gzhead=i,Ge)}function ia(e,i,t,r,u,f){if(!e)return Be;var l=1;if(i===Mo&&(i=6),r<0?(l=0,r=-r):r>15&&(l=2,r-=16),u<1||u>qo||t!==lr||r<8||r>15||i<0||i>9||f<0||f>Po)return ot(e,Be);r===8&&(r=9);var s=new af;return e.state=s,s.strm=e,s.wrap=l,s.gzhead=null,s.w_bits=r,s.w_size=1<Zi||i<0)return e?ot(e,Be):Be;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===Bt&&i!==ft)return ot(e,e.avail_out===0?Or:Be);if(r.strm=e,t=r.last_flush,r.last_flush=i,r.status===ur)if(r.wrap===2)e.adler=0,ge(r,31),ge(r,139),ge(r,8),r.gzhead?(ge(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ge(r,r.gzhead.time&255),ge(r,r.gzhead.time>>8&255),ge(r,r.gzhead.time>>16&255),ge(r,r.gzhead.time>>24&255),ge(r,r.level===9?2:r.strategy>=Gt||r.level<2?4:0),ge(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ge(r,r.gzhead.extra.length&255),ge(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=tt(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Xr):(ge(r,0),ge(r,0),ge(r,0),ge(r,0),ge(r,0),ge(r,r.level===9?2:r.strategy>=Gt||r.level<2?4:0),ge(r,Jo),r.status=ct);else{var l=lr+(r.w_bits-8<<4)<<8,s=-1;r.strategy>=Gt||r.level<2?s=0:r.level<6?s=1:r.level===6?s=2:s=3,l|=s<<6,r.strstart!==0&&(l|=Vo),l+=31-l%31,r.status=ct,kt(r,l),r.strstart!==0&&(kt(r,e.adler>>>16),kt(r,e.adler&65535)),e.adler=1}if(r.status===Xr)if(r.gzhead.extra){for(u=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>u&&(e.adler=tt(e.adler,r.pending_buf,r.pending-u,u)),rt(e),u=r.pending,r.pending===r.pending_buf_size));)ge(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>u&&(e.adler=tt(e.adler,r.pending_buf,r.pending-u,u)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Qt)}else r.status=Qt;if(r.status===Qt)if(r.gzhead.name){u=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>u&&(e.adler=tt(e.adler,r.pending_buf,r.pending-u,u)),rt(e),u=r.pending,r.pending===r.pending_buf_size)){f=1;break}r.gzindexu&&(e.adler=tt(e.adler,r.pending_buf,r.pending-u,u)),f===0&&(r.gzindex=0,r.status=er)}else r.status=er;if(r.status===er)if(r.gzhead.comment){u=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>u&&(e.adler=tt(e.adler,r.pending_buf,r.pending-u,u)),rt(e),u=r.pending,r.pending===r.pending_buf_size)){f=1;break}r.gzindexu&&(e.adler=tt(e.adler,r.pending_buf,r.pending-u,u)),f===0&&(r.status=tr)}else r.status=tr;if(r.status===tr&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&rt(e),r.pending+2<=r.pending_buf_size&&(ge(r,e.adler&255),ge(r,e.adler>>8&255),e.adler=0,r.status=ct)):r.status=ct),r.pending!==0){if(rt(e),e.avail_out===0)return r.last_flush=-1,Ge}else if(e.avail_in===0&&qi(i)<=qi(t)&&i!==ft)return ot(e,Or);if(r.status===Bt&&e.avail_in!==0)return ot(e,Or);if(e.avail_in!==0||r.lookahead!==0||i!==gt&&r.status!==Bt){var p=r.strategy===Gt?rf(r,i):r.strategy===Uo?tf(r,i):Rt[r.level].func(r,i);if((p===_t||p===Ct)&&(r.status=Bt),p===Se||p===_t)return e.avail_out===0&&(r.last_flush=-1),Ge;if(p===Ht&&(i===Bo?ke._tr_align(r):i!==Zi&&(ke._tr_stored_block(r,0,0,!1),i===No&&(it(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),rt(e),e.avail_out===0))return r.last_flush=-1,Ge}return i!==ft?Ge:r.wrap<=0?zi:(r.wrap===2?(ge(r,e.adler&255),ge(r,e.adler>>8&255),ge(r,e.adler>>16&255),ge(r,e.adler>>24&255),ge(r,e.total_in&255),ge(r,e.total_in>>8&255),ge(r,e.total_in>>16&255),ge(r,e.total_in>>24&255)):(kt(r,e.adler>>>16),kt(r,e.adler&65535)),rt(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Ge:zi)}function uf(e){var i;return!e||!e.state?Be:(i=e.state.status,i!==ur&&i!==Xr&&i!==Qt&&i!==er&&i!==tr&&i!==ct&&i!==Bt?ot(e,Be):(e.state=null,i===ct?ot(e,Oo):Ge))}function sf(e,i){var t=i.length,r,u,f,l,s,p,h,o;if(!e||!e.state||(r=e.state,l=r.wrap,l===2||l===1&&r.status!==ur||r.lookahead))return Be;for(l===1&&(e.adler=Qn(e.adler,i,t,0)),r.wrap=0,t>=r.w_size&&(l===0&&(it(r.head),r.strstart=0,r.block_start=0,r.insert=0),o=new Ie.Buf8(r.w_size),Ie.arraySet(o,i,t-r.w_size,r.w_size,0),i=o,t=r.w_size),s=e.avail_in,p=e.next_in,h=e.input,e.avail_in=t,e.next_in=0,e.input=i,pt(r);r.lookahead>=de;){u=r.strstart,f=r.lookahead-(de-1);do r.ins_h=(r.ins_h<>>24,I>>>=F,C-=F,F=B>>>16&255,F===0)Y[l++]=B&65535;else if(F&16){z=B&65535,F&=15,F&&(C>>=F,C-=F),C<15&&(I+=re[u++]<>>24,I>>>=F,C-=F,F=B>>>16&255,F&16){if($=B&65535,F&=15,Ch){i.msg="invalid distance too far back",r.mode=Kt;break e}if(I>>>=F,C-=F,F=l-s,$>F){if(F=$-F,F>g&&r.sane){i.msg="invalid distance too far back",r.mode=Kt;break e}if(Z=0,D=m,b===0){if(Z+=o-F,F2;)Y[l++]=D[Z++],Y[l++]=D[Z++],Y[l++]=D[Z++],z-=3;z&&(Y[l++]=D[Z++],z>1&&(Y[l++]=D[Z++]))}else{Z=l-$;do Y[l++]=Y[Z++],Y[l++]=Y[Z++],Y[l++]=Y[Z++],z-=3;while(z>2);z&&(Y[l++]=Y[Z++],z>1&&(Y[l++]=Y[Z++]))}}else if(F&64){i.msg="invalid distance code",r.mode=Kt;break e}else{B=w[(B&65535)+(I&(1<>3,u-=z,C-=z<<3,I&=(1<=1&&E[m]===0;m--);if(I>m&&(I=m),m===0)return f[l++]=1<<24|64<<16|0,f[l++]=1<<24|64<<16|0,p.bits=1,0;for(b=1;b0&&(i===Wi||m!==1))return-1;for(U[1]=0,o=1;oji||i===Gi&&A>$i)return 1;for(;;){we=o-L,s[g]Y?(he=G[te+s[g]],fe=D[re+s[g]]):(he=96,fe=0),B=1<>L)+F]=we<<24|he<<16|fe|0;while(F!==0);for(B=1<>=1;if(B!==0?(O&=B-1,O+=B):O=0,g++,--E[o]===0){if(o===m)break;o=t[r+s[g]]}if(o>I&&(O&$)!==z){for(L===0&&(L=I),Z+=b,C=o-L,w=1<ji||i===Gi&&A>$i)return 1;z=O&$,f[z]=I<<24|C<<16|Z-l|0}}return O!==0&&(f[Z+O]=o-L<<24|64<<16|0),p.bits=I,0},Fe=zt,Vr=Vn,je=Jn,wf=cf,Ot=gf,bf=0,na=1,aa=2,Ki=4,yf=5,Yt=6,vt=0,mf=1,Ef=2,Oe=-2,oa=-3,fa=-4,Rf=-5,Yi=8,la=1,Xi=2,Vi=3,Ji=4,Qi=5,en=6,tn=7,rn=8,nn=9,an=10,nr=11,Je=12,Ur=13,on=14,Pr=15,fn=16,ln=17,un=18,sn=19,Xt=20,Vt=21,hn=22,cn=23,dn=24,_n=25,pn=26,Zr=27,vn=28,gn=29,ye=30,ua=31,Sf=32,Tf=852,xf=592,Af=15,If=Af;function wn(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function Cf(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Fe.Buf16(320),this.work=new Fe.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function sa(e){var i;return!e||!e.state?Oe:(i=e.state,e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=i.wrap&1),i.mode=la,i.last=0,i.havedict=0,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Fe.Buf32(Tf),i.distcode=i.distdyn=new Fe.Buf32(xf),i.sane=1,i.back=-1,vt)}function ha(e){var i;return!e||!e.state?Oe:(i=e.state,i.wsize=0,i.whave=0,i.wnext=0,sa(e))}function ca(e,i){var t,r;return!e||!e.state||(r=e.state,i<0?(t=0,i=-i):(t=(i>>4)+1,i<48&&(i&=15)),i&&(i<8||i>15))?Oe:(r.window!==null&&r.wbits!==i&&(r.window=null),r.wrap=t,r.wbits=i,ha(e))}function da(e,i){var t,r;return e?(r=new Cf,e.state=r,r.window=null,t=ca(e,i),t!==vt&&(e.state=null),t):Oe}function Ff(e){return da(e,If)}var bn=!0,zr,qr;function Lf(e){if(bn){var i;for(zr=new Fe.Buf32(512),qr=new Fe.Buf32(32),i=0;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for(Ot(na,e.lens,0,288,zr,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;Ot(aa,e.lens,0,32,qr,0,e.work,{bits:5}),bn=!1}e.lencode=zr,e.lenbits=9,e.distcode=qr,e.distbits=5}function _a(e,i,t,r){var u,f=e.state;return f.window===null&&(f.wsize=1<=f.wsize?(Fe.arraySet(f.window,i,t-f.wsize,f.wsize,0),f.wnext=0,f.whave=f.wsize):(u=f.wsize-f.wnext,u>r&&(u=r),Fe.arraySet(f.window,i,t-r,u,f.wnext),r-=u,r?(Fe.arraySet(f.window,i,t-r,r,0),f.wnext=r,f.whave=f.wsize):(f.wnext+=u,f.wnext===f.wsize&&(f.wnext=0),f.whave>>8&255,t.check=je(t.check,D,2,0),h=0,o=0,t.mode=Xi;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((h&255)<<8)+(h>>8))%31){e.msg="incorrect header check",t.mode=ye;break}if((h&15)!==Yi){e.msg="unknown compression method",t.mode=ye;break}if(h>>>=4,o-=4,$=(h&15)+8,t.wbits===0)t.wbits=$;else if($>t.wbits){e.msg="invalid window size",t.mode=ye;break}t.dmax=1<<$,e.adler=t.check=1,t.mode=h&512?an:Je,h=0,o=0;break;case Xi:for(;o<16;){if(s===0)break e;s--,h+=r[f++]<>8&1),t.flags&512&&(D[0]=h&255,D[1]=h>>>8&255,t.check=je(t.check,D,2,0)),h=0,o=0,t.mode=Vi;case Vi:for(;o<32;){if(s===0)break e;s--,h+=r[f++]<>>8&255,D[2]=h>>>16&255,D[3]=h>>>24&255,t.check=je(t.check,D,4,0)),h=0,o=0,t.mode=Ji;case Ji:for(;o<16;){if(s===0)break e;s--,h+=r[f++]<>8),t.flags&512&&(D[0]=h&255,D[1]=h>>>8&255,t.check=je(t.check,D,2,0)),h=0,o=0,t.mode=Qi;case Qi:if(t.flags&1024){for(;o<16;){if(s===0)break e;s--,h+=r[f++]<>>8&255,t.check=je(t.check,D,2,0)),h=0,o=0}else t.head&&(t.head.extra=null);t.mode=en;case en:if(t.flags&1024&&(m=t.length,m>s&&(m=s),m&&(t.head&&($=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),Fe.arraySet(t.head.extra,r,f,m,$)),t.flags&512&&(t.check=je(t.check,r,m,f)),s-=m,f+=m,t.length-=m),t.length))break e;t.length=0,t.mode=tn;case tn:if(t.flags&2048){if(s===0)break e;m=0;do $=r[f+m++],t.head&&$&&t.length<65536&&(t.head.name+=String.fromCharCode($));while($&&m>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=Je;break;case an:for(;o<32;){if(s===0)break e;s--,h+=r[f++]<>>=o&7,o-=o&7,t.mode=Zr;break}for(;o<3;){if(s===0)break e;s--,h+=r[f++]<>>=1,o-=1,h&3){case 0:t.mode=on;break;case 1:if(Lf(t),t.mode=Xt,i===Yt){h>>>=2,o-=2;break e}break;case 2:t.mode=ln;break;case 3:e.msg="invalid block type",t.mode=ye}h>>>=2,o-=2;break;case on:for(h>>>=o&7,o-=o&7;o<32;){if(s===0)break e;s--,h+=r[f++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=ye;break}if(t.length=h&65535,h=0,o=0,t.mode=Pr,i===Yt)break e;case Pr:t.mode=fn;case fn:if(m=t.length,m){if(m>s&&(m=s),m>p&&(m=p),m===0)break e;Fe.arraySet(u,r,f,m,l),s-=m,f+=m,p-=m,l+=m,t.length-=m;break}t.mode=Je;break;case ln:for(;o<14;){if(s===0)break e;s--,h+=r[f++]<>>=5,o-=5,t.ndist=(h&31)+1,h>>>=5,o-=5,t.ncode=(h&15)+4,h>>>=4,o-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=ye;break}t.have=0,t.mode=un;case un:for(;t.have>>=3,o-=3}for(;t.have<19;)t.lens[E[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,re={bits:t.lenbits},Z=Ot(bf,t.lens,0,19,t.lencode,0,t.work,re),t.lenbits=re.bits,Z){e.msg="invalid code lengths set",t.mode=ye;break}t.have=0,t.mode=sn;case sn:for(;t.have>>24,A=L>>>16&255,O=L&65535,!(w<=o);){if(s===0)break e;s--,h+=r[f++]<>>=w,o-=w,t.lens[t.have++]=O;else{if(O===16){for(Y=w+2;o>>=w,o-=w,t.have===0){e.msg="invalid bit length repeat",t.mode=ye;break}$=t.lens[t.have-1],m=3+(h&3),h>>>=2,o-=2}else if(O===17){for(Y=w+3;o>>=w,o-=w,$=0,m=3+(h&7),h>>>=3,o-=3}else{for(Y=w+7;o>>=w,o-=w,$=0,m=11+(h&127),h>>>=7,o-=7}if(t.have+m>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=ye;break}for(;m--;)t.lens[t.have++]=$}}if(t.mode===ye)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=ye;break}if(t.lenbits=9,re={bits:t.lenbits},Z=Ot(na,t.lens,0,t.nlen,t.lencode,0,t.work,re),t.lenbits=re.bits,Z){e.msg="invalid literal/lengths set",t.mode=ye;break}if(t.distbits=6,t.distcode=t.distdyn,re={bits:t.distbits},Z=Ot(aa,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,re),t.distbits=re.bits,Z){e.msg="invalid distances set",t.mode=ye;break}if(t.mode=Xt,i===Yt)break e;case Xt:t.mode=Vt;case Vt:if(s>=6&&p>=258){e.next_out=l,e.avail_out=p,e.next_in=f,e.avail_in=s,t.hold=h,t.bits=o,wf(e,b),l=e.next_out,u=e.output,p=e.avail_out,f=e.next_in,r=e.input,s=e.avail_in,h=t.hold,o=t.bits,t.mode===Je&&(t.back=-1);break}for(t.back=0;L=t.lencode[h&(1<>>24,A=L>>>16&255,O=L&65535,!(w<=o);){if(s===0)break e;s--,h+=r[f++]<>B)],w=L>>>24,A=L>>>16&255,O=L&65535,!(B+w<=o);){if(s===0)break e;s--,h+=r[f++]<>>=B,o-=B,t.back+=B}if(h>>>=w,o-=w,t.back+=w,t.length=O,A===0){t.mode=pn;break}if(A&32){t.back=-1,t.mode=Je;break}if(A&64){e.msg="invalid literal/length code",t.mode=ye;break}t.extra=A&15,t.mode=hn;case hn:if(t.extra){for(Y=t.extra;o>>=t.extra,o-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=cn;case cn:for(;L=t.distcode[h&(1<>>24,A=L>>>16&255,O=L&65535,!(w<=o);){if(s===0)break e;s--,h+=r[f++]<>B)],w=L>>>24,A=L>>>16&255,O=L&65535,!(B+w<=o);){if(s===0)break e;s--,h+=r[f++]<>>=B,o-=B,t.back+=B}if(h>>>=w,o-=w,t.back+=w,A&64){e.msg="invalid distance code",t.mode=ye;break}t.offset=O,t.extra=A&15,t.mode=dn;case dn:if(t.extra){for(Y=t.extra;o>>=t.extra,o-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=ye;break}t.mode=_n;case _n:if(p===0)break e;if(m=b-p,t.offset>m){if(m=t.offset-m,m>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=ye;break}m>t.wnext?(m-=t.wnext,I=t.wsize-m):I=t.wnext-m,m>t.length&&(m=t.length),C=t.window}else C=u,I=l-t.offset,m=t.length;m>p&&(m=p),p-=m,t.length-=m;do u[l++]=C[I++];while(--m);t.length===0&&(t.mode=Vt);break;case pn:if(p===0)break e;u[l++]=t.length,p--,t.mode=Vt;break;case Zr:if(t.wrap){for(;o<32;){if(s===0)break e;s--,h|=r[f++]<e.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=o,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}h.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=e.UNZIP),this.mode===e.DEFLATE||this.mode===e.GZIP||this.mode===e.DEFLATERAW?r.deflateEnd(this.strm):(this.mode===e.INFLATE||this.mode===e.GUNZIP||this.mode===e.INFLATERAW||this.mode===e.UNZIP)&&u.inflateEnd(this.strm),this.mode=e.NONE,this.dictionary=null},h.prototype.write=function(o,g,b,m,I,C,L){return this._write(!0,o,g,b,m,I,C,L)},h.prototype.writeSync=function(o,g,b,m,I,C,L){return this._write(!1,o,g,b,m,I,C,L)},h.prototype._write=function(o,g,b,m,I,C,L,w){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==e.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,g===void 0,"must provide flush value"),this.write_in_progress=!0,g!==e.Z_NO_FLUSH&&g!==e.Z_PARTIAL_FLUSH&&g!==e.Z_SYNC_FLUSH&&g!==e.Z_FULL_FLUSH&&g!==e.Z_FINISH&&g!==e.Z_BLOCK)throw new Error("Invalid flush value");if(b==null&&(b=nt.alloc(0),I=0,m=0),this.strm.avail_in=I,this.strm.input=b,this.strm.next_in=m,this.strm.avail_out=w,this.strm.output=C,this.strm.next_out=L,this.flush=g,!o)return this._process(),this._checkError()?this._afterSync():void 0;var A=this;return se.nextTick(function(){A._process(),A._after()}),this},h.prototype._afterSync=function(){var o=this.strm.avail_out,g=this.strm.avail_in;return this.write_in_progress=!1,[g,o]},h.prototype._process=function(){var o=null;switch(this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=r.deflate(this.strm,this.flush);break;case e.UNZIP:switch(this.strm.avail_in>0&&(o=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(o===null)break;if(this.strm.input[o]===s){if(this.gzip_id_bytes_read=1,o++,this.strm.avail_in===1)break}else{this.mode=e.INFLATE;break}case 1:if(o===null)break;this.strm.input[o]===p?(this.gzip_id_bytes_read=2,this.mode=e.GUNZIP):this.mode=e.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:for(this.err=u.inflate(this.strm,this.flush),this.err===e.Z_NEED_DICT&&this.dictionary&&(this.err=u.inflateSetDictionary(this.strm,this.dictionary),this.err===e.Z_OK?this.err=u.inflate(this.strm,this.flush):this.err===e.Z_DATA_ERROR&&(this.err=e.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===e.GUNZIP&&this.err===e.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=u.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},h.prototype._checkError=function(){switch(this.err){case e.Z_OK:case e.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===e.Z_FINISH)return this._error("unexpected end of file"),!1;break;case e.Z_STREAM_END:break;case e.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},h.prototype._after=function(){if(this._checkError()){var o=this.strm.avail_out,g=this.strm.avail_in;this.write_in_progress=!1,this.callback(g,o),this.pending_close&&this.close()}},h.prototype._error=function(o){this.strm.msg&&(o=this.strm.msg),this.onerror(o,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},h.prototype.init=function(o,g,b,m,I){i(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(o>=8&&o<=15,"invalid windowBits"),i(g>=-1&&g<=9,"invalid compression level"),i(b>=1&&b<=9,"invalid memlevel"),i(m===e.Z_FILTERED||m===e.Z_HUFFMAN_ONLY||m===e.Z_RLE||m===e.Z_FIXED||m===e.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(g,o,b,m,I),this._setDictionary()},h.prototype.params=function(){throw new Error("deflateParams Not supported")},h.prototype.reset=function(){this._reset(),this._setDictionary()},h.prototype._init=function(o,g,b,m,I){switch(this.level=o,this.windowBits=g,this.memLevel=b,this.strategy=m,this.flush=e.Z_NO_FLUSH,this.err=e.Z_OK,(this.mode===e.GZIP||this.mode===e.GUNZIP)&&(this.windowBits+=16),this.mode===e.UNZIP&&(this.windowBits+=32),(this.mode===e.DEFLATERAW||this.mode===e.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new t,this.mode){case e.DEFLATE:case e.GZIP:case e.DEFLATERAW:this.err=r.deflateInit2(this.strm,this.level,e.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case e.INFLATE:case e.GUNZIP:case e.INFLATERAW:case e.UNZIP:this.err=u.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==e.Z_OK&&this._error("Init error"),this.dictionary=I,this.write_in_progress=!1,this.init_done=!0},h.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:this.err=r.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==e.Z_OK&&this._error("Failed to set dictionary")}},h.prototype._reset=function(){switch(this.err=e.Z_OK,this.mode){case e.DEFLATE:case e.DEFLATERAW:case e.GZIP:this.err=r.deflateReset(this.strm);break;case e.INFLATE:case e.INFLATERAW:case e.GUNZIP:this.err=u.inflateReset(this.strm);break}this.err!==e.Z_OK&&this._error("Failed to reset stream")},e.Zlib=h})(On);(function(e){var i=Tt.Buffer,t=La.Transform,r=On,u=Jr,f=yn().ok,l=Tt.kMaxLength,s="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";r.Z_MIN_WINDOWBITS=8,r.Z_MAX_WINDOWBITS=15,r.Z_DEFAULT_WINDOWBITS=15,r.Z_MIN_CHUNK=64,r.Z_MAX_CHUNK=1/0,r.Z_DEFAULT_CHUNK=16*1024,r.Z_MIN_MEMLEVEL=1,r.Z_MAX_MEMLEVEL=9,r.Z_DEFAULT_MEMLEVEL=8,r.Z_MIN_LEVEL=-1,r.Z_MAX_LEVEL=9,r.Z_DEFAULT_LEVEL=r.Z_DEFAULT_COMPRESSION;for(var p=Object.keys(r),h=0;h=l?X=new RangeError(s):H=i.concat(te,we),te=[],E.close(),G(X,H)}}function L(E,U){if(typeof U=="string"&&(U=i.from(U)),!i.isBuffer(U))throw new TypeError("Not a string or buffer");var G=E._finishFlushFlag;return E._processChunk(U,G)}function w(E){if(!(this instanceof w))return new w(E);D.call(this,E,r.DEFLATE)}function A(E){if(!(this instanceof A))return new A(E);D.call(this,E,r.INFLATE)}function O(E){if(!(this instanceof O))return new O(E);D.call(this,E,r.GZIP)}function B(E){if(!(this instanceof B))return new B(E);D.call(this,E,r.GUNZIP)}function F(E){if(!(this instanceof F))return new F(E);D.call(this,E,r.DEFLATERAW)}function z(E){if(!(this instanceof z))return new z(E);D.call(this,E,r.INFLATERAW)}function $(E){if(!(this instanceof $))return new $(E);D.call(this,E,r.UNZIP)}function Z(E){return E===r.Z_NO_FLUSH||E===r.Z_PARTIAL_FLUSH||E===r.Z_SYNC_FLUSH||E===r.Z_FULL_FLUSH||E===r.Z_FINISH||E===r.Z_BLOCK}function D(E,U){var G=this;if(this._opts=E=E||{},this._chunkSize=E.chunkSize||e.Z_DEFAULT_CHUNK,t.call(this,E),E.flush&&!Z(E.flush))throw new Error("Invalid flush flag: "+E.flush);if(E.finishFlush&&!Z(E.finishFlush))throw new Error("Invalid flush flag: "+E.finishFlush);if(this._flushFlag=E.flush||r.Z_NO_FLUSH,this._finishFlushFlag=typeof E.finishFlush<"u"?E.finishFlush:r.Z_FINISH,E.chunkSize&&(E.chunkSizee.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+E.chunkSize);if(E.windowBits&&(E.windowBitse.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+E.windowBits);if(E.level&&(E.levele.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+E.level);if(E.memLevel&&(E.memLevele.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+E.memLevel);if(E.strategy&&E.strategy!=e.Z_FILTERED&&E.strategy!=e.Z_HUFFMAN_ONLY&&E.strategy!=e.Z_RLE&&E.strategy!=e.Z_FIXED&&E.strategy!=e.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+E.strategy);if(E.dictionary&&!i.isBuffer(E.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new r.Zlib(U);var te=this;this._hadError=!1,this._handle.onerror=function(fe,me){re(te),te._hadError=!0;var H=new Error(fe);H.errno=me,H.code=e.codes[me],te.emit("error",H)};var we=e.Z_DEFAULT_COMPRESSION;typeof E.level=="number"&&(we=E.level);var he=e.Z_DEFAULT_STRATEGY;typeof E.strategy=="number"&&(he=E.strategy),this._handle.init(E.windowBits||e.Z_DEFAULT_WINDOWBITS,we,E.memLevel||e.Z_DEFAULT_MEMLEVEL,he,E.dictionary),this._buffer=i.allocUnsafe(this._chunkSize),this._offset=0,this._level=we,this._strategy=he,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!G._handle},configurable:!0,enumerable:!0})}u.inherits(D,t),D.prototype.params=function(E,U,G){if(Ee.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+E);if(U!=e.Z_FILTERED&&U!=e.Z_HUFFMAN_ONLY&&U!=e.Z_RLE&&U!=e.Z_FIXED&&U!=e.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+U);if(this._level!==E||this._strategy!==U){var te=this;this.flush(r.Z_SYNC_FLUSH,function(){f(te._handle,"zlib binding closed"),te._handle.params(E,U),te._hadError||(te._level=E,te._strategy=U,G&&G())})}else se.nextTick(G)},D.prototype.reset=function(){return f(this._handle,"zlib binding closed"),this._handle.reset()},D.prototype._flush=function(E){this._transform(i.alloc(0),"",E)},D.prototype.flush=function(E,U){var G=this,te=this._writableState;(typeof E=="function"||E===void 0&&!U)&&(U=E,E=r.Z_FULL_FLUSH),te.ended?U&&se.nextTick(U):te.ending?U&&this.once("end",U):te.needDrain?U&&this.once("drain",function(){return G.flush(E,U)}):(this._flushFlag=E,this.write(i.alloc(0),"",U))},D.prototype.close=function(E){re(this,E),se.nextTick(Y,this)};function re(E,U){U&&se.nextTick(U),E._handle&&(E._handle.close(),E._handle=null)}function Y(E){E.emit("close")}D.prototype._transform=function(E,U,G){var te,we=this._writableState,he=we.ending||we.ended,fe=he&&(!E||we.length===E.length);if(E!==null&&!i.isBuffer(E))return G(new Error("invalid input"));if(!this._handle)return G(new Error("zlib binding closed"));fe?te=this._finishFlushFlag:(te=this._flushFlag,E.length>=we.length&&(this._flushFlag=this._opts.flush||r.Z_NO_FLUSH)),this._processChunk(E,te,G)},D.prototype._processChunk=function(E,U,G){var te=E&&E.length,we=this._chunkSize-this._offset,he=0,fe=this,me=typeof G=="function";if(!me){var H=[],X=0,ie;this.on("error",function(S){ie=S}),f(this._handle,"zlib binding closed");do var le=this._handle.writeSync(U,E,he,te,this._buffer,this._offset,we);while(!this._hadError&&x(le[0],le[1]));if(this._hadError)throw ie;if(X>=l)throw re(this),new RangeError(s);var Q=i.concat(H,X);return re(this),Q}f(this._handle,"zlib binding closed");var ae=this._handle.write(U,E,he,te,this._buffer,this._offset,we);ae.buffer=E,ae.callback=x;function x(S,P){if(this&&(this.buffer=null,this.callback=null),!fe._hadError){var W=we-P;if(f(W>=0,"have should not go down"),W>0){var V=fe._buffer.slice(fe._offset,fe._offset+W);fe._offset+=W,me?fe.push(V):(H.push(V),X+=V.length)}if((P===0||fe._offset>=fe._chunkSize)&&(we=fe._chunkSize,fe._offset=0,fe._buffer=i.allocUnsafe(fe._chunkSize)),P===0){if(he+=te-S,te=S,!me)return!0;var _=fe._handle.write(U,E,he,te,fe._buffer,fe._offset,fe._chunkSize);_.callback=x,_.buffer=E;return}if(!me)return!1;G()}}},u.inherits(w,D),u.inherits(A,D),u.inherits(O,D),u.inherits(B,D),u.inherits(F,D),u.inherits(z,D),u.inherits($,D)})(ro);export{nt as B,jf as D,La as a,Ma as b,$f as h,ro as l,Ka as p,to as q,Ia as r,Cn as s,Nn as u}; diff --git a/docs/storybook/assets/index-yCoF09M4.js b/docs/storybook/assets/index-lt-u4Ncf.js similarity index 99% rename from docs/storybook/assets/index-yCoF09M4.js rename to docs/storybook/assets/index-lt-u4Ncf.js index 477d82fbd..158ea1085 100644 --- a/docs/storybook/assets/index-yCoF09M4.js +++ b/docs/storybook/assets/index-lt-u4Ncf.js @@ -1,4 +1,4 @@ -import{_ as Ht}from"./iframe-_98K0_ok.js";import{m as ar,g as yr,j as Dc,s as _c}from"./pickBy-llkn_6s3.js";import{r as b,b as dl,R as a,c as qn}from"./index-RfLt4OUa.js";import{r as Hi,R as Mc}from"./index-miLrID2P.js";import{c as Ii,a as $c,b as Bc,_ as yn}from"./inheritsLoose-O2jMHMzR.js";import{p as Hc}from"./pickBy-lHA7W3rs.js";import{u as Ic}from"./uniq-hAFl8ubt.js";import{c as Nc}from"./cloneDeep-eaEuvD8i.js";import"./callBound-4MCeDK1M.js";import{d as Ee}from"./index-xck8ovCi.js";import{S as pl,s as wa,a as Un}from"./index-I0bGnlnk.js";var Ne=e=>`control-${e.replace(/\s+/g,"-")}`,vn=e=>`set-${e.replace(/\s+/g,"-")}`;const{global:Zc}=__STORYBOOK_MODULE_GLOBAL__,{logger:jc}=__STORYBOOK_MODULE_CLIENT_LOGGER__;var Pc=Object.create,Ni=Object.defineProperty,Vc=Object.getOwnPropertyDescriptor,Zi=Object.getOwnPropertyNames,zc=Object.getPrototypeOf,qc=Object.prototype.hasOwnProperty,io=(e,t)=>function(){return t||(0,e[Zi(e)[0]])((t={exports:{}}).exports,t),t.exports},Uc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zi(t))!qc.call(e,o)&&o!==r&&Ni(e,o,{get:()=>t[o],enumerable:!(n=Vc(t,o))||n.enumerable});return e},ji=(e,t,r)=>(r=e!=null?Pc(zc(e)):{},Uc(t||!e||!e.__esModule?Ni(r,"default",{value:e,enumerable:!0}):r,e));function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jr(e,t,r){return Kc()?Jr=Reflect.construct.bind():Jr=function(n,o,l){var i=[null];i.push.apply(i,o);var s=Function.bind.apply(n,i),u=new s;return l&&vr(u,l.prototype),u},Jr.apply(null,arguments)}function Ca(e){var t=typeof Map=="function"?new Map:void 0;return Ca=function(r){if(r===null||!Yc(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return Jr(r,arguments,Aa(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),vr(n,r)},Ca(e)}var Xc={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }). +import{_ as Ht}from"./iframe-mUD1hmuH.js";import{m as ar,g as yr,j as Dc,s as _c}from"./pickBy-llkn_6s3.js";import{r as b,b as dl,R as a,c as qn}from"./index-RfLt4OUa.js";import{r as Hi,R as Mc}from"./index-miLrID2P.js";import{c as Ii,a as $c,b as Bc,_ as yn}from"./inheritsLoose-O2jMHMzR.js";import{p as Hc}from"./pickBy-lHA7W3rs.js";import{u as Ic}from"./uniq-hAFl8ubt.js";import{c as Nc}from"./cloneDeep-eaEuvD8i.js";import"./callBound-4MCeDK1M.js";import{d as Ee}from"./index-xck8ovCi.js";import{S as pl,s as wa,a as Un}from"./index-I0bGnlnk.js";var Ne=e=>`control-${e.replace(/\s+/g,"-")}`,vn=e=>`set-${e.replace(/\s+/g,"-")}`;const{global:Zc}=__STORYBOOK_MODULE_GLOBAL__,{logger:jc}=__STORYBOOK_MODULE_CLIENT_LOGGER__;var Pc=Object.create,Ni=Object.defineProperty,Vc=Object.getOwnPropertyDescriptor,Zi=Object.getOwnPropertyNames,zc=Object.getPrototypeOf,qc=Object.prototype.hasOwnProperty,io=(e,t)=>function(){return t||(0,e[Zi(e)[0]])((t={exports:{}}).exports,t),t.exports},Uc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zi(t))!qc.call(e,o)&&o!==r&&Ni(e,o,{get:()=>t[o],enumerable:!(n=Vc(t,o))||n.enumerable});return e},ji=(e,t,r)=>(r=e!=null?Pc(zc(e)):{},Uc(t||!e||!e.__esModule?Ni(r,"default",{value:e,enumerable:!0}):r,e));function Yt(){return Yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jr(e,t,r){return Kc()?Jr=Reflect.construct.bind():Jr=function(n,o,l){var i=[null];i.push.apply(i,o);var s=Function.bind.apply(n,i),u=new s;return l&&vr(u,l.prototype),u},Jr.apply(null,arguments)}function Ca(e){var t=typeof Map=="function"?new Map:void 0;return Ca=function(r){if(r===null||!Yc(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return Jr(r,arguments,Aa(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),vr(n,r)},Ca(e)}var Xc={1:`Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }). `,2:`Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }). @@ -226,9 +226,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho path { fill: currentColor; } -`,ye=({icon:e,useSymbol:t,...r})=>a.createElement(vu,{viewBox:"0 0 14 14",width:"14px",height:"14px",...r},t?a.createElement("use",{xlinkHref:`#icon--${e}`}):Lr[e]),Uf=b.memo(function({icons:e=Object.keys(Lr)}){return a.createElement(vu,{viewBox:"0 0 14 14",style:{position:"absolute",width:0,height:0},"data-chromatic":"ignore"},e.map(t=>a.createElement("symbol",{id:`icon--${t}`,key:t},Lr[t])))}),Wf=0,Gf=e=>e.button===Wf&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey,Yf=(e,t)=>{Gf(e)&&(e.preventDefault(),t(e))},Kf=R.span(({withArrow:e})=>e?{"> svg:last-of-type":{height:"0.7em",width:"0.7em",marginRight:0,marginLeft:"0.25em",bottom:"auto",verticalAlign:"inherit"}}:{},({containsIcon:e})=>e?{svg:{height:"1em",width:"1em",verticalAlign:"middle",position:"relative",bottom:0,marginRight:0}}:{}),Xf=R.a(({theme:e})=>({display:"inline-block",transition:"all 150ms ease-out",textDecoration:"none",color:e.color.secondary,"&:hover, &:focus":{cursor:"pointer",color:Wt(.07,e.color.secondary),"svg path:not([fill])":{fill:Wt(.07,e.color.secondary)}},"&:active":{color:Wt(.1,e.color.secondary),"svg path:not([fill])":{fill:Wt(.1,e.color.secondary)}},svg:{display:"inline-block",height:"1em",width:"1em",verticalAlign:"text-top",position:"relative",bottom:"-0.125em",marginRight:"0.4em","& path":{fill:e.color.secondary}}}),({theme:e,secondary:t,tertiary:r})=>{let n;return t&&(n=[e.textMutedColor,e.color.dark,e.color.darker]),r&&(n=[e.color.dark,e.color.darkest,e.textMutedColor]),n?{color:n[0],"svg path:not([fill])":{fill:n[0]},"&:hover":{color:n[1],"svg path:not([fill])":{fill:n[1]}},"&:active":{color:n[2],"svg path:not([fill])":{fill:n[2]}}}:{}},({nochrome:e})=>e?{color:"inherit","&:hover, &:active":{color:"inherit",textDecoration:"underline"}}:{},({theme:e,inverse:t})=>t?{color:e.color.lightest,":not([fill])":{fill:e.color.lightest},"&:hover":{color:e.color.lighter,"svg path:not([fill])":{fill:e.color.lighter}},"&:active":{color:e.color.light,"svg path:not([fill])":{fill:e.color.light}}}:{},({isButton:e})=>e?{border:0,borderRadius:0,background:"none",padding:0,fontSize:"inherit"}:{}),Et=({cancel:e,children:t,onClick:r,withArrow:n,containsIcon:o,className:l,...i})=>a.createElement(Xf,{...i,onClick:r&&e?s=>Yf(s,r):r,className:l},a.createElement(Kf,{withArrow:n,containsIcon:o},t,n&&a.createElement(ye,{icon:"arrowright"})));Et.defaultProps={cancel:!0,className:void 0,style:void 0,onClick:void 0,withArrow:!1,containsIcon:!1};var Jf=R.div(({theme:e})=>({fontSize:`${e.typography.size.s2}px`,lineHeight:"1.6",h1:{fontSize:`${e.typography.size.l1}px`,fontWeight:e.typography.weight.bold},h2:{fontSize:`${e.typography.size.m2}px`,borderBottom:`1px solid ${e.appBorderColor}`},h3:{fontSize:`${e.typography.size.m1}px`},h4:{fontSize:`${e.typography.size.s3}px`},h5:{fontSize:`${e.typography.size.s2}px`},h6:{fontSize:`${e.typography.size.s2}px`,color:e.color.dark},"pre:not(.prismjs)":{background:"transparent",border:"none",borderRadius:0,padding:0,margin:0},"pre pre, pre.prismjs":{padding:15,margin:0,whiteSpace:"pre-wrap",color:"inherit",fontSize:"13px",lineHeight:"19px"},"pre pre code, pre.prismjs code":{color:"inherit",fontSize:"inherit"},"pre code":{margin:0,padding:0,whiteSpace:"pre",border:"none",background:"transparent"},"pre code, pre tt":{backgroundColor:"transparent",border:"none"},"body > *:first-of-type":{marginTop:"0 !important"},"body > *:last-child":{marginBottom:"0 !important"},a:{color:e.color.secondary,textDecoration:"none"},"a.absent":{color:"#cc0000"},"a.anchor":{display:"block",paddingLeft:30,marginLeft:-30,cursor:"pointer",position:"absolute",top:0,left:0,bottom:0},"h1, h2, h3, h4, h5, h6":{margin:"20px 0 10px",padding:0,cursor:"text",position:"relative","&:first-of-type":{marginTop:0,paddingTop:0},"&:hover a.anchor":{textDecoration:"none"},"& tt, & code":{fontSize:"inherit"}},"h1:first-of-type + h2":{marginTop:0,paddingTop:0},"p, blockquote, ul, ol, dl, li, table, pre":{margin:"15px 0"},hr:{border:"0 none",borderTop:`1px solid ${e.appBorderColor}`,height:4,padding:0},"body > h1:first-of-type, body > h2:first-of-type, body > h3:first-of-type, body > h4:first-of-type, body > h5:first-of-type, body > h6:first-of-type":{marginTop:0,paddingTop:0},"body > h1:first-of-type + h2":{marginTop:0,paddingTop:0},"a:first-of-type h1, a:first-of-type h2, a:first-of-type h3, a:first-of-type h4, a:first-of-type h5, a:first-of-type h6":{marginTop:0,paddingTop:0},"h1 p, h2 p, h3 p, h4 p, h5 p, h6 p":{marginTop:0},"li p.first":{display:"inline-block"},"ul, ol":{paddingLeft:30,"& :first-of-type":{marginTop:0},"& :last-child":{marginBottom:0}},dl:{padding:0},"dl dt":{fontSize:"14px",fontWeight:"bold",fontStyle:"italic",margin:"0 0 15px",padding:"0 15px","&:first-of-type":{padding:0},"& > :first-of-type":{marginTop:0},"& > :last-child":{marginBottom:0}},blockquote:{borderLeft:`4px solid ${e.color.medium}`,padding:"0 15px",color:e.color.dark,"& > :first-of-type":{marginTop:0},"& > :last-child":{marginBottom:0}},table:{padding:0,borderCollapse:"collapse","& tr":{borderTop:`1px solid ${e.appBorderColor}`,backgroundColor:"white",margin:0,padding:0,"& th":{fontWeight:"bold",border:`1px solid ${e.appBorderColor}`,textAlign:"left",margin:0,padding:"6px 13px"},"& td":{border:`1px solid ${e.appBorderColor}`,textAlign:"left",margin:0,padding:"6px 13px"},"&:nth-of-type(2n)":{backgroundColor:e.color.lighter},"& th :first-of-type, & td :first-of-type":{marginTop:0},"& th :last-child, & td :last-child":{marginBottom:0}}},img:{maxWidth:"100%"},"span.frame":{display:"block",overflow:"hidden","& > span":{border:`1px solid ${e.color.medium}`,display:"block",float:"left",overflow:"hidden",margin:"13px 0 0",padding:7,width:"auto"},"& span img":{display:"block",float:"left"},"& span span":{clear:"both",color:e.color.darkest,display:"block",padding:"5px 0 0"}},"span.align-center":{display:"block",overflow:"hidden",clear:"both","& > span":{display:"block",overflow:"hidden",margin:"13px auto 0",textAlign:"center"},"& span img":{margin:"0 auto",textAlign:"center"}},"span.align-right":{display:"block",overflow:"hidden",clear:"both","& > span":{display:"block",overflow:"hidden",margin:"13px 0 0",textAlign:"right"},"& span img":{margin:0,textAlign:"right"}},"span.float-left":{display:"block",marginRight:13,overflow:"hidden",float:"left","& span":{margin:"13px 0 0"}},"span.float-right":{display:"block",marginLeft:13,overflow:"hidden",float:"right","& > span":{display:"block",overflow:"hidden",margin:"13px auto 0",textAlign:"right"}},"code, tt":{margin:"0 2px",padding:"0 5px",whiteSpace:"nowrap",border:`1px solid ${e.color.mediumlight}`,backgroundColor:e.color.lighter,borderRadius:3,color:e.base==="dark"&&e.color.darkest}})),$t=[],nr=null,Qf=b.lazy(async()=>{let{SyntaxHighlighter:e}=await Ht(()=>import("./syntaxhighlighter-V7JZZA35-R57c9JcY.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url);return $t.length>0&&($t.forEach(t=>{e.registerLanguage(...t)}),$t=[]),nr===null&&(nr=e),{default:t=>a.createElement(e,{...t})}}),em=b.lazy(async()=>{let[{SyntaxHighlighter:e},{formatter:t}]=await Promise.all([Ht(()=>import("./syntaxhighlighter-V7JZZA35-R57c9JcY.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url),Ht(()=>import("./formatter-SWP5E3XI--SW_q4fo.js"),__vite__mapDeps([15,2,3,4,1,5,6,7,8,9,10,11,12,13,14]),import.meta.url)]);return $t.length>0&&($t.forEach(r=>{e.registerLanguage(...r)}),$t=[]),nr===null&&(nr=e),{default:r=>a.createElement(e,{...r,formatter:t})}}),_n=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},e.format!==!1?a.createElement(em,{...e}):a.createElement(Qf,{...e}));_n.registerLanguage=(...e)=>{if(nr!==null){nr.registerLanguage(...e);return}$t.push(e)};var tm=e=>typeof e=="number"?e:Number(e),rm=R.div(({theme:e,col:t,row:r=1})=>t?{display:"inline-block",verticalAlign:"inherit","& > *":{marginLeft:t*e.layoutMargin,verticalAlign:"inherit"},[`& > *:first-child${_a}`]:{marginLeft:0}}:{"& > *":{marginTop:r*e.layoutMargin},[`& > *:first-child${_a}`]:{marginTop:0}},({theme:e,outer:t,col:r,row:n})=>{switch(!0){case!!(t&&r):return{marginLeft:t*e.layoutMargin,marginRight:t*e.layoutMargin};case!!(t&&n):return{marginTop:t*e.layoutMargin,marginBottom:t*e.layoutMargin};default:return{}}}),nm=({col:e,row:t,outer:r,children:n,...o})=>{let l=tm(typeof r=="number"||!r?r:e||t);return a.createElement(rm,{col:e,row:t,outer:l,...o},n)},am=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold})),om=R.div(),lm=R.div(({theme:e})=>({padding:30,textAlign:"center",color:e.color.defaultText,fontSize:e.typography.size.s2-1})),Eu=({children:e,...t})=>{let[r,n]=b.Children.toArray(e);return a.createElement(lm,{...t},a.createElement(am,null,r),n&&a.createElement(om,null,n))},im=R.div(({scale:e=1,elementHeight:t})=>({height:t||"auto",transformOrigin:"top left",transform:`scale(${1/e})`}));function sm({scale:e,children:t}){let r=b.useRef(null),[n,o]=b.useState(0),l=b.useCallback(({height:i})=>{i&&o(i/e)},[e]);return b.useEffect(()=>{r.current&&o(r.current.getBoundingClientRect().height)},[e]),Ks({ref:r,onResize:l}),a.createElement(im,{scale:e,elementHeight:n},a.createElement("div",{ref:r,className:"innerZoomElementWrapper"},t))}var um=class extends b.Component{constructor(){super(...arguments),this.iframe=null}componentDidMount(){let{iFrameRef:e}=this.props;this.iframe=e.current}shouldComponentUpdate(e){let{scale:t,active:r}=this.props;return t!==e.scale&&this.setIframeInnerZoom(e.scale),r!==e.active&&this.iframe.setAttribute("data-is-storybook",e.active?"true":"false"),e.children.props.src!==this.props.children.props.src}setIframeInnerZoom(e){try{Object.assign(this.iframe.contentDocument.body.style,{width:`${e*100}%`,height:`${e*100}%`,transform:`scale(${1/e})`,transformOrigin:"top left"})}catch{this.setIframeZoom(e)}}setIframeZoom(e){Object.assign(this.iframe.style,{width:`${e*100}%`,height:`${e*100}%`,transform:`scale(${1/e})`,transformOrigin:"top left"})}render(){let{children:e}=this.props;return a.createElement(a.Fragment,null,e)}},xu={Element:sm,IFrame:um},{document:cm}=lf,dm=R.strong(({theme:e})=>({color:e.color.orange})),pm=R.strong(({theme:e})=>({color:e.color.ancillary,textDecoration:"underline"})),ri=R.em(({theme:e})=>({color:e.textMutedColor})),fm=/(Error): (.*)\n/,mm=/at (?:(.*) )?\(?(.+)\)?/,gm=/([^@]+)?(?:\/<)?@(.+)?/,hm=/([^@]+)?@(.+)?/,wu=({error:e})=>{if(!e)return a.createElement(b.Fragment,null,"This error has no stack or message");if(!e.stack)return a.createElement(b.Fragment,null,e.message||"This error has no stack or message");let t=e.stack.toString();t&&e.message&&!t.includes(e.message)&&(t=`Error: ${e.message} +`,ye=({icon:e,useSymbol:t,...r})=>a.createElement(vu,{viewBox:"0 0 14 14",width:"14px",height:"14px",...r},t?a.createElement("use",{xlinkHref:`#icon--${e}`}):Lr[e]),Uf=b.memo(function({icons:e=Object.keys(Lr)}){return a.createElement(vu,{viewBox:"0 0 14 14",style:{position:"absolute",width:0,height:0},"data-chromatic":"ignore"},e.map(t=>a.createElement("symbol",{id:`icon--${t}`,key:t},Lr[t])))}),Wf=0,Gf=e=>e.button===Wf&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey,Yf=(e,t)=>{Gf(e)&&(e.preventDefault(),t(e))},Kf=R.span(({withArrow:e})=>e?{"> svg:last-of-type":{height:"0.7em",width:"0.7em",marginRight:0,marginLeft:"0.25em",bottom:"auto",verticalAlign:"inherit"}}:{},({containsIcon:e})=>e?{svg:{height:"1em",width:"1em",verticalAlign:"middle",position:"relative",bottom:0,marginRight:0}}:{}),Xf=R.a(({theme:e})=>({display:"inline-block",transition:"all 150ms ease-out",textDecoration:"none",color:e.color.secondary,"&:hover, &:focus":{cursor:"pointer",color:Wt(.07,e.color.secondary),"svg path:not([fill])":{fill:Wt(.07,e.color.secondary)}},"&:active":{color:Wt(.1,e.color.secondary),"svg path:not([fill])":{fill:Wt(.1,e.color.secondary)}},svg:{display:"inline-block",height:"1em",width:"1em",verticalAlign:"text-top",position:"relative",bottom:"-0.125em",marginRight:"0.4em","& path":{fill:e.color.secondary}}}),({theme:e,secondary:t,tertiary:r})=>{let n;return t&&(n=[e.textMutedColor,e.color.dark,e.color.darker]),r&&(n=[e.color.dark,e.color.darkest,e.textMutedColor]),n?{color:n[0],"svg path:not([fill])":{fill:n[0]},"&:hover":{color:n[1],"svg path:not([fill])":{fill:n[1]}},"&:active":{color:n[2],"svg path:not([fill])":{fill:n[2]}}}:{}},({nochrome:e})=>e?{color:"inherit","&:hover, &:active":{color:"inherit",textDecoration:"underline"}}:{},({theme:e,inverse:t})=>t?{color:e.color.lightest,":not([fill])":{fill:e.color.lightest},"&:hover":{color:e.color.lighter,"svg path:not([fill])":{fill:e.color.lighter}},"&:active":{color:e.color.light,"svg path:not([fill])":{fill:e.color.light}}}:{},({isButton:e})=>e?{border:0,borderRadius:0,background:"none",padding:0,fontSize:"inherit"}:{}),Et=({cancel:e,children:t,onClick:r,withArrow:n,containsIcon:o,className:l,...i})=>a.createElement(Xf,{...i,onClick:r&&e?s=>Yf(s,r):r,className:l},a.createElement(Kf,{withArrow:n,containsIcon:o},t,n&&a.createElement(ye,{icon:"arrowright"})));Et.defaultProps={cancel:!0,className:void 0,style:void 0,onClick:void 0,withArrow:!1,containsIcon:!1};var Jf=R.div(({theme:e})=>({fontSize:`${e.typography.size.s2}px`,lineHeight:"1.6",h1:{fontSize:`${e.typography.size.l1}px`,fontWeight:e.typography.weight.bold},h2:{fontSize:`${e.typography.size.m2}px`,borderBottom:`1px solid ${e.appBorderColor}`},h3:{fontSize:`${e.typography.size.m1}px`},h4:{fontSize:`${e.typography.size.s3}px`},h5:{fontSize:`${e.typography.size.s2}px`},h6:{fontSize:`${e.typography.size.s2}px`,color:e.color.dark},"pre:not(.prismjs)":{background:"transparent",border:"none",borderRadius:0,padding:0,margin:0},"pre pre, pre.prismjs":{padding:15,margin:0,whiteSpace:"pre-wrap",color:"inherit",fontSize:"13px",lineHeight:"19px"},"pre pre code, pre.prismjs code":{color:"inherit",fontSize:"inherit"},"pre code":{margin:0,padding:0,whiteSpace:"pre",border:"none",background:"transparent"},"pre code, pre tt":{backgroundColor:"transparent",border:"none"},"body > *:first-of-type":{marginTop:"0 !important"},"body > *:last-child":{marginBottom:"0 !important"},a:{color:e.color.secondary,textDecoration:"none"},"a.absent":{color:"#cc0000"},"a.anchor":{display:"block",paddingLeft:30,marginLeft:-30,cursor:"pointer",position:"absolute",top:0,left:0,bottom:0},"h1, h2, h3, h4, h5, h6":{margin:"20px 0 10px",padding:0,cursor:"text",position:"relative","&:first-of-type":{marginTop:0,paddingTop:0},"&:hover a.anchor":{textDecoration:"none"},"& tt, & code":{fontSize:"inherit"}},"h1:first-of-type + h2":{marginTop:0,paddingTop:0},"p, blockquote, ul, ol, dl, li, table, pre":{margin:"15px 0"},hr:{border:"0 none",borderTop:`1px solid ${e.appBorderColor}`,height:4,padding:0},"body > h1:first-of-type, body > h2:first-of-type, body > h3:first-of-type, body > h4:first-of-type, body > h5:first-of-type, body > h6:first-of-type":{marginTop:0,paddingTop:0},"body > h1:first-of-type + h2":{marginTop:0,paddingTop:0},"a:first-of-type h1, a:first-of-type h2, a:first-of-type h3, a:first-of-type h4, a:first-of-type h5, a:first-of-type h6":{marginTop:0,paddingTop:0},"h1 p, h2 p, h3 p, h4 p, h5 p, h6 p":{marginTop:0},"li p.first":{display:"inline-block"},"ul, ol":{paddingLeft:30,"& :first-of-type":{marginTop:0},"& :last-child":{marginBottom:0}},dl:{padding:0},"dl dt":{fontSize:"14px",fontWeight:"bold",fontStyle:"italic",margin:"0 0 15px",padding:"0 15px","&:first-of-type":{padding:0},"& > :first-of-type":{marginTop:0},"& > :last-child":{marginBottom:0}},blockquote:{borderLeft:`4px solid ${e.color.medium}`,padding:"0 15px",color:e.color.dark,"& > :first-of-type":{marginTop:0},"& > :last-child":{marginBottom:0}},table:{padding:0,borderCollapse:"collapse","& tr":{borderTop:`1px solid ${e.appBorderColor}`,backgroundColor:"white",margin:0,padding:0,"& th":{fontWeight:"bold",border:`1px solid ${e.appBorderColor}`,textAlign:"left",margin:0,padding:"6px 13px"},"& td":{border:`1px solid ${e.appBorderColor}`,textAlign:"left",margin:0,padding:"6px 13px"},"&:nth-of-type(2n)":{backgroundColor:e.color.lighter},"& th :first-of-type, & td :first-of-type":{marginTop:0},"& th :last-child, & td :last-child":{marginBottom:0}}},img:{maxWidth:"100%"},"span.frame":{display:"block",overflow:"hidden","& > span":{border:`1px solid ${e.color.medium}`,display:"block",float:"left",overflow:"hidden",margin:"13px 0 0",padding:7,width:"auto"},"& span img":{display:"block",float:"left"},"& span span":{clear:"both",color:e.color.darkest,display:"block",padding:"5px 0 0"}},"span.align-center":{display:"block",overflow:"hidden",clear:"both","& > span":{display:"block",overflow:"hidden",margin:"13px auto 0",textAlign:"center"},"& span img":{margin:"0 auto",textAlign:"center"}},"span.align-right":{display:"block",overflow:"hidden",clear:"both","& > span":{display:"block",overflow:"hidden",margin:"13px 0 0",textAlign:"right"},"& span img":{margin:0,textAlign:"right"}},"span.float-left":{display:"block",marginRight:13,overflow:"hidden",float:"left","& span":{margin:"13px 0 0"}},"span.float-right":{display:"block",marginLeft:13,overflow:"hidden",float:"right","& > span":{display:"block",overflow:"hidden",margin:"13px auto 0",textAlign:"right"}},"code, tt":{margin:"0 2px",padding:"0 5px",whiteSpace:"nowrap",border:`1px solid ${e.color.mediumlight}`,backgroundColor:e.color.lighter,borderRadius:3,color:e.base==="dark"&&e.color.darkest}})),$t=[],nr=null,Qf=b.lazy(async()=>{let{SyntaxHighlighter:e}=await Ht(()=>import("./syntaxhighlighter-V7JZZA35-WSwIxwL6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url);return $t.length>0&&($t.forEach(t=>{e.registerLanguage(...t)}),$t=[]),nr===null&&(nr=e),{default:t=>a.createElement(e,{...t})}}),em=b.lazy(async()=>{let[{SyntaxHighlighter:e},{formatter:t}]=await Promise.all([Ht(()=>import("./syntaxhighlighter-V7JZZA35-WSwIxwL6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url),Ht(()=>import("./formatter-SWP5E3XI-Nl3Uqdo1.js"),__vite__mapDeps([15,2,3,4,1,5,6,7,8,9,10,11,12,13,14]),import.meta.url)]);return $t.length>0&&($t.forEach(r=>{e.registerLanguage(...r)}),$t=[]),nr===null&&(nr=e),{default:r=>a.createElement(e,{...r,formatter:t})}}),_n=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},e.format!==!1?a.createElement(em,{...e}):a.createElement(Qf,{...e}));_n.registerLanguage=(...e)=>{if(nr!==null){nr.registerLanguage(...e);return}$t.push(e)};var tm=e=>typeof e=="number"?e:Number(e),rm=R.div(({theme:e,col:t,row:r=1})=>t?{display:"inline-block",verticalAlign:"inherit","& > *":{marginLeft:t*e.layoutMargin,verticalAlign:"inherit"},[`& > *:first-child${_a}`]:{marginLeft:0}}:{"& > *":{marginTop:r*e.layoutMargin},[`& > *:first-child${_a}`]:{marginTop:0}},({theme:e,outer:t,col:r,row:n})=>{switch(!0){case!!(t&&r):return{marginLeft:t*e.layoutMargin,marginRight:t*e.layoutMargin};case!!(t&&n):return{marginTop:t*e.layoutMargin,marginBottom:t*e.layoutMargin};default:return{}}}),nm=({col:e,row:t,outer:r,children:n,...o})=>{let l=tm(typeof r=="number"||!r?r:e||t);return a.createElement(rm,{col:e,row:t,outer:l,...o},n)},am=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold})),om=R.div(),lm=R.div(({theme:e})=>({padding:30,textAlign:"center",color:e.color.defaultText,fontSize:e.typography.size.s2-1})),Eu=({children:e,...t})=>{let[r,n]=b.Children.toArray(e);return a.createElement(lm,{...t},a.createElement(am,null,r),n&&a.createElement(om,null,n))},im=R.div(({scale:e=1,elementHeight:t})=>({height:t||"auto",transformOrigin:"top left",transform:`scale(${1/e})`}));function sm({scale:e,children:t}){let r=b.useRef(null),[n,o]=b.useState(0),l=b.useCallback(({height:i})=>{i&&o(i/e)},[e]);return b.useEffect(()=>{r.current&&o(r.current.getBoundingClientRect().height)},[e]),Ks({ref:r,onResize:l}),a.createElement(im,{scale:e,elementHeight:n},a.createElement("div",{ref:r,className:"innerZoomElementWrapper"},t))}var um=class extends b.Component{constructor(){super(...arguments),this.iframe=null}componentDidMount(){let{iFrameRef:e}=this.props;this.iframe=e.current}shouldComponentUpdate(e){let{scale:t,active:r}=this.props;return t!==e.scale&&this.setIframeInnerZoom(e.scale),r!==e.active&&this.iframe.setAttribute("data-is-storybook",e.active?"true":"false"),e.children.props.src!==this.props.children.props.src}setIframeInnerZoom(e){try{Object.assign(this.iframe.contentDocument.body.style,{width:`${e*100}%`,height:`${e*100}%`,transform:`scale(${1/e})`,transformOrigin:"top left"})}catch{this.setIframeZoom(e)}}setIframeZoom(e){Object.assign(this.iframe.style,{width:`${e*100}%`,height:`${e*100}%`,transform:`scale(${1/e})`,transformOrigin:"top left"})}render(){let{children:e}=this.props;return a.createElement(a.Fragment,null,e)}},xu={Element:sm,IFrame:um},{document:cm}=lf,dm=R.strong(({theme:e})=>({color:e.color.orange})),pm=R.strong(({theme:e})=>({color:e.color.ancillary,textDecoration:"underline"})),ri=R.em(({theme:e})=>({color:e.textMutedColor})),fm=/(Error): (.*)\n/,mm=/at (?:(.*) )?\(?(.+)\)?/,gm=/([^@]+)?(?:\/<)?@(.+)?/,hm=/([^@]+)?@(.+)?/,wu=({error:e})=>{if(!e)return a.createElement(b.Fragment,null,"This error has no stack or message");if(!e.stack)return a.createElement(b.Fragment,null,e.message||"This error has no stack or message");let t=e.stack.toString();t&&e.message&&!t.includes(e.message)&&(t=`Error: ${e.message} -${t}`);let r=t.match(fm);if(!r)return a.createElement(b.Fragment,null,t);let[,n,o]=r,l=t.split(/\n/).slice(1),[,...i]=l.map(s=>{let u=s.match(mm)||s.match(gm)||s.match(hm);return u?{name:(u[1]||"").replace("/<",""),location:u[2].replace(cm.location.origin,"")}:null}).filter(Boolean);return a.createElement(b.Fragment,null,a.createElement("span",null,n),": ",a.createElement(dm,null,o),a.createElement("br",null),i.map((s,u)=>s.name?a.createElement(b.Fragment,{key:u}," ","at ",a.createElement(pm,null,s.name)," (",a.createElement(ri,null,s.location),")",a.createElement("br",null)):a.createElement(b.Fragment,{key:u}," ","at ",a.createElement(ri,null,s.location),a.createElement("br",null))))},Au=R.button(({small:e,theme:t})=>({border:0,borderRadius:"3em",cursor:"pointer",display:"inline-block",overflow:"hidden",padding:e?"8px 16px":"13px 20px",position:"relative",textAlign:"center",textDecoration:"none",transitionProperty:"background, box-shadow",transitionDuration:"150ms",transitionTimingFunction:"ease-out",verticalAlign:"top",whiteSpace:"nowrap",userSelect:"none",opacity:1,margin:0,background:"transparent",fontSize:`${e?t.typography.size.s1:t.typography.size.s2-1}px`,fontWeight:t.typography.weight.bold,lineHeight:"1",svg:{display:"inline-block",height:e?12:14,width:e?12:14,verticalAlign:"top",marginRight:e?4:6,marginTop:e?0:-1,marginBottom:e?0:-1,pointerEvents:"none",path:{fill:"currentColor"}}}),({disabled:e})=>e?{cursor:"not-allowed !important",opacity:.5,"&:hover":{transform:"none"}}:{},({containsIcon:e,small:t})=>e?{svg:{display:"block",margin:0},...t?{padding:10}:{padding:13}}:{},({theme:e,primary:t,secondary:r,gray:n})=>{let o;return n?o=e.color.mediumlight:r?o=e.color.secondary:t&&(o=e.color.primary),o?{background:o,color:n?e.color.darkest:e.color.lightest,"&:hover":{background:Wt(.05,o)},"&:active":{boxShadow:"rgba(0, 0, 0, 0.1) 0 0 0 3em inset"},"&:focus":{boxShadow:`${ut(o,1)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${ut(o,.2)} 0 8px 18px 0px`}}:{}},({theme:e,tertiary:t,inForm:r,small:n})=>t?{background:e.button.background,color:e.input.color,boxShadow:`${e.button.border} 0 0 0 1px inset`,borderRadius:e.input.borderRadius,...r&&n?{padding:"10px 16px"}:{},"&:hover":{background:e.base==="light"?Wt(.02,e.button.background):Mf(.03,e.button.background),...r?{}:{boxShadow:"rgba(0,0,0,.2) 0 2px 6px 0, rgba(0,0,0,.1) 0 0 0 1px inset"}},"&:active":{background:e.button.background},"&:focus":{boxShadow:`${ut(e.color.secondary,1)} 0 0 0 1px inset`,outline:"none"}}:{},({theme:e,outline:t})=>t?{boxShadow:`${ve(.8,e.color.defaultText)} 0 0 0 1px inset`,color:ve(.3,e.color.defaultText),background:"transparent","&:hover, &:focus":{boxShadow:`${ve(.5,e.color.defaultText)} 0 0 0 1px inset`,outline:"none"},"&:active":{boxShadow:`${ve(.5,e.color.defaultText)} 0 0 0 2px inset`,color:ve(0,e.color.defaultText)}}:{},({theme:e,outline:t,primary:r})=>{let n=e.color.primary;return t&&r?{boxShadow:`${n} 0 0 0 1px inset`,color:n,"svg path:not([fill])":{fill:n},"&:hover":{boxShadow:`${n} 0 0 0 1px inset`,background:"transparent"},"&:active":{background:n,boxShadow:`${n} 0 0 0 1px inset`,color:e.color.tertiary},"&:focus":{boxShadow:`${n} 0 0 0 1px inset, ${ut(n,.4)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${n} 0 0 0 1px inset, ${ut(n,.2)} 0 8px 18px 0px`}}:{}},({theme:e,outline:t,primary:r,secondary:n})=>{let o;return n?o=e.color.secondary:r&&(o=e.color.primary),t&&o?{boxShadow:`${o} 0 0 0 1px inset`,color:o,"svg path:not([fill])":{fill:o},"&:hover":{boxShadow:`${o} 0 0 0 1px inset`,background:"transparent"},"&:active":{background:o,boxShadow:`${o} 0 0 0 1px inset`,color:e.color.tertiary},"&:focus":{boxShadow:`${o} 0 0 0 1px inset, ${ut(o,.4)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${o} 0 0 0 1px inset, ${ut(o,.2)} 0 8px 18px 0px`}}:{}}),bm=Au.withComponent("a"),Cu=Object.assign(b.forwardRef(function({isLink:e,children:t,...r},n){return e?a.createElement(bm,{...r,ref:n},t):a.createElement(Au,{...r,ref:n},t)}),{defaultProps:{isLink:!1}}),ym=R.label(({theme:e})=>({display:"flex",borderBottom:`1px solid ${e.appBorderColor}`,margin:"0 15px",padding:"8px 0","&:last-child":{marginBottom:"3rem"}})),vm=R.span(({theme:e})=>({minWidth:100,fontWeight:e.typography.weight.bold,marginRight:15,display:"flex",justifyContent:"flex-start",alignItems:"center",lineHeight:"16px"})),Su=({label:e,children:t,...r})=>a.createElement(ym,{...r},e?a.createElement(vm,null,a.createElement("span",null,e)):null,t);Su.defaultProps={label:void 0};function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[o]=e[o]);return r}var ni=function(e,t){if(typeof e=="function"){e(t);return}e.current=t},xm=function(e,t){var r=b.useRef();return b.useCallback(function(n){e.current=n,r.current&&ni(r.current,null),r.current=t,t&&ni(t,n)},[t])},wm=xm,Am=function(){},Cm=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Sm=function(e,t){e.cacheMeasurements,e.maxRows,e.minRows;var r=e.onChange,n=r===void 0?Am:r;e.onHeightChange;var o=Em(e,Cm);o.value;var l=b.useRef(null),i=wm(l,t);return b.useRef(0),b.useRef(),b.createElement("textarea",Ua({},o,{onChange:n,ref:i}))},km=b.forwardRef(Sm),Rm={appearance:"none",border:"0 none",boxSizing:"inherit",display:" block",margin:" 0",background:"transparent",padding:0,fontSize:"inherit",position:"relative"},Vo=({theme:e})=>({...Rm,transition:"box-shadow 200ms ease-out, opacity 200ms ease-out",color:e.input.color||"inherit",background:e.input.background,boxShadow:`${e.input.border} 0 0 0 1px inset`,borderRadius:e.input.borderRadius,fontSize:e.typography.size.s2-1,lineHeight:"20px",padding:"6px 10px",boxSizing:"border-box",height:32,'&[type="file"]':{height:"auto"},"&:focus":{boxShadow:`${e.color.secondary} 0 0 0 1px inset`,outline:"none"},"&[disabled]":{cursor:"not-allowed",opacity:.5},"&:-webkit-autofill":{WebkitBoxShadow:`0 0 0 3em ${e.color.lightest} inset`},"&::placeholder":{color:e.textMutedColor,opacity:1}}),Mn=({size:e})=>{switch(e){case"100%":return{width:"100%"};case"flex":return{flex:1};case"auto":default:return{display:"inline"}}},ku=({align:e})=>{switch(e){case"end":return{textAlign:"right"};case"center":return{textAlign:"center"};case"start":default:return{textAlign:"left"}}},$n=({valid:e,theme:t})=>{switch(e){case"valid":return{boxShadow:`${t.color.positive} 0 0 0 1px inset !important`};case"error":return{boxShadow:`${t.color.negative} 0 0 0 1px inset !important`};case"warn":return{boxShadow:`${t.color.warning} 0 0 0 1px inset`};case void 0:case null:default:return{}}},Fm=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement("input",{...n,ref:o})}))(Vo,Mn,ku,$n,{minHeight:32}),{displayName:"Input"}),Tm=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement("select",{...n,ref:o})}))(Vo,Mn,$n,{height:32,userSelect:"none",paddingRight:20,appearance:"menulist"}),{displayName:"Select"}),Om=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement(km,{...n,ref:o})}))(Vo,Mn,ku,$n,({height:e=400})=>({overflow:"visible",maxHeight:e})),{displayName:"Textarea"}),Lm=R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement(Cu,{...n,ref:o})}))(Mn,$n,{userSelect:"none",overflow:"visible",zIndex:2,"&:hover":{transform:"none"}}),Dm=Object.assign(b.forwardRef(function(e,t){return a.createElement(Lm,{...e,tertiary:!0,small:!0,inForm:!0,ref:t})}),{displayName:"Button"}),Ie=Object.assign(R.form({boxSizing:"border-box",width:"100%"}),{Field:Su,Input:Fm,Select:Tm,Textarea:Om,Button:Dm}),_m=b.lazy(()=>Ht(()=>import("./WithTooltip-V3YHNWJZ--j86pm_C.js"),__vite__mapDeps([16,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url).then(e=>({default:e.WithTooltip}))),Mm=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement(_m,{...e})),$m=b.lazy(()=>Ht(()=>import("./WithTooltip-V3YHNWJZ--j86pm_C.js"),__vite__mapDeps([16,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url).then(e=>({default:e.WithTooltipPure}))),Ru=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement($m,{...e})),Bm=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold})),Hm=R.span(),Im=R.div(({theme:e})=>({marginTop:8,textAlign:"center","> *":{margin:"0 8px",fontWeight:e.typography.weight.bold}})),Nm=R.div(({theme:e})=>({color:e.color.defaultText,lineHeight:"18px"})),Zm=R.div({padding:15,width:280,boxSizing:"border-box"}),Fu=({title:e,desc:t,links:r})=>a.createElement(Zm,null,a.createElement(Nm,null,e&&a.createElement(Bm,null,e),t&&a.createElement(Hm,null,t)),r&&a.createElement(Im,null,r.map(({title:n,...o})=>a.createElement(Et,{...o,key:n},n))));Fu.defaultProps={title:null,desc:null,links:null};var jm=R.div(({theme:e})=>({padding:"2px 6px",lineHeight:"16px",fontSize:10,fontWeight:e.typography.weight.bold,color:e.color.lightest,boxShadow:"0 0 5px 0 rgba(0, 0, 0, 0.3)",borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none",zIndex:-1,background:e.base==="light"?"rgba(60, 60, 60, 0.9)":"rgba(0, 0, 0, 0.95)",margin:6})),Pm=({note:e,...t})=>a.createElement(jm,{...t},e),Vm=R(({active:e,loading:t,disabled:r,...n})=>a.createElement("span",{...n}))(({theme:e})=>({color:e.color.defaultText,fontWeight:e.typography.weight.regular}),({active:e,theme:t})=>e?{color:t.color.secondary,fontWeight:t.typography.weight.bold}:{},({loading:e,theme:t})=>e?{display:"inline-block",flex:"none",...t.animation.inlineGlow}:{},({disabled:e,theme:t})=>e?{color:ve(.7,t.color.defaultText)}:{}),zm=R.span({display:"flex","& svg":{height:12,width:12,margin:"3px 0",verticalAlign:"top"},"& path":{fill:"inherit"}}),qm=R.span({flex:1,textAlign:"left",display:"flex",flexDirection:"column"},({isIndented:e})=>e?{marginLeft:24}:{}),Um=R.span(({theme:e})=>({fontSize:"11px",lineHeight:"14px"}),({active:e,theme:t})=>e?{color:t.color.secondary}:{},({theme:e,disabled:t})=>t?{color:e.textMutedColor}:{}),ai=R.span(({active:e,theme:t})=>e?{"& svg":{opacity:1},"& svg path:not([fill])":{fill:t.color.secondary}}:{},()=>({display:"flex",maxWidth:14})),Wm=R.a(({theme:e})=>({fontSize:e.typography.size.s1,transition:"all 150ms ease-out",color:e.color.dark,textDecoration:"none",cursor:"pointer",justifyContent:"space-between",lineHeight:"18px",padding:"7px 10px",display:"flex",alignItems:"center","& > * + *":{paddingLeft:10},"&:hover":{background:e.background.hoverable},"&:hover svg":{opacity:1}}),({disabled:e})=>e?{cursor:"not-allowed"}:{}),Gm=ar(100)((e,t,r)=>{let n={};return e&&Object.assign(n,{onClick:e}),t&&Object.assign(n,{href:t}),r&&t&&Object.assign(n,{to:t,as:r}),n}),Tu=({loading:e,left:t,title:r,center:n,right:o,icon:l,active:i,disabled:s,isIndented:u,href:c,onClick:d,LinkWrapper:h,...m})=>{let p=Gm(d,c,h),g={active:i,disabled:s},f=typeof l=="string"&&Lr[l];return a.createElement(Wm,{...g,...m,...p},l?a.createElement(ai,{...g},f?a.createElement(ye,{icon:l}):l):t&&a.createElement(ai,{...g},t),r||n?a.createElement(qm,{isIndented:!t&&!l&&u},r&&a.createElement(Vm,{...g,loading:e},r),n&&a.createElement(Um,{...g},n)):null,o&&a.createElement(zm,{...g},o))};Tu.defaultProps={loading:!1,left:null,title:a.createElement("span",null,"Loading state"),center:null,right:null,active:!1,disabled:!1,href:null,LinkWrapper:null,onClick:null};var zo=Tu,Ym=R.div({minWidth:180,overflow:"hidden",overflowY:"auto",maxHeight:15.5*32},({theme:e})=>({borderRadius:e.appBorderRadius})),Km=e=>{let{LinkWrapper:t,onClick:r,id:n,isIndented:o,...l}=e,{title:i,href:s,active:u}=l,c=b.useCallback(h=>{r(h,l)},[r]),d=!!r;return a.createElement(zo,{title:i,active:u,href:s,id:`list-item-${n}`,LinkWrapper:t,isIndented:o,...l,...d?{onClick:c}:{}})},qo=({links:e,LinkWrapper:t})=>{let r=e.some(n=>n.left||n.icon);return a.createElement(Ym,null,e.map(({isGatsby:n,...o})=>a.createElement(Km,{key:o.id,LinkWrapper:n?t:null,isIndented:r,...o})))};qo.defaultProps={LinkWrapper:zo.defaultProps.LinkWrapper};var Uo=a.forwardRef(({children:e,...t},r)=>t.href!=null?a.createElement("a",{ref:r,...t},e):a.createElement("button",{ref:r,type:"button",...t},e));Uo.displayName="ButtonOrLink";var Nr=R(Uo,{shouldForwardProp:uo})({whiteSpace:"normal",display:"inline-flex",overflow:"hidden",verticalAlign:"top",justifyContent:"center",alignItems:"center",textAlign:"center",textDecoration:"none","&:empty":{display:"none"}},({theme:e})=>({padding:"0 15px",transition:"color 0.2s linear, border-bottom-color 0.2s linear",height:40,lineHeight:"12px",cursor:"pointer",background:"transparent",border:"0 solid transparent",borderTop:"3px solid transparent",borderBottom:"3px solid transparent",fontWeight:"bold",fontSize:13,"&:focus":{outline:"0 none",borderBottomColor:e.color.secondary}}),({active:e,textColor:t,theme:r})=>e?{color:t||r.barSelectedColor,borderBottomColor:r.barSelectedColor}:{color:t||r.barTextColor,borderBottomColor:"transparent"});Nr.displayName="TabButton";var Bt=R(Uo,{shouldForwardProp:uo})(()=>({alignItems:"center",background:"transparent",border:"none",borderRadius:4,color:"inherit",cursor:"pointer",display:"inline-flex",fontSize:13,fontWeight:"bold",height:28,justifyContent:"center",marginTop:6,padding:"8px 7px","& > svg":{width:14}}),({active:e,theme:t})=>e?{backgroundColor:t.background.hoverable,color:t.barSelectedColor}:{},({disabled:e,theme:t})=>e?{opacity:.5,cursor:"not-allowed"}:{"&:hover, &:focus-visible":{background:ve(.88,t.color.secondary),color:t.barHoverColor},"&:focus-visible":{outline:Ln},"&:focus:not(:focus-visible)":{outline:"none"}});Bt.displayName="IconButton";var Xm=R.div(({theme:e})=>({width:14,height:14,backgroundColor:e.appBorderColor,animation:`${e.animation.glow} 1.5s ease-in-out infinite`})),Jm=R.div(()=>({marginTop:6,padding:7,height:28})),Ou=()=>a.createElement(Jm,null,a.createElement(Xm,null)),Wa=R.div({display:"flex",whiteSpace:"nowrap",flexBasis:"auto",marginLeft:3,marginRight:3},({scrollable:e})=>e?{flexShrink:0}:{},({left:e})=>e?{"& > *":{marginLeft:4}}:{},({right:e})=>e?{marginLeft:30,"& > *":{marginRight:4}}:{});Wa.displayName="Side";var Qm=({children:e,className:t,scrollable:r})=>r?a.createElement(ko,{vertical:!1,className:t},e):a.createElement("div",{className:t},e),Wo=R(Qm)(({theme:e,scrollable:t=!0})=>({color:e.barTextColor,width:"100%",height:40,flexShrink:0,overflow:t?"auto":"hidden",overflowY:"hidden"}),({theme:e,border:t=!1})=>t?{boxShadow:`${e.appBorderColor} 0 -1px 0 0 inset`,background:e.barBg}:{});Wo.displayName="Bar";var eg=R.div(({bgColor:e})=>({display:"flex",justifyContent:"space-between",position:"relative",flexWrap:"nowrap",flexShrink:0,height:40,backgroundColor:e||""})),Bn=({children:e,backgroundColor:t,...r})=>{let[n,o]=b.Children.toArray(e);return a.createElement(Wo,{...r},a.createElement(eg,{bgColor:t},a.createElement(Wa,{scrollable:r.scrollable,left:!0},n),o?a.createElement(Wa,{right:!0},o):null))};Bn.displayName="FlexBar";var Lu=R.div(({active:e})=>e?{display:"block"}:{display:"none"}),oi=e=>b.Children.toArray(e).map(({props:{title:t,id:r,color:n,children:o}})=>{let l=Array.isArray(o)?o[0]:o;return{title:t,id:r,...n?{color:n}:{},render:typeof l=="function"?l:({active:i})=>a.createElement(Lu,{active:i,role:"tabpanel"},l)}}),tg=R.span(({theme:e,isActive:t})=>({display:"inline-block",width:0,height:0,marginLeft:8,color:t?e.color.secondary:e.color.mediumdark,borderRight:"3px solid transparent",borderLeft:"3px solid transparent",borderTop:"3px solid",transition:"transform .1s ease-out"})),rg=R(Nr)(({active:e,theme:t,preActive:r})=>` +${t}`);let r=t.match(fm);if(!r)return a.createElement(b.Fragment,null,t);let[,n,o]=r,l=t.split(/\n/).slice(1),[,...i]=l.map(s=>{let u=s.match(mm)||s.match(gm)||s.match(hm);return u?{name:(u[1]||"").replace("/<",""),location:u[2].replace(cm.location.origin,"")}:null}).filter(Boolean);return a.createElement(b.Fragment,null,a.createElement("span",null,n),": ",a.createElement(dm,null,o),a.createElement("br",null),i.map((s,u)=>s.name?a.createElement(b.Fragment,{key:u}," ","at ",a.createElement(pm,null,s.name)," (",a.createElement(ri,null,s.location),")",a.createElement("br",null)):a.createElement(b.Fragment,{key:u}," ","at ",a.createElement(ri,null,s.location),a.createElement("br",null))))},Au=R.button(({small:e,theme:t})=>({border:0,borderRadius:"3em",cursor:"pointer",display:"inline-block",overflow:"hidden",padding:e?"8px 16px":"13px 20px",position:"relative",textAlign:"center",textDecoration:"none",transitionProperty:"background, box-shadow",transitionDuration:"150ms",transitionTimingFunction:"ease-out",verticalAlign:"top",whiteSpace:"nowrap",userSelect:"none",opacity:1,margin:0,background:"transparent",fontSize:`${e?t.typography.size.s1:t.typography.size.s2-1}px`,fontWeight:t.typography.weight.bold,lineHeight:"1",svg:{display:"inline-block",height:e?12:14,width:e?12:14,verticalAlign:"top",marginRight:e?4:6,marginTop:e?0:-1,marginBottom:e?0:-1,pointerEvents:"none",path:{fill:"currentColor"}}}),({disabled:e})=>e?{cursor:"not-allowed !important",opacity:.5,"&:hover":{transform:"none"}}:{},({containsIcon:e,small:t})=>e?{svg:{display:"block",margin:0},...t?{padding:10}:{padding:13}}:{},({theme:e,primary:t,secondary:r,gray:n})=>{let o;return n?o=e.color.mediumlight:r?o=e.color.secondary:t&&(o=e.color.primary),o?{background:o,color:n?e.color.darkest:e.color.lightest,"&:hover":{background:Wt(.05,o)},"&:active":{boxShadow:"rgba(0, 0, 0, 0.1) 0 0 0 3em inset"},"&:focus":{boxShadow:`${ut(o,1)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${ut(o,.2)} 0 8px 18px 0px`}}:{}},({theme:e,tertiary:t,inForm:r,small:n})=>t?{background:e.button.background,color:e.input.color,boxShadow:`${e.button.border} 0 0 0 1px inset`,borderRadius:e.input.borderRadius,...r&&n?{padding:"10px 16px"}:{},"&:hover":{background:e.base==="light"?Wt(.02,e.button.background):Mf(.03,e.button.background),...r?{}:{boxShadow:"rgba(0,0,0,.2) 0 2px 6px 0, rgba(0,0,0,.1) 0 0 0 1px inset"}},"&:active":{background:e.button.background},"&:focus":{boxShadow:`${ut(e.color.secondary,1)} 0 0 0 1px inset`,outline:"none"}}:{},({theme:e,outline:t})=>t?{boxShadow:`${ve(.8,e.color.defaultText)} 0 0 0 1px inset`,color:ve(.3,e.color.defaultText),background:"transparent","&:hover, &:focus":{boxShadow:`${ve(.5,e.color.defaultText)} 0 0 0 1px inset`,outline:"none"},"&:active":{boxShadow:`${ve(.5,e.color.defaultText)} 0 0 0 2px inset`,color:ve(0,e.color.defaultText)}}:{},({theme:e,outline:t,primary:r})=>{let n=e.color.primary;return t&&r?{boxShadow:`${n} 0 0 0 1px inset`,color:n,"svg path:not([fill])":{fill:n},"&:hover":{boxShadow:`${n} 0 0 0 1px inset`,background:"transparent"},"&:active":{background:n,boxShadow:`${n} 0 0 0 1px inset`,color:e.color.tertiary},"&:focus":{boxShadow:`${n} 0 0 0 1px inset, ${ut(n,.4)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${n} 0 0 0 1px inset, ${ut(n,.2)} 0 8px 18px 0px`}}:{}},({theme:e,outline:t,primary:r,secondary:n})=>{let o;return n?o=e.color.secondary:r&&(o=e.color.primary),t&&o?{boxShadow:`${o} 0 0 0 1px inset`,color:o,"svg path:not([fill])":{fill:o},"&:hover":{boxShadow:`${o} 0 0 0 1px inset`,background:"transparent"},"&:active":{background:o,boxShadow:`${o} 0 0 0 1px inset`,color:e.color.tertiary},"&:focus":{boxShadow:`${o} 0 0 0 1px inset, ${ut(o,.4)} 0 1px 9px 2px`,outline:"none"},"&:focus:hover":{boxShadow:`${o} 0 0 0 1px inset, ${ut(o,.2)} 0 8px 18px 0px`}}:{}}),bm=Au.withComponent("a"),Cu=Object.assign(b.forwardRef(function({isLink:e,children:t,...r},n){return e?a.createElement(bm,{...r,ref:n},t):a.createElement(Au,{...r,ref:n},t)}),{defaultProps:{isLink:!1}}),ym=R.label(({theme:e})=>({display:"flex",borderBottom:`1px solid ${e.appBorderColor}`,margin:"0 15px",padding:"8px 0","&:last-child":{marginBottom:"3rem"}})),vm=R.span(({theme:e})=>({minWidth:100,fontWeight:e.typography.weight.bold,marginRight:15,display:"flex",justifyContent:"flex-start",alignItems:"center",lineHeight:"16px"})),Su=({label:e,children:t,...r})=>a.createElement(ym,{...r},e?a.createElement(vm,null,a.createElement("span",null,e)):null,t);Su.defaultProps={label:void 0};function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[o]=e[o]);return r}var ni=function(e,t){if(typeof e=="function"){e(t);return}e.current=t},xm=function(e,t){var r=b.useRef();return b.useCallback(function(n){e.current=n,r.current&&ni(r.current,null),r.current=t,t&&ni(t,n)},[t])},wm=xm,Am=function(){},Cm=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Sm=function(e,t){e.cacheMeasurements,e.maxRows,e.minRows;var r=e.onChange,n=r===void 0?Am:r;e.onHeightChange;var o=Em(e,Cm);o.value;var l=b.useRef(null),i=wm(l,t);return b.useRef(0),b.useRef(),b.createElement("textarea",Ua({},o,{onChange:n,ref:i}))},km=b.forwardRef(Sm),Rm={appearance:"none",border:"0 none",boxSizing:"inherit",display:" block",margin:" 0",background:"transparent",padding:0,fontSize:"inherit",position:"relative"},Vo=({theme:e})=>({...Rm,transition:"box-shadow 200ms ease-out, opacity 200ms ease-out",color:e.input.color||"inherit",background:e.input.background,boxShadow:`${e.input.border} 0 0 0 1px inset`,borderRadius:e.input.borderRadius,fontSize:e.typography.size.s2-1,lineHeight:"20px",padding:"6px 10px",boxSizing:"border-box",height:32,'&[type="file"]':{height:"auto"},"&:focus":{boxShadow:`${e.color.secondary} 0 0 0 1px inset`,outline:"none"},"&[disabled]":{cursor:"not-allowed",opacity:.5},"&:-webkit-autofill":{WebkitBoxShadow:`0 0 0 3em ${e.color.lightest} inset`},"&::placeholder":{color:e.textMutedColor,opacity:1}}),Mn=({size:e})=>{switch(e){case"100%":return{width:"100%"};case"flex":return{flex:1};case"auto":default:return{display:"inline"}}},ku=({align:e})=>{switch(e){case"end":return{textAlign:"right"};case"center":return{textAlign:"center"};case"start":default:return{textAlign:"left"}}},$n=({valid:e,theme:t})=>{switch(e){case"valid":return{boxShadow:`${t.color.positive} 0 0 0 1px inset !important`};case"error":return{boxShadow:`${t.color.negative} 0 0 0 1px inset !important`};case"warn":return{boxShadow:`${t.color.warning} 0 0 0 1px inset`};case void 0:case null:default:return{}}},Fm=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement("input",{...n,ref:o})}))(Vo,Mn,ku,$n,{minHeight:32}),{displayName:"Input"}),Tm=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement("select",{...n,ref:o})}))(Vo,Mn,$n,{height:32,userSelect:"none",paddingRight:20,appearance:"menulist"}),{displayName:"Select"}),Om=Object.assign(R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement(km,{...n,ref:o})}))(Vo,Mn,ku,$n,({height:e=400})=>({overflow:"visible",maxHeight:e})),{displayName:"Textarea"}),Lm=R(b.forwardRef(function({size:e,valid:t,align:r,...n},o){return a.createElement(Cu,{...n,ref:o})}))(Mn,$n,{userSelect:"none",overflow:"visible",zIndex:2,"&:hover":{transform:"none"}}),Dm=Object.assign(b.forwardRef(function(e,t){return a.createElement(Lm,{...e,tertiary:!0,small:!0,inForm:!0,ref:t})}),{displayName:"Button"}),Ie=Object.assign(R.form({boxSizing:"border-box",width:"100%"}),{Field:Su,Input:Fm,Select:Tm,Textarea:Om,Button:Dm}),_m=b.lazy(()=>Ht(()=>import("./WithTooltip-V3YHNWJZ-5A2-LERo.js"),__vite__mapDeps([16,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url).then(e=>({default:e.WithTooltip}))),Mm=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement(_m,{...e})),$m=b.lazy(()=>Ht(()=>import("./WithTooltip-V3YHNWJZ-5A2-LERo.js"),__vite__mapDeps([16,1,2,3,4,5,6,7,8,9,10,11,12,13,14]),import.meta.url).then(e=>({default:e.WithTooltipPure}))),Ru=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement($m,{...e})),Bm=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold})),Hm=R.span(),Im=R.div(({theme:e})=>({marginTop:8,textAlign:"center","> *":{margin:"0 8px",fontWeight:e.typography.weight.bold}})),Nm=R.div(({theme:e})=>({color:e.color.defaultText,lineHeight:"18px"})),Zm=R.div({padding:15,width:280,boxSizing:"border-box"}),Fu=({title:e,desc:t,links:r})=>a.createElement(Zm,null,a.createElement(Nm,null,e&&a.createElement(Bm,null,e),t&&a.createElement(Hm,null,t)),r&&a.createElement(Im,null,r.map(({title:n,...o})=>a.createElement(Et,{...o,key:n},n))));Fu.defaultProps={title:null,desc:null,links:null};var jm=R.div(({theme:e})=>({padding:"2px 6px",lineHeight:"16px",fontSize:10,fontWeight:e.typography.weight.bold,color:e.color.lightest,boxShadow:"0 0 5px 0 rgba(0, 0, 0, 0.3)",borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none",zIndex:-1,background:e.base==="light"?"rgba(60, 60, 60, 0.9)":"rgba(0, 0, 0, 0.95)",margin:6})),Pm=({note:e,...t})=>a.createElement(jm,{...t},e),Vm=R(({active:e,loading:t,disabled:r,...n})=>a.createElement("span",{...n}))(({theme:e})=>({color:e.color.defaultText,fontWeight:e.typography.weight.regular}),({active:e,theme:t})=>e?{color:t.color.secondary,fontWeight:t.typography.weight.bold}:{},({loading:e,theme:t})=>e?{display:"inline-block",flex:"none",...t.animation.inlineGlow}:{},({disabled:e,theme:t})=>e?{color:ve(.7,t.color.defaultText)}:{}),zm=R.span({display:"flex","& svg":{height:12,width:12,margin:"3px 0",verticalAlign:"top"},"& path":{fill:"inherit"}}),qm=R.span({flex:1,textAlign:"left",display:"flex",flexDirection:"column"},({isIndented:e})=>e?{marginLeft:24}:{}),Um=R.span(({theme:e})=>({fontSize:"11px",lineHeight:"14px"}),({active:e,theme:t})=>e?{color:t.color.secondary}:{},({theme:e,disabled:t})=>t?{color:e.textMutedColor}:{}),ai=R.span(({active:e,theme:t})=>e?{"& svg":{opacity:1},"& svg path:not([fill])":{fill:t.color.secondary}}:{},()=>({display:"flex",maxWidth:14})),Wm=R.a(({theme:e})=>({fontSize:e.typography.size.s1,transition:"all 150ms ease-out",color:e.color.dark,textDecoration:"none",cursor:"pointer",justifyContent:"space-between",lineHeight:"18px",padding:"7px 10px",display:"flex",alignItems:"center","& > * + *":{paddingLeft:10},"&:hover":{background:e.background.hoverable},"&:hover svg":{opacity:1}}),({disabled:e})=>e?{cursor:"not-allowed"}:{}),Gm=ar(100)((e,t,r)=>{let n={};return e&&Object.assign(n,{onClick:e}),t&&Object.assign(n,{href:t}),r&&t&&Object.assign(n,{to:t,as:r}),n}),Tu=({loading:e,left:t,title:r,center:n,right:o,icon:l,active:i,disabled:s,isIndented:u,href:c,onClick:d,LinkWrapper:h,...m})=>{let p=Gm(d,c,h),g={active:i,disabled:s},f=typeof l=="string"&&Lr[l];return a.createElement(Wm,{...g,...m,...p},l?a.createElement(ai,{...g},f?a.createElement(ye,{icon:l}):l):t&&a.createElement(ai,{...g},t),r||n?a.createElement(qm,{isIndented:!t&&!l&&u},r&&a.createElement(Vm,{...g,loading:e},r),n&&a.createElement(Um,{...g},n)):null,o&&a.createElement(zm,{...g},o))};Tu.defaultProps={loading:!1,left:null,title:a.createElement("span",null,"Loading state"),center:null,right:null,active:!1,disabled:!1,href:null,LinkWrapper:null,onClick:null};var zo=Tu,Ym=R.div({minWidth:180,overflow:"hidden",overflowY:"auto",maxHeight:15.5*32},({theme:e})=>({borderRadius:e.appBorderRadius})),Km=e=>{let{LinkWrapper:t,onClick:r,id:n,isIndented:o,...l}=e,{title:i,href:s,active:u}=l,c=b.useCallback(h=>{r(h,l)},[r]),d=!!r;return a.createElement(zo,{title:i,active:u,href:s,id:`list-item-${n}`,LinkWrapper:t,isIndented:o,...l,...d?{onClick:c}:{}})},qo=({links:e,LinkWrapper:t})=>{let r=e.some(n=>n.left||n.icon);return a.createElement(Ym,null,e.map(({isGatsby:n,...o})=>a.createElement(Km,{key:o.id,LinkWrapper:n?t:null,isIndented:r,...o})))};qo.defaultProps={LinkWrapper:zo.defaultProps.LinkWrapper};var Uo=a.forwardRef(({children:e,...t},r)=>t.href!=null?a.createElement("a",{ref:r,...t},e):a.createElement("button",{ref:r,type:"button",...t},e));Uo.displayName="ButtonOrLink";var Nr=R(Uo,{shouldForwardProp:uo})({whiteSpace:"normal",display:"inline-flex",overflow:"hidden",verticalAlign:"top",justifyContent:"center",alignItems:"center",textAlign:"center",textDecoration:"none","&:empty":{display:"none"}},({theme:e})=>({padding:"0 15px",transition:"color 0.2s linear, border-bottom-color 0.2s linear",height:40,lineHeight:"12px",cursor:"pointer",background:"transparent",border:"0 solid transparent",borderTop:"3px solid transparent",borderBottom:"3px solid transparent",fontWeight:"bold",fontSize:13,"&:focus":{outline:"0 none",borderBottomColor:e.color.secondary}}),({active:e,textColor:t,theme:r})=>e?{color:t||r.barSelectedColor,borderBottomColor:r.barSelectedColor}:{color:t||r.barTextColor,borderBottomColor:"transparent"});Nr.displayName="TabButton";var Bt=R(Uo,{shouldForwardProp:uo})(()=>({alignItems:"center",background:"transparent",border:"none",borderRadius:4,color:"inherit",cursor:"pointer",display:"inline-flex",fontSize:13,fontWeight:"bold",height:28,justifyContent:"center",marginTop:6,padding:"8px 7px","& > svg":{width:14}}),({active:e,theme:t})=>e?{backgroundColor:t.background.hoverable,color:t.barSelectedColor}:{},({disabled:e,theme:t})=>e?{opacity:.5,cursor:"not-allowed"}:{"&:hover, &:focus-visible":{background:ve(.88,t.color.secondary),color:t.barHoverColor},"&:focus-visible":{outline:Ln},"&:focus:not(:focus-visible)":{outline:"none"}});Bt.displayName="IconButton";var Xm=R.div(({theme:e})=>({width:14,height:14,backgroundColor:e.appBorderColor,animation:`${e.animation.glow} 1.5s ease-in-out infinite`})),Jm=R.div(()=>({marginTop:6,padding:7,height:28})),Ou=()=>a.createElement(Jm,null,a.createElement(Xm,null)),Wa=R.div({display:"flex",whiteSpace:"nowrap",flexBasis:"auto",marginLeft:3,marginRight:3},({scrollable:e})=>e?{flexShrink:0}:{},({left:e})=>e?{"& > *":{marginLeft:4}}:{},({right:e})=>e?{marginLeft:30,"& > *":{marginRight:4}}:{});Wa.displayName="Side";var Qm=({children:e,className:t,scrollable:r})=>r?a.createElement(ko,{vertical:!1,className:t},e):a.createElement("div",{className:t},e),Wo=R(Qm)(({theme:e,scrollable:t=!0})=>({color:e.barTextColor,width:"100%",height:40,flexShrink:0,overflow:t?"auto":"hidden",overflowY:"hidden"}),({theme:e,border:t=!1})=>t?{boxShadow:`${e.appBorderColor} 0 -1px 0 0 inset`,background:e.barBg}:{});Wo.displayName="Bar";var eg=R.div(({bgColor:e})=>({display:"flex",justifyContent:"space-between",position:"relative",flexWrap:"nowrap",flexShrink:0,height:40,backgroundColor:e||""})),Bn=({children:e,backgroundColor:t,...r})=>{let[n,o]=b.Children.toArray(e);return a.createElement(Wo,{...r},a.createElement(eg,{bgColor:t},a.createElement(Wa,{scrollable:r.scrollable,left:!0},n),o?a.createElement(Wa,{right:!0},o):null))};Bn.displayName="FlexBar";var Lu=R.div(({active:e})=>e?{display:"block"}:{display:"none"}),oi=e=>b.Children.toArray(e).map(({props:{title:t,id:r,color:n,children:o}})=>{let l=Array.isArray(o)?o[0]:o;return{title:t,id:r,...n?{color:n}:{},render:typeof l=="function"?l:({active:i})=>a.createElement(Lu,{active:i,role:"tabpanel"},l)}}),tg=R.span(({theme:e,isActive:t})=>({display:"inline-block",width:0,height:0,marginLeft:8,color:t?e.color.secondary:e.color.mediumdark,borderRight:"3px solid transparent",borderLeft:"3px solid transparent",borderTop:"3px solid",transition:"transform .1s ease-out"})),rg=R(Nr)(({active:e,theme:t,preActive:r})=>` color: ${r||e?t.color.secondary:t.color.mediumdark}; &:hover { color: ${t.color.secondary}; @@ -292,7 +292,7 @@ ${t}`);let r=t.match(fm);if(!r)return a.createElement(b.Fragment,null,t);let[,n, ${Ge(.02,e.input.background)} 100%)`:`linear-gradient(to right, ${e.color.green} 0%, ${e.color.green} ${(n-t)/(r-t)*100}%, ${Ot(.02,e.input.background)} ${(n-t)/(r-t)*100}%, - ${Ot(.02,e.input.background)} 100%)`,boxShadow:`${e.appBorderColor} 0 0 0 1px inset`,color:"transparent",width:"100%",height:"6px",cursor:"pointer"},"&::-ms-fill-lower":{borderRadius:6},"&::-ms-fill-upper":{borderRadius:6},"&::-ms-thumb":{width:16,height:16,background:`${e.input.background}`,border:`1px solid ${ct(e.appBorderColor,.2)}`,borderRadius:50,cursor:"grab",marginTop:0},"@supports (-ms-ime-align:auto)":{"input[type=range]":{margin:"0"}}})),wc=R.span({paddingLeft:5,paddingRight:5,fontSize:12,whiteSpace:"nowrap",fontFeatureSettings:"tnum",fontVariantNumeric:"tabular-nums"}),z3=R(wc)(({numberOFDecimalsPlaces:e,max:t})=>({width:`${e+t.toString().length*2+3}ch`,textAlign:"right",flexShrink:0})),q3=R.div({display:"flex",alignItems:"center",width:"100%"});function U3(e){let t=e.toString().match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}var W3=({name:e,value:t,onChange:r,min:n=0,max:o=100,step:l=1,onBlur:i,onFocus:s})=>{let u=h=>{r(l3(h.target.value))},c=t!==void 0,d=b.useMemo(()=>U3(l),[l]);return a.createElement(q3,null,a.createElement(wc,null,n),a.createElement(V3,{id:Ne(e),type:"range",onChange:u,name:e,value:t,min:n,max:o,step:l,onFocus:s,onBlur:i}),a.createElement(z3,{numberOFDecimalsPlaces:d,max:o},c?t.toFixed(d):"--"," / ",o))},G3=R.label({display:"flex"}),Y3=R.div(({isMaxed:e})=>({marginLeft:"0.75rem",paddingTop:"0.35rem",color:e?"red":void 0})),K3=({name:e,value:t,onChange:r,onFocus:n,onBlur:o,maxLength:l})=>{let i=h=>{r(h.target.value)},[s,u]=b.useState(!1),c=b.useCallback(()=>{r(""),u(!0)},[u]);if(t===void 0)return a.createElement(Ie.Button,{id:vn(e),onClick:c},"Set string");let d=typeof t=="string";return a.createElement(G3,null,a.createElement(Ie.Textarea,{id:Ne(e),maxLength:l,onChange:i,size:"flex",placeholder:"Edit string...",autoFocus:s,valid:d?null:"error",name:e,value:d?t:"",onFocus:n,onBlur:o}),l&&a.createElement(Y3,{isMaxed:(t==null?void 0:t.length)===l},(t==null?void 0:t.length)??0," / ",l))},X3=R(Ie.Input)({padding:10});function J3(e){e.forEach(t=>{t.startsWith("blob:")&&URL.revokeObjectURL(t)})}var Q3=({onChange:e,name:t,accept:r="image/*",value:n})=>{let o=b.useRef(null);function l(i){if(!i.target.files)return;let s=Array.from(i.target.files).map(u=>URL.createObjectURL(u));e(s),J3(n)}return b.useEffect(()=>{n==null&&o.current&&(o.current.value=null)},[n,t]),a.createElement(X3,{ref:o,id:Ne(t),type:"file",name:t,multiple:!0,onChange:l,accept:r,size:"flex"})},e4=b.lazy(()=>Ht(()=>import("./Color-6VNJS4EI-N7NQjCtp.js"),__vite__mapDeps([17,4,18,3,1,2,5,6,7,8,9,10,11,12,13,14]),import.meta.url)),t4=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement(e4,{...e})),r4={array:Mi,object:Mi,boolean:Jb,color:t4,date:a3,number:i3,check:qt,"inline-check":qt,radio:qt,"inline-radio":qt,select:qt,"multi-select":qt,range:W3,text:K3,file:Q3},$i=()=>a.createElement(a.Fragment,null,"-"),n4=({row:e,arg:t,updateArgs:r,isHovered:n})=>{let{key:o,control:l}=e,[i,s]=b.useState(!1),[u,c]=b.useState({value:t});b.useEffect(()=>{i||c({value:t})},[i,t]);let d=b.useCallback(f=>(c({value:f}),r({[o]:f}),f),[r,o]),h=b.useCallback(()=>s(!1),[]),m=b.useCallback(()=>s(!0),[]);if(!l||l.disable)return n?a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Setup controls"):a.createElement($i,null);let p={name:o,argType:e,value:u.value,onChange:d,onBlur:h,onFocus:m},g=r4[l.type]||$i;return a.createElement(g,{...p,...l,controlType:l.type})},a4=R.span({fontWeight:"bold"}),o4=R.span(({theme:e})=>({color:e.color.negative,fontFamily:e.typography.fonts.mono,cursor:"help"})),l4=R.div(({theme:e})=>({"&&":{p:{margin:"0 0 10px 0"},a:{color:e.color.secondary}},code:{...ft({theme:e}),fontSize:12,fontFamily:e.typography.fonts.mono},"& code":{margin:0,display:"inline-block"},"& pre > code":{whiteSpace:"pre-wrap"}})),i4=R.div(({theme:e,hasDescription:t})=>({color:e.base==="light"?J(.1,e.color.defaultText):J(.2,e.color.defaultText),marginTop:t?4:0})),s4=R.div(({theme:e,hasDescription:t})=>({color:e.base==="light"?J(.1,e.color.defaultText):J(.2,e.color.defaultText),marginTop:t?12:0,marginBottom:12})),u4=R.td(({theme:e,expandable:t})=>({paddingLeft:t?"40px !important":"20px !important"})),Kr=e=>{var f;let[t,r]=b.useState(!1),{row:n,updateArgs:o,compact:l,expandable:i,initialExpandedArgs:s}=e,{name:u,description:c}=n,d=n.table||{},h=d.type||n.type,m=d.defaultValue||n.defaultValue,p=(f=n.type)==null?void 0:f.required,g=c!=null&&c!=="";return a.createElement("tr",{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1)},a.createElement(u4,{expandable:i},a.createElement(a4,null,u),p?a.createElement(o4,{title:"Required"},"*"):null),l?null:a.createElement("td",null,g&&a.createElement(l4,null,a.createElement(lc,null,c)),d.jsDocTags!=null?a.createElement(a.Fragment,null,a.createElement(s4,{hasDescription:g},a.createElement(va,{value:h,initialExpandedArgs:s})),a.createElement(Zb,{tags:d.jsDocTags})):a.createElement(i4,{hasDescription:g},a.createElement(va,{value:h,initialExpandedArgs:s}))),l?null:a.createElement("td",null,a.createElement(va,{value:m,initialExpandedArgs:s})),o?a.createElement("td",null,a.createElement(n4,{...e,isHovered:t})):null)},c4=R(ye)(({theme:e})=>({marginRight:8,marginLeft:-10,marginTop:-2,height:12,width:12,color:e.base==="light"?J(.25,e.color.defaultText):J(.3,e.color.defaultText),border:"none",display:"inline-block"})),d4=R.span(({theme:e})=>({display:"flex",lineHeight:"20px",alignItems:"center"})),p4=R.td(({theme:e})=>({position:"relative",letterSpacing:"0.35em",textTransform:"uppercase",fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s1-1,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText),background:`${e.background.app} !important`,"& ~ td":{background:`${e.background.app} !important`}})),f4=R.td(({theme:e})=>({position:"relative",fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s2-1,background:e.background.app})),m4=R.td(()=>({position:"relative"})),g4=R.tr(({theme:e})=>({"&:hover > td":{backgroundColor:`${Ot(.005,e.background.app)} !important`,boxShadow:`${e.color.mediumlight} 0 - 1px 0 0 inset`,cursor:"row-resize"}})),Bi=R.button(()=>({background:"none",border:"none",padding:"0",font:"inherit",position:"absolute",top:0,bottom:0,left:0,right:0,height:"100%",width:"100%",color:"transparent",cursor:"row-resize !important"})),xa=({level:e="section",label:t,children:r,initialExpanded:n=!0,colSpan:o=3})=>{let[l,i]=b.useState(n),s=e==="subsection"?f4:p4,u=(r==null?void 0:r.length)||0,c=e==="subsection"?`${u} item${u!==1?"s":""}`:"",d=l?"arrowdown":"arrowright",h=`${l?"Hide":"Show"} ${e==="subsection"?u:t} item${u!==1?"s":""}`;return a.createElement(a.Fragment,null,a.createElement(g4,{title:h},a.createElement(s,{colSpan:1},a.createElement(Bi,{onClick:m=>i(!l),tabIndex:0},h),a.createElement(d4,null,a.createElement(c4,{icon:d}),t)),a.createElement(m4,{colSpan:o-1},a.createElement(Bi,{onClick:m=>i(!l),tabIndex:-1,style:{outline:"none"}},h),l?null:c)),l?r:null)},Xr=R.div(({theme:e})=>({display:"flex",gap:16,borderBottom:`1px solid ${e.appBorderColor}`,"&:last-child":{borderBottom:0}})),fe=R.div(({numColumn:e})=>({display:"flex",flexDirection:"column",flex:e||1,gap:5,padding:"12px 20px"})),ae=R.div(({theme:e,width:t,height:r})=>({animation:`${e.animation.glow} 1.5s ease-in-out infinite`,background:e.appBorderColor,width:t||"100%",height:r||16,borderRadius:3})),me=[2,4,2,2],h4=()=>a.createElement(a.Fragment,null,a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"})))),b4=R.div(({inAddonPanel:e,theme:t})=>({height:e?"100%":"auto",display:"flex",border:e?"none":`1px solid ${t.appBorderColor}`,borderRadius:e?0:t.appBorderRadius,padding:e?0:40,alignItems:"center",justifyContent:"center",flexDirection:"column",gap:15,background:t.background.content,boxShadow:"rgba(0, 0, 0, 0.10) 0 1px 3px 0"})),y4=R.div({display:"flex",flexDirection:"column",gap:4,maxWidth:415}),v4=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s2-1,textAlign:"center",color:e.textColor})),E4=R.div(({theme:e})=>({fontWeight:e.typography.weight.regular,fontSize:e.typography.size.s2-1,textAlign:"center",color:e.textMutedColor})),x4=R.div(({theme:e})=>({display:"flex",fontSize:e.typography.size.s2-1,gap:25})),w4=R.div(({theme:e})=>({width:1,height:16,backgroundColor:e.appBorderColor})),A4=({inAddonPanel:e})=>{let[t,r]=b.useState(!0);return b.useEffect(()=>{let n=setTimeout(()=>{r(!1)},100);return()=>clearTimeout(n)},[]),t?null:a.createElement(b4,{inAddonPanel:e},a.createElement(y4,null,a.createElement(v4,null,e?"Interactive story playground":"Args table with interactive controls couldn't be auto-generated"),a.createElement(E4,null,"Controls give you an easy to use interface to test your components. Set your story args and you'll see controls appearing here automatically.")),a.createElement(x4,null,e&&a.createElement(a.Fragment,null,a.createElement(Et,{href:"https://youtu.be/0gOfS6K0x0E",target:"_blank",withArrow:!0},a.createElement(ye,{icon:"video"})," Watch 5m video"),a.createElement(w4,null),a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Read docs")),!e&&a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Learn how to set that up")))},C4=R.table(({theme:e,compact:t,inAddonPanel:r})=>({"&&":{borderSpacing:0,color:e.color.defaultText,"td, th":{padding:0,border:"none",verticalAlign:"top",textOverflow:"ellipsis"},fontSize:e.typography.size.s2-1,lineHeight:"20px",textAlign:"left",width:"100%",marginTop:r?0:25,marginBottom:r?0:40,"thead th:first-of-type, td:first-of-type":{width:"25%"},"th:first-of-type, td:first-of-type":{paddingLeft:20},"th:nth-of-type(2), td:nth-of-type(2)":{...t?null:{width:"35%"}},"td:nth-of-type(3)":{...t?null:{width:"15%"}},"th:last-of-type, td:last-of-type":{paddingRight:20,...t?null:{width:"25%"}},th:{color:e.base==="light"?J(.25,e.color.defaultText):J(.45,e.color.defaultText),paddingTop:10,paddingBottom:10,paddingLeft:15,paddingRight:15},td:{paddingTop:"10px",paddingBottom:"10px","&:not(:first-of-type)":{paddingLeft:15,paddingRight:15},"&:last-of-type":{paddingRight:20}},marginLeft:r?0:1,marginRight:r?0:1,tbody:{...r?null:{filter:e.base==="light"?"drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.10))":"drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.20))"},"> tr > *":{background:e.background.content,borderTop:`1px solid ${e.appBorderColor}`},...r?null:{"> tr:first-of-type > *":{borderBlockStart:`1px solid ${e.appBorderColor}`},"> tr:last-of-type > *":{borderBlockEnd:`1px solid ${e.appBorderColor}`},"> tr > *:first-of-type":{borderInlineStart:`1px solid ${e.appBorderColor}`},"> tr > *:last-of-type":{borderInlineEnd:`1px solid ${e.appBorderColor}`},"> tr:first-of-type > td:first-of-type":{borderTopLeftRadius:e.appBorderRadius},"> tr:first-of-type > td:last-of-type":{borderTopRightRadius:e.appBorderRadius},"> tr:last-of-type > td:first-of-type":{borderBottomLeftRadius:e.appBorderRadius},"> tr:last-of-type > td:last-of-type":{borderBottomRightRadius:e.appBorderRadius}}}}})),S4=R(Bt)(({theme:e})=>({color:e.barTextColor,margin:"-4px -12px -4px 0"})),k4=R.span({display:"flex",justifyContent:"space-between"}),R4={alpha:(e,t)=>e.name.localeCompare(t.name),requiredFirst:(e,t)=>{var r,n;return+!!((r=t.type)!=null&&r.required)-+!!((n=e.type)!=null&&n.required)||e.name.localeCompare(t.name)},none:void 0},F4=(e,t)=>{let r={ungrouped:[],ungroupedSubsections:{},sections:{}};if(!e)return r;Object.entries(e).forEach(([l,i])=>{let{category:s,subcategory:u}=(i==null?void 0:i.table)||{};if(s){let c=r.sections[s]||{ungrouped:[],subsections:{}};if(!u)c.ungrouped.push({key:l,...i});else{let d=c.subsections[u]||[];d.push({key:l,...i}),c.subsections[u]=d}r.sections[s]=c}else if(u){let c=r.ungroupedSubsections[u]||[];c.push({key:l,...i}),r.ungroupedSubsections[u]=c}else r.ungrouped.push({key:l,...i})});let n=R4[t],o=l=>n?Object.keys(l).reduce((i,s)=>({...i,[s]:l[s].sort(n)}),{}):l;return{ungrouped:r.ungrouped.sort(n),ungroupedSubsections:o(r.ungroupedSubsections),sections:Object.keys(r.sections).reduce((l,i)=>({...l,[i]:{ungrouped:r.sections[i].ungrouped.sort(n),subsections:o(r.sections[i].subsections)}}),{})}},T4=(e,t,r)=>{try{return $o.includeConditionalArg(e,t,r)}catch(n){return ib.warn(n.message),!1}},O4=e=>{let{updateArgs:t,resetArgs:r,compact:n,inAddonPanel:o,initialExpandedArgs:l,sort:i="none",isLoading:s}=e;if("error"in e){let{error:v}=e;return a.createElement(sc,null,v," ",a.createElement(Et,{href:"http://storybook.js.org/docs/",target:"_blank",withArrow:!0},"Read the docs"))}if(s)return a.createElement(h4,null);let{rows:u,args:c,globals:d}="rows"in e&&e,h=F4(Hc(u,v=>{var y;return!((y=v==null?void 0:v.table)!=null&&y.disable)&&T4(v,c||{},d||{})}),i),m=h.ungrouped.length===0,p=Object.entries(h.sections).length===0,g=Object.entries(h.ungroupedSubsections).length===0;if(m&&p&&g)return a.createElement(A4,{inAddonPanel:o});let f=1;t&&(f+=1),n||(f+=2);let w=Object.keys(h.sections).length>0,A={updateArgs:t,compact:n,inAddonPanel:o,initialExpandedArgs:l};return a.createElement(Po,null,a.createElement(C4,{compact:n,inAddonPanel:o,className:"docblock-argstable sb-unstyled"},a.createElement("thead",{className:"docblock-argstable-head"},a.createElement("tr",null,a.createElement("th",null,a.createElement("span",null,"Name")),n?null:a.createElement("th",null,a.createElement("span",null,"Description")),n?null:a.createElement("th",null,a.createElement("span",null,"Default")),t?a.createElement("th",null,a.createElement(k4,null,"Control"," ",!s&&r&&a.createElement(S4,{onClick:()=>r(),title:"Reset controls"},a.createElement(ye,{icon:"undo","aria-hidden":!0})))):null)),a.createElement("tbody",{className:"docblock-argstable-body"},h.ungrouped.map(v=>a.createElement(Kr,{key:v.key,row:v,arg:c&&c[v.key],...A})),Object.entries(h.ungroupedSubsections).map(([v,y])=>a.createElement(xa,{key:v,label:v,level:"subsection",colSpan:f},y.map(x=>a.createElement(Kr,{key:x.key,row:x,arg:c&&c[x.key],expandable:w,...A})))),Object.entries(h.sections).map(([v,y])=>a.createElement(xa,{key:v,label:v,level:"section",colSpan:f},y.ungrouped.map(x=>a.createElement(Kr,{key:x.key,row:x,arg:c&&c[x.key],...A})),Object.entries(y.subsections).map(([x,E])=>a.createElement(xa,{key:x,label:x,level:"subsection",colSpan:f},E.map(C=>a.createElement(Kr,{key:C.key,row:C,arg:c&&c[C.key],expandable:w,...A})))))))))};R.div(({theme:e})=>({marginRight:30,fontSize:`${e.typography.size.s1}px`,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText)}));R.div({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});R.div({display:"flex",flexDirection:"row",alignItems:"baseline","&:not(:last-child)":{marginBottom:"1rem"}});R.div(Q,({theme:e})=>({...jn(e),margin:"25px 0 40px",padding:"30px 20px"}));R.div(({theme:e})=>({fontWeight:e.typography.weight.bold,color:e.color.defaultText}));R.div(({theme:e})=>({color:e.base==="light"?J(.2,e.color.defaultText):J(.6,e.color.defaultText)}));R.div({flex:"0 0 30%",lineHeight:"20px",marginTop:5});R.div(({theme:e})=>({flex:1,textAlign:"center",fontFamily:e.typography.fonts.mono,fontSize:e.typography.size.s1,lineHeight:1,overflow:"hidden",color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText),"> div":{display:"inline-block",overflow:"hidden",maxWidth:"100%",textOverflow:"ellipsis"},span:{display:"block",marginTop:2}}));R.div({display:"flex",flexDirection:"row"});R.div(({background:e})=>({position:"relative",flex:1,"&::before":{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:e,content:'""'}}));R.div(({theme:e})=>({...jn(e),display:"flex",flexDirection:"row",height:50,marginBottom:5,overflow:"hidden",backgroundColor:"white",backgroundImage:"repeating-linear-gradient(-45deg, #ccc, #ccc 1px, #fff 1px, #fff 16px)",backgroundClip:"padding-box"}));R.div({display:"flex",flexDirection:"column",flex:1,position:"relative",marginBottom:30});R.div({flex:1,display:"flex",flexDirection:"row"});R.div({display:"flex",alignItems:"flex-start"});R.div({flex:"0 0 30%"});R.div({flex:1});R.div(({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",paddingBottom:20,fontWeight:e.typography.weight.bold,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText)}));R.div(({theme:e})=>({fontSize:e.typography.size.s2,lineHeight:"20px",display:"flex",flexDirection:"column"}));R.div(({theme:e})=>({fontFamily:e.typography.fonts.base,fontSize:e.typography.size.s2,color:e.color.defaultText,marginLeft:10,lineHeight:1.2}));R.div(({theme:e})=>({...jn(e),overflow:"hidden",height:40,width:40,display:"flex",alignItems:"center",justifyContent:"center",flex:"none","> img, > svg":{width:20,height:20}}));R.div({display:"inline-flex",flexDirection:"row",alignItems:"center",flex:"0 1 calc(20% - 10px)",minWidth:120,margin:"0px 10px 30px 0"});R.div({display:"flex",flexFlow:"row wrap"});var L4=e=>`anchor--${e}`,D4=({storyId:e,children:t})=>a.createElement("div",{id:L4(e),className:"sb-anchor"},t);Le&&Le.__DOCS_CONTEXT__===void 0&&(Le.__DOCS_CONTEXT__=b.createContext(null),Le.__DOCS_CONTEXT__.displayName="DocsContext");var Fe=Le?Le.__DOCS_CONTEXT__:b.createContext(null),Zr=(e,t)=>b.useContext(Fe).resolveOf(e,t);function _4(e,t="start"){e.scrollIntoView({behavior:"smooth",block:t,inline:"nearest"})}function M4(e,t){let r=al([e],t);return r&&r[0]}function al(e,t){let[r,n]=b.useState({});return b.useEffect(()=>{Promise.all(e.map(async o=>{let l=await t.loadStory(o);n(i=>i[o]===l?i:{...i,[o]:l})}))}),e.map(o=>{if(r[o])return r[o];try{return t.storyById(o)}catch{return null}})}function Ac(e){return _c(e)}var Cc=b.createContext({sources:{}}),Sc="--unknown--",$4=({children:e,channel:t})=>{let[r,n]=b.useState({});return b.useEffect(()=>{let o=(l,i=null,s=!1)=>{let{id:u,args:c=void 0,source:d,format:h}=typeof l=="string"?{id:l,source:i,format:s}:l,m=c?Ac(c):Sc;n(p=>({...p,[u]:{...p[u],[m]:{code:d,format:h}}}))};return t.on(pl,o),()=>t.off(pl,o)},[]),a.createElement(Cc.Provider,{value:{sources:r}},e)},B4=(e=>(e.OPEN="open",e.CLOSED="closed",e.NONE="none",e))(B4||{}),H4=e=>{let t=e.map(r=>{var n,o;return(o=(n=r.parameters.docs)==null?void 0:n.source)==null?void 0:o.state}).filter(Boolean);return t.length===0?"closed":t[0]},I4=(e,t,r)=>{let{sources:n}=r,o=n==null?void 0:n[e];return(o==null?void 0:o[Ac(t)])||(o==null?void 0:o[Sc])||{code:""}},N4=({snippet:e,storyContext:t,typeFromProps:r,transformFromProps:n})=>{var u,c,d,h,m,p;let{__isArgsStory:o}=t.parameters,l=((u=t.parameters.docs)==null?void 0:u.source)||{},i=r||l.type||Un.AUTO;if(l.code!==void 0)return l.code;let s=i===Un.DYNAMIC||i===Un.AUTO&&e&&o?e:l.originalSource||"";return l.transformSource&&ce(Ee`The \`transformSource\` parameter at \`parameters.docs.source.transformSource\` is deprecated, please use \`parameters.docs.source.transform\` instead. + ${Ot(.02,e.input.background)} 100%)`,boxShadow:`${e.appBorderColor} 0 0 0 1px inset`,color:"transparent",width:"100%",height:"6px",cursor:"pointer"},"&::-ms-fill-lower":{borderRadius:6},"&::-ms-fill-upper":{borderRadius:6},"&::-ms-thumb":{width:16,height:16,background:`${e.input.background}`,border:`1px solid ${ct(e.appBorderColor,.2)}`,borderRadius:50,cursor:"grab",marginTop:0},"@supports (-ms-ime-align:auto)":{"input[type=range]":{margin:"0"}}})),wc=R.span({paddingLeft:5,paddingRight:5,fontSize:12,whiteSpace:"nowrap",fontFeatureSettings:"tnum",fontVariantNumeric:"tabular-nums"}),z3=R(wc)(({numberOFDecimalsPlaces:e,max:t})=>({width:`${e+t.toString().length*2+3}ch`,textAlign:"right",flexShrink:0})),q3=R.div({display:"flex",alignItems:"center",width:"100%"});function U3(e){let t=e.toString().match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}var W3=({name:e,value:t,onChange:r,min:n=0,max:o=100,step:l=1,onBlur:i,onFocus:s})=>{let u=h=>{r(l3(h.target.value))},c=t!==void 0,d=b.useMemo(()=>U3(l),[l]);return a.createElement(q3,null,a.createElement(wc,null,n),a.createElement(V3,{id:Ne(e),type:"range",onChange:u,name:e,value:t,min:n,max:o,step:l,onFocus:s,onBlur:i}),a.createElement(z3,{numberOFDecimalsPlaces:d,max:o},c?t.toFixed(d):"--"," / ",o))},G3=R.label({display:"flex"}),Y3=R.div(({isMaxed:e})=>({marginLeft:"0.75rem",paddingTop:"0.35rem",color:e?"red":void 0})),K3=({name:e,value:t,onChange:r,onFocus:n,onBlur:o,maxLength:l})=>{let i=h=>{r(h.target.value)},[s,u]=b.useState(!1),c=b.useCallback(()=>{r(""),u(!0)},[u]);if(t===void 0)return a.createElement(Ie.Button,{id:vn(e),onClick:c},"Set string");let d=typeof t=="string";return a.createElement(G3,null,a.createElement(Ie.Textarea,{id:Ne(e),maxLength:l,onChange:i,size:"flex",placeholder:"Edit string...",autoFocus:s,valid:d?null:"error",name:e,value:d?t:"",onFocus:n,onBlur:o}),l&&a.createElement(Y3,{isMaxed:(t==null?void 0:t.length)===l},(t==null?void 0:t.length)??0," / ",l))},X3=R(Ie.Input)({padding:10});function J3(e){e.forEach(t=>{t.startsWith("blob:")&&URL.revokeObjectURL(t)})}var Q3=({onChange:e,name:t,accept:r="image/*",value:n})=>{let o=b.useRef(null);function l(i){if(!i.target.files)return;let s=Array.from(i.target.files).map(u=>URL.createObjectURL(u));e(s),J3(n)}return b.useEffect(()=>{n==null&&o.current&&(o.current.value=null)},[n,t]),a.createElement(X3,{ref:o,id:Ne(t),type:"file",name:t,multiple:!0,onChange:l,accept:r,size:"flex"})},e4=b.lazy(()=>Ht(()=>import("./Color-6VNJS4EI-lBZZYQGi.js"),__vite__mapDeps([17,4,18,3,1,2,5,6,7,8,9,10,11,12,13,14]),import.meta.url)),t4=e=>a.createElement(b.Suspense,{fallback:a.createElement("div",null)},a.createElement(e4,{...e})),r4={array:Mi,object:Mi,boolean:Jb,color:t4,date:a3,number:i3,check:qt,"inline-check":qt,radio:qt,"inline-radio":qt,select:qt,"multi-select":qt,range:W3,text:K3,file:Q3},$i=()=>a.createElement(a.Fragment,null,"-"),n4=({row:e,arg:t,updateArgs:r,isHovered:n})=>{let{key:o,control:l}=e,[i,s]=b.useState(!1),[u,c]=b.useState({value:t});b.useEffect(()=>{i||c({value:t})},[i,t]);let d=b.useCallback(f=>(c({value:f}),r({[o]:f}),f),[r,o]),h=b.useCallback(()=>s(!1),[]),m=b.useCallback(()=>s(!0),[]);if(!l||l.disable)return n?a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Setup controls"):a.createElement($i,null);let p={name:o,argType:e,value:u.value,onChange:d,onBlur:h,onFocus:m},g=r4[l.type]||$i;return a.createElement(g,{...p,...l,controlType:l.type})},a4=R.span({fontWeight:"bold"}),o4=R.span(({theme:e})=>({color:e.color.negative,fontFamily:e.typography.fonts.mono,cursor:"help"})),l4=R.div(({theme:e})=>({"&&":{p:{margin:"0 0 10px 0"},a:{color:e.color.secondary}},code:{...ft({theme:e}),fontSize:12,fontFamily:e.typography.fonts.mono},"& code":{margin:0,display:"inline-block"},"& pre > code":{whiteSpace:"pre-wrap"}})),i4=R.div(({theme:e,hasDescription:t})=>({color:e.base==="light"?J(.1,e.color.defaultText):J(.2,e.color.defaultText),marginTop:t?4:0})),s4=R.div(({theme:e,hasDescription:t})=>({color:e.base==="light"?J(.1,e.color.defaultText):J(.2,e.color.defaultText),marginTop:t?12:0,marginBottom:12})),u4=R.td(({theme:e,expandable:t})=>({paddingLeft:t?"40px !important":"20px !important"})),Kr=e=>{var f;let[t,r]=b.useState(!1),{row:n,updateArgs:o,compact:l,expandable:i,initialExpandedArgs:s}=e,{name:u,description:c}=n,d=n.table||{},h=d.type||n.type,m=d.defaultValue||n.defaultValue,p=(f=n.type)==null?void 0:f.required,g=c!=null&&c!=="";return a.createElement("tr",{onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1)},a.createElement(u4,{expandable:i},a.createElement(a4,null,u),p?a.createElement(o4,{title:"Required"},"*"):null),l?null:a.createElement("td",null,g&&a.createElement(l4,null,a.createElement(lc,null,c)),d.jsDocTags!=null?a.createElement(a.Fragment,null,a.createElement(s4,{hasDescription:g},a.createElement(va,{value:h,initialExpandedArgs:s})),a.createElement(Zb,{tags:d.jsDocTags})):a.createElement(i4,{hasDescription:g},a.createElement(va,{value:h,initialExpandedArgs:s}))),l?null:a.createElement("td",null,a.createElement(va,{value:m,initialExpandedArgs:s})),o?a.createElement("td",null,a.createElement(n4,{...e,isHovered:t})):null)},c4=R(ye)(({theme:e})=>({marginRight:8,marginLeft:-10,marginTop:-2,height:12,width:12,color:e.base==="light"?J(.25,e.color.defaultText):J(.3,e.color.defaultText),border:"none",display:"inline-block"})),d4=R.span(({theme:e})=>({display:"flex",lineHeight:"20px",alignItems:"center"})),p4=R.td(({theme:e})=>({position:"relative",letterSpacing:"0.35em",textTransform:"uppercase",fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s1-1,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText),background:`${e.background.app} !important`,"& ~ td":{background:`${e.background.app} !important`}})),f4=R.td(({theme:e})=>({position:"relative",fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s2-1,background:e.background.app})),m4=R.td(()=>({position:"relative"})),g4=R.tr(({theme:e})=>({"&:hover > td":{backgroundColor:`${Ot(.005,e.background.app)} !important`,boxShadow:`${e.color.mediumlight} 0 - 1px 0 0 inset`,cursor:"row-resize"}})),Bi=R.button(()=>({background:"none",border:"none",padding:"0",font:"inherit",position:"absolute",top:0,bottom:0,left:0,right:0,height:"100%",width:"100%",color:"transparent",cursor:"row-resize !important"})),xa=({level:e="section",label:t,children:r,initialExpanded:n=!0,colSpan:o=3})=>{let[l,i]=b.useState(n),s=e==="subsection"?f4:p4,u=(r==null?void 0:r.length)||0,c=e==="subsection"?`${u} item${u!==1?"s":""}`:"",d=l?"arrowdown":"arrowright",h=`${l?"Hide":"Show"} ${e==="subsection"?u:t} item${u!==1?"s":""}`;return a.createElement(a.Fragment,null,a.createElement(g4,{title:h},a.createElement(s,{colSpan:1},a.createElement(Bi,{onClick:m=>i(!l),tabIndex:0},h),a.createElement(d4,null,a.createElement(c4,{icon:d}),t)),a.createElement(m4,{colSpan:o-1},a.createElement(Bi,{onClick:m=>i(!l),tabIndex:-1,style:{outline:"none"}},h),l?null:c)),l?r:null)},Xr=R.div(({theme:e})=>({display:"flex",gap:16,borderBottom:`1px solid ${e.appBorderColor}`,"&:last-child":{borderBottom:0}})),fe=R.div(({numColumn:e})=>({display:"flex",flexDirection:"column",flex:e||1,gap:5,padding:"12px 20px"})),ae=R.div(({theme:e,width:t,height:r})=>({animation:`${e.animation.glow} 1.5s ease-in-out infinite`,background:e.appBorderColor,width:t||"100%",height:r||16,borderRadius:3})),me=[2,4,2,2],h4=()=>a.createElement(a.Fragment,null,a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"}))),a.createElement(Xr,null,a.createElement(fe,{numColumn:me[0]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[1]},a.createElement(ae,{width:"80%"}),a.createElement(ae,{width:"30%"})),a.createElement(fe,{numColumn:me[2]},a.createElement(ae,{width:"60%"})),a.createElement(fe,{numColumn:me[3]},a.createElement(ae,{width:"60%"})))),b4=R.div(({inAddonPanel:e,theme:t})=>({height:e?"100%":"auto",display:"flex",border:e?"none":`1px solid ${t.appBorderColor}`,borderRadius:e?0:t.appBorderRadius,padding:e?0:40,alignItems:"center",justifyContent:"center",flexDirection:"column",gap:15,background:t.background.content,boxShadow:"rgba(0, 0, 0, 0.10) 0 1px 3px 0"})),y4=R.div({display:"flex",flexDirection:"column",gap:4,maxWidth:415}),v4=R.div(({theme:e})=>({fontWeight:e.typography.weight.bold,fontSize:e.typography.size.s2-1,textAlign:"center",color:e.textColor})),E4=R.div(({theme:e})=>({fontWeight:e.typography.weight.regular,fontSize:e.typography.size.s2-1,textAlign:"center",color:e.textMutedColor})),x4=R.div(({theme:e})=>({display:"flex",fontSize:e.typography.size.s2-1,gap:25})),w4=R.div(({theme:e})=>({width:1,height:16,backgroundColor:e.appBorderColor})),A4=({inAddonPanel:e})=>{let[t,r]=b.useState(!0);return b.useEffect(()=>{let n=setTimeout(()=>{r(!1)},100);return()=>clearTimeout(n)},[]),t?null:a.createElement(b4,{inAddonPanel:e},a.createElement(y4,null,a.createElement(v4,null,e?"Interactive story playground":"Args table with interactive controls couldn't be auto-generated"),a.createElement(E4,null,"Controls give you an easy to use interface to test your components. Set your story args and you'll see controls appearing here automatically.")),a.createElement(x4,null,e&&a.createElement(a.Fragment,null,a.createElement(Et,{href:"https://youtu.be/0gOfS6K0x0E",target:"_blank",withArrow:!0},a.createElement(ye,{icon:"video"})," Watch 5m video"),a.createElement(w4,null),a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Read docs")),!e&&a.createElement(Et,{href:"https://storybook.js.org/docs/react/essentials/controls",target:"_blank",withArrow:!0},"Learn how to set that up")))},C4=R.table(({theme:e,compact:t,inAddonPanel:r})=>({"&&":{borderSpacing:0,color:e.color.defaultText,"td, th":{padding:0,border:"none",verticalAlign:"top",textOverflow:"ellipsis"},fontSize:e.typography.size.s2-1,lineHeight:"20px",textAlign:"left",width:"100%",marginTop:r?0:25,marginBottom:r?0:40,"thead th:first-of-type, td:first-of-type":{width:"25%"},"th:first-of-type, td:first-of-type":{paddingLeft:20},"th:nth-of-type(2), td:nth-of-type(2)":{...t?null:{width:"35%"}},"td:nth-of-type(3)":{...t?null:{width:"15%"}},"th:last-of-type, td:last-of-type":{paddingRight:20,...t?null:{width:"25%"}},th:{color:e.base==="light"?J(.25,e.color.defaultText):J(.45,e.color.defaultText),paddingTop:10,paddingBottom:10,paddingLeft:15,paddingRight:15},td:{paddingTop:"10px",paddingBottom:"10px","&:not(:first-of-type)":{paddingLeft:15,paddingRight:15},"&:last-of-type":{paddingRight:20}},marginLeft:r?0:1,marginRight:r?0:1,tbody:{...r?null:{filter:e.base==="light"?"drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.10))":"drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.20))"},"> tr > *":{background:e.background.content,borderTop:`1px solid ${e.appBorderColor}`},...r?null:{"> tr:first-of-type > *":{borderBlockStart:`1px solid ${e.appBorderColor}`},"> tr:last-of-type > *":{borderBlockEnd:`1px solid ${e.appBorderColor}`},"> tr > *:first-of-type":{borderInlineStart:`1px solid ${e.appBorderColor}`},"> tr > *:last-of-type":{borderInlineEnd:`1px solid ${e.appBorderColor}`},"> tr:first-of-type > td:first-of-type":{borderTopLeftRadius:e.appBorderRadius},"> tr:first-of-type > td:last-of-type":{borderTopRightRadius:e.appBorderRadius},"> tr:last-of-type > td:first-of-type":{borderBottomLeftRadius:e.appBorderRadius},"> tr:last-of-type > td:last-of-type":{borderBottomRightRadius:e.appBorderRadius}}}}})),S4=R(Bt)(({theme:e})=>({color:e.barTextColor,margin:"-4px -12px -4px 0"})),k4=R.span({display:"flex",justifyContent:"space-between"}),R4={alpha:(e,t)=>e.name.localeCompare(t.name),requiredFirst:(e,t)=>{var r,n;return+!!((r=t.type)!=null&&r.required)-+!!((n=e.type)!=null&&n.required)||e.name.localeCompare(t.name)},none:void 0},F4=(e,t)=>{let r={ungrouped:[],ungroupedSubsections:{},sections:{}};if(!e)return r;Object.entries(e).forEach(([l,i])=>{let{category:s,subcategory:u}=(i==null?void 0:i.table)||{};if(s){let c=r.sections[s]||{ungrouped:[],subsections:{}};if(!u)c.ungrouped.push({key:l,...i});else{let d=c.subsections[u]||[];d.push({key:l,...i}),c.subsections[u]=d}r.sections[s]=c}else if(u){let c=r.ungroupedSubsections[u]||[];c.push({key:l,...i}),r.ungroupedSubsections[u]=c}else r.ungrouped.push({key:l,...i})});let n=R4[t],o=l=>n?Object.keys(l).reduce((i,s)=>({...i,[s]:l[s].sort(n)}),{}):l;return{ungrouped:r.ungrouped.sort(n),ungroupedSubsections:o(r.ungroupedSubsections),sections:Object.keys(r.sections).reduce((l,i)=>({...l,[i]:{ungrouped:r.sections[i].ungrouped.sort(n),subsections:o(r.sections[i].subsections)}}),{})}},T4=(e,t,r)=>{try{return $o.includeConditionalArg(e,t,r)}catch(n){return ib.warn(n.message),!1}},O4=e=>{let{updateArgs:t,resetArgs:r,compact:n,inAddonPanel:o,initialExpandedArgs:l,sort:i="none",isLoading:s}=e;if("error"in e){let{error:v}=e;return a.createElement(sc,null,v," ",a.createElement(Et,{href:"http://storybook.js.org/docs/",target:"_blank",withArrow:!0},"Read the docs"))}if(s)return a.createElement(h4,null);let{rows:u,args:c,globals:d}="rows"in e&&e,h=F4(Hc(u,v=>{var y;return!((y=v==null?void 0:v.table)!=null&&y.disable)&&T4(v,c||{},d||{})}),i),m=h.ungrouped.length===0,p=Object.entries(h.sections).length===0,g=Object.entries(h.ungroupedSubsections).length===0;if(m&&p&&g)return a.createElement(A4,{inAddonPanel:o});let f=1;t&&(f+=1),n||(f+=2);let w=Object.keys(h.sections).length>0,A={updateArgs:t,compact:n,inAddonPanel:o,initialExpandedArgs:l};return a.createElement(Po,null,a.createElement(C4,{compact:n,inAddonPanel:o,className:"docblock-argstable sb-unstyled"},a.createElement("thead",{className:"docblock-argstable-head"},a.createElement("tr",null,a.createElement("th",null,a.createElement("span",null,"Name")),n?null:a.createElement("th",null,a.createElement("span",null,"Description")),n?null:a.createElement("th",null,a.createElement("span",null,"Default")),t?a.createElement("th",null,a.createElement(k4,null,"Control"," ",!s&&r&&a.createElement(S4,{onClick:()=>r(),title:"Reset controls"},a.createElement(ye,{icon:"undo","aria-hidden":!0})))):null)),a.createElement("tbody",{className:"docblock-argstable-body"},h.ungrouped.map(v=>a.createElement(Kr,{key:v.key,row:v,arg:c&&c[v.key],...A})),Object.entries(h.ungroupedSubsections).map(([v,y])=>a.createElement(xa,{key:v,label:v,level:"subsection",colSpan:f},y.map(x=>a.createElement(Kr,{key:x.key,row:x,arg:c&&c[x.key],expandable:w,...A})))),Object.entries(h.sections).map(([v,y])=>a.createElement(xa,{key:v,label:v,level:"section",colSpan:f},y.ungrouped.map(x=>a.createElement(Kr,{key:x.key,row:x,arg:c&&c[x.key],...A})),Object.entries(y.subsections).map(([x,E])=>a.createElement(xa,{key:x,label:x,level:"subsection",colSpan:f},E.map(C=>a.createElement(Kr,{key:C.key,row:C,arg:c&&c[C.key],expandable:w,...A})))))))))};R.div(({theme:e})=>({marginRight:30,fontSize:`${e.typography.size.s1}px`,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText)}));R.div({overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"});R.div({display:"flex",flexDirection:"row",alignItems:"baseline","&:not(:last-child)":{marginBottom:"1rem"}});R.div(Q,({theme:e})=>({...jn(e),margin:"25px 0 40px",padding:"30px 20px"}));R.div(({theme:e})=>({fontWeight:e.typography.weight.bold,color:e.color.defaultText}));R.div(({theme:e})=>({color:e.base==="light"?J(.2,e.color.defaultText):J(.6,e.color.defaultText)}));R.div({flex:"0 0 30%",lineHeight:"20px",marginTop:5});R.div(({theme:e})=>({flex:1,textAlign:"center",fontFamily:e.typography.fonts.mono,fontSize:e.typography.size.s1,lineHeight:1,overflow:"hidden",color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText),"> div":{display:"inline-block",overflow:"hidden",maxWidth:"100%",textOverflow:"ellipsis"},span:{display:"block",marginTop:2}}));R.div({display:"flex",flexDirection:"row"});R.div(({background:e})=>({position:"relative",flex:1,"&::before":{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:e,content:'""'}}));R.div(({theme:e})=>({...jn(e),display:"flex",flexDirection:"row",height:50,marginBottom:5,overflow:"hidden",backgroundColor:"white",backgroundImage:"repeating-linear-gradient(-45deg, #ccc, #ccc 1px, #fff 1px, #fff 16px)",backgroundClip:"padding-box"}));R.div({display:"flex",flexDirection:"column",flex:1,position:"relative",marginBottom:30});R.div({flex:1,display:"flex",flexDirection:"row"});R.div({display:"flex",alignItems:"flex-start"});R.div({flex:"0 0 30%"});R.div({flex:1});R.div(({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",paddingBottom:20,fontWeight:e.typography.weight.bold,color:e.base==="light"?J(.4,e.color.defaultText):J(.6,e.color.defaultText)}));R.div(({theme:e})=>({fontSize:e.typography.size.s2,lineHeight:"20px",display:"flex",flexDirection:"column"}));R.div(({theme:e})=>({fontFamily:e.typography.fonts.base,fontSize:e.typography.size.s2,color:e.color.defaultText,marginLeft:10,lineHeight:1.2}));R.div(({theme:e})=>({...jn(e),overflow:"hidden",height:40,width:40,display:"flex",alignItems:"center",justifyContent:"center",flex:"none","> img, > svg":{width:20,height:20}}));R.div({display:"inline-flex",flexDirection:"row",alignItems:"center",flex:"0 1 calc(20% - 10px)",minWidth:120,margin:"0px 10px 30px 0"});R.div({display:"flex",flexFlow:"row wrap"});var L4=e=>`anchor--${e}`,D4=({storyId:e,children:t})=>a.createElement("div",{id:L4(e),className:"sb-anchor"},t);Le&&Le.__DOCS_CONTEXT__===void 0&&(Le.__DOCS_CONTEXT__=b.createContext(null),Le.__DOCS_CONTEXT__.displayName="DocsContext");var Fe=Le?Le.__DOCS_CONTEXT__:b.createContext(null),Zr=(e,t)=>b.useContext(Fe).resolveOf(e,t);function _4(e,t="start"){e.scrollIntoView({behavior:"smooth",block:t,inline:"nearest"})}function M4(e,t){let r=al([e],t);return r&&r[0]}function al(e,t){let[r,n]=b.useState({});return b.useEffect(()=>{Promise.all(e.map(async o=>{let l=await t.loadStory(o);n(i=>i[o]===l?i:{...i,[o]:l})}))}),e.map(o=>{if(r[o])return r[o];try{return t.storyById(o)}catch{return null}})}function Ac(e){return _c(e)}var Cc=b.createContext({sources:{}}),Sc="--unknown--",$4=({children:e,channel:t})=>{let[r,n]=b.useState({});return b.useEffect(()=>{let o=(l,i=null,s=!1)=>{let{id:u,args:c=void 0,source:d,format:h}=typeof l=="string"?{id:l,source:i,format:s}:l,m=c?Ac(c):Sc;n(p=>({...p,[u]:{...p[u],[m]:{code:d,format:h}}}))};return t.on(pl,o),()=>t.off(pl,o)},[]),a.createElement(Cc.Provider,{value:{sources:r}},e)},B4=(e=>(e.OPEN="open",e.CLOSED="closed",e.NONE="none",e))(B4||{}),H4=e=>{let t=e.map(r=>{var n,o;return(o=(n=r.parameters.docs)==null?void 0:n.source)==null?void 0:o.state}).filter(Boolean);return t.length===0?"closed":t[0]},I4=(e,t,r)=>{let{sources:n}=r,o=n==null?void 0:n[e];return(o==null?void 0:o[Ac(t)])||(o==null?void 0:o[Sc])||{code:""}},N4=({snippet:e,storyContext:t,typeFromProps:r,transformFromProps:n})=>{var u,c,d,h,m,p;let{__isArgsStory:o}=t.parameters,l=((u=t.parameters.docs)==null?void 0:u.source)||{},i=r||l.type||Un.AUTO;if(l.code!==void 0)return l.code;let s=i===Un.DYNAMIC||i===Un.AUTO&&e&&o?e:l.originalSource||"";return l.transformSource&&ce(Ee`The \`transformSource\` parameter at \`parameters.docs.source.transformSource\` is deprecated, please use \`parameters.docs.source.transform\` instead. Please refer to the migration guide: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#source-block `),(c=t.parameters.docs)!=null&&c.transformSource&&ce(Ee`The \`transformSource\` parameter at \`parameters.docs.transformSource\` is deprecated, please use \`parameters.docs.source.transform\` instead. @@ -348,7 +348,7 @@ ${t}`);let r=t.match(fm);if(!r)return a.createElement(b.Fragment,null,t);let[,n, `),o?a.createElement(Oc,{of:o.moduleExport,expanded:!1,__primary:!0,withToolbar:!0}):null},w7=({children:e,disableAnchor:t,...r})=>{if(t||typeof e!="string")return a.createElement(Zo,null,e);let n=e.toLowerCase().replace(/[^a-z0-9]/gi,"-");return a.createElement(ll,{as:"h2",id:n,...r},e)},A7=R(w7)(({theme:e})=>({fontSize:`${e.typography.size.s2-1}px`,fontWeight:e.typography.weight.bold,lineHeight:"16px",letterSpacing:"0.35em",textTransform:"uppercase",color:e.textMutedColor,border:0,marginBottom:"12px","&:first-of-type":{marginTop:"56px"}})),C7=({title:e="Stories",includePrimary:t=!0})=>{let{componentStories:r}=b.useContext(Fe),n=r().filter(o=>{var l,i;return!((i=(l=o.parameters)==null?void 0:l.docs)!=null&&i.disable)});return t||(n=n.slice(1)),!n||n.length===0?null:a.createElement(a.Fragment,null,a.createElement(A7,null,e),n.map(o=>o&&a.createElement(Oc,{key:o.id,of:o.moduleExport,expanded:!0,__forceInitialArgs:!0})))},S7=()=>{let e=Zr("meta",["meta"]),{stories:t}=e.csfFile,r=Object.keys(t).length===1;return a.createElement(a.Fragment,null,a.createElement(y7,null),a.createElement(v7,null),a.createElement(lo,{of:"meta"}),r?a.createElement(lo,{of:"story"}):null,a.createElement(x7,null),a.createElement(W4,null),r?null:a.createElement(C7,null))};function P7({context:e,docsParameter:t}){let r=t.container||g7,n=t.page||S7;return a.createElement(r,{context:e,theme:t.theme},a.createElement(n,null))}export{K4 as A,G4 as C,P7 as D,Ie as F,e7 as H,ye as I,Ro as S,Pm as T,af as W,ke as _,Ys as a,H as b,Bs as c,g7 as d,S7 as e,Mm as f,Ne as g,R as n,I7 as s}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./syntaxhighlighter-V7JZZA35-R57c9JcY.js","./iframe-_98K0_ok.js","./pickBy-llkn_6s3.js","./callBound-4MCeDK1M.js","./index-RfLt4OUa.js","./index-miLrID2P.js","./inheritsLoose-O2jMHMzR.js","./pickBy-lHA7W3rs.js","./uniq-hAFl8ubt.js","./_baseUniq-2t0Y7xw1.js","./cloneDeep-eaEuvD8i.js","./_baseClone-6sJ_SjB4.js","./index-xck8ovCi.js","./index-I0bGnlnk.js","./assert-1o4ErrXT.js","./formatter-SWP5E3XI--SW_q4fo.js","./WithTooltip-V3YHNWJZ--j86pm_C.js","./Color-6VNJS4EI-N7NQjCtp.js","./debounce-eWC8LGMf.js"] + __vite__mapDeps.viteFileDeps = ["./syntaxhighlighter-V7JZZA35-WSwIxwL6.js","./iframe-mUD1hmuH.js","./pickBy-llkn_6s3.js","./callBound-4MCeDK1M.js","./index-RfLt4OUa.js","./index-miLrID2P.js","./inheritsLoose-O2jMHMzR.js","./pickBy-lHA7W3rs.js","./uniq-hAFl8ubt.js","./_baseUniq-2t0Y7xw1.js","./cloneDeep-eaEuvD8i.js","./_baseClone-6sJ_SjB4.js","./index-xck8ovCi.js","./index-I0bGnlnk.js","./assert-1o4ErrXT.js","./formatter-SWP5E3XI-Nl3Uqdo1.js","./WithTooltip-V3YHNWJZ-5A2-LERo.js","./Color-6VNJS4EI-lBZZYQGi.js","./debounce-eWC8LGMf.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/docs/storybook/assets/preview-tdpRB_fr.js b/docs/storybook/assets/preview-9rW2m5lX.js similarity index 64% rename from docs/storybook/assets/preview-tdpRB_fr.js rename to docs/storybook/assets/preview-9rW2m5lX.js index 57f34bcd8..e5e8040f9 100644 --- a/docs/storybook/assets/preview-tdpRB_fr.js +++ b/docs/storybook/assets/preview-9rW2m5lX.js @@ -1,7 +1,7 @@ -import{_ as e}from"./iframe-_98K0_ok.js";import"../sb-preview/runtime.js";var a={docs:{renderer:async()=>{let{DocsRenderer:r}=await e(()=>import("./DocsRenderer-NNNQARDV-hJLew0jG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);return new r}}};export{a as parameters}; +import{_ as e}from"./iframe-mUD1hmuH.js";import"../sb-preview/runtime.js";var a={docs:{renderer:async()=>{let{DocsRenderer:r}=await e(()=>import("./DocsRenderer-NNNQARDV-k-JbY6La.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);return new r}}};export{a as parameters}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["./DocsRenderer-NNNQARDV-hJLew0jG.js","./iframe-_98K0_ok.js","./index-RfLt4OUa.js","./react-16-hgR7FrAp.js","./index-miLrID2P.js","./index-yCoF09M4.js","./pickBy-llkn_6s3.js","./callBound-4MCeDK1M.js","./inheritsLoose-O2jMHMzR.js","./pickBy-lHA7W3rs.js","./uniq-hAFl8ubt.js","./_baseUniq-2t0Y7xw1.js","./cloneDeep-eaEuvD8i.js","./_baseClone-6sJ_SjB4.js","./index-xck8ovCi.js","./index-I0bGnlnk.js","./assert-1o4ErrXT.js"] + __vite__mapDeps.viteFileDeps = ["./DocsRenderer-NNNQARDV-k-JbY6La.js","./iframe-mUD1hmuH.js","./index-RfLt4OUa.js","./react-16-hgR7FrAp.js","./index-miLrID2P.js","./index-lt-u4Ncf.js","./pickBy-llkn_6s3.js","./callBound-4MCeDK1M.js","./inheritsLoose-O2jMHMzR.js","./pickBy-lHA7W3rs.js","./uniq-hAFl8ubt.js","./_baseUniq-2t0Y7xw1.js","./cloneDeep-eaEuvD8i.js","./_baseClone-6sJ_SjB4.js","./index-xck8ovCi.js","./index-I0bGnlnk.js","./assert-1o4ErrXT.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/docs/storybook/assets/preview-PfHsUsqb.js b/docs/storybook/assets/preview-rR4HDz8p.js similarity index 77% rename from docs/storybook/assets/preview-PfHsUsqb.js rename to docs/storybook/assets/preview-rR4HDz8p.js index 0de3b8fdb..b266a07ac 100644 --- a/docs/storybook/assets/preview-PfHsUsqb.js +++ b/docs/storybook/assets/preview-rR4HDz8p.js @@ -1 +1 @@ -import{d as o,e as r}from"./index-yCoF09M4.js";import"./iframe-_98K0_ok.js";import"../sb-preview/runtime.js";import"./pickBy-llkn_6s3.js";import"./callBound-4MCeDK1M.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./inheritsLoose-O2jMHMzR.js";import"./pickBy-lHA7W3rs.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./index-xck8ovCi.js";import"./index-I0bGnlnk.js";import"./assert-1o4ErrXT.js";const w={parameters:{docs:{container:o,page:r}}};export{w as default}; +import{d as o,e as r}from"./index-lt-u4Ncf.js";import"./iframe-mUD1hmuH.js";import"../sb-preview/runtime.js";import"./pickBy-llkn_6s3.js";import"./callBound-4MCeDK1M.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./inheritsLoose-O2jMHMzR.js";import"./pickBy-lHA7W3rs.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./index-xck8ovCi.js";import"./index-I0bGnlnk.js";import"./assert-1o4ErrXT.js";const w={parameters:{docs:{container:o,page:r}}};export{w as default}; diff --git a/docs/storybook/assets/syntaxhighlighter-V7JZZA35-R57c9JcY.js b/docs/storybook/assets/syntaxhighlighter-V7JZZA35-WSwIxwL6.js similarity index 78% rename from docs/storybook/assets/syntaxhighlighter-V7JZZA35-R57c9JcY.js rename to docs/storybook/assets/syntaxhighlighter-V7JZZA35-WSwIxwL6.js index 326ea4986..f19411623 100644 --- a/docs/storybook/assets/syntaxhighlighter-V7JZZA35-R57c9JcY.js +++ b/docs/storybook/assets/syntaxhighlighter-V7JZZA35-WSwIxwL6.js @@ -1 +1 @@ -import{S as x,c as y,s as C}from"./index-yCoF09M4.js";import"./iframe-_98K0_ok.js";import"../sb-preview/runtime.js";import"./pickBy-llkn_6s3.js";import"./callBound-4MCeDK1M.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./inheritsLoose-O2jMHMzR.js";import"./pickBy-lHA7W3rs.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./index-xck8ovCi.js";import"./index-I0bGnlnk.js";import"./assert-1o4ErrXT.js";export{x as SyntaxHighlighter,y as createCopyToClipboardFunction,C as default}; +import{S as x,c as y,s as C}from"./index-lt-u4Ncf.js";import"./iframe-mUD1hmuH.js";import"../sb-preview/runtime.js";import"./pickBy-llkn_6s3.js";import"./callBound-4MCeDK1M.js";import"./index-RfLt4OUa.js";import"./index-miLrID2P.js";import"./inheritsLoose-O2jMHMzR.js";import"./pickBy-lHA7W3rs.js";import"./uniq-hAFl8ubt.js";import"./_baseUniq-2t0Y7xw1.js";import"./cloneDeep-eaEuvD8i.js";import"./_baseClone-6sJ_SjB4.js";import"./index-xck8ovCi.js";import"./index-I0bGnlnk.js";import"./assert-1o4ErrXT.js";export{x as SyntaxHighlighter,y as createCopyToClipboardFunction,C as default}; diff --git a/docs/storybook/assets/withErrorBoundary-LzdLkl6I.js b/docs/storybook/assets/withErrorBoundary-Y3jy2SmJ.js similarity index 99% rename from docs/storybook/assets/withErrorBoundary-LzdLkl6I.js rename to docs/storybook/assets/withErrorBoundary-Y3jy2SmJ.js index 0d80b1f7d..77f81a3c9 100644 --- a/docs/storybook/assets/withErrorBoundary-LzdLkl6I.js +++ b/docs/storybook/assets/withErrorBoundary-Y3jy2SmJ.js @@ -1,4 +1,4 @@ -var Po=Object.defineProperty;var Uo=(t,e,n)=>e in t?Po(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Et=(t,e,n)=>(Uo(t,typeof e!="symbol"?e+"":e,n),n);import{j as U}from"./jsx-runtime-FsUICBgo.js";import{R as w,c as p,g as te,r as zt}from"./index-RfLt4OUa.js";import{c as it}from"./index-tUYgphcS.js";import{P as b}from"./index-4QtD-hFu.js";import{r as Bo,m as Vo}from"./mergeRefs-uj14wjf3.js";import{d as jo}from"./_baseSlice-BktYtjHb.js";import{s as ut,j as Mo,i as de,E as Ke,T as Ho,f as Go,S as Fo,c as tn}from"./Button-KibTbxDG.js";import{R as zo}from"./index-miLrID2P.js";import{s as Yo,a as Wo,w as Jo}from"./wrapFocus-29tK3Ecs.js";import{I as Xo,g as Zo}from"./getDocumentTitle-Zh1PemE-.js";import{_ as Qo,a as Ko}from"./_baseUniq-2t0Y7xw1.js";import{J as tr}from"./callBound-4MCeDK1M.js";import{t as er}from"./debounce-eWC8LGMf.js";import{e as nr}from"./events-fK0UhkIE.js";import{a as or,i as en,g as rr}from"./index-777x7qAF.js";import{c as sr}from"./cloneDeep-eaEuvD8i.js";function nn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function on(t){for(var e=1;e3?u-3:0),l=3;l"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Yt(t){return Yt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Yt(t)}function pr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Bn=function(t){ir(n,t);var e=lr(n);function n(o){var r;return ur(this,n),r=e.call(this,o),r.handleRef=r.handleRef.bind($e(r)),r.handleDocumentClick=r.handleDocumentClick.bind($e(r)),r}return ar(n,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleDocumentClick)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleDocumentClick)}},{key:"handleDocumentClick",value:function(r){this.element&&this.element.contains&&!this.element.contains(n.getEventTarget(r))&&this.props.onClickOutside(r)}},{key:"handleRef",value:function(r){var s=this.props.children;this.element=r,s.ref&&typeof s.ref=="function"&&s.ref(r)}},{key:"render",value:function(){return w.cloneElement(this.props.children,{ref:this.handleRef})}}],[{key:"getEventTarget",value:function(r){return r.composed&&typeof r.composedPath=="function"?r.composedPath()[0]:r.target}}]),n}(w.Component);pr(Bn,"propTypes",{children:b.element.isRequired,onClickOutside:b.func.isRequired});var br=typeof self=="object"&&self.self===self&&self||typeof p=="object"&&p.global===p&&p||p;const St=te(br);var hr=function(){var e=[],n=!1;function o(){e.forEach(function(c){c()}),n=!1}function r(){n||(n=!0,St.requestAnimationFrame(o))}function s(c){if(c){var a=e.indexOf(c);a<0&&e.push(c)}}return{add:function(a){return e.length||St.addEventListener("resize",r),s(a),{release:function(){var i=e.indexOf(a);i>=0&&e.splice(i,1)}}}}}();function sn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function fe(t){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Wt(t){return Wt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Wt(t)}function A(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function At(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?At=function(n){return typeof n}:At=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},At(t)}var un=ut.prefix,$t="left",vt="top",yt="right",K="bottom",_r=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return At(e)!==At(n)?!0:Object(n)===n&&typeof n!="function"?e.top!==n.top||e.left!==n.left:e!==n},wr=function(e){var n,o=e.menuSize,r=e.refPosition,s=r===void 0?{}:r,c=e.offset,a=c===void 0?{}:c,u=e.direction,i=u===void 0?K:u,l=e.scrollX,d=l===void 0?0:l,f=e.scrollY,y=f===void 0?0:f,E=e.container,m=s.left,g=m===void 0?0:m,_=s.top,x=_===void 0?0:_,R=s.right,M=R===void 0?0:R,Z=s.bottom,H=Z===void 0?0:Z,J=E.position!=="static"?0:d,G=E.position!=="static"?0:y,T={top:E.position!=="static"?E.rect.top:0,left:E.position!=="static"?E.rect.left:0},ot=o.width,F=o.height,tt=a.top,O=tt===void 0?0:tt,Q=a.left,z=Q===void 0?0:Q,pt=(g+M)/2,et=(x+H)/2;return(n={},A(n,$t,function(){return{left:g-ot+J-z-T.left,top:et-F/2+G+O-9-T.top}}),A(n,vt,function(){return{left:pt-ot/2+J+z-T.left,top:x-F+G-O-T.top}}),A(n,yt,function(){return{left:M+J+z-T.left,top:et-F/2+G+O+3-T.top}}),A(n,K,function(){return{left:pt-ot/2+J+z-T.left,top:H+G+O-T.top}}),n)[i]()},Le=function(t){$r(n,t);var e=vr(n);function n(){var o;gr(this,n);for(var r=arguments.length,s=new Array(r),c=0;c0&&arguments[0]!==void 0?arguments[0]:{},u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=o._menuBody;if(i){var l=a.menuOffset,d=l===void 0?{}:l,f=a.menuDirection,y=o.props,E=y.menuOffset,m=E===void 0?{}:E,g=y.menuDirection;if(_r(d,m)||f!==g||u){var _=o.props,x=_.flipped,R=_.triggerRef,M=_.updateOrientation,Z=R.current,H=i.getBoundingClientRect(),J=Z&&Z.getBoundingClientRect(),G=typeof m!="function"?m:m(i,g,Z,x);M&&M({menuSize:H,refPosition:J,direction:g,offset:G,scrollX:St.pageXOffset,scrollY:St.pageYOffset,container:{rect:o.props.target().getBoundingClientRect(),position:getComputedStyle(o.props.target()).position}}),(H.width>0&&H.height>0||!G)&&o.setState({floatingPosition:wr({menuSize:H,refPosition:J,direction:g,offset:G,scrollX:St.pageXOffset,scrollY:St.pageYOffset,container:{rect:o.props.target().getBoundingClientRect(),position:getComputedStyle(o.props.target()).position}})},function(){if(!u){var T=i.getBoundingClientRect();T!==H&&o._updateMenuSize(o.props,!0)}})}}}),A(X(o),"_focusMenuContent",function(a){var u=a.querySelector(o.props.selectorPrimaryFocus||null),i=a.querySelector(Yo),l=a.querySelector(Wo),d=u||i||l||a;o.props.focusTrap&&d.focus()}),A(X(o),"_menuRef",function(a){var u=o.props.menuRef;o._placeInProgress=!!a,u&&u(o._menuBody=a),a&&o._updateMenuSize()}),A(X(o),"_getChildrenWithProps",function(){var a=o.props,u=a.styles,i=a.children,l=o.state.floatingPosition,d=l?{left:"".concat(l.left,"px"),top:"".concat(l.top,"px"),right:"auto"}:{visibility:"hidden",top:"0px"};return w.cloneElement(i,{ref:o._menuRef,style:fe(fe(fe({},u),d),{},{position:"absolute",opacity:1})})}),A(X(o),"handleBlur",function(a){var u=a.target,i=a.relatedTarget;if(i&&u){var l=o.startSentinel.current,d=o.endSentinel.current;Jo({bodyNode:o._menuBody,startSentinelNode:l,endSentinelNode:d,currentActiveNode:i,oldActiveNode:u})}}),o}return mr(n,[{key:"componentWillUnmount",value:function(){this.hResize.release()}},{key:"componentDidMount",value:function(){var r=this;this.hResize=hr.add(function(){r._updateMenuSize()})}},{key:"componentDidUpdate",value:function(r){this._updateMenuSize(r);var s=this.props.onPlace;this._placeInProgress&&this.state.floatingPosition&&(this._menuBody&&!this._menuBody.contains(document.activeElement)&&this._focusMenuContent(this._menuBody),typeof s=="function"&&(s(this._menuBody),this._placeInProgress=!1))}},{key:"render",value:function(){if(typeof document<"u"){var r=this.props,s=r.focusTrap,c=r.target;return zo.createPortal(w.createElement("div",{onBlur:s?this.handleBlur:null},w.createElement("span",{ref:this.startSentinel,tabIndex:"0",role:"link",className:"".concat(un,"--visually-hidden")},"Focus sentinel"),this._getChildrenWithProps(),w.createElement("span",{ref:this.endSentinel,tabIndex:"0",role:"link",className:"".concat(un,"--visually-hidden")},"Focus sentinel")),c?c():document.body)}return null}}]),n}(w.Component);A(Le,"propTypes",{children:b.object,flipped:b.bool,focusTrap:b.bool,menuDirection:b.oneOf([$t,vt,yt,K]),menuOffset:b.oneOfType([b.shape({top:b.number,left:b.number}),b.func]),menuRef:b.func,onPlace:b.func,selectorPrimaryFocus:b.string,styles:b.object,target:b.func,triggerRef:b.oneOfType([b.func,b.shape({current:b.any})]),updateOrientation:b.func});A(Le,"defaultProps",{menuOffset:{},menuDirection:K,updateOrientation:null});function qr(t){return function(n,o,r){n[o],n.value,n.readOnly;for(var s=arguments.length,c=new Array(s>3?s-3:0),a=3;a=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function Sr(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,s;for(s=0;s=0)&&(n[r]=t[r]);return n}function Dr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function an(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jt(t){return Jt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Jt(t)}function ln(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Xt(t){for(var e=1;ex.rect.width?$t:y;case K:return ot+tt+et-O.top+z>x.rect.height?vt:y;default:return y}},Ro=function(){switch(y){case $t:case yt:return Qe-z/2+tt+et-9-O.top<0?"start":Qe-z/2+tt+et-9-O.top+z>x.rect.height?"end":"original";case vt:case K:return Ze-Q/2+F+qt-O.left<0?"start":Ze-Q/2+F+qt-O.left+Q>x.rect.width?"end":"original";default:return"original"}};return{direction:Co(),align:Ro()}}),$(k(r),"_handleUserInputOpenClose",function(c,a){var u=a.open;if(r.isControlled&&r.props.onChange){r.props.onChange(c,{open:u});return}var i=r._tooltipEl;r.setState({open:u},function(){if(r.props.onChange&&r.props.onChange(c,{open:u}),!u&&i&&i.id===r._tooltipId){r._tooltipDismissed=!0;var l=c==null?void 0:c.relatedTarget;if(!l&&document.activeElement===document.body&&(c==null?void 0:c.type)!=="click"){var d;(d=r._triggerRef)===null||d===void 0||d.current.focus()}}})}),$(k(r),"_handleFocus",function(c,a){var u=a.currentTarget,i=a.relatedTarget;if(u!==i&&(r._tooltipDismissed=!1),c==="over")r._tooltipDismissed||r._handleUserInputOpenClose(a,{open:!0}),r._tooltipDismissed=!1;else if(c!=="out"){var l=r._triggerRef.current,d=i&&(l&&(l==null?void 0:l.contains(i))||r._tooltipEl&&r._tooltipEl.contains(i));d||r._handleUserInputOpenClose(a,{open:!1})}}),$(k(r),"_debouncedHandleFocus",null),$(k(r),"_getTarget",function(){var c=r._triggerRef.current;return c&&c.closest("[data-floating-menu-container]")||document.body}),$(k(r),"handleMouse",function(c){c.persist();var a={focus:"over",blur:"out",click:"click"}[c.type],u=r._hasContextMenu;if((c.type==="click"||c.type==="contextmenu")&&(r._hasContextMenu=c.type==="contextmenu"),r._hasContextMenu){r._handleUserInputOpenClose(c,{open:!1});return}if(a==="click"){c.stopPropagation(),c.preventDefault();var i=r.isControlled?!r.props.open:!r.state.open;r._handleUserInputOpenClose(c,{open:i})}else if(a&&(a!=="out"||!u)){var l;(l=k(r))===null||l===void 0||l._debouncedHandleFocus(a,c)}}),$(k(r),"handleClickOutside",function(c){var a=c&&c.target&&r._tooltipEl&&r._tooltipEl.contains(c.target);!a&&r.state.open&&r._handleUserInputOpenClose(c,{open:!1})}),$(k(r),"handleKeyPress",function(c){if(de(c,[Ke,Ho])&&(c.stopPropagation(),r._handleUserInputOpenClose(c,{open:!1})),de(c,[Go,Fo])){c.stopPropagation(),c.preventDefault();var a=r.isControlled?!r.props.open:!r.state.open;r._handleUserInputOpenClose(c,{open:a})}}),$(k(r),"handleEscKeyPress",function(c){var a=r.isControlled?r.props:r.state,u=a.open;if(u&&de(c,[Ke]))return c.stopPropagation(),r._handleUserInputOpenClose(c,{open:!1})}),r.isControlled=o.open!==void 0,ye&&r.isControlled)return Vn(r);var s=ye?o.defaultOpen:o.open;return r.state={open:s,storedDirection:o.direction,storedAlign:o.align},r}return Ar(n,[{key:"componentDidMount",value:function(){this._debouncedHandleFocus||(this._debouncedHandleFocus=jo(this._handleFocus,200)),document.addEventListener("keydown",this.handleEscKeyPress,!1)}},{key:"componentDidUpdate",value:function(r,s){r.direction!=this.props.direction&&this.setState({storedDirection:this.props.direction}),r.align!=this.props.align&&this.setState({storedAlign:this.props.align}),s.open&&!this.state.open&&this.setState({storedDirection:this.props.direction,storedAlign:this.props.align})}},{key:"componentWillUnmount",value:function(){this._debouncedHandleFocus&&(this._debouncedHandleFocus.cancel(),this._debouncedHandleFocus=null),document.removeEventListener("keydown",this.handleEscKeyPress,!1)}},{key:"render",value:function(){var r,s=this,c=this.props,a=c.triggerId,u=a===void 0?this.triggerId=this.triggerId||"__carbon-tooltip-trigger_".concat(Math.random().toString(36).substr(2)):a,i=c.tooltipBodyId,l=c.children,d=c.className,f=c.triggerClassName,y=c.focusTrap,E=c.triggerText,m=c.showIcon,g=c.iconName,_=c.iconDescription,x=c.renderIcon,R=c.menuOffset,M=c.tabIndex,Z=M===void 0?0:M,H=c.innerRef;c.selectorPrimaryFocus,c.tooltipId;var J=Tr(c,Er),G=this.isControlled?this.props:this.state,T=G.open,ot=this.state,F=ot.storedDirection,tt=ot.storedAlign,O=tn("".concat(at,"--tooltip"),(r={},$(r,"".concat(at,"--tooltip--shown"),T),$(r,"".concat(at,"--tooltip--").concat(F),F),$(r,"".concat(at,"--tooltip--align-").concat(tt),tt),r),d),Q=tn("".concat(at,"--tooltip__label"),f),z=Vo(this._triggerRef,H),pt={name:g,role:null,description:null},et=Xt({role:"button",tabIndex:Z,onClick:this.handleMouse,onContextMenu:this.handleMouse,onKeyDown:this.handleKeyPress,onMouseOver:this.handleMouse,onMouseOut:this.handleMouse,onFocus:this.handleMouse,onBlur:this.handleMouse,"aria-controls":T?this._tooltipId:void 0,"aria-expanded":T,"aria-describedby":T?this._tooltipId:null},E?{"aria-labelledby":u}:{"aria-label":_});return w.createElement(w.Fragment,null,w.createElement(Bn,{onClickOutside:this.handleClickOutside},m?w.createElement("div",{id:u,className:Q},E,w.createElement("div",Lt({className:"".concat(at,"--tooltip__trigger")},et,{ref:z,"aria-describedby":i}),w.createElement(x,pt))):w.createElement("div",Lt({id:u,className:Q,ref:z},et,{"aria-describedby":i}),E)),T&&w.createElement(Le,{focusTrap:y,selectorPrimaryFocus:this.props.selectorPrimaryFocus,target:this._getTarget,triggerRef:this._triggerRef,menuDirection:F,menuOffset:R,menuRef:function(qt){s._tooltipEl=qt},updateOrientation:this.updateOrientation},w.createElement("div",Lt({className:O},J,{id:this._tooltipId,"data-floating-menu-direction":F,onMouseOver:this.handleMouse,onMouseOut:this.handleMouse,onFocus:this.handleMouse,onBlur:this.handleMouse,onContextMenu:this.handleMouse}),w.createElement("span",{className:"".concat(at,"--tooltip__caret")}),w.createElement("div",{className:"".concat(at,"--tooltip__content"),"aria-labelledby":this._tooltipId,role:"dialog"},l))))}}],[{key:"getDerivedStateFromProps",value:function(r,s){var c=r.open,a=s.prevOpen;return a===c?null:{open:c,prevOpen:c}}}]),n}(zt.Component);$(Ne,"propTypes",Xt({align:b.oneOf(["start","center","end"]),autoOrientation:b.bool,children:b.node,className:b.string,defaultOpen:b.bool,direction:b.oneOf(["bottom","top","left","right"]),focusTrap:b.bool,iconName:b.string,menuOffset:b.oneOfType([b.shape({top:b.number,left:b.number}),b.func]),onChange:ye?qr(b.func):b.func,open:b.bool,renderIcon:function(e,n,o){if(e[n]!=null){var r=e[n];if(!Bo.isForwardRef(w.createElement(r,null)))return new Error("Invalid value of prop '".concat(n,"' supplied to '").concat(o,`', +var Po=Object.defineProperty;var Uo=(t,e,n)=>e in t?Po(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Et=(t,e,n)=>(Uo(t,typeof e!="symbol"?e+"":e,n),n);import{j as U}from"./jsx-runtime-FsUICBgo.js";import{R as w,c as p,g as te,r as zt}from"./index-RfLt4OUa.js";import{c as it}from"./index-tUYgphcS.js";import{P as b}from"./index-4QtD-hFu.js";import{r as Bo,m as Vo}from"./mergeRefs-uj14wjf3.js";import{d as jo}from"./_baseSlice-BktYtjHb.js";import{s as ut,j as Mo,i as de,E as Ke,T as Ho,f as Go,S as Fo,c as tn}from"./Button-KibTbxDG.js";import{R as zo}from"./index-miLrID2P.js";import{s as Yo,a as Wo,w as Jo}from"./wrapFocus-29tK3Ecs.js";import{I as Xo,g as Zo}from"./getDocumentTitle-51WyFHkN.js";import{_ as Qo,a as Ko}from"./_baseUniq-2t0Y7xw1.js";import{J as tr}from"./callBound-4MCeDK1M.js";import{t as er}from"./debounce-eWC8LGMf.js";import{e as nr}from"./events-fK0UhkIE.js";import{a as or,i as en,g as rr}from"./index-777x7qAF.js";import{c as sr}from"./cloneDeep-eaEuvD8i.js";function nn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function on(t){for(var e=1;e3?u-3:0),l=3;l"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Yt(t){return Yt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Yt(t)}function pr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Bn=function(t){ir(n,t);var e=lr(n);function n(o){var r;return ur(this,n),r=e.call(this,o),r.handleRef=r.handleRef.bind($e(r)),r.handleDocumentClick=r.handleDocumentClick.bind($e(r)),r}return ar(n,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleDocumentClick)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleDocumentClick)}},{key:"handleDocumentClick",value:function(r){this.element&&this.element.contains&&!this.element.contains(n.getEventTarget(r))&&this.props.onClickOutside(r)}},{key:"handleRef",value:function(r){var s=this.props.children;this.element=r,s.ref&&typeof s.ref=="function"&&s.ref(r)}},{key:"render",value:function(){return w.cloneElement(this.props.children,{ref:this.handleRef})}}],[{key:"getEventTarget",value:function(r){return r.composed&&typeof r.composedPath=="function"?r.composedPath()[0]:r.target}}]),n}(w.Component);pr(Bn,"propTypes",{children:b.element.isRequired,onClickOutside:b.func.isRequired});var br=typeof self=="object"&&self.self===self&&self||typeof p=="object"&&p.global===p&&p||p;const St=te(br);var hr=function(){var e=[],n=!1;function o(){e.forEach(function(c){c()}),n=!1}function r(){n||(n=!0,St.requestAnimationFrame(o))}function s(c){if(c){var a=e.indexOf(c);a<0&&e.push(c)}}return{add:function(a){return e.length||St.addEventListener("resize",r),s(a),{release:function(){var i=e.indexOf(a);i>=0&&e.splice(i,1)}}}}}();function sn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function fe(t){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Wt(t){return Wt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Wt(t)}function A(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function At(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?At=function(n){return typeof n}:At=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},At(t)}var un=ut.prefix,$t="left",vt="top",yt="right",K="bottom",_r=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return At(e)!==At(n)?!0:Object(n)===n&&typeof n!="function"?e.top!==n.top||e.left!==n.left:e!==n},wr=function(e){var n,o=e.menuSize,r=e.refPosition,s=r===void 0?{}:r,c=e.offset,a=c===void 0?{}:c,u=e.direction,i=u===void 0?K:u,l=e.scrollX,d=l===void 0?0:l,f=e.scrollY,y=f===void 0?0:f,E=e.container,m=s.left,g=m===void 0?0:m,_=s.top,x=_===void 0?0:_,R=s.right,M=R===void 0?0:R,Z=s.bottom,H=Z===void 0?0:Z,J=E.position!=="static"?0:d,G=E.position!=="static"?0:y,T={top:E.position!=="static"?E.rect.top:0,left:E.position!=="static"?E.rect.left:0},ot=o.width,F=o.height,tt=a.top,O=tt===void 0?0:tt,Q=a.left,z=Q===void 0?0:Q,pt=(g+M)/2,et=(x+H)/2;return(n={},A(n,$t,function(){return{left:g-ot+J-z-T.left,top:et-F/2+G+O-9-T.top}}),A(n,vt,function(){return{left:pt-ot/2+J+z-T.left,top:x-F+G-O-T.top}}),A(n,yt,function(){return{left:M+J+z-T.left,top:et-F/2+G+O+3-T.top}}),A(n,K,function(){return{left:pt-ot/2+J+z-T.left,top:H+G+O-T.top}}),n)[i]()},Le=function(t){$r(n,t);var e=vr(n);function n(){var o;gr(this,n);for(var r=arguments.length,s=new Array(r),c=0;c0&&arguments[0]!==void 0?arguments[0]:{},u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=o._menuBody;if(i){var l=a.menuOffset,d=l===void 0?{}:l,f=a.menuDirection,y=o.props,E=y.menuOffset,m=E===void 0?{}:E,g=y.menuDirection;if(_r(d,m)||f!==g||u){var _=o.props,x=_.flipped,R=_.triggerRef,M=_.updateOrientation,Z=R.current,H=i.getBoundingClientRect(),J=Z&&Z.getBoundingClientRect(),G=typeof m!="function"?m:m(i,g,Z,x);M&&M({menuSize:H,refPosition:J,direction:g,offset:G,scrollX:St.pageXOffset,scrollY:St.pageYOffset,container:{rect:o.props.target().getBoundingClientRect(),position:getComputedStyle(o.props.target()).position}}),(H.width>0&&H.height>0||!G)&&o.setState({floatingPosition:wr({menuSize:H,refPosition:J,direction:g,offset:G,scrollX:St.pageXOffset,scrollY:St.pageYOffset,container:{rect:o.props.target().getBoundingClientRect(),position:getComputedStyle(o.props.target()).position}})},function(){if(!u){var T=i.getBoundingClientRect();T!==H&&o._updateMenuSize(o.props,!0)}})}}}),A(X(o),"_focusMenuContent",function(a){var u=a.querySelector(o.props.selectorPrimaryFocus||null),i=a.querySelector(Yo),l=a.querySelector(Wo),d=u||i||l||a;o.props.focusTrap&&d.focus()}),A(X(o),"_menuRef",function(a){var u=o.props.menuRef;o._placeInProgress=!!a,u&&u(o._menuBody=a),a&&o._updateMenuSize()}),A(X(o),"_getChildrenWithProps",function(){var a=o.props,u=a.styles,i=a.children,l=o.state.floatingPosition,d=l?{left:"".concat(l.left,"px"),top:"".concat(l.top,"px"),right:"auto"}:{visibility:"hidden",top:"0px"};return w.cloneElement(i,{ref:o._menuRef,style:fe(fe(fe({},u),d),{},{position:"absolute",opacity:1})})}),A(X(o),"handleBlur",function(a){var u=a.target,i=a.relatedTarget;if(i&&u){var l=o.startSentinel.current,d=o.endSentinel.current;Jo({bodyNode:o._menuBody,startSentinelNode:l,endSentinelNode:d,currentActiveNode:i,oldActiveNode:u})}}),o}return mr(n,[{key:"componentWillUnmount",value:function(){this.hResize.release()}},{key:"componentDidMount",value:function(){var r=this;this.hResize=hr.add(function(){r._updateMenuSize()})}},{key:"componentDidUpdate",value:function(r){this._updateMenuSize(r);var s=this.props.onPlace;this._placeInProgress&&this.state.floatingPosition&&(this._menuBody&&!this._menuBody.contains(document.activeElement)&&this._focusMenuContent(this._menuBody),typeof s=="function"&&(s(this._menuBody),this._placeInProgress=!1))}},{key:"render",value:function(){if(typeof document<"u"){var r=this.props,s=r.focusTrap,c=r.target;return zo.createPortal(w.createElement("div",{onBlur:s?this.handleBlur:null},w.createElement("span",{ref:this.startSentinel,tabIndex:"0",role:"link",className:"".concat(un,"--visually-hidden")},"Focus sentinel"),this._getChildrenWithProps(),w.createElement("span",{ref:this.endSentinel,tabIndex:"0",role:"link",className:"".concat(un,"--visually-hidden")},"Focus sentinel")),c?c():document.body)}return null}}]),n}(w.Component);A(Le,"propTypes",{children:b.object,flipped:b.bool,focusTrap:b.bool,menuDirection:b.oneOf([$t,vt,yt,K]),menuOffset:b.oneOfType([b.shape({top:b.number,left:b.number}),b.func]),menuRef:b.func,onPlace:b.func,selectorPrimaryFocus:b.string,styles:b.object,target:b.func,triggerRef:b.oneOfType([b.func,b.shape({current:b.any})]),updateOrientation:b.func});A(Le,"defaultProps",{menuOffset:{},menuDirection:K,updateOrientation:null});function qr(t){return function(n,o,r){n[o],n.value,n.readOnly;for(var s=arguments.length,c=new Array(s>3?s-3:0),a=3;a=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function Sr(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,s;for(s=0;s=0)&&(n[r]=t[r]);return n}function Dr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function an(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Jt(t){return Jt=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Jt(t)}function ln(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Xt(t){for(var e=1;ex.rect.width?$t:y;case K:return ot+tt+et-O.top+z>x.rect.height?vt:y;default:return y}},Ro=function(){switch(y){case $t:case yt:return Qe-z/2+tt+et-9-O.top<0?"start":Qe-z/2+tt+et-9-O.top+z>x.rect.height?"end":"original";case vt:case K:return Ze-Q/2+F+qt-O.left<0?"start":Ze-Q/2+F+qt-O.left+Q>x.rect.width?"end":"original";default:return"original"}};return{direction:Co(),align:Ro()}}),$(k(r),"_handleUserInputOpenClose",function(c,a){var u=a.open;if(r.isControlled&&r.props.onChange){r.props.onChange(c,{open:u});return}var i=r._tooltipEl;r.setState({open:u},function(){if(r.props.onChange&&r.props.onChange(c,{open:u}),!u&&i&&i.id===r._tooltipId){r._tooltipDismissed=!0;var l=c==null?void 0:c.relatedTarget;if(!l&&document.activeElement===document.body&&(c==null?void 0:c.type)!=="click"){var d;(d=r._triggerRef)===null||d===void 0||d.current.focus()}}})}),$(k(r),"_handleFocus",function(c,a){var u=a.currentTarget,i=a.relatedTarget;if(u!==i&&(r._tooltipDismissed=!1),c==="over")r._tooltipDismissed||r._handleUserInputOpenClose(a,{open:!0}),r._tooltipDismissed=!1;else if(c!=="out"){var l=r._triggerRef.current,d=i&&(l&&(l==null?void 0:l.contains(i))||r._tooltipEl&&r._tooltipEl.contains(i));d||r._handleUserInputOpenClose(a,{open:!1})}}),$(k(r),"_debouncedHandleFocus",null),$(k(r),"_getTarget",function(){var c=r._triggerRef.current;return c&&c.closest("[data-floating-menu-container]")||document.body}),$(k(r),"handleMouse",function(c){c.persist();var a={focus:"over",blur:"out",click:"click"}[c.type],u=r._hasContextMenu;if((c.type==="click"||c.type==="contextmenu")&&(r._hasContextMenu=c.type==="contextmenu"),r._hasContextMenu){r._handleUserInputOpenClose(c,{open:!1});return}if(a==="click"){c.stopPropagation(),c.preventDefault();var i=r.isControlled?!r.props.open:!r.state.open;r._handleUserInputOpenClose(c,{open:i})}else if(a&&(a!=="out"||!u)){var l;(l=k(r))===null||l===void 0||l._debouncedHandleFocus(a,c)}}),$(k(r),"handleClickOutside",function(c){var a=c&&c.target&&r._tooltipEl&&r._tooltipEl.contains(c.target);!a&&r.state.open&&r._handleUserInputOpenClose(c,{open:!1})}),$(k(r),"handleKeyPress",function(c){if(de(c,[Ke,Ho])&&(c.stopPropagation(),r._handleUserInputOpenClose(c,{open:!1})),de(c,[Go,Fo])){c.stopPropagation(),c.preventDefault();var a=r.isControlled?!r.props.open:!r.state.open;r._handleUserInputOpenClose(c,{open:a})}}),$(k(r),"handleEscKeyPress",function(c){var a=r.isControlled?r.props:r.state,u=a.open;if(u&&de(c,[Ke]))return c.stopPropagation(),r._handleUserInputOpenClose(c,{open:!1})}),r.isControlled=o.open!==void 0,ye&&r.isControlled)return Vn(r);var s=ye?o.defaultOpen:o.open;return r.state={open:s,storedDirection:o.direction,storedAlign:o.align},r}return Ar(n,[{key:"componentDidMount",value:function(){this._debouncedHandleFocus||(this._debouncedHandleFocus=jo(this._handleFocus,200)),document.addEventListener("keydown",this.handleEscKeyPress,!1)}},{key:"componentDidUpdate",value:function(r,s){r.direction!=this.props.direction&&this.setState({storedDirection:this.props.direction}),r.align!=this.props.align&&this.setState({storedAlign:this.props.align}),s.open&&!this.state.open&&this.setState({storedDirection:this.props.direction,storedAlign:this.props.align})}},{key:"componentWillUnmount",value:function(){this._debouncedHandleFocus&&(this._debouncedHandleFocus.cancel(),this._debouncedHandleFocus=null),document.removeEventListener("keydown",this.handleEscKeyPress,!1)}},{key:"render",value:function(){var r,s=this,c=this.props,a=c.triggerId,u=a===void 0?this.triggerId=this.triggerId||"__carbon-tooltip-trigger_".concat(Math.random().toString(36).substr(2)):a,i=c.tooltipBodyId,l=c.children,d=c.className,f=c.triggerClassName,y=c.focusTrap,E=c.triggerText,m=c.showIcon,g=c.iconName,_=c.iconDescription,x=c.renderIcon,R=c.menuOffset,M=c.tabIndex,Z=M===void 0?0:M,H=c.innerRef;c.selectorPrimaryFocus,c.tooltipId;var J=Tr(c,Er),G=this.isControlled?this.props:this.state,T=G.open,ot=this.state,F=ot.storedDirection,tt=ot.storedAlign,O=tn("".concat(at,"--tooltip"),(r={},$(r,"".concat(at,"--tooltip--shown"),T),$(r,"".concat(at,"--tooltip--").concat(F),F),$(r,"".concat(at,"--tooltip--align-").concat(tt),tt),r),d),Q=tn("".concat(at,"--tooltip__label"),f),z=Vo(this._triggerRef,H),pt={name:g,role:null,description:null},et=Xt({role:"button",tabIndex:Z,onClick:this.handleMouse,onContextMenu:this.handleMouse,onKeyDown:this.handleKeyPress,onMouseOver:this.handleMouse,onMouseOut:this.handleMouse,onFocus:this.handleMouse,onBlur:this.handleMouse,"aria-controls":T?this._tooltipId:void 0,"aria-expanded":T,"aria-describedby":T?this._tooltipId:null},E?{"aria-labelledby":u}:{"aria-label":_});return w.createElement(w.Fragment,null,w.createElement(Bn,{onClickOutside:this.handleClickOutside},m?w.createElement("div",{id:u,className:Q},E,w.createElement("div",Lt({className:"".concat(at,"--tooltip__trigger")},et,{ref:z,"aria-describedby":i}),w.createElement(x,pt))):w.createElement("div",Lt({id:u,className:Q,ref:z},et,{"aria-describedby":i}),E)),T&&w.createElement(Le,{focusTrap:y,selectorPrimaryFocus:this.props.selectorPrimaryFocus,target:this._getTarget,triggerRef:this._triggerRef,menuDirection:F,menuOffset:R,menuRef:function(qt){s._tooltipEl=qt},updateOrientation:this.updateOrientation},w.createElement("div",Lt({className:O},J,{id:this._tooltipId,"data-floating-menu-direction":F,onMouseOver:this.handleMouse,onMouseOut:this.handleMouse,onFocus:this.handleMouse,onBlur:this.handleMouse,onContextMenu:this.handleMouse}),w.createElement("span",{className:"".concat(at,"--tooltip__caret")}),w.createElement("div",{className:"".concat(at,"--tooltip__content"),"aria-labelledby":this._tooltipId,role:"dialog"},l))))}}],[{key:"getDerivedStateFromProps",value:function(r,s){var c=r.open,a=s.prevOpen;return a===c?null:{open:c,prevOpen:c}}}]),n}(zt.Component);$(Ne,"propTypes",Xt({align:b.oneOf(["start","center","end"]),autoOrientation:b.bool,children:b.node,className:b.string,defaultOpen:b.bool,direction:b.oneOf(["bottom","top","left","right"]),focusTrap:b.bool,iconName:b.string,menuOffset:b.oneOfType([b.shape({top:b.number,left:b.number}),b.func]),onChange:ye?qr(b.func):b.func,open:b.bool,renderIcon:function(e,n,o){if(e[n]!=null){var r=e[n];if(!Bo.isForwardRef(w.createElement(r,null)))return new Error("Invalid value of prop '".concat(n,"' supplied to '").concat(o,`', it should be created/wrapped with React.forwardRef() to have a ref and access the proper DOM node of the element to calculate its position in the viewport.`))}},selectorPrimaryFocus:b.string,showIcon:b.bool,tabIndex:b.number,tooltipBodyId:b.string,tooltipId:b.string,triggerClassName:b.string,triggerId:b.string},cr({triggerText:b.node,iconDescription:b.string})));$(Ne,"defaultProps",{align:"center",direction:K,focusTrap:!0,renderIcon:Xo,showIcon:!0,triggerText:null,menuOffset:Or,selectorPrimaryFocus:"[data-tooltip-primary-focus]"});const Cr=function(){var t=function(n,o){return w.createElement(Ne,Lt({},n,{innerRef:o}))};return t.displayName="Tooltip",w.forwardRef(t)}();var Rr=or,Ir=1/0;function Pr(t){var e=t==null?0:t.length;return e?Rr(t,Ir):[]}var Ur=Pr;const ke=te(Ur),ht={CONTRACT:"contract",INVOICE:"invoice",PURCHASE_ORDER:"purchase_order"};function jn(t){if(t){if(ht.INVOICE in t)return ht.INVOICE;if(ht.PURCHASE_ORDER in t)return ht.PURCHASE_ORDER}return ht.CONTRACT}const f8t=t=>t===ht.INVOICE||t===ht.PURCHASE_ORDER,Oe=t=>t.allAttributeIds,p8t=t=>t.some(Oe),Br="DEFAULT_F";function Ce(t){return t.location&&`${t.facetId||Br}_${t.location.begin}_${t.location.end}`}function b8t(t,e){return t[Vr(t,e)]}function Vr(t,e){return t.some(n=>Oe(n))?t.findIndex(n=>en(n.allAttributeIds.sort(),e.sort())):t.findIndex(n=>en([Ce(n)].sort(),e.sort()))}var jr=Qo;function Mr(t,e){return e=typeof e=="function"?e:void 0,t&&t.length?jr(t,void 0,e):[]}var Hr=Mr;const Gr=te(Hr),Fr=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),zr=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var pe;const Yr=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Wr=(pe=String.fromCodePoint)!==null&&pe!==void 0?pe:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function Jr(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=Yr.get(t))!==null&&e!==void 0?e:t}var N;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(N||(N={}));const Xr=32;var dt;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(dt||(dt={}));function _e(t){return t>=N.ZERO&&t<=N.NINE}function Zr(t){return t>=N.UPPER_A&&t<=N.UPPER_F||t>=N.LOWER_A&&t<=N.LOWER_F}function Qr(t){return t>=N.UPPER_A&&t<=N.UPPER_Z||t>=N.LOWER_A&&t<=N.LOWER_Z||_e(t)}function Kr(t){return t===N.EQUALS||Qr(t)}var D;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(D||(D={}));var lt;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(lt||(lt={}));class ts{constructor(e,n,o){this.decodeTree=e,this.emitCodePoint=n,this.errors=o,this.state=D.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=lt.Strict}startEntity(e){this.decodeMode=e,this.state=D.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case D.EntityStart:return e.charCodeAt(n)===N.NUM?(this.state=D.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=D.NamedEntity,this.stateNamedEntity(e,n));case D.NumericStart:return this.stateNumericStart(e,n);case D.NumericDecimal:return this.stateNumericDecimal(e,n);case D.NumericHex:return this.stateNumericHex(e,n);case D.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|Xr)===N.LOWER_X?(this.state=D.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=D.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,o,r){if(n!==o){const s=o-n;this.result=this.result*Math.pow(r,s)+parseInt(e.substr(n,s),r),this.consumed+=s}}stateNumericHex(e,n){const o=n;for(;n>14;for(;n>14,s!==0){if(c===N.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==lt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:o}=this,r=(o[n]&dt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,o){const{decodeTree:r}=this;return this.emitCodePoint(n===1?r[e]&~dt.VALUE_LENGTH:r[e+1],o),n===3&&this.emitCodePoint(r[e+2],o),o}end(){var e;switch(this.state){case D.NamedEntity:return this.result!==0&&(this.decodeMode!==lt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case D.NumericDecimal:return this.emitNumericEntity(0,2);case D.NumericHex:return this.emitNumericEntity(0,3);case D.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case D.EntityStart:return 0}}}function Mn(t){let e="";const n=new ts(t,o=>e+=Wr(o));return function(r,s){let c=0,a=0;for(;(a=r.indexOf("&",a))>=0;){e+=r.slice(c,a),n.startEntity(s);const i=n.write(r,a+1);if(i<0){c=a+n.end();break}c=a+i,a=i===0?c+1:c}const u=e+r.slice(c);return e="",u}}function es(t,e,n,o){const r=(e&dt.BRANCH_LENGTH)>>7,s=e&dt.JUMP_TABLE;if(r===0)return s!==0&&o===s?n:-1;if(s){const u=o-s;return u<0||u>=r?-1:t[n+u]-1}let c=n,a=c+r-1;for(;c<=a;){const u=c+a>>>1,i=t[u];if(io)a=u-1;else return t[u+r]}return-1}const ns=Mn(Fr);Mn(zr);function Hn(t,e=lt.Legacy){return ns(t,e)}function Vt(t){for(let e=1;et.codePointAt(e):(t,e)=>(t.charCodeAt(e)&64512)===55296?(t.charCodeAt(e)-55296)*1024+t.charCodeAt(e+1)-56320+65536:t.charCodeAt(e),ss=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function cs(t){return us(ss,t)}function us(t,e){let n="",o=0,r;for(;(r=t.exec(e))!==null;){const s=r.index;n+=e.substring(o,s);const c=e.charCodeAt(s);let a=os.get(c);if(typeof a=="object"){if(s+1u&&(r-=u));if(a===null&&i===null)throw new Error(`Unable to find text node. Node: ${t.textContent}, offset: ${e}`);return a===null&&i!==null?{textNode:i,textOffset:i.data.length}:{textNode:a,textOffset:r}}function g8t({fragment:t,parentRect:e,fieldType:n,fieldValue:o,fieldId:r,beginTextNode:s,beginOffset:c,endTextNode:a,endOffset:u}){const i=document.createElement("div");i.className="field",i.dataset.fieldType=n,i.dataset.fieldValue=o,i.dataset.fieldId=r,i.setAttribute("data-testid",`field-${r}`),t.appendChild(i),as(s,c,a,u,l=>{const d=document.createElement("div");d.className="field--rect",d.setAttribute("data-testid","field-rect"),d.setAttribute("style",`top: ${l.top-e.top}px; left: ${l.left-e.left}px; diff --git a/docs/storybook/iframe.html b/docs/storybook/iframe.html index a3e6cf093..c2947717a 100644 --- a/docs/storybook/iframe.html +++ b/docs/storybook/iframe.html @@ -359,7 +359,7 @@ } - + diff --git a/docs/storybook/project.json b/docs/storybook/project.json index e223a92e0..fa345632e 100644 --- a/docs/storybook/project.json +++ b/docs/storybook/project.json @@ -1 +1 @@ -{"generatedAt":1706287375710,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":true,"hasStorybookEslint":false,"refCount":0,"metaFramework":{"name":"CRA","packageName":"react-scripts","version":"5.0.1"},"monorepo":"Lerna","packageManager":{"type":"yarn","version":"4.0.2"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"7.6.10","storybookVersionSpecifier":"^7.6.10","language":"typescript","storybookPackages":{"@storybook/addons":{"version":"7.6.10"},"@storybook/preset-create-react-app":{"version":"7.6.10"},"@storybook/react":{"version":"7.6.10"},"@storybook/react-vite":{"version":"7.6.10"},"@storybook/source-loader":{"version":"7.6.10"},"storybook":{"version":"7.6.10"}},"addons":{"@storybook/addon-actions":{"version":"7.6.10"},"@storybook/addon-docs":{"version":"7.6.10"},"@storybook/addon-knobs":{"version":"7.0.2"}}} +{"generatedAt":1707929469049,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":true,"hasStorybookEslint":false,"refCount":0,"metaFramework":{"name":"CRA","packageName":"react-scripts","version":"5.0.1"},"monorepo":"Lerna","packageManager":{"type":"yarn","version":"4.0.2"},"preview":{"usesGlobals":false},"framework":{"name":"@storybook/react-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/react","storybookVersion":"7.6.10","storybookVersionSpecifier":"^7.6.10","language":"typescript","storybookPackages":{"@storybook/addons":{"version":"7.6.10"},"@storybook/preset-create-react-app":{"version":"7.6.10"},"@storybook/react":{"version":"7.6.10"},"@storybook/react-vite":{"version":"7.6.10"},"@storybook/source-loader":{"version":"7.6.10"},"storybook":{"version":"7.6.10"}},"addons":{"@storybook/addon-actions":{"version":"7.6.10"},"@storybook/addon-docs":{"version":"7.6.10"},"@storybook/addon-knobs":{"version":"7.0.2"}}} diff --git a/lerna.json b/lerna.json index 7be4fbecb..e3f138a9a 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "packages": ["packages/*"], - "version": "5.0.1", + "version": "5.0.2", "npmClient": "yarn", "command": { "publish": { diff --git a/packages/discovery-react-components/CHANGELOG.md b/packages/discovery-react-components/CHANGELOG.md index 6701e696b..250fcf71c 100644 --- a/packages/discovery-react-components/CHANGELOG.md +++ b/packages/discovery-react-components/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.0.2](https://github.com/watson-developer-cloud/discovery-components/compare/v5.0.1...v5.0.2) (2024-02-14) + + +### Bug Fixes + +* fixed error in search results due to document title ([#550](https://github.com/watson-developer-cloud/discovery-components/issues/550)) ([220798d](https://github.com/watson-developer-cloud/discovery-components/commit/220798d8d51ea380b16dab4c8330c6e93ea7de65)) + + + + + ## [5.0.1](https://github.com/watson-developer-cloud/discovery-components/compare/v5.0.0...v5.0.1) (2024-01-26) **Note:** Version bump only for package @ibm-watson/discovery-react-components diff --git a/packages/discovery-react-components/package.json b/packages/discovery-react-components/package.json index efbdfee87..d7ffa8318 100644 --- a/packages/discovery-react-components/package.json +++ b/packages/discovery-react-components/package.json @@ -1,6 +1,6 @@ { "name": "@ibm-watson/discovery-react-components", - "version": "5.0.1", + "version": "5.0.2", "description": "Discovery components built with the React framework and IBM Carbon components", "license": "Apache-2.0", "author": "IBM Corp.",