{"version":3,"sources":["../js/Annotations/AnnotationTextClassification.js"],"names":["g_oAnnotationTextClassification","AnnotationTextClassification","oSnapdragonData","this","g_oSnapdragonData","showTextClassificationAnnotationType","hideTextClassificationAnnotationType","g_oJQTEOptions","br","b","i","center","color","format","indent","link","left","outdent","ol","p","remove","right","rule","source","title","unlink","fsize","fsizes","sub","strike","sup","u","ul","prototype","renderAnnotationTextClassificationContent","oAnnotation","oArtworkCanvas","oContainer","oTextClassificationHeader","document","createElement","innerHTML","className","appendChild","id","createEditableTextClassificationData","createReadOnlyTextClassificationData","oTextClassificationValueHeader","bReplaceContainer","bListItem","$","parents","length","textClassificationId","input","setAttribute","szTextContent","g_oAnnotationData","Tag","Language","Sequence","bIE","documentMode","bEdge","window","StyleMedia","dir","off","on","event","AnnotationUI","copyOverride","g_iApprovalId","g_oAnnotations","g_oViewer","g_bReadOnly","g_bMainCanvas","g_iAuthor","g_oUserDetails","UserId","g_bUnlocked","addDomElement","editTextClassificationData","replaceWith","g_oSettings","g_oUserSettings","LeftMenuCollapse","slideDiv","szContent","createTextClassificationTagSelectList","createTextClassificationLanguageSelectList","createTextClassificationSequenceSelectList","saveTextClassificationData","css","szId","szValue","szStyle","oSelectListValues","SnapdragonTags","TagName","SnapdragonLanguages","CustomLanguageName","iCurrentSequenceValue","parseInt","e","preventDefault","stopPropagation","g_oGreenlightMessages","displayErrorBubble","relatedAnnotationId","relatedAnnotationDiv","relatedAnnotationListItem","substring","relatedAnnotation","grep","g_oAnnotationsMade","ann","target","textClassificationContainer","getElementById","Annotation","scrollEditAnnotation","getCanvas","updateAnnotationTextClassificationData","status","AnnotationSave","g_oAnnotationCanvas","val","populateDefaultAnnotationData","AdditionalData","removeClass","addClass"],"mappings":"AAaA,IAAIA,gCAAkC,IAErC,WACA,aAKA,SAASC,6BAA6BC,iBAGrCC,KAAKC,kBAAoBF,gBAGK,MAA1BC,KAAKC,kBACRD,KAAKE,uCAGLF,KAAKG,uCAINH,KAAKI,eAAiB,CACrBC,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ourcesContent":["/*\r\n* Copyright (c) 2025 SGS Europe. All rights reserved.\r\n*\r\n* This program is the CONFIDENTIAL and PROPRIETARY property of SGS Europe.\r\n* Any unauthorised use, reproduction, or transfer of this program is strictly\r\n* prohibited.\r\n*\r\n* File Name: AnnotationTextClassification.js\r\n*\r\n* Description: JavaScript code for the text classification annotation functionality.\r\n*\r\n*/\r\n\r\nvar g_oAnnotationTextClassification = {};\r\n\r\n(function () {\r\n\t\"use strict\";\r\n\r\n\t/**\r\n\t * Create the Annotation Text Classification object.\r\n\t */\r\n\tfunction AnnotationTextClassification(oSnapdragonData) {\r\n\r\n\t\t// Set the snapdragon data.\r\n\t\tthis.g_oSnapdragonData = oSnapdragonData;\r\n\r\n\t\t// Set the visibility of the text classification icon.\r\n\t\tif (this.g_oSnapdragonData != null) {\r\n\t\t\tthis.showTextClassificationAnnotationType();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.hideTextClassificationAnnotationType();\r\n\t\t}\r\n\r\n\t\t// Set the JQTE allowed options for text classification annotations.\r\n\t\tthis.g_oJQTEOptions = {\r\n\t\t\t\"br\": true,\r\n\t\t\t\"b\": true,\r\n\t\t\t\"i\": true,\r\n\t\t\t\"center\": false,\r\n\t\t\t\"color\": false,\r\n\t\t\t\"format\": false,\r\n\t\t\t\"indent\": false,\r\n\t\t\t\"link\": false,\r\n\t\t\t\"left\": false,\r\n\t\t\t\"outdent\": false,\r\n\t\t\t\"ol\": false,\r\n\t\t\t\"p\": false,\r\n\t\t\t\"remove\": false,\r\n\t\t\t\"right\": false,\r\n\t\t\t\"rule\": false,\r\n\t\t\t\"source\": false,\r\n\t\t\t\"title\": false,\r\n\t\t\t\"unlink\": false,\r\n\t\t\t\"fsize\": false,\r\n\t\t\t\"fsizes\": false,\r\n\t\t\t\"sub\": false,\r\n\t\t\t\"strike\": false,\r\n\t\t\t\"sup\": false,\r\n\t\t\t\"u\": false,\r\n\t\t\t\"ul\": false\r\n\t\t};\r\n\t};\r\n\r\n\t/**\r\n\t * Renders the annotations text classification content.\r\n\t * @param {any} oAnnotation - The annotation.\r\n\t * @param {any} oArtworkCanvas - The artwork canvas.\r\n\t * @param {any} oContainer - The container.\r\n\t */\r\n\tAnnotationTextClassification.prototype.renderAnnotationTextClassificationContent = function (oAnnotation, oArtworkCanvas, oContainer) {\r\n\t\t\r\n\t\t// Create the text classification header.\r\n\t\tvar oTextClassificationHeader = document.createElement(\"p\");\r\n\t\toTextClassificationHeader.innerHTML = \"Text Classification\";\r\n\t\toTextClassificationHeader.className = \"HeaderText\";\r\n\t\toContainer.appendChild(oTextClassificationHeader);\r\n\r\n\t\t// Create the editable text classification input area.\r\n\t\tif (oAnnotation.id < 0) {\r\n\t\t\tg_oAnnotationTextClassification.createEditableTextClassificationData(oAnnotation, oContainer, false);\r\n\t\t}\r\n\t\t// Create the read only text classification input area.\r\n\t\telse {\r\n\t\t\tg_oAnnotationTextClassification.createReadOnlyTextClassificationData(oAnnotation, oArtworkCanvas, oContainer, false);\r\n\t\t}\r\n\r\n\t\t// Create the text classification value header.\r\n\t\tvar oTextClassificationValueHeader = document.createElement(\"p\");\r\n\t\toTextClassificationValueHeader.innerHTML = \"Value\";\r\n\t\toTextClassificationValueHeader.className = \"HeaderText\";\r\n\t\toContainer.appendChild(oTextClassificationValueHeader);\r\n\t};\r\n\r\n\t/**\r\n\t * Creates the read only text classification data.\r\n\t * @param {any} oAnnotation - The annotation.\r\n\t * @param {any} oArtworkCanvas - The artwork canvas.\r\n\t * @param {any} oContainer - The container.\r\n\t * @param {any} bReplaceContainer - If the container should be replaced.\r\n\t */\r\n\tAnnotationTextClassification.prototype.createReadOnlyTextClassificationData = function (oAnnotation, oArtworkCanvas, oContainer, bReplaceContainer) {\r\n\r\n\t\t// Determine if this is a list item or popup.\r\n\t\tvar bListItem = ($(oContainer).parents(\".annotationListItem\").length > 0);\r\n\r\n\t\t// Build the id for the text classification data.\r\n\t\tvar textClassificationId = oAnnotation.id + \"_textClassificationData\" + (bListItem ? \"_list\" : \"_popup\");\r\n\r\n\t\t// Create the input element.\r\n\t\tvar input = document.createElement(\"p\");\r\n\t\tinput.id = textClassificationId;\r\n\t\tinput.setAttribute(\"data-dbId\", textClassificationId);\r\n\t\tinput.className = \"ReadOnlyAnnotationText\";\r\n\r\n\t\t// Build the text content.\r\n\t\tvar szTextContent = \"Tag: \" + oAnnotation.g_oAnnotationData.Tag + \"
\";\r\n\t\tszTextContent += \"Language: \" + oAnnotation.g_oAnnotationData.Language + \"
\";\r\n\t\tszTextContent += \"Sequence: \" + oAnnotation.g_oAnnotationData.Sequence + \"\"\r\n\r\n\t\t// Set the text content.\r\n\t\tinput.innerHTML = szTextContent;\r\n\r\n\t\t// Internet Explorer 6-11\r\n\t\tvar bIE = false || !!document.documentMode;\r\n\t\t// Edge 20+\r\n\t\tvar bEdge = !bIE && !!window.StyleMedia;\r\n\t\tif (!bIE && !bEdge) {\r\n\t\t\tinput.dir = \"auto\";\r\n\t\t}\r\n\r\n\t\t// Update the speech bubble copy functionality.\r\n\t\t$(\".speechbubble\").off('copy');\r\n\t\t$(\".speechbubble\").on('copy', function (event) { AnnotationUI.prototype.copyOverride(event); });\r\n\t\t\r\n\t\t// We show the edit option if the user has an open approval slot and this is not a new annotation or an annotation status.\r\n\t\t// And they created the annotation, this is an unlocked annotation, or this is an svg text annotation which the user has permissions to edit.\r\n\t\tif (oAnnotation.g_iApprovalId === g_oAnnotations.g_iApprovalId && !g_oViewer.g_bReadOnly && oArtworkCanvas.g_bMainCanvas && oAnnotation.id > 0) {\r\n\t\t\tif ((oAnnotation.g_iAuthor === g_oUserDetails.UserId || oAnnotation.g_bUnlocked)) {\r\n\t\t\t\taddDomElement(\"eb_\" + textClassificationId, \"input\", \"img/Edit_Wht_16.png\", \"editAnnotationDataButton\", \"Edit Classification Data\", g_oAnnotationTextClassification.editTextClassificationData, input);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Replace the container.\r\n\t\tif (bReplaceContainer) {\r\n\t\t\toContainer.replaceWith(input);\r\n\t\t}\r\n\t\t// Append to the container.\r\n\t\telse {\r\n\t\t\toContainer.appendChild(input);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Creates the editable text classification data.\r\n\t * @param {any} oAnnotation - The annotation.\r\n\t * @param {any} oContainer - The container.\r\n\t * @param {any} bReplaceContainer - If the container should be replaced.\r\n\t */\r\n\tAnnotationTextClassification.prototype.createEditableTextClassificationData = function (oAnnotation, oContainer, bReplaceContainer) {\r\n\r\n\t\t// If the annotation slide out is collapsed, open it.\r\n\t\tif (g_oSettings.g_oUserSettings.LeftMenuCollapse) {\r\n\r\n\t\t\t// Slide the menu to the correct position.\r\n\t\t\tslideDiv($(\"#divAnnotationsContainer\"), true, true);\r\n\t\t}\r\n\r\n\t\t// We only allow editing of text classification data on list items.\r\n\t\tvar bListItem = ($(oContainer).parents(\".annotationListItem\").length > 0);\r\n\r\n\t\t// Build the id for the text classification data.\r\n\t\tvar textClassificationId = oAnnotation.id + \"_textClassificationData\" + (bListItem ? \"_list\" : \"_popup\");\r\n\r\n\t\t// Create the input element.\r\n\t\tvar input = document.createElement(\"p\");\r\n\t\tinput.id = textClassificationId;\r\n\t\tinput.setAttribute(\"data-dbId\", textClassificationId);\r\n\t\tinput.className = \"TextClassificationAnnotationText\";\r\n\r\n\t\t// Build the editable content.\r\n\t\tvar szContent = \"\";\r\n\t\tszContent += \"