@bimdata/viewer 2.10.1-beta.2 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5507,7 +5507,7 @@ void main() {
|
|
|
5507
5507
|
--bimdata-local-context-width: ${r.width}px;
|
|
5508
5508
|
--bimdata-local-context-center-width: ${r.centerWidth}px;
|
|
5509
5509
|
--bimdata-local-context-resolution: ${r.resolution};
|
|
5510
|
-
`),onMouseenter:e[0]||(e[0]=(...h)=>r.onMouseEnter&&r.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>r.onMouseLeave&&r.onMouseLeave(...h))},[F(s,{ref:"modalManagerTemplateRef"},null,512),B("div",PFi,[r.windowPlugins.leftSidePanel?(Q(),te(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):fe("",!0),B("div",RFi,[(Q(!0),U(Et,null,Wt(r.windowPlugins.free,h=>(Q(),te(l,{key:h.name,class:be({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),F(c,{position:"left",plugins:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),F(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(Q(),te(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):fe("",!0)]),r.loading?(Q(),U("div",FFi,[r.spinner&&r.spinner.component?(Q(),te(Uo(r.spinner.component),ud(ll({key:0},r.spinner.props)),null,16)):(Q(),te(d,{key:1,size:"20px",border:"3px"}))])):fe("",!0),r.layoutSettingsDisplayed?(Q(),U("div",LFi,[F(u)])):fe("",!0)],36)}const _Fi=K(DFi,[["render",TFi],["__scopeId","data-v-558e7ce5"]]);let UFi=class{constructor(t=!0){const e=ERi(Qae,null,{resizable:t});e.registerContent("default",_Fi),this.settings=xa({edit:!1,swap:!1,full:!1}),this.areas=e}get resizable(){return this.areas.resizable}set resizable(t){this.areas.resizable=t}apply(t=null){this.areas.layout=t?xRi(t):null}copy(t,e=!0){return kRi(this.areas.layout,t,e)}open({ratio:t,direction:e,insertAfter:i,windowName:r=null,windowState:o=null,localContextId:n=null}={}){const s=r?{options:{windowName:r,windowState:o}}:null;return n===null?this.areas.splitLayout(t,e,i,s):this.areas.split(n,t,e,i,s)}swap(t,e){return this.areas.swap(t,e)}close(t){return this.areas.delete(t)}compare(t,e){var i,r;if(!t&&!e)return!0;if(!t||!e)return!1;if(typeof t=="string"&&typeof e=="string")return t===e;if(typeof t=="string"||typeof e=="string")return!1;if(t.windowName&&e.windowName){if(t.windowName!==e.windowName)return!1;const o=new Set((i=t.windowState)==null?void 0:i.modelIds),n=new Set((r=e.windowState)==null?void 0:r.modelIds);return o.size===n.size&&[...o].every(s=>n.has(s))}return t.windowName||e.windowName||t.direction!==e.direction||t.children.length!==e.children.length?!1:t.children.every((o,n)=>this.compare(o,e.children[n]))}};const NFi="2.10.1-beta.2",OFi={version:NFi};class HFi{constructor({plugins:e,api:i,ui:r,locale:o="fr"}){this.pluginManager=new USi(e),this.windowManager=new OSi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new MPi(i),this.globalContext=new xHe(this),this.state=GPi(this),this.shortcutManager=CFe(this.state),this.uiSettings=r||{},this.i18n=new BHe(o),this._contextMenu=null,this.layout=new UFi(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return OFi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||mFe}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function VFi(t,e={}){e.backgroundColor&&(t.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&t.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&t.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&t.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&t.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&t.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&t.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&t.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&t.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&t.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&t.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&t.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&t.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&t.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&t.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&t.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&t.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&t.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&t.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&t.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&t.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&t.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&t.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&t.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&t.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&t.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&t.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&t.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&t.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&t.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),t.style.setProperty("--areas-background-color","transparent")}const jFi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),_9=Object.freeze({READ:"read",WRITE:"write"});function Cxe(t){const e={};return t.forEach(i=>{const[r,o]=i.split(":");e[r]?e[r].push(o):e[r]=[o]}),e}const GFi={token_scopes:[],usable_scopes:[],user_role:25};function yxe(t=GFi){var e,i,r,o,n,s;const a=Cxe(t.token_scopes),l=Cxe(t.usable_scopes);return{...fhe(t),tokenScopes:a,usableScopes:l,userRole:jFi[t.user_role],user:t.user?fhe(t.user):null,hasBcfReadPermission:((e=l.bcf)==null?void 0:e.includes(_9.READ))??!1,hasBcfWritePermission:((i=l.bcf)==null?void 0:i.includes(_9.WRITE))??!1,hasModelReadPermission:((r=l.model)==null?void 0:r.includes(_9.READ))??!1,hasModelWritePermission:((o=l.model)==null?void 0:o.includes(_9.WRITE))??!1,hasDocReadPermission:((n=l.document)==null?void 0:n.includes(_9.READ))??!1,hasDocWritePermission:((s=l.document)==null?void 0:s.includes(_9.WRITE))??!1}}const zFi={BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{goBackButton:"Zur\xFCck",title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t:",noPriority:"Keine",assignedTo:"Zugewiesen an :",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte w\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"F\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Ver\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}},qFi={BcfComponents:zFi},KFi={BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{goBackButton:"Back",title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority: ",noPriority:"None",assignedTo:"Assigned to: ",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}},JFi={BcfComponents:KFi},YFi={BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{goBackButton:"Volver",title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad :",noPriority:"Sin",assignedTo:"Asignado a :",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotaci\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotograf\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Est\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}},WFi={BcfComponents:YFi},ZFi={BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{goBackButton:"Retour",title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9 : ",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0 : ",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorit\xE9s",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}},XFi={BcfComponents:ZFi},$Fi={BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{goBackButton:"Indietro",title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorit\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0:",noPriority:"Nessuno",assignedTo:"Assegnato a:",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorit\xE0",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE0",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorit\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorit\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}},eLi={BcfComponents:$Fi},tLi={de:qFi,en:JFi,es:WFi,fr:XFi,it:eLi},iLi=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?mo.setup({apiClient:t,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(tLi).forEach(([o,n])=>{i.global.mergeLocaleMessage(o,n)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(qqe).forEach(([o,n])=>{r.component(o,n)})}}),rLi={title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},oLi={creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"},nLi={BuildingMaker:rLi,FileManager:oLi},sLi={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},aLi={title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},lLi={creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},cLi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},dLi={title:"Photosphere Building"},uLi={BIMDataComponents:sLi,BuildingMaker:aLi,FileManager:lLi,MetaBuildingStructure:cLi,PhotosphereBuilding:dLi},hLi={title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},ALi={creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"},pLi={BuildingMaker:hLi,FileManager:ALi},gLi={t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},fLi={title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},mLi={creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},vLi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},CLi={title:"Photosph\xE8re Building"},yLi={BIMDataComponents:gLi,BuildingMaker:fLi,FileManager:mLi,MetaBuildingStructure:vLi,PhotosphereBuilding:CLi},wLi={title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},bLi={creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella \xE8 vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"},ILi={BuildingMaker:wLi,FileManager:bLi},BLi={de:nLi,en:uLi,es:pLi,fr:yLi,it:ILi},ELi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(BLi).forEach(([i,r])=>{t.global.mergeLocaleMessage(i,r)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(a3i).forEach(([i,r])=>{e.component(i,r)})}}),xLi={beforeMount(t,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);t.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(r=>r===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},kLi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:xh,BIMDataClickInputAway:xLi},Symbol.toStringTag,{value:"Module"})),MLi=t=>({install(e){Object.entries(U5t).forEach(([i,r])=>{e.component(i,r)}),Object.entries(kLi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),SLi={name:"LiWrapper",render(){return Fn("li",this.$slots.default())}};function QLi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const $h=Ia("id"),DLi=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(e.filter(Ah(kr("visible"),Af("selected"))).map($h)),predicate:()=>e.some(Ah(kr("visible"),Af("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(e.filter(kr("selected")).map($h)),predicate:()=>e.some(kr("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){const o=e.filter(n=>n.visible&&n.type===this.selectedObject.type&&n.id!==this.selectedObject.id).map($h);i.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(Ah(kr("visible"),kr("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return t.$t("context_menu.reverse_selection")},get group(){return t.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(kr("selected")).map($h)),n=new Set(e.filter(kr("visible")).map($h));i.selectObjects(Array.from(QLi(n,o)),{exclusive:!0})},predicate:()=>e.some(Ah(Af("selected"),kr("visible")))&&e.some(Ah(kr("selected"),kr("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(e.filter(Af("visible")).map($h)),predicate:()=>e.some(Af("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(kr("selected"));o.length>0&&i.deselectObjects(o.map($h)),i.hideObjects(this.objectsToHide.map($h))},predicate(){return this.objectsToHide=e.filter(Ah(kr("selected"),kr("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return t.groupPositions.visibility},position:3,get label(){return t.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(kr("visible"));o.some(kr("selected"))&&i.deselectObjects(o.filter(kr("selected")).map($h)),i.hideObjects(o.map($h))},predicate:()=>e.some(kr("visible"))}].filter(o=>o.predicate()),PLi={components:{LiWrapper:SLi},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(t){t?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(t){t.key==="Escape"&&this.away()},setPosition(t){const e=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=t.clientX-e.left,this.top=t.clientY-e.top,this.left+this.width>e.width&&(this.left=this.left-this.width),t.clientY>e.top+e.height/2?(this.bottom=e.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(t={}){let e=null;if((!t.execute||typeof t.execute!="function")&!t.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),t.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return t.id=this.nextCommandId++,t},open(t){this.currentCommands=[],this.setPosition(t),this.originEvent=t,t.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async t=>{if(typeof t.predicate=="function"){const e=t.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(t);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const i=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(t))}}else this.currentCommands.push(t)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:t=[],state:e=this.$viewer.state,context:i=null}){const r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(o=>r.set(o.name,o.key)),DLi({contextMenu:this,objects:t,state:e,pictos:r})},executeCommand(t){if(t.execute&&(t.execute(this.originEvent),this.displayed=!1),t.component&&!t.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const t=new Map;this.currentCommands.forEach(i=>{(i.group===null||i.group===void 0)&&(i.group=0),t.has(i.group)?t.get(i.group).push(i):t.set(i.group,[i])}),t.forEach(i=>i.sort((r,o)=>(r.position=r.position||0,o.position=o.position||0,r.position-o.position)));const e=[...t.keys()].sort((i,r)=>i-r).map(i=>t.get(i)).flat();this.currentCommands=e},isGroupIntersection(t){if(t===0)return!1;const e=this.currentCommands[t-1],i=this.currentCommands[t];return e.group<i.group},registerContextCommand(t){const e=this.typeCheckCommand(t);return this.contextCommands.push(e),t.id},registerCommand(t){const e=this.typeCheckCommand(t);return this.registeredCommands.push(e),t.id},unregisterCommand(t){return this.registeredCommands.find(e=>e.id===t)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==t),!0):!1},preventDefault(){this.defaultPrevented=!0}}},RLi={key:0,class:"separator"},FLi={class:"menu-text"},LLi={key:1,class:"menu-picto"},TLi={key:0,class:"context-menu__spinner"};function _Li(t,e,i,r,o,n){const s=R("BIMDataIconChevron"),a=R("LiWrapper"),l=R("BIMDataSpinner"),c=tr("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?Tt((Q(),U("ul",{key:0,class:"bimdata-list context-menu",style:Be(n.position)},[(Q(!0),U(Et,null,Wt(o.currentCommands,(d,u)=>(Q(),te(a,{key:d.label,class:"context-menu__element",onClick:h=>n.executeCommand(d)},{default:z(()=>[n.isGroupIntersection(u)?(Q(),U("div",RLi)):fe("",!0),B("div",FLi,ee(d.label),1),!d.component&&d.picto?(Q(),U("span",LLi,ee(d.picto),1)):d.component?(Q(),te(s,{key:2,size:"xxs",class:"fill-primary"})):fe("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(Q(),U("li",TLi,[F(l)])):fe("",!0)],4)),[[c,n.away]]):fe("",!0)}const ULi=K(PLi,[["render",_Li],["__scopeId","data-v-5b87d4a3"]]),NLi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=_t("$viewer"),e=xa(new Map),i=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},r=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:t.uiSettings.bimdataLogo!==!1,version:t.uiSettings.version!==!1?t.version:null,headerContent:e,headerRightContentComponents:ht(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,n)=>o.order-n.order).map(o=>o.component)),headerLeftContentComponents:ht(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,n)=>o.order-n.order).map(o=>o.component)),addContent:i,removeContent:r}}},OLi={class:"viewer-header"},HLi={class:"viewer-header__content"},VLi={class:"viewer-header__content__left"},jLi={class:"viewer-header__content__right"},GLi={key:0,class:"m-l-6 flex items-center"},zLi={key:1,class:"viewer-header__version"};function qLi(t,e,i,r,o,n){const s=R("BIMDataIllustration");return Tt((Q(),U("div",OLi,[B("div",HLi,[B("div",VLi,[(Q(!0),U(Et,null,Wt(r.headerLeftContentComponents,a=>(Q(),te(Uo(a),{key:a.name}))),128))]),B("div",jLi,[(Q(!0),U(Et,null,Wt(r.headerRightContentComponents,a=>(Q(),te(Uo(a),{key:a.name}))),128))])]),r.logo||r.version?(Q(),U("div",GLi,[r.logo?(Q(),te(s,{key:0,name:"logo",width:"30px",height:"30px"})):fe("",!0),r.version?(Q(),U("div",zLi,ee(r.version),1)):fe("",!0)])):fe("",!0)],512)),[[vi,i.visible]])}const KLi=K(NLi,[["render",qLi],["__scopeId","data-v-5c9ea6b6"]]),JLi={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX;const o=s=>{s.preventDefault();const a=s.clientX-r;r=s.clientX,e("resize",a)},n=s=>{s.preventDefault(),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}}}},YLi={class:"bimdata-separator"};function WLi(t,e,i,r,o,n){return Q(),U("div",YLi,[e[1]||(e[1]=B("div",{class:"bimdata-separator__line"},null,-1)),B("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>r.onResizerMousedown&&r.onResizerMousedown(...s))},null,32)])}const ZLi=K(JLi,[["render",WLi],["__scopeId","data-v-79a3b3af"]]),XLi={components:{Separator:ZLi},props:{position:{type:String,required:!0,validator(t){return["left","right"].includes(t)}},sidePanel:{type:Object,required:!0,validator(t){if(t.width&&(typeof t.width!="number"||t.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof t.width}`),!1;const e=typeof t?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(t){const e=Ue(null),i=Ue(t.sidePanel.width??400),r=(o,n=1)=>{const s=i.value+o*n;i.value=Math.max(0,s)};return Ht(()=>t.sidePanel,()=>{Object.defineProperty(t.sidePanel,"width",{get(){return i.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}i.value=o}}),Object.defineProperty(t.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:i,onResize:r}}},$Li={class:"bimdata-global-side-panel__component"};function eTi(t,e,i,r,o,n){const s=R("Separator");return Q(),U("div",{class:"bimdata-global-side-panel",style:Be(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(Q(),te(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):fe("",!0),B("div",$Li,[(Q(),te(Uo(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(Q(),te(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):fe("",!0)],4)}const tTi=K(XLi,[["render",eTi],["__scopeId","data-v-82d0d4cb"]]),iTi={name:"BimdataViewer",components:{ContextMenu:ULi,ViewerHeader:KLi,ModalManager:fxe,GlobalSidePanel:tTi},setup(){const t=_t("$viewer"),{globalContext:e,shortcutManager:i}=t;fo(()=>{i&&i.destroy(),e.hub.clear()}),Mr(()=>{t.pluginManager.runPluginsScripts(t)});const r=ht(()=>{var A;return t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||((A=e.localContexts[0].window)==null?void 0:A.logoAndVersion))}),o=ht(()=>{var A;return t.uiSettings.version!==!1&&(e.localContexts.length!==1||(A=e.localContexts[0].window)!=null&&A.logoAndVersion)?t.version:null}),n=ht(()=>e.leftSidePanel),s=ht(()=>e.rightSidePanel),a=ht(()=>{var A;const g=t.uiSettings.header!==!1,p=e.localContexts.length===1&&((A=e.localContexts[0].window)==null?void 0:A.header)===!1,m=!!(n.value||s.value);return g&&(!p||m)}),l=t.uiSettings.contextMenu!==!1,c=Ue(null);function d(A){l&&c.value.open(A)}function u(){t.shortcutManager.active=!0}function h(){t.shortcutManager.active=!1}return{Layout:t.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:h,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:o,version:t.version,loading:ht(()=>e.loading),spinner:ht(()=>e.spinner),leftSidePanel:n,rightSidePanel:s}}},rTi={key:1,class:"global-spinner",style:{"z-index":"3"}},oTi={key:2,class:"viewer__logo"},nTi={key:1,class:"version m-t-6"};function sTi(t,e,i,r,o,n){const s=R("ModalManager"),a=R("ContextMenu"),l=R("ViewerHeader"),c=R("GlobalSidePanel"),d=R("BIMDataSpinner"),u=R("BIMDataIllustration");return Q(),U("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>r.onContextMenu&&r.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>r.onMouseenter&&r.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>r.onMouseleave&&r.onMouseleave(...h))},[F(s,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(Q(),te(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):fe("",!0),F(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),B("div",{class:"bimdata-viewer__content",style:Be(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(Q(),te(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):fe("",!0),(Q(),te(Uo(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(Q(),te(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):fe("",!0)],4),r.loading?(Q(),U("div",rTi,[r.spinner&&r.spinner.component?(Q(),te(Uo(r.spinner.component),ud(ll({key:0},r.spinner.props)),null,16)):(Q(),te(d,{key:1,size:"40px",border:"5px"}))])):fe("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(Q(),U("div",oTi,[r.bimdataLogoOnSingleWindow?(Q(),te(u,{key:0,name:"logo"})):fe("",!0),r.viewerVersionOnSingleWindow?(Q(),U("div",nTi,ee(r.version),1)):fe("",!0)])):fe("",!0)],544)}const aTi=K(iTi,[["render",sTi],["__scopeId","data-v-c02b9f3f"]]),lTi=["src"],cTi={class:"bimdata-models__header"},dTi={key:0,class:"bimdata-models__header__loader"},uTi={class:"bimdata-models__header__picto"},hTi={class:"bimdata-models__header__name"},ATi={key:0,class:"bimdata-models__header__name--empty"},pTi={key:1,class:"bimdata-models__header__name--empty"},gTi={key:3},fTi=["onMousemove","onClick"],mTi={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=_t("$viewer"),r=Ue(),o=Ue(0),n=Ue(0),s=Ue(),a=go([]),l=Ue(!1),c=ht(()=>i.localContext.loadedModels),d=ht(()=>i.localContext.loadedModelIds),u=ht(()=>i.localContext.loadingModelIds),h=ht(()=>i.localContext.multiModel),A=ht(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(b=>c.value.find(E=>{var x;return((x=E.document)==null?void 0:x.head_id)!=null&&E.document.head_id===b.document.id})??b)),g=b=>d.value.includes(b),p=b=>u.value.includes(b),m=ht(()=>{var b;const{x:E,y:x}=((b=s.value)==null?void 0:b.getBoundingClientRect())??{x:0,y:0};return`top:${n.value-x}px; left:${o.value-E}px;`}),f=b=>{!h.value&&g(b.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(b.id)?i.localContext.unloadModels([b.id]):i.localContext.loadModels([b.id]))},v=b=>{switch(b){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},y=(b,E)=>{b!=null&&b.viewer_360_file&&(o.value=E.clientX,n.value=E.clientY),r.value=b?.viewer_360_file},C=async b=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,b)).filter(E=>i.state.models.some(x=>x.archived)||!E.archived).sort(o1("updated_at",!1))}catch(E){console.error("[Models] Cannot get project models. Error: ",E)}finally{l.value=!1}return[]},w=b=>{var E;return((E=b.children)==null?void 0:E.some(x=>g(x.id)))??!1};return C(i.localContext.modelTypes).then(b=>{a.value=b}),(b,E)=>{const x=R("BIMDataSpinner"),k=R("BIMDataIconModel3D"),M=R("BIMDataTextbox"),D=R("BIMDataCheckbox"),P=R("BIMDataRadio"),L=R("BIMDataIcon"),O=R("BIMDataDropdownList");return Q(),U("div",{ref_key:"templateRef",ref:s,class:be(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(Q(),U("div",{key:0,class:"bimdata-models__preview",style:Be(m.value)},[B("img",{src:r.value},null,8,lTi)],4)):fe("",!0),F(O,{style:Be(`--bimdata-models-width: ${t.width};`),width:t.width,list:A.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:A.value.length===0,onElementClick:f},{header:z(({isOpen:V})=>[B("div",cTi,[l.value||u.value.length>0?(Q(),U("div",dTi,[F(x)])):(Q(),U(Et,{key:1},[B("div",uTi,[F(k)]),B("div",{class:be(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[B("span",null,ee(d.value.length),1)],2),B("div",hTi,[A.value.length===0?(Q(),U("span",ATi,ee(b.$t("model.no_model")),1)):d.value.length===0?(Q(),U("span",pTi,ee(b.$t("model.no_loaded_model")),1)):d.value.length===1?(Q(),te(M,{key:2,text:c.value[0].name,tooltip:!V},null,8,["text","tooltip"])):d.value.length>1?(Q(),U("span",gTi,ee(b.$t("model.selected_models")),1)):fe("",!0)])],64))])]),element:z(({element:V,close:_})=>[B("div",{class:"bimdata-models__model",onMousemove:H=>t.preview&&y(V,H),onMouseout:E[0]||(E[0]=H=>t.preview&&y()),onClick:()=>{!h.value&&!g(V.id)&&_()}},[h.value?(Q(),te(D,{key:0,"model-value":g(V.id)||w(V),disabled:V.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(Q(),te(P,{key:1,"model-value":g(V.id)||w(V),disabled:V.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),F(L,{margin:"0 calc(var(--spacing-unit) / 2)",name:v(V.status),size:"xs",class:be({"fill-success":V.status==="C","fill-high":V.status==="E"})},null,8,["name","class"]),F(M,{class:be({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":V.status!=="C"||u.value.length>0}),text:V.name,width:`calc(100% -
|
|
5510
|
+
`),onMouseenter:e[0]||(e[0]=(...h)=>r.onMouseEnter&&r.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>r.onMouseLeave&&r.onMouseLeave(...h))},[F(s,{ref:"modalManagerTemplateRef"},null,512),B("div",PFi,[r.windowPlugins.leftSidePanel?(Q(),te(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):fe("",!0),B("div",RFi,[(Q(!0),U(Et,null,Wt(r.windowPlugins.free,h=>(Q(),te(l,{key:h.name,class:be({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),F(c,{position:"left",plugins:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),F(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(Q(),te(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):fe("",!0)]),r.loading?(Q(),U("div",FFi,[r.spinner&&r.spinner.component?(Q(),te(Uo(r.spinner.component),ud(ll({key:0},r.spinner.props)),null,16)):(Q(),te(d,{key:1,size:"20px",border:"3px"}))])):fe("",!0),r.layoutSettingsDisplayed?(Q(),U("div",LFi,[F(u)])):fe("",!0)],36)}const _Fi=K(DFi,[["render",TFi],["__scopeId","data-v-558e7ce5"]]);let UFi=class{constructor(t=!0){const e=ERi(Qae,null,{resizable:t});e.registerContent("default",_Fi),this.settings=xa({edit:!1,swap:!1,full:!1}),this.areas=e}get resizable(){return this.areas.resizable}set resizable(t){this.areas.resizable=t}apply(t=null){this.areas.layout=t?xRi(t):null}copy(t,e=!0){return kRi(this.areas.layout,t,e)}open({ratio:t,direction:e,insertAfter:i,windowName:r=null,windowState:o=null,localContextId:n=null}={}){const s=r?{options:{windowName:r,windowState:o}}:null;return n===null?this.areas.splitLayout(t,e,i,s):this.areas.split(n,t,e,i,s)}swap(t,e){return this.areas.swap(t,e)}close(t){return this.areas.delete(t)}compare(t,e){var i,r;if(!t&&!e)return!0;if(!t||!e)return!1;if(typeof t=="string"&&typeof e=="string")return t===e;if(typeof t=="string"||typeof e=="string")return!1;if(t.windowName&&e.windowName){if(t.windowName!==e.windowName)return!1;const o=new Set((i=t.windowState)==null?void 0:i.modelIds),n=new Set((r=e.windowState)==null?void 0:r.modelIds);return o.size===n.size&&[...o].every(s=>n.has(s))}return t.windowName||e.windowName||t.direction!==e.direction||t.children.length!==e.children.length?!1:t.children.every((o,n)=>this.compare(o,e.children[n]))}};const NFi="2.10.1",OFi={version:NFi};class HFi{constructor({plugins:e,api:i,ui:r,locale:o="fr"}){this.pluginManager=new USi(e),this.windowManager=new OSi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new MPi(i),this.globalContext=new xHe(this),this.state=GPi(this),this.shortcutManager=CFe(this.state),this.uiSettings=r||{},this.i18n=new BHe(o),this._contextMenu=null,this.layout=new UFi(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return OFi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||mFe}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function VFi(t,e={}){e.backgroundColor&&(t.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&t.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&t.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&t.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&t.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&t.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&t.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&t.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&t.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&t.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&t.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&t.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&t.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&t.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&t.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&t.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&t.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&t.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&t.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&t.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&t.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&t.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&t.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&t.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&t.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&t.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&t.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&t.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&t.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&t.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),t.style.setProperty("--areas-background-color","transparent")}const jFi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),_9=Object.freeze({READ:"read",WRITE:"write"});function Cxe(t){const e={};return t.forEach(i=>{const[r,o]=i.split(":");e[r]?e[r].push(o):e[r]=[o]}),e}const GFi={token_scopes:[],usable_scopes:[],user_role:25};function yxe(t=GFi){var e,i,r,o,n,s;const a=Cxe(t.token_scopes),l=Cxe(t.usable_scopes);return{...fhe(t),tokenScopes:a,usableScopes:l,userRole:jFi[t.user_role],user:t.user?fhe(t.user):null,hasBcfReadPermission:((e=l.bcf)==null?void 0:e.includes(_9.READ))??!1,hasBcfWritePermission:((i=l.bcf)==null?void 0:i.includes(_9.WRITE))??!1,hasModelReadPermission:((r=l.model)==null?void 0:r.includes(_9.READ))??!1,hasModelWritePermission:((o=l.model)==null?void 0:o.includes(_9.WRITE))??!1,hasDocReadPermission:((n=l.document)==null?void 0:n.includes(_9.READ))??!1,hasDocWritePermission:((s=l.document)==null?void 0:s.includes(_9.WRITE))??!1}}const zFi={BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{goBackButton:"Zur\xFCck",title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t:",noPriority:"Keine",assignedTo:"Zugewiesen an :",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte w\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"F\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Ver\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}},qFi={BcfComponents:zFi},KFi={BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{goBackButton:"Back",title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority: ",noPriority:"None",assignedTo:"Assigned to: ",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}},JFi={BcfComponents:KFi},YFi={BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{goBackButton:"Volver",title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad :",noPriority:"Sin",assignedTo:"Asignado a :",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotaci\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotograf\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Est\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}},WFi={BcfComponents:YFi},ZFi={BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{goBackButton:"Retour",title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9 : ",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0 : ",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorit\xE9s",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}},XFi={BcfComponents:ZFi},$Fi={BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{goBackButton:"Indietro",title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorit\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0:",noPriority:"Nessuno",assignedTo:"Assegnato a:",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorit\xE0",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE0",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorit\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorit\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}},eLi={BcfComponents:$Fi},tLi={de:qFi,en:JFi,es:WFi,fr:XFi,it:eLi},iLi=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?mo.setup({apiClient:t,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(tLi).forEach(([o,n])=>{i.global.mergeLocaleMessage(o,n)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(qqe).forEach(([o,n])=>{r.component(o,n)})}}),rLi={title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},oLi={creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"},nLi={BuildingMaker:rLi,FileManager:oLi},sLi={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},aLi={title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},lLi={creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},cLi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},dLi={title:"Photosphere Building"},uLi={BIMDataComponents:sLi,BuildingMaker:aLi,FileManager:lLi,MetaBuildingStructure:cLi,PhotosphereBuilding:dLi},hLi={title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},ALi={creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"},pLi={BuildingMaker:hLi,FileManager:ALi},gLi={t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},fLi={title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},mLi={creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},vLi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},CLi={title:"Photosph\xE8re Building"},yLi={BIMDataComponents:gLi,BuildingMaker:fLi,FileManager:mLi,MetaBuildingStructure:vLi,PhotosphereBuilding:CLi},wLi={title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},bLi={creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella \xE8 vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"},ILi={BuildingMaker:wLi,FileManager:bLi},BLi={de:nLi,en:uLi,es:pLi,fr:yLi,it:ILi},ELi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(BLi).forEach(([i,r])=>{t.global.mergeLocaleMessage(i,r)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(a3i).forEach(([i,r])=>{e.component(i,r)})}}),xLi={beforeMount(t,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);t.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(r=>r===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},kLi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:xh,BIMDataClickInputAway:xLi},Symbol.toStringTag,{value:"Module"})),MLi=t=>({install(e){Object.entries(U5t).forEach(([i,r])=>{e.component(i,r)}),Object.entries(kLi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),SLi={name:"LiWrapper",render(){return Fn("li",this.$slots.default())}};function QLi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const $h=Ia("id"),DLi=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(e.filter(Ah(kr("visible"),Af("selected"))).map($h)),predicate:()=>e.some(Ah(kr("visible"),Af("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(e.filter(kr("selected")).map($h)),predicate:()=>e.some(kr("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){const o=e.filter(n=>n.visible&&n.type===this.selectedObject.type&&n.id!==this.selectedObject.id).map($h);i.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(Ah(kr("visible"),kr("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return t.$t("context_menu.reverse_selection")},get group(){return t.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(kr("selected")).map($h)),n=new Set(e.filter(kr("visible")).map($h));i.selectObjects(Array.from(QLi(n,o)),{exclusive:!0})},predicate:()=>e.some(Ah(Af("selected"),kr("visible")))&&e.some(Ah(kr("selected"),kr("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(e.filter(Af("visible")).map($h)),predicate:()=>e.some(Af("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(kr("selected"));o.length>0&&i.deselectObjects(o.map($h)),i.hideObjects(this.objectsToHide.map($h))},predicate(){return this.objectsToHide=e.filter(Ah(kr("selected"),kr("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return t.groupPositions.visibility},position:3,get label(){return t.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(kr("visible"));o.some(kr("selected"))&&i.deselectObjects(o.filter(kr("selected")).map($h)),i.hideObjects(o.map($h))},predicate:()=>e.some(kr("visible"))}].filter(o=>o.predicate()),PLi={components:{LiWrapper:SLi},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(t){t?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(t){t.key==="Escape"&&this.away()},setPosition(t){const e=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=t.clientX-e.left,this.top=t.clientY-e.top,this.left+this.width>e.width&&(this.left=this.left-this.width),t.clientY>e.top+e.height/2?(this.bottom=e.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(t={}){let e=null;if((!t.execute||typeof t.execute!="function")&!t.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),t.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return t.id=this.nextCommandId++,t},open(t){this.currentCommands=[],this.setPosition(t),this.originEvent=t,t.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async t=>{if(typeof t.predicate=="function"){const e=t.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(t);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const i=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(t))}}else this.currentCommands.push(t)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:t=[],state:e=this.$viewer.state,context:i=null}){const r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(o=>r.set(o.name,o.key)),DLi({contextMenu:this,objects:t,state:e,pictos:r})},executeCommand(t){if(t.execute&&(t.execute(this.originEvent),this.displayed=!1),t.component&&!t.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const t=new Map;this.currentCommands.forEach(i=>{(i.group===null||i.group===void 0)&&(i.group=0),t.has(i.group)?t.get(i.group).push(i):t.set(i.group,[i])}),t.forEach(i=>i.sort((r,o)=>(r.position=r.position||0,o.position=o.position||0,r.position-o.position)));const e=[...t.keys()].sort((i,r)=>i-r).map(i=>t.get(i)).flat();this.currentCommands=e},isGroupIntersection(t){if(t===0)return!1;const e=this.currentCommands[t-1],i=this.currentCommands[t];return e.group<i.group},registerContextCommand(t){const e=this.typeCheckCommand(t);return this.contextCommands.push(e),t.id},registerCommand(t){const e=this.typeCheckCommand(t);return this.registeredCommands.push(e),t.id},unregisterCommand(t){return this.registeredCommands.find(e=>e.id===t)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==t),!0):!1},preventDefault(){this.defaultPrevented=!0}}},RLi={key:0,class:"separator"},FLi={class:"menu-text"},LLi={key:1,class:"menu-picto"},TLi={key:0,class:"context-menu__spinner"};function _Li(t,e,i,r,o,n){const s=R("BIMDataIconChevron"),a=R("LiWrapper"),l=R("BIMDataSpinner"),c=tr("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?Tt((Q(),U("ul",{key:0,class:"bimdata-list context-menu",style:Be(n.position)},[(Q(!0),U(Et,null,Wt(o.currentCommands,(d,u)=>(Q(),te(a,{key:d.label,class:"context-menu__element",onClick:h=>n.executeCommand(d)},{default:z(()=>[n.isGroupIntersection(u)?(Q(),U("div",RLi)):fe("",!0),B("div",FLi,ee(d.label),1),!d.component&&d.picto?(Q(),U("span",LLi,ee(d.picto),1)):d.component?(Q(),te(s,{key:2,size:"xxs",class:"fill-primary"})):fe("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(Q(),U("li",TLi,[F(l)])):fe("",!0)],4)),[[c,n.away]]):fe("",!0)}const ULi=K(PLi,[["render",_Li],["__scopeId","data-v-5b87d4a3"]]),NLi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=_t("$viewer"),e=xa(new Map),i=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},r=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:t.uiSettings.bimdataLogo!==!1,version:t.uiSettings.version!==!1?t.version:null,headerContent:e,headerRightContentComponents:ht(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,n)=>o.order-n.order).map(o=>o.component)),headerLeftContentComponents:ht(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,n)=>o.order-n.order).map(o=>o.component)),addContent:i,removeContent:r}}},OLi={class:"viewer-header"},HLi={class:"viewer-header__content"},VLi={class:"viewer-header__content__left"},jLi={class:"viewer-header__content__right"},GLi={key:0,class:"m-l-6 flex items-center"},zLi={key:1,class:"viewer-header__version"};function qLi(t,e,i,r,o,n){const s=R("BIMDataIllustration");return Tt((Q(),U("div",OLi,[B("div",HLi,[B("div",VLi,[(Q(!0),U(Et,null,Wt(r.headerLeftContentComponents,a=>(Q(),te(Uo(a),{key:a.name}))),128))]),B("div",jLi,[(Q(!0),U(Et,null,Wt(r.headerRightContentComponents,a=>(Q(),te(Uo(a),{key:a.name}))),128))])]),r.logo||r.version?(Q(),U("div",GLi,[r.logo?(Q(),te(s,{key:0,name:"logo",width:"30px",height:"30px"})):fe("",!0),r.version?(Q(),U("div",zLi,ee(r.version),1)):fe("",!0)])):fe("",!0)],512)),[[vi,i.visible]])}const KLi=K(NLi,[["render",qLi],["__scopeId","data-v-5c9ea6b6"]]),JLi={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX;const o=s=>{s.preventDefault();const a=s.clientX-r;r=s.clientX,e("resize",a)},n=s=>{s.preventDefault(),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}}}},YLi={class:"bimdata-separator"};function WLi(t,e,i,r,o,n){return Q(),U("div",YLi,[e[1]||(e[1]=B("div",{class:"bimdata-separator__line"},null,-1)),B("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>r.onResizerMousedown&&r.onResizerMousedown(...s))},null,32)])}const ZLi=K(JLi,[["render",WLi],["__scopeId","data-v-79a3b3af"]]),XLi={components:{Separator:ZLi},props:{position:{type:String,required:!0,validator(t){return["left","right"].includes(t)}},sidePanel:{type:Object,required:!0,validator(t){if(t.width&&(typeof t.width!="number"||t.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof t.width}`),!1;const e=typeof t?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(t){const e=Ue(null),i=Ue(t.sidePanel.width??400),r=(o,n=1)=>{const s=i.value+o*n;i.value=Math.max(0,s)};return Ht(()=>t.sidePanel,()=>{Object.defineProperty(t.sidePanel,"width",{get(){return i.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}i.value=o}}),Object.defineProperty(t.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:i,onResize:r}}},$Li={class:"bimdata-global-side-panel__component"};function eTi(t,e,i,r,o,n){const s=R("Separator");return Q(),U("div",{class:"bimdata-global-side-panel",style:Be(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(Q(),te(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):fe("",!0),B("div",$Li,[(Q(),te(Uo(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(Q(),te(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):fe("",!0)],4)}const tTi=K(XLi,[["render",eTi],["__scopeId","data-v-82d0d4cb"]]),iTi={name:"BimdataViewer",components:{ContextMenu:ULi,ViewerHeader:KLi,ModalManager:fxe,GlobalSidePanel:tTi},setup(){const t=_t("$viewer"),{globalContext:e,shortcutManager:i}=t;fo(()=>{i&&i.destroy(),e.hub.clear()}),Mr(()=>{t.pluginManager.runPluginsScripts(t)});const r=ht(()=>{var A;return t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||((A=e.localContexts[0].window)==null?void 0:A.logoAndVersion))}),o=ht(()=>{var A;return t.uiSettings.version!==!1&&(e.localContexts.length!==1||(A=e.localContexts[0].window)!=null&&A.logoAndVersion)?t.version:null}),n=ht(()=>e.leftSidePanel),s=ht(()=>e.rightSidePanel),a=ht(()=>{var A;const g=t.uiSettings.header!==!1,p=e.localContexts.length===1&&((A=e.localContexts[0].window)==null?void 0:A.header)===!1,m=!!(n.value||s.value);return g&&(!p||m)}),l=t.uiSettings.contextMenu!==!1,c=Ue(null);function d(A){l&&c.value.open(A)}function u(){t.shortcutManager.active=!0}function h(){t.shortcutManager.active=!1}return{Layout:t.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:h,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:o,version:t.version,loading:ht(()=>e.loading),spinner:ht(()=>e.spinner),leftSidePanel:n,rightSidePanel:s}}},rTi={key:1,class:"global-spinner",style:{"z-index":"3"}},oTi={key:2,class:"viewer__logo"},nTi={key:1,class:"version m-t-6"};function sTi(t,e,i,r,o,n){const s=R("ModalManager"),a=R("ContextMenu"),l=R("ViewerHeader"),c=R("GlobalSidePanel"),d=R("BIMDataSpinner"),u=R("BIMDataIllustration");return Q(),U("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>r.onContextMenu&&r.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>r.onMouseenter&&r.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>r.onMouseleave&&r.onMouseleave(...h))},[F(s,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(Q(),te(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):fe("",!0),F(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),B("div",{class:"bimdata-viewer__content",style:Be(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(Q(),te(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):fe("",!0),(Q(),te(Uo(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(Q(),te(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):fe("",!0)],4),r.loading?(Q(),U("div",rTi,[r.spinner&&r.spinner.component?(Q(),te(Uo(r.spinner.component),ud(ll({key:0},r.spinner.props)),null,16)):(Q(),te(d,{key:1,size:"40px",border:"5px"}))])):fe("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(Q(),U("div",oTi,[r.bimdataLogoOnSingleWindow?(Q(),te(u,{key:0,name:"logo"})):fe("",!0),r.viewerVersionOnSingleWindow?(Q(),U("div",nTi,ee(r.version),1)):fe("",!0)])):fe("",!0)],544)}const aTi=K(iTi,[["render",sTi],["__scopeId","data-v-c02b9f3f"]]),lTi=["src"],cTi={class:"bimdata-models__header"},dTi={key:0,class:"bimdata-models__header__loader"},uTi={class:"bimdata-models__header__picto"},hTi={class:"bimdata-models__header__name"},ATi={key:0,class:"bimdata-models__header__name--empty"},pTi={key:1,class:"bimdata-models__header__name--empty"},gTi={key:3},fTi=["onMousemove","onClick"],mTi={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=_t("$viewer"),r=Ue(),o=Ue(0),n=Ue(0),s=Ue(),a=go([]),l=Ue(!1),c=ht(()=>i.localContext.loadedModels),d=ht(()=>i.localContext.loadedModelIds),u=ht(()=>i.localContext.loadingModelIds),h=ht(()=>i.localContext.multiModel),A=ht(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(b=>c.value.find(E=>{var x;return((x=E.document)==null?void 0:x.head_id)!=null&&E.document.head_id===b.document.id})??b)),g=b=>d.value.includes(b),p=b=>u.value.includes(b),m=ht(()=>{var b;const{x:E,y:x}=((b=s.value)==null?void 0:b.getBoundingClientRect())??{x:0,y:0};return`top:${n.value-x}px; left:${o.value-E}px;`}),f=b=>{!h.value&&g(b.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(b.id)?i.localContext.unloadModels([b.id]):i.localContext.loadModels([b.id]))},v=b=>{switch(b){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},y=(b,E)=>{b!=null&&b.viewer_360_file&&(o.value=E.clientX,n.value=E.clientY),r.value=b?.viewer_360_file},C=async b=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,b)).filter(E=>i.state.models.some(x=>x.archived)||!E.archived).sort(o1("updated_at",!1))}catch(E){console.error("[Models] Cannot get project models. Error: ",E)}finally{l.value=!1}return[]},w=b=>{var E;return((E=b.children)==null?void 0:E.some(x=>g(x.id)))??!1};return C(i.localContext.modelTypes).then(b=>{a.value=b}),(b,E)=>{const x=R("BIMDataSpinner"),k=R("BIMDataIconModel3D"),M=R("BIMDataTextbox"),D=R("BIMDataCheckbox"),P=R("BIMDataRadio"),L=R("BIMDataIcon"),O=R("BIMDataDropdownList");return Q(),U("div",{ref_key:"templateRef",ref:s,class:be(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(Q(),U("div",{key:0,class:"bimdata-models__preview",style:Be(m.value)},[B("img",{src:r.value},null,8,lTi)],4)):fe("",!0),F(O,{style:Be(`--bimdata-models-width: ${t.width};`),width:t.width,list:A.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:A.value.length===0,onElementClick:f},{header:z(({isOpen:V})=>[B("div",cTi,[l.value||u.value.length>0?(Q(),U("div",dTi,[F(x)])):(Q(),U(Et,{key:1},[B("div",uTi,[F(k)]),B("div",{class:be(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[B("span",null,ee(d.value.length),1)],2),B("div",hTi,[A.value.length===0?(Q(),U("span",ATi,ee(b.$t("model.no_model")),1)):d.value.length===0?(Q(),U("span",pTi,ee(b.$t("model.no_loaded_model")),1)):d.value.length===1?(Q(),te(M,{key:2,text:c.value[0].name,tooltip:!V},null,8,["text","tooltip"])):d.value.length>1?(Q(),U("span",gTi,ee(b.$t("model.selected_models")),1)):fe("",!0)])],64))])]),element:z(({element:V,close:_})=>[B("div",{class:"bimdata-models__model",onMousemove:H=>t.preview&&y(V,H),onMouseout:E[0]||(E[0]=H=>t.preview&&y()),onClick:()=>{!h.value&&!g(V.id)&&_()}},[h.value?(Q(),te(D,{key:0,"model-value":g(V.id)||w(V),disabled:V.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(Q(),te(P,{key:1,"model-value":g(V.id)||w(V),disabled:V.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),F(L,{margin:"0 calc(var(--spacing-unit) / 2)",name:v(V.status),size:"xs",class:be({"fill-success":V.status==="C","fill-high":V.status==="E"})},null,8,["name","class"]),F(M,{class:be({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":V.status!=="C"||u.value.length>0}),text:V.name,width:`calc(100% -
|
|
5511
5511
|
${h.value?13:23}px - 2 * 6px - 16px)`},null,8,["class","text","width"]),V.document&&!V.document.is_head_version?(Q(),te(L,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):fe("",!0)],40,fTi),p(V.id)?(Q(),te(x,{key:0,class:"bimdata-models__model__spinner"})):fe("",!0)]),_:1},8,["style","width","list","loading","disabled"])],2)}}},wxe=K(mTi,[["__scopeId","data-v-34c2cf79"]]),vTi="data:image/svg+xml,%3csvg%20width='16'%20height='21'%20viewBox='0%200%2016%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.47193%202.76644C7.65699%202.84439%207.77716%203.02565%207.777%203.22661L7.77339%207.94624C7.77318%208.22238%207.54916%208.44655%207.27301%208.44693L2.4192%208.45366C2.21569%208.45394%202.03258%208.33085%201.95617%208.1424C1.87975%207.95394%201.92528%207.73773%202.07129%207.59566L6.92872%202.86931C7.0729%202.72902%207.28688%202.6885%207.47193%202.76644ZM3.65141%207.45195L6.77378%207.44762L6.7761%204.41157L3.65141%207.45195ZM5.81657%200.893911L6.02338%200.893274L13.3879%200.870595C14.679%200.866619%2015.7208%201.91642%2015.722%203.20083L15.2221%203.20237L15.722%203.20052L15.722%203.20083L15.745%2017.8999L15.745%2017.9002C15.7462%2019.1846%2014.7063%2020.2408%2013.4153%2020.2448L2.35929%2020.2788C1.07114%2020.2828%200.0171799%2019.2362%200.0159721%2017.9486L0.00563138%206.92409L0.00543684%206.71668L0.152103%206.56972L5.67032%201.04045L5.81657%200.893911ZM6.23113%201.89264L1.00582%207.12841L1.01597%2017.9455C1.01666%2018.6791%201.62068%2019.2811%202.35835%2019.2788L13.4143%2019.2448C14.1484%2019.2425%2014.7456%2018.6402%2014.745%2017.9035C14.745%2017.9034%2014.745%2017.9033%2014.745%2017.9033L14.722%203.20423L14.722%203.20391C14.7213%202.46716%2014.123%201.86833%2013.3888%201.87059L6.23113%201.89264Z'%20fill='%232F374A'/%3e%3c/svg%3e",CTi=["src"],yTi={key:0,class:"bimdata-multi-model-loader__header-container"},wTi={key:0,class:"bimdata-multi-model-loader__header__loader"},bTi={class:"bimdata-multi-model-loader__header__picto"},ITi=["src"],BTi={class:"bimdata-multi-model-loader__header__name"},ETi={key:0,class:"bimdata-multi-model-loader__header__name--empty"},xTi={key:1,class:"bimdata-multi-model-loader__header__name--empty"},kTi={key:3},MTi={key:1,class:"bimdata-multi-model-loader__main"},STi=["onMousemove","onClick"],QTi={__name:"BIMDataMultiModelLoader",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=_t("$viewer"),r=Ue(),o=Ue(0),n=Ue(0),s=Ue(),a=go([]),l=Ue(!1),c=Ue(!0),d=P=>{P.key==="Escape"?c.value=!0:P.key==="Enter"&&x()};Ht(c,P=>{P?(window.removeEventListener("keydown",d),y.clear(),v.clear(),r.value=null):window.addEventListener("keydown",d)});const u=ht(()=>i.localContext.loadedModels),h=ht(()=>i.localContext.loadedModelIds),A=ht(()=>i.localContext.loadingModelIds),g=ht(()=>i.localContext.multiModel),p=ht(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(P=>u.value.find(L=>{var O;return((O=L.document)==null?void 0:O.head_id)!=null&&L.document.head_id===P.document.id})??P)),m=P=>h.value.includes(P),f=P=>A.value.includes(P),v=xa(new Set),y=xa(new Set),C=P=>{var L;return((L=P.children)==null?void 0:L.some(O=>m(O.id)))??!1},w=P=>(m(P.id)||C(P)||v.has(P))&&!y.has(P),b=ht(()=>{const{x:P,y:L}=s.value.getBoundingClientRect();return`top:${n.value-L}px; left:${o.value-P}px;`}),E=P=>{P.status==="C"&&(!g.value&&m(P.id)||(m(P.id)?y.has(P)?y.delete(P):y.add(P):v.has(P)?v.delete(P):v.add(P)))},x=()=>{v.size>0&&i.localContext.loadModels(Array.from(v).map(P=>P.id)),y.size>0&&i.localContext.unloadModels(Array.from(y).map(P=>P.id)),c.value=!0},k=P=>{switch(P){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},M=P=>P.document&&!P.document.is_head_version,D=(P,L)=>{e.preview&&(P!=null&&P.viewer_360_file&&(o.value=L.clientX,n.value=L.clientY),r.value=P?.viewer_360_file)};return(async P=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,P)).filter(L=>i.state.models.some(O=>O.archived)||!L.archived).sort(o1("updated_at",!1))}catch(L){console.error("[Models] Cannot get project models. Error: ",L)}finally{l.value=!1}return[]})(i.localContext.modelTypes).then(P=>{a.value=P}),(P,L)=>{const O=R("BIMDataSpinner"),V=R("BIMDataTextbox"),_=R("BIMDataIconChevron"),H=R("BIMDataButton"),Y=R("BIMDataIconFileIfcPolychrome"),re=R("BIMDataCheckbox"),de=R("BIMDataRadio"),xe=R("BIMDataIcon"),pe=R("BIMDataPaginatedList"),Ee=tr("click-away");return Q(),U("div",{ref_key:"templateRef",ref:s,class:be(["bimdata-multi-model-loader",{"bimdata-multi-model-loader--window-positioning":t.windowPositioning}])},[r.value?(Q(),U("div",{key:0,class:"bimdata-multi-model-loader__preview",style:Be(b.value)},[B("img",{src:r.value},null,8,CTi)],4)):fe("",!0),F(lr,{name:"fade",mode:"out-in"},{default:z(()=>[c.value?(Q(),U("div",yTi,[Mt(P.$slots,"left",{},void 0,!0),B("div",{class:"bimdata-multi-model-loader__header",onClick:L[0]||(L[0]=ue=>c.value=!1)},[l.value||A.value.length>0?(Q(),U("div",wTi,[F(O)])):(Q(),U(Et,{key:1},[B("div",bTi,[B("img",{src:Vt(vTi),alt:"file icon"},null,8,ITi)]),B("div",{class:be(["bimdata-multi-model-loader__header__number bimdata-info-length",{"bimdata-multi-model-loader__header__number--empty":h.value.length===0}])},[B("span",null,ee(h.value.length),1)],2),B("div",BTi,[p.value.length===0?(Q(),U("span",ETi,ee(P.$t("model.no_model")),1)):h.value.length===0?(Q(),U("span",xTi,ee(P.$t("model.no_loaded_model")),1)):h.value.length===1?(Q(),te(V,{key:2,text:u.value[0].name,tooltip:c.value,width:"233px"},null,8,["text","tooltip"])):h.value.length>1?(Q(),U("span",kTi,ee(P.$t("model.selected_models")),1)):fe("",!0)]),F(H,{color:"default",icon:"",radius:"",fill:"",width:"21px",height:"21px"},{default:z(()=>[F(_,{size:"xxxs"})]),_:1})],64))]),Mt(P.$slots,"right",{},void 0,!0)])):Tt((Q(),U("div",MTi,[F(pe,{list:p.value,"per-page":10},{element:z(({element:ue})=>[B("div",{class:be(["bimdata-multi-model-loader__main__model",{"bimdata-multi-model-loader__main__model--disabled":ue.status!=="C"}]),onMousemove:De=>D(ue,De),onMouseout:L[1]||(L[1]=De=>D()),onClick:De=>E(ue)},[F(Y,{fill:"",color:"default",size:"xs"}),g.value?(Q(),te(re,{key:0,"model-value":w(ue),disabled:ue.status!=="C"},null,8,["model-value","disabled"])):(Q(),te(de,{key:1,"model-value":w(ue),disabled:ue.status!=="C"},null,8,["model-value","disabled"])),F(V,{class:be({"bimdata-multi-model-loader__main__model__name":!0,"bimdata-multi-model-loader__main__model__name--disabled":ue.status!=="C"}),text:ue.name,width:M(ue)?"333px":"363px"},null,8,["class","text","width"]),M(ue)?(Q(),te(xe,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):fe("",!0),f(ue.id)?(Q(),te(O,{key:3,class:"bimdata-multi-model-loader__main__model__spinner"})):(Q(),te(xe,{key:4,name:k(ue.status),size:"xs",class:be({"fill-success":ue.status==="C","fill-high":ue.status==="E"})},null,8,["name","class"]))],42,STi)]),_:1},8,["list"]),F(H,{class:"bimdata-multi-model-loader__main__validate",width:"93px",color:"primary",fill:"",radius:"",disabled:Vt(v).size===0&&Vt(y).size===0,onClick:x},{default:z(()=>[gt(ee(P.$t("global.validate")),1)]),_:1},8,["disabled"])])),[[Ee,()=>c.value=!0]])]),_:3})],2)}}},DTi=K(QTi,[["__scopeId","data-v-ef41eab1"]]),PTi={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function RTi(t,e,i,r,o,n){const s=R("BIMDataIllustration");return Q(),U("div",{class:"bimdata__no-model",style:Be({"--no-model--opacity":o.shown?1:0})},[F(s,{name:"emptyViewer",x:"90",y:"90"}),B("span",null,ee(t.$t("model.select_model")),1)],4)}const bxe=K(PTi,[["render",RTi],["__scopeId","data-v-5ffd9bc0"]]);window.BIMDataViewerVue=Qae;class FTi{constructor(e={}){var i,r;const{api:o={},ui:n}=e;this.uiCfg=n,o.apiUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `apiUrl` not set, use 'https://api.bimdata.io' by default."),o.apiUrl="https://api.bimdata.io"),o.archiveUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `archiveUrl` not set, use 'https://archive.bimdata.io' by default."),o.archiveUrl="https://archive.bimdata.io"),o.pdfBackendUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `pdfBackendUrl` not set, use 'https://pdf-backend.bimdata.io' by default."),o.pdfBackendUrl="https://pdf-backend.bimdata.io"),o.ifcIds&&(console.warn("[BIMData Viewer] DEPRECATED - Viewer config - please use the `modelIds` property instead of `ifcIds`."),o.modelIds===void 0&&(o.modelIds=o.ifcIds)),o.modelIds||(o.modelIds=[]),(i=o.offline)!=null&&i.dataFile&&(o.offline.data=o.offline.dataFile),this.$viewer=new HFi(e),(r=o.offline)!=null&&r.enabled?this.$viewer.api.enableOfflineMode(o.offline.data,o.offline.options).then(()=>this.state.loadModels(o.modelIds)):(this.$viewer.globalContext.loadingProcessStart(),this.state.loadModels(o.modelIds).finally(()=>this.$viewer.globalContext.loadingProcessEnd())),this.vueApp=null}get state(){return this.$viewer.state}get api(){return this.$viewer.api}async mount(e,i="3d"){var r;const{$viewer:o}=this;await o.api.ready;try{const u=await o.api.apiClient.collaborationApi.checkProjectAccess(o.api.cloudId,o.api.projectId);o.api.permissions=yxe(u)}catch{o.api.permissions=yxe()}const n=this.api.accessToken,{i18n:s}=o;s.registerTranslations(o.pluginManager.pluginTranslations),o.layout.apply(i);const a={i18n:s.i18nVuePlugin,data(){return{accessToken:n}},render(){return Fn(aTi,{style:"height: 100%"})}},l=Ay(a).use(s.i18nVuePlugin).use(MLi()).use(ELi({i18nPlugin:s.i18nVuePlugin})).use(iLi({apiClient:o.api.apiClient,i18nPlugin:s.i18nVuePlugin}));l.provide("$viewer",o),l.component("BIMDataModelLoader",wxe),l.component("BIMDataMultiModelLoader",DTi),l.component("BIMDataNoModelWindowPlaceHolder",bxe),l.component("BIMDataStoreySelector",aG),l.component("ModelsLoader",wxe),l.component("NoModelWindowPlaceHolder",bxe);const c=e instanceof HTMLElement?e:document.querySelector(e);c&&(c.style.height="100%");const d=l.mount(e);return d.$viewer=o,VFi(d.$el,(r=this.uiCfg)==null?void 0:r.style),typeof window<"u"&&(window.bimdataViewer=d),this.vueApp=l,d}destroy(){var e;(e=this.vueApp)==null||e.unmount()}setLocale(e){if(!qae.includes(e))throw new Error(`Viewer available locales are ${qae.join(", ")}.`);this.$viewer.i18n.locale=e}registerPlugin(e){this.$viewer.registerPlugin(e)}registerWindow(e){return this.$viewer.windowManager.registerWindow(e)}unregisterWindow(e){return this.$viewer.windowManager.unregisterWindow(e)}setAccessToken(e){this.api.accessToken=e}async loadModels(e){this.$viewer.globalContext.loadingProcessStart();const i=await this.state.loadModels(e);return this.$viewer.globalContext.loadingProcessEnd(),i}loadIfcs(e){return console.warn("[BIMData Viewer] DEPRECATED - Viewer - please use the loadModels method instead of loadIfcs."),this.loadModels(e)}}const Ixe=(t={})=>new FTi(t);window.makeBIMDataViewer=Ixe;var hI={};hI.d=(t,e)=>{for(var i in e)hI.o(e,i)&&!hI.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},hI.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var zi=globalThis.pdfjsLib={};hI.d(zi,{AbortException:()=>og,AnnotationEditorLayer:()=>YUi,AnnotationEditorParamsType:()=>Qr,AnnotationEditorType:()=>rr,AnnotationEditorUIManager:()=>SI,AnnotationLayer:()=>_Ui,AnnotationMode:()=>ig,ColorPicker:()=>FMe,DOMSVGFactory:()=>ZX,DrawLayer:()=>WUi,FeatureTest:()=>xl,GlobalWorkerOptions:()=>mg,ImageKind:()=>BR,InvalidPDFException:()=>ZZ,MissingPDFException:()=>pI,OPS:()=>Vu,OutputScale:()=>lX,PDFDataRangeTransport:()=>Zke,PDFDateString:()=>sX,PDFWorker:()=>OF,PasswordResponses:()=>UTi,PermissionFlag:()=>_Ti,PixelsPerInch:()=>N9,RenderingCancelledException:()=>oX,TextLayer:()=>qX,TouchManager:()=>$xe,UnexpectedResponseException:()=>MR,Util:()=>bi,VerbosityLevel:()=>ER,XfaLayer:()=>iMe,build:()=>fUi,createValidAbsoluteUrl:()=>VTi,fetchData:()=>DR,getDocument:()=>nUi,getFilenameFromUrl:()=>ZTi,getPdfFilenameFromUrl:()=>XTi,getXfaPageViewport:()=>$Ti,isDataScheme:()=>PR,isPdfFile:()=>nX,noContextMenu:()=>ju,normalizeUnicode:()=>JTi,setLayerDimensions:()=>H2,shadow:()=>pr,stopEvent:()=>Xc,version:()=>gUi});const Oa=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),Bxe=[1,0,0,1,0,0],JZ=[.001,0,0,.001,0,0],LTi=1e7,YZ=1.35,Zc={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},ig={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},TTi="pdfjs_internal_editor_",rr={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},Qr={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,DRAW_STEP:41},_Ti={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Ha={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},BR={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Cs={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,WIDGET:20},AI={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},ER={ERRORS:0,WARNINGS:1,INFOS:5},Vu={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},UTi={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let xR=ER.WARNINGS;function NTi(t){Number.isInteger(t)&&(xR=t)}function OTi(){return xR}function kR(t){xR>=ER.INFOS&&console.log(`Info: ${t}`)}function or(t){xR>=ER.WARNINGS&&console.log(`Warning: ${t}`)}function Mo(t){throw new Error(t)}function $n(t,e){t||Mo(e)}function HTi(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function VTi(t,e=null,i=null){if(!t)return null;try{if(i&&typeof t=="string"){if(i.addDefaultProtocol&&t.startsWith("www.")){const o=t.match(/\./g);o?.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=KTi(t)}catch{}}const r=e?new URL(t,e):new URL(t);if(HTi(r))return r}catch{}return null}function pr(t,e,i,r=!1){return Object.defineProperty(t,e,{value:i,enumerable:!r,configurable:!0,writable:!1}),i}const rg=function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t}();let Exe=class extends rg{constructor(t,e){super(t,"PasswordException"),this.code=e}},WZ=class extends rg{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},ZZ=class extends rg{constructor(t){super(t,"InvalidPDFException")}},pI=class extends rg{constructor(t){super(t,"MissingPDFException")}},MR=class extends rg{constructor(t,e){super(t,"UnexpectedResponseException"),this.status=e}},jTi=class extends rg{constructor(t){super(t,"FormatError")}},og=class extends rg{constructor(t){super(t,"AbortException")}};function xxe(t){(typeof t!="object"||t?.length===void 0)&&Mo("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const r=[];for(let o=0;o<e;o+=i){const n=Math.min(o+i,e),s=t.subarray(o,n);r.push(String.fromCharCode.apply(null,s))}return r.join("")}function SR(t){typeof t!="string"&&Mo("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let r=0;r<e;++r)i[r]=t.charCodeAt(r)&255;return i}function GTi(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function XZ(t){const e=Object.create(null);for(const[i,r]of t)e[i]=r;return e}function zTi(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function qTi(){try{return new Function(""),!0}catch{return!1}}class xl{static get isLittleEndian(){return pr(this,"isLittleEndian",zTi())}static get isEvalSupported(){return pr(this,"isEvalSupported",qTi())}static get isOffscreenCanvasSupported(){return pr(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return pr(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get platform(){return typeof navigator<"u"&&typeof navigator?.platform=="string"?pr(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:typeof navigator?.userAgent=="string"&&navigator.userAgent.includes("Firefox")}):pr(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){var e,i;return pr(this,"isCSSRoundSupported",(i=(e=globalThis.CSS)==null?void 0:e.supports)==null?void 0:i.call(e,"width: round(1.5px, 1px)"))}}const $Z=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));var O2,eX,QR,tX;let bi=(eX=class{static makeHexColor(t,e,i){return`#${$Z[t]}${$Z[e]}${$Z[i]}`}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){const i=t[0]*e[0]+t[1]*e[2]+e[4],r=t[0]*e[1]+t[1]*e[3]+e[5];return[i,r]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2],r=(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,o=(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i;return[r,o]}static getAxialAlignedBoundingBox(t,e){const i=this.applyTransform(t,e),r=this.applyTransform(t.slice(2,4),e),o=this.applyTransform([t[0],t[3]],e),n=this.applyTransform([t[2],t[1]],e);return[Math.min(i[0],r[0],o[0],n[0]),Math.min(i[1],r[1],o[1],n[1]),Math.max(i[0],r[0],o[0],n[0]),Math.max(i[1],r[1],o[1],n[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],r=t[0]*e[1]+t[1]*e[3],o=t[2]*e[0]+t[3]*e[2],n=t[2]*e[1]+t[3]*e[3],s=(i+n)/2,a=Math.sqrt((i+n)**2-4*(i*n-o*r))/2,l=s+a||1,c=s-a||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),r=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>r)return null;const o=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),n=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return o>n?null:[i,o,r,n]}static bezierBoundingBox(t,e,i,r,o,n,s,a,l){return l?(l[0]=Math.min(l[0],t,s),l[1]=Math.min(l[1],e,a),l[2]=Math.max(l[2],t,s),l[3]=Math.max(l[3],e,a)):l=[Math.min(t,s),Math.min(e,a),Math.max(t,s),Math.max(e,a)],oe(this,O2,tX).call(this,t,i,o,s,e,r,n,a,3*(-t+3*(i-o)+s),6*(t-2*i+o),3*(i-t),l),oe(this,O2,tX).call(this,t,i,o,s,e,r,n,a,3*(-e+3*(r-n)+a),6*(e-2*r+n),3*(r-e),l),l}},O2=new WeakSet,QR=function(t,e,i,r,o,n,s,a,l,c){if(l<=0||l>=1)return;const d=1-l,u=l*l,h=u*l,A=d*(d*(d*t+3*l*e)+3*u*i)+h*r,g=d*(d*(d*o+3*l*n)+3*u*s)+h*a;c[0]=Math.min(c[0],A),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],A),c[3]=Math.max(c[3],g)},tX=function(t,e,i,r,o,n,s,a,l,c,d,u){if(Math.abs(l)<1e-12){Math.abs(c)>=1e-12&&oe(this,O2,QR).call(this,t,e,i,r,o,n,s,a,-d/c,u);return}const h=c**2-4*d*l;if(h<0)return;const A=Math.sqrt(h),g=2*l;oe(this,O2,QR).call(this,t,e,i,r,o,n,s,a,(-c+A)/g,u),oe(this,O2,QR).call(this,t,e,i,r,o,n,s,a,(-c-A)/g,u)},ce(eX,O2),eX);function KTi(t){return decodeURIComponent(escape(t))}let iX=null,kxe=null;function JTi(t){return iX||(iX=/([\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,kxe=new Map([["\uFB05","\u017Ft"]])),t.replaceAll(iX,(e,i,r)=>i?i.normalize("NFKC"):kxe.get(r))}function YTi(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),xxe(t)}const rX="pdfjs_internal_id_";function WTi(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(xxe(t))}typeof Promise.try!="function"&&(Promise.try=function(t,...e){return new Promise(i=>{i(t(...e))})});const N1="http://www.w3.org/2000/svg",U9=class{};ai(U9,"CSS",96),ai(U9,"PDF",72),ai(U9,"PDF_TO_CSS_UNITS",U9.CSS/U9.PDF);let N9=U9;async function DR(t,e="text"){if(gI(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,r)=>{const o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType=e,o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE){if(o.status===200||o.status===0){switch(e){case"arraybuffer":case"blob":case"json":i(o.response);return}i(o.responseText);return}r(new Error(o.statusText))}},o.send(null)})}class nx{constructor({viewBox:e,userUnit:i,scale:r,rotation:o,offsetX:n=0,offsetY:s=0,dontFlip:a=!1}){this.viewBox=e,this.userUnit=i,this.scale=r,this.rotation=o,this.offsetX=n,this.offsetY=s,r*=i;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let d,u,h,A;switch(o%=360,o<0&&(o+=360),o){case 180:d=-1,u=0,h=0,A=1;break;case 90:d=0,u=1,h=1,A=0;break;case 270:d=0,u=-1,h=-1,A=0;break;case 0:d=1,u=0,h=0,A=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(h=-h,A=-A);let g,p,m,f;d===0?(g=Math.abs(c-e[1])*r+n,p=Math.abs(l-e[0])*r+s,m=(e[3]-e[1])*r,f=(e[2]-e[0])*r):(g=Math.abs(l-e[0])*r+n,p=Math.abs(c-e[1])*r+s,m=(e[2]-e[0])*r,f=(e[3]-e[1])*r),this.transform=[d*r,u*r,h*r,A*r,g-d*r*l-h*r*c,p-u*r*l-A*r*c],this.width=m,this.height=f}get rawDims(){const{userUnit:e,viewBox:i}=this,r=i.map(o=>o*e);return pr(this,"rawDims",{pageWidth:r[2]-r[0],pageHeight:r[3]-r[1],pageX:r[0],pageY:r[1]})}clone({scale:e=this.scale,rotation:i=this.rotation,offsetX:r=this.offsetX,offsetY:o=this.offsetY,dontFlip:n=!1}={}){return new nx({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:i,offsetX:r,offsetY:o,dontFlip:n})}convertToViewportPoint(e,i){return bi.applyTransform([e,i],this.transform)}convertToViewportRectangle(e){const i=bi.applyTransform([e[0],e[1]],this.transform),r=bi.applyTransform([e[2],e[3]],this.transform);return[i[0],i[1],r[0],r[1]]}convertToPdfPoint(e,i){return bi.applyInverseTransform([e,i],this.transform)}}class oX extends rg{constructor(e,i=0){super(e,"RenderingCancelledException"),this.extraDelay=i}}function PR(t){const e=t.length;let i=0;for(;i<e&&t[i].trim()==="";)i++;return t.substring(i,i+5).toLowerCase()==="data:"}function nX(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function ZTi(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function XTi(t,e="document.pdf"){if(typeof t!="string")return e;if(PR(t))return or('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,o=i.exec(t);let n=r.exec(o[1])||r.exec(o[2])||r.exec(o[3]);if(n&&(n=n[0],n.includes("%")))try{n=r.exec(decodeURIComponent(n))[0]}catch{}return n||e}class Mxe{constructor(){ai(this,"started",Object.create(null)),ai(this,"times",[])}time(e){e in this.started&&or(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||or(`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 i=0;for(const{name:r}of this.times)i=Math.max(r.length,i);for(const{name:r,start:o,end:n}of this.times)e.push(`${r.padEnd(i)} ${n-o}ms
|
|
5512
5512
|
`);return e.join("")}}function gI(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return i==="http:"||i==="https:"}catch{return!1}}function ju(t){t.preventDefault()}function Xc(t){t.preventDefault(),t.stopPropagation()}var fI;class sX{static toDateObject(e){if(!e||typeof e!="string")return null;S(this,fI)||ie(this,fI,new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const i=S(this,fI).exec(e);if(!i)return null;const r=parseInt(i[1],10);let o=parseInt(i[2],10);o=o>=1&&o<=12?o-1:0;let n=parseInt(i[3],10);n=n>=1&&n<=31?n:1;let s=parseInt(i[4],10);s=s>=0&&s<=23?s:0;let a=parseInt(i[5],10);a=a>=0&&a<=59?a:0;let l=parseInt(i[6],10);l=l>=0&&l<=59?l:0;const c=i[7]||"Z";let d=parseInt(i[8],10);d=d>=0&&d<=23?d:0;let u=parseInt(i[9],10)||0;return u=u>=0&&u<=59?u:0,c==="-"?(s+=d,a+=u):c==="+"&&(s-=d,a-=u),new Date(Date.UTC(r,o,n,s,a,l))}}fI=new WeakMap,ce(sX,fI);function $Ti(t,{scale:e=1,rotation:i=0}){const{width:r,height:o}=t.attributes.style,n=[0,0,parseInt(r),parseInt(o)];return new nx({viewBox:n,userUnit:1,scale:e,rotation:i})}function aX(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(or(`Not a valid color format: "${t}"`),[0,0,0])}function e_i(t){const e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(const i of t.keys()){e.style.color=i;const r=window.getComputedStyle(e).color;t.set(i,aX(r))}e.remove()}function en(t){const{a:e,b:i,c:r,d:o,e:n,f:s}=t.getTransform();return[e,i,r,o,n,s]}function eA(t){const{a:e,b:i,c:r,d:o,e:n,f:s}=t.getTransform().invertSelf();return[e,i,r,o,n,s]}function H2(t,e,i=!1,r=!0){if(e instanceof nx){const{pageWidth:o,pageHeight:n}=e.rawDims,{style:s}=t,a=xl.isCSSRoundSupported,l=`var(--scale-factor) * ${o}px`,c=`var(--scale-factor) * ${n}px`,d=a?`round(down, ${l}, var(--scale-round-x, 1px))`:`calc(${l})`,u=a?`round(down, ${c}, var(--scale-round-y, 1px))`:`calc(${c})`;!i||e.rotation%180===0?(s.width=d,s.height=u):(s.width=u,s.height=d)}r&&t.setAttribute("data-main-rotation",e.rotation)}class lX{constructor(){const e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}}var V2,O9,tA,H9,RR,mI,cX,Sxe,iA,Qxe,Dxe,FR,Pxe,dX;const LR=class E_{constructor(e){ce(this,iA),ce(this,V2,null),ce(this,O9,null),ce(this,tA),ce(this,H9,null),ce(this,RR,null),ie(this,tA,e),S(E_,mI)||ie(E_,mI,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=ie(this,V2,document.createElement("div"));e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const i=S(this,tA)._uiManager._signal;e.addEventListener("contextmenu",ju,{signal:i}),e.addEventListener("pointerdown",oe(E_,cX,Sxe),{signal:i});const r=ie(this,H9,document.createElement("div"));r.className="buttons",e.append(r);const o=S(this,tA).toolbarPosition;if(o){const{style:n}=e,s=S(this,tA)._uiManager.direction==="ltr"?1-o[0]:o[0];n.insetInlineEnd=`${100*s}%`,n.top=`calc(${100*o[1]}% + var(--editor-toolbar-vert-offset))`}return oe(this,iA,Pxe).call(this),e}get div(){return S(this,V2)}hide(){var e;S(this,V2).classList.add("hidden"),(e=S(this,O9))==null||e.hideDropdown()}show(){var e;S(this,V2).classList.remove("hidden"),(e=S(this,RR))==null||e.shown()}async addAltText(e){const i=await e.render();oe(this,iA,FR).call(this,i),S(this,H9).prepend(i,S(this,iA,dX)),ie(this,RR,e)}addColorPicker(e){ie(this,O9,e);const i=e.renderButton();oe(this,iA,FR).call(this,i),S(this,H9).prepend(i,S(this,iA,dX))}remove(){var e;S(this,V2).remove(),(e=S(this,O9))==null||e.destroy(),ie(this,O9,null)}};V2=new WeakMap,O9=new WeakMap,tA=new WeakMap,H9=new WeakMap,RR=new WeakMap,mI=new WeakMap,cX=new WeakSet,Sxe=function(t){t.stopPropagation()},iA=new WeakSet,Qxe=function(t){S(this,tA)._focusEventsAllowed=!1,Xc(t)},Dxe=function(t){S(this,tA)._focusEventsAllowed=!0,Xc(t)},FR=function(t){const e=S(this,tA)._uiManager._signal;t.addEventListener("focusin",oe(this,iA,Qxe).bind(this),{capture:!0,signal:e}),t.addEventListener("focusout",oe(this,iA,Dxe).bind(this),{capture:!0,signal:e}),t.addEventListener("contextmenu",ju,{signal:e})},Pxe=function(){const{editorType:t,_uiManager:e}=S(this,tA),i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",S(LR,mI)[t]),oe(this,iA,FR).call(this,i),i.addEventListener("click",r=>{e.delete()},{signal:e._signal}),S(this,H9).append(i)},dX=function(){const t=document.createElement("div");return t.className="divider",t},ce(LR,cX),ce(LR,mI,null);let t_i=LR;var TR,j2,V9,vI,Rxe,Fxe,Lxe;class i_i{constructor(e){ce(this,vI),ce(this,TR,null),ce(this,j2,null),ce(this,V9),ie(this,V9,e)}show(e,i,r){const[o,n]=oe(this,vI,Fxe).call(this,i,r),{style:s}=S(this,j2)||ie(this,j2,oe(this,vI,Rxe).call(this));e.append(S(this,j2)),s.insetInlineEnd=`${100*o}%`,s.top=`calc(${100*n}% + var(--editor-toolbar-vert-offset))`}hide(){S(this,j2).remove()}}TR=new WeakMap,j2=new WeakMap,V9=new WeakMap,vI=new WeakSet,Rxe=function(){const t=ie(this,j2,document.createElement("div"));t.className="editToolbar",t.setAttribute("role","toolbar"),t.addEventListener("contextmenu",ju,{signal:S(this,V9)._signal});const e=ie(this,TR,document.createElement("div"));return e.className="buttons",t.append(e),oe(this,vI,Lxe).call(this),t},Fxe=function(t,e){let i=0,r=0;for(const o of t){const n=o.y+o.height;if(n<i)continue;const s=o.x+(e?o.width:0);if(n>i){r=s,i=n;continue}e?s>r&&(r=s):s<r&&(r=s)}return[e?1-r:r,i]},Lxe=function(){const t=document.createElement("button");t.className="highlightButton",t.tabIndex=0,t.setAttribute("data-l10n-id","pdfjs-highlight-floating-button1");const e=document.createElement("span");t.append(e),e.className="visuallyHidden",e.setAttribute("data-l10n-id","pdfjs-highlight-floating-button-label");const i=S(this,V9)._signal;t.addEventListener("contextmenu",ju,{signal:i}),t.addEventListener("click",()=>{S(this,V9).highlightSelection("floating_button")},{signal:i}),S(this,TR).append(t)};function _R(t,e,i){for(const r of i)e.addEventListener(r,t[r].bind(t))}var uX;class r_i{constructor(){ce(this,uX,0)}get id(){return`${TTi}${Ol(this,uX)._++}`}}uX=new WeakMap;var CI,UR,ys,yI,NR;const Txe=class{constructor(){ce(this,yI),ce(this,CI,YTi()),ce(this,UR,0),ce(this,ys,null)}static get _isSVGFittingCanvas(){const e='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>',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),r=new Image;r.src=e;const o=r.decode().then(()=>(i.drawImage(r,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return pr(this,"_isSVGFittingCanvas",o)}async getFromFile(e){const{lastModified:i,name:r,size:o,type:n}=e;return oe(this,yI,NR).call(this,`${i}_${r}_${o}_${n}`,e)}async getFromUrl(e){return oe(this,yI,NR).call(this,e,e)}async getFromBlob(e,i){const r=await i;return oe(this,yI,NR).call(this,e,r)}async getFromId(e){S(this,ys)||ie(this,ys,new Map);const i=S(this,ys).get(e);if(!i)return null;if(i.bitmap)return i.refCounter+=1,i;if(i.file)return this.getFromFile(i.file);if(i.blobPromise){const{blobPromise:r}=i;return delete i.blobPromise,this.getFromBlob(i.id,r)}return this.getFromUrl(i.url)}getFromCanvas(e,i){S(this,ys)||ie(this,ys,new Map);let r=S(this,ys).get(e);if(r!=null&&r.bitmap)return r.refCounter+=1,r;const o=new OffscreenCanvas(i.width,i.height);return o.getContext("2d").drawImage(i,0,0),r={bitmap:o.transferToImageBitmap(),id:`image_${S(this,CI)}_${Ol(this,UR)._++}`,refCounter:1,isSvg:!1},S(this,ys).set(e,r),S(this,ys).set(r.id,r),r}getSvgUrl(e){const i=S(this,ys).get(e);return i!=null&&i.isSvg?i.svgUrl:null}deleteId(e){var i;S(this,ys)||ie(this,ys,new Map);const r=S(this,ys).get(e);if(!r||(r.refCounter-=1,r.refCounter!==0))return;const{bitmap:o}=r;if(!r.url&&!r.file){const n=new OffscreenCanvas(o.width,o.height);n.getContext("bitmaprenderer").transferFromImageBitmap(o),r.blobPromise=n.convertToBlob()}(i=o.close)==null||i.call(o),r.bitmap=null}isValidId(e){return e.startsWith(`image_${S(this,CI)}_`)}};CI=new WeakMap,UR=new WeakMap,ys=new WeakMap,yI=new WeakSet,NR=async function(t,e){S(this,ys)||ie(this,ys,new Map);let i=S(this,ys).get(t);if(i===null)return null;if(i!=null&&i.bitmap)return i.refCounter+=1,i;try{i||(i={bitmap:null,id:`image_${S(this,CI)}_${Ol(this,UR)._++}`,refCounter:0,isSvg:!1});let r;if(typeof e=="string"?(i.url=e,r=await DR(e,"blob")):e instanceof File?r=i.file=e:e instanceof Blob&&(r=e),r.type==="image/svg+xml"){const o=Txe._isSVGFittingCanvas,n=new FileReader,s=new Image,a=new Promise((l,c)=>{s.onload=()=>{i.bitmap=s,i.isSvg=!0,l()},n.onload=async()=>{const d=i.svgUrl=n.result;s.src=await o?`${d}#svgView(preserveAspectRatio(none))`:d},s.onerror=n.onerror=c});n.readAsDataURL(r),await a}else i.bitmap=await createImageBitmap(r);i.refCounter=1}catch(r){or(r),i=null}return S(this,ys).set(t,i),i&&S(this,ys).set(i.id,i),i};let o_i=Txe;var es,G2,OR,tn;class n_i{constructor(e=128){ce(this,es,[]),ce(this,G2,!1),ce(this,OR),ce(this,tn,-1),ie(this,OR,e)}add({cmd:e,undo:i,post:r,mustExec:o,type:n=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}){if(o&&e(),S(this,G2))return;const l={cmd:e,undo:i,post:r,type:n};if(S(this,tn)===-1){S(this,es).length>0&&(S(this,es).length=0),ie(this,tn,0),S(this,es).push(l);return}if(s&&S(this,es)[S(this,tn)].type===n){a&&(l.undo=S(this,es)[S(this,tn)].undo),S(this,es)[S(this,tn)]=l;return}const c=S(this,tn)+1;c===S(this,OR)?S(this,es).splice(0,1):(ie(this,tn,c),c<S(this,es).length&&S(this,es).splice(c)),S(this,es).push(l)}undo(){if(S(this,tn)===-1)return;ie(this,G2,!0);const{undo:e,post:i}=S(this,es)[S(this,tn)];e(),i?.(),ie(this,G2,!1),ie(this,tn,S(this,tn)-1)}redo(){if(S(this,tn)<S(this,es).length-1){ie(this,tn,S(this,tn)+1),ie(this,G2,!0);const{cmd:e,post:i}=S(this,es)[S(this,tn)];e(),i?.(),ie(this,G2,!1)}}hasSomethingToUndo(){return S(this,tn)!==-1}hasSomethingToRedo(){return S(this,tn)<S(this,es).length-1}cleanType(e){if(S(this,tn)!==-1){for(let i=S(this,tn);i>=0;i--)if(S(this,es)[i].type!==e){S(this,es).splice(i+1,S(this,tn)-i),ie(this,tn,i);return}S(this,es).length=0,ie(this,tn,-1)}}destroy(){ie(this,es,null)}}es=new WeakMap,G2=new WeakMap,OR=new WeakMap,tn=new WeakMap;var hX,_xe;class wI{constructor(e){ce(this,hX),this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:i}=xl.platform;for(const[r,o,n={}]of e)for(const s of r){const a=s.startsWith("mac+");i&&a?(this.callbacks.set(s.slice(4),{callback:o,options:n}),this.allKeys.add(s.split("+").at(-1))):!i&&!a&&(this.callbacks.set(s,{callback:o,options:n}),this.allKeys.add(s.split("+").at(-1)))}}exec(e,i){if(!this.allKeys.has(i.key))return;const r=this.callbacks.get(oe(this,hX,_xe).call(this,i));if(!r)return;const{callback:o,options:{bubbles:n=!1,args:s=[],checker:a=null}}=r;a&&!a(e,i)||(o.bind(e,...s,i)(),n||Xc(i))}}hX=new WeakSet,_xe=function(t){t.altKey&&this.buffer.push("alt"),t.ctrlKey&&this.buffer.push("ctrl"),t.metaKey&&this.buffer.push("meta"),t.shiftKey&&this.buffer.push("shift"),this.buffer.push(t.key);const e=this.buffer.join("+");return this.buffer.length=0,e};const Uxe=class HRe{get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return e_i(e),pr(this,"_colors",e)}convert(e){const i=aX(e);if(!window.matchMedia("(forced-colors: active)").matches)return i;for(const[r,o]of this._colors)if(o.every((n,s)=>n===i[s]))return HRe._colorsMapping.get(r);return i}getHexCode(e){const i=this._colors.get(e);return i?bi.makeHexColor(...i):e}};ai(Uxe,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let s_i=Uxe;var bI,Ld,Us,Va,II,ng,j9,Gu,z2,G9,BI,z9,O1,rA,q9,HR,VR,EI,jR,H1,q2,xI,K2,oA,AX,J2,GR,Y2,K9,zR,qR,oa,Bo,sg,J9,kI,KR,W2,V1,ag,JR,zu,Ei,YR,pX,Nxe,Oxe,WR,Hxe,Vxe,jxe,gX,Gxe,fX,mX,zxe,kl,j1,qxe,Kxe,vX,Jxe,MI,CX;const yX=class Nte{constructor(e,i,r,o,n,s,a,l,c,d,u,h,A){ce(this,Ei),ce(this,bI,new AbortController),ce(this,Ld,null),ce(this,Us,new Map),ce(this,Va,new Map),ce(this,II,null),ce(this,ng,null),ce(this,j9,null),ce(this,Gu,new n_i),ce(this,z2,null),ce(this,G9,null),ce(this,BI,0),ce(this,z9,new Set),ce(this,O1,null),ce(this,rA,null),ce(this,q9,new Set),ai(this,"_editorUndoBar",null),ce(this,HR,!1),ce(this,VR,!1),ce(this,EI,!1),ce(this,jR,null),ce(this,H1,null),ce(this,q2,null),ce(this,xI,null),ce(this,K2,!1),ce(this,oA,null),ce(this,AX,new r_i),ce(this,J2,!1),ce(this,GR,!1),ce(this,Y2,null),ce(this,K9,null),ce(this,zR,null),ce(this,qR,null),ce(this,oa,rr.NONE),ce(this,Bo,new Set),ce(this,sg,null),ce(this,J9,null),ce(this,kI,null),ce(this,KR,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1}),ce(this,W2,[0,0]),ce(this,V1,null),ce(this,ag,null),ce(this,JR,null),ce(this,zu,null);const g=this._signal=S(this,bI).signal;ie(this,ag,e),ie(this,JR,i),ie(this,II,r),this._eventBus=o,o._on("editingaction",this.onEditingAction.bind(this),{signal:g}),o._on("pagechanging",this.onPageChanging.bind(this),{signal:g}),o._on("scalechanging",this.onScaleChanging.bind(this),{signal:g}),o._on("rotationchanging",this.onRotationChanging.bind(this),{signal:g}),o._on("setpreference",this.onSetPreference.bind(this),{signal:g}),o._on("switchannotationeditorparams",p=>this.updateParams(p.type,p.value),{signal:g}),oe(this,Ei,Hxe).call(this),oe(this,Ei,zxe).call(this),oe(this,Ei,gX).call(this),ie(this,ng,n.annotationStorage),ie(this,jR,n.filterFactory),ie(this,J9,s),ie(this,xI,a||null),ie(this,HR,l),ie(this,VR,c),ie(this,EI,d),ie(this,qR,u||null),this.viewParameters={realScale:N9.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=h||null,this._supportsPinchToZoom=A!==!1}static get _keyboardManager(){const e=Nte.prototype,i=s=>S(s,ag).contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),r=(s,{target:a})=>{if(a instanceof HTMLInputElement){const{type:l}=a;return l!=="text"&&l!=="number"}return!0},o=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return pr(this,"_keyboardManager",new wI([[["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:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&S(s,ag).contains(a)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&S(s,ag).contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-o,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-n,0],checker:i}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[o,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[n,0],checker:i}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-o],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-n],checker:i}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,o],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,n],checker:i}]]))}destroy(){var e,i,r,o,n;(e=S(this,zu))==null||e.resolve(),ie(this,zu,null),(i=S(this,bI))==null||i.abort(),ie(this,bI,null),this._signal=null;for(const s of S(this,Va).values())s.destroy();S(this,Va).clear(),S(this,Us).clear(),S(this,q9).clear(),ie(this,Ld,null),S(this,Bo).clear(),S(this,Gu).destroy(),(r=S(this,II))==null||r.destroy(),(o=S(this,oA))==null||o.hide(),ie(this,oA,null),S(this,H1)&&(clearTimeout(S(this,H1)),ie(this,H1,null)),S(this,V1)&&(clearTimeout(S(this,V1)),ie(this,V1,null)),(n=this._editorUndoBar)==null||n.destroy()}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return S(this,qR)}get useNewAltTextFlow(){return S(this,VR)}get useNewAltTextWhenAddingImage(){return S(this,EI)}get hcmFilter(){return pr(this,"hcmFilter",S(this,J9)?S(this,jR).addHCMFilter(S(this,J9).foreground,S(this,J9).background):"none")}get direction(){return pr(this,"direction",getComputedStyle(S(this,ag)).direction)}get highlightColors(){return pr(this,"highlightColors",S(this,xI)?new Map(S(this,xI).split(",").map(e=>e.split("=").map(i=>i.trim()))):null)}get highlightColorNames(){return pr(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),ie(this,G9,e)}setMainHighlightColorPicker(e){ie(this,zR,e)}editAltText(e,i=!1){var r;(r=S(this,II))==null||r.editAltText(this,e,i)}switchToMode(e,i){this._eventBus.on("annotationeditormodechanged",i,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,i){this._eventBus.dispatch("setpreference",{source:this,name:e,value:i})}onSetPreference({name:e,value:i}){switch(e){case"enableNewAltTextWhenAddingImage":ie(this,EI,i);break}}onPageChanging({pageNumber:e}){ie(this,BI,e-1)}focusMainContainer(){S(this,ag).focus()}findParent(e,i){for(const r of S(this,Va).values()){const{x:o,y:n,width:s,height:a}=r.div.getBoundingClientRect();if(e>=o&&e<=o+s&&i>=n&&i<=n+a)return r}return null}disableUserSelect(e=!1){S(this,JR).classList.toggle("noUserSelect",e)}addShouldRescale(e){S(this,q9).add(e)}removeShouldRescale(e){S(this,q9).delete(e)}onScaleChanging({scale:e}){var i;this.commitOrRemove(),this.viewParameters.realScale=e*N9.PDF_TO_CSS_UNITS;for(const r of S(this,q9))r.onScaleChanging();(i=S(this,G9))==null||i.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}highlightSelection(e=""){const i=document.getSelection();if(!i||i.isCollapsed)return;const{anchorNode:r,anchorOffset:o,focusNode:n,focusOffset:s}=i,a=i.toString(),l=oe(this,Ei,YR).call(this,i).closest(".textLayer"),c=this.getSelectionBoxes(l);if(!c)return;i.empty();const d=oe(this,Ei,pX).call(this,l),u=S(this,oa)===rr.NONE,h=()=>{d?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:c,anchorNode:r,anchorOffset:o,focusNode:n,focusOffset:s,text:a}),u&&this.showAllEditors("highlight",!0,!0)};if(u){this.switchToMode(rr.HIGHLIGHT,h);return}h()}addToAnnotationStorage(e){!e.isEmpty()&&S(this,ng)&&!S(this,ng).has(e.id)&&S(this,ng).setValue(e.id,e)}blur(){if(this.isShiftKeyDown=!1,S(this,K2)&&(ie(this,K2,!1),oe(this,Ei,WR).call(this,"main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const i of S(this,Bo))if(i.div.contains(e)){ie(this,K9,[i,e]),i._focusEventsAllowed=!1;break}}focus(){if(!S(this,K9))return;const[e,i]=S(this,K9);ie(this,K9,null),i.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),i.focus()}addEditListeners(){oe(this,Ei,gX).call(this),oe(this,Ei,fX).call(this)}removeEditListeners(){oe(this,Ei,Gxe).call(this),oe(this,Ei,mX).call(this)}dragOver(e){for(const{type:i}of e.dataTransfer.items)for(const r of S(this,rA))if(r.isHandlingMimeForPasting(i)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const i of e.dataTransfer.items)for(const r of S(this,rA))if(r.isHandlingMimeForPasting(i.type)){r.paste(i,this.currentLayer),e.preventDefault();return}}copy(e){var i;if(e.preventDefault(),(i=S(this,Ld))==null||i.commitOrRemove(),!this.hasSelection)return;const r=[];for(const o of S(this,Bo)){const n=o.serialize(!0);n&&r.push(n)}r.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(r))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:i}=e;for(const n of i.items)for(const s of S(this,rA))if(s.isHandlingMimeForPasting(n.type)){s.paste(n,this.currentLayer);return}let r=i.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(n){or(`paste: "${n.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const o=this.currentLayer;try{const n=[];for(const l of r){const c=await o.deserialize(l);if(!c)return;n.push(c)}const s=()=>{for(const l of n)oe(this,Ei,vX).call(this,l);oe(this,Ei,CX).call(this,n)},a=()=>{for(const l of n)l.remove()};this.addCommands({cmd:s,undo:a,mustExec:!0})}catch(n){or(`paste: "${n.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),S(this,oa)!==rr.NONE&&!this.isEditorHandlingKeyboard&&Nte._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,S(this,K2)&&(ie(this,K2,!1),oe(this,Ei,WR).call(this,"main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}setEditingState(e){e?(oe(this,Ei,Vxe).call(this),oe(this,Ei,fX).call(this),oe(this,Ei,kl).call(this,{isEditing:S(this,oa)!==rr.NONE,isEmpty:oe(this,Ei,MI).call(this),hasSomethingToUndo:S(this,Gu).hasSomethingToUndo(),hasSomethingToRedo:S(this,Gu).hasSomethingToRedo(),hasSelectedEditor:!1})):(oe(this,Ei,jxe).call(this),oe(this,Ei,mX).call(this),oe(this,Ei,kl).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!S(this,rA)){ie(this,rA,e);for(const i of S(this,rA))oe(this,Ei,j1).call(this,i.defaultPropertiesToUpdate)}}getId(){return S(this,AX).id}get currentLayer(){return S(this,Va).get(S(this,BI))}getLayer(e){return S(this,Va).get(e)}get currentPageIndex(){return S(this,BI)}addLayer(e){S(this,Va).set(e.pageIndex,e),S(this,J2)?e.enable():e.disable()}removeLayer(e){S(this,Va).delete(e.pageIndex)}async updateMode(e,i=null,r=!1){var o;if(S(this,oa)!==e&&!(S(this,zu)&&(await S(this,zu).promise,!S(this,zu)))){if(ie(this,zu,Promise.withResolvers()),ie(this,oa,e),e===rr.NONE){this.setEditingState(!1),oe(this,Ei,Kxe).call(this),(o=this._editorUndoBar)==null||o.hide(),S(this,zu).resolve();return}this.setEditingState(!0),await oe(this,Ei,qxe).call(this),this.unselectAll();for(const n of S(this,Va).values())n.updateMode(e);if(!i){r&&this.addNewEditorFromKeyboard(),S(this,zu).resolve();return}for(const n of S(this,Us).values())n.annotationElementId===i?(this.setSelected(n),n.enterInEditMode()):n.unselect();S(this,zu).resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e!==S(this,oa)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:e})}updateParams(e,i){var r;if(S(this,rA)){switch(e){case Qr.CREATE:this.currentLayer.addNewEditor();return;case Qr.HIGHLIGHT_DEFAULT_COLOR:(r=S(this,zR))==null||r.updateColor(i);break;case Qr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(S(this,kI)||ie(this,kI,new Map)).set(e,i),this.showAllEditors("highlight",i);break}for(const o of S(this,Bo))o.updateParams(e,i);for(const o of S(this,rA))o.updateDefaultParams(e,i)}}showAllEditors(e,i,r=!1){var o;for(const n of S(this,Us).values())n.editorType===e&&n.show(i);(((o=S(this,kI))==null?void 0:o.get(Qr.HIGHLIGHT_SHOW_ALL))??!0)!==i&&oe(this,Ei,j1).call(this,[[Qr.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(e=!1){if(S(this,GR)!==e){ie(this,GR,e);for(const i of S(this,Va).values())e?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",e)}}getEditors(e){const i=[];for(const r of S(this,Us).values())r.pageIndex===e&&i.push(r);return i}getEditor(e){return S(this,Us).get(e)}addEditor(e){S(this,Us).set(e.id,e)}removeEditor(e){var i;e.div.contains(document.activeElement)&&(S(this,H1)&&clearTimeout(S(this,H1)),ie(this,H1,setTimeout(()=>{this.focusMainContainer(),ie(this,H1,null)},0))),S(this,Us).delete(e.id),this.unselect(e),(!e.annotationElementId||!S(this,z9).has(e.annotationElementId))&&((i=S(this,ng))==null||i.remove(e.id))}addDeletedAnnotationElement(e){S(this,z9).add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return S(this,z9).has(e)}removeDeletedAnnotationElement(e){S(this,z9).delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}setActiveEditor(e){S(this,Ld)!==e&&(ie(this,Ld,e),e&&oe(this,Ei,j1).call(this,e.propertiesToUpdate))}updateUI(e){S(this,Ei,Jxe)===e&&oe(this,Ei,j1).call(this,e.propertiesToUpdate)}updateUIForDefaultProperties(e){oe(this,Ei,j1).call(this,e.defaultPropertiesToUpdate)}toggleSelected(e){if(S(this,Bo).has(e)){S(this,Bo).delete(e),e.unselect(),oe(this,Ei,kl).call(this,{hasSelectedEditor:this.hasSelection});return}S(this,Bo).add(e),e.select(),oe(this,Ei,j1).call(this,e.propertiesToUpdate),oe(this,Ei,kl).call(this,{hasSelectedEditor:!0})}setSelected(e){var i;(i=S(this,G9))==null||i.commitOrRemove();for(const r of S(this,Bo))r!==e&&r.unselect();S(this,Bo).clear(),S(this,Bo).add(e),e.select(),oe(this,Ei,j1).call(this,e.propertiesToUpdate),oe(this,Ei,kl).call(this,{hasSelectedEditor:!0})}isSelected(e){return S(this,Bo).has(e)}get firstSelectedEditor(){return S(this,Bo).values().next().value}unselect(e){e.unselect(),S(this,Bo).delete(e),oe(this,Ei,kl).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return S(this,Bo).size!==0}get isEnterHandled(){return S(this,Bo).size===1&&this.firstSelectedEditor.isEnterHandled}undo(){var e;S(this,Gu).undo(),oe(this,Ei,kl).call(this,{hasSomethingToUndo:S(this,Gu).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:oe(this,Ei,MI).call(this)}),(e=this._editorUndoBar)==null||e.hide()}redo(){S(this,Gu).redo(),oe(this,Ei,kl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:S(this,Gu).hasSomethingToRedo(),isEmpty:oe(this,Ei,MI).call(this)})}addCommands(e){S(this,Gu).add(e),oe(this,Ei,kl).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:oe(this,Ei,MI).call(this)})}cleanUndoStack(e){S(this,Gu).cleanType(e)}delete(){var e;this.commitOrRemove();const i=(e=this.currentLayer)==null?void 0:e.endDrawingSession(!0);if(!this.hasSelection&&!i)return;const r=i?[i]:[...S(this,Bo)],o=()=>{var s;(s=this._editorUndoBar)==null||s.show(n,r.length===1?r[0].editorType:r.length);for(const a of r)a.remove()},n=()=>{for(const s of r)oe(this,Ei,vX).call(this,s)};this.addCommands({cmd:o,undo:n,mustExec:!0})}commitOrRemove(){var e;(e=S(this,Ld))==null||e.commitOrRemove()}hasSomethingToControl(){return S(this,Ld)||this.hasSelection}selectAll(){for(const e of S(this,Bo))e.commit();oe(this,Ei,CX).call(this,S(this,Us).values())}unselectAll(){var e;if(!(S(this,Ld)&&(S(this,Ld).commitOrRemove(),S(this,oa)!==rr.NONE))&&!((e=S(this,G9))!=null&&e.commitOrRemove())&&this.hasSelection){for(const i of S(this,Bo))i.unselect();S(this,Bo).clear(),oe(this,Ei,kl).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(e,i,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;S(this,W2)[0]+=e,S(this,W2)[1]+=i;const[o,n]=S(this,W2),s=[...S(this,Bo)];S(this,V1)&&clearTimeout(S(this,V1)),ie(this,V1,setTimeout(()=>{ie(this,V1,null),S(this,W2)[0]=S(this,W2)[1]=0,this.addCommands({cmd:()=>{for(const l of s)S(this,Us).has(l.id)&&l.translateInPage(o,n)},undo:()=>{for(const l of s)S(this,Us).has(l.id)&&l.translateInPage(-o,-n)},mustExec:!1})},1e3));for(const l of s)l.translateInPage(e,i)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),ie(this,O1,new Map);for(const e of S(this,Bo))S(this,O1).set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!S(this,O1))return!1;this.disableUserSelect(!1);const e=S(this,O1);ie(this,O1,null);let i=!1;for(const[{x:o,y:n,pageIndex:s},a]of e)a.newX=o,a.newY=n,a.newPageIndex=s,i||(i=o!==a.savedX||n!==a.savedY||s!==a.savedPageIndex);if(!i)return!1;const r=(o,n,s,a)=>{if(S(this,Us).has(o.id)){const l=S(this,Va).get(a);l?o._setParentAndPosition(l,n,s):(o.pageIndex=a,o.x=n,o.y=s)}};return this.addCommands({cmd:()=>{for(const[o,{newX:n,newY:s,newPageIndex:a}]of e)r(o,n,s,a)},undo:()=>{for(const[o,{savedX:n,savedY:s,savedPageIndex:a}]of e)r(o,n,s,a)},mustExec:!0}),!0}dragSelectedEditors(e,i){if(S(this,O1))for(const r of S(this,O1).keys())r.drag(e,i)}rebuild(e){if(e.parent===null){const i=this.getLayer(e.pageIndex);i?(i.changeParent(e),i.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){var e;return((e=this.getActive())==null?void 0:e.shouldGetKeyboardEvents())||S(this,Bo).size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return S(this,Ld)===e}getActive(){return S(this,Ld)}getMode(){return S(this,oa)}get imageManager(){return pr(this,"imageManager",new o_i)}getSelectionBoxes(e){if(!e)return null;const i=document.getSelection();for(let c=0,d=i.rangeCount;c<d;c++)if(!e.contains(i.getRangeAt(c).commonAncestorContainer))return null;const{x:r,y:o,width:n,height:s}=e.getBoundingClientRect();let a;switch(e.getAttribute("data-main-rotation")){case"90":a=(c,d,u,h)=>({x:(d-o)/s,y:1-(c+u-r)/n,width:h/s,height:u/n});break;case"180":a=(c,d,u,h)=>({x:1-(c+u-r)/n,y:1-(d+h-o)/s,width:u/n,height:h/s});break;case"270":a=(c,d,u,h)=>({x:1-(d+h-o)/s,y:(c-r)/n,width:h/s,height:u/n});break;default:a=(c,d,u,h)=>({x:(c-r)/n,y:(d-o)/s,width:u/n,height:h/s});break}const l=[];for(let c=0,d=i.rangeCount;c<d;c++){const u=i.getRangeAt(c);if(!u.collapsed)for(const{x:h,y:A,width:g,height:p}of u.getClientRects())g===0||p===0||l.push(a(h,A,g,p))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:i}){(S(this,j9)||ie(this,j9,new Map)).set(e,i)}removeChangedExistingAnnotation({annotationElementId:e}){var i;(i=S(this,j9))==null||i.delete(e)}renderAnnotationElement(e){var i;const r=(i=S(this,j9))==null?void 0:i.get(e.data.id);if(!r)return;const o=S(this,ng).getRawValue(r);o&&(S(this,oa)===rr.NONE&&!o.hasBeenModified||o.renderAnnotationElement(e))}};bI=new WeakMap,Ld=new WeakMap,Us=new WeakMap,Va=new WeakMap,II=new WeakMap,ng=new WeakMap,j9=new WeakMap,Gu=new WeakMap,z2=new WeakMap,G9=new WeakMap,BI=new WeakMap,z9=new WeakMap,O1=new WeakMap,rA=new WeakMap,q9=new WeakMap,HR=new WeakMap,VR=new WeakMap,EI=new WeakMap,jR=new WeakMap,H1=new WeakMap,q2=new WeakMap,xI=new WeakMap,K2=new WeakMap,oA=new WeakMap,AX=new WeakMap,J2=new WeakMap,GR=new WeakMap,Y2=new WeakMap,K9=new WeakMap,zR=new WeakMap,qR=new WeakMap,oa=new WeakMap,Bo=new WeakMap,sg=new WeakMap,J9=new WeakMap,kI=new WeakMap,KR=new WeakMap,W2=new WeakMap,V1=new WeakMap,ag=new WeakMap,JR=new WeakMap,zu=new WeakMap,Ei=new WeakSet,YR=function({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t},pX=function(t){const{currentLayer:e}=this;if(e.hasTextLayer(t))return e;for(const i of S(this,Va).values())if(i.hasTextLayer(t))return i;return null},Nxe=function(){const t=document.getSelection();if(!t||t.isCollapsed)return;const e=oe(this,Ei,YR).call(this,t).closest(".textLayer"),i=this.getSelectionBoxes(e);i&&(S(this,oA)||ie(this,oA,new i_i(this)),S(this,oA).show(e,i,this.direction==="ltr"))},Oxe=function(){var t,e,i;const r=document.getSelection();if(!r||r.isCollapsed){S(this,sg)&&((t=S(this,oA))==null||t.hide(),ie(this,sg,null),oe(this,Ei,kl).call(this,{hasSelectedText:!1}));return}const{anchorNode:o}=r;if(o===S(this,sg))return;const n=oe(this,Ei,YR).call(this,r).closest(".textLayer");if(!n){S(this,sg)&&((e=S(this,oA))==null||e.hide(),ie(this,sg,null),oe(this,Ei,kl).call(this,{hasSelectedText:!1}));return}if((i=S(this,oA))==null||i.hide(),ie(this,sg,o),oe(this,Ei,kl).call(this,{hasSelectedText:!0}),!(S(this,oa)!==rr.HIGHLIGHT&&S(this,oa)!==rr.NONE)&&(S(this,oa)===rr.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),ie(this,K2,this.isShiftKeyDown),!this.isShiftKeyDown)){const s=S(this,oa)===rr.HIGHLIGHT?oe(this,Ei,pX).call(this,n):null;s?.toggleDrawing();const a=new AbortController,l=this.combinedSignal(a),c=d=>{d.type==="pointerup"&&d.button!==0||(a.abort(),s?.toggleDrawing(!0),d.type==="pointerup"&&oe(this,Ei,WR).call(this,"main_toolbar"))};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}},WR=function(t=""){S(this,oa)===rr.HIGHLIGHT?this.highlightSelection(t):S(this,HR)&&oe(this,Ei,Nxe).call(this)},Hxe=function(){document.addEventListener("selectionchange",oe(this,Ei,Oxe).bind(this),{signal:this._signal})},Vxe=function(){if(S(this,q2))return;ie(this,q2,new AbortController);const t=this.combinedSignal(S(this,q2));window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})},jxe=function(){var t;(t=S(this,q2))==null||t.abort(),ie(this,q2,null)},gX=function(){if(S(this,Y2))return;ie(this,Y2,new AbortController);const t=this.combinedSignal(S(this,Y2));window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})},Gxe=function(){var t;(t=S(this,Y2))==null||t.abort(),ie(this,Y2,null)},fX=function(){if(S(this,z2))return;ie(this,z2,new AbortController);const t=this.combinedSignal(S(this,z2));document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})},mX=function(){var t;(t=S(this,z2))==null||t.abort(),ie(this,z2,null)},zxe=function(){const t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})},kl=function(t){Object.entries(t).some(([e,i])=>S(this,KR)[e]!==i)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(S(this,KR),t)}),S(this,oa)===rr.HIGHLIGHT&&t.hasSelectedEditor===!1&&oe(this,Ei,j1).call(this,[[Qr.HIGHLIGHT_FREE,!0]]))},j1=function(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})},qxe=async function(){if(!S(this,J2)){ie(this,J2,!0);const t=[];for(const e of S(this,Va).values())t.push(e.enable());await Promise.all(t);for(const e of S(this,Us).values())e.enable()}},Kxe=function(){if(this.unselectAll(),S(this,J2)){ie(this,J2,!1);for(const t of S(this,Va).values())t.disable();for(const t of S(this,Us).values())t.disable()}},vX=function(t){const e=S(this,Va).get(t.pageIndex);e?e.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))},Jxe=function(){let t=null;for(t of S(this,Bo));return t},MI=function(){if(S(this,Us).size===0)return!0;if(S(this,Us).size===1)for(const t of S(this,Us).values())return t.isEmpty();return!1},CX=function(t){for(const e of S(this,Bo))e.unselect();S(this,Bo).clear();for(const e of t)e.isEmpty()||(S(this,Bo).add(e),e.select());oe(this,Ei,kl).call(this,{hasSelectedEditor:this.hasSelection})},ai(yX,"TRANSLATE_SMALL",1),ai(yX,"TRANSLATE_BIG",10);let SI=yX;var na,G1,nA,QI,z1,Td,DI,q1,$c,lg,Y9,K1,cg,J1,PI,ZR;const RI=class cf{constructor(e){ce(this,J1),ce(this,na,null),ce(this,G1,!1),ce(this,nA,null),ce(this,QI,null),ce(this,z1,null),ce(this,Td,null),ce(this,DI,!1),ce(this,q1,null),ce(this,$c,null),ce(this,lg,null),ce(this,Y9,null),ce(this,K1,!1),ie(this,$c,e),ie(this,K1,e._uiManager.useNewAltTextFlow),S(cf,cg)||ie(cf,cg,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){cf._l10n??(cf._l10n=e)}async render(){const e=ie(this,nA,document.createElement("button"));e.className="altText",e.tabIndex="0";const i=ie(this,QI,document.createElement("span"));e.append(i),S(this,K1)?(e.classList.add("new"),e.setAttribute("data-l10n-id",S(cf,cg).missing),i.setAttribute("data-l10n-id",S(cf,cg)["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=S(this,$c)._uiManager._signal;e.addEventListener("contextmenu",ju,{signal:r}),e.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:r});const o=n=>{n.preventDefault(),S(this,$c)._uiManager.editAltText(S(this,$c)),S(this,K1)&&S(this,$c)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:S(this,J1,PI)}})};return e.addEventListener("click",o,{capture:!0,signal:r}),e.addEventListener("keydown",n=>{n.target===e&&n.key==="Enter"&&(ie(this,DI,!0),o(n))},{signal:r}),await oe(this,J1,ZR).call(this),e}finish(){S(this,nA)&&(S(this,nA).focus({focusVisible:S(this,DI)}),ie(this,DI,!1))}isEmpty(){return S(this,K1)?S(this,na)===null:!S(this,na)&&!S(this,G1)}hasData(){return S(this,K1)?S(this,na)!==null||!!S(this,lg):this.isEmpty()}get guessedText(){return S(this,lg)}async setGuessedText(e){S(this,na)===null&&(ie(this,lg,e),ie(this,Y9,await cf._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e})),oe(this,J1,ZR).call(this))}toggleAltTextBadge(e=!1){var i;if(!S(this,K1)||S(this,na)){(i=S(this,q1))==null||i.remove(),ie(this,q1,null);return}if(!S(this,q1)){const r=ie(this,q1,document.createElement("div"));r.className="noAltTextBadge",S(this,$c).div.append(r)}S(this,q1).classList.toggle("hidden",!e)}serialize(e){let i=S(this,na);return!e&&S(this,lg)===i&&(i=S(this,Y9)),{altText:i,decorative:S(this,G1),guessedText:S(this,lg),textWithDisclaimer:S(this,Y9)}}get data(){return{altText:S(this,na),decorative:S(this,G1)}}set data({altText:e,decorative:i,guessedText:r,textWithDisclaimer:o,cancel:n=!1}){r&&(ie(this,lg,r),ie(this,Y9,o)),!(S(this,na)===e&&S(this,G1)===i)&&(n||(ie(this,na,e),ie(this,G1,i)),oe(this,J1,ZR).call(this))}toggle(e=!1){S(this,nA)&&(!e&&S(this,Td)&&(clearTimeout(S(this,Td)),ie(this,Td,null)),S(this,nA).disabled=!e)}shown(){S(this,$c)._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:S(this,J1,PI)}})}destroy(){var e,i;(e=S(this,nA))==null||e.remove(),ie(this,nA,null),ie(this,QI,null),ie(this,z1,null),(i=S(this,q1))==null||i.remove(),ie(this,q1,null)}};na=new WeakMap,G1=new WeakMap,nA=new WeakMap,QI=new WeakMap,z1=new WeakMap,Td=new WeakMap,DI=new WeakMap,q1=new WeakMap,$c=new WeakMap,lg=new WeakMap,Y9=new WeakMap,K1=new WeakMap,cg=new WeakMap,J1=new WeakSet,PI=function(){return S(this,na)&&"added"||S(this,na)===null&&this.guessedText&&"review"||"missing"},ZR=async function(){var t,e,i;const r=S(this,nA);if(!r)return;if(S(this,K1)){if(r.classList.toggle("done",!!S(this,na)),r.setAttribute("data-l10n-id",S(RI,cg)[S(this,J1,PI)]),(t=S(this,QI))==null||t.setAttribute("data-l10n-id",S(RI,cg)[`${S(this,J1,PI)}-label`]),!S(this,na)){(e=S(this,z1))==null||e.remove();return}}else{if(!S(this,na)&&!S(this,G1)){r.classList.remove("done"),(i=S(this,z1))==null||i.remove();return}r.classList.add("done"),r.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let o=S(this,z1);if(!o){ie(this,z1,o=document.createElement("span")),o.className="tooltip",o.setAttribute("role","tooltip"),o.id=`alt-text-tooltip-${S(this,$c).id}`;const s=100,a=S(this,$c)._uiManager._signal;a.addEventListener("abort",()=>{clearTimeout(S(this,Td)),ie(this,Td,null)},{once:!0}),r.addEventListener("mouseenter",()=>{ie(this,Td,setTimeout(()=>{ie(this,Td,null),S(this,z1).classList.add("show"),S(this,$c)._reportTelemetry({action:"alt_text_tooltip"})},s))},{signal:a}),r.addEventListener("mouseleave",()=>{var l;S(this,Td)&&(clearTimeout(S(this,Td)),ie(this,Td,null)),(l=S(this,z1))==null||l.classList.remove("show")},{signal:a})}S(this,G1)?o.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(o.removeAttribute("data-l10n-id"),o.textContent=S(this,na)),o.parentNode||r.append(o);const n=S(this,$c).getImageForAltText();n?.setAttribute("aria-describedby",o.id)},ce(RI,cg,null),ai(RI,"_l10n",null);let Yxe=RI;var XR,W9,$R,eF,tF,iF,rF,FI,dg,Z9,Z2,X9,Wxe,Zxe,wX;const Xxe=class{constructor({container:e,isPinchingDisabled:i=null,isPinchingStopped:r=null,onPinchStart:o=null,onPinching:n=null,onPinchEnd:s=null,signal:a}){ce(this,X9),ce(this,XR),ce(this,W9,!1),ce(this,$R,null),ce(this,eF),ce(this,tF),ce(this,iF),ce(this,rF),ce(this,FI),ce(this,dg,null),ce(this,Z9),ce(this,Z2,null),ie(this,XR,e),ie(this,$R,r),ie(this,eF,i),ie(this,tF,o),ie(this,iF,n),ie(this,rF,s),ie(this,Z9,new AbortController),ie(this,FI,AbortSignal.any([a,S(this,Z9).signal])),e.addEventListener("touchstart",oe(this,X9,Wxe).bind(this),{passive:!1,signal:S(this,FI)})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return pr(this,"MIN_TOUCH_DISTANCE_TO_PINCH",35/(window.devicePixelRatio||1))}destroy(){var e;(e=S(this,Z9))==null||e.abort(),ie(this,Z9,null)}};XR=new WeakMap,W9=new WeakMap,$R=new WeakMap,eF=new WeakMap,tF=new WeakMap,iF=new WeakMap,rF=new WeakMap,FI=new WeakMap,dg=new WeakMap,Z9=new WeakMap,Z2=new WeakMap,X9=new WeakSet,Wxe=function(t){var e,i,r;if((e=S(this,eF))!=null&&e.call(this)||t.touches.length<2)return;if(!S(this,Z2)){ie(this,Z2,new AbortController);const s=AbortSignal.any([S(this,FI),S(this,Z2).signal]),a=S(this,XR),l={signal:s,passive:!1};a.addEventListener("touchmove",oe(this,X9,Zxe).bind(this),l),a.addEventListener("touchend",oe(this,X9,wX).bind(this),l),a.addEventListener("touchcancel",oe(this,X9,wX).bind(this),l),(i=S(this,tF))==null||i.call(this)}if(Xc(t),t.touches.length!==2||(r=S(this,$R))!=null&&r.call(this)){ie(this,dg,null);return}let[o,n]=t.touches;o.identifier>n.identifier&&([o,n]=[n,o]),ie(this,dg,{touch0X:o.screenX,touch0Y:o.screenY,touch1X:n.screenX,touch1Y:n.screenY})},Zxe=function(t){var e;if(!S(this,dg)||t.touches.length!==2)return;let[i,r]=t.touches;i.identifier>r.identifier&&([i,r]=[r,i]);const{screenX:o,screenY:n}=i,{screenX:s,screenY:a}=r,l=S(this,dg),{touch0X:c,touch0Y:d,touch1X:u,touch1Y:h}=l,A=u-c,g=h-d,p=s-o,m=a-n,f=Math.hypot(p,m)||1,v=Math.hypot(A,g)||1;if(!S(this,W9)&&Math.abs(v-f)<=Xxe.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=o,l.touch0Y=n,l.touch1X=s,l.touch1Y=a,t.preventDefault(),!S(this,W9)){ie(this,W9,!0);return}const y=[(o+s)/2,(n+a)/2];(e=S(this,iF))==null||e.call(this,y,v,f)},wX=function(t){var e;S(this,Z2).abort(),ie(this,Z2,null),(e=S(this,rF))==null||e.call(this),S(this,dg)&&(t.preventDefault(),ie(this,dg,null),ie(this,W9,!1))};let $xe=Xxe;var $9,sA,rn,LI,X2,oF,e6,ja,t6,ug,$2,nF,i6,Ga,sF,r6,hg,Y1,TI,_I,_d,em,aF,bX,jr,IX,lF,BX,cF,eke,tke,EX,dF,xX,ike,rke,oke,kX,nke,MX,ske,ake,lke,SX,UI;const Vn=class Ca{constructor(e){ce(this,jr),ce(this,$9,null),ce(this,sA,null),ce(this,rn,null),ce(this,LI,!1),ce(this,X2,null),ce(this,oF,""),ce(this,e6,!1),ce(this,ja,null),ce(this,t6,null),ce(this,ug,null),ce(this,$2,null),ce(this,nF,""),ce(this,i6,!1),ce(this,Ga,null),ce(this,sF,!1),ce(this,r6,!1),ce(this,hg,!1),ce(this,Y1,null),ce(this,TI,0),ce(this,_I,0),ce(this,_d,null),ce(this,em,null),ai(this,"_editToolbar",null),ai(this,"_initialOptions",Object.create(null)),ai(this,"_initialData",null),ai(this,"_isVisible",!0),ai(this,"_uiManager",null),ai(this,"_focusEventsAllowed",!0),ce(this,aF,!1),ce(this,bX,Ca._zIndex++),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:i,rawDims:{pageWidth:r,pageHeight:o,pageX:n,pageY:s}}=this.parent.viewport;this.rotation=i,this.pageRotation=(360+i-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,o],this.pageTranslation=[n,s];const[a,l]=this.parentDimensions;this.x=e.x/a,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}static get _resizerKeyboardManager(){const e=Ca.prototype._resizeWithKeyboard,i=SI.TRANSLATE_SMALL,r=SI.TRANSLATE_BIG;return pr(this,"_resizerKeyboardManager",new wI([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-i,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[i,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-i]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,i]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],Ca.prototype._stopResizingWithKeyboard]]))}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get isDrawer(){return!1}static get _defaultLineColor(){return pr(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const i=new a_i({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});i.annotationElementId=e.annotationElementId,i.deleted=!0,i._uiManager.addToAnnotationStorage(i)}static initialize(e,i){if(Ca._l10n??(Ca._l10n=e),Ca._l10nResizer||(Ca._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"})),Ca._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);Ca._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,i){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,i){Mo("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return S(this,aF)}set _isDraggable(e){var i;ie(this,aF,e),(i=this.div)==null||i.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){const[e,i]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*i/(e*2),this.y+=this.width*e/(i*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*i/(e*2),this.y-=this.width*e/(i*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}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=S(this,bX)}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):oe(this,jr,UI).call(this),this.parent=e}focusin(e){this._focusEventsAllowed&&(S(this,i6)?ie(this,i6,!1):this.parent.setSelected(this))}focusout(e){var i;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const r=e.relatedTarget;r!=null&&r.closest(`#${this.id}`)||(e.preventDefault(),(i=this.parent)!=null&&i.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,i,r,o){const[n,s]=this.parentDimensions;[r,o]=this.screenToPageTranslation(r,o),this.x=(e+r)/n,this.y=(i+o)/s,this.fixAndSetPosition()}translate(e,i){oe(this,jr,IX).call(this,this.parentDimensions,e,i)}translateInPage(e,i){S(this,Ga)||ie(this,Ga,[this.x,this.y,this.width,this.height]),oe(this,jr,IX).call(this,this.pageDimensions,e,i),this.div.scrollIntoView({block:"nearest"})}drag(e,i){S(this,Ga)||ie(this,Ga,[this.x,this.y,this.width,this.height]);const{div:r,parentDimensions:[o,n]}=this;if(this.x+=e/o,this.y+=i/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,h)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:a}=this;const[l,c]=this.getBaseTranslation();s+=l,a+=c;const{style:d}=r;d.left=`${(100*s).toFixed(2)}%`,d.top=`${(100*a).toFixed(2)}%`,this._onTranslating(s,a),r.scrollIntoView({block:"nearest"})}_onTranslating(e,i){}_onTranslated(e,i){}get _hasBeenMoved(){return!!S(this,Ga)&&(S(this,Ga)[0]!==this.x||S(this,Ga)[1]!==this.y)}get _hasBeenResized(){return!!S(this,Ga)&&(S(this,Ga)[2]!==this.width||S(this,Ga)[3]!==this.height)}getBaseTranslation(){const[e,i]=this.parentDimensions,{_borderLineWidth:r}=Ca,o=r/e,n=r/i;switch(this.rotation){case 90:return[-o,n];case 180:return[o,n];case 270:return[o,-n];default:return[-o,-n]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:i},pageDimensions:[r,o]}=this;let{x:n,y:s,width:a,height:l}=this;if(a*=r,l*=o,n*=r,s*=o,this._mustFixPosition)switch(e){case 0:n=Math.max(0,Math.min(r-a,n)),s=Math.max(0,Math.min(o-l,s));break;case 90:n=Math.max(0,Math.min(r-l,n)),s=Math.min(o,Math.max(a,s));break;case 180:n=Math.min(r,Math.max(a,n)),s=Math.min(o,Math.max(l,s));break;case 270:n=Math.min(r,Math.max(l,n)),s=Math.max(0,Math.min(o-a,s));break}this.x=n/=r,this.y=s/=o;const[c,d]=this.getBaseTranslation();n+=c,s+=d,i.left=`${(100*n).toFixed(2)}%`,i.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(e,i){var r;return oe(r=Ca,lF,BX).call(r,e,i,this.parentRotation)}pageTranslationToScreen(e,i){var r;return oe(r=Ca,lF,BX).call(r,e,i,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[i,r]}=this;return[i*e,r*e]}setDims(e,i){const[r,o]=this.parentDimensions,{style:n}=this.div;n.width=`${(100*e/r).toFixed(2)}%`,S(this,e6)||(n.height=`${(100*i/o).toFixed(2)}%`)}fixDims(){const{style:e}=this.div,{height:i,width:r}=e,o=r.endsWith("%"),n=!S(this,e6)&&i.endsWith("%");if(o&&n)return;const[s,a]=this.parentDimensions;o||(e.width=`${(100*parseFloat(r)/s).toFixed(2)}%`),!S(this,e6)&&!n&&(e.height=`${(100*parseFloat(i)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}_onResized(){}static _round(e){return Math.round(e*1e4)/1e4}_onResizing(){}altTextFinish(){var e;(e=S(this,rn))==null||e.finish()}async addEditToolbar(){return this._editToolbar||S(this,r6)?this._editToolbar:(this._editToolbar=new t_i(this),this.div.append(this._editToolbar.render()),S(this,rn)&&await this._editToolbar.addAltText(S(this,rn)),this._editToolbar)}removeEditToolbar(){var e;this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,(e=S(this,rn))==null||e.destroy())}addContainer(e){var i;const r=(i=this._editToolbar)==null?void 0:i.div;r?r.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}async addAltTextButton(){S(this,rn)||(Yxe.initialize(Ca._l10n),ie(this,rn,new Yxe(this)),S(this,$9)&&(S(this,rn).data=S(this,$9),ie(this,$9,null)),await this.addEditToolbar())}get altTextData(){var e;return(e=S(this,rn))==null?void 0:e.data}set altTextData(e){S(this,rn)&&(S(this,rn).data=e)}get guessedAltText(){var e;return(e=S(this,rn))==null?void 0:e.guessedText}async setGuessedAltText(e){var i;await((i=S(this,rn))==null?void 0:i.setGuessedText(e))}serializeAltText(e){var i;return(i=S(this,rn))==null?void 0:i.serialize(e)}hasAltText(){return!!S(this,rn)&&!S(this,rn).isEmpty()}hasAltTextData(){var e;return((e=S(this,rn))==null?void 0:e.hasData())??!1}render(){var e;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=S(this,LI)?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),oe(this,jr,MX).call(this);const[i,r]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*r/i).toFixed(2)}%`,this.div.style.maxHeight=`${(100*i/r).toFixed(2)}%`);const[o,n]=this.getInitialTranslation();return this.translate(o,n),_R(this,this.div,["pointerdown"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(S(this,em)||ie(this,em,new $xe({container:this.div,isPinchingDisabled:()=>!this.isSelected,onPinchStart:oe(this,jr,ike).bind(this),onPinching:oe(this,jr,rke).bind(this),onPinchEnd:oe(this,jr,oke).bind(this),signal:this._uiManager._signal}))),(e=this._uiManager._editorUndoBar)==null||e.hide(),this.div}pointerdown(e){const{isMac:i}=xl.platform;if(e.button!==0||e.ctrlKey&&i){e.preventDefault();return}if(ie(this,i6,!0),this._isDraggable){oe(this,jr,nke).call(this,e);return}oe(this,jr,kX).call(this,e)}get isSelected(){return this._uiManager.isSelected(this)}_onStartDragging(){}_onStopDragging(){}moveInDOM(){S(this,Y1)&&clearTimeout(S(this,Y1)),ie(this,Y1,setTimeout(()=>{var e;ie(this,Y1,null),(e=this.parent)==null||e.moveEditorInDOM(this)},0))}_setParentAndPosition(e,i,r){e.changeParent(this),this.x=i,this.y=r,this.fixAndSetPosition(),this._onTranslated()}getRect(e,i,r=this.rotation){const o=this.parentScale,[n,s]=this.pageDimensions,[a,l]=this.pageTranslation,c=e/o,d=i/o,u=this.x*n,h=this.y*s,A=this.width*n,g=this.height*s;switch(r){case 0:return[u+c+a,s-h-d-g+l,u+c+A+a,s-h-d+l];case 90:return[u+d+a,s-h+c+l,u+d+g+a,s-h+c+A+l];case 180:return[u-c-A+a,s-h+d+l,u-c+a,s-h+d+g+l];case 270:return[u-d-g+a,s-h-c-A+l,u-d+a,s-h-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,i){const[r,o,n,s]=e,a=n-r,l=s-o;switch(this.rotation){case 0:return[r,i-s,a,l];case 90:return[r,i-o,l,a];case 180:return[n,i-o,a,l];case 270:return[n,i-s,l,a];default:throw new Error("Invalid rotation")}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){ie(this,r6,!0)}disableEditMode(){ie(this,r6,!1)}isInEditMode(){return S(this,r6)}shouldGetKeyboardEvents(){return S(this,hg)}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:i,bottom:r,right:o}=this.getClientDimensions(),{innerHeight:n,innerWidth:s}=window;return i<s&&o>0&&e<n&&r>0}rebuild(){oe(this,jr,MX).call(this)}rotate(e){}resize(){}serializeDeleted(){var e;return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:((e=this._initialData)==null?void 0:e.popupRef)||""}}serialize(e=!1,i=null){Mo("An editor must be serializable")}static async deserialize(e,i,r){const o=new this.prototype.constructor({parent:i,id:i.getNextId(),uiManager:r});o.rotation=e.rotation,ie(o,$9,e.accessibilityData);const[n,s]=o.pageDimensions,[a,l,c,d]=o.getRectInCurrentCoords(e.rect,s);return o.x=a/n,o.y=l/s,o.width=c/n,o.height=d/s,o}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){var e,i;if((e=S(this,$2))==null||e.abort(),ie(this,$2,null),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),S(this,Y1)&&(clearTimeout(S(this,Y1)),ie(this,Y1,null)),oe(this,jr,UI).call(this),this.removeEditToolbar(),S(this,_d)){for(const r of S(this,_d).values())clearTimeout(r);ie(this,_d,null)}this.parent=null,(i=S(this,em))==null||i.destroy(),ie(this,em,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(oe(this,jr,eke).call(this),S(this,ja).classList.remove("hidden"),_R(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),ie(this,ug,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const i=S(this,ja).children;if(!S(this,sA)){ie(this,sA,Array.from(i));const s=oe(this,jr,ske).bind(this),a=oe(this,jr,ake).bind(this),l=this._uiManager._signal;for(const c of S(this,sA)){const d=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",s,{signal:l}),c.addEventListener("blur",a,{signal:l}),c.addEventListener("focus",oe(this,jr,lke).bind(this,d),{signal:l}),c.setAttribute("data-l10n-id",Ca._l10nResizer[d])}}const r=S(this,sA)[0];let o=0;for(const s of i){if(s===r)break;o++}const n=(360-this.rotation+this.parentRotation)%360/90*(S(this,sA).length/4);if(n!==o){if(n<o)for(let a=0;a<o-n;a++)S(this,ja).append(S(this,ja).firstChild);else if(n>o)for(let a=0;a<n-o;a++)S(this,ja).firstChild.before(S(this,ja).lastChild);let s=0;for(const a of i){const l=S(this,sA)[s++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",Ca._l10nResizer[l])}}oe(this,jr,SX).call(this,0),ie(this,hg,!0),S(this,ja).firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}_resizeWithKeyboard(e,i){S(this,hg)&&oe(this,jr,xX).call(this,S(this,nF),{deltaX:e,deltaY:i,fromKeyboard:!0})}_stopResizingWithKeyboard(){oe(this,jr,UI).call(this),this.div.focus()}select(){var e,i,r;if(this.makeResizable(),(e=this.div)==null||e.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{var o,n;(o=this.div)!=null&&o.classList.contains("selectedEditor")&&((n=this._editToolbar)==null||n.show())});return}(i=this._editToolbar)==null||i.show(),(r=S(this,rn))==null||r.toggleAltTextBadge(!1)}unselect(){var e,i,r,o,n;(e=S(this,ja))==null||e.classList.add("hidden"),(i=this.div)==null||i.classList.remove("selectedEditor"),(r=this.div)!=null&&r.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),(o=this._editToolbar)==null||o.hide(),(n=S(this,rn))==null||n.toggleAltTextBadge(!0)}updateParams(e,i){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return S(this,sF)}set isEditing(e){ie(this,sF,e),this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,i){ie(this,e6,!0);const r=e/i,{style:o}=this.div;o.aspectRatio=r,o.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,i=!1){if(i){S(this,_d)||ie(this,_d,new Map);const{action:r}=e;let o=S(this,_d).get(r);o&&clearTimeout(o),o=setTimeout(()=>{this._reportTelemetry(e),S(this,_d).delete(r),S(this,_d).size===0&&ie(this,_d,null)},Ca._telemetryTimeout),S(this,_d).set(r,o);return}e.type||(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),ie(this,LI,!1)}disable(){this.div&&(this.div.tabIndex=-1),ie(this,LI,!0)}renderAnnotationElement(e){let i=e.container.querySelector(".annotationContent");if(!i)i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),e.container.prepend(i);else if(i.nodeName==="CANVAS"){const r=i;i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),r.before(i)}return i}resetAnnotationElement(e){const{firstChild:i}=e.container;i?.nodeName==="DIV"&&i.classList.contains("annotationContent")&&i.remove()}};$9=new WeakMap,sA=new WeakMap,rn=new WeakMap,LI=new WeakMap,X2=new WeakMap,oF=new WeakMap,e6=new WeakMap,ja=new WeakMap,t6=new WeakMap,ug=new WeakMap,$2=new WeakMap,nF=new WeakMap,i6=new WeakMap,Ga=new WeakMap,sF=new WeakMap,r6=new WeakMap,hg=new WeakMap,Y1=new WeakMap,TI=new WeakMap,_I=new WeakMap,_d=new WeakMap,em=new WeakMap,aF=new WeakMap,bX=new WeakMap,jr=new WeakSet,IX=function([t,e],i,r){[i,r]=this.screenToPageTranslation(i,r),this.x+=i/t,this.y+=r/e,this._onTranslating(this.x,this.y),this.fixAndSetPosition()},lF=new WeakSet,BX=function(t,e,i){switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}},cF=function(t){switch(t){case 90:{const[e,i]=this.pageDimensions;return[0,-e/i,i/e,0]}case 180:return[-1,0,0,-1];case 270:{const[e,i]=this.pageDimensions;return[0,e/i,-i/e,0]}default:return[1,0,0,1]}},eke=function(){if(S(this,ja))return;ie(this,ja,document.createElement("div")),S(this,ja).classList.add("resizers");const t=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],e=this._uiManager._signal;for(const i of t){const r=document.createElement("div");S(this,ja).append(r),r.classList.add("resizer",i),r.setAttribute("data-resizer-name",i),r.addEventListener("pointerdown",oe(this,jr,tke).bind(this,i),{signal:e}),r.addEventListener("contextmenu",ju,{signal:e}),r.tabIndex=-1}this.div.prepend(S(this,ja))},tke=function(t,e){var i;e.preventDefault();const{isMac:r}=xl.platform;if(e.button!==0||e.ctrlKey&&r)return;(i=S(this,rn))==null||i.toggle(!1);const o=this._isDraggable;this._isDraggable=!1,ie(this,t6,[e.screenX,e.screenY]);const n=new AbortController,s=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",oe(this,jr,xX).bind(this,t),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",Xc,{passive:!1,signal:s}),window.addEventListener("contextmenu",ju,{signal:s}),ie(this,ug,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height});const a=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(e.target).cursor;const c=()=>{var d;n.abort(),this.parent.togglePointerEvents(!0),(d=S(this,rn))==null||d.toggle(!0),this._isDraggable=o,this.parent.div.style.cursor=a,this.div.style.cursor=l,oe(this,jr,dF).call(this)};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})},EX=function(t,e,i,r){this.width=i,this.height=r,this.x=t,this.y=e;const[o,n]=this.parentDimensions;this.setDims(o*i,n*r),this.fixAndSetPosition(),this._onResized()},dF=function(){if(!S(this,ug))return;const{savedX:t,savedY:e,savedWidth:i,savedHeight:r}=S(this,ug);ie(this,ug,null);const o=this.x,n=this.y,s=this.width,a=this.height;o===t&&n===e&&s===i&&a===r||this.addCommands({cmd:oe(this,jr,EX).bind(this,o,n,s,a),undo:oe(this,jr,EX).bind(this,t,e,i,r),mustExec:!0})},xX=function(t,e){const[i,r]=this.parentDimensions,o=this.x,n=this.y,s=this.width,a=this.height,l=Vn.MIN_SIZE/i,c=Vn.MIN_SIZE/r,d=oe(this,jr,cF).call(this,this.rotation),u=(V,_)=>[d[0]*V+d[2]*_,d[1]*V+d[3]*_],h=oe(this,jr,cF).call(this,360-this.rotation),A=(V,_)=>[h[0]*V+h[2]*_,h[1]*V+h[3]*_];let g,p,m=!1,f=!1;switch(t){case"topLeft":m=!0,g=(V,_)=>[0,0],p=(V,_)=>[V,_];break;case"topMiddle":g=(V,_)=>[V/2,0],p=(V,_)=>[V/2,_];break;case"topRight":m=!0,g=(V,_)=>[V,0],p=(V,_)=>[0,_];break;case"middleRight":f=!0,g=(V,_)=>[V,_/2],p=(V,_)=>[0,_/2];break;case"bottomRight":m=!0,g=(V,_)=>[V,_],p=(V,_)=>[0,0];break;case"bottomMiddle":g=(V,_)=>[V/2,_],p=(V,_)=>[V/2,0];break;case"bottomLeft":m=!0,g=(V,_)=>[0,_],p=(V,_)=>[V,0];break;case"middleLeft":f=!0,g=(V,_)=>[0,_/2],p=(V,_)=>[V,_/2];break}const v=g(s,a),y=p(s,a);let C=u(...y);const w=Vn._round(o+C[0]),b=Vn._round(n+C[1]);let E=1,x=1,k,M;if(e.fromKeyboard)({deltaX:k,deltaY:M}=e);else{const{screenX:V,screenY:_}=e,[H,Y]=S(this,t6);[k,M]=this.screenToPageTranslation(V-H,_-Y),S(this,t6)[0]=V,S(this,t6)[1]=_}if([k,M]=A(k/i,M/r),m){const V=Math.hypot(s,a);E=x=Math.max(Math.min(Math.hypot(y[0]-v[0]-k,y[1]-v[1]-M)/V,1/s,1/a),l/s,c/a)}else f?E=Math.max(l,Math.min(1,Math.abs(y[0]-v[0]-k)))/s:x=Math.max(c,Math.min(1,Math.abs(y[1]-v[1]-M)))/a;const D=Vn._round(s*E),P=Vn._round(a*x);C=u(...p(D,P));const L=w-C[0],O=b-C[1];S(this,Ga)||ie(this,Ga,[this.x,this.y,this.width,this.height]),this.width=D,this.height=P,this.x=L,this.y=O,this.setDims(i*D,r*P),this.fixAndSetPosition(),this._onResizing()},ike=function(){var t;ie(this,ug,{savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height}),(t=S(this,rn))==null||t.toggle(!1),this.parent.togglePointerEvents(!1)},rke=function(t,e,i){let r=.7*(i/e)+1-.7;if(r===1)return;const o=oe(this,jr,cF).call(this,this.rotation),n=(C,w)=>[o[0]*C+o[2]*w,o[1]*C+o[3]*w],[s,a]=this.parentDimensions,l=this.x,c=this.y,d=this.width,u=this.height,h=Vn.MIN_SIZE/s,A=Vn.MIN_SIZE/a;r=Math.max(Math.min(r,1/d,1/u),h/d,A/u);const g=Vn._round(d*r),p=Vn._round(u*r);if(g===d&&p===u)return;S(this,Ga)||ie(this,Ga,[l,c,d,u]);const m=n(d/2,u/2),f=Vn._round(l+m[0]),v=Vn._round(c+m[1]),y=n(g/2,p/2);this.x=f-y[0],this.y=v-y[1],this.width=g,this.height=p,this.setDims(s*g,a*p),this.fixAndSetPosition(),this._onResizing()},oke=function(){var t;(t=S(this,rn))==null||t.toggle(!0),this.parent.togglePointerEvents(!0),oe(this,jr,dF).call(this)},kX=function(t){const{isMac:e}=xl.platform;t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this)},nke=function(t){const{isSelected:e}=this;this._uiManager.setUpDragSession();let i=!1;const r=new AbortController,o=this._uiManager.combinedSignal(r),n={capture:!0,passive:!1,signal:o},s=l=>{r.abort(),ie(this,X2,null),ie(this,i6,!1),this._uiManager.endDragSession()||oe(this,jr,kX).call(this,l),i&&this._onStopDragging()};e&&(ie(this,TI,t.clientX),ie(this,_I,t.clientY),ie(this,X2,t.pointerId),ie(this,oF,t.pointerType),window.addEventListener("pointermove",l=>{i||(i=!0,this._onStartDragging());const{clientX:c,clientY:d,pointerId:u}=l;if(u!==S(this,X2)){Xc(l);return}const[h,A]=this.screenToPageTranslation(c-S(this,TI),d-S(this,_I));ie(this,TI,c),ie(this,_I,d),this._uiManager.dragSelectedEditors(h,A)},n),window.addEventListener("touchmove",Xc,n),window.addEventListener("pointerdown",l=>{l.pointerType===S(this,oF)&&(S(this,em)||l.isPrimary)&&s(l),Xc(l)},n));const a=l=>{if(!S(this,X2)||S(this,X2)===l.pointerId){s(l);return}Xc(l)};window.addEventListener("pointerup",a,{signal:o}),window.addEventListener("blur",a,{signal:o})},MX=function(){if(S(this,$2)||!this.div)return;ie(this,$2,new AbortController);const t=this._uiManager.combinedSignal(S(this,$2));this.div.addEventListener("focusin",this.focusin.bind(this),{signal:t}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:t})},ske=function(t){Vn._resizerKeyboardManager.exec(this,t)},ake=function(t){var e;S(this,hg)&&((e=t.relatedTarget)==null?void 0:e.parentNode)!==S(this,ja)&&oe(this,jr,UI).call(this)},lke=function(t){ie(this,nF,S(this,hg)?t:"")},SX=function(t){if(S(this,sA))for(const e of S(this,sA))e.tabIndex=t},UI=function(){ie(this,hg,!1),oe(this,jr,SX).call(this,-1),oe(this,jr,dF).call(this)},ce(Vn,lF),ai(Vn,"_l10n",null),ai(Vn,"_l10nResizer",null),ai(Vn,"_borderLineWidth",-1),ai(Vn,"_colorManager",new s_i),ai(Vn,"_zIndex",1),ai(Vn,"_telemetryTimeout",1e3);let jn=Vn;class a_i extends jn{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const cke=3285377520,Ud=4294901760,aA=65535;let dke=class{constructor(t){this.h1=t?t&4294967295:cke,this.h2=t?t&4294967295:cke}update(t){let e,i;if(typeof t=="string"){e=new Uint8Array(t.length*2),i=0;for(let g=0,p=t.length;g<p;g++){const m=t.charCodeAt(g);m<=255?e[i++]=m:(e[i++]=m>>>8,e[i++]=m&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),i=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const r=i>>2,o=i-r*4,n=new Uint32Array(e.buffer,0,r);let s=0,a=0,l=this.h1,c=this.h2;const d=3432918353,u=461845907,h=d&aA,A=u&aA;for(let g=0;g<r;g++)g&1?(s=n[g],s=s*d&Ud|s*h&aA,s=s<<15|s>>>17,s=s*u&Ud|s*A&aA,l^=s,l=l<<13|l>>>19,l=l*5+3864292196):(a=n[g],a=a*d&Ud|a*h&aA,a=a<<15|a>>>17,a=a*u&Ud|a*A&aA,c^=a,c=c<<13|c>>>19,c=c*5+3864292196);switch(s=0,o){case 3:s^=e[r*4+2]<<16;case 2:s^=e[r*4+1]<<8;case 1:s^=e[r*4],s=s*d&Ud|s*h&aA,s=s<<15|s>>>17,s=s*u&Ud|s*A&aA,r&1?l^=s:c^=s}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&Ud|t*36045&aA,e=e*4283543511&Ud|((e<<16|t>>>16)*2950163797&Ud)>>>16,t^=e>>>1,t=t*444984403&Ud|t*60499&aA,e=e*3301882366&Ud|((e<<16|t>>>16)*3120437893&Ud)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}};const QX=Object.freeze({map:null,hash:"",transfer:void 0});var o6,n6,sa,DX,uke;class PX{constructor(){ce(this,DX),ce(this,o6,!1),ce(this,n6,null),ce(this,sa,new Map),this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,i){const r=S(this,sa).get(e);return r===void 0?i:Object.assign(i,r)}getRawValue(e){return S(this,sa).get(e)}remove(e){if(S(this,sa).delete(e),S(this,sa).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const i of S(this,sa).values())if(i instanceof jn)return;this.onAnnotationEditor(null)}}setValue(e,i){const r=S(this,sa).get(e);let o=!1;if(r!==void 0)for(const[n,s]of Object.entries(i))r[n]!==s&&(o=!0,r[n]=s);else o=!0,S(this,sa).set(e,i);o&&oe(this,DX,uke).call(this),i instanceof jn&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(i.constructor._type)}has(e){return S(this,sa).has(e)}getAll(){return S(this,sa).size>0?XZ(S(this,sa)):null}setAll(e){for(const[i,r]of Object.entries(e))this.setValue(i,r)}get size(){return S(this,sa).size}resetModified(){S(this,o6)&&(ie(this,o6,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new hke(this)}get serializable(){if(S(this,sa).size===0)return QX;const e=new Map,i=new dke,r=[],o=Object.create(null);let n=!1;for(const[s,a]of S(this,sa)){const l=a instanceof jn?a.serialize(!1,o):a;l&&(e.set(s,l),i.update(`${s}:${JSON.stringify(l)}`),n||(n=!!l.bitmap))}if(n)for(const s of e.values())s.bitmap&&r.push(s.bitmap);return e.size>0?{map:e,hash:i.hexdigest(),transfer:r}:QX}get editorStats(){let e=null;const i=new Map;for(const r of S(this,sa).values()){if(!(r instanceof jn))continue;const o=r.telemetryFinalData;if(!o)continue;const{type:n}=o;i.has(n)||i.set(n,Object.getPrototypeOf(r).constructor),e||(e=Object.create(null));const s=e[n]||(e[n]=new Map);for(const[a,l]of Object.entries(o)){if(a==="type")continue;let c=s.get(a);c||(c=new Map,s.set(a,c));const d=c.get(l)??0;c.set(l,d+1)}}for(const[r,o]of i)e[r]=o.computeTelemetryFinalData(e[r]);return e}resetModifiedIds(){ie(this,n6,null)}get modifiedIds(){if(S(this,n6))return S(this,n6);const e=[];for(const i of S(this,sa).values())!(i instanceof jn)||!i.annotationElementId||!i.serialize()||e.push(i.annotationElementId);return ie(this,n6,{ids:new Set(e),hash:e.join(",")})}}o6=new WeakMap,n6=new WeakMap,sa=new WeakMap,DX=new WeakSet,uke=function(){S(this,o6)||(ie(this,o6,!0),typeof this.onSetModified=="function"&&this.onSetModified())};var uF;class hke extends PX{constructor(e){super(),ce(this,uF);const{map:i,hash:r,transfer:o}=e.serializable,n=structuredClone(i,o?{transfer:o}:null);ie(this,uF,{map:n,hash:r,transfer:o})}get print(){Mo("Should not call PrintAnnotationStorage.print")}get serializable(){return S(this,uF)}get modifiedIds(){return pr(this,"modifiedIds",{ids:new Set,hash:""})}}uF=new WeakMap;var NI;class l_i{constructor({ownerDocument:e=globalThis.document,styleElement:i=null}){ce(this,NI,new Set),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 i=this.styleElement.sheet;i.insertRule(e,i.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),S(this,NI).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,_inspectFont:i}){if(!(!e||S(this,NI).has(e.loadedName))){if($n(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:r,src:o,style:n}=e,s=new FontFace(r,o,n);this.addNativeFontFace(s);try{await s.load(),S(this,NI).add(r),i?.(e)}catch{or(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(s)}return}Mo("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){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(o){throw or(`Failed to load font '${r.family}': '${o}'.`),e.disableFontFace=!0,o}}return}const i=e.createFontFaceRule();if(i){if(this.insertRule(i),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const o=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,o)})}}get isFontLoadingAPISupported(){var e;const i=!!((e=this._document)!=null&&e.fonts);return pr(this,"isFontLoadingAPISupported",i)}get isSyncFontLoadingSupported(){let e=!1;return(Oa||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),pr(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function i(){for($n(!o.done,"completeRequest() cannot be called twice."),o.done=!0;r.length>0&&r[0].done;){const n=r.shift();setTimeout(n.callback,0)}}const{loadingRequests:r}=this,o={done:!1,complete:i,callback:e};return r.push(o),o}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return pr(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,i){function r(y,C){return y.charCodeAt(C)<<24|y.charCodeAt(C+1)<<16|y.charCodeAt(C+2)<<8|y.charCodeAt(C+3)&255}function o(y,C,w,b){const E=y.substring(0,C),x=y.substring(C+w);return E+b+x}let n,s;const a=this._document.createElement("canvas");a.width=1,a.height=1;const l=a.getContext("2d");let c=0;function d(y,C){if(++c>30){or("Load test font never loaded."),C();return}if(l.font="30px "+y,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){C();return}setTimeout(d.bind(null,y,C))}const u=`lt${Date.now()}${this.loadTestFontId++}`;let h=this._loadTestFont;h=o(h,976,u.length,u);const A=16,g=1482184792;let p=r(h,A);for(n=0,s=u.length-3;n<s;n+=4)p=p-g+r(u,n)|0;n<u.length&&(p=p-g+r(u+"XXX",n)|0),h=o(h,A,4,GTi(p));const m=`url(data:font/opentype;base64,${btoa(h)});`,f=`@font-face {font-family:"${u}";src:${m}}`;this.insertRule(f);const v=this._document.createElement("div");v.style.visibility="hidden",v.style.width=v.style.height="10px",v.style.position="absolute",v.style.top=v.style.left="0px";for(const y of[e.loadedName,u]){const C=this._document.createElement("span");C.textContent="Hi",C.style.fontFamily=y,v.append(C)}this._document.body.append(v),d(u,()=>{v.remove(),i.complete()})}}NI=new WeakMap;class c_i{constructor(e,{disableFontFace:i=!1,fontExtraProperties:r=!1,inspectFont:o=null}){this.compiledGlyphs=Object.create(null);for(const n in e)this[n]=e[n];this.disableFontFace=i===!0,this.fontExtraProperties=r===!0,this._inspectFont=o}createNativeFontFace(){var e;if(!this.data||this.disableFontFace)return null;let i;if(!this.cssFontInfo)i=new FontFace(this.loadedName,this.data,{});else{const r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style=`oblique ${this.cssFontInfo.italicAngle}deg`),i=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}return(e=this._inspectFont)==null||e.call(this,this),i}createFontFaceRule(){var e;if(!this.data||this.disableFontFace)return null;const i=`url(data:${this.mimetype};base64,${WTi(this.data)});`;let r;if(!this.cssFontInfo)r=`@font-face {font-family:"${this.loadedName}";src:${i}}`;else{let o=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(o+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),r=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${o}src:${i}}`}return(e=this._inspectFont)==null||e.call(this,this,i),r}getPathGenerator(e,i){if(this.compiledGlyphs[i]!==void 0)return this.compiledGlyphs[i];const r=this.loadedName+"_path_"+i;let o;try{o=e.get(r)}catch(s){or(`getPathGenerator - ignoring character: "${s}".`)}const n=new Path2D(o||"");return this.fontExtraProperties||e.delete(r),this.compiledGlyphs[i]=n}}const hF={DATA:1,ERROR:2},ts={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Ake(){}function cc(t){if(t instanceof og||t instanceof ZZ||t instanceof pI||t instanceof Exe||t instanceof MR||t instanceof WZ)return t;switch(t instanceof Error||typeof t=="object"&&t!==null||Mo('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new og(t.message);case"InvalidPDFException":return new ZZ(t.message);case"MissingPDFException":return new pI(t.message);case"PasswordException":return new Exe(t.message,t.code);case"UnexpectedResponseException":return new MR(t.message,t.status);case"UnknownErrorException":return new WZ(t.message,t.details)}return new WZ(t.message,t.toString())}var OI,Ag,pke,gke,fke,AF,mke;let HI=(mke=class{constructor(t,e,i){ce(this,Ag),ce(this,OI,new AbortController),this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",oe(this,Ag,pke).bind(this),{signal:S(this,OI).signal})}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const r=this.callbackId++,o=Promise.withResolvers();this.callbackCapabilities[r]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:r,data:e},i)}catch(n){o.reject(n)}return o.promise}sendWithStream(t,e,i,r){const o=this.streamId++,n=this.sourceName,s=this.targetName,a=this.comObj;return new ReadableStream({start:l=>{const c=Promise.withResolvers();return this.streamControllers[o]={controller:l,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},a.postMessage({sourceName:n,targetName:s,action:t,streamId:o,data:e,desiredSize:l.desiredSize},r),c.promise},pull:l=>{const c=Promise.withResolvers();return this.streamControllers[o].pullCall=c,a.postMessage({sourceName:n,targetName:s,stream:ts.PULL,streamId:o,desiredSize:l.desiredSize}),c.promise},cancel:l=>{$n(l instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[o].cancelCall=c,this.streamControllers[o].isClosed=!0,a.postMessage({sourceName:n,targetName:s,stream:ts.CANCEL,streamId:o,reason:cc(l)}),c.promise}},i)}destroy(){var t;(t=S(this,OI))==null||t.abort(),ie(this,OI,null)}},OI=new WeakMap,Ag=new WeakSet,pke=function({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){oe(this,Ag,fke).call(this,t);return}if(t.callback){const i=t.callbackId,r=this.callbackCapabilities[i];if(!r)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],t.callback===hF.DATA)r.resolve(t.data);else if(t.callback===hF.ERROR)r.reject(cc(t.reason));else throw new Error("Unexpected callback case");return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.sourceName,r=t.sourceName,o=this.comObj;Promise.try(e,t.data).then(function(n){o.postMessage({sourceName:i,targetName:r,callback:hF.DATA,callbackId:t.callbackId,data:n})},function(n){o.postMessage({sourceName:i,targetName:r,callback:hF.ERROR,callbackId:t.callbackId,reason:cc(n)})});return}if(t.streamId){oe(this,Ag,gke).call(this,t);return}e(t.data)},gke=function(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,n=this,s=this.actionHandler[t.action],a={enqueue(l,c=1,d){if(this.isCancelled)return;const u=this.desiredSize;this.desiredSize-=c,u>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:i,targetName:r,stream:ts.ENQUEUE,streamId:e,chunk:l},d)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:ts.CLOSE,streamId:e}),delete n.streamSinks[e])},error(l){$n(l instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:ts.ERROR,streamId:e,reason:cc(l)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};a.sinkCapability.resolve(),a.ready=a.sinkCapability.promise,this.streamSinks[e]=a,Promise.try(s,t.data,a).then(function(){o.postMessage({sourceName:i,targetName:r,stream:ts.START_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:ts.START_COMPLETE,streamId:e,reason:cc(l)})})},fke=function(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,n=this.streamControllers[e],s=this.streamSinks[e];switch(t.stream){case ts.START_COMPLETE:t.success?n.startCall.resolve():n.startCall.reject(cc(t.reason));break;case ts.PULL_COMPLETE:t.success?n.pullCall.resolve():n.pullCall.reject(cc(t.reason));break;case ts.PULL:if(!s){o.postMessage({sourceName:i,targetName:r,stream:ts.PULL_COMPLETE,streamId:e,success:!0});break}s.desiredSize<=0&&t.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=t.desiredSize,Promise.try(s.onPull||Ake).then(function(){o.postMessage({sourceName:i,targetName:r,stream:ts.PULL_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:ts.PULL_COMPLETE,streamId:e,reason:cc(l)})});break;case ts.ENQUEUE:if($n(n,"enqueue should have stream controller"),n.isClosed)break;n.controller.enqueue(t.chunk);break;case ts.CLOSE:if($n(n,"close should have stream controller"),n.isClosed)break;n.isClosed=!0,n.controller.close(),oe(this,Ag,AF).call(this,n,e);break;case ts.ERROR:$n(n,"error should have stream controller"),n.controller.error(cc(t.reason)),oe(this,Ag,AF).call(this,n,e);break;case ts.CANCEL_COMPLETE:t.success?n.cancelCall.resolve():n.cancelCall.reject(cc(t.reason)),oe(this,Ag,AF).call(this,n,e);break;case ts.CANCEL:if(!s)break;const a=cc(t.reason);Promise.try(s.onCancel||Ake,a).then(function(){o.postMessage({sourceName:i,targetName:r,stream:ts.CANCEL_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:ts.CANCEL_COMPLETE,streamId:e,reason:cc(l)})}),s.sinkCapability.reject(a),s.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}},AF=async function(t,e){var i,r,o;await Promise.allSettled([(i=t.startCall)==null?void 0:i.promise,(r=t.pullCall)==null?void 0:r.promise,(o=t.cancelCall)==null?void 0:o.promise]),delete this.streamControllers[e]},mke);var pF;class vke{constructor({enableHWA:e=!1}){ce(this,pF,!1),ie(this,pF,e)}create(e,i){if(e<=0||i<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,i);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!S(this,pF)})}}reset(e,i,r){if(!e.canvas)throw new Error("Canvas is not specified");if(i<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=i,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,i){Mo("Abstract method `_createCanvas` called.")}}pF=new WeakMap;class d_i extends vke{constructor({ownerDocument:e=globalThis.document,enableHWA:i=!1}){super({enableHWA:i}),this._document=e}_createCanvas(e,i){const r=this._document.createElement("canvas");return r.width=e,r.height=i,r}}class Cke{constructor({baseUrl:e=null,isCompressed:i=!0}){this.baseUrl=e,this.isCompressed=i}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 i=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(i).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)})}async _fetch(e){Mo("Abstract method `_fetch` called.")}}class yke extends Cke{async _fetch(e){const i=await DR(e,this.isCompressed?"arraybuffer":"text");return i instanceof ArrayBuffer?new Uint8Array(i):SR(i)}}class wke{addFilter(e){return"none"}addHCMFilter(e,i){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,i,r,o,n){return"none"}destroy(e=!1){}}var s6,a6,pg,gg,Ml,tm,l6,xi,za,VI,c6,gF,d6,bke,RX,u6,jI,GI,FX,zI;class u_i extends wke{constructor({docId:e,ownerDocument:i=globalThis.document}){super(),ce(this,xi),ce(this,s6),ce(this,a6),ce(this,pg),ce(this,gg),ce(this,Ml),ce(this,tm),ce(this,l6,0),ie(this,gg,e),ie(this,Ml,i)}addFilter(e){if(!e)return"none";let i=S(this,xi,za).get(e);if(i)return i;const[r,o,n]=oe(this,xi,gF).call(this,e),s=e.length===1?r:`${r}${o}${n}`;if(i=S(this,xi,za).get(s),i)return S(this,xi,za).set(e,i),i;const a=`g_${S(this,gg)}_transfer_map_${Ol(this,l6)._++}`,l=oe(this,xi,d6).call(this,a);S(this,xi,za).set(e,l),S(this,xi,za).set(s,l);const c=oe(this,xi,u6).call(this,a);return oe(this,xi,GI).call(this,r,o,n,c),l}addHCMFilter(e,i){var r;const o=`${e}-${i}`,n="base";let s=S(this,xi,VI).get(n);if(s?.key===o||(s?((r=s.filter)==null||r.remove(),s.key=o,s.url="none",s.filter=null):(s={key:o,url:"none",filter:null},S(this,xi,VI).set(n,s)),!e||!i))return s.url;const a=oe(this,xi,zI).call(this,e);e=bi.makeHexColor(...a);const l=oe(this,xi,zI).call(this,i);if(i=bi.makeHexColor(...l),S(this,xi,c6).style.color="",e==="#000000"&&i==="#ffffff"||e===i)return s.url;const c=new Array(256);for(let g=0;g<=255;g++){const p=g/255;c[g]=p<=.03928?p/12.92:((p+.055)/1.055)**2.4}const d=c.join(","),u=`g_${S(this,gg)}_hcm_filter`,h=s.filter=oe(this,xi,u6).call(this,u);oe(this,xi,GI).call(this,d,d,d,h),oe(this,xi,RX).call(this,h);const A=(g,p)=>{const m=a[g]/255,f=l[g]/255,v=new Array(p+1);for(let y=0;y<=p;y++)v[y]=m+y/p*(f-m);return v.join(",")};return oe(this,xi,GI).call(this,A(0,5),A(1,5),A(2,5),h),s.url=oe(this,xi,d6).call(this,u),s.url}addAlphaFilter(e){let i=S(this,xi,za).get(e);if(i)return i;const[r]=oe(this,xi,gF).call(this,[e]),o=`alpha_${r}`;if(i=S(this,xi,za).get(o),i)return S(this,xi,za).set(e,i),i;const n=`g_${S(this,gg)}_alpha_map_${Ol(this,l6)._++}`,s=oe(this,xi,d6).call(this,n);S(this,xi,za).set(e,s),S(this,xi,za).set(o,s);const a=oe(this,xi,u6).call(this,n);return oe(this,xi,FX).call(this,r,a),s}addLuminosityFilter(e){let i=S(this,xi,za).get(e||"luminosity");if(i)return i;let r,o;if(e?([r]=oe(this,xi,gF).call(this,[e]),o=`luminosity_${r}`):o="luminosity",i=S(this,xi,za).get(o),i)return S(this,xi,za).set(e,i),i;const n=`g_${S(this,gg)}_luminosity_map_${Ol(this,l6)._++}`,s=oe(this,xi,d6).call(this,n);S(this,xi,za).set(e,s),S(this,xi,za).set(o,s);const a=oe(this,xi,u6).call(this,n);return oe(this,xi,bke).call(this,a),e&&oe(this,xi,FX).call(this,r,a),s}addHighlightHCMFilter(e,i,r,o,n){var s;const a=`${i}-${r}-${o}-${n}`;let l=S(this,xi,VI).get(e);if(l?.key===a||(l?((s=l.filter)==null||s.remove(),l.key=a,l.url="none",l.filter=null):(l={key:a,url:"none",filter:null},S(this,xi,VI).set(e,l)),!i||!r))return l.url;const[c,d]=[i,r].map(oe(this,xi,zI).bind(this));let u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),h=Math.round(.2126*d[0]+.7152*d[1]+.0722*d[2]),[A,g]=[o,n].map(oe(this,xi,zI).bind(this));h<u&&([u,h,A,g]=[h,u,g,A]),S(this,xi,c6).style.color="";const p=(v,y,C)=>{const w=new Array(256),b=(h-u)/C,E=v/255,x=(y-v)/(255*C);let k=0;for(let M=0;M<=C;M++){const D=Math.round(u+M*b),P=E+M*x;for(let L=k;L<=D;L++)w[L]=P;k=D+1}for(let M=k;M<256;M++)w[M]=w[k-1];return w.join(",")},m=`g_${S(this,gg)}_hcm_${e}_filter`,f=l.filter=oe(this,xi,u6).call(this,m);return oe(this,xi,RX).call(this,f),oe(this,xi,GI).call(this,p(A[0],g[0],5),p(A[1],g[1],5),p(A[2],g[2],5),f),l.url=oe(this,xi,d6).call(this,m),l.url}destroy(e=!1){var i,r,o,n;e&&(i=S(this,tm))!=null&&i.size||((r=S(this,pg))==null||r.parentNode.parentNode.remove(),ie(this,pg,null),(o=S(this,a6))==null||o.clear(),ie(this,a6,null),(n=S(this,tm))==null||n.clear(),ie(this,tm,null),ie(this,l6,0))}}s6=new WeakMap,a6=new WeakMap,pg=new WeakMap,gg=new WeakMap,Ml=new WeakMap,tm=new WeakMap,l6=new WeakMap,xi=new WeakSet,za=function(){return S(this,a6)||ie(this,a6,new Map)},VI=function(){return S(this,tm)||ie(this,tm,new Map)},c6=function(){if(!S(this,pg)){const t=S(this,Ml).createElement("div"),{style:e}=t;e.visibility="hidden",e.contain="strict",e.width=e.height=0,e.position="absolute",e.top=e.left=0,e.zIndex=-1;const i=S(this,Ml).createElementNS(N1,"svg");i.setAttribute("width",0),i.setAttribute("height",0),ie(this,pg,S(this,Ml).createElementNS(N1,"defs")),t.append(i),i.append(S(this,pg)),S(this,Ml).body.append(t)}return S(this,pg)},gF=function(t){if(t.length===1){const a=t[0],l=new Array(256);for(let d=0;d<256;d++)l[d]=a[d]/255;const c=l.join(",");return[c,c,c]}const[e,i,r]=t,o=new Array(256),n=new Array(256),s=new Array(256);for(let a=0;a<256;a++)o[a]=e[a]/255,n[a]=i[a]/255,s[a]=r[a]/255;return[o.join(","),n.join(","),s.join(",")]},d6=function(t){if(S(this,s6)===void 0){ie(this,s6,"");const e=S(this,Ml).URL;e!==S(this,Ml).baseURI&&(PR(e)?or('#createUrl: ignore "data:"-URL for performance reasons.'):ie(this,s6,e.split("#",1)[0]))}return`url(${S(this,s6)}#${t})`},bke=function(t){const e=S(this,Ml).createElementNS(N1,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),t.append(e)},RX=function(t){const e=S(this,Ml).createElementNS(N1,"feColorMatrix");e.setAttribute("type","matrix"),e.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),t.append(e)},u6=function(t){const e=S(this,Ml).createElementNS(N1,"filter");return e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("id",t),S(this,xi,c6).append(e),e},jI=function(t,e,i){const r=S(this,Ml).createElementNS(N1,e);r.setAttribute("type","discrete"),r.setAttribute("tableValues",i),t.append(r)},GI=function(t,e,i,r){const o=S(this,Ml).createElementNS(N1,"feComponentTransfer");r.append(o),oe(this,xi,jI).call(this,o,"feFuncR",t),oe(this,xi,jI).call(this,o,"feFuncG",e),oe(this,xi,jI).call(this,o,"feFuncB",i)},FX=function(t,e){const i=S(this,Ml).createElementNS(N1,"feComponentTransfer");e.append(i),oe(this,xi,jI).call(this,i,"feFuncA",t)},zI=function(t){return S(this,xi,c6).style.color=t,aX(getComputedStyle(S(this,xi,c6)).getPropertyValue("color"))};class Ike{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 i=`${this.baseUrl}${e}`;return this._fetch(i).catch(r=>{throw new Error(`Unable to load font data at: ${i}`)})}async _fetch(e){Mo("Abstract method `_fetch` called.")}}class Bke extends Ike{async _fetch(e){const i=await DR(e,"arraybuffer");return new Uint8Array(i)}}Oa&&or("Please use the `legacy` build in Node.js environments.");async function Eke(t){const e=await process.getBuiltinModule("fs").promises.readFile(t);return new Uint8Array(e)}class h_i extends wke{}class A_i extends vke{_createCanvas(e,i){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(e,i)}}class p_i extends Cke{async _fetch(e){return Eke(e)}}class g_i extends Ike{async _fetch(e){return Eke(e)}}const qa={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function LX(t,e){if(!e)return;const i=e[2]-e[0],r=e[3]-e[1],o=new Path2D;o.rect(e[0],e[1],i,r),t.clip(o)}class TX{getPattern(){Mo("Abstract method `getPattern` called.")}}class f_i extends TX{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 i;this._type==="axial"?i=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(i=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const r of this._colorStops)i.addColorStop(r[0],r[1]);return i}getPattern(e,i,r,o){let n;if(o===qa.STROKE||o===qa.FILL){const s=i.current.getClippedPathBoundingBox(o,en(e))||[0,0,0,0],a=Math.ceil(s[2]-s[0])||1,l=Math.ceil(s[3]-s[1])||1,c=i.cachedCanvases.getCanvas("pattern",a,l),d=c.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-s[0],-s[1]),r=bi.transform(r,[1,0,0,1,s[0],s[1]]),d.transform(...i.baseTransform),this.matrix&&d.transform(...this.matrix),LX(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),n=e.createPattern(c.canvas,"no-repeat");const u=new DOMMatrix(r);n.setTransform(u)}else LX(e,this._bbox),n=this._createGradient(e);return n}}function _X(t,e,i,r,o,n,s,a){const l=e.coords,c=e.colors,d=t.data,u=t.width*4;let h;l[i+1]>l[r+1]&&(h=i,i=r,r=h,h=n,n=s,s=h),l[r+1]>l[o+1]&&(h=r,r=o,o=h,h=s,s=a,a=h),l[i+1]>l[r+1]&&(h=i,i=r,r=h,h=n,n=s,s=h);const A=(l[i]+e.offsetX)*e.scaleX,g=(l[i+1]+e.offsetY)*e.scaleY,p=(l[r]+e.offsetX)*e.scaleX,m=(l[r+1]+e.offsetY)*e.scaleY,f=(l[o]+e.offsetX)*e.scaleX,v=(l[o+1]+e.offsetY)*e.scaleY;if(g>=v)return;const y=c[n],C=c[n+1],w=c[n+2],b=c[s],E=c[s+1],x=c[s+2],k=c[a],M=c[a+1],D=c[a+2],P=Math.round(g),L=Math.round(v);let O,V,_,H,Y,re,de,xe;for(let pe=P;pe<=L;pe++){if(pe<m){const Z=pe<g?0:(g-pe)/(g-m);O=A-(A-p)*Z,V=y-(y-b)*Z,_=C-(C-E)*Z,H=w-(w-x)*Z}else{let Z;pe>v?Z=1:m===v?Z=0:Z=(m-pe)/(m-v),O=p-(p-f)*Z,V=b-(b-k)*Z,_=E-(E-M)*Z,H=x-(x-D)*Z}let Ee;pe<g?Ee=0:pe>v?Ee=1:Ee=(g-pe)/(g-v),Y=A-(A-f)*Ee,re=y-(y-k)*Ee,de=C-(C-M)*Ee,xe=w-(w-D)*Ee;const ue=Math.round(Math.min(O,Y)),De=Math.round(Math.max(O,Y));let Ie=u*pe+ue*4;for(let Z=ue;Z<=De;Z++)Ee=(O-Z)/(O-Y),Ee<0?Ee=0:Ee>1&&(Ee=1),d[Ie++]=V-(V-re)*Ee|0,d[Ie++]=_-(_-de)*Ee|0,d[Ie++]=H-(H-xe)*Ee|0,d[Ie++]=255}}function m_i(t,e,i){const r=e.coords,o=e.colors;let n,s;switch(e.type){case"lattice":const a=e.verticesPerRow,l=Math.floor(r.length/a)-1,c=a-1;for(n=0;n<l;n++){let d=n*a;for(let u=0;u<c;u++,d++)_X(t,i,r[d],r[d+1],r[d+a],o[d],o[d+1],o[d+a]),_X(t,i,r[d+a+1],r[d+1],r[d+a],o[d+a+1],o[d+1],o[d+a])}break;case"triangles":for(n=0,s=r.length;n<s;n+=3)_X(t,i,r[n],r[n+1],r[n+2],o[n],o[n+1],o[n+2]);break;default:throw new Error("illegal figure")}}class v_i extends TX{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,i,r){const o=Math.floor(this._bounds[0]),n=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-o,a=Math.ceil(this._bounds[3])-n,l=Math.min(Math.ceil(Math.abs(s*e[0]*1.1)),3e3),c=Math.min(Math.ceil(Math.abs(a*e[1]*1.1)),3e3),d=s/l,u=a/c,h={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-n,scaleX:1/d,scaleY:1/u},A=l+2*2,g=c+2*2,p=r.getCanvas("mesh",A,g),m=p.context,f=m.createImageData(l,c);if(i){const v=f.data;for(let y=0,C=v.length;y<C;y+=4)v[y]=i[0],v[y+1]=i[1],v[y+2]=i[2],v[y+3]=255}for(const v of this._figures)m_i(f,v,h);return m.putImageData(f,2,2),{canvas:p.canvas,offsetX:o-2*d,offsetY:n-2*u,scaleX:d,scaleY:u}}getPattern(e,i,r,o){LX(e,this._bbox);let n;if(o===qa.SHADING)n=bi.singularValueDecompose2dScale(en(e));else if(n=bi.singularValueDecompose2dScale(i.baseTransform),this.matrix){const a=bi.singularValueDecompose2dScale(this.matrix);n=[n[0]*a[0],n[1]*a[1]]}const s=this._createMeshCanvas(n,o===qa.SHADING?null:this._background,i.cachedCanvases);return o!==qa.SHADING&&(e.setTransform(...i.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}}class C_i extends TX{getPattern(){return"hotpink"}}function y_i(t){switch(t[0]){case"RadialAxial":return new f_i(t);case"Mesh":return new v_i(t);case"Dummy":return new C_i}throw new Error(`Unknown IR type: ${t[0]}`)}const xke={COLORED:1,UNCOLORED:2},kke=class VRe{constructor(e,i,r,o,n){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=i,this.ctx=r,this.canvasGraphicsFactory=o,this.baseTransform=n}createPatternCanvas(e){const{bbox:i,operatorList:r,paintType:o,tilingType:n,color:s,canvasGraphicsFactory:a}=this;let{xstep:l,ystep:c}=this;l=Math.abs(l),c=Math.abs(c),kR("TilingType: "+n);const d=i[0],u=i[1],h=i[2],A=i[3],g=h-d,p=A-u,m=bi.singularValueDecompose2dScale(this.matrix),f=bi.singularValueDecompose2dScale(this.baseTransform),v=m[0]*f[0],y=m[1]*f[1];let C=g,w=p,b=!1,E=!1;const x=Math.ceil(l*v),k=Math.ceil(c*y),M=Math.ceil(g*v),D=Math.ceil(p*y);x>=M?C=l:b=!0,k>=D?w=c:E=!0;const P=this.getSizeAndScale(C,this.ctx.canvas.width,v),L=this.getSizeAndScale(w,this.ctx.canvas.height,y),O=e.cachedCanvases.getCanvas("pattern",P.size,L.size),V=O.context,_=a.createCanvasGraphics(V);if(_.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(_,o,s),V.translate(-P.scale*d,-L.scale*u),_.transform(P.scale,0,0,L.scale,0,0),V.save(),this.clipBbox(_,d,u,h,A),_.baseTransform=en(_.ctx),_.executeOperatorList(r),_.endDrawing(),V.restore(),b||E){const H=O.canvas;b&&(C=l),E&&(w=c);const Y=this.getSizeAndScale(C,this.ctx.canvas.width,v),re=this.getSizeAndScale(w,this.ctx.canvas.height,y),de=Y.size,xe=re.size,pe=e.cachedCanvases.getCanvas("pattern-workaround",de,xe),Ee=pe.context,ue=b?Math.floor(g/l):0,De=E?Math.floor(p/c):0;for(let Ie=0;Ie<=ue;Ie++)for(let Z=0;Z<=De;Z++)Ee.drawImage(H,de*Ie,xe*Z,de,xe,0,0,de,xe);return{canvas:pe.canvas,scaleX:Y.scale,scaleY:re.scale,offsetX:d,offsetY:u}}return{canvas:O.canvas,scaleX:P.scale,scaleY:L.scale,offsetX:d,offsetY:u}}getSizeAndScale(e,i,r){const o=Math.max(VRe.MAX_PATTERN_SIZE,i);let n=Math.ceil(e*r);return n>=o?n=o:r=n/e,{scale:r,size:n}}clipBbox(e,i,r,o,n){const s=o-i,a=n-r;e.ctx.rect(i,r,s,a),e.current.updateRectMinMax(en(e.ctx),[i,r,o,n]),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,i,r){const o=e.ctx,n=e.current;switch(i){case xke.COLORED:const s=this.ctx;o.fillStyle=s.fillStyle,o.strokeStyle=s.strokeStyle,n.fillColor=s.fillStyle,n.strokeColor=s.strokeStyle;break;case xke.UNCOLORED:const a=bi.makeHexColor(r[0],r[1],r[2]);o.fillStyle=a,o.strokeStyle=a,n.fillColor=a,n.strokeColor=a;break;default:throw new jTi(`Unsupported paint type: ${i}`)}}getPattern(e,i,r,o){let n=r;o!==qa.SHADING&&(n=bi.transform(n,i.baseTransform),this.matrix&&(n=bi.transform(n,this.matrix)));const s=this.createPatternCanvas(i);let a=new DOMMatrix(n);a=a.translate(s.offsetX,s.offsetY),a=a.scale(1/s.scaleX,1/s.scaleY);const l=e.createPattern(s.canvas,"repeat");return l.setTransform(a),l}};ai(kke,"MAX_PATTERN_SIZE",3e3);let w_i=kke;function b_i({src:t,srcPos:e=0,dest:i,width:r,height:o,nonBlackColor:n=4294967295,inverseDecode:s=!1}){const a=xl.isLittleEndian?4278190080:255,[l,c]=s?[n,a]:[a,n],d=r>>3,u=r&7,h=t.length;i=new Uint32Array(i.buffer);let A=0;for(let g=0;g<o;g++){for(const m=e+d;e<m;e++){const f=e<h?t[e]:255;i[A++]=f&128?c:l,i[A++]=f&64?c:l,i[A++]=f&32?c:l,i[A++]=f&16?c:l,i[A++]=f&8?c:l,i[A++]=f&4?c:l,i[A++]=f&2?c:l,i[A++]=f&1?c:l}if(u===0)continue;const p=e<h?t[e++]:255;for(let m=0;m<u;m++)i[A++]=p&1<<7-m?c:l}return{srcPos:e,destPos:A}}const Mke=16,Ske=100,I_i=15,Qke=10,Dke=1e3,dc=16;function B_i(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(i,r){e.translate(i,r),this.__originalTranslate(i,r)},t.scale=function(i,r){e.scale(i,r),this.__originalScale(i,r)},t.transform=function(i,r,o,n,s,a){e.transform(i,r,o,n,s,a),this.__originalTransform(i,r,o,n,s,a)},t.setTransform=function(i,r,o,n,s,a){e.setTransform(i,r,o,n,s,a),this.__originalSetTransform(i,r,o,n,s,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(i){e.rotate(i),this.__originalRotate(i)},t.clip=function(i){e.clip(i),this.__originalClip(i)},t.moveTo=function(i,r){e.moveTo(i,r),this.__originalMoveTo(i,r)},t.lineTo=function(i,r){e.lineTo(i,r),this.__originalLineTo(i,r)},t.bezierCurveTo=function(i,r,o,n,s,a){e.bezierCurveTo(i,r,o,n,s,a),this.__originalBezierCurveTo(i,r,o,n,s,a)},t.rect=function(i,r,o,n){e.rect(i,r,o,n),this.__originalRect(i,r,o,n)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class E_i{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,i,r){let o;return this.cache[e]!==void 0?(o=this.cache[e],this.canvasFactory.reset(o,i,r)):(o=this.canvasFactory.create(i,r),this.cache[e]=o),o}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const i=this.cache[e];this.canvasFactory.destroy(i),delete this.cache[e]}}}function fF(t,e,i,r,o,n,s,a,l,c){const[d,u,h,A,g,p]=en(t);if(u===0&&h===0){const v=s*d+g,y=Math.round(v),C=a*A+p,w=Math.round(C),b=(s+l)*d+g,E=Math.abs(Math.round(b)-y)||1,x=(a+c)*A+p,k=Math.abs(Math.round(x)-w)||1;return t.setTransform(Math.sign(d),0,0,Math.sign(A),y,w),t.drawImage(e,i,r,o,n,0,0,E,k),t.setTransform(d,u,h,A,g,p),[E,k]}if(d===0&&A===0){const v=a*h+g,y=Math.round(v),C=s*u+p,w=Math.round(C),b=(a+c)*h+g,E=Math.abs(Math.round(b)-y)||1,x=(s+l)*u+p,k=Math.abs(Math.round(x)-w)||1;return t.setTransform(0,Math.sign(u),Math.sign(h),0,y,w),t.drawImage(e,i,r,o,n,0,0,k,E),t.setTransform(d,u,h,A,g,p),[k,E]}t.drawImage(e,i,r,o,n,s,a,l,c);const m=Math.hypot(d,u),f=Math.hypot(h,A);return[m*l,f*c]}function x_i(t){const{width:e,height:i}=t;if(e>Dke||i>Dke)return null;const r=1e3,o=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),n=e+1;let s=new Uint8Array(n*(i+1)),a,l,c;const d=e+7&-8;let u=new Uint8Array(d*i),h=0;for(const m of t.data){let f=128;for(;f>0;)u[h++]=m&f?0:255,f>>=1}let A=0;for(h=0,u[h]!==0&&(s[0]=1,++A),l=1;l<e;l++)u[h]!==u[h+1]&&(s[l]=u[h]?2:1,++A),h++;for(u[h]!==0&&(s[l]=2,++A),a=1;a<i;a++){h=a*d,c=a*n,u[h-d]!==u[h]&&(s[c]=u[h]?1:8,++A);let m=(u[h]?4:0)+(u[h-d]?8:0);for(l=1;l<e;l++)m=(m>>2)+(u[h+1]?4:0)+(u[h-d+1]?8:0),o[m]&&(s[c+l]=o[m],++A),h++;if(u[h-d]!==u[h]&&(s[c+l]=u[h]?2:4,++A),A>r)return null}for(h=d*(i-1),c=a*n,u[h]!==0&&(s[c]=8,++A),l=1;l<e;l++)u[h]!==u[h+1]&&(s[c+l]=u[h]?4:8,++A),h++;if(u[h]!==0&&(s[c+l]=4,++A),A>r)return null;const g=new Int32Array([0,n,-1,0,-n,0,0,0,1]),p=new Path2D;for(a=0;A&&a<=i;a++){let m=a*n;const f=m+e;for(;m<f&&!s[m];)m++;if(m===f)continue;p.moveTo(m%n,a);const v=m;let y=s[m];do{const C=g[y];do m+=C;while(!s[m]);const w=s[m];w!==5&&w!==10?(y=w,s[m]=0):(y=w&51*y>>4,s[m]&=y>>2|y<<2),p.lineTo(m%n,m/n|0),s[m]||--A}while(v!==m);--a}return u=null,s=null,function(m){m.save(),m.scale(1/e,-1/i),m.translate(0,-i),m.fill(p),m.beginPath(),m.restore()}}class Pke{constructor(e,i){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=Bxe,this.textMatrixScale=1,this.fontMatrix=JZ,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=Ha.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.patternStroke=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,i])}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,i){this.x=e,this.y=i}updatePathMinMax(e,i,r){[i,r]=bi.applyTransform([i,r],e),this.minX=Math.min(this.minX,i),this.minY=Math.min(this.minY,r),this.maxX=Math.max(this.maxX,i),this.maxY=Math.max(this.maxY,r)}updateRectMinMax(e,i){const r=bi.applyTransform(i,e),o=bi.applyTransform(i.slice(2),e),n=bi.applyTransform([i[0],i[3]],e),s=bi.applyTransform([i[2],i[1]],e);this.minX=Math.min(this.minX,r[0],o[0],n[0],s[0]),this.minY=Math.min(this.minY,r[1],o[1],n[1],s[1]),this.maxX=Math.max(this.maxX,r[0],o[0],n[0],s[0]),this.maxY=Math.max(this.maxY,r[1],o[1],n[1],s[1])}updateScalingPathMinMax(e,i){bi.scaleMinMax(e,i),this.minX=Math.min(this.minX,i[0]),this.minY=Math.min(this.minY,i[1]),this.maxX=Math.max(this.maxX,i[2]),this.maxY=Math.max(this.maxY,i[3])}updateCurvePathMinMax(e,i,r,o,n,s,a,l,c,d){const u=bi.bezierBoundingBox(i,r,o,n,s,a,l,c,d);d||this.updateRectMinMax(e,u)}getPathBoundingBox(e=qa.FILL,i=null){const r=[this.minX,this.minY,this.maxX,this.maxY];if(e===qa.STROKE){i||Mo("Stroke bounding box must include transform.");const o=bi.singularValueDecompose2dScale(i),n=o[0]*this.lineWidth/2,s=o[1]*this.lineWidth/2;r[0]-=n,r[1]-=s,r[2]+=n,r[3]+=s}return r}updateClipFromPath(){const e=bi.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=qa.FILL,i=null){return bi.intersect(this.clipBox,this.getPathBoundingBox(e,i))}}function Rke(t,e){if(e instanceof ImageData){t.putImageData(e,0,0);return}const i=e.height,r=e.width,o=i%dc,n=(i-o)/dc,s=o===0?n:n+1,a=t.createImageData(r,dc);let l=0,c;const d=e.data,u=a.data;let h,A,g,p;if(e.kind===BR.GRAYSCALE_1BPP){const m=d.byteLength,f=new Uint32Array(u.buffer,0,u.byteLength>>2),v=f.length,y=r+7>>3,C=4294967295,w=xl.isLittleEndian?4278190080:255;for(h=0;h<s;h++){for(g=h<n?dc:o,c=0,A=0;A<g;A++){const b=m-l;let E=0;const x=b>y?r:b*8-7,k=x&-8;let M=0,D=0;for(;E<k;E+=8)D=d[l++],f[c++]=D&128?C:w,f[c++]=D&64?C:w,f[c++]=D&32?C:w,f[c++]=D&16?C:w,f[c++]=D&8?C:w,f[c++]=D&4?C:w,f[c++]=D&2?C:w,f[c++]=D&1?C:w;for(;E<x;E++)M===0&&(D=d[l++],M=128),f[c++]=D&M?C:w,M>>=1}for(;c<v;)f[c++]=0;t.putImageData(a,0,h*dc)}}else if(e.kind===BR.RGBA_32BPP){for(A=0,p=r*dc*4,h=0;h<n;h++)u.set(d.subarray(l,l+p)),l+=p,t.putImageData(a,0,A),A+=dc;h<s&&(p=r*o*4,u.set(d.subarray(l,l+p)),t.putImageData(a,0,A))}else if(e.kind===BR.RGB_24BPP)for(g=dc,p=r*g,h=0;h<s;h++){for(h>=n&&(g=o,p=r*g),c=0,A=p;A--;)u[c++]=d[l++],u[c++]=d[l++],u[c++]=d[l++],u[c++]=255;t.putImageData(a,0,h*dc)}else throw new Error(`bad image kind: ${e.kind}`)}function Fke(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const i=e.height,r=e.width,o=i%dc,n=(i-o)/dc,s=o===0?n:n+1,a=t.createImageData(r,dc);let l=0;const c=e.data,d=a.data;for(let u=0;u<s;u++){const h=u<n?dc:o;({srcPos:l}=b_i({src:c,srcPos:l,dest:d,width:r,height:h,nonBlackColor:0})),t.putImageData(a,0,u*dc)}}function qI(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of i)t[r]!==void 0&&(e[r]=t[r]);t.setLineDash!==void 0&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function mF(t){if(t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",t.setLineDash!==void 0&&(t.setLineDash([]),t.lineDashOffset=0),!Oa){const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}}function Lke(t,e){if(e)return!0;const i=bi.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]),i[1]=Math.fround(i[1]);const r=Math.fround((globalThis.devicePixelRatio||1)*N9.PDF_TO_CSS_UNITS);return i[0]<=r&&i[1]<=r}const k_i=["butt","round","square"],M_i=["miter","round","bevel"],S_i={},Tke={};var fg,UX,NX,OX;const Q_i=class jRe{constructor(e,i,r,o,n,{optionalContentConfig:s,markedContentStack:a=null},l,c){ce(this,fg),this.ctx=e,this.current=new Pke(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=i,this.objs=r,this.canvasFactory=o,this.filterFactory=n,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=a||[],this.optionalContentConfig=s,this.cachedCanvases=new E_i(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map}getObject(e,i=null){return typeof e=="string"?e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e):i}beginDrawing({transform:e,viewport:i,transparency:r=!1,background:o=null}){const n=this.ctx.canvas.width,s=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=o||"#ffffff",this.ctx.fillRect(0,0,n,s),this.ctx.fillStyle=a,r){const l=this.cachedCanvases.getCanvas("transparent",n,s);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...en(this.compositeCtx))}this.ctx.save(),mF(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=en(this.ctx)}executeOperatorList(e,i,r,o){const n=e.argsArray,s=e.fnArray;let a=i||0;const l=n.length;if(l===a)return a;const c=l-a>Qke&&typeof r=="function",d=c?Date.now()+I_i:0;let u=0;const h=this.commonObjs,A=this.objs;let g;for(;;){if(o!==void 0&&a===o.nextBreakPoint)return o.breakIt(a,r),a;if(g=s[a],g!==Vu.dependency)this[g].apply(this,n[a]);else for(const p of n[a]){const m=p.startsWith("g_")?h:A;if(!m.has(p))return m.get(p,r),a}if(a++,a===l)return a;if(c&&++u>Qke){if(Date.now()>d)return r(),a;u=0}}}endDrawing(){oe(this,fg,UX).call(this),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const i of e.values())typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&(i.width=i.height=0);e.clear()}this._cachedBitmapsMap.clear(),oe(this,fg,NX).call(this)}_scaleImage(e,i){const r=e.width??e.displayWidth,o=e.height??e.displayHeight;let n=Math.max(Math.hypot(i[0],i[1]),1),s=Math.max(Math.hypot(i[2],i[3]),1),a=r,l=o,c="prescale1",d,u;for(;n>2&&a>1||s>2&&l>1;){let h=a,A=l;n>2&&a>1&&(h=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),n/=a/h),s>2&&l>1&&(A=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,s/=l/A),d=this.cachedCanvases.getCanvas(c,h,A),u=d.context,u.clearRect(0,0,h,A),u.drawImage(e,0,0,a,l,0,0,h,A),e=d.canvas,a=h,l=A,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:a,paintHeight:l}}_createMaskCanvas(e){const i=this.ctx,{width:r,height:o}=e,n=this.current.fillColor,s=this.current.patternFill,a=en(i);let l,c,d,u;if((e.bitmap||e.data)&&e.count>1){const x=e.bitmap||e.data.buffer;c=JSON.stringify(s?a:[a.slice(0,4),n]),l=this._cachedBitmapsMap.get(x),l||(l=new Map,this._cachedBitmapsMap.set(x,l));const k=l.get(c);if(k&&!s){const M=Math.round(Math.min(a[0],a[2])+a[4]),D=Math.round(Math.min(a[1],a[3])+a[5]);return{canvas:k,offsetX:M,offsetY:D}}d=k}d||(u=this.cachedCanvases.getCanvas("maskCanvas",r,o),Fke(u.context,e));let h=bi.transform(a,[1/r,0,0,-1/o,0,0]);h=bi.transform(h,[1,0,0,1,0,-o]);const[A,g,p,m]=bi.getAxialAlignedBoundingBox([0,0,r,o],h),f=Math.round(p-A)||1,v=Math.round(m-g)||1,y=this.cachedCanvases.getCanvas("fillCanvas",f,v),C=y.context,w=A,b=g;C.translate(-w,-b),C.transform(...h),d||(d=this._scaleImage(u.canvas,eA(C)),d=d.img,l&&s&&l.set(c,d)),C.imageSmoothingEnabled=Lke(en(C),e.interpolate),fF(C,d,0,0,d.width,d.height,0,0,r,o),C.globalCompositeOperation="source-in";const E=bi.transform(eA(C),[1,0,0,1,-w,-b]);return C.fillStyle=s?n.getPattern(i,this,E,qa.FILL):n,C.fillRect(0,0,r,o),l&&!s&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,y.canvas)),{canvas:y.canvas,offsetX:Math.round(w),offsetY:Math.round(b)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=k_i[e]}setLineJoin(e){this.ctx.lineJoin=M_i[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,i){const r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(e),r.lineDashOffset=i)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(const[i,r]of e)switch(i){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);break}}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,i=this.ctx.canvas.height,r="smaskGroupAt"+this.groupLevel,o=this.cachedCanvases.getCanvas(r,e,i);this.suspendedCtx=this.ctx,this.ctx=o.context;const n=this.ctx;n.setTransform(...en(this.suspendedCtx)),qI(this.suspendedCtx,n),B_i(n,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(),qI(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 i=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,i,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,i,r,o){const n=o[0],s=o[1],a=o[2]-n,l=o[3]-s;a===0||l===0||(this.genericComposeSMask(i.context,r,a,l,i.subtype,i.backdrop,i.transferMap,n,s,i.offsetX,i.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,i,r,o,n,s,a,l,c,d,u){let h=e.canvas,A=l-d,g=c-u;if(s){const m=bi.makeHexColor(...s);if(A<0||g<0||A+r>h.width||g+o>h.height){const f=this.cachedCanvases.getCanvas("maskExtension",r,o),v=f.context;v.drawImage(h,-A,-g),v.globalCompositeOperation="destination-atop",v.fillStyle=m,v.fillRect(0,0,r,o),v.globalCompositeOperation="source-over",h=f.canvas,A=g=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const f=new Path2D;f.rect(A,g,r,o),e.clip(f),e.globalCompositeOperation="destination-atop",e.fillStyle=m,e.fillRect(A,g,r,o),e.restore()}}i.save(),i.globalAlpha=1,i.setTransform(1,0,0,1,0,0),n==="Alpha"&&a?i.filter=this.filterFactory.addAlphaFilter(a):n==="Luminosity"&&(i.filter=this.filterFactory.addLuminosityFilter(a));const p=new Path2D;p.rect(l,c,r,o),i.clip(p),i.globalCompositeOperation="destination-in",i.drawImage(h,A,g,r,o,l,c,r,o),i.restore()}save(){this.inSMaskMode?(qI(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();const e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),qI(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,i,r,o,n,s){this.ctx.transform(e,i,r,o,n,s),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,i,r){const o=this.ctx,n=this.current;let s=n.x,a=n.y,l,c;const d=en(o),u=d[0]===0&&d[3]===0||d[1]===0&&d[2]===0,h=u?r.slice(0):null;for(let A=0,g=0,p=e.length;A<p;A++)switch(e[A]|0){case Vu.rectangle:s=i[g++],a=i[g++];const m=i[g++],f=i[g++],v=s+m,y=a+f;o.moveTo(s,a),m===0||f===0?o.lineTo(v,y):(o.lineTo(v,a),o.lineTo(v,y),o.lineTo(s,y)),u||n.updateRectMinMax(d,[s,a,v,y]),o.closePath();break;case Vu.moveTo:s=i[g++],a=i[g++],o.moveTo(s,a),u||n.updatePathMinMax(d,s,a);break;case Vu.lineTo:s=i[g++],a=i[g++],o.lineTo(s,a),u||n.updatePathMinMax(d,s,a);break;case Vu.curveTo:l=s,c=a,s=i[g+4],a=i[g+5],o.bezierCurveTo(i[g],i[g+1],i[g+2],i[g+3],s,a),n.updateCurvePathMinMax(d,l,c,i[g],i[g+1],i[g+2],i[g+3],s,a,h),g+=6;break;case Vu.curveTo2:l=s,c=a,o.bezierCurveTo(s,a,i[g],i[g+1],i[g+2],i[g+3]),n.updateCurvePathMinMax(d,l,c,s,a,i[g],i[g+1],i[g+2],i[g+3],h),s=i[g+2],a=i[g+3],g+=4;break;case Vu.curveTo3:l=s,c=a,s=i[g+2],a=i[g+3],o.bezierCurveTo(i[g],i[g+1],s,a,s,a),n.updateCurvePathMinMax(d,l,c,i[g],i[g+1],s,a,s,a,h),g+=4;break;case Vu.closePath:o.closePath();break}u&&n.updateScalingPathMinMax(d,h),n.setCurrentPoint(s,a)}closePath(){this.ctx.closePath()}stroke(e=!0){const i=this.ctx,r=this.current.strokeColor;i.globalAlpha=this.current.strokeAlpha,this.contentVisible&&(typeof r=="object"&&r!=null&&r.getPattern?(i.save(),i.strokeStyle=r.getPattern(i,this,eA(i),qa.STROKE),this.rescaleAndStroke(!1),i.restore()):this.rescaleAndStroke(!0)),e&&this.consumePath(this.current.getClippedPathBoundingBox()),i.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath(),this.stroke()}fill(e=!0){const i=this.ctx,r=this.current.fillColor,o=this.current.patternFill;let n=!1;o&&(i.save(),i.fillStyle=r.getPattern(i,this,eA(i),qa.FILL),n=!0);const s=this.current.getClippedPathBoundingBox();this.contentVisible&&s!==null&&(this.pendingEOFill?(i.fill("evenodd"),this.pendingEOFill=!1):i.fill()),n&&i.restore(),e&&this.consumePath(s)}eoFill(){this.pendingEOFill=!0,this.fill()}fillStroke(){this.fill(!1),this.stroke(!1),this.consumePath()}eoFillStroke(){this.pendingEOFill=!0,this.fillStroke()}closeFillStroke(){this.closePath(),this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=S_i}eoClip(){this.pendingClip=Tke}beginText(){this.current.textMatrix=Bxe,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}endText(){const e=this.pendingTextPaths,i=this.ctx;if(e===void 0){i.beginPath();return}const r=new Path2D,o=i.getTransform().invertSelf();for(const{transform:n,x:s,y:a,fontSize:l,path:c}of e)r.addPath(c,new DOMMatrix(n).preMultiplySelf(o).translate(s,a).scale(l,-l));i.clip(r),i.beginPath(),delete this.pendingTextPaths}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,i){var r;const o=this.commonObjs.get(e),n=this.current;if(!o)throw new Error(`Can't find font for ${e}`);if(n.fontMatrix=o.fontMatrix||JZ,(n.fontMatrix[0]===0||n.fontMatrix[3]===0)&&or("Invalid font matrix for font "+e),i<0?(i=-i,n.fontDirection=-1):n.fontDirection=1,this.current.font=o,this.current.fontSize=i,o.isType3Font)return;const s=o.loadedName||"sans-serif",a=((r=o.systemFontInfo)==null?void 0:r.css)||`"${s}", ${o.fallbackName}`;let l="normal";o.black?l="900":o.bold&&(l="bold");const c=o.italic?"italic":"normal";let d=i;i<Mke?d=Mke:i>Ske&&(d=Ske),this.current.fontSizeScale=i/d,this.ctx.font=`${c} ${l} ${d}px ${a}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,i){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=i}setLeadingMoveText(e,i){this.setLeading(-i),this.moveText(e,i)}setTextMatrix(e,i,r,o,n,s){this.current.textMatrix=[e,i,r,o,n,s],this.current.textMatrixScale=Math.hypot(e,i),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,i,r,o,n){const s=this.ctx,a=this.current,l=a.font,c=a.textRenderingMode,d=a.fontSize/a.fontSizeScale,u=c&Ha.FILL_STROKE_MASK,h=!!(c&Ha.ADD_TO_PATH_FLAG),A=a.patternFill&&!l.missingFile,g=a.patternStroke&&!l.missingFile;let p;if((l.disableFontFace||h||A||g)&&(p=l.getPathGenerator(this.commonObjs,e)),l.disableFontFace||A||g){if(s.save(),s.translate(i,r),s.scale(d,-d),u===Ha.FILL||u===Ha.FILL_STROKE)if(o){const m=s.getTransform();s.setTransform(...o),s.fill(oe(this,fg,OX).call(this,p,m,o))}else s.fill(p);if(u===Ha.STROKE||u===Ha.FILL_STROKE)if(n){const m=s.getTransform();s.setTransform(...n),s.stroke(oe(this,fg,OX).call(this,p,m,n))}else s.lineWidth/=d,s.stroke(p);s.restore()}else(u===Ha.FILL||u===Ha.FILL_STROKE)&&s.fillText(e,i,r),(u===Ha.STROKE||u===Ha.FILL_STROKE)&&s.strokeText(e,i,r);h&&(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:en(s),x:i,y:r,fontSize:d,path:p})}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const i=e.getImageData(0,0,10,10).data;let r=!1;for(let o=3;o<i.length;o+=4)if(i[o]>0&&i[o]<255){r=!0;break}return pr(this,"isFontSubpixelAAEnabled",r)}showText(e){const i=this.current,r=i.font;if(r.isType3Font)return this.showType3Text(e);const o=i.fontSize;if(o===0)return;const n=this.ctx,s=i.fontSizeScale,a=i.charSpacing,l=i.wordSpacing,c=i.fontDirection,d=i.textHScale*c,u=e.length,h=r.vertical,A=h?1:-1,g=r.defaultVMetrics,p=o*i.fontMatrix[0],m=i.textRenderingMode===Ha.FILL&&!r.disableFontFace&&!i.patternFill;n.save(),n.transform(...i.textMatrix),n.translate(i.x,i.y+i.textRise),c>0?n.scale(d,-1):n.scale(d,1);let f,v;if(i.patternFill){n.save();const E=i.fillColor.getPattern(n,this,eA(n),qa.FILL);f=en(n),n.restore(),n.fillStyle=E}if(i.patternStroke){n.save();const E=i.strokeColor.getPattern(n,this,eA(n),qa.STROKE);v=en(n),n.restore(),n.strokeStyle=E}let y=i.lineWidth;const C=i.textMatrixScale;if(C===0||y===0){const E=i.textRenderingMode&Ha.FILL_STROKE_MASK;(E===Ha.STROKE||E===Ha.FILL_STROKE)&&(y=this.getSinglePixelWidth())}else y/=C;if(s!==1&&(n.scale(s,s),y/=s),n.lineWidth=y,r.isInvalidPDFjsFont){const E=[];let x=0;for(const k of e)E.push(k.unicode),x+=k.width;n.fillText(E.join(""),0,0),i.x+=x*p*d,n.restore(),this.compose();return}let w=0,b;for(b=0;b<u;++b){const E=e[b];if(typeof E=="number"){w+=A*E*o/1e3;continue}let x=!1;const k=(E.isSpace?l:0)+a,M=E.fontChar,D=E.accent;let P,L,O=E.width;if(h){const _=E.vmetric||g,H=-(E.vmetric?_[1]:O*.5)*p,Y=_[2]*p;O=_?-_[0]:O,P=H/s,L=(w+Y)/s}else P=w/s,L=0;if(r.remeasure&&O>0){const _=n.measureText(M).width*1e3/o*s;if(O<_&&this.isFontSubpixelAAEnabled){const H=O/_;x=!0,n.save(),n.scale(H,1),P/=H}else O!==_&&(P+=(O-_)/2e3*o/s)}if(this.contentVisible&&(E.isInFont||r.missingFile)){if(m&&!D)n.fillText(M,P,L);else if(this.paintChar(M,P,L,f,v),D){const _=P+o*D.offset.x/s,H=L-o*D.offset.y/s;this.paintChar(D.fontChar,_,H,f,v)}}const V=h?O*p-k*c:O*p+k*c;w+=V,x&&n.restore()}h?i.y-=w:i.x+=w*d,n.restore(),this.compose()}showType3Text(e){const i=this.ctx,r=this.current,o=r.font,n=r.fontSize,s=r.fontDirection,a=o.vertical?1:-1,l=r.charSpacing,c=r.wordSpacing,d=r.textHScale*s,u=r.fontMatrix||JZ,h=e.length,A=r.textRenderingMode===Ha.INVISIBLE;let g,p,m,f;if(!(A||n===0)){for(this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,i.save(),i.transform(...r.textMatrix),i.translate(r.x,r.y),i.scale(d,s),g=0;g<h;++g){if(p=e[g],typeof p=="number"){f=a*p*n/1e3,this.ctx.translate(f,0),r.x+=f*d;continue}const v=(p.isSpace?c:0)+l,y=o.charProcOperatorList[p.operatorListId];if(!y){or(`Type3 character "${p.operatorListId}" is not available.`);continue}this.contentVisible&&(this.processingType3=p,this.save(),i.scale(n,n),i.transform(...u),this.executeOperatorList(y),this.restore()),m=bi.applyTransform([p.width,0],u)[0]*n+v,i.translate(m,0),r.x+=m*d}i.restore(),this.processingType3=null}}setCharWidth(e,i){}setCharWidthAndBounds(e,i,r,o,n,s){this.ctx.rect(r,o,n-r,s-o),this.ctx.clip(),this.endPath()}getColorN_Pattern(e){let i;if(e[0]==="TilingPattern"){const r=e[1],o=this.baseTransform||en(this.ctx),n={createCanvasGraphics:s=>new jRe(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};i=new w_i(e,r,this.ctx,n,o)}else i=this._getPattern(e[1],e[2]);return i}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments),this.current.patternStroke=!0}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,i,r){this.ctx.strokeStyle=this.current.strokeColor=bi.makeHexColor(e,i,r),this.current.patternStroke=!1}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,i,r){this.ctx.fillStyle=this.current.fillColor=bi.makeHexColor(e,i,r),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,i=null){let r;return this.cachedPatterns.has(e)?r=this.cachedPatterns.get(e):(r=y_i(this.getObject(e)),this.cachedPatterns.set(e,r)),i&&(r.matrix=i),r}shadingFill(e){if(!this.contentVisible)return;const i=this.ctx;this.save();const r=this._getPattern(e);i.fillStyle=r.getPattern(i,this,eA(i),qa.SHADING);const o=eA(i);if(o){const{width:n,height:s}=i.canvas,[a,l,c,d]=bi.getAxialAlignedBoundingBox([0,0,n,s],o);this.ctx.fillRect(a,l,c-a,d-l)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Mo("Should not call beginInlineImage")}beginImageData(){Mo("Should not call beginImageData")}paintFormXObjectBegin(e,i){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=en(this.ctx),i)){const r=i[2]-i[0],o=i[3]-i[1];this.ctx.rect(i[0],i[1],r,o),this.current.updateRectMinMax(en(this.ctx),i),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 i=this.ctx;e.isolated||kR("TODO: Support non-isolated groups."),e.knockout&&or("Knockout groups not supported.");const r=en(i);if(e.matrix&&i.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let o=bi.getAxialAlignedBoundingBox(e.bbox,en(i));const n=[0,0,i.canvas.width,i.canvas.height];o=bi.intersect(o,n)||[0,0,0,0];const s=Math.floor(o[0]),a=Math.floor(o[1]),l=Math.max(Math.ceil(o[2])-s,1),c=Math.max(Math.ceil(o[3])-a,1);this.current.startNewPathAndClipBox([0,0,l,c]);let d="groupAt"+this.groupLevel;e.smask&&(d+="_smask_"+this.smaskCounter++%2);const u=this.cachedCanvases.getCanvas(d,l,c),h=u.context;h.translate(-s,-a),h.transform(...r),e.smask?this.smaskStack.push({canvas:u.canvas,context:h,offsetX:s,offsetY:a,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(i.setTransform(1,0,0,1,0,0),i.translate(s,a),i.save()),qI(i,h),this.ctx=h,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;const i=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 o=en(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...o);const n=bi.getAxialAlignedBoundingBox([0,0,i.canvas.width,i.canvas.height],o);this.ctx.drawImage(i.canvas,0,0),this.ctx.restore(),this.compose(n)}}beginAnnotation(e,i,r,o,n){if(oe(this,fg,UX).call(this),mF(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),i){const s=i[2]-i[0],a=i[3]-i[1];if(n&&this.annotationCanvasMap){r=r.slice(),r[4]-=i[0],r[5]-=i[1],i=i.slice(),i[0]=i[1]=0,i[2]=s,i[3]=a;const[l,c]=bi.singularValueDecompose2dScale(en(this.ctx)),{viewportScale:d}=this,u=Math.ceil(s*this.outputScaleX*d),h=Math.ceil(a*this.outputScaleY*d);this.annotationCanvas=this.canvasFactory.create(u,h);const{canvas:A,context:g}=this.annotationCanvas;this.annotationCanvasMap.set(e,A),this.annotationCanvas.savedCtx=this.ctx,this.ctx=g,this.ctx.save(),this.ctx.setTransform(l,0,0,-c,0,a*c),mF(this.ctx)}else mF(this.ctx),this.endPath(),this.ctx.rect(i[0],i[1],s,a),this.ctx.clip(),this.ctx.beginPath()}this.current=new Pke(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...r),this.transform(...o)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),oe(this,fg,NX).call(this),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;const i=e.count;e=this.getObject(e.data,e),e.count=i;const r=this.ctx,o=this.processingType3;if(o&&(o.compiled===void 0&&(o.compiled=x_i(e)),o.compiled)){o.compiled(r);return}const n=this._createMaskCanvas(e),s=n.canvas;r.save(),r.setTransform(1,0,0,1,0,0),r.drawImage(s,n.offsetX,n.offsetY),r.restore(),this.compose()}paintImageMaskXObjectRepeat(e,i,r=0,o=0,n,s){if(!this.contentVisible)return;e=this.getObject(e.data,e);const a=this.ctx;a.save();const l=en(a);a.transform(i,r,o,n,0,0);const c=this._createMaskCanvas(e);a.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]);for(let d=0,u=s.length;d<u;d+=2){const h=bi.transform(l,[i,r,o,n,s[d],s[d+1]]),[A,g]=bi.applyTransform([0,0],h);a.drawImage(c.canvas,A,g)}a.restore(),this.compose()}paintImageMaskXObjectGroup(e){if(!this.contentVisible)return;const i=this.ctx,r=this.current.fillColor,o=this.current.patternFill;for(const n of e){const{data:s,width:a,height:l,transform:c}=n,d=this.cachedCanvases.getCanvas("maskCanvas",a,l),u=d.context;u.save();const h=this.getObject(s,n);Fke(u,h),u.globalCompositeOperation="source-in",u.fillStyle=o?r.getPattern(u,this,eA(i),qa.FILL):r,u.fillRect(0,0,a,l),u.restore(),i.save(),i.transform(...c),i.scale(1,-1),fF(i,d.canvas,0,0,a,l,0,-1,1,1),i.restore()}this.compose()}paintImageXObject(e){if(!this.contentVisible)return;const i=this.getObject(e);if(!i){or("Dependent image isn't ready yet");return}this.paintInlineImageXObject(i)}paintImageXObjectRepeat(e,i,r,o){if(!this.contentVisible)return;const n=this.getObject(e);if(!n){or("Dependent image isn't ready yet");return}const s=n.width,a=n.height,l=[];for(let c=0,d=o.length;c<d;c+=2)l.push({transform:[i,0,0,r,o[c],o[c+1]],x:0,y:0,w:s,h:a});this.paintInlineImageXObjectGroup(n,l)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:i,width:r,height:o}=e,n=this.cachedCanvases.getCanvas("inlineImage",r,o),s=n.context;return s.filter=this.current.transferMaps,s.drawImage(i,0,0),s.filter="none",n.canvas}paintInlineImageXObject(e){if(!this.contentVisible)return;const i=e.width,r=e.height,o=this.ctx;if(this.save(),!Oa){const{filter:a}=o;a!=="none"&&a!==""&&(o.filter="none")}o.scale(1/i,-1/r);let n;if(e.bitmap)n=this.applyTransferMapsToBitmap(e);else if(typeof HTMLElement=="function"&&e instanceof HTMLElement||!e.data)n=e;else{const a=this.cachedCanvases.getCanvas("inlineImage",i,r).context;Rke(a,e),n=this.applyTransferMapsToCanvas(a)}const s=this._scaleImage(n,eA(o));o.imageSmoothingEnabled=Lke(en(o),e.interpolate),fF(o,s.img,0,0,s.paintWidth,s.paintHeight,0,-r,i,r),this.compose(),this.restore()}paintInlineImageXObjectGroup(e,i){if(!this.contentVisible)return;const r=this.ctx;let o;if(e.bitmap)o=e.bitmap;else{const n=e.width,s=e.height,a=this.cachedCanvases.getCanvas("inlineImage",n,s).context;Rke(a,e),o=this.applyTransferMapsToCanvas(a)}for(const n of i)r.save(),r.transform(...n.transform),r.scale(1,-1),fF(r,o,n.x,n.y,n.w,n.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,i){}beginMarkedContent(e){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,i){e==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(i)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(e){const i=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(e);const r=this.ctx;this.pendingClip&&(i||(this.pendingClip===Tke?r.clip("evenodd"):r.clip()),this.pendingClip=null),this.current.startNewPathAndClipBox(this.current.clipBox),r.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=en(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const i=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),o=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,o)/i}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:i,b:r,c:o,d:n}=this.ctx.getTransform();let s,a;if(r===0&&o===0){const l=Math.abs(i),c=Math.abs(n);if(l===c)if(e===0)s=a=1/l;else{const d=l*e;s=a=d<1?1/d:1}else if(e===0)s=1/l,a=1/c;else{const d=l*e,u=c*e;s=d<1?1/d:1,a=u<1?1/u:1}}else{const l=Math.abs(i*n-r*o),c=Math.hypot(i,r),d=Math.hypot(o,n);if(e===0)s=d/l,a=c/l;else{const u=e*l;s=d>u?d/u:1,a=c>u?c/u:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(e){const{ctx:i}=this,{lineWidth:r}=this.current,[o,n]=this.getScaleForStroking();if(i.lineWidth=r||1,o===1&&n===1){i.stroke();return}const s=i.getLineDash();if(e&&i.save(),i.scale(o,n),s.length>0){const a=Math.max(o,n);i.setLineDash(s.map(l=>l/a)),i.lineDashOffset/=a}i.stroke(),e&&i.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};fg=new WeakSet,UX=function(){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)},NX=function(){if(this.pageColors){const t=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(t!=="none"){const e=this.ctx.filter;this.ctx.filter=t,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=e}}},OX=function(t,e,i){const r=new Path2D;return r.addPath(t,new DOMMatrix(i).invertSelf().multiplySelf(e)),r};let vF=Q_i;for(const t in Vu)vF.prototype[t]!==void 0&&(vF.prototype[Vu[t]]=vF.prototype[t]);var CF,yF;class mg{static get workerPort(){return S(this,CF)}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");ie(this,CF,e)}static get workerSrc(){return S(this,yF)}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");ie(this,yF,e)}}CF=new WeakMap,yF=new WeakMap,ce(mg,CF,null),ce(mg,yF,"");var h6,wF;class D_i{constructor({parsedData:e,rawData:i}){ce(this,h6),ce(this,wF),ie(this,h6,e),ie(this,wF,i)}getRaw(){return S(this,wF)}get(e){return S(this,h6).get(e)??null}getAll(){return XZ(S(this,h6))}has(e){return S(this,h6).has(e)}}h6=new WeakMap,wF=new WeakMap;const A6=Symbol("INTERNAL");var bF,IF,BF,KI;class P_i{constructor(e,{name:i,intent:r,usage:o,rbGroups:n}){ce(this,bF,!1),ce(this,IF,!1),ce(this,BF,!1),ce(this,KI,!0),ie(this,bF,!!(e&Zc.DISPLAY)),ie(this,IF,!!(e&Zc.PRINT)),this.name=i,this.intent=r,this.usage=o,this.rbGroups=n}get visible(){if(S(this,BF))return S(this,KI);if(!S(this,KI))return!1;const{print:e,view:i}=this.usage;return S(this,bF)?i?.viewState!=="OFF":S(this,IF)?e?.printState!=="OFF":!0}_setVisible(e,i,r=!1){e!==A6&&Mo("Internal method `_setVisible` called."),ie(this,BF,r),ie(this,KI,i)}}bF=new WeakMap,IF=new WeakMap,BF=new WeakMap,KI=new WeakMap;var im,Eo,JI,YI,EF,HX;class R_i{constructor(e,i=Zc.DISPLAY){if(ce(this,EF),ce(this,im,null),ce(this,Eo,new Map),ce(this,JI,null),ce(this,YI,null),this.renderingIntent=i,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,ie(this,YI,e.order);for(const r of e.groups)S(this,Eo).set(r.id,new P_i(i,r));if(e.baseState==="OFF")for(const r of S(this,Eo).values())r._setVisible(A6,!1);for(const r of e.on)S(this,Eo).get(r)._setVisible(A6,!0);for(const r of e.off)S(this,Eo).get(r)._setVisible(A6,!1);ie(this,JI,this.getHash())}}isVisible(e){if(S(this,Eo).size===0)return!0;if(!e)return kR("Optional content group not defined."),!0;if(e.type==="OCG")return S(this,Eo).has(e.id)?S(this,Eo).get(e.id).visible:(or(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return oe(this,EF,HX).call(this,e.expression);if(!e.policy||e.policy==="AnyOn"){for(const i of e.ids){if(!S(this,Eo).has(i))return or(`Optional content group not found: ${i}`),!0;if(S(this,Eo).get(i).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const i of e.ids){if(!S(this,Eo).has(i))return or(`Optional content group not found: ${i}`),!0;if(!S(this,Eo).get(i).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const i of e.ids){if(!S(this,Eo).has(i))return or(`Optional content group not found: ${i}`),!0;if(!S(this,Eo).get(i).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const i of e.ids){if(!S(this,Eo).has(i))return or(`Optional content group not found: ${i}`),!0;if(S(this,Eo).get(i).visible)return!1}return!0}return or(`Unknown optional content policy ${e.policy}.`),!0}return or(`Unknown group type ${e.type}.`),!0}setVisibility(e,i=!0,r=!0){var o;const n=S(this,Eo).get(e);if(!n){or(`Optional content group not found: ${e}`);return}if(r&&i&&n.rbGroups.length)for(const s of n.rbGroups)for(const a of s)a!==e&&((o=S(this,Eo).get(a))==null||o._setVisible(A6,!1,!0));n._setVisible(A6,!!i,!0),ie(this,im,null)}setOCGState({state:e,preserveRB:i}){let r;for(const o of e){switch(o){case"ON":case"OFF":case"Toggle":r=o;continue}const n=S(this,Eo).get(o);if(n)switch(r){case"ON":this.setVisibility(o,!0,i);break;case"OFF":this.setVisibility(o,!1,i);break;case"Toggle":this.setVisibility(o,!n.visible,i);break}}ie(this,im,null)}get hasInitialVisibility(){return S(this,JI)===null||this.getHash()===S(this,JI)}getOrder(){return S(this,Eo).size?S(this,YI)?S(this,YI).slice():[...S(this,Eo).keys()]:null}getGroups(){return S(this,Eo).size>0?XZ(S(this,Eo)):null}getGroup(e){return S(this,Eo).get(e)||null}getHash(){if(S(this,im)!==null)return S(this,im);const e=new dke;for(const[i,r]of S(this,Eo))e.update(`${i}:${r.visible}`);return ie(this,im,e.hexdigest())}}im=new WeakMap,Eo=new WeakMap,JI=new WeakMap,YI=new WeakMap,EF=new WeakSet,HX=function(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let r=1;r<e;r++){const o=t[r];let n;if(Array.isArray(o))n=oe(this,EF,HX).call(this,o);else if(S(this,Eo).has(o))n=S(this,Eo).get(o).visible;else return or(`Optional content group not found: ${o}`),!0;switch(i){case"And":if(!n)return!1;break;case"Or":if(n)return!0;break;case"Not":return!n;default:return!0}}return i==="And"};class F_i{constructor(e,{disableRange:i=!1,disableStream:r=!1}){$n(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:o,initialData:n,progressiveDone:s,contentDispositionFilename:a}=e;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=a,n?.length>0){const l=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!i,this._contentLength=o,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:i}){const r=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const o=this._rangeReaders.some(function(n){return n._begin!==e?!1:(n._enqueue(r),!0)});$n(o,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}_onProgress(e){var i,r,o,n;e.total===void 0?(r=(i=this._rangeReaders[0])==null?void 0:i.onProgress)==null||r.call(i,{loaded:e.loaded}):(n=(o=this._fullRequestReader)==null?void 0:o.onProgress)==null||n.call(o,{loaded:e.loaded,total:e.total})}_onProgressiveDone(){var e;(e=this._fullRequestReader)==null||e.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const i=this._rangeReaders.indexOf(e);i>=0&&this._rangeReaders.splice(i,1)}getFullReader(){$n(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new L_i(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new T_i(this,e,i);return this._pdfDataRangeTransport.requestDataRange(e,i),this._rangeReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeReaders.slice(0))r.cancel(e);this._pdfDataRangeTransport.abort()}}class L_i{constructor(e,i,r=!1,o=null){this._stream=e,this._done=r||!1,this._filename=nX(o)?o:null,this._queuedChunks=i||[],this._loaded=0;for(const n of this._queuedChunks)this._loaded+=n.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class T_i{constructor(e,i,r){this._stream=e,this._begin=i,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const i of this._requests)i.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 i=this._queuedChunk;return this._queuedChunk=null,{value:i,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 i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function __i(t){let e=!0,i=r("filename\\*","i").exec(t);if(i){i=i[1];let d=a(i);return d=unescape(d),d=l(d),d=c(d),n(d)}if(i=s(t),i){const d=c(i);return n(d)}if(i=r("filename","i").exec(t),i){i=i[1];let d=a(i);return d=c(d),n(d)}function r(d,u){return new RegExp("(?:^|;)\\s*"+d+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',u)}function o(d,u){if(d){if(!/^[\x00-\xFF]+$/.test(u))return u;try{const h=new TextDecoder(d,{fatal:!0}),A=SR(u);u=h.decode(A),e=!1}catch{}}return u}function n(d){return e&&/[\x80-\xff]/.test(d)&&(d=o("utf-8",d),e&&(d=o("iso-8859-1",d))),d}function s(d){const u=[];let h;const A=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(h=A.exec(d))!==null;){let[,p,m,f]=h;if(p=parseInt(p,10),p in u){if(p===0)break;continue}u[p]=[m,f]}const g=[];for(let p=0;p<u.length&&p in u;++p){let[m,f]=u[p];f=a(f),m&&(f=unescape(f),p===0&&(f=l(f))),g.push(f)}return g.join("")}function a(d){if(d.startsWith('"')){const u=d.slice(1).split('\\"');for(let h=0;h<u.length;++h){const A=u[h].indexOf('"');A!==-1&&(u[h]=u[h].slice(0,A),u.length=h+1),u[h]=u[h].replaceAll(/\\(.)/g,"$1")}d=u.join('"')}return d}function l(d){const u=d.indexOf("'");if(u===-1)return d;const h=d.slice(0,u),A=d.slice(u+1).replace(/^[^']*'/,"");return o(h,A)}function c(d){return!d.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(d)?d:d.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(u,h,A,g){if(A==="q"||A==="Q")return g=g.replaceAll("_"," "),g=g.replaceAll(/=([0-9a-fA-F]{2})/g,function(p,m){return String.fromCharCode(parseInt(m,16))}),o(h,g);try{g=atob(g)}catch{}return o(h,g)})}return""}function _ke(t,e){const i=new Headers;if(!t||!e||typeof e!="object")return i;for(const r in e){const o=e[r];o!==void 0&&i.append(r,o)}return i}function xF(t){try{return new URL(t).origin}catch{}return null}function Uke({responseHeaders:t,isHttp:e,rangeChunkSize:i,disableRange:r}){const o={allowRangeRequests:!1,suggestedLength:void 0},n=parseInt(t.get("Content-Length"),10);return!Number.isInteger(n)||(o.suggestedLength=n,n<=2*i)||r||!e||t.get("Accept-Ranges")!=="bytes"||(t.get("Content-Encoding")||"identity")!=="identity"||(o.allowRangeRequests=!0),o}function Nke(t){const e=t.get("Content-Disposition");if(e){let i=__i(e);if(i.includes("%"))try{i=decodeURIComponent(i)}catch{}if(nX(i))return i}return null}function kF(t,e){return t===404||t===0&&e.startsWith("file:")?new pI('Missing PDF "'+e+'".'):new MR(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)}function Oke(t){return t===200||t===206}function Hke(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function Vke(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(or(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class jke{constructor(e){ai(this,"_responseOrigin",null),this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=_ke(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return $n(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new U_i(this),this._fullRequestReader}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new N_i(this,e,i);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class U_i{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const i=e.source;this._withCredentials=i.withCredentials||!1,this._contentLength=i.length,this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange;const r=new Headers(e.headers),o=i.url;fetch(o,Hke(r,this._withCredentials,this._abortController)).then(n=>{if(e._responseOrigin=xF(n.url),!Oke(n.status))throw kF(n.status,o);this._reader=n.body.getReader(),this._headersCapability.resolve();const s=n.headers,{allowRangeRequests:a,suggestedLength:l}=Uke({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=l||this._contentLength,this._filename=Nke(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new og("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._headersCapability.promise;const{value:i,done:r}=await this._reader.read();return r?{value:i,done:r}:(this._loaded+=i.byteLength,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:Vke(i),done:!1})}cancel(e){var i;(i=this._reader)==null||i.cancel(e),this._abortController.abort()}}class N_i{constructor(e,i,r){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController;const n=new Headers(e.headers);n.append("Range",`bytes=${i}-${r-1}`);const s=o.url;fetch(s,Hke(n,this._withCredentials,this._abortController)).then(a=>{const l=xF(a.url);if(l!==e._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${e._responseOrigin}".`);if(!Oke(a.status))throw kF(a.status,s);this._readCapability.resolve(),this._reader=a.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;await this._readCapability.promise;const{value:i,done:r}=await this._reader.read();return r?{value:i,done:r}:(this._loaded+=i.byteLength,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded}),{value:Vke(i),done:!1})}cancel(e){var i;(i=this._reader)==null||i.cancel(e),this._abortController.abort()}}const VX=200,jX=206;function O_i(t){const e=t.response;return typeof e!="string"?e:SR(e).buffer}class H_i{constructor({url:e,httpHeaders:i,withCredentials:r}){ai(this,"_responseOrigin",null),this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=_ke(this.isHttp,i),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const i=new XMLHttpRequest,r=this.currXhrId++,o=this.pendingRequests[r]={xhr:i};i.open("GET",this.url),i.withCredentials=this.withCredentials;for(const[n,s]of this.headers)i.setRequestHeader(n,s);return this.isHttp&&"begin"in e&&"end"in e?(i.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),o.expectedStatus=jX):o.expectedStatus=VX,i.responseType="arraybuffer",$n(e.onError,"Expected `onError` callback to be provided."),i.onerror=()=>{e.onError(i.status)},i.onreadystatechange=this.onStateChange.bind(this,r),i.onprogress=this.onProgress.bind(this,r),o.onHeadersReceived=e.onHeadersReceived,o.onDone=e.onDone,o.onError=e.onError,o.onProgress=e.onProgress,i.send(null),r}onProgress(e,i){var r;const o=this.pendingRequests[e];o&&((r=o.onProgress)==null||r.call(o,i))}onStateChange(e,i){const r=this.pendingRequests[e];if(!r)return;const o=r.xhr;if(o.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),o.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],o.status===0&&this.isHttp){r.onError(o.status);return}const n=o.status||VX;if(!(n===VX&&r.expectedStatus===jX)&&n!==r.expectedStatus){r.onError(o.status);return}const s=O_i(o);if(n===jX){const a=o.getResponseHeader("Content-Range"),l=/bytes (\d+)-(\d+)\/(\d+)/.exec(a);l?r.onDone({begin:parseInt(l[1],10),chunk:s}):(or('Missing or invalid "Content-Range" header.'),r.onError(0))}else s?r.onDone({begin:0,chunk:s}):r.onError(o.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const i=this.pendingRequests[e].xhr;delete this.pendingRequests[e],i.abort()}}class V_i{constructor(e){this._source=e,this._manager=new H_i(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const i=this._rangeRequestReaders.indexOf(e);i>=0&&this._rangeRequestReaders.splice(i,1)}getFullReader(){return $n(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new j_i(this._manager,this._source),this._fullRequestReader}getRangeReader(e,i){const r=new G_i(this._manager,e,i);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class j_i{constructor(e,i){this._manager=e,this._url=i.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._contentLength=i.length,this._rangeChunkSize=i.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,i=this._manager.getRequestXhr(e);this._manager._responseOrigin=xF(i.responseURL);const r=i.getAllResponseHeaders(),o=new Headers(r?r.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(a=>{const[l,...c]=a.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:n,suggestedLength:s}=Uke({responseHeaders:o,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=Nke(o),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=kF(e,this._url),this._headersCapability.reject(this._storedError);for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){var i;(i=this.onProgress)==null||i.call(this,{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(await this._headersCapability.promise,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 i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class G_i{constructor(e,i,r){this._manager=e,this._url=e.url,this._requestId=e.request({begin:i,end:r,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){var e;const i=xF((e=this._manager.getRequestXhr(this._requestId))==null?void 0:e.responseURL);i!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${i}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){var e;(e=this.onClosed)==null||e.call(this,this)}_onDone(e){const i=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:i,done:!1}):this._queuedChunk=i,this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??(this._storedError=kF(e,this._url));for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){var i;this.isStreamingSupported||(i=this.onProgress)==null||i.call(this,{loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const i=this._queuedChunk;return this._queuedChunk=null,{value:i,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 i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const z_i=/^[a-z][a-z0-9\-+.]+:/i;function q_i(t){if(z_i.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}class K_i{constructor(e){this.source=e,this.url=q_i(e.url),$n(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){var e;return((e=this._fullRequestReader)==null?void 0:e._loaded)??0}getFullReader(){return $n(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new J_i(this),this._fullRequestReader}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new Y_i(this,e,i);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){var i;(i=this._fullRequestReader)==null||i.cancel(e);for(const r of this._rangeRequestReaders.slice(0))r.cancel(e)}}class J_i{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const i=e.source;this._contentLength=i.length,this._loaded=0,this._filename=null,this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const r=process.getBuiltinModule("fs");r.promises.lstat(this._url).then(o=>{this._contentLength=o.size,this._setReadableStream(r.createReadStream(this._url)),this._headersCapability.resolve()},o=>{o.code==="ENOENT"&&(o=new pI(`Missing PDF "${this._url}".`)),this._storedError=o,this._headersCapability.reject(o)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const i=this._readableStream.read();return i===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=i.length,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(i).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(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",i=>{this._error(i)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new og("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class Y_i{constructor(e,i,r){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const o=e.source;this._isStreamingSupported=!o.disableStream;const n=process.getBuiltinModule("fs");this._setReadableStream(n.createReadStream(this._url,{start:i,end:r-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){var e;if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const i=this._readableStream.read();return i===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=i.length,(e=this.onProgress)==null||e.call(this,{loaded:this._loaded}),{value:new Uint8Array(i).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(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",i=>{this._error(i)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const W_i=1e5,uc=30,Z_i=.8;var Gke,rm,ed,MF,SF,om,vg,QF,DF,p6,WI,ZI,nm,XI,PF,$I,g6,RF,FF,f6,m6,LF,sm,eB,v6,zke,qke,GX,W1,TF,zX,Kke,Jke;const hc=class JE{constructor({textContentSource:e,container:i,viewport:r}){ce(this,v6),ce(this,rm,Promise.withResolvers()),ce(this,ed,null),ce(this,MF,!1),ce(this,SF,!!((Gke=globalThis.FontInspector)!=null&&Gke.enabled)),ce(this,om,null),ce(this,vg,null),ce(this,QF,0),ce(this,DF,0),ce(this,p6,null),ce(this,WI,null),ce(this,ZI,0),ce(this,nm,0),ce(this,XI,Object.create(null)),ce(this,PF,[]),ce(this,$I,null),ce(this,g6,[]),ce(this,RF,new WeakMap),ce(this,FF,null);var o;if(e instanceof ReadableStream)ie(this,$I,e);else if(typeof e=="object")ie(this,$I,new ReadableStream({start(c){c.enqueue(e),c.close()}}));else throw new Error('No "textContentSource" parameter specified.');ie(this,ed,ie(this,WI,i)),ie(this,nm,r.scale*(globalThis.devicePixelRatio||1)),ie(this,ZI,r.rotation),ie(this,vg,{div:null,properties:null,ctx:null});const{pageWidth:n,pageHeight:s,pageX:a,pageY:l}=r.rawDims;ie(this,FF,[1,0,0,-1,-a,l+s]),ie(this,DF,n),ie(this,QF,s),oe(o=JE,W1,Kke).call(o),H2(i,r),S(this,rm).promise.finally(()=>{S(JE,eB).delete(this),ie(this,vg,null),ie(this,XI,null)}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:i}=xl.platform;return pr(this,"fontFamilyMap",new Map([["sans-serif",`${e&&i?"Calibri, ":""}sans-serif`],["monospace",`${e&&i?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{S(this,p6).read().then(({value:i,done:r})=>{if(r){S(this,rm).resolve();return}S(this,om)??ie(this,om,i.lang),Object.assign(S(this,XI),i.styles),oe(this,v6,zke).call(this,i.items),e()},S(this,rm).reject)};return ie(this,p6,S(this,$I).getReader()),S(JE,eB).add(this),e(),S(this,rm).promise}update({viewport:e,onBefore:i=null}){var r;const o=e.scale*(globalThis.devicePixelRatio||1),n=e.rotation;if(n!==S(this,ZI)&&(i?.(),ie(this,ZI,n),H2(S(this,WI),{rotation:n})),o!==S(this,nm)){i?.(),ie(this,nm,o);const s={div:null,properties:null,ctx:oe(r=JE,W1,TF).call(r,S(this,om))};for(const a of S(this,g6))s.properties=S(this,RF).get(a),s.div=a,oe(this,v6,GX).call(this,s)}}cancel(){var e;const i=new og("TextLayer task cancelled.");(e=S(this,p6))==null||e.cancel(i).catch(()=>{}),ie(this,p6,null),S(this,rm).reject(i)}get textDivs(){return S(this,g6)}get textContentItemsStr(){return S(this,PF)}static cleanup(){if(!(S(this,eB).size>0)){S(this,f6).clear();for(const{canvas:e}of S(this,m6).values())e.remove();S(this,m6).clear()}}};rm=new WeakMap,ed=new WeakMap,MF=new WeakMap,SF=new WeakMap,om=new WeakMap,vg=new WeakMap,QF=new WeakMap,DF=new WeakMap,p6=new WeakMap,WI=new WeakMap,ZI=new WeakMap,nm=new WeakMap,XI=new WeakMap,PF=new WeakMap,$I=new WeakMap,g6=new WeakMap,RF=new WeakMap,FF=new WeakMap,f6=new WeakMap,m6=new WeakMap,LF=new WeakMap,sm=new WeakMap,eB=new WeakMap,v6=new WeakSet,zke=function(t){var e,i;if(S(this,MF))return;(i=S(this,vg)).ctx??(i.ctx=oe(e=hc,W1,TF).call(e,S(this,om)));const r=S(this,g6),o=S(this,PF);for(const n of t){if(r.length>W_i){or("Ignoring additional textDivs for performance reasons."),ie(this,MF,!0);return}if(n.str===void 0){if(n.type==="beginMarkedContentProps"||n.type==="beginMarkedContent"){const s=S(this,ed);ie(this,ed,document.createElement("span")),S(this,ed).classList.add("markedContent"),n.id!==null&&S(this,ed).setAttribute("id",`${n.id}`),s.append(S(this,ed))}else n.type==="endMarkedContent"&&ie(this,ed,S(this,ed).parentNode);continue}o.push(n.str),oe(this,v6,qke).call(this,n)}},qke=function(t){var e;const i=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,fontSize:0};S(this,g6).push(i);const o=bi.transform(S(this,FF),t.transform);let n=Math.atan2(o[1],o[0]);const s=S(this,XI)[t.fontName];s.vertical&&(n+=Math.PI/2);let a=S(this,SF)&&s.fontSubstitution||s.fontFamily;a=hc.fontFamilyMap.get(a)||a;const l=Math.hypot(o[2],o[3]),c=l*oe(e=hc,W1,Jke).call(e,a,S(this,om));let d,u;n===0?(d=o[4],u=o[5]-c):(d=o[4]+c*Math.sin(n),u=o[5]-c*Math.cos(n));const h="calc(var(--scale-factor)*",A=i.style;S(this,ed)===S(this,WI)?(A.left=`${(100*d/S(this,DF)).toFixed(2)}%`,A.top=`${(100*u/S(this,QF)).toFixed(2)}%`):(A.left=`${h}${d.toFixed(2)}px)`,A.top=`${h}${u.toFixed(2)}px)`),A.fontSize=`${h}${(S(hc,sm)*l).toFixed(2)}px)`,A.fontFamily=a,r.fontSize=l,i.setAttribute("role","presentation"),i.textContent=t.str,i.dir=t.dir,S(this,SF)&&(i.dataset.fontName=s.fontSubstitutionLoadedName||t.fontName),n!==0&&(r.angle=n*(180/Math.PI));let g=!1;if(t.str.length>1)g=!0;else if(t.str!==" "&&t.transform[0]!==t.transform[3]){const p=Math.abs(t.transform[0]),m=Math.abs(t.transform[3]);p!==m&&Math.max(p,m)/Math.min(p,m)>1.5&&(g=!0)}if(g&&(r.canvasWidth=s.vertical?t.height:t.width),S(this,RF).set(i,r),S(this,vg).div=i,S(this,vg).properties=r,oe(this,v6,GX).call(this,S(this,vg)),r.hasText&&S(this,ed).append(i),r.hasEOL){const p=document.createElement("br");p.setAttribute("role","presentation"),S(this,ed).append(p)}},GX=function(t){var e;const{div:i,properties:r,ctx:o}=t,{style:n}=i;let s="";if(S(hc,sm)>1&&(s=`scale(${1/S(hc,sm)})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:a}=n,{canvasWidth:l,fontSize:c}=r;oe(e=hc,W1,zX).call(e,o,c*S(this,nm),a);const{width:d}=o.measureText(i.textContent);d>0&&(s=`scaleX(${l*S(this,nm)/d}) ${s}`)}r.angle!==0&&(s=`rotate(${r.angle}deg) ${s}`),s.length>0&&(n.transform=s)},W1=new WeakSet,TF=function(t=null){let e=S(this,m6).get(t||(t=""));if(!e){const i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=t,document.body.append(i),e=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),S(this,m6).set(t,e),S(this,LF).set(e,{size:0,family:""})}return e},zX=function(t,e,i){const r=S(this,LF).get(t);e===r.size&&i===r.family||(t.font=`${e}px ${i}`,r.size=e,r.family=i)},Kke=function(){if(S(this,sm)!==null)return;const t=document.createElement("div");t.style.opacity=0,t.style.lineHeight=1,t.style.fontSize="1px",t.style.position="absolute",t.textContent="X",document.body.append(t),ie(this,sm,t.getBoundingClientRect().height),t.remove()},Jke=function(t,e){const i=S(this,f6).get(t);if(i)return i;const r=oe(this,W1,TF).call(this,e);r.canvas.width=r.canvas.height=uc,oe(this,W1,zX).call(this,r,uc,t);const o=r.measureText("");let n=o.fontBoundingBoxAscent,s=Math.abs(o.fontBoundingBoxDescent);if(n){const c=n/(n+s);return S(this,f6).set(t,c),r.canvas.width=r.canvas.height=0,c}r.strokeStyle="red",r.clearRect(0,0,uc,uc),r.strokeText("g",0,0);let a=r.getImageData(0,0,uc,uc).data;s=0;for(let c=a.length-1-3;c>=0;c-=4)if(a[c]>0){s=Math.ceil(c/4/uc);break}r.clearRect(0,0,uc,uc),r.strokeText("A",0,uc),a=r.getImageData(0,0,uc,uc).data,n=0;for(let c=0,d=a.length;c<d;c+=4)if(a[c]>0){n=uc-Math.floor(c/4/uc);break}r.canvas.width=r.canvas.height=0;const l=n?n/(n+s):Z_i;return S(this,f6).set(t,l),l},ce(hc,W1),ce(hc,f6,new Map),ce(hc,m6,new Map),ce(hc,LF,new WeakMap),ce(hc,sm,null),ce(hc,eB,new Set);let qX=hc;class sx{static textContent(e){const i=[],r={items:i,styles:Object.create(null)};function o(n){var s;if(!n)return;let a=null;const l=n.name;if(l==="#text")a=n.value;else if(sx.shouldBuildText(l))(s=n?.attributes)!=null&&s.textContent?a=n.attributes.textContent:n.value&&(a=n.value);else return;if(a!==null&&i.push({str:a}),!!n.children)for(const c of n.children)o(c)}return o(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}const X_i=65536,$_i=100,eUi=5e3,tUi=Oa?A_i:d_i,iUi=Oa?p_i:yke,rUi=Oa?h_i:u_i,oUi=Oa?g_i:Bke;function nUi(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new lUi,{docId:i}=e,r=t.url?sUi(t.url):null,o=t.data?aUi(t.data):null,n=t.httpHeaders||null,s=t.withCredentials===!0,a=t.password??null,l=t.range instanceof Zke?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:X_i;let d=t.worker instanceof OF?t.worker:null;const u=t.verbosity,h=typeof t.docBaseUrl=="string"&&!PR(t.docBaseUrl)?t.docBaseUrl:null,A=typeof t.cMapUrl=="string"?t.cMapUrl:null,g=t.cMapPacked!==!1,p=t.CMapReaderFactory||iUi,m=typeof t.standardFontDataUrl=="string"?t.standardFontDataUrl:null,f=t.StandardFontDataFactory||oUi,v=t.stopAtErrors!==!0,y=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,C=t.isEvalSupported!==!1,w=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!Oa,b=typeof t.isImageDecoderSupported=="boolean"?t.isImageDecoderSupported:!Oa&&(xl.platform.isFirefox||!globalThis.chrome),E=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,x=typeof t.disableFontFace=="boolean"?t.disableFontFace:Oa,k=t.fontExtraProperties===!0,M=t.enableXfa===!0,D=t.ownerDocument||globalThis.document,P=t.disableRange===!0,L=t.disableStream===!0,O=t.disableAutoFetch===!0,V=t.pdfBug===!0,_=t.CanvasFactory||tUi,H=t.FilterFactory||rUi,Y=t.enableHWA===!0,re=l?l.length:t.length??NaN,de=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!Oa&&!x,xe=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:p===yke&&f===Bke&&A&&m&&gI(A,document.baseURI)&&gI(m,document.baseURI),pe=null;NTi(u);const Ee={canvasFactory:new _({ownerDocument:D,enableHWA:Y}),filterFactory:new H({docId:i,ownerDocument:D}),cMapReaderFactory:xe?null:new p({baseUrl:A,isCompressed:g}),standardFontDataFactory:xe?null:new f({baseUrl:m})};if(!d){const Ie={verbosity:u,port:mg.workerPort};d=Ie.port?OF.fromPort(Ie):new OF(Ie),e._worker=d}const ue={docId:i,apiVersion:"4.10.38",data:o,password:a,disableAutoFetch:O,rangeChunkSize:c,length:re,docBaseUrl:h,enableXfa:M,evaluatorOptions:{maxImageSize:y,disableFontFace:x,ignoreErrors:v,isEvalSupported:C,isOffscreenCanvasSupported:w,isImageDecoderSupported:b,canvasMaxAreaInBytes:E,fontExtraProperties:k,useSystemFonts:de,cMapUrl:xe?A:null,standardFontDataUrl:xe?m:null}},De={disableFontFace:x,fontExtraProperties:k,ownerDocument:D,pdfBug:V,styleElement:pe,loadingParams:{disableAutoFetch:O,enableXfa:M}};return d.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const Ie=d.messageHandler.sendWithPromise("GetDocRequest",ue,o?[o.buffer]:null);let Z;if(l)Z=new F_i(l,{disableRange:P,disableStream:L});else if(!o){if(!r)throw new Error("getDocument - no `url` parameter provided.");let ae;if(Oa)if(gI(r)){if(typeof fetch>"u"||typeof Response>"u"||!("body"in Response.prototype))throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`.");ae=jke}else ae=K_i;else ae=gI(r)?jke:V_i;Z=new ae({url:r,length:re,httpHeaders:n,withCredentials:s,rangeChunkSize:c,disableRange:P,disableStream:L})}return Ie.then(ae=>{if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const le=new HI(i,ae,d.port),Ae=new hUi(le,e,Z,De,Ee);e._transport=Ae,le.send("Ready",null)})}).catch(e._capability.reject),e}function sUi(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(Oa&&typeof t=="string")return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function aUi(t){if(Oa&&typeof Buffer<"u"&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if(typeof t=="string")return SR(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof t=="object"&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function Yke(t){return typeof t=="object"&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0}var KX;const Wke=class GRe{constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${Ol(GRe,KX)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var e,i,r,o;this.destroyed=!0;try{(e=this._worker)!=null&&e.port&&(this._worker._pendingDestroy=!0),await((i=this._transport)==null?void 0:i.destroy())}catch(n){throw(r=this._worker)!=null&&r.port&&delete this._worker._pendingDestroy,n}this._transport=null,(o=this._worker)==null||o.destroy(),this._worker=null}};KX=new WeakMap,ce(Wke,KX,0);let lUi=Wke;class Zke{constructor(e,i,r=!1,o=null){this.length=e,this.initialData=i,this.progressiveDone=r,this.contentDispositionFilename=o,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,i){for(const r of this._rangeListeners)r(e,i)}onDataProgress(e,i){this._readyCapability.promise.then(()=>{for(const r of this._progressListeners)r(e,i)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(const i of this._progressiveReadListeners)i(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,i){Mo("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class cUi{constructor(e,i){this._pdfInfo=e,this._transport=i}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 pr(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)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(i)}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()}}var am,Cg,lA,C6,_F;class dUi{constructor(e,i,r,o=!1){ce(this,lA),ce(this,am,null),ce(this,Cg,!1),this._pageIndex=e,this._pageInfo=i,this._transport=r,this._stats=o?new Mxe:null,this._pdfBug=o,this.commonObjs=r.commonObjs,this.objs=new Xke,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:i=this.rotate,offsetX:r=0,offsetY:o=0,dontFlip:n=!1}={}){return new nx({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:i,offsetX:r,offsetY:o,dontFlip:n})}getAnnotations({intent:e="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,i)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return pr(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var e;return((e=this._transport._htmlForXfa)==null?void 0:e.children[this._pageIndex])||null}render({canvasContext:e,viewport:i,intent:r="display",annotationMode:o=ig.ENABLE,transform:n=null,background:s=null,optionalContentConfigPromise:a=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:d=null,isEditing:u=!1}){var h,A;(h=this._stats)==null||h.time("Overall");const g=this._transport.getRenderingIntent(r,o,d,u),{renderingIntent:p,cacheKey:m}=g;ie(this,Cg,!1),oe(this,lA,_F).call(this),a||(a=this._transport.getOptionalContentConfig(p));let f=this._intentStates.get(m);f||(f=Object.create(null),this._intentStates.set(m,f)),f.streamReaderCancelTimeout&&(clearTimeout(f.streamReaderCancelTimeout),f.streamReaderCancelTimeout=null);const v=!!(p&Zc.PRINT);f.displayReadyCapability||(f.displayReadyCapability=Promise.withResolvers(),f.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(A=this._stats)==null||A.time("Page Request"),this._pumpOperatorList(g));const y=b=>{var E;f.renderTasks.delete(C),(this._maybeCleanupAfterRender||v)&&ie(this,Cg,!0),oe(this,lA,C6).call(this,!v),b?(C.capability.reject(b),this._abortOperatorList({intentState:f,reason:b instanceof Error?b:new Error(b)})):C.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),(E=globalThis.Stats)!=null&&E.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},C=new pUi({callback:y,params:{canvasContext:e,viewport:i,transform:n,background:s},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:f.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:c});(f.renderTasks||(f.renderTasks=new Set)).add(C);const w=C.task;return Promise.all([f.displayReadyCapability.promise,a]).then(([b,E])=>{var x;if(this.destroyed){y();return}if((x=this._stats)==null||x.time("Rendering"),!(E.renderingIntent&p))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");C.initializeGraphics({transparency:b,optionalContentConfig:E}),C.operatorListChanged()}).catch(y),w}getOperatorList({intent:e="display",annotationMode:i=ig.ENABLE,printAnnotationStorage:r=null,isEditing:o=!1}={}){var n;function s(){l.operatorList.lastChunk&&(l.opListReadCapability.resolve(l.operatorList),l.renderTasks.delete(c))}const a=this._transport.getRenderingIntent(e,i,r,o,!0);let l=this._intentStates.get(a.cacheKey);l||(l=Object.create(null),this._intentStates.set(a.cacheKey,l));let c;return l.opListReadCapability||(c=Object.create(null),c.operatorListChanged=s,l.opListReadCapability=Promise.withResolvers(),(l.renderTasks||(l.renderTasks=new Set)).add(c),l.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(n=this._stats)==null||n.time("Page Request"),this._pumpOperatorList(a)),l.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:i=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:i===!0},{highWaterMark:100,size(r){return r.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>sx.textContent(r));const i=this.streamTextContent(e);return new Promise(function(r,o){function n(){s.read().then(function({value:l,done:c}){if(c){r(a);return}a.lang??(a.lang=l.lang),Object.assign(a.styles,l.styles),a.items.push(...l.items),n()},o)}const s=i.getReader(),a={items:[],styles:Object.create(null),lang:null};n()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const i of this._intentStates.values())if(this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0}),!i.opListReadCapability)for(const r of i.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),ie(this,Cg,!1),oe(this,lA,_F).call(this),Promise.all(e)}cleanup(e=!1){ie(this,Cg,!0);const i=oe(this,lA,C6).call(this,!1);return e&&i&&this._stats&&(this._stats=new Mxe),i}_startRenderPage(e,i){var r,o;const n=this._intentStates.get(i);n&&((r=this._stats)==null||r.timeEnd("Page Request"),(o=n.displayReadyCapability)==null||o.resolve(e))}_renderPageChunk(e,i){for(let r=0,o=e.length;r<o;r++)i.operatorList.fnArray.push(e.fnArray[r]),i.operatorList.argsArray.push(e.argsArray[r]);i.operatorList.lastChunk=e.lastChunk,i.operatorList.separateAnnots=e.separateAnnots;for(const r of i.renderTasks)r.operatorListChanged();e.lastChunk&&oe(this,lA,C6).call(this,!0)}_pumpOperatorList({renderingIntent:e,cacheKey:i,annotationStorageSerializable:r,modifiedIds:o}){const{map:n,transfer:s}=r,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:n,modifiedIds:o},s).getReader(),l=this._intentStates.get(i);l.streamReader=a;const c=()=>{a.read().then(({value:d,done:u})=>{if(u){l.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,l),c())},d=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const u of l.renderTasks)u.operatorListChanged();oe(this,lA,C6).call(this,!0)}if(l.displayReadyCapability)l.displayReadyCapability.reject(d);else if(l.opListReadCapability)l.opListReadCapability.reject(d);else throw d}})};c()}_abortOperatorList({intentState:e,reason:i,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(i instanceof oX){let o=$_i;i.extraDelay>0&&i.extraDelay<1e3&&(o+=i.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})},o);return}}if(e.streamReader.cancel(new og(i.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[o,n]of this._intentStates)if(n===e){this._intentStates.delete(o);break}this.cleanup()}}}get stats(){return this._stats}}am=new WeakMap,Cg=new WeakMap,lA=new WeakSet,C6=function(t=!1){if(oe(this,lA,_F).call(this),!S(this,Cg)||this.destroyed)return!1;if(t)return ie(this,am,setTimeout(()=>{ie(this,am,null),oe(this,lA,C6).call(this,!1)},eUi)),!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),ie(this,Cg,!1),!0},_F=function(){S(this,am)&&(clearTimeout(S(this,am)),ie(this,am,null))};var yg,JX;class uUi{constructor(){ce(this,yg,new Map),ce(this,JX,Promise.resolve())}postMessage(e,i){const r={data:structuredClone(e,i?{transfer:i}:null)};S(this,JX).then(()=>{for(const[o]of S(this,yg))o.call(this,r)})}addEventListener(e,i,r=null){let o=null;if(r?.signal instanceof AbortSignal){const{signal:n}=r;if(n.aborted){or("LoopbackPort - cannot use an `aborted` signal.");return}const s=()=>this.removeEventListener(e,i);o=()=>n.removeEventListener("abort",s),n.addEventListener("abort",s)}S(this,yg).set(i,o)}removeEventListener(e,i){const r=S(this,yg).get(i);r?.(),S(this,yg).delete(i)}terminate(){for(const[,e]of S(this,yg))e?.();S(this,yg).clear()}}yg=new WeakMap,JX=new WeakMap;var YX,y6,lm,tB,UF,iB,NF;const wg=class _l{constructor({name:e=null,port:i=null,verbosity:r=OTi()}={}){ce(this,tB);var o;if(this.name=e,this.destroyed=!1,this.verbosity=r,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,i){if((o=S(_l,lm))!=null&&o.has(i))throw new Error("Cannot use more than one PDFWorker per port.");(S(_l,lm)||ie(_l,lm,new WeakMap)).set(i,this),this._initializeFromPort(i);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new HI("main","worker",e),this._messageHandler.on("ready",function(){}),oe(this,tB,UF).call(this)}_initialize(){if(S(_l,y6)||S(_l,iB,NF)){this._setupFakeWorker();return}let{workerSrc:e}=_l;try{_l._isSameOrigin(window.location.href,e)||(e=_l._createCDNWrapper(new URL(e,window.location).href));const i=new Worker(e,{type:"module"}),r=new HI("main","worker",i),o=()=>{n.abort(),r.destroy(),i.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},n=new AbortController;i.addEventListener("error",()=>{this._webWorker||o()},{signal:n.signal}),r.on("test",a=>{if(n.abort(),this.destroyed||!a){o();return}this._messageHandler=r,this._port=i,this._webWorker=i,oe(this,tB,UF).call(this)}),r.on("ready",a=>{if(n.abort(),this.destroyed){o();return}try{s()}catch{this._setupFakeWorker()}});const s=()=>{const a=new Uint8Array;r.send("test",a,[a.buffer])};s();return}catch{kR("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){S(_l,y6)||(or("Setting up fake worker."),ie(_l,y6,!0)),_l._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const i=new uUi;this._port=i;const r=`fake${Ol(_l,YX)._++}`,o=new HI(r+"_worker",r,i);e.setup(o,i),this._messageHandler=new HI(r,r+"_worker",i),oe(this,tB,UF).call(this)}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){var e,i,r;this.destroyed=!0,(e=this._webWorker)==null||e.terminate(),this._webWorker=null,(i=S(_l,lm))==null||i.delete(this._port),this._port=null,(r=this._messageHandler)==null||r.destroy(),this._messageHandler=null}static fromPort(e){var i;if(!(e!=null&&e.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const r=(i=S(this,lm))==null?void 0:i.get(e.port);if(r){if(r._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return r}return new _l(e)}static get workerSrc(){if(mg.workerSrc)return mg.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return pr(this,"_setupFakeWorkerGlobal",(async()=>S(this,iB,NF)?S(this,iB,NF):(await import(this.workerSrc)).WorkerMessageHandler)())}};YX=new WeakMap,y6=new WeakMap,lm=new WeakMap,tB=new WeakSet,UF=function(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})},iB=new WeakSet,NF=function(){var t;try{return((t=globalThis.pdfjsWorker)==null?void 0:t.WorkerMessageHandler)||null}catch{return null}},ce(wg,iB),ce(wg,YX,0),ce(wg,y6,!1),ce(wg,lm),Oa&&(ie(wg,y6,!0),mg.workerSrc||(mg.workerSrc="./pdf.worker.mjs")),wg._isSameOrigin=(t,e)=>{let i;try{if(i=new URL(t),!i.origin||i.origin==="null")return!1}catch{return!1}const r=new URL(e,i);return i.origin===r.origin},wg._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};let OF=wg;var bg,Z1,rB,oB,Ig,w6,nB;class hUi{constructor(e,i,r,o,n){ce(this,w6),ce(this,bg,new Map),ce(this,Z1,new Map),ce(this,rB,new Map),ce(this,oB,new Map),ce(this,Ig,null),this.messageHandler=e,this.loadingTask=i,this.commonObjs=new Xke,this.fontLoader=new l_i({ownerDocument:o.ownerDocument,styleElement:o.styleElement}),this.loadingParams=o.loadingParams,this._params=o,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return pr(this,"annotationStorage",new PX)}getRenderingIntent(e,i=ig.ENABLE,r=null,o=!1,n=!1){let s=Zc.DISPLAY,a=QX;switch(e){case"any":s=Zc.ANY;break;case"display":break;case"print":s=Zc.PRINT;break;default:or(`getRenderingIntent - invalid intent: ${e}`)}const l=s&Zc.PRINT&&r instanceof hke?r:this.annotationStorage;switch(i){case ig.DISABLE:s+=Zc.ANNOTATIONS_DISABLE;break;case ig.ENABLE:break;case ig.ENABLE_FORMS:s+=Zc.ANNOTATIONS_FORMS;break;case ig.ENABLE_STORAGE:s+=Zc.ANNOTATIONS_STORAGE,a=l.serializable;break;default:or(`getRenderingIntent - invalid annotationMode: ${i}`)}o&&(s+=Zc.IS_EDITING),n&&(s+=Zc.OPLIST);const{ids:c,hash:d}=l.modifiedIds,u=[s,a.hash,d];return{renderingIntent:s,cacheKey:u.join("_"),annotationStorageSerializable:a,modifiedIds:c}}destroy(){var e;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),(e=S(this,Ig))==null||e.reject(new Error("Worker was destroyed during onPassword callback"));const i=[];for(const o of S(this,Z1).values())i.push(o._destroy());S(this,Z1).clear(),S(this,rB).clear(),S(this,oB).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const r=this.messageHandler.sendWithPromise("Terminate",null);return i.push(r),Promise.all(i).then(()=>{var o,n;this.commonObjs.clear(),this.fontLoader.clear(),S(this,bg).clear(),this.filterFactory.destroy(),qX.cleanup(),(o=this._networkStream)==null||o.cancelAllRequests(new og("Worker was terminated.")),(n=this.messageHandler)==null||n.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:i}=this;e.on("GetReader",(r,o)=>{$n(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=n=>{this._lastProgress={loaded:n.loaded,total:n.total}},o.onPull=()=>{this._fullReader.read().then(function({value:n,done:s}){if(s){o.close();return}$n(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),o.enqueue(new Uint8Array(n),1,[n])}).catch(n=>{o.error(n)})},o.onCancel=n=>{this._fullReader.cancel(n),o.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",async r=>{var o;await this._fullReader.headersReady;const{isStreamingSupported:n,isRangeSupported:s,contentLength:a}=this._fullReader;return(!n||!s)&&(this._lastProgress&&((o=i.onProgress)==null||o.call(i,this._lastProgress)),this._fullReader.onProgress=l=>{var c;(c=i.onProgress)==null||c.call(i,{loaded:l.loaded,total:l.total})}),{isStreamingSupported:n,isRangeSupported:s,contentLength:a}}),e.on("GetRangeReader",(r,o)=>{$n(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(r.begin,r.end);if(!n){o.close();return}o.onPull=()=>{n.read().then(function({value:s,done:a}){if(a){o.close();return}$n(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),o.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{o.error(s)})},o.onCancel=s=>{n.cancel(s),o.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,i._capability.resolve(new cUi(r,this))}),e.on("DocException",r=>{i._capability.reject(cc(r))}),e.on("PasswordRequest",r=>{ie(this,Ig,Promise.withResolvers());try{if(!i.onPassword)throw cc(r);const o=n=>{n instanceof Error?S(this,Ig).reject(n):S(this,Ig).resolve({password:n})};i.onPassword(o,r.code)}catch(o){S(this,Ig).reject(o)}return S(this,Ig).promise}),e.on("DataLoaded",r=>{var o;(o=i.onProgress)==null||o.call(i,{loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),e.on("StartRenderPage",r=>{this.destroyed||S(this,Z1).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,o,n])=>{var s;if(this.destroyed||this.commonObjs.has(r))return null;switch(o){case"Font":const{disableFontFace:a,fontExtraProperties:l,pdfBug:c}=this._params;if("error"in n){const A=n.error;or(`Error during font loading: ${A}`),this.commonObjs.resolve(r,A);break}const d=c&&(s=globalThis.FontInspector)!=null&&s.enabled?(A,g)=>globalThis.FontInspector.fontAdded(A,g):null,u=new c_i(n,{disableFontFace:a,fontExtraProperties:l,inspectFont:d});this.fontLoader.bind(u).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{!l&&u.data&&(u.data=null),this.commonObjs.resolve(r,u)});break;case"CopyLocalImage":const{imageRef:h}=n;$n(h,"The imageRef must be defined.");for(const A of S(this,Z1).values())for(const[,g]of A.objs)if(g?.ref===h)return g.dataLen?(this.commonObjs.resolve(r,structuredClone(g)),g.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(r,n);break;default:throw new Error(`Got unknown common object type ${o}`)}return null}),e.on("obj",([r,o,n,s])=>{var a;if(this.destroyed)return;const l=S(this,Z1).get(o);if(!l.objs.has(r)){if(l._intentStates.size===0){(a=s?.bitmap)==null||a.close();return}switch(n){case"Image":l.objs.resolve(r,s),s?.dataLen>LTi&&(l._maybeCleanupAfterRender=!0);break;case"Pattern":l.objs.resolve(r,s);break;default:throw new Error(`Got unknown object type ${n}`)}}}),e.on("DocProgress",r=>{var o;this.destroyed||(o=i.onProgress)==null||o.call(i,{loaded:r.loaded,total:r.total})}),e.on("FetchBuiltInCMap",async r=>{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(r)}),e.on("FetchStandardFontData",async r=>{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(r)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var e;this.annotationStorage.size<=0&&or("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:r}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:((e=this._fullReader)==null?void 0:e.filename)??null},r).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const i=e-1,r=S(this,rB).get(i);if(r)return r;const o=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then(n=>{if(this.destroyed)throw new Error("Transport destroyed");n.refStr&&S(this,oB).set(n.refStr,e);const s=new dUi(i,n,this,this._params.pdfBug);return S(this,Z1).set(i,s),s});return S(this,rB).set(i,o),o}getPageIndex(e){return Yke(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,i){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:i})}getFieldObjects(){return oe(this,w6,nB).call(this,"GetFieldObjects")}hasJSActions(){return oe(this,w6,nB).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return oe(this,w6,nB).call(this,"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 oe(this,w6,nB).call(this,"GetOptionalContentConfig").then(i=>new R_i(i,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",i=S(this,bg).get(e);if(i)return i;const r=this.messageHandler.sendWithPromise(e,null).then(o=>{var n,s;return{info:o[0],metadata:o[1]?new D_i(o[1]):null,contentDispositionFilename:((n=this._fullReader)==null?void 0:n.filename)??null,contentLength:((s=this._fullReader)==null?void 0:s.contentLength)??null}});return S(this,bg).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 i of S(this,Z1).values())if(!i.cleanup())throw new Error(`startCleanup: Page ${i.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),S(this,bg).clear(),this.filterFactory.destroy(!0),qX.cleanup()}}cachedPageNumber(e){if(!Yke(e))return null;const i=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return S(this,oB).get(i)??null}}bg=new WeakMap,Z1=new WeakMap,rB=new WeakMap,oB=new WeakMap,Ig=new WeakMap,w6=new WeakSet,nB=function(t,e=null){const i=S(this,bg).get(t);if(i)return i;const r=this.messageHandler.sendWithPromise(t,e);return S(this,bg).set(t,r),r};const sB=Symbol("INITIAL_DATA");var Nd,HF,WX;class Xke{constructor(){ce(this,HF),ce(this,Nd,Object.create(null))}get(e,i=null){if(i){const o=oe(this,HF,WX).call(this,e);return o.promise.then(()=>i(o.data)),null}const r=S(this,Nd)[e];if(!r||r.data===sB)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const i=S(this,Nd)[e];return!!i&&i.data!==sB}delete(e){const i=S(this,Nd)[e];return!i||i.data===sB?!1:(delete S(this,Nd)[e],!0)}resolve(e,i=null){const r=oe(this,HF,WX).call(this,e);r.data=i,r.resolve()}clear(){var e;for(const i in S(this,Nd)){const{data:r}=S(this,Nd)[i];(e=r?.bitmap)==null||e.close()}ie(this,Nd,Object.create(null))}*[Symbol.iterator](){for(const e in S(this,Nd)){const{data:i}=S(this,Nd)[e];i!==sB&&(yield[e,i])}}}Nd=new WeakMap,HF=new WeakSet,WX=function(t){var e;return(e=S(this,Nd))[t]||(e[t]={...Promise.withResolvers(),data:sB})};var cm;class AUi{constructor(e){ce(this,cm,null),ie(this,cm,e),this.onContinue=null}get promise(){return S(this,cm).capability.promise}cancel(e=0){S(this,cm).cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=S(this,cm).operatorList;if(!e)return!1;const{annotationCanvasMap:i}=S(this,cm);return e.form||e.canvas&&i?.size>0}}cm=new WeakMap;var dm,b6;const $ke=class YE{constructor({callback:e,params:i,objs:r,commonObjs:o,annotationCanvasMap:n,operatorList:s,pageIndex:a,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:u=!1,pageColors:h=null}){ce(this,dm,null),this.callback=e,this.params=i,this.objs=r,this.commonObjs=o,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=a,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=u,this.pageColors=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=d===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new AUi(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:i}){var r,o;if(this.cancelled)return;if(this._canvas){if(S(YE,b6).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.");S(YE,b6).add(this._canvas)}this._pdfBug&&(r=globalThis.StepperManager)!=null&&r.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:n,viewport:s,transform:a,background:l}=this.params;this.gfx=new vF(n,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:a,viewport:s,transparency:e,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,(o=this.graphicsReadyCallback)==null||o.call(this)}cancel(e=null,i=0){var r;this.running=!1,this.cancelled=!0,(r=this.gfx)==null||r.endDrawing(),S(this,dm)&&(window.cancelAnimationFrame(S(this,dm)),ie(this,dm,null)),S(YE,b6).delete(this._canvas),this.callback(e||new oX(`Rendering cancelled, page ${this._pageIndex+1}`,i))}operatorListChanged(){var e;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(e=this.stepper)==null||e.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?ie(this,dm,window.requestAnimationFrame(()=>{ie(this,dm,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(),S(YE,b6).delete(this._canvas),this.callback())))}};dm=new WeakMap,b6=new WeakMap,ce($ke,b6,new WeakSet);let pUi=$ke;const gUi="4.10.38",fUi="f9bea397f";function eMe(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function aB(t){return Math.max(0,Math.min(255,255*t))}class tMe{static CMYK_G([e,i,r,o]){return["G",1-Math.min(1,.3*e+.59*r+.11*i+o)]}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=aB(e),[e,e,e]}static G_HTML([e]){const i=eMe(e);return`#${i}${i}${i}`}static RGB_G([e,i,r]){return["G",.3*e+.59*i+.11*r]}static RGB_rgb(e){return e.map(aB)}static RGB_HTML(e){return`#${e.map(eMe).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,i,r,o]){return["RGB",1-Math.min(1,e+o),1-Math.min(1,r+o),1-Math.min(1,i+o)]}static CMYK_rgb([e,i,r,o]){return[aB(1-Math.min(1,e+o)),aB(1-Math.min(1,r+o)),aB(1-Math.min(1,i+o))]}static CMYK_HTML(e){const i=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(i)}static RGB_CMYK([e,i,r]){const o=1-e,n=1-i,s=1-r,a=Math.min(o,n,s);return["CMYK",o,n,s,a]}}class mUi{create(e,i,r=!1){if(e<=0||i<=0)throw new Error("Invalid SVG dimensions");const o=this._createSVG("svg:svg");return o.setAttribute("version","1.1"),r||(o.setAttribute("width",`${e}px`),o.setAttribute("height",`${i}px`)),o.setAttribute("preserveAspectRatio","none"),o.setAttribute("viewBox",`0 0 ${e} ${i}`),o}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Mo("Abstract method `_createSVG` called.")}}class ZX extends mUi{_createSVG(e){return document.createElementNS(N1,e)}}class iMe{static setupStorage(e,i,r,o,n){const s=o.getValue(i,{value:null});switch(r.name){case"textarea":if(s.value!==null&&(e.textContent=s.value),n==="print")break;e.addEventListener("input",a=>{o.setValue(i,{value:a.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(s.value===r.attributes.xfaOn?e.setAttribute("checked",!0):s.value===r.attributes.xfaOff&&e.removeAttribute("checked"),n==="print")break;e.addEventListener("change",a=>{o.setValue(i,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&e.setAttribute("value",s.value),n==="print")break;e.addEventListener("input",a=>{o.setValue(i,{value:a.target.value})})}break;case"select":if(s.value!==null){e.setAttribute("value",s.value);for(const a of r.children)a.attributes.value===s.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}e.addEventListener("input",a=>{const l=a.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;o.setValue(i,{value:c})});break}}static setAttributes({html:e,element:i,storage:r=null,intent:o,linkService:n}){const{attributes:s}=i,a=e instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${o}`);for(const[l,c]of Object.entries(s))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!a||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}a&&n.addLinkAttributes(e,s.href,s.newWindow),r&&s.dataId&&this.setupStorage(e,s.dataId,i,r)}static render(e){var i,r;const o=e.annotationStorage,n=e.linkService,s=e.xfaHtml,a=e.intent||"display",l=document.createElement(s.name);s.attributes&&this.setAttributes({html:l,element:s,intent:a,linkService:n});const c=a!=="richText",d=e.div;if(d.append(l),e.viewport){const A=`matrix(${e.viewport.transform.join(",")})`;d.style.transform=A}c&&d.setAttribute("class","xfaLayer xfaFont");const u=[];if(s.children.length===0){if(s.value){const A=document.createTextNode(s.value);l.append(A),c&&sx.shouldBuildText(s.name)&&u.push(A)}return{textDivs:u}}const h=[[s,-1,l]];for(;h.length>0;){const[A,g,p]=h.at(-1);if(g+1===A.children.length){h.pop();continue}const m=A.children[++h.at(-1)[1]];if(m===null)continue;const{name:f}=m;if(f==="#text"){const y=document.createTextNode(m.value);u.push(y),p.append(y);continue}const v=(i=m?.attributes)!=null&&i.xmlns?document.createElementNS(m.attributes.xmlns,f):document.createElement(f);if(p.append(v),m.attributes&&this.setAttributes({html:v,element:m,storage:o,intent:a,linkService:n}),((r=m.children)==null?void 0:r.length)>0)h.push([m,-1,v]);else if(m.value){const y=document.createTextNode(m.value);c&&sx.shouldBuildText(f)&&u.push(y),v.append(y)}}for(const A of d.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))A.setAttribute("readOnly",!0);return{textDivs:u}}static update(e){const i=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=i,e.div.hidden=!1}}const lB=1e3,vUi=9,um=new WeakSet;function Bg(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class CUi{static create(e){switch(e.data.annotationType){case Cs.LINK:return new nMe(e);case Cs.TEXT:return new wUi(e);case Cs.WIDGET:switch(e.data.fieldType){case"Tx":return new bUi(e);case"Btn":return e.data.radioButton?new sMe(e):e.data.checkBox?new BUi(e):new EUi(e);case"Ch":return new xUi(e);case"Sig":return new IUi(e)}return new pm(e);case Cs.POPUP:return new $X(e);case Cs.FREETEXT:return new uMe(e);case Cs.LINE:return new MUi(e);case Cs.SQUARE:return new SUi(e);case Cs.CIRCLE:return new QUi(e);case Cs.POLYLINE:return new hMe(e);case Cs.CARET:return new PUi(e);case Cs.INK:return new n$(e);case Cs.POLYGON:return new DUi(e);case Cs.HIGHLIGHT:return new AMe(e);case Cs.UNDERLINE:return new RUi(e);case Cs.SQUIGGLY:return new FUi(e);case Cs.STRIKEOUT:return new LUi(e);case Cs.STAMP:return new pMe(e);case Cs.FILEATTACHMENT:return new TUi(e);default:return new ws(e)}}}var hm,cB,dB,VF,XX;const yUi=class zRe{constructor(e,{isRenderable:i=!1,ignoreBorder:r=!1,createQuadrilaterals:o=!1}={}){ce(this,VF),ce(this,hm,null),ce(this,cB,!1),ce(this,dB,null),this.isRenderable=i,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,i&&(this.container=this._createContainer(r)),o&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:i,richText:r}){return!!(e!=null&&e.str||i!=null&&i.str||r!=null&&r.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return zRe._hasPopupData(this.data)}updateEdited(e){var i;if(!this.container)return;S(this,hm)||ie(this,hm,{rect:this.data.rect.slice(0)});const{rect:r}=e;r&&oe(this,VF,XX).call(this,r),(i=S(this,dB))==null||i.popup.updateEdited(e)}resetEdited(){var e;S(this,hm)&&(oe(this,VF,XX).call(this,S(this,hm).rect),(e=S(this,dB))==null||e.popup.resetEdited(),ie(this,hm,null))}_createContainer(e){const{data:i,parent:{page:r,viewport:o}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",i.id),this instanceof pm||(n.tabIndex=lB);const{style:s}=n;if(s.zIndex=this.parent.zIndex++,i.alternativeText&&(n.title=i.alternativeText),i.noRotate&&n.classList.add("norotate"),!i.rect||this instanceof $X){const{rotation:p}=i;return!i.hasOwnCanvas&&p!==0&&this.setRotation(p,n),n}const{width:a,height:l}=Bg(i.rect);if(!e&&i.borderStyle.width>0){s.borderWidth=`${i.borderStyle.width}px`;const p=i.borderStyle.horizontalCornerRadius,m=i.borderStyle.verticalCornerRadius;if(p>0||m>0){const v=`calc(${p}px * var(--scale-factor)) / calc(${m}px * var(--scale-factor))`;s.borderRadius=v}else if(this instanceof sMe){const v=`calc(${a}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;s.borderRadius=v}switch(i.borderStyle.style){case AI.SOLID:s.borderStyle="solid";break;case AI.DASHED:s.borderStyle="dashed";break;case AI.BEVELED:or("Unimplemented border style: beveled");break;case AI.INSET:or("Unimplemented border style: inset");break;case AI.UNDERLINE:s.borderBottomStyle="solid";break}const f=i.borderColor||null;f?(ie(this,cB,!0),s.borderColor=bi.makeHexColor(f[0]|0,f[1]|0,f[2]|0)):s.borderWidth=0}const c=bi.normalizeRect([i.rect[0],r.view[3]-i.rect[1]+r.view[1],i.rect[2],r.view[3]-i.rect[3]+r.view[1]]),{pageWidth:d,pageHeight:u,pageX:h,pageY:A}=o.rawDims;s.left=`${100*(c[0]-h)/d}%`,s.top=`${100*(c[1]-A)/u}%`;const{rotation:g}=i;return i.hasOwnCanvas||g===0?(s.width=`${100*a/d}%`,s.height=`${100*l/u}%`):this.setRotation(g,n),n}setRotation(e,i=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:o}=this.parent.viewport.rawDims,{width:n,height:s}=Bg(this.data.rect);let a,l;e%180===0?(a=100*n/r,l=100*s/o):(a=100*s/r,l=100*n/o),i.style.width=`${a}%`,i.style.height=`${l}%`,i.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(i,r,o)=>{const n=o.detail[i],s=n[0],a=n.slice(1);o.target.style[r]=tMe[`${s}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[r]:tMe[`${s}_rgb`](a)})};return pr(this,"_commonActions",{display:i=>{const{display:r}=i.detail,o=r%2===1;this.container.style.visibility=o?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:o,noPrint:r===1||r===2})},print:i=>{this.annotationStorage.setValue(this.data.id,{noPrint:!i.detail.print})},hidden:i=>{const{hidden:r}=i.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:i=>{setTimeout(()=>i.target.focus({preventScroll:!1}),0)},userName:i=>{i.target.title=i.detail.userName},readonly:i=>{i.target.disabled=i.detail.readonly},required:i=>{this._setRequired(i.target,i.detail.required)},bgColor:i=>{e("bgColor","backgroundColor",i)},fillColor:i=>{e("fillColor","backgroundColor",i)},fgColor:i=>{e("fgColor","color",i)},textColor:i=>{e("textColor","color",i)},borderColor:i=>{e("borderColor","borderColor",i)},strokeColor:i=>{e("strokeColor","borderColor",i)},rotation:i=>{const r=i.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(e,i){const r=this._commonActions;for(const o of Object.keys(i.detail)){const n=e[o]||r[o];n?.(i)}}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const i=this.annotationStorage.getRawValue(this.data.id);if(!i)return;const r=this._commonActions;for(const[o,n]of Object.entries(i)){const s=r[o];if(s){const a={detail:{[o]:n},target:e};s(a),delete i[o]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[i,r,o,n]=this.data.rect.map(p=>Math.fround(p));if(e.length===8){const[p,m,f,v]=e.subarray(2,6);if(o===p&&n===m&&i===f&&r===v)return}const{style:s}=this.container;let a;if(S(this,cB)){const{borderColor:p,borderWidth:m}=s;s.borderWidth=0,a=["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="${p}" stroke-width="${m}">`],this.container.classList.add("hasBorder")}const l=o-i,c=n-r,{svgFactory:d}=this,u=d.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0);const h=d.createElement("defs");u.append(h);const A=d.createElement("clipPath"),g=`clippath_${this.data.id}`;A.setAttribute("id",g),A.setAttribute("clipPathUnits","objectBoundingBox"),h.append(A);for(let p=2,m=e.length;p<m;p+=8){const f=e[p],v=e[p+1],y=e[p+2],C=e[p+3],w=d.createElement("rect"),b=(y-i)/l,E=(n-v)/c,x=(f-y)/l,k=(v-C)/c;w.setAttribute("x",b),w.setAttribute("y",E),w.setAttribute("width",x),w.setAttribute("height",k),A.append(w),a?.push(`<rect vector-effect="non-scaling-stroke" x="${b}" y="${E}" width="${x}" height="${k}"/>`)}S(this,cB)&&(a.push("</g></svg>')"),s.backgroundImage=a.join("")),this.container.append(u),this.container.style.clipPath=`url(#${g})`}_createPopup(){const{data:e}=this,i=ie(this,dB,new $X({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(i.render())}render(){Mo("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,i=null){const r=[];if(this._fieldObjects){const o=this._fieldObjects[e];if(o)for(const{page:n,id:s,exportValues:a}of o){if(n===-1||s===i)continue;const l=typeof a=="string"?a:null,c=document.querySelector(`[data-element-id="${s}"]`);if(c&&!um.has(c)){or(`_getElementsByName - element not allowed: ${s}`);continue}r.push({id:s,exportValue:l,domElement:c})}return r}for(const o of document.getElementsByName(e)){const{exportValue:n}=o,s=o.getAttribute("data-element-id");s!==i&&um.has(o)&&r.push({id:s,exportValue:n,domElement:o})}return r}show(){var e;this.container&&(this.container.hidden=!1),(e=this.popup)==null||e.maybeShow()}hide(){var e;this.container&&(this.container.hidden=!0),(e=this.popup)==null||e.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const i of e)i.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:i}}=this;this.container.addEventListener("dblclick",()=>{var r;(r=this.linkService.eventBus)==null||r.dispatch("switchannotationeditormode",{source:this,mode:e,editId:i})})}};hm=new WeakMap,cB=new WeakMap,dB=new WeakMap,VF=new WeakSet,XX=function(t){const{container:{style:e},data:{rect:i,rotation:r},parent:{viewport:{rawDims:{pageWidth:o,pageHeight:n,pageX:s,pageY:a}}}}=this;i?.splice(0,4,...t);const{width:l,height:c}=Bg(t);e.left=`${100*(t[0]-s)/o}%`,e.top=`${100*(n-t[3]+a)/n}%`,r===0?(e.width=`${100*l/o}%`,e.height=`${100*c/n}%`):this.setRotation(r)};let ws=yUi;var cA,Am,rMe,oMe;class nMe extends ws{constructor(e,i=null){super(e,{isRenderable:!0,ignoreBorder:!!(i!=null&&i.ignoreBorder),createQuadrilaterals:!0}),ce(this,cA),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:i}=this,r=document.createElement("a");r.setAttribute("data-element-id",e.id);let o=!1;return e.url?(i.addLinkAttributes(r,e.url,e.newWindow),o=!0):e.action?(this._bindNamedAction(r,e.action),o=!0):e.attachment?(oe(this,cA,rMe).call(this,r,e.attachment,e.attachmentDest),o=!0):e.setOCGState?(oe(this,cA,oMe).call(this,r,e.setOCGState),o=!0):e.dest?(this._bindLink(r,e.dest),o=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,e),o=!0),e.resetForm?(this._bindResetFormAction(r,e.resetForm),o=!0):this.isTooltipOnly&&!o&&(this._bindLink(r,""),o=!0)),this.container.classList.add("linkAnnotation"),o&&this.container.append(r),this.container}_bindLink(e,i){e.href=this.linkService.getDestinationHash(i),e.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&oe(this,cA,Am).call(this)}_bindNamedAction(e,i){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(i),!1),oe(this,cA,Am).call(this)}_bindJSAction(e,i){e.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const o of Object.keys(i.actions)){const n=r.get(o);n&&(e[n]=()=>{var s;return(s=this.linkService.eventBus)==null||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:o}}),!1})}e.onclick||(e.onclick=()=>!1),oe(this,cA,Am).call(this)}_bindResetFormAction(e,i){const r=e.onclick;if(r||(e.href=this.linkService.getAnchorUrl("")),oe(this,cA,Am).call(this),!this._fieldObjects){or('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),r||(e.onclick=()=>!1);return}e.onclick=()=>{var o;r?.();const{fields:n,refs:s,include:a}=i,l=[];if(n.length!==0||s.length!==0){const u=new Set(s);for(const h of n){const A=this._fieldObjects[h]||[];for(const{id:g}of A)u.add(g)}for(const h of Object.values(this._fieldObjects))for(const A of h)u.has(A.id)===a&&l.push(A)}else for(const u of Object.values(this._fieldObjects))l.push(...u);const c=this.annotationStorage,d=[];for(const u of l){const{id:h}=u;switch(d.push(h),u.type){case"text":{const g=u.defaultValue||"";c.setValue(h,{value:g});break}case"checkbox":case"radiobutton":{const g=u.defaultValue===u.exportValues;c.setValue(h,{value:g});break}case"combobox":case"listbox":{const g=u.defaultValue||"";c.setValue(h,{value:g});break}default:continue}const A=document.querySelector(`[data-element-id="${h}"]`);if(A){if(!um.has(A)){or(`_bindResetFormAction - element not allowed: ${h}`);continue}}else continue;A.dispatchEvent(new Event("resetform"))}return this.enableScripting&&((o=this.linkService.eventBus)==null||o.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:d,name:"ResetForm"}})),!1}}}cA=new WeakSet,Am=function(){this.container.setAttribute("data-internal-link","")},rMe=function(t,e,i=null){t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>{var r;return(r=this.downloadManager)==null||r.openOrDownloadData(e.content,e.filename,i),!1},oe(this,cA,Am).call(this)},oMe=function(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),oe(this,cA,Am).call(this)};class wUi extends ws{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 pm extends ws{render(){return this.container}showElementAndHideCanvas(e){var i;this.data.hasOwnCanvas&&(((i=e.previousSibling)==null?void 0:i.nodeName)==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return xl.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,i,r,o,n){r.includes("mouse")?e.addEventListener(r,s=>{var a;(a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:o,value:n(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):e.addEventListener(r,s=>{var a;if(r==="blur"){if(!i.focused||!s.relatedTarget)return;i.focused=!1}else if(r==="focus"){if(i.focused)return;i.focused=!0}n&&((a=this.linkService.eventBus)==null||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:o,value:n(s)}}))})}_setEventListeners(e,i,r,o){var n,s,a;for(const[l,c]of r)(c==="Action"||(n=this.data.actions)!=null&&n[c])&&((c==="Focus"||c==="Blur")&&(i||(i={focused:!1})),this._setEventListener(e,i,l,c,o),c==="Focus"&&!((s=this.data.actions)!=null&&s.Blur)?this._setEventListener(e,i,"blur","Blur",null):c==="Blur"&&!((a=this.data.actions)!=null&&a.Focus)&&this._setEventListener(e,i,"focus","Focus",null))}_setBackgroundColor(e){const i=this.data.backgroundColor||null;e.style.backgroundColor=i===null?"transparent":bi.makeHexColor(i[0],i[1],i[2])}_setTextStyle(e){const i=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,o=this.data.defaultAppearanceData.fontSize||vUi,n=e.style;let s;const a=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-a),d=Math.round(c/(YZ*o))||1,u=c/d;s=Math.min(o,l(u/YZ))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-a);s=Math.min(o,l(c/YZ))}n.fontSize=`calc(${s}px * var(--scale-factor))`,n.color=bi.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(n.textAlign=i[this.data.textAlignment])}_setRequired(e,i){i?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",i)}}class bUi extends pm{constructor(e){const i=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:i})}setPropertyOnSiblings(e,i,r,o){const n=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[i]=r),n.setValue(s.id,{[o]:r})}render(){var e,i;const r=this.annotationStorage,o=this.data.id;this.container.classList.add("textWidgetAnnotation");let n=null;if(this.renderForms){const s=r.getValue(o,{value:this.data.fieldValue});let a=s.value||"";const l=r.getValue(o,{charLimit:this.data.maxLen}).charLimit;l&&a.length>l&&(a=a.slice(0,l));let c=s.formattedValue||((e=this.data.textContent)==null?void 0:e.join(`
|
|
5513
5513
|
`))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const d={userValue:a,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement("textarea"),n.textContent=c??a,this.data.doNotScroll&&(n.style.overflowY="hidden")):(n=document.createElement("input"),n.type="text",n.setAttribute("value",c??a),this.data.doNotScroll&&(n.style.overflowX="hidden")),this.data.hasOwnCanvas&&(n.hidden=!0),um.add(n),n.setAttribute("data-element-id",o),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=lB,this._setRequired(n,this.data.required),l&&(n.maxLength=l),n.addEventListener("input",h=>{r.setValue(o,{value:h.target.value}),this.setPropertyOnSiblings(n,"value",h.target.value,"value"),d.formattedValue=null}),n.addEventListener("resetform",h=>{const A=this.data.defaultFieldValue??"";n.value=d.userValue=A,d.formattedValue=null});let u=h=>{const{formattedValue:A}=d;A!=null&&(h.target.value=A),h.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener("focus",A=>{var g;if(d.focused)return;const{target:p}=A;d.userValue&&(p.value=d.userValue),d.lastCommittedValue=p.value,d.commitKey=1,(g=this.data.actions)!=null&&g.Focus||(d.focused=!0)}),n.addEventListener("updatefromsandbox",A=>{this.showElementAndHideCanvas(A.target);const g={value(p){d.userValue=p.detail.value??"",r.setValue(o,{value:d.userValue.toString()}),p.target.value=d.userValue},formattedValue(p){const{formattedValue:m}=p.detail;d.formattedValue=m,m!=null&&p.target!==document.activeElement&&(p.target.value=m),r.setValue(o,{formattedValue:m})},selRange(p){p.target.setSelectionRange(...p.detail.selRange)},charLimit:p=>{var m;const{charLimit:f}=p.detail,{target:v}=p;if(f===0){v.removeAttribute("maxLength");return}v.setAttribute("maxLength",f);let y=d.userValue;!y||y.length<=f||(y=y.slice(0,f),v.value=d.userValue=y,r.setValue(o,{value:y}),(m=this.linkService.eventBus)==null||m.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:y,willCommit:!0,commitKey:1,selStart:v.selectionStart,selEnd:v.selectionEnd}}))}};this._dispatchEventFromSandbox(g,A)}),n.addEventListener("keydown",A=>{var g;d.commitKey=1;let p=-1;if(A.key==="Escape"?p=0:A.key==="Enter"&&!this.data.multiLine?p=2:A.key==="Tab"&&(d.commitKey=3),p===-1)return;const{value:m}=A.target;d.lastCommittedValue!==m&&(d.lastCommittedValue=m,d.userValue=m,(g=this.linkService.eventBus)==null||g.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:m,willCommit:!0,commitKey:p,selStart:A.target.selectionStart,selEnd:A.target.selectionEnd}}))});const h=u;u=null,n.addEventListener("blur",A=>{var g,p;if(!d.focused||!A.relatedTarget)return;(g=this.data.actions)!=null&&g.Blur||(d.focused=!1);const{value:m}=A.target;d.userValue=m,d.lastCommittedValue!==m&&((p=this.linkService.eventBus)==null||p.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:m,willCommit:!0,commitKey:d.commitKey,selStart:A.target.selectionStart,selEnd:A.target.selectionEnd}})),h(A)}),(i=this.data.actions)!=null&&i.Keystroke&&n.addEventListener("beforeinput",A=>{var g;d.lastCommittedValue=null;const{data:p,target:m}=A,{value:f,selectionStart:v,selectionEnd:y}=m;let C=v,w=y;switch(A.inputType){case"deleteWordBackward":{const b=f.substring(0,v).match(/\w*[^\w]*$/);b&&(C-=b[0].length);break}case"deleteWordForward":{const b=f.substring(v).match(/^[^\w]*\w*/);b&&(w+=b[0].length);break}case"deleteContentBackward":v===y&&(C-=1);break;case"deleteContentForward":v===y&&(w+=1);break}A.preventDefault(),(g=this.linkService.eventBus)==null||g.dispatch("dispatcheventinsandbox",{source:this,detail:{id:o,name:"Keystroke",value:f,change:p||"",willCommit:!1,selStart:C,selEnd:w}})}),this._setEventListeners(n,d,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],A=>A.target.value)}if(u&&n.addEventListener("blur",u),this.data.comb){const h=(this.data.rect[2]-this.data.rect[0])/l;n.classList.add("comb"),n.style.letterSpacing=`calc(${h}px * var(--scale-factor) - 1ch)`}}else n=document.createElement("div"),n.textContent=this.data.fieldValue,n.style.verticalAlign="middle",n.style.display="table-cell",this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class IUi extends pm{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class BUi extends pm{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,i=this.data,r=i.id;let o=e.getValue(r,{value:i.exportValue===i.fieldValue}).value;typeof o=="string"&&(o=o!=="Off",e.setValue(r,{value:o})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return um.add(n),n.setAttribute("data-element-id",r),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=i.fieldName,o&&n.setAttribute("checked",!0),n.setAttribute("exportValue",i.exportValue),n.tabIndex=lB,n.addEventListener("change",s=>{const{name:a,checked:l}=s.target;for(const c of this._getElementsByName(a,r)){const d=l&&c.exportValue===i.exportValue;c.domElement&&(c.domElement.checked=d),e.setValue(c.id,{value:d})}e.setValue(r,{value:l})}),n.addEventListener("resetform",s=>{const a=i.defaultFieldValue||"Off";s.target.checked=a===i.exportValue}),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",s=>{const a={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(r,{value:l.target.checked})}};this._dispatchEventFromSandbox(a,s)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class sMe extends pm{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,i=this.data,r=i.id;let o=e.getValue(r,{value:i.fieldValue===i.buttonValue}).value;if(typeof o=="string"&&(o=o!==i.buttonValue,e.setValue(r,{value:o})),o)for(const s of this._getElementsByName(i.fieldName,r))e.setValue(s.id,{value:!1});const n=document.createElement("input");if(um.add(n),n.setAttribute("data-element-id",r),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=i.fieldName,o&&n.setAttribute("checked",!0),n.tabIndex=lB,n.addEventListener("change",s=>{const{name:a,checked:l}=s.target;for(const c of this._getElementsByName(a,r))e.setValue(c.id,{value:!1});e.setValue(r,{value:l})}),n.addEventListener("resetform",s=>{const a=i.defaultFieldValue;s.target.checked=a!=null&&a===i.buttonValue}),this.enableScripting&&this.hasJSActions){const s=i.buttonValue;n.addEventListener("updatefromsandbox",a=>{const l={value:c=>{const d=s===c.detail.value;for(const u of this._getElementsByName(c.target.name)){const h=d&&u.id===r;u.domElement&&(u.domElement.checked=h),e.setValue(u.id,{value:h})}}};this._dispatchEventFromSandbox(l,a)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class EUi extends nMe{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const i=e.lastChild;return this.enableScripting&&this.hasJSActions&&i&&(this._setDefaultPropertiesFromJS(i),i.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),e}}class xUi extends pm{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,i=this.data.id,r=e.getValue(i,{value:this.data.fieldValue}),o=document.createElement("select");um.add(o),o.setAttribute("data-element-id",i),o.disabled=this.data.readOnly,this._setRequired(o,this.data.required),o.name=this.data.fieldName,o.tabIndex=lB;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(o.size=this.data.options.length,this.data.multiSelect&&(o.multiple=!0)),o.addEventListener("resetform",d=>{const u=this.data.defaultFieldValue;for(const h of o.options)h.selected=h.value===u});for(const d of this.data.options){const u=document.createElement("option");u.textContent=d.displayValue,u.value=d.exportValue,r.value.includes(d.exportValue)&&(u.setAttribute("selected",!0),n=!1),o.append(u)}let s=null;if(n){const d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),o.prepend(d),s=()=>{d.remove(),o.removeEventListener("input",s),s=null},o.addEventListener("input",s)}const a=d=>{const u=d?"value":"textContent",{options:h,multiple:A}=o;return A?Array.prototype.filter.call(h,g=>g.selected).map(g=>g[u]):h.selectedIndex===-1?null:h[h.selectedIndex][u]};let l=a(!1);const c=d=>{const u=d.target.options;return Array.prototype.map.call(u,h=>({displayValue:h.textContent,exportValue:h.value}))};return this.enableScripting&&this.hasJSActions?(o.addEventListener("updatefromsandbox",d=>{const u={value(h){s?.();const A=h.detail.value,g=new Set(Array.isArray(A)?A:[A]);for(const p of o.options)p.selected=g.has(p.value);e.setValue(i,{value:a(!0)}),l=a(!1)},multipleSelection(h){o.multiple=!0},remove(h){const A=o.options,g=h.detail.remove;A[g].selected=!1,o.remove(g),A.length>0&&Array.prototype.findIndex.call(A,p=>p.selected)===-1&&(A[0].selected=!0),e.setValue(i,{value:a(!0),items:c(h)}),l=a(!1)},clear(h){for(;o.length!==0;)o.remove(0);e.setValue(i,{value:null,items:[]}),l=a(!1)},insert(h){const{index:A,displayValue:g,exportValue:p}=h.detail.insert,m=o.children[A],f=document.createElement("option");f.textContent=g,f.value=p,m?m.before(f):o.append(f),e.setValue(i,{value:a(!0),items:c(h)}),l=a(!1)},items(h){const{items:A}=h.detail;for(;o.length!==0;)o.remove(0);for(const g of A){const{displayValue:p,exportValue:m}=g,f=document.createElement("option");f.textContent=p,f.value=m,o.append(f)}o.options.length>0&&(o.options[0].selected=!0),e.setValue(i,{value:a(!0),items:c(h)}),l=a(!1)},indices(h){const A=new Set(h.detail.indices);for(const g of h.target.options)g.selected=A.has(g.index);e.setValue(i,{value:a(!0)}),l=a(!1)},editable(h){h.target.disabled=!h.detail.editable}};this._dispatchEventFromSandbox(u,d)}),o.addEventListener("input",d=>{var u;const h=a(!0),A=a(!1);e.setValue(i,{value:h}),d.preventDefault(),(u=this.linkService.eventBus)==null||u.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:l,change:A,changeEx:h,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(o,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],d=>d.target.value)):o.addEventListener("input",function(d){e.setValue(i,{value:a(!0)})}),this.data.combo&&this._setTextStyle(o),this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}}class $X extends ws{constructor(e){const{data:i,elements:r}=e;super(e,{isRenderable:ws._hasPopupData(i)}),this.elements=r,this.popup=null}render(){this.container.classList.add("popupAnnotation");const e=this.popup=new kUi({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}),i=[];for(const r of this.elements)r.popup=e,r.container.ariaHasPopup="dialog",i.push(r.data.id),r.addHighlightArea();return this.container.setAttribute("aria-controls",i.map(r=>`${rX}${r}`).join(",")),this.container}}var uB,e$,t$,hB,I6,Gn,Eg,AB,jF,GF,pB,xg,dA,kg,zF,Mg,qF,gm,B6,bs,KF,i$,aMe,lMe,cMe,dMe,JF,YF,r$;class kUi{constructor({container:e,color:i,elements:r,titleObj:o,modificationDate:n,contentsObj:s,richText:a,parent:l,rect:c,parentRect:d,open:u}){ce(this,bs),ce(this,uB,oe(this,bs,cMe).bind(this)),ce(this,e$,oe(this,bs,r$).bind(this)),ce(this,t$,oe(this,bs,YF).bind(this)),ce(this,hB,oe(this,bs,JF).bind(this)),ce(this,I6,null),ce(this,Gn,null),ce(this,Eg,null),ce(this,AB,null),ce(this,jF,null),ce(this,GF,null),ce(this,pB,null),ce(this,xg,!1),ce(this,dA,null),ce(this,kg,null),ce(this,zF,null),ce(this,Mg,null),ce(this,qF,null),ce(this,gm,null),ce(this,B6,!1);var h;ie(this,Gn,e),ie(this,qF,o),ie(this,Eg,s),ie(this,Mg,a),ie(this,GF,l),ie(this,I6,i),ie(this,zF,c),ie(this,pB,d),ie(this,jF,r),ie(this,AB,sX.toDateObject(n)),this.trigger=r.flatMap(A=>A.getElementsToTriggerPopup());for(const A of this.trigger)A.addEventListener("click",S(this,hB)),A.addEventListener("mouseenter",S(this,t$)),A.addEventListener("mouseleave",S(this,e$)),A.classList.add("popupTriggerArea");for(const A of r)(h=A.container)==null||h.addEventListener("keydown",S(this,uB));S(this,Gn).hidden=!0,u&&oe(this,bs,JF).call(this)}render(){if(S(this,dA))return;const e=ie(this,dA,document.createElement("div"));if(e.className="popup",S(this,I6)){const n=e.style.outlineColor=bi.makeHexColor(...S(this,I6));CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?e.style.backgroundColor=`color-mix(in srgb, ${n} 30%, white)`:e.style.backgroundColor=bi.makeHexColor(...S(this,I6).map(s=>Math.floor(.7*(255-s)+s)))}const i=document.createElement("span");i.className="header";const r=document.createElement("h1");if(i.append(r),{dir:r.dir,str:r.textContent}=S(this,qF),e.append(i),S(this,AB)){const n=document.createElement("span");n.classList.add("popupDate"),n.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),n.setAttribute("data-l10n-args",JSON.stringify({dateObj:S(this,AB).valueOf()})),i.append(n)}const o=S(this,bs,KF);if(o)iMe.render({xfaHtml:o,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{const n=this._formatContents(S(this,Eg));e.append(n)}S(this,Gn).append(e)}_formatContents({str:e,dir:i}){const r=document.createElement("p");r.classList.add("popupContent"),r.dir=i;const o=e.split(/(?:\r\n?|\n)/);for(let n=0,s=o.length;n<s;++n){const a=o[n];r.append(document.createTextNode(a)),n<s-1&&r.append(document.createElement("br"))}return r}updateEdited({rect:e,popupContent:i}){var r;S(this,gm)||ie(this,gm,{contentsObj:S(this,Eg),richText:S(this,Mg)}),e&&ie(this,kg,null),i&&(ie(this,Mg,oe(this,bs,lMe).call(this,i)),ie(this,Eg,null)),(r=S(this,dA))==null||r.remove(),ie(this,dA,null)}resetEdited(){var e;S(this,gm)&&({contentsObj:Ol(this,Eg)._,richText:Ol(this,Mg)._}=S(this,gm),ie(this,gm,null),(e=S(this,dA))==null||e.remove(),ie(this,dA,null),ie(this,kg,null))}forceHide(){ie(this,B6,this.isVisible),S(this,B6)&&(S(this,Gn).hidden=!0)}maybeShow(){S(this,B6)&&(S(this,dA)||oe(this,bs,YF).call(this),ie(this,B6,!1),S(this,Gn).hidden=!1)}get isVisible(){return S(this,Gn).hidden===!1}}uB=new WeakMap,e$=new WeakMap,t$=new WeakMap,hB=new WeakMap,I6=new WeakMap,Gn=new WeakMap,Eg=new WeakMap,AB=new WeakMap,jF=new WeakMap,GF=new WeakMap,pB=new WeakMap,xg=new WeakMap,dA=new WeakMap,kg=new WeakMap,zF=new WeakMap,Mg=new WeakMap,qF=new WeakMap,gm=new WeakMap,B6=new WeakMap,bs=new WeakSet,KF=function(){const t=S(this,Mg),e=S(this,Eg);return t!=null&&t.str&&(!(e!=null&&e.str)||e.str===t.str)&&S(this,Mg).html||null},i$=function(){var t,e,i;return((i=(e=(t=S(this,bs,KF))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.fontSize)||0},aMe=function(){var t,e,i;return((i=(e=(t=S(this,bs,KF))==null?void 0:t.attributes)==null?void 0:e.style)==null?void 0:i.color)||null},lMe=function(t){const e=[],i={str:t,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:e}]}},r={style:{color:S(this,bs,aMe),fontSize:S(this,bs,i$)?`calc(${S(this,bs,i$)}px * var(--scale-factor))`:""}};for(const o of t.split(`
|