text: angular.module("palladioMetavis",["palladio","palladio.services"]).run(["componentService",function(t){var e=function(t,e){t.modifiable=void 0!==t.modifiable?t.modifiable:"true",t.displayOverview=void 0!==t.displayOverview?t.displayOverview:"true",t.displayTables=void 0!==t.displayTables?t.displayTables:"true",t.displayTypes=void 0!==t.displayTypes?t.displayTypes:"false",t.displayPills=void 0!==t.displayPills?t.displayPills:"false",t.displayDownload=void 0!==t.displayDownload?t.displayDownload:"true",t.displayReview=void 0!==t.displayReview?t.displayReview:"false",t.expanded=void 0!==t.expanded?t.expanded:"false",t.displayIndex=void 0!==t.displayIndex?t.displayIndex:"all";var i="<div data-palladio-metavis ";return i+='modifiable="'+t.modifiable+'" ',i+='display-overview="'+t.displayOverview+'" ',i+='display-tables="'+t.displayTables+'" ',i+='display-index="'+t.displayIndex+'" ',i+='display-types="'+t.displayTypes+'" ',i+='display-pills="'+t.displayPills+'" ',i+='display-download="'+t.displayDownload+'" ',i+='display-review="'+t.displayReview+'" ',i+='expanded="'+t.expanded+'" ',i+=" ></div>"};t.register("metavis",e)}]).directive("palladioMetavis",function(t,e,i,l){return{scope:{modifiable:"=",expanded:"=",displayOverview:"=",displayTables:"=",displayIndex:"@",displayTypes:"=",displayReview:"=",displayPills:"=",displayDownload:"="},templateUrl:"partials/palladio-metavis-component/template.html",link:{pre:function(t,e){t.fileForArrowIndexChange=null,t.editModalId="dimensionEditModal"+Math.round(1e4*Math.random()),t.clearArrowEffect=function(){t.fileForArrowIndexChange=null},t.reparseFile=function(e){e.fields.forEach(function(i){t.reparseField(i,e)})},t.reparseField=function(t,e){var l=i.parseColumn(t.key,e.data,t.mvDelimiter,t.hierDelimiter,[],t.type);t.uniques=l.uniques,t.uniqueValues=t.uniques.map(function(t){return t.key}),t.sourceType=t.sourceType?t.sourceType:null,t.detailType=t.detailType?t.detailType:t.type?t.type:null,t.uniqueKey&&"number"===t.detailType&&(t.detailType="uniqueNumeric"),t.uniqueKey&&"text"===t.detailType&&(t.detailType="uniqueText"),2===t.uniques.length&&(t.detailType="binary0"),t.uniques.length>2&&t.uniques.length<10&&"number"===t.detailType&&(t.detailType="ordinalNumeric"),t.uniques.length>2&&t.uniques.length<10&&"text"===t.detailType&&(t.detailType="nominalText"),"numeric"===t.detailType&&(t.detailType="number"),void 0===t.verifiedSpecialChars&&(t.verifiedSpecialChars=[])},t.reparseUniques=function(t,e){var l=i.parseColumn(t.key,e.data,t.mvDelimiter,t.hierDelimiter,[],t.type);t.uniques=l.uniques,t.uniqueValues=t.uniques.map(function(t){return t.key})},t.codemirrorLoaded=function(e){e.on("drop",function(e,i){t.$apply(function(t){t.lastFileName=i.dataTransfer.files[0].name.replace(/\.[^\/.]+$/,"")||null})})},t.lastFileName=null,t.downloadFile=function(t){var e=new Blob([d3.csv.format(t.data)],{type:"text/csv;charset=utf-8"}),i=t.label+".csv";saveAs(e,i)},t.selectedFieldMetadata={},t.selectedFile={},t.assignSelectedFieldandFile=function(e,i){t.selectedFieldMetadata=e,t.selectedFile=i,t.modifiable&&$("#"+t.editModalId).modal({show:!0})},t.colors={uniqueNumeric:"#E0CD29",uniqueText:"#E07129",numeric:"#BBAA1B",number:"#BBAA1B",text:"#BB5A1B",binary0:"#9988C0",binary1:"#CD88BD",ordinalNumeric:"#767A79",nominalText:"#53585F",coordinates:"#A1C088",latlong:"#A1C088",date:"#577AA4",YYYYMMDD:"#577AA4",YYYYMM:"#88A1C0",YYYY:"#A9BBD2",url:"#C0A788","null":"#EEEEEE",mismatch:"#EC5D57"},t.textColors={uniqueNumeric:"#FFFFFF",uniqueText:"#FFFFFF",numeric:"#FFFFFF",number:"#FFFFFF",text:"#FFFFFF",binary0:"#FFFFFF",binary1:"#FFFFFF",ordinalNumeric:"#FFFFFF",nominalText:"#FFFFFF",coordinates:"#FFFFFF",latlong:"#FFFFFF",date:"#FFFFFF",YYYYMMDD:"#FFFFFF",YYYYMM:"#FFFFFF",YYYY:"#FFFFFF",url:"#FFFFFF","null":"#444444",mismatch:"#FFFFFF"},t.typeTexts={uniqueNumeric:"Unique Numeric",uniqueText:"Unique Text",numeric:"Numeric",number:"Numeric",text:"Text",binary0:"Binary",binary1:"Binary",ordinalNumeric:"Ordinal Numeric (<10 values)",nominalText:"Nominal Text (<10 values)",coordinates:"Coordinates",latlong:"Coordinates",date:"Date",YYYYMMDD:"Date (YYYY-MM-DD)",YYYYMM:"Date (YYYY-MM)",YYYY:"Date (YYYY)",url:"URL","null":"not defined",mismatch:"match error"},t.allowedTypes=[{id:"uniqueNumeric",name:"Unique Numeric",description:"Numeric and unique data such as 1234 or 1.234"},{id:"uniqueText",name:"Unique Text",description:"Any text-based data that is unique"},{id:"number",name:"Numeric",description:"Numeric data such as 1234 or 1.234"},{id:"text",name:"Text",description:"Any text-based data"},{id:"binary0",name:"Binary",description:"Binary data such as Y/N, True/False"},{id:"ordinalNumeric",name:"Ordinal Numeric",description:"Numeric, categorical data with a limited number (<10) of categories"},{id:"nominalText",name:"Nominal Text",description:"Text, categorical data with a limited number (<10) or categories"},{id:"coordinates",name:"Coordinates",description:"Latitude, Longitude coordinates such as 12.345,67.890"},{id:"date",name:"Date",description:"Dates can be YYYY or YYYY-MM-DD"},{id:"url",name:"URL",description:"The URL of a website or image such as http://www.example.org/file.yyy"}],t.sourceTexts={source:"Directly from source data",curated:"Curated values based on source data",authored:"Authored information",generated:"Generated for visualization or data analysis purposes",unknown:"Unknown source"},t.sourceTextArray=d3.entries(t.sourceTexts).map(function(t){return t.displayKey=t.key.charAt(0).toUpperCase()+t.key.slice(1),t}),t.displayVal=function(t){var e=null,i='<span class="small">'+t.key.split(e).reduce(function(t,e,i,l){return t+"&nbsp;".repeat(2*i)+e},"")+"</span>",l=t.value>1?'<span class="pull-right small muted">'+t.value+"</span>":"";return i+l},t.sortOptions=[{label:"Sort by Value",value:"key",icon:"fa-sort-alpha-asc",ordering:function(t){return t.key}},{label:"Sort by Frequency",value:"value",icon:"fa-sort-numeric-asc",ordering:function(t){return-t.value}}],t.displayOptions={sortBy:t.sortOptions[0]},t.$watch("displayOptions.sortBy",function(){t.sortOrder=t.displayOptions.sortBy.ordering}),t.filterSpecials=function(t,e){return e||(e=[]),t.filter(function(t){return e.indexOf(t)===-1})}},post:function(t,n,a){function d(){setTimeout(function(){s()},100)}function s(){angular.element(n[0]).find("div.dimension-type").tooltip(),angular.element(n[0]).find("i.source-type").tooltip()}function o(){angular.element(n[0]).find("div.dimension-type").tooltip("destroy"),angular.element(n[0]).find("i.source-type").tooltip("destroy")}t.metadata=e.getMetadata(),t.files=e.getFiles(),t.displayIndex&&"all"!==t.displayIndex&&(t.files=[t.files[t.displayIndex]]),t.maxRecords=d3.max(t.files,function(t){return t.data.length}),t.files.forEach(t.reparseFile),t.sortFields=function(e){e.fields.forEach(function(i){t.sortField(i,e)})},t.sortField=function(e,i){switch(i.sortMode){case"Map errors and gaps":e.sortedValues=i.data.map(function(t){return t[e.key]}).map(function(i){return{value:i,color:t.colorCalc(i,"error",e)}});break;case"Map by data types":e.sortedValues=i.data.map(function(t){return t[e.key]}).map(function(i){return{value:i,color:t.colorCalc(i,"type",e)}});break;case"Sort by values":e.sortedValues=i.data.map(function(t){return t[e.key]}).map(function(i){return{value:i,color:t.colorCalc(i,"type",e)}}).sort(function(t,e){return t.color<e.color?-1:1})}},d(),t.centerTable=function(t){function e(){var e=t.currentTarget.parentNode.parentNode.parentNode;e.parentNode.scrollLeft=e.parentNode.scrollLeft-30+e.getBoundingClientRect().left}setTimeout(e)},t.calcPosition=function(e){return $(".table-display")[t.files.indexOf(e)].getBoundingClientRect().left<0&&$(".table-display")[t.files.indexOf(e)].getBoundingClientRect().right>500?"absolute":"relative"},$("#tables").scroll(function(){t.$digest()}),t.colorCalc=function(e,i,l){if("error"===i){if(null===e||void 0===e||""===e)return t.colors["null"];var n=v(e);return n.indexOf(l.detailType)!==-1||n.indexOf("number")>-1&&("uniqueNumeric"===l.detailType||"ordinalNumeric"===l.detailType)||n.indexOf("text")>-1&&("uniqueText"===l.detailType||"nominalText"===l.detailType)||n.indexOf("text")>-1&&"uniqueText"===l.detailType||(4===e.length||7===e.length)&&"date"===l.detailType||"binary0"===l.detailType?"#bbbbbb":t.colors.mismatch}if("edit"===i){var n=v(e);return n.indexOf(l.detailType)!==-1||n.indexOf("number")>-1&&("uniqueNumeric"===l.detailType||"ordinalNumeric"===l.detailType)||n.indexOf("text")>-1&&("uniqueText"===l.detailType||"nominalText"===l.detailType)||n.indexOf("text")>-1&&"uniqueText"===l.detailType||"binary0"===l.detailType?"#bbbbbb":t.colors.mismatch}if("type"===i)return"ordinalNumeric"===l.detailType&&"number"===h(e)?t.colors.ordinalNumeric:"binary0"!==l.detailType||!l.uniqueValues||e!==l.uniqueValues[0]&&e!==l.uniqueValues[1]?"ordinalNumeric"!==l.detailType&&"nominalText"!==l.detailType||!e||l.uniqueValues.indexOf(e.split(l.mvDelimiter)[0])===-1?t.colors[h(e)]:t.colors[l.detailType]:e===l.uniqueValues[0]?t.colors.binary0:t.colors.binary1},t.assignIndexAndFile=function(e,i){e.editIndex=i,t.fileForArrowIndexChange=e},l.keydown(function(e){t.$apply(function(i){27===e.keyCode&&i.files.forEach(function(t){t.editIndex=null}),37===e.keyCode&&t.fileForArrowIndexChange&&t.fileForArrowIndexChange.editIndex>0&&(e.preventDefault(),t.fileForArrowIndexChange.editIndex--),39===e.keyCode&&t.fileForArrowIndexChange&&t.fileForArrowIndexChange.editIndex<t.fileForArrowIndexChange.data.length-1&&(e.preventDefault(),t.fileForArrowIndexChange.editIndex++)})}),t.numberWithValue=function(t,e){return t.data.filter(function(t){return null!==t[e.key]&&void 0!==t[e.key]&&""!==t[e.key]}).length};var r=function(t){return"string"==typeof t},c=function(t){return!(!t||!t.toString)&&"[object Array]"==t.toString()},p=function(t){return"number"==typeof t||RegExp("^\\d*$").test(t)},u=function(t){return null!==t&&"object"==typeof t},f=function(t){return!(!t||!t.replace)&&!isNaN(t.replace(",","."))},m=function(t){var e=RegExp("^[-]\\d\\d\\d\\d($)|([-](0[0-9]|1[012]|[0-9])[-](0[0-9]|[12][0-9]|3[01]|[0-9])$)");return!!e.test(t)},g=function(t){if(t){var e=t.split(",");if(2!==e.length)return!1;if(f(e[0])&&f(e[1]))return!0}return!1},y=function(t){return!(!t||!t.indexOf||0!==t.indexOf("https://")&&0!==t.indexOf("http://")&&0!==t.indexOf("www."))},h=function(t){return"undefined"==typeof t||null===t||0===t.length?"null":u(t)?"object":c(t)?"array":p(t)&&4===t.length?"YYYY":p(t)?"number":y(t)?"url":m(t)&&4===t.length?"YYYY":m(t)&&7===t.length?"YYYYMM":m(t)?"date":f(t)?"number":g(t)?"latlong":r(t)?"text":null},v=function(t){var e=[];return u(t)&&e.push("object"),c(t)&&e.push("array"),p(t)&&4===t.length&&e.push("YYYY"),p(t)&&e.push("number"),y(t)&&e.push("url"),m(t)&&4===t.length&&e.push("YYYY"),m(t)&&7===t.length&&e.push("YYYYMM"),m(t)&&e.push("date"),f(t)&&e.push("number"),g(t)&&e.push("latlong"),r(t)&&e.push("text"),e};t.updateMetadata=function(){t.reparseUniques(t.selectedFieldMetadata,t.selectedFile),t.sortField(t.selectedFieldMetadata,t.selectedFile),o(),d()},t.updateUniques=t.updateMetadata,t.addFile=function(l,n){if(l&&l.length)if(t.parseError=!1,0!==l.indexOf("http")||l.indexOf("\n")!==-1){try{var a=JSON.parse(l);return e.addFile(a,t.lastFileName),t.lastFileName=null,void t.reparseFile(e.getFiles()[e.getFiles().length-1])}catch(s){try{var a=i.parseText(l);e.addFile(a,t.lastFileName),t.lastFileName=null,t.reparseFile(e.getFiles()[e.getFiles().length-1])}catch(s){t.parseError=s.message}}d()}else try{i.parseUrl(l).then(function(n){var a=l,s=i.parseText(n);e.addFile(s,"From URL",a),t.reparseFile(e.getFiles()[e.getFiles().length-1]),d()},function(e){t.parseError=e})}catch(s){t.parseError=s.message}}}}}}),angular.module("palladio").run(["$templateCache",function(t){t.put("partials/palladio-metavis-component/template.html",'<div id="main">\n\t<div id="table-histograms" data-ng-if="displayOverview" class="center-block container-fluid">\n\t\t<div class="table-histogram row" ng-repeat="file in files">\n\t\t\t<div class="col-md-2">\n\t\t\t\t<span class="pull-right" ng-click="file.reviewMode = !file.reviewMode;">{{file.label}}</span>\n\t\t\t</div>\n\t\t\t<div class="col-md-8">\n\t\t\t\t<div \n\t\t\t\t\tstyle="width: {{85 * file.data.length / maxRecords}}%; background-color: #D3D3D3; height: 10px; margin-top: 5px; display: inline-block"\n\t\t\t\t\tng-click="file.reviewMode = !file.reviewMode;">\n\t\t\t\t</div>\n\t\t\t\t<span style="font-weight: lighter; font-size: smaller"\n\t\t\t\t\tng-click="file.reviewMode = !file.reviewMode;">\n\t\t\t\t\t\n\t\t\t\t\t{{file.data.length}} records\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class="clearfix" style="height:50px"></div>\n\t<div id="tables" data-ng-if="displayTables"\n\t\t\tstyle="overflow-x:scroll; white-space: nowrap; margin-bottom: 2px; height: 100%; padding-left: 30px">\n\t\t<div class="table-display" ng-repeat="file in files"\n\t\t\tstyle="vertical-align:top; margin-right: 30px;"\n\t\t\tng-init="sortModes=[\'Map errors and gaps\',\'Map by data types\',\'Sort by values\']; file.sortMode = sortModes[0]; sortFields(file); file.displayType = displayTypes; file.reviewMode = expanded;">\n\t\t\t<div class="table-header pull-left" style="margin-bottom: 7px; overflow:hidden; white-space: nowrap; display: inline-block; clear: both;">\n\t\t\t\t<span class="labels" style="width:263px; display:inline-block">\n\t\t\t\t\t<!--<span class="table-label" style="font-weight: strong; font-size: larger">{{file.label}}</span>-->\n\t\t\t\t\t<input tooltip-animation="false" tooltip-append-to-body="true" tooltip="Rename" data-container="body"\n\t\t\t\t\t\tdata-placement="top" type="text" class="form-control editable ng-pristine ng-untouched ng-valid table-label"\n\t\t\t\t\t\tng-model="file.label" placeholder="Untitled" ng-disabled="!modifiable">\n\t\t\t\t\t<span class="review-label" data-ng-if="displayReview"\n\t\t\t\t\t\tstyle="font-weight: strong; font-size: larger; color: #EC5D57;"\n\t\t\t\t\t\tng-click="file.reviewMode = !file.reviewMode; centerTable($event);">review</span>\n\t\t\t\t</span>\n\t\t\t\t<span style="width: 35px; padding: 5px; display:inline-block;">\n\t\t\t\t\t<input type="checkbox" \n\t\t\t\t\t\tng-model="file.displayType"\n\t\t\t\t\t\tstyle="height: 16px; width: 16px; margin-top:0px;">\n\t\t\t\t\t</input>\n\t\t\t\t</span>\n\t\t\t\t<span ng-show="file.reviewMode">\n\t\t\t\t\t<span ng-repeat="mode in sortModes" style="margin-left: 10px; margin-right: 10px"\n\t\t\t\t\t\tng-style="{ \'color\': mode === file.sortMode ? \'#bbbbbb\' : \'#68ABE5\' }"\n\t\t\t\t\t\tng-click="file.sortMode = mode; file.sortMode === sortModes[2] ? file.editIndex = null : null; sortFields(file);">\n\t\t\t\t\t\t{{mode}}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div class="dimension pull-left" ng-repeat="field in file.fields"\n\t\t\t\tstyle="overflow:hidden; white-space: nowrap; margin-bottom: 2px; height: 35px; display: inline-block; clear: both; left: -30px;">\n\t\t\t\t<div style="height: 35px; width: 300px; display: inline-block; left: 0px;">\n\t\t\t\t\t<div class="dimension-main" style="height: 35px; width: 263px; background-color: #eeeeee; padding: 5px; font-weight: lighter; display: inline-block;"\n\t\t\t\t\t\tng-click="assignSelectedFieldandFile(field, file)">\n            <div style="left: 5px; overflow: visible; width: 263px;">\n              <i class="source-type fa pull-left" style="margin-top:6px; margin-right: 7px; min-width:12px;"\n                  ng-class="{ \'fa-circle\': field.sourceType === \'authored\', \'fa-dot-circle-o\': field.sourceType === \'curated\', \'fa-circle-o\': field.sourceType === \'source\' }"\n                  data-toggle="tooltip" data-placement="right" title="{{sourceTexts[field.sourceType] ? sourceTexts[field.sourceType] : \'No source information provided\'}}"></i>\n              <div style="padding-left: 5px; padding-right: 5px; border-radius: 4px; background-color: #eeeeee;" ng-style="{ position: calcPosition(file) }">\n                <span class="pull-left field-description">{{field.description}}{{field.mvDelimiter ? \' (M)\' : \'\'}}</span>\n              </div>\n            </div>\n\t\t\t\t\t\t<span class="dimension-specials pull-right" data-ng-if="displayPills">\n\t\t\t\t\t\t\t<div class="special-character" ng-repeat="special in field.special"\n\t\t\t\t\t\t\t\tstyle="color: #FFFFFF; height: 25px; width: 25px; display: inline-block; margin-right: 2px; text-align: center; font-size: larger; font-weight: strong; border-radius: 4px;"\n\t\t\t\t\t\t\t\tng-style="{ \'background-color\': filterSpecials(field.unassignedSpecialChars, field.verifiedSpecialChars).indexOf(special) === -1 ? \'#bbbbbb\' : \'#EC5D57\' }"\n\t\t\t\t\t\t\t\tng-click="field.verifiedSpecialChars.push(special); $event.stopPropagation()">\n\t\t\t\t\t\t\t\t{{special}}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style="width: 35px; height:35px; display: inline-block; margin-left: -2px; padding: 5px";\n\t\t\t\t\t\tng-style="{ \'background-color\' : file.displayType ? colors[field.detailType] : \'#eeeeee\' }"\n\t\t\t\t\t\tdata-toggle="tooltip" data-placement="top" title="{{typeTexts[field.detailType] ? typeTexts[field.detailType] : \'not found\'}}"\n\t\t\t\t\t\tclass="dimension-type">\n\t\t\t\t\t\t<span ng-hide="!file.reviewMode" class="pull-left"\n\t\t\t\t\t\t\tstyle="width: 25px; font-weight: lighter; text-align: center;"\n\t\t\t\t\t\t\tng-style="{ color: file.displayType ? textColors[field.detailType] : \'#444444\', \'font-size\': numberWithValue(file, field)>999 ? (numberWithValue(file, field)>9999 ? \'10px\' : \'11.5px\') : \'inherit\', \'margin-top\': numberWithValue(file, field)>999 ? \'4px\' : \'3px\' }">\n\t\t\t\t\t\t\t{{numberWithValue(file, field)}}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div style="height: 35px; display: inline-block; margin-left: -2px"\n\t\t\t\t\t\tng-show="file.reviewMode">\n\t\t\t\t\t<span ng-show="file.editIndex !== null && file.editIndex !== undefined"\n\t\t\t\t\t\tstyle="height: 35px; display: inline-block; width: 200px; position: relative; float: left;"\n\t\t\t\t\t\tng-style="{ left: file.editIndex*4 }">\n\t\t\t\t\t\t<input type="text" ng-model="file.data[file.editIndex][field.key]"\n\t\t\t\t\t\t\tstyle="width:200px; margin:0px; height: 35px;"\n\t\t\t\t\t\t\tng-disabled = "!modifiable"\n\t\t\t\t\t\t\tng-focus="clearArrowEffect()"\n\t\t\t\t\t\t\tng-change="field.sortedValues[file.editIndex].color = colorCalc(file.data[file.editIndex][field.key], file.sortMode === sortModes[0] ? \'edit\' : \'type\', field)"\n\t\t\t\t\t\t\tng-style="{ \'color\': colorCalc(file.data[file.editIndex][field.key], file.sortMode === sortModes[0] ? \'edit\' : \'type\', field) }"></input>\n\t\t\t\t\t</span>\n\t\t\t\t\t<div style="height:35px; display: inline-block; background-color: #eeeeee"\n\t\t\t\t\t\tng-style="{ \'margin-left\': file.editIndex !== null && file.editIndex !== undefined ? \'-200px\' : \'0px\' }">\n\t\t\t\t\t\t<div ng-repeat="obj in field.sortedValues"\n\t\t\t\t\t\t\tstyle="height: 35px; margin-right: 1px; display: inline-block;"\n\t\t\t\t\t\t\tng-style="{ width: $index === file.editIndex ? \'200px\' : 3 + \'px\', \'background-color\': $index === file.editIndex ? \'white\' : obj.color }"\n\t\t\t\t\t\t\tng-click="file.sortMode !== sortModes[2] ? assignIndexAndFile(file, $index) : null">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tdata-ng-if="displayDownload"\n\t\t\t\tclass="pull-left"\n\t\t\t\tstyle="display: inline-block; margin-top: 3px; margin-left: 5px; clear: left;"\n\t\t\t\ttooltip-append-to-body="true"\n\t\t\t\ttooltip="Download as .csv"\n\t\t\t\ttooltip-placement="right"\n\t\t\t\tdata-ng-click="downloadFile(file)">\n\t\t\t\t\t<i class="fa fa-download"></i>\n\t\t\t</div>\n\t\t\t<div class="pull-left" data-ng-if="modifiable"\n\t\t\t\tstyle="font-size: smaller; color: #EC5D57; margin-top: 5px; margin-left: 5px; height: 35px; display: inline-block;"\n\t\t\t\tng-click="files.splice($index, 1)">\n\t\t\t\t\n\t\t\t\tRemove file\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div style="padding-left: 30px" data-ng-if="modifiable">\n\t\t<!-- Button trigger add file modal -->\n\t\t<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#addFileModal">\n\t\t\tAdd file\n\t\t</button>\n\t\t<div palladio-data-download data-ng-show="files.length" style="display:inline-block">\n\t\t\tDownload Palladio save file\n\t\t</div>\n\t</div>\n</div>\n\n<!-- Add File Modal -->\n<div class="modal fade" id="addFileModal" tabindex="-1" role="dialog" aria-labelledby="addFileModalLabel">\n  <div class="modal-dialog modal-lg">\n    <div class="modal-content">\n      <div class="modal-header">\n        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>\n        <h4 class="modal-title" id="addFileModalLabel">Add File</h4>\n      </div>\n      <div class="modal-body">\n        <textarea ui-refresh="" ui-codemirror="{ mode : \'text\', lineNumbers : true, lineWrapping: true, onLoad : codemirrorLoaded }" placeholder="Paste your data or drop a file here" ng-model="text"></textarea>\n      </div>\n      <div class="modal-footer">\n        <button type="button" class="btn btn-default" data-dismiss="modal" ng-click="text = null">Close</button>\n        <button type="button" class="btn btn-primary" ng-click="addFile(text); text = null" data-dismiss="modal">Add file</button>\n      </div>\n    </div>\n  </div>\n</div>\n\n<!-- Dimension edit modal -->\n\n<div class="modal" id="{{editModalId}}" tabindex="-1" role="dialog" aria-labelledby="dimensionEditModalLabel" aria-hidden="true">\n\t<div class="modal-dialog modal-lg">\n\t\t<div class="modal-content">\n\t\t\t<!-- Modal Header -->\n\t\t\t<div class="modal-header">\n\t\t\t\t<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>\n\t\t\t\t<span>Edit dimension</span>\n\t\t\t</div>\n\n\t\t\t<!-- Modal Body -->\n\t\t\t<div class="modal-body">\n\t\t\t\t<div>\n\t\t\t\t\t<div class="row margin-bottom">\n\t\t\t\t\t\t<div class="col-lg-2 col-md-2 col-sm-4 col-xs-4 text-right">\n\t\t\t\t\t\t\t<label class="inline">Title</label>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-lg-10 col-md-10 col-sm-8 col-xs-8 col-condensed">\n\t\t\t\t\t\t\t<div class="row margin-bottom">\n\t\t\t\t\t\t\t\t\t<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tdata-toggle="tooltip"\n\t\t\t\t\t\t\t\t\t\t\tdata-original-title="Rename"\n\t\t\t\t\t\t\t\t\t\t\ttype="text"\n\t\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t\t\tclass="form-control"\n\t\t\t\t\t\t\t\t\t\t\tdata-ng-model="selectedFieldMetadata.description" placeholder="Untitled"></input>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">\n\t\t\t\t\t\t\t\t\t\t<label>Source <i class="fa fa-question-circle hint" popover-trigger="mouseenter" popover="Choose a description of the source or authorship of data in this column."></i></label>\n\t\t\t\t\t\t\t\t\t\t<ui-select ng-model="selectedFieldMetadata.sourceType" theme="selectize" append-to-body="true">\n\t\t\t\t\t\t\t\t\t\t\t<ui-select-match placeholder="Select" allow-clear="true">\n\t\t\t\t\t\t\t\t\t\t\t\t{{$select.selected.displayKey}}\n\t\t\t\t\t\t\t\t\t\t\t\t<span class="caret"></span>\n\t\t\t\t\t\t\t\t\t\t\t</ui-select-match>\n\t\t\t\t\t\t\t\t\t\t\t<ui-select-choices repeat="type.key as type in sourceTextArray | filter: {key:$select.search}">\n\t\t\t\t\t\t\t\t\t\t\t\t<span ng-bind-html="type.displayKey | highlight: $select.search"></span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class="text-muted" ng-bind-html="type.value"></span>\n\t\t\t\t\t\t\t\t\t\t\t</ui-select-choices>\n\t\t\t\t\t\t\t\t\t\t</ui-select>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\n\t\n\t\t\t\t\t<div class="row margin-top">\n\t\t\t\t\t\t<div class="col-lg-2 col-md-2 col-sm-4 col-xs-4 text-right">\n\t\t\t\t\t\t\t<label class="inline">Data type</label>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-lg-9 col-md-9 col-sm-8 col-xs-8 col-condensed">\n\t\n\t\t\t\t\t\t\t<ui-select ng-model="selectedFieldMetadata.detailType" theme="selectize" ng-disabled="disabled" on-select="updateMetadata()" append-to-body="true">\n\t\t\t\t\t\t\t\t<ui-select-match placeholder="Select or search">\n\t\t\t\t\t\t\t\t\t{{$select.selected.name}}\n\t\t\t\t\t\t\t\t\t<span class="caret"></span>\n\t\t\t\t\t\t\t\t</ui-select-match>\n\t\t\t\t\t\t\t\t<ui-select-choices repeat="type.id as type in allowedTypes | filter: {name:$select.search}">\n\t\t\t\t\t\t\t\t\t<span ng-bind-html="type.name | highlight: $select.search"></span><br/>\n\t\t\t\t\t\t\t\t\t<span class="text-muted" ng-bind-html="type.description"></span>\n\t\t\t\t\t\t\t\t</ui-select-choices>\n\t\t\t\t\t\t\t</ui-select>\n\t\n\t\t\t\t\t\t\t<p class="help-block" data-ng-show="selectedFieldMetadata.errors.length">{{selectedFieldMetadata.errors.length}} unique values do not match this data type!</p>\n\t\t\t\t\t\t\t<p class="help-block" data-ng-hide="selectedFieldMetadata.errors.length">All the values match this type.</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\n\t\n\t\t\t\t\t<div class="row">\n\t\n\t\t\t\t\t\t<div class="col-lg-2 col-md-2 col-sm-4 col-xs-4 text-right">\n\t\t\t\t\t\t\t<label class="inline">Unique values</label>\n\t\t\t\t\t\t</div>\n\t\n\t\t\t\t\t\t<div class="col-lg-10 col-md-10 col-sm-8 col-xs-8 col-condensed">\n\t\n\t\t\t\t\t\t\t<div class="row margin-bottom">\n\t\n\t\t\t\t\t\t\t\t<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">\n\t\n\t\t\t\t\t\t\t\t\t<div class="row">\n\t\n\t\t\t\t\t\t\t\t\t\t<div class="col-lg-5 col-md-6 col-sm-6 margin-bottom">\n\t\t\t\t\t\t\t\t\t\t\t<input type="text" class="form-control" ng-model="searchUnique.key" placeholder="Search"></input>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\n\t\t\t\t\t\t\t\t\t\t<div class="col-lg-5 col-lg-offset-2 col-md-6 col-sm-6">\n\t\n\t\t\t\t\t\t\t\t\t\t\t<ui-select class="pull-right" ng-model="displayOptions.sortBy" theme="selectize" ng-disabled="disabled" on-select="updateMetadata()">\n\t\t\t\t\t\t\t\t\t\t\t\t<ui-select-match placeholder="Select">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<!--<i class="fa margin-right" ng-class="$select.selected.icon"></i>-->\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{$select.selected.label}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="caret"></span>\n\t\t\t\t\t\t\t\t\t\t\t\t</ui-select-match>\n\t\t\t\t\t\t\t\t\t\t\t\t<ui-select-choices repeat="type in sortOptions | filter: {label:$select.search}">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span ng-bind-html="type.label | highlight: $select.search"></span><br/>\n\t\t\t\t\t\t\t\t\t\t\t\t</ui-select-choices>\n\t\t\t\t\t\t\t\t\t\t\t</ui-select>\n\t\n\t\t\t\t\t\t\t\t\t\t\t<div class="clearfix"></div>\n\t\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\n\t\t\t\t\t\t\t\t\t</div>\n\t\n\t\t\t\t\t\t\t\t\t<div class="unique-values margin-bottom">\n\t\t\t\t\t\t\t\t\t\t<table\n\t\t\t\t\t\t\t\t\t\t\tclass="table table-striped"\n\t\t\t\t\t\t\t\t\t\t\tdata-ng-show="!filtered || (filtered && filtered.length > 0)">\n\t\t\t\t\t\t\t\t\t\t\t<tr data-ng-repeat="val in filtered = (selectedFieldMetadata.uniques | filter:searchUnique | orderBy: sortOrder) | limitTo:1000">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-ng-class="{ \'text-danger\': findError(val.key) }"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle="{{findError(val.key).message}}"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-ng-bind-html="displayVal(val)">\n\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t<div class="padding-all text-danger small" data-ng-show="filtered && filtered.length == 0">No values found</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\n\t\t\t\t\t\t\t\t\t<p class="help-block"><strong>{{filtered.length}}</strong> values displayed.</p>\n\t\n\t\t\t\t\t\t\t\t</div>\n\t\n\t\t\t\t\t\t\t\t<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">\n\t\n\t\t\t\t\t\t\t\t\t<!--<div ng-show="selectedFieldMetadata.unassignedSpecialChars.length">\n\t\t\t\t\t\t\t\t\t\t<span class="help-block">Some of the values in this dimension contain the following special characters. If you want to use them as delimiter, type them into the forms below.</span>\n\t\t\t\t\t\t\t\t\t\t<div specials></div>\n\t\t\t\t\t\t\t\t\t</div>-->\n\t\n\t\t\t\t\t\t\t\t\t<div class="margin-bottom" ng-show="selectedFieldMetadata.unassignedSpecialChars.length">\n\t\t\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t\t\t<span data-ng-class="{ \'text-danger\': selectedFieldMetadata.unassignedSpecialChars.length !==  selectedFieldMetadata.verifiedSpecialChars.length}">\n\t\t\t\t\t\t\t\t\t\t\t\tVerify special characters\n\t\t\t\t\t\t\t\t\t\t\t</span> <i class="fa fa-question-circle hint" popover-trigger="mouseenter" popover="Special characters may be errors or multiple-value delimiters."></i></label>\n\t\t\t\t\t\t\t\t\t\t<div specials></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\n\t\t\t\t\t\t\t\t\t<label>Multiple values <i class="fa fa-question-circle hint" popover-trigger="mouseenter" popover="Field contains multiple values that are split by this character."></i></label>\n\t\t\t\t\t\t\t\t\t<input type="text" id="val-delimiter" class="form-control"\n\t\t\t\t\t\t\t\t\t\tdata-ng-model="selectedFieldMetadata.mvDelimiter"\n\t\t\t\t\t\t\t\t\t\tdata-ng-change="updateMetadata()"/>\n\t\t\t\t\t\t\t\t\t<span class="help-block">If the dimension contains multiple values, insert the delimiter string above</span>\n\t\t\t\t\t\t\t\t</div>\n\t\n\t\t\t\t\t\t\t</div>\n\t\n\t\n\t\n\t\t\t\t\t\t</div>\n\t\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<!-- Modal Footer -->\n\t\t\t<div class="modal-footer">\n\t\t\t\t<button data-ng-show="selectedFieldMetadata.unassignedSpecialChars.length === selectedFieldMetadata.verifiedSpecialChars.length" type="button" class="btn btn-default" data-dismiss="modal" ng-click="hideNewTable()"><i class="fa fa-check margin-right text-primary"></i>Done</button>\n\t\t\t\t<button data-ng-show="selectedFieldMetadata.unassignedSpecialChars.length !== selectedFieldMetadata.verifiedSpecialChars.length" type="button" class="btn btn-default" data-dismiss="modal" ng-click="hideNewTable()">Close</button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>')}]);