1(()=>{var e={6137(e,t,r){const n=r(1594),i=r(9469),a=r(6622),s=r(5556),o=r(8274),l=r(2084),c=r(1261),u=r(5515),d=r(83),h=r(6128),p=r(4444),f=r(8122),g=r(4798),m=r(9764),v=r(4976);e.exports={classnames:o,FileDrop:a.FileDrop,HexColorInput:g.HexColorInput,HexColorPicker:g.HexColorPicker,immer:c.produce,PropTypes:s,React:n,ReactCalendar:f,ReactDOM:i,ReactDND:d,ReactDNDMultiBackend:h,ReactDNDHtml5ToTouch:p,ReactPaginate:m.default,ReactRouter:{BrowserRouter:v.BrowserRouter,Route:v.Route,Routes:v.Routes,Link:v.Link,NavLink:v.NavLink,useLocation:v.useLocation,useNavigate:v.useNavigate,useSearchParams:v.useSearchParams},SimpleBar:u.default,zustand:l.default}},6536(e,t,r){"use strict";var n={};r.r(n),r.d(n,{dU:()=>Li,ng:()=>Ii,Tm:()=>Ni,D6:()=>ji,YE:()=>Fi});var i=r(8221),a=r.n(i),s=r(4848),o=r(1594),l=function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},c=l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l(l([],["onCopy","onCut","onPaste"],!0),["onCompositionEnd","onCompositionStart","onCompositionUpdate"],!0),["onFocus","onBlur"],!0),["onInput","onInvalid","onReset","onSubmit"],!0),["onLoad","onError"],!0),["onKeyDown","onKeyPress","onKeyUp"],!0),["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],!0),["onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],!0),["onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop"],!0),["onSelect"],!0),["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],!0),["onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut"],!0),["onScroll"],!0),["onWheel"],!0),["onAnimationStart","onAnimationEnd","onAnimationIteration"],!0),["onTransitionEnd"],!0),["onChange"],!0),["onToggle"],!0);function u(e,t){var r={};return c.forEach(function(n){var i=e[n];i&&(r[n]=t?function(e){return i(e,t(n))}:i)}),r}function d(e){var t=!1;return{promise:new Promise(function(r,n){e.then(function(e){return!t&&r(e)}).catch(function(e){return!t&&n(e)})}),cancel:function(){t=!0}}}function h(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=h(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}const p=function(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=h(e))&&(n&&(n+=" "),n+=t);return n};var f="Invariant failed";function g(e,t){if(!e)throw new Error(f)}var m=r.cjs(function(e,t){var r=function(){};e.exports=r}),v=Object.prototype.hasOwnProperty;function y(e,t,r){for(r of e.keys())if(b(r,t))return r}function b(e,t){var r,n,i;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&b(e[n],t[n]););return-1===n}if(r===Set){if(e.size!==t.size)return!1;for(n of e){if((i=n)&&"object"==typeof i&&!(i=y(t,i)))return!1;if(!t.has(i))return!1}return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e){if((i=n[0])&&"object"==typeof i&&!(i=y(t,i)))return!1;if(!b(n[1],t.get(i)))return!1}return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return-1===n}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return-1===n}if(!r||"object"==typeof e){for(r in n=0,e){if(v.call(e,r)&&++n&&!v.call(t,r))return!1;if(!(r in t)||!b(e[r],t[r]))return!1}return Object.keys(t).length===n}}return e!=e&&t!=t} 2/** 3 * @licstart The following is the entire license notice for the 4 * JavaScript code in this page 5 * 6 * Copyright 2024 Mozilla Foundation 7 * 8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License. 10 * You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an "AS IS" BASIS, 16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 * 20 * @licend The above is the entire license notice for the 21 * JavaScript code in this page 22 */var w={d:(e,t)=>{for(var r in t)w.o(t,r)&&!w.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},x=globalThis.pdfjsLib={};w.d(x,{AbortException:()=>Me,AnnotationEditorLayer:()=>ki,AnnotationEditorParamsType:()=>N,AnnotationEditorType:()=>I,AnnotationEditorUIManager:()=>Ct,AnnotationLayer:()=>yi,AnnotationMode:()=>L,ColorPicker:()=>Pi,DOMSVGFactory:()=>Bn,DrawLayer:()=>Mi,FeatureTest:()=>je,GlobalWorkerOptions:()=>Ar,ImageKind:()=>W,InvalidPDFException:()=>Re,MissingPDFException:()=>Oe,OPS:()=>ge,OutputScale:()=>yt,PDFDataRangeTransport:()=>An,PDFDateString:()=>ht,PDFWorker:()=>Pn,PasswordResponses:()=>me,PermissionFlag:()=>j,PixelsPerInch:()=>et,RenderingCancelledException:()=>nt,TextLayer:()=>gn,UnexpectedResponseException:()=>De,Util:()=>He,VerbosityLevel:()=>fe,XfaLayer:()=>zn,build:()=>In,createValidAbsoluteUrl:()=>Ae,fetchData:()=>tt,getDocument:()=>xn,getFilenameFromUrl:()=>st,getPdfFilenameFromUrl:()=>ot,getXfaPageViewport:()=>pt,isDataScheme:()=>it,isPdfFile:()=>at,noContextMenu:()=>ut,normalizeUnicode:()=>$e,setLayerDimensions:()=>vt,shadow:()=>_e,version:()=>Ln});const E=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type),S=[1,0,0,1,0,0],A=[.001,0,0,.001,0,0],_=1.35,T=1,C=2,P=4,R=16,O=32,D=64,k=128,M=256,L={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},I={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},N={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},j={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},F=0,H=1,B=2,z=3,$=3,U=4,W={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},V=1,q=2,Y=3,G=4,X=5,K=6,J=7,Q=8,Z=9,ee=10,te=11,re=12,ne=13,ie=14,ae=15,se=16,oe=17,le=20,ce=1,ue=2,de=3,he=4,pe=5,fe={ERRORS:0,WARNINGS:1,INFOS:5},ge={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},me={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let ve=fe.WARNINGS;function ye(e){Number.isInteger(e)&&(ve=e)}function be(){return ve}function we(e){ve>=fe.INFOS&&console.log(`Info: ${e}`)}function xe(e){ve>=fe.WARNINGS&&console.log(`Warning: ${e}`)}function Ee(e){throw new Error(e)}function Se(e,t){e||Ee(t)}function Ae(e,t=null,r=null){if(!e)return null;try{if(r&&"string"==typeof e){if(r.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t?.length>=2&&(e=`http://${e}`)}if(r.tryConvertEncoding)try{e=decodeURIComponent(escape(e))}catch{}}const n=t?new URL(e,t):new URL(e);if(function(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch{}return null}function _e(e,t,r,n=!1){return Object.defineProperty(e,t,{value:r,enumerable:!n,configurable:!0,writable:!1}),r}const Te=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=new Error,e.constructor=e,e}();class Ce extends Te{constructor(e,t){super(e,"PasswordException"),this.code=t}}class Pe extends Te{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}}class Re extends Te{constructor(e){super(e,"InvalidPDFException")}}class Oe extends Te{constructor(e){super(e,"MissingPDFException")}}class De extends Te{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}}class ke extends Te{constructor(e){super(e,"FormatError")}}class Me extends Te{constructor(e){super(e,"AbortException")}}function Le(e){"object"==typeof e&&void 0!==e?.length||Ee("Invalid argument for bytesToString");const t=e.length,r=8192;if(t<r)return String.fromCharCode.apply(null,e);const n=[];for(let i=0;i<t;i+=r){const a=Math.min(i+r,t),s=e.subarray(i,a);n.push(String.fromCharCode.apply(null,s))}return n.join("")}function Ie(e){"string"!=typeof e&&Ee("Invalid argument for stringToBytes");const t=e.length,r=new Uint8Array(t);for(let n=0;n<t;++n)r[n]=255&e.charCodeAt(n);return r}function Ne(e){const t=Object.create(null);for(const[r,n]of e)t[r]=n;return t}class je{static get isLittleEndian(){return _e(this,"isLittleEndian",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return _e(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return _e(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"!=typeof navigator&&"string"==typeof navigator?.platform?_e(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:"string"==typeof navigator?.userAgent&&navigator.userAgent.includes("Firefox")}):_e(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){return _e(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Fe=Array.from(Array(256).keys(),e=>e.toString(16).padStart(2,"0"));class He{static makeHexColor(e,t,r){return`#${Fe[e]}${Fe[t]}${Fe[r]}`}static scaleMinMax(e,t){let r;e[0]?(e[0]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[3],t[3]*=e[3]):(r=t[0],t[0]=t[1],t[1]=r,r=t[2],t[2]=t[3],t[3]=r,e[1]<0&&(r=t[1],t[1]=t[3],t[3]=r),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(r=t[0],t[0]=t[2],t[2]=r),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const r=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/r,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/r]}static getAxialAlignedBoundingBox(e,t){const r=this.applyTransform(e,t),n=this.applyTransform(e.slice(2,4),t),i=this.applyTransform([e[0],e[3]],t),a=this.applyTransform([e[2],e[1]],t);return[Math.min(r[0],n[0],i[0],a[0]),Math.min(r[1],n[1],i[1],a[1]),Math.max(r[0],n[0],i[0],a[0]),Math.max(r[1],n[1],i[1],a[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],r=e[0]*t[0]+e[1]*t[2],n=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],a=e[2]*t[1]+e[3]*t[3],s=(r+a)/2,o=Math.sqrt((r+a)**2-4*(r*a-i*n))/2,l=s+o||1,c=s-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const r=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(r>n)return null;const i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>a?null:[r,i,n,a]}static#e(e,t,r,n,i,a,s,o,l,c){if(l<=0||l>=1)return;const u=1-l,d=l*l,h=d*l,p=u*(u*(u*e+3*l*t)+3*d*r)+h*n,f=u*(u*(u*i+3*l*a)+3*d*s)+h*o;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],f),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],f)}static#t(e,t,r,n,i,a,s,o,l,c,u,d){if(Math.abs(l)<1e-12)return void(Math.abs(c)>=1e-12&&this.#e(e,t,r,n,i,a,s,o,-u/c,d));const h=c**2-4*u*l;if(h<0)return;const p=Math.sqrt(h),f=2*l;this.#e(e,t,r,n,i,a,s,o,(-c+p)/f,d),this.#e(e,t,r,n,i,a,s,o,(-c-p)/f,d)}static bezierBoundingBox(e,t,r,n,i,a,s,o,l){return l?(l[0]=Math.min(l[0],e,s),l[1]=Math.min(l[1],t,o),l[2]=Math.max(l[2],e,s),l[3]=Math.max(l[3],t,o)):l=[Math.min(e,s),Math.min(t,o),Math.max(e,s),Math.max(t,o)],this.#t(e,r,i,s,t,n,a,o,3*(3*(r-i)-e+s),6*(e-2*r+i),3*(r-e),l),this.#t(e,r,i,s,t,n,a,o,3*(3*(n-a)-t+o),6*(t-2*n+a),3*(n-t),l),l}}let Be=null,ze=null;function $e(e){return Be||(Be=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,ze=new Map([["ï¬ ","Å¿t"]])),e.replaceAll(Be,(e,t,r)=>t?t.normalize("NFKC"):ze.get(r))}
vendor: 24,988 bytes, line 22
22const Ue="pdfjs_internal_id_",We=0,Ve=1,qe=2,Ye=3,Ge=4,Xe=5,Ke=6,Je=7,Qe=8;const Ze="http://www.w3.org/2000/svg";class et{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function tt(e,t="text"){if(ct(e,document.baseURI)){const r=await fetch(e);if(!r.ok)throw new Error(r.statusText);switch(t){case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"json":return r.json()}return r.text()}return new Promise((r,n)=>{const i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType=t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE)if(200!==i.status&&0!==i.status)n(new Error(i.statusText));else{switch(t){case"arraybuffer":case"blob":case"json":return void r(i.response)}r(i.responseText)}},i.send(null)})}class rt{constructor({viewBox:e,scale:t,rotation:r,offsetX:n=0,offsetY:i=0,dontFlip:a=!1}){this.viewBox=e,this.scale=t,this.rotation=r,this.offsetX=n,this.offsetY=i;const s=(e[2]+e[0])/2,o=(e[3]+e[1])/2;let l,c,u,d,h,p,f,g;switch((r%=360)<0&&(r+=360),r){case 180:l=-1,c=0,u=0,d=1;break;case 90:l=0,c=1,u=1,d=0;break;case 270:l=0,c=-1,u=-1,d=0;break;case 0:l=1,c=0,u=0,d=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(u=-u,d=-d),0===l?(h=Math.abs(o-e[1])*t+n,p=Math.abs(s-e[0])*t+i,f=(e[3]-e[1])*t,g=(e[2]-e[0])*t):(h=Math.abs(s-e[0])*t+n,p=Math.abs(o-e[1])*t+i,f=(e[2]-e[0])*t,g=(e[3]-e[1])*t),this.transform=[l*t,c*t,u*t,d*t,h-l*t*s-u*t*o,p-c*t*s-d*t*o],this.width=f,this.height=g}get rawDims(){const{viewBox:e}=this;return _e(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:r=this.offsetX,offsetY:n=this.offsetY,dontFlip:i=!1}={}){return new rt({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:r,offsetY:n,dontFlip:i})}convertToViewportPoint(e,t){return He.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){const t=He.applyTransform([e[0],e[1]],this.transform),r=He.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],r[0],r[1]]}convertToPdfPoint(e,t){return He.applyInverseTransform([e,t],this.transform)}}class nt extends Te{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}}function it(e){const t=e.length;let r=0;for(;r<t&&""===e[r].trim();)r++;return"data:"===e.substring(r,r+5).toLowerCase()}function at(e){return"string"==typeof e&&/\.pdf$/i.test(e)}function st(e){return[e]=e.split(/[#?]/,1),e.substring(e.lastIndexOf("/")+1)}function ot(e,t="document.pdf"){if("string"!=typeof e)return t;if(it(e))return xe('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),t;const r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,n=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/.exec(e);let i=r.exec(n[1])||r.exec(n[2])||r.exec(n[3]);if(i&&(i=i[0],i.includes("%")))try{i=r.exec(decodeURIComponent(i))[0]}catch{}return i||t}class lt{started=Object.create(null);times=[];time(e){e in this.started&&xe(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||xe(`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 t=0;for(const{name:e}of this.times)t=Math.max(e.length,t);for(const{name:r,start:n,end:i}of this.times)e.push(`${r.padEnd(t)} ${i-n}ms\n`);return e.join("")}}function ct(e,t){try{const{protocol:r}=t?new URL(e,t):new URL(e);return"http:"===r||"https:"===r}catch{return!1}}function ut(e){e.preventDefault()}function dt(e){console.log("Deprecated API usage: "+e)}class ht{static#r;static toDateObject(e){if(!e||"string"!=typeof e)return null;this.#r||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const t=this.#r.exec(e);if(!t)return null;const r=parseInt(t[1],10);let n=parseInt(t[2],10);n=n>=1&&n<=12?n-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let s=parseInt(t[5],10);s=s>=0&&s<=59?s:0;let o=parseInt(t[6],10);o=o>=0&&o<=59?o:0;const l=t[7]||"Z";let c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,"-"===l?(a+=c,s+=u):"+"===l&&(a-=c,s-=u),new Date(Date.UTC(r,n,i,a,s,o))}}function pt(e,{scale:t=1,rotation:r=0}){const{width:n,height:i}=e.attributes.style,a=[0,0,parseInt(n),parseInt(i)];return new rt({viewBox:a,scale:t,rotation:r})}function ft(e){if(e.startsWith("#")){const t=parseInt(e.slice(1),16);return[(16711680&t)>>16,(65280&t)>>8,255&t]}return e.startsWith("rgb(")?e.slice(4,-1).split(",").map(e=>parseInt(e)):e.startsWith("rgba(")?e.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(xe(`Not a valid color format: "${e}"`),[0,0,0])}function gt(e){const{a:t,b:r,c:n,d:i,e:a,f:s}=e.getTransform();return[t,r,n,i,a,s]}function mt(e){const{a:t,b:r,c:n,d:i,e:a,f:s}=e.getTransform().invertSelf();return[t,r,n,i,a,s]}function vt(e,t,r=!1,n=!0){if(t instanceof rt){const{pageWidth:n,pageHeight:i}=t.rawDims,{style:a}=e,s=je.isCSSRoundSupported,o=`var(--scale-factor) * ${n}px`,l=`var(--scale-factor) * ${i}px`,c=s?`round(down, ${o}, var(--scale-round-x, 1px))`:`calc(${o})`,u=s?`round(down, ${l}, var(--scale-round-y, 1px))`:`calc(${l})`;r&&t.rotation%180!=0?(a.width=u,a.height=c):(a.width=c,a.height=u)}n&&e.setAttribute("data-main-rotation",t.rotation)}class yt{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return 1!==this.sx||1!==this.sy}get symmetric(){return this.sx===this.sy}}class bt{#n=null;#i=null;#a;#s=null;#o=null;static#l=null;constructor(e){this.#a=e,bt.#l||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"})}render(){const e=this.#n=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const t=this.#a._uiManager._signal;e.addEventListener("contextmenu",ut,{signal:t}),e.addEventListener("pointerdown",bt.#c,{signal:t});const r=this.#s=document.createElement("div");r.className="buttons",e.append(r);const n=this.#a.toolbarPosition;if(n){const{style:t}=e,r="ltr"===this.#a._uiManager.direction?1-n[0]:n[0];t.insetInlineEnd=100*r+"%",t.top=`calc(${100*n[1]}% + var(--editor-toolbar-vert-offset))`}return this.#u(),e}get div(){return this.#n}static#c(e){e.stopPropagation()}#d(e){this.#a._focusEventsAllowed=!1,e.preventDefault(),e.stopPropagation()}#h(e){this.#a._focusEventsAllowed=!0,e.preventDefault(),e.stopPropagation()}#p(e){const t=this.#a._uiManager._signal;e.addEventListener("focusin",this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#h.bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",ut,{signal:t})}hide(){this.#n.classList.add("hidden"),this.#i?.hideDropdown()}show(){this.#n.classList.remove("hidden"),this.#o?.shown()}#u(){const{editorType:e,_uiManager:t}=this.#a,r=document.createElement("button");r.className="delete",r.tabIndex=0,r.setAttribute("data-l10n-id",bt.#l[e]),this.#p(r),r.addEventListener("click",e=>{t.delete()},{signal:t._signal}),this.#s.append(r)}get#f(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const t=await e.render();this.#p(t),this.#s.prepend(t,this.#f),this.#o=e}addColorPicker(e){this.#i=e;const t=e.renderButton();this.#p(t),this.#s.prepend(t,this.#f)}remove(){this.#n.remove(),this.#i?.destroy(),this.#i=null}}class wt{#s=null;#n=null;#g;constructor(e){this.#g=e}#m(){const e=this.#n=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",ut,{signal:this.#g._signal});const t=this.#s=document.createElement("div");return t.className="buttons",e.append(t),this.#v(),e}#y(e,t){let r=0,n=0;for(const i of e){const e=i.y+i.height;if(e<r)continue;const a=i.x+(t?i.width:0);e>r?(n=a,r=e):t?a>n&&(n=a):a<n&&(n=a)}return[t?1-n:n,r]}show(e,t,r){const[n,i]=this.#y(t,r),{style:a}=this.#n||=this.#m();e.append(this.#n),a.insetInlineEnd=100*n+"%",a.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){this.#n.remove()}#v(){const e=document.createElement("button");e.className="highlightButton",e.tabIndex=0,e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const t=document.createElement("span");e.append(t),t.className="visuallyHidden",t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const r=this.#g._signal;e.addEventListener("contextmenu",ut,{signal:r}),e.addEventListener("click",()=>{this.#g.highlightSelection("floating_button")},{signal:r}),this.#s.append(e)}}function xt(e,t,r){for(const n of r)t.addEventListener(n,e[n].bind(e))}class Et{#b=0;get id(){return"pdfjs_internal_editor_"+this.#b++}}class St{#w=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();const e=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(e);else for(let t=0;t<32;t++)e[t]=Math.floor(255*Math.random());return Le(e)}();#b=0;#x=null;static get _isSVGFittingCanvas(){const e=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),t=new Image;t.src='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>';return _e(this,"_isSVGFittingCanvas",t.decode().then(()=>(e.drawImage(t,0,0,1,1,0,0,1,3),0===new Uint32Array(e.getImageData(0,0,1,1).data.buffer)[0])))}async#E(e,t){this.#x||=new Map;let r=this.#x.get(e);if(null===r)return null;if(r?.bitmap)return r.refCounter+=1,r;try{let e;if(r||={bitmap:null,id:`image_${this.#w}_${this.#b++}`,refCounter:0,isSvg:!1},"string"==typeof t?(r.url=t,e=await tt(t,"blob")):t instanceof File?e=r.file=t:t instanceof Blob&&(e=t),"image/svg+xml"===e.type){const t=St._isSVGFittingCanvas,n=new FileReader,i=new Image,a=new Promise((e,a)=>{i.onload=()=>{r.bitmap=i,r.isSvg=!0,e()},n.onload=async()=>{const e=r.svgUrl=n.result;i.src=await t?`${e}#svgView(preserveAspectRatio(none))`:e},i.onerror=n.onerror=a});n.readAsDataURL(e),await a}else r.bitmap=await createImageBitmap(e);r.refCounter=1}catch(e){console.error(e),r=null}return this.#x.set(e,r),r&&this.#x.set(r.id,r),r}async getFromFile(e){const{lastModified:t,name:r,size:n,type:i}=e;return this.#E(`${t}_${r}_${n}_${i}`,e)}async getFromUrl(e){return this.#E(e,e)}async getFromBlob(e,t){const r=await t;return this.#E(e,r)}async getFromId(e){this.#x||=new Map;const t=this.#x.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){const{blobPromise:e}=t;return delete t.blobPromise,this.getFromBlob(t.id,e)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#x||=new Map;let r=this.#x.get(e);if(r?.bitmap)return r.refCounter+=1,r;const n=new OffscreenCanvas(t.width,t.height);return n.getContext("2d").drawImage(t,0,0),r={bitmap:n.transferToImageBitmap(),id:`image_${this.#w}_${this.#b++}`,refCounter:1,isSvg:!1},this.#x.set(e,r),this.#x.set(r.id,r),r}getSvgUrl(e){const t=this.#x.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#x||=new Map;const t=this.#x.get(e);if(!t)return;if(t.refCounter-=1,0!==t.refCounter)return;const{bitmap:r}=t;if(!t.url&&!t.file){const e=new OffscreenCanvas(r.width,r.height);e.getContext("bitmaprenderer").transferFromImageBitmap(r),t.blobPromise=e.convertToBlob()}r.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#w}_`)}}class At{#S=[];#A=!1;#_;#T=-1;constructor(e=128){this.#_=e}add({cmd:e,undo:t,post:r,mustExec:n,type:i=NaN,overwriteIfSameType:a=!1,keepUndo:s=!1}){if(n&&e(),this.#A)return;const o={cmd:e,undo:t,post:r,type:i};if(-1===this.#T)return this.#S.length>0&&(this.#S.length=0),this.#T=0,void this.#S.push(o);if(a&&this.#S[this.#T].type===i)return s&&(o.undo=this.#S[this.#T].undo),void(this.#S[this.#T]=o);const l=this.#T+1;l===this.#_?this.#S.splice(0,1):(this.#T=l,l<this.#S.length&&this.#S.splice(l)),this.#S.push(o)}undo(){if(-1===this.#T)return;this.#A=!0;const{undo:e,post:t}=this.#S[this.#T];e(),t?.(),this.#A=!1,this.#T-=1}redo(){if(this.#T<this.#S.length-1){this.#T+=1,this.#A=!0;const{cmd:e,post:t}=this.#S[this.#T];e(),t?.(),this.#A=!1}}hasSomethingToUndo(){return-1!==this.#T}hasSomethingToRedo(){return this.#T<this.#S.length-1}destroy(){this.#S=null}}class _t{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:t}=je.platform;for(const[r,n,i={}]of e)for(const e of r){const r=e.startsWith("mac+");t&&r?(this.callbacks.set(e.slice(4),{callback:n,options:i}),this.allKeys.add(e.split("+").at(-1))):t||r||(this.callbacks.set(e,{callback:n,options:i}),this.allKeys.add(e.split("+").at(-1)))}}#C(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const t=this.buffer.join("+");return this.buffer.length=0,t}exec(e,t){if(!this.allKeys.has(t.key))return;const r=this.callbacks.get(this.#C(t));if(!r)return;const{callback:n,options:{bubbles:i=!1,args:a=[],checker:s=null}}=r;s&&!s(e,t)||(n.bind(e,...a,t)(),i||(t.stopPropagation(),t.preventDefault()))}}class Tt{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return function(e){const t=document.createElement("span");t.style.visibility="hidden",document.body.append(t);for(const r of e.keys()){t.style.color=r;const n=window.getComputedStyle(t).color;e.set(r,ft(n))}t.remove()}(e),_e(this,"_colors",e)}convert(e){const t=ft(e);if(!window.matchMedia("(forced-colors: active)").matches)return t;for(const[e,r]of this._colors)if(r.every((e,r)=>e===t[r]))return Tt._colorsMapping.get(e);return t}getHexCode(e){const t=this._colors.get(e);return t?He.makeHexColor(...t):e}}class Ct{#P=new AbortController;#R=null;#O=new Map;#D=new Map;#k=null;#M=null;#L=null;#I=new At;#N=null;#j=0;#F=new Set;#H=null;#B=null;#z=new Set;#$=!1;#U=!1;#W=!1;#V=null;#q=null;#Y=null;#G=null;#X=!1;#K=null;#J=new Et;#Q=!1;#Z=!1;#ee=null;#te=null;#re=null;#ne=null;#ie=I.NONE;#ae=new Set;#se=null;#oe=null;#le=null;#ce={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#ue=[0,0];#de=null;#he=null;#pe=null;#fe=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=Ct.prototype,t=e=>e.#he.contains(document.activeElement)&&"BUTTON"!==document.activeElement.tagName&&e.hasSomethingToControl(),r=(e,{target:t})=>{if(t instanceof HTMLInputElement){const{type:e}=t;return"text"!==e&&"number"!==e}return!0},n=this.TRANSLATE_SMALL,i=this.TRANSLATE_BIG;return _e(this,"_keyboardManager",new _t([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#he.contains(t)&&!e.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#he.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-n,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-i,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[n,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[i,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-n],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-i],checker:t}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,n],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,i],checker:t}]]))}constructor(e,t,r,n,i,a,s,o,l,c,u){const d=this._signal=this.#P.signal;this.#he=e,this.#pe=t,this.#k=r,this._eventBus=n,n._on("editingaction",this.onEditingAction.bind(this),{signal:d}),n._on("pagechanging",this.onPageChanging.bind(this),{signal:d}),n._on("scalechanging",this.onScaleChanging.bind(this),{signal:d}),n._on("rotationchanging",this.onRotationChanging.bind(this),{signal:d}),n._on("setpreference",this.onSetPreference.bind(this),{signal:d}),n._on("switchannotationeditorparams",e=>this.updateParams(e.type,e.value),{signal:d}),this.#ge(),this.#me(),this.#ve(),this.#M=i.annotationStorage,this.#V=i.filterFactory,this.#oe=a,this.#G=s||null,this.#$=o,this.#U=l,this.#W=c,this.#ne=u||null,this.viewParameters={realScale:et.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#fe?.resolve(),this.#fe=null,this.#P?.abort(),this.#P=null,this._signal=null;for(const e of this.#D.values())e.destroy();this.#D.clear(),this.#O.clear(),this.#z.clear(),this.#R=null,this.#ae.clear(),this.#I.destroy(),this.#k?.destroy(),this.#K?.hide(),this.#K=null,this.#q&&(clearTimeout(this.#q),this.#q=null),this.#de&&(clearTimeout(this.#de),this.#de=null)}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#ne}get useNewAltTextFlow(){return this.#U}get useNewAltTextWhenAddingImage(){return this.#W}get hcmFilter(){return _e(this,"hcmFilter",this.#oe?this.#V.addHCMFilter(this.#oe.foreground,this.#oe.background):"none")}get direction(){return _e(this,"direction",getComputedStyle(this.#he).direction)}get highlightColors(){return _e(this,"highlightColors",this.#G?new Map(this.#G.split(",").map(e=>e.split("=").map(e=>e.trim()))):null)}get highlightColorNames(){return _e(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setMainHighlightColorPicker(e){this.#re=e}editAltText(e,t=!1){this.#k?.editAltText(this,e,t)}switchToMode(e,t){this._eventBus.on("annotationeditormodechanged",t,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch("setpreference",{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){if("enableNewAltTextWhenAddingImage"===e)this.#W=t}onPageChanging({pageNumber:e}){this.#j=e-1}focusMainContainer(){this.#he.focus()}findParent(e,t){for(const r of this.#D.values()){const{x:n,y:i,width:a,height:s}=r.div.getBoundingClientRect();if(e>=n&&e<=n+a&&t>=i&&t<=i+s)return r}return null}disableUserSelect(e=!1){this.#pe.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#z.add(e)}removeShouldRescale(e){this.#z.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*et.PDF_TO_CSS_UNITS;for(const e of this.#z)e.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#ye({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#be(e){const{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(const t of this.#D.values())if(t.hasTextLayer(e))return t;return null}highlightSelection(e=""){const t=document.getSelection();if(!t||t.isCollapsed)return;const{anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:a}=t,s=t.toString(),o=this.#ye(t).closest(".textLayer"),l=this.getSelectionBoxes(o);if(!l)return;t.empty();const c=this.#be(o),u=this.#ie===I.NONE,d=()=>{c?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:l,anchorNode:r,anchorOffset:n,focusNode:i,focusOffset:a,text:s}),u&&this.showAllEditors("highlight",!0,!0)};u?this.switchToMode(I.HIGHLIGHT,d):d()}#we(){const e=document.getSelection();if(!e||e.isCollapsed)return;const t=this.#ye(e).closest(".textLayer"),r=this.getSelectionBoxes(t);r&&(this.#K||=new wt(this),this.#K.show(t,r,"ltr"===this.direction))}addToAnnotationStorage(e){e.isEmpty()||!this.#M||this.#M.has(e.id)||this.#M.setValue(e.id,e)}#xe(){const e=document.getSelection();if(!e||e.isCollapsed)return void(this.#se&&(this.#K?.hide(),this.#se=null,this.#Ee({hasSelectedText:!1})));const{anchorNode:t}=e;if(t===this.#se)return;const r=this.#ye(e).closest(".textLayer");if(r){if(this.#K?.hide(),this.#se=t,this.#Ee({hasSelectedText:!0}),(this.#ie===I.HIGHLIGHT||this.#ie===I.NONE)&&(this.#ie===I.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#X=this.isShiftKeyDown,!this.isShiftKeyDown)){const e=this.#ie===I.HIGHLIGHT?this.#be(r):null;e?.toggleDrawing();const t=new AbortController,n=this.combinedSignal(t),i=r=>{"pointerup"===r.type&&0!==r.button||(t.abort(),e?.toggleDrawing(!0),"pointerup"===r.type&&this.#Se("main_toolbar"))};window.addEventListener("pointerup",i,{signal:n}),window.addEventListener("blur",i,{signal:n})}}else this.#se&&(this.#K?.hide(),this.#se=null,this.#Ee({hasSelectedText:!1}))}#Se(e=""){this.#ie===I.HIGHLIGHT?this.highlightSelection(e):this.#$&&this.#we()}#ge(){document.addEventListener("selectionchange",this.#xe.bind(this),{signal:this._signal})}#Ae(){if(this.#Y)return;this.#Y=new AbortController;const e=this.combinedSignal(this.#Y);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#_e(){this.#Y?.abort(),this.#Y=null}blur(){if(this.isShiftKeyDown=!1,this.#X&&(this.#X=!1,this.#Se("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const t of this.#ae)if(t.div.contains(e)){this.#te=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#te)return;const[e,t]=this.#te;this.#te=null,t.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#ve(){if(this.#ee)return;this.#ee=new AbortController;const e=this.combinedSignal(this.#ee);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#Te(){this.#ee?.abort(),this.#ee=null}#Ce(){if(this.#N)return;this.#N=new AbortController;const e=this.combinedSignal(this.#N);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#Pe(){this.#N?.abort(),this.#N=null}#me(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#ve(),this.#Ce()}removeEditListeners(){this.#Te(),this.#Pe()}dragOver(e){for(const{type:t}of e.dataTransfer.items)for(const r of this.#B)if(r.isHandlingMimeForPasting(t))return e.dataTransfer.dropEffect="copy",void e.preventDefault()}drop(e){for(const t of e.dataTransfer.items)for(const r of this.#B)if(r.isHandlingMimeForPasting(t.type))return r.paste(t,this.currentLayer),void e.preventDefault()}copy(e){if(e.preventDefault(),this.#R?.commitOrRemove(),!this.hasSelection)return;const t=[];for(const e of this.#ae){const r=e.serialize(!0);r&&t.push(r)}0!==t.length&&e.clipboardData.setData("application/pdfjs",JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:t}=e;for(const e of t.items)for(const t of this.#B)if(t.isHandlingMimeForPasting(e.type))return void t.paste(e,this.currentLayer);let r=t.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(e){return void xe(`paste: "${e.message}".`)}if(!Array.isArray(r))return;this.unselectAll();const n=this.currentLayer;try{const e=[];for(const t of r){const r=await n.deserialize(t);if(!r)return;e.push(r)}const t=()=>{for(const t of e)this.#Re(t);this.#Oe(e)},i=()=>{for(const t of e)t.remove()};this.addCommands({cmd:t,undo:i,mustExec:!0})}catch(e){xe(`paste: "${e.message}".`)}}keydown(e){this.isShiftKeyDown||"Shift"!==e.key||(this.isShiftKeyDown=!0),this.#ie===I.NONE||this.isEditorHandlingKeyboard||Ct._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&"Shift"===e.key&&(this.isShiftKeyDown=!1,this.#X&&(this.#X=!1,this.#Se("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu")}}#Ee(e){Object.entries(e).some(([e,t])=>this.#ce[e]!==t)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#ce,e)}),this.#ie===I.HIGHLIGHT&&!1===e.hasSelectedEditor&&this.#De([[N.HIGHLIGHT_FREE,!0]]))}#De(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#Ae(),this.#Ce(),this.#Ee({isEditing:this.#ie!==I.NONE,isEmpty:this.#ke(),hasSomethingToUndo:this.#I.hasSomethingToUndo(),hasSomethingToRedo:this.#I.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#_e(),this.#Pe(),this.#Ee({isEditing:!1}),this.disableUserSelect(!1))}
vendor: 4,331 bytes, line 22
22registerEditorTypes(e){if(!this.#B){this.#B=e;for(const e of this.#B)this.#De(e.defaultPropertiesToUpdate)}}getId(){return this.#J.id}get currentLayer(){return this.#D.get(this.#j)}getLayer(e){return this.#D.get(e)}get currentPageIndex(){return this.#j}addLayer(e){this.#D.set(e.pageIndex,e),this.#Q?e.enable():e.disable()}removeLayer(e){this.#D.delete(e.pageIndex)}async updateMode(e,t=null,r=!1){if(this.#ie!==e&&(!this.#fe||(await this.#fe.promise,this.#fe))){if(this.#fe=Promise.withResolvers(),this.#ie=e,e===I.NONE)return this.setEditingState(!1),this.#Me(),void this.#fe.resolve();this.setEditingState(!0),await this.#Le(),this.unselectAll();for(const t of this.#D.values())t.updateMode(e);if(!t)return r&&this.addNewEditorFromKeyboard(),void this.#fe.resolve();for(const e of this.#O.values())e.annotationElementId===t?(this.setSelected(e),e.enterInEditMode()):e.unselect();this.#fe.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==this.#ie&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,t){if(this.#B){switch(e){case N.CREATE:return void this.currentLayer.addNewEditor();case N.HIGHLIGHT_DEFAULT_COLOR:this.#re?.updateColor(t);break;case N.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#le||=new Map).set(e,t),this.showAllEditors("highlight",t)}for(const r of this.#ae)r.updateParams(e,t);for(const r of this.#B)r.updateDefaultParams(e,t)}}showAllEditors(e,t,r=!1){for(const r of this.#O.values())r.editorType===e&&r.show(t);(this.#le?.get(N.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#De([[N.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#Z!==e){this.#Z=e;for(const t of this.#D.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle("waiting",e)}}async#Le(){if(!this.#Q){this.#Q=!0;const e=[];for(const t of this.#D.values())e.push(t.enable());await Promise.all(e);for(const e of this.#O.values())e.enable()}}#Me(){if(this.unselectAll(),this.#Q){this.#Q=!1;for(const e of this.#D.values())e.disable();for(const e of this.#O.values())e.disable()}}getEditors(e){const t=[];for(const r of this.#O.values())r.pageIndex===e&&t.push(r);return t}getEditor(e){return this.#O.get(e)}addEditor(e){this.#O.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#q&&clearTimeout(this.#q),this.#q=setTimeout(()=>{this.focusMainContainer(),this.#q=null},0)),this.#O.delete(e.id),this.unselect(e),e.annotationElementId&&this.#F.has(e.annotationElementId)||this.#M?.remove(e.id)}addDeletedAnnotationElement(e){this.#F.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#F.has(e)}removeDeletedAnnotationElement(e){this.#F.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#Re(e){const t=this.#D.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#R!==e&&(this.#R=e,e&&this.#De(e.propertiesToUpdate))}get#Ie(){let e=null;for(e of this.#ae);return e}updateUI(e){this.#Ie===e&&this.#De(e.propertiesToUpdate)}toggleSelected(e){if(this.#ae.has(e))return this.#ae.delete(e),e.unselect(),void this.#Ee({hasSelectedEditor:this.hasSelection});this.#ae.add(e),e.select(),this.#De(e.propertiesToUpdate),this.#Ee({hasSelectedEditor:!0})}setSelected(e){for(const t of this.#ae)t!==e&&t.unselect();this.#ae.clear(),this.#ae.add(e),e.select(),this.#De(e.propertiesToUpdate),this.#Ee({hasSelectedEditor:!0})}isSelected(e){return this.#ae.has(e)}get firstSelectedEditor(){return this.#ae.values().next().value}unselect(e){e.unselect(),this.#ae.delete(e),this.#Ee({hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==this.#ae.size}get isEnterHandled(){return 1===this.#ae.size&&this.firstSelectedEditor.isEnterHandled}undo(){this.#I.undo(),this.#Ee({hasSomethingToUndo:this.#I.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#ke()})}redo(){this.#I.redo(),this.#Ee({hasSomethingToUndo:!0,hasSomethingToRedo:this.#I.hasSomethingToRedo(),isEmpty:this.#ke()})}addCommands(e){this.#I.add(e),this.#Ee({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#ke()})}#ke(){if(0===this.#O.size)return!0;
vendor: 10,111 bytes, line 22
22if(1===this.#O.size)for(const e of this.#O.values())return e.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const e=[...this.#ae];this.addCommands({cmd:()=>{for(const t of e)t.remove()},undo:()=>{for(const t of e)this.#Re(t)},mustExec:!0})}commitOrRemove(){this.#R?.commitOrRemove()}hasSomethingToControl(){return this.#R||this.hasSelection}#Oe(e){for(const e of this.#ae)e.unselect();this.#ae.clear();for(const t of e)t.isEmpty()||(this.#ae.add(t),t.select());this.#Ee({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#ae)e.commit();this.#Oe(this.#O.values())}unselectAll(){if((!this.#R||(this.#R.commitOrRemove(),this.#ie===I.NONE))&&this.hasSelection){for(const e of this.#ae)e.unselect();this.#ae.clear(),this.#Ee({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;this.#ue[0]+=e,this.#ue[1]+=t;const[n,i]=this.#ue,a=[...this.#ae];this.#de&&clearTimeout(this.#de),this.#de=setTimeout(()=>{this.#de=null,this.#ue[0]=this.#ue[1]=0,this.addCommands({cmd:()=>{for(const e of a)this.#O.has(e.id)&&e.translateInPage(n,i)},undo:()=>{for(const e of a)this.#O.has(e.id)&&e.translateInPage(-n,-i)},mustExec:!1})},1e3);for(const r of a)r.translateInPage(e,t)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#H=new Map;for(const e of this.#ae)this.#H.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#H)return!1;this.disableUserSelect(!1);const e=this.#H;this.#H=null;let t=!1;for(const[{x:r,y:n,pageIndex:i},a]of e)a.newX=r,a.newY=n,a.newPageIndex=i,t||=r!==a.savedX||n!==a.savedY||i!==a.savedPageIndex;if(!t)return!1;const r=(e,t,r,n)=>{if(this.#O.has(e.id)){const i=this.#D.get(n);i?e._setParentAndPosition(i,t,r):(e.pageIndex=n,e.x=t,e.y=r)}};return this.addCommands({cmd:()=>{for(const[t,{newX:n,newY:i,newPageIndex:a}]of e)r(t,n,i,a)},undo:()=>{for(const[t,{savedX:n,savedY:i,savedPageIndex:a}]of e)r(t,n,i,a)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#H)for(const r of this.#H.keys())r.drag(e,t)}rebuild(e){if(null===e.parent){const t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||1===this.#ae.size&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#R===e}getActive(){return this.#R}getMode(){return this.#ie}get imageManager(){return _e(this,"imageManager",new St)}getSelectionBoxes(e){if(!e)return null;const t=document.getSelection();for(let r=0,n=t.rangeCount;r<n;r++)if(!e.contains(t.getRangeAt(r).commonAncestorContainer))return null;const{x:r,y:n,width:i,height:a}=e.getBoundingClientRect();let s;switch(e.getAttribute("data-main-rotation")){case"90":s=(e,t,s,o)=>({x:(t-n)/a,y:1-(e+s-r)/i,width:o/a,height:s/i});break;case"180":s=(e,t,s,o)=>({x:1-(e+s-r)/i,y:1-(t+o-n)/a,width:s/i,height:o/a});break;case"270":s=(e,t,s,o)=>({x:1-(t+o-n)/a,y:(e-r)/i,width:o/a,height:s/i});break;default:s=(e,t,s,o)=>({x:(e-r)/i,y:(t-n)/a,width:s/i,height:o/a})}const o=[];for(let e=0,r=t.rangeCount;e<r;e++){const r=t.getRangeAt(e);if(!r.collapsed)for(const{x:e,y:t,width:n,height:i}of r.getClientRects())0!==n&&0!==i&&o.push(s(e,t,n,i))}return 0===o.length?null:o}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#L||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#L?.delete(e)}renderAnnotationElement(e){const t=this.#L?.get(e.data.id);if(!t)return;const r=this.#M.getRawValue(t);r&&(this.#ie!==I.NONE||r.hasBeenModified)&&r.renderAnnotationElement(e)}}class Pt{#o=null;#Ne=!1;#je=null;#Fe=null;#He=null;#Be=null;#ze=!1;#$e=null;#a=null;#Ue=null;#We=null;#Ve=!1;static#qe=null;static _l10n=null;constructor(e){this.#a=e,this.#Ve=e._uiManager.useNewAltTextFlow,Pt.#qe||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(e){Pt._l10n??=e}async render(){const e=this.#je=document.createElement("button");e.className="altText",e.tabIndex="0";const t=this.#Fe=document.createElement("span");e.append(t),this.#Ve?(e.classList.add("new"),e.setAttribute("data-l10n-id",Pt.#qe.missing),t.setAttribute("data-l10n-id",Pt.#qe["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=this.#a._uiManager._signal;e.addEventListener("contextmenu",ut,{signal:r}),e.addEventListener("pointerdown",e=>e.stopPropagation(),{signal:r});const n=e=>{e.preventDefault(),this.#a._uiManager.editAltText(this.#a),this.#Ve&&this.#a._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#Ye}})};return e.addEventListener("click",n,{capture:!0,signal:r}),e.addEventListener("keydown",t=>{t.target===e&&"Enter"===t.key&&(this.#ze=!0,n(t))},{signal:r}),await this.#Ge(),e}get#Ye(){return(this.#o?"added":null===this.#o&&this.guessedText&&"review")||"missing"}finish(){this.#je&&(this.#je.focus({focusVisible:this.#ze}),this.#ze=!1)}isEmpty(){return this.#Ve?null===this.#o:!this.#o&&!this.#Ne}hasData(){return this.#Ve?null!==this.#o||!!this.#Ue:this.isEmpty()}get guessedText(){return this.#Ue}async setGuessedText(e){null===this.#o&&(this.#Ue=e,this.#We=await Pt._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),this.#Ge())}toggleAltTextBadge(e=!1){if(!this.#Ve||this.#o)return this.#$e?.remove(),void(this.#$e=null);if(!this.#$e){const e=this.#$e=document.createElement("div");e.className="noAltTextBadge",this.#a.div.append(e)}this.#$e.classList.toggle("hidden",!e)}serialize(e){let t=this.#o;return e||this.#Ue!==t||(t=this.#We),{altText:t,decorative:this.#Ne,guessedText:this.#Ue,textWithDisclaimer:this.#We}}get data(){return{altText:this.#o,decorative:this.#Ne}}set data({altText:e,decorative:t,guessedText:r,textWithDisclaimer:n,cancel:i=!1}){r&&(this.#Ue=r,this.#We=n),this.#o===e&&this.#Ne===t||(i||(this.#o=e,this.#Ne=t),this.#Ge())}toggle(e=!1){this.#je&&(!e&&this.#Be&&(clearTimeout(this.#Be),this.#Be=null),this.#je.disabled=!e)}shown(){this.#a._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#Ye}})}destroy(){this.#je?.remove(),this.#je=null,this.#Fe=null,this.#He=null,this.#$e?.remove(),this.#$e=null}async#Ge(){const e=this.#je;if(!e)return;if(this.#Ve){if(e.classList.toggle("done",!!this.#o),e.setAttribute("data-l10n-id",Pt.#qe[this.#Ye]),this.#Fe?.setAttribute("data-l10n-id",Pt.#qe[`${this.#Ye}-label`]),!this.#o)return void this.#He?.remove()}else{if(!this.#o&&!this.#Ne)return e.classList.remove("done"),void this.#He?.remove();e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let t=this.#He;if(!t){this.#He=t=document.createElement("span"),t.className="tooltip",t.setAttribute("role","tooltip"),t.id=`alt-text-tooltip-${this.#a.id}`;const r=100,n=this.#a._uiManager._signal;n.addEventListener("abort",()=>{clearTimeout(this.#Be),this.#Be=null},{once:!0}),e.addEventListener("mouseenter",()=>{this.#Be=setTimeout(()=>{this.#Be=null,this.#He.classList.add("show"),this.#a._reportTelemetry({action:"alt_text_tooltip"})},r)},{signal:n}),e.addEventListener("mouseleave",()=>{this.#Be&&(clearTimeout(this.#Be),this.#Be=null),this.#He?.classList.remove("show")},{signal:n})}this.#Ne?t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(t.removeAttribute("data-l10n-id"),t.textContent=this.#o),t.parentNode||e.append(t);const r=this.#a.getImageForAltText();r?.setAttribute("aria-describedby",t.id)}}class Rt{#Xe=null;#Ke=null;#o=null;#Je=!1;#Qe=!1;#Ze=null;#et=null;#tt=null;#rt="";#nt=!1;#it=null;#at=!1;#st=!1;#ot=!1;#lt=null;#ct=0;#ut=0;#dt=null;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#ht=!1;#pt=Rt._zIndex++;static _borderLineWidth=-1;static _colorManager=new Tt;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=Rt.prototype._resizeWithKeyboard,t=Ct.TRANSLATE_SMALL,r=Ct.TRANSLATE_BIG;return _e(this,"_resizerKeyboardManager",new _t([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],Rt.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;const{rotation:t,rawDims:{pageWidth:r,pageHeight:n,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,n],this.pageTranslation=[i,a];const[s,o]=this.parentDimensions;this.x=e.x/s,this.y=e.y/o,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return _e(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const t=new Ot({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}
vendor: 7,257 bytes, line 22
22static initialize(e,t){if(Rt._l10n??=e,Rt._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),-1!==Rt._borderLineWidth)return;const r=getComputedStyle(document.documentElement);Rt._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){Ee("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#ht}set _isDraggable(e){this.#ht=e,this.div?.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(2*e),this.y+=this.width*e/(2*t);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(2*e),this.y-=this.width*e/(2*t);break;default:this.x-=this.width/2,this.y-=this.height/2}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#pt}setParent(e){null!==e?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):this.#ft(),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#nt?this.#nt=!1:this.parent.setSelected(this))}focusout(e){if(!this._focusEventsAllowed)return;if(!this.isAttachedToDOM)return;const t=e.relatedTarget;t?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,r,n){const[i,a]=this.parentDimensions;[r,n]=this.screenToPageTranslation(r,n),this.x=(e+r)/i,this.y=(t+n)/a,this.fixAndSetPosition()}#gt([e,t],r,n){[r,n]=this.screenToPageTranslation(r,n),this.x+=r/e,this.y+=n/t,this.fixAndSetPosition()}translate(e,t){this.#gt(this.parentDimensions,e,t)}translateInPage(e,t){this.#it||=[this.x,this.y],this.#gt(this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}drag(e,t){this.#it||=[this.x,this.y];const[r,n]=this.parentDimensions;if(this.x+=e/r,this.y+=t/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:i,y:a}=this;const[s,o]=this.getBaseTranslation();i+=s,a+=o,this.div.style.left=`${(100*i).toFixed(2)}%`,this.div.style.top=`${(100*a).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#it&&(this.#it[0]!==this.x||this.#it[1]!==this.y)}getBaseTranslation(){const[e,t]=this.parentDimensions,{_borderLineWidth:r}=Rt,n=r/e,i=r/t;switch(this.rotation){case 90:return[-n,i];case 180:return[n,i];case 270:return[n,-i];default:return[-n,-i]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const[t,r]=this.pageDimensions;let{x:n,y:i,width:a,height:s}=this;if(a*=t,s*=r,n*=t,i*=r,this._mustFixPosition)switch(e){case 0:n=Math.max(0,Math.min(t-a,n)),i=Math.max(0,Math.min(r-s,i));break;case 90:n=Math.max(0,Math.min(t-s,n)),i=Math.min(r,Math.max(a,i));break;case 180:n=Math.min(t,Math.max(a,n)),i=Math.min(r,Math.max(s,i));break;case 270:n=Math.min(t,Math.max(s,n)),i=Math.max(0,Math.min(r-a,i))}this.x=n/=t,this.y=i/=r;const[o,l]=this.getBaseTranslation();n+=o,i+=l;const{style:c}=this.div;c.left=`${(100*n).toFixed(2)}%`,c.top=`${(100*i).toFixed(2)}%`,this.moveInDOM()}static#mt(e,t,r){switch(r){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(e,t){return Rt.#mt(e,t,this.parentRotation)}pageTranslationToScreen(e,t){return Rt.#mt(e,t,360-this.parentRotation)}#vt(e){switch(e){case 90:{const[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[t,r]}=this;return[t*e,r*e]}setDims(e,t){const[r,n]=this.parentDimensions;this.div.style.width=`${(100*e/r).toFixed(2)}%`,this.#Qe||(this.div.style.height=`${(100*t/n).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:t,width:r}=e,n=r.endsWith("%"),i=!this.#Qe&&t.endsWith("%");if(n&&i)return;const[a,s]=this.parentDimensions;n||(e.width=`${(100*parseFloat(r)/a).toFixed(2)}%`),this.#Qe||i||(e.height=`${(100*parseFloat(t)/s).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#yt(){if(this.#Ze)return;this.#Ze=document.createElement("div"),this.#Ze.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(const r of e){const e=document.createElement("div");this.#Ze.append(e),e.classList.add("resizer",r),e.setAttribute("data-resizer-name",r),e.addEventListener("pointerdown",this.#bt.bind(this,r),{signal:t}),e.addEventListener("contextmenu",ut,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#Ze)}#bt(e,t){t.preventDefault();const{isMac:r}=je.platform;if(0!==t.button||t.ctrlKey&&r)return;this.#o?.toggle(!1);const n=this._isDraggable;this._isDraggable=!1;const i=new AbortController,a=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#wt.bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener("contextmenu",ut,{signal:a});const s=this.x,o=this.y,l=this.width,c=this.height,u=this.parent.div.style.cursor,d=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;const h=()=>{i.abort(),this.parent.togglePointerEvents(!0),this.#o?.toggle(!0),this._isDraggable=n,this.parent.div.style.cursor=u,this.div.style.cursor=d,this.#xt(s,o,l,c)};window.addEventListener("pointerup",h,{signal:a}),window.addEventListener("blur",h,{signal:a})}#xt(e,t,r,n){const i=this.x,a=this.y,s=this.width,o=this.height;i===e&&a===t&&s===r&&o===n||this.addCommands({cmd:()=>{this.width=s,this.height=o,this.x=i,this.y=a;const[e,t]=this.parentDimensions;this.setDims(e*s,t*o),this.fixAndSetPosition()},undo:()=>{this.width=r,this.height=n,this.x=e,this.y=t;const[i,a]=this.parentDimensions;this.setDims(i*r,a*n),this.fixAndSetPosition()},mustExec:!0})}#wt(e,t){const[r,n]=this.parentDimensions,i=this.x,a=this.y,s=this.width,o=this.height,l=Rt.MIN_SIZE/r,c=Rt.MIN_SIZE/n,u=e=>Math.round(1e4*e)/1e4,d=this.#vt(this.rotation),h=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=this.#vt(360-this.rotation);let f,g,m=!1,v=!1;switch(e){case"topLeft":m=!0,f=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case"topMiddle":f=(e,t)=>
22[e/2,0],g=(e,t)=>[e/2,t];break;case"topRight":m=!0,f=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case"middleRight":v=!0,f=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case"bottomRight":m=!0,f=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case"bottomMiddle":f=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case"bottomLeft":m=!0,f=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case"middleLeft":v=!0,f=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2]}const y=f(s,o),b=g(s,o);let w=h(...b);const x=u(i+w[0]),E=u(a+w[1]);let S=1,A=1,[_,T]=this.screenToPageTranslation(t.movementX,t.movementY);var C,P;if([_,T]=(C=_/r,P=T/n,[p[0]*C+p[2]*P,p[1]*C+p[3]*P]),m){const e=Math.hypot(s,o);S=A=Math.max(Math.min(Math.hypot(b[0]-y[0]-_,b[1]-y[1]-T)/e,1/s,1/o),l/s,c/o)}else v?S=Math.max(l,Math.min(1,Math.abs(b[0]-y[0]-_)))/s:A=Math.max(c,Math.min(1,Math.abs(b[1]-y[1]-T)))/o;const R=u(s*S),O=u(o*A);w=h(...g(R,O));const D=x-w[0],k=E-w[1];this.width=R,this.height=O,this.x=D,this.y=k,this.setDims(r*R,n*O),this.fixAndSetPosition()}altTextFinish(){this.#o?.finish()}async addEditToolbar(){return this._editToolbar||this.#st||(this._editToolbar=new bt(this),this.div.append(this._editToolbar.render()),this.#o&&await this._editToolbar.addAltText(this.#o)),this._editToolbar}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#o?.destroy())}addContainer(e){const t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){this.#o||(Pt.initialize(Rt._l10n),this.#o=new Pt(this),this.#Xe&&(this.#o.data=this.#Xe,this.#Xe=null),await this.addEditToolbar())}get altTextData(){return this.#o?.data}set altTextData(e){this.#o&&(this.#o.data=e)}get guessedAltText(){return this.#o?.guessedText}async setGuessedAltText(e){await(this.#o?.setGuessedText(e))}serializeAltText(e){return this.#o?.serialize(e)}hasAltText(){return!!this.#o&&!this.#o.isEmpty()}hasAltTextData(){return this.#o?.hasData()??!1}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#Je?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.#Et();const[e,t]=this.parentDimensions;this.parentRotation%180!=0&&(this.div.style.maxWidth=`${(100*t/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/t).toFixed(2)}%`);const[r,n]=this.getInitialTranslation();return this.translate(r,n),xt(this,this.div,["pointerdown"]),this.div}pointerdown(e){const{isMac:t}=je.platform;0!==e.button||e.ctrlKey&&t?e.preventDefault():(this.#nt=!0,this._isDraggable?this.#St(e):this.#At(e))}get isSelected(){return this._uiManager.isSelected(this)}#At(e){const{isMac:t}=je.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#St(e){const{isSelected:t}=this;this._uiManager.setUpDragSession();const r=new AbortController,n=this._uiManager.combinedSignal(r);if(t){this.div.classList.add("moving"),this.#ct=e.clientX,this.#ut=e.clientY;const t=e=>{const{clientX:t,clientY:r}=e,[n,i]=this.screenToPageTranslation(t-this.#ct,r-this.#ut);this.#ct=t,this.#ut=r,this._uiManager.dragSelectedEditors(n,i)};window.addEventListener("pointermove",t,{passive:!0,capture:!0,signal:n})}const i=()=>{r.abort(),t&&this.div.classList.remove("moving"),this.#nt=!1,this._uiManager.endDragSession()||this.#At(e)};window.addEventListener("pointerup",i,{signal:n}),window.addEventListener("blur",i,{signal:n})}moveInDOM(){this.#lt&&clearTimeout(this.#lt),this.#lt=setTimeout(()=>{this.#lt=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,r){e.changeParent(this),this.x=t,this.y=r,this.fixAndSetPosition()}getRect(e,t,r=this.rotation){const n=this.parentScale,[i,a]=this.pageDimensions,[s,o]=this.pageTranslation,l=e/n,c=t/n,u=this.x*i,d=this.y*a,h=this.width*i,p=this.height*a;switch(r){case 0:return[u+l+s,a-d-c-p+o,u+l+h+s,a-d-c+o];case 90:return[u+c+s,a-d+l+o,u+c+p+s,a-d+l+h+o];case 180:return[u-l-h+s,a-d+c+o,u-l+s,a-d+c+p+o];case 270:return[u-c-p+s,a-d-l-h+o,u-c+s,a-d-l+o];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){const[r,n,i,a]=e,s=i-r,o=a-n;switch(this.rotation){case 0:return[r,t-a,s,o];case 90:return[r,t-n,o,s];case 180:return[i,t-n,s,o];case 270:return[i,t-a,o,s];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#st=!0}disableEditMode(){this.#st=!1}isInEditMode(){return this.#st}shouldGetKeyboardEvents(){return this.#ot}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}#Et(){if(this.#tt||!this.div)return;this.#tt=new AbortController;const e=this._uiManager.combinedSignal(this.#tt);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}
vendor: 9,973 bytes, line 22
22rebuild(){this.#Et()}rotate(e){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,t=null){Ee("An editor must be serializable")}static async deserialize(e,t,r){const n=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:r});n.rotation=e.rotation,n.#Xe=e.accessibilityData;const[i,a]=n.pageDimensions,[s,o,l,c]=n.getRectInCurrentCoords(e.rect,a);return n.x=s/i,n.y=o/a,n.width=l/i,n.height=c/a,n}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||null!==this.serialize())}remove(){if(this.#tt?.abort(),this.#tt=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#lt&&(clearTimeout(this.#lt),this.#lt=null),this.#ft(),this.removeEditToolbar(),this.#dt){for(const e of this.#dt.values())clearTimeout(e);this.#dt=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#yt(),this.#Ze.classList.remove("hidden"),xt(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||"Enter"!==e.key)return;this._uiManager.setSelected(this),this.#et={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const t=this.#Ze.children;if(!this.#Ke){this.#Ke=Array.from(t);const e=this.#_t.bind(this),r=this.#Tt.bind(this),n=this._uiManager._signal;for(const t of this.#Ke){const i=t.getAttribute("data-resizer-name");t.setAttribute("role","spinbutton"),t.addEventListener("keydown",e,{signal:n}),t.addEventListener("blur",r,{signal:n}),t.addEventListener("focus",this.#Ct.bind(this,i),{signal:n}),t.setAttribute("data-l10n-id",Rt._l10nResizer[i])}}const r=this.#Ke[0];let n=0;for(const e of t){if(e===r)break;n++}const i=(360-this.rotation+this.parentRotation)%360/90*(this.#Ke.length/4);if(i!==n){if(i<n)for(let e=0;e<n-i;e++)this.#Ze.append(this.#Ze.firstChild);else if(i>n)for(let e=0;e<i-n;e++)this.#Ze.firstChild.before(this.#Ze.lastChild);let e=0;for(const r of t){const t=this.#Ke[e++].getAttribute("data-resizer-name");r.setAttribute("data-l10n-id",Rt._l10nResizer[t])}}this.#Pt(0),this.#ot=!0,this.#Ze.firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#_t(e){Rt._resizerKeyboardManager.exec(this,e)}#Tt(e){this.#ot&&e.relatedTarget?.parentNode!==this.#Ze&&this.#ft()}#Ct(e){this.#rt=this.#ot?e:""}#Pt(e){if(this.#Ke)for(const t of this.#Ke)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#ot&&this.#wt(this.#rt,{movementX:e,movementY:t})}#ft(){if(this.#ot=!1,this.#Pt(-1),this.#et){const{savedX:e,savedY:t,savedWidth:r,savedHeight:n}=this.#et;this.#xt(e,t,r,n),this.#et=null}}_stopResizingWithKeyboard(){this.#ft(),this.div.focus()}select(){this.makeResizable(),this.div?.classList.add("selectedEditor"),this._editToolbar?(this._editToolbar?.show(),this.#o?.toggleAltTextBadge(!1)):this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()})}unselect(){this.#Ze?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#o?.toggleAltTextBadge(!0)}updateParams(e,t){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#at}set isEditing(e){this.#at=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){this.#Qe=!0;const r=e/t,{style:n}=this.div;n.aspectRatio=r,n.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){this.#dt||=new Map;const{action:t}=e;let r=this.#dt.get(t);return r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(e),this.#dt.delete(t),0===this.#dt.size&&(this.#dt=null)},Rt._telemetryTimeout),void this.#dt.set(t,r)}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#Je=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#Je=!0}renderAnnotationElement(e){let t=e.container.querySelector(".annotationContent");if(t){if("CANVAS"===t.nodeName){const e=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.before(t)}}else t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);return t}resetAnnotationElement(e){const{firstChild:t}=e.container;"DIV"===t?.nodeName&&t.classList.contains("annotationContent")&&t.remove()}}class Ot extends Rt{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const Dt=3285377520,kt=4294901760,Mt=65535;class Lt{constructor(e){this.h1=e?4294967295&e:Dt,this.h2=e?4294967295&e:Dt}update(e){let t,r;if("string"==typeof e){t=new Uint8Array(2*e.length),r=0;for(let n=0,i=e.length;n<i;n++){const i=e.charCodeAt(n);i<=255?t[r++]=i:(t[r++]=i>>>8,t[r++]=255&i)}}else{if(!ArrayBuffer.isView(e))throw new Error("Invalid data format, must be a string or TypedArray.");t=e.slice(),r=t.byteLength}const n=r>>2,i=r-4*n,a=new Uint32Array(t.buffer,0,n);let s=0,o=0,l=this.h1,c=this.h2;const u=3432918353,d=461845907,h=11601,p=13715;for(let e=0;e<n;e++)1&e?(s=a[e],s=s*u&kt|s*h&Mt,s=s<<15|s>>>17,s=s*d&kt|s*p&Mt,l^=s,l=l<<13|l>>>19,l=5*l+3864292196):(o=a[e],o=o*u&kt|o*h&Mt,o=o<<15|o>>>17,o=o*d&kt|o*p&Mt,c^=o,c=c<<13|c>>>19,c=5*c+3864292196);switch(s=0,i){case 3:s^=t[4*n+2]<<16;case 2:s^=t[4*n+1]<<8;case 1:s^=t[4*n],s=s*u&kt|s*h&Mt,s=s<<15|s>>>17,s=s*d&kt|s*p&Mt,1&n?l^=s:c^=s}this.h1=l,this.h2=c}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=3981806797*e&kt|36045*e&Mt,t=4283543511*t&kt|(2950163797*(t<<16|e>>>16)&kt)>>>16,e^=t>>>1,e=444984403*e&kt|60499*e&Mt,t=3301882366*t&kt|(3120437893*(t<<16|e>>>16)&kt)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}}const It=Object.freeze({map:null,hash:"",transfer:void 0});class Nt{#Rt=!1;#Ot=null;#Dt=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){const r=this.#Dt.get(e);return void 0===r?t:Object.assign(t,r)}getRawValue(e){return this.#Dt.get(e)}remove(e){if(this.#Dt.delete(e),0===this.#Dt.size&&this.resetModified(),"function"==typeof this.onAnnotationEditor){for(const e of this.#Dt.values())if(e instanceof Rt)return;this.onAnnotationEditor(null)}}setValue(e,t){const r=this.#Dt.get(e);let n=!1;if(void 0!==r)for(const[e,i]of Object.entries(t))r[e]!==i&&(n=!0,r[e]=i);else n=!0,this.#Dt.set(e,t);n&&this.#kt(),t instanceof Rt&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#Dt.has(e)}getAll(){return this.#Dt.size>0?Ne(this.#Dt):null}setAll(e){for(const[t,r]of Object.entries(e))this.setValue(t,r)}get size(){return this.#Dt.size}#kt(){this.#Rt||(this.#Rt=!0,"function"==typeof this.onSetModified&&this.onSetModified())}resetModified(){this.#Rt&&(this.#Rt=!1,"function"==typeof this.onResetModified&&this.onResetModified())}get print(){return new jt(this)}get serializable(){if(0===this.#Dt.size)return It;const e=new Map,t=new Lt,r=[],n=Object.create(null);let i=!1;for(const[r,a]of this.#Dt){const s=a instanceof Rt?a.serialize(!1,n):a;s&&(e.set(r,s),t.update(`${r}:${JSON.stringify(s)}`),i||=!!s.bitmap)}if(i)for(const t of e.values())t.bitmap&&r.push(t.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:r}:It}get editorStats(){let e=null;const t=new Map;for(const r of this.#Dt.values()){if(!(r instanceof Rt))continue;const n=r.telemetryFinalData;if(!n)continue;const{type:i}=n;t.has(i)||t.set(i,Object.getPrototypeOf(r).constructor),e||=Object.create(null);const a=e[i]||=new Map;for(const[e,t]of Object.entries(n)){if("type"===e)continue;let r=a.get(e);r||(r=new Map,a.set(e,r));const n=r.get(t)??0;r.set(t,n+1)}}for(const[r,n]of t)e[r]=n.computeTelemetryFinalData(e[r]);return e}resetModifiedIds(){this.#Ot=null}get modifiedIds(){if(this.#Ot)return this.#Ot;const e=[];for(const t of this.#Dt.values())t instanceof Rt&&t.annotationElementId&&t.serialize()&&e.push(t.annotationElementId);return this.#Ot={ids:new Set(e),hash:e.join(",")}}}class jt extends Nt{#Mt;constructor(e){super();const{map:t,hash:r,transfer:n}=e.serializable,i=structuredClone(t,n?{transfer:n}:null);this.#Mt={map:i,hash:r,transfer:n}}get print(){Ee("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#Mt}get modifiedIds(){return _e(this,"modifiedIds",{ids:new Set,hash:""})}}class Ft{#Lt=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#Lt.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:t}){if(e&&!this.#Lt.has(e.loadedName)){if(Se(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:n,style:i}=e,a=new FontFace(r,n,i);
vendor: 5,635 bytes, line 22
22this.addNativeFontFace(a);try{await a.load(),this.#Lt.add(r),t?.(e)}catch{xe(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}Ee("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo)return void await this.loadSystemFont(e);if(this.isFontLoadingAPISupported){const t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(r){throw xe(`Failed to load font '${t.family}': '${r}'.`),e.disableFontFace=!0,r}}return}const t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(t=>{const r=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,r)})}}get isFontLoadingAPISupported(){return _e(this,"isFontLoadingAPISupported",!!this._document?.fonts)}get isSyncFontLoadingSupported(){let e=!1;return(E||"undefined"!=typeof navigator&&"string"==typeof navigator?.userAgent&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),_e(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){const{loadingRequests:t}=this,r={done:!1,complete:function(){for(Se(!r.done,"completeRequest() cannot be called twice."),r.done=!0;t.length>0&&t[0].done;){const e=t.shift();setTimeout(e.callback,0)}},callback:e};return t.push(r),r}get _loadTestFont(){return _e(this,"_loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))}_prepareFontLoadEvent(e,t){function r(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|255&e.charCodeAt(t+3)}function n(e,t,r,n){return e.substring(0,t)+n+e.substring(t+r)}let i,a;const s=this._document.createElement("canvas");s.width=1,s.height=1;const o=s.getContext("2d");let l=0;const c=`lt${Date.now()}${this.loadTestFontId++}`;let u=this._loadTestFont;u=n(u,976,c.length,c);const d=1482184792;let h=r(u,16);for(i=0,a=c.length-3;i<a;i+=4)h=h-d+r(c,i)|0;var p;i<c.length&&(h=h-d+r(c+"XXX",i)|0),u=n(u,16,4,(p=h,String.fromCharCode(p>>24&255,p>>16&255,p>>8&255,255&p)));const f=`@font-face {font-family:"${c}";src:${`url(data:font/opentype;base64,${btoa(u)});`}}`;this.insertRule(f);const g=this._document.createElement("div");g.style.visibility="hidden",g.style.width=g.style.height="10px",g.style.position="absolute",g.style.top=g.style.left="0px";for(const t of[e.loadedName,c]){const e=this._document.createElement("span");e.textContent="Hi",e.style.fontFamily=t,g.append(e)}this._document.body.append(g),function e(t,r){if(++l>30)return xe("Load test font never loaded."),void r();o.font="30px "+t,o.fillText(".",0,20),o.getImageData(0,0,1,1).data[3]>0?r():setTimeout(e.bind(null,t,r))}(c,()=>{g.remove(),t.complete()})}}class Ht{constructor(e,{disableFontFace:t=!1,inspectFont:r=null}){this.compiledGlyphs=Object.create(null);for(const t in e)this[t]=e[t];this.disableFontFace=!0===t,this._inspectFont=r}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${t=this.data,Uint8Array.prototype.toBase64?t.toBase64():btoa(Le(t))});`;var t;let r;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${e}}`}else r=`@font-face {font-family:"${this.loadedName}";src:${e}}`;return this._inspectFont?.(this,e),r}getPathGenerator(e,t){if(void 0!==this.compiledGlyphs[t])return this.compiledGlyphs[t];let r;try{r=e.get(this.loadedName+"_path_"+t)}catch(e){xe(`getPathGenerator - ignoring character: "${e}".`)}if(!Array.isArray(r)||0===r.length)return this.compiledGlyphs[t]=function(e,t){};const n=[];for(let e=0,t=r.length;e<t;
22)switch(r[e++]){case We:{const[t,i,a,s,o,l]=r.slice(e,e+6);n.push(e=>e.bezierCurveTo(t,i,a,s,o,l)),e+=6}break;case Ve:{const[t,i]=r.slice(e,e+2);n.push(e=>e.moveTo(t,i)),e+=2}break;case qe:{const[t,i]=r.slice(e,e+2);n.push(e=>e.lineTo(t,i)),e+=2}break;case Ye:{const[t,i,a,s]=r.slice(e,e+4);n.push(e=>e.quadraticCurveTo(t,i,a,s)),e+=4}break;case Ge:n.push(e=>e.restore());break;case Xe:n.push(e=>e.save());break;case Ke:Se(2===n.length,"Scale command is only valid at the third position.");break;case Je:{const[t,i,a,s,o,l]=r.slice(e,e+6);n.push(e=>e.transform(t,i,a,s,o,l)),e+=6}break;case Qe:{const[t,i]=r.slice(e,e+2);n.push(e=>e.translate(t,i)),e+=2}}return this.compiledGlyphs[t]=function(e,t){n[0](e),n[1](e),e.scale(t,-t);for(let t=2,r=n.length;t<r;t++)n[t](e)}}}class Bt{#It=!1;constructor({enableHWA:e=!1}){this.#It=e}create(e,t){if(e<=0||t<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,t);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!this.#It})}}reset(e,t,r){if(!e.canvas)throw new Error("Canvas is not specified");if(t<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=t,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){Ee("Abstract method `_createCanvas` called.")}}class zt{constructor({baseUrl:e=null,isCompressed:t=!0}){this.baseUrl=e,this.isCompressed=t}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const t=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(t).then(e=>({cMapData:e,isCompressed:this.isCompressed})).catch(e=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${t}`)})}async _fetch(e){Ee("Abstract method `_fetch` called.")}}class $t extends zt{async _fetch(e){const t=await tt(e,this.isCompressed?"arraybuffer":"text");return t instanceof ArrayBuffer?new Uint8Array(t):Ie(t)}}class Ut{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,r,n,i){return"none"}destroy(e=!1){}}class Wt{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const t=`${this.baseUrl}${e}`;return this._fetch(t).catch(e=>{throw new Error(`Unable to load font data at: ${t}`)})}async _fetch(e){Ee("Abstract method `_fetch` called.")}}class Vt extends Wt{async _fetch(e){const t=await tt(e,"arraybuffer");return new Uint8Array(t)}}if(E){var qt=Promise.withResolvers(),Yt=null;(async()=>{const e=await(import("fs")),t=await(import("http")),r=await(import("https")),n=await(import("url"));return new Map(Object.entries({fs:e,http:t,https:r,url:n,canvas:void 0,path2d:void 0}))})().then(e=>{Yt=e,qt.resolve()},e=>{xe(`loadPackages: ${e}`),Yt=new Map,qt.resolve()})}class Gt{static get promise(){return qt.promise}static get(e){return Yt?.get(e)}}async function Xt(e){const t=Gt.get("fs"),r=await t.promises.readFile(e);return new Uint8Array(r)}const Kt="Fill",Jt="Stroke",Qt="Shading";function Zt(e,t){if(!t)return;const r=t[2]-t[0],n=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],r,n),e.clip(i)}class er{getPattern(){Ee("Abstract method `getPattern` called.")}}class tr extends er{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;"axial"===this._type?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const e of this._colorStops)t.addColorStop(e[0],e[1]);return t}getPattern(e,t,r,n){let i;if(n===Jt||n===Kt){const a=t.current.getClippedPathBoundingBox(n,gt(e))||[0,0,0,0],s=Math.ceil(a[2]-a[0])||1,o=Math.ceil(a[3]-a[1])||1,l=t.cachedCanvases.getCanvas("pattern",s,o),c=l.context;c.clearRect(0,0,c.canvas.width,c.canvas.height),c.beginPath(),c.rect(0,0,c.canvas.width,c.canvas.height),c.translate(-a[0],-a[1]),r
vendor: 4,359 bytes, line 22
22=He.transform(r,[1,0,0,1,a[0],a[1]]),c.transform(...t.baseTransform),this.matrix&&c.transform(...this.matrix),Zt(c,this._bbox),c.fillStyle=this._createGradient(c),c.fill(),i=e.createPattern(l.canvas,"no-repeat");const u=new DOMMatrix(r);i.setTransform(u)}else Zt(e,this._bbox),i=this._createGradient(e);return i}}function rr(e,t,r,n,i,a,s,o){const l=t.coords,c=t.colors,u=e.data,d=4*e.width;let h;l[r+1]>l[n+1]&&(h=r,r=n,n=h,h=a,a=s,s=h),l[n+1]>l[i+1]&&(h=n,n=i,i=h,h=s,s=o,o=h),l[r+1]>l[n+1]&&(h=r,r=n,n=h,h=a,a=s,s=h);const p=(l[r]+t.offsetX)*t.scaleX,f=(l[r+1]+t.offsetY)*t.scaleY,g=(l[n]+t.offsetX)*t.scaleX,m=(l[n+1]+t.offsetY)*t.scaleY,v=(l[i]+t.offsetX)*t.scaleX,y=(l[i+1]+t.offsetY)*t.scaleY;if(f>=y)return;const b=c[a],w=c[a+1],x=c[a+2],E=c[s],S=c[s+1],A=c[s+2],_=c[o],T=c[o+1],C=c[o+2],P=Math.round(f),R=Math.round(y);let O,D,k,M,L,I,N,j;for(let e=P;e<=R;e++){if(e<m){const t=e<f?0:(f-e)/(f-m);O=p-(p-g)*t,D=b-(b-E)*t,k=w-(w-S)*t,M=x-(x-A)*t}else{let t;t=e>y?1:m===y?0:(m-e)/(m-y),O=g-(g-v)*t,D=E-(E-_)*t,k=S-(S-T)*t,M=A-(A-C)*t}let t;t=e<f?0:e>y?1:(f-e)/(f-y),L=p-(p-v)*t,I=b-(b-_)*t,N=w-(w-T)*t,j=x-(x-C)*t;const r=Math.round(Math.min(O,L)),n=Math.round(Math.max(O,L));let i=d*e+4*r;for(let e=r;e<=n;e++)t=(O-e)/(O-L),t<0?t=0:t>1&&(t=1),u[i++]=D-(D-I)*t|0,u[i++]=k-(k-N)*t|0,u[i++]=M-(M-j)*t|0,u[i++]=255}}function nr(e,t,r){const n=t.coords,i=t.colors;let a,s;switch(t.type){case"lattice":const o=t.verticesPerRow,l=Math.floor(n.length/o)-1,c=o-1;for(a=0;a<l;a++){let t=a*o;for(let a=0;a<c;a++,t++)rr(e,r,n[t],n[t+1],n[t+o],i[t],i[t+1],i[t+o]),rr(e,r,n[t+o+1],n[t+1],n[t+o],i[t+o+1],i[t+1],i[t+o])}break;case"triangles":for(a=0,s=n.length;a<s;a+=3)rr(e,r,n[a],n[a+1],n[a+2],i[a],i[a+1],i[a+2]);break;default:throw new Error("illegal figure")}}class ir extends er{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[7],this._background=e[8],this.matrix=null}_createMeshCanvas(e,t,r){const n=Math.floor(this._bounds[0]),i=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-n,s=Math.ceil(this._bounds[3])-i,o=Math.min(Math.ceil(Math.abs(a*e[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(s*e[1]*1.1)),3e3),c=a/o,u=s/l,d={coords:this._coords,colors:this._colors,offsetX:-n,offsetY:-i,scaleX:1/c,scaleY:1/u},h=o+4,p=l+4,f=r.getCanvas("mesh",h,p),g=f.context,m=g.createImageData(o,l);if(t){const e=m.data;for(let r=0,n=e.length;r<n;r+=4)e[r]=t[0],e[r+1]=t[1],e[r+2]=t[2],e[r+3]=255}for(const e of this._figures)nr(m,e,d);g.putImageData(m,2,2);return{canvas:f.canvas,offsetX:n-2*c,offsetY:i-2*u,scaleX:c,scaleY:u}}getPattern(e,t,r,n){let i;if(Zt(e,this._bbox),n===Qt)i=He.singularValueDecompose2dScale(gt(e));else if(i=He.singularValueDecompose2dScale(t.baseTransform),this.matrix){const e=He.singularValueDecompose2dScale(this.matrix);i=[i[0]*e[0],i[1]*e[1]]}const a=this._createMeshCanvas(i,n===Qt?null:this._background,t.cachedCanvases);return n!==Qt&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY),e.createPattern(a.canvas,"no-repeat")}}class ar extends er{getPattern(){return"hotpink"}}const sr=1,or=2;class lr{static MAX_PATTERN_SIZE=3e3;constructor(e,t,r,n,i){this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.color=t,this.ctx=r,this.canvasGraphicsFactory=n,this.baseTransform=i}createPatternCanvas(e){const{bbox:t,operatorList:r,paintType:n,tilingType:i,color:a,canvasGraphicsFactory:s}=this;let{xstep:o,ystep:l}=this;o=Math.abs(o),l=Math.abs(l),we("TilingType: "+i);const c=t[0],u=t[1],d=t[2],h=t[3],p=d-c,f=h-u,g=He.singularValueDecompose2dScale(this.matrix),m=He.singularValueDecompose2dScale(this.baseTransform),v=g[0]*m[0],y=g[1]*m[1];let b=p,w=f,x=!1,E=!1;const S=Math.ceil(o*v),A=Math.ceil(l*y);S>=Math.ceil(p*v)?b=o:x=!0,A>=Math.ceil(f*y)?w=l:E=!0;const _=this.getSizeAndScale(b,this.ctx.canvas.width,v),T=this.getSizeAndScale(w,this.ctx.canvas.height,y),C=e.cachedCanvases.getCanvas("pattern",_.size,T.size),P=C.context,R=s.createCanvasGraphics(P);if(R.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(R,n,a),P.translate(-_.scale*c,-T.scale*u),R.transform(_.scale,0,0,T.scale,0,0),P.save(),this.clipBbox(R,c,u,d,h),R.baseTransform=gt(R.ctx),R.executeOperatorList(r),R.endDrawing(),P.restore(
22),x||E){const t=C.canvas;x&&(b=o),E&&(w=l);const r=this.getSizeAndScale(b,this.ctx.canvas.width,v),n=this.getSizeAndScale(w,this.ctx.canvas.height,y),i=r.size,a=n.size,s=e.cachedCanvases.getCanvas("pattern-workaround",i,a),d=s.context,h=x?Math.floor(p/o):0,g=E?Math.floor(f/l):0;for(let e=0;e<=h;e++)for(let r=0;r<=g;r++)d.drawImage(t,i*e,a*r,i,a,0,0,i,a);return{canvas:s.canvas,scaleX:r.scale,scaleY:n.scale,offsetX:c,offsetY:u}}return{canvas:C.canvas,scaleX:_.scale,scaleY:T.scale,offsetX:c,offsetY:u}}getSizeAndScale(e,t,r){const n=Math.max(lr.MAX_PATTERN_SIZE,t);let i=Math.ceil(e*r);return i>=n?i=n:r=i/e,{scale:r,size:i}}clipBbox(e,t,r,n,i){const a=n-t,s=i-r;e.ctx.rect(t,r,a,s),e.current.updateRectMinMax(gt(e.ctx),[t,r,n,i]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,t,r){const n=e.ctx,i=e.current;switch(t){case sr:const e=this.ctx;n.fillStyle=e.fillStyle,n.strokeStyle=e.strokeStyle,i.fillColor=e.fillStyle,i.strokeColor=e.strokeStyle;break;case or:const a=He.makeHexColor(r[0],r[1],r[2]);n.fillStyle=a,n.strokeStyle=a,i.fillColor=a,i.strokeColor=a;break;default:throw new ke(`Unsupported paint type: ${t}`)}}getPattern(e,t,r,n){let i=r;n!==Qt&&(i=He.transform(i,t.baseTransform),this.matrix&&(i=He.transform(i,this.matrix)));const a=this.createPatternCanvas(t);let s=new DOMMatrix(i);s=s.translate(a.offsetX,a.offsetY),s=s.scale(1/a.scaleX,1/a.scaleY);const o=e.createPattern(a.canvas,"repeat");return o.setTransform(s),o}}function cr({src:e,srcPos:t=0,dest:r,width:n,height:i,nonBlackColor:a=4294967295,inverseDecode:s=!1}){const o=je.isLittleEndian?4278190080:255,[l,c]=s?[a,o]:[o,a],u=n>>3,d=7&n,h=e.length;r=new Uint32Array(r.buffer);let p=0;for(let n=0;n<i;n++){for(const n=t+u;t<n;t++){const n=t<h?e[t]:255;r[p++]=128&n?c:l,r[p++]=64&n?c:l,r[p++]=32&n?c:l,r[p++]=16&n?c:l,r[p++]=8&n?c:l,r[p++]=4&n?c:l,r[p++]=2&n?c:l,r[p++]=1&n?c:l}if(0===d)continue;const n=t<h?e[t++]:255;for(let e=0;e<d;e++)r[p++]=n&1<<7-e?c:l}return{srcPos:t,destPos:p}}const ur=16;class dr{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,r){let n;return void 0!==this.cache[e]?(n=this.cache[e],this.canvasFactory.reset(n,t,r)):(n=this.canvasFactory.create(t,r),this.cache[e]=n),n}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}}function hr(e,t,r,n,i,a,s,o,l,c){const[u,d,h,p,f,g]=gt(e);if(0===d&&0===h){const m=s*u+f,v=Math.round(m),y=o*p+g,b=Math.round(y),w=(s+l)*u+f,x=Math.abs(Math.round(w)-v)||1,E=(o+c)*p+g,S=Math.abs(Math.round(E)-b)||1;return e.setTransform(Math.sign(u),0,0,Math.sign(p),v,b),e.drawImage(t,r,n,i,a,0,0,x,S),e.setTransform(u,d,h,p,f,g),[x,S]}if(0===u&&0===p){const m=o*h+f,v=Math.round(m),y=s*d+g,b=Math.round(y),w=(o+c)*h+f,x=Math.abs(Math.round(w)-v)||1,E=(s+l)*d+g,S=Math.abs(Math.round(E)-b)||1;return e.setTransform(0,Math.sign(d),Math.sign(h),0,v,b),e.drawImage(t,r,n,i,a,0,0,S,x),e.setTransform(u,d,h,p,f,g),[S,x]}e.drawImage(t,r,n,i,a,s,o,l,c);return[Math.hypot(u,d)*l,Math.hypot(h,p)*c]}class pr{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=S,this.textMatrixScale=1,this.fontMatrix=A,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=F,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,t])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,r){[t,r]=He.applyTransform([t,r],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,r),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,r)}updateRectMinMax(e,t){const r=He.applyTransform(t,e),n=He.applyTransform(t.slice(2),e),i=He.applyTransform([t[0],t[3]],e),a=He.applyTransform([t[2],t[1]],e);this.minX=Math.min(this.minX,r[0],n[0],i[0],a[0]),this.minY=Math.min(this.minY,r[1],n[1],i[1],a[1]),this.maxX=Math.max(this.maxX,r[0],n[0],i[0],a[0]),this.maxY=Math.max(this.maxY,r[1],n[1],i[1],a[1])}updateScalingPathMinMax(e,t){He.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.minY=Math.min(this.minY,t[1]),this.maxX=Math.max(this.maxX,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,r,n,i,a,s,o,l,c){const u=He.bezierBoundingBox(t,r,n,i,a,s,o,l,c);c||this.updateRectMinMax(e,u)}getPathBoundingBox(e=Kt,t=null){const r=[this.minX,this.minY,this.maxX,this.maxY];if(e===Jt){t||Ee("Stroke bounding box must include transform.");const e=He.singularValueDecompose2dScale(t),n=e[0]*this.lineWidth/2,i=e[1]*this.lineWidth/2;r[0]-=n,r[1]-=i,r[2]+=n,r[3]+=i}return r}updateClipFromPath(){const e=He.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=Kt,t=null){return He.intersect(this.clipBox,this.getPathBoundingBox(e,t))}}function fr(e,t){if("undefined"!=typeof ImageData&&t instanceof ImageData)return void e.putImageData(t,0,0);const r=t.height,n=t.width,i=r%ur,a=(r-i)/ur,s=0===i?a:a+1,o=e.createImageData(n,ur);let l,c=0;const u=t.data,d=o.data;let h,p,f,g;if(t.kind===W.GRAYSCALE_1BPP){const t=u.byteLength,r=new Uint32Array(d.buffer,0,d.byteLength>>2),g=r.length,m=n+7>>3,v=4294967295,y=je.isLittleEndian?4278190080:255;for(h=0;h<s;h++){for(f=h<a?ur:i,l=0,p=0;p<f;p++){const e=t-c;let i=0;const a=e>m?n:8*e-7,s=-8&a;let o=0,d=0;for(;i<s;i+=8)d=u[c++],r[l++]=128&d?v:y,r[l++]=64&d?v:y,r[l++]=32&d?v:y,r[l++]=16&d?v:y,r[l++]=8&d?v:y,r[l++]=4&d?v:y,r[l++]=2&d?v:y,r[l++]=1&d?v:y;for(;i<a;i++)0===o&&(d=u[c++],o=128),r[l++]=d&o?v:y,o>>=1}for(;l<g;
vendor: 9,223 bytes, line 22
22)r[l++]=0;e.putImageData(o,0,h*ur)}}else if(t.kind===W.RGBA_32BPP){for(p=0,g=n*ur*4,h=0;h<a;h++)d.set(u.subarray(c,c+g)),c+=g,e.putImageData(o,0,p),p+=ur;h<s&&(g=n*i*4,d.set(u.subarray(c,c+g)),e.putImageData(o,0,p))}else{if(t.kind!==W.RGB_24BPP)throw new Error(`bad image kind: ${t.kind}`);for(f=ur,g=n*f,h=0;h<s;h++){for(h>=a&&(f=i,g=n*f),l=0,p=g;p--;)d[l++]=u[c++],d[l++]=u[c++],d[l++]=u[c++],d[l++]=255;e.putImageData(o,0,h*ur)}}}function gr(e,t){if(t.bitmap)return void e.drawImage(t.bitmap,0,0);const r=t.height,n=t.width,i=r%ur,a=(r-i)/ur,s=0===i?a:a+1,o=e.createImageData(n,ur);let l=0;const c=t.data,u=o.data;for(let t=0;t<s;t++){const r=t<a?ur:i;({srcPos:l}=cr({src:c,srcPos:l,dest:u,width:n,height:r,nonBlackColor:0})),e.putImageData(o,0,t*ur)}}function mr(e,t){const r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const n of r)void 0!==e[n]&&(t[n]=e[n]);void 0!==e.setLineDash&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function vr(e){if(e.strokeStyle=e.fillStyle="#000000",e.fillRule="nonzero",e.globalAlpha=1,e.lineWidth=1,e.lineCap="butt",e.lineJoin="miter",e.miterLimit=10,e.globalCompositeOperation="source-over",e.font="10px sans-serif",void 0!==e.setLineDash&&(e.setLineDash([]),e.lineDashOffset=0),!E){const{filter:t}=e;"none"!==t&&""!==t&&(e.filter="none")}}function yr(e,t){if(t)return!0;const r=He.singularValueDecompose2dScale(e);r[0]=Math.fround(r[0]),r[1]=Math.fround(r[1]);const n=Math.fround((globalThis.devicePixelRatio||1)*et.PDF_TO_CSS_UNITS);return r[0]<=n&&r[1]<=n}const br=["butt","round","square"],wr=["miter","round","bevel"],xr={},Er={};class Sr{constructor(e,t,r,n,i,{optionalContentConfig:a,markedContentStack:s=null},o,l){this.ctx=e,this.current=new pr(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=t,this.objs=r,this.canvasFactory=n,this.filterFactory=i,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=s||[],this.optionalContentConfig=a,this.cachedCanvases=new dr(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=o,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=l,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,t=null){return"string"==typeof e?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):t}beginDrawing({transform:e,viewport:t,transparency:r=!1,background:n=null}){const i=this.ctx.canvas.width,a=this.ctx.canvas.height,s=this.ctx.fillStyle;if(this.ctx.fillStyle=n||"#ffffff",this.ctx.fillRect(0,0,i,a),this.ctx.fillStyle=s,r){const e=this.cachedCanvases.getCanvas("transparent",i,a);this.compositeCtx=this.ctx,this.transparentCanvas=e.canvas,this.ctx=e.context,this.ctx.save(),this.ctx.transform(...gt(this.compositeCtx))}this.ctx.save(),vr(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=gt(this.ctx)}executeOperatorList(e,t,r,n){const i=e.argsArray,a=e.fnArray;let s=t||0;const o=i.length;if(o===s)return s;const l=o-s>10&&"function"==typeof r,c=l?Date.now()+15:0;let u=0;const d=this.commonObjs,h=this.objs;let p;for(;;){if(void 0!==n&&s===n.nextBreakPoint)return n.breakIt(s,r),s;if(p=a[s],p!==ge.dependency)this[p].apply(this,i[s]);else for(const e of i[s]){const t=e.startsWith("g_")?d:h;if(!t.has(e))return t.get(e,r),s}if(s++,s===o)return s;if(l&&++u>10){if(Date.now()>c)return r(),s;u=0}}}#Nt(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,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)}endDrawing(){this.#Nt(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const t of e.values())"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#jt()}#jt(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if("none"!==e){const t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){const r=e.width??e.displayWidth,n=e.height??e.displayHeight;let i,a,s=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),l=r,c=n,u="prescale1";for(;s>2&&l>1||o>2&&c>1;){let t=l,r=c;s>2&&l>1&&(t=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l/2),s/=l/t),o>2&&c>1&&(r=c>=16384?Math.floor(c/2)-1||1:Math.ceil(c)/2,o/=c/r),i=this.cachedCanvases.getCanvas(u,t,r),a=i.context,a.clearRect(0,0,t,r),a.drawImage(e,0,0,l,c,0,0,t,r),e=i.canvas,l=t,c=r,u="prescale1"===u?"prescale2":"prescale1"}return{img:e,paintWidth:l,paintHeight:c}}_createMaskCanvas(e){const t=this.ctx,{width:r,height:n}=e,i=this.current.fillColor,a=this.current.patternFill,s=gt(t);let o,l,c,u;if((e.bitmap||e.data)&&e.count>1){const t=e.bitmap||e.data.buffer;l=JSON.stringify(a?s:[s.slice(0,4),i]),o=this._cachedBitmapsMap.get(t),o||(o=new Map,this._cachedBitmapsMap.set(t,o));const r=o.get(l);if(r&&!a){return{canvas:r,offsetX:Math.round(Math.min(s[0],s[2])+s[4]),offsetY:Math.round(Math.min(s[1],s[3])+s[5])}}c=r}c||(u=this.cachedCanvases.getCanvas("maskCanvas",r,n),gr(u.context,e));let d=He.transform(s,[1/r,0,0,-1/n,0,0]);d=He.transform(d,[1,0,0,1,0,-n]);const[h,p,f,g]=He.getAxialAlignedBoundingBox([0,0,r,n],d),m=Math.round(f-h)||1,v=Math.round(g-p)||1,y=this.cachedCanvases.getCanvas("fillCanvas",m,v),b=y.context,w=h,x=p;b.translate(-w,-x),b.transform(...d),c||(c=this._scaleImage(u.canvas,mt(b)),c=c.img,o&&a&&o.set(l,c)),b.imageSmoothingEnabled=yr(gt(b),e.interpolate),hr(b,c,0,0,c.width,c.height,0,0,r,n),b.globalCompositeOperation="source-in";const E=He.transform(mt(b),[1,0,0,1,-w,-x]);return b.fillStyle=a?i.getPattern(t,this,E,Kt):i,b.fillRect(0,0,r,n),o&&!a&&(this.cachedCanvases.delete("fillCanvas"),o.set(l,y.canvas)),{canvas:y.canvas,offsetX:Math.round(w),offsetY:Math.round(x)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=br[e]}setLineJoin(e){this.ctx.lineJoin=wr[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){const r=this.ctx;void 0!==r.setLineDash&&(r.setLineDash(e),r.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[t,r]of e)switch(t){case"LW":this.setLineWidth(r);break;case"LC":this.setLineCap(r);break;case"LJ":this.setLineJoin(r);break;case"ML":this.setMiterLimit(r);break;case"D":this.setDash(r[0],r[1]);break;case"RI":this.setRenderingIntent(r);break;case"FL":this.setFlatness(r);break;case"Font":this.setFont(r[0],r[1]);break;case"CA":this.current.strokeAlpha=r;break;case"ca":this.current.fillAlpha=r,this.ctx.globalAlpha=r;break;case"BM":this.ctx.globalCompositeOperation=r;break;case"SMask":this.current.activeSMask=r?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r)}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const e=this.ctx.canvas.width,t=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(r,e,t);this.suspendedCtx=this.ctx,this.ctx=n.context;const i=this.ctx;i.setTransform(...gt(this.suspendedCtx)),mr(this.suspendedCtx,i),function(e,t){if(e._removeMirroring)throw new Error("Context is already forwarding operations.");e.__originalSave=e.save,e.__originalRestore=e.restore,e.__originalRotate=e.rotate,e.__originalScale=e.scale,e.__originalTranslate=e.translate,e.__originalTransform=e.transform,e.__originalSetTransform=e.setTransform,e.__originalResetTransform=e.resetTransform,e.__originalClip=e.clip,e.__originalMoveTo=e.moveTo,e.__originalLineTo=e.lineTo,e.__originalBezierCurveTo=e.bezierCurveTo,e.__originalRect=e.rect,e.__originalClosePath=e.closePath,e.__originalBeginPath=e.beginPath,e._removeMirroring=()=>{e.save=e.__originalSave,e.restore=e.__originalRestore,e.rotate=e.__originalRotate,e.scale=e.__originalScale,e.translate=e.__originalTranslate,e.transform=e.__originalTransform,e.setTransform=e.__originalSetTransform,e.resetTransform=e.__originalResetTransform,e.clip=e.__originalClip,e.moveTo=e.__originalMoveTo,e.lineTo=e.__originalLineTo,e.bezierCurveTo=e.__originalBezierCurveTo,e.rect=e.__originalRect,e.closePath=e.__originalClosePath,e.beginPath=e.__originalBeginPath,delete e._removeMirroring},e.save=function(){t.save(),this.__originalSave()}
22,e.restore=function(){t.restore(),this.__originalRestore()},e.translate=function(e,r){t.translate(e,r),this.__originalTranslate(e,r)},e.scale=function(e,r){t.scale(e,r),this.__originalScale(e,r)},e.transform=function(e,r,n,i,a,s){t.transform(e,r,n,i,a,s),this.__originalTransform(e,r,n,i,a,s)},e.setTransform=function(e,r,n,i,a,s){t.setTransform(e,r,n,i,a,s),this.__originalSetTransform(e,r,n,i,a,s)},e.resetTransform=function(){t.resetTransform(),this.__originalResetTransform()},e.rotate=function(e){t.rotate(e),this.__originalRotate(e)},e.clip=function(e){t.clip(e),this.__originalClip(e)},e.moveTo=function(e,r){t.moveTo(e,r),this.__originalMoveTo(e,r)},e.lineTo=function(e,r){t.lineTo(e,r),this.__originalLineTo(e,r)},e.bezierCurveTo=function(e,r,n,i,a,s){t.bezierCurveTo(e,r,n,i,a,s),this.__originalBezierCurveTo(e,r,n,i,a,s)},e.rect=function(e,r,n,i){t.rect(e,r,n,i),this.__originalRect(e,r,n,i)},e.closePath=function(){t.closePath(),this.__originalClosePath()},e.beginPath=function(){t.beginPath(),this.__originalBeginPath()}}(i,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),mr(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const t=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,r,n){const i=n[0],a=n[1],s=n[2]-i,o=n[3]-a;0!==s&&0!==o&&(this.genericComposeSMask(t.context,r,s,o,t.subtype,t.backdrop,t.transferMap,i,a,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,0,0),e.restore())}genericComposeSMask(e,t,r,n,i,a,s,o,l,c,u){let d=e.canvas,h=o-c,p=l-u;if(a){const t=He.makeHexColor(...a);if(h<0||p<0||h+r>d.width||p+n>d.height){const e=this.cachedCanvases.getCanvas("maskExtension",r,n),i=e.context;i.drawImage(d,-h,-p),i.globalCompositeOperation="destination-atop",i.fillStyle=t,i.fillRect(0,0,r,n),i.globalCompositeOperation="source-over",d=e.canvas,h=p=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const i=new Path2D;i.rect(h,p,r,n),e.clip(i),e.globalCompositeOperation="destination-atop",e.fillStyle=t,e.fillRect(h,p,r,n),e.restore()}}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),"Alpha"===i&&s?t.filter=this.filterFactory.addAlphaFilter(s):"Luminosity"===i&&(t.filter=this.filterFactory.addLuminosityFilter(s));const f=new Path2D;f.rect(o,l,r,n),t.clip(f),t.globalCompositeOperation="destination-in",t.drawImage(d,h,p,r,n,o,l,r,n),t.restore()}save(){this.inSMaskMode?(mr(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode(),0!==this.stateStack.length&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),mr(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,r,n,i,a){this.ctx.transform(e,t,r,n,i,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,r){const n=this.ctx,i=this.current;let a,s,o=i.x,l=i.y;const c=gt(n),u=0===c[0]&&0===c[3]||0===c[1]&&0===c[2],d=u?r.slice(0):null;for(let r=0,h=0,p=e.length;r<p;r++)switch(0|e[r]){case ge.rectangle:o=t[h++],l=t[h++];const e=t[h++],r=t[h++],p=o+e,f=l+r;n.moveTo(o,l),0===e||0===r?n.lineTo(p,f):(n.lineTo(p,l),n.lineTo(p,f),n.lineTo(o,f)),u||i.updateRectMinMax(c,[o,l,p,f]),n.closePath();break;case ge.moveTo:o=t[h++],l=t[h++],n.moveTo(o,l),u||i.updatePathMinMax(c,o,l);break;case ge.lineTo:o=t[h++],l=t[h++],n.lineTo(o,l),u||i.updatePathMinMax(c,o,l);break;case ge.curveTo:a=o,s=l,o=t[h+4],l=t[h+5],n.bezierCurveTo(t[h],t[h+1],t[h+2],t[h+3],o,l),i.updateCurvePathMinMax(c,a,s,t[h],t[h+1],t[h+2],t[h+3],o,l,d),h+=6;break;case ge.curveTo2:a=o,s=l,n.bezierCurveTo(o,l,t[h],t[h+1],t[h+2],t[h+3]),i.updateCurvePathMinMax(c,a,s,o,l,t[h],t[h+1],t[h+2],t[h+3],d),o=t[h+2],l=t[h+3],h+=4;break;case ge.curveTo3:a=o,s=l,o=t[h+2],l=t[h+3],n.bezierCurveTo(t[h],t[h+1],o,l,o,l),i.updateCurvePathMinMax(c,a,s,t[h],t[h+1],o,l,o,l,d),h+=4;break;case ge.closePath:n.closePath()}u&&i.updateScalingPathMinMax(c,d),i.setCurrentPoint(o,l)}closePath(){this.ctx.closePath()}stroke(e=!0){const t=this.ctx,r=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha,this.contentVisible&&("object"==typeof r&&r?.getPattern?(t.save(),t.strokeStyle=r.getPattern(t,this,mt(t),Jt),this.rescaleAndStroke(!1),t.restore(
22)):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),t.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const t=this.ctx,r=this.current.fillColor;let n=!1;this.current.patternFill&&(t.save(),t.fillStyle=r.getPattern(t,this,mt(t),Kt),n=!0);const i=this.current.getClippedPathBoundingBox();this.contentVisible&&null!==i&&(this.pendingEOFill?(t.fill("evenodd"),this.pendingEOFill=!1):t.fill()),n&&t.restore(),e&&this.consumePath(i)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=xr}eoClip(){this.pendingClip=Er}beginText(){this.current.textMatrix=S,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,t=this.ctx;if(void 0!==e){t.save(),t.beginPath();for(const r of e)t.setTransform(...r.transform),t.translate(r.x,r.y),r.addToPath(t,r.fontSize);t.restore(),t.clip(),t.beginPath(),delete this.pendingTextPaths}else t.beginPath()}setCharSpacing(e){this.current.charSpacing=e}setWordSpacing(e){this.current.wordSpacing=e}setHScale(e){this.current.textHScale=e/100}setLeading(e){this.current.leading=-e}setFont(e,t){const r=this.commonObjs.get(e),n=this.current;if(!r)throw new Error(`Can't find font for ${e}`);if(n.fontMatrix=r.fontMatrix||A,0!==n.fontMatrix[0]&&0!==n.fontMatrix[3]||xe("Invalid font matrix for font "+e),t<0?(t=-t,n.fontDirection=-1):n.fontDirection=1,this.current.font=r,this.current.fontSize=t,r.isType3Font)return;const i=r.loadedName||"sans-serif",a=r.systemFontInfo?.css||`"${i}", ${r.fallbackName}`;let s="normal";r.black?s="900":r.bold&&(s="bold");const o=r.italic?"italic":"normal";let l=t;t<16?l=16:t>100&&(l=100),this.current.fontSizeScale=t/l,this.ctx.font=`${o} ${s} ${l}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,r,n,i,a){this.current.textMatrix=[e,t,r,n,i,a],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,r,n){const i=this.ctx,a=this.current,s=a.font,o=a.textRenderingMode,l=a.fontSize/a.fontSizeScale,c=o&$,u=!!(o&U),d=a.patternFill&&!s.missingFile;let h;if((s.disableFontFace||u||d)&&(h=s.getPathGenerator(this.commonObjs,e)),s.disableFontFace||d?(i.save(),i.translate(t,r),i.beginPath(),h(i,l),n&&i.setTransform(...n),c!==F&&c!==B||i.fill(),c!==H&&c!==B||i.stroke(),i.restore()):(c!==F&&c!==B||i.fillText(e,t,r),c!==H&&c!==B||i.strokeText(e,t,r)),u){(this.pendingTextPaths||=[]).push({transform:gt(i),x:t,y:r,fontSize:l,addToPath:h})}}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const t=e.getImageData(0,0,10,10).data;let r=!1;for(let e=3;e<t.length;e+=4)if(t[e]>0&&t[e]<255){r=!0;break}return _e(this,"isFontSubpixelAAEnabled",r)}showText(e){const t=this.current,r=t.font;if(r.isType3Font)return this.showType3Text(e);const n=t.fontSize;if(0===n)return;const i=this.ctx,a=t.fontSizeScale,s=t.charSpacing,o=t.wordSpacing,l=t.fontDirection,c=t.textHScale*l,u=e.length,d=r.vertical,h=d?1:-1,p=r.defaultVMetrics,f=n*t.fontMatrix[0],g=t.textRenderingMode===F&&!r.disableFontFace&&!t.patternFill;let m;if(i.save(),i.transform(...t.textMatrix),i.translate(t.x,t.y+t.textRise),l>0?i.scale(c,-1):i.scale(c,1),t.patternFill){i.save();const e=t.fillColor.getPattern(i,this,mt(i),Kt);m=gt(i),i.restore(),i.fillStyle=e}let v=t.lineWidth;const y=t.textMatrixScale;if(0===y||0===v){const e=t.textRenderingMode&$;e!==H&&e!==B||(v=this.getSinglePixelWidth())}else v/=y;
vendor: 1,048 bytes, line 22
22if(1!==a&&(i.scale(a,a),v/=a),i.lineWidth=v,r.isInvalidPDFjsFont){const r=[];let n=0;for(const t of e)r.push(t.unicode),n+=t.width;return i.fillText(r.join(""),0,0),t.x+=n*f*c,i.restore(),void this.compose()}let b,w=0;for(b=0;b<u;++b){const t=e[b];if("number"==typeof t){w+=h*t*n/1e3;continue}let c=!1;const u=(t.isSpace?o:0)+s,v=t.fontChar,y=t.accent;let x,E,S=t.width;if(d){const e=t.vmetric||p,r=-(t.vmetric?e[1]:.5*S)*f,n=e[2]*f;S=e?-e[0]:S,x=r/a,E=(w+n)/a}else x=w/a,E=0;if(r.remeasure&&S>0){const e=1e3*i.measureText(v).width/n*a;if(S<e&&this.isFontSubpixelAAEnabled){const t=S/e;c=!0,i.save(),i.scale(t,1),x/=t}else S!==e&&(x+=(S-e)/2e3*n/a)}if(this.contentVisible&&(t.isInFont||r.missingFile))if(g&&!y)i.fillText(v,x,E);else if(this.paintChar(v,x,E,m),y){const e=x+n*y.offset.x/a,t=E-n*y.offset.y/a;this.paintChar(y.fontChar,e,t,m)}w+=d?S*f-u*l:S*f+u*l,c&&i.restore()}d?t.y-=w:t.x+=w*c,i.restore(),this.compose()}showType3Text(e){const t=this.ctx,r=this.current,n=r.font,i=r.fontSize,a=r.fontDirection,s=n.vertical?1:-1,o=r.charSpacing,l=r.
22wordSpacing,c=r.textHScale*a,u=r.fontMatrix||A,d=e.length;let h,p,f,g;if(!(r.textRenderingMode===z)&&0!==i){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,t.save(),t.transform(...r.textMatrix),t.translate(r.x,r.y),t.scale(c,a),h=0;h<d;++h){if(p=e[h],"number"==typeof p){g=s*p*i/1e3,this.ctx.translate(g,0),r.x+=g*c;continue}const a=(p.isSpace?l:0)+o,d=n.charProcOperatorList[p.operatorListId];if(!d){xe(`Type3 character "${p.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=p,this.save(),t.scale(i,i),t.transform(...u),this.executeOperatorList(d),this.restore());f=He.applyTransform([p.width,0],u)[0]*i+a,t.translate(f,0),r.x+=f*c}t.restore(),this.processingType3=null}}setCharWidth(e,t){}setCharWidthAndBounds(e,t,r,n,i,a){this.ctx.rect(r,n,i-r,a-n),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let t;if("TilingPattern"===e[0]){const r=e[1],n=this.baseTransform||gt(this.ctx),i={createCanvasGraphics:e=>new Sr(e,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new lr(e,r,this.ctx,i,n)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,r){this.ctx.strokeStyle=this.current.strokeColor=He.makeHexColor(e,t,r)}
22setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent"}setFillRGBColor(e,t,r){this.ctx.fillStyle=this.current.fillColor=He.makeHexColor(e,t,r),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t=null){let r;return this.cachedPatterns.has(e)?r=this.cachedPatterns.get(e):(r=function(e){switch(e[0]){case"RadialAxial":return new tr(e);case"Mesh":return new ir(e);case"Dummy":return new ar}throw new Error(`Unknown IR type: ${e[0]}`)}(this.getObject(e)),this.cachedPatterns.set(e,r)),t&&(r.matrix=t),r}shadingFill(e){if(!this.contentVisible)return;const t=this.ctx;this.save();const r=this._getPattern(e);t.fillStyle=r.getPattern(t,this,mt(t),Qt);const n=mt(t);if(n){const{width:e,height:r}=t.canvas,[i,a,s,o]=He.getAxialAlignedBoundingBox([0,0,e,r],n);this.ctx.fillRect(i,a,s-i,o-a)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Ee("Should not call beginInlineImage")}beginImageData(){Ee("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=gt(this.ctx),t)){const e=t[2]-t[0],r=t[3]-t[1];this.ctx.rect(t[0],t[1],e,r),this.current.updateRectMinMax(gt(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const t=this.ctx;
vendor: 4,133 bytes, line 22
22e.isolated||we("TODO: Support non-isolated groups."),e.knockout&&xe("Knockout groups not supported.");const r=gt(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let n=He.getAxialAlignedBoundingBox(e.bbox,gt(t));const i=[0,0,t.canvas.width,t.canvas.height];n=He.intersect(n,i)||[0,0,0,0];const a=Math.floor(n[0]),s=Math.floor(n[1]),o=Math.max(Math.ceil(n[2])-a,1),l=Math.max(Math.ceil(n[3])-s,1);this.current.startNewPathAndClipBox([0,0,o,l]);let c="groupAt"+this.groupLevel;e.smask&&(c+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(c,o,l),d=u.context;d.translate(-a,-s),d.transform(...r),e.smask?this.smaskStack.push({canvas:u.canvas,context:d,offsetX:a,offsetY:s,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(a,s),t.save()),mr(t,d),this.ctx=d,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const t=this.ctx,r=this.groupStack.pop();if(this.ctx=r,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();const e=gt(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...e);const r=He.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],e);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(r)}}beginAnnotation(e,t,r,n,i){if(this.#Nt(),vr(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),t){const n=t[2]-t[0],a=t[3]-t[1];if(i&&this.annotationCanvasMap){(r=r.slice())[4]-=t[0],r[5]-=t[1],(t=t.slice())[0]=t[1]=0,t[2]=n,t[3]=a;const[i,s]=He.singularValueDecompose2dScale(gt(this.ctx)),{viewportScale:o}=this,l=Math.ceil(n*this.outputScaleX*o),c=Math.ceil(a*this.outputScaleY*o);this.annotationCanvas=this.canvasFactory.create(l,c);const{canvas:u,context:d}=this.annotationCanvas;this.annotationCanvasMap.set(e,u),this.annotationCanvas.savedCtx=this.ctx,this.ctx=d,this.ctx.save(),this.ctx.setTransform(i,0,0,-s,0,a*s),vr(this.ctx)}else vr(this.ctx),this.endPath(),this.ctx.rect(t[0],t[1],n,a),this.ctx.clip(),this.ctx.beginPath()}this.current=new pr(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...n)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#jt(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const t=e.count;(e=this.getObject(e.data,e)).count=t;const r=this.ctx,n=this.processingType3;if(n&&(void 0===n.compiled&&(n.compiled=function(e){const{width:t,height:r}=e;if(t>1e3||r>1e3)return null;const n=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),i=t+1;let a,s,o,l=new Uint8Array(i*(r+1));const c=t+7&-8;let u=new Uint8Array(c*r),d=0;for(const t of e.data){let e=128;for(;e>0;)u[d++]=t&e?0:255,e>>=1}let h=0;for(d=0,0!==u[d]&&(l[0]=1,++h),s=1;s<t;s++)u[d]!==u[d+1]&&(l[s]=u[d]?2:1,++h),d++;for(0!==u[d]&&(l[s]=2,++h),a=1;a<r;a++){d=a*c,o=a*i,u[d-c]!==u[d]&&(l[o]=u[d]?1:8,++h);let e=(u[d]?4:0)+(u[d-c]?8:0);for(s=1;s<t;s++)e=(e>>2)+(u[d+1]?4:0)+(u[d-c+1]?8:0),n[e]&&(l[o+s]=n[e],++h),d++;if(u[d-c]!==u[d]&&(l[o+s]=u[d]?2:4,++h),h>1e3)return null}for(d=c*(r-1),o=a*i,0!==u[d]&&(l[o]=8,++h),s=1;s<t;s++)u[d]!==u[d+1]&&(l[o+s]=u[d]?4:8,++h),d++;if(0!==u[d]&&(l[o+s]=4,++h),h>1e3)return null;const p=new Int32Array([0,i,-1,0,-i,0,0,0,1]),f=new Path2D;for(a=0;h&&a<=r;a++){let e=a*i;const r=e+t;for(;e<r&&!l[e];)e++;if(e===r)continue;f.moveTo(e%i,a);const n=e;let s=l[e];do{const t=p[s];do{e+=t}while(!l[e]);const r=l[e];5!==r&&10!==r?(s=r,l[e]=0):(s=r&51*s>>4,l[e]&=s>>2|s<<2),f.lineTo(e%i,e/i|0),l[e]||--h}while(n!==e);--a}return u=null,l=null,function(e){e.save(),e.scale(1/t,-1/r),e.translate(0,-r),e.fill(f),e.beginPath(),e.restore()}}(e)),n.compiled))return void n.compiled(r);const i=this._createMaskCanvas(e),a=i.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(a,i.offsetX,i.offsetY),r.restore(
22),this.compose()}paintImageMaskXObjectRepeat(e,t,r=0,n=0,i,a){if(!this.contentVisible)return;e=this.getObject(e.data,e);const s=this.ctx;s.save();const o=gt(s);s.transform(t,r,n,i,0,0);const l=this._createMaskCanvas(e);s.setTransform(1,0,0,1,l.offsetX-o[4],l.offsetY-o[5]);for(let e=0,c=a.length;e<c;e+=2){const c=He.transform(o,[t,r,n,i,a[e],a[e+1]]),[u,d]=He.applyTransform([0,0],c);s.drawImage(l.canvas,u,d)}s.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const t=this.ctx,r=this.current.fillColor,n=this.current.patternFill;for(const i of e){const{data:e,width:a,height:s,transform:o}=i,l=this.cachedCanvases.getCanvas("maskCanvas",a,s),c=l.context;c.save();gr(c,this.getObject(e,i)),c.globalCompositeOperation="source-in",c.fillStyle=n?r.getPattern(c,this,mt(t),Kt):r,c.fillRect(0,0,a,s),c.restore(),t.save(),t.transform(...o),t.scale(1,-1),hr(t,l.canvas,0,0,a,s,0,-1,1,1),t.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const t=this.getObject(e);t?this.paintInlineImageXObject(t):xe("Dependent image isn't ready yet")}paintImageXObjectRepeat(e,t,r,n){if(!this.contentVisible)return;const i=this.getObject(e);if(!i)return void xe("Dependent image isn't ready yet");const a=i.width,s=i.height,o=[];for(let e=0,i=n.length;e<i;e+=2)o.push({transform:[t,0,0,r,n[e],n[e+1]],x:0,y:0,w:a,h:s});this.paintInlineImageXObjectGroup(i,o)}applyTransferMapsToCanvas(e){return"none"!==this.current.transferMaps&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if("none"===this.current.transferMaps)return e.bitmap;const{bitmap:t,width:r,height:n}=e,i=this.cachedCanvases.getCanvas("inlineImage",r,n),a=i.context;return a.filter=this.current.transferMaps,a.drawImage(t,0,0),a.filter="none",i.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const t=e.width,r=e.height,n=this.ctx;if(this.save(),!E){const{filter:e}=n;"none"!==e&&""!==e&&(n.filter="none")}let i;if(n.scale(1/t,-1/r),e.bitmap)i=this.applyTransferMapsToBitmap(e);else if("function"==typeof HTMLElement&&e instanceof HTMLElement||!e.data)i=e;else{const n=this.cachedCanvases.getCanvas("inlineImage",t,r).context;fr(n,e),i=this.applyTransferMapsToCanvas(n)}const a=this._scaleImage(i,mt(n));n.imageSmoothingEnabled=yr(gt(n),e.interpolate),hr(n,a.img,0,0,a.paintWidth,a.paintHeight,0,-r,t,r),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,t){if(!this.contentVisible)return;const r=this.ctx;let n;if(e.bitmap)n=e.bitmap;else{const t=e.width,r=e.height,i=this.cachedCanvases.getCanvas("inlineImage",t,r).context;fr(i,e),n=this.applyTransferMapsToCanvas(i)}for(const e of t)r.save(),r.transform(...e.transform),r.scale(1,-1),hr(r,n,e.x,e.y,e.w,e.h,0,-1,1,1),r.restore();this.compose()}paintSolidColorImageMask(){this.contentVisible&&(this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e){}markPointProps(e,t){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t){"OC"===e?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const t=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const r=this.ctx;this.pendingClip&&(t||(this.pendingClip===Er?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=gt(this.ctx);if(0===e[1]&&0===e[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const t=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),n=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,n)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(-1===this._cachedScaleForStroking[0]){const{lineWidth:e}=this.current,{a:t,b:r,c:n,d:i}=this.ctx.getTransform();let a,s;if(0===r&&0===n){const r=Math.abs(t),n=Math.abs(i);if(r===n)if(0===e)a=s=1/r;else{const t=r*e;a=s=t<1?1/t:1}else if(0===e)a=1/r,s=1/n;else{const t=r*e,i=n*e;a=t<1?1/t:1,s=i<1?1/i:1}}else{const o=Math.abs(t*i-r*n),l=Math.hypot(t,r),c=Math.hypot(n,i);if(0===e)a=c/o,s=l/o;else{const t=e*o;a=c>t?c/t:1,s=l>t?l/t:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=s}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:t}=this,{lineWidth:r}=this.current,[n,i]=this.getScaleForStroking();if(t.lineWidth=r||1,1===n&&1===i)return void t.stroke();const a=t.getLineDash();if(e&&t.save(),t.scale(n,i),a.length>0){const e=Math.max(n,i);t.setLineDash(a.map(t=>t/e)),t.lineDashOffset/=e}
vendor: 16,637 bytes, line 22
22t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const e in ge)void 0!==Sr.prototype[e]&&(Sr.prototype[ge[e]]=Sr.prototype[e]);class Ar{static#Ft=null;static#Ht="";static get workerPort(){return this.#Ft}static set workerPort(e){if(!("undefined"!=typeof Worker&&e instanceof Worker)&&null!==e)throw new Error("Invalid `workerPort` type.");this.#Ft=e}static get workerSrc(){return this.#Ht}static set workerSrc(e){if("string"!=typeof e)throw new Error("Invalid `workerSrc` type.");this.#Ht=e}}const _r=1,Tr=2,Cr=1,Pr=2,Rr=3,Or=4,Dr=5,kr=6,Mr=7,Lr=8;function Ir(e){switch(e instanceof Error||"object"==typeof e&&null!==e||Ee('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),e.name){case"AbortException":return new Me(e.message);case"MissingPDFException":return new Oe(e.message);case"PasswordException":return new Ce(e.message,e.code);case"UnexpectedResponseException":return new De(e.message,e.status);case"UnknownErrorException":return new Pe(e.message,e.details);default:return new Pe(e.message,e.toString())}}class Nr{#Bt=new AbortController;constructor(e,t,r){this.sourceName=e,this.targetName=t,this.comObj=r,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),r.addEventListener("message",this.#zt.bind(this),{signal:this.#Bt.signal})}#zt({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream)return void this.#$t(e);if(e.callback){const t=e.callbackId,r=this.callbackCapabilities[t];if(!r)throw new Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===_r)r.resolve(e.data);else{if(e.callback!==Tr)throw new Error("Unexpected callback case");r.reject(Ir(e.reason))}return}const t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const r=this.sourceName,n=e.sourceName,i=this.comObj;return void new Promise(function(r){r(t(e.data))}).then(function(t){i.postMessage({sourceName:r,targetName:n,callback:_r,callbackId:e.callbackId,data:t})},function(t){i.postMessage({sourceName:r,targetName:n,callback:Tr,callbackId:e.callbackId,reason:Ir(t)})})}e.streamId?this.#Ut(e):t(e.data)}on(e,t){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=t}send(e,t,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},r)}sendWithPromise(e,t,r){const n=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[n]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},r)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,r,n){const i=this.streamId++,a=this.sourceName,s=this.targetName,o=this.comObj;return new ReadableStream({start:r=>{const l=Promise.withResolvers();return this.streamControllers[i]={controller:r,startCall:l,pullCall:null,cancelCall:null,isClosed:!1},o.postMessage({sourceName:a,targetName:s,action:e,streamId:i,data:t,desiredSize:r.desiredSize},n),l.promise},pull:e=>{const t=Promise.withResolvers();return this.streamControllers[i].pullCall=t,o.postMessage({sourceName:a,targetName:s,stream:kr,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{Se(e instanceof Error,"cancel must have a valid reason");const t=Promise.withResolvers();return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,o.postMessage({sourceName:a,targetName:s,stream:Cr,streamId:i,reason:Ir(e)}),t.promise}},r)}#Ut(e){const t=e.streamId,r=this.sourceName,n=e.sourceName,i=this.comObj,a=this,s=this.actionHandler[e.action],o={enqueue(e,a=1,s){if(this.isCancelled)return;const o=this.desiredSize;this.desiredSize-=a,o>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:r,targetName:n,stream:Or,streamId:t,chunk:e},s)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:n,stream:Rr,streamId:t}),delete a.streamSinks[t])},error(e){Se(e instanceof Error,"error must have a valid reason"),this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:r,targetName:n,stream:Dr,streamId:t,reason:Ir(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};o.sinkCapability.resolve(),o.ready=o.sinkCapability.promise,this.streamSinks[t]=o,new Promise(function(t){t(s(e.data,o))}).then(function(){i.postMessage({sourceName:r,targetName:n,stream:Lr,streamId:t,success:!0})},function(e){i.postMessage({sourceName:r,targetName:n,stream:Lr,streamId:t,reason:Ir(e)})})}#$t(e){const t=e.streamId,r=this.sourceName,n=e.sourceName,i=this.comObj,a=this.streamControllers[t],s=this.streamSinks[t];switch(e.stream){case Lr:e.success?a.startCall.resolve():a.startCall.reject(Ir(e.reason));break;case Mr:e.success?a.pullCall.resolve():a.pullCall.reject(Ir(e.reason));break;case kr:if(!s){i.postMessage({sourceName:r,targetName:n,stream:Mr,streamId:t,success:!0});break}s.desiredSize<=0&&e.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=e.desiredSize,new Promise(function(e){e(s.onPull?.())}).then(function(){i.postMessage({sourceName:r,targetName:n,stream:Mr,streamId:t,success:!0})},function(e){i.postMessage({sourceName:r,targetName:n,stream:Mr,streamId:t,reason:Ir(e)})});break;case Or:if(Se(a,"enqueue should have stream controller"),a.isClosed)break;a.controller.enqueue(e.chunk);break;case Rr:if(Se(a,"close should have stream controller"),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#Wt(a,t);break;case Dr:Se(a,"error should have stream controller"),a.controller.error(Ir(e.reason)),this.#Wt(a,t);break;case Pr:e.success?a.cancelCall.resolve():a.cancelCall.reject(Ir(e.reason)),this.#Wt(a,t);break;case Cr:if(!s)break;new Promise(function(t){t(s.onCancel?.(Ir(e.reason)))}).then(function(){i.postMessage({sourceName:r,targetName:n,stream:Pr,streamId:t,success:!0})},function(e){i.postMessage({sourceName:r,targetName:n,stream:Pr,streamId:t,reason:Ir(e)})}),s.sinkCapability.reject(Ir(e.reason)),s.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async#Wt(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#Bt?.abort(),this.#Bt=null}}class jr{#Vt;#qt;constructor({parsedData:e,rawData:t}){this.#Vt=e,this.#qt=t}getRaw(){return this.#qt}get(e){return this.#Vt.get(e)??null}getAll(){return Ne(this.#Vt)}has(e){return this.#Vt.has(e)}}const Fr=Symbol("INTERNAL");class Hr{#Yt=!1;#Gt=!1;#Xt=!1;#Kt=!0;constructor(e,{name:t,intent:r,usage:n,rbGroups:i}){this.#Yt=!!(e&C),this.#Gt=!!(e&P),this.name=t,this.intent=r,this.usage=n,this.rbGroups=i}get visible(){if(this.#Xt)return this.#Kt;if(!this.#Kt)return!1;const{print:e,view:t}=this.usage;return this.#Yt?"OFF"!==t?.viewState:!this.#Gt||"OFF"!==e?.printState}_setVisible(e,t,r=!1){e!==Fr&&Ee("Internal method `_setVisible` called."),this.#Xt=r,this.#Kt=t}}class Br{#Jt=null;#Qt=new Map;#Zt=null;#er=null;constructor(e,t=C){if(this.renderingIntent=t,this.name=null,this.creator=null,null!==e){this.name=e.name,this.creator=e.creator,this.#er=e.order;for(const r of e.groups)this.#Qt.set(r.id,new Hr(t,r));if("OFF"===e.baseState)for(const e of this.#Qt.values())e._setVisible(Fr,!1);for(const t of e.on)this.#Qt.get(t)._setVisible(Fr,!0);for(const t of e.off)this.#Qt.get(t)._setVisible(Fr,!1);this.#Zt=this.getHash()}}#tr(e){const t=e.length;if(t<2)return!0;const r=e[0];for(let n=1;n<t;n++){const t=e[n];let i;if(Array.isArray(t))i=this.#tr(t);else{if(!this.#Qt.has(t))return xe(`Optional content group not found: ${t}`),!0;i=this.#Qt.get(t).visible}switch(r){case"And":if(!i)return!1;break;case"Or":if(i)return!0;break;case"Not":return!i;default:return!0}}return"And"===r}isVisible(e){if(0===this.#Qt.size)return!0;if(!e)return we("Optional content group not defined."),!0;if("OCG"===e.type)return this.#Qt.has(e.id)?this.#Qt.get(e.id).visible:(xe(`Optional content group not found: ${e.id}`),!0);if("OCMD"===e.type){if(e.expression)return this.#tr(e.expression);if(!e.policy||"AnyOn"===e.policy){for(const t of e.ids){if(!this.#Qt.has(t))return xe(`Optional content group not found: ${t}`),!0;if(this.#Qt.get(t).visible)return!0}return!1}if("AllOn"===e.policy){for(const t of e.ids){if(!this.#Qt.has(t))return xe(`Optional content group not found: ${t}`),!0;if(!this.#Qt.get(t).visible)return!1}return!0}if("AnyOff"===e.policy){for(const t of e.ids){if(!this.#Qt.has(t))return xe(`Optional content group not found: ${t}`),!0;if(!this.#Qt.get(t).visible)return!0}return!1}if("AllOff"===e.policy){for(const t of e.ids){if(!this.#Qt.has(t))return xe(`Optional content group not found: ${t}`),!0;if(this.#Qt.get(t).visible)return!1}return!0}return xe(`Unknown optional content policy ${e.policy}.`),!0}return xe(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,r=!0){const n=this.#Qt.get(e);if(n){if(r&&t&&n.rbGroups.length)for(const t of n.rbGroups)for(const r of t)r!==e&&this.#Qt.get(r)?._setVisible(Fr,!1,!0);n._setVisible(Fr,!!t,!0),this.#Jt=null}else xe(`Optional content group not found: ${e}`)}setOCGState({state:e,preserveRB:t}){let r;for(const n of e){switch(n){case"ON":case"OFF":case"Toggle":r=n;continue}const e=this.#Qt.get(n);if(e)switch(r){case"ON":this.setVisibility(n,!0,t);break;case"OFF":this.setVisibility(n,!1,t);break;case"Toggle":this.setVisibility(n,!e.visible,t)}}this.#Jt=null}get hasInitialVisibility(){return null===this.#Zt||this.getHash()===this.#Zt}getOrder(){return this.#Qt.size?this.#er?this.#er.slice():[...this.#Qt.keys()]:null}getGroups(){return this.#Qt.size>0?Ne(this.#Qt):null}getGroup(e){return this.#Qt.get(e)||null}getHash(){if(null!==this.#Jt)return this.#Jt;const e=new Lt;for(const[t,r]of this.#Qt)e.update(`${t}:${r.visible}`);return this.#Jt=e.hexdigest()}}class zr{constructor(e,{disableRange:t=!1,disableStream:r=!1}){Se(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:n,initialData:i,progressiveDone:a,contentDispositionFilename:s}=e;if(this._queuedChunks=[],this._progressiveDone=a,this._contentDispositionFilename=s,i?.length>0){const e=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;this._queuedChunks.push(e)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!t,this._contentLength=n,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((e,t)=>{this._onReceiveData({begin:e,chunk:t})}),e.addProgressListener((e,t)=>{this._onProgress({loaded:e,total:t})}),e.addProgressiveReadListener(e=>{this._onReceiveData({chunk:e})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){const r=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(void 0===e)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{Se(this._rangeReaders.some(function(t){return t._begin===e&&(t._enqueue(r),!0)}),"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){void 0===e.total?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){Se(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new $r(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new Ur(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}}class $r{constructor(e,t,r=!1,n=null){this._stream=e,this._done=r||!1,this._filename=at(n)?n:null,this._queuedChunks=t||[],this._loaded=0;for(const e of this._queuedChunks)this._loaded+=e.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else 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=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class Ur{constructor(e,t,r){this._stream=e,this._begin=t,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(0===this._requests.length)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function Wr(e,t){const r=new Headers;if(!e||!t||"object"!=typeof t)return r;for(const e in t){const n=t[e];void 0!==n&&r.append(e,n)}return r}function Vr({responseHeaders:e,isHttp:t,rangeChunkSize:r,disableRange:n}){const i={allowRangeRequests:!1,suggestedLength:void 0},a=parseInt(e.get("Content-Length"),10);if(!Number.isInteger(a))return i;if(i.suggestedLength=a,a<=2*r)return i;if(n||!t)return i;if("bytes"!==e.get("Accept-Ranges"))return i;return"identity"!==(e.get("Content-Encoding")||"identity")||(i.allowRangeRequests=!0),i}function qr(e){const t=e.get("Content-Disposition");if(t){let e=function(e){let t=!0,r=n("filename\\*","i").exec(e);if(r){r=r[1];let e=s(r);return e=unescape(e),e=o(e),e=l(e),a(e)}if(r=function(e){const t=[];let r;const i=n("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(r=i.exec(e));){let[,e,n,i]=r;if(e=parseInt(e,10),e in t){if(0===e)break}else t[e]=[n,i]}const a=[];for(let e=0;e<t.length&&e in t;++e){let[r,n]=t[e];n=s(n),r&&(n=unescape(n),0===e&&(n=o(n))),a.push(n)}return a.join("")}(e),r)return a(l(r));if(r=n("filename","i").exec(e),r){r=r[1];let e=s(r);return e=l(e),a(e)}function n(e,t){return new RegExp("(?:^|;)\\s*"+e+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',t)}function i(e,r){if(e){if(!/^[\x00-\xFF]+$/.test(r))return r;try{const n=new TextDecoder(e,{fatal:!0}),i=Ie(r);r=n.decode(i),t=!1}catch{}}return r}function a(e){return t&&/[\x80-\xff]/.test(e)&&(e=i("utf-8",e),t&&(e=i("iso-8859-1",e))),e}function s(e){if(e.startsWith('"')){const t=e.slice(1).split('\\"');for(let e=0;e<t.length;++e){const r=t[e].indexOf('"');-1!==r&&(t[e]=t[e].slice(0,r),t.length=e+1),t[e]=t[e].replaceAll(/\\(.)/g,"$1")}e=t.join('"')}return e}function o(e){const t=e.indexOf("'");return-1===t?e:i(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,""))}function l(e){return!e.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(e,t,r,n){if("q"===r||"Q"===r)return i(t,n=(n=n.replaceAll("_"," ")).replaceAll(/=([0-9a-fA-F]{2})/g,function(e,t){return String.fromCharCode(parseInt(t,16))}));try{n=atob(n)}catch{}return i(t,n)})}return""}(t);if(e.includes("%"))try{e=decodeURIComponent(e)}catch{}if(at(e))return e}return null}function Yr(e,t){return 404===e||0===e&&t.startsWith("file:")?new Oe('Missing PDF "'+t+'".'):new De(`Unexpected server response
22(${e}) while retrieving PDF "${t}".`,e)}function Gr(e){return 200===e||206===e}function Xr(e,t,r){return{method:"GET",headers:e,signal:r.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function Kr(e){return e instanceof Uint8Array?e.buffer:e instanceof ArrayBuffer?e:(xe(`getArrayBuffer - unexpected data format: ${e}`),new Uint8Array(e).buffer)}class Jr{constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=Wr(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Se(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new Qr(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=new Zr(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class Qr{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const t=e.source;this._withCredentials=t.withCredentials||!1,this._contentLength=t.length,this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange;const r=new Headers(e.headers),n=t.url;fetch(n,Xr(r,this._withCredentials,this._abortController)).then(t=>{if(!Gr(t.status))throw Yr(t.status,n);this._reader=t.body.getReader(),this._headersCapability.resolve();const r=t.headers,{allowRangeRequests:i,suggestedLength:a}=Vr({responseHeaders:r,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i,this._contentLength=a||this._contentLength,this._filename=qr(r),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new Me("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:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:Kr(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class Zr{constructor(e,t,r){this._stream=e,this._reader=null,this._loaded=0;const n=e.source;this._withCredentials=n.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!n.disableStream,this._abortController=new AbortController;const i=new Headers(e.headers);i.append("Range",`bytes=${t}-${r-1}`);const a=n.url;fetch(a,Xr(i,this._withCredentials,this._abortController)).then(e=>{if(!Gr(e.status))throw Yr(e.status,a);this._readCapability.resolve(),this._reader=e.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:Kr(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class en{constructor({url:e,httpHeaders:t,withCredentials:r}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=Wr(this.isHttp,t),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,r){const n={begin:e,end:t};for(const e in r)n[e]=r[e];return this.request(n)}requestFull(e){return this.request(e)}request(e){const t=new XMLHttpRequest,r=this.currXhrId++,n=this.pendingRequests[r]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(const[e,r]of this.headers)t.setRequestHeader(e,r);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),n.expectedStatus=206):n.expectedStatus=200,t.responseType="arraybuffer",e.onError&&(t.onerror=function(r){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,r),t.onprogress=this.onProgress.bind(this,r),n.onHeadersReceived=e.onHeadersReceived,n.onDone=e.onDone,n.onError=e.onError,n.onProgress=e.onProgress,t.send(null),r}onProgress(e,t){const r=this.pendingRequests[e];r&&r.onProgress?.(t)}onStateChange(e,t){const r=this.pendingRequests[e];if(!r)return;const n=r.xhr;if(n.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),4!==n.readyState)return;if(!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],0===n.status&&this.isHttp)return void r.onError?.(n.status);const i=n.status||200;if(!(200===i&&206===r.expectedStatus)&&i!==r.expectedStatus)return void r.onError?.(n.status);const a=function(e){const t=e.response;return"string"!=typeof t?t:Ie(t).buffer}(n);if(206===i){const e=n.getResponseHeader("Content-Range"),t=/bytes (\d+)-(\d+)\/(\d+)/.exec(e);r.onDone({begin:parseInt(t[1],10),chunk:a})}else a?r.onDone({begin:0,chunk:a}):r.onError?.(n.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}
vendor: 4,756 bytes, line 22
22abortRequest(e){const t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}}class tn{constructor(e){this._source=e,this._manager=new en(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return Se(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new rn(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){const r=new nn(this._manager,e,t);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class rn{constructor(e,t){this._manager=e;const r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(r),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.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 e=this._fullRequestId,t=this._manager.getRequestXhr(e),r=new Headers(t.getAllResponseHeaders().trim().split(/[\r\n]+/).map(e=>{const[t,...r]=e.split(": ");return[t,r.join(": ")]})),{allowRangeRequests:n,suggestedLength:i}=Vr({responseHeaders:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=i||this._contentLength,this._filename=qr(r),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e)if(this._requests.length>0){this._requests.shift().resolve({value:e.chunk,done:!1})}else this._cachedChunks.push(e.chunk);if(this._done=!0,!(this._cachedChunks.length>0)){for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=Yr(e,this._url),this._headersCapability.reject(this._storedError);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.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._headersCapability.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 e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class nn{constructor(e,t,r){this._manager=e;const n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,r,n),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(e){const t=e.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunk=t;this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=Yr(e,this._url);for(const e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest
22(this._requestId),this._close()}}const an=/^[a-z][a-z0-9\-+.]+:/i;function sn(e,t,r){if("http:"===e.protocol){return Gt.get("http").request(e,{headers:t},r)}return Gt.get("https").request(e,{headers:t},r)}class on{constructor(e){this.source=e,this.url=function(e){if(an.test(e))return new URL(e);const t=Gt.get("url");return new URL(t.pathToFileURL(e))}(e.url),this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol,this.isFsUrl="file:"===this.url.protocol,this.headers=Wr(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Se(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new hn(this):new un(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;const r=this.isFsUrl?new pn(this,e,t):new dn(this,e,t);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}}class ln{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,this._rangeChunkSize||this._disableRange||(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new Me("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class cn{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const t=e.source;this._isStreamingSupported=!t.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 e=this._readableStream.read();if(null===e)return this._readCapability=Promise.withResolvers(),this.read();this._loaded+=e.length,this.onProgress?.({loaded:this._loaded});return{value:new Uint8Array(e).buffer,done:!1}}cancel(e){this._readableStream?this._readableStream.destroy(e):this._error(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",e=>{this._error(e)}),this._storedError&&this._readableStream.destroy(this._storedError)}}class un extends ln{constructor(e){super(e);const t=Object.fromEntries(e.headers);this._request=sn(this._url,t,t=>{if(404===t.statusCode){const e=new Oe(`Missing PDF "${this._url}".`);return this._storedError=e,void this._headersCapability.reject(e)}this._headersCapability.resolve(),this._setReadableStream(t);const r=new Headers(this._readableStream.headers),{allowRangeRequests:n,suggestedLength:i}=Vr({responseHeaders:r,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=n,this._contentLength=i||this._contentLength,this._filename=qr(r)}),this._request.on("error",e=>{this._storedError=e,this._headersCapability.reject(e)}),this._request.end()}}class dn extends cn{constructor(e,t,r){super(e);const n=Object.fromEntries(e.headers);n.Range=`bytes=${t}-${r-1}`;this._request=sn(this._url,n,e=>{if(404===e.statusCode){const e=new Oe(`Missing PDF "${this._url}".`);return void(this._storedError=e)}this._setReadableStream(e)}),this._request.on("error",e=>{this._storedError=e}),this._request.end()}}class hn extends ln{constructor(e){super(e);const t=Gt.get("fs");t.promises.lstat(this._url).then(e=>{this._contentLength=e.size,this._setReadableStream(t.createReadStream(this._url)),this._headersCapability.resolve()},e=>{"ENOENT"===e.code&&(e=new Oe(`Missing PDF "${this._url}".`)),this._storedError=e,this._headersCapability.reject(e)})}}class pn extends cn{constructor(e,t,r){super(e);const n=Gt.get("fs");this._setReadableStream(n.createReadStream(this._url,{start:t,end:r-1}))}}const fn=30;class gn{#rr=Promise.withResolvers();#he=null;#nr=!1;#ir=!!globalThis.FontInspector?.enabled;#ar=null;#sr=null;#or=0;#lr=0;#cr=null;#ur=null;#dr=0;#hr=0;#pr=Object.create(null);#fr=[];#gr=null;#mr=[];#vr=new WeakMap;#yr=null;static#br=new Map;static#wr=new Map;static#xr=new WeakMap;static#Er=null;static#Sr=new Set;constructor({textContentSource:e,container:t,viewport:r}){if(e instanceof ReadableStream)this.#gr=e;else{if("object"!=typeof e)throw new Error('No "textContentSource" parameter specified.');this.#gr=new ReadableStream({start(t){t.enqueue(e),t.close()}})}this.#he=this.#ur=t,this.#hr=r.scale*(globalThis.devicePixelRatio||1),this.#dr=r.rotation,this.#sr={div:null,properties:null,ctx:null};const{pageWidth:n,pageHeight:i,pageX:a,pageY:s}=r.rawDims;this.#yr=[1,0,0,-1,-a,s+i],this.#lr=n,this.#or=i,gn.#Ar(),vt(t,r),this.#rr.promise.finally(()=>
vendor: 5,287 bytes, line 22
22{gn.#Sr.delete(this),this.#sr=null,this.#pr=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:t}=je.platform;return _e(this,"fontFamilyMap",new Map([["sans-serif",(e&&t?"Calibri, ":"")+"sans-serif"],["monospace",(e&&t?"Lucida Console, ":"")+"monospace"]]))}render(){const e=()=>{this.#cr.read().then(({value:t,done:r})=>{r?this.#rr.resolve():(this.#ar??=t.lang,Object.assign(this.#pr,t.styles),this.#_r(t.items),e())},this.#rr.reject)};return this.#cr=this.#gr.getReader(),gn.#Sr.add(this),e(),this.#rr.promise}update({viewport:e,onBefore:t=null}){const r=e.scale*(globalThis.devicePixelRatio||1),n=e.rotation;if(n!==this.#dr&&(t?.(),this.#dr=n,vt(this.#ur,{rotation:n})),r!==this.#hr){t?.(),this.#hr=r;const e={div:null,properties:null,ctx:gn.#Tr(this.#ar)};for(const t of this.#mr)e.properties=this.#vr.get(t),e.div=t,this.#Cr(e)}}cancel(){const e=new Me("TextLayer task cancelled.");this.#cr?.cancel(e).catch(()=>{}),this.#cr=null,this.#rr.reject(e)}get textDivs(){return this.#mr}get textContentItemsStr(){return this.#fr}#_r(e){if(this.#nr)return;this.#sr.ctx??=gn.#Tr(this.#ar);const t=this.#mr,r=this.#fr;for(const n of e){if(t.length>1e5)return xe("Ignoring additional textDivs for performance reasons."),void(this.#nr=!0);if(void 0!==n.str)r.push(n.str),this.#Pr(n);else if("beginMarkedContentProps"===n.type||"beginMarkedContent"===n.type){const e=this.#he;this.#he=document.createElement("span"),this.#he.classList.add("markedContent"),null!==n.id&&this.#he.setAttribute("id",`${n.id}`),e.append(this.#he)}else"endMarkedContent"===n.type&&(this.#he=this.#he.parentNode)}}#Pr(e){const t=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};this.#mr.push(t);const n=He.transform(this.#yr,e.transform);let i=Math.atan2(n[1],n[0]);const a=this.#pr[e.fontName];a.vertical&&(i+=Math.PI/2);let s=this.#ir&&a.fontSubstitution||a.fontFamily;s=gn.fontFamilyMap.get(s)||s;const o=Math.hypot(n[2],n[3]),l=o*gn.#Rr(s,this.#ar);let c,u;0===i?(c=n[4],u=n[5]-l):(c=n[4]+l*Math.sin(i),u=n[5]-l*Math.cos(i));const d="calc(var(--scale-factor)*",h=t.style;this.#he===this.#ur?(h.left=`${(100*c/this.#lr).toFixed(2)}%`,h.top=`${(100*u/this.#or).toFixed(2)}%`):(h.left=`${d}${c.toFixed(2)}px)`,h.top=`${d}${u.toFixed(2)}px)`),h.fontSize=`${d}${(gn.#Er*o).toFixed(2)}px)`,h.fontFamily=s,r.fontSize=o,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,this.#ir&&(t.dataset.fontName=a.fontSubstitutionLoadedName||e.fontName),0!==i&&(r.angle=i*(180/Math.PI));let p=!1;if(e.str.length>1)p=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),r=Math.abs(e.transform[3]);t!==r&&Math.max(t,r)/Math.min(t,r)>1.5&&(p=!0)}if(p&&(r.canvasWidth=a.vertical?e.height:e.width),this.#vr.set(t,r),this.#sr.div=t,this.#sr.properties=r,this.#Cr(this.#sr),r.hasText&&this.#he.append(t),r.hasEOL){const e=document.createElement("br");e.setAttribute("role","presentation"),this.#he.append(e)}}#Cr(e){const{div:t,properties:r,ctx:n}=e,{style:i}=t;let a="";if(gn.#Er>1&&(a=`scale(${1/gn.#Er})`),0!==r.canvasWidth&&r.hasText){const{fontFamily:e}=i,{canvasWidth:s,fontSize:o}=r;gn.#Or(n,o*this.#hr,e);const{width:l}=n.measureText(t.textContent);l>0&&(a=`scaleX(${s*this.#hr/l}) ${a}`)}0!==r.angle&&(a=`rotate(${r.angle}deg) ${a}`),a.length>0&&(i.transform=a)}static cleanup(){if(!(this.#Sr.size>0)){this.#br.clear();for(const{canvas:e}of this.#wr.values())e.remove();this.#wr.clear()}}static#Tr(e=null){let t=this.#wr.get(e||="");if(!t){const r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=e,document.body.append(r),t=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#wr.set(e,t),this.#xr.set(t,{size:0,family:""})}return t}static#Or(e,t,r){const n=this.#xr.get(e);t===n.size&&r===n.family||(e.font=`${t}px ${r}`,n.size=t,n.family=r)}static#Ar(){if(null!==this.#Er)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#Er=e.getBoundingClientRect().height,e.remove()}static#Rr(e,t){const r=this.#br.get(e);if(r)return r;const n=this.#Tr(t);n.canvas.width=n.canvas.height=fn,this.#Or(n,fn,e);const i=n.measureText("");let a=i.fontBoundingBoxAscent,s=Math.abs(i.fontBoundingBoxDescent);if(a){const t=a/(a+s);return this.#br.set(e,t),n.canvas.width=n.canvas.height=0,t}n.strokeStyle="red",n.clearRect(0,0,fn,fn),n.strokeText("g",0,0);let o=n.getImageData(0,0,fn,fn).data;s=0;for(let e=o.length-1-3;e>=0;e-=4)if(o[e]>0){s=Math.ceil(e/4/fn);break}n.clearRect(0,0,fn,fn),n.strokeText("A",0,fn),o=n.getImageData(0,0,fn,fn).data,a=0;for(let e=0,t=o.length;e<t;e+=4)if(o[e]>0){a=fn-Math.floor(e/4/fn);break}n.canvas.width=n.canvas.height=0;const l=a?a/(a+s):.8;return this.#br.set(e,l),l}}class mn{static textContent(e){const t=[],r={items:t,styles:Object.create(null)};return function e(r){if(!r)return;let n=null;const i=r.name;if("#text"===i)n=r.value;else{if(!mn.shouldBuildText(i))return;r?.attributes?.textContent?n=r.attributes.textContent:r.value&&(n=r.value)}if(null!==n&&t.push({str:n}),r.children)for(const t of r.children)e(t)}(e),r}static shouldBuildText(e){return!("textarea"===e||"input"===e||"option"===e||"select"===e)}}
vendor: 4,400 bytes, line 22
22const vn=E?class extends Bt{_createCanvas(e,t){return Gt.get("canvas").createCanvas(e,t)}}:class extends Bt{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){const r=this._document.createElement("canvas");return r.width=e,r.height=t,r}},yn=E?class extends zt{async _fetch(e){return Xt(e)}}:$t,bn=E?class extends Ut{}:class extends Ut{#Dr;#kr;#Mr;#Lr;#Ir;#Nr;#b=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#Lr=e,this.#Ir=t}get#x(){return this.#kr||=new Map}get#jr(){return this.#Nr||=new Map}get#Fr(){if(!this.#Mr){const e=this.#Ir.createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;const r=this.#Ir.createElementNS(Ze,"svg");r.setAttribute("width",0),r.setAttribute("height",0),this.#Mr=this.#Ir.createElementNS(Ze,"defs"),e.append(r),r.append(this.#Mr),this.#Ir.body.append(e)}return this.#Mr}#Hr(e){if(1===e.length){const t=e[0],r=new Array(256);for(let e=0;e<256;e++)r[e]=t[e]/255;const n=r.join(",");return[n,n,n]}const[t,r,n]=e,i=new Array(256),a=new Array(256),s=new Array(256);for(let e=0;e<256;e++)i[e]=t[e]/255,a[e]=r[e]/255,s[e]=n[e]/255;return[i.join(","),a.join(","),s.join(",")]}#Br(e){if(void 0===this.#Dr){this.#Dr="";const e=this.#Ir.URL;e!==this.#Ir.baseURI&&(it(e)?xe('#createUrl: ignore "data:"-URL for performance reasons.'):this.#Dr=e.split("#",1)[0])}return`url(${this.#Dr}#${e})`}addFilter(e){if(!e)return"none";let t=this.#x.get(e);if(t)return t;const[r,n,i]=this.#Hr(e),a=1===e.length?r:`${r}${n}${i}`;if(t=this.#x.get(a),t)return this.#x.set(e,t),t;const s=`g_${this.#Lr}_transfer_map_${this.#b++}`,o=this.#Br(s);this.#x.set(e,o),this.#x.set(a,o);const l=this.#zr(s);return this.#$r(r,n,i,l),o}addHCMFilter(e,t){const r=`${e}-${t}`,n="base";let i=this.#jr.get(n);if(i?.key===r)return i.url;if(i?(i.filter?.remove(),i.key=r,i.url="none",i.filter=null):(i={key:r,url:"none",filter:null},this.#jr.set(n,i)),!e||!t)return i.url;const a=this.#Ur(e);e=He.makeHexColor(...a);const s=this.#Ur(t);if(t=He.makeHexColor(...s),this.#Fr.style.color="","#000000"===e&&"#ffffff"===t||e===t)return i.url;const o=new Array(256);for(let e=0;e<=255;e++){const t=e/255;o[e]=t<=.03928?t/12.92:((t+.055)/1.055)**2.4}const l=o.join(","),c=`g_${this.#Lr}_hcm_filter`,u=i.filter=this.#zr(c);this.#$r(l,l,l,u),this.#Wr(u);const d=(e,t)=>{const r=a[e]/255,n=s[e]/255,i=new Array(t+1);for(let e=0;e<=t;e++)i[e]=r+e/t*(n-r);return i.join(",")};return this.#$r(d(0,5),d(1,5),d(2,5),u),i.url=this.#Br(c),i.url}addAlphaFilter(e){let t=this.#x.get(e);if(t)return t;const[r]=this.#Hr([e]),n=`alpha_${r}`;if(t=this.#x.get(n),t)return this.#x.set(e,t),t;const i=`g_${this.#Lr}_alpha_map_${this.#b++}`,a=this.#Br(i);this.#x.set(e,a),this.#x.set(n,a);const s=this.#zr(i);return this.#Vr(r,s),a}addLuminosityFilter(e){let t,r,n=this.#x.get(e||"luminosity");if(n)return n;if(e?([t]=this.#Hr([e]),r=`luminosity_${t}`):r="luminosity",n=this.#x.get(r),n)return this.#x.set(e,n),n;const i=`g_${this.#Lr}_luminosity_map_${this.#b++}`,a=this.#Br(i);this.#x.set(e,a),this.#x.set(r,a);const s=this.#zr(i);return this.#qr(s),e&&this.#Vr(t,s),a}addHighlightHCMFilter(e,t,r,n,i){const a=`${t}-${r}-${n}-${i}`;let s=this.#jr.get(e);if(s?.key===a)return s.url;if(s?(s.filter?.remove(),s.key=a,s.url="none",s.filter=null):(s={key:a,url:"none",filter:null},this.#jr.set(e,s)),!t||!r)return s.url;const[o,l]=[t,r].map(this.#Ur.bind(this));let c=Math.round(.2126*o[0]+.7152*o[1]+.0722*o[2]),u=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),[d,h]=[n,i].map(this.#Ur.bind(this));u<c&&([c,u,d,h]=[u,c,h,d]),this.#Fr.style.color="";const p=(e,t,r)=>{const n=new Array(256),i=(u-c)/r,a=e/255,s=(t-e)/(255*r);let o=0;for(let e=0;e<=r;e++){const t=Math.round(c+e*i),r=a+e*s;for(let e=o;e<=t;e++)n[e]=r;o=t+1}for(let e=o;e<256;e++)n[e]=n[o-1];return n.join(",")},f=`g_${this.#Lr}_hcm_${e}_filter`,g=s.filter=this.#zr(f);return this.#Wr(g),this.#$r(p(d[0],h[0],5),p(d[1],h[1],5),p(d[2],h[2],5),g),s.url=this.#Br(f),s.url}destroy(e=!1){e&&0!==this.#jr.size||(this.#Mr&&(this.#Mr.parentNode.parentNode.remove(),this.#Mr=null),this.#kr&&(this.#kr.clear(),this.#kr=null),this.#b=0)}#qr(e){const t=this.#Ir.createElementNS(Ze,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),e.a
22ppend(t)}#Wr(e){const t=this.#Ir.createElementNS(Ze,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(t)}#zr(e){const t=this.#Ir.createElementNS(Ze,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#Fr.append(t),t}#Yr(e,t,r){const n=this.#Ir.createElementNS(Ze,t);n.setAttribute("type","discrete"),n.setAttribute("tableValues",r),e.append(n)}#$r(e,t,r,n){const i=this.#Ir.createElementNS(Ze,"feComponentTransfer");n.append(i),this.#Yr(i,"feFuncR",e),this.#Yr(i,"feFuncG",t),this.#Yr(i,"feFuncB",r)}#Vr(e,t){const r=this.#Ir.createElementNS(Ze,"feComponentTransfer");t.append(r),this.#Yr(r,"feFuncA",e)}#Ur(e){return this.#Fr.style.color=e,ft(getComputedStyle(this.#Fr).getPropertyValue("color"))}},wn=E?class extends Wt{async _fetch(e){return Xt(e)}}:Vt;function xn(e={}){"string"==typeof e||e instanceof URL?e={url:e}:(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});const t=new Sn,{docId:r}=t,n=e.url?function(e){if(e instanceof URL)return e.href;try{return new URL(e,window.location).href}catch{if(E&&"string"==typeof e)return e}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(e.url):null,i=e.data?function(e){if(E&&"undefined"!=typeof Buffer&&e instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if("string"==typeof e)return Ie(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||"object"==typeof e&&!isNaN(e?.length))return new Uint8Array(e);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(e.data):null,a=e.httpHeaders||null,s=!0===e.withCredentials,o=e.password??null,l=e.range instanceof An?e.range:null,c=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:65536;let u=e.worker instanceof Pn?e.worker:null;const d=e.verbosity,h="string"!=typeof e.docBaseUrl||it(e.docBaseUrl)?null:e.docBaseUrl,p="string"==typeof e.cMapUrl?e.cMapUrl:null,f=!1!==e.cMapPacked,g=e.CMapReaderFactory||yn,m="string"==typeof e.standardFontDataUrl?e.standardFontDataUrl:null,v=e.StandardFontDataFactory||wn,y=!0!==e.stopAtErrors,b=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,w=!1!==e.isEvalSupported,x="boolean"==typeof e.isOffscreenCanvasSupported?e.isOffscreenCanvasSupported:!E,S="boolean"==typeof e.isChrome?e.isChrome:!je.platform.isFirefox&&"undefined"!=typeof window&&!!window?.chrome,A=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,_="boolean"==typeof e.disableFontFace?e.disableFontFace:E,T=!0===e.fontExtraProperties,C=!0===e.enableXfa,P=e.ownerDocument||globalThis.document,R=!0===e.disableRange,O=!0===e.disableStream,D=!0===e.disableAutoFetch,k=!0===e.pdfBug,M=e.CanvasFactory||vn,L=e.FilterFactory||bn,I=!0===e.enableHWA,N=l?l.length:e.length??NaN,j="boolean"==typeof e.useSystemFonts?e.useSystemFonts:!E&&!_,F="boolean"==typeof e.useWorkerFetch?e.useWorkerFetch:g===$t&&v===Vt&&p&&m&&ct(p,document.baseURI)&&ct(m,document.baseURI);e.canvasFactory&&dt("`canvasFactory`-instance option, please use `CanvasFactory` instead."),e.filterFactory&&dt("`filterFactory`-instance option, please use `FilterFactory` instead.");ye(d);const H={canvasFactory:new M({ownerDocument:P,enableHWA:I}),filterFactory:new L({docId:r,ownerDocument:P}),cMapReaderFactory:F?null:new g({baseUrl:p,isCompressed:f}),standardFontDataFactory:F?null:new v({baseUrl:m})};if(!u){const e={verbosity:d,port:Ar.workerPort};u=e.port?Pn.fromPort(e):new Pn(e),t._worker=u}const B={docId:r,apiVersion:"4.8.69",data:i,password:o,disableAutoFetch:D,rangeChunkSize:c,length:N,docBaseUrl:h,enableXfa:C,evaluatorOptions:{maxImageSize:b,disableFontFace:_,ignoreErrors:y,isEvalSupported:w,isOffscreenCanvasSupported:x,isChrome:S,canvasMaxAreaInBytes:A,fontExtraProperties:T,useSystemFonts:j,cMapUrl:F?p:null,standardFontDataUrl:F?m:null}},z={disableFontFace:_,fontExtraProperties:T,ownerDocument:P,pdfBug:k,styleElement:null,loadingParams:{disableAutoFetch:D,enableXfa:C}};return u.promise.then(function(){if(t.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");
22const e=u.messageHandler.sendWithPromise("GetDocRequest",B,i?[i.buffer]:null);let o;if(l)o=new zr(l,{disableRange:R,disableStream:O});else if(!i){if(!n)throw new Error("getDocument - no `url` parameter provided.");let e;if(E){e="undefined"!=typeof fetch&&"undefined"!=typeof Response&&"body"in Response.prototype&&ct(n)?Jr:on}else e=ct(n)?Jr:tn;o=new e({url:n,length:N,httpHeaders:a,withCredentials:s,rangeChunkSize:c,disableRange:R,disableStream:O})}return e.then(e=>{if(t.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const n=new Nr(r,e,u.port),i=new Rn(n,t,o,z,H);t._transport=i,n.send("Ready",null)})}).catch(t._capability.reject),t}function En(e){return"object"==typeof e&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0}class Sn{static#Lr=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d"+Sn.#Lr++,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await(this._transport?.destroy())}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}class An{constructor(e,t,r=!1,n=null){this.length=e,this.initialData=t,this.progressiveDone=r,this.contentDispositionFilename=n,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}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,t){for(const r of this._rangeListeners)r(e,t)}onDataProgress(e,t){this._readyCapability.promise.then(()=>{for(const r of this._progressListeners)r(e,t)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){Ee("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class _n{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return _e(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}
vendor: 4,193 bytes, line 22
22getDestinations(){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()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class Tn{#Gr=null;#Xr=!1;constructor(e,t,r,n=!1){this._pageIndex=e,this._pageInfo=t,this._transport=r,this._stats=n?new lt:null,this._pdfBug=n,this.commonObjs=r.commonObjs,this.objs=new Dn,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:r=0,offsetY:n=0,dontFlip:i=!1}={}){return new rt({viewBox:this.view,scale:e,rotation:t,offsetX:r,offsetY:n,dontFlip:i})}getAnnotations({intent:e="display"}={}){const{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return _e(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,viewport:t,intent:r="display",annotationMode:n=L.ENABLE,transform:i=null,background:a=null,optionalContentConfigPromise:s=null,annotationCanvasMap:o=null,pageColors:l=null,printAnnotationStorage:c=null,isEditing:u=!1}){this._stats?.time("Overall");const d=this._transport.getRenderingIntent(r,n,c,u),{renderingIntent:h,cacheKey:p}=d;this.#Xr=!1,this.#Kr(),s||=this._transport.getOptionalContentConfig(h);let f=this._intentStates.get(p);f||(f=Object.create(null),this._intentStates.set(p,f)),f.streamReaderCancelTimeout&&(clearTimeout(f.streamReaderCancelTimeout),f.streamReaderCancelTimeout=null);const g=!!(h&P);f.displayReadyCapability||(f.displayReadyCapability=Promise.withResolvers(),f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(d));const m=e=>{f.renderTasks.delete(v),(this._maybeCleanupAfterRender||g)&&(this.#Xr=!0),this.#Jr(!g),e?(v.capability.reject(e),this._abortOperatorList({intentState:f,reason:e instanceof Error?e:new Error(e)})):v.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},v=new Mn({callback:m,params:{canvasContext:e,viewport:t,transform:i,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:o,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!g,pdfBug:this._pdfBug,page
22Colors:l});(f.renderTasks||=new Set).add(v);const y=v.task;return Promise.all([f.displayReadyCapability.promise,s]).then(([e,t])=>{if(this.destroyed)m();else{if(this._stats?.time("Rendering"),!(t.renderingIntent&h))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");v.initializeGraphics({transparency:e,optionalContentConfig:t}),v.operatorListChanged()}}).catch(m),y}getOperatorList({intent:e="display",annotationMode:t=L.ENABLE,printAnnotationStorage:r=null,isEditing:n=!1}={}){const i=this._transport.getRenderingIntent(e,t,r,n,!0);let a,s=this._intentStates.get(i.cacheKey);return s||(s=Object.create(null),this._intentStates.set(i.cacheKey,s)),s.opListReadCapability||(a=Object.create(null),a.operatorListChanged=function(){s.operatorList.lastChunk&&(s.opListReadCapability.resolve(s.operatorList),s.renderTasks.delete(a))},s.opListReadCapability=Promise.withResolvers(),(s.renderTasks||=new Set).add(a),s.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(i)),s.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===e,disableNormalization:!0===t},{highWaterMark:100,size:e=>e.items.length})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>mn.textContent(e));const t=this.streamTextContent(e);return new Promise(function(e,r){const n=t.getReader(),i={items:[],styles:Object.create(null),lang:null};!function t(){n.read().then(function({value:r,done:n}){n?e(i):(i.lang??=r.lang,Object.assign(i.styles,r.styles),i.items.push(...r.items),t())},r)}()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(const r of t.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),this.#Xr=!1,this.#Kr(),Promise.all(e)}cleanup(e=!1){this.#Xr=!0;const t=this.#Jr(!1);return e&&t&&(this._stats&&=new lt),t}#Jr(e=!1){if(this.#Kr(),!this.#Xr||this.destroyed)return!1;if(e)return this.#Gr=setTimeout(()=>{this.#Gr=null,this.#Jr(!1)},5e3),!1;for(const{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#Xr=!1,!0}#Kr(){this.#Gr&&(clearTimeout(this.#Gr),this.#Gr=null)}_startRenderPage(e,t){const r=this._intentStates.get(t);r&&(this._stats?.timeEnd("Page Request"),r.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let r=0,n=e.length;r<n;r++)t.operatorList.fnArray.push(e.fnArray[r]),t.operatorList.argsArray.push(e.argsArray[r]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(const e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this.#Jr(!0)}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:r,modifiedIds:n}){const{map:i,transfer:a}=r,s=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:i,modifiedIds:n},a).getReader(),o=this._intentStates.get(t);o.streamReader=s;const l=()=>{s.read().then(({value:e,done:t})=>{t?o.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,o),l())},e=>{if(o.streamReader=null,!this._transport.destroyed){if(o.operatorList){o.operatorList.lastChunk=!0;for(const e of o.renderTasks)e.operatorListChanged();this.#Jr(!0)}if(o.displayReadyCapability)o.displayReadyCapability.reject(e);else{if(!o.opListReadCapability)throw e;o.opListReadCapability.reject(e)}}})};l()}_abortOperatorList({intentState:e,reason:t,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(t instanceof nt){let r=100;return t.extraDelay>0&&t.extraDelay<1e3&&(r+=t.extraDelay),void(e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},r))}}if(e.streamReader.cancel(new Me(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[t,r]of this._intentStates)if(r===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}class Cn{#Qr=new Map;#Zr=Promise.resolve();postMessage(e,t){const r={data:structuredClone(e,t?{transfer:t}:null)};this.#Zr.then(()=>{for(const[e]of this.#Qr)e.call(this,r)})}addEventListener(e,t,r=null){let n=null;if(r?.signal instanceof AbortSignal){const{signal:i}=r;if(i.aborted)return void xe("LoopbackPort - cannot use an `aborted` signal.");const a=()=>this.removeEventListener(e,t);n=()=>i.removeEventListener("abort",a),i.addEventListener("abort",a)}this.#Qr.set(t,n)}removeEventListener(e,t){const r=this.#Qr.get(t);r?.(),this.#Qr.delete(t)}terminate(){for(const[,e]of this.#Qr)e?.();this.#Qr.clear()}}class Pn{static#en=0;static#tn=!1;static#rn;static{E&&(this.#tn=!0,Ar.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(e,t)=>{let r;try{if(r=new URL(e),!r.origin||"null"===r.origin)return!1}catch{return!1}const n=new URL(t,r);return r.origin===n.origin},this._createCDNWrapper=e=>{const t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))}}constructor({name:e=null,port:t=null,verbosity:r=be()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=r,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,t){if(Pn.#rn?.has(t))throw new Error("Cannot use more than one PDFWorker per port.");return(Pn.#rn||=new WeakMap).set(t,this),void this._initializeFromPort(t)}this._initialize()}get promise(){return E?Promise.all([Gt.promise,this._readyCapability.promise]):this._readyCapability.promise}#nn(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new Nr("main","worker",e),this._messageHandler.on("ready",function(){}),this.#nn()}_initialize(){if(Pn.#tn||Pn.#in)return void this._setupFakeWorker();let{workerSrc:e}=Pn;try{Pn._isSameOrigin(window.location.href,e)||(e=Pn._createCDNWrapper(new URL(e,window.location).href));const t=new Worker(e,{type:"module"}),r=new Nr("main","worker",t),n=()=>{i.abort(),r.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},i=new AbortController;t.addEventListener("error",()=>{this._webWorker||n()},{signal:i.signal}),r.on("test",e=>{i.abort(),!this.destroyed&&e?(this._messageHandler=r,this._port=t,this._webWorker=t,this.#nn()):n()}),r.on("ready",e=>{if(i.abort(),this.destroyed)n();else try{a()}catch{this._setupFakeWorker()}});const a=()=>{const e=new Uint8Array;r.send("test",e,[e.buffer])};return void a()}catch{we("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){Pn.#tn||(xe("Setting up fake worker."),Pn.#tn=!0),Pn._setupFakeWorkerGlobal.then(e=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const t=new Cn;this._port=t;const r="fake"+Pn.#en++,n=new Nr(r+"_worker",r,t);e.setup(n,t),this._messageHandler=new Nr(r,r+"_worker",t),this.#nn()}).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),Pn.#rn?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const t=this.#rn?.get(e.port);
vendor: 28,828 bytes, line 22
22if(t){if(t._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new Pn(e)}static get workerSrc(){if(Ar.workerSrc)return Ar.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#in(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return _e(this,"_setupFakeWorkerGlobal",(async()=>{if(this.#in)return this.#in;return(await(import(this.workerSrc))).WorkerMessageHandler})())}}class Rn{#an=new Map;#sn=new Map;#on=new Map;#ln=new Map;#cn=null;constructor(e,t,r,n,i){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new Dn,this.fontLoader=new Ft({ownerDocument:n.ownerDocument,styleElement:n.styleElement}),this.loadingParams=n.loadingParams,this._params=n,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.cMapReaderFactory=i.cMapReaderFactory,this.standardFontDataFactory=i.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#un(e,t=null){const r=this.#an.get(e);if(r)return r;const n=this.messageHandler.sendWithPromise(e,t);return this.#an.set(e,n),n}get annotationStorage(){return _e(this,"annotationStorage",new Nt)}getRenderingIntent(e,t=L.ENABLE,r=null,n=!1,i=!1){let a=C,s=It;switch(e){case"any":a=T;break;case"display":break;case"print":a=P;break;default:xe(`getRenderingIntent - invalid intent: ${e}`)}const o=a&P&&r instanceof jt?r:this.annotationStorage;switch(t){case L.DISABLE:a+=D;break;case L.ENABLE:break;case L.ENABLE_FORMS:a+=R;break;case L.ENABLE_STORAGE:a+=O,s=o.serializable;break;default:xe(`getRenderingIntent - invalid annotationMode: ${t}`)}n&&(a+=k),i&&(a+=M);const{ids:l,hash:c}=o.modifiedIds;return{renderingIntent:a,cacheKey:[a,s.hash,c].join("_"),annotationStorageSerializable:s,modifiedIds:l}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#cn?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const t of this.#sn.values())e.push(t._destroy());this.#sn.clear(),this.#on.clear(),this.#ln.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#an.clear(),this.filterFactory.destroy(),gn.cleanup(),this._networkStream?.cancelAllRequests(new Me("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:t}=this;e.on("GetReader",(e,t)=>{Se(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=e=>{this._lastProgress={loaded:e.loaded,total:e.total}},t.onPull=()=>{this._fullReader.read().then(function({value:e,done:r}){r?t.close():(Se(e instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{this._fullReader.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on("ReaderHeadersReady",async e=>{await this._fullReader.headersReady;const{isStreamingSupported:r,isRangeSupported:n,contentLength:i}=this._fullReader;return r&&n||(this._lastProgress&&t.onProgress?.(this._lastProgress),this._fullReader.onProgress=e=>{t.onProgress?.({loaded:e.loaded,total:e.total})}),{isStreamingSupported:r,isRangeSupported:n,contentLength:i}}),e.on("GetRangeReader",(e,t)=>{Se(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const r=this._networkStream.getRangeReader(e.begin,e.end);r?(t.onPull=()=>{r.read().then(function({value:e,done:r}){r?t.close():(Se(e instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),t.enqueue(new Uint8Array(e),1,[e]))}).catch(e=>{t.error(e)})},t.onCancel=e=>{r.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}):t.close()}),e.on("GetDoc",({pdfInfo:e})=>{this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new _n(e,this))}),e.on("DocException",function(e){let r;switch(e.name){case"PasswordException":r=new Ce(e.message,e.code);break;case"InvalidPDFException":r=new Re(e.message);break;case"MissingPDFException":r=new Oe(e.message);break;case"UnexpectedResponseException":r=new De(e.message,e.status);break;case"UnknownErrorException":r=new Pe(e.message,e.details);break;default:Ee("DocException - expected a valid Error.")}t._capability.reject(r)}),e.on("PasswordRequest",e=>{if(this.#cn=Promise.withResolvers(),t.onPassword){const r=e=>{e instanceof Error?this.#cn.reject(e):this.#cn.resolve({password:e})};try{t.onPassword(r,e.code)}catch(e){this.#cn.reject(e)}}else this.#cn.reject(new Ce(e.message,e.code));return this.#cn.promise}),e.on("DataLoaded",e=>{t.onProgress?.({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on("StartRenderPage",e=>{if(this.destroyed)return;this.#sn.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}),e.on("commonobj",([t,r,n])=>{if(this.destroyed)return null;if(this.commonObjs.has(t))return null;switch(r){case"Font":const{disableFontFace:i,fontExtraProperties:a,pdfBug:s}=this._params;if("error"in n){const e=n.error;xe(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}const o=s&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,l=new Ht(n,{disableFontFace:i,inspectFont:o});this.fontLoader.bind(l).catch(()=>e.sendWithPromise("FontFallback",{id:t})).finally(()=>{!a&&l.data&&(l.data=null),this.commonObjs.resolve(t,l)});break;case"CopyLocalImage":const{imageRef:c}=n;Se(c,"The imageRef must be defined.");for(const e of this.#sn.values())for(const[,r]of e.objs)if(r?.ref===c)return r.dataLen?(this.commonObjs.resolve(t,structuredClone(r)),r.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(t,n);break;default:throw new Error(`Got unknown common object type ${r}`)}return null}),e.on("obj",([e,t,r,n])=>{if(this.destroyed)return;const i=this.#sn.get(t);if(!i.objs.has(e))if(0!==i._intentStates.size)switch(r){case"Image":i.objs.resolve(e,n),n?.dataLen>1e7&&(i._maybeCleanupAfterRender=!0);break;case"Pattern":i.objs.resolve(e,n);break;default:throw new Error(`Got unknown object type ${r}`)}else n?.bitmap?.close()}),e.on("DocProgress",e=>{this.destroyed||t.onProgress?.({loaded:e.loaded,total:e.total})}),e.on("FetchBuiltInCMap",async e=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.cMapReaderFactory)throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(e)}),e.on("FetchStandardFontData",async e=>{if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.standardFontDataFactory)throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(e)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&xe("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const t=e-1,r=this.#on.get(t);if(r)return r;const n=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(r=>{if(this.destroyed)throw new Error("Transport destroyed");r.refStr&&this.#ln.set(r.refStr,e);const n=new Tn(t,r,this,this._params.pdfBug);return this.#sn.set(t,n),n});return this.#on.set(t,n),n}getPageIndex(e){return En(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#un("GetFieldObjects")}hasJSActions(){return this.#un("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return"string"!=typeof e?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)}getDocJSActions(){return this.#un("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#un("GetOptionalContentConfig").then(t=>new Br(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",t=this.#an.get(e);if(t)return t;const r=this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new jr(e[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#an.set(e,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const e of this.#sn.values()){if(!e.cleanup())throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`)}this.commonObjs.clear(),e||this.fontLoader.clear(),this.#an.clear(),this.filterFactory.destroy(!0),gn.cleanup()}}cachedPageNumber(e){if(!En(e))return null;const t=0===e.gen?`${e.num}R`:`${e.num}R${e.gen}`;return this.#ln.get(t)??null}}const On=Symbol("INITIAL_DATA");class Dn{#dn=Object.create(null);#hn(e){return this.#dn[e]||={...Promise.withResolvers(),data:On}}get(e,t=null){if(t){const r=this.#hn(e);return r.promise.then(()=>t(r.data)),null}const r=this.#dn[e];if(!r||r.data===On)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const t=this.#dn[e];return!!t&&t.data!==On}resolve(e,t=null){const r=this.#hn(e);r.data=t,r.resolve()}clear(){for(const e in this.#dn){const{data:t}=this.#dn[e];t?.bitmap?.close()}this.#dn=Object.create(null)}*[Symbol.iterator](){for(const e in this.#dn){const{data:t}=this.#dn[e];t!==On&&(yield[e,t])}}}class kn{#pn=null;constructor(e){this.#pn=e,this.onContinue=null}get promise(){return this.#pn.capability.promise}cancel(e=0){this.#pn.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#pn.operatorList;if(!e)return!1;const{annotationCanvasMap:t}=this.#pn;return e.form||e.canvas&&t?.size>0}}class Mn{#fn=null;static#gn=new WeakSet;constructor({callback:e,params:t,objs:r,commonObjs:n,annotationCanvasMap:i,operatorList:a,pageIndex:s,canvasFactory:o,filterFactory:l,useRequestAnimationFrame:c=!1,pdfBug:u=!1,pageColors:d=null}){this.callback=e,this.params=t,this.objs=r,this.commonObjs=n,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=s,this.canvasFactory=o,this.filterFactory=l,this._pdfBug=u,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new kn(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(Mn.#gn.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");Mn.#gn.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:r,viewport:n,transform:i,background:a}=this.params;this.gfx=new Sr(r,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:i,viewport:n,transparency:e,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#fn&&(window.cancelAnimationFrame(this.#fn),this.#fn=null),Mn.#gn.delete(this._canvas),this.callback(e||new nt(`Rendering cancelled, page ${this._pageIndex+1}`,t))}operatorListChanged(){this.graphicsReady?(this.stepper?.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||=this._continueBound}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#fn=window.requestAnimationFrame(()=>{this.#fn=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),Mn.#gn.delete(this._canvas),this.callback())))}}const Ln="4.8.69",In="3634dab10";function Nn(e){return Math.floor(255*Math.max(0,Math.min(1,e))).toString(16).padStart(2,"0")}function jn(e){return Math.max(0,Math.min(255,255*e))}class Fn{static CMYK_G([e,t,r,n]){return["G",1-Math.min(1,.3*e+.59*r+.11*t+n)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return[e=jn(e),e,e]}static G_HTML([e]){const t=Nn(e);return`#${t}${t}${t}`}static RGB_G([e,t,r]){return["G",.3*e+.59*t+.11*r]}static RGB_rgb(e){return e.map(jn)}static RGB_HTML(e){return`#${e.map(Nn).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,r,n]){return["RGB",1-Math.min(1,e+n),1-Math.min(1,r+n),1-Math.min(1,t+n)]}static CMYK_rgb([e,t,r,n]){return[jn(1-Math.min(1,e+n)),jn(1-Math.min(1,r+n)),jn(1-Math.min(1,t+n))]}static CMYK_HTML(e){const t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,r]){const n=1-e,i=1-t,a=1-r;return["CMYK",n,i,a,Math.min(n,i,a)]}}class Hn{create(e,t,r=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");const n=this._createSVG("svg:svg");return n.setAttribute("version","1.1"),r||(n.setAttribute("width",`${e}px`),n.setAttribute("height",`${t}px`)),n.setAttribute("preserveAspectRatio","none"),n.setAttribute("viewBox",`0 0 ${e} ${t}`),n}createElement(e){if("string"!=typeof e)throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Ee("Abstract method `_createSVG` called.")}}class Bn extends Hn{_createSVG(e){return document.createElementNS(Ze,e)}}class zn{static setupStorage(e,t,r,n,i){const a=n.getValue(t,{value:null});switch(r.name){case"textarea":if(null!==a.value&&(e.textContent=a.value),"print"===i)break;e.addEventListener("input",e=>{n.setValue(t,{value:e.target.value})});break;case"input":if("radio"===r.attributes.type||"checkbox"===r.attributes.type){if(a.value===r.attributes.xfaOn?e.setAttribute("checked",!0):a.value===r.attributes.xfaOff&&e.removeAttribute("checked"),"print"===i)break;e.addEventListener("change",e=>{n.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})})}else{if(null!==a.value&&e.setAttribute("value",a.value),"print"===i)break;e.addEventListener("input",e=>{n.setValue(t,{value:e.target.value})})}break;case"select":if(null!==a.value){e.setAttribute("value",a.value);for(const e of r.children)e.attributes.value===a.value?e.attributes.selected=!0:e.attributes.hasOwnProperty("selected")&&delete e.attributes.selected}e.addEventListener("input",e=>{const r=e.target.options,i=-1===r.selectedIndex?"":r[r.selectedIndex].value;n.setValue(t,{value:i})})}}static setAttributes({html:e,element:t,storage:r=null,intent:n,linkService:i}){const{attributes:a}=t,s=e instanceof HTMLAnchorElement;"radio"===a.type&&(a.name=`${a.name}-${n}`);for(const[t,r]of Object.entries(a))if(null!=r)switch(t){case"class":r.length&&e.setAttribute(t,r.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",r);break;case"style":Object.assign(e.style,r);break;case"textContent":e.textContent=r;break;default:(!s||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,r)}s&&i.addLinkAttributes(e,a.href,a.newWindow),r&&a.dataId&&this.setupStorage(e,a.dataId,t,r)}static render(e){const t=e.annotationStorage,r=e.linkService,n=e.xfaHtml,i=e.intent||"display",a=document.createElement(n.name);n.attributes&&this.setAttributes({html:a,element:n,intent:i,linkService:r});const s="richText"!==i,o=e.div;if(o.append(a),e.viewport){const t=`matrix(${e.viewport.transform.join(",")})`;o.style.transform=t}s&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===n.children.length){if(n.value){const e=document.createTextNode(n.value);a.append(e),s&&mn.shouldBuildText(n.name)&&l.push(e)}return{textDivs:l}}const c=[[n,-1,a]];for(;c.length>0;){const[e,n,a]=c.at(-1);if(n+1===e.children.length){c.pop();continue}const o=e.children[++c.at(-1)[1]];if(null===o)continue;const{name:u}=o;if("#text"===u){const e=document.createTextNode(o.value);l.push(e),a.append(e);continue}const d=o?.attributes?.xmlns?document.createElementNS(o.attributes.xmlns,u):document.createElement(u);if(a.append(d),o.attributes&&this.setAttributes({html:d,element:o,storage:t,intent:i,linkService:r}),o.children?.length>0)c.push([o,-1,d]);else if(o.value){const e=document.createTextNode(o.value);s&&mn.shouldBuildText(u)&&l.push(e),d.append(e)}}for(const e of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))e.setAttribute("readOnly",!0);return{textDivs:l}}static update(e){const t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}}const $n=1e3,Un=new WeakSet;function Wn(e){return{width:e[2]-e[0],height:e[3]-e[1]}}class Vn{static create(e){switch(e.data.annotationType){case q:return new Yn(e);case V:return new Gn(e);case le:switch(e.data.fieldType){case"Tx":return new Kn(e);case"Btn":return e.data.radioButton?new Zn(e):e.data.checkBox?new Qn(e):new ei(e);case"Ch":return new ti(e);case"Sig":return new Jn(e)}return new Xn(e);case se:return new ri(e);case Y:return new ii(e);case G:return new ai(e);case X:return new si(e);case K:return new oi(e);case Q:return new li(e);case ie:return new ui(e);case ae:return new di(e);case J:return new ci(e);case Z:return new hi(e);case ee:return new pi(e);case te:return new fi(e);case re:return new gi(e);case ne:return new mi(e);case oe:return new vi(e);default:return new qn(e)}}}class qn{#mn=null;#vn=!1;#yn=null;constructor(e,{isRenderable:t=!1,ignoreBorder:r=!1,createQuadrilaterals:n=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(r)),n&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:t,richText:r}){return!!(e?.str||t?.str||r?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return qn._hasPopupData(this.data)}updateEdited(e){if(!this.container)return;this.#mn||={rect:this.data.rect.slice(0)};const{rect:t}=e;t&&this.#bn(t),this.#yn?.popup.updateEdited(e)}resetEdited(){this.#mn&&(this.#bn(this.#mn.rect),this.#yn?.popup.resetEdited(),this.#mn=null)}#bn(e){const{container:{style:t},data:{rect:r,rotation:n},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:a,pageX:s,pageY:o}}}}=this;r?.splice(0,4,...e);const{width:l,height:c}=Wn(e);t.left=100*(e[0]-s)/i+"%",t.top=100*(a-e[3]+o)/a+"%",0===n?(t.width=100*l/i+"%",t.height=100*c/a+"%"):this.setRotation(n)}_createContainer(e){const{data:t,parent:{page:r,viewport:n}}=this,i=document.createElement("section");i.setAttribute("data-annotation-id",t.id),this instanceof Xn||(i.tabIndex=$n);const{style:a}=i;if(a.zIndex=this.parent.zIndex++,t.alternativeText&&(i.title=t.alternativeText),t.noRotate&&i.classList.add("norotate"),!t.rect||this instanceof ri){const{rotation:e}=t;return t.hasOwnCanvas||0===e||this.setRotation(e,i),i}const{width:s,height:o}=Wn(t.rect);if(!e&&t.borderStyle.width>0){a.borderWidth=`${t.borderStyle.width}px`;const e=t.borderStyle.horizontalCornerRadius,r=t.borderStyle.verticalCornerRadius;if(e>0||r>0){const t=`calc(${e}px * var(--scale-factor)) / calc(${r}px * var(--scale-factor))`;a.borderRadius=t}else if(this instanceof Zn){const e=`calc(${s}px * var(--scale-factor)) / calc(${o}px * var(--scale-factor))`;a.borderRadius=e}switch(t.borderStyle.style){case ce:a.borderStyle="solid";break;case ue:a.borderStyle="dashed";break;case de:xe("Unimplemented border style: beveled");break;case he:xe("Unimplemented border style: inset");break;case pe:a.borderBottomStyle="solid"}const n=t.borderColor||null;n?(this.#vn=!0,a.borderColor=He.makeHexColor(0|n[0],0|n[1],0|n[2])):a.borderWidth=0}const l=He.normalizeRect([t.rect[0],r.view[3]-t.rect[1]+r.view[1],t.rect[2],r.view[3]-t.rect[3]+r.view[1]]),{pageWidth:c,pageHeight:u,pageX:d,pageY:h}=n.rawDims;a.left=100*(l[0]-d)/c+"%",a.top=100*(l[1]-h)/u+"%";const{rotation:p}=t;return t.hasOwnCanvas||0===p?(a.width=100*s/c+"%",a.height=100*o/u+"%"):this.setRotation(p,i),i}setRotation(e,t=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:n}=this.parent.viewport.rawDims,{width:i,height:a}=Wn(this.data.rect);let s,o;e%180==0?(s=100*i/r,o=100*a/n):(s=100*a/r,o=100*i/n),t.style.width=`${s}%`,t.style.height=`${o}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(e,t,r)=>{const n=r.detail[e],i=n[0],a=n.slice(1);r.target.style[t]=Fn[`${i}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[t]:Fn[`${i}_rgb`](a)})};return _e(this,"_commonActions",{display:e=>{const{display:t}=e.detail,r=t%2==1;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:r,noPrint:1===t||2===t})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{const{hidden:t}=e.detail;this.container.style.visibility=t?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:e=>{const t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){const r=this._commonActions;for(const n of Object.keys(t.detail)){const i=e[n]||r[n];i?.(t)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;const r=this._commonActions;for(const[n,i]of Object.entries(t)){const a=r[n];if(a){a({detail:{[n]:i},target:e}),delete t[n]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[t,r,n,i]=this.data.rect.map(e=>Math.fround(e));if(8===e.length){const[a,s,o,l]=e.subarray(2,6);if(n===a&&i===s&&t===o&&r===l)return}const{style:a}=this.container;let s;if(this.#vn){const{borderColor:e,borderWidth:t}=a;a.borderWidth=0,s=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${e}" stroke-width="${t}">`],this.container.classList.add("hasBorder")}const o=n-t,l=i-r,{svgFactory:c}=this,u=c.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0);const d=c.createElement("defs");u.append(d);const h=c.createElement("clipPath"),p=`clippath_${this.data.id}`;h.setAttribute("id",p),h.setAttribute("clipPathUnits","objectBoundingBox"),d.append(h);for(let r=2,n=e.length;r<n;r+=8){const n=e[r],a=e[r+1],u=e[r+2],d=e[r+3],p=c.createElement("rect"),f=(u-t)/o,g=(i-a)/l,m=(n-u)/o,v=(a-d)/l;p.setAttribute("x",f),p.setAttribute("y",g),p.setAttribute("width",m),p.setAttribute("height",v),h.append(p),s?.push(`<rect vector-effect="non-scaling-stroke" x="${f}" y="${g}" width="${m}" height="${v}"/>`)}this.#vn&&(s.push("</g></svg>')"),a.backgroundImage=s.join("")),this.container.append(u),this.container.style.clipPath=`url(#${p})`}_createPopup(){const{data:e}=this,t=this.#yn=new ri({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(t.render())}render(){Ee("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){const r=[];if(this._fieldObjects){const n=this._fieldObjects[e];if(n)for(const{page:e,id:i,exportValues:a}of n){if(-1===e)continue;if(i===t)continue;const n="string"==typeof a?a:null,s=document.querySelector(`[data-element-id="${i}"]`);!s||Un.has(s)?r.push({id:i,exportValue:n,domElement:s}):xe(`_getElementsByName - element not allowed: ${i}`)}return r}for(const n of document.getElementsByName(e)){const{exportValue:e}=n,i=n.getAttribute("data-element-id");i!==t&&(Un.has(n)&&r.push({id:i,exportValue:e,domElement:n}))}return r}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})})}}class Yn extends qn{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:t}=this,r=document.createElement("a");r.setAttribute("data-element-id",e.id);let n=!1;return e.url?(t.addLinkAttributes(r,e.url,e.newWindow),n=!0):e.action?(this._bindNamedAction(r,e.action),n=!0):e.attachment?(this.#wn(r,e.attachment,e.attachmentDest),n=!0):e.setOCGState?(this.#xn(r,e.setOCGState),n=!0):e.dest?(this._bindLink(r,e.dest),n=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,e),n=!0),e.resetForm?(this._bindResetFormAction(r,e.resetForm),n=!0):this.isTooltipOnly&&!n&&(this._bindLink(r,""),n=!0)),this.container.classList.add("linkA
22nnotation"),n&&this.container.append(r),this.container}#En(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||""===t)&&this.#En()}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),this.#En()}#wn(e,t,r=null){e.href=this.linkService.getAnchorUrl(""),t.description&&(e.title=t.description),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,r),!1),this.#En()}#xn(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),this.#En()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const n of Object.keys(t.actions)){const i=r.get(n);i&&(e[i]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:n}}),!1))}e.onclick||(e.onclick=()=>!1),this.#En()}_bindResetFormAction(e,t){const r=e.onclick;if(r||(e.href=this.linkService.getAnchorUrl("")),this.#En(),!this._fieldObjects)return xe('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(r||(e.onclick=()=>!1));e.onclick=()=>{r?.();const{fields:e,refs:n,include:i}=t,a=[];if(0!==e.length||0!==n.length){const t=new Set(n);for(const r of e){const e=this._fieldObjects[r]||[];for(const{id:r}of e)t.add(r)}for(const e of Object.values(this._fieldObjects))for(const r of e)t.has(r.id)===i&&a.push(r)}else for(const e of Object.values(this._fieldObjects))a.push(...e);const s=this.annotationStorage,o=[];for(const e of a){const{id:t}=e;switch(o.push(t),e.type){case"text":{const r=e.defaultValue||"";s.setValue(t,{value:r});break}case"checkbox":case"radiobutton":{const r=e.defaultValue===e.exportValues;s.setValue(t,{value:r});break}case"combobox":case"listbox":{const r=e.defaultValue||"";s.setValue(t,{value:r});break}default:continue}const r=document.querySelector(`[data-element-id="${t}"]`);r&&(Un.has(r)?r.dispatchEvent(new Event("resetform")):xe(`_bindResetFormAction - element not allowed: ${t}`))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}),!1}}}class Gn extends qn{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}}class Xn extends qn{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&("CANVAS"===e.previousSibling?.nodeName&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return je.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,r,n,i){r.includes("mouse")?e.addEventListener(r,e=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:i(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})}):e.addEventListener(r,e=>{if("blur"===r){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if("focus"===r){if(t.focused)return;t.focused=!0}i&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:n,value:i(e)}})})}_setEventListeners(e,t,r,n){for(const[i,a]of r)("Action"===a||this.data.actions?.[a])&&("Focus"!==a&&"Blur"!==a||(t||={focused:!1}),this._setEventListener(e,t,i,a,n),"Focus"!==a||this.data.actions?.Blur?"Blur"!==a||this.data.actions?.Focus||this._setEventListener(e,t,"focus","Focus",null):this._setEventListener(e,t,"blur","Blur",null))}_setBackgroundColor(e){const t=this.data.backgroundColor||null;e.style.backgroundColor=null===t?"transparent":He.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){const t=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,n=this.data.defaultAppearanceData.fontSize||9,i=e.style;let a;const s=e=>Math.round(10*e)/10;if(this.data.multiLine){const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(_*n))||1);a=Math.min(n,s(t/_))}else{const e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(n,s(e/_))}i.fontSize=`calc(${a}px * var(--scale-factor))`,i.color=He.makeHexColor(r[0],r[1],r[2]),null!==this.data.textAlignment&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}}class Kn extends Xn{constructor(e){super(e,{isRenderable:e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue})}setPropertyOnSiblings(e,t,r,n){const i=this.annotationStorage;
vendor: 12,582 bytes, line 22
22for(const a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=r),i.setValue(a.id,{[n]:r})}render(){const e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){const n=e.getValue(t,{value:this.data.fieldValue});let i=n.value||"";const a=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;a&&i.length>a&&(i=i.slice(0,a));let s=n.formattedValue||this.data.textContent?.join("\n")||null;s&&this.data.comb&&(s=s.replaceAll(/\s+/g,""));const o={userValue:i,formattedValue:s,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=s??i,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type="text",r.setAttribute("value",s??i),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),Un.add(r),r.setAttribute("data-element-id",t),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=$n,this._setRequired(r,this.data.required),a&&(r.maxLength=a),r.addEventListener("input",n=>{e.setValue(t,{value:n.target.value}),this.setPropertyOnSiblings(r,"value",n.target.value,"value"),o.formattedValue=null}),r.addEventListener("resetform",e=>{const t=this.data.defaultFieldValue??"";r.value=o.userValue=t,o.formattedValue=null});let l=e=>{const{formattedValue:t}=o;null!=t&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",e=>{if(o.focused)return;const{target:t}=e;o.userValue&&(t.value=o.userValue),o.lastCommittedValue=t.value,o.commitKey=1,this.data.actions?.Focus||(o.focused=!0)}),r.addEventListener("updatefromsandbox",r=>{this.showElementAndHideCanvas(r.target);const n={value(r){o.userValue=r.detail.value??"",e.setValue(t,{value:o.userValue.toString()}),r.target.value=o.userValue},formattedValue(r){const{formattedValue:n}=r.detail;o.formattedValue=n,null!=n&&r.target!==document.activeElement&&(r.target.value=n),e.setValue(t,{formattedValue:n})},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:r=>{const{charLimit:n}=r.detail,{target:i}=r;if(0===n)return void i.removeAttribute("maxLength");i.setAttribute("maxLength",n);let a=o.userValue;!a||a.length<=n||(a=a.slice(0,n),i.value=o.userValue=a,e.setValue(t,{value:a}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:a,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}};this._dispatchEventFromSandbox(n,r)}),r.addEventListener("keydown",e=>{o.commitKey=1;let r=-1;if("Escape"===e.key?r=0:"Enter"!==e.key||this.data.multiLine?"Tab"===e.key&&(o.commitKey=3):r=2,-1===r)return;const{value:n}=e.target;o.lastCommittedValue!==n&&(o.lastCommittedValue=n,o.userValue=n,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:n,willCommit:!0,commitKey:r,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});const n=l;l=null,r.addEventListener("blur",e=>{if(!o.focused||!e.relatedTarget)return;this.data.actions?.Blur||(o.focused=!1);const{value:r}=e.target;o.userValue=r,o.lastCommittedValue!==r&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:r,willCommit:!0,commitKey:o.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),n(e)}),this.data.actions?.Keystroke&&r.addEventListener("beforeinput",e=>{o.lastCommittedValue=null;const{data:r,target:n}=e,{value:i,selectionStart:a,selectionEnd:s}=n;let l=a,c=s;switch(e.inputType){case"deleteWordBackward":{const e=i.substring(0,a).match(/\w*[^\w]*$/);e&&(l-=e[0].length);break}case"deleteWordForward":{const e=i.substring(a).match(/^[^\w]*\w*/);e&&(c+=e[0].length);break}case"deleteContentBackward":a===s&&(l-=1);break;case"deleteContentForward":a===s&&(c+=1)}e.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:i,change:r||"",willCommit:!1,selStart:l,selEnd:c}})}),this._setEventListeners(r,o,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.value)}if(l&&r.addEventListener("blur",l),this.data.comb){const e=(this.data.rect[2]-this.data.rect[0])/a;r.classList.add("comb"),r.style.letterSpacing=`calc(${e}px * var(--scale-factor) - 1ch)`}}else r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell",this.data.hasOwnCanvas&&(r.hidden=!0);return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class Jn extends Xn{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class Qn extends Xn{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,t=this.data,r=t.id;let n=e.getValue(r,{value:t.exportValue===t.fieldValue}).value;"string"==typeof n&&(n="Off"!==n,e.setValue(r,{value:n})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const i=document.createElement("input");return Un.add(i),i.setAttribute("data-element-id",r),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="checkbox",i.name=t.fieldName,n&&i.setAttribute("checked",!0),i.setAttribute("exportValue",t.exportValue),i.tabIndex=$n,i.addEventListener("change",n=>{const{name:i,checked:a}=n.target;for(const n of this._getElementsByName(i,r)){const r=a&&n.exportValue===t.exportValue;n.domElement&&(n.domElement.checked=r),e.setValue(n.id,{value:r})}e.setValue(r,{value:a})}),i.addEventListener("resetform",e=>{const r=t.defaultFieldValue||"Off";e.target.checked=r===t.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener("updatefromsandbox",t=>{const n={value(t){t.target.checked="Off"!==t.detail.value,e.setValue(r,{value:t.target.checked})}};this._dispatchEventFromSandbox(n,t)}),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Zn extends Xn{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,t=this.data,r=t.id;let n=e.getValue(r,{value:t.fieldValue===t.buttonValue}).value;if("string"==typeof n&&(n=n!==t.buttonValue,e.setValue(r,{value:n})),n)for(const n of this._getElementsByName(t.fieldName,r))e.setValue(n.id,{value:!1});const i=document.createElement("input");if(Un.add(i),i.setAttribute("data-element-id",r),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type="radio",i.name=t.fieldName,n&&i.setAttribute("checked",!0),i.tabIndex=$n,i.addEventListener("change",t=>{const{name:n,checked:i}=t.target;for(const t of this._getElementsByName(n,r))e.setValue(t.id,{value:!1});e.setValue(r,{value:i})}),i.addEventListener("resetform",e=>{const r=t.defaultFieldValue;e.target.checked=null!=r&&r===t.buttonValue}),this.enableScripting&&this.hasJSActions){const n=t.buttonValue;i.addEventListener("updatefromsandbox",t=>{const i={value:t=>{const i=n===t.detail.value;for(const n of this._getElementsByName(t.target.name)){const t=i&&n.id===r;n.domElement&&(n.domElement.checked=t),e.setValue(n.id,{value:t})}}};this._dispatchEventFromSandbox(i,t)}),this._setEventListeners(i,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],e=>e.target.checked)}return this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class ei extends Yn{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",e=>{this._dispatchEventFromSandbox({},e)})),e}}class ti extends Xn{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,t=this.data.id,r=e.getValue(t,{value:this.data.fieldValue}),n=document.createElement("select");Un.add(n),n.setAttribute("data-element-id",t),n.disabled=this.data.readOnly,this._setRequired(n,this.data.required),n.name=this.data.fieldName,n.tabIndex=$n;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(n.size=this.data.options.length,this.data.multiSelect&&(n.multiple=!0)),n.addEventListener("resetform",e=>{const t=this.data.defaultFieldValue;for(const e of n.options)e.selected=e.value===t});for(const e of this.data.options){const t=document.createElement("option");t.textContent=e.displayValue,t.value=e.exportValue,r.value.includes(e.exportValue)&&(t.setAttribute("selected",!0),i=!1),n.append(t)}let a=null;if(i){const e=document.createElement("option");e.value=" ",e.setAttribute("hidden",!0),e.setAttribute("selected",!0),n.prepend(e),a=()=>{e.remove(),n.removeEventListener("input",a),a=null},n.addEventListener("input",a)}const s=e=>{const t=e?"value":"textContent",{options:r,multiple:i}=n;return i?Array.prototype.filter.call(r,e=>e.selected).map(e=>e[t]):-1===r.selectedIndex?null:r[r.selectedIndex][t]};let o=s(!1);const l=e=>{const t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(n.addEventListener("updatefromsandbox",r=>{const i={value(r){a?.();const i=r.detail.value,l=new Set(Array.isArray(i)?i:[i]);for(const e of n.options)e.selected=l.has(e.value);e.setValue(t,{value:s(!0)}),o=s(!1)},multipleSelection(e){n.multiple=!0},remove(r){const i=n.options,a=r.detail.remove;if(i[a].selected=!1,n.remove(a),i.length>0){-1===Array.prototype.findIndex.call(i,e=>e.selected)&&(i[0].selected=!0)}e.setValue(t,{value:s(!0),items:l(r)}),o=s(!1)},clear(r){for(;0!==n.length;)n.remove(0);e.setValue(t,{value:null,items:[]}),o=s(!1)},insert(r){const{index:i,displayValue:a,exportValue:c}=r.detail.insert,u=n.children[i],d=document.createElement("option");d.textContent=a,d.value=c,u?u.before(d):n.append(d),e.setValue(t,{value:s(!0),items:l(r)}),o=s(!1)},items(r){const{items:i}=r.detail;for(;0!==n.length;)n.remove(0);for(const e of i){const{displayValue:t,exportValue:r}=e,i=document.createElement("option");i.textContent=t,i.value=r,n.append(i)}n.options.length>0&&(n.options[0].selected=!0),e.setValue(t,{value:s(!0),items:l(r)}),o=s(!1)},indices(r){const n=new Set(r.detail.indices);for(const e of r.target.options)e.selected=n.has(e.index);e.setValue(t,{value:s(!0)}),o=s(!1)},editable(e){e.target.disabled=!e.detail.editable}};this._dispatchEventFromSandbox(i,r)}),n.addEventListener("input",r=>{const n=s(!0),i=s(!1);e.setValue(t,{value:n}),r.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:o,change:i,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(n,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],e=>e.target.value)):n.addEventListener("input",function(r){e.setValue(t,{value:s(!0)})}),this.data.combo&&this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class ri extends qn{constructor(e){const{data:t,elements:r}=e;super(e,{isRenderable:qn._hasPopupData(t)}),this.elements=r,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new ni({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),t=[];for(const r of this.elements)r.popup=e,r.container.ariaHasPopup="dialog",t.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",t.map(e=>`${Ue}${e}`).join(",")),this.container}}
22class ni{#Sn=this.#An.bind(this);#_n=this.#Tn.bind(this);#Cn=this.#Pn.bind(this);#Rn=this.#On.bind(this);#Dn=null;#he=null;#kn=null;#Mn=null;#Ln=null;#In=null;#Nn=null;#jn=!1;#Fn=null;#T=null;#Hn=null;#Bn=null;#zn=null;#mn=null;#$n=!1;constructor({container:e,color:t,elements:r,titleObj:n,modificationDate:i,contentsObj:a,richText:s,parent:o,rect:l,parentRect:c,open:u}){this.#he=e,this.#zn=n,this.#kn=a,this.#Bn=s,this.#In=o,this.#Dn=t,this.#Hn=l,this.#Nn=c,this.#Ln=r,this.#Mn=ht.toDateObject(i),this.trigger=r.flatMap(e=>e.getElementsToTriggerPopup());for(const e of this.trigger)e.addEventListener("click",this.#Rn),e.addEventListener("mouseenter",this.#Cn),e.addEventListener("mouseleave",this.#_n),e.classList.add("popupTriggerArea");for(const e of r)e.container?.addEventListener("keydown",this.#Sn);this.#he.hidden=!0,u&&this.#On()}render(){if(this.#Fn)return;const e=this.#Fn=document.createElement("div");if(e.className="popup",this.#Dn){const t=e.style.outlineColor=He.makeHexColor(...this.#Dn);if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))e.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`;else{const t=.7;e.style.backgroundColor=He.makeHexColor(...this.#Dn.map(e=>Math.floor(t*(255-e)+e)))}}const t=document.createElement("span");t.className="header";const r=document.createElement("h1");if(t.append(r),({dir:r.dir,str:r.textContent}=this.#zn),e.append(t),this.#Mn){const e=document.createElement("span");e.classList.add("popupDate"),e.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),e.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#Mn.valueOf()})),t.append(e)}const n=this.#Un;if(n)zn.render({xfaHtml:n,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const t=this._formatContents(this.#kn);e.append(t)}this.#he.append(e)}get#Un(){const e=this.#Bn,t=this.#kn;return!e?.str||t?.str&&t.str!==e.str?null:this.#Bn.html||null}get#Wn(){return this.#Un?.attributes?.style?.fontSize||0}get#Vn(){return this.#Un?.attributes?.style?.color||null}#qn(e){const t=[],r={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},n={style:{color:this.#Vn,fontSize:this.#Wn?`calc(${this.#Wn}px * var(--scale-factor))`:""}};for(const r of e.split("\n"))t.push({name:"span",value:r,attributes:n});return r}_formatContents({str:e,dir:t}){const r=document.createElement("p");r.classList.add("popupContent"),r.dir=t;const n=e.split(/(?:\r\n?|\n)/);for(let e=0,t=n.length;e<t;++e){const i=n[e];r.append(document.createTextNode(i)),e<t-1&&r.append(document.createElement("br"))}return r}#An(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||("Enter"===e.key||"Escape"===e.key&&this.#jn)&&this.#On()}updateEdited({rect:e,popupContent:t}){this.#mn||={contentsObj:this.#kn,richText:this.#Bn},e&&(this.#T=null),t&&(this.#Bn=this.#qn(t),this.#kn=null),this.#Fn?.remove(),this.#Fn=null}resetEdited(){this.#mn&&(({contentsObj:this.#kn,richText:this.#Bn}=this.#mn),this.#mn=null,this.#Fn?.remove(),this.#Fn=null,this.#T=null)}#Yn(){if(null!==this.#T)return;const{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:r,pageX:n,pageY:i}}}=this.#In;let a=!!this.#Nn,s=a?this.#Nn:this.#Hn;for(const e of this.#Ln)if(!s||null!==He.intersect(e.data.rect,s)){s=e.data.rect,a=!0;break}const o=He.normalizeRect([s[0],e[3]-s[1]+e[1],s[2],e[3]-s[3]+e[1]]),l=a?s[2]-s[0]+5:0,c=o[0]+l,u=o[1];this.#T=[100*(c-n)/t,100*(u-i)/r];const{style:d}=this.#he;d.left=`${this.#T[0]}%`,d.top=`${this.#T[1]}%`}#On(){this.#jn=!this.#jn,this.#jn?(this.#Pn(),this.#he.addEventListener("click",this.#Rn),this.#he.addEventListener("keydown",this.#Sn)):(this.#Tn(),this.#he.removeEventListener("click",this.#Rn),this.#he.removeEventListener("keydown",this.#Sn))}#Pn(){this.#Fn||this.render(),this.isVisible?this.#jn&&this.#he.classList.add("focused"):(this.#Yn(),this.#he.hidden=!1,this.#he.style.zIndex=parseInt(this.#he.style.zIndex)+1e3)}#Tn(){this.#he.classList.remove("focused"),!this.#jn&&this.isVisible&&(this.#he.hidden=!0,this.#he.style.zIndex=parseInt(this.#he.style.zIndex)-1e3)}forceHide(){this.#$n=this.isVisible,this.#$n&&(this.#he.hidden=!0)}maybeShow(){this.#$n&&(this.#Fn||this.#Pn(),this.#$n=!1,this.#he.hidden=!1)}get isVisible(){return!1===this.#he.hidden}}class ii extends qn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=I.FREETEXT}
vendor: 11,008 bytes, line 22
22render(){if(this.container.classList.add("freeTextAnnotation"),this.textContent){const e=document.createElement("div");e.classList.add("annotationTextContent"),e.setAttribute("role","comment");for(const t of this.textContent){const r=document.createElement("span");r.textContent=t,e.append(r)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class ai extends qn{#Gn=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("lineAnnotation");const e=this.data,{width:t,height:r}=Wn(e.rect),n=this.svgFactory.create(t,r,!0),i=this.#Gn=this.svgFactory.createElement("svg:line");return i.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]),i.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]),i.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]),i.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]),i.setAttribute("stroke-width",e.borderStyle.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),n.append(i),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Gn}addHighlightArea(){this.container.classList.add("highlightArea")}}class si extends qn{#Xn=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("squareAnnotation");const e=this.data,{width:t,height:r}=Wn(e.rect),n=this.svgFactory.create(t,r,!0),i=e.borderStyle.width,a=this.#Xn=this.svgFactory.createElement("svg:rect");return a.setAttribute("x",i/2),a.setAttribute("y",i/2),a.setAttribute("width",t-i),a.setAttribute("height",r-i),a.setAttribute("stroke-width",i||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Xn}addHighlightArea(){this.container.classList.add("highlightArea")}}class oi extends qn{#Kn=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add("circleAnnotation");const e=this.data,{width:t,height:r}=Wn(e.rect),n=this.svgFactory.create(t,r,!0),i=e.borderStyle.width,a=this.#Kn=this.svgFactory.createElement("svg:ellipse");return a.setAttribute("cx",t/2),a.setAttribute("cy",r/2),a.setAttribute("rx",t/2-i/2),a.setAttribute("ry",r/2-i/2),a.setAttribute("stroke-width",i||1),a.setAttribute("stroke","transparent"),a.setAttribute("fill","transparent"),n.append(a),this.container.append(n),!e.popupRef&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Kn}addHighlightArea(){this.container.classList.add("highlightArea")}}class li extends qn{#Jn=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="polylineAnnotation",this.svgElementName="svg:polyline"}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,vertices:t,borderStyle:r,popupRef:n}}=this;if(!t)return this.container;const{width:i,height:a}=Wn(e),s=this.svgFactory.create(i,a,!0);let o=[];for(let r=0,n=t.length;r<n;r+=2){const n=t[r]-e[0],i=e[3]-t[r+1];o.push(`${n},${i}`)}o=o.join(" ");const l=this.#Jn=this.svgFactory.createElement(this.svgElementName);return l.setAttribute("points",o),l.setAttribute("stroke-width",r.width||1),l.setAttribute("stroke","transparent"),l.setAttribute("fill","transparent"),s.append(l),this.container.append(s),!n&&this.hasPopupData&&this._createPopup(),this.container}getElementsToTriggerPopup(){return this.#Jn}addHighlightArea(){this.container.classList.add("highlightArea")}}class ci extends li{constructor(e){super(e),this.containerClassName="polygonAnnotation",this.svgElementName="svg:polygon"}}class ui extends qn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add("caretAnnotation"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container}}class di extends qn{#Qn=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName="inkAnnotation",this.svgElementName="svg:polyline",this.annotationEditorType="InkHighlight"===this.data.it?I.HIGHLIGHT:I.INK}render(){this.container.classList.add(this.containerClassName);const{data:{rect:e,inkLists:t,borderStyle:r,popupRef:n}}=this,{width:i,height:a}=Wn(e),s=this.svgFactory.create(i,a,!0);for(const n of t){let t=[];for(let r=0,i=n.length;r<i;r+=2){const i=n[r]-e[0],a=e[3]-n[r+1];t.push(`${i},${a}`)}t=t.join(" ");const i=this.svgFactory.createElement(this.svgElementName);this.#Qn.push(i),i.setAttribute("points",t),i.setAttribute("stroke-width",r.width||1),i.setAttribute("stroke","transparent"),i.setAttribute("fill","transparent"),s.append(i)}return!n&&this.hasPopupData&&this._createPopup(),this.container.append(s),this._editOnDoubleClick(),this.container}getElementsToTriggerPopup(){return this.#Qn}addHighlightArea(){this.container.classList.add("highlightArea")}}class hi extends qn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=I.HIGHLIGHT}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("highlightAnnotation"),this._editOnDoubleClick(),this.container}}class pi extends qn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("underlineAnnotation"),this.container}}class fi extends qn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("squigglyAnnotation"),this.container}}class gi extends qn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){return!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.classList.add("strikeoutAnnotation"),this.container}}class mi extends qn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=I.STAMP}render(){return this.container.classList.add("stampAnnotation"),this.container.setAttribute("role","img"),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this._editOnDoubleClick(),this.container}}class vi extends qn{#Zn=null;constructor(e){super(e,{isRenderable:!0});const{file:t}=this.data;this.filename=t.filename,this.content=t.content,this.linkService.eventBus?.dispatch("fileattachmentannotation",{source:this,...t})}render(){this.container.classList.add("fileAttachmentAnnotation");const{container:e,data:t}=this;let r;t.hasAppearance||0===t.fillAlpha?r=document.createElement("div"):(r=document.createElement("img"),r.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?"paperclip":"pushpin"}.svg`,t.fillAlpha&&t.fillAlpha<1&&(r.style=`filter: opacity(${Math.round(100*t.fillAlpha)}%);`)),r.addEventListener("dblclick",this.#ei.bind(this)),this.#Zn=r;const{isMac:n}=je.platform;return e.addEventListener("keydown",e=>{"Enter"===e.key&&(n?e.metaKey:e.ctrlKey)&&this.#ei()}),!t.popupRef&&this.hasPopupData?this._createPopup():r.classList.add("popupTriggerArea"),e.append(r),e}getElementsToTriggerPopup(){return this.#Zn}addHighlightArea(){this.container.classList.add("highlightArea")}#ei(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}}class yi{#ti=null;#ri=null;#ni=new Map;#ii=null;constructor({div:e,accessibilityManager:t,annotationCanvasMap:r,annotationEditorUIManager:n,page:i,viewport:a,structTreeLayer:s}){this.div=e,this.#ti=t,this.#ri=r,this.#ii=s||null,this.page=i,this.viewport=a,this.zIndex=0,this._annotationEditorUIManager=n}hasEditableAnnotations(){return this.#ni.size>0}async#ai(e,t){const r=e.firstChild||e,n=r.id=`${Ue}${t}`,i=await(this.#ii?.getAriaAttributes(n));if(i)for(const[e,t]of i)r.setAttribute(e,t);this.div.append(e),this.#ti?.moveElementInDOM(this.div,e,r,!1)}async render(e){const{annotations:t}=e,r=this.div;vt(r,this.viewport);const n=new Map,i={data:null,layer:r,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:!1!==e.renderForms,svgFactory:new Bn,annotationStorage:e.annotationStorage||new Nt,enableScripting:!0===e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(const e of t){if(e.noHTML)continue;const t=e.annotationType===se;if(t){const t=n.get(e.id);if(!t)continue;i.elements=t}else{const{width:t,height:r}=Wn(e.rect);if(t<=0||r<=0)continue}i.data=e;const r=Vn.create(i);if(!r.isRenderable)continue;if(!t&&e.popupRef){const t=n.get(e.popupRef);t?t.push(r):n.set(e.popupRef,[r])}const a=r.render();e.hidden&&(a.style.visibility="hidden"),await this.#ai(a,e.id),r._isEditable&&(this.#ni.set(r.data.id,r),this._annotationEditorUIManager?.renderAnnotationElement(r))}this.#si()}update({viewport:e}){const t=this.div;this.viewport=e,vt(t,{rotation:e.rotation}),this.#si(),t.hidden=!1}#si(){if(!this.#ri)return;const e=this.div;for(const[t,r]of this.#ri){const n=e.querySelector(`[data-annotation-id="${t}"]`);if(!n)continue;r.className="annotationContent";const{firstChild:i}=n;i?"CANVAS"===i.nodeName?i.replaceWith(r):i.classList.contains("annotationContent")?i.after(r):i.before(r):n.append(r)}this.#ri.clear()}getEditableAnnotations(){return Array.from(this.#ni.values())}getEditableAnnotation(e){return this.#ni.get(e)}}const bi=/\r\n?|\n/g;class wi extends Rt{#Dn;#oi="";#li=`${this.id}-editor`;#ci=null;#Wn;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){const e=wi.prototype,t=e=>e.isEmpty(),r=Ct.TRANSLATE_SMALL,n=Ct.TRANSLATE_BIG;return _e(this,"_keyboardManager",new _t([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-n,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[r,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[n,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-n],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,r],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,n],checker:t}]]))}static _type="freetext";static _editorType=I.FREETEXT;constructor(e){super({...e,name:"freeTextEditor"}),this.#Dn=e.color||wi._defaultColor||Rt._defaultLineColor,this.#Wn=e.fontSize||wi._defaultFontSize}static initialize(e,t){Rt.initialize(e,t);const r=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(r.getPropertyValue("--freetext-padding"))}
vendor: 9,100 bytes, line 22
22static updateDefaultParams(e,t){switch(e){case N.FREETEXT_SIZE:wi._defaultFontSize=t;break;case N.FREETEXT_COLOR:wi._defaultColor=t}}updateParams(e,t){switch(e){case N.FREETEXT_SIZE:this.#ui(t);break;case N.FREETEXT_COLOR:this.#di(t)}}static get defaultPropertiesToUpdate(){return[[N.FREETEXT_SIZE,wi._defaultFontSize],[N.FREETEXT_COLOR,wi._defaultColor||Rt._defaultLineColor]]}get propertiesToUpdate(){return[[N.FREETEXT_SIZE,this.#Wn],[N.FREETEXT_COLOR,this.#Dn]]}#ui(e){const t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--scale-factor))`,this.translate(0,-(e-this.#Wn)*this.parentScale),this.#Wn=e,this.#hi()},r=this.#Wn;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:N.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#di(e){const t=e=>{this.#Dn=this.editorDiv.style.color=e},r=this.#Dn;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:N.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){const e=this.parentScale;return[-wi._internalPadding*e,-(wi._internalPadding+this.#Wn)*e]}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(I.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#ci=new AbortController;const e=this._uiManager.combinedSignal(this.#ci);this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#li),this._isDraggable=!0,this.#ci?.abort(),this.#ci=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#pi(){const e=[];this.editorDiv.normalize();let t=null;for(const r of this.editorDiv.childNodes)t?.nodeType===Node.TEXT_NODE&&"BR"===r.nodeName||(e.push(wi.#fi(r)),t=r);return e.join("\n")}#hi(){const[e,t]=this.parentDimensions;let r;if(this.isAttachedToDOM)r=this.div.getBoundingClientRect();else{const{currentLayer:e,div:t}=this,n=t.style.display,i=t.classList.contains("hidden");t.classList.remove("hidden"),t.style.display="hidden",e.div.append(this.div),r=t.getBoundingClientRect(),t.remove(),t.style.display=n,t.classList.toggle("hidden",i)}this.rotation%180==this.parentRotation%180?(this.width=r.width/e,this.height=r.height/t):(this.width=r.height/e,this.height=r.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();const e=this.#oi,t=this.#oi=this.#pi().trimEnd();if(e===t)return;const r=e=>{this.#oi=e,e?(this.#gi(),this._uiManager.rebuild(this),this.#hi()):this.remove()};this.addCommands({cmd:()=>{r(t)},undo:()=>{r(e)},mustExec:!1}),this.#hi()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&"Enter"===e.key&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){wi._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#li),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;const{style:r}=this.editorDiv;if(r.fontSize=`calc(${this.#Wn}px * var(--scale-factor))`,r.color=this.#Dn,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),xt(this,this.div,["dblclick","keydown"]),this.width){const[r,n]=this.parentDimensions;if(this.annotationElementId){const{position:i}=this._initialData;let[a,s]=this.getInitialTranslation();[a,s]=this.pageTranslationToScreen(a,s);const[o,l]=this.pageDimensions,[c,u]=this.pageTranslation;let d,h;switch(this.rotation){case 0:d=e+(i[0]-c)/o,h=t+this.height-(i[1]-u)/l;break;case 90:d=e+(i[0]-c)/o,h=t-(i[1]-u)/l,[a,s]=[s,-a];break;case 180:d=e-this.width+(i[0]-c)/o,h=t-(i[1]-u)/l,[a,s]=[-a,-s];break;case 270:d=e+(i[0]-c-this.height*l)/o,h=t+(i[1]-u-this.width*o)/l,[a,s]=[-s,a]}this.setAt(d*r,h*n,a,s)}else this.setAt(e*r,t*n,this.width*r,this.height*n);this.#gi(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#fi(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(bi,"")}editorDivPaste(e){const t=e.clipboardData||window.clipboardData,{types:r}=t;if(1===r.length&&"text/plain"===r[0])return;e.preventDefault();const n=wi.#mi(t.getData("text")||"").replaceAll(bi,"\n");if(!n)return;const i=window.getSelection();if(!i.rangeCount)return;this.editorDiv.normalize(),i.deleteFromDocument();const a=i.getRangeAt(0);if(!n.includes("\n"))return a.insertNode(document.createTextNode(n)),this.editorDiv.normalize(),void i.collapseToStart();const{startContainer:s,startOffset:o}=a,l=[],c=[];if(s.nodeType===Node.TEXT_NODE){const e=s.parentElement;if(c.push(s.nodeValue.slice(o).replaceAll(bi,"")),e!==this.editorDiv){let t=l;for(const r of this.editorDiv.childNodes)r!==e?t.push(wi.#fi(r)):t=c}l.push(s.nodeValue.slice(0,o).replaceAll(bi,""))}else if(s===this.editorDiv){let e=l,t=0;for(const r of this.editorDiv.childNodes)t++===o&&(e=c),e.push(wi.#fi(r))}this.#oi=`${l.join("\n")}${n}${c.join("\n")}`,this.#gi();const u=new Range;let d=l.reduce((e,t)=>e+t.length,0);for(const{firstChild:e}of this.editorDiv.childNodes)if(e.nodeType===Node.TEXT_NODE){const t=e.nodeValue.length;if(d<=t){u.setStart(e,d),u.setEnd(e,d);break}d-=t}i.removeAllRanges(),i.addRange(u)}#gi(){if(this.editorDiv.replaceChildren(),this.#oi)for(const e of this.#oi.split("\n")){const t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}#vi(){return this.#oi.replaceAll("Â "," ")}static#mi(e){return e.replaceAll(" ","Â ")}get contentDiv(){return this.editorDiv}static async deserialize(e,t,r){let n=null;if(e instanceof ii){const{data:{defaultAppearanceData:{fontSize:t,fontColor:r},rect:i,rotation:a,id:s,popupRef:o},textContent:l,textPosition:c,parent:{page:{pageNumber:u}}}=e;if(!l||0===l.length)return null;n=e={annotationType:I.FREETEXT,color:Array.from(r),fontSize:t,value:l.join("\n"),position:c,pageIndex:u-1,rect:i.slice(0),rotation:a,id:s,deleted:!1,popupRef:o}}const i=await super.deserialize(e,t,r);return i.#Wn=e.fontSize,i.#Dn=He.makeHexColor(...e.color),i.#oi=wi.#mi(e.value),i.annotationElementId=e.id||null,i._initialData=n,i}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const t=wi._internalPadding*this.parentScale,r=this.getRect(t,t),n=Rt._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#Dn),i={annotationType:I.FREETEXT,color:n,fontSize:this.#Wn,value:this.#vi(),pageIndex:this.pageIndex,rect:r,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?i:this.annotationElementId&&!this.#yi(i)?null:(i.id=this.annotationElementId,i)}#yi(e){const{value:t,fontSize:r,color:n,pageIndex:i}=this._initialData;return this._hasBeenMoved||e.value!==t||e.fontSize!==r||e.color.some((e,t)=>e!==n[t])||e.pageIndex!==i}renderAnnotationElement(e){const t=super.renderAnnotationElement(e);
vendor: 5,164 bytes, line 22
22if(this.deleted)return t;const{style:r}=t;r.fontSize=`calc(${this.#Wn}px * var(--scale-factor))`,r.color=this.#Dn,t.replaceChildren();for(const e of this.#oi.split("\n")){const r=document.createElement("div");r.append(e?document.createTextNode(e):document.createElement("br")),t.append(r)}const n=wi._internalPadding*this.parentScale;return e.updateEdited({rect:this.getRect(n,n),popupContent:this.#oi}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}}class xi{toSVGPath(){Ee("Abstract method `toSVGPath` must be implemented.")}get box(){Ee("Abstract getter `box` must be implemented.")}serialize(e,t){Ee("Abstract method `serialize` must be implemented.")}get classNamesForDrawing(){Ee("Abstract getter `classNamesForDrawing` must be implemented.")}get classNamesForOutlining(){Ee("Abstract getter `classNamesForOutlining` must be implemented.")}get mustRemoveSelfIntersections(){return!1}}class Ei{#bi;#wi=[];#xi;#Ei;#Si=[];#Ai=new Float64Array(18);#_i;#Ti;#Ci;#Pi;#Ri;#Oi;#Di=[];static#ki=8;static#Mi=2;static#Li=Ei.#ki+Ei.#Mi;constructor({x:e,y:t},r,n,i,a,s=0){this.#bi=r,this.#Oi=i*n,this.#Ei=a,this.#Ai.set([NaN,NaN,NaN,NaN,e,t],6),this.#xi=s,this.#Pi=Ei.#ki*n,this.#Ci=Ei.#Li*n,this.#Ri=n,this.#Di.push(e,t)}isEmpty(){return isNaN(this.#Ai[8])}#Ii(){const e=this.#Ai.subarray(4,6),t=this.#Ai.subarray(16,18),[r,n,i,a]=this.#bi;return[(this.#_i+(e[0]-t[0])/2-r)/i,(this.#Ti+(e[1]-t[1])/2-n)/a,(this.#_i+(t[0]-e[0])/2-r)/i,(this.#Ti+(t[1]-e[1])/2-n)/a]}add({x:e,y:t}){this.#_i=e,this.#Ti=t;const[r,n,i,a]=this.#bi;let[s,o,l,c]=this.#Ai.subarray(8,12);const u=e-l,d=t-c,h=Math.hypot(u,d);if(h<this.#Ci)return!1;const p=h-this.#Pi,f=p/h,g=f*u,m=f*d;let v=s,y=o;s=l,o=c,l+=g,c+=m,this.#Di?.push(e,t);const b=g/p,w=-m/p*this.#Oi,x=b*this.#Oi;if(this.#Ai.set(this.#Ai.subarray(2,8),0),this.#Ai.set([l+w,c+x],4),this.#Ai.set(this.#Ai.subarray(14,18),12),this.#Ai.set([l-w,c-x],16),isNaN(this.#Ai[6]))return 0===this.#Si.length&&(this.#Ai.set([s+w,o+x],2),this.#Si.push(NaN,NaN,NaN,NaN,(s+w-r)/i,(o+x-n)/a),this.#Ai.set([s-w,o-x],14),this.#wi.push(NaN,NaN,NaN,NaN,(s-w-r)/i,(o-x-n)/a)),this.#Ai.set([v,y,s,o,l,c],6),!this.isEmpty();this.#Ai.set([v,y,s,o,l,c],6);return Math.abs(Math.atan2(y-o,v-s)-Math.atan2(m,g))<Math.PI/2?([s,o,l,c]=this.#Ai.subarray(2,6),this.#Si.push(NaN,NaN,NaN,NaN,((s+l)/2-r)/i,((o+c)/2-n)/a),[s,o,v,y]=this.#Ai.subarray(14,18),this.#wi.push(NaN,NaN,NaN,NaN,((v+s)/2-r)/i,((y+o)/2-n)/a),!0):([v,y,s,o,l,c]=this.#Ai.subarray(0,6),this.#Si.push(((v+5*s)/6-r)/i,((y+5*o)/6-n)/a,((5*s+l)/6-r)/i,((5*o+c)/6-n)/a,((s+l)/2-r)/i,((o+c)/2-n)/a),[l,c,s,o,v,y]=this.#Ai.subarray(12,18),this.#wi.push(((v+5*s)/6-r)/i,((y+5*o)/6-n)/a,((5*s+l)/6-r)/i,((5*o+c)/6-n)/a,((s+l)/2-r)/i,((o+c)/2-n)/a),!0)}toSVGPath(){if(this.isEmpty())return"";const e=this.#Si,t=this.#wi;if(isNaN(this.#Ai[6])&&!this.isEmpty())return this.#Ni();const r=[];r.push(`M${e[4]} ${e[5]}`);for(let t=6;t<e.length;t+=6)isNaN(e[t])?r.push(`L${e[t+4]} ${e[t+5]}`):r.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);this.#ji(r);for(let e=t.length-6;e>=6;e-=6)isNaN(t[e])?r.push(`L${t[e+4]} ${t[e+5]}`):r.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);return this.#Fi(r),r.join(" ")}#Ni(){const[e,t,r,n]=this.#bi,[i,a,s,o]=this.#Ii();return`M${(this.#Ai[2]-e)/r} ${(this.#Ai[3]-t)/n} L${(this.#Ai[4]-e)/r} ${(this.#Ai[5]-t)/n} L${i} ${a} L${s} ${o} L${(this.#Ai[16]-e)/r} ${(this.#Ai[17]-t)/n} L${(this.#Ai[14]-e)/r} ${(this.#Ai[15]-t)/n} Z`}#Fi(e){const t=this.#wi;e.push(`L${t[4]} ${t[5]} Z`)}#ji(e){const[t,r,n,i]=this.#bi,a=this.#Ai.subarray(4,6),s=this.#Ai.subarray(16,18),[o,l,c,u]=this.#Ii();e.push(`L${(a[0]-t)/n} ${(a[1]-r)/i} L${o} ${l} L${c} ${u} L${(s[0]-t)/n} ${(s[1]-r)/i}`)}newFreeDrawOutline(e,t,r,n,i,a){return new Si(e,t,r,n,i,a)}getOutlines(){const e=this.#Si,t=this.#wi,r=this.#Ai,[n,i,a,s]=this.#bi,o=new Float64Array((this.#Di?.length??0)+2);for(let e=0,t=o.length-2;e<t;e+=2)o[e]=(this.#Di[e]-n)/a,o[e+1]=(this.#Di[e+1]-i)/s;if(o[o.length-2]=(this.#_i-n)/a,o[o.length-1]=(this.#Ti-i)/s,isNaN(r[6])&&!this.isEmpty())return this.#Hi(o);const l=new Float64Array(this.#Si.length+24+this.#wi.length);let c=e.length;for(let t=0;t<c;t+=2)isNaN(e[t])?l[t]=l[t+1]=NaN:(l[t]=e[t],l[t+1]=e[t+1]);c=this.#Bi(l,c);for(let e=t.length-6;e>=6;e-=6)for(let r=0;r<6;r+=2)isNaN(t[e+r])?(l[c]=l[c+1]=NaN,c+=2):(l[c]=t[e+r],l[c+1]=t[e+r+1],c+=2);return this.#zi(l,c),this.newFreeDrawOutline(l,o,this.#bi,this.#Ri,this.#xi,this.#Ei)}#Hi(e){const t=this.#Ai,[r,n,i,a]=this.#bi,[s,o,l,c]=this.#Ii(),u=new Float64Array(36);return u.set([NaN,NaN,NaN,NaN,(t[2]-r)/i,(t[3]-n)/a,NaN,NaN,NaN,NaN,(t[4]-r)/i,(t[5]-n)/a,NaN,NaN,NaN,NaN,s,o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,(t[16]-r)/i,(t[17]-n)/a,NaN,NaN,NaN,NaN,(t[14]-r)/i,(t[15]-n)/a],0),this.newFreeDrawOutline(u,e,this.#bi,this.#Ri,this.#xi,this.#Ei)}#zi(e,t){const r=this.#wi;return e.set([NaN,NaN,NaN,NaN,r[4],r[5]],t),t+6}#Bi(e,t){const r=this.#Ai.subarray(4,6),n=this.#Ai.subarray(16,18),[i,a,s,o]=this.#bi,[l,c,u,d]=this.#Ii();return e.set([NaN,NaN,NaN,NaN,(r[0]-i)/s,(r[1]-a)/o,NaN,NaN,NaN,NaN,l,c,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,(n[0]-i)/s,(n[1]-a)/o],t),t+24}}
22class Si extends xi{#bi;#$i=null;#xi;#Ei;#Di;#Ri;#Ui;constructor(e,t,r,n,i,a){super(),this.#Ui=e,this.#Di=t,this.#bi=r,this.#Ri=n,this.#xi=i,this.#Ei=a,this.#Wi(a);const{x:s,y:o,width:l,height:c}=this.#$i;for(let t=0,r=e.length;t<r;t+=2)e[t]=(e[t]-s)/l,e[t+1]=(e[t+1]-o)/c;for(let e=0,r=t.length;e<r;e+=2)t[e]=(t[e]-s)/l,t[e+1]=(t[e+1]-o)/c}toSVGPath(){const e=[`M${this.#Ui[4]} ${this.#Ui[5]}`];for(let t=6,r=this.#Ui.length;t<r;t+=6)isNaN(this.#Ui[t])?e.push(`L${this.#Ui[t+4]} ${this.#Ui[t+5]}`):e.push(`C${this.#Ui[t]} ${this.#Ui[t+1]} ${this.#Ui[t+2]} ${this.#Ui[t+3]} ${this.#Ui[t+4]} ${this.#Ui[t+5]}`);return e.push("Z"),e.join(" ")}serialize([e,t,r,n],i){const a=r-e,s=n-t;let o,l;switch(i){case 0:o=this.#Vi(this.#Ui,e,n,a,-s),l=this.#Vi(this.#Di,e,n,a,-s);break;case 90:o=this.#qi(this.#Ui,e,t,a,s),l=this.#qi(this.#Di,e,t,a,s);break;case 180:o=this.#Vi(this.#Ui,r,t,-a,s),l=this.#Vi(this.#Di,r,t,-a,s);break;case 270:o=this.#qi(this.#Ui,r,n,-a,-s),l=this.#qi(this.#Di,r,n,-a,-s)}return{outline:Array.from(o),points:[Array.from(l)]}}#Vi(e,t,r,n,i){const a=new Float64Array(e.length);for(let s=0,o=e.length;s<o;s+=2)a[s]=t+e[s]*n,a[s+1]=r+e[s+1]*i;return a}#qi(e,t,r,n,i){const a=new Float64Array(e.length);for(let s=0,o=e.length;s<o;s+=2)a[s]=t+e[s+1]*n,a[s+1]=r+e[s]*i;return a}#Wi(e){const t=this.#Ui;let r=t[4],n=t[5],i=r,a=n,s=r,o=n,l=r,c=n;const u=e?Math.max:Math.min;for(let e=6,d=t.length;e<d;e+=6){if(isNaN(t[e]))i=Math.min(i,t[e+4]),a=Math.min(a,t[e+5]),s=Math.max(s,t[e+4]),o=Math.max(o,t[e+5]),c<t[e+5]?(l=t[e+4],c=t[e+5]):c===t[e+5]&&(l=u(l,t[e+4]));else{const d=He.bezierBoundingBox(r,n,...t.slice(e,e+6));i=Math.min(i,d[0]),a=Math.min(a,d[1]),s=Math.max(s,d[2]),o=Math.max(o,d[3]),c<d[3]?(l=d[2],c=d[3]):c===d[3]&&(l=u(l,d[2]))}r=t[e+4],n=t[e+5]}const d=i-this.#xi,h=a-this.#xi,p=s-i+2*this.#xi,f=o-a+2*this.#xi;this.#$i={x:d,y:h,width:p,height:f,lastPoint:[l,c]}}get box(){return this.#$i}newOutliner(e,t,r,n,i,a=0){return new Ei(e,t,r,n,i,a)}getNewOutline(e,t){const{x:r,y:n,width:i,height:a}=this.#$i,[s,o,l,c]=this.#bi,u=i*l,d=a*c,h=r*l+s,p=n*c+o,f=this.newOutliner({x:this.#Di[0]*u+h,y:this.#Di[1]*d+p},this.#bi,this.#Ri,e,this.#Ei,t??this.#xi);for(let e=2;e<this.#Di.length;e+=2)f.add({x:this.#Di[e]*u+h,y:this.#Di[e+1]*d+p});return f.getOutlines()}get mustRemoveSelfIntersections(){return!0}}class Ai{#bi;#Yi=[];#Gi=[];constructor(e,t=0,r=0,n=!0){let i=1/0,a=-1/0,s=1/0,o=-1/0;const l=10**-4;for(const{x:r,y:n,width:c,height:u}of e){const e=Math.floor((r-t)/l)*l,d=Math.ceil((r+c+t)/l)*l,h=Math.floor((n-t)/l)*l,p=Math.ceil((n+u+t)/l)*l,f=[e,h,p,!0],g=[d,h,p,!1];this.#Yi.push(f,g),i=Math.min(i,e),a=Math.max(a,d),s=Math.min(s,h),o=Math.max(o,p)}const c=a-i+2*r,u=o-s+2*r,d=i-r,h=s-r,p=this.#Yi.at(n?-1:-2),f=[p[0],p[2]];for(const e of this.#Yi){const[t,r,n]=e;e[0]=(t-d)/c,e[1]=(r-h)/u,e[2]=(n-h)/u}this.#bi={x:d,y:h,width:c,height:u,lastPoint:f}}getOutlines(){this.#Yi.sort((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2]);const e=[];for(const t of this.#Yi)t[3]?(e.push(...this.#Xi(t)),this.#Ki(t)):(this.#Ji(t),e.push(...this.#Xi(t)));return this.#Qi(e)}#Qi(e){const t=[],r=new Set;for(const r of e){const[e,n,i]=r;t.push([e,n,r],[e,i,r])}t.sort((e,t)=>e[1]-t[1]||e[0]-t[0]);for(let e=0,n=t.length;e<n;e+=2){const n=t[e][2],i=t[e+1][2];n.push(i),i.push(n),r.add(n),r.add(i)}const n=[];let i;for(;r.size>0;){const e=r.values().next().value;let[t,a,s,o,l]=e;r.delete(e);let c=t,u=a;for(i=[t,s],n.push(i);;){let e;if(r.has(o))e=o;else{if(!r.has(l))break;e=l}r.delete(e),[t,a,s,o,l]=e,c!==t&&(i.push(c,u,t,u===a?a:s),c=t),u=u===a?s:a}i.push(c,u)}return new _i(n,this.#bi)}#Zi(e){const t=this.#Gi;let r=0,n=t.length-1;for(;r<=n;){const i=r+n>>1,a=t[i][0];if(a===e)return i;a<e?r=i+1:n=i-1}return n+1}#Ki([,e,t]){const r=this.#Zi(e);this.#Gi.splice(r,0,[e,t])}#Ji([,e,t]){const r=this.#Zi(e);for(let n=r;n<this.#Gi.length;n++){const[r,i]=this.#Gi[n];if(r!==e)break;if(r===e&&i===t)return void this.#Gi.splice(n,1)}for(let n=r-1;n>=0;n--){const[r,i]=this.#Gi[n];if(r!==e)break;if(r===e&&i===t)return void this.#Gi.splice(n,1)}}#Xi(e){const[t,r,n]=e,i=[[t,r,n]],a=this.#Zi(n);for(let e=0;e<a;e++){const[r,n]=this.#Gi[e];for(let e=0,a=i.length;e<a;e++){const[,s,o]=i[e];if(!(n<=s||o<=r))if(s>=r)if(o>n)i[e][1]=n;else{if(1===a)return[];i.splice(e,1),e--,a--}else i[e][2]=r,o>n&&i.push([t,n,o])}}return i}}
vendor: 5,222 bytes, line 22
22class _i extends xi{#bi;#ea;constructor(e,t){super(),this.#ea=e,this.#bi=t}toSVGPath(){const e=[];for(const t of this.#ea){let[r,n]=t;e.push(`M${r} ${n}`);for(let i=2;i<t.length;i+=2){const a=t[i],s=t[i+1];a===r?(e.push(`V${s}`),n=s):s===n&&(e.push(`H${a}`),r=a)}e.push("Z")}return e.join(" ")}serialize([e,t,r,n],i){const a=[],s=r-e,o=n-t;for(const t of this.#ea){const r=new Array(t.length);for(let i=0;i<t.length;i+=2)r[i]=e+t[i]*s,r[i+1]=n-t[i+1]*o;a.push(r)}return a}get box(){return this.#bi}get classNamesForDrawing(){return["highlight"]}get classNamesForOutlining(){return["highlightOutline"]}}class Ti extends Ei{newFreeDrawOutline(e,t,r,n,i,a){return new Ci(e,t,r,n,i,a)}get classNamesForDrawing(){return["highlight","free"]}}class Ci extends Si{get classNamesForDrawing(){return["highlight","free"]}get classNamesForOutlining(){return["highlightOutline","free"]}newOutliner(e,t,r,n,i,a=0){return new Ti(e,t,r,n,i,a)}}class Pi{#ta=null;#ra=null;#na;#ia=null;#aa=!1;#sa=!1;#a=null;#oa;#la=null;#g=null;#ca;static#ua=null;static get _keyboardManager(){return _e(this,"_keyboardManager",new _t([[["Escape","mac+Escape"],Pi.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Pi.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Pi.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Pi.prototype._moveToPrevious],[["Home","mac+Home"],Pi.prototype._moveToBeginning],[["End","mac+End"],Pi.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:t=null}){e?(this.#sa=!1,this.#ca=N.HIGHLIGHT_COLOR,this.#a=e):(this.#sa=!0,this.#ca=N.HIGHLIGHT_DEFAULT_COLOR),this.#g=e?._uiManager||t,this.#oa=this.#g._eventBus,this.#na=e?.color||this.#g?.highlightColors.values().next().value||"#FFFF98",Pi.#ua||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const e=this.#ta=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.setAttribute("aria-haspopup",!0);const t=this.#g._signal;e.addEventListener("click",this.#da.bind(this),{signal:t}),e.addEventListener("keydown",this.#An.bind(this),{signal:t});const r=this.#ra=document.createElement("span");return r.className="swatch",r.setAttribute("aria-hidden",!0),r.style.backgroundColor=this.#na,e.append(r),e}renderMainDropdown(){const e=this.#ia=this.#ha();return e.setAttribute("aria-orientation","horizontal"),e.setAttribute("aria-labelledby","highlightColorPickerLabel"),e}#ha(){const e=document.createElement("div"),t=this.#g._signal;e.addEventListener("contextmenu",ut,{signal:t}),e.className="dropdown",e.role="listbox",e.setAttribute("aria-multiselectable",!1),e.setAttribute("aria-orientation","vertical"),e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown");for(const[r,n]of this.#g.highlightColors){const i=document.createElement("button");i.tabIndex="0",i.role="option",i.setAttribute("data-color",n),i.title=r,i.setAttribute("data-l10n-id",Pi.#ua[r]);const a=document.createElement("span");i.append(a),a.className="swatch",a.style.backgroundColor=n,i.setAttribute("aria-selected",n===this.#na),i.addEventListener("click",this.#pa.bind(this,n),{signal:t}),e.append(i)}return e.addEventListener("keydown",this.#An.bind(this),{signal:t}),e}#pa(e,t){t.stopPropagation(),this.#oa.dispatch("switchannotationeditorparams",{source:this,type:this.#ca,value:e})}_colorSelectFromKeyboard(e){if(e.target===this.#ta)return void this.#da(e);const t=e.target.getAttribute("data-color");t&&this.#pa(t,e)}_moveToNext(e){this.#fa?e.target!==this.#ta?e.target.nextSibling?.focus():this.#ia.firstChild?.focus():this.#da(e)}_moveToPrevious(e){e.target!==this.#ia?.firstChild&&e.target!==this.#ta?(this.#fa||this.#da(e),e.target.previousSibling?.focus()):this.#fa&&this._hideDropdownFromKeyboard()}_moveToBeginning(e){this.#fa?this.#ia.firstChild?.focus():this.#da(e)}_moveToEnd(e){this.#fa?this.#ia.lastChild?.focus():this.#da(e)}#An(e){Pi._keyboardManager.exec(this,e)}#da(e){if(this.#fa)return void this.hideDropdown();if(this.#aa=0===e.detail,this.#la||(this.#la=new AbortController,window.addEventListener("pointerdown",this.#c.bind(this),{signal:this.#g.combinedSignal(this.#la)})),this.#ia)return void this.#ia.classList.remove("hidden");const t=this.#ia=this.#ha();this.#ta.append(t)}#c(e){this.#ia?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#ia?.classList.add("hidden"),this.#la?.abort(),this.#la=null}get#fa(){return this.#ia&&!this.#ia.classList.contains("hidden")}_hideDropdownFromKeyboard(){this.#sa||(this.#fa?(this.hideDropdown(),this.#ta.focus({preventScroll:!0,focusVisible:this.#aa})):this.#a?.unselect())}updateColor(e){if(this.#ra&&(this.#ra.style.backgroundColor=e),!this.#ia)return;const t=this.#g.highlightColors.values();for(const r of this.#ia.children)r.setAttribute("aria-selected",t.next().value===e)}destroy(){this.#ta?.remove(),this.#ta=null,this.#ra=null,this.#ia?.remove(),this.#ia=null}}class Ri extends Rt{#ga=null;#ma=0;#va;#ya=null;#i=null;#ba=null;#wa=null;#xa=0;#Ea=null;#Sa=null;
vendor: 1,434 bytes, line 22
22#b=null;#Aa=!1;#_a=null;#Ta;#Ca=null;#Pa="";#Oi;#Ra="";static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=12;static _type="highlight";static _editorType=I.HIGHLIGHT;static _freeHighlightId=-1;static _freeHighlight=null;static _freeHighlightClipId="";static get _keyboardManager(){const e=Ri.prototype;return _e(this,"_keyboardManager",new _t([[["ArrowLeft","mac+ArrowLeft"],e._moveCaret,{args:[0]}],[["ArrowRight","mac+ArrowRight"],e._moveCaret,{args:[1]}],[["ArrowUp","mac+ArrowUp"],e._moveCaret,{args:[2]}],[["ArrowDown","mac+ArrowDown"],e._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:"highlightEditor"}),this.color=e.color||Ri._defaultColor,this.#Oi=e.thickness||Ri._defaultThickness,this.#Ta=e.opacity||Ri._defaultOpacity,this.#va=e.boxes||null,this.#Ra=e.methodOfCreation||"",this.#Pa=e.text||"",this._isDraggable=!1,e.highlightId>-1?(this.#Aa=!0,this.#Oa(e),this.#Da()):this.#va&&(this.#ga=e.anchorNode,this.#ma=e.anchorOffset,this.#wa=e.focusNode,this.#xa=e.focusOffset,this.#ka(),this.#Da(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#Aa?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#Oi,methodOfCreation:this.#Ra}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("
22color").size}}#ka(){const e=new Ai(this.#va,.001);this.#Sa=e.getOutlines(),({x:this.x,y:this.y,width:this.width,height:this.height}=this.#Sa.box);const t=new Ai(this.#va,.0025,.001,"ltr"===this._uiManager.direction);this.#ba=t.getOutlines();const{lastPoint:r}=this.#ba.box;this.#_a=[(r[0]-this.x)/this.width,(r[1]-this.y)/this.height]}#Oa({highlightOutlines:e,highlightId:t,clipPathId:r}){this.#Sa=e;if(this.#ba=e.getNewOutline(this.#Oi/2+1.5,.0025),t>=0)this.#b=t,this.#ya=r,this.parent.drawLayer.finalizeLine(t,e),this.#Ca=this.parent.drawLayer.drawOutline(this.#ba);else if(this.parent){const t=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(this.#b,e),this.parent.drawLayer.updateBox(this.#b,Ri.#Ma(this.#Sa.box,(t-this.rotation+360)%360)),this.parent.drawLayer.updateLine(this.#Ca,this.#ba),this.parent.drawLayer.updateBox(this.#Ca,Ri.#Ma(this.#ba.box,t))}const{x:n,y:i,width:a,height:s}=e.box;switch(this.rotation){case 0:this.x=n,this.y=i,this.width=a,this.height=s;break;case 90:{const[e,t]=this.parentDimensions;this.x=i,this.y=1-n,this.width=a*t/e,this.height=s*e/t;break}case 180:this.x=1-n,this.y=1-i,this.width=a,this.height=s;break;case 270:{const[e,t]=this.parentDimensions;this.x=1-i,this.y=n,this.width=a*t/e,this.height=s*e/t;break}}const{lastPoint:o}=this.#ba.box;this.#_a=[(o[0]-n)/a,(o[1]-i)/s]}static initialize(e,t){Rt.initialize(e,t),Ri._defaultColor||=t.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,t){switch(e){case N.HIGHLIGHT_DEFAULT_COLOR:Ri._defaultColor=t;break;case N.HIGHLIGHT_THICKNESS:Ri._defaultThickness=t}}translateInPage(e,t){}get toolbarPosition(){return this.#_a}updateParams(e,t){switch(e){case N.HIGHLIGHT_COLOR:this.#di(t);break;case N.HIGHLIGHT_THICKNESS:this.#La(t)}}static get defaultPropertiesToUpdate(){return[[N.HIGHLIGHT_DEFAULT_COLOR,Ri._defaultColor],[N.HIGHLIGHT_THICKNESS,Ri._defaultThickness]]}get propertiesToUpdate(){return[[N.HIGHLIGHT_COLOR,this.color||Ri._defaultColor],[N.HIGHLIGHT_THICKNESS,this.#Oi||Ri._defaultThickness],[N.HIGHLIGHT_FREE,this.#Aa]]}#di(e){const t=(e,t)=>{this.color=e,this.parent?.drawLayer.changeColor(this.#b,e),this.#i?.updateColor(e),this.#Ta=t,this.parent?.drawLayer.changeOpacity(this.#b,t)},r=this.color,n=this.#Ta;this.addCommands({cmd:t.bind(this,e,Ri._defaultOpacity),undo:t.bind(this,r,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:N.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(e)},!0)}#La(e){const t=this.#Oi,r=e=>{this.#Oi=e,this.#Ia(e)};this.addCommands({cmd:r.bind(this,e),undo:r.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:N.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}async addEditToolbar(){const e=await super.addEditToolbar();return e?(this._uiManager.highlightColors&&(this.#i=new Pi({editor:this}),e.addColorPicker(this.#i)),e):null}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#Na())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#Na())}onceAdded(){this.annotationElementId||this.parent.addUndoableEditor(this),this.div.focus()}remove(){this.#ja(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.#Da(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#ja():e&&(this.#Da(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),t&&this.select()}#Ia(e){if(!this.#Aa)return;this.#Oa({highlightOutlines:this.#Sa.getNewOutline(e/2)}),this.fixAndSetPosition();const[t,r]=this.parentDimensions;this.setDims(this.width*t,this.height*r)}#ja(){null!==this.#b&&this.parent&&(this.parent.drawLayer.remove(this.#b),this.#b=null,this.parent.drawLayer.remove(this.#Ca),this.#Ca=null)}#Da(e=this.parent){null===this.#b&&(({id:this.#b,clipPathId:this.#ya}=e.drawLayer.draw(this.#Sa,this.color,this.#Ta)),this.#Ca=e.drawLayer.drawOutline(this.#ba),this.#Ea&&
22(this.#Ea.style.clipPath=this.#ya))}static#Ma({x:e,y:t,width:r,height:n},i){switch(i){case 90:return{x:1-t-n,y:e,width:n,height:r};case 180:return{x:1-e-r,y:1-t-n,width:r,height:n};case 270:return{x:t,y:1-e-r,width:n,height:r}}return{x:e,y:t,width:r,height:n}}rotate(e){const{drawLayer:t}=this.parent;let r;this.#Aa?(e=(e-this.rotation+360)%360,r=Ri.#Ma(this.#Sa.box,e)):r=Ri.#Ma(this,e),t.rotate(this.#b,e),t.rotate(this.#Ca,e),t.updateBox(this.#b,r),t.updateBox(this.#Ca,Ri.#Ma(this.#ba.box,e))}render(){if(this.div)return this.div;const e=super.render();this.#Pa&&(e.setAttribute("aria-label",this.#Pa),e.setAttribute("role","mark")),this.#Aa?e.classList.add("free"):this.div.addEventListener("keydown",this.#Fa.bind(this),{signal:this._uiManager._signal});const t=this.#Ea=document.createElement("div");e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal",t.style.clipPath=this.#ya;const[r,n]=this.parentDimensions;return this.setDims(this.width*r,this.height*n),xt(this,this.#Ea,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent.drawLayer.addClass(this.#Ca,"hovered")}pointerleave(){this.isSelected||this.parent.drawLayer.removeClass(this.#Ca,"hovered")}#Fa(e){Ri._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#Ha(!0);break;case 1:case 3:this.#Ha(!1)}}#Ha(e){if(!this.#ga)return;const t=window.getSelection();e?t.setPosition(this.#ga,this.#ma):t.setPosition(this.#wa,this.#xa)}select(){super.select(),this.#Ca&&(this.parent?.drawLayer.removeClass(this.#Ca,"hovered"),this.parent?.drawLayer.addClass(this.#Ca,"selected"))}unselect(){super.unselect(),this.#Ca&&(this.parent?.drawLayer.removeClass(this.#Ca,"selected"),this.#Aa||this.#Ha(!1))}get _mustFixPosition(){return!this.#Aa}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.show(this.#b,e),this.parent.drawLayer.show(this.#Ca,e))}#Na(){return this.#Aa?this.rotation:0}#Ba(){if(this.#Aa)return null;const[e,t]=this.pageDimensions,[r,n]=this.pageTranslation,i=this.#va,a=new Float32Array(8*i.length);let s=0;for(const{x:o,y:l,width:c,height:u}of i){const i=o*e+r,d=(1-l-u)*t+n;a[s]=a[s+4]=i,a[s+1]=a[s+3]=d,a[s+2]=a[s+6]=i+c*e,a[s+5]=a[s+7]=d+u*t,s+=8}return a}#za(e){return this.#Sa.serialize(e,this.#Na())}static startHighlighting(e,t,{target:r,x:n,y:i}){const{x:a,y:s,width:o,height:l}=r.getBoundingClientRect(),c=new AbortController,u=e.combinedSignal(c),d=t=>{c.abort(),this.#$a(e,t)};window.addEventListener("blur",d,{signal:u}),window.addEventListener("pointerup",d,{signal:u}),window.addEventListener("pointerdown",e=>{e.preventDefault(),e.stopPropagation()},{capture:!0,passive:!1,signal:u}),window.addEventListener("contextmenu",ut,{signal:u}),r.addEventListener("pointermove",this.#Ua.bind(this,e),{signal:u}),this._freeHighlight=new Ti({x:n,y:i},[a,s,o,l],e.scale,this._defaultThickness/2,t,.001),({id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0))}static#Ua(e,t){this._freeHighlight.add(t)&&e.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}static#$a(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static async deserialize(e,t,r){let n=null;if(e instanceof hi){const{data:{quadPoints:t,rect:r,rotation:i,id:a,color:s,opacity:o,popupRef:l},parent:{page:{pageNumber:c}}}=e;n=e={annotationType:I.HIGHLIGHT,color:Array.from(s),opacity:o,quadPoints:t,boxes:null,pageIndex:c-1,rect:r.slice(0),rotation:i,id:a,deleted:!1,popupRef:l}}else if(e instanceof di){const{data:{inkLists:t,rect:r,rotation:i,id:a,color:s,borderStyle:{rawWidth:o},popupRef:l},parent:{page:{pageNumber:c}}}=e;n=e={annotationType:I.HIGHLIGHT,color:Array.from(s),thickness:o,inkLists:t,boxes:null,pageIndex:c-1,rect:r.slice(0),rotation:i,id:a,deleted:!1,popupRef:l}}const{color:i,quadPoints:a,inkLists:s,opacity:o}=e,l=await super.deserialize(e,t,r);l.color=He.makeHexColor(...i),l.#Ta=o||1,s&&(l.#Oi=e.thickness),l.annotationElementId=e.id||null,l._initialData=n;const[c,u]=l.pageDimensions,[d,h]=l.pageTranslation;if(a){const e=l.#va=[];for(let t=0;t<a.length;t+=8)e.push({x:(a[t]-d)/c,y:1-(a[t+1]-h)/u,width:(a[t+2]-a[t])/c,height:(a[t+1]-a[t+5])/u});l.#ka(),l.#Da(),l.rotate(l.rotation)}else if(s){l.#Aa=!0;const e=s[0],r={x:e[0]-d,y:u-(e[1]-h)},n=new Ti(r,[0,0,c,u],1,l.#Oi/2,!0,.001);for(let t=0,i=e.length;t<i;t+=2)r.x=e[t]-d,r.y=u-(e[t+1]-h),n.add(r);const{id:i,clipPathId:a}=t.drawLayer.draw(n,l.color,l._defaultOpacity,!0);l.#Oa({highlightOutlines:n.getOutlines(),highlightId:i,clipPathId:a}),l.#Da()}return l}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();const t=this.getRect(0,0),r=Rt._colorManager.convert(this.color),n={annotationType:I.HIGHLIGHT,color:r,opacity:this.#Ta,thickness:this.#Oi,quadPoints:this.#Ba(),outlines:this.#za(t),pageIndex:this.pageIndex,rect:t,rotation:this.#Na(),structTreeParentId:this._structTreeParentId};return this.annotationElementId&&!this.#yi(n)?null:(n.id=this.annotationElementId,n)}#yi(e){const{color:t}=this._initialData;return e.color.some((e,r)=>e!==t[r])}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}}class Oi extends Rt{#Wa=0;#Va=0;#qa=null;#Ya=new Path2D;#Ga=!1;#Xa=null;#Ka=!1;#Ja=!1;#Qa=null;#Za=null;#es=0;#ts=0;#rs=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";static _editorType=I.INK;constructor(e){super({...e,name:"inkEditor"}),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(e,t){Rt.initialize(e,t)}static updateDefaultParams(e,t){switch(e){case N.INK_THICKNESS:Oi._defaultThickness=t;break;case N.INK_COLOR:Oi._defaultColor=t;break;case N.INK_OPACITY:Oi._defaultOpacity=t/100}}updateParams(e,t){switch(e){case N.INK_THICKNESS:this.#La(t);break;case N.INK_COLOR:this.#di(t);break;case N.INK_OPACITY:this.#ns(t)}}static get defaultPropertiesToUpdate(){return[[N.INK_THICKNESS,Oi._defaultThickness],[N.INK_COLOR,Oi._defaultColor||Rt._defaultLineColor],[N.INK_OPACITY,Math.round(100*Oi._defaultOpacity)]]}get propertiesToUpdate(){return[[N.INK_THICKNESS,this.thickness||Oi._defaultThickness],[N.INK_COLOR,this.color||Oi._defaultColor||Rt._defaultLineColor],[N.INK_OPACITY,Math.round(100*(this.opacity??Oi._defaultOpacity))]]}#La(e){const t=e=>{this.thickness=e,this.#is()},r=this.thickness;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:N.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#di(e){const t=e=>{this.color=e,this.#as()},r=this.color;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:N.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#ns(e){const t=e=>{this.opacity=e,this.#as()};e/=100;const r=this.opacity;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:N.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),null!==this.div&&(this.canvas||(this.#ss(),this.#os()),this.isAttachedToDOM||(this.parent.add(this),this.#ls()),this.#is()))}remove(){null!==this.canvas&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#qa&&(clearTimeout(this.#qa),this.#qa=null),this.#Qa?.disconnect(),this.#Qa=null,super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&null===e&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){const[e,t]=this.parentDimensions,r=this.width*e,n=this.height*t;this.setDimensions(r,n)}enableEditMode(){this.#Ga||null===this.canvas||(super.enableEditMode(),this._isDraggable=!1,this.#cs())}disableEditMode(){this.isInEditMode()&&null!==this.canvas&&(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.#us())}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}#ds(){const{parentRotation:e,parentDimensions:[t,r]}=this;switch(e){case 90:return[0,r,r,t];case 180:return[t,r,t,r];case 270:return[t,0,r,t];default:return[0,0,t,r]}}
22#hs(){const{ctx:e,color:t,opacity:r,thickness:n,parentScale:i,scaleFactor:a}=this;e.lineWidth=n*i/a,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle=`${t}${function(e){return Math.round(Math.min(255,Math.max(1,255*e))).toString(16).padStart(2,"0")}(r)}`}#ps(e,t){this.canvas.addEventListener("contextmenu",ut,{signal:this._uiManager._signal}),this.#us(),this.#Xa=new AbortController;const r=this._uiManager.combinedSignal(this.#Xa);this.canvas.addEventListener("pointerleave",this.canvasPointerleave.bind(this),{signal:r}),this.canvas.addEventListener("pointermove",this.canvasPointermove.bind(this),{signal:r}),this.canvas.addEventListener("pointerup",this.canvasPointerup.bind(this),{signal:r}),this.isEditing=!0,this.#Ja||(this.#Ja=!0,this.#ls(),this.thickness||=Oi._defaultThickness,this.color||=Oi._defaultColor||Rt._defaultLineColor,this.opacity??=Oi._defaultOpacity),this.currentPath.push([e,t]),this.#Ka=!1,this.#hs(),this.#rs=()=>{this.#fs(),this.#rs&&window.requestAnimationFrame(this.#rs)},window.requestAnimationFrame(this.#rs)}#gs(e,t){const[r,n]=this.currentPath.at(-1);if(this.currentPath.length>1&&e===r&&t===n)return;const i=this.currentPath;let a=this.#Ya;if(i.push([e,t]),this.#Ka=!0,i.length<=2)return a.moveTo(...i[0]),void a.lineTo(e,t);3===i.length&&(this.#Ya=a=new Path2D,a.moveTo(...i[0])),this.#ms(a,...i.at(-3),...i.at(-2),e,t)}#vs(){if(0===this.currentPath.length)return;const e=this.currentPath.at(-1);this.#Ya.lineTo(...e)}#ys(e,t){let r;if(this.#rs=null,e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height),this.#gs(e,t),this.#vs(),1!==this.currentPath.length)r=this.#bs();else{const n=[e,t];r=[[n,n.slice(),n.slice(),n]]}const n=this.#Ya,i=this.currentPath;this.currentPath=[],this.#Ya=new Path2D;this.addCommands({cmd:()=>{this.allRawPaths.push(i),this.paths.push(r),this.bezierPath2D.push(n),this._uiManager.rebuild(this)},undo:()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),0===this.paths.length?this.remove():(this.canvas||(this.#ss(),this.#os()),this.#is())},mustExec:!0})}#fs(){if(!this.#Ka)return;this.#Ka=!1;const e=Math.ceil(this.thickness*this.parentScale),t=this.currentPath.slice(-3),r=t.map(e=>e[0]),n=t.map(e=>e[1]),{ctx:i}=(Math.min(...r),Math.max(...r),Math.min(...n),Math.max(...n),this);i.save(),i.clearRect(0,0,this.canvas.width,this.canvas.height);for(const e of this.bezierPath2D)i.stroke(e);i.stroke(this.#Ya),i.restore()}#ms(e,t,r,n,i,a,s){const o=(t+n)/2,l=(r+i)/2,c=(n+a)/2,u=(i+s)/2;e.bezierCurveTo(o+2*(n-o)/3,l+2*(i-l)/3,c+2*(n-c)/3,u+2*(i-u)/3,c,u)}#bs(){const e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];const t=[];let r,[n,i]=e[0];for(r=1;r<e.length-2;r++){const[a,s]=e[r],[o,l]=e[r+1],c=(a+o)/2,u=(s+l)/2,d=[n+2*(a-n)/3,i+2*(s-i)/3],h=[c+2*(a-c)/3,u+2*(s-u)/3];t.push([[n,i],d,h,[c,u]]),[n,i]=[c,u]}const[a,s]=e[r],[o,l]=e[r+1],c=[n+2*(a-n)/3,i+2*(s-i)/3],u=[o+2*(a-o)/3,l+2*(s-l)/3];return t.push([[n,i],c,u,[o,l]]),t}#as(){if(this.isEmpty())return void this.#ws();this.#hs();const{canvas:e,ctx:t}=this;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),this.#ws();for(const e of this.bezierPath2D)t.stroke(e)}commit(){this.#Ga||(super.commit(),this.isEditing=!1,this.disableEditMode(),this.setInForeground(),this.#Ga=!0,this.div.classList.add("disabled"),this.#is(!0),this.select(),this.parent.addInkEditorIfNeeded(!0),this.moveInDOM(),this.div.focus({preventScroll:!0}))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),this.enableEditMode())}#cs(){if(this.#Za)return;this.#Za=new AbortController;const e=this._uiManager.combinedSignal(this.#Za);this.canvas.addEventListener("pointerdown",this.canvasPointerdown.bind(this),{signal:e})}#us(){this.pointerdownAC?.abort(),this.pointerdownAC=null}canvasPointerdown(e){0===e.button&&this.isInEditMode()&&!this.#Ga&&(this.setInForeground(),e.preventDefault(),this.div.contains(document.activeElement)||this.div.focus({preventScroll:!0}),this.#ps(e.offsetX,e.offsetY))}canvasPointermove(e){e.preventDefault(),this.#gs(e.offsetX,e.offsetY)}canvasPointerup(e){e.preventDefault(),this.#xs(e)}canvasPointerleave(e){this.#xs(e)}#xs(e){this.#Xa?.abort(),this.#Xa=null,this.#cs(),this.#qa&&clearTimeout(this.#qa),this.#qa=setTimeout(()=>{this.#qa=null,this.canvas.removeEventListener("contextmenu",ut)},10),this.#ys(e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackgroun
22d()}#ss(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#os(){this.#Qa=new ResizeObserver(e=>{const t=e[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)}),this.#Qa.observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{this.#Qa?.disconnect(),this.#Qa=null},{once:!0})}get isResizable(){return!this.isEmpty()&&this.#Ga}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");const[r,n,i,a]=this.#ds();if(this.setAt(r,n,0,0),this.setDims(i,a),this.#ss(),this.width){const[r,n]=this.parentDimensions;this.setAspectRatio(this.width*r,this.height*n),this.setAt(e*r,t*n,this.width*r,this.height*n),this.#Ja=!0,this.#ls(),this.setDims(this.width*r,this.height*n),this.#as(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#os(),this.div}#ls(){if(!this.#Ja)return;const[e,t]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),this.#ws()}setDimensions(e,t){const r=Math.round(e),n=Math.round(t);if(this.#es===r&&this.#ts===n)return;this.#es=r,this.#ts=n,this.canvas.style.visibility="hidden";const[i,a]=this.parentDimensions;this.width=e/i,this.height=t/a,this.fixAndSetPosition(),this.#Ga&&this.#Es(e,t),this.#ls(),this.#as(),this.canvas.style.visibility="visible",this.fixDims()}#Es(e,t){const r=this.#Ss(),n=(e-r)/this.#Va,i=(t-r)/this.#Wa;this.scaleFactor=Math.min(n,i)}#ws(){const e=this.#Ss()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#As(e){const t=new Path2D;for(let r=0,n=e.length;r<n;r++){const[n,i,a,s]=e[r];0===r&&t.moveTo(...n),t.bezierCurveTo(i[0],i[1],a[0],a[1],s[0],s[1])}return t}static#_s(e,t,r){const[n,i,a,s]=t;switch(r){case 0:for(let t=0,r=e.length;t<r;t+=2)e[t]+=n,e[t+1]=s-e[t+1];break;case 90:for(let t=0,r=e.length;t<r;t+=2){const r=e[t];
22e[t]=e[t+1]+n,e[t+1]=r+i}break;case 180:for(let t=0,r=e.length;t<r;t+=2)e[t]=a-e[t],e[t+1]+=i;break;case 270:for(let t=0,r=e.length;t<r;t+=2){const r=e[t];e[t]=a-e[t+1],e[t+1]=s-r}break;default:throw new Error("Invalid rotation")}return e}static#Ts(e,t,r){const[n,i,a,s]=t;switch(r){case 0:for(let t=0,r=e.length;t<r;t+=2)e[t]-=n,e[t+1]=s-e[t+1];break;case 90:for(let t=0,r=e.length;t<r;t+=2){const r=e[t];e[t]=e[t+1]-i,e[t+1]=r-n}break;case 180:for(let t=0,r=e.length;t<r;t+=2)e[t]=a-e[t],e[t+1]-=i;break;case 270:for(let t=0,r=e.length;t<r;t+=2){const r=e[t];e[t]=s-e[t+1],e[t+1]=a-r}break;default:throw new Error("Invalid rotation")}return e}#Cs(e,t,r,n){const i=[],a=this.thickness/2,s=e*t+a,o=e*r+a;for(const t of this.paths){const r=[],a=[];for(let n=0,i=t.length;n<i;n++){const[l,c,u,d]=t[n];if(l[0]===d[0]&&l[1]===d[1]&&1===i){const t=e*l[0]+s,n=e*l[1]+o;r.push(t,n),a.push(t,n);break}const h=e*l[0]+s,p=e*l[1]+o,f=e*c[0]+s,g=e*c[1]+o,m=e*u[0]+s,v=e*u[1]+o,y=e*d[0]+s,b=e*d[1]+o;0===n&&(r.push(h,p),a.push(h,p)),r.push(f,g,m,v,y,b),a.push(f,g),n===i-1&&a.push(y,b)}i.push({bezier:Oi.#_s(r,n,this.rotation),points:Oi.#_s(a,n,this.rotation)})}return i}#Ps(){let e=1/0,t=-1/0,r=1/0,n=-1/0;for(const i of this.paths)for(const[a,s,o,l]of i){const i=He.bezierBoundingBox(...a,...s,...o,...l);e=Math.min(e,i[0]),r=Math.min(r,i[1]),t=Math.max(t,i[2]),n=Math.max(n,i[3])}return[e,r,t,n]}#Ss(){return this.#Ga?Math.ceil(this.thickness*this.parentScale):0}#is(e=!1){if(this.isEmpty())return;if(!this.#Ga)return void this.#as();const t=this.#Ps(),r=this.#Ss();this.#Va=Math.max(Rt.MIN_SIZE,t[2]-t[0]),this.#Wa=Math.max(Rt.MIN_SIZE,t[3]-t[1]);const n=Math.ceil(r+this.#Va*this.scaleFactor),i=Math.ceil(r+this.#Wa*this.scaleFactor),[a,s]=this.parentDimensions;this.width=n/a,this.height=i/s,this.setAspectRatio(n,i);const o=this.translationX,l=this.translationY;this.translationX=-t[0],this.translationY=-t[1],this.#ls(),this.#as(),this.#es=n,this.#ts=i,this.setDims(n,i);const c=e?r/this.scaleFactor/2:0;this.translate(o-this.translationX-c,l-this.translationY-c)}static async deserialize(e,t,r){if(e instanceof di)return null;const n=await super.deserialize(e,t,r);n.thickness=e.thickness,n.color=He.makeHexColor(...e.color),n.opacity=e.opacity;const[i,a]=n.pageDimensions,s=n.width*i,o=n.height*a,l=n.parentScale,c=e.thickness/2;n.#Ga=!0,n.#es=Math.round(s),n.#ts=Math.round(o);const{paths:u,rect:d,rotation:h}=e;for(let{bezier:e}of u){e=Oi.#Ts(e,d,h);const t=[];n.paths.push(t);let r=l*(e[0]-c),i=l*(e[1]-c);for(let n=2,a=e.length;n<a;n+=6){const a=l*(e[n]-c),s=l*(e[n+1]-c),o=l*(e[n+2]-c),u=l*(e[n+3]-c),d=l*(e[n+4]-c),h=l*(e[n+5]-c);t.push([[r,i],[a,s],[o,u],[d,h]]),r=d,i=h}const a=this.#As(t);n.bezierPath2D.push(a)}const p=n.#Ps();return n.#Va=Math.max(Rt.MIN_SIZE,p[2]-p[0]),n.#Wa=Math.max(Rt.MIN_SIZE,p[3]-p[1]),n.#Es(s,o),n}serialize(){if(this.isEmpty())return null;const e=this.getRect(0,0),t=Rt._colorManager.convert(this.ctx.strokeStyle);return{annotationType:I.INK,color:t,thickness:this.thickness,opacity:this.opacity,paths:this.#Cs(this.scaleFactor/this.parentScale,this.translationX,this.translationY,e),pageIndex:this.pageIndex,rect:e,rotation:this.rotation,structTreeParentId:this._structTreeParentId}}}class Di extends Rt{#Rs=null;#Os=null;#Ds=null;#ks=null;#Ms=null;#Ls="";#Is=null;#Qa=null;#Ns=null;#js=!1;#Fs=!1;static _type="stamp";static _editorType=I.STAMP;constructor(e){super({...e,name:"stampEditor"}),this.#ks=e.bitmapUrl,this.#Ms=e.bitmapFile}static initialize(e,t){Rt.initialize(e,t)}static get supportedTypes(){return _e(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map(e=>`image/${e}`))}static get supportedTypesStr(){return _e(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,t){t.pasteEditor(I.STAMP,{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){const t=e.get("hasAltText");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#Hs(e,t=!1){e?(this.#Rs=e.bitmap,t||(this.#Os=e.id,this.#js=e.isSvg),e.file&&(this.#Ls=e.file.name),this.#ss()):this.remove()}#Bs(){if(this.#Ds=null,this._uiManager.enableWaiting(!1),this.#Is){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#Rs)return this._editToolbar.hide(),void this._uiManager.editAltText(this,!0);if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#Rs){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(e=null,t=!0){if(this.hasAltTextData())return null;const{mlManager:r}=this._uiManager;if(!r)throw new Error("No ML.");if(!await r.isEnabledFor("altText"))throw new Error("ML isn't enabled for alt text.");const{data:n,width:i,height:a}=e||this.copyCanvas(null,null,!0).imageData,s=await r.guess({name:"altText",request:{data:n,width:i,height:a,channels:n.length/(i*a)}});if(!s)throw new Error("No response from the AI service.");if(s.error)throw new Error("Error from the AI service.");if(s.cancel)return null;if(!s.output)throw new Error("No valid response from the AI service.");const o=s.output;return await this.setGuessedAltText(o),t&&!this.hasAltTextData()&&(this.altTextData={alt:o,decorative:!1}),o}#zs(){if(this.#Os)return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(this.#Os).then(e=>this.#Hs(e,!0)).finally(()=>this.#Bs());if(this.#ks){const e=this.#ks;return this.#ks=null,this._uiManager.enableWaiting(!0),void(this.#Ds=this._uiManager.imageManager.getFromUrl(e).then(e=>this.#Hs(e)).finally(()=>this.#Bs()))}if(this.#Ms){const e=this.#Ms;return this.#Ms=null,this._uiManager.enableWaiting(!0),void(this.#Ds=this._uiManager.imageManager.getFromFile(e).then(e=>this.#Hs(e)).finally(()=>this.#Bs()))}const e=document.createElement("input");e.type="file",e.accept=Di.supportedTypesStr;const t=this._uiManager._signal;this.#Ds=new Promise(r=>{e.addEventListener("change",async()=>
vendor: 2,111 bytes, line 22
22{if(e.files&&0!==e.files.length){this._uiManager.enableWaiting(!0);const t=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#Hs(t)}else this.remove();r()},{signal:t}),e.addEventListener("cancel",()=>{this.remove(),r()},{signal:t})}).finally(()=>this.#Bs()),e.click()}remove(){this.#Os&&(this.#Rs=null,this._uiManager.imageManager.deleteId(this.#Os),this.#Is?.remove(),this.#Is=null,this.#Qa?.disconnect(),this.#Qa=null,this.#Ns&&(clearTimeout(this.#Ns),this.#Ns=null)),super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(this.#Os&&null===this.#Is&&this.#zs(),this.isAttachedToDOM||this.parent.add(this))):this.#Os&&this.#zs()}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#Ds||this.#Rs||this.#ks||this.#Ms||this.#Os)}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;if(this.width&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.div.setAttribute("role","figure"),this.addAltTextButton(),this.#Rs?this.#ss():this.#zs(),this.width&&!this.annotationElementId){const[r,n]=this.parentDimensions;this.setAt(e*r,t*n,this.width*r,this.height*n)}return this.div}#ss(){const{div:e}=this;let{width:t,height:r}=this.#Rs;const[n,i]=this.pageDimensions,a=.75;if(this.width)t=this.width*n,r=this.height*i;else if(t>a*n||r>a*i){const e=Math.min(a*n/t,a*i/r);t*=e,r*=e}const[s,o]=this.parentDimensions;this.setDims(t*s/n,r*o/i),this._uiManager.enableWaiting(!1);const l=this.#Is=document.createElement("canvas");l.setAttribute("role","img"),this.addContainer(l),this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&!this.annotationElementId||(e.hidden=!1),this.#$s(t,r),this.#os(),this.#Fs||(this.parent.addUndoableEditor(this),this.#Fs=!0),this._reportTelemetry({action:"inserted_image"}),this.#Ls&&l.setAttribute("aria-label",this.#Ls)}copyCanvas(e,t,r=!1){e||(e=224);const{width:n,height:i}=this.#Rs,a=new yt;let s=this.#Rs,o=n,l=i,c=null;if(t){if(n>t||i>t){const e=Math.min(t/n,t/i);
22o=Math.floor(n*e),l=Math.floor(i*e)}c=document.createElement("canvas");const e=c.width=Math.ceil(o*a.sx),r=c.height=Math.ceil(l*a.sy);this.#js||(s=this.#Us(e,r));const u=c.getContext("2d");u.filter=this._uiManager.hcmFilter;let d="white",h="#cfcfd8";"none"!==this._uiManager.hcmFilter?h="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(d="#8f8f9d",h="#42414d");const p=15,f=p*a.sx,g=p*a.sy,m=new OffscreenCanvas(2*f,2*g),v=m.getContext("2d");v.fillStyle=d,v.fillRect(0,0,2*f,2*g),v.fillStyle=h,v.fillRect(0,0,f,g),v.fillRect(f,g,f,g),u.fillStyle=u.createPattern(m,"repeat"),u.fillRect(0,0,e,r),u.drawImage(s,0,0,s.width,s.height,0,0,e,r)}let u=null;if(r){let t,r;if(a.symmetric&&s.width<e&&s.height<e)t=s.width,r=s.height;else if(s=this.#Rs,n>e||i>e){const a=Math.min(e/n,e/i);t=Math.floor(n*a),r=Math.floor(i*a),this.#js||(s=this.#Us(t,r))}const o=new OffscreenCanvas(t,r).getContext("2d",{willReadFrequently:!0});o.drawImage(s,0,0,s.width,s.height,0,0,t,r),u={width:t,height:r,data:o.getImageData(0,0,t,r).data}}return{canvas:c,width:o,height:l,imageData:u}}#Ws(e,t){const[r,n]=this.parentDimensions;this.width=e/r,this.height=t/n,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==this.#Ns&&clearTimeout(this.#Ns);this.#Ns=setTimeout(()=>{this.#Ns=null,this.#$s(e,t)},200)}#Us(e,t){const{width:r,height:n}=this.#Rs;let i=r,a=n,s=this.#Rs;for(;i>2*e||a>2*t;){const r=i,n=a;i>2*e&&(i=i>=16384?Math.floor(i/2)-1:Math.ceil(i/2)),a>2*t&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const o=new OffscreenCanvas(i,a);o.getContext("2d").drawImage(s,0,0,r,n,0,0,i,a),s=o.transferToImageBitmap()}return s}#$s(e,t){const r=new yt,n=Math.ceil(e*r.sx),i=Math.ceil(t*r.sy),a=this.#Is;if(!a||a.width===n&&a.height===i)return;a.width=n,a.height=i;const s=this.#js?this.#Rs:this.#Us(n,i),o=a.getContext("2d");o.filter=this._uiManager.hcmFilter,o.drawImage(s,0,0,s.width,s.height,0,0,n,i)}getImageForAltText(){return this.#Is}#Vs(e){if(e){if(this.#js){const e=this._uiManager.imageManager.getSvgUrl(this.#Os);if(e)return e}const e=document.createElement("canvas");({width:e.width,height:e.height}=this.#Rs);return e.getContext("2d").drawImage(this.#Rs,0,0),e.toDataURL()}if(this.#js){const[e,t]=this.pageDimensions,r=Math.round(this.width*e*et.PDF_TO_CSS_UNITS),n=Math.round(this.height*t*et.PDF_TO_CSS_UNITS),i=new OffscreenCanvas(r,n);return i.getContext("2d").drawImage(this.#Rs,0,0,this.#Rs.width,this.#Rs.height,0,0,r,n),i.transferToImageBitmap()}return structuredClone(this.#Rs)}#os(){this._uiManager._signal&&(this.#Qa=new ResizeObserver(e=>{const t=e[0].contentRect;t.width&&t.height&&this.#Ws(t.width,t.height)}),this.#Qa.observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{this.#Qa?.disconnect(),this.#Qa=null},{once:!0}))}static async deserialize(e,t,r){let n=null;if(e instanceof mi){const{data:{rect:i,rotation:a,id:s,structParent:o,popupRef:l},container:c,parent:{page:{pageNumber:u}}}=e,d=c.querySelector("canvas"),h=r.imageManager.getFromCanvas(c.id,d);d.remove();const p=(await t._structTree.getAriaAttributes(`${Ue}${s}`))?.get("aria-label")||"";n=e={annotationType:I.STAMP,bitmapId:h.id,bitmap:h.bitmap,pageIndex:u-1,rect:i.slice(0),rotation:a,id:s,deleted:!1,accessibilityData:{decorative:!1,altText:p},isSvg:!1,structParent:o,popupRef:l}}const i=await super.deserialize(e,t,r),{rect:a,bitmap:s,bitmapUrl:o,bitmapId:l,isSvg:c,accessibilityData:u}=e;l&&r.imageManager.isValidId(l)?(i.#Os=l,s&&(i.#Rs=s)):i.#ks=o,i.#js=c;const[d,h]=i.pageDimensions;return i.width=(a[2]-a[0])/d,i.height=(a[3]-a[1])/h,i.annotationElementId=e.id||null,u&&(i.altTextData=u),i._initialData=n,i.#Fs=!!n,i}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();const r={annotationType:I.STAMP,bitmapId:this.#Os,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#js,structTreeParentId:this._structTreeParentId};if(e)return r.bitmapUrl=this.#Vs(!0),r.accessibilityData=this.serializeAltText(!0),r;const{decorative:n,altText:i}=this.serializeAltText(!1);if(!n&&i&&(r.accessibilityData={type:"Figure",alt:i}),this.annotationElementId){const e=this.#yi(r);if(e.isSame)return null;e.isSameAltText?delete r.accessibilityData:r.accessibilityData.structParent=this._initialData.structParent??-1}if(r.id=this.annotationElementId,null===t)return r;t.stamps||=new Map;const a=this.#js?(r.rect[2]-r.rect[0])*(r.rect[3]-r.rect[1]):null;if(t.stamps.has(this.#Os)){if(this.#js){const e=t.stamps.get(this.#Os);a>e.area&&(e.area=a,e.serialized.bitmap.close(),e.serialized.bitmap=this.#Vs(!1))}}else t.stamps.set(this.#Os,{area:a,serialized:r}),r.bitmap=this.#Vs(!1);return r}#yi(e){const{rect:t,pageIndex:r,accessibilityData:{altText:n}}=this._initialData,i=e.rect.every((e,r)=>
vendor: 9,392 bytes, line 22
22Math.abs(e-t[r])<1),a=e.pageIndex===r,s=(e.accessibilityData?.alt||"")===n;return{isSame:i&&a&&s,isSameAltText:s}}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}}class ki{#ti;#qs=!1;#Ys=null;#Gs=null;#Xs=null;#Ks=new Map;#Js=!1;#Qs=!1;#Zs=!1;#eo=null;#to=null;#g;static _initialized=!1;static#B=new Map([wi,Oi,Di,Ri].map(e=>[e._editorType,e]));constructor({uiManager:e,pageIndex:t,div:r,structTreeLayer:n,accessibilityManager:i,annotationLayer:a,drawLayer:s,textLayer:o,viewport:l,l10n:c}){const u=[...ki.#B.values()];if(!ki._initialized){ki._initialized=!0;for(const t of u)t.initialize(c,e)}e.registerEditorTypes(u),this.#g=e,this.pageIndex=t,this.div=r,this.#ti=i,this.#Ys=a,this.viewport=l,this.#eo=o,this.drawLayer=s,this._structTree=n,this.#g.addLayer(this)}get isEmpty(){return 0===this.#Ks.size}get isInvisible(){return this.isEmpty&&this.#g.getMode()===I.NONE}updateToolbar(e){this.#g.updateToolbar(e)}updateMode(e=this.#g.getMode()){switch(this.#ro(),e){case I.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case I.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case I.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:t}=this.div;for(const r of ki.#B.values())t.toggle(`${r._type}Editing`,e===r._editorType);this.div.hidden=!1}hasTextLayer(e){return e===this.#eo?.div}addInkEditorIfNeeded(e){if(this.#g.getMode()!==I.INK)return;if(!e)for(const e of this.#Ks.values())if(e.isEmpty())return void e.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(e){this.#g.setEditingState(e)}addCommands(e){this.#g.addCommands(e)}toggleDrawing(e=!1){this.div.classList.toggle("drawing",!e)}togglePointerEvents(e=!1){this.div.classList.toggle("disabled",!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#Ys?.div.classList.toggle("disabled",!e)}async enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const e=new Set;for(const t of this.#Ks.values())t.enableEditing(),t.show(!0),t.annotationElementId&&(this.#g.removeChangedExistingAnnotation(t),e.add(t.annotationElementId));if(!this.#Ys)return;const t=this.#Ys.getEditableAnnotations();for(const r of t){if(r.hide(),this.#g.isDeletedAnnotationElement(r.data.id))continue;if(e.has(r.data.id))continue;const t=await this.deserialize(r);t&&(this.addOrRebuild(t),t.enableEditing())}}disable(){this.#Zs=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);const e=new Map,t=new Map;for(const r of this.#Ks.values())r.disableEditing(),r.annotationElementId&&(null===r.serialize()?(t.set(r.annotationElementId,r),this.getEditableAnnotation(r.annotationElementId)?.show(),r.remove()):e.set(r.annotationElementId,r));if(this.#Ys){const r=this.#Ys.getEditableAnnotations();for(const n of r){const{id:r}=n.data;if(this.#g.isDeletedAnnotationElement(r))continue;let i=t.get(r);i?(i.resetAnnotationElement(n),i.show(!1),n.show()):(i=e.get(r),i&&(this.#g.addChangedExistingAnnotation(i),i.renderAnnotationElement(n)&&i.show(!1)),n.show())}}this.#ro(),this.isEmpty&&(this.div.hidden=!0);const{classList:r}=this.div;for(const e of ki.#B.values())r.remove(`${e._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#Zs=!1}getEditableAnnotation(e){return this.#Ys?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#g.getActive()!==e&&this.#g.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#eo?.div&&!this.#to){this.#to=new AbortController;const e=this.#g.combinedSignal(this.#to);this.#eo.div.addEventListener("pointerdown",this.#no.bind(this),{signal:e}),this.#eo.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#eo?.div&&this.#to&&(this.#to.abort(),this.#to=null,this.#eo.div.classList.remove("highlighting"))}#no(e){this.#g.unselectAll();const{target:t}=e;if(t===this.#eo.div||("img"===t.getAttribute("role")||t.classList.contains("endOfContent"))&&this.#eo.div.contains(t)){const{isMac:t}=je.platform;if(0!==e.button||e.ctrlKey&&t)return;this.#g.showAllEditors("highlight",!0,!0),this.#eo.div.classList.add("free"),this.toggleDrawing(),Ri.startHighlighting(this,"ltr"===this.#g.direction,{target:this.#eo.div,x:e.x,y:e.y}),this.#eo.div.addEventListener("pointerup",()=>{this.#eo.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#g._signal}),e.preventDefault()}}enableClick(){if(this.#Gs)return;this.#Gs=new AbortController;const e=this.#g.combinedSignal(this.#Gs);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:e}),this.div.addEventListener("pointerup",this.pointerup.bind(this),{signal:e})}disableClick(){this.#Gs?.abort(),this.#Gs=null}attach(e){this.#Ks.set(e.id,e);const{annotationElementId:t}=e;t&&this.#g.isDeletedAnnotationElement(t)&&this.#g.removeDeletedAnnotationElement(e)}detach(e){this.#Ks.delete(e.id),this.#ti?.removePointerInTextLayer(e.contentDiv),!this.#Zs&&e.annotationElementId&&this.#g.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#g.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1,this.#Qs||this.addInkEditorIfNeeded(!1)}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#g.addDeletedAnnotationElement(e.annotationElementId),Rt.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(e.parent!==this||!e.isAttachedToDOM){if(this.changeParent(e),this.#g.addEditor(e),this.attach(e),!e.isAttachedToDOM){const t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(),this.#g.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;const{activeElement:t}=document;e.div.contains(t)&&!this.#Xs&&(e._focusEventsAllowed=!1,this.#Xs=setTimeout(()=>{this.#Xs=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#g._signal}),t.focus())},0)),e._structTreeParentId=this.#ti?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getNextId(){return this.#g.getId()}get#io(){return ki.#B.get(this.#g.getMode())}combinedSignal(e){return this.#g.combinedSignal(e)}#ao(e){const t=this.#io;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#io?.canCreateNewEmptyEditor()}pasteEditor(e,t){this.#g.updateToolbar(e),this.#g.updateMode(e);const{offsetX:r,offsetY:n}=this.#so(),i=this.getNextId(),a=this.#ao({parent:this,id:i,x:r,y:n,uiManager:this.#g,isCentered:!0,...t});a&&this.add(a)}async deserialize(e){return await(ki.#B.get(e.annotationType??e.annotationEditorType)?.deserialize(e,this,this.#g))||null}createAndAddNewEditor(e,t,r={}){const n=this.getNextId(),i=this.#ao({parent:this,id:n,x:e.offsetX,y:e.offsetY,uiManager:this.#g,isCentered:t,...r});return i&&this.add(i),i}#so(){const{x:e,y:t,width:r,height:n}=this.div.getBoundingClientRect(),i=Math.max(0,e),a=Math.max(0,t),s=(i+Math.min(window.innerWidth,e+r))/2-e,o=(a+Math.min(window.innerHeight,t+n))/2-t,[l,c]=this.viewport.rotation%180==0?[s,o]:[o,s];return{offsetX:l,offsetY:c}}addNewEditor(){this.createAndAddNewEditor(this.#so(),!0)}setSelected(e){this.#g.setSelected(e)}toggleSelected(e){this.#g.toggleSelected(e)}unselect(e){this.#g.unselect(e)}pointerup(e){const{isMac:t}=je.platform;0!==e.button||e.ctrlKey&&t||e.target===this.div&&this.#Js&&(this.#Js=!1,this.#qs?this.#g.getMode()!==I.STAMP?this.createAndAddNewEditor(e,!1):this.#g.unselectAll():this.#qs=!0)}pointerdown(e){if(this.#g.getMode()===I.HIGHLIGHT&&this.enableTextSelection(),this.#Js)return void(this.#Js=!1);const{isMac:t}=je.platform;if(0!==e.button||e.ctrlKey&&t)return;if(e.target!==this.div)return;this.#Js=!0;const r=this.#g.getActive();this.#qs=!r||r.isEmpty()}findNewParent(e,t,r){const n=this.#g.findParent(t,r);return null!==n&&n!==this&&(n.changeParent(e),!0)}destroy(){this.#g.getActive()?.parent===this&&(this.#g.commitOrRemove(),this.#g.setActiveEditor(null)),this.#Xs&&(clearTimeout(this.#Xs),this.#Xs=null);for(const e of this.#Ks.values())this.#ti?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#Ks.clear(),this.#g.removeLayer(this)}#ro(){this.#Qs=!0;for(const e of this.#Ks.values())e.isEmpty()&&e.remove();this.#Qs=!1}render({viewport:e}){this.viewport=e,vt(this.div,e);for(const e of this.#g.getEditors(this.pageIndex))this.add(e),e.rebuild();this.updateMode()}update({viewport:e}){this.#g.commitOrRemove(),this.#ro();const t=this.viewport.rotation,r=e.rotation;if(this.viewport=e,vt(this.div,{rotation:r}),t!==r)for(const e of this.#Ks.values())e.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#g.viewParameters.realScale}}class Mi{#In=null;
22#b=0;#oo=new Map;#lo=new Map;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(this.#In){if(this.#In!==e){if(this.#oo.size>0)for(const t of this.#oo.values())t.remove(),e.append(t);this.#In=e}}else this.#In=e}static get _svgFactory(){return _e(this,"_svgFactory",new Bn)}static#co(e,{x:t=0,y:r=0,width:n=1,height:i=1}={}){const{style:a}=e;a.top=100*r+"%",a.left=100*t+"%",a.width=100*n+"%",a.height=100*i+"%"}#uo(e){const t=Mi._svgFactory.create(1,1,!0);return this.#In.append(t),t.setAttribute("aria-hidden",!0),Mi.#co(t,e),t}#do(e,t){const r=Mi._svgFactory.createElement("clipPath");e.append(r);const n=`clip_${t}`;r.setAttribute("id",n),r.setAttribute("clipPathUnits","objectBoundingBox");const i=Mi._svgFactory.createElement("use");return r.append(i),i.setAttribute("href",`#${t}`),i.classList.add("clip"),n}draw(e,t,r,n=!1){const i=this.#b++,a=this.#uo(e.box);a.classList.add(...e.classNamesForDrawing);const s=Mi._svgFactory.createElement("defs");a.append(s);const o=Mi._svgFactory.createElement("path");s.append(o);const l=`path_p${this.pageIndex}_${i}`;o.setAttribute("id",l),o.setAttribute("d",e.toSVGPath()),n&&this.#lo.set(i,o);const c=this.#do(s,l),u=Mi._svgFactory.createElement("use");return a.append(u),a.setAttribute("fill",t),a.setAttribute("fill-opacity",r),u.setAttribute("href",`#${l}`),this.#oo.set(i,a),{id:i,clipPathId:`url(#${c})`}}drawOutline(e){const t=this.#b++,r=this.#uo(e.box);r.classList.add(...e.classNamesForOutlining);const n=Mi._svgFactory.createElement("defs");r.append(n);const i=Mi._svgFactory.createElement("path");n.append(i);const a=`path_p${this.pageIndex}_${t}`;let s;if(i.setAttribute("id",a),i.setAttribute("d",e.toSVGPath()),i.setAttribute("vector-effect","non-scaling-stroke"),e.mustRemoveSelfIntersections){const e=Mi._svgFactory.createElement("mask");n.append(e),s=`mask_p${this.pageIndex}_${t}`,e.setAttribute("id",s),e.setAttribute("maskUnits","objectBoundingBox");const r=Mi._svgFactory.createElement("rect");e.append(r),r.setAttribute("width","1"),r.setAttribute("height","1"),r.setAttribute("fill","white");const i=Mi._svgFactory.createElement("use");e.append(i),i.setAttribute("href",`#${a}`),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const o=Mi._svgFactory.createElement("use");r.append(o),o.setAttribute("href",`#${a}`),s&&o.setAttribute("mask",`url(#${s})`);const l=o.cloneNode();return r.append(l),o.classList.add("mainOutline"),l.classList.add("secondaryOutline"),this.#oo.set(t,r),t}finalizeLine(e,t){const r=this.#lo.get(e);this.#lo.delete(e),this.updateBox(e,t.box),r.setAttribute("d",t.toSVGPath())}updateLine(e,t){this.#oo.get(e).firstChild.firstChild.setAttribute("d",t.toSVGPath())}updatePath(e,t){this.#lo.get(e).setAttribute("d",t.toSVGPath())}updateBox(e,t){Mi.#co(this.#oo.get(e),t)}show(e,t){this.#oo.get(e).classList.toggle("hidden",!t)}rotate(e,t){this.#oo.get(e).setAttribute("data-main-rotation",t)}changeColor(e,t){this.#oo.get(e).setAttribute("fill",t)}changeOpacity(e,t){this.#oo.get(e).setAttribute("fill-opacity",t)}addClass(e,t){this.#oo.get(e).classList.add(t)}removeClass(e,t){this.#oo.get(e).classList.remove(t)}getSVGRoot(e){return this.#oo.get(e)}remove(e){this.#lo.delete(e),null!==this.#In&&(this.#oo.get(e).remove(),this.#oo.delete(e))}destroy(){this.#In=null;for(const e of this.#oo.values())e.remove();this.#oo.clear(),this.#lo.clear()}}var Li=x.AnnotationLayer,Ii=x.AnnotationMode,Ni=x.PDFDataRangeTransport,ji=x.TextLayer,Fi=x.getDocument;const Hi=(0,o.createContext)(null);function Bi({children:e,type:t}){return(0,s.jsx)("div",{className:`react-pdf__message react-pdf__message--${t}`,children:e})}class zi{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(e){this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setExternalLinkRel(e){this.externalLinkRel=e}setExternalLinkTarget(e){this.externalLinkTarget=e}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return g(this.pdfViewer),this.pdfViewer.currentPageNumber||0}set page(e){g(this.pdfViewer),this.pdfViewer.currentPageNumber=e}get rotation(){return 0}set rotation(e){}goToDestination(e){return new Promise(t=>{g(this.pdfDocument),g(e),"string"==typeof e?this.pdfDocument.getDestination(e).then(t):Array.isArray(e)?t(e):e.then(t)}).then(e=>{g(Array.isArray(e));const t=e[0];new Promise(e=>{g(this.pdfDocument),t instanceof Object?this.pdfDocument.getPageIndex(t).then(t=>{e(t)}).catch(()=>{g(!1)}):"number"==typeof t?e(t):g(!1)}).then(t=>{const r=t+1;g(this.pdfViewer),g(r>=1&&r<=this.pagesCount),this.pdfViewer.scrollPageIntoView({dest:e,pageIndex:t,pageNumber:r})})})}navigateTo(e){this.goToDestination(e)}goToPage(e){const t=e-1;g(this.pdfViewer),g(e>=1&&e<=this.pagesCount),this.pdfViewer.scrollPageIntoView({pageIndex:t,pageNumber:e})}addLinkAttributes(e,t,r){e.href=t,e.rel=this.externalLinkRel||"noopener noreferrer nofollow",e.target=r?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const $i={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};const Ui="undefined"!=typeof window,Wi=Ui&&"file:"===window.location.protocol;function Vi(e){return function(e){return void 0!==e}(e)&&null!==e}function qi(e){return function(e){return"string"==typeof e}(e)&&/^data:/.test(e)}function Yi(e){g(qi(e));const[t="",r=""]=e.split(",");return-1!==t.split(";").indexOf("base64")?atob(r):unescape(r)}function Gi(){return Ui&&window.devicePixelRatio||1}
22const Xi="On Chromium based browsers, you can use --allow-file-access-from-files flag for debugging purposes.";function Ki(){m(!Wi,`Loading PDF as base64 strings/URLs may not work on protocols other than HTTP/HTTPS. ${Xi}`)}function Ji(e){(null==e?void 0:e.cancel)&&e.cancel()}function Qi(e,t){return Object.defineProperty(e,"width",{get(){return this.view[2]*t},configurable:!0}),Object.defineProperty(e,"height",{get(){return this.view[3]*t},configurable:!0}),Object.defineProperty(e,"originalWidth",{get(){return this.view[2]},configurable:!0}),Object.defineProperty(e,"originalHeight",{get(){return this.view[3]},configurable:!0}),e}function Zi(e,t){switch(t.type){case"RESOLVE":return{value:t.value,error:void 0};case"REJECT":return{value:!1,error:t.error};case"RESET":return{value:void 0,error:void 0};default:return e}}function ea(){return(0,o.useReducer)(Zi,{value:void 0,error:void 0})}var ta=function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(s,o)}l((n=n.apply(e,t||[])).next())})},ra=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};const{Tm:na}=n,ia=(e,t)=>{switch(t){case $i.NEED_PASSWORD:e(prompt("Enter the password to open this PDF file."));break;case $i.INCORRECT_PASSWORD:e(prompt("Invalid password. Please try again."));break}};function aa(e){return"object"==typeof e&&null!==e&&("data"in e||"range"in e||"url"in e)}const sa=(0,o.forwardRef)(function(e,t){var{children:r,className:n,error:i="Failed to load PDF file.",externalLinkRel:a,externalLinkTarget:l,file:c,inputRef:h,imageResourcesPath:f,loading:v="Loading PDFâ¦",noData:y="No PDF file specified.",onItemClick:w,onLoadError:x,onLoadProgress:E,onLoadSuccess:S,onPassword:A=ia,onSourceError:_,onSourceSuccess:T,options:C,renderMode:P,rotate:R}=e,O=ra(e,["children","className","error","externalLinkRel","externalLinkTarget","file","inputRef","imageResourcesPath","loading","noData","onItemClick","onLoadError","onLoadProgress","onLoadSuccess","onPassword","onSourceError","onSourceSuccess","options","renderMode","rotate"]);const[D,k]=ea(),{value:M,error:L}=D,[I,N]=ea(),{value:j,error:F}=I,H=(0,o.useRef)(new zi),B=(0,o.useRef)([]),z=(0,o.useRef)(void 0),$=(0,o.useRef)(void 0);c&&c!==z.current&&aa(c)&&(m(!b(c,z.current),'File prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "file" prop.'),z.current=c),C&&C!==$.current&&(m(!b(C,$.current),'Options prop passed to <Document /> changed, but it\'s equal to previous one. This might result in unnecessary reloads. Consider memoizing the value passed to "options" prop.'),$.current=C);const U=(0,o.useRef)({scrollPageIntoView:e=>{const{dest:t,pageNumber:r,pageIndex:n=r-1}=e;if(w)return void w({dest:t,pageIndex:n,pageNumber:r});const i=B.current[n];i?i.scrollIntoView():m(!1,`An internal link leading to page ${r} was clicked, but neither <Document> was provided with onItemClick nor it was able to find the page within itself. Either provide onItemClick to <Document> and handle navigating by yourself or ensure that all pages are rendered within <Document>.`)}});(0,o.useImperativeHandle)(t,()=>({linkService:H,pages:B,viewer:U}),[]),(0,o.useEffect)(function(){k({type:"RESET"})},[c,k]);const W=(0,o.useCallback)(()=>ta(this,void 0,void 0,function*(){if(!c)return null;if("string"==typeof c){if(qi(c)){return{data:Yi(c)}}return Ki(),{url:c}}if(c instanceof na)return{range:c};if(c instanceof ArrayBuffer)return{data:c};if(Ui&&function(e){return g(Ui),e instanceof Blob}(c)){const e=yield function(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>{if(!n.result)return r(new Error("Error while reading a file."));t(n.result)},n.onerror=e=>{if(!e.target)return r(new Error("Error while reading a file."));const{error:t}=e.target;if(!t)return r(new Error("Error while reading a file."));switch(t.code){case t.NOT_FOUND_ERR:return r(new Error("Error while reading a file: File not found."));case t.SECURITY_ERR:return r(new Error("Error while reading a file: Security error."));case t.ABORT_ERR:return r(new Error("Error while reading a file: Aborted."));default:return r(new Error("Error while reading a file."))}},n.readAsArrayBuffer(e)})}(c);return{data:e}}if(g("object"==typeof c),g(aa(c)),"url"in c&&"string"==typeof c.url){if(qi(c.url)){const{url:e}=c,t=ra(c,["url"]),r=Yi(e);return Object.assign({data:r},t)}Ki()}return c}),[c]);(0,o.useEffect)(()=>{const e=d(W());return e.promise.then(e=>{k({type:"RESOLVE",value:e})}).catch(e=>{k({type:"REJECT",error:e})}),()=>{Ji(e)}},[W,k]),(0,o.useEffect)(()=>{void 0!==M&&(!1!==M?T&&T():L&&(m(!1,L.toString()),_&&_(L)))},[M]),(0,o.useEffect)(function(){N({type:"RESET"})},[N,M]),(0,o.useEffect)(function(){if(!M)return;const e=C?Object.assign(Object.assign({},M),C):M,t=Fi(e);
22E&&(t.onProgress=E),A&&(t.onPassword=A);const r=t,n=r.promise.then(e=>{N({type:"RESOLVE",value:e})}).catch(e=>{r.destroyed||N({type:"REJECT",error:e})});return()=>{n.finally(()=>r.destroy())}},[C,N,M]),(0,o.useEffect)(()=>{void 0!==j&&(!1!==j?j&&(S&&S(j),B.current=new Array(j.numPages),H.current.setDocument(j)):F&&(m(!1,F.toString()),x&&x(F)))},[j]),(0,o.useEffect)(function(){H.current.setViewer(U.current),H.current.setExternalLinkRel(a),H.current.setExternalLinkTarget(l)},[a,l]);const V=(0,o.useCallback)((e,t)=>{B.current[e]=t},[]),q=(0,o.useCallback)(e=>{delete B.current[e]},[]),Y=(0,o.useMemo)(()=>({imageResourcesPath:f,linkService:H.current,onItemClick:w,pdf:j,registerPage:V,renderMode:P,rotate:R,unregisterPage:q}),[f,w,j,V,P,R,q]),G=(0,o.useMemo)(()=>u(O,()=>j),[O,j]);return(0,s.jsx)("div",Object.assign({className:p("react-pdf__Document",n),ref:h,style:{"--scale-factor":"1"}},G,{children:c?null==j?(0,s.jsx)(Bi,{type:"loading",children:"function"==typeof v?v():v}):!1===j?(0,s.jsx)(Bi,{type:"error",children:"function"==typeof i?i():i}):(0,s.jsx)(Hi.Provider,{value:Y,children:r}):(0,s.jsx)(Bi,{type:"no-data",children:"function"==typeof y?y():y})}))}),oa=sa;var la=r(6137);const ca="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,ua=e=>{const t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||(e=>e.$$typeof===ca)(e)};function da(e){return(e=>!!e&&"object"==typeof e)(e)&&!ua(e)}function ha(e){return e&&"[object Function]"==={}.toString.call(e)}function pa(e,t){return!1!==t.clone&&t.isMergeableObject(e)?ba((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function fa(e,t,r){return e.concat(t).map(function(e){return pa(e,r)})}function ga(e,t,r){const n=e.slice();return t.forEach((t,i)=>{void 0===n[i]?n[i]=r.cloneUnlessOtherwiseSpecified(t,r):r.isMergeableObject(t)?n[i]=ba(e[i],t,r):-1===e.indexOf(t)&&n.push(t)}),n}function ma(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}(e))}function va(e,t){try{return t in e}catch(e){return!1}}function ya(e,t,r){const n={};return r.isMergeableObject(e)&&ma(e).forEach(function(t){n[t]=pa(e[t],r)}),ma(t).forEach(function(i){(function(e,t){return va(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(va(e,i)&&r.isMergeableObject(t[i])?n[i]=function(e,t){if(!t.customMerge)return ba;const r=t.customMerge(e);return"function"==typeof r?r:ba}(i,r)(e[i],t[i],r):n[i]=pa(t[i],r))}),n}function ba(e,t,r={}){r.arrayMerge=function(e){let t=fa;return"combine"===e.arrayMerge?t=ga:ha(e.arrayMerge)&&(t=e.arrayMerge),t}(r),r.isMergeableObject=r.isMergeableObject||da,r.cloneUnlessOtherwiseSpecified=pa;const n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):ya(e,t,r):pa(t,r)}r.dn(ha),ba.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,r){return ba(e,r,t)},{})};function wa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function xa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?wa(Object(r),!0).forEach(function(t){Ea(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wa(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ea(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sa=(e,t,r,n)=>{if("length"===r||"prototype"===r)return;if("arguments"===r||"caller"===r)return;const i=Object.getOwnPropertyDescriptor(e,r),a=Object.getOwnPropertyDescriptor(t,r);!Aa(i,a)&&n||Object.defineProperty(e,r,a)},Aa=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},_a=(e,t)=>`/* Wrapped ${e}*/\n${t}`,Ta=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Ca=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function Pa(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:n}=e;for(const n of Reflect.ownKeys(t))Sa(e,t,n,r);return((e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)})(e,t),((e,t,r)=>{const n=""===r?"":`with ${r.trim()}() `,i=_a.bind(null,n,t.toString());Object.defineProperty(i,"name",Ca),Object.defineProperty(e,"toString",xa(xa({},Ta),{},{value:i}))})(e,t,n),e}Object.create(null);function Ra(e="id"){return`${e.length?`${e}-`:""}${Math.random().toString(36).substr(2,9)}`}r.dn(Ra);/(android)/i.test(window.navigator.userAgent);const Oa=!!window.chrome,Da=/* @cc_on!@ */document.documentMode||!1,ka=(!Da&&window.StyleMedia,window.navigator.userAgent.match(/(iPod|iPhone|iPad)/i),window.navigator.userAgent.match(/(iPod|iPhone)/i),!!window.opera||window.navigator.userAgent.indexOf(" OPR/")>=0);Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0||!Oa&&!ka&&window.webkitAudioContext,window.navigator.platform;function Ma(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function La(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
22t%2?Ma(Object(r),!0).forEach(function(t){Ia(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ma(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ia(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Na=(e,t="",r="gform-spacing")=>{const n={};return!e||"string"!=typeof e&&"number"!=typeof e&&!Array.isArray(e)||Array.isArray(e)&&!e.length?n:"string"==typeof e||"number"==typeof e?(n[`${r}--${t}bottom-${e}`]=!0,n):1===e.length?(["top","right","bottom","left"].forEach(i=>{n[`${r}--${t}${i}-${e[0]}`]=!0}),n):2===e.length?(["top","bottom"].forEach(i=>{n[`${r}--${t}${i}-${e[0]}`]=!0}),["right","left"].forEach(i=>{n[`${r}--${t}${i}-${e[1]}`]=!0}),n):3===e.length?(n[`${r}--${t}top-${e[0]}`]=!0,["right","left"].forEach(i=>{n[`${r}--${t}${i}-${e[1]}`]=!0}),n[`gform-spacing--${t}bottom-${e[2]}`]=!0,n):4===e.length?(n[`${r}--${t}top-${e[0]}`]=!0,n[`${r}--${t}right-${e[1]}`]=!0,n[`${r}--${t}bottom-${e[2]}`]=!0,n[`${r}--${t}left-${e[3]}`]=!0,n):n};function ja(e="",t="gform-spacing"){const r={};return!e||"string"!=typeof e&&"number"!=typeof e&&!Array.isArray(e)&&("object"!=typeof e||Array.isArray(e))||Array.isArray(e)&&!e.length?r:(r[t]=!0,"string"==typeof e||"number"==typeof e||Array.isArray(e)?La(La({},r),Na(e,"",t)):["","md","lg"].reduce((r,n)=>Object.prototype.hasOwnProperty.call(e,n)?La(La({},r),Na(e[n],n?`${n}-`:"",t)):r,r))}if("undefined"!=typeof Element&&!Element.prototype.matches){const e=Element.prototype;e.matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector}window.gform=window.gform||{},window.gform.instances=window.gform.instances||{},window.gform.instances.filters=window.gform.instances.filters||[];window.gform.instances.filters;function Fa(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ha(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Fa(Object(r),!0).forEach(function(t){Ba(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fa(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ba(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{forwardRef:za}=la.React,$a={"metric-info":"mail","metric-success":"check-circle","metric-warn":"clock","metric-error":"x-circle","status-default":"question-mark-simple","status-locked":"lock","status-info":"information-simple","status-incorrect":"x-simple","status-correct":"checkmark-simple","status-error":"exclamation-simple"},Ua=za(({children:e=null,customAttributes:t={},customClasses:r=[],icon:n="",iconPrefix:i="gform-icon",preset:a="",spacing:s=""},o)=>{!n.length&&$a[a]&&(n=$a[a]);const l=Ha({className:(0,la.classnames)(Ha({[`${i}`]:!0,[`${i}--${n}`]:n.length>0,"gform-icon--preset-active":a.length>0,[`gform-icon-preset--${a}`]:a.length>0},ja(s)),r),ref:o},t);return la.React.createElement("span",l,e)});Ua.propTypes={children:la.PropTypes.oneOfType([la.PropTypes.arrayOf(la.PropTypes.node),la.PropTypes.node]),customAttributes:la.PropTypes.object,customClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),icon:la.PropTypes.string,iconPrefix:la.PropTypes.string,
22spacing:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.number,la.PropTypes.array,la.PropTypes.object])},Ua.displayName="Icon";const Wa=Ua,Va=({condition:e,wrapper:t,children:r})=>e?t(r):r;const{useState:qa,useEffect:Ya}=la.React;const{useState:Ga,useEffect:Xa}=la.React;"undefined"!=typeof window&&window.document;const{useCallback:Ka,useEffect:Ja,useRef:Qa}=la.React;const{useState:Za,useEffect:es}=la.React;const{useState:ts,useEffect:rs}=la.React;function ns(e){const[t,r]=ts(e);return rs(()=>{r(e)},[e]),[t,r]}function is(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function as(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?is(Object(r),!0).forEach(function(t){ss(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):is(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ss(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const os=({children:e=null,displayText:t=!0,loader:r=null,mask:n=!1,maskCustomAttributes:i={},maskCustomClasses:a=[],maskTheme:s="light",text:o="",textColor:l="#000",textCustomAttributes:c={},textCustomClasses:u=[]})=>{const d=n?as({className:(0,la.classnames)({"gform-loader__mask":!0,[`gform-loader__mask--theme-${s}`]:!0},a)},i):{},h=o?as({className:(0,la.classnames)({"gform-loader__text":t,"gform-visually-hidden":!t},u),style:{color:l}},c):{};return la.React.createElement(la.React.Fragment,null,la.React.createElement(Va,{condition:n,wrapper:e=>la.React.createElement("div",d,e)},la.React.createElement(Va,{condition:!n&&o&&t,wrapper:e=>la.React.createElement("span",{className:"gform-loader__inner"},e)},r,o&&la.React.createElement("span",h,o),e)))};os.propTypes={children:la.PropTypes.oneOfType([la.PropTypes.arrayOf(la.PropTypes.node),la.PropTypes.node]),displayText:la.PropTypes.bool,loader:la.PropTypes.node,mask:la.PropTypes.bool,maskCustomAttributes:la.PropTypes.object,maskCustomClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),maskTheme:la.PropTypes.string,text:la.PropTypes.string,textColor:la.PropTypes.string,textCustomAttributes:la.PropTypes.object,textCustomClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object])},os.displayName="Loader";const ls=os;function cs(){return cs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cs.apply(null,arguments)}function us(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ds(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?us(Object(r),!0).forEach(function(t){hs(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):us(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function hs(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{forwardRef:ps}=la.React,fs=ps(({customAttributes:e={},customClasses:t=[],foreground:r="",lineWeight:n=2,loaderCustomAttributes:i={},size:a=40,spacing:s="",speed:o=2},l)=>{const c=ds({className:(0,la.classnames)(ds({"gform-loader":!0,"gform-loader--ring":!0}
22,ja(s)),t),height:a,width:a,viewBox:"25 25 50 50",style:{animation:`gformLoaderRotate ${o}s linear infinite`,height:`${a}px`,width:`${a}px`}},e),u=50*n/a,d={animation:`animation: gformLoaderStretch calc(${o}s * 0.75) ease-in-out infinite`};r&&(d.stroke=r);const h=ds(ds({},i),{},{loader:la.React.createElement("svg",cs({},c,{ref:l}),la.React.createElement("circle",{cx:"50",cy:"50",r:"20",strokeWidth:u,style:d}))});return la.React.createElement(ls,h)});fs.propTypes={customAttributes:la.PropTypes.object,customClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),foreground:la.PropTypes.string,lineWeight:la.PropTypes.number,loaderCustomAttributes:la.PropTypes.object,size:la.PropTypes.number,spacing:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.number,la.PropTypes.array,la.PropTypes.object]),speed:la.PropTypes.number},fs.displayName="Loaders/RingLoader";const gs=fs;function ms(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function vs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ms(Object(r),!0).forEach(function(t){ys(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ms(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ys(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{forwardRef:bs,useState:ws,useRef:xs,useEffect:Es}=la.React,Ss={"size-height-s":"size-text-xs","size-height-m":"size-text-sm","size-height-l":"size-text-sm","size-height-xl":"size-text-sm","size-height-xxl":"size-text-md"},As=bs(({active:e=!1,activeText:t="",activeType:r="",ariaLabel:n="",children:i=null,circular:a=!1,customAttributes:s={},customClasses:o=[],disabled:l=!1,disableWhileActive:c=!0,icon:u="",iconAttributes:d={},iconPosition:h="",iconPrefix:p="gform-icon",label:f="",loaderProps:g={customClasses:"gform-button__loader",lineWeight:2,size:16},lockSize:m=!1,onClick:v=()=>{},size:y="size-r",spacing:b="",type:w="primary-new",width:x="auto"},E)=>{const S=["icon-white","icon-grey"].includes(w),[A,_]=ws(null),[T,C]=ws({width:"auto",height:"auto"}),P=xs();Es(()=>{if(P.current&&m){const e=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(C({width:P.current.offsetWidth,height:P.current.offsetHeight}),e.disconnect())})},{threshold:.1});e.observe(P.current),_(e)}return()=>{A&&A.disconnect()}},[P,m]);const R=vs({className:(0,la.classnames)(vs({"gform-button":!0,[`gform-button--${y}`]:!0,[`gform-button--${w}`]:!0,[`gform-button--width-${x}`]:!S,"gform-button--circular":!S&&a,"gform-button--activated":e,[`gform-button--active-type-${r}`]:r,"gform-button--loader-after":"loader"===r,"gform-button--icon-leading":!S&&u&&"leading"===h,"gform-button--icon-trailing":!S&&u&&"trailing"===h},ja(b)),o),onClick:v,disabled:l||c&&e,ref:e=>{P.current=e,"function"==typeof E?E(e):E&&(E.current=e)},style:e&&m?{width:`${T.width}px`,height:`${T.height}px`}:{}},s);n&&(R["aria-label"]=n);const O=vs(vs({},d),{},{customClasses:(0,la.classnames)(["gform-button__icon"],d.customClasses||[]),icon:u,iconPrefix:p});return la.React.createElement("button",R,S&&u&&(()=>{const e=(0,la.classnames)({"gform-button__text":!0,"gform-visually-hidden":!0});return la.React.createElement(la.React.Fragment,null,la.React.createElement(Wa,O),f&&la.React.createElement("span",{className:e},f))})()||(()=>{const n=Ss[y],a=(0,la.classnames)({"gform-button__text":!0,"gform-button__text--inactive":!0,[`gform-typography--${n}`]:0===y.indexOf("size-height-"),"gform-visually-hidden":S}),s=(0,la.classnames)({"gform-button__text":!0,"gform-button__text--active":!0,[`gform-typography--${n}`]:0===y.indexOf("size-height-")}),o=t&&e;return la.React.createElement(la.React.Fragment,null,u&&(!f||"leading"===h)&&la.React.createElement(Wa,O),f&&!o&&la.React.createElement("span",{className:a},f),o&&la.React.createElement("span",{className:s},t),u&&"trailing"===h&&la.React.createElement(Wa,O),"loader"===r&&e&&la.React.createElement(gs,g),i)})())});As.propTypes={active:la.PropTypes.bool,activeText:la.PropTypes.string,activeType:la.PropTypes.oneOf(["loader"]),children:la.PropTypes.oneOfType([la.PropTypes.arrayOf(la.PropTypes.node),la.PropTypes.node]),circular:la.PropTypes.bool,customAttributes:la.PropTypes.object,customClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),disabled:la.PropTypes.bool,disableWhileActive:la.PropTypes.bool,icon:la.PropTypes.string,iconAttributes:la.PropTypes.object,iconPosition:la.PropTypes.oneOf(["leading","trailing"]),iconPrefix:la.PropTypes.string,label:la.PropTypes.string,loaderProps:la.PropTypes.object,lockSize:la.PropTypes.bool,onClick:la.PropTypes.func,size:la.PropTypes.string,
22spacing:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.number,la.PropTypes.array,la.PropTypes.object]),type:la.PropTypes.string,width:la.PropTypes.string},As.displayName="Button";const _s=As;function Ts(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Cs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ts(Object(r),!0).forEach(function(t){Ps(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ts(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ps(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{forwardRef:Rs}=la.React,Os=Rs(({children:e=null,content:t="",customAttributes:r={},customClasses:n=[],href:i="",size:a="text-sm",spacing:s="",target:o="",weight:l="regular"},c)=>{const u=Cs({className:(0,la.classnames)(Cs({"gform-link":!0,[`gform-typography--size-${a}`]:!0,[`gform-typography--weight-${l}`]:!0},ja(s)),n),href:i,target:o,ref:c},r);return"_blank"===o&&(u.rel="noopener"),la.React.createElement("a",u,t,e)});Os.propTypes={children:la.PropTypes.oneOfType([la.PropTypes.arrayOf(la.PropTypes.node),la.PropTypes.node]),content:la.PropTypes.string,customAttributes:la.PropTypes.object,customClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),href:la.PropTypes.string,spacing:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.number,la.PropTypes.array,la.PropTypes.object]),target:la.PropTypes.string},Os.displayName="Link";const Ds=Os;function ks(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ms(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ks(Object(r),!0).forEach(function(t){Ls(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ks(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ls(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{forwardRef:Is}=la.React,Ns=Is(({asHtml:e=!1,children:t=null,color:r="port",content:n="",customAttributes:i={},customClasses:a=[],size:s="text-md",spacing:o="",tagName:l="div",weight:c="regular"},u)=>{const d=Ms({className:(0,la.classnames)(Ms({"gform-text":!0,[`gform-text--color-${r}`]:!0,[`gform-typography--size-${s}`]:!0,[`gform-typography--weight-${c}`]:!0},ja(o)),a),ref:u},i);e&&(d.dangerouslySetInnerHTML={__html:n});const h=l;return e?la.React.createElement(h,d):la.React.createElement(h,d,n,t)});Ns.propTypes={asHtml:la.PropTypes.bool,children:la.PropTypes.oneOfType([la.PropTypes.arrayOf(la.PropTypes.node),la.PropTypes.node]),content:la.PropTypes.string,customAttributes:la.PropTypes.object,customClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),size:la.PropTypes.string,spacing:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.number,la.PropTypes.array,la.PropTypes.object]),tagName:la.PropTypes.string,weight:la.PropTypes.string},Ns.displayName="Text";const js=Ns;function Fs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Hs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
22t%2?Fs(Object(r),!0).forEach(function(t){Bs(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fs(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Bs(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{forwardRef:zs,useState:$s}=la.React,Us=zs(({children:e=null,content:t="",contentCustomAttributes:r={},contentCustomClasses:n=[],ctaLabel:i="",ctaLink:a="",customAttributes:s={},customClasses:o=[],customIcon:l="",customIconPrefix:c="gform-icon",dismissableAriaLabel:u="",dismissableTitle:d="",hasCta:h=!1,iconAttributes:p={},iconClasses:f=[],isDismissable:g=!1,isInline:m=!1,spacing:v="",theme:y="cosmos",type:b="default"},w)=>{const[x,E]=$s(!1),S=Hs({className:(0,la.classnames)(Hs({"gform-alert":!0,[`gform-alert--${b}`]:!0,[`gform-alert--theme-${y}`]:!0,"gform-alert--inline":m},ja(v)),o),ref:w},s),A="cosmos"===y,_=Hs({"aria-hidden":"true"},p),T=(0,la.classnames)({"gform-alert__icon":!0},f);let C=l,P="";if(!l)switch(b){case"default":C="campaign";break;case"info":C=A?"information-simple":"circle-notice-fine",P=A?"status-info":"";break;case"notice":C=A?"exclamation-simple":"circle-notice-fine",P=A?"status-info":"";break;case"success":C=A?"checkmark-simple":"circle-check-fine",P=A?"status-correct":"";break;case"error":C=A?"exclamation-simple":"circle-error-fine",P=A?"status-error":"";break;case"incorrect":C=A?"exclamation-simple":"circle-error-fine",P=A?"status-incorrect":"";break;case"accessibility":C="accessibility"}const R=Hs({content:t,customClasses:(0,la.classnames)(["gform-alert__message"],n),tagName:"p"},r);return x?null:la.React.createElement("div",S,la.React.createElement(Wa,{customAttributes:_,customClasses:T,icon:C,iconPrefix:c,preset:P}),la.React.createElement("div",{className:"gform-alert__message-wrap"},la.React.createElement(js,R,e),h&&la.React.createElement(Ds,{content:i,customClasses:["gform-alert__cta","gform-button","gform-button--white","gform-button--size-xs"],href:a,target:"_blank"})),g&&la.React.createElement(_s,{ariaLabel:u,customAttributes:{title:d},customClasses:["gform-alert__dismiss"],icon:"delete",onClick:()=>{E(!0)}}))});Us.propTypes={children:la.PropTypes.oneOfType([la.PropTypes.arrayOf(la.PropTypes.node),la.PropTypes.node]),content:la.PropTypes.string,contentCustomAttributes:la.PropTypes.object,contentCustomClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),ctaLabel:la.PropTypes.string,ctaLink:la.PropTypes.string,customAttributes:la.PropTypes.object,customClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),customIcon:la.PropTypes.string,customIconPrefix:la.PropTypes.string,dismissableAriaLabel:la.PropTypes.string,dismissableTitle:la.PropTypes.string,hasCta:la.PropTypes.bool,iconAttributes:la.PropTypes.object,iconClasses:la.PropTypes.array,isDismissable:la.PropTypes.bool,isInline:la.PropTypes.bool,spacing:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.number,la.PropTypes.array,la.PropTypes.object]),theme:la.PropTypes.string,type:la.PropTypes.string},Us.displayName="Alert";const Ws=Us,Vs=({message:e})=>React.createElement("div",{className:"cg-fillablepdfs-embed__document-error gform-admin"},React.createElement(Ws,{type:"error"},e)),{__:qs}=wp.i18n,Ys=()=>React.createElement("div",{className:"cg-fillablepdfs-embed__document-loading"},React.createElement("span",{className:"gform-loader gform-loader--simple"}),React.createElement("span",{className:"gform-loader__text"},qs("Loading...","forgravity_fillablepdfs")));function Gs(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.filter(Boolean);return r.length<=1?r[0]||null:function(e){r.forEach(function(t){"function"==typeof t?t(e):t&&(t.current=e)})}}const Xs=(0,o.createContext)(null),Ks={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P
22:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},Js=/^H(\d+)$/;function Qs(e){return"children"in e}function Zs(e){return!!Qs(e)&&(1===e.children.length&&0 in e.children&&"id"in e.children[0])}function eo(e){const t={};if(Qs(e)){const{role:r}=e,n=r.match(Js);if(n)t.role="heading",t["aria-level"]=Number(n[1]);else if(function(e){return e in Ks}(r)){const e=Ks[r];e&&(t.role=e)}}return t}function to(e){const t={};if(Qs(e)){if(void 0!==e.alt&&(t["aria-label"]=e.alt),void 0!==e.lang&&(t.lang=e.lang),Zs(e)){const[r]=e.children;if(r){const e=to(r);return Object.assign(Object.assign({},t),e)}}}else"id"in e&&(t["aria-owns"]=e.id);return t}function ro(e){return e?Object.assign(Object.assign({},eo(e)),to(e)):null}function no({className:e,node:t}){const r=(0,o.useMemo)(()=>ro(t),[t]),n=(0,o.useMemo)(()=>Qs(t)?Zs(t)?null:t.children.map((e,t)=>(0,s.jsx)(no,{node:e},t)):null,[t]);return(0,s.jsx)("span",Object.assign({className:e},r,{children:n}))}function io(){return(0,o.useContext)(Xs)}function ao(){const e=io();g(e);const{onGetStructTreeError:t,onGetStructTreeSuccess:r}=e,[n,i]=ea(),{value:a,error:l}=n,{customTextRenderer:c,page:u}=e;return(0,o.useEffect)(function(){i({type:"RESET"})},[i,u]),(0,o.useEffect)(function(){if(c)return;if(!u)return;const e=d(u.getStructTree()),t=e;return e.promise.then(e=>{i({type:"RESOLVE",value:e})}).catch(e=>{i({type:"REJECT",error:e})}),()=>Ji(t)},[c,u,i]),(0,o.useEffect)(()=>{void 0!==a&&(!1!==a?a&&r&&r(a):l&&(m(!1,l.toString()),t&&t(l)))},[a]),a?(0,s.jsx)(no,{className:"react-pdf__Page__structTree structTree",node:a}):null}const so=Ii;function oo(e){const t=io();g(t);const r=Object.assign(Object.assign({},t),e),{_className:n,canvasBackground:i,devicePixelRatio:a=Gi(),onRenderError:l,onRenderSuccess:c,page:u,renderForms:d,renderTextLayer:h,rotate:p,scale:f}=r,{canvasRef:v}=e;g(u);const y=(0,o.useRef)(null);
22function b(e){(function(e){return"RenderingCancelledException"===e.name})(e)||(m(!1,e.toString()),l&&l(e))}const w=(0,o.useMemo)(()=>u.getViewport({scale:f*a,rotation:p}),[a,u,p,f]),x=(0,o.useMemo)(()=>u.getViewport({scale:f,rotation:p}),[u,p,f]);(0,o.useEffect)(function(){if(!u)return;u.cleanup();const{current:e}=y;if(!e)return;e.width=w.width,e.height=w.height,e.style.width=`${Math.floor(x.width)}px`,e.style.height=`${Math.floor(x.height)}px`,e.style.visibility="hidden";const t={annotationMode:d?so.ENABLE_FORMS:so.ENABLE,canvasContext:e.getContext("2d",{alpha:!1}),viewport:w};i&&(t.background=i);const r=u.render(t),n=r;return r.promise.then(()=>{e.style.visibility="",u&&c&&c(Qi(u,f))}).catch(b),()=>Ji(n)},[i,u,d,w,x]);const E=(0,o.useCallback)(()=>{const{current:e}=y;e&&(e.width=0,e.height=0)},[]);return(0,o.useEffect)(()=>E,[E]),(0,s.jsx)("canvas",{className:`${n}__canvas`,dir:"ltr",ref:Gs(v,y),style:{display:"block",userSelect:"none"},children:h?(0,s.jsx)(ao,{}):null})}function lo(){const e=io();g(e);const{customTextRenderer:t,onGetTextError:r,onGetTextSuccess:n,onRenderTextLayerError:i,onRenderTextLayerSuccess:a,page:l,pageIndex:c,pageNumber:u,rotate:h,scale:f}=e;g(l);const[v,y]=ea(),{value:b,error:w}=v,x=(0,o.useRef)(null);m(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-text-layer"),10),"TextLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-text-layer"),(0,o.useEffect)(function(){y({type:"RESET"})},[l,y]),(0,o.useEffect)(function(){if(!l)return;const e=d(l.getTextContent()),t=e;return e.promise.then(e=>{y({type:"RESOLVE",value:e})}).catch(e=>{y({type:"REJECT",error:e})}),()=>Ji(t)},[l,y]),(0,o.useEffect)(()=>{void 0!==b&&(!1!==b?b&&n&&n(b):w&&(m(!1,w.toString()),r&&r(w)))},[b]);const E=(0,o.useCallback)(()=>{a&&a()},[a]),S=(0,o.useCallback)(e=>{m(!1,e.toString()),i&&i(e)},[i]);const A=(0,o.useMemo)(()=>l.getViewport({scale:f,rotation:h}),[l,h,f]);return(0,o.useLayoutEffect)(function(){if(!l||!b)return;const{current:e}=x;if(!e)return;e.innerHTML="";const r=l.streamTextContent({includeMarkedContent:!0}),n=new ji({container:e,textContentSource:r,viewport:A}),i=n;return n.render().then(()=>{const r=document.createElement("div");r.className="endOfContent",e.append(r);const n=e.querySelectorAll('[role="presentation"]');if(t){let e=0;b.items.forEach((r,i)=>{if(!function(e){return"str"in e}(r))return;const a=n[e];if(!a)return;const s=t(Object.assign({pageIndex:c,pageNumber:u,itemIndex:i},r));a.innerHTML=s,e+=r.str&&r.hasEOL?2:1})}E()}).catch(S),()=>Ji(i)},[t,S,E,l,c,u,b,A]),(0,s.jsx)("div",{className:p("react-pdf__Page__textContent","textLayer"),onMouseUp:function(){const e=x.current;e&&e.classList.remove("selecting")},onMouseDown:function(){const e=x.current;e&&e.classList.add("selecting")},ref:x})}function co(){return(0,o.useContext)(Hi)}function uo(){const e=co(),t=io();g(t);const r=Object.assign(Object.assign({},e),t),{imageResourcesPath:n,linkService:i,onGetAnnotationsError:a,onGetAnnotationsSuccess:l,onRenderAnnotationLayerError:c,onRenderAnnotationLayerSuccess:u,page:h,pdf:f,renderForms:v,rotate:y,scale:b=1}=r;g(f),g(h),g(i);const[w,x]=ea(),{value:E,error:S}=w,A=(0,o.useRef)(null);m(1===Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--react-pdf-annotation-layer"),10),"AnnotationLayer styles not found. Read more: https://github.com/wojtekmaj/react-pdf#support-for-annotations"),(0,o.useEffect)(function(){x({type:"RESET"})},[x,h]),(0,o.useEffect)(function(){if(!h)return;const e=d(h.getAnnotations()),t=e;return e.promise.then(e=>{x({type:"RESOLVE",value:e})}).catch(e=>{x({type:"REJECT",error:e})}),()=>{Ji(t)}},[x,h]),(0,o.useEffect)(()=>{void 0!==E&&(!1!==E?E&&l&&l(E):S&&(m(!1,S.toString()),a&&a(S)))},[E]);const _=(0,o.useMemo)(()=>h.getViewport({scale:b,rotation:y}),[h,y,b]);return(0,o.useEffect)(function(){if(!(f&&h&&i&&E))return;const{current:e}=A;if(!e)return;const t=_.clone({dontFlip:!0}),r={accessibilityManager:null,annotationCanvasMap:null,annotationEditorUIManager:null,div:e,l10n:null,page:h,structTreeLayer:null,viewport:t},a={annotations:E,annotationStorage:f.annotationStorage,div:e,imageResourcesPath:n,linkService:i,page:h,renderForms:v,viewport:t};e.innerHTML="";try{new Li(r).render(a),u&&u()}catch(e){!function(e){m(!1,`${e}`),c&&c(e)}(e)}return()=>{}},[E,n,i,h,f,v,_]),(0,s.jsx)("div",{className:p("react-pdf__Page__annotations","annotationLayer"),ref:A})}var ho=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};const po=1;function fo(e){const t=co(),r=Object.assign(Object.assign({},t),e),{_className:n="react-pdf__Page",_enableRegisterUnregisterPage:i=!0,canvasBackgroun
22d:a,canvasRef:l,children:c,className:h,customRenderer:f,customTextRenderer:v,devicePixelRatio:y,error:b="Failed to load the page.",height:w,inputRef:x,loading:E="Loading pageâ¦",noData:S="No page specified.",onGetAnnotationsError:A,onGetAnnotationsSuccess:_,onGetStructTreeError:T,onGetStructTreeSuccess:C,onGetTextError:P,onGetTextSuccess:R,onLoadError:O,onLoadSuccess:D,onRenderAnnotationLayerError:k,onRenderAnnotationLayerSuccess:M,onRenderError:L,onRenderSuccess:I,onRenderTextLayerError:N,onRenderTextLayerSuccess:j,pageIndex:F,pageNumber:H,pdf:B,registerPage:z,renderAnnotationLayer:$=!0,renderForms:U=!1,renderMode:W="canvas",renderTextLayer:V=!0,rotate:q,scale:Y=po,unregisterPage:G,width:X}=r,K=ho(r,["_className","_enableRegisterUnregisterPage","canvasBackground","canvasRef","children","className","customRenderer","customTextRenderer","devicePixelRatio","error","height","inputRef","loading","noData","onGetAnnotationsError","onGetAnnotationsSuccess","onGetStructTreeError","onGetStructTreeSuccess","onGetTextError","onGetTextSuccess","onLoadError","onLoadSuccess","onRenderAnnotationLayerError","onRenderAnnotationLayerSuccess","onRenderError","onRenderSuccess","onRenderTextLayerError","onRenderTextLayerSuccess","pageIndex","pageNumber","pdf","registerPage","renderAnnotationLayer","renderForms","renderMode","renderTextLayer","rotate","scale","unregisterPage","width"]),[J,Q]=ea(),{value:Z,error:ee}=J,te=(0,o.useRef)(null);g(B);const re=Vi(H)?H-1:null!=F?F:null,ne=null!=H?H:Vi(F)?F+1:null,ie=null!=q?q:Z?Z.rotate:null,ae=(0,o.useMemo)(()=>{if(!Z)return null;let e=1;const t=null!=Y?Y:po;if(X||w){const t=Z.getViewport({scale:1,rotation:ie});X?e=X/t.width:w&&(e=w/t.height)}return t*e},[w,Z,ie,Y,X]);(0,o.useEffect)(function(){return()=>{Vi(re)&&i&&G&&G(re)}},[i,B,re,G]),(0,o.useEffect)(function(){Q({type:"RESET"})},[Q,B,re]),(0,o.useEffect)(function(){if(!B||!ne)return;const e=d(B.getPage(ne)),t=e;return e.promise.then(e=>{Q({type:"RESOLVE",value:e})}).catch(e=>{Q({type:"REJECT",error:e})}),()=>Ji(t)},[Q,B,ne]),(0,o.useEffect)(()=>{void 0!==Z&&(!1!==Z?function(){if(D){if(!Z||!ae)return;D(Qi(Z,ae))}if(i&&z){if(!Vi(re)||!te.current)return;z(re,te.current)}}():ee&&(m(!1,ee.toString()),O&&O(ee)))},[Z,ae]);const se=(0,o.useMemo)(()=>Z&&Vi(re)&&ne&&Vi(ie)&&Vi(ae)?{_className:n,canvasBackground:a,customTextRenderer:v,devicePixelRatio:y,onGetAnnotationsError:A,onGetAnnotationsSuccess:_,onGetStructTreeError:T,onGetStructTreeSuccess:C,onGetTextError:P,onGetTextSuccess:R,onRenderAnnotationLayerError:k,onRenderAnnotationLayerSuccess:M,onRenderError:L,onRenderSuccess:I,onRenderTextLayerError:N,onRenderTextLayerSuccess:j,page:Z,pageIndex:re,pageNumber:ne,renderForms:U,renderTextLayer:V,rotate:ie,scale:ae}:null,[n,a,v,y,A,_,T,C,P,R,k,M,L,I,N,j,Z,re,ne,U,V,ie,ae]),oe=(0,o.useMemo)(()=>u(K,()=>Z?ae?Qi(Z,ae):void 0:Z),[K,Z,ae]),le=`${re}@${ae}/${ie}`;function ce(){switch(W){case"custom":return g(f),(0,s.jsx)(f,{},`${le}_custom`);case"none":return null;default:return(0,s.jsx)(oo,{canvasRef:l},`${le}_canvas`)}}return(0,s.jsx)("div",Object.assign({className:p(n,h),"data-page-number":ne,ref:Gs(x,te),style:{"--scale-factor":`${ae}`,backgroundColor:a||"white",position:"relative",minWidth:"min-content",minHeight:"min-content"}},oe,{children:ne?null===B||null==Z?(0,s.jsx)(Bi,{type:"loading",children:"function"==typeof E?E():E}):!1===B||!1===Z?(0,s.jsx)(Bi,{type:"error",children:"function"==typeof b?b():b}):(0,s.jsxs)(Xs.Provider,{value:se,children:[ce(),V?(0,s.jsx)(lo,{},`${le}_text`):null,$?(0,s.jsx)(uo,{},`${le}_annotations`):null,c]}):(0,s.jsx)(Bi,{type:"no-data",children:"function"==typeof S?S():S})}))}var go=Object.defineProperty,mo=(e,t,r)=>((e,t,r)=>t in e?go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),vo=new Map,yo=new WeakMap,bo=0,wo=void 0;function xo(e){return Object.keys(e).sort().filter(t=>void 0!==e[t]).map(t=>{return`${t}_${"root"===t?(r=e.root,r?(yo.has(r)||(bo+=1,yo.set(r,bo.toString())),yo.get(r)):"0"):e[t]}`;var r}).toString()}function Eo(e,t,r={},n=wo){if(void 0===window.IntersectionObserver&&void 0!==n){const i=e.getBoundingClientRect();return t(n,{isIntersecting:n,target:e,intersectionRatio:"number"==typeof r.threshold?r.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:a,elements:s}=function(e){const t=xo(e);let r=vo.get(t);if(!r){const n=new Map;let i;const a=new IntersectionObserver(t=>{t.forEach(t=>{var r;const a=t.isIntersecting&&i.some(e=>t.intersectionRatio>=e);e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=a),null==(r=n.get(t.target))||r.forEach(e
22=>{e(a,t)})})},e);i=a.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),r={id:t,observer:a,elements:n},vo.set(t,r)}return r}(r),o=s.get(e)||[];return s.has(e)||s.set(e,o),o.push(t),a.observe(e),function(){o.splice(o.indexOf(t),1),0===o.length&&(s.delete(e),a.unobserve(e)),0===s.size&&(a.disconnect(),vo.delete(i))}}o.Component;const{forwardRef:So,useEffect:Ao,useRef:_o}=wp.element,To=So(({pageNumber:e,setCurrentPage:t,zoom:r,containerRef:n,defaultPdfWidth:i},a)=>{const s=_o(!0),{ref:l,inView:c}=function({threshold:e,delay:t,trackVisibility:r,rootMargin:n,root:i,triggerOnce:a,skip:s,initialInView:l,fallbackInView:c,onChange:u}={}){var d;const[h,p]=o.useState(null),f=o.useRef(u),[g,m]=o.useState({inView:!!l,entry:void 0});f.current=u,o.useEffect(()=>{if(s||!h)return;let o;return o=Eo(h,(e,t)=>{m({inView:e,entry:t}),f.current&&f.current(e,t),t.isIntersecting&&a&&o&&(o(),o=void 0)},{root:i,rootMargin:n,threshold:e,trackVisibility:r,delay:t},c),()=>{o&&o()}},[Array.isArray(e)?e.toString():e,h,i,n,a,s,r,c,t]);const v=null==(d=g.entry)?void 0:d.target,y=o.useRef(void 0);h||!v||a||s||y.current===v||(y.current=v,m({inView:!!l,entry:void 0}));const b=[p,g.inView,g.entry];return b.ref=b[0],b.inView=b[1],b.entry=b[2],b}({root:n.current,rootMargin:"0px 0px -25% 0px",threshold:.1,triggerOnce:!1});Ao(()=>{if(s.current)s.current=!1;else if(c){const r=setTimeout(()=>{t(e)},100);return()=>clearTimeout(r)}},[c,e,t]);return React.createElement("div",{className:"cg-fillablepdfs-embed__page",ref:e=>{l(e),a&&("function"==typeof a?a(e):void 0!==a.current&&(a.current=e))}},React.createElement(fo,{pageNumber:e,width:i*(r/100)-40,renderTextLayer:!1}))}),Co=["customClasses"];function Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Po.apply(null,arguments)}function Ro(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Oo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ro(Object(r),!0).forEach(function(t){Do(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ro(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Do(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{useEffect:ko,useRef:Mo,useState:Lo,forwardRef:Io}=la.React,No=14,jo=Io(({buffer:e=0,children:t=null,content:r="",contentAttributes:n={},customAttributes:i={},customClasses:a=[],icon:s="question-mark",iconPrefix:o="gform-icon",iconPreset:l="",intentDelay:c=500,id:u="",maxWidth:d=0,position:h="top",spacing:p="",tagName:f="div",theme:g="chathams",tooltipCustomAttributes:m={},type:v="default"},y)=>{const b=u||Ra("tooltip"),w=Mo(),[x,E]=Lo(0),[S,A]=Lo(!1),[_,T]=Lo(!1),[C,P]=Lo(!1),[R,O]=Lo("top"),D=()=>{A(!0),w.current&&!x&&E(w.current.offsetWidth+1)},k=()=>{A(!1),_&&P(!1),M.cancel()},M=function(e,t={}){if("function"!=typeof e)throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);const{wait:r=0,maxWait:n=Number.Infinity,before:i=!1,after:a=!0}=t;if(!i&&!a)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let s,o,l;const c=function(...t){const c=this,u=()=>{o=void 0,s&&(clearTimeout(s),s=void 0),a&&(l=e.apply(c,t))},d=i&&!s;return clearTimeout(s),s=setTimeout(()=>{s=void 0,o&&(clearTimeout(o),o=void 0),a&&(l=e.apply(c,t))},r),n>0&&n!==Number.Infinity&&!o&&(o=setTimeout(u,n)),d&&(l=e.apply(c,t)),l};return Pa(c,e),c.cancel=()=>{s&&(clearTimeout(s),s=void 0),o&&(clearTimeout(o),o=void 0)},c}(()=>{T(!0),O(h),requestAnimationFrame(()=>{const t=N(e,h,w);O(t),P(!0)})},{wait:c});ko(()=>{S&&M()},[S]);const L=(e,t,r,n,i,a)=>{const s=e*t;let o=0;return r>0&&(o+=r*t),n>0&&(o+=n*t),i>0&&(o+=i*e),a>0&&(o+=a*e),i>0&&r>0&&(o-=i*r),i>0&&n>0&&(o-=i*n),a>0&&r>0&&(o-=a*r),a>0&&n>0&&(o-=a*n),(s-o)/s},I=(e,t,r,n,i)=>{const a=n.innerWidth,s=n.innerHeight,o=i-r.top,l=r.bottom-(s-i),c=i-r.left,u=r.right-(a-i);let d,h,p,f,g,m,v,y;switch(e){case"top":switch(t){case"top":return!0;case"bottom":d=r.bottom+44,h=d+r.height,g=i-d,m=h-(s-i),v=c,y=u;break;
22case"left":d=r.bottom+No+8-r.height/2,h=d+r.height,p=r.left+r.width/2-8-No-r.width,f=p+r.width,g=i-d,m=h-(s-i),v=i-p,y=f-(a-i);break;case"right":d=r.bottom+No+8-r.height/2,h=d+r.height,p=r.left+r.width/2+8+No,f=p+r.width,g=i-d,m=h-(s-i),v=i-p,y=f-(a-i);break;default:return!1}break;case"bottom":switch(t){case"top":d=r.top-44-r.height,h=d+r.height,g=i-d,m=h-(s-i),v=c,y=u;break;case"bottom":return!0;case"left":d=r.top-No-8-r.height/2,h=d+r.height,p=r.left+r.width/2-8-No-r.width,f=p+r.width,g=i-d,m=h-(s-i),v=i-p,y=f-(a-i);break;case"right":d=r.top-No-8-r.height/2,h=d+r.height,p=r.left+r.width/2+8+No,f=p+r.width,g=i-d,m=h-(s-i),v=i-p,y=f-(a-i);break;default:return!1}break;case"left":switch(t){case"top":d=r.top+r.height/2-8-No-r.height,h=d+r.height,p=r.right+No+8-r.width/2,f=p+r.width,g=i-d,m=h-(s-i),v=i-p,y=f-(a-i);break;case"bottom":d=r.top+r.height/2+8+No,h=d+r.height,p=r.right+No+8-r.width/2,f=p+r.width,g=i-d,m=h-(s-i),v=i-p,y=f-(a-i);break;case"left":return!0;case"right":p=r.right+44,f=p+r.width,g=o,m=l,v=i-p,y=f-(a-i);break;default:return!1}break;case"right":switch(t){case"top":d=r.top+r.height/2-8-No-r.height,h=d+r.height,p=r.left-No-8-r.width/2,f=p+r.width,g=i-d,m=h-(s-i),v=i-p,y=f-(a-i);break;case"bottom":d=r.top+r.height/2+8+No,h=d+r.height,p=r.left-No-8-r.width/2,f=p+r.width,g=i-d,m=h-(s-i),v=i-p,y=f-(a-i);break;case"left":p=r.left-44-r.width,f=p+r.width,g=o,m=l,v=i-p,y=f-(a-i);break;case"right":return!0;default:return!1}break;default:return!1}return L(r.width,r.height,v,y,g,m)},N=(e,t,r)=>{if(!r.current)return t;const n=r.current.getBoundingClientRect(),i=r.current.ownerDocument.defaultView,a=i.innerWidth,s=i.innerHeight,o=e-n.top,l=n.bottom-(s-e),c=e-n.left,u=n.right-(a-e),d=L(n.width,n.height,c,u,o,l),h={};switch(t){case"top":h.top=d,h.bottom=I("top","bottom",n,i,e),h.left=I("top","left",n,i,e),h.right=I("top","right",n,i,e);break;case"bottom":h.top=I("bottom","top",n,i,e),h.bottom=d,h.left=I("bottom","left",n,i,e),h.right=I("bottom","right",n,i,e);break;case"left":h.top=I("left","top",n,i,e),h.bottom=I("left","bottom",n,i,e),h.left=d,h.right=I("left","right",n,i,e);break;case"right":h.top=I("right","top",n,i,e),h.bottom=I("right","bottom",n,i,e),h.left=I("right","left",n,i,e),h.right=d;break;default:return t}return Object.keys(h).reduce((e,t)=>h[t]>h[e]?t:e,t)},j=({con:e="",cAttributes:t={size:"text-xs"}})=>{if(!e)return null;const{customClasses:r}=t,n=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,Co),i=Oo({customClasses:(0,la.classnames)(["gform-tooltip__tooltip-content"],r),color:"white",size:"text-xs"},n);return la.React.createElement(js,i,e)},F=Oo({className:(0,la.classnames)(Oo({"gform-tooltip":!0,[`gform-tooltip--position-${R}`]:!0,[`gform-tooltip--theme-${g}`]:!0,[`gform-tooltip--type-${v}`]:!0,"gform-tooltip--initialized":!!x,"gform-tooltip--anim-in-ready":_,"gform-tooltip--anim-in-active":_&&C},ja(p)),a)},i),H={className:"gform-tooltip__trigger","aria-describedby":b,onBlur:k,onFocus:D,onMouseEnter:D,onMouseLeave:k},B=Oo({className:"gform-tooltip__tooltip",role:"tooltip",id:b,onTransitionEnd:()=>{C||T(!1)}},m),z={icon:s,iconPrefix:o,preset:l},$={};x&&($.width=x+"px"),d&&($.maxWidth=d+"px"),B.style=$;const U=f;return la.React.createElement(U,Po({},F,{ref:y}),la.React.createElement("button",H,la.React.createElement(Wa,z)),la.React.createElement("div",Po({ref:w},B),la.React.createElement(j,{con:r,cAttributes:n}),t,la.React.createElement("span",{className:"gform-tooltip__tooltip-arrow"})))});jo.propTypes={buffer:la.PropTypes.number,children:la.PropTypes.oneOfType([la.PropTypes.arrayOf(la.PropTypes.node),la.PropTypes.node]),content:la.PropTypes.string,contentAttributes:la.PropTypes.object,customAttributes:la.PropTypes.object,customClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),icon:la.PropTypes.string,iconPrefix:la.PropTypes.string,iconPreset:la.PropTypes.string,intentDelay:la.PropTypes.number,id:la.PropTypes.string,maxWidth:la.PropTypes.number,position:la.PropTypes.string,
22spacing:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.number,la.PropTypes.array,la.PropTypes.object]),theme:la.PropTypes.string,tooltipCustomAttributes:la.PropTypes.object,type:la.PropTypes.string},jo.displayName="Tooltip";const Fo=jo;function Ho(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Bo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ho(Object(r),!0).forEach(function(t){zo(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ho(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function zo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{forwardRef:$o}=la.React,Uo=$o(({children:e=null,customAttributes:t={},customClasses:r=[],htmlFor:n="",icon:i="lock",iconPrefix:a="gform-icon",isVisible:s=!0,label:o="",locked:l=!1,lockedMessage:c="",size:u="text-sm",spacing:d="",weight:h="medium"},p)=>{if(!o&&!e)return null;const f=Bo({className:(0,la.classnames)(Bo({"gform-label":!0,[`gform-typography--size-${u}`]:!0,[`gform-typography--weight-${h}`]:!0,"gform-visually-hidden":!s},ja(d)),r),htmlFor:n,ref:p},t),g={content:c,icon:i,iconPrefix:a,iconPreset:"status-locked",maxWidth:300,position:"right",spacing:[0,0,0,2],tagName:"span",theme:"port"};return la.React.createElement("label",f,o,e,l&&la.React.createElement(Fo,g))});Uo.propTypes={children:la.PropTypes.oneOfType([la.PropTypes.arrayOf(la.PropTypes.node),la.PropTypes.node]),customAttributes:la.PropTypes.object,customClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),htmlFor:la.PropTypes.string,iconPrefix:la.PropTypes.string,isVisible:la.PropTypes.bool,label:la.PropTypes.string,locked:la.PropTypes.bool,lockedMessage:la.PropTypes.string,size:la.PropTypes.string,spacing:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.number,la.PropTypes.array,la.PropTypes.object]),weight:la.PropTypes.string},Uo.displayName="Label";const Wo=Uo;function Vo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function qo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vo(Object(r),!0).forEach(function(t){Yo(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Yo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{forwardRef:Go}=la.React,Xo=Go(({asHtml:e=!1,content:t="",customAttributes:r={},customClasses:n=[],id:i="",size:a="text-xs",spacing:s="",weight:o="regular"},l)=>{if(!t)return null;const c=qo({className:(0,la.classnames)(qo({"gform-input-help-text":!0,[`gform-typography--size-${a}`]:!0,[`gform-typography--weight-${o}`]:!0},ja(s)),n),id:i,ref:l},r);return e&&(c.dangerouslySetInnerHTML={__html:t}),e?la.React.createElement("span",c):la.React.createElement("span",c,t)});Xo.propTypes={content:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.node]),customAttributes:la.PropTypes.object,customClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),id:la.PropTypes.string,
22size:la.PropTypes.string,spacing:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.number,la.PropTypes.array,la.PropTypes.object]),weight:la.PropTypes.string},Xo.displayName="HelpText";const Ko=Xo;function Jo(){return Jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jo.apply(null,arguments)}function Qo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Zo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Qo(Object(r),!0).forEach(function(t){el(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function el(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const{useState:tl,forwardRef:rl}=la.React,nl=rl(({actionButtonAttributes:e={label:""},borderStyle:t="default",clearable:r=!1,clearableButtonAttributes:n={},controlled:i=!1,customAttributes:a={},customClasses:s=[],disabled:o=!1,helpTextAttributes:l={size:"text-xs",weight:"regular"},helpTextPosition:c="below",iconAttributes:u={},id:d="",labelAttributes:h={size:"text-sm",weight:"medium"},name:p="",onBlur:f=()=>{},onChange:g=()=>{},onClear:m=()=>{},onKeyDown:v=()=>{},onFocus:y=()=>{},placeholder:b="",required:w=!1,requiredLabel:x={size:"text-sm",weight:"medium"},size:E="size-r",spacing:S="",textSecurity:A="none",theme:_="cosmos",type:T="text",value:C="",wrapperAttributes:P={},wrapperClasses:R=[],wrapperTagName:O="div"},D)=>{const k=i?ns:tl,[M,L]=k(C),I=d||Ra("input"),N=`${I}-help-text`,j=!(!u.icon&&!u.preset),F=e.label&&e.label.length>0,H=Zo(Zo({},P),{},{className:(0,la.classnames)(Zo(Zo({"gform-input-wrapper":!0,[`gform-input-wrapper--theme-${_}`]:!0,"gform-input-wrapper--input":!0,"gform-input-wrapper--with-action":F,"gform-input-wrapper--clearable":r,"gform-input-wrapper--disabled":o},ja(S)),{},{"gform-input-wrapper--required":w,[`gform-input-wrapper--border-${t}`]:!0,"gform-input-wrapper--with-icon":j,[`gform-input-wrapper--text-security-${A}`]:"password"!==T&&"none"!==A}),R),ref:D}),B=Zo(Zo({},a),{},{className:(0,la.classnames)({"gform-input":!0,"gform-typography--size-text-sm":"cosmos"===_,[`gform-input--${E}`]:!0,[`gform-input--${T}`]:!0},s),disabled:o||!0===h?.locked,id:I,name:p,onBlur:f,onKeyDown:v,onChange:e=>{const{value:t}=e.target;L(t),g(t,e)},onFocus:y,type:T,value:M});b&&(B.placeholder=b),l.content&&(B["aria-describedby"]=N),w&&(B.required=!0);const z=Zo(Zo({},h),{},{htmlFor:I}),$=Zo(Zo({},l),{},{id:N}),U=Zo({customClasses:(0,la.classnames)(["gform-input-help-text--required"]),id:N},x),W=Zo(Zo({},u),{},{customClasses:(0,la.classnames)(["gform-input__icon"],u.customClasses||[])}),V=Zo(Zo({icon:"circle-close",type:"unstyled"},n),{},{customClasses:(0,la.classnames)(["gform-input__clearable-button"],n.customClasses||[])}),q=Zo(Zo({iconPosition:"leading",type:"white"},e),{},{customClasses:(0,la.classnames)(["gform-input__action-button"],e.customClasses||[]),onClick:t=>{e.onClick&&e.onClick(t,M)}}),Y=O;return la.React.createElement(Y,H,la.React.createElement(Wo,z),w&&la.React.createElement(Ko,U),"above"===c&&la.React.createElement(Ko,$),la.React.createElement(Va,{condition:F,wrapper:e=>la.React.createElement("div",{className:"gform-input__action-wrapper"},e,la.React.createElement(_s,q))},la.React.createElement(Va,{condition:j,wrapper:e=>la.React.createElement("div",{className:"gform-input__wrapper"},e)},la.React.createElement("input",B),j&&la.React.createElement(Wa,W),r&&M&&la.React.createElement(_s,Jo({},V,{onClick:()=>{L(""),m()}})))),"below"===c&&la.React.createElement(Ko,$))});
22nl.propTypes={borderStyle:la.PropTypes.string,clearable:la.PropTypes.bool,clearableButtonAttributes:la.PropTypes.object,controlled:la.PropTypes.bool,customAttributes:la.PropTypes.object,customClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),disabled:la.PropTypes.bool,helpTextAttributes:la.PropTypes.object,helpTextPosition:la.PropTypes.string,iconAttributes:la.PropTypes.object,id:la.PropTypes.string,labelAttributes:la.PropTypes.object,name:la.PropTypes.string,onBlur:la.PropTypes.func,onChange:la.PropTypes.func,onClear:la.PropTypes.func,onKeyDown:la.PropTypes.func,onFocus:la.PropTypes.func,placeholder:la.PropTypes.string,required:la.PropTypes.bool,requiredLabel:la.PropTypes.object,size:la.PropTypes.string,spacing:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.number,la.PropTypes.array,la.PropTypes.object]),textSecurity:la.PropTypes.string,theme:la.PropTypes.string,type:la.PropTypes.string,value:la.PropTypes.string,wrapperAttributes:la.PropTypes.object,wrapperClasses:la.PropTypes.oneOfType([la.PropTypes.string,la.PropTypes.array,la.PropTypes.object]),wrapperTagName:la.PropTypes.string},nl.displayName="Input";const il=nl,{useEffect:al,useRef:sl,useState:ol}=wp.element,{__:ll}=wp.i18n,cl=({onSubmit:e,errorMessage:t,isLoading:r})=>{const[n,i]=ol(""),a=sl(null);al(()=>{t&&(i(""),setTimeout(()=>{a.current&&a.current.querySelector("input").focus()},100))},[t]);return React.createElement("div",{className:"cg-fillablepdfs-embed__document-password gform-admin"},React.createElement("form",{onSubmit:t=>{t.preventDefault(),n.trim()&&e&&e(n.trim())}},React.createElement(Wo,null,ll("This document is password protected.","forgravity_fillablepdfs")),React.createElement(il,{ref:a,type:"password",value:n,onChange:i,placeholder:ll("Enter Password","forgravity_fillablepdfs"),className:"cg-fillablepdfs-embed__password-protection-input",disabled:r,autoComplete:"off"}),React.createElement(_s,{type:"submit",width:"auto",disabled:!n.trim()||r},r?React.createElement(React.Fragment,null,React.createElement("span",{className:"gform-loader gform-loader--simple"}),ll("Verifyingâ¦","forgravity_fillablepdfs")):ll("Unlock PDF","forgravity_fillablepdfs"))),t&&React.createElement(Ws,{type:"error"},t))},ul=(e=20,t=21)=>React.createElement("svg",{fill:"none",height:t,viewBox:"0 0 20 21",width:e,xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{fill:"#fff"},React.createElement("path",{d:"m6.75 8.75c-.41421 0-.75.33579-.75.75s.33579.75.75.75h4.5c.4142 0 .75-.33579.75-.75s-.3358-.75-.75-.75z"}),React.createElement("path",{clipRule:"evenodd",d:"m9 2.5c-3.86599 0-7 3.13401-7 7 0 3.866 3.13401 7 7 7 1.6625 0 3.1906-.5803 4.3911-1.5483l3.3286 3.3286c.2929.2929.7677.2929 1.0606 0s.2929-.7677 0-1.0606l-3.3286-3.3286c.968-1.2005 1.5483-2.7286 1.5483-4.3911 0-3.86599-3.134-7-7-7zm-5.5 7c0-3.03757 2.46243-5.5 5.5-5.5 3.0376 0 5.5 2.46243 5.5 5.5 0 1.519-.6148 2.893-1.6109 3.8891s-2.3701 1.6109-3.8891 1.6109c-3.03757 0-5.5-2.4624-5.5-5.5z",fillRule:"evenodd"}))),dl=()=>React.createElement("svg",{fill:"none",height:"21",viewBox:"0 0 20 21",width:"20",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{fill:"#fff"},React.createElement("path",{d:"m9 6.5c.41421 0 .75.33579.75.75v1.5h1.5c.4142 0 .75.33579.75.75s-.3358.75-.75.75h-1.5v1.5c0 .4142-.33579.75-.75.75s-.75-.3358-.75-.75v-1.5h-1.5c-.41421 0-.75-.33579-.75-.75s.33579-.75.75-.75h1.5v-1.5c0-.41421.33579-.75.75-.75z"}),React.createElement("path",{clipRule:"evenodd",d:"m2 9.5c0-3.86599 3.13401-7 7-7 3.866 0 7 3.13401 7 7 0 1.6625-.5803 3.1906-1.5483 4.3911l3.3286 3.3286c.2929.2929.2929.7677 0 1.0606s-.7677.2929-1.0606 0l-3.3286-3.3286c-1.2005.968-2.7286 1.5483-4.3911 1.5483-3.86599 0-7-3.134-7-7zm7-5.5c-3.03757 0-5.5 2.46243-5.5 5.5 0 3.0376 2.46243 5.5 5.5 5.5 1.519 0 2.893-.6148 3.8891-1.6109s1.6109-2.3701 1.6109-3.8891c0-3.03757-2.4624-5.5-5.5-5.5z",fillRule:"evenodd"}))),hl=(e=15,t=15)=>React.createElement("svg",{fill:"none",height:t,viewBox:"0 0 15 15",width:e,xmlns:"http://www.w3.org/2000/svg"}
22,React.createElement("path",{clipRule:"evenodd",d:"m11.0303 9.21967c.2929.29289.2929.76777 0 1.06063l-2.99997 3c-.29289.2929-.76777.2929-1.06066 0l-3-3c-.29289-.29286-.29289-.76774 0-1.06063s.76777-.29289 1.06066 0l1.71967 1.71963v-8.6893c0-.41421.33579-.75.75-.75s.75.33579.75.75v8.6893l1.71967-1.71963c.29293-.29289.76773-.29289 1.06063 0z",fill:"#fff",fillRule:"evenodd"})),pl=(e=24,t=25)=>React.createElement("svg",{fill:"none",height:t,viewBox:"0 0 24 25",width:e,xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"m6.72012 14.3287c-.24068.0302-.48073.0624-.72012.0966m.72012-.0966c1.72945-.2169 3.49158-.3287 5.27988-.3287s3.5504.1118 5.2799.3287m-10.55978 0-.37921 4.1713m10.93899-4.1713c.2407.0302.4807.0624.7201.0966m-.7201-.0966.3792 4.1713m0 0 .2294 2.5231c.0599.6589-.4589 1.2269-1.1204 1.2269h-9.53619c-.66153 0-1.18027-.568-1.12038-1.2269l.22938-2.5231m11.31819 0h1.0909c1.2426 0 2.25-1.0074 2.25-2.25v-6.29431c0-1.08094-.7679-2.01487-1.8369-2.17483-.6338-.09482-1.2715-.17725-1.9131-.24705m-10.90909 10.96619h-1.09091c-1.24264 0-2.25-1.0074-2.25-2.25v-6.29431c0-1.08094.7679-2.01487 1.83694-2.17483.63372-.09482 1.27149-.17725 1.91306-.24705m10.5 0c-1.7242-.18756-3.4759-.28381-5.25-.28381s-3.52577.09625-5.25.28381m10.5 0v-3.65881c0-.62132-.5037-1.125-1.125-1.125h-8.25c-.62132 0-1.125.50368-1.125 1.125v3.65881m11.25 3.46619h.0075v.0075h-.0075zm-3 0h.0075v.0075h-.0075z",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})),{useEffect:fl,useRef:gl,useState:ml}=wp.element,{__:vl}=wp.i18n;function yl({currentPage:e,totalPages:t,goToPage:r,zoom:n,setZoom:i,containerWidth:a,defaultPdfWidth:s,canDownload:o=!0,downloadCallback:l,canPrint:c=!0,printCallback:u,setIsFitToScreen:d}){const[h,p]=ml(null),[f,g]=ml("actual_size"),m=gl(null),v=[50,75,100,125,200,300,400],y=[{label:"Actual Size",value:"actual_size",calculate:()=>100},{label:"Page Fit",value:"page_fit",calculate:()=>a&&s?Math.round(a/s*100):100},{label:"Page Width",value:"page_width",calculate:()=>a?Math.round(a/800*100):100}],b=e=>{i(t=>{const r=((e,t)=>{const r=e<=100?10:20;return"in"===t?Math.min(400,Math.ceil((e+r)/r)*r):Math.max(25,Math.floor((e-r)/r)*r)})(t,e);return v.includes(r)?p(null):p(r),r})},w=()=>h||(f&&y.some(e=>e.value===f)?f:n);fl(()=>{m.current&&(m.current.value=w())},[n,h]);return React.createElement("div",{className:"cg-fillablepdfs-embed__toolbar gform-admin"},React.createElement("div",{className:"cg-fillablepdfs-embed__toolbar-pages"},"Page",React.createElement("div",{className:"gform-input-wrapper gform-input-wrapper--theme-cosmos gform-input-wrapper--select gform-input-wrapper--size-r"},React.createElement("div",{className:"gform-select__wrapper"},React.createElement("select",{value:e,onChange:e=>r(e.target.value),className:"gform-select"},Array.from({length:t||1},(e,t)=>React.createElement("option",{key:t+1,value:t+1},t+1))))),"of ",t||"1"),React.createElement("div",{className:"cg-fillablepdfs-embed__toolbar-zoom"},React.createElement(_s,{onClick:()=>b("out"),disabled:25===n},React.createElement("span",{className:"screen-reader-text"},vl("Zoom Out","forgravity_fillablepdfs")),ul()),React.createElement("div",{className:"gform-input-wrapper gform-input-wrapper--theme-cosmos gform-input-wrapper--select gform-input-wrapper--size-r"},React.createElement("div",{className:"gform-select__wrapper"},React.createElement("select",{value:w(),onChange:e=>{const t=e.target.value;g(t);const r=y.find(e=>e.value===t);if(r)i(r.calculate()),d("page_fit"===t);else{const e=parseInt(t,10);isNaN(e)||(i(e),d(!1))}p(null)},className:"gform-select"},[...y.map(e=>React.createElement("option",{key:e.label,value:e.value},e.label)),...h?[React.createElement("option",{key:"custom",value:h,disabled:!0},h,"%")]:[],...v.map(e=>React.createElement("option",{key:e,value:e},e,"%"))]))),React.createElement(_s,{onClick:()=>b("in"),disabled:400===n},React.createElement("span",{className:"screen-reader-text"},vl("Zoom In","forgravity_fillablepdfs")),dl())),React.createElement("div",{className:"cg-fillablepdfs-embed__toolbar-actions"},o&&React.createElement(_s,{onClick:l},vl("Download","forgravity_fillablepdfs")," ",hl()),c&&React.createElement(_s,{onClick:u},vl("Print","forgravity_fillablepdfs")," ",pl())))}const{apiFetch:bl}=wp,{addQueryArgs:wl}=wp.url,xl=e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return new Blob([r],{type:"application/pdf"})},{useCallback:El,useEffect:Sl,useRef:Al,useState:_l}=wp.element,{__:Tl}=wp.i18n;
22function Cl({formId:e,feedId:t,id:r,height:n,canDownload:i,canPrint:s}){const o=!!e&&document.getElementById(`gform_${e}`),[l,c]=_l(null),[u,d]=_l("document.pdf"),[h,p]=_l(null),[f,g]=_l(null),[m,v]=_l(1),[y,b]=_l(!0),[w,x]=_l(600),[E,S]=_l(612),[A,_]=_l(()=>w/E*100),[T,C]=_l(!1),[P,R]=_l(null),[O,D]=_l(!1),[k,M]=_l(!1),[L,I]=_l(null),N=Al(null),j=Al([]),F=El(async()=>{try{const n=await(async({formId:e,feedId:t,id:r})=>{const n={path:"/cg/pdfs/embed"};if(r)n.path=wl(n.path,{id:r});else{const r=document.getElementById(`gform_${e}`);if(!r)return!1;const i=new FormData(r);i.append("form_id",e),i.append("feed_id",t),i.delete("gform_submit"),i.delete("gform_ajax"),n.method="POST",n.body=i}return await bl(n).catch(e=>({message:e.message||"There was an unknown error processing your request. Please try again."}))})({formId:e,feedId:t,id:r});if(!n.document)return void p(n.message||Tl("Unable to load PDF.","forgravity_fillablepdfs"));p(null),d(n.file_name||"document.pdf"),c(n.document)}catch(e){p(Tl("Unable to load PDF.","forgravity_fillablepdfs"))}},[e,t,r]);Sl(()=>{if(F(),r)return;if(!e||!o)return;const t=a()(()=>F(),500),n=r=>{r.target.closest('[data-ignore-change="true"]')||r.target.closest(`#gform_${e}`)&&t()};return o.addEventListener("input",n),o.addEventListener("change",n),()=>{o.removeEventListener("input",n),o.removeEventListener("change",n)}},[e,r,F]),Sl(()=>{if(!l)return;I(null),M(!0);(async()=>{try{const e=window.pdfjsLib,t=atob(l),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);const n=e.getDocument({data:r});await n.promise,M(!1)}catch(e){e.message&&e.message.includes("password")||"PasswordException"===e.name?(C(!0),p(null)):p(e.message),M(!1)}})()},[l]),Sl(()=>{N.current&&(N.current.closest(".gform-theme--no-framework")&&(()=>{if(!Array.from(document.styleSheets).some(e=>e.href===cg_fillablepdfs_embed.admin_components_url)){const e=document.createElement("link");e.rel="stylesheet",e.href=cg_fillablepdfs_embed.admin_components_url,e.type="text/css",document.head.appendChild(e)}})(),x(N.current.clientWidth))},[]),Sl(()=>{const e=()=>{if(!N.current)return;const e=N.current.clientWidth-40;x(e),y&&_(e/E*100)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[y,E]);const H=async e=>{D(!0),R(null);try{const t=await(async(e,t)=>{const r=window.pdfjsLib;try{const n=atob(e),i=new Uint8Array(n.length);for(let e=0;e<n.length;e++)i[e]=n.charCodeAt(e);const a=r.getDocument({data:i,password:t}),s=await a.promise,o=await s.getData();let l="";const c=8192;for(let e=0;e<o.length;e+=c){const t=o.subarray(e,e+c);l+=String.fromCharCode.apply(null,t)}return btoa(l)}catch(e){if(e.message&&e.message.includes("password")||"PasswordException"===e.name)throw new Error("Invalid password");throw e}})(l,e);c(t),I(e),C(!1),D(!1),R(null)}catch(e){e.message&&e.message.includes("password")||"PasswordException"===e.name||e.name&&e.name.includes("Password")?R(Tl("Incorrect password.","forgravity_fillablepdfs")):(console.error("PDF decryption error:",e),R(Tl("Unable to decrypt PDF. Please check the password and try again.","forgravity_fillablepdfs"))),D(!1)}},B=()=>f?Array.from({length:f},(e,t)=>React.createElement(To,{key:t,pageNumber:t+1,setCurrentPage:v,zoom:A,containerWidth:w,containerRef:N,defaultPdfWidth:E,ref:e=>{e&&(j.current||(j.current=[]),j.current[t]=e)}})):[];return React.createElement("div",{className:"cg-fillablepdfs-embed__container",ref:N},React.createElement(yl,{currentPage:m,totalPages:f,goToPage:e=>{e>=1&&e<=f&&j.current[e-1]&&j.current[e-1].scrollIntoView({behavior:"smooth",block:"start"})},zoom:A,setZoom:_,containerWidth:w,printCallback:e=>{if(e.preventDefault(),!l)return;const t=xl(l),r=URL.createObjectURL(t),n=window.open(r,"_blank");n&&(n.onload=()=>{n.print(),URL.revokeObjectURL(r)})},canPrint:s,canDownload:i,downloadCallback:e=>{if(e.preventDefault(),!l)return;const t=xl(l),r=URL.createObjectURL(t),n=document.createElement("a");n.href=r,n.download=u,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)},setIsFitToScreen:b,defaultPdfWidth:E}),React.createElement("div",{className:"cg-fillablepdfs-embed__document",style:{height:Number(n)}},h?React.createElement(Vs,{message:h}):!l||k?React.createElement(Ys,null):T&&!L?React.createElement(cl,{onSubmit:H,errorMessage:P,isLoading:O}):React.createElement(oa,{file:`data:application/pdf;base64,${l}`,onLoadSuccess:e=>{g(e.numPages),e.getPage(1).then(e=>{const t=e.view[2],r=N.current.clientWidth/t;S(t),_(100*r)})},onLoadError:e=>p(e.message),onPassword:e=>{e(L||new Error("Password required"))},loading:React.createElement(Ys,null)},B())))}const{createRoot:Pl,render:Rl}=wp.element,Ol=(e,t)=>
vendor: 6,590 bytes, lines 22-27
22{t&&(Pl?Pl(t).render(e):Rl(e,t))},Dl=window.pdfjsLib;Dl.GlobalWorkerOptions.workerSrc=`https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${Dl.version}/pdf.worker.mjs`,window.addEventListener("DOMContentLoaded",()=>{const e=document.querySelectorAll(".cg-fillablepdfs-embed");0!==e.length&&e.forEach(e=>{const t={id:e.dataset.id??!1,formId:e.dataset.formId??!1,feedId:e.dataset.feedId??!1,height:e.dataset.height??800,canDownload:"1"===e.dataset.canDownload??!1,canPrint:"1"===e.dataset.canPrint??!1,fieldId:e.parentNode.id};Ol(React.createElement(Cl,t),e)})})},8274(e,t){var r; 23/*! 24 Copyright (c) 2018 Jed Watson. 25 Licensed under the MIT License (MIT), see 26 http://jedwatson.github.io/classnames 27*/!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(r);else if(Array.isArray(r)){if(r.length){var s=i.apply(null,r);s&&e.push(s)}}else if("object"===a)if(r.toString===Object.prototype.toString)for(var o in r)n.call(r,o)&&r[o]&&e.push(o);else e.push(r.toString())}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(r=function(){return i}.apply(t,[]))||(e.exports=r)}()},9469(e,t,r){"use strict";var n=r(5206);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},4610(e){var t=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=t},1508(e){function t(e){var r,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(r=0;r<a;r++)e[r]&&(n=t(e[r]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function r(){for(var e,r,n=0,i="",a=arguments.length;n<a;n++)(e=arguments[n])&&(r=t(e))&&(i&&(i+=" "),i+=r);return i}e.exports=r,e.exports.clsx=r},1261(e,t,r){"use strict";function n(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map(function(e){return"'"+e+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function i(e){return!!e&&!!e[V]}function a(e){return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===q}(e)||Array.isArray(e)||!!e[W]||!!e.constructor[W]||h(e)||p(e))}function s(e,t,r){void 0===r&&(r=!1),0===o(e)?(r?Object.keys:Y)(e).forEach(function(n){r&&"symbol"==typeof n||t(n,e[n],e)}):e.forEach(function(r,n){return t(n,r,e)})}function o(e){var t=e[V];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:h(e)?2:p(e)?3:0}function l(e,t){return 2===o(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){return 2===o(e)?e.get(t):e[t]}function u(e,t,r){var n=o(e);2===n?e.set(t,r):3===n?(e.delete(t),e.add(r)):e[t]=r}function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function h(e){return B&&e instanceof Map}function p(e){return z&&e instanceof Set}function f(e){return e.o||e.t}function g(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=G(e);delete t[V];for(var r=Y(t),n=0;n<r.length;n++){var i=r[n],a=t[i];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function m(e,t){return void 0===t&&(t=!1),y(e)||i(e)||!a(e)||(o(e)>1&&(e.set=e.add=e.clear=e.delete=v),Object.freeze(e),t&&s(e,function(e,t){return m(t,!0)},!0)),e}function v(){n(2)}function y(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function b(e){var t=X[e];return t||n(18,e),t}function w(){return F}function x(e,t){t&&(b("Patches"),e.u=[],e.s=[],e.v=t)}function E(e){S(e),e.p.forEach(_),e.p=null}function S(e){e===F&&(F=e.l)}function A(e){return F={p:[],l:F,h:e,m:!0,_:0}}function _(e){var t=e[V];0===t.i||1===t.i?t.j():t.O=!0}function T(e,t){t._=t.p.length;var r=t.p[0],i=void 0!==e&&e!==r;return t.h.g||b("ES5").S(t,e,i),i?(r[V].P&&(E(t),n(4)),a(e)&&(e=C(t,e),t.l||R(t,e)),t.u&&b("Patches").M(r[V].t,e,t.u,t.s)):e=C(t,r,[]),E(t),t.u&&t.v(t.u,t.s),e!==U?e:void 0}function C(e,t,r){if(y(t))return t;var n=t[V];if(!n)return s(t,function(i,a){return P(e,n,t,i,a,r)},!0),t;if(n.A!==e)return t;if(!n.P)return R(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=4===n.i||5===n.i?n.o=g(n.k):n.o;s(3===n.i?new Set(i):i,function(t,a){return P(e,n,i,t,a,r)}),R(e,i,!1),r&&e.u&&b("Patches").R(n,r,e.u,e.s)}return n.o}function P(e,t,r,n,s,o){if(i(s)){var c=C(e,s,o&&t&&3!==t.i&&!l(t.D,n)?o.concat(n):void 0);if(u(r,n,c),!i(c))return;e.m=!1}if(a(s)&&!y(s)){if(!e.h.F&&e._<1)return;C(e,s),t&&t.A.l||R(e,s)}}function R(e,t,r){void 0===r&&(r=!1),e.h.F&&e.m&&m(t,r)}function O(e,t){var r=e[V];return(r?f(r):e)[t]}function D(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function k(e){e.P||(e.P=!0,e.l&&k(e.l))}function M(e){e.o||(e.o=g(e.t))}function L(e,t,r){var n=h(t)?b("MapSet").N(t,r):p(t)?b("MapSet").T(t,r):e.g?function(e,t){var r=Array.isArray(e),n={i:r?1:0,A:t?t.A:w(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=n,a=K;r&&(i=[n],a=J);var s=Proxy.revocable(i,a),o=s.revoke,l=s.proxy;return n.k=l,n.j=o,l}(t,r):b("ES5").J(t,r);return(r?r.A:w()).p.push(n),n}function I(e){return i(e)||n(22,e),function e(t){if(!a(t))return t;var r,n=t[V],i=o(t);if(n){if(!n.P&&(n.i<4||!b("ES5").K(n)))return n.t;n.I=!0,r=N(t,i),n.I=!1}else r=N(t,i);return s(r,function(t,i){n&&c(n.t,t)===i||u(r,t,e(i))}),3===i?new Set(r):r}(e)}function N(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return g(e)}r.d(t,{produce:()=>ee});var j,F,H="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),B="undefined"!=typeof Map,z="undefined"!=typeof Set,$="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,U=H?Symbol.for("immer-nothing"):((j={})["immer-nothing"]=!0,j),W=H?Symbol.for("immer-draftable"):"__$immer_draftable",V=H?Symbol.for("immer-state"):"__$immer_state",q=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),Y="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,G=Object.getOwnPropertyDescriptors||function(e){var t={};return Y(e).forEach(function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)}),t},X={},K={get:function(e,t){if(t===V)return e;var r=f(e);
27if(!l(r,t))return function(e,t,r){var n,i=D(t,r);return i?"value"in i?i.value:null===(n=i.get)||void 0===n?void 0:n.call(e.k):void 0}(e,r,t);var n=r[t];return e.I||!a(n)?n:n===O(e.t,t)?(M(e),e.o[t]=L(e.A.h,n,e)):n},has:function(e,t){return t in f(e)},ownKeys:function(e){return Reflect.ownKeys(f(e))},set:function(e,t,r){var n=D(f(e),t);if(null==n?void 0:n.set)return n.set.call(e.k,r),!0;if(!e.P){var i=O(f(e),t),a=null==i?void 0:i[V];if(a&&a.t===r)return e.o[t]=r,e.D[t]=!1,!0;if(d(r,i)&&(void 0!==r||l(e.t,t)))return!0;M(e),k(e)}return e.o[t]===r&&"number"!=typeof r&&(void 0!==r||t in e.o)||(e.o[t]=r,e.D[t]=!0,!0)},deleteProperty:function(e,t){return void 0!==O(e.t,t)||t in e.t?(e.D[t]=!1,M(e),k(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=f(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty:function(){n(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){n(12)}},J={};s(K,function(e,t){J[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),J.deleteProperty=function(e,t){return J.set.call(this,e,t,void 0)},J.set=function(e,t,r){return K.set.call(this,e[0],t,r,e[0])};var Q=function(){function e(e){var t=this;this.g=$,this.F=!0,this.produce=function(e,r,i){if("function"==typeof e&&"function"!=typeof r){var s=r;r=e;var o=t;return function(e){var t=this;void 0===e&&(e=s);for(var n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return o.produce(e,function(e){var n;return(n=r).call.apply(n,[t,e].concat(i))})}}var l;if("function"!=typeof r&&n(6),void 0!==i&&"function"!=typeof i&&n(7),a(e)){var c=A(t),u=L(t,e,void 0),d=!0;try{l=r(u),d=!1}finally{d?E(c):S(c)}return"undefined"!=typeof Promise&&l instanceof Promise?l.then(function(e){return x(c,i),T(e,c)},function(e){throw E(c),e}):(x(c,i),T(l,c))}if(!e||"object"!=typeof e){if(void 0===(l=r(e))&&(l=e),l===U&&(l=void 0),t.F&&m(l,!0),i){var h=[],p=[];b("Patches").M(e,l,h,p),i(h,p)}return l}n(21,e)},this.produceWithPatches=function(e,r){if("function"==typeof e)return function(r){for(var n=arguments.length,i=Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return t.produceWithPatches(r,function(t){return e.apply(void 0,[t].concat(i))})};var n,i,a=t.produce(e,r,function(e,t){n=e,i=t});return"undefined"!=typeof Promise&&a instanceof Promise?a.then(function(e){return[e,n,i]}):[a,n,i]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){a(e)||n(8),i(e)&&(e=I(e));var t=A(this),r=L(this,e,void 0);return r[V].C=!0,S(t),r},t.finishDraft=function(e,t){var r=(e&&e[V]).A;return x(r,t),T(void 0,r)},t.setAutoFreeze=function(e){this.F=e},t.setUseProxies=function(e){e&&!$&&n(20),this.g=e},t.applyPatches=function(e,t){var r;for(r=t.length-1;r>=0;r--){var n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));var a=b("Patches").$;return i(e)?a(e,t):this.produce(e,function(e){return a(e,t)})},e}(),Z=new Q,ee=Z.produce;Z.produceWithPatches.bind(Z),Z.setAutoFreeze.bind(Z),Z.setUseProxies.bind(Z),Z.applyPatches.bind(Z),Z.createDraft.bind(Z),Z.finishDraft.bind(Z)},7654(e,t,r){var n="__lodash_hash_undefined__",i="[object Function]",a="[object GeneratorFunction]",s=/^\[object .+?Constructor\]$/,o="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,l="object"==typeof self&&self&&self.Object===Object&&self,c=o||l||Function("return this")();var u,d=Array.prototype,h=Function.prototype,p=Object.prototype,f=c["__core-js_shared__"],g=(u=/[^.]+$/.exec(f&&f.keys&&f.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",m=h.toString,v=p.hasOwnProperty,y=p.toString,b=RegExp("^"+m.call(v).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),w=d.splice,x=R(c,"Map"),E=R(Object,"create");function S(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function A(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function _(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function T(e,t){for(var r=e.length;r--;)if(D(e[r][0],t))return r;return-1}function C(e){if(!k(e)||(t=e,g&&g in t))return!1;var t,r=function(e){var t=k(e)?y.call(e):"";return t==i||t==a}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?b:s;return r.test(function(e){if(null!=e){try{return m.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function P(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function R(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return C(r)?r:void 0}function O(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=e.apply(this,n);return r.cache=a.set(i,s),s};return r.cache=new(O.Cache||_),r}function D(e,t){return e===t||e!=e&&t!=t}function k(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}S.prototype.clear=function(){this.__data__=E?E(null):{}},S.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},S.prototype.get=function(e){var t=this.__data__;if(E){var r=t[e];return r===n?void 0:r}return v.call(t,e)?t[e]:void 0},S.prototype.has=function(e){var t=this.__data__;return E?void 0!==t[e]:v.call(t,e)},S.prototype.set=function(e,t){return this.__data__[e]=E&&void 0===t?n:t,this},A.prototype.clear=function(){this.__data__=[]},A.prototype.delete=function(e){var t=this.__data__,r=T(t,e);return!(r<0)&&(r==t.length-1?t.pop():w.call(t,r,1),!0)},A.prototype.get=function(e){var t=this.__data__,r=T(t,e);return r<0?void 0:t[r][1]},A.prototype.has=function(e){return T(this.__data__,e)>-1},A.prototype.set=function(e,t){var r=this.__data__,n=T(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},_.prototype.clear=function(){this.__data__={hash:new S,map:new(x||A),string:new S}},_.prototype.delete=function(e){return P(this,e).delete(e)},_.prototype.get=function(e){return P(this,e).get(e)},_.prototype.has=function(e){return P(this,e).has(e)},_.prototype.set=function(e,t){return P(this,e).set(e,t),this},O.Cache=_,e.exports=O},1873(e,t,r){var n=r(9325).Symbol;e.exports=n},2552(e,t,r){var n=r(1873),i=r(659),a=r(9350),s=n?n.toStringTag:void 0;
27e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):a(e)}},4128(e,t,r){var n=r(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},4840(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},659(e,t,r){var n=r(1873),i=Object.prototype,a=i.hasOwnProperty,s=i.toString,o=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,o),r=e[o];try{e[o]=void 0;var n=!0}catch(e){}var i=s.call(e);return n&&(t?e[o]=r:delete e[o]),i}},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9325(e,t,r){var n=r(4840),i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")();e.exports=a},1800(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},8221(e,t,r){var n=r(3805),i=r(124),a=r(9374),s=Math.max,o=Math.min;e.exports=function(e,t,r){var l,c,u,d,h,p,f=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var r=l,n=c;return l=c=void 0,f=t,d=e.apply(n,r)}function b(e){var r=e-p;return void 0===p||r>=t||r<0||m&&e-f>=u}function w(){var e=i();if(b(e))return x(e);h=setTimeout(w,function(e){var r=t-(e-p);return m?o(r,u-(e-f)):r}(e))}function x(e){return h=void 0,v&&l?y(e):(l=c=void 0,d)}function E(){var e=i(),r=b(e);if(l=arguments,c=this,p=e,r){if(void 0===h)return function(e){return f=e,h=setTimeout(w,t),g?y(e):d}(p);if(m)return clearTimeout(h),h=setTimeout(w,t),y(p)}return void 0===h&&(h=setTimeout(w,t)),d}return t=a(t)||0,n(r)&&(g=!!r.leading,u=(m="maxWait"in r)?s(a(r.maxWait)||0,t):u,v="trailing"in r?!!r.trailing:v),E.cancel=function(){void 0!==h&&clearTimeout(h),f=0,l=p=c=h=void 0},E.flush=function(){return void 0===h?d:x(i())},E}},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},4394(e,t,r){var n=r(2552),i=r(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},124(e,t,r){var n=r(9325);e.exports=function(){return n.Date.now()}},9374(e,t,r){var n=r(4128),i=r(3805),a=r(4394),s=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=o.test(e);return r||l.test(e)?c(e.slice(2),r?2:8):s.test(e)?NaN:+e}},2201(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,a){function s(e){try{l(n.next(e))}catch(e){a(e)}}function o(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(s,o)}l((n=n.apply(e,t||[])).next())})},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=i(r(714));function s(e,t="maxAge"){let r,i,s;const o=()=>n(this,void 0,void 0,function*(){if(void 0!==r)return;const o=o=>n(this,void 0,void 0,function*(){s=a.default();const n=o[1][t]-Date.now();return n<=0?(e.delete(o[0]),void s.resolve()):(r=o[0],i=setTimeout(()=>{e.delete(o[0]),s&&s.resolve()},n),"function"==typeof i.unref&&i.unref(),s.promise)});try{for(const t of e)yield o(t)}catch(e){}r=void 0}),l=e.set.bind(e);return e.set=(t,n)=>{e.has(t)&&e.delete(t);const a=l(t,n);return r&&r===t&&(r=void 0,void 0!==i&&(clearTimeout(i),i=void 0),void 0!==s&&(s.reject(void 0),s=void 0)),o(),a},o(),e}t.default=s,e.exports=s,e.exports.default=s},119(e,t,r){"use strict";const n=r(2986),i=r(2201),a=new WeakMap,s=new WeakMap,o=(e,{cacheKey:t,cache:r=new Map,maxAge:a}={})=>{"number"==typeof a&&i(r);const o=function(...n){const i=t?t(n):n[0],s=r.get(i);if(s)return s.data;const o=e.apply(this,n);return r.set(i,{data:o,maxAge:a?Date.now()+a:Number.POSITIVE_INFINITY}),o};return n(o,e,{ignoreNonConfigurable:!0}),s.set(o,r),o};o.decorator=(e={})=>(t,r,n)=>{const i=t[r];if("function"!=typeof i)throw new TypeError("The decorated value must be a function");delete n.value,delete n.writable,n.get=function(){if(!a.has(this)){const t=o(i,e);return a.set(this,t),t}return a.get(this)}},o.clear=e=>{const t=s.get(e);if(!t)throw new TypeError("Can't clear a function that was not memoized!");if("function"!=typeof t.clear)throw new TypeError("The cache Map can't be cleared!");t.clear()},e.exports=o},2986(e){"use strict";const t=(e,t,n,i)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const a=Object.getOwnPropertyDescriptor(e,n),s=Object.getOwnPropertyDescriptor(t,n);!r(a,s)&&i||Object.defineProperty(e,n,s)},r=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},n=(e,t)=>`/* Wrapped ${e}*/\n${t}`,i=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),a=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");e.exports=(e,r,{ignoreNonConfigurable:s=!1}={})=>{const{name:o}=e;for(const n of Reflect.ownKeys(r))t(e,r,n,s);return((e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)})(e,r),((e,t,r)=>{const s=""===r?"":`with ${r.trim()}() `,o=n.bind(null,s,t.toString());Object.defineProperty(o,"name",a),Object.defineProperty(e,"toString",{...i,value:o})})(e,r,o),e}},714(e){"use strict";e.exports=()=>{const e={};return e.promise=new Promise((t,r)=>{e.resolve=t,e.reject=r}),e}},2694(e,t,r){"use strict";var n=r(6925);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,a,s){if
27(s!==n){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return r.PropTypes=r,r}},5556(e,t,r){e.exports=r(2694)()},6925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4798(e,t,r){var n=r(1594);var i=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(n);function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function s(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(i[r]=e[r]);return i}function o(e){var t=n.useRef(e),r=n.useRef(function(e){t.current&&t.current(e)});return t.current=e,r.current}var l=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e<t?t:e},c=function(e){return"touches"in e},u=function(e){return e&&e.ownerDocument.defaultView||self},d=function(e,t,r){var n=e.getBoundingClientRect(),i=c(t)?function(e,t){for(var r=0;r<e.length;r++)if(e[r].identifier===t)return e[r];return e[0]}(t.touches,r):t;return{left:l((i.pageX-(n.left+u(e).pageXOffset))/n.width),top:l((i.pageY-(n.top+u(e).pageYOffset))/n.height)}},h=function(e){!c(e)&&e.preventDefault()},p=i.default.memo(function(e){var t=e.onMove,r=e.onKey,l=s(e,["onMove","onKey"]),p=n.useRef(null),f=o(t),g=o(r),m=n.useRef(null),v=n.useRef(!1),y=n.useMemo(function(){var e=function(e){h(e),(c(e)?e.touches.length>0:e.buttons>0)&&p.current?f(d(p.current,e,m.current)):r(!1)},t=function(){return r(!1)};function r(r){var n=v.current,i=u(p.current),a=r?i.addEventListener:i.removeEventListener;a(n?"touchmove":"mousemove",e),a(n?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,n=p.current;if(n&&(h(t),!function(e,t){return t&&!c(e)}(t,v.current)&&n)){if(c(t)){v.current=!0;var i=t.changedTouches||[];i.length&&(m.current=i[0].identifier)}n.focus(),f(d(n,t,m.current)),r(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),g({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},r]},[g,f]),b=y[0],w=y[1],x=y[2];return n.useEffect(function(){return x},[x]),i.default.createElement("div",a({},l,{onTouchStart:b,onMouseDown:b,className:"react-colorful__interactive",ref:p,onKeyDown:w,tabIndex:0,role:"slider"}))}),f=function(e){return e.filter(Boolean).join(" ")},g=function(e){var t=e.color,r=e.left,n=e.top,a=void 0===n?.5:n,s=f(["react-colorful__pointer",e.className]);return i.default.createElement("div",{className:s,style:{top:100*a+"%",left:100*r+"%"}},i.default.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},m=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r},v={grad:.9,turn:360,rad:360/(2*Math.PI)},y=function(e){return I(b(e))},b=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:4===e.length?m(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:8===e.length?m(parseInt(e.substring(6,8),16)/255,2):1}},w=function(e,t){return void 0===t&&(t="deg"),Number(e)*(v[t]||1)},x=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?S({h:w(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},E=x,S=function(e){var t=e.s,r=e.l;return{h:e.h,s:(t*=(r<50?r:100-r)/100)>0?2*t/(r+t)*100:0,v:r+t,a:e.a}},A=function(e){return L(P(e))},_=function(e){var t=e.s,r=e.v,n=e.a,i=(200-t)*r/100;return{h:m(e.h),s:m(i>0&&i<200?t*r/100/(i<=100?i:200-i)*100:0),l:m(i/2),a:m(n,2)}},T=function(e){var t=_(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},C=function(e){var t=_(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},P=function(e){var t=e.h,r=e.s,n=e.v,i=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),s=n*(1-r),o=n*(1-(t-a)*r),l=n*(1-(1-t+a)*r),c=a%6;return{r:m(255*[n,o,s,s,l,n][c]),g:m(255*[l,n,n,o,s,s][c]),b:m(255*[s,s,l,n,n,o][c]),a:m(i,2)}},R=function(e){var t=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?N({h:w(t[1],t[2]),s:Number(t[3]),v:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},O=R,D=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?I({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:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},k=D,M=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},L=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=i<1?M(m(255*i)):"";return"#"+M(t)+M(r)+M(n)+a},I=function(e){var t=e.r,r=e.g,n=e.b,i=e.a,a=Math.max(t,r,n),s=a-Math.min(t,r,n),o=s?a===t?(r-n)/s:a===r?2+(n-t)/s:4+(t-r)/s:0;return{h:m(60*(o<0?o+6:o)),s:m(a?s/a*100:0),v:m(a/255*100),a:i}},N=function(e){return{h:m(e.h),s:m(e.s),v:m(e.v),a:m(e.a,2)}},j=i.default.memo(function(e){var t=e.hue,r=e.onChange,n=f(["react-colorful__hue",e.className]);return i.default.createElement("div",{className:n},i.default.createElement(p,{onMove:function(e){r({h:360*e.left})},onKey:function(e){r({h:l(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":m(t),"aria-valuemax":"360","aria-valuemin":"
270"},i.default.createElement(g,{className:"react-colorful__hue-pointer",left:t/360,color:T({h:t,s:100,v:100,a:1})})))}),F=i.default.memo(function(e){var t=e.hsva,r=e.onChange,n={backgroundColor:T({h:t.h,s:100,v:100,a:1})};return i.default.createElement("div",{className:"react-colorful__saturation",style:n},i.default.createElement(p,{onMove:function(e){r({s:100*e.left,v:100-100*e.top})},onKey:function(e){r({s:l(t.s+100*e.left,0,100),v:l(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+m(t.s)+"%, Brightness "+m(t.v)+"%"},i.default.createElement(g,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:T(t)})))}),H=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},B=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")},z=function(e,t){return e.toLowerCase()===t.toLowerCase()||H(b(e),b(t))};function $(e,t,r){var i=o(r),a=n.useState(function(){return e.toHsva(t)}),s=a[0],l=a[1],c=n.useRef({color:t,hsva:s});n.useEffect(function(){if(!e.equal(t,c.current.color)){var r=e.toHsva(t);c.current={hsva:r,color:t},l(r)}},[t,e]),n.useEffect(function(){var t;H(s,c.current.hsva)||e.equal(t=e.fromHsva(s),c.current.color)||(c.current={hsva:s,color:t},i(t))},[s,e,i]);var u=n.useCallback(function(e){l(function(t){return Object.assign({},t,e)})},[]);return[s,u]}var U,W="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,V=new Map,q=function(e){W(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!V.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,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',V.set(t,n);var i=U||r.nc;i&&n.setAttribute("nonce",i),t.head.appendChild(n)}},[])},Y=function(e){var t=e.className,r=e.colorModel,o=e.color,l=void 0===o?r.defaultColor:o,c=e.onChange,u=s(e,["className","colorModel","color","onChange"]),d=n.useRef(null);q(d);var h=$(r,l,c),p=h[0],g=h[1],m=f(["react-colorful",t]);return i.default.createElement("div",a({},u,{ref:d,className:m}),i.default.createElement(F,{hsva:p,onChange:g}),i.default.createElement(j,{hue:p.h,onChange:g,className:"react-colorful__last-control"}))},G={defaultColor:"000",toHsva:y,fromHsva:function(e){return A({h:e.h,s:e.s,v:e.v,a:1})},equal:z},X=function(e){var t=e.className,r=e.hsva,n=e.onChange,a={backgroundImage:"linear-gradient(90deg, "+C(Object.assign({},r,{a:0}))+", "+C(Object.assign({},r,{a:1}))+")"},s=f(["react-colorful__alpha",t]),o=m(100*r.a);return i.default.createElement("div",{className:s},i.default.createElement("div",{className:"react-colorful__alpha-gradient",style:a}),i.default.createElement(p,{onMove:function(e){n({a:e.left})},onKey:function(e){n({a:l(r.a+e.left)})},"aria-label":"Alpha","aria-valuetext":o+"%","aria-valuenow":o,"aria-valuemin":"
270","aria-valuemax":"100"},i.default.createElement(g,{className:"react-colorful__alpha-pointer",left:r.a,color:C(r)})))},K=function(e){var t=e.className,r=e.colorModel,o=e.color,l=void 0===o?r.defaultColor:o,c=e.onChange,u=s(e,["className","colorModel","color","onChange"]),d=n.useRef(null);q(d);var h=$(r,l,c),p=h[0],g=h[1],m=f(["react-colorful",t]);return i.default.createElement("div",a({},u,{ref:d,className:m}),i.default.createElement(F,{hsva:p,onChange:g}),i.default.createElement(j,{hue:p.h,onChange:g}),i.default.createElement(X,{hsva:p,onChange:g,className:"react-colorful__last-control"}))},J={defaultColor:"0001",toHsva:y,fromHsva:A,equal:z},Q={defaultColor:{h:0,s:0,l:0,a:1},toHsva:S,fromHsva:_,equal:H},Z={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:x,fromHsva:C,equal:B},ee={defaultColor:{h:0,s:0,l:0},toHsva:function(e){return S({h:e.h,s:e.s,l:e.l,a:1})},fromHsva:function(e){return{h:(t=_(e)).h,s:t.s,l:t.l};var t},equal:H},te={defaultColor:"hsl(0, 0%, 0%)",toHsva:E,fromHsva:T,equal:B},re={defaultColor:{h:0,s:0,v:0,a:1},toHsva:function(e){return e},fromHsva:N,equal:H},ne={defaultColor:"hsva(0, 0%, 0%, 1)",toHsva:R,fromHsva:function(e){var t=N(e);return"hsva("+t.h+", "+t.s+"%, "+t.v+"%, "+t.a+")"},equal:B},ie={defaultColor:{h:0,s:0,v:0},toHsva:function(e){return{h:e.h,s:e.s,v:e.v,a:1}},fromHsva:function(e){var t=N(e);return{h:t.h,s:t.s,v:t.v}},equal:H},ae={defaultColor:"hsv(0, 0%, 0%)",toHsva:O,fromHsva:function(e){var t=N(e);return"hsv("+t.h+", "+t.s+"%, "+t.v+"%)"},equal:B},se={defaultColor:{r:0,g:0,b:0,a:1},toHsva:I,fromHsva:P,equal:H},oe={defaultColor:"rgba(0, 0, 0, 1)",toHsva:D,fromHsva:function(e){var t=P(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:B},le={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return I({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(t=P(e)).r,g:t.g,b:t.b};var t},equal:H},ce={defaultColor:"rgb(0, 0, 0)",toHsva:k,fromHsva:function(e){var t=P(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:B},ue=/^#?([0-9A-F]{3,8})$/i,de=function(e){var t=e.color,r=void 0===t?"":t,l=e.onChange,c=e.onBlur,u=e.escape,d=e.validate,h=e.format,p=e.process,f=s(e,["color","onChange","onBlur","escape","validate","format","process"]),g=n.useState(function(){return u(r)}),m=g[0],v=g[1],y=o(l),b=o(c),w=n.useCallback(function(e){var t=u(e.target.value);v(t),d(t)&&y(p?p(t):t)},[u,p,d,y]),x=n.useCallback(function(e){d(e.target.value)||v(u(r)),b(e)},[r,u,d,b]);return n.useEffect(function(){v(u(r))},[r,u]),i.default.createElement("input",a({},f,{value:h?h(m):m,spellCheck:"false",onChange:w,onBlur:x}))},he=function(e){return"#"+e};t.HexColorInput=function(e){var t=e.prefixed,r=e.alpha,o=s(e,["prefixed","alpha"]),l=n.useCallback(function(e){return e.replace(/([^0-9A-F]+)/gi,"").substring(0,r?8:6)},[r]),c=n.useCallback(function(e){return function(e,t){var r=ue.exec(e),n=r?r[1].length:0;return 3===n||6===n||!!t&&4===n||!!t&&8===n}(e,r)},[r]);return i.default.createElement(de,a({},o,{escape:l,format:t?he:void 0,process:he,validate:c}))},t.HexColorPicker=function(e){return i.default.createElement(Y,a({},e,{colorModel:G}))}},6622(e,t,r){"use strict";
27var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=a(r(5556)),o=a(r(1594)),l=function(e){function t(r){var n=e.call(this,r)||this;return n.resetDragging=function(){n.frameDragCounter=0,n.setState({draggingOverFrame:!1,draggingOverTarget:!1})},n.handleWindowDragOverOrDrop=function(e){e.preventDefault()},n.handleFrameDrag=function(e){if(t.eventHasFiles(e))return n.frameDragCounter+="dragenter"===e.type?1:-1,1===n.frameDragCounter?(n.setState({draggingOverFrame:!0}),void(n.props.onFrameDragEnter&&n.props.onFrameDragEnter(e))):0===n.frameDragCounter?(n.setState({draggingOverFrame:!1}),void(n.props.onFrameDragLeave&&n.props.onFrameDragLeave(e))):void 0},n.handleFrameDrop=function(e){n.state.draggingOverTarget||(n.resetDragging(),n.props.onFrameDrop&&n.props.onFrameDrop(e))},n.handleDragOver=function(e){t.eventHasFiles(e)&&(n.setState({draggingOverTarget:!0}),!t.isIE()&&n.props.dropEffect&&(e.dataTransfer.dropEffect=n.props.dropEffect),n.props.onDragOver&&n.props.onDragOver(e))},n.handleDragLeave=function(e){n.setState({draggingOverTarget:!1}),n.props.onDragLeave&&n.props.onDragLeave(e)},n.handleDrop=function(e){if(n.props.onDrop&&t.eventHasFiles(e)){var r=e.dataTransfer?e.dataTransfer.files:null;n.props.onDrop(r,e)}n.resetDragging()},n.handleTargetClick=function(e){n.props.onTargetClick&&n.props.onTargetClick(e),n.resetDragging()},n.stopFrameListeners=function(e){e&&(e.removeEventListener("dragenter",n.handleFrameDrag),e.removeEventListener("dragleave",n.handleFrameDrag),e.removeEventListener("drop",n.handleFrameDrop))},n.startFrameListeners=function(e){e&&(e.addEventListener("dragenter",n.handleFrameDrag),e.addEventListener("dragleave",n.handleFrameDrag),e.addEventListener("drop",n.handleFrameDrop))},n.frameDragCounter=0,n.state={draggingOverFrame:!1,draggingOverTarget:!1},n}return i(t,e),t.prototype.componentDidMount=function(){this.startFrameListeners(this.props.frame),this.resetDragging(),window.addEventListener("dragover",this.handleWindowDragOverOrDrop),window.addEventListener("drop",this.handleWindowDragOverOrDrop)},t.prototype.componentDidUpdate=function(e){e.frame!==this.props.frame&&(this.resetDragging(),this.stopFrameListeners(e.frame),this.startFrameListeners(this.props.frame))},t.prototype.componentWillUnmount=function(){this.stopFrameListeners(this.props.frame),window.removeEventListener("dragover",this.handleWindowDragOverOrDrop),window.removeEventListener("drop",this.handleWindowDragOverOrDrop)},t.prototype.render=function(){var e=this.props,t=e.children,r=e.className,n=e.targetClassName,i=e.draggingOverFrameClassName,a=e.draggingOverTargetClassName,s=this.state,l=s.draggingOverTarget,c=n;return s.draggingOverFrame&&(c+=" "+i),l&&(c+=" "+a),o.default.createElement("div",{className:r,onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},o.default.createElement("div",{className:c,onClick:this.handleTargetClick},t))},t.isIE=function(){return"undefined"!=typeof window&&(-1!==window.navigator.userAgent.indexOf("MSIE")||window.navigator.appVersion.indexOf("Trident/")>0)},t.eventHasFiles=function(e){var t=!1;if(e.dataTransfer){var r=e.dataTransfer.types;for(var n in r)if("Files"===r[n]){t=!0;break}}return t},t.propTypes={className:s.default.string,targetClassName:s.default.string,draggingOverFrameClassName:s.default.string,draggingOverTargetClassName:s.default.string,onDragOver:s.default.func,onDragLeave:s.default.func,onDrop:s.default.func,onTargetClick:s.default.func,dropEffect:s.default.oneOf(["copy","move","link","none"]),frame:function(e,t,r){var n=e[t];return null==n?new Error("Warning: Required prop `"+t+"` was not specified in `"+r+"`"):n===document||n instanceof HTMLElement?void 0:new Error("Warning: Prop `"+t+"` must be one of the following: document, HTMLElement!")},onFrameDragEnter:s.default.func,onFrameDragLeave:s.default.func,onFrameDrop:s.default.func},t.defaultProps={dropEffect:"copy",frame:"undefined"==typeof window?void 0:window.document,className:"file-drop",targetClassName:"file-drop-target",draggingOverFrameClassName:"file-drop-dragging-over-frame",draggingOverTargetClassName:"file-drop-dragging-over-target"},t}(o.default.PureComponent);t.FileDrop=l},9764(e,t,r){var n;n=e=>(()=>{var t={703:(e,t,r)=>{"use strict";var n=r(414);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,a,s){if
27(s!==n){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return r.PropTypes=r,r}},697:(e,t,r)=>{e.exports=r(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},98:t=>{"use strict";t.exports=e}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{default:()=>w});var e=n(98),t=n.n(e),r=n(697),a=n.n(r);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}var o=function(e){var r=e.pageClassName,n=e.pageLinkClassName,i=e.page,a=e.selected,o=e.activeClassName,l=e.activeLinkClassName,c=e.getEventListener,u=e.pageSelectedHandler,d=e.href,h=e.extraAriaContext,p=e.pageLabelBuilder,f=e.rel,g=e.ariaLabel||"Page "+i+(h?" "+h:""),m=null;return a&&(m="page",g=e.ariaLabel||"Page "+i+" is your current page",r=void 0!==r?r+" "+o:o,void 0!==n?void 0!==l&&(n=n+" "+l):n=l),t().createElement("li",{className:r},t().createElement("a",s({rel:f,role:d?void 0:"button",className:n,href:d,tabIndex:a?"-1":"0","aria-label":g,"aria-current":m,onKeyPress:u},c(u)),p(i)))};o.propTypes={pageSelectedHandler:a().func.isRequired,selected:a().bool.isRequired,pageClassName:a().string,pageLinkClassName:a().string,activeClassName:a().string,activeLinkClassName:a().string,extraAriaContext:a().string,href:a().string,ariaLabel:a().string,page:a().number.isRequired,getEventListener:a().func.isRequired,pageLabelBuilder:a().func.isRequired,rel:a().string};const l=o;function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c.apply(this,arguments)}var u=function(e){var r=e.breakLabel,n=e.breakAriaLabel,i=e.breakClassName,a=e.breakLinkClassName,s=e.breakHandler,o=e.getEventListener,l=i||"break";return t().createElement("li",{className:l},t().createElement("a",c({className:a,role:"button",tabIndex:"0","aria-label":n,onKeyPress:s},o(s)),r))};u.propTypes={breakLabel:a().oneOfType([a().string,a().node]),breakAriaLabel:a().string,breakClassName:a().string,breakLinkClassName:a().string,breakHandler:a().func.isRequired,getEventListener:a().func.isRequired};const d=u;function h(e){return null!=e?e:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f.apply(this,arguments)}function g(e,t){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},g(e,t)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(o,e);var r,n,i,a,s=(i=o,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=v(i);if(a){var r=v(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}(this,e)});function o(e){var r,n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),y(m(r=s.call(this,e)),"handlePreviousPage",function(e){var t=r.state.selected;r.handleClick(e,null,t>0?t-1:void 0,{isPrevious:!0})}),y(m(r),"handleNextPage",function(e){var t=r.state.selected,n=r.props.pageCount;r.handleClick(e,null,t<n-1?t+1:void 0,{isNext:!0})}),y(m(r),"handlePageSelected",function(e,t){if(r.state.selected===e)return r.callActiveCallback(e),void r.handleClick(t,null,void 0,{isActive:!0});r.handleClick(t,null,e)}),y(m(r),"handlePageChange",function(e){r.state.selected!==e&&(r.setState({selected:e}),r.callCallback(e))}),y(m(r),"getEventListener",function(e){return y({},r.props.eventListener,e)}),y(m(r),"handleClick",function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=i.isPrevious,s=void 0!==a&&a,o=i.isNext,l=void 0!==o&&o,c=i.isBreak,u=void 0!==c&&c,d=i.isActive,h=void 0!==d&&d;e.preventDefault?e.preventDefault():e.returnValue=!1;var p=r.state.selected,f=r.props.onClick,g=n;if(f){var m=f({index:t,selected:p,nextSelectedPage:n,event:e,isPrevious:s,isNext:l,isBreak:u,isActive:h});if(!1===m)return;Number.isInteger(m)&&(g=m)}void 0!==g&&r.handlePageChange(g)}),y(m(r),"handleBreakClick",function(e,t){var n=r.state.selected;r.handleClick(t,e,n<e?r.getForwardJump():r.getBackwardJump(),{isBreak:!0})}),y(m(r),"callCallback",function(e){void 0!==r.props.onPageChange&&"function"==typeof r.props.onPageChange&&r.props.onPageChange({selected:e})}),y(m(r),"callActiveCallback",function(e){void 0!==r.props.onPageActive&&"function"==typeof r.props.onPageActive&&r.props.onPageActive({selected:e})}),y(m(r),"getElementPageRel",function(e){var t=r.state.selected,n=r.props,i=n.nextPageRel,a=n.prevPageRel,s=n.selectedPageRel;return t-1===e?a:t===e?s:t+1===e?i:void 0}),y(m(r),"pagination",function(){var e=[],n=r.props,i=n.pageRangeDisplayed,a=n.pageCount,s=n.marginPagesDisplayed,o=n.breakLabel,l=n.breakClassName,c=n.breakLinkClassName,u=n.breakAriaLabels,h=r.state.selected;if(a<=i)for(var p=0;p<a;
27p++)e.push(r.getPageElement(p));else{var f=i/2,g=i-f;h>a-i/2?f=i-(g=a-h):h<i/2&&(g=i-(f=h));var m,v,y=function(e){return r.getPageElement(e)},b=[];for(m=0;m<a;m++){var w=m+1;if(w<=s)b.push({type:"page",index:m,display:y(m)});else if(w>a-s)b.push({type:"page",index:m,display:y(m)});else if(m>=h-f&&m<=h+(0===h&&i>1?g-1:g))b.push({type:"page",index:m,display:y(m)});else if(o&&b.length>0&&b[b.length-1].display!==v&&(i>0||s>0)){var x=m<h?u.backward:u.forward;v=t().createElement(d,{key:m,breakAriaLabel:x,breakLabel:o,breakClassName:l,breakLinkClassName:c,breakHandler:r.handleBreakClick.bind(null,m),getEventListener:r.getEventListener}),b.push({type:"break",index:m,display:v})}}b.forEach(function(t,r){var n=t;"break"===t.type&&b[r-1]&&"page"===b[r-1].type&&b[r+1]&&"page"===b[r+1].type&&b[r+1].index-b[r-1].index<=2&&(n={type:"page",index:t.index,display:y(t.index)}),e.push(n.display)})}return e}),void 0!==e.initialPage&&void 0!==e.forcePage&&console.warn("(react-paginate): Both initialPage (".concat(e.initialPage,") and forcePage (").concat(e.forcePage,") props are provided, which is discouraged.")+" Use exclusively forcePage prop for a controlled component.\nSee https://reactjs.org/docs/forms.html#controlled-components"),n=e.initialPage?e.initialPage:e.forcePage?e.forcePage:0,r.state={selected:n},r}return r=o,(n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.initialPage,r=e.disableInitialCallback,n=e.extraAriaContext,i=e.pageCount,a=e.forcePage;void 0===t||r||this.callCallback(t),n&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead."),Number.isInteger(i)||console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(i,"). Did you forget a Math.ceil()?")),void 0!==t&&t>i-1&&console.warn("(react-paginate): The initialPage prop provided is greater than the maximum page index from pageCount prop (".concat(t," > ").concat(i-1,").")),void 0!==a&&a>i-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(a," > ").concat(i-1,")."))}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.forcePage&&this.props.forcePage!==e.forcePage&&(this.props.forcePage>this.props.pageCount-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(this.props.forcePage," > ").concat(this.props.pageCount-1,").")),this.setState({selected:this.props.forcePage})),Number.isInteger(e.pageCount)&&!Number.isInteger(this.props.pageCount)&&console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(this.props.pageCount,"). Did you forget a Math.ceil()?"))}},{key:"getForwardJump",value:function(){var e=this.state.selected,t=this.props,r=t.pageCount,n=e+t.pageRangeDisplayed;return n>=r?r-1:n}},{key:"getBackwardJump",value:function(){var e=this.state.selected-this.props.pageRangeDisplayed;return e<0?0:e}},{key:"getElementHref",value:function(e){var t=this.props,r=t.hrefBuilder,n=t.pageCount,i=t.hrefAllControls;if(r)return i||e>=0&&e<n?r(e+1,n,this.state.selected):void 0}},{key:"ariaLabelBuilder",value:function(e){var t=e===this.state.selected;if(this.props.ariaLabelBuilder&&e>=0&&e<this.props.pageCount){var r=this.props.ariaLabelBuilder(e+1,t);return this.props.extraAriaContext&&!t&&(r=r+" "+this.props.extraAriaContext),r}}},{key:"getPageElement",value:function(e){var r=this.state.selected,n=this.props,i=n.pageClassName,a=n.pageLinkClassName,s=n.activeClassName,o=n.activeLinkClassName,c=n.extraAriaContext,u=n.pageLabelBuilder;return t().createElement(l,{key:e,pageSelectedHandler:this.handlePageSelected.bind(null,e),selected:r===e,rel:this.getElementPageRel(e),pageClassName:i,pageLinkClassName:a,activeClassName:s,activeLinkClassName:o,extraAriaContext:c,href:this.getElementHref(e),ariaLabel:this.ariaLabelBuilder(e),page:e+1,pageLabelBuilder:u,getEventListener:this.getEventListener})}},{key:"render",value:function(){var e=this.props.renderOnZeroPageCount;if(0===this.props.pageCount&&void 0!==e)return e?e(this.props):e;var r=this.props,n=r.disabledClassName,i=r.disabledLinkClassName,a=r.pageCount,s=r.className,o=r.containerClassName,l=r.previousLabel,c=r.previousClassName,u=r.previousLinkClassName,d=r.previousAriaLabel,p=r.prevRel,g=r.nextLabel,m=r.nextClassName,v=r.nextLinkClassName,y=r.nextAriaLabel,b=r.nextRel,w=this.state.selected,x=0===w,E=w===a-1,S="".concat(h(c)).concat(x?" ".concat(h(n)):""),A="".concat(h(m)).concat(E?" ".concat(h(n)):""),_="".concat(h(u)).concat(x?" ".concat(h(i)):""),T="".concat(h(v)).concat(E?" ".concat(h(i)):""),C=x?"true":"false",P=E?"true":"false";return t().createElement("ul",{className:s||o,role:"navigation","aria-label":"Pagination"},t().createElement("li",{className:S},t().createElement("a",f({className:_,href:this.getElementHref(w-1),tabIndex:x?"-1":"0",role:"button",onKeyPress:this.handlePreviousPage,"aria-disabled":C,"aria-label":d,rel:p},this.getEventListener(this.handlePreviousPage)),l)),this.pagination(),t().createElement("li",{className:A},t().createElement("a",f({className:T,href:this.getElementHref(w+1),tabIndex:E?"-1":"0",role:"button",onKeyPress:this.handleNextPage,"aria-disabled":P,"aria-label":y,rel:b},this.getEventListener(this.handleNextPage)),g)))}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),o}(e.Component);y(b,"propTypes",{pageCount:a().number.isRequired,pageRangeDisplayed:a().number,marginPagesDisplayed:a().number,previousLabel:a().node,previousAriaLabel:a().string,prevPageRel:a().string,prevRel:a().string,nextLabel:a().node,nextAriaLabel:a().string,nextPageRel:a().string,nextRel:a().string,breakLabel:a().oneOfType([a().string,a().node]),breakAriaLabels:a().shape({forward:a().string,backward:a().string}
vendor: 6,351 bytes, lines 27-46
27),hrefBuilder:a().func,hrefAllControls:a().bool,onPageChange:a().func,onPageActive:a().func,onClick:a().func,initialPage:a().number,forcePage:a().number,disableInitialCallback:a().bool,containerClassName:a().string,className:a().string,pageClassName:a().string,pageLinkClassName:a().string,pageLabelBuilder:a().func,activeClassName:a().string,activeLinkClassName:a().string,previousClassName:a().string,nextClassName:a().string,previousLinkClassName:a().string,nextLinkClassName:a().string,disabledClassName:a().string,disabledLinkClassName:a().string,breakClassName:a().string,breakLinkClassName:a().string,extraAriaContext:a().string,ariaLabelBuilder:a().func,eventListener:a().string,renderOnZeroPageCount:a().func,selectedPageRel:a().string}),y(b,"defaultProps",{pageRangeDisplayed:2,marginPagesDisplayed:3,activeClassName:"selected",previousLabel:"Previous",previousClassName:"previous",previousAriaLabel:"Previous page",prevPageRel:"prev",prevRel:"prev",nextLabel:"Next",nextClassName:"next",nextAriaLabel:"Next page",nextPageRel:"next",nextRel:"next",breakLabel:"...",breakAriaLabels:{forward:"Jump forward",backward:"Jump backward"},disabledClassName:"disabled",disableInitialCallback:!1,pageLabelBuilder:function(e){return e},eventListener:"onClick",renderOnZeroPageCount:void 0,selectedPageRel:"canonical",hrefAllControls:!1});const w=b})(),i})(),e.exports=n(r(1594))},4976(e,t,r){"use strict"; 28/** 29 * react-router-dom v7.18.2 30 * 31 * Copyright (c) Remix Software Inc. 32 * 33 * This source code is licensed under the MIT license found in the 34 * LICENSE.md file in the root directory of this source tree. 35 * 36 * @license MIT 37 */var n,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,l=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of s(t))o.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(n=a(t,l))||n.enumerable});return e},c={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(c,{HydratedRouter:()=>u.HydratedRouter,RouterProvider:()=>u.RouterProvider}),e.exports=(n=c,l(i({},"__esModule",{value:!0}),n));var u=r(2600);((e,t,r)=>{l(e,t,"default"),r&&l(r,t,"default")})(c,r(9949),e.exports)},1020(e,t,r){"use strict"; 38/** 39 * @license React 40 * react-jsx-runtime.production.min.js 41 * 42 * Copyright (c) Facebook, Inc. and its affiliates. 43 * 44 * This source code is licensed under the MIT license found in the 45 * LICENSE file in the root directory of this source tree. 46 */var n=r(1594),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,a={},c=null,u=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,n)&&!l.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:i,type:e,key:c,ref:u,props:a,_owner:o.current}}t.Fragment=a,t.jsx=c,t.jsxs=c},4848(e,t,r){"use strict";e.exports=r(1020)},5515(e,t,r){"use strict";r.d(t,{default:()=>me});var n,i=r(1594),a=r.n(i),s=r(5556),o=r.n(s),l=(r(8940),r(9085),r(2008),r(6099),r(3792),r(7764),r(3772),r(2953),r(8977)),c=r.n(l),u=r(3922),d=r.n(u),h=r(7654),p=r.n(h),f=[],g=function(){return f.some(function(e){return e.activeTargets.length>0})},m="ResizeObserver loop completed with undelivered notifications.";!function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(n||(n={}));var v,y=function(e){return Object.freeze(e)},b=function(e,t){this.inlineSize=e,this.blockSize=t,y(this)},w=function(){function e(e,t,r,n){return this.x=e,this.y=t,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,y(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),x=function(e){return e instanceof SVGElement&&"getBBox"in e},E=function(e){if(x(e)){var t=e.getBBox(),r=t.width,n=t.height;return!r&&!n}var i=e,a=i.offsetWidth,s=i.offsetHeight;return!(a||s||e.getClientRects().length)},S=function(e){var t;if(e instanceof Element)return!0;var r=null===(t=null==e?void 0:e.ownerDocument)||void 0===t?void 0:t.defaultView;return!!(r&&e instanceof r.Element)},A="undefined"!=typeof window?window:{},_=new WeakMap,T=/auto|scroll/,C=/^tb|vertical/,P=/msie|trident/i.test(A.navigator&&A.navigator.userAgent),R=function(e){return parseFloat(e||"0")},O=function(e,t,r){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=!1),new b((r?t:e)||0,(r?e:t)||0)},D=y({devicePixelContentBoxSize:O(),borderBoxSize:O(),contentBoxSize:O(),contentRect:new w(0,0,0,0)}),k=function(e,t){if(void 0===t&&(t=!1),_.has(e)&&!t)return _.get(e);if(E(e))return _.set(e,D),D;var r=getComputedStyle(e),n=x(e)&&e.ownerSVGElement&&e.getBBox(),i=!P&&"border-box"===r.boxSizing,a=C.test(r.writingMode||""),s=!n&&T.test(r.overflowY||""),o=!n&&T.test(r.overflowX||""),l=n?0:R(r.paddingTop),c=n?0:R(r.paddingRight),u=n?0:R(r.paddingBottom),d=n?0:R(r.paddingLeft),h=n?0:R(r.borderTopWidth),p=n?0:R(r.borderRightWidth),f=n?0:R(r.borderBottomWidth),g=d+c,m=l+u,v=(n?0:R(r.borderLeftWidth))+p,b=h+f,S=o?e.offsetHeight-b-e.clientHeight:0,A=s?e.offsetWidth-v-e.clientWidth:0,k=i?g+v:0,M=i?m+b:0,L=n?n.width:R(r.width)-k-A,I=n?n.height:R(r.height)-M-S,N=L+g+A+v,j=I+m+S+b,F=y({devicePixelContentBoxSize:O(Math.round(L*devicePixelRatio),Math.round(I*devicePixelRatio),a),borderBoxSize:O(N,j,a),contentBoxSize:O(L,I,a),contentRect:new w(d,l,L,I)});return _.set(e,F),F},M=function(e,t,r){var i=k(e,r),a=i.borderBoxSize,s=i.contentBoxSize,o=i.devicePixelContentBoxSize;switch(t){case n.DEVICE_PIXEL_CONTENT_BOX:return o;case n.BORDER_BOX:return a;default:return s}},L=function(e){var t=k(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=y([t.borderBoxSize]),this.contentBoxSize=y([t.contentBoxSize]),this.devicePixelContentBoxSize=y([t.devicePixelContentBoxSize])},I=function(e){if(E(e))return 1/0;for(var t=0,r=e.parentNode;r;)t+=1,r=r.parentNode;return t},N=function(){var e=1/0,t=[];f.forEach(function(r){if(0!==r.activeTargets.length){var n=[];
46r.activeTargets.forEach(function(t){var r=new L(t.target),i=I(t.target);n.push(r),t.lastReportedSize=M(t.target,t.observedBox),i<e&&(e=i)}),t.push(function(){r.callback.call(r.observer,n,r.observer)}),r.activeTargets.splice(0,r.activeTargets.length)}});for(var r=0,n=t;r<n.length;r++){(0,n[r])()}return e},j=function(e){f.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(r){r.isActive()&&(I(r.target)>e?t.activeTargets.push(r):t.skippedTargets.push(r))})})},F=function(){var e,t=0;for(j(t);g();)t=N(),j(t);return f.some(function(e){return e.skippedTargets.length>0})&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:m}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=m),window.dispatchEvent(e)),t>0},H=[],B=function(e){if(!v){var t=0,r=document.createTextNode("");new MutationObserver(function(){return H.splice(0).forEach(function(e){return e()})}).observe(r,{characterData:!0}),v=function(){r.textContent="".concat(t?t--:t++)}}H.push(e),v()},z=0,$={attributes:!0,characterData:!0,childList:!0,subtree:!0},U=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],W=function(e){return void 0===e&&(e=0),Date.now()+e},V=!1,q=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!V){V=!0;var r,n=W(e);r=function(){var r=!1;try{r=F()}finally{if(V=!1,e=n-W(),!z)return;r?t.run(1e3):e>0?t.run(e):t.start()}},B(function(){requestAnimationFrame(r)})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,$)};document.body?t():A.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),U.forEach(function(t){return A.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),U.forEach(function(t){return A.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},e}()),Y=function(e){!z&&e>0&&q.start(),!(z+=e)&&q.stop()},G=function(){function e(e,t){this.target=e,this.observedBox=t||n.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=M(this.target,this.observedBox,!0);return e=this.target,x(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),X=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},K=new WeakMap,J=function(e,t){for(var r=0;r<e.length;r+=1)if(e[r].target===t)return r;return-1},Q=function(){function e(){}return e.connect=function(e,t){var r=new X(e,t);K.set(e,r)},e.observe=function(e,t,r){var n=K.get(e),i=0===n.observationTargets.length;J(n.observationTargets,t)<0&&(i&&f.push(n),n.observationTargets.push(new G(t,r&&r.box)),Y(1),q.schedule())},e.unobserve=function(e,t){var r=K.get(e),n=J(r.observationTargets,t),i=1===r.observationTargets.length;n>=0&&(i&&f.splice(f.indexOf(r),1),r.observationTargets.splice(n,1),Y(-1))},e.disconnect=function(e){var t=this,r=K.get(e);r.observationTargets.slice().forEach(function(r){return t.unobserve(e,r.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Z=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Q.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!S(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Q.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!S(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Q.unobserve(this,e)},e.prototype.disconnect=function(){Q.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}(),ee=r(4610),te=r.n(ee);r(2712),r(7495),r(1761),r(2010),r(5440);function re(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window}function ne(e){return e&&e.ownerDocument?e.ownerDocument:document}var ie=null,ae=null;function se(e){if(null===ie){var t=ne(e);if(void 0===t)return ie=0;var r=t.body,n=t.createElement("div");n.classList.add("simplebar-hide-scrollbar"),r.appendChild(n);var i=n.getBoundingClientRect().right;r.removeChild(n),ie=i}return ie}te()&&window.addEventListener("resize",function(){ae!==window.devicePixelRatio&&(ae=window.devicePixelRatio,ie=null)});var oe=function(){function e(t,r){var n=this;this.onScroll=function(){var e=re(n.el);n.scrollXTicking||(e.requestAnimationFrame(n.scrollX),n.scrollXTicking=!0),n.scrollYTicking||(e.requestAnimationFrame(n.scrollY),n.scrollYTicking=!0)},this.scrollX=function(){n.axis.x.isOverflowing&&(n.showScrollbar("x"),n.positionScrollbar("x")),n.scrollXTicking=!1},this.scrollY=function(){n.axis.y.isOverflowing&&(n.showScrollbar("y"),n.positionScrollbar("y")),n.scrollYTicking=!1},this.onMouseEnter=function(){n.showScrollbar("x"),n.showScrollbar("y")},this.onMouseMove=function(e){n.mouseX=e.clientX,n.mouseY=e.clientY,(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&n.onMouseMoveForAxis("x"),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&n.onMouseMoveForAxis("y")},this.onMouseLeave=function(){n.onMouseMove.cancel(),(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&n.onMouseLeaveForAxis("x"),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&n.onMouseLeaveForAxis("y"),n.mouseX=-1,n.mouseY=-1},this.onWindowResize=function(){n.scrollbarWidth=n.getScrollbarWidth(),n.hideNativeScrollbar()},this.hideScrollbars=function(){n.axis.x.track.rect=n.axis.x.track.el.getBoundingClientRect(),n.axis.y.track.rect=n.axis.y.track.el.getBoundingClientRect(),n.isWithinBounds(n.axis.y.track.rect)||(n.axis.y.scrollbar.el.classList.remove(n.classNames.visible),n.axis.y.isVisible=!1),n.isWithinBounds(n.axis.x.track.rect)||(n.axis.x.scrollbar.el.classList.remove(n.classNames.visible),n.axis.x.isVisible=!1)},this.onPointerEvent=function(e){var t,r;n.axis.x.track.rect=n.axis.x.track.el.getBoundingClientRect(),n.axis.y.track.rect=n.axis.y.track.el.getBoundingClientRect(),(n.axis.x.isOverflowing||n.axis.x.forceVisible)&&(t=n.isWithinBounds(n.axis.x.track.rect)),(n.axis.y.isOverflowing||n.axis.y.forceVisible)&&(r=n.isWithinBounds(n.axis.y.track.rect)),(t||r)&&(e.preventDefault(),e.stopPropagation(),"mousedown"===e.type&&(t&&(n.axis.x.scrollbar.rect=n.axis.x.scrollbar.el.getBoundingClientRect(),n.isWithinBounds(n.axis.x.scrollbar.rect)?n.onDragStart(e,"x"):n.onTrackClick(e,"x")),r&&(n.axis.y.scrollbar.rect=n.axis.y.scrollbar.el.getBoundingClientRect(),n.isWithinBounds(n.axis.y.scrollbar.rect)?n.onDragStart(e,"y"):n.onTrackClick(e,"y"))))},this.drag=function(t){var r=n.axis[n.draggedAxis].track,i=r.rect[n.axis[n.draggedAxis].sizeAttr],a=n.axis[n.draggedAxis].scrollbar,s=n.
46contentWrapperEl[n.axis[n.draggedAxis].scrollSizeAttr],o=parseInt(n.elStyles[n.axis[n.draggedAxis].sizeAttr],10);t.preventDefault(),t.stopPropagation();var l=(("y"===n.draggedAxis?t.pageY:t.pageX)-r.rect[n.axis[n.draggedAxis].offsetAttr]-n.axis[n.draggedAxis].dragOffset)/(i-a.size)*(s-o);"x"===n.draggedAxis&&(l=n.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?l-(i+a.size):l,l=n.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-l:l),n.contentWrapperEl[n.axis[n.draggedAxis].scrollOffsetAttr]=l},this.onEndDrag=function(e){var t=ne(n.el),r=re(n.el);e.preventDefault(),e.stopPropagation(),n.el.classList.remove(n.classNames.dragging),t.removeEventListener("mousemove",n.drag,!0),t.removeEventListener("mouseup",n.onEndDrag,!0),n.removePreventClickId=r.setTimeout(function(){t.removeEventListener("click",n.preventClick,!0),t.removeEventListener("dblclick",n.preventClick,!0),n.removePreventClickId=null})},this.preventClick=function(e){e.preventDefault(),e.stopPropagation()},this.el=t,this.minScrollbarWidth=20,this.options=Object.assign({},e.defaultOptions,r),this.classNames=Object.assign({},e.defaultOptions.classNames,this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,e.instances.has(this.el)||(this.recalculate=c()(this.recalculate.bind(this),64),this.onMouseMove=c()(this.onMouseMove.bind(this),64),this.hideScrollbars=d()(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=d()(this.onWindowResize.bind(this),64,{leading:!0}),e.getRtlHelpers=p()(e.getRtlHelpers),this.init())}e.getRtlHelpers=function(){var t=document.createElement("div");t.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';var r=t.firstElementChild;document.body.appendChild(r);var n=r.firstElementChild;r.scrollLeft=0;var i=e.getOffset(r),a=e.getOffset(n);r.scrollLeft=999;var s=e.getOffset(n);return{isRtlScrollingInverted:i.left!==a.left&&a.left-s.left!==0,isRtlScrollbarInverted:i.left!==a.left}},e.getOffset=function(e){var t=e.getBoundingClientRect(),r=ne(e),n=re(e);return{top:t.top+(n.pageYOffset||r.documentElement.scrollTop),left:t.left+(n.pageXOffset||r.documentElement.scrollLeft)}};var t=e.prototype;return t.init=function(){e.instances.set(this.el,this),te()&&(this.initDOM(),this.setAccessibilityAttributes(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},t.initDOM=function(){var e=this;if(Array.prototype.filter.call(this.el.children,function(t){return t.classList.contains(e.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.c
46ontentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var t=document.createElement("div"),r=document.createElement("div");t.classList.add(this.classNames.track),r.classList.add(this.classNames.scrollbar),t.appendChild(r),this.axis.x.track.el=t.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=t.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-simplebar","init")},t.setAccessibilityAttributes=function(){var e=this.options.ariaLabel||"scrollable content";this.contentWrapperEl.setAttribute("tabindex","0"),this.contentWrapperEl.setAttribute("role","region"),this.contentWrapperEl.setAttribute("aria-label",e)},t.initListeners=function(){var e=this,t=re(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(t){e.el.addEventListener(t,e.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(t){e.el.addEventListener(t,e.onPointerEvent,{capture:!0,passive:!0})}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),t.addEventListener("resize",this.onWindowResize);var r=!1,n=null,i=t.ResizeObserver||Z;this.resizeObserver=new i(function(){r&&null===n&&(n=t.requestAnimationFrame(function(){e.recalculate(),n=null}))}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),t.requestAnimationFrame(function(){r=!0}),this.mutationObserver=new t.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},t.recalculate=function(){var e=re(this.el);this.elStyles=e.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;var t=this.heightAutoObserverEl.offsetHeight<=1,r=this.heightAutoObserverEl.offsetWidth<=1,n=this.contentEl.offsetWidth,i=this.contentWrapperEl.offsetWidth,a=this.elStyles.overflowX,s=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft,this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var o=this.contentEl.scrollHeight,l=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=t?"auto":"100%",this.placeholderEl.style.width=r?n+"px":"auto",this.placeholderEl.style.height=o+"px";var c=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=l>n,this.axis.y.isOverflowing=o>c,this.axis.x.isOverflowing="hidden"!==a&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==s&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();var u=this.axis.x.isOverflowing?this.scrollbarWidth:0,d=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&l>i-d,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&o>c-u,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px",this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px",this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")},t.getScrollbarSize=function(e){if(void 0===e&&(e="y"),!this.axis[e].isOverflowing)return 0;var t,r=this.contentEl[this.axis[e].scrollSizeAttr],n=this.axis[e].track.el[this.axis[e].offsetSizeAttr],i=n/r;return t=Math.max(~~(i*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(t=Math.min(t,this.options.scrollbarMaxSize)),t},t.positionScrollbar=function(t){if(void 0===t&&(t="y"),this.axis[t].isOverflowing){var r=this.contentWrapperEl[this.axis[t].scrollSizeAttr],n=this.axis[t].track.el[this.axis[t].offsetSizeAttr],i=parseInt(this.elStyles[this.axis[t].sizeAttr],10),a=this.axis[t].scrollbar,s=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],o=(s="x"===t&&this.isRtl&&e.getRtlHelpers().isRtlScrollingInverted?-s:s)/(r-i),l=~~((n-a.size)*o
46);l="x"===t&&this.isRtl&&e.getRtlHelpers().isRtlScrollbarInverted?l+(n-a.size):l,a.el.style.transform="x"===t?"translate3d("+l+"px, 0, 0)":"translate3d(0, "+l+"px, 0)"}},t.toggleTrackVisibility=function(e){void 0===e&&(e="y");var t=this.axis[e].track.el,r=this.axis[e].scrollbar.el;this.axis[e].isOverflowing||this.axis[e].forceVisible?(t.style.visibility="visible",this.contentWrapperEl.style[this.axis[e].overflowAttr]="scroll"):(t.style.visibility="hidden",this.contentWrapperEl.style[this.axis[e].overflowAttr]="hidden"),this.axis[e].isOverflowing?r.style.display="block":r.style.display="none"},t.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},t.onMouseMoveForAxis=function(e){void 0===e&&(e="y"),this.axis[e].track.rect=this.axis[e].track.el.getBoundingClientRect(),this.axis[e].scrollbar.rect=this.axis[e].scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis[e].scrollbar.rect)?this.axis[e].scrollbar.el.classList.add(this.classNames.hover):this.axis[e].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[e].track.rect)?(this.showScrollbar(e),this.axis[e].track.el.classList.add(this.classNames.hover)):this.axis[e].track.el.classList.remove(this.classNames.hover)},t.onMouseLeaveForAxis=function(e){void 0===e&&(e="y"),this.axis[e].track.el.classList.remove(this.classNames.hover),this.axis[e].scrollbar.el.classList.remove(this.classNames.hover)},t.showScrollbar=function(e){void 0===e&&(e="y");var t=this.axis[e].scrollbar.el;this.axis[e].isVisible||(t.classList.add(this.classNames.visible),this.axis[e].isVisible=!0),this.options.autoHide&&this.hideScrollbars()},t.onDragStart=function(e,t){void 0===t&&(t="y");var r=ne(this.el),n=re(this.el),i=this.axis[t].scrollbar,a="y"===t?e.pageY:e.pageX;this.axis[t].dragOffset=a-i.rect[this.axis[t].offsetAttr],this.draggedAxis=t,this.el.classList.add(this.classNames.dragging),r.addEventListener("mousemove",this.drag,!0),r.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(r.addEventListener("click",this.preventClick,!0),r.addEventListener("dblclick",this.preventClick,!0)):(n.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},t.onTrackClick=function(e,t){var r=this;if(void 0===t&&(t="y"),this.options.clickOnTrack){var n=re(this.el);this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect();var i=this.axis[t].scrollbar.rect[this.axis[t].offsetAttr],a=parseInt(this.elStyles[this.axis[t].sizeAttr],10),s=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],o=("y"===t?this.mouseY-i:this.mouseX-i)<0?-1:1,l=-1===o?s-a:s+a;!function e(){var i,a;-1===o?s>l&&(s-=r.options.clickOnTrackSpeed,r.contentWrapperEl.scrollTo(((i={})[r.axis[t].offsetAttr]=s,i)),n.requestAnimationFrame(e)):s<l&&(s+=r.options.clickOnTrackSpeed,r.contentWrapperEl.scrollTo(((a={})[r.axis[t].offsetAttr]=s,a)),n.requestAnimationFrame(e))}()}},t.getContentElement=function(){return this.contentEl},t.getScrollElement=function(){return this.contentWrapperEl},t.getScrollbarWidth=function(){try{return"none"===getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:se(this.el)}catch(e){return se(this.el)}},t.removeListeners=function(){var e=this,t=re(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(function(t){e.el.removeEventListener(t,e.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(function(t){e.el.removeEventListener(t,e.onPointerEvent,{capture:!0,passive:!0})}),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()},t.unMount=function(){this.removeListeners(),e.instances.delete(this.el)},t.isWithinBounds=function(e){return this.mouseX>=e.left&&this.mouseX<=e.left+e.width&&this.mouseY>=e.top&&this.mouseY<=e.top+e.height},t.findChild=function(e,t){var r=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;return Array.prototype.filter.call(e.children,function(e){return r.call(e,t)})[0]},e}();
46oe.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"simplebar-content",contentWrapper:"simplebar-content-wrapper",offset:"simplebar-offset",mask:"simplebar-mask",wrapper:"simplebar-wrapper",placeholder:"simplebar-placeholder",scrollbar:"simplebar-scrollbar",track:"simplebar-track",heightAutoObserverWrapperEl:"simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"simplebar-height-auto-observer",visible:"simplebar-visible",horizontal:"simplebar-horizontal",vertical:"simplebar-vertical",hover:"simplebar-hover",dragging:"simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},oe.instances=new WeakMap;const le=oe;function ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(r),!0).forEach(function(t){de(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ce(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function de(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function he(){return he=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},he.apply(this,arguments)}function pe(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var fe=["children","scrollableNodeProps","tag"],ge=a().forwardRef(function(e,t){var r,n=e.children,s=e.scrollableNodeProps,o=void 0===s?{}:s,l=e.tag,c=void 0===l?"div":l,u=pe(e,fe),d=c,h=(0,i.useRef)(),p=(0,i.useRef)(),f=(0,i.useRef)(),g={},m={},v=[];return Object.keys(u).forEach(function(e){Object.prototype.hasOwnProperty.call(le.defaultOptions,e)?g[e]=u[e]:e.match(/data-simplebar-(.+)/)&&"data-simplebar-direction"!==e?v.push({name:e,value:u[e]}):m[e]=u[e]}),v.length&&console.warn("simplebar-react: this way of passing options is deprecated. Pass it like normal props instead:\n 'data-simplebar-auto-hide=\"false\"' â> 'autoHide=\"false\"'\n "),(0,i.useEffect)(function(){var e;return h=o.ref||h,p.current&&(r=new le(p.current,ue(ue(ue(ue({},(e=v,Array.prototype.reduce.call(e,function(e,t){var r=t.name.match(/data-simplebar-(.+)/);if(r){var n=r[1].replace(/\W+(.)/g,function(e,t){return t.toUpperCase()});switch(t.value){case"true":e[n]=!0;break;case"false":e[n]=!1;break;case void 0:e[n]=!0;break;default:e[n]=t.value}}return e},{}))),g),h&&{scrollableNode:h.current}),f.current&&{contentNode:f.current})),t&&(t.current=r)),function(){r.unMount(),r=null}},[]),a().createElement(d,he({ref:p,"data-simplebar":!0},m),a().createElement("div",{className:"simplebar-wrapper"},a().createElement("div",{className:"simplebar-height-auto-observer-wrapper"},a().createElement("div",{className:"simplebar-height-auto-observer"})),a().createElement("div",{className:"simplebar-mask"},a().createElement("div",{className:"simplebar-offset"},"function"==typeof n?n({scrollableNodeRef:h,contentNodeRef:f}):a().createElement("div",he({},o,{className:"simplebar-content-wrapper".concat(o.className?" ".concat(o.className):"")}),a().createElement("div",{className:"simplebar-content"},n)))),a().createElement("div",{className:"simplebar-placeholder"})),a().createElement("div",{className:"simplebar-track simplebar-horizontal"},a().createElement("div",{className:"simplebar-scrollbar"})),a().createElement("div",{className:"simplebar-track simplebar-vertical"},a().createElement("div",{className:"simplebar-scrollbar"})))});ge.displayName="SimpleBar",ge.propTypes={children:o().oneOfType([o().node,o().func]),scrollableNodeProps:o().object,tag:o().string};const me=ge},3922(e,t,r){var n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,l="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),d=Object.prototype.toString,h=Math.max,p=Math.min,f=function(){return u.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;
46if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var r=a.test(e);return r||s.test(e)?o(e.slice(2),r?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,r){var n,i,a,s,o,l,c=0,u=!1,d=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var r=n,a=i;return n=i=void 0,c=t,s=e.apply(a,r)}function b(e){var r=e-l;return void 0===l||r>=t||r<0||d&&e-c>=a}function w(){var e=f();if(b(e))return x(e);o=setTimeout(w,function(e){var r=t-(e-l);return d?p(r,a-(e-c)):r}(e))}function x(e){return o=void 0,v&&n?y(e):(n=i=void 0,s)}function E(){var e=f(),r=b(e);if(n=arguments,i=this,l=e,r){if(void 0===o)return function(e){return c=e,o=setTimeout(w,t),u?y(e):s}(l);if(d)return o=setTimeout(w,t),y(l)}return void 0===o&&(o=setTimeout(w,t)),s}return t=m(t)||0,g(r)&&(u=!!r.leading,a=(d="maxWait"in r)?h(m(r.maxWait)||0,t):a,v="trailing"in r?!!r.trailing:v),E.cancel=function(){void 0!==o&&clearTimeout(o),c=0,n=l=i=o=void 0},E.flush=function(){return void 0===o?s:x(f())},E}},8977(e,t,r){var n="Expected a function",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,u="object"==typeof self&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),h=Object.prototype.toString,p=Math.max,f=Math.min,g=function(){return d.Date.now()};function m(e,t,r){var i,a,s,o,l,c,u=0,d=!1,h=!1,m=!0;if("function"!=typeof e)throw new TypeError(n);function b(t){var r=i,n=a;return i=a=void 0,u=t,o=e.apply(n,r)}function w(e){var r=e-c;return void 0===c||r>=t||r<0||h&&e-u>=s}function x(){var e=g();if(w(e))return E(e);l=setTimeout(x,function(e){var r=t-(e-c);return h?f(r,s-(e-u)):r}(e))}function E(e){return l=void 0,m&&i?b(e):(i=a=void 0,o)}function S(){var e=g(),r=w(e);if(i=arguments,a=this,c=e,r){if(void 0===l)return function(e){return u=e,l=setTimeout(x,t),d?b(e):o}(c);if(h)return l=setTimeout(x,t),b(c)}return void 0===l&&(l=setTimeout(x,t)),o}return t=y(t)||0,v(r)&&(d=!!r.leading,s=(h="maxWait"in r)?p(y(r.maxWait)||0,t):s,m="trailing"in r?!!r.trailing:m),S.cancel=function(){void 0!==l&&clearTimeout(l),u=0,i=c=a=l=void 0},S.flush=function(){return void 0===l?o:E(g())},S}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var r=s.test(e);return r||o.test(e)?l(e.slice(2),r?2:8):a.test(e)?NaN:+e}e.exports=function(e,t,r){var i=!0,a=!0;if("function"!=typeof e)throw new TypeError(n);return v(r)&&(i="leading"in r?!!r.leading:i,a="trailing"in r?!!r.trailing:a),m(e,t,{leading:i,maxWait:t,trailing:a})}},2084(e,t,r){"use strict";r.d(t,{default:()=>s});var n=r(1594);function i(e){let t;const r=new Set,n=(e,n)=>{const i="function"==typeof e?e(t):e;if(i!==t){const e=t;t=n?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,a={setState:n,getState:i,subscribe:(e,n,a)=>n||a?((e,n=i,a=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let s=n(t);function o(){const r=n(t);if(!a(s,r)){const t=s;e(s=r,t)}}return r.add(o),()=>r.delete(o)})(e,n,a):(r.add(e),()=>r.delete(e)),destroy:()=>r.clear()};return t=e(n,i,a),a}const a="undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?n.useEffect:n.useLayoutEffect;function s(e){const t="function"==typeof e?i(e):e,r=(e=t.getState,r=Object.is)=>{const[,i]=(0,n.useReducer)(e=>e+1,0),s=t.getState(),o=(0,n.useRef)(s),l=(0,n.useRef)(e),c=(0,n.useRef)(r),u=(0,n.useRef)(!1),d=(0,n.useRef)();let h;void 0===d.current&&(d.current=e(s));let p=!1;(o.current!==s||l.current!==e||c.current!==r||u.current)&&(h=e(s),p=!r(d.current,h)),a(()=>{p&&(d.current=h),o.current=s,l.current=e,c.current=r,u.current=!1});const f=(0,n.useRef)(s);a(()=>{const e=()=>{try{const e=t.getState(),r=l.current(e);c.current(d.current,r)||(o.current=e,d.current=r,i())}catch(e){u.current=!0,i()}},r=t.subscribe(e);return t.getState()!==f.current&&e(),r},[]);const g=p?h:d.current;return(0,n.useDebugValue)(g),g};return Object.assign(r,t),r[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const e=[r,t];return{next(){const t=e.length<=0;return{value:e.shift(),done:t}}}},r}},1594(e){"use strict";e.exports=React},5206(e){"use strict";e.exports=ReactDOM},1229(e,t){"use strict";function r(e,t,r){return function(n,i){void 0===i&&(i=r);var a=e(n)+i;return t(a)}}function n(e){return function(t){return new Date(e(t).getTime()-1)}}function i(e,t){return function(r){return[e(r),t(r)]}}function a(e){if(e instanceof Date)return e.getFullYear();if("number"==typeof e)return e;var t=parseInt(e,10);if("string"==typeof e&&!isNaN(t))return t;throw new Error("Failed to get year from date: ".concat(e,"."))}function s(e){if(e instanceof Date)return e.getMonth();throw new Error("Failed to get month from date: ".concat(e,"."))}function o(e){if(e instanceof Date)return e.getMonth()+1;throw new Error("Failed to get human-readable month from date: ".concat(e,"."))}function l(e){if(e instanceof Date)return e.getDate();throw new Error("Failed to get year from date: ".concat(e,"."))}function c(e){if(e instanceof Date)return e.getHours();if("string"==typeof e){var t=e.split(":");if(t.length>=2){var r=t[0];if(r){var n=parseInt(r,10);if(!isNaN(n))return n}}}throw new Error("Failed to get hours from date: ".concat(e,"."))}function u(e){if(e instanceof Date)return e.getMinutes();if("string"==typeof e){var t=e.split(":");if(t.length>=2){var r=t[1]||"0",n=parseInt(r,10);if(!isNaN(n))return n}}throw new Error("Failed to get minutes from date: ".concat(e,"."))}function d(e){if(e instanceof Date)return e.getSeconds();if("string"==typeof e){var t=e.split(":");if(t.length>=2){var r=t[2]||"0",n=parseInt(r,10);if(!isNaN(n))return n}}throw new Error("Failed to get seconds from date: ".concat(e,"."))}function h(e){var t=a(e),r=t+(1-t)%100,n=new Date;return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}function p(e){var t=a(e),r=t+(1-t)%10,n=new Date;return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}function f(e){var t=a(e),r=new Date;return r.setFullYear(t,0,1),r.setHours(0,0,0,0),r}function g(e,t){return function(r,n){void 0===n&&(n=t);var i=a(r),o=s(r)+n,l=new Date;return l.setFullYear(i,o,1),l.setHours(0,0,0,0),e(l)}}function m(e){var t=a(e),r=s(e),n=new Date;return n.setFullYear(t,r,1),n.setHours(0,0,0,0),n}function v(e,t){return function(r,n){void 0===n&&(n=t);var i=a(r),o=s(r),c=l(r)+n,u=new Date;return u.setFullYear(i,o,c),u.setHours(0,0,0,0),e(u)}}function y(e){var t=a(e),r=s(e),n=l(e),i=new Date;return i.setFullYear(t,r,n),i.setHours(0,0,0,0),i}function b(e,t){void 0===t&&(t=2);var r="".concat(e);return r.length>=t?e:"0000".concat(r).slice(-t)}function w(e){var t=b(c(e)),r=b(u(e)),n=b(d(e));return"".concat(t,":").concat(r,":").concat(n)}function x(e){var t=b(a(e),4),r=b(o(e)),n=b(l(e));return"".concat(t,"-").concat(r,"-").concat(n)}
46Object.defineProperty(t,"__esModule",{value:!0}),t.getISOLocalDateTime=t.getISOLocalDate=t.getISOLocalMonth=t.getHoursMinutesSeconds=t.getHoursMinutes=t.getDaysInMonth=t.getDayRange=t.getNextDayEnd=t.getPreviousDayEnd=t.getDayEnd=t.getNextDayStart=t.getPreviousDayStart=t.getDayStart=t.getMonthRange=t.getNextMonthEnd=t.getPreviousMonthEnd=t.getMonthEnd=t.getNextMonthStart=t.getPreviousMonthStart=t.getMonthStart=t.getYearRange=t.getNextYearEnd=t.getPreviousYearEnd=t.getYearEnd=t.getNextYearStart=t.getPreviousYearStart=t.getYearStart=t.getDecadeRange=t.getNextDecadeEnd=t.getPreviousDecadeEnd=t.getDecadeEnd=t.getNextDecadeStart=t.getPreviousDecadeStart=t.getDecadeStart=t.getCenturyRange=t.getNextCenturyEnd=t.getPreviousCenturyEnd=t.getCenturyEnd=t.getNextCenturyStart=t.getPreviousCenturyStart=t.getCenturyStart=t.getMilliseconds=t.getSeconds=t.getMinutes=t.getHours=t.getDate=t.getMonthHuman=t.getMonth=t.getYear=void 0,t.getYear=a,t.getMonth=s,t.getMonthHuman=o,t.getDate=l,t.getHours=c,t.getMinutes=u,t.getSeconds=d,t.getMilliseconds=function(e){if(e instanceof Date)return e.getMilliseconds();if("string"==typeof e){var t=e.split(":");if(t.length>=2){var r=(t[2]||"0").split(".")[1]||"0",n=parseInt(r,10);if(!isNaN(n))return n}}throw new Error("Failed to get seconds from date: ".concat(e,"."))},t.getCenturyStart=h,t.getPreviousCenturyStart=r(a,h,-100),t.getNextCenturyStart=r(a,h,100),t.getCenturyEnd=n(t.getNextCenturyStart),t.getPreviousCenturyEnd=r(a,t.getCenturyEnd,-100),t.getNextCenturyEnd=r(a,t.getCenturyEnd,100),t.getCenturyRange=i(h,t.getCenturyEnd),t.getDecadeStart=p,t.getPreviousDecadeStart=r(a,p,-10),t.getNextDecadeStart=r(a,p,10),t.getDecadeEnd=n(t.getNextDecadeStart),t.getPreviousDecadeEnd=r(a,t.getDecadeEnd,-10),t.getNextDecadeEnd=r(a,t.getDecadeEnd,10),t.getDecadeRange=i(p,t.getDecadeEnd),t.getYearStart=f,t.getPreviousYearStart=r(a,f,-1),t.getNextYearStart=r(a,f,1),t.getYearEnd=n(t.getNextYearStart),t.getPreviousYearEnd=r(a,t.getYearEnd,-1),t.getNextYearEnd=r(a,t.getYearEnd,1),t.getYearRange=i(f,t.getYearEnd),t.getMonthStart=m,t.getPreviousMonthStart=g(m,-1),t.getNextMonthStart=g(m,1),t.getMonthEnd=n(t.getNextMonthStart),t.getPreviousMonthEnd=g(t.getMonthEnd,-1),t.getNextMonthEnd=g(t.getMonthEnd,1),t.getMonthRange=i(m,t.getMonthEnd),t.getDayStart=y,t.getPreviousDayStart=v(y,-1),t.getNextDayStart=v(y,1),t.getDayEnd=n(t.getNextDayStart),t.getPreviousDayEnd=v(t.getDayEnd,-1),t.getNextDayEnd=v(t.getDayEnd,1),t.getDayRange=i(y,t.getDayEnd),t.getDaysInMonth=function(e){return l((0,t.getMonthEnd)(e))},t.getHoursMinutes=function(e){var t=b(c(e)),r=b(u(e));return"".concat(t,":").concat(r)},t.getHoursMinutesSeconds=w,t.getISOLocalMonth=function(e){var t=b(a(e),4),r=b(o(e));return"".concat(t,"-").concat(r)},t.getISOLocalDate=x,t.getISOLocalDateTime=function(e){return"".concat(x(e),"T").concat(w(e))}},9306(e,t,r){"use strict";var n=r(4901),i=r(6823),a=TypeError;e.exports=function(e){if(n(e))return e;throw new a(i(e)+" is not a function")}},3506(e,t,r){"use strict";var n=r(3925),i=String,a=TypeError;e.exports=function(e){if(n(e))return e;throw new a("Can't set "+i(e)+" as a prototype")}},6469(e,t,r){"use strict";var n=r(8227),i=r(2360),a=r(4913).f,s=n("unscopables"),o=Array.prototype;void 0===o[s]&&a(o,s,{configurable:!0,value:i(null)}),e.exports=function(e){o[s][e]=!0}},7829(e,t,r){"use strict";var n=r(8183).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},679(e,t,r){"use strict";var n=r(1625),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},8551(e,t,r){"use strict";var n=r(34),i=String,a=TypeError;e.exports=function(e){if(n(e))return e;throw new a(i(e)+" is not an object")}},5652(e,t,r){"use strict";var n=r(9039);e.exports=n(function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})},9617(e,t,r){"use strict";var n=r(5397),i=r(5610),a=r(6198),s=function(e){return function(t,r,s){var o=n(t),l=a(o);if(0===l)return!e&&-1;var c,u=i(s,l);if(e&&r!=r){for(;l>u;)if((c=o[u++])!=c)return!0}else for(;l>u;u++)if((e||u in o)&&o[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},9213(e,t,r){"use strict";var n=r(6080),i=r(9504),a=r(7055),s=r(8981),o=r(6198),l=r(1469),c=i([].push),u=function(e){var t=1===e,r=2===e,i=3===e,u=4===e,d=6===e,h=7===e,p=5===e||d;return function(f,g,m,v){for(var y,b,w=s(f),x=a(w),E=o(x),S=n(g,m),A=0,_=v||l,T=t?_(f,E):r||h?_(f,0):void 0;E>A;A++)if((p||A in x)&&(b=S(y=x[A],A,w),e))if(t)T[A]=b;else if(b)switch(e){case 3:return!0;case 5:return y;case 6:return A;case 2:c(T,y)}else switch(e){case 4:return!1;case 7:c(T,y)}return d?-1:i||u?u:T}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},597(e,t,r){"use strict";var n=r(9039),i=r(8227),a=r(9519),s=i("species");e.exports=function(e){return a>=51||!n(function(){var t=[];return(t.constructor={})[s]=function(){return{foo:1}
vendor: 3,752 bytes, line 46
46},1!==t[e](Boolean).foo})}},4598(e,t,r){"use strict";var n=r(9039);e.exports=function(e,t){var r=[][e];return!!r&&n(function(){r.call(null,t||function(){return 1},1)})}},926(e,t,r){"use strict";var n=r(9306),i=r(8981),a=r(7055),s=r(6198),o=TypeError,l="Reduce of empty array with no initial value",c=function(e){return function(t,r,c,u){var d=i(t),h=a(d),p=s(d);if(n(r),0===p&&c<2)throw new o(l);var f=e?p-1:0,g=e?-1:1;if(c<2)for(;;){if(f in h){u=h[f],f+=g;break}if(f+=g,e?f<0:p<=f)throw new o(l)}for(;e?f>=0:p>f;f+=g)f in h&&(u=r(u,h[f],f,d));return u}};e.exports={left:c(!1),right:c(!0)}},7680(e,t,r){"use strict";var n=r(9504);e.exports=n([].slice)},7433(e,t,r){"use strict";var n=r(4376),i=r(3517),a=r(34),s=r(8227)("species"),o=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(i(t)&&(t===o||n(t.prototype))||a(t)&&null===(t=t[s]))&&(t=void 0)),void 0===t?o:t}},1469(e,t,r){"use strict";var n=r(7433);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},4428(e,t,r){"use strict";var n=r(8227)("iterator"),i=!1;try{var a=0,s={next:function(){return{done:!!a++}},return:function(){i=!0}};s[n]=function(){return this},Array.from(s,function(){throw 2})}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var r=!1;try{var a={};a[n]=function(){return{next:function(){return{done:r=!0}}}},e(a)}catch(e){}return r}},2195(e,t,r){"use strict";var n=r(9504),i=n({}.toString),a=n("".slice);e.exports=function(e){return a(i(e),8,-1)}},6955(e,t,r){"use strict";var n=r(2140),i=r(4901),a=r(2195),s=r(8227)("toStringTag"),o=Object,l="Arguments"===a(function(){return arguments}());e.exports=n?a:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=o(e),s))?r:l?a(t):"Object"===(n=a(t))&&i(t.callee)?"Arguments":n}},4006(e,t,r){"use strict";var n=r(9504),i=r(6279),a=r(3451).getWeakData,s=r(679),o=r(8551),l=r(4117),c=r(34),u=r(2652),d=r(9213),h=r(9297),p=r(1181),f=p.set,g=p.getterFor,m=d.find,v=d.findIndex,y=n([].splice),b=0,w=function(e){return e.frozen||(e.frozen=new x)},x=function(){this.entries=[]},E=function(e,t){return m(e.entries,function(e){return e[0]===t})};x.prototype={get:function(e){var t=E(this,e);if(t)return t[1]},has:function(e){return!!E(this,e)},set:function(e,t){var r=E(this,e);r?r[1]=t:this.entries.push([e,t])},delete:function(e){var t=v(this.entries,function(t){return t[0]===e});return~t&&y(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,r,n){var d=e(function(e,i){s(e,p),f(e,{type:t,id:b++,frozen:null}),l(i)||u(i,e[n],{that:e,AS_ENTRIES:r})}),p=d.prototype,m=g(t),v=function(e,t,r){var n=m(e),i=a(o(t),!0);return!0===i?w(n).set(t,r):i[n.id]=r,e};return i(p,{delete:function(e){var t=m(this);if(!c(e))return!1;var r=a(e);return!0===r?w(t).delete(e):r&&h(r,t.id)&&delete r[t.id]},has:function(e){var t=m(this);if(!c(e))return!1;var r=a(e);return!0===r?w(t).has(e):r&&h(r,t.id)}}),i(p,r?{get:function(e){var t=m(this);if(c(e)){var r=a(e);if(!0===r)return w(t).get(e);if(r)return r[t.id]}},set:function(e,t){return v(this,e,t)}}:{add:function(e){return v(this,e,!0)}}),d}}},6468(e,t,r){"use strict";var n=r(6518),i=r(4576),a=r(9504),s=r(2796),o=r(6840),l=r(3451),c=r(2652),u=r(679),d=r(4901),h=r(4117),p=r(34),f=r(9039),g=r(4428),m=r(687),v=r(3167);e.exports=function(e,t,r){var y=-1!==e.indexOf("Map"),b=-1!==e.indexOf("Weak"),w=y?"set":"add",x=i[e],E=x&&x.prototype,S=x,A={},_=function(e){var t=a(E[e]);o(E,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(b&&!p(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return b&&!p(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(b&&!p(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};
46if(s(e,!d(x)||!(b||E.forEach&&!f(function(){(new x).entries().next()}))))S=r.getConstructor(t,e,y,w),l.enable();else if(s(e,!0)){var T=new S,C=T[w](b?{}:-0,1)!==T,P=f(function(){T.has(1)}),R=g(function(e){new x(e)}),O=!b&&f(function(){for(var e=new x,t=5;t--;)e[w](t,t);return!e.has(-0)});R||((S=t(function(e,t){u(e,E);var r=v(new x,e,S);return h(t)||c(t,r[w],{that:r,AS_ENTRIES:y}),r})).prototype=E,E.constructor=S),(P||O)&&(_("delete"),_("has"),y&&_("get")),(O||C)&&_(w),b&&E.clear&&delete E.clear}return A[e]=S,n({global:!0,constructor:!0,forced:S!==x},A),m(S,e),b||r.setStrong(S,e,y),S}},7740(e,t,r){"use strict";var n=r(9297),i=r(5031),a=r(7347),s=r(4913);e.exports=function(e,t,r){for(var o=i(t),l=s.f,c=a.f,u=0;u<o.length;u++){var d=o[u];n(e,d)||r&&n(r,d)||l(e,d,c(t,d))}}},2211(e,t,r){"use strict";var n=r(9039);e.exports=!n(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},2529(e){"use strict";e.exports=function(e,t){return{value:e,done:t}}},6699(e,t,r){"use strict";var n=r(3724),i=r(4913),a=r(6980);e.exports=n?function(e,t,r){return i.f(e,t,a(1,r))}:function(e,t,r){return e[t]=r,e}},6980(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},2106(e,t,r){"use strict";var n=r(283),i=r(4913);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},6840(e,t,r){"use strict";var n=r(4901),i=r(4913),a=r(283),s=r(9433);e.exports=function(e,t,r,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:t;if(n(r)&&a(r,c,o),o.global)l?e[t]=r:s(t,r);else{try{o.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e}},6279(e,t,r){"use strict";var n=r(6840);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},9433(e,t,r){"use strict";var n=r(4576),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},3724(e,t,r){"use strict";var n=r(9039);e.exports=!n(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},4055(e,t,r){"use strict";var n=r(4576),i=r(34),a=n.document,s=i(a)&&i(a.createElement);e.exports=function(e){return s?a.createElement(e):{}}},7400(e){"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},9296(e,t,r){"use strict";var n=r(4055)("span").classList,i=n&&n.constructor&&n.constructor.prototype;e.exports=i===Object.prototype?void 0:i},8727(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193(e,t,r){"use strict";var n=r(4215);e.exports="NODE"===n},2839(e,t,r){"use strict";var n=r(4576).navigator,i=n&&n.userAgent;e.exports=i?String(i):""},9519(e,t,r){"use strict";var n,i,a=r(4576),s=r(2839),o=a.process,l=a.Deno,c=o&&o.versions||l&&l.version,u=c&&c.v8;u&&(i=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&s&&(!(n=s.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},4215(e,t,r){"use strict";var n=r(4576),i=r(2839),a=r(2195),s=function(e){return i.slice(0,e.length)===e};e.exports=s("Bun/")?"BUN":s("Cloudflare-Workers")?"CLOUDFLARE":s("Deno/")?"DENO":s("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===a(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},6518(e,t,r){"use strict";var n=r(4576),i=r(7347).f,a=r(6699),s=r(6840),o=r(9433),l=r(7740),c=r(2796);e.exports=function(e,t){var r,u,d,h,p,f=e.target,g=e.global,m=e.stat;if(r=g?n:m?n[f]||o(f,{}):n[f]&&n[f].prototype)for(u in t){if(h=t[u],d=e.dontCallGetSet?(p=i(r,u))&&p.value:r[u],!c(g?u:f+(m?".":"#")+u,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;l(h,d)}(e.sham||d&&d.sham)&&a(h,"sham",!0),s(r,u,h,e)}}},9039(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},9228(e,t,r){"use strict";r(7495);
vendor: 5,067 bytes, line 46
46var n=r(9565),i=r(6840),a=r(7323),s=r(9039),o=r(8227),l=r(6699),c=o("species"),u=RegExp.prototype;e.exports=function(e,t,r,d){var h=o(e),p=!s(function(){var t={};return t[h]=function(){return 7},7!==""[e](t)}),f=p&&!s(function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[h]=/./[h]),r.exec=function(){return t=!0,null},r[h](""),!t});if(!p||!f||r){var g=/./[h],m=t(h,""[e],function(e,t,r,i,s){var o=t.exec;return o===a||o===u.exec?p&&!s?{done:!0,value:n(g,t,r,i)}:{done:!0,value:n(e,r,t,i)}:{done:!1}});i(String.prototype,e,m[0]),i(u,h,m[1])}d&&l(u[h],"sham",!0)}},2744(e,t,r){"use strict";var n=r(9039);e.exports=!n(function(){return Object.isExtensible(Object.preventExtensions({}))})},8745(e,t,r){"use strict";var n=r(616),i=Function.prototype,a=i.apply,s=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(a):function(){return s.apply(a,arguments)})},6080(e,t,r){"use strict";var n=r(7476),i=r(9306),a=r(616),s=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:a?s(e,t):function(){return e.apply(t,arguments)}}},616(e,t,r){"use strict";var n=r(9039);e.exports=!n(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},9565(e,t,r){"use strict";var n=r(616),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},350(e,t,r){"use strict";var n=r(3724),i=r(9297),a=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,o=i(a,"name"),l=o&&"something"===function(){}.name,c=o&&(!n||n&&s(a,"name").configurable);e.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},6706(e,t,r){"use strict";var n=r(9504),i=r(9306);e.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},7476(e,t,r){"use strict";var n=r(2195),i=r(9504);e.exports=function(e){if("Function"===n(e))return i(e)}},9504(e,t,r){"use strict";var n=r(616),i=Function.prototype,a=i.call,s=n&&i.bind.bind(a,a);e.exports=n?s:function(e){return function(){return a.apply(e,arguments)}}},7751(e,t,r){"use strict";var n=r(4576),i=r(4901);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},851(e,t,r){"use strict";var n=r(6955),i=r(5966),a=r(4117),s=r(6269),o=r(8227)("iterator");e.exports=function(e){if(!a(e))return i(e,o)||i(e,"@@iterator")||s[n(e)]}},81(e,t,r){"use strict";var n=r(9565),i=r(9306),a=r(8551),s=r(6823),o=r(851),l=TypeError;e.exports=function(e,t){var r=arguments.length<2?o(e):t;if(i(r))return a(n(r,e));throw new l(s(e)+" is not iterable")}},5966(e,t,r){"use strict";var n=r(9306),i=r(4117);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},2478(e,t,r){"use strict";var n=r(9504),i=r(8981),a=Math.floor,s=n("".charAt),o=n("".replace),l=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,n,d,h){var p=r+e.length,f=n.length,g=u;return void 0!==d&&(d=i(d),g=c),o(h,g,function(i,o){var c;switch(s(o,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,r);case"'":return l(t,p);case"<":c=d[l(o,1,-1)];break;default:var u=+o;if(0===u)return i;if(u>f){var h=a(u/10);return 0===h?i:h<=f?void 0===n[h-1]?s(o,1):n[h-1]+s(o,1):i}c=n[u-1]}return void 0===c?"":c})}},4576(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297(e,t,r){"use strict";var n=r(9504),i=r(8981),a=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},421(e){"use strict";e.exports={}},397(e,t,r){"use strict";var n=r(7751);e.exports=n("document","documentElement")},5917(e,t,r){"use strict";var n=r(3724),i=r(9039),a=r(4055);e.exports=!n&&!i(function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a})},7055(e,t,r){"use strict";var n=r(9504),i=r(9039),a=r(2195),s=Object,o=n("".split);e.exports=i(function(){return!s("z").propertyIsEnumerable(0)})?function(e){return"String"===a(e)?o(e,""):s(e)}:s},3167(e,t,r){"use strict";var n=r(4901),i=r(34),a=r(2967);e.exports=function(e,t,r){var s,o;return a&&n(s=t.constructor)&&s!==r&&i(o=s.prototype)&&o!==r.prototype&&a(e,o),e}},3706(e,t,r){"use strict";var n=r(9504),i=r(4901),a=r(7629),s=n(Function.toString);i(a.inspectSource)||(a.inspectSource=function(e){return s(e)}),e.exports=a.inspectSource},3451(e,t,r){"use strict";var n=r(6518),i=r(9504),a=r(421),s=r(34),o=r(9297),l=r(4913).f,c=r(8480),u=r(298),d=r(4124),h=r(3392),p=r(2744),f=!1,g=h("meta"),m=0,v=function(e){l(e,g,{value:{objectID:"O"+m++,weakData:{}}})},y=e.exports={enable:function(){y.enable=function(){},f=!0;var e=c.f,t=i([].splice),r={};r[g]=1,e(r).length&&(c.f=function(r){for(var n=e(r),i=0,a=n.length;i<a;i++)if(n[i]===g){t(n,i,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:u.f}))},fastKey:function(e,t){if(!s(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;
vendor: 3,387 bytes, line 46
46if(!o(e,g)){if(!d(e))return"F";if(!t)return"E";v(e)}return e[g].objectID},getWeakData:function(e,t){if(!o(e,g)){if(!d(e))return!0;if(!t)return!1;v(e)}return e[g].weakData},onFreeze:function(e){return p&&f&&d(e)&&!o(e,g)&&v(e),e}};a[g]=!0},1181(e,t,r){"use strict";var n,i,a,s=r(8622),o=r(4576),l=r(34),c=r(6699),u=r(9297),d=r(7629),h=r(6119),p=r(421),f="Object already initialized",g=o.TypeError,m=o.WeakMap;if(s||d.state){var v=d.state||(d.state=new m);v.get=v.get,v.has=v.has,v.set=v.set,n=function(e,t){if(v.has(e))throw new g(f);return t.facade=e,v.set(e,t),t},i=function(e){return v.get(e)||{}},a=function(e){return v.has(e)}}else{var y=h("state");p[y]=!0,n=function(e,t){if(u(e,y))throw new g(f);return t.facade=e,c(e,y,t),t},i=function(e){return u(e,y)?e[y]:{}},a=function(e){return u(e,y)}}e.exports={set:n,get:i,has:a,enforce:function(e){return a(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=i(t)).type!==e)throw new g("Incompatible receiver, "+e+" required");return r}}}},4209(e,t,r){"use strict";var n=r(8227),i=r(6269),a=n("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||s[a]===e)}},4376(e,t,r){"use strict";var n=r(2195);e.exports=Array.isArray||function(e){return"Array"===n(e)}},4901(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},3517(e,t,r){"use strict";var n=r(9504),i=r(9039),a=r(4901),s=r(6955),o=r(7751),l=r(3706),c=function(){},u=o("Reflect","construct"),d=/^\s*(?:class|function)\b/,h=n(d.exec),p=!d.test(c),f=function(e){if(!a(e))return!1;try{return u(c,[],e),!0}catch(e){return!1}},g=function(e){if(!a(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!h(d,l(e))}catch(e){return!0}};g.sham=!0,e.exports=!u||i(function(){var e;return f(f.call)||!f(Object)||!f(function(){e=!0})||e})?g:f},2796(e,t,r){"use strict";var n=r(9039),i=r(4901),a=/#|\.prototype\./,s=function(e,t){var r=l[o(e)];return r===u||r!==c&&(i(t)?n(t):!!t)},o=s.normalize=function(e){return String(e).replace(a,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",u=s.POLYFILL="P";e.exports=s},4117(e){"use strict";e.exports=function(e){return null==e}},34(e,t,r){"use strict";var n=r(4901);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},3925(e,t,r){"use strict";var n=r(34);e.exports=function(e){return n(e)||null===e}},6395(e){"use strict";e.exports=!1},757(e,t,r){"use strict";var n=r(7751),i=r(4901),a=r(1625),s=r(7040),o=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&a(t.prototype,o(e))}},2652(e,t,r){"use strict";var n=r(6080),i=r(9565),a=r(8551),s=r(6823),o=r(4209),l=r(6198),c=r(1625),u=r(81),d=r(851),h=r(9539),p=TypeError,f=function(e,t){this.stopped=e,this.result=t},g=f.prototype;e.exports=function(e,t,r){var m,v,y,b,w,x,E,S=r&&r.that,A=!(!r||!r.AS_ENTRIES),_=!(!r||!r.IS_RECORD),T=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),P=n(t,S),R=function(e){return m&&h(m,"normal",e),new f(!0,e)},O=function(e){return A?(a(e),C?P(e[0],e[1],R):P(e[0],e[1])):C?P(e,R):P(e)};if(_)m=e.iterator;else if(T)m=e;else{if(!(v=d(e)))throw new p(s(e)+" is not iterable");if(o(v)){for(y=0,b=l(e);b>y;y++)if((w=O(e[y]))&&c(g,w))return w;return new f(!1)}m=u(e,v)}
vendor: 7,275 bytes, line 46
46for(x=_?e.next:m.next;!(E=i(x,m)).done;){try{w=O(E.value)}catch(e){h(m,"throw",e)}if("object"==typeof w&&w&&c(g,w))return w}return new f(!1)}},9539(e,t,r){"use strict";var n=r(9565),i=r(8551),a=r(5966);e.exports=function(e,t,r){var s,o;i(e);try{if(!(s=a(e,"return"))){if("throw"===t)throw r;return r}s=n(s,e)}catch(e){o=!0,s=e}if("throw"===t)throw r;if(o)throw s;return i(s),r}},3994(e,t,r){"use strict";var n=r(7657).IteratorPrototype,i=r(2360),a=r(6980),s=r(687),o=r(6269),l=function(){return this};e.exports=function(e,t,r,c){var u=t+" Iterator";return e.prototype=i(n,{next:a(+!c,r)}),s(e,u,!1,!0),o[u]=l,e}},1088(e,t,r){"use strict";var n=r(6518),i=r(9565),a=r(6395),s=r(350),o=r(4901),l=r(3994),c=r(2787),u=r(2967),d=r(687),h=r(6699),p=r(6840),f=r(8227),g=r(6269),m=r(7657),v=s.PROPER,y=s.CONFIGURABLE,b=m.IteratorPrototype,w=m.BUGGY_SAFARI_ITERATORS,x=f("iterator"),E="keys",S="values",A="entries",_=function(){return this};e.exports=function(e,t,r,s,f,m,T){l(r,t,s);var C,P,R,O=function(e){if(e===f&&I)return I;if(!w&&e&&e in M)return M[e];switch(e){case E:case S:case A:return function(){return new r(this,e)}}return function(){return new r(this)}},D=t+" Iterator",k=!1,M=e.prototype,L=M[x]||M["@@iterator"]||f&&M[f],I=!w&&L||O(f),N="Array"===t&&M.entries||L;if(N&&(C=c(N.call(new e)))!==Object.prototype&&C.next&&(a||c(C)===b||(u?u(C,b):o(C[x])||p(C,x,_)),d(C,D,!0,!0),a&&(g[D]=_)),v&&f===S&&L&&L.name!==S&&(!a&&y?h(M,"name",S):(k=!0,I=function(){return i(L,this)})),f)if(P={values:O(S),keys:m?I:O(E),entries:O(A)},T)for(R in P)(w||k||!(R in M))&&p(M,R,P[R]);else n({target:t,proto:!0,forced:w||k},P);return a&&!T||M[x]===I||p(M,x,I,{name:f}),g[t]=I,P}},7657(e,t,r){"use strict";var n,i,a,s=r(9039),o=r(4901),l=r(34),c=r(2360),u=r(2787),d=r(6840),h=r(8227),p=r(6395),f=h("iterator"),g=!1;[].keys&&("next"in(a=[].keys())?(i=u(u(a)))!==Object.prototype&&(n=i):g=!0),!l(n)||s(function(){var e={};return n[f].call(e)!==e})?n={}:p&&(n=c(n)),o(n[f])||d(n,f,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},6269(e){"use strict";e.exports={}},6198(e,t,r){"use strict";var n=r(8014);e.exports=function(e){return n(e.length)}},283(e,t,r){"use strict";var n=r(9504),i=r(9039),a=r(4901),s=r(9297),o=r(3724),l=r(350).CONFIGURABLE,c=r(3706),u=r(1181),d=u.enforce,h=u.get,p=String,f=Object.defineProperty,g=n("".slice),m=n("".replace),v=n([].join),y=o&&!i(function(){return 8!==f(function(){},"length",{value:8}).length}),b=String(String).split("String"),w=e.exports=function(e,t,r){"Symbol("===g(p(t),0,7)&&(t="["+m(p(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!s(e,"name")||l&&e.name!==t)&&(o?f(e,"name",{value:t,configurable:!0}):e.name=t),y&&r&&s(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&s(r,"constructor")&&r.constructor?o&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=d(e);return s(n,"source")||(n.source=v(b,"string"==typeof t?t:"")),e};Function.prototype.toString=w(function(){return a(this)&&h(this).source||c(this)},"toString")},741(e){"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},2703(e,t,r){"use strict";var n=r(4576),i=r(9039),a=r(9504),s=r(655),o=r(3802).trim,l=r(7452),c=n.parseInt,u=n.Symbol,d=u&&u.iterator,h=/^[+-]?0x/i,p=a(h.exec),f=8!==c(l+"08")||22!==c(l+"0x16")||d&&!i(function(){c(Object(d))});e.exports=f?function(e,t){var r=o(s(e));return c(r,t>>>0||(p(h,r)?16:10))}:c},4213(e,t,r){"use strict";var n=r(3724),i=r(9504),a=r(9565),s=r(9039),o=r(1072),l=r(3717),c=r(8773),u=r(8981),d=r(7055),h=Object.assign,p=Object.defineProperty,f=i([].concat);e.exports=!h||s(function(){if(n&&1!==h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),i="abcdefghijklmnopqrst";return e[r]=7,i.split("").forEach(function(e){t[e]=e}),7!==h({},e)[r]||o(h({},t)).join("")!==i})?function(e,t){for(var r=u(e),i=arguments.length,s=1,h=l.f,p=c.f;i>s;)for(var g,m=d(arguments[s++]),v=h?f(o(m),h(m)):o(m),y=v.length,b=0;y>b;)g=v[b++],n&&!a(p,m,g)||(r[g]=m[g]);return r}:h},2360(e,t,r){"use strict";var n,i=r(8551),a=r(6801),s=r(8727),o=r(421),l=r(397),c=r(4055),u=r(6119),d="prototype",h="script",p=u("IE_PROTO"),f=function(){},g=function(e){return"<"+h+">"+e+"</"+h+">"},m=function(e){e.write(g("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;v="undefined"!=typeof document?document.domain&&n?m(n):(t=c("iframe"),r="java"+h+":",t.style.display="none",l.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F):m(n);for(var i=s.length;i--;)delete v[d][s[i]];return v()};o[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[d]=i(e),r=new f,f[d]=null,r[p]=e):r=v(),void 0===t?r:a.f(r,t)}},6801(e,t,r){"use strict";var n=r(3724),i=r(8686),a=r(4913),s=r(8551),o=r(5397),l=r(1072);t.f=n&&!i?Object.defineProperties:function(e,t){s(e);for(var r,n=o(t),i=l(t),c=i.length,u=0;c>u;)a.f(e,r=i[u++],n[r]);return e}},4913(e,t,r){"use strict";var n=r(3724),i=r(5917),a=r(8686),s=r(8551),o=r(6969),l=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",h="configurable",p="writable";t.f=n?a?function(e,t,r){if(s(e),t=o(t),s(r),"function"==typeof e&&"prototype"===t&&"value"in r&&p in r&&!r[p]){var n=u(e,t);n&&n[p]&&(e[t]=r.value,r={configurable:h in r?r[h]:n[h],enumerable:d in r?r[d]:n[d],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(s(e),t=o(t),s(r),i)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},7347(e,t,r){"use strict";var n=r(3724),i=r(9565),a=r(8773),s=r(6980),o=r(5397),l=r(6969),c=r(9297),u=r(5917),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=o(e),t=l(t),u)try{return d(e,t)}catch(e){}if(c(e,t))return s(!i(a.f,e,t),e[t])}},298(e,t,r){"use strict";var n=r(2195),i=r(5397),a=r(8480).f,s=r(7680),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"Window"===n(e)?function(e){try{return a(e)}catch(e){return s(o)}}(e):a(i(e))}},8480(e,t,r){"use strict";var n=r(1828),i=r(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},3717(e,t){"use strict";t.f=Object.getOwnPropertySymbols},2787(e,t,r){"use strict";var n=r(9297),i=r(4901),a=r(8981),s=r(6119),o=r(2211),l=s("IE_PROTO"),c=Object,u=c.prototype;e.exports=o?c.getPrototypeOf:function(e){var t=a(e);if(n(t,l))return t[l];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof c?u:null}},4124(e,t,r){"use strict";var n=r(9039),i=r(34),a=r(2195),s=r(5652),o=Object.isExtensible,l=n(function(){o(1)});e.exports=l||s?function(e){return!!i(e)&&((!s||"ArrayBuffer"!==a(e))&&(!o||o(e)))}:o},1625(e,t,r){"use strict";var n=r(9504);e.exports=n({}.isPrototypeOf)},1828(e,t,r){"use strict";var n=r(9504),i=r(9297),a=r(5397),s=r(9617).indexOf,o=r(421),l=n([].push);e.exports=function(e,t){var r,n=a(e),c=0,u=[];for(r in n)!i(o,r)&&i(n,r)&&l(u,r);for(;t.length>c;)i(n,r=t[c++])&&(~s(u,r)||l(u,r));return u}}
vendor: 2,388 bytes, line 46
46,1072(e,t,r){"use strict";var n=r(1828),i=r(8727);e.exports=Object.keys||function(e){return n(e,i)}},8773(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},2967(e,t,r){"use strict";var n=r(6706),i=r(34),a=r(7750),s=r(3506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return a(r),s(n),i(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0)},3179(e,t,r){"use strict";var n=r(2140),i=r(6955);e.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},4270(e,t,r){"use strict";var n=r(9565),i=r(4901),a=r(34),s=TypeError;e.exports=function(e,t){var r,o;if("string"===t&&i(r=e.toString)&&!a(o=n(r,e)))return o;if(i(r=e.valueOf)&&!a(o=n(r,e)))return o;if("string"!==t&&i(r=e.toString)&&!a(o=n(r,e)))return o;throw new s("Can't convert object to primitive value")}},5031(e,t,r){"use strict";var n=r(7751),i=r(9504),a=r(8480),s=r(3717),o=r(8551),l=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=a.f(o(e)),r=s.f;return r?l(t,r(e)):t}},6682(e,t,r){"use strict";var n=r(9565),i=r(8551),a=r(4901),s=r(2195),o=r(7323),l=TypeError;e.exports=function(e,t){var r=e.exec;if(a(r)){var c=n(r,e,t);return null!==c&&i(c),c}if("RegExp"===s(e))return n(o,e,t);throw new l("RegExp#exec called on incompatible receiver")}},7323(e,t,r){"use strict";var n,i,a=r(9565),s=r(9504),o=r(655),l=r(7979),c=r(8429),u=r(5745),d=r(2360),h=r(1181).get,p=r(3635),f=r(8814),g=u("native-string-replace",String.prototype.replace),m=RegExp.prototype.exec,v=m,y=s("".charAt),b=s("".indexOf),w=s("".replace),x=s("".slice),E=(i=/b*/g,a(m,n=/a/,"a"),a(m,i,"a"),0!==n.lastIndex||0!==i.lastIndex),S=c.BROKEN_CARET,A=void 0!==/()??/.exec("")[1];(E||A||S||p||f)&&(v=function(e){var t,r,n,i,s,c,u,p=this,f=h(p),_=o(e),T=f.raw;if(T)return T.lastIndex=p.lastIndex,t=a(v,T,_),p.lastIndex=T.lastIndex,t;var C=f.groups,P=S&&p.sticky,R=a(l,p),O=p.source,D=0,k=_;if(P&&(R=w(R,"y",""),-1===b(R,"g")&&(R+="g"),k=x(_,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==y(_,p.lastIndex-1))&&(O="(?: "+O+")",k=" "+k,D++),r=new RegExp("^(?:"+O+")",R)),A&&(r=new RegExp("^"+O+"$(?!\\s)",R)),E&&(n=p.lastIndex),i=a(m,P?r:p,k),P?i?(i.input=x(i.input,D),i[0]=x(i[0],D),i.index=
vendor: 10,152 bytes, line 46
46p.lastIndex,p.lastIndex+=i[0].length):p.lastIndex=0:E&&i&&(p.lastIndex=p.global?i.index+i[0].length:n),A&&i&&i.length>1&&a(g,i[0],r,function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(i[s]=void 0)}),i&&C)for(i.groups=c=d(null),s=0;s<C.length;s++)c[(u=C[s])[0]]=i[u[1]];return i}),e.exports=v},7979(e,t,r){"use strict";var n=r(8551);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},8429(e,t,r){"use strict";var n=r(9039),i=r(4576).RegExp,a=n(function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")}),s=a||n(function(){return!i("a","y").sticky}),o=a||n(function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")});e.exports={BROKEN_CARET:o,MISSED_STICKY:s,UNSUPPORTED_Y:a}},3635(e,t,r){"use strict";var n=r(9039),i=r(4576).RegExp;e.exports=n(function(){var e=i(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)})},8814(e,t,r){"use strict";var n=r(9039),i=r(4576).RegExp;e.exports=n(function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})},7750(e,t,r){"use strict";var n=r(4117),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},687(e,t,r){"use strict";var n=r(4913).f,i=r(9297),a=r(8227)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!i(e,a)&&n(e,a,{configurable:!0,value:t})}},6119(e,t,r){"use strict";var n=r(5745),i=r(3392),a=n("keys");e.exports=function(e){return a[e]||(a[e]=i(e))}},7629(e,t,r){"use strict";var n=r(6395),i=r(4576),a=r(9433),s="__core-js_shared__",o=e.exports=i[s]||a(s,{});(o.versions||(o.versions=[])).push({version:"3.41.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745(e,t,r){"use strict";var n=r(7629);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},8183(e,t,r){"use strict";var n=r(9504),i=r(1291),a=r(655),s=r(7750),o=n("".charAt),l=n("".charCodeAt),c=n("".slice),u=function(e){return function(t,r){var n,u,d=a(s(t)),h=i(r),p=d.length;return h<0||h>=p?e?"":void 0:(n=l(d,h))<55296||n>56319||h+1===p||(u=l(d,h+1))<56320||u>57343?e?o(d,h):n:e?c(d,h,h+2):u-56320+(n-55296<<10)+65536}};e.exports={codeAt:u(!1),charAt:u(!0)}},3802(e,t,r){"use strict";var n=r(9504),i=r(7750),a=r(655),s=r(7452),o=n("".replace),l=RegExp("^["+s+"]+"),c=RegExp("(^|[^"+s+"])["+s+"]+$"),u=function(e){return function(t){var r=a(i(t));return 1&e&&(r=o(r,l,"")),2&e&&(r=o(r,c,"$1")),r}};e.exports={start:u(1),end:u(2),trim:u(3)}},4495(e,t,r){"use strict";var n=r(9519),i=r(9039),a=r(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!i(function(){var e=Symbol("symbol detection");return!a(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},5610(e,t,r){"use strict";var n=r(1291),i=Math.max,a=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):a(r,t)}},5397(e,t,r){"use strict";var n=r(7055),i=r(7750);e.exports=function(e){return n(i(e))}},1291(e,t,r){"use strict";var n=r(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},8014(e,t,r){"use strict";var n=r(1291),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},8981(e,t,r){"use strict";var n=r(7750),i=Object;e.exports=function(e){return i(n(e))}},2777(e,t,r){"use strict";var n=r(9565),i=r(34),a=r(757),s=r(5966),o=r(4270),l=r(8227),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!i(e)||a(e))return e;var r,l=s(e,u);if(l){if(void 0===t&&(t="default"),r=n(l,e,t),!i(r)||a(r))return r;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),o(e,t)}},6969(e,t,r){"use strict";var n=r(2777),i=r(757);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},2140(e,t,r){"use strict";var n={};n[r(8227)("toStringTag")]="z",e.exports="[object z]"===String(n)},655(e,t,r){"use strict";var n=r(6955),i=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},6823(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392(e,t,r){"use strict";var n=r(9504),i=0,a=Math.random(),s=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++i+a,36)}},7040(e,t,r){"use strict";var n=r(4495);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686(e,t,r){"use strict";var n=r(3724),i=r(9039);e.exports=n&&i(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8622(e,t,r){"use strict";var n=r(4576),i=r(4901),a=n.WeakMap;e.exports=i(a)&&/native code/.test(String(a))},8227(e,t,r){"use strict";var n=r(4576),i=r(5745),a=r(9297),s=r(3392),o=r(4495),l=r(7040),c=n.Symbol,u=i("wks"),d=l?c.for||c:c&&c.withoutSetter||s;e.exports=function(e){return a(u,e)||(u[e]=o&&a(c,e)?c[e]:d("Symbol."+e)),u[e]}},7452(e){"use strict";e.exports="\t\n\v\f\r  áââââââ
ââââââ¯âã\u2028\u2029\ufeff"},2008(e,t,r){"use strict";var n=r(6518),i=r(9213).filter;n({target:"Array",proto:!0,forced:!r(597)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},3792(e,t,r){"use strict";var n=r(5397),i=r(6469),a=r(6269),s=r(1181),o=r(4913).f,l=r(1088),c=r(2529),u=r(6395),d=r(3724),h="Array Iterator",p=s.set,f=s.getterFor(h);e.exports=l(Array,"Array",function(e,t){p(this,{type:h,target:n(e),index:0,kind:t})},function(){var e=f(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case"keys":return c(r,!1);case"values":return c(t[r],!1)}return c([r,t[r]],!1)},"values");var g=a.Arguments=a.Array;if(i("keys"),i("values"),i("entries"),!u&&d&&"values"!==g.name)try{o(g,"name",{value:"values"})}catch(e){}},2712(e,t,r){"use strict";var n=r(6518),i=r(926).left,a=r(4598),s=r(9519);n({target:"Array",proto:!0,forced:!r(6193)&&s>79&&s<83||!a("reduce")},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},2010(e,t,r){"use strict";var n=r(3724),i=r(350).EXISTS,a=r(9504),s=r(2106),o=Function.prototype,l=a(o.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=a(c.exec);n&&!i&&s(o,"name",{configurable:!0,get:function(){try{return u(c,l(this))[1]}catch(e){return""}}})},9085(e,t,r){"use strict";var n=r(6518),i=r(4213);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},6099(e,t,r){"use strict";var n=r(2140),i=r(6840),a=r(3179);n||i(Object.prototype,"toString",a,{unsafe:!0})},8940(e,t,r){"use strict";var n=r(6518),i=r(2703);n({global:!0,forced:parseInt!==i},{parseInt:i})},7495(e,t,r){"use strict";var n=r(6518),i=r(7323);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},7764(e,t,r){"use strict";var n=r(8183).charAt,i=r(655),a=r(1181),s=r(1088),o=r(2529),l="String Iterator",c=a.set,u=a.getterFor(l);s(String,"String",function(e){c(this,{type:l,string:i(e),index:0})},function(){var e,t=u(this),r=t.string,i=t.index;return i>=r.length?o(void 0,!0):(e=n(r,i),t.index+=e.length,o(e,!1))})},1761(e,t,r){"use strict";var n=r(9565),i=r(9228),a=r(8551),s=r(4117),o=r(8014),l=r(655),c=r(7750),u=r(5966),d=r(7829),h=r(6682);i("match",function(e,t,r){return[function(t){var r=c(this),i=s(t)?void 0:u(t,e);return i?n(i,t,r):new RegExp(t)[e](l(r))},function(e){var n=a(this),i=l(e),s=r(t,n,i);if(s.done)return s.value;if(!n.global)return h(n,i);var c=n.unicode;n.lastIndex=0;for(var u,p=[],f=0;null!==(u=h(n,i));){var g=l(u[0]);p[f]=g,""===g&&(n.lastIndex=d(i,o(n.lastIndex),c)),f++}return 0===f?null:p}]})},5440(e,t,r){"use strict";var n=r(8745),i=r(9565),a=r(9504),s=r(9228),o=r(9039),l=r(8551),c=r(4901),u=r(4117),d=r(1291),h=r(8014),p=r(655),f=r(7750),g=r(7829),m=r(5966),v=r(2478),y=r(6682),b=r(8227)("replace"),w=Math.max,x=Math.min,E=a([].concat),S=a([].push),A=a("".indexOf),_=a("".slice),T=function(e){return void 0===e?e:String(e)},C="$0"==="a".replace(/./,"$0"),P=!!/./[b]&&""===/./[b]("a","$0");s("replace",function(e,t,r){var a=P?"$":"$0";return[function(e,r){var n=f(this),a=u(e)?void 0:m(e,b);return a?i(a,e,n,r):i(t,p(n),e,r)},function(e,i){var s=l(this),o=p(e);if("string"==typeof i&&-1===A(i,a)&&-1===A(i,"$<")){var u=r(t,s,o,i);if(u.done)return u.value}var f=c(i);f||(i=p(i));var m,b=s.global;b&&(m=s.unicode,s.lastIndex=0);for(var C,P=[];null!==(C=y(s,o))&&(S(P,C),b);){""===p(C[0])&&(s.lastIndex=g(o,h(s.lastIndex),m))}for(var R="",O=0,D=0;D<P.length;D++){for(var k,M=p((C=P[D])[0]),L=w(x(d(C.index),o.length),0),I=[],N=1;N<C.length;N++)S(I,T(C[N]));var j=C.groups;if(f){var F=E([M],I,L,o);void 0!==j&&S(F,j),k=p(n(i,void 0,F))}else k=v(M,o,L,I,j,i);L>=O&&(R+=_(o,O,L)+k,O=L+M.length)}return R+_(o,O)}]},!!o(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})||!C||P)},5746(e,t,r){"use strict";var n,i=r(2744),a=r(4576),s=r(9504),o=r(6279),l=r(3451),c=r(6468),u=r(4006),d=r(34),h=r(1181).enforce,p=r(9039),f=r(8622),g=Object,m=Array.isArray,v=g.isExtensible,y=g.isFrozen,b=g.isSealed,w=g.freeze,x=g.seal,E=!a.ActiveXObject&&"ActiveXObject"in a,S=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},A=c("WeakMap",S,u),_=A.prototype,T=s(_.set);if(f)if(E){n=u.getConstructor(S,"WeakMap",!0),l.enable();var C=s(_.delete),P=s(_.has),R=s(_.get);o(_,{delete:function(e){if(d(e)&&!v(e)){var t=h(this);return t.frozen||(t.frozen=new n),C(this,e)||t.frozen.delete(e)}return C(this,e)},has:function(e){if(d(e)&&!v(e)){var t=h(this);return t.frozen||(t.frozen=new n),P(this,e)||t.frozen.has(e)}return P(this,e)},get:function(e){if(d(e)&&!v(e)){var t=h(this);return t.frozen||(t.frozen=new n),P(this,e)?R(this,e):t.frozen.get(e)}return R(this,e)},set:function(e,t){if(d(e)&&!v(e)){var r=h(this);r.frozen||(r.frozen=new n),P(this,e)?T(this,e,t):r.frozen.set(e,t)}else T(this,e,t);return this}})}else i&&p(function(){var e=w([]);return T(new A,e,1),!y(e)})&&o(_,{set:function(e,t){var r;return m(e)&&(y(e)?r=w:b(e)&&(r=x)),T(this,e,t),r&&r(e),this}})}
46,3772(e,t,r){"use strict";r(5746)},2953(e,t,r){"use strict";var n=r(4576),i=r(7400),a=r(9296),s=r(3792),o=r(6699),l=r(687),c=r(8227)("iterator"),u=s.values,d=function(e,t){if(e){if(e[c]!==u)try{o(e,c,u)}catch(t){e[c]=u}if(l(e,t,!0),i[t])for(var r in s)if(e[r]!==s[r])try{o(e,r,s[r])}catch(t){e[r]=s[r]}}};for(var h in i)d(n[h]&&n[h].prototype,h);d(a,"DOMTokenList")},4081(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getUserLocale=t.getUserLocales=void 0;var i=n(r(119));function a(e){return"string"==typeof e}function s(e,t,r){return r.indexOf(e)===t}function o(e){return-1===e.indexOf(",")?e:e.split(",")}function l(e){if(!e)return e;if("C"===e||"posix"===e||"POSIX"===e)return"en-US";if(-1!==e.indexOf(".")){var t=e.split(".")[0];return l(void 0===t?"":t)}if(-1!==e.indexOf("@")){var r=e.split("@")[0];return l(void 0===r?"":r)}if(-1===e.indexOf("-")||(n=e).toLowerCase()!==n)return e;var n,i=e.split("-"),a=i[0],s=i[1],o=void 0===s?"":s;return"".concat(a,"-").concat(o.toUpperCase())}t.getUserLocales=(0,i.default)(function(e){var t=void 0===e?{}:e,r=t.useFallbackLocale,n=void 0===r||r,i=t.fallbackLocale,c=void 0===i?"en-US":i,u=[];if("undefined"!=typeof navigator){for(var d=[],h=0,p=navigator.languages||[];h<p.length;h++){var f=p[h];d=d.concat(o(f))}var g=navigator.language,m=g?o(g):g;u=u.concat(d,m)}return n&&u.push(c),u.filter(a).map(l).filter(s)},{cacheKey:JSON.stringify}),t.getUserLocale=(0,i.default)(function(e){return(0,t.getUserLocales)(e)[0]||null},{cacheKey:JSON.stringify}),t.default=t.getUserLocale},2562(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(4848),s=r(1594),o=i(r(1508)),l=i(r(8391)),c=i(r(3863)),u=i(r(1057)),d=i(r(6348)),h=i(r(7869)),p=r(6335),f=r(479),g="react-calendar",m=["century","decade","year","month"],v=["decade","year","month","day"],y=new Date;y.setFullYear(1,0,1),y.setHours(0,0,0,0);var b=new Date(864e13);function w(e){return e instanceof Date?e:new Date(e)}function x(e,t){return m.slice(m.indexOf(e),m.indexOf(t)+1)}function E(e,t,r){return e&&function(e,t,r){return-1!==x(t,r).indexOf(e)}(e,t,r)?e:r}function S(e){var t=m.indexOf(e);return v[t]}function A(e,t){var r=e.value,n=e.minDate,i=e.maxDate,a=e.maxDetail,s=function(e,t){var r=Array.isArray(e)?e[t]:e;if(!r)return null;var n=w(r);if(isNaN(n.getTime()))throw new Error("Invalid date: ".concat(e));return n}(r,t);if(!s)return null;var o=S(a),l=function(){switch(t){case 0:return(0,p.getBegin)(o,s);case 1:return(0,p.getEnd)(o,s);default:throw new Error("Invalid index value: ".concat(t))}}();return(0,f.between)(l,n,i)}var _=function(e){return A(e,0)},T=function(e){return A(e,1)},C=function(e){return[_,T].map(function(t){return t(e)})};function P(e){var t=e.maxDate,r=e.maxDetail,n=e.minDate,i=e.minDetail,a=e.value,s=E(e.view,i,r),o=_({value:a,minDate:n,maxDate:t,maxDetail:r})||new Date;return(0,p.getBegin)(s,o)}function R(e){return e&&(!Array.isArray(e)||1===e.length)}function O(e,t){return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}var D=(0,s.forwardRef)(function(e,t){var r,i=e.activeStartDate,f=e.allowPartialRange,m=e.calendarType,v=e.className,A=e.defaultActiveStartDate,D=e.defaultValue,k=e.defaultView,M=e.formatDay,L=e.formatLongDate,I=e.formatMonth,N=e.formatMonthYear,j=e.formatShortWeekday,F=e.formatWeekday,H=e.formatYear,B=e.goToRangeStartOnSelect,z=void 0===B||B,$=e.inputRef,U=e.locale,W=e.maxDate,V=void 0===W?b:W,q=e.maxDetail,Y=void 0===q?"month":q,G=e.minDate,X=void 0===G?y:G,K=e.minDetail,J=void 0===K?"century":K,Q=e.navigationAriaLabel,Z=e.navigationAriaLive,ee=e.navigationLabel,te=e.next2AriaLabel,re=e.next2Label,ne=e.nextAriaLabel,ie=e.nextLabel,ae=e.onActiveStartDateChange,se=e.onChange,oe=e.onClickDay,le=e.onClickDecade,ce=e.onClickMonth,ue=e.onClickWeekNumber,de=e.onClickYear,he=e.onDrillDown,pe=e.onDrillUp,fe=e.onViewChange,ge=e.prev2AriaLabel,me=e.prev2Label,ve=e.prevAriaLabel,ye=e.prevLabel,be=e.returnValue,we=void 0===be?"start":be,xe=e.selectRange,Ee=e.showDoubleView,Se=e.showFixedNumberOfWeeks,Ae=e.showNavigation,_e=void 0===Ae||Ae,Te=e.showNeighboringCentury,Ce=e.showNeighboringDecade,Pe=e.showNeighboringMonth,Re=void 0===Pe||Pe,Oe=e.showWeekNumbers,De=e.tileClassName,ke=e.tileContent,Me=e.tileDisabled,Le=e.value,Ie=e.view,Ne=(0,s.use
46State)(A),je=Ne[0],Fe=Ne[1],He=(0,s.useState)(null),Be=He[0],ze=He[1],$e=(0,s.useState)(Array.isArray(D)?D.map(function(e){return null!==e?w(e):null}):null!=D?w(D):null),Ue=$e[0],We=$e[1],Ve=(0,s.useState)(k),qe=Ve[0],Ye=Ve[1],Ge=i||je||function(e){var t=e.activeStartDate,r=e.defaultActiveStartDate,n=e.defaultValue,i=e.defaultView,a=e.maxDate,s=e.maxDetail,o=e.minDate,l=e.minDetail,c=e.value,u=e.view,d=E(u,l,s),h=t||r;return h?(0,p.getBegin)(d,h):P({maxDate:a,maxDetail:s,minDate:o,minDetail:l,value:c||n,view:u||i})}({activeStartDate:i,defaultActiveStartDate:A,defaultValue:D,defaultView:k,maxDate:V,maxDetail:Y,minDate:X,minDetail:J,value:Le,view:Ie}),Xe=(r=xe&&R(Ue)?Ue:void 0!==Le?Le:Ue)?Array.isArray(r)?r.map(function(e){return null!==e?w(e):null}):null!==r?w(r):null:null,Ke=S(Y),Je=E(Ie||qe,J,Y),Qe=x(J,Y),Ze=xe?Be:null,et=Qe.indexOf(Je)<Qe.length-1,tt=Qe.indexOf(Je)>0,rt=(0,s.useCallback)(function(e){return function(){switch(we){case"start":return _;case"end":return T;case"range":return C;default:throw new Error("Invalid returnValue.")}}()({maxDate:V,maxDetail:Y,minDate:X,value:e})},[V,Y,X,we]),nt=(0,s.useCallback)(function(e,t){Fe(e);var r={action:t,activeStartDate:e,value:Xe,view:Je};ae&&!O(Ge,e)&&ae(r)},[Ge,ae,Xe,Je]),it=(0,s.useCallback)(function(e,t){var r=function(){switch(Je){case"century":return le;case"decade":return de;case"year":return ce;case"month":return oe;default:throw new Error("Invalid view: ".concat(Je,"."))}}();r&&r(e,t)},[oe,le,ce,de,Je]),at=(0,s.useCallback)(function(e,t){if(et){it(e,t);var r=Qe[Qe.indexOf(Je)+1];if(!r)throw new Error("Attempted to drill down from the lowest view.");Fe(e),Ye(r);var n={action:"drillDown",activeStartDate:e,value:Xe,view:r};ae&&!O(Ge,e)&&ae(n),fe&&Je!==r&&fe(n),he&&he(n)}},[Ge,et,ae,it,he,fe,Xe,Je,Qe]),st=(0,s.useCallback)(function(){if(tt){var e=Qe[Qe.indexOf(Je)-1];if(!e)throw new Error("Attempted to drill up from the highest view.");var t=(0,p.getBegin)(e,Ge);Fe(t),Ye(e);var r={action:"drillUp",activeStartDate:t,value:Xe,view:e};ae&&!O(Ge,t)&&ae(r),fe&&Je!==e&&fe(r),pe&&pe(r)}},[Ge,tt,ae,pe,fe,Xe,Je,Qe]),ot=(0,s.useCallback)(function(e,t){var r=Xe;it(e,t);var n,i=xe&&!R(r);if(xe)if(i)n=(0,p.getBegin)(Ke,e);else{if(!r)throw new Error("previousValue is required");if(Array.isArray(r))throw new Error("previousValue must not be an array");n=(0,p.getValueRange)(Ke,r,e)}else n=rt(e);var a=!xe||i||z?P({maxDate:V,maxDetail:Y,minDate:X,minDetail:J,value:n,view:Je}):null;t.persist(),Fe(a),We(n);var s={action:"onChange",activeStartDate:a,value:n,view:Je};if(ae&&!O(Ge,a)&&ae(s),se)if(xe)if(R(n)){if(f){if(Array.isArray(n))throw new Error("value must not be an array");se([n||null,null],t)}}else se(n||null,t);else se(n||null,t)},[Ge,f,rt,z,V,Y,X,J,ae,se,it,xe,Xe,Ke,Je]);function lt(e){ze(e)}function ct(){ze(null)}function ut(e){var t={activeStartDate:e?(0,p.getBeginNext)(Je,Ge):(0,p.getBegin)(Je,Ge),hover:Ze,locale:U,maxDate:V,minDate:X,onClick:et?at:ot,onMouseOver:xe?lt:void 0,tileClassName:De,tileContent:ke,tileDisabled:Me,value:Xe,valueType:Ke};switch(Je){case"century":return(0,a.jsx)(c.default,n({formatYear:H,showNeighboringCentury:Te},t));case"decade":return(0,a.jsx)(u.default,n({formatYear:H,showNeighboringDecade:Ce},t));case"year":return(0,a.jsx)(d.default,n({formatMonth:I,formatMonthYear:N},t));case"month":return(0,a.jsx)(h.default,n({calendarType:m,formatDay:M,formatLongDate:L,formatShortWeekday:j,formatWeekday:F,onClickWeekNumber:ue,onMouseLeave:xe?ct:void 0,showFixedNumberOfWeeks:void 0!==Se?Se:Ee,showNeighboringMonth:Re,showWeekNumbers:Oe},t));default:throw new Error("Invalid view: ".concat(Je,"."))}}(0,s.useImperativeHandle)(t,function(){return{activeStartDate:Ge,drillDown:at,drillUp:st,onChange:ot,setActiveStartDate:nt,value:Xe,view:Je}},[Ge,at,st,ot,nt,Xe,Je]);var dt=Array.isArray(Xe)?Xe:[Xe];return(0,a.jsxs)("div",{className:(0,o.default)(g,xe&&1===dt.length&&"".concat(g,"--selectRange"),Ee&&"".concat(g,"--doubleView"),v),ref:$,children:[_e?(0,a.jsx)(l.default,{activeStartDate:Ge,drillUp:st,formatMonthYear:N,formatYear:H,locale:U,maxDate:V,minDate:X,navigationAriaLabel:Q,navigationAriaLive:Z,navigationLabel:ee,next2AriaLabel:te,next2Label:re,nextAriaLabel:ne,nextLabel:ie,prev2AriaLabel:ge,prev2Label:me,prevAriaLabel:ve,prevLabel:ye,setActiveStartDate:nt,showDoubleView:Ee,view:Je,views:Qe}):null,(0,a.jsxs)("div",{className:"".concat(g,"__viewContainer"),onBlur:xe?ct:void 0,onMouseLeave:xe?ct:void 0,children:[ut(),Ee?ut(!0):null]})]})});t.default=D},8391(e,t,r){"use strict";
46Object.defineProperty(t,"__esModule",{value:!0});var n=r(4848),i=r(4081),a=r(6335),s=r(3340),o="react-calendar__navigation";t.default=function(e){var t,r=e.activeStartDate,l=e.drillUp,c=e.formatMonthYear,u=void 0===c?s.formatMonthYear:c,d=e.formatYear,h=void 0===d?s.formatYear:d,p=e.locale,f=e.maxDate,g=e.minDate,m=e.navigationAriaLabel,v=void 0===m?"":m,y=e.navigationAriaLive,b=e.navigationLabel,w=e.next2AriaLabel,x=void 0===w?"":w,E=e.next2Label,S=void 0===E?"»":E,A=e.nextAriaLabel,_=void 0===A?"":A,T=e.nextLabel,C=void 0===T?"âº":T,P=e.prev2AriaLabel,R=void 0===P?"":P,O=e.prev2Label,D=void 0===O?"«":O,k=e.prevAriaLabel,M=void 0===k?"":k,L=e.prevLabel,I=void 0===L?"â¹":L,N=e.setActiveStartDate,j=e.showDoubleView,F=e.view,H=e.views.indexOf(F)>0,B="century"!==F,z=(0,a.getBeginPrevious)(F,r),$=B?(0,a.getBeginPrevious2)(F,r):void 0,U=(0,a.getBeginNext)(F,r),W=B?(0,a.getBeginNext2)(F,r):void 0,V=function(){if(z.getFullYear()<0)return!0;var e=(0,a.getEndPrevious)(F,r);return g&&g>=e}(),q=B&&function(){if($.getFullYear()<0)return!0;var e=(0,a.getEndPrevious2)(F,r);return g&&g>=e}(),Y=f&&f<U,G=B&&f&&f<W;function X(e){var t=function(){switch(F){case"century":return(0,a.getCenturyLabel)(p,h,e);case"decade":return(0,a.getDecadeLabel)(p,h,e);case"year":return h(p,e);case"month":return u(p,e);default:throw new Error("Invalid view: ".concat(F,"."))}}();return b?b({date:e,label:t,locale:p||(0,i.getUserLocale)()||void 0,view:F}):t}return(0,n.jsxs)("div",{className:o,children:[null!==D&&B?(0,n.jsx)("button",{"aria-label":R,className:"".concat(o,"__arrow ").concat(o,"__prev2-button"),disabled:q,onClick:function(){N($,"prev2")},type:"button",children:D}):null,null!==I&&(0,n.jsx)("button",{"aria-label":M,className:"".concat(o,"__arrow ").concat(o,"__prev-button"),disabled:V,onClick:function(){N(z,"prev")},type:"button",children:I}),(t="".concat(o,"__label"),(0,n.jsxs)("button",{"aria-label":v,"aria-live":y,className:t,disabled:!H,onClick:l,style:{flexGrow:1},type:"button",children:[(0,n.jsx)("span",{className:"".concat(t,"__labelText ").concat(t,"__labelText--from"),children:X(r)}),j?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"".concat(t,"__divider"),children:" â "}),(0,n.jsx)("span",{className:"".concat(t,"__labelText ").concat(t,"__labelText--to"),children:X(U)})]}):null]})),null!==C&&(0,n.jsx)("button",{"aria-label":_,className:"".concat(o,"__arrow ").concat(o,"__next-button"),disabled:Y,onClick:function(){N(U,"next")},type:"button",children:C}),null!==S&&B?(0,n.jsx)("button",{"aria-label":x,className:"".concat(o,"__arrow ").concat(o,"__next2-button"),disabled:G,onClick:function(){N(W,"next2")},type:"button",children:S}):null]})}},3863(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(4848),s=i(r(1585));t.default=function(e){return(0,a.jsx)("div",{className:"react-calendar__century-view",children:(0,a.jsx)(s.default,n({},e))})}},5138(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(4848),o=r(1229),l=a(r(5044)),c=r(6335),u=r(3340),d="react-calendar__century-view__decades__decade";t.default=function(e){var t=e.classes,r=void 0===t?[]:t,a=e.currentCentury,h=e.formatYear,p=void 0===h?u.formatYear:h,f=i(e,["classes","currentCentury","formatYear"]),g=f.date,m=f.locale,v=[];return r&&v.push.apply(v,r),d&&v.push(d),(0,o.getCenturyStart)(g).getFullYear()!==a&&v.push("".concat(d,"--neighboringCentury")),(0,s.jsx)(l.default,n({},f,{classes:v,maxDateTransform:o.getDecadeEnd,minDateTransform:o.getDecadeStart,view:"century",children:(0,c.getDecadeLabel)(m,p,g)}))}},1585(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}
46,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(4848),o=r(1229),l=a(r(4729)),c=a(r(5138)),u=r(6335);t.default=function(e){var t=e.activeStartDate,r=e.hover,a=e.showNeighboringCentury,d=e.value,h=e.valueType,p=i(e,["activeStartDate","hover","showNeighboringCentury","value","valueType"]),f=(0,u.getBeginOfCenturyYear)(t),g=f+(a?119:99);return(0,s.jsx)(l.default,{className:"react-calendar__century-view__decades",dateTransform:o.getDecadeStart,dateType:"decade",end:g,hover:r,renderTile:function(e){var r=e.date,a=i(e,["date"]);return(0,s.jsx)(c.default,n({},p,a,{activeStartDate:t,currentCentury:f,date:r}),r.getTime())},start:f,step:10,value:d,valueType:h})}},1057(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(4848),s=i(r(676));t.default=function(e){return(0,a.jsx)("div",{className:"react-calendar__decade-view",children:(0,a.jsx)(s.default,n({},e))})}},3185(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(4848),o=r(1229),l=a(r(5044)),c=r(3340),u="react-calendar__decade-view__years__year";t.default=function(e){var t=e.classes,r=void 0===t?[]:t,a=e.currentDecade,d=e.formatYear,h=void 0===d?c.formatYear:d,p=i(e,["classes","currentDecade","formatYear"]),f=p.date,g=p.locale,m=[];return r&&m.push.apply(m,r),u&&m.push(u),(0,o.getDecadeStart)(f).getFullYear()!==a&&m.push("".concat(u,"--neighboringDecade")),(0,s.jsx)(l.default,n({},p,{classes:m,maxDateTransform:o.getYearEnd,minDateTransform:o.getYearStart,view:"decade",children:h(g,f)}))}},676(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(4848),o=r(1229),l=a(r(4729)),c=a(r(3185)),u=r(6335);t.default=function(e){var t=e.activeStartDate,r=e.hover,a=e.showNeighboringDecade,d=e.value,h=e.valueType,p=i(e,["activeStartDate","hover","showNeighboringDecade","value","valueType"]),f=(0,u.getBeginOfDecadeYear)(t),g=f+(a?11:9);return(0,s.jsx)(l.default,{className:"react-calendar__decade-view__years",dateTransform:o.getYearStart,dateType:"year",end:g,hover:r,renderTile:function(e){var r=e.date,a=i(e,["date"]);return(0,s.jsx)(c.default,n({},p,a,{activeStartDate:t,currentDecade:f,date:r}),r.getTime())},start:f,value:d,valueType:h})}},7707(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};
46Object.defineProperty(t,"__esModule",{value:!0});var a=r(4848),s=r(1594);function o(e){return"".concat(e,"%")}t.default=function(e){var t=e.children,r=e.className,l=e.count,c=e.direction,u=e.offset,d=e.style,h=e.wrap,p=i(e,["children","className","count","direction","offset","style","wrap"]);return(0,a.jsx)("div",n({className:r,style:n({display:"flex",flexDirection:c,flexWrap:h?"wrap":"nowrap"},d)},p,{children:s.Children.map(t,function(e,t){var r=u&&0===t?o(100*u/l):null;return(0,s.cloneElement)(e,n(n({},e.props),{style:{flexBasis:o(100/l),flexShrink:0,flexGrow:0,overflow:"hidden",marginLeft:r,marginInlineStart:r,marginInlineEnd:0}}))})}))}},7869(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(4848),o=a(r(1508)),l=a(r(15)),c=a(r(3871)),u=a(r(2188)),d=r(821);t.default=function(e){var t=e.activeStartDate,r=e.locale,a=e.onMouseLeave,h=e.showFixedNumberOfWeeks,p=e.calendarType,f=void 0===p?function(e){if(e)for(var t=0,r=Object.entries(d.CALENDAR_TYPE_LOCALES);t<r.length;t++){var n=r[t],i=n[0];if(n[1].includes(e))return i}return d.CALENDAR_TYPES.ISO_8601}(r):p,g=e.formatShortWeekday,m=e.formatWeekday,v=e.onClickWeekNumber,y=e.showWeekNumbers,b=i(e,["calendarType","formatShortWeekday","formatWeekday","onClickWeekNumber","showWeekNumbers"]),w="react-calendar__month-view";return(0,s.jsx)("div",{className:(0,o.default)(w,y?"".concat(w,"--weekNumbers"):""),children:(0,s.jsxs)("div",{style:{display:"flex",alignItems:"flex-end"},children:[y?(0,s.jsx)(u.default,{activeStartDate:t,calendarType:f,onClickWeekNumber:v,onMouseLeave:a,showFixedNumberOfWeeks:h}):null,(0,s.jsxs)("div",{style:{flexGrow:1,width:"100%"},children:[(0,s.jsx)(c.default,{calendarType:f,formatShortWeekday:g,formatWeekday:m,locale:r,onMouseLeave:a}),(0,s.jsx)(l.default,n({calendarType:f},b))]})]})})}},8707(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(4848),o=r(1229),l=a(r(5044)),c=r(6335),u=r(3340),d="react-calendar__month-view__days__day";t.default=function(e){var t=e.calendarType,r=e.classes,a=void 0===r?[]:r,h=e.currentMonthIndex,p=e.formatDay,f=void 0===p?u.formatDay:p,g=e.formatLongDate,m=void 0===g?u.formatLongDate:g,v=i(e,["calendarType","classes","currentMonthIndex","formatDay","formatLongDate"]),y=v.date,b=v.locale,w=[];return a&&w.push.apply(w,a),d&&w.push(d),(0,c.isWeekend)(y,t)&&w.push("".concat(d,"--weekend")),y.getMonth()!==h&&w.push("".concat(d,"--neighboringMonth")),(0,s.jsx)(l.default,n({},v,{classes:w,formatAbbr:m,maxDateTransform:o.getDayEnd,minDateTransform:o.getDayStart,view:"month",children:f(b,y)}))}},15(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}
46,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(4848),o=r(1229),l=a(r(4729)),c=a(r(8707)),u=r(6335);t.default=function(e){var t=e.activeStartDate,r=e.calendarType,a=e.hover,d=e.showFixedNumberOfWeeks,h=e.showNeighboringMonth,p=e.value,f=e.valueType,g=i(e,["activeStartDate","calendarType","hover","showFixedNumberOfWeeks","showNeighboringMonth","value","valueType"]),m=(0,o.getYear)(t),v=(0,o.getMonth)(t),y=d||h,b=(0,u.getDayOfWeek)(t,r),w=y?0:b,x=1+(y?-b:0),E=function(){if(d)return x+42-1;var e=(0,o.getDaysInMonth)(t);if(h){var n=new Date;return n.setFullYear(m,v,e),n.setHours(0,0,0,0),e+(7-(0,u.getDayOfWeek)(n,r)-1)}return e}();return(0,s.jsx)(l.default,{className:"react-calendar__month-view__days",count:7,dateTransform:function(e){var t=new Date;return t.setFullYear(m,v,e),(0,o.getDayStart)(t)},dateType:"day",hover:a,end:E,renderTile:function(e){var a=e.date,o=i(e,["date"]);return(0,s.jsx)(c.default,n({},g,o,{activeStartDate:t,calendarType:r,currentMonthIndex:v,date:a}),a.getTime())},offset:w,start:x,value:p,valueType:f})}},73(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0});var a=r(4848),s="react-calendar__tile";t.default=function(e){var t=e.onClickWeekNumber,r=e.weekNumber,o=(0,a.jsx)("span",{children:r});if(t){var l=e.date,c=e.onClickWeekNumber,u=e.weekNumber,d=i(e,["date","onClickWeekNumber","weekNumber"]);return(0,a.jsx)("button",n({},d,{className:s,onClick:function(e){return c(u,l,e)},type:"button",children:o}))}return e.date,e.onClickWeekNumber,e.weekNumber,d=i(e,["date","onClickWeekNumber","weekNumber"]),(0,a.jsx)("div",n({},d,{className:s,children:o}))}},2188(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(4848),a=r(1229),s=n(r(73)),o=n(r(7707)),l=r(6335);t.default=function(e){var t=e.activeStartDate,r=e.calendarType,n=e.onClickWeekNumber,c=e.onMouseLeave,u=e.showFixedNumberOfWeeks,d=function(){if(u)return 6;var e=(0,a.getDaysInMonth)(t)-(7-(0,l.getDayOfWeek)(t,r));return 1+Math.ceil(e/7)}(),h=function(){for(var e=(0,a.getYear)(t),n=(0,a.getMonth)(t),i=(0,a.getDate)(t),s=[],o=0;o<d;o+=1)s.push((0,l.getBeginOfWeek)(new Date(e,n,i+7*o),r));return s}(),p=h.map(function(e){return(0,l.getWeekNumber)(e,r)});return(0,i.jsx)(o.default,{className:"react-calendar__month-view__weekNumbers",count:d,direction:"column",onFocus:c,onMouseOver:c,style:{flexBasis:"calc(100% * (1 / 8)",flexShrink:0},children:p.map(function(e,t){var r=h[t];if(!r)throw new Error("date is not defined");return(0,i.jsx)(s.default,{date:r,onClickWeekNumber:n,weekNumber:e},e)})})}},3871(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(4848),a=n(r(1508)),s=r(1229),o=n(r(7707)),l=r(6335),c=r(3340),u="react-calendar__month-view__weekdays",d="".concat(u,"__weekday");t.default=function(e){for(var t=e.calendarType,r=e.formatShortWeekday,n=void 0===r?c.formatShortWeekday:r,h=e.formatWeekday,p=void 0===h?c.formatWeekday:h,f=e.locale,g=e.onMouseLeave,m=new Date,v=(0,s.getMonthStart)(m),y=(0,s.getYear)(v),b=(0,s.getMonth)(v),w=[],x=1;x<=7;x+=1){var E=new Date(y,b,x-(0,l.getDayOfWeek)(v,t)),S=p(f,E);w.push((0,i.jsx)("div",{className:(0,a.default)(d,(0,l.isCurrentDayOfWeek)(E)&&"".concat(d,"--current"),(0,l.isWeekend)(E,t)&&"".concat(d,"--weekend")),children:(0,i.jsx)("abbr",{"aria-label":S,title:S,children:n(f,E).replace(".","")})},x))}return(0,i.jsx)(o.default,{className:u,count:7,onFocus:g,onMouseOver:g,children:w})}},5044(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
46dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(4848),a=r(1594),s=n(r(1508));t.default=function(e){var t=e.activeStartDate,r=e.children,n=e.classes,o=e.date,l=e.formatAbbr,c=e.locale,u=e.maxDate,d=e.maxDateTransform,h=e.minDate,p=e.minDateTransform,f=e.onClick,g=e.onMouseOver,m=e.style,v=e.tileClassName,y=e.tileContent,b=e.tileDisabled,w=e.view,x=(0,a.useMemo)(function(){return"function"==typeof v?v({activeStartDate:t,date:o,view:w}):v},[t,o,v,w]),E=(0,a.useMemo)(function(){return"function"==typeof y?y({activeStartDate:t,date:o,view:w}):y},[t,o,y,w]);return(0,i.jsxs)("button",{className:(0,s.default)(n,x),disabled:h&&p(h)>o||u&&d(u)<o||b&&b({activeStartDate:t,date:o,view:w}),onClick:f?function(e){return f(o,e)}:void 0,onFocus:g?function(){return g(o)}:void 0,onMouseOver:g?function(){return g(o)}:void 0,style:m,type:"button",children:[l?(0,i.jsx)("abbr",{"aria-label":l(c,o),children:r}):r,E]})}},4729(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(4848),a=n(r(7707)),s=r(479);t.default=function(e){for(var t=e.className,r=e.count,n=void 0===r?3:r,o=e.dateTransform,l=e.dateType,c=e.end,u=e.hover,d=e.offset,h=e.renderTile,p=e.start,f=e.step,g=void 0===f?1:f,m=e.value,v=e.valueType,y=[],b=p;b<=c;b+=g){var w=o(b);y.push(h({classes:(0,s.getTileClasses)({date:w,dateType:l,hover:u,value:m,valueType:v}),date:w}))}return(0,i.jsx)(a.default,{className:t,count:n,offset:d,wrap:!0,children:y})}},6348(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(4848),s=i(r(3572));t.default=function(e){return(0,a.jsx)("div",{className:"react-calendar__year-view",children:(0,a.jsx)(s.default,n({},e))})}},1169(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(4848),l=r(1229),c=s(r(5044)),u=r(3340);t.default=function(e){var t=e.classes,r=void 0===t?[]:t,s=e.formatMonth,d=void 0===s?u.formatMonth:s,h=e.formatMonthYear,p=void 0===h?u.formatMonthYear:h,f=i(e,["classes","formatMonth","formatMonthYear"]),g=f.date,m=f.locale;return(0,o.jsx)(c.default,n({},f,{classes:a(a([],r,!0),["react-calendar__year-view__months__month"],!1),formatAbbr:p,maxDateTransform:l.getMonthEnd,minDateTransform:l.getMonthStart,view:"year",children:d(m,g)}))}},3572(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}
46,a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(4848),o=r(1229),l=a(r(4729)),c=a(r(1169));t.default=function(e){var t=e.activeStartDate,r=e.hover,a=e.value,u=e.valueType,d=i(e,["activeStartDate","hover","value","valueType"]),h=(0,o.getYear)(t);return(0,s.jsx)(l.default,{className:"react-calendar__year-view__months",dateTransform:function(e){var t=new Date;return t.setFullYear(h,e,1),(0,o.getMonthStart)(t)},dateType:"month",end:11,hover:r,renderTile:function(e){var r=e.date,a=i(e,["date"]);return(0,s.jsx)(c.default,n({},d,a,{activeStartDate:t,date:r}),r.getTime())},start:0,value:a,valueType:u})}},8122(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.YearView=t.Navigation=t.MonthView=t.DecadeView=t.CenturyView=t.Calendar=void 0;var i=n(r(2562));t.Calendar=i.default;var a=n(r(3863));t.CenturyView=a.default;var s=n(r(1057));t.DecadeView=s.default;var o=n(r(7869));t.MonthView=o.default;var l=n(r(8391));t.Navigation=l.default;var c=n(r(6348));t.YearView=c.default,t.default=i.default},821(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.WEEKDAYS=t.CALENDAR_TYPE_LOCALES=t.CALENDAR_TYPES=void 0,t.CALENDAR_TYPES={GREGORY:"gregory",HEBREW:"hebrew",ISLAMIC:"islamic",ISO_8601:"iso8601"},t.CALENDAR_TYPE_LOCALES=((r={})[t.CALENDAR_TYPES.GREGORY]=["en-CA","en-US","es-AR","es-BO","es-CL","es-CO","es-CR","es-DO","es-EC","es-GT","es-HN","es-MX","es-NI","es-PA","es-PE","es-PR","es-SV","es-VE","pt-BR"],r[t.CALENDAR_TYPES.HEBREW]=["he","he-IL"],r[t.CALENDAR_TYPES.ISLAMIC]=["ar","ar-AE","ar-BH","ar-DZ","ar-EG","ar-IQ","ar-JO","ar-KW","ar-LY","ar-OM","ar-QA","ar-SA","ar-SD","ar-SY","ar-YE","dv","dv-MV","ps","ps-AR"],r),t.WEEKDAYS=[0,1,2,3,4,5,6]},3340(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.formatYear=t.formatWeekday=t.formatShortWeekday=t.formatMonthYear=t.formatMonth=t.formatLongDate=t.formatDay=t.formatDate=void 0;var i=n(r(4081)),a=new Map;function s(e){return function(t,r){return function(e){return function(t,r){var n=t||(0,i.default)();a.has(n)||a.set(n,new Map);var s=a.get(n);return s.has(e)||s.set(e,new Intl.DateTimeFormat(n||void 0,e).format),s.get(e)(r)}}(e)(t,function(e){var t=new Date(e);return new Date(t.setHours(12))}(r))}}t.formatDate=s({day:"numeric",month:"numeric",year:"numeric"}),t.formatDay=s({day:"numeric"}),t.formatLongDate=s({day:"numeric",month:"long",year:"numeric"}),t.formatMonth=s({month:"long"}),t.formatMonthYear=s({month:"long",year:"numeric"}),t.formatShortWeekday=s({weekday:"short"}),t.formatWeekday=s({weekday:"long"}),t.formatYear=s({year:"numeric"})},6335(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWeekend=t.isCurrentDayOfWeek=t.getDecadeLabel=t.getCenturyLabel=t.getValueRange=t.getRange=t.getEndPrevious2=t.getEndPrevious=t.getEnd=t.getBeginNext2=t.getBeginPrevious2=t.getBeginNext=t.getBeginPrevious=t.getBegin=t.getWeekNumber=t.getBeginOfWeek=t.getBeginOfDecadeYear=t.getBeginOfCenturyYear=t.getDayOfWeek=void 0;var n=r(1229),i=r(821),a=r(3340),s=i.WEEKDAYS[0],o=i.WEEKDAYS[5],l=i.WEEKDAYS[6];function c(e,t){void 0===t&&(t=i.CALENDAR_TYPES.ISO_8601);var r=e.getDay();switch(t){case i.CALENDAR_TYPES.ISO_8601:return(r+6)%7;case i.CALENDAR_TYPES.ISLAMIC:return(r+1)%7;case i.CALENDAR_TYPES.HEBREW:case i.CALENDAR_TYPES.GREGORY:return r;default:throw new Error("Unsupported calendar type.")}}function u(e,t){void 0===t&&(t=i.CALENDAR_TYPES.ISO_8601);var r=(0,n.getYear)(e),a=(0,n.getMonth)(e),s=e.getDate()-c(e,t);return new Date(r,a,s)}function d(e,t){switch(e){case"century":return(0,n.getCenturyStart)(t);case"decade":return(0,n.getDecadeStart)(t);case"year":return(0,n.getYearStart)(t);case"month":return(0,n.getMonthStart)(t);case"day":return(0,n.getDayStart)(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function h(e,t){switch(e){case"century":return(0,n.getCenturyEnd)(t);case"decade":return(0,n.getDecadeEnd)(t);case"year":return(0,n.getYearEnd)(t);case"month":return(0,n.getMonthEnd)(t);case"day":return(0,n.getDayEnd)(t);default:throw new Error("Invalid rangeType: ".concat(e))}}function p(e,t,r){return void 0===t&&(t=a.formatYear),r.map(function(r){return t(e,r)}).join(" â ")}t.getDayOfWeek=c,t.getBeginOfCenturyYear=function(e){var t=(0,n.getCenturyStart)(e);return(0,n.getYear)(t)},t.getBeginOfDecadeYear=function(e){var t=(0,n.getDecadeStart)(e);return(0,n.getYear)(t)},t.getBeginOfWeek=u,t.getWeekNumber=function(e,t){void 0===t&&(t=i.CALENDAR_TYPES.ISO_8601);var r,a=t===i.CALENDAR_TYPES.GREGORY?i.CALENDAR_TYPES.GREGORY:i.CALENDAR_TYPES.ISO_8601,s=u(e,t),o=(0,n.getYear)(e)+1;do{r=u(new Date(o,0,a===i.CALENDAR_TYPES.ISO_8601?4:1),t),o-=1}while(e<r);return Math.round((s.getTime()-r.getTime())/6048e5)+1},t.getBegin=d,t.getBeginPrevious=function(e,t){switch(e){case"century":return(0,n.getPreviousCenturyStart)(t);case"decade":return(0,n.getPreviousDecadeStart)(t);case"year":return(0,n.getPreviousYearStart)(t);case"month":return(0,n.getPreviousMonthStart)(t);default:throw new Error("Invalid rangeType: ".concat(e))}},t.getBeginNext=function(e,t){switch(e){case"century":return(0,n.getNextCenturyStart)(t);case"decade":return(0,n.getNextDecadeStart)(t);case"year":return(0,n.getNextYearStart)(t);case"month":return(0,n.getNextMonthStart)(t);default:throw new Error("Invalid rangeType: ".concat(e))}},t.getBeginPrevious2=function(e,t){switch(e){case"decade":return(0,n.getPreviousDecadeStart)(t,-100);case"year":return(0,n.getPreviousYearStart)(t,-10);case"month":return(0,n.getPreviousMonthStart)(t,-12);default:throw new Error("Invalid rangeType: ".concat(e))}},t.getBeginNext2=function(e,t){switch(e){case"decade":return(0,n.getNextDecadeStart)(t,100);case"year":return(0,n.getNextYearStart)(t,10);case"month":return(0,n.getNextMonthStart)(t,12);default:throw new Error("Invalid rangeType: ".concat(e))}},t.getEnd=h,t.getEndPrevious=function(e,t){switch(e){case"century":return(0,n.getPreviousCenturyEnd)(t);case"decade":return(0,n.getPreviousDecadeEnd)(t);case"year":return(0,n.getPreviousYearEnd)(t);case"month":return(0,n.getPreviousMonthEnd)(t);default:throw new Error("Invalid rangeType: ".concat(e))}},t.getEndPrevious2=function(e,t){switch(e){case"decade":return(0,n.getPreviousDecadeEnd)(t,-100);case"year":return(0,n.getPreviousYearEnd)(t,-10);case"month":return(0,n.getPreviousMonthEnd)(t,-12);default:throw new Error("Invalid rangeType: ".concat(e))}},t.getRange=function(e,t){switch(e){case"century":return(0,n.getCenturyRange)(t);case"decade":return(0,n.getDecadeRange)(t);case"year":return(0,n.getYearRange)(t);case"month":return(0,n.getMonthRange)(t);case"day":return(0,n.getDayRange)(t);default:throw new Error("Invalid rangeType: ".concat(e))}},t.getValueRange=function(e,t,r){var n=[t,r].sort(function(e,t){return e.getTime()-t.getTime()});return[d(e,n[0]),h(e,n[1])]},t.getCenturyLabel=function(e,t,r){return p(e,t,(0,n.getCenturyRange)(r))},t.getDecadeLabel=function(e,t,r){return p(e,t,(0,n.getDecadeRange)(r))},t.isCurrentDayOfWeek=function(e){return e.getDay()===(new Date).getDay()},t.isWeekend=function(e,t){void 0===t&&(t=i.CALENDAR_TYPES.ISO_8601);var r=e.getDay();switch(t){case i.CALENDAR_TYPES.ISLAMIC:case i.CALENDAR_TYPES.HEBREW:return r===o||r===l;case i.CALENDAR_TYPES.ISO_8601:case i.CALENDAR_TYPES.GREGORY:return r===l||r===s;default:throw new Error("Unsupported calendar type.")}}},479(e,t,r){"use strict";
46Object.defineProperty(t,"__esModule",{value:!0}),t.getTileClasses=t.doRangesOverlap=t.isRangeWithinRange=t.isValueWithinRange=t.between=void 0;var n=r(6335);function i(e,t){return t[0]<=e&&t[1]>=e}function a(e,t){return e[0]<=t[0]&&e[1]>=t[1]}function s(e,t){return i(e[0],t)||i(e[1],t)}function o(e,t,r){var n=[];if(s(t,e)){n.push(r);var a=i(e[0],t),o=i(e[1],t);a&&n.push("".concat(r,"Start")),o&&n.push("".concat(r,"End")),a&&o&&n.push("".concat(r,"BothEnds"))}return n}t.between=function(e,t,r){return t&&t>e?t:r&&r<e?r:e},t.isValueWithinRange=i,t.isRangeWithinRange=a,t.doRangesOverlap=s,t.getTileClasses=function(e){if(!e)throw new Error("args is required");var t=e.value,r=e.date,l=e.hover,c="react-calendar__tile",u=[c];if(!r)return u;var d=new Date,h=function(){if(Array.isArray(r))return r;var t=e.dateType;if(!t)throw new Error("dateType is required when date is not an array of two dates");return(0,n.getRange)(t,r)}();if(i(d,h)&&u.push("".concat(c,"--now")),!t||!function(e){return Array.isArray(e)?null!==e[0]&&null!==e[1]:null!==e}(t))return u;var p=function(){if(Array.isArray(t))return t;var r=e.valueType;if(!r)throw new Error("valueType is required when value is not an array of two dates");return(0,n.getRange)(r,t)}();a(p,h)?u.push("".concat(c,"--active")):s(p,h)&&u.push("".concat(c,"--hasActive"));var f=o(p,h,"".concat(c,"--range"));u.push.apply(u,f);var g=Array.isArray(t)?t:[t];if(l&&1===g.length){var m=o(l>p[0]?[p[0],l]:[l,p[0]],h,"".concat(c,"--hover"));u.push.apply(u,m)}return u}},9396(e,t,r){"use strict";function n(e,t,...r){if("undefined"!=typeof process&&void 0===t)throw new Error("invariant requires an error message argument");if(!e){let e;if(void 0===t)e=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let n=0;e=new Error(t.replace(/%s/g,function(){return r[n++]})),e.name="Invariant Violation"}throw e.framesToPop=1,e}}r.d(t,{V:()=>n})},1670(e,t,r){"use strict";function n(e,t,r,n){let i=r?r.call(n,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;const a=Object.keys(e),s=Object.keys(t);if(a.length!==s.length)return!1;const o=Object.prototype.hasOwnProperty.bind(t);for(let s=0;s<a.length;s++){const l=a[s];if(!o(l))return!1;const c=e[l],u=t[l];if(i=r?r.call(n,c,u,l):void 0,!1===i||void 0===i&&c!==u)return!1}return!0}r.d(t,{b:()=>n})},2300(e,t,r){"use strict";r.d(t,{Ik:()=>T,U2:()=>S,eV:()=>A,lr:()=>_,nf:()=>P,v8:()=>C});var n,i=e=>{throw TypeError(e)},a=(e,t,r)=>t.has(e)||i("Cannot "+r),s=(e,t,r)=>(a(e,t,"read from private field"),r?r.call(e):t.get(e)),o=(e,t,r)=>t.has(e)?i("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),l=(e,t,r,n)=>(a(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),c=class{constructor(){o(this,n),this.register=e=>{s(this,n).push(e)},this.unregister=e=>{for(;-1!==s(this,n).indexOf(e);)s(this,n).splice(s(this,n).indexOf(e),1)},this.backendChanged=e=>{for(let t of s(this,n))t.backendChanged(e)},l(this,n,[])}};n=new WeakMap;var u,d,h,p,f,g,m,v,y,b,w,x=class e{constructor(t,r,n){if(o(this,u),o(this,d),o(this,h),o(this,p),o(this,f),o(this,g,(e,t,r)=>{if(!r.backend)throw new Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(r)}`);let n=r.backend(e,t,r.options),i=r.id,a=!r.id&&n&&n.constructor;if(a&&(i=n.constructor.name),!i)throw new Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(r)}\n see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);if(a&&console.warn("Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.\n This might be unsupported in the future, please specify 'id' explicitely for every backend."),s(this,h)[i])throw new Error(`You must specify a unique 'id' property in your Backend entry:\n ${JSON.stringify(r)} (conflicts with: ${JSON.stringify(s(this,h)[i])})`);return{id:i,instance:n,preview:r.preview??!1,transition:r.transition,skipDispatchOnTransition:r.skipDispatchOnTransition??!1}}),this.setup=()=>
46{if(!(typeof window>"u")){if(e.isSetUp)throw new Error("Cannot have two MultiBackends at the same time.");e.isSetUp=!0,s(this,m).call(this,window),s(this,h)[s(this,u)].instance.setup()}},this.teardown=()=>{typeof window>"u"||(e.isSetUp=!1,s(this,v).call(this,window),s(this,h)[s(this,u)].instance.teardown())},this.connectDragSource=(e,t,r)=>s(this,w).call(this,"connectDragSource",e,t,r),this.connectDragPreview=(e,t,r)=>s(this,w).call(this,"connectDragPreview",e,t,r),this.connectDropTarget=(e,t,r)=>s(this,w).call(this,"connectDropTarget",e,t,r),this.profile=()=>s(this,h)[s(this,u)].instance.profile(),this.previewEnabled=()=>s(this,h)[s(this,u)].preview,this.previewsList=()=>s(this,d),this.backendsList=()=>s(this,p),o(this,m,e=>{for(let t of s(this,p))t.transition&&e.addEventListener(t.transition.event,s(this,y))}),o(this,v,e=>{for(let t of s(this,p))t.transition&&e.removeEventListener(t.transition.event,s(this,y))}),o(this,y,e=>{let t=s(this,u);if(s(this,p).some(t=>!(t.id===s(this,u)||!t.transition||!t.transition.check(e))&&(l(this,u,t.id),!0)),s(this,u)!==t){s(this,h)[t].instance.teardown();for(let[e,t]of Object.entries(s(this,f)))t.unsubscribe(),t.unsubscribe=s(this,b).call(this,t.func,...t.args);s(this,d).backendChanged(this);let r=s(this,h)[s(this,u)];if(r.instance.setup(),r.skipDispatchOnTransition)return;let n=new(0,e.constructor)(e.type,e);e.target?.dispatchEvent(n)}}),o(this,b,(e,t,r,n)=>s(this,h)[s(this,u)].instance[e](t,r,n)),o(this,w,(e,t,r,n)=>{let i=`${e}_${t}`,a=s(this,b).call(this,e,t,r,n);return s(this,f)[i]={func:e,args:[t,r,n],unsubscribe:a},()=>{s(this,f)[i].unsubscribe(),delete s(this,f)[i]}}),!n||!n.backends||n.backends.length<1)throw new Error("You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)\n see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx");l(this,d,new c),l(this,h,{}),l(this,p,[]);for(let e of n.backends){let n=s(this,g).call(this,t,r,e);s(this,h)[n.id]=n,s(this,p).push(n)}l(this,u,s(this,p)[0].id),l(this,f,{})}};u=new WeakMap,d=new WeakMap,h=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,w=new WeakMap,x.isSetUp=!1;var E=x,S=(e,t,r)=>new E(e,t,r),A=(e,t)=>({event:e,check:t}),_=A("touchstart",e=>{let t=e;return null!==t.touches&&void 0!==t.touches}),T=A("dragstart",e=>-1!==e.type.indexOf("drag")||-1!==e.type.indexOf("drop")),C=A("mousedown",e=>-1===e.type.indexOf("touch")&&-1!==e.type.indexOf("mouse")),P=A("pointerdown",e=>"mouse"===e.pointerType)},4444(e,t,r){"use strict";r.r(t),r.d(t,{HTML5toTouch:()=>N});var n={};function i(e){let t=null;return()=>(null==t&&(t=e()),t)}r.r(n),r.d(n,{FILE:()=>o,HTML:()=>u,TEXT:()=>c,URL:()=>l});class a{enter(e){const t=this.entered.length;return this.entered=function(e,t){const r=new Set,n=e=>r.add(e);e.forEach(n),t.forEach(n);const i=[];return r.forEach(e=>i.push(e)),i}(this.entered.filter(t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e))),[e]),0===t&&this.entered.length>0}leave(e){const t=this.entered.length;var r,n;return this.entered=(r=this.entered.filter(this.isNodeInDocument),n=e,r.filter(e=>e!==n)),t>0&&0===this.entered.length}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class s{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get:()=>(console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null)})})}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach(r=>{const n=this.config.exposeProperties[r];null!=n&&(t[r]={value:n(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const o="__NATIVE_FILE__",l="__NATIVE_URL__",c="__NATIVE_TEXT__",u="__NATIVE_HTML__";function d(e,t,r){const n=t.reduce((t,r)=>t||e.getData(r),"");return null!=n?n:r}const h={[o]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[u]:{exposeProperties:{html:(e,t)=>
vendor: 13,424 bytes, line 46
46d(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[l]:{exposeProperties:{urls:(e,t)=>d(e,t,"").split("\n"),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[c]:{exposeProperties:{text:(e,t)=>d(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function p(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(h).filter(e=>{const r=h[e];return!!(null==r?void 0:r.matchesTypes)&&r.matchesTypes.some(e=>t.indexOf(e)>-1)})[0]||null}const f=i(()=>/firefox/i.test(navigator.userAgent)),g=i(()=>Boolean(window.safari));class m{interpolate(e){const{xs:t,ys:r,c1s:n,c2s:i,c3s:a}=this;let s=t.length-1;if(e===t[s])return r[s];let o,l=0,c=a.length-1;for(;l<=c;){o=Math.floor(.5*(l+c));const n=t[o];if(n<e)l=o+1;else{if(!(n>e))return r[o];c=o-1}}s=Math.max(0,c);const u=e-t[s],d=u*u;return r[s]+n[s]*u+i[s]*d+a[s]*u*d}constructor(e,t){const{length:r}=e,n=[];for(let e=0;e<r;e++)n.push(e);n.sort((t,r)=>e[t]<e[r]?-1:1);const i=[],a=[],s=[];let o,l;for(let n=0;n<r-1;n++)o=e[n+1]-e[n],l=t[n+1]-t[n],a.push(o),i.push(l),s.push(l/o);const c=[s[0]];for(let e=0;e<a.length-1;e++){const t=s[e],r=s[e+1];if(t*r<=0)c.push(0);else{o=a[e];const n=a[e+1],i=o+n;c.push(3*i/((i+n)/t+(i+o)/r))}}c.push(s[s.length-1]);const u=[],d=[];let h;for(let e=0;e<c.length-1;e++){h=s[e];const t=c[e],r=1/a[e],n=t+c[e+1]-h-h;u.push((h-t-n)*r),d.push(n*r*r)}this.xs=e,this.ys=t,this.c1s=c,this.c2s=u,this.c3s=d}}function v(e){const t=1===e.nodeType?e:e.parentElement;if(!t)return null;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}function y(e){return{x:e.clientX,y:e.clientY}}function b(e,t,r,n,i){const a="IMG"===(s=t).nodeName&&(f()||!(null===(o=document.documentElement)||void 0===o?void 0:o.contains(s)));var s,o;const l=v(a?e:t),c={x:r.x-l.x,y:r.y-l.y},{offsetWidth:u,offsetHeight:d}=e,{anchorX:h,anchorY:p}=n,{dragPreviewWidth:y,dragPreviewHeight:b}=function(e,t,r,n){let i=e?t.width:r,a=e?t.height:n;return g()&&e&&(a/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:a}}(a,t,u,d),{offsetX:w,offsetY:x}=i,E=0===x||x;return{x:0===w||w?w:new m([0,.5,1],[c.x,c.x/u*y,c.x+y-u]).interpolate(h),y:E?x:(()=>{let e=new m([0,.5,1],[c.y,c.y/d*b,c.y+b-d]).interpolate(p);return g()&&a&&(e+=(window.devicePixelRatio-1)*b),e})()}}class w{get window(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}get document(){var e;return(null===(e=this.globalContext)||void 0===e?void 0:e.document)?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}}function x(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){x(e,t,r[t])})}return e}class S{profile(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;var t;void 0!==e&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(t=this.window)||void 0===t||t.cancelAnimationFrame(this.asyncEndDragFrameId)))}connectDragPreview(e,t,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,r){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,r);const n=t=>this.handleDragStart(t,e),i=e=>this.handleSelectStart(e);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",n),t.addEventListener("selectstart",i),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",n),t.removeEventListener("selectstart",i),t.setAttribute("draggable","false")}}connectDropTarget(e,t){const r=t=>this.handleDragEnter(t,e),n=t=>this.handleDragOver(t,e),i=t=>this.handleDrop(t,e);return t.addEventListener("dragenter",r),t.addEventListener("dragover",n),t.addEventListener("drop",i),()=>{t.removeEventListener("dragenter",r),t.removeEventListener("dragover",n),t.removeEventListener("drop",i)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return E({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId();return E({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(n).some(t=>n[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){const r=h[e];if(!r)throw new Error(`native type ${e} has no configuration`);const n=new s(r);return n.loadDataTransfer(t),n}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;this.mouseMoveTimeoutTimer=setTimeout(()=>{var e;return null===(e=this.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){var e;if(this.currentDragSourceNode=null,this.rootElement)null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0);return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{const t=this.sourceNodes.get(e);return t&&v(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>Boolean(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{const e=this.currentDragSourceNode;null==e||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{null===this.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{null!==this.hoverRafId&&"undefined"!=typeof cancelAnimationFrame&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;const{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;const r=y(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});const{dataTransfer:n}=e,i=p(n);if(this.monitor.isDragging()){if(n&&"function"==typeof n.setDragImage){const e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),i=this.sourcePreviewNodes.get(e)||t;if(i){const{anchorX:e,anchorY:a,offsetX:s,offsetY:o}=this.getCurrentSourcePreviewNodeOptions(),l=b(t,i,r,{anchorX:e,anchorY:a},{offsetX:s,offsetY:o});n.setDragImage(i,l.x,l.y)}}try{null==n||n.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target);const{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(i)this.beginDragNativeItem(i);else{if(n&&!n.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{var t;(this.dragEnterTargetIds=[],this.isDraggingNativeItem())&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer));if(!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;const{dataTransfer:r}=e,n=p(r);n&&this.beginDragNativeItem(n,r)},this.handleTopDragEnter=e=>{const{dragEnterTargetIds:t}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:y(e)});t.some(e=>this.monitor.canDropOnTarget(e))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=e=>{var t;(this.dragOverTargetIds=[],this.isDraggingNativeItem())&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer))},this.handleTopDragOver=e=>{const{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));this.altKeyPressed=e.altKey,this.lastClientOffset=y(e),this.scheduleHover(t);(t||[]).some(e=>this.monitor.canDropOnTarget(e))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault();this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=e=>{var t;(this.dropTargetIds=[],this.isDraggingNativeItem())?(e.preventDefault(),null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):p(e.dataTransfer)&&e.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{const{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:y(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(
46),this.cancelHover()},this.handleSelectStart=e=>{const t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new w(t,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new a(this.isNodeInDocument)}}var A,_=r(9396);!function(e){e.mouse="mouse",e.touch="touch",e.keyboard="keyboard"}(A||(A={}));class T{get delay(){var e;return null!==(e=this.args.delay)&&void 0!==e?e:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var e;return null!==(e=this.args.ignoreContextMenu)&&void 0!==e&&e}get enableHoverOutsideTarget(){var e;return null!==(e=this.args.enableHoverOutsideTarget)&&void 0!==e&&e}get enableKeyboardEvents(){var e;return null!==(e=this.args.enableKeyboardEvents)&&void 0!==e&&e}get enableMouseEvents(){var e;return null!==(e=this.args.enableMouseEvents)&&void 0!==e&&e}get enableTouchEvents(){var e;return null===(e=this.args.enableTouchEvents)||void 0===e||e}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,t,r,n;return null!==(n=null!==(r=null===(e=this.args)||void 0===e?void 0:e.delayTouchStart)&&void 0!==r?r:null===(t=this.args)||void 0===t?void 0:t.delay)&&void 0!==n?n:0}get delayMouseStart(){var e,t,r,n;return null!==(n=null!==(r=null===(e=this.args)||void 0===e?void 0:e.delayMouseStart)&&void 0!==r?r:null===(t=this.args)||void 0===t?void 0:t.delay)&&void 0!==n?n:0}get window(){return this.context&&this.context.window?this.context.window:"undefined"!=typeof window?window:void 0}get document(){var e;return(null===(e=this.context)||void 0===e?void 0:e.document)?this.context.document:this.window?this.window.document:void 0}get rootElement(){var e;return(null===(e=this.args)||void 0===e?void 0:e.rootElement)||this.document}constructor(e,t){this.args=e,this.context=t}}const C=1,P=0;function R(e){return void 0===e.button||e.button===P}function O(e){return!!e.targetTouches}function D(e,t){return O(e)?function(e,t){return 1===e.targetTouches.length?D(e.targetTouches[0]):t&&1===e.touches.length&&e.touches[0].target===t.target?D(e.touches[0]):void 0}(e,t):{x:e.clientX,y:e.clientY}}const k=(()=>{let e=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get:()=>(e=!0,!0)}))}catch(e){}return e})(),M={[A.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[A.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[A.keyboard]:{keydown:"keydown"}};class L{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:(null===(e=this.dragOverTargetIds)||void 0===e?void 0:e.length)||0}}get document(){return this.options.document}setup(){const e=this.options.rootElement;e&&((0,_.V)(!L.isSetUp,"Cannot have two Touch backends at the same time."),L.isSetUp=!0,this.addEventListener(e,"start",this.getTopMoveStartHandler()),this.addEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(e,"move",this.handleTopMove),this.addEventListener(e,"move",this.handleTopMoveCapture,!0),this.addEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(e,"keydown",this.handleCancelOnEscape,!0))}teardown(){const e=this.options.rootElement;e&&(L.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(e,"start",this.handleTopMoveStart),this.removeEventListener(e,"move",this.handleTopMoveCapture,!0),this.removeEventListener(e,"move",this.handleTopMove),this.removeEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(e,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,t,r,n=!1){const i=k?{capture:n,passive:!1}:n;
46this.listenerTypes.forEach(function(n){const a=M[n][t];a&&e.addEventListener(a,r,i)})}removeEventListener(e,t,r,n=!1){const i=k?{capture:n,passive:!1}:n;this.listenerTypes.forEach(function(n){const a=M[n][t];a&&e.removeEventListener(a,r,i)})}connectDragSource(e,t){const r=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,t),this.addEventListener(t,"start",r),()=>{this.sourceNodes.delete(e),this.removeEventListener(t,"start",r)}}connectDragPreview(e,t,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,t){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const n=n=>{if(!this.document||!r||!this.monitor.isDragging())return;let i;switch(n.type){case M.mouse.move:i={x:n.clientX,y:n.clientY};break;case M.touch.move:var a,s;i={x:(null===(a=n.touches[0])||void 0===a?void 0:a.clientX)||0,y:(null===(s=n.touches[0])||void 0===s?void 0:s.clientY)||0}}const o=null!=i?this.document.elementFromPoint(i.x,i.y):void 0,l=o&&t.contains(o);return o===t||l?this.handleMove(n,e):void 0};return this.addEventListener(this.document.body,"move",n),this.targetNodes.set(e,t),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,"move",n))}}getTopMoveStartHandler(){return this.options.delayTouchStart||this.options.delayMouseStart?this.handleTopMoveStartDelay:this.handleTopMoveStart}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),e&&e.parentElement&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,t,r){this.getSourceClientOffset=e=>{const t=this.sourceNodes.get(e);return t&&function(e){const t=1===e.nodeType?e:e.parentElement;if(!t)return;const{top:r,left:n}=t.getBoundingClientRect();return{x:n,y:r}}(t)},this.handleTopMoveStartCapture=e=>{R(e)&&(this.moveStartSourceIds=[])},this.handleMoveStart=e=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(e)},this.handleTopMoveStart=e=>{if(!R(e))return;const t=D(e);t&&(O(e)&&(this.lastTargetTouchFallback=e.targetTouches[0]),this._mouseClientOffset=t),this.waitingForDelay=!1},this.handleTopMoveStartDelay=e=>{if(!R(e))return;const t=e.type===M.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,e),t),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(e,t)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(t)},this.handleTopMove=e=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:t,dragOverTargetIds:r}=this,n=this.options.enableHoverOutsideTarget,i=D(e,this.lastTargetTouchFallback);if(!i)return;if(this._isScrolling||!this.monitor.isDragging()&&function(e,t,r,n,i){if(!i)return!1;const a=180*Math.atan2(n-t,r-e)/Math.PI+180;for(let e=0;e<i.length;++e){const t=i[e];if(t&&(null==t.start||a>=t.start)&&(null==t.end||a<=t.end))return!0}return!1}
46(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,i.x,i.y,this.options.scrollAngleRanges))return void(this._isScrolling=!0);var a,s,o,l;if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&t&&(a=this._mouseClientOffset.x||0,s=this._mouseClientOffset.y||0,o=i.x,l=i.y,Math.sqrt(Math.pow(Math.abs(o-a),2)+Math.pow(Math.abs(l-s),2))>(this.options.touchSlop?this.options.touchSlop:0))&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(t,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const c=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(c),this.actions.publishDragSource(),e.cancelable&&e.preventDefault();const u=(r||[]).map(e=>this.targetNodes.get(e)).filter(e=>!!e),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(i.x,i.y,u):this.document.elementsFromPoint(i.x,i.y),h=[];for(const e in d){if(!d.hasOwnProperty(e))continue;let t=d[e];for(null!=t&&h.push(t);t;)t=t.parentElement,t&&-1===h.indexOf(t)&&h.push(t)}const p=h.filter(e=>u.indexOf(e)>-1).map(e=>this._getDropTargetId(e)).filter(e=>!!e).filter((e,t,r)=>r.indexOf(e)===t);if(n)for(const e in this.targetNodes){const t=this.targetNodes.get(e);if(c&&t&&t.contains(c)&&-1===p.indexOf(e)){p.unshift(e);break}}p.reverse(),this.actions.hover(p,{clientOffset:i})},this._getDropTargetId=e=>{const t=this.targetNodes.keys();let r=t.next();for(;!1===r.done;){const n=r.value;if(e===this.targetNodes.get(n))return n;r=t.next()}},this.handleTopMoveEndCapture=e=>{this._isScrolling=!1,this.lastTargetTouchFallback=void 0,function(e){return void 0===e.buttons||0===(e.buttons&C)}(e)&&(this.monitor.isDragging()&&!this.monitor.didDrop()?(e.cancelable&&e.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()):this.moveStartSourceIds=void 0)},this.handleCancelOnEscape=e=>{"Escape"===e.key&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new T(r,t),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(A.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(A.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(A.keyboard)}}var I=r(2300),N={backends:[{id:"html5",backend:function(e,t,r){return new S(e,t,r)},transition:I.nf},{id:"touch",backend:function(e,t={},r={}){return new L(e,t,r)},options:{enableMouseEvents:!0},preview:!0,transition:I.lr}]}},6128(e,t,r){"use strict";
46r.r(t),r.d(t,{DndProvider:()=>x,HTML5DragTransition:()=>n.Ik,MouseTransition:()=>n.v8,MultiBackend:()=>n.U2,PointerTransition:()=>n.nf,Preview:()=>S,PreviewContext:()=>c,TouchTransition:()=>n.lr,createTransition:()=>n.eV,useMultiDrag:()=>T,useMultiDrop:()=>C,usePreview:()=>P});var n=r(2300),i=r(1594),a=r(4546),s=r(5206),o=r(7978),l=r(4848),c=(0,i.createContext)(void 0),u=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),d=(e,t)=>{switch(e){case"left":case"top-start":case"bottom-start":return 0;case"right":case"top-end":case"bottom-end":return t.width;default:return t.width/2}},h=(e,t)=>{switch(e){case"top":case"top-start":case"top-end":return 0;case"bottom":case"bottom-start":case"bottom-end":return t.height;default:return t.height/2}},p=(e,t,r="center",n={x:0,y:0})=>{let i=e.getClientOffset();if(null===i)return null;if(!t.current||!t.current.getBoundingClientRect)return u(i,(e=>{let t=e.getInitialClientOffset(),r=e.getInitialSourceClientOffset();return null===t||null===r?{x:0,y:0}:u(t,r)})(e));let a=t.current.getBoundingClientRect(),s={x:d(r,a),y:h(r,a)};return((e,t)=>({x:e.x+t.x,y:e.y+t.y}))(u(i,s),n)},f=e=>{let t=`translate(${e.x.toFixed(1)}px, ${e.y.toFixed(1)}px)`;return{pointerEvents:"none",position:"fixed",top:0,left:0,transform:t,WebkitTransform:t}},g=e=>{let t=(0,i.useRef)(null),r=(0,o.V)(r=>({currentOffset:p(r,t,e?.placement,e?.padding),isDragging:r.isDragging(),itemType:r.getItemType(),item:r.getItem(),monitor:r}));return r.isDragging&&null!==r.currentOffset?{display:!0,itemType:r.itemType,item:r.item,style:f(r.currentOffset),monitor:r.monitor,ref:t}:{display:!1}},m=e=>{let t=g({placement:e.placement,padding:e.padding});if(!t.display)return null;let r,{display:n,...i}=t;return r="children"in e?"function"==typeof e.children?e.children(i):e.children:e.generator(i),(0,l.jsx)(c.Provider,{value:i,children:r})},v=r(912),y=r(8410),b=r(5079),w=(0,i.createContext)(null),x=({portal:e,...t})=>{let[r,s]=(0,i.useState)(null);return i.createElement(w.Provider,{value:e??r},i.createElement(a.Q,{backend:n.U2,...t}),e?null:i.createElement("div",{ref:s}))},E=()=>{let[e,t]=(0,i.useState)(!1),r=(0,i.useContext)(v.M);return(0,i.useEffect)(()=>{let e=r?.dragDropManager?.getBackend(),n={backendChanged:e=>{t(e.previewEnabled())}};return t(e.previewEnabled()),e.previewsList().register(n),()=>{e.previewsList().unregister(n)}},[r,r.dragDropManager]),e},S=e=>{let t=E(),r=(0,i.useContext)(w);if(!t)return null;let n=i.createElement(m,{...e});return null!==r?(0,s.createPortal)(n,r):n};S.Context=c;var A=(e,t,r,n)=>{let i=r.getBackend();r.receiveBackend(n);let a=t(e);return r.receiveBackend(i),a},_=(e,t)=>{let r=(0,i.useContext)(v.M),n=r?.dragDropManager?.getBackend();if(void 0===n)throw new Error("could not find backend, make sure you are using a <DndProvider />");let a=t(e),s={},o=n.backendsList();for(let n of o)s[n.id]=A(e,t,r.dragDropManager,n.instance);return[a,s]},T=e=>_(e,y.i),C=e=>_(e,b.H),P=()=>{let e=E(),t=g();return e?t:{display:!1}}},912(e,t,r){"use strict";const n=(0,r(1594).createContext)({dragDropManager:void 0});r.d(t,["M",0,n])},4546(e,t,r){"use strict";r.d(t,{Q:()=>ve});var n=r(4848);function i(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var a="function"==typeof Symbol&&Symbol.observable||"@@observable",s=function(){return Math.random().toString(36).substring(7).split("").join(".")},o={INIT:"@@redux/INIT"+s(),REPLACE:"@@redux/REPLACE"+s(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+s()}};function l(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function c(e,t,r){var n;if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(i(0));if("function"==typeof t&&void 0===r&&(r=t,t=void 0),void 0!==r){if("function"!=typeof r)throw new Error(i(1));return r(c)(e,t)}if("function"!=typeof e)throw new Error(i(2));var s=e,u=t,d=[],h=d,p=!1;function f(){h===d&&(h=d.slice())}function g(){if(p)throw new Error(i(3));return u}function m(e){if("function"!=typeof e)throw new Error(i(4));if(p)throw new Error(i(5));var t=!0;return f(),h.push(e),function(){if(t){if(p)throw new Error(i(6));t=!1,f();var r=h.indexOf(e);h.splice(r,1),d=null}}}function v(e){if(!l(e))throw new Error(i(7));if(void 0===e.type)throw new Error(i(8));if(p)throw new Error(i(9));try{p=!0,u=s(u,e)}finally{p=!1}for(var t=d=h,r=0;r<t.length;r++){(0,t[r])()}return e}return v({type:o.INIT}),(n={dispatch:v,subscribe:m,getState:g,replaceReducer:function(e){if("function"!=typeof e)throw new Error(i(10));s=e,v({type:o.REPLACE})}})[a]=function(){var e,t=m;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(i(11));function r(){e.next&&e.next(g())}return r(),{unsubscribe:t(r)}}})[a]=function(){return this},e},n}var u=r(9396);function d(e){return"object"==typeof e}const h="dnd-core/INIT_COORDS",p="dnd-core/BEGIN_DRAG",f="dnd-core/PUBLISH_DRAG_SOURCE",g="dnd-core/HOVER",m="dnd-core/DROP",v="dnd-core/END_DRAG";function y(e,t){return{type:h,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const b={type:h,payload:{clientOffset:null,sourceClientOffset:null}};function w(e){return function(t=[],r={publishSource:!0}){const{publishSource:n=!0,clientOffset:i,getSourceClientOffset:a}=r,s=e.getMonitor(),o=e.getRegistry();e.dispatch(y(i)),function(e,t,r){(0,u.V)(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(e){(0,u.V)(r.getSource(e),"Expected sourceIds to be registered.")})}(t,s,o);const l=function(e,t){let r=null;for(let n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}(t,s);if(null==l)return void e.dispatch(b);let c=null;if(i){if(!a)throw new Error("getSourceClientOffset must be defined");!function(e){(0,u.V)("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(a),c=a(l)}
vendor: 15,528 bytes, line 46
46e.dispatch(y(i,c));const h=o.getSource(l).beginDrag(s,l);if(null==h)return;!function(e){(0,u.V)(d(e),"Item must be an object.")}(h),o.pinSource(l);const f=o.getSourceType(l);return{type:p,payload:{itemType:f,item:h,sourceId:l,clientOffset:i||null,sourceClientOffset:c||null,isSourcePublic:!!n}}}}function x(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){x(e,t,r[t])})}return e}function S(e){return function(t={}){const r=e.getMonitor(),n=e.getRegistry();!function(e){(0,u.V)(e.isDragging(),"Cannot call drop while not dragging."),(0,u.V)(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(r);const i=function(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(r);i.forEach((i,a)=>{const s=function(e,t,r,n){const i=r.getTarget(e);let a=i?i.drop(n,e):void 0;(function(e){(0,u.V)(void 0===e||d(e),"Drop result must either be an object or undefined.")})(a),void 0===a&&(a=0===t?{}:n.getDropResult());return a}(i,a,n,r),o={type:m,payload:{dropResult:E({},t,s)}};e.dispatch(o)})}}function A(e){return function(){const t=e.getMonitor(),r=e.getRegistry();!function(e){(0,u.V)(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);const n=t.getSourceId();if(null!=n){r.getSource(n,!0).endDrag(t,n),r.unpinSource()}return{type:v}}}function _(e,t){return null===t?null===e:Array.isArray(e)?e.some(e=>e===t):e===t}function T(e){return function(t,{clientOffset:r}={}){!function(e){(0,u.V)(Array.isArray(e),"Expected targetIds to be an array.")}(t);const n=t.slice(0),i=e.getMonitor(),a=e.getRegistry();return function(e,t,r){for(let n=e.length-1;n>=0;n--){const i=e[n];_(t.getTargetType(i),r)||e.splice(n,1)}}(n,a,i.getItemType()),function(e,t,r){(0,u.V)(t.isDragging(),"Cannot call hover while not dragging."),(0,u.V)(!t.didDrop(),"Cannot call hover after drop.");for(let t=0;t<e.length;t++){const n=e[t];(0,u.V)(e.lastIndexOf(n)===t,"Expected targetIds to be unique in the passed array.");const i=r.getTarget(n);(0,u.V)(i,"Expected targetIds to be registered.")}}(n,i,a),function(e,t,r){e.forEach(function(e){r.getTarget(e).hover(t,e)})}(n,i,a),{type:g,payload:{targetIds:n,clientOffset:r||null}}}}function C(e){return function(){if(e.getMonitor().isDragging())return{type:f}}}class P{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:t}=this.store;const r=function(e){return{beginDrag:w(e),publishDragSource:C(e),hover:T(e),drop:S(e),endDrag:A(e)}}(this);return Object.keys(r).reduce((n,i)=>{const a=r[i];var s;return n[i]=(s=a,(...r)=>{const n=s.apply(e,r);void 0!==n&&t(n)}),n},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}}function R(e,t){return{x:e.x-t.x,y:e.y-t.y}}const O=[],D=[];O.__IS_NONE__=!0,D.__IS_ALL__=!0;class k{subscribeToStateChange(e,t={}){const{handlerIds:r}=t;(0,u.V)("function"==typeof e,"listener must be a function."),(0,u.V)(void 0===r||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let n=this.store.getState().stateId;return this.store.subscribe(()=>{const t=this.store.getState(),i=t.stateId;try{const a=i===n||i===n+1&&!function(e,t){return e!==O&&(e===D||void 0===t||(r=e,t.filter(e=>r.indexOf(e)>-1)).length>0);var r}(t.dirtyHandlerIds,r);a||e()}finally{n=i}})}subscribeToOffsetChange(e){(0,u.V)("function"==typeof e,"listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{const r=this.store.getState().dragOffset;r!==t&&(t=r,e())})}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return(0,u.V)(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);if((0,u.V)(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;return _(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);if((0,u.V)(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;return this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;const{shallow:r}=t;if(!this.isDragging())return!1;const n=this.registry.getTargetType(e),i=this.getItemType();if(i&&!_(n,i))return!1;const a=this.getTargetIds();if(!a.length)return!1;const s=a.indexOf(e);return r?s===a.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(e){const{clientOffset:t,initialClientOffset:r,initialSourceClientOffset:n}=e;return t&&r&&n?R((a=n,{x:(i=t).x+a.x,y:i.y+a.y}),r):null;var i,a}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(e){const{clientOffset:t,initialClientOffset:r}=e;return t&&r?R(t,r):null}(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}}const M=void 0!==r.g?r.g:self,L=M.MutationObserver||M.WebKitMutationObserver;function I(e){return function(){const t=setTimeout(n,0),r=setInterval(n,50);function n(){clearTimeout(t),clearInterval(r),e()}}}const N="function"==typeof L?function(e){let t=1;const r=new L(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}:I;class j{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const F=new class{enqueueTask(e){const{queue:t,requestFlush:r}=this;t.length||(r(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,r=e.length-this.index;t<r;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=N(this.flush),this.requestErrorThrow=I(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},H=new class{create(e){const t=this.freeTasks,r=t.length?t.pop():new j(this.onError,e=>t[t.length]=e);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}(F.registerPendingError);const B="dnd-core/ADD_SOURCE",z="dnd-core/ADD_TARGET",$="dnd-core/REMOVE_SOURCE",U="dnd-core/REMOVE_TARGET";function W(e,t){t&&Array.isArray(e)?e.forEach(e=>W(e,!1)):(0,u.V)("string"==typeof e||"symbol"==typeof e,t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var V;!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(V||(V={}));let q=0;function Y(e){const t=(q++).toString();switch(e){case V.SOURCE:return`S${t}`;case V.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function G(e){switch(e[0]){case"S":return V.SOURCE;case"T":return V.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function X(e,t){const r=e.entries();let n=!1;do{const{done:e,value:[,i]}=r.next();if(i===t)return!0;n=!!e}while(!n);return!1}class K{addSource(e,t){W(e),function(e){(0,u.V)("function"==typeof e.canDrag,"Expected canDrag to be a function."),(0,u.V)("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),(0,u.V)("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);const r=this.addHandler(V.SOURCE,e,t);return this.store.dispatch(function(e){return{type:B,payload:{sourceId:e}}}(r)),r}addTarget(e,t){W(e,!0),function(e){(0,u.V)("function"==typeof e.canDrop,"Expected canDrop to be a function."),(0,u.V)("function"==typeof e.hover,"Expected hover to be a function."),(0,u.V)("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);const r=this.addHandler(V.TARGET,e,t);return this.store.dispatch(function(e){return{type:z,payload:{targetId:e}}}(r)),r}containsHandler(e){return X(this.dragSources,e)||X(this.dropTargets,e)}getSource(e,t=!1){(0,u.V)(this.isSourceId(e),"Expected a valid source ID.");return t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return(0,u.V)(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return(0,u.V)(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return(0,u.V)(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return G(e)===V.SOURCE}isTargetId(e){return G(e)===V.TARGET}removeSource(e){var t;(0,u.V)(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:$,payload:{sourceId:e}}}(e)),t=()=>{this.dragSources.delete(e),this.types.delete(e)},F.enqueueTask(H.create(t))}removeTarget(e){(0,u.V)(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:U,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);(0,u.V)(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){(0,u.V)(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,r){const n=Y(e);return this.types.set(n,t),e===V.SOURCE?this.dragSources.set(n,r):e===V.TARGET&&this.dropTargets.set(n,r),n}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const J=(e,t)=>e===t;function Q(e=O,t){switch(t.type){case g:break;case B:case z:case U:case $:return O;default:return D}const{targetIds:r=[],prevTargetIds:n=[]}=t.payload,i=function(e,t){const r=new Map,n=e=>{r.set(e,r.has(e)?r.get(e)+1:1)};e.forEach(n),t.forEach(n);const i=[];return r.forEach((e,t)=>{1===e&&i.push(t)}),i}(r,n);if(!(i.length>0||!function(e,t,r=J){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}(r,n)))return O;const a=n[n.length-1],s=r[r.length-1];return a!==s&&(a&&i.push(a),s&&i.push(s)),i}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ee={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function te(e=ee,t){const{payload:r}=t;switch(t.type){case h:case p:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case g:return n=e.clientOffset,i=r.clientOffset,!n&&!i||n&&i&&n.x===i.x&&n.y===i.y?e:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){Z(e,t,r[t])})}return e}({},e,{clientOffset:r.clientOffset});case v:case m:return ee;default:return e}var n,i}function re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){re(e,t,r[t])})}return e}const ie={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function ae(e=ie,t){const{payload:r}=t;switch(t.type){case p:return ne({},e,{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case f:return ne({},e,{isSourcePublic:!0});case g:return ne({},e,{targetIds:r.targetIds});case U:return-1===e.targetIds.indexOf(r.targetId)?e:ne({},e,{targetIds:(n=e.targetIds,i=r.targetId,n.filter(e=>e!==i))});case m:return ne({},e,{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case v:return ne({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var n,i}function se(e=0,t){switch(t.type){case B:case z:return e+1;case $:case U:return e-1;default:return e}}function oe(e=0){return e+1}function le(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){le(e,t,r[t])})}return e}function ue(e={},t){return{dirtyHandlerIds:Q(e.dirtyHandlerIds,{type:t.type,payload:ce({},t.payload,{prevTargetIds:(r=e,n="dragOperation.targetIds",i=[],n.split(".").reduce((e,t)=>e&&e[t]?e[t]:i||null,r))})}),dragOffset:te(e.dragOffset,t),refCount:se(e.refCount,t),dragOperation:ae(e.dragOperation,t),stateId:oe(e.stateId)};var r,n,i}function de(e,t=void 0,r={},n=!1){const i=function(e){const t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return c(ue,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(n),a=new k(i,new K(i)),s=new P(i,a),o=e(s,t,r);return s.receiveBackend(o),s}var he=r(1594),pe=r(912);function fe(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}let ge=0;const me=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var ve=(0,he.memo)(function(e){var{children:t}=e,r=fe(e,["children"]);const[i,a]=function(e){if("manager"in e){return[{dragDropManager:e.manager},!1]}const t=function(e,t=ye(),r,n){const i=t;i[me]||(i[me]={dragDropManager:de(e,t,r,n)});return i[me]}(e.backend,e.context,e.options,e.debugMode),r=!e.context;return[t,r]}(r);return(0,he.useEffect)(()=>
46{if(a){const e=ye();return++ge,()=>{0===--ge&&(e[me]=null)}}},[]),(0,n.jsx)(pe.M.Provider,{value:i,children:t})});function ye(){return void 0!==r.g?r.g:window}},8576(e,t,r){"use strict";r.d(t,{j:()=>a});var n=r(8114),i=r(7727);function a(e,t,r){return function(e,t,r){const[a,s]=(0,n.F)(e,t,r);return(0,i.E)(function(){const t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(s,{handlerIds:[t]})},[e,s]),a}(t,e||(()=>({})),()=>r.reconnect())}},8114(e,t,r){"use strict";r.d(t,{F:()=>s});var n=r.cjs(function(e,t){e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!==i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!==i--;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=n;0!==i--;){var s=a[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}}),i=r(1594),a=r(7727);function s(e,t,r){const[s,o]=(0,i.useState)(()=>t(e)),l=(0,i.useCallback)(()=>{const i=t(e);n(s,i)||(o(i),r&&r())},[s,e,r]);return(0,a.E)(l),[s,l]}},8410(e,t,r){"use strict";r.d(t,{i:()=>x});var n=r(9396),i=r(8576),a=r(7739),s=r(1594);function o(e){return(0,s.useMemo)(()=>e.hooks.dragSource(),[e])}function l(e){return(0,s.useMemo)(()=>e.hooks.dragPreview(),[e])}var c=r(1670),u=r(8853),d=r(1643);class h{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){const t=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();r&&this.disconnectDragPreview(),this.handlerId&&(t?r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!(0,c.b)(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!(0,c.b)(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=(0,d.i)({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,(0,u.i)(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,(0,u.i)(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}var p=r(6143),f=r(7727);let g=!1,m=!1;class v{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){(0,n.V)(!g,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return g=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{g=!1}}isDragging(){if(!this.sourceId)return!1;(0,n.V)(!m,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return m=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{m=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}
46getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}var y=r(5711);class b{beginDrag(){const e=this.spec,t=this.monitor;let r=null;return r="object"==typeof e.item?e.item:"function"==typeof e.item?e.item(t):{},null!=r?r:null}canDrag(){const e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)}isDragging(e,t){const r=this.spec,n=this.monitor,{isDragging:i}=r;return i?i(n):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,r=this.connector,{end:n}=e;n&&n(t.getItem(),t),r.reconnect()}constructor(e,t,r){this.spec=e,this.monitor=t,this.connector=r}}function w(e,t,r){const i=(0,p.u)(),a=function(e,t,r){const n=(0,s.useMemo)(()=>new b(e,t,r),[t,r]);return(0,s.useEffect)(()=>{n.spec=e},[e]),n}(e,t,r),o=function(e){return(0,s.useMemo)(()=>{const t=e.type;return(0,n.V)(null!=t,"spec.type must be defined"),t},[e])}(e);(0,f.E)(function(){if(null!=o){const[e,n]=(0,y.V)(o,a,i);return t.receiveHandlerId(e),r.receiveHandlerId(e),n}},[i,t,r,a,o])}function x(e,t){const r=(0,a.I)(e,t);(0,n.V)(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const c=function(){const e=(0,p.u)();return(0,s.useMemo)(()=>new v(e),[e])}(),u=function(e,t){const r=(0,p.u)(),n=(0,s.useMemo)(()=>new h(r.getBackend()),[r]);return(0,f.E)(()=>(n.dragSourceOptions=e||null,n.reconnect(),()=>n.disconnectDragSource()),[n,e]),(0,f.E)(()=>(n.dragPreviewOptions=t||null,n.reconnect(),()=>n.disconnectDragPreview()),[n,t]),n}(r.options,r.previewOptions);return w(r,c,u),[(0,i.j)(r.collect,c,u),o(u),l(u)]}},6143(e,t,r){"use strict";r.d(t,{u:()=>s});var n=r(9396),i=r(1594),a=r(912);function s(){const{dragDropManager:e}=(0,i.useContext)(a.M);return(0,n.V)(null!=e,"Expected drag drop context"),e}},7978(e,t,r){"use strict";r.d(t,{V:()=>s});var n=r(1594),i=r(8114),a=r(6143);function s(e){const t=(0,a.u)().getMonitor(),[r,s]=(0,i.F)(t,e);return(0,n.useEffect)(()=>t.subscribeToOffsetChange(s)),(0,n.useEffect)(()=>t.subscribeToStateChange(s)),r}},5079(e,t,r){"use strict";r.d(t,{H:()=>b});var n=r(8576),i=r(7739),a=r(1594);function s(e){return(0,a.useMemo)(()=>e.hooks.dropTarget(),[e])}var o=r(1670),l=r(8853),c=r(1643);class u{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!(0,o.b)(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=(0,c.i)({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,(0,l.i)(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}var d=r(6143),h=r(7727);var p=r(9396);let f=!1;class g{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;(0,p.V)(!f,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return f=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{f=!1}}isOver(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}getItemType(){return this.internalMonitor.getItemType()}
46getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}var m=r(5711);class v{canDrop(){const e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function y(e,t,r){const n=(0,d.u)(),i=function(e,t){const r=(0,a.useMemo)(()=>new v(e,t),[t]);return(0,a.useEffect)(()=>{r.spec=e},[e]),r}(e,t),s=function(e){const{accept:t}=e;return(0,a.useMemo)(()=>((0,p.V)(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}(e);(0,h.E)(function(){const[e,a]=(0,m.l)(s,i,n);return t.receiveHandlerId(e),r.receiveHandlerId(e),a},[n,t,i,r,s.map(e=>e.toString()).join("|")])}function b(e,t){const r=(0,i.I)(e,t),o=function(){const e=(0,d.u)();return(0,a.useMemo)(()=>new g(e),[e])}(),l=function(e){const t=(0,d.u)(),r=(0,a.useMemo)(()=>new u(t.getBackend()),[t]);return(0,h.E)(()=>(r.dropTargetOptions=e||null,r.reconnect(),()=>r.disconnectDropTarget()),[e]),r}(r.options);return y(r,o,l),[(0,n.j)(r.collect,o,l),s(l)]}},7727(e,t,r){"use strict";var n=r(1594);const i="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;r.d(t,["E",0,i])},7739(e,t,r){"use strict";r.d(t,{I:()=>i});var n=r(1594);function i(e,t){const r=[...t||[]];return null==t&&"function"!=typeof e&&r.push(e),(0,n.useMemo)(()=>"function"==typeof e?e():e,r)}},83(e,t,r){"use strict";r.r(t),r.d(t,{DndContext:()=>n.M,DndProvider:()=>i.Q,DragPreviewImage:()=>s,useDrag:()=>o.i,useDragDropManager:()=>l.u,useDragLayer:()=>c.V,useDrop:()=>u.H});var n=r(912),i=r(4546),a=r(1594);const s=(0,a.memo)(function({connect:e,src:t}){return(0,a.useEffect)(()=>{if("undefined"==typeof Image)return;let r=!1;const n=new Image;return n.src=t,n.onload=()=>{e(n),r=!0},()=>{r&&e(null)}}),null});var o=r(8410),l=r(6143),c=r(7978),u=r(5079)},8853(e,t,r){"use strict";function n(e){return null!==e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}r.d(t,{i:()=>n})},5711(e,t,r){"use strict";function n(e,t,r){const n=r.getRegistry(),i=n.addTarget(e,t);return[i,()=>n.removeTarget(i)]}function i(e,t,r){const n=r.getRegistry(),i=n.addSource(e,t);return[i,()=>n.removeSource(i)]}r.d(t,{V:()=>i,l:()=>n})},1643(e,t,r){"use strict";r.d(t,{i:()=>s});var n=r(9396),i=r(1594);function a(e){return(t=null,r=null)=>{if(!(0,i.isValidElement)(t)){const n=t;return e(n,r),n}const a=t;!function(e){if("string"==typeof e.type)return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}(a);return function(e,t){const r=e.ref;return(0,n.V)("string"!=typeof r,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?(0,i.cloneElement)(e,{ref:e=>{o(r,e),o(t,e)}}):(0,i.cloneElement)(e,{ref:t})}(a,r?t=>e(t,r):e)}}function s(e){const t={};return Object.keys(e).forEach(r=>{const n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{const e=a(n);t[r]=()=>e}}),t}function o(e,t){"function"==typeof e?e(t):e.current=t}},6213(e,t,r){"use strict";let n;r.d(t,{$P:()=>Sr,$n:()=>fr,AO:()=>A,AV:()=>Mn,AX:()=>zn,B6:()=>q,BV:()=>Rn,Bu:()=>cr,C0:()=>Er,C5:()=>_n,Cu:()=>Se,EB:()=>Bn,Eu:()=>Ln,Ew:()=>Zr,FE:()=>Jr,G3:()=>Ue,Ge:()=>ka,Gy:()=>Va,HC:()=>fe,HW:()=>$e,I9:()=>Na,Ix:()=>Pn,J8:()=>rn,K:()=>rs,KC:()=>kr,KD:()=>us,KP:()=>sn,KT:()=>In,KZ:()=>dr,Kd:()=>Ia,LG:()=>Qr,Ls:()=>Ka,MF:()=>Ri,N_:()=>Fa,OA:()=>za,OW:()=>qi,P1:()=>Mr,PI:()=>Gn,PM:()=>is,Pl:()=>vr,Q2:()=>jn,QE:()=>Kt,QH:()=>hr,Qd:()=>Pi,RF:()=>Ai,RQ:()=>Cr,RV:()=>ts,R_:()=>M,Ri:()=>Ar,Rr:()=>_,SI:()=>Ja,Sk:()=>pe,Sv:()=>Xt,T:()=>xr,T6:()=>dn,TM:()=>b,Tw:()=>_a,U:()=>Jt,U2:()=>br,UU:()=>_i,Ul:()=>gi,V1:()=>w,V2:()=>he,VM:()=>na,Vp:()=>Wn,W8:()=>Ea,Wj:()=>aa,YX:()=>Gt,Ye:()=>Nr,Ys:()=>Da,ZD:()=>yi,Zp:()=>Or,_3:()=>gr,aB:()=>R,aD:()=>Ti,aE:()=>Ge,aJ:()=>Ca,ay:()=>lr,bg:()=>yn,cM:()=>ya,cj:()=>me,cq:()=>Xr,d6:()=>Xe,di:()=>mr,eF:()=>Ke,et:()=>N,fS:()=>An,g:()=>Lr,g$:()=>Xa,gI:()=>Si,gQ:()=>Ci,hA:()=>Xi,hf:()=>or,ht:()=>Di,iA:()=>d,jC:()=>vn,jD:()=>On,jM:()=>Zt,je:()=>ss,k2:()=>Ha,kO:()=>as,kc:()=>ns,ks:()=>ja,lF:()=>fi,lR:()=>xi,lS:()=>oa,lV:()=>Ba,lq:()=>cn,mP:()=>en,mc:()=>pn,nW:()=>mn,o1:()=>Q,oI:()=>nn,of:()=>Ga,ok:()=>qa,ou:()=>Yi,p:()=>de,p4:()=>sa,pX:()=>ve,pb:()=>K,pg:()=>wn,pp:()=>Un,q6:()=>P,q9:()=>Aa,qF:()=>va,qI:()=>Ki,qh:()=>Cn,r5:()=>tn,rc:()=>f,sC:()=>v,sv:()=>Tn,tW:()=>V,uD:()=>ze,ue:()=>I,ux:()=>Fn,vB:()=>Zi,vL:()=>Kr,wQ:()=>Tr,x$:()=>Ir,xu:()=>cs,yL:()=>ha,yd:()=>ra,yf:()=>Tt,zR:()=>y,zy:()=>_r});var i=r(1594),a=e=>{throw TypeError(e)},s=(e,t,r)=>t.has(e)||a("Cannot "+r),o=(e,t,r)=>(s(e,t,"read from private field"),r?r.call(e):t.get(e)),l=(e,t,r)=>t.has(e)?a("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),c=(e,t,r,n)=>(s(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),u=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,d=/^[\\/]{2}/; 47/** 48 * react-router v7.18.2 49 * 50 * Copyright (c) Remix Software Inc. 51 * 52 * This source code is licensed under the MIT license found in the 53 * LICENSE.md file in the root directory of this source tree. 54 * 55 * @license MIT 56 */function h(e,t){return t+e.replace(/\\/g,"/")}var p,f=(e=>(e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE",e))(f||{}),g="popstate";function m(e){return"object"==typeof e&&null!=e&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function v(e={}){let t,{initialEntries:r=["/"],initialIndex:n,v5Compat:i=!1}=e;t=r.map((e,t)=>u(e,"string"==typeof e?null:e.state,0===t?"default":void 0,"string"==typeof e?void 0:e.mask));let a=l(n??t.length-1),s="POP",o=null;function l(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[a]}function u(e,r=null,n,i){let a=S(t?c().pathname:"/",e,r,n,i);return x("/"===a.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),a}function d(e){return"string"==typeof e?e:A(e)}return{get index(){return a},get action(){return s},get location(){return c()},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?_(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,r){s="PUSH";let n=m(e)?e:u(e,r);a+=1,t.splice(a,t.length,n),i&&o&&o({action:s,location:n,delta:1})},replace(e,r){s="REPLACE";let n=m(e)?e:u(e,r);t[a]=n,i&&o&&o({action:s,location:n,delta:0})},go(e){s="POP";let r=l(a+e),n=t[r];a=r,o&&o({action:s,location:n,delta:e})},listen:e=>(o=e,()=>{o=null})}}function y(e={}){return T(function(e,t){let r=t.state?.masked,{pathname:n,search:i,hash:a}=r||e.location;return S("",{pathname:n,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default",r?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)},function(e,t){return"string"==typeof t?t:A(t)},null,e)}function b(e={}){return T(function(e,t){let{pathname:r="/",search:n="",hash:i=""}=_(e.location.hash.substring(1));return r.startsWith("/")||r.startsWith(".")||(r="/"+r),S("",{pathname:r,search:n,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){let r=e.document.querySelector("base"),n="";if(r&&r.getAttribute("href")){let t=e.location.href,r=t.indexOf("#");n=-1===r?t:t.slice(0,r)}return n+"#"+("string"==typeof t?t:A(t))},function(e,t){x("/"===e.pathname.charAt(0),`relative pathnames are not supported in hash history.push(${JSON.stringify(t)})`)},e)}function w(e,t){if(!1===e||null==e)throw new Error(t)}function x(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function E(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function S(e,t,r=null,n,i){return{pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?_(t):t,state:r,key:t&&t.key||n||Math.random().toString(36).substring(2,10),mask:i}}function A({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"
56===r.charAt(0)?r:"#"+r),e}function _(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function T(e,t,r,n={}){let{window:i=document.defaultView,v5Compat:a=!1}=n,s=i.history,o="POP",l=null,c=u();function u(){return(s.state||{idx:null}).idx}function d(){o="POP";let e=u(),t=null==e?null:e-c;c=e,l&&l({action:o,location:p.location,delta:t})}function h(e){return C(i,e)}null==c&&(c=0,s.replaceState({...s.state,idx:c},""));let p={get action(){return o},get location(){return e(i,s)},listen(e){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(g,d),l=e,()=>{i.removeEventListener(g,d),l=null}},createHref:e=>t(i,e),createURL:h,encodeLocation(e){let t=h(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){o="PUSH";let n=m(e)?e:S(p.location,e,t);r&&r(n,e),c=u()+1;let d=E(n,c),h=p.createHref(n.mask||n);try{s.pushState(d,"",h)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;i.location.assign(h)}a&&l&&l({action:o,location:p.location,delta:1})},replace:function(e,t){o="REPLACE";let n=m(e)?e:S(p.location,e,t);r&&r(n,e),c=u();let i=E(n,c),d=p.createHref(n.mask||n);s.replaceState(i,"",d),a&&l&&l({action:o,location:p.location,delta:0})},go:e=>s.go(e)};return p}function C(e,t,r=!1){let n="http://localhost";e&&(n="null"!==e.location.origin?e.location.origin:e.location.href),w(n,"No window.location.(origin|href) available to create URL");let i="string"==typeof t?t:A(t);return i=i.replace(/ $/,"%20"),!r&&d.test(i)&&(i=n+i),new URL(i,n)}function P(e){return{defaultValue:e}}var R=class{constructor(e){if(l(this,p,new Map),e)for(let[t,r]of e)this.set(t,r)}get(e){if(o(this,p).has(e))return o(this,p).get(e);if(void 0!==e.defaultValue)return e.defaultValue;throw new Error("No value found for context")}set(e,t){o(this,p).set(e,t)}};p=new WeakMap;var O=new Set(["lazy","caseSensitive","path","id","index","children"]);var D=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function k(e){return D.has(e)}function M(e,t,r=[],n={},i=!1){return e.map((e,a)=>{let s=[...r,String(a)],o="string"==typeof e.id?e.id:s.join("-");if(w(!0!==e.index||!e.children,"Cannot specify children on an index route"),w(i||!n[o],`Found a route id collision on i
56d "${o}". Route id's must be globally unique within Data Router usages`),function(e){return!0===e.index}(e)){let r={...e,id:o};return n[o]=L(r,t(r)),r}{let r={...e,id:o,children:void 0};return n[o]=L(r,t(r)),e.children&&(r.children=M(e.children,t,s,n,i)),r}})}function L(e,t){return Object.assign(e,{...t,..."object"==typeof t.lazy&&null!=t.lazy?{lazy:{...e.lazy,...t.lazy}}:{}})}function I(e,t,r="/"){return N(e,t,r,!1)}function N(e,t,r,n,i){let a=K(("string"==typeof t?_(t):t).pathname||"/",r);if(null==a)return null;let s=i??F(e),o=null,l=X(a);for(let e=0;null==o&&e<s.length;++e)o=W(s[e],l,n);return o}function j(e,t){let{route:r,pathname:n,params:i}=e;return{id:r.id,pathname:n,params:i,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function F(e){let t=H(e);return function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every((e,r)=>e===t[r]);return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(t),t}function H(e,t=[],r=[],n="",i=!1){let a=(e,a,s=i,o)=>{let l={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};if(l.relativePath.startsWith("/")){if(!l.relativePath.startsWith(n)&&s)return;w(l.relativePath.startsWith(n),`Absolute route path "${l.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),l.relativePath=l.relativePath.slice(n.length)}let c=ae([n,l.relativePath]),u=r.concat(l);e.children&&e.children.length>0&&(w(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${c}".`),H(e.children,t,u,c,s)),(null!=e.path||e.index)&&t.push({path:c,score:U(c,e.index),routesMeta:u.map((e,t)=>{let[r,n]=G(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:r,compiledParams:n}})})};return e.forEach((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of B(e.path))a(e,t,!0,r);else a(e,t)}),t}function B(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(0===n.length)return i?[a,""]:[a];let s=B(n.join("/")),o=[];return o.push(...s.map(e=>""===e?a:[a,e].join("/"))),i&&o.push(...s),o.map(t=>e.startsWith("/")&&""===t?"/":t)}var z=/^:[\w-]+$/,$=e=>"*"===e;function U(e,t){let r=e.split("/"),n=r.length;return r.some($)&&(n+=-2),t&&(n+=2),r.filter(e=>!$(e)).reduce((e,t)=>e+(z.test(t)?3:""===t?1:10),n)}function W(e,t,r=!1){let{routesMeta:n}=e,i={},a="/",s=[];for(let e=0;e<n.length;++e){let o=n[e],l=e===n.length-1,c="/"===a?t:t.slice(a.length)||"/",u={path:o.relativePath,caseSensitive:o.caseSensitive,end:l},d=o.matcher&&o.compiledParams?Y(u,c,o.matcher,o.compiledParams):q(u,c),h=o.route;if(!d&&l&&r&&!n[n.length-1].route.index&&(d=q({path:o.relativePath,caseSensitive:o.caseSensitive,end:!1},c)),!d)return null;
56Object.assign(i,d.params),s.push({params:i,pathname:ae([a,d.pathname]),pathnameBase:oe(ae([a,d.pathnameBase])),route:h}),"/"!==d.pathnameBase&&(a=ae([a,d.pathnameBase]))}return s}function V(e,t={}){let r=e;r.endsWith("*")&&"*"!==r&&!r.endsWith("/*")&&(x(!1,`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`),r=r.replace(/\*$/,"/*"));const n=r.startsWith("/")?"/":"",i=e=>null==e?"":"string"==typeof e?e:String(e);return n+r.split(/\/+/).map((e,r,n)=>{if(r===n.length-1&&"*"===e)return i(t["*"]);const a=e.match(/^:([\w-]+)(\??)(.*)/);if(a){const[,e,r,n]=a;let s=t[e];return w("?"===r||null!=s,`Missing ":${e}" param`),encodeURIComponent(i(s))+n}return e.replace(/\?$/g,"")}).filter(e=>!!e).join("/")}function q(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=G(e.path,e.caseSensitive,e.end);return Y(e,t,r,n)}function Y(e,t,r,n){let i=t.match(r);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:n.reduce((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=o[n]||"";s=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const i=o[n];return e[t]=r&&!i?void 0:(i||"").replace(/%2F/g,"/"),e},{}),pathname:a,pathnameBase:s,pattern:e}}function G(e,t=!1,r=!0){x("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,r,i,a)=>{if(n.push({paramName:t,isOptional:null!=r}),r){let t=a.charAt(i+e.length);return t&&"/"!==t?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function X(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return x(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function K(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}var J=e=>u.test(e);function Q(e,t="/"){let r,{pathname:n,search:i="",hash:a=""}="string"==typeof e?_(e):e;return n?(n=ie(n),r=n.startsWith("/")?Z(n.substring(1),"/"):Z(n,t)):r=t,{pathname:r,search:le(i),hash:ce(a)}}function Z(e,t){let r=se(t).split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function ee(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function te(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function re(e){let t=te(e);return t.map((e,r)=>r===t.length-1?e.pathname:e.pathnameBase)}function ne(e,t,r,n=!1){let i;"string"==typeof e?i=_(e):(i={...e},w(!i.pathname||!i.pathname.includes("?"),ee("?","pathname","search",i)),w(!i.pathname||!i.pathname.includes("#"),ee("#","pathname","hash",i)),w(!i.search||!i.search.includes("#"),ee("#","search","hash",i)));let a,s=""===e||""===i.pathname,o=s?"/":i.pathname;if(null==o)a=r;else{let e=t.length-1;if(!n&&o.startsWith("..")){let t=o.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}a=e>=0?t[e]:"/"}let l=Q(i,a),c=o&&"/"!==o&&o.endsWith("/"),u=(s||"."===o)&&r.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var ie=e=>e.replace(/[\\/]{2,}/g,"/"),ae=e=>ie(e.join("/")),se=e=>e.replace(/\/+$/,""),oe=e=>se(e).replace(/^\/*/,"/"),le=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",ce=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",ue=class{constructor(e,t){this.type="DataWithResponseInit",this.data=e,this.init=t||null}};function de(e,t){return new ue(e,"number"==typeof t?{status:t}:t)}var he=(e,t=302)=>{let r=t;"number"==typeof r?r={status:r}:void 0===r.status&&(r.status=302);let n=new Headers(r.headers);return n.set("Location",e),new Response(null,{...r,headers:n})},pe=(e,t)=>{let r=he(e,t);return r.headers.set("X-Remix-Reload-Document","true"),r},fe=(e,t)=>
56{let r=he(e,t);return r.headers.set("X-Remix-Replace","true"),r},ge=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],me=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function ve(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}function ye(e){let t=e.map(e=>e.route.path).filter(Boolean);return ae(t)||"/"}var be="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function we(e,t){let r=e;if("string"!=typeof r||!u.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,i=!1;if(be)try{let e=new URL(window.location.href),n=d.test(r)?new URL(h(r,e.protocol)):new URL(r),a=K(n.pathname,t);n.origin===e.origin&&null!=a?r=a+n.search+n.hash:i=!0}catch(e){x(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:i,to:r}}var xe=Symbol("Uninstrumented");function Ee(e,t){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(r);for(let n of t)e[n]&&r[n].push(e[n])}}));let n={};if("function"==typeof t.lazy&&r.lazy.length>0){let e=Ae(r.lazy,t.lazy,()=>{});e&&(n.lazy=e)}if("object"==typeof t.lazy){let e=t.lazy;["middleware","loader","action"].forEach(t=>{let i=e[t],a=r[`lazy.${t}`];if("function"==typeof i&&a.length>0){let e=Ae(a,i,()=>{});e&&(n.lazy=Object.assign(n.lazy||{},{[t]:e}))}})}return["loader","action"].forEach(e=>{let i=t[e];if("function"==typeof i&&r[e].length>0){let t=i[xe]??i,a=Ae(r[e],t,(...e)=>Te(e[0]));a&&("loader"===e&&!0===t.hydrate&&(a.hydrate=!0),a[xe]=t,n[e]=a)}}),t.middleware&&t.middleware.length>0&&r.middleware.length>0&&(n.middleware=t.middleware.map(e=>{let t=e[xe]??e,n=Ae(r.middleware,t,(...e)=>Te(e[0]));return n?(n[xe]=t,n):e})),n}function Se(e,t){let r={request:[]};t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let n of t)e[n]&&r[n].push(e[n])}}));let n=e;return r.request.length>0&&(n=Ae(r.request,e,(...e)=>{let[t,r]=e;return{request:Pe(t),context:null!=r?Re(r):r}})),n}function Ae(e,t,r){return 0===e.length?null:async(...n)=>{let i=await _e(e,r(...n),()=>t(...n),e.length-1);if("error"===i.type)throw i.value;return i.value}}async function _e(e,t,r,n){let i,a=e[n];if(a){let s,o=async()=>(s?console.error("You cannot call instrumented handlers more than once"):s=_e(e,t,r,n-1),i=await s,w(i,"Expected a result"),"error"===i.type&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await a(o,t)}catch(e){console.error("An instrumentation function threw an error:",e)}s||await o(),await s}else try{let e=await r();i={type:"success",value:e}}catch(e){i={type:"error",value:e}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function Te(e){let{request:t,context:r,params:n,pattern:i}=e;return{request:Pe(t),params:{...n},pattern:i,context:Re(r)}}function Ce(e,t){return{currentUrl:A(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Pe(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Re(e){if(function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t||Object.getOwnPropertyNames(t).sort().join("\0")===Oe}(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Oe=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var De,ke,Me,Le,Ie=["POST","PUT","PATCH","DELETE"],Ne=new Set(Ie),je=["GET",...Ie],Fe=new Set(je),He=new Set([301,302,303,307,308]),Be=new Set([307,308]),ze={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$e={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ue={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},We=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),Ve="remix-router-transitions",qe=Symbol("ResetLoaderData"),Ye=class{constructor(e){l(this,De),l(this,ke),l(this,Me),l(this,Le),c(this,De,e),c(this,ke,F(e))}get stableRoutes(){return o(this,De)}get activeRoutes(){return o(this,Me)??o(this,De)}get branches(){return o(this,Le)??o(this,ke)}get hasHMRRoutes(){return null!=o(this,Me)}setRoutes(e){c(this,De,e),c(this,ke,F(e))}setHmrRoutes(e){c(this,Me,e),c(this,Le,F(e))}commitHmrRoutes(){o(this,Me)&&(c(this,De,o(this,Me)),c(this,ke,o(this,Le)),c(this,Me,void 0),c(this,Le,void 0))}};function Ge(e){const t=e.window?e.window:"undefined"!=typeof window?window:void 0,r=void 0!==t&&void 0!==t.document&&void 0!==t.document.createElement;w(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let n=e.hydrationRouteProperties||[],i=e.mapRouteProperties||We,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...Ee(t.map(e=>
56e.route).filter(Boolean),e)})}let s={},o=new Ye(M(e.routes,a,void 0,s)),l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let c,u,d,h=e.dataStrategy||pt,p={...e.future},f=null,g=new Set,m=null,v=null,y=null,b=null,E=null!=e.hydrationData,T=N(o.activeRoutes,e.history.location,l,!1,o.branches),P=!1,O=null;if(null!=T||e.patchRoutesOnNavigation){if(T&&!e.hydrationData){Oe(T,o.activeRoutes,e.history.location.pathname).active&&(T=null)}if(T)if(T.some(e=>e.route.lazy))c=!1,u=!c;else if(T.some(e=>rt(e.route))){let t=e.hydrationData?e.hydrationData.loaderData:null,r=e.hydrationData?e.hydrationData.errors:null,n=T;if(r){let e=T.findIndex(e=>void 0!==r[e.route.id]);n=n.slice(0,e+1)}u=!1,c=!0,n.forEach(e=>{let n=nt(e.route,t,r);u=u||n.renderFallback,c=c&&!n.shouldLoad})}else c=!0,u=!c;else{c=!1,u=!c,T=[];let t=Oe(null,o.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(P=!0,T=t.matches)}}else{let t=Ft(404,{pathname:e.history.location.pathname}),{matches:r,route:n}=jt(o.activeRoutes);c=!0,u=!c,T=r,O={[n.id]:t}}let D,k,L={historyAction:e.history.action,location:e.history.location,matches:T,initialized:c,renderFallback:u,navigation:ze,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||O,fetchers:new Map,blockers:new Map},I="POP",F=null,H=!1,B=!1,z=new Map,$=null,U=!1,W=!1,V=new Set,q=new Map,Y=0,G=-1,X=new Map,Q=new Set,Z=new Map,ee=new Map,te=new Set,re=new Map,ne=null;function ie(e,t={}){e.matches&&(e.matches=e.matches.map(e=>{let t=s[e.route.id],r=e.route;return r.element!==t.element||r.errorElement!==t.errorElement||r.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e})),L={...L,...e};let r=[],n=[];L.fetchers.forEach((e,t)=>{"idle"===e.state&&(te.has(t)?r.push(t):n.push(t))}),te.forEach(e=>{L.fetchers.has(e)||q.has(e)||r.push(e)}),0===g.size&&(m={newErrors:e.errors??null}),[...g].forEach(n=>n(L,{deletedFetchers:r,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:!0===t.flushSync})),r.forEach(e=>fe(L.fetchers,e)),n.forEach(e=>L.fetchers.delete(e))}function ae(t,r,{flushSync:n}={}){let i,a=null!=L.actionData&&null!=L.navigation.formMethod&&Zt(L.navigation.formMethod)&&"loading"===L.navigation.state&&!0!==t.state?._isRedirect;i=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:a?L.actionData:null;let s=r.loaderData?Lt(L.loaderData,r.loaderData,r.matches||[],r.errors):L.loaderData,l=L.blockers;l.size>0&&(l=new Map(l),l.forEach((e,t)=>l.set(t,Ue)));let c,u=!U&&Re(t,r.matches||L.matches),d=!0===H||null!=L.navigation.formMethod&&Zt(L.navigation.formMethod)&&!0!==t.state?._isRedirect;if(o.commitHmrRoutes(),U||"POP"===I||("PUSH"===I?e.history.push(t,t.state):"REPLACE"===I&&e.history.replace(t,t.state)),"POP"===I){let e=z.get(L.location.pathname);e&&e.has(t.pathname)?c={currentLocation:L.location,nextLocation:t}:z.has(t.pathname)&&(c={currentLocation:t,nextLocation:L.location})}else if(B){let e=z.get(L.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),z.set(L.location.pathname,e)),c={currentLocation:L.location,nextLocation:t}}ie({...r,actionData:i,loaderData:s,historyAction:I,location:t,initialized:!0,renderFallback:!1,navigation:ze,revalidation:"idle",restoreScrollPosition:u,preventScrollReset:d,blockers:l},{viewTransitionOpts:c,flushSync:!0===n}),I="POP",H=!1,B=!1,U=!1,W=!1,F?.resolve(),F=null,ne?.resolve(),ne=null}async function se(t,r,i){D&&D.abort(),D=null,I=t,U=!0===(i&&i.startUninterruptedRevalidation),function(e,t){if(v&&b){let r=Pe(e,t);v[r]=b()}}(L.location,L.matches),H=!0===(i&&i.preventScrollReset),B=!0===(i&&i.enableViewTransition);let c=o.activeRoutes,u=i?.initialHydration&&L.matches&&L.matches.length>0&&!P?L.matches:N(c,r,l,!1,o.branches),d=!0===(i&&i.flushSync);if(u&&L.initialized&&!W&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(L.location,r)&&!(i&&i.submission&&Zt(i.submission.formMethod)))return void ae(r,{matches:u},{flushSync:d});let h=Oe(u,c,r.pathname);if(h.active&&h.matches&&(u=h.matches),!u){let{error:e,notFoundMatches:t,route:n}=Te(r.pathname);return void ae(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:d})}let p=i&&i.overrideNavigation?{...i.overrideNavigation,matches:u,historyAction:t}:void 0;D=new AbortController;let f,g=Pt(e.history,r,D.signal,i&&i.submission),m=e.getContext?await e.getContext():new R;if(i&&i.pendingError)f=[Nt(u).route.id,{type:"error",error:i.pendingError}];else if(i&&i.submission&&Zt(i.submission.formMethod)){let c=await async function(t,r,i,c,u,d,h,p,f={}){de();let g,m=function(e,t,r,n){let i={state:"submitting",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text};return i}(r,c,u,i);if(ie({navigation:m},{flushSync:!0===f.flushSync}),h){let e=await De(c,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=jt(o.activeRoutes);
56return{matches:t,pendingActionResult:[r.id,{type:"error",error:e.error}]}}let t=Nt(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:"error",error:e.error}]}}if(!e.matches){let{notFoundMatches:e,error:t,route:n}=Te(r.pathname);return{matches:e,pendingActionResult:[n.id,{type:"error",error:t}]}}c=e.matches}let v=tr(c,r);if(v.route.action||v.route.lazy){let e=wt(a,s,t,r,c,v,p?[]:n,d),i=await ce(t,r,e,d,null);if(g=i[v.route.id],!g)for(let e of c)if(i[e.route.id]){g=i[e.route.id];break}if(t.signal.aborted)return{shortCircuited:!0}}else g={type:"error",error:Ft(405,{method:t.method,pathname:r.pathname,routeId:v.route.id})};if(Yt(g)){let r;if(f&&null!=f.replace)r=f.replace;else{r=Ct(g.response.headers.get("Location"),new URL(t.url),l,e.history)===L.location.pathname+L.location.search}return await le(t,g,!0,{submission:i,replace:r}),{shortCircuited:!0}}if(qt(g)){let e=Nt(c,v.route.id);return!0!==(f&&f.replace)&&(I="PUSH"),{matches:c,pendingActionResult:[e.route.id,g,v.route.id]}}return{matches:c,pendingActionResult:[v.route.id,g]}}(g,r,i.submission,u,t,m,h.active,i&&!0===i.initialHydration,{replace:i.replace,flushSync:d});if(c.shortCircuited)return;if(c.pendingActionResult){let[e,t]=c.pendingActionResult;if(qt(t)&&ve(t.error)&&404===t.error.status)return D=null,void ae(r,{matches:c.matches,loaderData:{},errors:{[e]:t.error}})}u=c.matches||u,f=c.pendingActionResult,p=nr(r,u,t,i.submission),d=!1,h.active=!1,g=Pt(e.history,g.url,g.signal)}let{shortCircuited:y,matches:w,loaderData:x,errors:E,workingFetchers:S}=await async function(t,r,i,c,u,d,h,p,f,g,m,v,y,b){let w=h||nr(r,i,c,p),x=p||f||rr(w),E=!U&&!m;if(d){if(E){let e=oe(y);ie({navigation:w,...void 0!==e?{actionData:e}:{}},{flushSync:v})}let e=await De(i,r.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){if(0===e.partialMatches.length){let{matches:t,route:r}=jt(o.activeRoutes);return{matches:t,loaderData:{},errors:{[r.id]:e.error}}}let t=Nt(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(!e.matches){let{error:e,notFoundMatches:t,route:n}=Te(r.pathname);return{matches:t,loaderData:{},errors:{[n.id]:e}}}i=e.matches}let S=o.activeRoutes,{dsMatches:A,revalidatingFetchers:_}=tt(t,u,a,s,e.history,L,i,x,r,m?[]:n,!0===m,W,V,te,Z,Q,S,l,null!=e.patchRoutesOnNavigation,o.branches,y,b);if(G=++Y,!e.dataStrategy&&!A.some(e=>e.shouldLoad)&&!A.some(e=>e.route.middleware&&e.route.middleware.length>0)&&0===_.length){let e=new Map(L.fetchers),t=ye(e);return ae(r,{matches:i,loaderData:{},errors:y&&qt(y[1])?{[y[0]]:y[1].error}:null,...It(y),...t?{fetchers:e}:{}},{flushSync:v}),{shortCircuited:!0}}if(E){let e={};if(!d){e.navigation=w;let t=oe(y);void 0!==t&&(e.actionData=t)}_.length>0&&(e.fetchers=function(e){let t=new Map(L.fetchers);return e.forEach(e=>{let r=t.get(e.key),n=ir(void 0,r?r.data:void 0);t.set(e.key,n)}),t}(_)),ie(e,{flushSync:v})}_.forEach(e=>{ge(e.key),e.controller&&q.set(e.key,e.controller)});let T=()=>_.forEach(e=>ge(e.key));D&&D.signal.addEventListener("abort",T);let{loaderResults:C,fetcherResults:P}=await ue(A,_,t,r,u);if(t.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",T);_.forEach(e=>q.delete(e.key));let R=Ht(C);if(R)return await le(t,R.result,!0,{replace:g}),{shortCircuited:!0};if(R=Ht(P),R)return Q.add(R.key),await le(t,R.result,!0,{replace:g}),{shortCircuited:!0};let O=new Map(L.fetchers),{loaderData:k,errors:M}=Mt(L,i,C,y,_,P,O);m&&L.errors&&(M={...L.errors,...M});let I=ye(O),N=be(G,O),j=I||N||_.length>0;return{matches:i,loaderData:k,errors:M,...j?{workingFetchers:O}:{}}}(g,r,u,t,m,h.active,p,i&&i.submission,i&&i.fetcherSubmission,i&&i.replace,i&&!0===i.initialHydration,d,f,i&&i.callSiteDefaultShouldRevalidate);y||(D=null,ae(r,{matches:w||u,...It(f),loaderData:x,errors:E,...S?{fetchers:S}:{}}))}function oe(e){return e&&!qt(e[1])?{[e[0]]:e[1].data}:L.actionData?0===Object.keys(L.actionData).length?null:L.actionData:void 0}async function le(n,i,a,{submission:s,fetcherSubmission:o,preventScrollReset:c,replace:u}={}){a||(F?.resolve(),F=null),i.response.headers.has("X-Remix-Revalidate")&&(W=!0);let d=i.response.headers.get("Location");
56w(d,"Expected a Location header on the redirect Response"),d=Ct(d,new URL(n.url),l,e.history);let h=S(L.location,d,{_isRedirect:!0});if(r){let e=!1;if(i.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(J(d)){const r=C(t,d,!0);e=r.origin!==t.location.origin||null==K(r.pathname,l)}if(e)return void(u?t.location.replace(d):t.location.assign(d))}D=null;let p=!0===u||i.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:f,formAction:g,formEncType:m}=L.navigation;!s&&!o&&f&&g&&m&&(s=rr(L.navigation));let v=s||o;if(Be.has(i.response.status)&&v&&Zt(v.formMethod))await se(p,h,{submission:{...v,formAction:d},preventScrollReset:c||H,enableViewTransition:a?B:void 0});else{let e=nr(h,[],p,s);await se(p,h,{overrideNavigation:e,fetcherSubmission:o,preventScrollReset:c||H,enableViewTransition:a?B:void 0})}}async function ce(e,t,r,n,i){let a,s={};try{a=await xt(h,e,t,r,i,n,!1)}catch(e){return r.filter(e=>e.shouldLoad).forEach(t=>{s[t.route.id]={type:"error",error:e}}),s}if(e.signal.aborted)return s;if(!Zt(e.method))for(let e of r){if("error"===a[e.route.id]?.type)break;a.hasOwnProperty(e.route.id)||L.loaderData.hasOwnProperty(e.route.id)||L.errors&&L.errors.hasOwnProperty(e.route.id)||!e.shouldCallHandler()||(a[e.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,n]of Object.entries(a))if(Vt(n)){let i=n.result;s[t]={type:"redirect",response:At(i,e,t,r,l)}}else s[t]=await St(n);return s}async function ue(e,t,r,n,i){let a=ce(r,n,e,i,null),s=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await ce(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:"error",error:Ft(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await s).reduce((e,t)=>Object.assign(e,t),{})}}function de(){W=!0,Z.forEach((e,t)=>{q.has(t)&&V.add(t),ge(t)})}function he(e,t,r={}){let n=new Map(L.fetchers);n.set(e,t),ie({fetchers:n},{flushSync:!0===(r&&r.flushSync)})}function pe(e,t,r,n={}){let i=Nt(L.matches,t),a=new Map(L.fetchers);fe(a,e),ie({errors:{[i.route.id]:r},fetchers:a},{flushSync:!0===(n&&n.flushSync)})}function fe(e,t){let r=L.fetchers.get(t);!q.has(t)||r&&"loading"===r.state&&X.has(t)||ge(t),Z.delete(t),X.delete(t),Q.delete(t),te.delete(t),V.delete(t),e.delete(t)}function ge(e,t){let r=q.get(e);r&&(r.abort(t),q.delete(e))}function me(e,t){for(let r of e){let e=t.get(r);w(e,`Expected fetcher: ${r}`);let n=ar(e.data);t.set(r,n)}}function ye(e){let t=[],r=!1;for(let n of Q){let i=e.get(n);w(i,`Expected fetcher: ${n}`),"loading"===i.state&&(Q.delete(n),t.push(n),r=!0)}return me(t,e),r}function be(e,t){let r=[];for(let[n,i]of X)if(i<e){let e=t.get(n);w(e,`Expected fetcher: ${n}`),"loading"===e.state&&(ge(n),X.delete(n),r.push(n))}return me(r,t),r.length>0}function we(e){L.blockers.delete(e),re.delete(e)}function Se(e,t){let r=L.blockers.get(e)||Ue;w("unblocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"blocked"===t.state||"blocked"===r.state&&"proceeding"===t.state||"blocked"===r.state&&"unblocked"===t.state||"proceeding"===r.state&&"unblocked"===t.state,`Invalid blocker state transition: ${r.state} -> ${t.state}`);let n=new Map(L.blockers);n.set(e,t),ie({blockers:n})}function _e({currentLocation:e,nextLocation:t,historyAction:r}){if(0===re.size)return;re.size>1&&x(!1,"A router only supports one blocker at a time");let n=Array.from(re.entries()),[i,a]=n[n.length-1],s=L.blockers.get(i);return s&&"proceeding"===s.state?void 0:a({currentLocation:e,nextLocation:t,historyAction:r})?i:void 0}function Te(e){let t=Ft(404,{pathname:e}),r=o.activeRoutes,{matches:n,route:i}=jt(r);return{notFoundMatches:n,route:i,error:t}}function Pe(e,t){if(y){return y(e,t.map(e=>j(e,L.loaderData)))||e.key}return e.key}function Re(e,t){if(v){let r=Pe(e,t),n=v[r];if("number"==typeof n)return n}return null}function Oe(t,r,n){if(e.patchRoutesOnNavigation){let e=o.branches;if(!t){return{active:!0,matches:N(r,n,l,!0,e)||[]}}if(Object.keys(t[0].params).length>0){return{active:!0,matches:N(r,n,l,!0,e)}}}return{active:!1,matches:null}}async function De(t,r,n,i){if(!e.patchRoutesOnNavigation)return{type:"success",matches:t};let c=t;
56for(;;){let t=s;try{await e.patchRoutesOnNavigation({signal:n,path:r,matches:c,fetcherKey:i,patch:(e,r)=>{n.aborted||at(e,r,o,t,a,!1)}})}catch(e){return{type:"error",error:e,partialMatches:c}}if(n.aborted)return{type:"aborted"};let u=o.branches,d=N(o.activeRoutes,r,l,!1,u),h=null;if(d){if(0===Object.keys(d[0].params).length)return{type:"success",matches:d};if(h=N(o.activeRoutes,r,l,!0,u),!(h&&c.length<h.length&&ke(c,h.slice(0,c.length))))return{type:"success",matches:d}}if(h||(h=N(o.activeRoutes,r,l,!0,u)),!h||ke(c,h))return{type:"success",matches:null};c=h}}function ke(e,t){return e.length===t.length&&e.every((e,r)=>e.route.id===t[r].route.id)}return d={get basename(){return l},get future(){return p},get state(){return L},get routes(){return o.stableRoutes},get branches(){return o.branches},get manifest(){return s},get window(){return t},initialize:function(){if(f=e.history.listen(({action:t,location:r,delta:n})=>{if(k)return k(),void(k=void 0);x(0===re.size||null!=n,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=_e({currentLocation:L.location,nextLocation:r,historyAction:t});if(i&&null!=n){let t=new Promise(e=>{k=e});return e.history.go(-1*n),Se(i,{state:"blocked",location:r,proceed(){Se(i,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then(()=>e.history.go(n))},reset(){let e=new Map(L.blockers);e.set(i,Ue),ie({blockers:e})}}),F?.resolve(),void(F=null)}return se(t,r)}),r){!function(e,t){try{let r=e.sessionStorage.getItem(Ve);if(r){let e=JSON.parse(r);for(let[r,n]of Object.entries(e||{}))n&&Array.isArray(n)&&t.set(r,new Set(n||[]))}}catch(e){}}(t,z);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(Ve,JSON.stringify(r))}catch(e){x(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}(t,z);t.addEventListener("pagehide",e),$=()=>t.removeEventListener("pagehide",e)}return L.initialized||se("POP",L.location,{initialHydration:!0}),d},subscribe:function(e){if(g.add(e),m){let{newErrors:t}=m;m=null,e(L,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>g.delete(e)},enableScrollRestoration:function(e,t,r){if(v=e,b=t,y=r||null,!E&&L.navigation===ze){E=!0;let e=Re(L.location,L.matches);null!=e&&ie({restoreScrollPosition:e})}return()=>{v=null,b=null,y=null}},navigate:async function t(r,n){if(F?.resolve(),F=null,"number"==typeof r){F||(F=sr());let t=F.promise;return e.history.go(r),t}let i,a=Ze(L.location,L.matches,l,r,n?.fromRouteId,n?.relative),{path:s,submission:o,error:c}=et(!1,a,n);if(n?.mask){i={pathname:"",search:"",hash:"",..."string"==typeof n.mask?_(n.mask):{...L.location.mask,...n.mask}}}let u=L.location,d=S(u,s,n&&n.state,void 0,i);d={...d,...e.history.encodeLocation(d)};let h=n&&null!=n.replace?n.replace:void 0,p="PUSH";!0===h?p="REPLACE":!1===h||null!=o&&Zt(o.formMethod)&&o.formAction===L.location.pathname+L.location.search&&(p="REPLACE");let f=n&&"preventScrollReset"in n?!0===n.preventScrollReset:void 0,g=!0===(n&&n.flushSync),m=_e({currentLocation:u,nextLocation:d,historyAction:p});m?Se(m,{state:"blocked",location:d,proceed(){Se(m,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),t(r,n)},reset(){let e=new Map(L.blockers);e.set(m,Ue),ie({blockers:e})}}):await se(p,d,{submission:o,pendingError:c,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:g,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})},fetch:async function(t,r,i,c){ge(t);let u=!0===(c&&c.flushSync),d=o.activeRoutes,h=Ze(L.location,L.matches,l,i,r,c?.relative),p=N(d,h,l,!1,o.branches),f=Oe(p,d,h);if(f.active&&f.matches&&(p=f.matches),!p)return void pe(t,r,Ft(404,{pathname:h}),{flushSync:u});let{path:g,submission:m,error:v}=et(!0,h,c);if(v)return void pe(t,r,v,{flushSync:u});let y=e.getContext?await e.getContext():new R,b=!0===(c&&c.preventScrollReset);m&&Zt(m.formMethod)?await async function(t,r,i,c,u,d,h,p,f,g){de(),Z.delete(t);let m=L.fetchers.get(t);he(t,function(e,t){let r={state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0};return r}(f,m),{flushSync:h});let v=new AbortController,y=Pt(e.history,i,v.signal,f);if(d){let e=await De(c,new URL(y.url).pathname,y.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void pe(t,r,e.error,{flushSync:h});if(!e.matches)return void pe(t,r,Ft(404,{pathname:i}),{flushSync:h});c=e.matches}let b=tr(c,i);if(!b.route.action&&!b.route.lazy){let e=Ft(405,{method:f.formMethod,pathname:i,routeId:r});return void pe(t,r,e,{flushSync:h})}q.set(t,v);let x=Y,E=wt(a,s,y,i,c,b,n,u),S=await ce(y,i,E,u,t),A=S[b.route.id];if(!A)for(let e of E)if(S[e.route.id]){A=S[e.route.id];break}if(y.signal.aborted)return void(q.get(t)===v&&q.delete(t));if(te.has(t)){if(Yt(A)||qt(A))return void he(t,ar(void 0))}else{if(Yt(A))return q.delete(t),G>x?void he(t,ar(void 0)):(Q.add(t),he(t,ir(f)),le(y,A,!1,{fetcherSubmission:f,preventScrollReset:p}));if(qt(A))return void pe(t,r,A.error)}let _=L.navigation.location||L.location,T=Pt(e.history,_,v.signal),C=o.activeRoutes,P="idle"!==L.navigation.state?N(C,L.navigation.location,l,!1,o.branches):L.matches;w(P,"Didn't find any matches after fetcher action");let R=++Y;X.set(t,R);let{dsMatches:O,revalidatingFetchers:k}=tt(T,u,a,s,e.history,L,P,f,_,n,!1,W,V,te,Z,Q,C,l,null!=e.patchRoutesOnNavigation,o.branches,[b.route.id,A],g),M=ir(f,A.data),j=new Map(L.fetchers);j.set(t,M),k.filter(e=>
56e.key!==t).forEach(e=>{let t=e.key,r=j.get(t),n=ir(void 0,r?r.data:void 0);j.set(t,n),ge(t),e.controller&&q.set(t,e.controller)}),ie({fetchers:j});let F=()=>k.forEach(e=>ge(e.key));v.signal.addEventListener("abort",F);let{loaderResults:H,fetcherResults:B}=await ue(O,k,T,_,u);if(v.signal.aborted)return;v.signal.removeEventListener("abort",F),X.delete(t),q.delete(t),k.forEach(e=>q.delete(e.key));let z=L.fetchers.has(t),$=e=>{if(!z)return e;let r=new Map(e.fetchers);return r.set(t,ar(A.data)),{...e,fetchers:r}},U=Ht(H);if(U)return L=$(L),le(T,U.result,!1,{preventScrollReset:p});if(U=Ht(B),U)return Q.add(U.key),L=$(L),le(T,U.result,!1,{preventScrollReset:p});let K=new Map(L.fetchers);z&&K.set(t,ar(A.data));let{loaderData:J,errors:ee}=Mt(L,P,H,void 0,k,B,K);be(R,K),"loading"===L.navigation.state&&R>G?(w(I,"Expected pending action"),D&&D.abort(),ae(L.navigation.location,{matches:P,loaderData:J,errors:ee,fetchers:K})):(ie({errors:ee,loaderData:Lt(L.loaderData,J,P,ee),fetchers:K}),W=!1)}(t,r,g,p,y,f.active,u,b,m,c&&c.defaultShouldRevalidate):(Z.set(t,{routeId:r,path:g}),await async function(t,r,i,o,l,c,u,d,h){let p=L.fetchers.get(t);he(t,ir(h,p?p.data:void 0),{flushSync:u});let f=new AbortController,g=Pt(e.history,i,f.signal);if(c){let e=await De(o,new URL(g.url).pathname,g.signal,t);if("aborted"===e.type)return;if("error"===e.type)return void pe(t,r,e.error,{flushSync:u});if(!e.matches)return void pe(t,r,Ft(404,{pathname:i}),{flushSync:u});o=e.matches}let m=tr(o,i);q.set(t,f);let v=Y,y=wt(a,s,g,i,o,m,n,l),b=await ce(g,i,y,l,t),w=b[m.route.id];if(!w)for(let e of o)if(b[e.route.id]){w=b[e.route.id];break}q.get(t)===f&&q.delete(t);if(g.signal.aborted)return;if(te.has(t))return void he(t,ar(void 0));if(Yt(w))return G>v?void he(t,ar(void 0)):(Q.add(t),void await le(g,w,!1,{preventScrollReset:d}));if(qt(w))return void pe(t,r,w.error);he(t,ar(w.data))}(t,r,g,p,y,f.active,u,b,m))},revalidate:function(){ne||(ne=sr()),de(),ie({revalidation:"loading"});let e=ne.promise;return"submitting"===L.navigation.state?e:"idle"===L.navigation.state?(se(L.historyAction,L.location,{startUninterruptedRevalidation:!0}),e):(se(I||L.historyAction,L.navigation.location,{overrideNavigation:L.navigation,enableViewTransition:!0===B}),e)},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:function(e){return ee.set(e,(ee.get(e)||0)+1),te.has(e)&&te.delete(e),L.fetchers.get(e)||$e},resetFetcher:function(e,t){ge(e,t?.reason),he(e,ar(null))},deleteFetcher:function(e){let t=(ee.get(e)||0)-1;t<=0?(ee.delete(e),te.add(e)):ee.set(e,t),ie({fetchers:new Map(L.fetchers)})},dispose:function(){f&&f(),$&&$(),g.clear(),D&&D.abort(),L.fetchers.forEach((e,t)=>fe(L.fetchers,t)),L.blockers.forEach((e,t)=>we(t))},getBlocker:function(e,t){let r=L.blockers.get(e)||Ue;return re.get(e)!==t&&re.set(e,t),r},deleteBlocker:we,patchRoutes:function(e,t,r=!1){at(e,t,o,s,a,r),o.hasHMRRoutes||ie({})},_internalFetchControllers:q,_internalSetRoutes:function(e){s={},o.setHmrRoutes(M(e,a,void 0,s))},_internalSetStateDoNotUseOrYouWillBreakYourApp(e){ie(e)}},e.instrumentations&&(d=function(e,t){let r={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let n of t)e[n]&&r[n].push(e[n])}})),r.navigate.length>0){let t=e.navigate[xe]??e.navigate,n=Ae(r.navigate,t,(...t)=>{let[r,n]=t;return{to:"number"==typeof r||"string"==typeof r?r:r?A(r):".",...Ce(e,n??{})}});n&&(n[xe]=t,e.navigate=n)}if(r.fetch.length>0){let t=e.fetch[xe]??e.fetch,n=Ae(r.fetch,t,(...t)=>{let[r,,n,i]=t;return{href:n??".",fetcherKey:r,...Ce(e,i??{})}});n&&(n[xe]=t,e.fetch=n)}return e}(d,e.instrumentations.map(e=>e.router).filter(Boolean))),d}function Xe(e,t){w(e.length>0,"You must provide a non-empty routes array to createStaticHandler");let r={},n=(t?t.basename:null)||"/",i=t?.mapRouteProperties||We,a=i;if(t?.instrumentations){let e=t.instrumentations;a=t=>({...i(t),...Ee(e.map(e=>e.route).filter(Boolean),t)})}let s=M(e,a,void 0,r),o=F(s);async function l(e,t,n,i,s,o,l,d,h){w(e.signal,"query()/queryRoute() requests must contain an AbortController signal");try{if(Zt(e.method)){let p=await async function(e,t,n,i,s,o,l,d,h,p){let f;if(i.route.action||i.route.lazy){let l=wt(a,r,e,t,n,i,[],s);f=(await u(e,t,l,d,s,o))[i.route.id],e.signal.aborted&&Je(e,d)}else{let t=Ft(405,{method:e.method,pathname:new URL(e.url).pathname,routeId:i.route.id});if(d)throw t;f={type:"error",error:t}}if(Yt(f))throw new Response(null,{status:f.response.status,headers:{Location:f.response.headers.get("Location")}});if(d){if(qt(f))throw f.error;return{matches:[i],loaderData:{},actionData:{[i.route.id]:f.data},errors:null,statusCode:200,loaderHeaders:{},actionHeaders:{}}}
56if(p){if(qt(f)){let e=l?i:Nt(n,i.route.id);return{statusCode:ve(f.error)?f.error.status:null!=f.statusCode?f.statusCode:500,actionData:null,actionHeaders:{...f.headers?{[i.route.id]:f.headers}:{}},matches:n,loaderData:{},errors:{[e.route.id]:f.error},loaderHeaders:{}}}return{actionData:{[i.route.id]:f.data},actionHeaders:f.headers?{[i.route.id]:f.headers}:{},matches:n,loaderData:{},errors:null,statusCode:f.statusCode||200,loaderHeaders:{}}}let g=new Request(e.url,{headers:e.headers,redirect:e.redirect,signal:e.signal});if(qt(f)){let e=l?i:Nt(n,i.route.id);return{...await c(g,t,n,s,o,l,null,h,[e.route.id,f]),statusCode:ve(f.error)?f.error.status:null!=f.statusCode?f.statusCode:500,actionData:null,actionHeaders:{...f.headers?{[i.route.id]:f.headers}:{}}}}let m=await c(g,t,n,s,o,l,null,h);return{...m,actionData:{[i.route.id]:f.data},...f.statusCode?{statusCode:f.statusCode}:{},actionHeaders:f.headers?{[i.route.id]:f.headers}:{}}}(e,t,n,l||tr(n,t),i,s,o,null!=l,d,h);return p}let p=await c(e,t,n,i,s,o,l,d);return Xt(p)?p:{...p,actionData:null,actionHeaders:{}}}catch(e){if(Wt(e)&&Xt(e.result)){if("error"===e.type)throw e.result;return e.result}if(Jt(e))return e;throw e}}async function c(e,t,n,i,s,o,l,c,d){let h,p=null!=l;if(p&&!l?.route.loader&&!l?.route.lazy)throw Ft(400,{method:e.method,pathname:new URL(e.url).pathname,routeId:l?.route.id});if(l)h=wt(a,r,e,t,n,l,[],i);else{let s=d&&qt(d[1])?n.findIndex(e=>e.route.id===d[0])-1:void 0,o=ye(n);h=n.map((n,l)=>bt(a,r,e,t,o,n,[],i,!(null!=s&&l>s)&&(null!=(n.route.loader||n.route.lazy)&&(!c||c(n)))))}if(!s&&!h.some(e=>e.shouldLoad))return{matches:n,loaderData:{},errors:d&&qt(d[1])?{[d[0]]:d[1].error}:null,statusCode:200,loaderHeaders:{}};let f=await u(e,t,h,p,i,s);return e.signal.aborted&&Je(e,p),{...kt(n,f,d,!0,o),matches:n}}async function u(e,t,r,i,a,s){let o=await xt(s||ht,e,t,r,null,a,!0),l={};return await Promise.all(r.map(async t=>{if(!(t.route.id in o))return;let a=o[t.route.id];if(Vt(a)){throw At(a.result,e,t.route.id,r,n)}if(i){if(Xt(a.result))throw a;if(Gt(a.result))throw zt(a.result)}l[t.route.id]=await St(a)})),l}return{dataRoutes:s,_internalRouteBranches:o,query:async function(e,{requestContext:t,filterMatchesToLoad:i,skipLoaderErrorBubbling:c,skipRevalidation:u,dataStrategy:d,generateMiddlewareResponse:h,normalizePath:p}={}){let f=p||Qe,g=e.method,m=S("",f(e),null,"default"),v=N(s,m,n,!1,o);if(t=null!=t?t:new R,!Qt(g)&&"HEAD"!==g){let e=Ft(405,{method:g}),{matches:t,route:r}=jt(s),i={basename:n,location:m,matches:t,loaderData:{},actionData:null,errors:{[r.id]:e},statusCode:e.status,loaderHeaders:{},actionHeaders:{}};return h?h(()=>Promise.resolve(i)):i}if(!v){let e=Ft(404,{pathname:m.pathname}),{matches:t,route:r}=jt(s),i={basename:n,location:m,matches:t,loaderData:{},actionData:null,errors:{[r.id]:e},statusCode:e.status,loaderHeaders:{},actionHeaders:{}};return h?h(()=>Promise.resolve(i)):i}if(h){w(t instanceof R,"When using middleware in `staticHandler.query()`, any provided `requestContext` must be an instance of `RouterContextProvider`");try{let o;await dt(v,r,a);let p=await ft({request:e,url:Rt(e,m),pattern:ye(v),matches:v,params:v[0].params,context:t},async()=>await h(async(e,r={})=>{let a=await l(e,m,v,t,d||null,!0===c,null,"filterMatchesToLoad"in r?r.filterMatchesToLoad??null:i??null,!0===u);return Xt(a)?a:(o={location:m,basename:n,...a},o)}),async(e,t)=>{if(Jt(e))return e;if(Xt(e))try{e=new me(e.status,e.statusText,await Et(e))}catch(t){e=t}if(Gt(e)&&(e=$t(e)),o){t in o.loaderData&&(o.loaderData[t]=void 0);let r=Ke(s,o,e,c?t:Nt(v,t).route.id);return h(()=>Promise.resolve(r))}{let r=c?t:Nt(v,v.find(e=>e.route.id===t||e.route.loader)?.route.id||t).route.id,i={matches:v,location:m,basename:n,loaderData:{},actionData:null,errors:{[r]:e},statusCode:ve(e)?e.status:500,actionHeaders:{},loaderHeaders:{}};return h(()=>Promise.resolve(i))}});return w(Xt(p),"Expected a response in query()"),p}catch(e){if(Xt(e))return e;throw e}}let y=await l(e,m,v,t,d||null,!0===c,null,i||null,!0===u);return Xt(y)?y:{location:m,basename:n,...y}},queryRoute:async function(e,{routeId:t,requestContext:i,dataStrategy:c,generateMiddlewareResponse:u,normalizePath:d}={}){let h=d||Qe,p=e.method,f=S("",h(e),null,"default"),g=N(s,f,n,!1,o);if(i=null!=i?i:new R,!Qt(p)&&"HEAD"!==p&&"OPTIONS"!==p)throw Ft(405,{method:p});if(!g)throw Ft(404,{pathname:f.pathname});let m=t?g.find(e=>e.route.id===t):tr(g,f);if(t&&!m)throw Ft(403,{pathname:f.pathname,routeId:t});if(!m)throw Ft(404,{pathname:f.pathname});if(u){return w(i instanceof R,"When using middleware in `staticHandler.queryRoute()`, any provided `requestContext` must be an instance of `RouterContextProvider`"),await dt(g,r,a),await ft({request:e,url:Rt(e,f),pattern:ye(g),matches:g,params:g[0].params,context:i},async()=>await u(async e=>{let t=v(await l(e,f,g,i,c||null,!1,m,null,!1));return Xt(t)?t:"string"==typeof t?new Response(t):Response.json(t)}),e=>{if(Gt(e))return Promise.resolve(zt(e));if(Xt(e))return Promise.resolve(e);throw e})}return v(await l(e,f,g,i,c||null,!1,m,null,!1));function v(e){if(Xt(e))return e;let t=e.errors?Object.values(e.errors)[0]:void 0;if(void 0!==t)throw t;return e.actionData?Object.values(e.actionData)[0]:e.loaderData?Object.values(e.loaderData)[0]:void 0}}}}function Ke(e,t,r,n){let i=n||t._deepestRenderedBoundaryId||e[0].id;return{...t,statusCode:ve(r)?r.status:500,errors:{[i]:r}}}function Je(e,t){if(void 0!==e.signal.reason)throw e.signal.reason;throw new Error(`${t?"queryRoute":"query"}() call aborted without an \`AbortSignal.reason\`: ${e.method} ${e.url}`)}function Qe(e){let t=new URL(e.url);return{pathname:t.pathname,search:t.search,hash:t.hash}}function Ze(e,t,r,n,i,a){let s,o;
56if(i){s=[];for(let e of t)if(s.push(e),e.route.id===i){o=e;break}}else s=t,o=t[t.length-1];let l=ne(n||".",re(s),K(e.pathname,r)||e.pathname,"path"===a);if(null==n&&(l.search=e.search,l.hash=e.hash),(null==n||""===n||"."===n)&&o){let e=er(l.search);if(o.route.index&&!e)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!o.route.index&&e){let e=new URLSearchParams(l.search),t=e.getAll("index");e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();l.search=r?`?${r}`:""}}return"/"!==r&&(l.pathname=function({basename:e,pathname:t}){return"/"===t?e:ae([e,t])}({basename:r,pathname:l.pathname})),A(l)}function et(e,t,r){if(!r||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(r))return{path:t};if(r.formMethod&&!Qt(r.formMethod))return{path:t,error:Ft(405,{method:r.formMethod})};let n,i,a=()=>({path:t,error:Ft(400,{type:"invalid-body"})}),s=(r.formMethod||"get").toUpperCase(),o=Bt(t);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!Zt(s))return a();let e="string"==typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((e,[t,r])=>`${e}${t}=${r}\n`,""):String(r.body);return{path:t,submission:{formMethod:s,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===r.formEncType){if(!Zt(s))return a();try{let e="string"==typeof r.body?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:s,formAction:o,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch(e){return a()}}}if(w("function"==typeof FormData,"FormData is not available in this environment"),r.formData)n=Ot(r.formData),i=r.formData;else if(r.body instanceof FormData)n=Ot(r.body),i=r.body;else if(r.body instanceof URLSearchParams)n=r.body,i=Dt(n);else if(null==r.body)n=new URLSearchParams,i=new FormData;else try{n=new URLSearchParams(r.body),i=Dt(n)}catch(e){return a()}let l={formMethod:s,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:i,json:void 0,text:void 0};if(Zt(l.formMethod))return{path:t,submission:l};let c=_(t);return e&&c.search&&er(c.search)&&n.append("index",""),c.search=`?${n}`,{path:A(c),submission:l}}function tt(e,t,r,n,i,a,s,o,l,c,u,d,h,p,f,g,m,v,y,b,w,x){let E,S=w?qt(w[1])?w[1].error:w[1].data:void 0,A=i.createURL(a.location),_=i.createURL(l);if(u&&a.errors){let e=Object.keys(a.errors)[0];E=s.findIndex(t=>t.route.id===e)}else if(w&&qt(w[1])){let e=w[0];E=s.findIndex(t=>t.route.id===e)-1}let T=w?w[1].statusCode:void 0,C=T&&T>=400,P={currentUrl:A,currentParams:a.matches[0]?.params||{},nextUrl:_,nextParams:s[0].params,...o,actionResult:S,actionStatus:T},R=ye(s),O=s.map((i,s)=>{let{route:o}=i,h=null;if(null!=E&&s>E)h=!1;else if(o.lazy)h=!0;else if(rt(o))if(u){let{shouldLoad:e}=nt(o,a.loaderData,a.errors);h=e}else(function(e,t,r){let n=!t||r.route.id!==t.route.id,i=!e.hasOwnProperty(r.route.id);return n||i})(a.loaderData,a.matches[s],i)&&(h=!0);else h=!1;if(null!==h)return bt(r,n,e,l,R,i,c,t,h);let p=!1;"boolean"==typeof x?p=x:C?p=!1:(d||A.pathname+A.search===_.pathname+_.search||A.search!==_.search||function(e,t){let r=e.route.path;return e.pathname!==t.pathname||null!=r&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}(a.matches[s],i))&&(p=!0);let f={...P,defaultShouldRevalidate:p},g=it(i,f);return bt(r,n,e,l,R,i,c,t,g,f,x)}),D=[];return f.forEach((e,o)=>{if(u||!s.some(t=>t.route.id===e.routeId)||p.has(o))return;let l=a.fetchers.get(o),f=l&&"idle"!==l.state&&void 0===l.data,w=N(m,e.path,v??"/",!1,b);if(!w){if(y&&f)return;return void D.push({key:o,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null})}if(g.has(o))return;let E=tr(w,e.path),S=new AbortController,A=Pt(i,e.path,S.signal),_=null;if(h.has(o))h.delete(o),_=wt(r,n,A,e.path,w,E,c,t);else if(f)d&&(_=wt(r,n,A,e.path,w,E,c,t));else{let i;i="boolean"==typeof x?x:!C&&d;let a={...P,defaultShouldRevalidate:i};it(E,a)&&(_=wt(r,n,A,e.path,w,E,c,t,a))}_&&D.push({key:o,routeId:e.routeId,path:e.path,matches:_,match:E,request:A,controller:S})}),{dsMatches:O,revalidatingFetchers:D}}function rt(e){return null!=e.loader||null!=e.middleware&&e.middleware.length>0}function nt(e,t,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!rt(e))return{shouldLoad:!1,renderFallback:!1};let n=null!=t&&e.id in t,i=null!=r&&void 0!==r[e.id];if(!n&&i)return{shouldLoad:!1,renderFallback:!1};if("function"==typeof e.loader&&!0===e.loader.hydrate)return{shouldLoad:!0,renderFallback:!n};let a=!n&&!i;return{shouldLoad:a,renderFallback:a}}function it(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if("boolean"==typeof r)return r}return t.defaultShouldRevalidate}function at(e,t,r,n,i,a){let s;if(e){let t=n[e];w(t,`No route found to patch children into: routeId = ${e}`),t.children||(t.children=[]),s=t.children}else s=r.activeRoutes;let o=[],l=[];
56if(t.forEach(e=>{let t=s.find(t=>st(e,t));t?l.push({existingRoute:t,newRoute:e}):o.push(e)}),o.length>0){let t=M(o,i,[e||"_","patch",String(s?.length||"0")],n);s.push(...t)}if(a&&l.length>0)for(let e=0;e<l.length;e++){let{existingRoute:t,newRoute:r}=l[e],n=t,[a]=M([r],i,[],{},!0);Object.assign(n,{element:a.element?a.element:n.element,errorElement:a.errorElement?a.errorElement:n.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:n.hydrateFallbackElement})}r.hasHMRRoutes||r.setRoutes([...r.activeRoutes])}function st(e,t){return"id"in e&&"id"in t&&e.id===t.id||e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive&&(!(e.children&&0!==e.children.length||t.children&&0!==t.children.length)||(e.children?.every((e,r)=>t.children?.some(t=>st(e,t)))??!1))}De=new WeakMap,ke=new WeakMap,Me=new WeakMap,Le=new WeakMap;var ot=new WeakMap,lt=({key:e,route:t,manifest:r,mapRouteProperties:n})=>{let i=r[t.id];if(w(i,"No route found in manifest"),!i.lazy||"object"!=typeof i.lazy)return;let a=i.lazy[e];if(!a)return;let s=ot.get(i);s||(s={},ot.set(i,s));let o=s[e];if(o)return o;let l=(async()=>{let t=function(e){return O.has(e)}(e),r=void 0!==i[e]&&"hasErrorBoundary"!==e;if(t)x(!t,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),s[e]=Promise.resolve();else if(r)x(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();null!=t&&(Object.assign(i,{[e]:t}),Object.assign(i,n(i)))}"object"==typeof i.lazy&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>void 0===e)&&(i.lazy=void 0))})();return s[e]=l,l},ct=new WeakMap;function ut(e){return void 0!==e}function dt(e,t,r){let n=e.map(({route:e})=>{if("object"==typeof e.lazy&&e.lazy.middleware)return lt({key:"middleware",route:e,manifest:t,mapRouteProperties:r})}).filter(ut);return n.length>0?Promise.all(n):void 0}async function ht(e){let t=e.matches.filter(e=>e.shouldLoad),r={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,n)=>{r[t[n].route.id]=e}),r}async function pt(e){return e.matches.some(e=>e.route.middleware)?gt(e,()=>ht(e)):ht(e)}function ft(e,t,r){return mt(e,t,function(e){return Gt(e)?zt(e):e},Xt,r)}function gt(e,t){return mt(e,t,e=>{if(Jt(e))throw e;return e},Ut,function(t,r,n){if(n)return Promise.resolve(Object.assign(n.value,{[r]:{type:"error",result:t}}));{let{matches:n}=e,i=Math.min(Math.max(n.findIndex(e=>e.route.id===r),0),Math.max(n.findIndex(e=>e.shouldCallHandler()),0)),a=Nt(n,n[i].route.id).route.id;return Promise.resolve({[a]:{type:"error",result:t}})}})}async function mt(e,t,r,n,i){let{matches:a,...s}=e,o=a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]);return await vt(s,o,t,r,n,i)}async function vt(e,t,r,n,i,a,s=0){let{request:o}=e;if(o.signal.aborted)throw o.signal.reason??new Error(`Request aborted: ${o.method} ${o.url}`);let l=t[s];if(!l){return await r()}let c,[u,d]=l,h=async()=>{if(c)throw new Error("You may only call `next()` once per middleware");try{let o=await vt(e,t,r,n,i,a,s+1);return c={value:o},c.value}catch(e){return c={value:await a(e,u,c)},c.value}};try{let t=await d(e,h),r=null!=t?n(t):void 0;return i(r)?r:c?r??c.value:(c={value:await h()},c.value)}catch(e){return await a(e,u,c)}}function yt(e,t,r,n,i){let a=lt({key:"middleware",route:n.route,manifest:t,mapRouteProperties:e}),s=function(e,t,r,n,i){let a=r[e.id];if(w(a,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if("function"==typeof e.lazy){let t=ct.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let r=(async()=>{w("function"==typeof e.lazy,"No lazy route function found");let t=await e.lazy(),r={};for(let e in t){let n=t[e];if(void 0===n)continue;let i=k(e),s=void 0!==a[e]&&"hasErrorBoundary"!==e;i?x(!i,"Route property "+e+" is not a supported property to be returned from a lazy route function. This property will be ignored."):s?x(!s,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):r[e]=n}Object.assign(a,r),Object.assign(a,{...n(a),lazy:void 0})})();return ct.set(a,r),r.catch(()=>{}),{lazyRoutePromise:r,lazyHandlerPromise:r}}let s,o=Object.keys(e.lazy),l=[];for(let a of o){if(i&&i.includes(a))continue;let o=lt({key:a,route:e,manifest:r,mapRouteProperties:n});
56o&&(l.push(o),a===t&&(s=o))}let c=l.length>0?Promise.all(l).then(()=>{}):void 0;return c?.catch(()=>{}),s?.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:s}}(n.route,Zt(r.method)?"action":"loader",t,e,i);return{middleware:a,route:s.lazyRoutePromise,handler:s.lazyHandlerPromise}}function bt(e,t,r,n,i,a,s,o,l,c=null,u){let d=!1,h=yt(e,t,r,a,s);return{...a,_lazyPromises:h,shouldLoad:l,shouldRevalidateArgs:c,shouldCallHandler:e=>(d=!0,c?it(a,"boolean"==typeof u?{...c,defaultShouldRevalidate:u}:"boolean"==typeof e?{...c,defaultShouldRevalidate:e}:c):l),resolve(e){let{lazy:t,loader:s,middleware:c}=a.route,u=d||l||e&&!Zt(r.method)&&(t||s),p=c&&c.length>0&&!s&&!t;return!u||!Zt(r.method)&&p?Promise.resolve({type:"data",result:void 0}):async function({request:e,path:t,pattern:r,match:n,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:s,scopedContext:o}){let l,c,u=Zt(e.method),d=u?"action":"loader",h=i=>{let a,l=new Promise((e,t)=>a=t);c=()=>a(),e.signal.addEventListener("abort",c);let u=a=>"function"!=typeof i?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${n.route.id}]`)):i({request:e,url:Rt(e,t),pattern:r,params:n.params,context:o},...void 0!==a?[a]:[]),h=(async()=>{try{return{type:"data",result:await(s?s(e=>u(e)):u())}}catch(e){return{type:"error",result:e}}})();return Promise.race([h,l])};try{let t=u?n.route.action:n.route.loader;if(i||a)if(t){let e,[r]=await Promise.all([h(t).catch(t=>{e=t}),i,a]);if(void 0!==e)throw e;l=r}else{await i;let t=u?n.route.action:n.route.loader;if(!t){if("action"===d){let t=new URL(e.url),r=t.pathname+t.search;throw Ft(405,{method:e.method,pathname:r,routeId:n.route.id})}return{type:"data",result:void 0}}[l]=await Promise.all([h(t),a])}else{if(!t){let t=new URL(e.url);throw Ft(404,{pathname:t.pathname+t.search})}l=await h(t)}}catch(e){return{type:"error",result:e}}finally{c&&e.signal.removeEventListener("abort",c)}return l}({request:r,path:n,pattern:i,match:a,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:e,scopedContext:o})}}}function wt(e,t,r,n,i,a,s,o,l=null){return i.map(c=>c.route.id!==a.route.id?{...c,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:yt(e,t,r,c,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:bt(e,t,r,n,ye(i),c,s,o,!0,l))}async function xt(e,t,r,n,i,a,s){n.some(e=>e._lazyPromises?.middleware)&&await Promise.all(n.map(e=>e._lazyPromises?.middleware));let o={request:t,url:Rt(t,r),pattern:ye(n),params:n[0].params,context:a,matches:n},l=s?()=>{throw new Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=o;return gt(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},c=await e({...o,fetcherKey:i,runClientMiddleware:l});try{await Promise.all(n.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch(e){}return c}async function Et(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}async function St(e){let{result:t,type:r}=e;if(Xt(t)){let e;try{e=await Et(t)}catch(e){return{type:"error",error:e}}return"error"===r?{type:"error",error:new me(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:"data",data:e,statusCode:t.status,headers:t.headers}}return"error"===r?Gt(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:$t(t),statusCode:ve(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ve(t)?t.status:void 0}:Gt(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function At(e,t,r,n,i){let a=e.headers.get("Location");if(w(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!J(a)){let s=n.slice(0,n.findIndex(e=>e.route.id===r)+1);a=Ze(new URL(t.url),s,i,a),e.headers.set("Location",a)}return e}var _t=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Tt(e){try{return _t.includes(new URL(e).protocol)}catch{return!1}}function Ct(e,t,r,n){if(J(e)){let n=e,i=d.test(n)?new URL(h(n,t.protocol)):new URL(n);if(Tt(i.toString()))throw new Error("Invalid redirect location");let a=null!=K(i.pathname,r);
56if(i.origin===t.origin&&a)return ie(i.pathname)+i.search+i.hash}try{if(Tt(n.createURL(e).toString()))throw new Error("Invalid redirect location")}catch(e){}return e}function Pt(e,t,r,n){let i=e.createURL(Bt(t)).toString(),a={signal:r};if(n&&Zt(n.formMethod)){let{formMethod:e,formEncType:t}=n;a.method=e.toUpperCase(),"application/json"===t?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(n.json)):"text/plain"===t?a.body=n.text:"application/x-www-form-urlencoded"===t&&n.formData?a.body=Ot(n.formData):a.body=n.formData}return new Request(i,a)}function Rt(e,t){let r=new URL(e.url),n="string"==typeof t?_(t):t;if(r.pathname=n.pathname||"/",n.search){let e=new URLSearchParams(n.search),t=e.getAll("index");e.delete("index");for(let r of t.filter(Boolean))e.append("index",r);r.search=e.size?`?${e.toString()}`:""}else r.search="";return r.hash=n.hash||"",r}function Ot(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,"string"==typeof n?n:n.name);return t}function Dt(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function kt(e,t,r,n=!1,i=!1){let a,s={},o=null,l=!1,c={},u=r&&qt(r[1])?r[1].error:void 0;return e.forEach(r=>{if(!(r.route.id in t))return;let d=r.route.id,h=t[d];if(w(!Yt(h),"Cannot handle redirect results in processLoaderData"),qt(h)){let t=h.error;if(void 0!==u&&(t=u,u=void 0),o=o||{},i)o[d]=t;else{let r=Nt(e,d);null==o[r.route.id]&&(o[r.route.id]=t)}n||(s[d]=qe),l||(l=!0,a=ve(h.error)?h.error.status:500),h.headers&&(c[d]=h.headers)}else s[d]=h.data,h.statusCode&&200!==h.statusCode&&!l&&(a=h.statusCode),h.headers&&(c[d]=h.headers)}),void 0!==u&&r&&(o={[r[0]]:u},r[2]&&(s[r[2]]=void 0)),{loaderData:s,errors:o,statusCode:a||200,loaderHeaders:c}}function Mt(e,t,r,n,i,a,s){let{loaderData:o,errors:l}=kt(t,r,n);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:r,match:n,controller:i}=t;if(i&&i.signal.aborted)return;let o=a[r];if(w(o,"Did not find corresponding fetcher result"),qt(o)){let t=Nt(e.matches,n?.route.id);l&&l[t.route.id]||(l={...l,[t.route.id]:o.error}),s.delete(r)}else if(Yt(o))w(!1,"Unhandled fetcher revalidation redirect");else{let e=ar(o.data);s.set(r,e)}}),{loaderData:o,errors:l}}function Lt(e,t,r,n){let i=Object.entries(t).filter(([,e])=>e!==qe).reduce((e,[t,r])=>(e[t]=r,e),{});for(let a of r){let r=a.route.id;if(!t.hasOwnProperty(r)&&e.hasOwnProperty(r)&&a.route.loader&&(i[r]=e[r]),n&&n.hasOwnProperty(r))break}return i}function It(e){return e?qt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Nt(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>!0===e.route.hasErrorBoundary)||e[0]}function jt(e){let t=1===e.length?e[0]:e.find(e=>e.index||!e.path||"/"===e.path)||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ft(e,{pathname:t,routeId:r,method:n,type:i,message:a}={}){let s="Unknown Server Error",o="Unknown @remix-run/router error";return 400===e?(s="Bad Request",n&&t&&r?o=`You made a ${n} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:"invalid-body"===i&&(o="Unable to encode submission body")):403===e?(s="Forbidden",o=`Route "${r}" does not match URL "${t}"`):404===e?(s="Not Found",o=`No route matches URL "${t}"`):405===e&&(s="Method Not Allowed",n&&t&&r?o=`You made a ${n.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:n&&(o=`Invalid request method "${n.toUpperCase()}"`)),new me(e||500,s,new Error(o),!0)}function Ht(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[r,n]=t[e];if(Yt(n))return{key:r,result:n}}}function Bt(e){return A({..."string"==typeof e?_(e):e,hash:""})}function zt(e){return Response.json(e.data,e.init??void 0)}function $t(e){return new me(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function Ut(e){return null!=e&&"object"==typeof e&&Object.entries(e).every(([e,t])=>"string"==typeof e&&Wt(t))}function Wt(e){return null!=e&&"object"==typeof e&&"type"in e&&"result"in e&&("data"===e.type||"error"===e.type)}function Vt(e){return Xt(e.result)&&He.has(e.result.status)}function qt(e){return"error"===e.type}function Yt(e){return"redirect"===(e&&e.type)}function Gt(e){return"object"==typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function Xt(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"object"==typeof e.headers&&void 0!==e.body}function Kt(e){return He.has(e)}function Jt(e){return Xt(e)&&Kt(e.status)&&e.headers.has("Location")}function Qt(e){return Fe.has(e.toUpperCase())}function Zt(e){return Ne.has(e.toUpperCase())}function er(e){return new URLSearchParams(e).getAll("index").some(e=>""===e)}function tr(e,t){let r="string"==typeof t?_(t).search:t.search;if(e[e.length-1].route.index&&er(r||""))return e[e.length-1];let n=te(e);return n[n.length-1]}function rr(e){let{formMethod:t,formAction:r,formEncType:n,text:i,formData:a,json:s}=e;if(t&&r&&n)return null!=i?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:i}:null!=a?{formMethod:t,formAction:r,formEncType:n,formData:a,json:void 0,text:void 0}:void 0!==s?{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:s,text:void 0}:void 0}function nr(e,t,r,n){if(n){return{state:"loading",location:e,matches:t,historyAction:r,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}return{state:"loading",location:e,matches:t,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ir(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function ar(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function sr(){let e,t,r=new Promise((n,i)=>{e=async e=>{n(e);try{await r}catch(e){}},t=async e=>{i(e);try{await r}catch(e){}}});return{promise:r,resolve:e,reject:t}}var or=i.createContext(null);or.displayName="DataRouter";var lr=i.createContext(null);lr.displayName="DataRouterState";var cr=i.createContext(!1);function ur(){return i.useContext(cr)}var dr=i.createContext({isTransitioning:!1});dr.displayName="ViewTransition";var hr=i.createContext(new Map);hr.displayName="Fetchers";var pr=i.createContext(null);pr.displayName="Await";var fr=e=>i.createElement(pr.Provider,e),gr=i.createContext(null);
56gr.displayName="Navigation";var mr=i.createContext(null);mr.displayName="Location";var vr=i.createContext({outlet:null,matches:[],isDataRoute:!1});vr.displayName="Route";var yr=i.createContext(null);yr.displayName="RouteError";var br=!0,wr="REACT_ROUTER_ERROR";function xr(e){if(e.startsWith(`${wr}:REDIRECT:{`))try{let t=JSON.parse(e.slice(28));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText&&"string"==typeof t.location&&"boolean"==typeof t.reloadDocument&&"boolean"==typeof t.replace)return t}catch{}}function Er(e){if(e.startsWith(`${wr}:ROUTE_ERROR_RESPONSE:{`))try{let t=JSON.parse(e.slice(40));if("object"==typeof t&&t&&"number"==typeof t.status&&"string"==typeof t.statusText)return new me(t.status,t.statusText,t.data)}catch{}}function Sr(e,{relative:t}={}){w(Ar(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=i.useContext(gr),{hash:a,pathname:s,search:o}=Ir(e,{relative:t}),l=s;return"/"!==r&&(l="/"===s?r:ae([r,s])),n.createHref({pathname:l,search:o,hash:a})}function Ar(){return null!=i.useContext(mr)}function _r(){return w(Ar(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(mr).location}function Tr(){return i.useContext(mr).navigationType}function Cr(e){w(Ar(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=_r();return i.useMemo(()=>q(e,X(t)),[t,e])}var Pr="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Rr(e){i.useContext(gr).static||i.useLayoutEffect(e)}function Or(){let{isDataRoute:e}=i.useContext(vr);return e?function(){let{router:e}=qr("useNavigate"),t=Gr("useNavigate"),r=i.useRef(!1);return Rr(()=>{r.current=!0}),i.useCallback(async(n,i={})=>{x(r.current,Pr),r.current&&("number"==typeof n?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...i}))},[e,t])}():function(){w(Ar(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(or),{basename:t,navigator:r}=i.useContext(gr),{matches:n}=i.useContext(vr),{pathname:a}=_r(),s=JSON.stringify(re(n)),o=i.useRef(!1);return Rr(()=>{o.current=!0}),i.useCallback((n,i={})=>{if(x(o.current,Pr),!o.current)return;if("number"==typeof n)return void r.go(n);let l=ne(n,JSON.parse(s),a,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:ae([t,l.pathname])),(i.replace?r.replace:r.push)(l,i.state,i)},[t,r,s,a,e])}()}var Dr=i.createContext(null);function kr(){return i.useContext(Dr)}function Mr(e){let t=i.useContext(vr).outlet;return i.useMemo(()=>t&&i.createElement(Dr.Provider,{value:e},t),[t,e])}function Lr(){let{matches:e}=i.useContext(vr),t=e[e.length-1];return t?.params??{}}function Ir(e,{relative:t}={}){let{matches:r}=i.useContext(vr),{pathname:n}=_r(),a=JSON.stringify(re(r));return i.useMemo(()=>ne(e,JSON.parse(a),n,"path"===t),[e,a,n,t])}function Nr(e,t){return jr(e,t)}function jr(e,t,r){w(Ar(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=i.useContext(gr),{matches:a}=i.useContext(vr),s=a[a.length-1],o=s?s.params:{},l=s?s.pathname:"/",c=s?s.pathnameBase:"/",u=s&&s.route;if(br){let e=u&&u.path||"";ln(l,!u||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}let d,h=_r();if(t){let e="string"==typeof t?_(t):t;w("/"===c||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=h;let p=d.pathname||"/",f=p;if("/"!==c){let e=c.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=r&&r.state.matches.length?r.state.matches.map(e=>Object.assign(e,{route:r.manifest[e.route.id]||e.route})):I(e,{pathname:f});br&&(x(u||null!=g,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),x(null==g||void 0!==g[g.length-1].route.element||void 0!==g[g.length-1].route.Component||void 0!==g[g.length-1].route.lazy,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let m=Wr(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:ae([c,n.encodeLocation?n.encodeLocation(e.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:ae([c,n.encodeLocation?n.encodeLocation(e.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:e.pathnameBase])})),a,r);return t&&m?i.createElement(mr.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},m):m}function Fr(){let e=tn(),t=ve(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},s={padding:"2px 4px",backgroundColor:n},o=null;return br&&(console.error("Error handled by React Router default ErrorBoundary:",e),o=i.createElement(i.Fragment,null,i.createElement("p",null,"ð¿ Hey developer ð"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:s},"ErrorBoundary")," or"," ",i.createElement("code",{style:s},"errorElement")," prop on your route."))),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application
56Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),r?i.createElement("pre",{style:a},r):null,o)}var Hr=i.createElement(Fr,null),Br=class extends i.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&"object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){const t=Er(e.digest);t&&(e=t)}let t=void 0!==e?i.createElement(vr.Provider,{value:this.props.routeContext},i.createElement(yr.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?i.createElement($r,{error:e},t):t}};Br.contextType=cr;var zr=new WeakMap;function $r({children:e,error:t}){let{basename:r}=i.useContext(gr);if("object"==typeof t&&t&&"digest"in t&&"string"==typeof t.digest){let e=xr(t.digest);if(e){let n=zr.get(t);if(n)throw n;let a=we(e.location,r),s=a.absoluteURL||a.to;if(Tt(s))throw new Error("Invalid redirect location");if(be&&!zr.get(t)){if(!a.isExternal&&!e.reloadDocument){const r=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw zr.set(t,r),r}window.location.href=s}return i.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s}`})}}return e}function Ur({routeContext:e,match:t,children:r}){let n=i.useContext(or);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(vr.Provider,{value:e},r)}function Wr(e,t=[],r){let n=r?.state;if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let a=e,s=n?.errors;if(null!=s){let e=a.findIndex(e=>e.route.id&&void 0!==s?.[e.route.id]);w(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),a=a.slice(0,Math.min(a.length,e+1))}let o=!1,l=-1;if(r&&n){o=n.renderFallback;for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(l=e),t.route.id){let{loaderData:e,errors:i}=n,s=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!i||void 0===i[t.route.id]);if(t.route.lazy||s){r.isStatic&&(o=!0),a=l>=0?a.slice(0,l+1):[a[0]];break}}}}let c=r?.onError,u=n&&c?(e,t)=>{c(e,{location:n.location,params:n.matches?.[0]?.params??{},pattern:ye(n.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,c)=>{let d,h=!1,p=null,f=null;n&&(d=s&&r.route.id?s[r.route.id]:void 0,p=r.route.errorElement||Hr,o&&(l<0&&0===c?(ln("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,f=null):l===c&&(h=!0,f=r.route.hydrateFallbackElement||null)));let g=t.concat(a.slice(0,c+1)),m=()=>{let t;return t=d?p:h?f:r.route.Component?i.createElement(r.route.Component,null):r.route.element?r.route.element:e,i.createElement(Ur,{match:r,routeContext:{outlet:e,matches:g,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===c)?i.createElement(Br,{location:n.location,revalidation:n.revalidation,component:p,error:d,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:u}):m()},null)}function Vr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qr(e){let t=i.useContext(or);return w(t,Vr(e)),t}function Yr(e){let t=i.useContext(lr);return w(t,Vr(e)),t}function Gr(e){let t=function(e){let t=i.useContext(vr);return w(t,Vr(e)),t}(e),r=t.matches[t.matches.length-1];return w(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Xr(){let e=Yr("useNavigation");return i.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}function Kr(){let e=qr("useRevalidator"),t=Yr("useRevalidator"),r=i.useCallback(async()=>{await e.router.revalidate()},[e.router]);return i.useMemo(()=>({revalidate:r,state:t.revalidation}),[r,t.revalidation])}function Jr(){let{matches:e,loaderData:t}=Yr("useMatches");return i.useMemo(()=>e.map(e=>j(e,t)),[e,t])}function Qr(){let e=Yr("useLoaderData"),t=Gr("useLoaderData");return e.loaderData[t]}function Zr(e){return Yr("useRouteLoaderData").loaderData[e]}function en(){let e=Yr("useActionData"),t=Gr("useLoaderData");return e.actionData?e.actionData[t]:void 0}function tn(){let e=i.useContext(yr),t=Yr("useRouteError"),r=Gr("useRouteError");return void 0!==e?e:t.errors?.[r]}function rn(){let e=i.useContext(pr);return e?._data}function nn(){let e=i.useContext(pr);return e?._error}var an=0;function sn(e){let{router:t,basename:r}=qr("useBlocker"),n=Yr("useBlocker"),[a,s]=i.useState(""),o=i.useCallback(t=>{if("function"!=typeof e)return!!e;if("/"===r)return e(t);let{currentLocation:n,nextLocation:i,historyAction:a}=t;return e({currentLocation:{...n,pathname:K(n.pathname,r)||n.pathname},nextLocation:{...i,pathname:K(i.pathname,r)||i.pathname},historyAction:a})},[r,e]);return i.useEffect(()=>{let e=String(++an);return s(e),()=>t.deleteBlocker(e)},[t]),i.useEffect(()=>{""!==a&&t.getBlocker(a,o)},[t,a,o]),a&&n.blockers.has(a)?n.blockers.get(a):Ue}var on={};function ln(e,t,r){t||on[e]||(on[e]=!0,x(!1,r))}function cn(...e){const t=Gr("useRoute"),r=e[0]??t,n=Yr("useRoute"),i=n.matches.find(({route:e})=>e.id===r);if(void 0!==i)return{handle:i.route.handle,loaderData:n.loaderData[r],actionData:n.actionData?.[r]}}function un(e){return{id:e.route.id,pathname:e.pathname,params:e.params,handle:e.route.handle}}function dn(){let{location:e,historyAction:t,matches:r,navigation:n}=Yr("unstable_useRouterState"),a=i.useMemo(()=>({type:t,location:e,searchParams:new URLSearchParams(e.search),params:r[r.length-1]?.params??{},matches:r.map(e=>un(e))}),[e,r,t]),s=i.useMemo(()=>
56{if("idle"===n.state)return null;let e={type:n.historyAction,location:n.location,searchParams:new URLSearchParams(n.location.search),params:n.matches[n.matches.length-1]?.params??{},matches:n.matches.map(e=>un(e))};return"loading"===n.state?{...e,state:"loading",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{...e,state:"submitting",formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}},[n]);return i.useMemo(()=>({active:a,pending:s}),[a,s])}var hn={};function pn(e,t){e||hn[t]||(hn[t]=!0,console.warn(t))}var fn=(n||(n=r.t(i,2))).useOptimistic,gn=()=>{};function mn(e){let t={hasErrorBoundary:e.hasErrorBoundary||null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&(br&&e.element&&x(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:i.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(br&&e.hydrateFallbackElement&&x(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:i.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(br&&e.errorElement&&x(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:i.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var vn=["HydrateFallback","hydrateFallbackElement"];function yn(e,t){return Ge({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:v({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,hydrationRouteProperties:vn,mapRouteProperties:mn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,instrumentations:t?.instrumentations}).initialize()}var bn=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=t=>{"pending"===this.status&&(this.status="resolved",e(t))},this.reject=e=>{"pending"===this.status&&(this.status="rejected",t(e))}})}};function wn({router:e,flushSync:t,onError:r,useTransitions:n}){let a=ur();n=a||n;let[s,o]=i.useState(e.state),[l,c]=(u=s,fn?fn(u):[u,gn]);var u;let[d,h]=i.useState(),[p,f]=i.useState({isTransitioning:!1}),[g,m]=i.useState(),[v,y]=i.useState(),[b,w]=i.useState(),x=i.useRef(new Map),E=i.useCallback((a,{deletedFetchers:s,newErrors:l,flushSync:u,viewTransitionOpts:d})=>{l&&r&&Object.values(l).forEach(e=>r(e,{location:a.location,params:a.matches[0]?.params??{},pattern:ye(a.matches)})),a.fetchers.forEach((e,t)=>{void 0!==e.data&&x.current.set(t,e.data)}),s.forEach(e=>x.current.delete(e)),pn(!1===u||null!=t,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let p=null!=e.window&&null!=e.window.document&&"function"==typeof e.window.document.startViewTransition;if(pn(null==d||p,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),d&&p){if(t&&u){t(()=>{v&&(g?.resolve(),v.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:d.currentLocation,nextLocation:d.nextLocation})});let r=e.window.document.startViewTransition(()=>{t(()=>o(a))});return r.finished.finally(()=>{t(()=>{m(void 0),y(void 0),h(void 0),f({isTransitioning:!1})})}),void t(()=>y(r))}v?(g?.resolve(),v.skipTransition(),w({state:a,currentLocation:d.currentLocation,nextLocation:d.nextLocation})):(h(a),f({isTransitioning:!0,flushSync:!1,currentLocation:d.currentLocation,nextLocation:d.nextLocation}))}else t&&u?t(()=>o(a)):!1===n?o(a):i.startTransition(()=>{!0===n&&c(e=>xn(e,a)),o(a)})},[e.window,t,v,g,n,c,r]);i.useLayoutEffect(()=>e.subscribe(E),[e,E]),i.useEffect(()=>{p.isTransitioning&&!p.flushSync&&m(new bn)}
56,[p]),i.useEffect(()=>{if(g&&d&&e.window){let t=d,r=g.promise,a=e.window.document.startViewTransition(async()=>{!1===n?o(t):i.startTransition(()=>{!0===n&&c(e=>xn(e,t)),o(t)}),await r});a.finished.finally(()=>{m(void 0),y(void 0),h(void 0),f({isTransitioning:!1})}),y(a)}},[d,g,e.window,n,c]),i.useEffect(()=>{g&&d&&l.location.key===d.location.key&&g.resolve()},[g,v,l.location,d]),i.useEffect(()=>{!p.isTransitioning&&b&&(h(b.state),f({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))},[p.isTransitioning,b]);let S=i.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,r,n)=>e.navigate(t,{state:r,preventScrollReset:n?.preventScrollReset}),replace:(t,r,n)=>e.navigate(t,{replace:!0,state:r,preventScrollReset:n?.preventScrollReset})}),[e]),A=e.basename||"/",_=i.useMemo(()=>({router:e,navigator:S,static:!1,basename:A,onError:r}),[e,S,A,r]);return i.createElement(i.Fragment,null,i.createElement(or.Provider,{value:_},i.createElement(lr.Provider,{value:l},i.createElement(hr.Provider,{value:x.current},i.createElement(dr.Provider,{value:p},i.createElement(Pn,{basename:A,location:l.location,navigationType:l.historyAction,navigator:S,useTransitions:n},i.createElement(En,{routes:e.routes,manifest:e.manifest,future:e.future,state:l,isStatic:!1,onError:r})))))),null)}function xn(e,t){return{...e,navigation:"idle"!==t.navigation.state?t.navigation:e.navigation,revalidation:"idle"!==t.revalidation?t.revalidation:e.revalidation,actionData:"submitting"!==t.navigation.state?t.actionData:e.actionData,fetchers:t.fetchers}}var En=i.memo(Sn);function Sn({routes:e,manifest:t,future:r,state:n,isStatic:i,onError:a}){return jr(e,void 0,{manifest:t,state:n,isStatic:i,onError:a,future:r})}function An({basename:e,children:t,initialEntries:r,initialIndex:n,useTransitions:a}){let s=i.useRef();null==s.current&&(s.current=v({initialEntries:r,initialIndex:n,v5Compat:!0}));let o=s.current,[l,c]=i.useState({action:o.action,location:o.location}),u=i.useCallback(e=>{!1===a?c(e):i.startTransition(()=>c(e))},[a]);return i.useLayoutEffect(()=>o.listen(u),[o,u]),i.createElement(Pn,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,useTransitions:a})}function _n({to:e,replace:t,state:r,relative:n}){w(Ar(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=i.useContext(gr);x(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=i.useContext(vr),{pathname:o}=_r(),l=Or(),c=ne(e,re(s),o,"path"===n),u=JSON.stringify(c);return i.useEffect(()=>{l(JSON.parse(u),{replace:t,state:r,relative:n})},[l,u,n,t,r]),null}function Tn(e){return Mr(e.context)}function Cn(e){w(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Pn({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:s=!1,useTransitions:o}){w(!Ar(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=i.useMemo(()=>({basename:l,navigator:a,static:s,useTransitions:o,future:{}}),[l,a,s,o]);"string"==typeof r&&(r=_(r));let{pathname:u="/",search:d="",hash:h="",state:p=null,key:f="default",mask:g}=r,m=i.useMemo(()=>{let e=K(u,l);return null==e?null:{location:{pathname:e,search:d,hash:h,state:p,key:f,mask:g},navigationType:n}},[l,u,d,h,p,f,n,g]);return x(null!=m,`<Router basename="${l}"> is not able to match the URL "${u}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),null==m?null:i.createElement(gr.Provider,{value:c},i.createElement(mr.Provider,{children:t,value:m}))}function Rn({children:e,location:t}){return Nr(Mn(e),t)}function On({children:e,errorElement:t,resolve:r}){let n=i.useContext(or),a=i.useContext(lr),s=i.useCallback((e,t)=>{n&&n.onError&&a&&n.onError(e,{location:a.location,params:a.matches[0]?.params||{},pattern:ye(a.matches),errorInfo:t})},[n,a]);return i.createElement(Dn,{resolve:r,errorElement:t,onError:s},i.createElement(kn,null,e))}var Dn=class extends i.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,a=0;if(r instanceof Promise)if(this.state.error){a=2;let e=this.state.error;n=Promise.reject().catch(()=>{}),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_error",{get:()=>e})}else r._tracked?(n=r,a="_error"in n?2:"_data"in n?1:0):(a=0,Object.defineProperty(r,"_tracked",{get:()=>!0}),n=r.then(e=>Object.defineProperty(r,"_data",{get:()=>e}),e=>{this.props.onError?.(e),Object.defineProperty(r,"_error",{get:()=>e})}));else a=1,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:()=>!0}),Object.defineProperty(n,"_data",{get:()=>r});if(2===a&&!t)throw n._error;if(2===a)return i.createElement(pr.Provider,{value:n,children:t});if(1===a)return i.createElement(pr.Provider,{value:n,children:e});throw n}};function kn({children:e}){let t=rn(),r="function"==typeof e?e(t):e;return i.createElement(i.Fragment,null,r)}function Mn(e,t=[]){let r=[];
56return i.Children.forEach(e,(e,n)=>{if(!i.isValidElement(e))return;let a=[...t,n];if(e.type===i.Fragment)return void r.push.apply(r,Mn(e.props.children,a));w(e.type===Cn,`[${"string"==typeof e.type?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),w(!e.props.index||!e.props.children,"An index route cannot have child routes.");let s={id:e.props.id||a.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.hasErrorBoundary||null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(s.children=Mn(e.props.children,a)),r.push(s)}),r}var Ln=Mn;function In(e){return Wr(e)}function Nn(){return{params:Lr(),loaderData:Qr(),actionData:en(),matches:Jr()}}function jn({children:e}){const t=Nn();return i.cloneElement(e,t)}function Fn(e){return function(){const t=Nn();return i.createElement(e,t)}}function Hn(){return{params:Lr(),loaderData:Qr(),actionData:en()}}function Bn({children:e}){const t=Hn();return i.cloneElement(e,t)}function zn(e){return function(){const t=Hn();return i.createElement(e,t)}}function $n(){return{params:Lr(),loaderData:Qr(),actionData:en(),error:tn()}}function Un({children:e}){const t=$n();return i.cloneElement(e,t)}function Wn(e){return function(){const t=$n();return i.createElement(e,t)}}var Vn="get",qn="application/x-www-form-urlencoded";function Yn(e){return"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}function Gn(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(e=>[r,e]):[[r,n]])},[]))}var Xn=null;var Kn=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jn(e){return null==e||Kn.has(e)?e:(x(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${qn}"`),null)}function Qn(e,t){let r,n,i,a,s;if(Yn(o=e)&&"form"===o.tagName.toLowerCase()){let s=e.getAttribute("action");n=s?K(s,t):null,r=e.getAttribute("method")||Vn,i=Jn(e.getAttribute("enctype"))||qn,a=new FormData(e)}else if(function(e){return Yn(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Yn(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let s=e.form;if(null==s)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let o=e.getAttribute("formaction")||s.getAttribute("action");if(n=o?K(o,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||Vn,i=Jn(e.getAttribute("formenctype"))||Jn(s.getAttribute("enctype"))||qn,a=new FormData(s,e),!function(){if(null===Xn)try{new FormData(document.createElement("form"),0),Xn=!1}catch(e){Xn=!0}return Xn}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";a.append(`${e}x`,"0"),a.append(`${e}y`,"0")}else t&&a.append(t,n)}}else{if(Yn(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Vn,n=null,i=qn,s=e}var o;return a&&"text/plain"===i&&(s=a,a=void 0),{action:n,method:r.toLowerCase(),encType:i,formData:a,body:s}}var Zn="E",ei="P",ti=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};var ri=()=>Date.now(),ni=()=>new Promise(e=>setTimeout(e,0));async function ii(e){const{indices:t}=this,r=t.get(e);if(r)return[r];if(void 0===e)return-7;if(null===e)return-5;if(Number.isNaN(e))return-2;if(e===Number.POSITIVE_INFINITY)return-6;if(e===Number.NEGATIVE_INFINITY)return-3;if(0===e&&1/e<0)return-4;const n=this.index++;t.set(e,n);const i=[[e,n]];return await ai.call(this,i),n}async function ai(e){const{deferred:t,indices:r,plugins:n,postPlugins:i}=this,a=this.stringified;let s=ri();const o=t=>{const n=r.get(t);if(n)return[n];if(void 0===t)return-7;if(null===t)return-5;if(Number.isNaN(t))return-2;if(t===Number.POSITIVE_INFINITY)return-6;if(t===Number.NEGATIVE_INFINITY)return-3;if(0===t&&1/t<0)return-4;const i=this.index++;return r.set(t,i),e.push([t,i]),i};let l=0;for(;e.length>0;){const r=ri();++l%6e3==0&&r-s>=1&&(await ni(),s=ri());const[c,u]=e.pop(),d=e=>Object.keys(e).map(t=>`"_${o(t)}":${o(e[t])}`).join(",");let h=null;switch(typeof c){case"boolean":case"number":case"string":a[u]=JSON.stringify(c);break;case"bigint":a[u]=`["B","${c}"]`;break;
56case"symbol":{const e=Symbol.keyFor(c);e?a[u]=`["Y",${JSON.stringify(e)}]`:h=new Error("Cannot encode symbol unless created with Symbol.for()");break}case"object":{if(!c){a[u]="-5";break}const e=Array.isArray(c);let r=!1;if(!e&&n)for(const e of n){const t=e(c);if(Array.isArray(t)){r=!0;const[e,...n]=t;a[u]=`[${JSON.stringify(e)}`,n.length>0&&(a[u]+=`,${n.map(e=>o(e)).join(",")}`),a[u]+="]";break}}if(!r){let r=e?"[":"{";if(e){for(let e=0;e<c.length;e++)r+=(e?",":"")+(e in c?o(c[e]):-1);a[u]=`${r}]`}else if(c instanceof Date){const e=c.getTime();a[u]=`["D",${Number.isNaN(e)?JSON.stringify("invalid"):e}]`}else c instanceof URL?a[u]=`["U",${JSON.stringify(c.href)}]`:c instanceof RegExp?a[u]=`["R",${JSON.stringify(c.source)},${JSON.stringify(c.flags)}]`:c instanceof Set?c.size>0?a[u]=`["S",${[...c].map(e=>o(e)).join(",")}]`:a[u]='["S"]':c instanceof Map?c.size>0?a[u]=`["M",${[...c].flatMap(([e,t])=>[o(e),o(t)]).join(",")}]`:a[u]='["M"]':c instanceof Promise?(a[u]=`["${ei}",${u}]`,t[u]=c):c instanceof Error?(a[u]=`["${Zn}",${JSON.stringify(c.message)}`,"Error"!==c.name&&(a[u]+=`,${JSON.stringify(c.name)}`),a[u]+="]"):null===Object.getPrototypeOf(c)?a[u]=`["N",{${d(c)}}]`:oi(c)?a[u]=`{${d(c)}}`:h=new Error("Cannot encode object with prototype")}break}default:{let e=!1;if(!Array.isArray(c)&&n)for(const t of n){const r=t(c);if(Array.isArray(r)){e=!0;const[t,...n]=r;a[u]=`[${JSON.stringify(t)}`,n.length>0&&(a[u]+=`,${n.map(e=>o(e)).join(",")}`),a[u]+="]";break}}e||(h=new Error("Cannot encode function or unexpected type"))}}if(h){let e=!1;if(i)for(const t of i){const r=t(c);if(Array.isArray(r)){e=!0;const[t,...n]=r;a[u]=`[${JSON.stringify(t)}`,n.length>0&&(a[u]+=`,${n.map(e=>o(e)).join(",")}`),a[u]+="]";break}}if(!e)throw h}}}var si=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oi(e){const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t||Object.getOwnPropertyNames(t).sort().join("\0")===si}var li="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0;function ci(e){const{hydrated:t,values:r}=this;if("number"==typeof e)return ui.call(this,e);if(!Array.isArray(e)||!e.length)throw new SyntaxError;const n=r.length;for(const t of e)r.push(t);return t.length=r.length,ui.call(this,n)}function ui(e){const{hydrated:t,values:r,deferred:n,plugins:i}=this;let a;const s=[[e,e=>{a=e}]];let o=[];for(;s.length>0;){const[e,a]=s.pop();switch(e){case-7:a(void 0);continue;case-5:a(null);continue;case-2:a(NaN);continue;case-6:a(1/0);continue;case-3:a(-1/0);continue;case-4:a(-0);continue}if(t[e]){a(t[e]);continue}const l=r[e];if(l&&"object"==typeof l){if(!Array.isArray(l)){const r={};t[e]=r;for(const e of Object.keys(l).reverse()){const t=[];s.push([l[e],e=>{t[1]=e}]),s.push([Number(e.slice(1)),e=>{t[0]=e}]),o.push(()=>{r[t[0]]=t[1]})}a(r);continue}if("string"!=typeof l[0]){const r=[];t[e]=r;for(let e=0;e<l.length;e++){const t=l[e];-1!==t&&s.push([t,t=>{r[e]=t}])}a(r);continue}{const[r,c,u]=l;switch(r){case"D":a(t[e]=new Date(c));continue;case"U":a(t[e]=new URL(c));continue;case"B":a(t[e]=BigInt(c));continue;case"R":a(t[e]=new RegExp(c,u));continue;case"Y":a(t[e]=Symbol.for(c));continue;case"S":const r=new Set;t[e]=r;for(let e=l.length-1;e>0;e--)s.push([l[e],e=>{r.add(e)}]);a(r);continue;case"M":const d=new Map;t[e]=d;for(let e=l.length-2;e>0;e-=2){const t=[];s.push([l[e+1],e=>{t[1]=e}]),s.push([l[e],e=>{t[0]=e}]),o.push(()=>{d.set(t[0],t[1])})}a(d);continue;case"N":const h=Object.create(null);t[e]=h;for(const e of Object.keys(c).reverse()){const t=[];s.push([c[e],e=>{t[1]=e}]),s.push([Number(e.slice(1)),e=>{t[0]=e}]),o.push(()=>{h[t[0]]=t[1]})}a(h);continue;case ei:if(t[c])a(t[e]=t[c]);else{const r=new ti;n[c]=r,a(t[e]=r.promise)}continue;case Zn:const[,p,f]=l;let g=f&&li&&ge.includes(f)&&f in li&&"function"==typeof li[f]?new li[f](p):new Error(p);t[e]=g,a(g);continue;case"Z":a(t[e]=t[c]);continue;default:if(Array.isArray(i)){const r=[],n=l.slice(1);for(let e=0;e<n.length;e++){const t=n[e];s.push([t,t=>{r[e]=t}])}o.push(()=>{for(const n of i){const i=n(l[0],...r);if(i)return void a(t[e]=i.value)}throw new SyntaxError});continue}throw new SyntaxError}}}else t[e]=l,a(l)}for(;o.length>0;)o.pop()();return a}
56async function di(e,t){const{plugins:r}=t??{},n=new ti,i=e.pipeThrough(function(){const e=new TextDecoder;let t="";return new TransformStream({transform(r,n){const i=e.decode(r,{stream:!0}),a=(t+i).split("\n");t=a.pop()||"";for(const e of a)n.enqueue(e)},flush(e){t&&e.enqueue(t)}})}()).getReader(),a={values:[],hydrated:[],deferred:{},plugins:r},s=await hi.call(a,i);let o=n.promise;return s.done?n.resolve():o=pi.call(a,i).then(n.resolve).catch(e=>{for(const t of Object.values(a.deferred))t.reject(e);n.reject(e)}),{done:o.then(()=>i.closed),value:s.value}}async function hi(e){const t=await e.read();if(!t.value)throw new SyntaxError;let r;try{r=JSON.parse(t.value)}catch(e){throw new SyntaxError}return{done:t.done,value:ci.call(this,r)}}async function pi(e){let t=await e.read();for(;!t.done;){if(!t.value)continue;const r=t.value;switch(r[0]){case ei:{const e=r.indexOf(":"),t=Number(r.slice(1,e)),n=this.deferred[t];if(!n)throw new Error(`Deferred ID ${t} not found in stream`);const i=r.slice(e+1);let a;try{a=JSON.parse(i)}catch(e){throw new SyntaxError}const s=ci.call(this,a);n.resolve(s);break}case Zn:{const e=r.indexOf(":"),t=Number(r.slice(1,e)),n=this.deferred[t];if(!n)throw new Error(`Deferred ID ${t} not found in stream`);const i=r.slice(e+1);let a;try{a=JSON.parse(i)}catch(e){throw new SyntaxError}const s=ci.call(this,a);n.reject(s);break}default:throw new SyntaxError}t=await e.read()}}function fi(e,t){const{onComplete:r,plugins:n,postPlugins:i,signal:a}=t??{},s={deferred:{},index:0,indices:new Map,stringified:[],plugins:n,postPlugins:i,signal:a},o=new TextEncoder;let l=0;return new ReadableStream({async start(t){const n=await ii.call(s,e);if(Array.isArray(n))throw new Error("This should never happen");n<0?t.enqueue(o.encode(`${n}\n`)):(t.enqueue(o.encode(`[${s.stringified.join(",")}]\n`)),l=s.stringified.length-1);const i=new WeakSet;let c=Promise.resolve();if(Object.keys(s.deferred).length){let e;const r=new Promise((t,r)=>{if(e=t,a){const e=()=>r(a.reason||new Error("Signal was aborted."));a.aborted?e():a.addEventListener("abort",t=>{e()})}});for(;Object.keys(s.deferred).length>0;){for(const[e,n]of Object.entries(s.deferred))i.has(n)||i.add(s.deferred[Number(e)]=Promise.race([r,n]).then(r=>(c=c.then(async()=>{const n=await ii.call(s,r);if(Array.isArray(n))t.enqueue(o.encode(`${ei}${e}:[["Z",${n[0]}]]\n`)),s.index++,l++;else if(n<0)t.enqueue(o.encode(`${ei}${e}:${n}\n`));else{const r=s.stringified.slice(l+1).join(",");t.enqueue(o.encode(`${ei}${e}:[${r}]\n`)),l=s.stringified.length-1}}),c),r=>(c=c.then(async()=>{r&&"object"==typeof r&&r instanceof Error||(r=new Error("An unknown error occurred"));const n=await ii.call(s,r);if(Array.isArray(n))t.enqueue(o.encode(`${Zn}${e}:[["Z",${n[0]}]]\n`)),s.index++,l++;else if(n<0)t.enqueue(o.encode(`${Zn}${e}:${n}\n`));else{const r=s.stringified.slice(l+1).join(",");t.enqueue(o.encode(`${Zn}${e}:[${r}]\n`)),l=s.stringified.length-1}}),c)).finally(()=>{delete s.deferred[Number(e)]}));await Promise.race(Object.values(s.deferred))}e()}await Promise.all(Object.values(s.deferred)),await c,t.close(),r?.()}})}async function gi(e){let t={signal:e.signal};if("GET"!==e.method){t.method=e.method;let r=e.headers.get("Content-Type");r&&/\bapplication\/json\b/.test(r)?(t.headers={"Content-Type":r},t.body=JSON.stringify(await e.json())):r&&/\btext\/plain\b/.test(r)?(t.headers={"Content-Type":r},t.body=await e.text()):r&&/\bapplication\/x-www-form-urlencoded\b/.test(r)?t.body=new URLSearchParams(await e.text()):t.body=await e.formData()}return t}var mi={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},vi=/[&><\u2028\u2029]/g;function yi(e){return e.replace(vi,e=>mi[e])}function bi(e,t){if(!1===e||null==e)throw new Error(t)}var wi,xi=Symbol("SingleFetchRedirect"),Ei=class extends Error{},Si=202,Ai=new Set([100,101,204,205]);function _i({context:e,identifier:t,reader:r,textDecoder:n,nonce:a}){if(!e.renderMeta||!e.renderMeta.didRenderScripts)return null;e.renderMeta.streamCache||(e.renderMeta.streamCache={});let{streamCache:s}=e.renderMeta,o=s[t];if(o||(o=s[t]=r.read().then(e=>{s[t].result={done:e.done,value:n.decode(e.value,{stream:!0})}}).catch(e=>{s[t].error=e})),o.error)throw o.error;if(void 0===o.result)throw o;let{done:l,value:c}=o.result,u=c?i.createElement("script",{nonce:a,dangerouslySetInnerHTML:{__html:`window.__reactRouterContext.streamController.enqueue(${yi(JSON.stringify(c))});`}}):null;return l?i.createElement(i.Fragment,null,u,i.createElement("script",{nonce:a,dangerouslySetInnerHTML:{__html:"window.__reactRouterContext.streamController.close();"}})):i.createElement(i.Fragment,null,u,i.createElement(i.Suspense,null,i.createElement(_i,{
56context:e,identifier:t+1,reader:r,textDecoder:n,nonce:a})))}function Ti(e,t,r,n,i,a){let s=Ci(e,e=>{let r=t.routes[e.route.id];return bi(r,"Route not found in manifest"),{hasLoader:r.hasLoader,hasClientLoader:r.hasClientLoader}},Oi,n,i,a);return async e=>e.runClientMiddleware(s)}function Ci(e,t,r,n,i,a,s=()=>!0){return async o=>{let{request:l,matches:c,fetcherKey:u}=o,d=e();if("GET"!==l.method)return async function(e,t,r,n){let i=e.matches.find(e=>e.shouldCallHandler());bi(i,"No action match found");let a,s=await i.resolve(async s=>await s(async()=>{let{data:s,status:o}=await t(e,r,n,[i.route.id]);return a=o,ki(s,i.route.id)}));if(Xt(s.result)||ve(s.result)||Gt(s.result))return{[i.route.id]:s};return{[i.route.id]:{type:s.type,result:de(s.result,a)}}}(o,r,i,a);let h=c.some(e=>{let{hasLoader:r,hasClientLoader:n}=t(e);return e.shouldCallHandler()&&r&&!n});return n||h?u?async function(e,t,r,n){let i=e.matches.find(e=>e.shouldCallHandler());bi(i,"No fetcher match found");let a=i.route.id,s=await i.resolve(async i=>i(async()=>{let{data:i}=await t(e,r,n,[a]);return ki(i,a)}));return{[i.route.id]:s}}(o,r,i,a):async function(e,t,r,n,i,a,s,o=()=>!0){let l=new Set,c=!1,u=e.matches.map(()=>Mi()),d=Mi(),h={},p=Promise.all(e.matches.map(async(t,i)=>t.resolve(async p=>{u[i].resolve();let f=t.route.id,{hasLoader:g,hasClientLoader:m}=r(t),v=!t.shouldRevalidateArgs||null==t.shouldRevalidateArgs.actionStatus||t.shouldRevalidateArgs.actionStatus<400;if(t.shouldCallHandler(v))if(o(t)&&m){g&&(c=!0);try{let t=await p(async()=>{let{data:t}=await n(e,a,s,[f]);return ki(t,f)});h[f]={type:"data",result:t}}catch(e){h[f]={type:"error",result:e}}}else{g&&l.add(f);try{let e=await p(async()=>ki(await d.promise,f));h[f]={type:"data",result:e}}catch(e){h[f]={type:"error",result:e}}}else c||(c=null!=t.shouldRevalidateArgs&&g)})));await Promise.all(u.map(e=>e.promise));let f=!t.state.initialized&&"idle"===t.state.navigation.state;if(!f&&0!==l.size||window.__reactRouterHdrActive){let t=i&&c&&l.size>0?[...l.keys()]:void 0;try{let r=await n(e,a,s,t);d.resolve(r.data)}catch(e){d.reject(e)}}else d.resolve({routes:{}});return await p,await async function(e,t,r,n){try{let i,a=await e;if("routes"in a)for(let e of t)if(e.route.id in a.routes){let t=a.routes[e.route.id];if("error"in t){i=t.error,null==n[e.route.id]?.result&&(n[e.route.id]={type:"error",result:i});break}}void 0!==i&&Array.from(r.values()).forEach(e=>{n[e].result instanceof Ei&&(n[e].result=i)})}catch(e){}}(d.promise,e.matches,l,h),h}(o,d,t,r,n,i,a,s):async function(e,t,r,n,i){let a=e.matches.filter(e=>e.shouldCallHandler()),s={};return await Promise.all(a.map(a=>a.resolve(async o=>{try{let{hasClientLoader:l}=t(a),c=a.route.id,u=l?await o(async()=>{let{data:t}=await r(e,n,i,[c]);return ki(t,c)}):await o();s[a.route.id]={type:"data",result:u}}catch(e){s[a.route.id]={type:"error",result:e}}}))),s}(o,t,r,i,a)}}function Pi(e){let t=e.searchParams.getAll("index");e.searchParams.delete("index");let r=[];for(let e of t)e&&r.push(e);for(let t of r)e.searchParams.append("index",t);return e}function Ri(e,t,r,n){let i="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return r?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${n}`:i.pathname=`${i.pathname}.${n}`:"/"===i.pathname?i.pathname=`_root.${n}`:t&&"/"===K(i.pathname,t)?i.pathname=`${se(t)}/_root.${n}`:i.pathname=`${se(i.pathname)}.${n}`,i}async function Oi(e,t,r,n){let{request:i}=e,a=Ri(i.url,t,r,"data");"GET"===i.method&&(a=Pi(a),n&&a.searchParams.set("_routes",n.join(",")));let s=await fetch(a,await gi(i));if(s.status>=400&&!s.headers.has("X-Remix-Response"))throw new me(s.status,s.statusText,await s.text());if(204===s.status&&s.headers.has("X-Remix-Redirect"))return{status:Si,data:{redirect:{redirect:s.headers.get("X-Remix-Redirect"),status:Number(s.headers.get("X-Remix-Status")||"302"),revalidate:"true"===s.headers.get("X-Remix-Revalidate"),reload:"true"===s.headers.get("X-Remix-Reload-Document"),replace:"true"===s.headers.get("X-Remix-Replace")}}};if(Ai.has(s.status)){let e={};return n&&"GET"!==i.method&&(e[n[0]]={data:void 0}),{status:s.status,data:{routes:e}}}bi(s.body,"No response body to decode");try{let e,t=await Di(s.body,window);if("GET"===i.method){let r=t.value;e=xi in r?{redirect:r[xi]}:{routes:r}}else{let r=t.value,i=n?.[0];bi(i,"No routeId found for single fetch call decoding"),e="redirect"in r?{redirect:r}:{routes:{[i]:r}}}return{status:s.status,data:e}}catch(e){throw new Error("Unable to decode turbo-stream response")}}function Di(e,t){return di(e,{plugins:[(e,...r)=>{if("SanitizedError"===e){let[e,n,i]=r,a=Error;e&&ge.includes(e)&&e in t&&"function"==typeof t[e]&&(a=t[e]);let s=new a(n);return s.stack=i,{value:s}}if("ErrorResponse"===e){let[e,t,n]=r;return{value:new me(t,n,e)}}return"SingleFetchRedirect"===e?{value:{[xi]:r[0]}}:"SingleFetchClassInstance"===e?{value:r[0]}:"SingleFetchFallback"===e?{value:void 0}:void 0}]})}function ki(e,t){if("redirect"in e){let{redirect:t,revalidate:r,reload:n,replace:i,status:a}=e.redirect;throw he(t,{status:a,headers:{...r?{"X-Remix-Revalidate":"yes"}:null,...n?{"X-Remix-Reload-Document":"yes"}:null,...i?{"X-Remix-Replace":"yes"}:null}})}let r=e.routes[t];if(null==r)throw new Ei(`No result found for routeId "${t}"`);if("error"in r)throw r.error;if("data"in r)return r.data;throw new Error(`Invalid response found for routeId "${t}"`)}function Mi(){let e,t,r=new Promise((n,i)=>{e=async e=>{n(e);try{await r}catch(e){}},t=async e=>{i(e);try{await r}catch(e){}}});return{promise:r,resolve:e,reject:t}}async function Li(e,t){if(e.id in t)return t[e.id];try{let r=await(import(e.module));return t[e.id]=r,r}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.
56isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ii(e){return e.css?e.css.map(e=>({rel:"stylesheet",href:e})):[]}async function Ni(e,t){if(!e.css&&!t.links||!function(){if(void 0!==wi)return wi;let e=document.createElement("link");return wi=e.relList.supports("preload"),e=null,wi}())return;let r=[];if(e.css&&r.push(...Ii(e)),t.links&&r.push(...t.links()),0===r.length)return;let n=[];for(let e of r)Fi(e)||"stylesheet"!==e.rel||n.push({...e,rel:"preload",as:"style"});await Promise.all(n.map(ji))}async function ji(e){return new Promise(t=>{if(e.media&&!window.matchMedia(e.media).matches||document.querySelector(`link[rel="stylesheet"][href="${e.href}"]`))return t();let r=document.createElement("link");function n(){document.head.contains(r)&&document.head.removeChild(r)}Object.assign(r,e),r.onload=()=>{n(),t()},r.onerror=()=>{n(),t()},document.head.appendChild(r)})}function Fi(e){return null!=e&&"string"==typeof e.page}function Hi(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}function Bi(e,t,r,n,i,a){let s=(e,t)=>!r[t]||e.route.id!==r[t].route.id,o=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===a?t.filter((e,t)=>s(e,t)||o(e,t)):"data"===a?t.filter((t,a)=>{let l=n.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(s(t,a)||o(t,a))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0}):[]}function zi(e,t,{includeHydrateFallback:r}={}){return n=e.map(e=>{let n=t.routes[e.route.id];if(!n)return[];let i=[n.module];return n.clientActionModule&&(i=i.concat(n.clientActionModule)),n.clientLoaderModule&&(i=i.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(i=i.concat(n.hydrateFallbackModule)),n.imports&&(i=i.concat(n.imports)),i}).flat(1),[...new Set(n)];var n}function $i(e,t){let r=new Set,n=new Set(t);return e.reduce((e,i)=>{if(t&&!Fi(i)&&"script"===i.as&&i.href&&n.has(i.href))return e;let a=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}(i));return r.has(a)||(r.add(a),e.push({key:a,link:i})),e},[])}function Ui(){let{nonce:e}=pa();return i.createElement(Ra,{title:"Loading...",renderScripts:!0},br?i.createElement("script",{nonce:e,dangerouslySetInnerHTML:{__html:'\n console.log(\n "ð¿ Hey developer ð. You can provide a way better UX than this " +\n "when your app is loading JS modules and/or running `clientLoader` " +\n "functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +\n "for more information."\n );\n '}}):null)}function Wi(e){let t={};return Object.values(e).forEach(e=>{if(e){let r=e.parentId||"";t[r]||(t[r]=[]),t[r].push(e)}}),t}function Vi(e,t,r){let n=Qi(t),a=!t.HydrateFallback||r&&"root"!==e.id?"root"===e.id?Ui:void 0:t.HydrateFallback,s=t.ErrorBoundary?t.ErrorBoundary:"root"===e.id?()=>i.createElement(Pa,{error:tn()}):void 0;return"root"===e.id&&t.Layout?{...n?{element:i.createElement(t.Layout,null,i.createElement(n,null))}:{Component:n},...s?{errorElement:i.createElement(t.Layout,null,i.createElement(s,null))}:{ErrorBoundary:s},...a?{hydrateFallbackElement:i.createElement(t.Layout,null,i.createElement(a,null))}:{HydrateFallback:a}}:{Component:n,ErrorBoundary:s,HydrateFallback:a}}function qi(e,t,r,n,i="",a=Wi(e),s=Promise.resolve({Component:()=>null})){return(a[i]||[]).map(i=>{let o=t[i.id];bi(o,"No `routeModule` available to create server routes");let l={...Vi(i,o,n),caseSensitive:i.caseSensitive,id:i.id,index:i.index,path:i.path,handle:o.handle,lazy:n?()=>s:void 0,loader:i.hasLoader||i.hasClientLoader?()=>null:void 0},c=qi(e,t,r,n,i.id,a,s);return c.length>0&&(l.children=c),l})}function Yi(e,t,r,n,i,a){return Ki(t,r,n,i,a,"",Wi(t),e)}function Gi(e,t){if("loader"===e&&!t.hasLoader||"action"===e&&!t.hasAction){let r=`You are trying to call ${"action"===e?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t.id}")`;throw console.error(r),new me(400,"Bad Request",new Error(r),!0)}}function Xi(e,t){let r="clientAction"===e?"a":"an",n=`Route "${t}" does not have ${r} ${e}, but you are trying to submit to it. To fix this, please add ${r} \`${e}\` function to the route`;throw console.error(n),new me(405,"Method Not Allowed",new Error(n),!0)}function Ki(e,t,r,n,i,a="",s=Wi(e),o){return(s[a]||[]).map(a=>{let l=t[a.id];function c(e){return bi("function"==typeof e,"No single fetch function available for route handler"),e()}function u(e){return a.hasLoader?c(e):Promise.resolve(null)}function d(e){if(!a.hasAction)throw Xi("action",a.id);return c(e)}function h(e){import(e)}function p(e){e.clientActionModule&&h(e.clientActionModule),e.clientLoaderModule&&h(e.clientLoaderModule)}async function f(e){let r=t[a.id],n=r?Ni(a,r):Promise.resolve();try{return e()}finally{await n}}let g={id:a.id,index:a.index,path:a.path};if(l){Object.assign(g,{...g,...Vi(a,l,i),middleware:l.clientMiddleware,handle:l.handle,shouldRevalidate:Ji(g.path,l,a,n,o)});let v=r&&r.loaderData&&a.id in r.loaderData,y=v?r?.loaderData?.[a.id]:void 0,b=r&&r.errors&&a.id in r.errors,w=b?r?.errors?.[a.id]:void 0,x=null==o&&(!0===l.clientLoader?.hydrate||!a.hasLoader);g.loader=async({request:e,params:t,context:r,pattern:n,url:i},s)=>{let o=x;return x=!1,await f(async()=>(bi(l,"No `routeModule` available for critical-route loader"),l.clientLoader?l.clientLoader({request:e,params:t,context:r,pattern:n,url:i,async serverLoader(){if
56(Gi("loader",a),o){if(v)return y;if(b)throw w}return u(s)}}):u(s)))},g.loader.hydrate=Zi(a.id,l.clientLoader,a.hasLoader,i),g.action=({request:e,params:t,context:r,pattern:n,url:s},o)=>f(async()=>{if(bi(l,"No `routeModule` available for critical-route action"),!l.clientAction){if(i)throw Xi("clientAction",a.id);return d(o)}return l.clientAction({request:e,params:t,context:r,pattern:n,url:s,serverAction:async()=>(Gi("action",a),d(o))})})}else{let E;async function S(){return E||(E=(async()=>{(a.clientLoaderModule||a.clientActionModule)&&await new Promise(e=>setTimeout(e,0));let e=async function(e,t){let r=Li(e,t),n=async function(e){if(!e.css)return;let t=Ii(e);await Promise.all(t.map(ji))}(e),i=await r;return await Promise.all([n,Ni(e,i)]),{Component:Qi(i),ErrorBoundary:i.ErrorBoundary,clientMiddleware:i.clientMiddleware,clientAction:i.clientAction,clientLoader:i.clientLoader,handle:i.handle,links:i.links,meta:i.meta,shouldRevalidate:i.shouldRevalidate}}(a,t);return p(a),await e})()),await E}a.hasClientLoader||(g.loader=(e,t)=>f(()=>u(t))),a.hasClientAction||(g.action=(e,t)=>f(()=>{if(i)throw Xi("clientAction",a.id);return d(t)})),g.lazy={loader:a.hasClientLoader?async()=>{let{clientLoader:e}=a.clientLoaderModule?await(import(a.clientLoaderModule)):await S();return bi(e,"No `clientLoader` export found"),(t,r)=>e({...t,serverLoader:async()=>(Gi("loader",a),u(r))})}:void 0,action:a.hasClientAction?async()=>{let e=a.clientActionModule?import(a.clientActionModule):S();p(a);let{clientAction:t}=await e;return bi(t,"No `clientAction` export found"),(e,r)=>t({...e,serverAction:async()=>(Gi("action",a),d(r))})}:void 0,middleware:a.hasClientMiddleware?async()=>{let{clientMiddleware:e}=a.clientMiddlewareModule?await(import(a.clientMiddlewareModule)):await S();return bi(e,"No `clientMiddleware` export found"),e}:void 0,shouldRevalidate:async()=>{let e=await S();return Ji(g.path,e,a,n,o)},handle:async()=>(await S()).handle,Component:async()=>(await S()).Component,ErrorBoundary:a.hasErrorBoundary?async()=>(await S()).ErrorBoundary:void 0}}let m=Ki(e,t,r,n,i,a.id,s,o);return m.length>0&&(g.children=m),g})}function Ji(e,t,r,n,i){if(i)return function(e,t,r){let n=!1;return i=>n?t?t(i):i.defaultShouldRevalidate:(n=!0,r.has(e))}(r.id,t.shouldRevalidate,i);if(!n&&r.hasLoader&&!r.hasClientLoader){let r=e?G(e)[1].map(e=>e.paramName):[];const n=e=>r.some(t=>e.currentParams[t]!==e.nextParams[t]);if(t.shouldRevalidate){let e=t.shouldRevalidate;return t=>e({...t,defaultShouldRevalidate:n(t)})}return e=>n(e)}return t.shouldRevalidate}function Qi(e){if(null==e.default)return;return"object"==typeof e.default&&0===Object.keys(e.default).length?void 0:e.default}function Zi(e,t,r,n){return n&&"root"!==e||null!=t&&(!0===t.hydrate||!0!==r)}var ea=new Set,ta=new Set,ra=7680;function na(e){let t=new Set;return e.forEach(e=>{e.startsWith("/")||(e=`/${e}`);for(let r=1;r<e.length;r++)"/"===e[r]&&t.add(e.slice(0,r));t.add(e)}),Array.from(t)}function ia(e,t){return"lazy"===e.mode&&!0===t}function aa(e,t,r,n,i,a,s){if(ia(i,n))return async({path:o,patch:l,signal:c,fetcherKey:u})=>{if(ta.has(o))return;let{state:d}=e();await ca([o],u?window.location.href:A(d.navigation.location||d.location),t,r,n,a,s,i.manifestPath,l,c)}}function sa(e,t,r,n,a,s){i.useEffect(()=>{if(!ia(a,n)||!0===window.navigator?.connection?.saveData)return;function i(e){let t="FORM"===e.tagName?e.getAttribute("action"):e.getAttribute("href");if(!t)return;let r="A"===e.tagName?e.pathname:new URL(t,window.location.origin).pathname;ta.has(r)||ea.add(r)}async function o(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(i);let o=Array.from(ea.keys()).filter(e=>!ta.has(e)||(ea.delete(e),!1));if(0!==o.length)try{await ca(o,null,t,r,n,s,e.basename,a.manifestPath,e.patchRoutes)}catch(e){console.error("Failed to fetch manifest patches",e)}}let l=function(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}(o,100);o();let c=new MutationObserver(()=>l());return c.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]}),()=>c.disconnect()},[n,s,t,r,e,a])}function oa(e,t){let r=e||"/__manifest";return null==t?r:ae([t,r])}var la="react-router-manifest-version";async function ca(e,t,r,n,i,a,s,o,l,c){e=na(e);const u=new URLSearchParams;u.set("paths",e.sort().join(",")),u.set("version",r.version);let d,h=new URL(oa(o,s),window.location.origin);if(h.search=u.toString(),h.toString().length>ra)return void ea.clear();try{let e=await fetch(h,{signal:c});if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);if(204===e.status&&e.headers.has("X-Remix-Reload-Document")){if(!t)return void console.warn("Detected a manifest version mismatch during eager route discovery. The next navigation/fetch to an undiscovered route will result in a
56new document navigation to sync up with the latest manifest.");try{if(sessionStorage.getItem(la)===r.version)return void console.error("Unable to discover routes due to manifest version mismatch.");sessionStorage.setItem(la,r.version)}catch{}window.location.href=t,console.warn("Detected manifest version mismatch, reloading..."),await new Promise(()=>{})}else if(e.status>=400)throw new Error(await e.text());try{sessionStorage.removeItem(la)}catch{}d=await e.json()}catch(e){if(c?.aborted)return;throw e}let p=new Set(Object.keys(r.routes)),f=Object.values(d).reduce((e,t)=>(t&&!p.has(t.id)&&(e[t.id]=t),e),{});Object.assign(r.routes,f),e.forEach(e=>function(e,t){if(t.size>=1e3){let e=t.values().next().value;t.delete(e)}t.add(e)}(e,ta));let g=new Set;Object.values(f).forEach(e=>{!e||e.parentId&&f[e.parentId]||g.add(e.parentId)}),g.forEach(e=>l(e||null,Ki(f,n,null,i,a,e)))}function ua(){let e=i.useContext(or);return bi(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function da(){let e=i.useContext(lr);return bi(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ha=i.createContext(void 0);function pa(){let e=i.useContext(ha);return bi(e,"You must render this element inside a <HydratedRouter> element"),e}function fa(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function ga(e,t,r){if(r&&!Sa)return[e[0]];if(t){let r=e.findIndex(e=>void 0!==t[e.route.id]);return e.slice(0,r+1)}return e}ha.displayName="FrameworkContext";var ma="data-react-router-critical-css";function va({nonce:e,crossOrigin:t}){let{isSpaMode:r,manifest:n,routeModules:a,criticalCss:s,nonce:o}=pa(),{errors:l,matches:c}=da(),u=ga(c,l,r),d=i.useMemo(()=>function(e,t,r){return $i(e.map(e=>{let n=t[e.route.id],i=r.routes[e.route.id];return[i&&i.css?i.css.map(e=>({rel:"stylesheet",href:e})):[],n?.links?.()||[]]}).flat(2),zi(e,r))}(u,a,n),[u,a,n]);return null==e&&o&&(e=o),i.createElement(i.Fragment,null,"string"==typeof s?i.createElement("style",{[ma]:"",nonce:e,dangerouslySetInnerHTML:{__html:s}}):null,"object"==typeof s?i.createElement("link",{[ma]:"",rel:"stylesheet",href:s.href,nonce:e,crossOrigin:t}):null,d.map(({key:r,link:n})=>Fi(n)?i.createElement(ya,{key:r,nonce:e,...n,crossOrigin:n.crossOrigin??t}):i.createElement("link",{key:r,nonce:e,...n,crossOrigin:n.crossOrigin??t})))}function ya({page:e,...t}){let r=ur(),{nonce:n}=pa(),{router:a}=ua(),s=i.useMemo(()=>I(a.routes,e,a.basename),[a.routes,e,a.basename]);return s?(null==t.nonce&&n&&(t={...t,nonce:n}),r?i.createElement(wa,{page:e,matches:s,...t}):i.createElement(xa,{page:e,matches:s,...t})):null}function ba(e){let{manifest:t,routeModules:r}=pa(),[n,a]=i.useState([]);return i.useEffect(()=>{let n=!1;return async function(e,t,r){return $i((await Promise.all(e.map(async e=>{let n=t.routes[e.route.id];if(n){let e=await Li(n,r);return e.links?e.links():[]}return[]}))).flat(1).filter(Hi).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"}))}(e,t,r).then(e=>{n||a(e)}),()=>{n=!0}},[e,t,r]),n}function wa({page:e,matches:t,...r}){let n=_r(),{future:a}=pa(),{basename:s}=ua(),o=i.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let r=Ri(e,s,a.v8_trailingSlashAwareDataRequests,"rsc"),i=!1,o=[];for(let e of t)"function"==typeof e.route.shouldRevalidate?i=!0:o.push(e.route.id);return i&&o.length>0&&r.searchParams.set("_routes",o.join(",")),[r.pathname+r.search]},[s,a.v8_trailingSlashAwareDataRequests,e,n,t]);return i.createElement(i.Fragment,null,o.map(e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})))}function xa({page:e,matches:t,...r}){let n=_r(),{future:a,manifest:s,routeModules:o}=pa(),{basename:l}=ua(),{loaderData:c,matches:u}=da(),d=i.useMemo(()=>Bi(e,t,u,s,n,"data"),[e,t,u,s,n]),h=i.useMemo(()=>Bi(e,t,u,s,n,"assets"),[e,t,u,s,n]),p=i.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let r=new Set,i=!1;if(t.forEach(e=>{let t=s.routes[e.route.id];t&&t.hasLoader&&(!d.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:r.add(e.route.id))}),0===r.size)return[];let u=Ri(e,l,a.v8_trailingSlashAwareDataRequests,"data");return i&&r.size>0&&u.searchParams.set("_routes",t.filter(e=>r.has(e.route.id)).map(e=>e.route.id).join(",")),[u.pathname+u.search]},[l,a.v8_trailingSlashAwareDataRequests,c,n,s,d,t,e,o]),f=i.useMemo(()=>zi(h,s),[h,s]),g=ba(h);return i.createElement(i.Fragment,null,p.map(e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...r})),f.map(e=>i.createElement("link",{key:e,rel:"modulepreload",href:e,...r})),g.map(({key:e,link:t})=>i.createElement("link",{key:e,nonce:r.nonce,...t,crossOrigin:t.crossOrigin??r.crossOrigin})))}
56function Ea(){let{isSpaMode:e,routeModules:t}=pa(),{errors:r,matches:n,loaderData:a}=da(),s=_r(),o=ga(n,r,e),l=null;r&&(l=r[o[o.length-1].route.id]);let c=[],u=null,d=[];for(let e=0;e<o.length;e++){let r=o[e],n=r.route.id,i=a[n],h=r.params,p=t[n],f=[],g={id:n,data:i,loaderData:i,meta:[],params:r.params,pathname:r.pathname,handle:r.route.handle,error:l};if(d[e]=g,p?.meta?f="function"==typeof p.meta?p.meta({data:i,loaderData:i,params:h,location:s,matches:d,error:l}):Array.isArray(p.meta)?[...p.meta]:p.meta:u&&(f=[...u]),f=f||[],!Array.isArray(f))throw new Error("The route at "+r.route.path+" returns an invalid value. All route meta functions must return an array of meta objects.\n\nTo reference the meta function API, see https://reactrouter.com/start/framework/route-module#meta");g.meta=f,d[e]=g,c=[...f],u=c}return i.createElement(i.Fragment,null,c.flat().map(e=>{if(!e)return null;if("tagName"in e){let{tagName:t,...r}=e;if(!function(e){return"string"==typeof e&&/^(meta|link)$/.test(e)}(t))return console.warn(`A meta object uses an invalid tagName: ${t}. Expected either 'link' or 'meta'`),null;let n=t;return i.createElement(n,{key:JSON.stringify(r),...r})}if("title"in e)return i.createElement("title",{key:"title"},String(e.title));if("charset"in e&&(e.charSet??(e.charSet=e.charset),delete e.charset),"charSet"in e&&null!=e.charSet)return"string"==typeof e.charSet?i.createElement("meta",{key:"charSet",charSet:e.charSet}):null;if("script:ld+json"in e)try{let t=JSON.stringify(e["script:ld+json"]);return i.createElement("script",{key:`script:ld+json:${t}`,type:"application/ld+json",dangerouslySetInnerHTML:{__html:yi(t)}})}catch(e){return null}return i.createElement("meta",{key:JSON.stringify(e),...e})}))}var Sa=!1;function Aa(){Sa=!0}function _a(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:a,routeDiscovery:s,ssr:o,nonce:l}=pa(),{router:c,static:u,staticContext:d}=ua(),{matches:h}=da(),p=ur(),f=ia(s,o);null==e.nonce&&l&&(e={...e,nonce:l}),a&&(a.didRenderScripts=!0);let g=ga(h,null,n);i.useEffect(()=>{Aa()},[]);let m=i.useMemo(()=>{if(p)return null;let n=d?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",a=u?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${f?"":`import ${JSON.stringify(t.url)}`};\n${g.map((e,r)=>{let n=`route${r}`,i=t.routes[e.route.id];bi(i,`Route ${e.route.id} not found in manifest`);let{clientActionModule:a,clientLoaderModule:s,clientMiddlewareModule:o,hydrateFallbackModule:l,module:c}=i,u=[...a?[{module:a,varName:`${n}_clientAction`}]:[],...s?[{module:s,varName:`${n}_clientLoader`}]:[],...o?[{module:o,varName:`${n}_clientMiddleware`}]:[],...l?[{module:l,varName:`${n}_HydrateFallback`}]:[],{module:c,varName:`${n}_main`}];return 1===u.length?`import * as ${n} from ${JSON.stringify(c)};`:[u.map(e=>`import * as ${e.varName} from "${e.module}";`).join("\n"),`const ${n} = {${u.map(e=>`...${e.varName}`).join(",")}};`].join("\n")}).join("\n")}\n ${f?`window.__reactRouterManifest = ${JSON.stringify(function({sri:e,...t},r){let n=new Set(r.state.matches.map(e=>e.route.id)),i=r.state.location.pathname.split("/").filter(Boolean),a=["/"];for(i.pop();i.length>0;)a.push(`/${i.join("/")}`),i.pop();a.forEach(e=>{let t=N(r.routes,e,r.basename||"/",!1,r.branches);t&&t.forEach(e=>n.add(e.route.id))});let s=[...n].reduce((e,r)=>Object.assign(e,{[r]:t.routes[r]}),{});return{...t,routes:s,sri:!!e||void 0}}(t,c),null,2)};`:""}\n window.__reactRouterRouteModules = {${g.map((e,t)=>`${JSON.stringify(e.route.id)}:route${t}`).join(",")}};\n\nimport(${JSON.stringify(t.entry.module)});`:" ";return i.createElement(i.Fragment,null,i.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:n},type:void 0}),i.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:a},type:"module",async:!0}))},[]),v=Sa||p?[]:[...new Set(t.entry.imports.concat(zi(g,t,{includeHydrateFallback:!0})))],y="object"==typeof t.sri?t.sri:{};return pn(!p,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),Sa||p?null:i.createElement(i.Fragment,null,"object"==typeof t.sri?i.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:y})}}):null,f?null:i.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:y[t.url],nonce:e.nonce,suppressHydrationWarning:!0}),i.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:y[t.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),v.map(t=>i.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin,integrity:y[t],nonce:e.nonce,suppressHydrationWarning:!0})),m)}function Ta(...e){return t=>
56{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}var Ca=class extends i.Component{constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?i.createElement(Pa,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Pa({error:e,isOutsideRemixApp:t}){let{nonce:r}=pa();console.error(e);let n,a=i.createElement("script",{nonce:r,dangerouslySetInnerHTML:{__html:'\n console.log(\n "ð¿ Hey developer ð. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n );\n '}});if(ve(e))return i.createElement(Ra,{title:"Unhandled Thrown Response!"},i.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),br?a:null);if(e instanceof Error)n=e;else{let t=null==e?"Unknown Error":"object"==typeof e&&"toString"in e?e.toString():JSON.stringify(e);n=new Error(t)}return i.createElement(Ra,{title:"Application Error!",isOutsideRemixApp:t},i.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),i.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},n.stack),a)}function Ra({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:a}=pa();return a.root?.Layout&&!r?n:i.createElement("html",{lang:"en"},i.createElement("head",null,i.createElement("meta",{charSet:"utf-8"}),i.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),i.createElement("title",null,e)),i.createElement("body",null,i.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?i.createElement(_a,null):null)))}var Oa="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{Oa&&(window.__reactRouterVersion="7.18.2")}catch(e){}function Da(e,t){return Ge({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:y({window:t?.window}),hydrationData:t?.hydrationData||Ma(),routes:e,mapRouteProperties:mn,hydrationRouteProperties:vn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function ka(e,t){return Ge({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:b({window:t?.window}),hydrationData:t?.hydrationData||Ma(),routes:e,mapRouteProperties:mn,hydrationRouteProperties:vn,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Ma(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:La(e.errors)}),e}function La(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)if(n&&"RouteErrorResponse"===n.__type)r[e]=new me(n.status,n.statusText,n.data,!0===n.internal);else if(n&&"Error"===n.__type){if("string"==typeof n.__subType&&ge.includes(n.__subType)){let t=window[n.__subType];if("function"==typeof t)try{let i=new t(n.message);i.stack="",r[e]=i}catch(e){}}if(null==r[e]){let t=new Error(n.message);t.stack="",r[e]=t}}else r[e]=n;return r}function Ia({basename:e,children:t,useTransitions:r,window:n}){let a=i.useRef();null==a.current&&(a.current=y({window:n,v5Compat:!0}));let s=a.current,[o,l]=i.useState({action:s.action,location:s.location}),c=i.useCallback(e=>{!1===r?l(e):i.startTransition(()=>l(e))},[r]);return i.useLayoutEffect(()=>s.listen(c),[s,c]),i.createElement(Pn,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s,useTransitions:r})}function Na({basename:e,children:t,useTransitions:r,window:n}){let a=i.useRef();null==a.current&&(a.current=b({window:n,v5Compat:!0}));let s=a.current,[o,l]=i.useState({action:s.action,location:s.location}),c=i.useCallback(e=>{!1===r?l(e):i.startTransition(()=>l(e))},[r]);return i.useLayoutEffect(()=>s.listen(c),[s,c]),i.createElement(Pn,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s,useTransitions:r})}function ja({basename:e,children:t,history:r,useTransitions:n}){let[a,s]=i.useState({action:r.action,location:r.location}),o=i.useCallback(e=>{!1===n?s(e):i.startTransition(()=>s(e))},[n]);return i.useLayoutEffect(()=>r.listen(o),[r,o]),i.createElement(Pn,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:r,useTransitions:n})}ja.displayName="unstable_HistoryRouter";var Fa=i.forwardRef(function({onClick:e,discover:t="render",prefetch:r="none",relative:n,reloadDocument:a,replace:s,mask:o,state:l,target:c,to:d,preventScrollReset:h,viewTransition:p,defaultShouldRevalidate:f,...g},m){let{basename:v,navigator:y,useTransitions:b}=i.useContext(gr),w="string"==typeof d&&u.test(d),x=we(d,v),E=Sr(d=x.to,{relative:n}),S=_r(),A=null;if(o){let e=ne(o,[],S.mask?S.mask.pathname:"/",!0);"/"!==v&&(e.pathname="/"===e.pathname?v:ae([v,e.pathname])),A=y.createHref(e)}let[_,T,C]=function(e,t){let r=i.useContext(ha),[n,a]=i.useState(!1),[s,o]=i.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=t,p=i.useRef(null);i.useEffect(()=>{if("render"===e&&o(!0),"viewport"===e){let e=new IntersectionObserver(e=>
56{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),i.useEffect(()=>{if(n){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[n]);let f=()=>{a(!0)},g=()=>{a(!1),o(!1)};return r?"intent"!==e?[s,p,{}]:[s,p,{onFocus:fa(l,f),onBlur:fa(c,g),onMouseEnter:fa(u,f),onMouseLeave:fa(d,g),onTouchStart:fa(h,f)}]:[!1,p,{}]}(r,g),P=Va(d,{replace:s,mask:o,state:l,target:c,preventScrollReset:h,relative:n,viewTransition:p,defaultShouldRevalidate:f,useTransitions:b});let R=!(x.isExternal||a),O=i.createElement("a",{...g,...C,href:(R?A:void 0)||x.absoluteURL||E,onClick:R?function(t){e&&e(t),t.defaultPrevented||P(t)}:e,ref:Ta(m,T),target:c,"data-discover":w||"render"!==t?void 0:"true"});return _&&!w?i.createElement(i.Fragment,null,O,i.createElement(ya,{page:E})):O});Fa.displayName="Link";var Ha=i.forwardRef(function({"aria-current":e="page",caseSensitive:t=!1,className:r="",end:n=!1,style:a,to:s,viewTransition:o,children:l,...c},u){let d=Ir(s,{relative:c.relative}),h=_r(),p=i.useContext(lr),{navigator:f,basename:g}=i.useContext(gr),m=null!=p&&is(d)&&!0===o,v=f.encodeLocation?f.encodeLocation(d).pathname:d.pathname,y=h.pathname,b=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(y=y.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&g&&(b=K(b,g)||b);const w="/"!==v&&v.endsWith("/")?v.length-1:v.length;let x,E=y===v||!n&&y.startsWith(v)&&"/"===y.charAt(w),S=null!=b&&(b===v||!n&&b.startsWith(v)&&"/"===b.charAt(v.length)),A={isActive:E,isPending:S,isTransitioning:m},_=E?e:void 0;x="function"==typeof r?r(A):[r,E?"active":null,S?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let T="function"==typeof a?a(A):a;return i.createElement(Fa,{...c,"aria-current":_,className:x,ref:u,style:T,to:s,viewTransition:o},"function"==typeof l?l(A):l)});Ha.displayName="NavLink";var Ba=i.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:a,state:s,method:o=Vn,action:l,onSubmit:c,relative:d,preventScrollReset:h,viewTransition:p,defaultShouldRevalidate:f,...g},m)=>{let{useTransitions:v}=i.useContext(gr),y=Ga(),b=Xa(l,{relative:d}),w="get"===o.toLowerCase()?"get":"post",x="string"==typeof l&&u.test(l);return i.createElement("form",{ref:m,method:w,action:b,onSubmit:n?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let n=e.nativeEvent.submitter,l=n?.getAttribute("formmethod")||o,u=()=>y(n||e.currentTarget,{fetcherKey:t,method:l,navigate:r,replace:a,state:s,relative:d,preventScrollReset:h,viewTransition:p,defaultShouldRevalidate:f});v&&!1!==r?i.startTransition(()=>u()):u()},...g,"data-discover":x||"render"!==e?void 0:"true"})});function za({getKey:e,storageKey:t,...r}){let n=i.useContext(ha),{basename:a}=i.useContext(gr),s=_r(),o=Jr();ts({getKey:e,storageKey:t});let l=i.useMemo(()=>{if(!n||!e)return null;let t=es(s,o,a,e);return t!==s.key?t:null},[]);if(!n||n.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},"")}try{let r=JSON.parse(sessionStorage.getItem(e)||"{}")[t||window.history.state.key];"number"==typeof r&&window.scrollTo(0,r)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return null==r.nonce&&n?.nonce&&(r.nonce=n.nonce),i.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${yi(JSON.stringify(t||Qa))}, ${yi(JSON.stringify(l))})`}})}function $a(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ua(e){let t=i.useContext(or);return w(t,$a(e)),t}function Wa(e){let t=i.useContext(lr);return w(t,$a(e)),t}function Va(e,{target:t,replace:r,mask:n,state:a,preventScrollReset:s,relative:o,viewTransition:l,defaultShouldRevalidate:c,useTransitions:u}={}){let d=Or(),h=_r(),p=Ir(e,{relative:o});return i.useCallback(f=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(f,t)){f.preventDefault();let t=void 0!==r?r:A(h)===A(p),g=()=>d(e,{replace:t,mask:n,state:a,preventScrollReset:s,relative:o,viewTransition:l,defaultShouldRevalidate:c});u?i.startTransition(()=>g()):g()}},[h,d,p,r,n,a,t,e,s,o,l,c,u])}function qa(e){x("undefined"!=typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=i.useRef(Gn(e)),r=i.useRef(!1),n=_r(),a=i.useMemo(()=>function(e,t){let r=Gn(e);return t&&t.forEach((e,n)=>
56{r.has(n)||t.getAll(n).forEach(e=>{r.append(n,e)})}),r}(n.search,r.current?null:t.current),[n.search]),s=Or(),o=i.useCallback((e,t)=>{const n=Gn("function"==typeof e?e(new URLSearchParams(a)):e);r.current=!0,s("?"+n,t)},[s,a]);return[a,o]}Ba.displayName="Form",za.displayName="ScrollRestoration";var Ya=0;function Ga(){let{router:e}=Ua("useSubmit"),{basename:t}=i.useContext(gr),r=Gr("useRouteId"),n=e.fetch,a=e.navigate;return i.useCallback(async(e,i={})=>{let{action:s,method:o,encType:l,formData:c,body:u}=Qn(e,t);if(!1===i.navigate){let e=i.fetcherKey||`__${String(++Ya)}__`;await n(e,r,i.action||s,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:u,formMethod:i.method||o,formEncType:i.encType||l,flushSync:i.flushSync})}else await a(i.action||s,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:u,formMethod:i.method||o,formEncType:i.encType||l,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,a,t,r])}function Xa(e,{relative:t}={}){let{basename:r}=i.useContext(gr),n=i.useContext(vr);w(n,"useFormAction must be used inside a RouteContext");let[a]=n.matches.slice(-1),s={...Ir(e||".",{relative:t})},o=_r();if(null==e){s.search=o.search;let e=new URLSearchParams(s.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let r=e.toString();s.search=r?`?${r}`:""}}return e&&"."!==e||!a.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),"/"!==r&&(s.pathname="/"===s.pathname?r:ae([r,s.pathname])),A(s)}function Ka({key:e}={}){let{router:t}=Ua("useFetcher"),r=Wa("useFetcher"),n=i.useContext(hr),a=i.useContext(vr),s=a.matches[a.matches.length-1]?.route.id;w(n,"useFetcher must be used inside a FetchersContext"),w(a,"useFetcher must be used inside a RouteContext"),w(null!=s,'useFetcher can only be used on routes that contain a unique "id"');let o=i.useId(),[l,c]=i.useState(e||o);e&&e!==l&&c(e);let{deleteFetcher:u,getFetcher:d,resetFetcher:h,fetch:p}=t;i.useEffect(()=>(d(l),()=>u(l)),[u,d,l]);let f=i.useCallback(async(e,t)=>{w(s,"No routeId available for fetcher.load()"),await p(l,s,e,t)},[l,s,p]),g=Ga(),m=i.useCallback(async(e,t)=>{await g(e,{...t,navigate:!1,fetcherKey:l})},[l,g]),v=i.useCallback(e=>h(l,e),[h,l]),y=i.useMemo(()=>{let e=i.forwardRef((e,t)=>i.createElement(Ba,{...e,navigate:!1,fetcherKey:l,ref:t}));return e.displayName="fetcher.Form",e},[l]),b=r.fetchers.get(l)||$e,x=n.get(l);return i.useMemo(()=>({Form:y,submit:m,load:f,reset:v,...b,data:x}),[y,m,f,v,b,x])}function Ja(){let e=Wa("useFetchers");return i.useMemo(()=>Array.from(e.fetchers.entries()).map(([e,t])=>({...t,key:e})),[e.fetchers])}var Qa="react-router-scroll-positions",Za={};function es(e,t,r,n){let i=null;return n&&(i=n("/"!==r?{...e,pathname:K(e.pathname,r)||e.pathname}:e,t)),null==i&&(i=e.key),i}function ts({getKey:e,storageKey:t}={}){let{router:r}=Ua("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:a}=Wa("useScrollRestoration"),{basename:s}=i.useContext(gr),o=_r(),l=Jr(),c=Xr();i.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),function(e,t){let{capture:r}=t||{};i.useEffect(()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("pagehide",e,t),()=>{window.removeEventListener("pagehide",e,t)}},[e,r])}(i.useCallback(()=>{if("idle"===c.state){let t=es(o,l,s,e);Za[t]=window.scrollY}try{sessionStorage.setItem(t||Qa,JSON.stringify(Za))}catch(e){x(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration="auto"},[c.state,e,s,o,l,t])),"undefined"!=typeof document&&(i.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Qa);e&&(Za=JSON.parse(e))}catch(e){}},[t]),i.useLayoutEffect(()=>{let t=r?.enableScrollRestoration(Za,()=>window.scrollY,e?(t,r)=>es(t,r,s,e):void 0);return()=>t&&t()},[r,s,e]),i.useLayoutEffect(()=>{if(!1!==n)if("number"!=typeof n){try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e)return void e.scrollIntoView()}}catch{x(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}!0!==a&&window.scrollTo(0,0)}else window.scrollTo(0,n)}
56,[o,n,a]))}function rs(e,t){let{capture:r}=t||{};i.useEffect(()=>{let t=null!=r?{capture:r}:void 0;return window.addEventListener("beforeunload",e,t),()=>{window.removeEventListener("beforeunload",e,t)}},[e,r])}function ns({when:e,message:t}){let r=sn(e);i.useEffect(()=>{if("blocked"===r.state){window.confirm(t)?setTimeout(r.proceed,0):r.reset()}},[r,t]),i.useEffect(()=>{"blocked"!==r.state||e||r.reset()},[r,e])}function is(e,{relative:t}={}){let r=i.useContext(dr);w(null!=r,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Ua("useViewTransitionState"),a=Ir(e,{relative:t});if(!r.isTransitioning)return!1;let s=K(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=K(r.nextLocation.pathname,n)||r.nextLocation.pathname;return null!=q(a.pathname,o)||null!=q(a.pathname,s)}function as({basename:e,children:t,location:r="/"}){"string"==typeof r&&(r=_(r));let n={pathname:r.pathname||"/",search:r.search||"",hash:r.hash||"",state:null!=r.state?r.state:null,key:r.key||"default",mask:void 0},a=ls();return i.createElement(Pn,{basename:e,children:t,location:n,navigationType:"POP",navigator:a,static:!0,useTransitions:!1})}function ss({context:e,router:t,hydrate:r=!0,nonce:n}){w(t&&e,"You must provide `router` and `context` to <StaticRouterProvider>");let a={router:t,navigator:ls(),static:!0,staticContext:e,basename:e.basename||"/"},s=new Map,o="";if(!1!==r){let t={loaderData:e.loaderData,actionData:e.actionData,errors:os(e.errors)};o=`window.__staticRouterHydrationData = JSON.parse(${yi(JSON.stringify(JSON.stringify(t)))});`}let{state:l}=a.router;return i.createElement(i.Fragment,null,i.createElement(or.Provider,{value:a},i.createElement(lr.Provider,{value:l},i.createElement(hr.Provider,{value:s},i.createElement(dr.Provider,{value:{isTransitioning:!1}},i.createElement(Pn,{basename:a.basename,location:l.location,navigationType:l.historyAction,navigator:a.navigator,static:a.static,useTransitions:!1},i.createElement(Sn,{manifest:t.manifest,routes:t.routes,future:t.future,state:l,isStatic:!0})))))),o?i.createElement("script",{suppressHydrationWarning:!0,nonce:n,dangerouslySetInnerHTML:{__html:o}}):null)}function os(e){if(!e)return null;let t=Object.entries(e),r={};for(let[e,n]of t)ve(n)?r[e]={...n,__type:"RouteErrorResponse"}:n instanceof Error?r[e]={message:n.message,__type:"Error",..."Error"!==n.name?{__subType:n.name}:{}}:r[e]=n;return r}function ls(){return{createHref:ds,encodeLocation:hs,push(e){throw new Error(`You cannot use navigator.push() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)})\` somewhere in your app.`)},replace(e){throw new Error(`You cannot use navigator.replace() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(e)}, { replace: true })\` somewhere in your app.`)},go(e){throw new Error(`You cannot use navigator.go() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${e})\` somewhere in your app.`)},back(){throw new Error("You cannot use navigator.back() on the server because it is a stateless environment.")},forward(){throw new Error("You cannot use navigator.forward() on the server because it is a stateless environment.")}}}function cs(e,t){return Xe(e,{...t,mapRouteProperties:mn})}function us(e,t,r={}){let n={},i=M(e,mn,void 0,n),a=t.matches.map(e=>{let t=n[e.route.id]||e.route;return{...e,route:t}}),s=e=>`You cannot use router.${e}() on the server because it is a stateless environment`;return{get basename(){return t.basename},get future(){return{v8_middleware:!1,v8_passThroughRequests:!1,v8_trailingSlashAwareDataRequests:!1,...r?.future}},get state(){return{historyAction:"POP",location:t.location,matches:a,loaderData:t.loaderData,actionData:t.actionData,errors:t.errors,initialized:!0,renderFallback:!1,navigation:ze,restoreScrollPosition:null,preventScrollReset:!1,revalidation:"idle",fetchers:new Map,blockers:new Map}},get routes(){return i},get branches(){return r.branches},get manifest(){return n},get window(){},initialize(){throw s("initialize")},subscribe(){throw s("subscribe")},enableScrollRestoration(){throw s("enableScrollRestoration")},navigate(){throw s("navigate")},fetch(){throw s("fetch")},revalidate(){throw s("revalidate")},createHref:ds,encodeLocation:hs,getFetcher:()=>$e,deleteFetcher(){throw s("deleteFetcher")},resetFetcher(){throw s("resetFetcher")},dispose(){throw s("dispose")},getBlocker:()=>Ue,deleteBlocker(){throw s("deleteBlocker")},patchRoutes(){throw s("patchRoutes")},_internalFetchControllers:new Map,_internalSetRoutes(){throw s("_internalSetRoutes")},_internalSetStateDoNotUseOrYouWillBreakYourApp(){throw s("_internalSetStateDoNotUseOrYouWillBreakYourApp")}}}function ds(e){return"string"==typeof e?e:A(e)}function hs(e){let t="string"==typeof e?e:A(e);t=t.replace(/ $/,"%20");let r=u.test(t)?new URL(t):new URL(t,"http://localhost");return{pathname:r.pathname,search:r.search,hash:r.hash}}},1517(e,t,r){"use strict";r.d(t,{yq:()=>le,ZJ:()=>ae,E3:()=>ge,dC:()=>b,Zz:()=>l,n0:()=>f,Y6:()=>Q,Nb:()=>Z,KB:()=>V,PY:()=>c,jw:()=>G,yM:()=>K,Zd:()=>me,UF:()=>ee,fm:()=>g,lV:()=>X,Vv:()=>ue,C3:()=>fe,LQ:()=>R});var n=r(6213),i=r(1594),a=r.t(i,2),s=r.cjs(function(e,t){t.qg=c,t.lK=u,t.lK=u;const r=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,n=/^[\u0021-\u003A\u003C-\u007E]*$/,i=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,s=/^-?\d+$/,o=Object.prototype.toString,l=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function c(e,t){const r=new l,n=e.length;if(n<2)return r;const i=t?.decode||f;let a=0;do{const t=h(e,a,n);if(-1===t)break;const s=d(e,a,n);if(t>s){a=e.lastIndexOf(";",t-1)+1;continue}const o=p(e,a,t);void 0===r[o]&&(r[o]=i(p(e,t+1,s))),a=s+1}while(a<n);return r}function u(e,t,s){const l="object"==typeof e?e:{...s,name:e,value:String(t)},c="object"==typeof t?t:s,u=c?.encode||encodeURIComponent;
vendor: 1,061 bytes, line 56
56if(!r.test(l.name))throw new TypeError(`argument name is invalid: ${l.name}`);const d=l.value?u(l.value):"";if(!n.test(d))throw new TypeError(`argument val is invalid: ${l.value}`);let h=l.name+"="+d;if(void 0!==l.maxAge){if(!Number.isInteger(l.maxAge))throw new TypeError(`option maxAge is invalid: ${l.maxAge}`);h+="; Max-Age="+l.maxAge}if(l.domain){if(!i.test(l.domain))throw new TypeError(`option domain is invalid: ${l.domain}`);h+="; Domain="+l.domain}if(l.path){if(!a.test(l.path))throw new TypeError(`option path is invalid: ${l.path}`);h+="; Path="+l.path}if(l.expires){if(p=l.expires,"[object Date]"!==o.call(p)||!Number.isFinite(l.expires.valueOf()))throw new TypeError(`option expires is invalid: ${l.expires}`);h+="; Expires="+l.expires.toUTCString()}var p;if(l.httpOnly&&(h+="; HttpOnly"),l.secure&&(h+="; Secure"),l.partitioned&&(h+="; Partitioned"),l.priority){switch("string"==typeof l.priority?l.priority.toLowerCase():void 0){case"low":h+="; Priority=Low";break;case"medium":h+="; Priority=Medium";break;case"high":h+="; Priority=High";break;
56default:throw new TypeError(`option priority is invalid: ${l.priority}`)}}if(l.sameSite){switch("string"==typeof l.sameSite?l.sameSite.toLowerCase():l.sameSite){case!0:case"strict":h+="; SameSite=Strict";break;case"lax":h+="; SameSite=Lax";break;case"none":h+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${l.sameSite}`)}}return h}function d(e,t,r){const n=e.indexOf(";",t);return-1===n?r:n}function h(e,t,r){const n=e.indexOf("=",t);return n<r?n:-1}function p(e,t,r){let n=t,i=r;do{const t=e.charCodeAt(n);if(32!==t&&9!==t)break}while(++n<i);for(;i>n;){const t=e.charCodeAt(i-1);if(32!==t&&9!==t)break;i--}return e.slice(n,i)}function f(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}}),o=r.cjs(function(e,t){var r={decodeValues:!0,map:!1,silent:!1};function n(e){return"string"!=typeof e||e in{}}function i(){return Object.create(null)}function a(e){return"string"==typeof e&&!!e.trim()}function s(e,t){var s=e.split(";").filter(a),o=function(e){var t="",r="",n=e.split("=");n.length>1?(t=n.shift(),r=n.join("=")):r=e;return{name:t,value:r}}(s.shift()),l=o.name,c=o.value;if(t=t?Object.assign({},r,t):r,n(l))return null;try{c=t.decodeValues?decodeURIComponent(c):c}catch(e){console.error("set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.",e)}var u=i();return u.name=l,u.value=c,s.forEach(function(e){var t=e.split("="),r=t.shift().trimLeft().toLowerCase();if(!n(r)){var i=t.join("=");if("expires"===r)u.expires=new Date(i);else if("max-age"===r){var a=parseInt(i,10);Number.isNaN(a)||(u.maxAge=a)}else"secure"===r?u.secure=!0:"httponly"===r?u.httpOnly=!0:"samesite"===r?u.sameSite=i:"partitioned"===r?u.partitioned=!0:r&&(u[r]=i)}}),u}function o(e,t){if(t=t?Object.assign({},r,t):r,!e)return t.map?i():[];if(e.headers)if("function"==typeof e.headers.getSetCookie)e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var o=e.headers[Object.keys(e.headers).find(function(e){return"set-cookie"===e.toLowerCase()})];o||!e.headers.cookie||t.silent||console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=o}if(Array.isArray(e)||(e=[e]),t.map){var l=i();return e.filter(a).reduce(function(e,r){var i=s(r,t);return i&&!n(i.name)&&(e[i.name]=i),e},l)}return e.filter(a).map(function(e){return s(e,t)}).filter(Boolean)}e.exports=o,e.exports.parse=o,e.exports.parseString=s,e.exports.splitCookiesString=function(e){if(Array.isArray(e))return e;if("string"!=typeof e)return[];var t,r,n,i,a,s=[],o=0;function l(){for(;o<e.length&&/\s/.test(e.charAt(o));)o+=1;return o<e.length}function c(){return"="!==(r=e.charAt(o))&&";"!==r&&","!==r}for(;o<e.length;){for(t=o,a=!1;l();)if(","===(r=e.charAt(o))){for(n=o,o+=1,l(),i=o;o<e.length&&c();)o+=1;o<e.length&&"="===e.charAt(o)?(a=!0,o=i,s.push(e.substring(t,n)),t=o):o=n+1}else o+=1;(!a||o>=e.length)&&s.push(e.substring(t,e.length))}return s}}); 57/** 58 * react-router v7.18.2 59 * 60 * Copyright (c) Remix Software Inc. 61 * 62 * This source code is licensed under the MIT license found in the 63 * LICENSE.md file in the root directory of this source tree. 64 * 65 * @license MIT 66 */ 67function l({context:e,url:t,nonce:r}){"string"==typeof t&&(t=new URL(t));let{manifest:a,routeModules:s,criticalCss:o,serverHandoffString:l}=e,c=(0,n.OW)(a.routes,s,e.future,e.isSpaMode);e.staticHandlerContext.loaderData={...e.staticHandlerContext.loaderData};for(let t of e.staticHandlerContext.matches){let r=t.route.id,i=s[r],a=e.manifest.routes[r];i&&a&&(0,n.vB)(r,i.clientLoader,a.hasLoader,e.isSpaMode)&&(i.HydrateFallback||!a.hasLoader)&&delete e.staticHandlerContext.loaderData[r]}let u=(0,n.KD)(c,e.staticHandlerContext,{branches:e.branches});return i.createElement(i.Fragment,null,i.createElement(n.yL.Provider,{value:{manifest:a,routeModules:s,criticalCss:o,serverHandoffString:l,future:e.future,ssr:e.ssr,isSpaMode:e.isSpaMode,routeDiscovery:e.routeDiscovery,nonce:r,serializeError:e.serializeError,renderMeta:e.renderMeta}},i.createElement(n.aJ,{location:u.state.location},i.createElement(n.je,{router:u,context:e.staticHandlerContext,hydrate:!1}))),e.serverHandoffStream?i.createElement(i.Suspense,null,i.createElement(n.UU,{context:e,identifier:0,reader:e.serverHandoffStream.getReader(),textDecoder:new TextDecoder,nonce:r})):null)}function c(e,t){return function({initialEntries:r,initialIndex:a,hydrationData:s,future:o}){let l=i.useRef(),c=i.useRef();if(null==l.current){c.current={future:{v8_passThroughRequests:!0===o?.v8_passThroughRequests,v8_middleware:!0===o?.v8_middleware,v8_trailingSlashAwareDataRequests:!0===o?.v8_trailingSlashAwareDataRequests},manifest:{routes:{},entry:{imports:[],module:""},url:"",version:""},routeModules:{},ssr:!1,isSpaMode:!1,routeDiscovery:{mode:"lazy",manifestPath:"/__manifest"}};let i=u((0,n.R_)(e,e=>e),void 0!==t?t:o?.v8_middleware?new n.aB:{},c.current.manifest,c.current.routeModules);l.current=(0,n.bg)(i,{initialEntries:r,initialIndex:a,hydrationData:s})}return i.createElement(n.yL.Provider,{value:c.current},i.createElement(n.pg,{router:l.current}))}}function u(e,t,r,i,a){return e.map(e=>{if(!e.id)throw new Error("Expected a route.id in react-router processRoutes() function");let s={id:e.id,path:e.path,index:e.index,Component:e.Component?(0,n.ux)(e.Component):void 0,HydrateFallback:e.HydrateFallback?(0,n.AX)(e.HydrateFallback):void 0,ErrorBoundary:e.ErrorBoundary?(0,n.Vp)(e.ErrorBoundary):void 0,action:e.action?r=>e.action({...r,context:t}):void 0,loader:e.loader?r=>e.loader({...r,context:t}):void 0,middleware:e.middleware?e.middleware.map(e=>(...r)=>e({...r[0],context:t},r[1])):void 0,handle:e.handle,shouldRevalidate:e.shouldRevalidate},o={id:e.id,path:e.path,index:e.index,parentId:a,hasAction:null!=e.action,hasLoader:null!=e.loader,hasClientAction:!1,hasClientLoader:!1,hasClientMiddleware:!1,hasErrorBoundary:null!=e.ErrorBoundary,module:"build/stub-path-to-module.js",clientActionModule:void 0,clientLoaderModule:void 0,clientMiddlewareModule:void 0,hydrateFallbackModule:void 0};return r.routes[s.id]=o,i[e.id]={default:s.Component||n.sv,ErrorBoundary:s.ErrorBoundary||void 0,handle:e.handle,links:e.links,meta:e.meta,shouldRevalidate:e.shouldRevalidate},e.children&&(s.children=u(e.children,t,r,i,s.id)),s})}var d=new TextEncoder,h=async(e,t)=>{let r=e.lastIndexOf("."),n=e.slice(0,r),i=e.slice(r+1),a=d.encode(n),s=await p(t,["verify"]);try{let e=function(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}(atob(i));return!!await crypto.subtle.verify("HMAC",s,e,a)&&n}catch(e){return!1}},p=async(e,t)=>crypto.subtle.importKey("raw",d.encode(e),{name:"HMAC",hash:"SHA-256"},!1,t);var f=(e,t={})=>{let{secrets:r=[],...i}={path:"/",sameSite:"lax",...t};return function(e,t){(0,n.mc)(!t,`The "${e}" cookie has an "expires" property set. This will cause the expires value to not be updated when the session is committed. Instead, you should set the expires value when serializing the cookie. You can use \`commitSession(session, { expires })\` if using a session storage object, or \`cookie.serialize("value", { expires })\` if you're using the cookie directly.`)}(e,i.expires),{get name(){return e},get isSigned(){return r.length>0},get expires(){return void 0!==i.maxAge?new Date(Date.now()+1e3*i.maxAge):i.expires},async parse(t,n){if(!t)return null;let a=(0,s.qg)(t,{...i,...n});if(e in a){let t=a[e];if("string"==typeof t&&""!==t){let e=await async function(e,t){if(t.length>0){for(let r of t){let t=await h(e,r);if(!1!==t)return m(t)}return null}return m(e)}(t,r);return e}return""}return null}
67,serialize:async(t,n)=>(0,s.lK)(e,""===t?"":await async function(e,t){let r=function(e){return btoa(function(e){let t,r,n=e.toString(),i="",a=0;for(;a<n.length;){if(t=n.charAt(a++),"%"===t)if("u"===n.charAt(a)){if(r=n.slice(a+1,a+5),/^[\da-f]{4}$/i.exec(r)){i+=String.fromCharCode(parseInt(r,16)),a+=5;continue}}else if(r=n.slice(a,a+2),/^[\da-f]{2}$/i.exec(r)){i+=String.fromCharCode(parseInt(r,16)),a+=2;continue}i+=t}return i}(encodeURIComponent(JSON.stringify(e))))}(e);t.length>0&&(r=await(async(e,t)=>{let r=d.encode(e),n=await p(t,["sign"]),i=await crypto.subtle.sign("HMAC",n,r);return e+"."+btoa(String.fromCharCode(...new Uint8Array(i))).replace(/=+$/,"")})(r,t[0]));return r}(t,r),{...i,...n})}},g=e=>null!=e&&"string"==typeof e.name&&"boolean"==typeof e.isSigned&&"function"==typeof e.parse&&"function"==typeof e.serialize;function m(e){try{return JSON.parse(decodeURIComponent(function(e){let t,r,n=e.toString(),i="",a=0;for(;a<n.length;)t=n.charAt(a++),/[\w*+\-./@]/.exec(t)?i+=t:(r=t.charCodeAt(0),i+=r<256?"%"+v(r,2):"%u"+v(r,4).toUpperCase());return i}(atob(e))))}catch(e){return{}}}function v(e,t){let r=e.toString(16);for(;r.length<t;)r="0"+r;return r}function y(e){return Object.keys(e).reduce((t,r)=>{let n=e[r];return n&&(t[r]=n.module),t},{})}var b=(e=>(e.Development="development",e.Production="production",e.Test="test",e))(b||{});function w(e,t){if(e instanceof Error&&"development"!==t){let e=new Error("Unexpected Server Error");return e.stack=void 0,e}return e}function x(e,t){return Object.entries(e).reduce((e,[r,n])=>Object.assign(e,{[r]:w(n,t)}),{})}function E(e,t){let r=w(e,t);return{message:r.message,stack:r.stack}}function S(e,t){if(!1===e||null==e)throw console.error("The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose"),new Error(t)}function A(e,t,r,i,a){let s=(0,n.et)(t,i,a??"/",!1,r);return s?s.map(t=>{let r=e[t.route.id];return S(r,`Route with id "${t.route.id}" not found in manifest.`),{params:t.params,pathname:t.pathname,route:r}}):null}async function _(e,t,r){let i=await e({request:r.v8_passThroughRequests?t.request:C(T(t.request)),url:t.url,params:t.params,context:t.context,pattern:t.pattern});if((0,n.YX)(i)&&i.init&&i.init.status&&(0,n.QE)(i.init.status))throw new Response(null,i.init);return i}function T(e){let t=new URL(e.url),r=t.searchParams.getAll("index");t.searchParams.delete("index");let n=[];for(let e of r)e&&n.push(e);for(let e of n)t.searchParams.append("index",e);let i={method:e.method,body:e.body,headers:e.headers,signal:e.signal};return i.body&&(i.duplex="half"),new Request(t.href,i)}function C(e){let t=new URL(e.url);t.searchParams.delete("_routes");let r={method:e.method,body:e.body,headers:e.headers,signal:e.signal};return r.body&&(r.duplex="half"),new Request(t.href,r)}var P="__reactRouterDevServerHooks";function R(e){globalThis[P]=e}function O(){return globalThis[P]}function D(e,t){if("undefined"!=typeof process)try{if(process.env.hasOwnProperty("IS_RR_BUILD_REQUEST")&&"yes"===process.env.IS_RR_BUILD_REQUEST)return e.headers.get(t)}catch(e){}return null}function k(e,t,i="",a=function(e){let t={};return Object.values(e).forEach(e=>{if(e){let r=e.parentId||"";t[r]||(t[r]=[]),t[r].push(e)}}),t}(e)){return(a[i]||[]).map(i=>{let s={hasErrorBoundary:"root"===i.id||null!=i.module.ErrorBoundary,id:i.id,path:i.path,middleware:i.module.middleware,loader:i.module.loader?async e=>{let a=D(e.request,"X-React-Router-Prerender-Data");if(null!=a){let e=a?decodeURI(a):a;S(e,"Missing prerendered data for route");let t=(new TextEncoder).encode(e),s=new ReadableStream({start(e){e.enqueue(t),e.close()}}),o=(await(0,n.ht)(s,r.g)).value;if(o&&n.lR in o){let e=o[n.lR],t={status:e.status};throw e.reload?(0,n.Sk)(e.redirect,t):e.replace?(0,n.HC)(e.redirect,t):(0,n.V2)(e.redirect,t)}{S(o&&i.id in o,"Unable to decode prerendered data");let e=o[i.id];return S("data"in e,"Unable to process prerendered data"),e.data}}return await _(i.module.loader,e,t)}:void 0,action:i.module.action?e=>_(i.module.action,e,t):void 0,handle:i.module.handle};return i.index?{index:!0,...s}:{caseSensitive:i.caseSensitive,children:k(e,t,i.id,a),...s}})}function M(e){return(0,n.ZD)(JSON.stringify(e))}function L(e,t){return function(e,t,r){let n,i=e.errors?e.matches.findIndex(t=>e.errors[t.route.id]):-1,a=i>=0?e.matches.slice(0,i+1):e.matches;if(i>=0){let{actionHeaders:t,actionData:r,loaderHeaders:a,loaderData:s}=e;e.matches.slice(i).some(e=>{let i=e.route.id;return!t[i]||r&&r.hasOwnProperty(i)?a[i]&&!s.hasOwnProperty(i)&&(n=a[i]):n=t[i],null!=n})}const s=new Headers(r);return a.reduce((r,i,s)=>{let{id:o}=i.route,l=e.loaderHeaders[o]||new Headers,c=e.actionHeaders[o]||new Headers,u=null!=n&&s===a.length-1,d=u&&n!==l&&n!==c,h=t(i);if(null==h){let e=new Headers(r);return d&&I(n,e),I(c,e),I(l,e),e}let p=new Headers("function"==typeof h?h({loaderHeaders:l,parentHeaders:r,actionHeaders:c,errorHeaders:u?n:void 0}):h);return d&&I(n,p),I(c,p),I(l,p),I(r,p),p},new Headers(s))}(e,e=>{let r=t.routes[e.route.id];return S(r,`Route with id "${e.route.id}" not found in build`),r.module.headers})}function I(e,t){let r=e.get("Set-Cookie");if(r){let e=(0,o.splitCookiesString)(r),n=new Set(t.getSetCookie());
67e.forEach(e=>{n.has(e)||t.append("Set-Cookie",e)})}}function N(e,t){let r=e.headers.get("origin"),n=null;try{n="string"==typeof r&&"null"!==r?new URL(r).host:r}catch{throw new Error("`origin` header is not a valid URL. Aborting the action.")}let i=new URL(e.url).host;if(n&&n!==i&&!function(e,t=[]){return t.some(t=>t&&(t===e||function(e,t){const r=e.split("."),n=t.split(".");if(n.length<1)return!1;if(r.length<n.length)return!1;for(;n.length;){const e=n.pop(),t=r.pop();switch(e){case"":return!1;case"*":if(t)continue;return!1;case"**":return!(n.length>0)&&void 0!==t;default:if(t!==e)return!1}}return 0===r.length}(e,t)))}(n,t))throw new Error("The `request.url` host does not match `origin` header from a forwarded action request. Aborting the action.")}function j(e,t,r){t=t||"/";let i=new URL(e.url),a=i.pathname;r?.v8_trailingSlashAwareDataRequests?a=a.endsWith("/_.data")?a.replace(/_\.data$/,""):a.replace(/\.data$/,""):("/_root.data"===(0,n.pb)(a,t)?a=t:a.endsWith(".data")&&(a=a.replace(/\.data$/,"")),"/"!==(0,n.pb)(a,t)&&a.endsWith("/")&&(a=a.slice(0,-1)));let s=new URLSearchParams(i.search);s.delete("_routes");let o=s.toString();return o&&(o=`?${o}`),{pathname:a,search:o,hash:""}}var F=new Set([...n.RF,304]);async function H(e,t,r,i,a,s,o){try{try{N(i,Array.isArray(e.allowedActionOrigins)?e.allowedActionOrigins:[])}catch(e){return c(new Error("Bad Request"),400)}let t=e.future.v8_passThroughRequests?i:new Request(a,{method:i.method,body:i.body,headers:i.headers,signal:i.signal,...i.body?{duplex:"half"}:void 0}),n=await r.query(t,{requestContext:s,skipLoaderErrorBubbling:!0,skipRevalidation:!0,generateMiddlewareResponse:e.future.v8_middleware?async e=>{try{return l(await e(t))}catch(e){return c(e)}}:void 0,normalizePath:t=>j(t,e.basename,e.future)});return l(n)}catch(e){return c(e)}function l(r){return(0,n.Sv)(r)?r:function(r){let a,s=L(r,e);if((0,n.QE)(r.statusCode)&&s.has("Location"))return new Response(null,{status:r.statusCode,headers:s});r.errors&&(Object.values(r.errors).forEach(e=>{(0,n.pX)(e)&&!e.error||o(e)}),r.errors=x(r.errors,t));a=r.errors?{error:Object.values(r.errors)[0]}:{data:Object.values(r.actionData||{})[0]};return z(i,e,t,{result:a,headers:s,status:r.statusCode})}(r)}function c(r,n=500){return o(r),z(i,e,t,{result:{error:r},headers:new Headers,status:n})}}async function B(e,t,r,i,a,s,o){let l=new URL(i.url).searchParams.get("_routes"),c=l?new Set(l.split(",")):null;try{let t=e.future.v8_passThroughRequests?i:new Request(a,{headers:i.headers,signal:i.signal}),n=await r.query(t,{requestContext:s,filterMatchesToLoad:e=>!c||c.has(e.route.id),skipLoaderErrorBubbling:!0,generateMiddlewareResponse:e.future.v8_middleware?async e=>{try{return u(await e(t))}catch(e){return d(e)}}:void 0,normalizePath:t=>j(t,e.basename,e.future)});return u(n)}catch(e){return d(e)}function u(r){return(0,n.Sv)(r)?r:function(r){let a=L(r,e);if((0,n.QE)(r.statusCode)&&a.has("Location"))return new Response(null,{status:r.statusCode,headers:a});r.errors&&(Object.values(r.errors).forEach(e=>{(0,n.pX)(e)&&!e.error||o(e)}),r.errors=x(r.errors,t));let s={},l=new Set(r.matches.filter(e=>c?c.has(e.route.id):null!=e.route.loader).map(e=>e.route.id));if(r.errors)for(let[e,t]of Object.entries(r.errors))s[e]={error:t};for(let[e,t]of Object.entries(r.loaderData))!(e in s)&&l.has(e)&&(s[e]={data:t});return z(i,e,t,{result:s,headers:a,status:r.statusCode})}(r)}function d(r){return o(r),z(i,e,t,{result:{error:r},headers:new Headers,status:500})}}function z(e,t,r,{result:n,headers:i,status:a}){let s=new Headers(i);return s.set("X-Remix-Response","yes"),F.has(a)?new Response(null,{status:a,headers:s}):(s.set("Content-Type","text/x-script"),s.delete("Content-Length"),new Response(U(n,e.signal,t.entry.module.streamTimeout,r),{status:a||200,headers:s}))}function $(e,t,r,i){let a=function(e,t,r){let i=t.get("Location");r&&(i=(0,n.pb)(i,r)||i);return{redirect:i,status:e,revalidate:t.has("X-Remix-Revalidate")||t.has("Set-Cookie"),reload:t.has("X-Remix-Reload-Document"),replace:t.has("X-Remix-Replace")}}(e.status,e.headers,r.basename),s=new Headers(e.headers);return s.delete("Location"),s.set("Content-Type","text/x-script"),z(t,r,i,{result:"GET"===t.method?{[n.lR]:a}:a,headers:s,status:n.gI})}function U(e,t,r,i){let a=new AbortController,s=setTimeout(()=>{a.abort(new Error("Server Timeout")),l()},"number"==typeof r?r:4950),o=()=>{a.abort(t.reason),l()};t.addEventListener("abort",o);let l=()=>{clearTimeout(s),t.removeEventListener("abort",o)};return(0,n.lF)(e,{signal:a.signal,onComplete:l,plugins:[e=>{if(e instanceof Error){let{name:t,message:r,stack:n}="production"===i?w(e,i):e;return["SanitizedError",t,r,n]}if(e instanceof n.cj){let{data:t,status:r,statusText:n}=e;return["ErrorResponse",t,r,n]}if(e&&"object"==typeof e&&n.lR in e)return["SingleFetchRedirect",e[n.lR]]}],postPlugins:[e=>{if(e&&"object"==typeof e)return["SingleFetchClassInstance",Object.fromEntries(Object.entries(e))]},()=>["SingleFetchFallback"]]})}function W(e,t){let r=k(e.routes,e.future),i="development"===(a=t)||"production"===a||"test"===a?t:"production";var a;let s=(0,n.d6)(r,{basename:e.basename,instrumentations:e.entry.module.instrumentations,future:e.future}),o=e.entry.module.handleError||((e,{request:t})=>{"test"===i||t.signal.aborted||console.error((0,n.pX)(e)&&e.error?e.error:e)}),l=async(r,a)=>{let l,c={},u=e=>{"development"===t&&O()?.processRequestError?.(e),o(e,{context:l,params:c,request:r})};
67if(e.future.v8_middleware){if(a&&!(a instanceof n.aB)){let e=new Error("Invalid `context` value provided to `handleRequest`. When middleware is enabled you must return an instance of `RouterContextProvider` from your `getLoadContext` function.");return u(e),q(e,i)}l=a||new n.aB}else l=a||{};let d=new URL(r.url),h=j(r,e.basename,e.future).pathname,p="yes"===D(r,"X-React-Router-SPA-Mode");if(!e.ssr){let t=decodeURI(h);if(e.basename&&"/"!==e.basename){let i=(0,n.pb)(t,e.basename);if(null==i)return o(new n.cj(404,"Not Found",`Refusing to prerender the \`${t}\` path because it does not start with the basename \`${e.basename}\``),{context:l,params:c,request:r}),new Response("Not Found",{status:404,statusText:"Not Found"});t=i}if(0===e.prerender.length)p=!0;else if(!e.prerender.includes(t.replace(/\/$/,""))&&!e.prerender.includes(t.replace(/[^/]$/,"/"))){if(d.pathname.endsWith(".data"))return o(new n.cj(404,"Not Found",`Refusing to SSR the path \`${t}\` because \`ssr:false\` is set and the path is not included in the \`prerender\` config, so in production the path will be a 404.`),{context:l,params:c,request:r}),new Response("Not Found",{status:404,statusText:"Not Found"});p=!0}}let f=(0,n.lS)(e.routeDiscovery.manifestPath,e.basename);if("lazy"===e.routeDiscovery.mode&&d.pathname===f)try{let t=await async function(e,t,r,i){if(i.toString().length>n.yd)return new Response(null,{statusText:"Bad Request",status:400});if(e.assets.version!==i.searchParams.get("version"))return new Response(null,{status:204,headers:{"X-Remix-Reload-Document":"true"}});let a={};if(i.searchParams.has("paths")){let n=i.searchParams.get("paths")||"",s=new Set(n.split(",").filter(Boolean));for(let n of s){n.startsWith("/")||(n=`/${n}`);let i=A(e.routes,t,r,n,e.basename);if(i)for(let t of i){let r=t.route.id,n=e.assets.routes[r];n&&(a[r]=n)}}return Response.json(a,{headers:{"Cache-Control":"public, max-age=31536000, immutable"}})}return new Response("Invalid Request",{status:400})}(e,s.dataRoutes,s._internalRouteBranches,d);return t}catch(e){return u(e),new Response("Unknown Server Error",{status:500})}let g,m=A(e.routes,s.dataRoutes,s._internalRouteBranches,h,e.basename);if(m&&m.length>0&&Object.assign(c,m[0].params),d.pathname.endsWith(".data"))g=await async function(e,t,r,i,a,s,o){let l=new URL(i.url);l.pathname=a;
67let c=(0,n.jM)(i.method)?await H(t,e,r,i,l,s,o):await B(t,e,r,i,l,s,o);return c}(i,e,s,r,h,l,u),(0,n.U)(g)&&(g=$(g,r,e,i)),e.entry.module.handleDataRequest&&(g=await e.entry.module.handleDataRequest(g,{context:l,params:m?m[0].params:{},request:r}),(0,n.U)(g)&&(g=$(g,r,e,i)));else if(!p&&m&&null==m[m.length-1].route.module.default&&null==m[m.length-1].route.module.ErrorBoundary)g=await async function(e,t,r,i,a,s,o){try{let e=await r.queryRoute(a,{routeId:i,requestContext:s,generateMiddlewareResponse:t.future.v8_middleware?async e=>{try{return l(await e(a))}catch(e){return c(e)}}:void 0,normalizePath:e=>j(e,t.basename,t.future)});return l(e)}catch(e){return c(e)}function l(e){return(0,n.Sv)(e)?e:"string"==typeof e?new Response(e):Response.json(e)}function c(t){if((0,n.Sv)(t))return t;if((0,n.pX)(t))return o(t),function(e,t){return Response.json(E(e.error||new Error("Unexpected Server Error"),t),{status:e.status,statusText:e.statusText})}(t,e);if(t instanceof Error&&"Expected a response from queryRoute"===t.message){let t=new Error("Expected a Response to be returned from resource route handler");return o(t),q(t,e)}return o(t),q(t,e)}}(i,e,s,m.slice(-1)[0].route.id,r,l,u);else{let a,{pathname:o}=d;e.unstable_getCriticalCss?a=await e.unstable_getCriticalCss({pathname:o}):"development"===t&&O()?.getCriticalCss&&(a=await(O()?.getCriticalCss?.(o))),g=await async function(e,t,r,i,a,s,o,l){try{if((0,n.jM)(i.method))try{N(i,Array.isArray(t.allowedActionOrigins)?t.allowedActionOrigins:[])}catch(e){return s(e),new Response("Bad Request",{status:400})}let e=await r.query(i,{requestContext:a,generateMiddlewareResponse:t.future.v8_middleware?async e=>{try{let t=await e(i);return(0,n.Sv)(t)||(t=await c(t,o)),t}catch(e){return s(e),new Response(null,{status:500})}}:void 0,normalizePath:e=>j(e,t.basename,t.future)});return(0,n.Sv)(e)||(e=await c(e,o)),e}catch(e){return s(e),new Response(null,{status:500})}async function c(o,c){let u=L(o,t);if(F.has(o.statusCode))return new Response(null,{status:o.statusCode,headers:u});o.errors&&(Object.values(o.errors).forEach(e=>{(0,n.pX)(e)&&!e.error||s(e)}),o.errors=x(o.errors,e));let d={loaderData:o.loaderData,actionData:o.actionData,errors:o.errors},h={basename:t.basename,future:t.future,routeDiscovery:t.routeDiscovery,ssr:t.
67ssr,isSpaMode:c},p={manifest:t.assets,branches:r._internalRouteBranches,routeModules:y(t.routes),staticHandlerContext:o,criticalCss:l,serverHandoffString:M({...h,criticalCss:l}),serverHandoffStream:U(d,i.signal,t.entry.module.streamTimeout,e),renderMeta:{},future:t.future,ssr:t.ssr,routeDiscovery:t.routeDiscovery,isSpaMode:c,serializeError:t=>E(t,e)},f=t.entry.module.default;try{return await f(i,o.statusCode,u,p,a)}catch(l){s(l);let c=l;if((0,n.Sv)(l))try{let e=await function(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?null==e.body?null:e.json():e.text()}(l);c=new n.cj(l.status,l.statusText,e)}catch(e){}(o=(0,n.eF)(r.dataRoutes,o,c)).errors&&(o.errors=x(o.errors,e));let d={loaderData:o.loaderData,actionData:o.actionData,errors:o.errors};p={...p,staticHandlerContext:o,serverHandoffString:M(h),serverHandoffStream:U(d,i.signal,t.entry.module.streamTimeout,e),renderMeta:{}};try{return await f(i,o.statusCode,u,p,a)}catch(t){return s(t),q(t,e)}}}}(i,e,s,r,l,u,p,a)}return"HEAD"===r.method?new Response(null,{headers:g.headers,status:g.status,statusText:g.statusText}):g};return e.entry.module.instrumentations&&(l=(0,n.Cu)(l,e.entry.module.instrumentations.map(e=>e.handler).filter(Boolean))),{serverMode:i,staticHandler:s,errorHandler:o,requestHandler:l}}var V=(e,t)=>{let r,n,i,a,s;return async function(o,l){if(r="function"==typeof e?await e():e,"function"==typeof e){let e=W(r,t);n=e.serverMode,i=e.staticHandler,a=e.errorHandler,s=e.requestHandler}else if(!(n&&i&&a&&s)){let e=W(r,t);n=e.serverMode,i=e.staticHandler,a=e.errorHandler,s=e.requestHandler}return s(o,l)}};function q(e,t){let r="Unexpected Server Error";return"production"!==t&&(r+=`\n\n${String(e)}`),new Response(r,{status:500,headers:{"Content-Type":"text/plain"}})}function Y(e){return`__flash_${e}__`}var G=(e={},t="")=>{let r=new Map(Object.entries(e));return{get id(){return t},get data(){return Object.fromEntries(r)},has:e=>r.has(e)||r.has(Y(e)),get(e){if(r.has(e))return r.get(e);let t=Y(e);if(r.has(t)){let e=r.get(t);return r.delete(t),e}},set(e,t){r.set(e,t)},flash(e,t){r.set(Y(e),t)},unset(e){r.delete(e)}}},X=e=>null!=e&&"string"==typeof e.id&&void 0!==e.data&&"function"==typeof e.has&&"function"==typeof e.get&&"function"==typeof e.set&&"function"==typeof e.flash&&"function"==typeof e.unset;function K({cookie:e,createData:t,readData:r,updateData:n,deleteData:i}){let a=g(e)?e:f(e?.name||"__session",e);return J(a),{async getSession(e,t){let n=e&&await a.parse(e,t),i=n&&await r(n);return G(i||{},n||"")},async commitSession(e,r){let{id:i,data:s}=e,o=null!=r?.maxAge?new Date(Date.now()+1e3*r.maxAge):null!=r?.expires?r.expires:a.expires;return i?await n(i,s,o):i=await t(s,o),a.serialize(i,r)},destroySession:async(e,t)=>(await i(e.id),a.serialize("",{...t,maxAge:void 0,expires:new Date(0)}))}}function J(e){(0,n.mc)(e.isSigned,`The "${e.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies for more information.`)}function Q({cookie:e}={}){let t=g(e)?e:f(e?.name||"__session",e);return J(t),{getSession:async(e,r)=>G(e&&await t.parse(e,r)||{}),async commitSession(e,r){let n=await t.serialize(e.data,r);if(n.length>4096)throw new Error("Cookie length will exceed browser maximum. Length: "+n.length);return n},destroySession:async(e,r)=>t.serialize("",{...r,maxAge:void 0,expires:new Date(0)})}}function Z({cookie:e}={}){let t=new Map;return K({cookie:e,async createData(e,r){let n=Math.random().toString(36).substring(2,10);return t.set(n,{data:e,expires:r}),n},async readData(e){if(t.has(e)){let{data:r,expires:n}=t.get(e);if(!n||n>new Date)return r;n&&t.delete(e)}return null},async updateData(e,r,n){t.set(e,{data:r,expires:n})},async deleteData(e){t.delete(e)}})}function ee(e,...t){let r=t[0],n=function(e){let t=e.length-1,r=e[t];if("*"!==r&&"/"!==r)return e;for(t--;t>=0&&"/"===e[t];t--);return e.slice(0,t+1)}(e).replace(/\/:([\w-]+)(\?)?/g,(t,n,i)=>{const a=void 0===i,s=r?.[n];if(a&&void 0===s)throw new Error(`Path '${e}' requires param '${n}' but it was not provided`);return void 0===s?"":"/"+s}
67);if(e.endsWith("*")){const e=r?.["*"];void 0!==e&&(n+="/"+e)}return n||"/"}var te=new TextEncoder,re="</body></html>";function ne(e){let t,r=new TextDecoder,n=new Promise(e=>t=e),i=!1,a=[],s=null;function o(e){for(let t of a){let n=r.decode(t,{stream:!0});n.endsWith(re)&&(n=n.slice(0,-14)),e.enqueue(te.encode(n))}a.length=0,s=null}return new TransformStream({transform(r,n){a.push(r),s||(s=setTimeout(async()=>{o(n),i||(i=!0,async function(e,t){let r=new TextDecoder("utf-8",{fatal:!0});const n=e.getReader();try{let e;for(;(e=await n.read())&&!e.done;){const n=e.value;try{ie(JSON.stringify(r.decode(n,{stream:!0})),t)}catch(e){ie(`Uint8Array.from(atob(${JSON.stringify(btoa(String.fromCodePoint(...n)))}), m => m.codePointAt(0))`,t)}}}finally{n.releaseLock()}let i=r.decode();i.length&&ie(JSON.stringify(i),t)}(e,n).catch(e=>n.error(e)).then(t))},0))},async flush(e){await n,s&&(clearTimeout(s),o(e)),e.enqueue(te.encode("</body></html>"))}})}function ie(e,t){var r;t.enqueue(te.encode(`<script>${r=`(self.__FLIGHT_DATA||=[]).push(${e})`,r.replace(/<!--/g,"<\\!--").replace(/<\/(script)/gi,"</\\$1")}<\/script>`))}var ae=class extends i.Component{constructor(e){super(e),this.state={error:null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:null,location:e.location}:{error:t.error,location:t.location}}render(){return this.state.error?i.createElement(oe,{error:this.state.error,renderAppShell:!0}):this.props.children}};function se({renderAppShell:e,title:t,children:r}){return e?i.createElement("html",{lang:"en"},i.createElement("head",null,i.createElement("meta",{charSet:"utf-8"}),i.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),i.createElement("title",null,t)),i.createElement("body",null,i.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},r))):r}function oe({error:e,renderAppShell:t}){console.error(e);let r,a=i.createElement("script",{dangerouslySetInnerHTML:{__html:'\n console.log(\n "ð¿ Hey developer ð. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n );\n '}});if((0,n.pX)(e))return i.createElement(se,{renderAppShell:t,title:"Unhandled Thrown Response!"},i.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),n.U2?a:null);if(e instanceof Error)r=e;else{let t=null==e?"Unknown Error":"object"==typeof e&&"toString"in e?e.toString():JSON.stringify(e);r=new Error(t)}return i.createElement(se,{renderAppShell:t,title:"Application Error!"},i.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),i.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},r.stack),a)}function le({hasRootLayout:e}){let t=(0,n.r5)();if(void 0===e)throw new Error("Missing 'hasRootLayout' prop");return i.createElement(oe,{renderAppShell:!e,error:t})}function ce(e){const t={};for(const r of e.matches)ue(t,r);return t}function ue(e,t){t=Array.isArray(t)?t:[t];for(const r of t)e[r.id]={links:r.links,meta:r.meta,default:de}}var de=()=>null,he="/__manifest",pe=a.use;async function fe({request:e,serverResponse:t,createFromReadableStream:r,renderHTML:i,hydrate:a=!0}){const s=new URL(e.url),o=function(e){return e.pathname.endsWith(".rsc")}(s),l=o||function(e){return e.pathname.endsWith(".manifest")}(s)||e.headers.has("rsc-action-id");if(l||"true"===t.headers.get("React-Router-Resource"))return t;if(!t.body)throw new Error("Missing body in server response");const c=t.clone();let u=null;a&&(u=t.clone());const d=t.body;let h,p=[];const f=()=>h?new ReadableStream({start(e){h.forEach(t=>e.enqueue(t)),p.push(e)}}):(h=[],d.pipeThrough(new TransformStream({transform(e,t){h.push(e),t.enqueue(e),p.forEach(t=>t.enqueue(e))},flush(){p.forEach(e=>e.close()),p=[]}})));let g=null;const m=()=>{const e=Promise.resolve(r(f()));return Object.defineProperties(e,{_deepestRenderedBoundaryId:{get:()=>g,set(e){g=e}},formState:{get:()=>e.then(e=>"render"===e.type?e.formState:void 0)}})};let v,y;try{if(!c.body)throw new Error("Failed to clone server response");const e=await r(c.body);if(t.status===n.gI&&"redirect"===e.type){if((0,n.yf)(e.location))throw new Error("Invalid redirect location");const r=new Headers(t.headers);return r.delete("Content-Encoding"),r.delete("Content-Length"),r.delete("Content-Type"),r.delete("X-Remix-Response"),r.set("Location",e.location),new Response(u?.body||"",{headers:r,status:e.status,statusText:t.statusText})}let s=new Headers,o=t.status,l=t.statusText,d=await i(m,{onError(e){if("object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){if(v=(0,n.T)(e.digest),v)return e.digest;let t=(0,n.C0)(e.digest);if(t)return y=t,o=t.status,l=t.statusText,e.digest}},onHeaders(e){for(const[t,r]of e)s.append(t,r)}});const h=new Headers(s);for(const[e,r]of t.headers)h.append(e,r);if(h.set("Content-Type","text/html; charset=utf-8"),v){if((0,n.yf)(v.location))throw new Error("Invalid redirect location");return h.set("Location",v.location),new Response(d,{status:v.status,headers:h})}const p=new TransformStream({flush(e){if(v){if((0,n.yf)(v.location))return;e.enqueue((new TextEncoder).encode(`<meta http-equiv="refresh" content="0;url=${(0,n.ZD)(v.location)}"/>`))}}});if(!a)return new Response(d.pipeThrough(p),{status:o,statusText:l,headers:h});if(!u?.body)throw new Error("Failed to clone server response");const f=d.pipeThrough(ne(u.body)).pipeThrough(p);return new Response(f,{status:o,statusText:l,headers:h})}catch(e){if(e instanceof Response)return e;if(v){if((0,n.yf)(v.location))throw new Error("Invalid redirect location");return new Response(`Redirect: ${v.location}`,{status:v.status,headers:{Location:v.location}})}try{let s,o=y??e,[l,c]=(0,n.pX)(o)?[o.status,o.statusText]:[500,""],d=new Headers;const h=await i(()=>{const e=Promise.resolve(r(f())).then(e=>Object.assign(e,{status:l,errors:g?{[g]:o}:{}}));return Object.defineProperties(e,{_deepestRenderedBoundaryId:{get:()=>g,set(e){g=e}},formState:{get:()=>e.then(e=>"render"===e.type?e.formState:void 0)}})},{onError(e){if("object"==typeof e&&e&&"digest"in e&&"string"==typeof e.digest){if(s=(0,n.T)(e.digest),s)return e.digest;let t=(0,n.C0)(e.digest);
67if(t)return l=t.status,c=t.statusText,e.digest}},onHeaders(e){for(const[t,r]of e)d.append(t,r)}}),p=new Headers(d);for(const[e,r]of t.headers)p.append(e,r);if(p.set("Content-Type","text/html; charset=utf-8"),s){if((0,n.yf)(s.location))throw new Error("Invalid redirect location");return p.set("Location",s.location),new Response(h,{status:s.status,headers:p})}const m=new TransformStream({flush(e){if(s){if((0,n.yf)(s.location))return;e.enqueue((new TextEncoder).encode(`<meta http-equiv="refresh" content="0;url=${(0,n.ZD)(s.location)}"/>`))}}});if(!a)return new Response(h.pipeThrough(m),{status:l,statusText:c,headers:p});if(!u?.body)throw new Error("Failed to clone server response");const v=h.pipeThrough(ne(u.body)).pipeThrough(m);return new Response(v,{status:l,statusText:c,headers:p})}catch(e){}throw e}}function ge({getPayload:e}){const t=e(),r=function(e){if(pe)return pe(e);throw new Error("React Router v7 requires React 19+ for RSC features.")}(t);if("redirect"===r.type){if((0,n.yf)(r.location))throw new Error("Invalid redirect location");throw new Response(null,{status:r.status,headers:{Location:r.location}})}if("render"!==r.type)return null;let a={...r.loaderData};for(const e of r.matches)!(0,n.vB)(e.id,e.clientLoader,e.hasLoader,!1)||!e.hydrateFallbackElement&&e.hasLoader||delete a[e.id];const s={get _deepestRenderedBoundaryId(){return t._deepestRenderedBoundaryId??null},set _deepestRenderedBoundaryId(e){t._deepestRenderedBoundaryId=e},actionData:r.actionData,actionHeaders:{},basename:r.basename,errors:r.errors,loaderData:a,loaderHeaders:{},location:r.location,statusCode:200,matches:r.matches.map(e=>({params:e.params,pathname:e.pathname,pathnameBase:e.pathnameBase,route:{id:e.id,action:e.hasAction||!!e.clientAction,handle:e.handle,hasErrorBoundary:e.hasErrorBoundary,loader:e.hasLoader||!!e.clientLoader,index:e.index,path:e.path,shouldRevalidate:e.shouldRevalidate}}))},o=(0,n.KD)(r.matches.reduceRight((e,t)=>{const r={id:t.id,action:t.hasAction||!!t.clientAction,element:t.element,errorElement:t.errorElement,handle:t.handle,hasErrorBoundary:!!t.errorElement,hydrateFallbackElement:t.hydrateFallbackElement,index:t.index,loader:t.hasLoader||!!t.clientLoader,path:t.path,shouldRevalidate:t.shouldRevalidate};return e.length>0&&(r.children=e),[r]},[]),s),l={future:{v8_middleware:!1,v8_trailingSlashAwareDataRequests:!0,v8_passThroughRequests:!0},isSpaMode:!1,ssr:!0,criticalCss:"",manifest:{routes:{},version:"1",url:"",entry:{module:"",imports:[]}},routeDiscovery:"initial"===r.routeDiscovery.mode?{mode:"initial",manifestPath:he}:{mode:"lazy",manifestPath:r.routeDiscovery.manifestPath||he},routeModules:ce(r)};return i.createElement(n.Bu.Provider,{value:!0},i.createElement(ae,{location:r.location},i.createElement(n.yL.Provider,{value:l},i.createElement(n.je,{context:s,router:o,hydrate:!1,nonce:r.nonce}))))}function me({state:e,routes:t,getRouteInfo:r,location:i,basename:a,isSpaMode:s}){let o={...e,loaderData:{...e.loaderData}},l=(0,n.ue)(t,i,a);if(l)for(let e of l){let t=e.route.id,i=r(t);!(0,n.vB)(t,i.clientLoader,i.hasLoader,s)||!i.hasHydrateFallback&&i.hasLoader?i.hasLoader||(o.loaderData[t]=null):delete o.loaderData[t]}return o}},2600(e,t,r){"use strict";r.r(t),r.d(t,{HydratedRouter:()=>d,RouterProvider:()=>o,unstable_RSCHydratedRouter:()=>m,unstable_createCallServer:()=>p,unstable_getRSCStream:()=>C});var n=r(1517),i=r(6213),a=r(1594),s=r(5206);function o(e){return a.createElement(i.pg,{flushSync:s.flushSync,...e})}var l=null,c=null;function u({getContext:e,instrumentations:t}){if(function(){if(!l&&window.__reactRouterContext&&window.__reactRouterManifest&&window.__reactRouterRouteModules){if(!0===window.__reactRouterManifest.sri){const e=document.querySelector("script[rr-importmap]");if(e?.textContent)try{window.__reactRouterManifest.sri=JSON.parse(e.textContent).integrity}catch(e){console.error("Failed to parse import map",e)}}l={context:window.__reactRouterContext,manifest:window.__reactRouterManifest,routeModules:window.__reactRouterRouteModules,stateDecodingPromise:void 0,router:void 0,routerInitialized:!1}}}(),!l)throw new Error("You must be using the SSR features of React Router in order to skip passing a `router` prop to `<
67RouterProvider>`");let r=l;if(!l.stateDecodingPromise){let e=l.context.stream;(0,i.V1)(e,"No stream found for single fetch decoding"),l.context.stream=void 0,l.stateDecodingPromise=(0,i.ht)(e,window).then(e=>{l.context.state=e.value,r.stateDecodingPromise.value=!0}).catch(e=>{r.stateDecodingPromise.error=e})}if(l.stateDecodingPromise.error)throw l.stateDecodingPromise.error;if(!l.stateDecodingPromise.value)throw l.stateDecodingPromise;let a,s=(0,i.qI)(l.manifest.routes,l.routeModules,l.context.state,l.context.ssr,l.context.isSpaMode);if(l.context.isSpaMode){let{loaderData:e}=l.context.state;l.manifest.routes.root?.hasLoader&&e&&"root"in e&&(a={loaderData:{root:e.root}})}else a=(0,n.Zd)({state:l.context.state,routes:s,getRouteInfo:e=>({clientLoader:l.routeModules[e]?.clientLoader,hasLoader:!0===l.manifest.routes[e]?.hasLoader,hasHydrateFallback:null!=l.routeModules[e]?.HydrateFallback}),location:window.location,basename:window.__reactRouterContext?.basename,isSpaMode:l.context.isSpaMode});window.history.state&&window.history.state.masked&&window.history.replaceState({...window.history.state,masked:void 0},"");let o=(0,i.aE)({routes:s,history:(0,i.zR)(),basename:l.context.basename,getContext:e,hydrationData:a,hydrationRouteProperties:i.jC,instrumentations:t,mapRouteProperties:i.nW,future:{v8_passThroughRequests:l.context.future.v8_passThroughRequests},dataStrategy:(0,i.aD)(()=>o,l.manifest,l.routeModules,l.context.ssr,l.context.basename,l.context.future.v8_trailingSlashAwareDataRequests),patchRoutesOnNavigation:(0,i.Wj)(()=>o,l.manifest,l.routeModules,l.context.ssr,l.context.routeDiscovery,l.context.isSpaMode,l.context.basename)});return l.router=o,o.state.initialized&&(l.routerInitialized=!0,o.initialize()),o.createRoutesForHMR=i.ou,window.__reactRouterDataRouter=o,o}function d(e){c||(c=u({getContext:e.getContext,instrumentations:e.instrumentations}));let[t,r]=a.useState(void 0);a.useEffect(()=>{0},[]),a.useEffect(()=>{0},[t]);let[n,s]=a.useState(c.state.location);return a.useLayoutEffect(()=>{l&&l.router&&!l.routerInitialized&&(l.routerInitialized=!0,l.router.initialize())},[]),a.useLayoutEffect(()=>{if(l&&l.router)return l.router.subscribe(e=>{e.location!==n&&s(e.location)})},[n]),(0,i.V1)(l,"ssrInfo unavailable for HydratedRouter"),(0,i.p4)(c,l.manifest,l.routeModules,l.context.ssr,l.context.routeDiscovery,l.context.isSpaMode),a.createElement(a.Fragment,null,a.createElement(i.yL.Provider,{value:{manifest:l.manifest,routeModules:l.routeModules,future:l.context.future,criticalCss:t,ssr:l.context.ssr,isSpaMode:l.context.isSpaMode,routeDiscovery:l.context.routeDiscovery}},a.createElement(i.aJ,{location:n},a.createElement(o,{router:c,useTransitions:e.useTransitions,onError:e.onError}))),a.createElement(a.Fragment,null))}var h="/__manifest";function p({createFromReadableStream:e,createTemporaryReferenceSet:t,encodeReply:r,fetch:n=fetch}){const s=window;return async(o,l)=>{let c=s.__routerActionID=(s.__routerActionID??(s.__routerActionID=0))+1;const u=t(),d=n(new Request(location.href,{body:await r(l,{temporaryReferences:u}),method:"POST",headers:{Accept:"text/x-component","rsc-action-id":o}})).then(t=>{if(!t.body)throw new Error("No response body");return e(t.body,{temporaryReferences:u})});return a.startTransition(()=>Promise.resolve(d).then(async e=>{if("redirect"===e.type){let t=A(e.location);if(e.reload||S(t)){if((0,i.yf)(t))throw new Error("Invalid redirect location");return void(window.location.href=t)}return void a.startTransition(()=>{s.__reactRouterDataRouter.navigate(t,{replace:e.replace})})}if("action"!==e.type)throw new Error("Unexpected payload type");const t=await e.rerender;if(t&&0<c&&s.__routerActionID<=c){if("redirect"===t.type){let e=A(t.location);if(t.reload||S(e)){if((0,i.yf)(e))throw new Error("Invalid redirect location");return void(window.location.href=e)}return void a.startTransition(()=>{s.__reactRouterDataRouter.navigate(e,{replace:t.replace})})}a.startTransition(()=>{let e;for(const r of t.matches)s.__reactRouterDataRouter.patchRoutes(e?.id??null,[v(r)],!0),e=r;window.__reactRouterDataRouter._internalSetStateDoNotUseOrYouWillBreakYourApp({loaderData:Object.assign({},s.__reactRouterDataRouter.state.loaderData,t.loaderData),errors:t.errors?Object.assign({},s.__reactRouterDataRouter.state.errors,t.errors):null})})}}).catch(()=>{})),d.then(e=>{if("action"!==e.type&&"redirect"!==e.type)throw new Error("Unexpected payload type");return e.actionResult})}}var f=(0,i.q6)();function g(e,t,r,n,s){let o=(0,i.gQ)(e,e=>{let t=e;return{hasLoader:t.route.hasLoader,hasClientLoader:t.route.hasClientLoader,hasComponent:t.route.hasComponent,hasAction:t.route.hasAction,hasClientAction:t.route.hasClientAction}},function(e,t){return async(r,n,a,s)=>{let{request:o,context:l}=r,c=(0,i.MF)(o.url,n,a,"rsc");"GET"===o.method&&(c=(0,i.Qd)(c),s&&c.searchParams.set("_routes",s.join(",")));
67let u=await t(new Request(c,await(0,i.Ul)(o)));if(u.status>=400&&!u.headers.has("X-Remix-Response"))throw new i.cj(u.status,u.statusText,await u.text());(0,i.V1)(u.body,"No response body to decode");try{const t=await e(u.body,{temporaryReferences:void 0});if("redirect"===t.type)return{status:u.status,data:{redirect:{redirect:t.location,reload:t.reload,replace:t.replace,revalidate:!1,status:t.status}}};if("render"!==t.type)throw new Error("Unexpected payload type");l.get(f).push(...t.matches);let r={routes:{}};const n=(0,i.jM)(o.method)?"actionData":"loaderData";for(let[e,i]of Object.entries(t[n]||{}))r.routes[e]={data:i};if(t.errors)for(let[e,n]of Object.entries(t.errors))r.routes[e]={error:n};return{status:u.status,data:r}}catch(e){throw new Error("Unable to decode RSC response",{cause:e})}}}(n,s),t,r,!0,e=>{let t=e;return t.route.hasComponent&&!t.route.element});return async e=>e.runClientMiddleware(async()=>{let t=e.context;t.set(f,[]);let r=await o(e);const n=new Map;for(const e of t.get(f))n.has(e.id)||n.set(e.id,[]),n.get(e.id).push(e);return a.startTransition(()=>{for(const t of e.matches){const e=n.get(t.route.id);if(e)for(const t of e)window.__reactRouterDataRouter.patchRoutes(t.parentId??null,[v(t)],!0)}}),r})}function m({createFromReadableStream:e,fetch:t=fetch,payload:r,getContext:o}){if("render"!==r.type)throw new Error("Invalid payload type");let{routeDiscovery:l}=r,{router:c,routeModules:u}=a.useMemo(()=>function({fetchImplementation:e,createFromReadableStream:t,getContext:r,payload:s}){const o=window;if(o.__reactRouterDataRouter&&o.__reactRouterRouteModules)return{router:o.__reactRouterDataRouter,routeModules:o.__reactRouterRouteModules};if("render"!==s.type)throw new Error("Invalid payload type");o.__reactRouterRouteModules=o.__reactRouterRouteModules??{},(0,n.Vv)(o.__reactRouterRouteModules,s.matches);let l,c,u=s.matches.reduceRight((e,t)=>{const r=v(t,s);return e.length>0?r.children=e:r.index||(r.children=[]),[r]},[]);return o.__reactRouterDataRouter=(0,i.aE)({routes:u,getContext:r,basename:s.basename,history:(0,i.zR)(),hydrationData:(0,n.Zd)({state:{loaderData:s.loaderData,actionData:s.actionData,errors:s.errors},routes:u,getRouteInfo:e=>{let t=s.matches.find(t=>t.id===e);return(0,i.V1)(t,"Route not found in payload"),{clientLoader:t.clientLoader,hasLoader:t.hasLoader,hasHydrateFallback:null!=t.hydrateFallbackElement}},location:s.location,basename:s.basename,isSpaMode:!1}),async patchRoutesOnNavigation({path:r,signal:n}){if("initial"===s.routeDiscovery.mode)return l||(l=(async()=>{if(!s.patches)return;let e=await s.patches;a.startTransition(()=>{e.forEach(e=>{window.__reactRouterDataRouter.patchRoutes(e.parentId??null,[v(e)])})})})()),void await l;x.has(r)||await E([r],t,e,n)},dataStrategy:g(()=>o.__reactRouterDataRouter,!0,s.basename,t,e)}),o.__reactRouterDataRouter.state.initialized?(o.__routerInitialized=!0,o.__reactRouterDataRouter.initialize()):o.__routerInitialized=!1,o.__reactRouterDataRouter.subscribe(({loaderData:e,actionData:t})=>{c!==e&&(o.__routerActionID=(o.__routerActionID??(o.__routerActionID=0))+1)}),o.__reactRouterDataRouter._updateRoutesForHMR=e=>{const t=window.__reactRouterDataRouter.routes,r=[];r.push(...function t(r,n){return r.map(r=>{const i=e.get(r.id);if(i){const{routeModule:e,hasAction:a,hasComponent:s,hasErrorBoundary:o,hasLoader:l}=i,c=v({clientAction:e.clientAction,clientLoader:e.clientLoader,element:r.element,errorElement:r.errorElement,handle:r.handle,hasAction:a,hasComponent:s,hasErrorBoundary:o,hasLoader:l,hydrateFallbackElement:r.hydrateFallbackElement,id:r.id,index:r.index,links:e.links,meta:e.meta,parentId:n,path:r.path,shouldRevalidate:e.shouldRevalidate});return r.children&&(c.children=t(r.children,r.id)),c}const a={...r};return r.children&&(a.children=t(r.children,r.id)),a})}(t,void 0)),window.__reactRouterDataRouter._internalSetRoutes(r)},{router:o.__reactRouterDataRouter,routeModules:o.__reactRouterRouteModules}}({payload:r,fetchImplementation:t,getContext:o,createFromReadableStream:e}),[e,r,t,o]);a.useEffect(()=>{(0,i.q9)()},[]),a.useLayoutEffect(()=>{const e=window;e.__routerInitialized||(e.__routerInitialized=!0,e.__reactRouterDataRouter.initialize())},[]);let[{routes:d,state:p},f]=a.useState(()=>({routes:_(c.routes),state:c.state}));a.useLayoutEffect(()=>c.subscribe(e=>{T(c.routes,d)&&a.startTransition(()=>{f({routes:_(c.routes),state:e})})}),[c.subscribe,d,c]);const m=a.useMemo(()=>({...c,state:p,routes:d}),[c,d,p]);a.useEffect(()=>{if("initial"===l.mode||!0===window.navigator?.connection?.saveData)return;function r(e){let t="FORM"===e.tagName?e.getAttribute("action"):e.getAttribute("href");if(!t)return;let r="A"===e.tagName?e.pathname:new URL(t,window.location.origin).pathname;x.has(r)||w.add(r)}async function n(){document.querySelectorAll("a[data-discover], form[data-discover]").forEach(r);let n=Array.from(w.keys()).filter(e=>!x.has(e)||(w.delete(e),!1));if(0!==n.length)try{await E(n,e,t)}catch(e){console.error("Failed to fetch manifest patches",e)}}let i=function(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}(n,100);n(),new MutationObserver(()=>i()).observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["data-discover","href","action"]})},[l,e,t]);const y={future:{v8_middleware:!1,v8_trailingSlashAwareDataRequests:!0,v8_passThroughRequests:!0},isSpaMode:!1,ssr:!0,criticalCss:"",manifest:{routes:{},version:"1",url:"",entry:{module:"",imports:[]}},routeDiscovery:"initial"===r.routeDiscovery.mode?{mode:"initial",manifestPath:h}:{mode:"lazy",manifestPath:r.routeDiscovery.manifestPath||h},routeModules:u};return a.createElement(i.Bu.Provider,{value:!0},a.createElement(n.ZJ,{location:p.location},a.createElement(i.yL.Provider,{value:y},a.createElement(i.pg,{router:m,flushSync:s.flushSync}))))}function v(e,t){let r=t&&e.id in t.loaderData,a=t?.loaderData[e.id],s=t?.errors&&e.id in t.errors,o=t?.errors?.[e.i
67d],l=!0===e.clientLoader?.hydrate||!e.hasLoader||e.hasComponent&&!e.element;(0,i.V1)(window.__reactRouterRouteModules),(0,n.Vv)(window.__reactRouterRouteModules,e);let c={id:e.id,element:e.element,errorElement:e.errorElement,handle:e.handle,hasErrorBoundary:e.hasErrorBoundary,hydrateFallbackElement:e.hydrateFallbackElement,index:e.index,loader:e.clientLoader?async(t,n)=>{let i=l;return l=!1,await e.clientLoader({...t,serverLoader:()=>{if(b("loader",e.id,e.hasLoader),i){if(r)return a;if(s)throw o}return y(n)}})}:(e,t)=>y(t),action:e.clientAction?(t,r)=>e.clientAction({...t,serverAction:async()=>(b("action",e.id,e.hasLoader),await y(r))}):e.hasAction?(e,t)=>y(t):()=>{throw(0,i.hA)("action",e.id)},path:e.path,shouldRevalidate:e.shouldRevalidate,hasLoader:!0,hasClientLoader:null!=e.clientLoader,hasAction:e.hasAction,hasClientAction:null!=e.clientAction};return"function"==typeof c.loader&&(c.loader.hydrate=(0,i.vB)(e.id,e.clientLoader,e.hasLoader,!1)),c}function y(e){return(0,i.V1)("function"==typeof e,"Invalid singleFetch parameter"),e()}function b(e,t,r){if(!r){let r=`You are trying to call ${"action"===e?"serverAction()":"serverLoader()"} on a route that does not have a server ${e} (routeId: "${t}")`;throw console.error(r),new i.cj(400,"Bad Request",new Error(r),!0)}}var w=new Set,x=new Set;async function E(e,t,r,n){let s=function(e){if(0===e.length)return null;if(1===e.length)return new URL(`${e[0]}.manifest`,window.location.origin);let t=(window.__reactRouterDataRouter.basename??"").replace(/^\/|\/$/g,""),r=new URL(`${t}/.manifest`,window.location.origin);return r.searchParams.set("paths",e.sort().join(",")),r}(e=(0,i.VM)(e));if(null==s)return;if(s.toString().length>i.yd)return void w.clear();let o=await r(new Request(s,{signal:n}));if(!o.body||o.status<200||o.status>=300)throw new Error("Unable to fetch new route matches from the server");let l=await t(o.body,{temporaryReferences:void 0});if("manifest"!==l.type)throw new Error("Failed to patch routes");e.forEach(e=>function(e,t){if(t.size>=1e3){let e=t.values().next().value;"string"==typeof e&&t.delete(e)}t.add(e)}(e,x));let c=await l.patches;a.startTransition(()=>{c.forEach(e=>{window.__reactRouterDataRouter.patchRoutes(e.parentId??null,[v(e)])})})}function S(e){return new URL(e,window.location.href).origin!==window.location.origin}function A(e){if(i.iA.test(e)){let t=(0,i.o1)(e);return t.pathname+t.search+t.hash}return e}function _(e){if(e)return e.map(e=>({...e,children:_(e.children)}))}function T(e,t){return e.length!==t.length||e.some((e,r)=>e.element!==t[r].element||(e.errorElement!==t[r].errorElement||(e.hydrateFallbackElement!==t[r].hydrateFallbackElement||(e.hasErrorBoundary!==t[r].hasErrorBoundary||(e.hasLoader!==t[r].hasLoader||(e.hasClientLoader!==t[r].hasClientLoader||(e.hasAction!==t[r].hasAction||(e.hasClientAction!==t[r].hasClientAction||T(e.children||[],t[r].children||[])))))))))}function C(){let e=new TextEncoder,t=null,r=new ReadableStream({start(r){if("undefined"==typeof window)return;let n=t=>{"string"==typeof t?r.enqueue(e.encode(t)):r.enqueue(t)};window.__FLIGHT_DATA||(window.__FLIGHT_DATA=[]),window.__FLIGHT_DATA.forEach(n),window.__FLIGHT_DATA.push=e=>(n(e),0),t=r}});return"undefined"!=typeof document&&"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{t?.close()}):t?.close(),r}},9949(e,t,r){"use strict";r.r(t),r.d(t,{Await:()=>i.jD,BrowserRouter:()=>i.Kd,Form:()=>i.lV,HashRouter:()=>i.I9,IDLE_BLOCKER:()=>i.G3,IDLE_FETCHER:()=>i.HW,IDLE_NAVIGATION:()=>i.uD,Link:()=>i.N_,Links:()=>i.qF,MemoryRouter:()=>i.fS,Meta:()=>i.W8,NavLink:()=>i.k2,Navigate:()=>i.C5,NavigationType:()=>i.rc,Outlet:()=>i.sv,PrefetchPageLinks:()=>i.cM,Route:()=>i.qh,Router:()=>i.Ix,RouterContextProvider:()=>i.aB,RouterProvider:()=>i.pg,Routes:()=>i.BV,Scripts:()=>i.Tw,ScrollRestoration:()=>i.OA,ServerRouter:()=>n.Zz,StaticRouter:()=>i.kO,StaticRouterProvider:()=>i.je,UNSAFE_AwaitContextProvider:()=>i.$n,UNSAFE_DataRouterContext:()=>i.hf,UNSAFE_DataRouterStateContext:()=>i.ay,UNSAFE_ErrorResponseImpl:()=>i.cj,UNSAFE_FetchersContext:()=>i.QH,UNSAFE_FrameworkContext:()=>i.yL,UNSAFE_LocationContext:()=>i.di,UNSAFE_NavigationContext:()=>i._3,UNSAFE_RSCDefaultRootErrorBoundary:()=>n.yq,UNSAFE_RemixErrorBoundary:()=>i.aJ,UNSAFE_RouteContext:()=>i.Pl,UNSAFE_ServerMode:()=>n.dC,UNSAFE_SingleFetchRedirectSymbol:()=>i.lR,UNSAFE_ViewTransitionContext:()=>i.KZ,UNSAFE_WithComponentProps:()=>i.Q2,UNSAFE_WithErrorBoundaryProps:()=>i.pp,UNSAFE_WithHydrateFallbackProps:()=>i.EB,UNSAFE_createBrowserHistory:()=>i.zR,UNSAFE_createClientRoutes:()=>i.qI,UNSAFE_createClientRoutesWithHMRRevalidationOptOut:()=>i.ou,UNSAFE_createHashHistory:()=>i.TM,UNSAFE_createMemoryHistory:()=>i.sC,UNSAFE_createRouter:()=>i.aE,UNSAFE_decodeViaTurboStream:()=>i.ht,UNSAFE_getHydrationData:()=>n.Zd,UNSAFE_getPatchRoutesOnNavigationFunction:()=>i.Wj,UNSAFE_getTurboStreamSingleFetchDataStrategy:()=>i.aD,UNSAFE_hydrationRouteProperties:()=>i.jC,UNSAFE_invariant:()=>
67i.V1,UNSAFE_mapRouteProperties:()=>i.nW,UNSAFE_shouldHydrateRouteLoader:()=>i.vB,UNSAFE_useFogOFWarDiscovery:()=>i.p4,UNSAFE_useScrollRestoration:()=>i.RV,UNSAFE_withComponentProps:()=>i.ux,UNSAFE_withErrorBoundaryProps:()=>i.Vp,UNSAFE_withHydrateFallbackProps:()=>i.AX,createBrowserRouter:()=>i.Ys,createContext:()=>i.q6,createCookie:()=>n.n0,createCookieSessionStorage:()=>n.Y6,createHashRouter:()=>i.Ge,createMemoryRouter:()=>i.bg,createMemorySessionStorage:()=>n.Nb,createPath:()=>i.AO,createRequestHandler:()=>n.KB,createRoutesFromChildren:()=>i.AV,createRoutesFromElements:()=>i.Eu,createRoutesStub:()=>n.PY,createSearchParams:()=>i.PI,createSession:()=>n.jw,createSessionStorage:()=>n.yM,createStaticHandler:()=>i.xu,createStaticRouter:()=>i.KD,data:()=>i.p,generatePath:()=>i.tW,href:()=>n.UF,isCookie:()=>n.fm,isRouteErrorResponse:()=>i.pX,isSession:()=>n.lV,matchPath:()=>i.B6,matchRoutes:()=>i.ue,parsePath:()=>i.Rr,redirect:()=>i.V2,redirectDocument:()=>i.Sk,renderMatches:()=>i.KT,replace:()=>i.HC,resolvePath:()=>i.o1,unstable_HistoryRouter:()=>i.ks,unstable_RSCStaticRouter:()=>n.E3,unstable_routeRSCServerRequest:()=>n.C3,unstable_setDevServerHooks:()=>n.LQ,unstable_usePrompt:()=>i.kc,unstable_useRoute:()=>i.lq,unstable_useRouterState:()=>i.T6,useActionData:()=>i.mP,useAsyncError:()=>i.oI,useAsyncValue:()=>i.J8,useBeforeUnload:()=>i.K,useBlocker:()=>i.KP,useFetcher:()=>i.Ls,useFetchers:()=>i.SI,useFormAction:()=>i.g$,useHref:()=>i.$P,useInRouterContext:()=>i.Ri,useLinkClickHandler:()=>i.Gy,useLoaderData:()=>i.LG,useLocation:()=>i.zy,useMatch:()=>i.RQ,useMatches:()=>i.FE,useNavigate:()=>i.Zp,useNavigation:()=>i.cq,useNavigationType:()=>i.wQ,useOutlet:()=>i.P1,useOutletContext:()=>i.KC,useParams:()=>i.g,useResolvedPath:()=>i.x$,useRevalidator:()=>i.vL,useRouteError:()=>i.r5,useRouteLoaderData:()=>i.Ew,useRoutes:()=>i.Ye,useSearchParams:()=>i.ok,useSubmit:()=>i.of,useViewTransitionState:()=>i.PM});var n=r(1517),i=r(6213)}};const t={};function r(n){const i=t[n];if(void 0!==i)return i.exports;const a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{const e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;let t;r.t=function(n,i){if(1&i&&(n=this(n)),8&i)return n;if("object"==typeof n&&n){if(4&i&&n.__esModule)return n;if(16&i&&"function"==typeof n.then)return n}const a=Object.create(null);r.r(a);const s={};t=t||[null,e({}),e([]),e(e)];for(var o=2&i&&n;("object"==typeof o||"function"==typeof o)&&!~t.indexOf(o);o=e(o))Object.getOwnPropertyNames(o).forEach(e=>s[e]=()=>n[e]);return s.default=()=>n,r.d(a,s),a}})(),r.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var i=t[n++],a=t[n++];r.o(e,i)?0===a&&n++:0===a?Object.defineProperty(e,i,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,i,{enumerable:!0,get:a})}else for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},r.cjs=e=>{const t={exports:{}};return e.call(t.exports,t,t.exports),t.exports},r.nc=void 0;r(6536)})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.