/*!
 * Azure Storage SDK for JavaScript - Blob, 10.3.0
 * Copyright (c) Microsoft and contributors. All rights reserved.
 */
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports):"function"==typeof define&&define.amd?define(["exports"],factory):factory(global.azblob={})}(this,function(exports){"use strict";function getHeaderKey(headerName){return headerName.toLowerCase()}var HttpHeaders=function(){function HttpHeaders(rawHeaders){if(this._headersMap={},rawHeaders)for(var headerName in rawHeaders)this.set(headerName,rawHeaders[headerName])}return HttpHeaders.prototype.set=function(headerName,headerValue){this._headersMap[getHeaderKey(headerName)]={name:headerName,value:headerValue.toString()}},HttpHeaders.prototype.get=function(headerName){var header=this._headersMap[getHeaderKey(headerName)];return header?header.value:void 0},HttpHeaders.prototype.contains=function(headerName){return!!this._headersMap[getHeaderKey(headerName)]},HttpHeaders.prototype.remove=function(headerName){var result=this.contains(headerName);return delete this._headersMap[getHeaderKey(headerName)],result},HttpHeaders.prototype.rawHeaders=function(){var result={};for(var headerKey in this._headersMap){var header=this._headersMap[headerKey];result[header.name.toLowerCase()]=header.value}return result},HttpHeaders.prototype.headersArray=function(){var headers=[];for(var headerKey in this._headersMap)headers.push(this._headersMap[headerKey]);return headers},HttpHeaders.prototype.headerNames=function(){for(var headerNames=[],headers=this.headersArray(),i=0;i<headers.length;++i)headerNames.push(headers[i].name);return headerNames},HttpHeaders.prototype.headerValues=function(){for(var headerValues=[],headers=this.headersArray(),i=0;i<headers.length;++i)headerValues.push(headers[i].value);return headerValues},HttpHeaders.prototype.toJson=function(){return this.rawHeaders()},HttpHeaders.prototype.toString=function(){return JSON.stringify(this.toJson())},HttpHeaders.prototype.clone=function(){return new HttpHeaders(this.rawHeaders())},HttpHeaders}();function encodeByteArray(value){for(var str="",i=0;i<value.length;i++)str+=String.fromCharCode(value[i]);return btoa(str)}function decodeString(value){for(var byteString=atob(value),arr=new Uint8Array(byteString.length),i=0;i<byteString.length;i++)arr[i]=byteString.charCodeAt(i);return arr}for(var rngBrowser=function createCommonjsModule(fn,module){return fn(module={exports:{}},module.exports),module.exports}(function(module){var getRandomValues="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues){var rnds8=new Uint8Array(16);module.exports=function whatwgRNG(){return getRandomValues(rnds8),rnds8}}else{var rnds=new Array(16);module.exports=function mathRNG(){for(var r,i=0;i<16;i++)3&i||(r=4294967296*Math.random()),rnds[i]=r>>>((3&i)<<3)&255;return rnds}}}),byteToHex=[],i=0;i<256;++i)byteToHex[i]=(i+256).toString(16).substr(1);var bytesToUuid_1=function bytesToUuid(buf,offset){var i=offset||0,bth=byteToHex;return[bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]]].join("")};var v4_1=function v4(options,buf,offset){var i=buf&&offset||0;"string"==typeof options&&(buf="binary"===options?new Array(16):null,options=null);var rnds=(options=options||{}).random||(options.rng||rngBrowser)();if(rnds[6]=15&rnds[6]|64,rnds[8]=63&rnds[8]|128,buf)for(var ii=0;ii<16;++ii)buf[i+ii]=rnds[ii];return buf||bytesToUuid_1(rnds)},Constants_msRestVersion="0.1.0",Constants_HttpConstants={HttpVerbs:{PUT:"PUT",GET:"GET",DELETE:"DELETE",POST:"POST",MERGE:"MERGE",HEAD:"HEAD",PATCH:"PATCH"},StatusCodes:{TooManyRequests:429}},Constants_HeaderConstants={AUTHORIZATION:"authorization",AUTHORIZATION_SCHEME:"Bearer",RETRY_AFTER:"Retry-After",USER_AGENT:"User-Agent"},isNode="undefined"==typeof navigator&&"undefined"!=typeof process;function stripResponse(response){var strippedResponse={};return strippedResponse.body=response.bodyAsText,strippedResponse.headers=response.headers,strippedResponse.status=response.status,strippedResponse}function stripRequest(request){var strippedRequest=request.clone();return strippedRequest.headers&&strippedRequest.headers.remove("authorization"),strippedRequest}function generateUuid(){return v4_1()}function delay$1(t,value){return new Promise(function(resolve){return setTimeout(function(){return resolve(value)},t)})}var validateISODuration=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function replaceAll(value,searchValue,replaceValue){return value&&searchValue?value.split(searchValue).join(replaceValue||""):value}var Serializer=function(){function Serializer(modelMappers,isXML){void 0===modelMappers&&(modelMappers={}),this.modelMappers=modelMappers,this.isXML=isXML}return Serializer.prototype.validateConstraints=function(mapper,value,objectName){var failValidation=function(constraintName,constraintValue){throw new Error('"'+objectName+'" with value "'+value+'" should satisfy the constraint "'+constraintName+'": '+constraintValue+".")};if(mapper.constraints&&null!=value){var _a=mapper.constraints,ExclusiveMaximum=_a.ExclusiveMaximum,ExclusiveMinimum=_a.ExclusiveMinimum,InclusiveMaximum=_a.InclusiveMaximum,InclusiveMinimum=_a.InclusiveMinimum,MaxItems=_a.MaxItems,MaxLength=_a.MaxLength,MinItems=_a.MinItems,MinLength=_a.MinLength,MultipleOf=_a.MultipleOf,Pattern=_a.Pattern,UniqueItems=_a.UniqueItems;null!=ExclusiveMaximum&&value>=ExclusiveMaximum&&failValidation("ExclusiveMaximum",ExclusiveMaximum),null!=ExclusiveMinimum&&value<=ExclusiveMinimum&&failValidation("ExclusiveMinimum",ExclusiveMinimum),null!=InclusiveMaximum&&value>InclusiveMaximum&&failValidation("InclusiveMaximum",InclusiveMaximum),null!=InclusiveMinimum&&value<InclusiveMinimum&&failValidation("InclusiveMinimum",InclusiveMinimum),null!=MaxItems&&value.length>MaxItems&&failValidation("MaxItems",MaxItems),null!=MaxLength&&value.length>MaxLength&&failValidation("MaxLength",MaxLength),null!=MinItems&&value.length<MinItems&&failValidation("MinItems",MinItems),null!=MinLength&&value.length<MinLength&&failValidation("MinLength",MinLength),null!=MultipleOf&&value%MultipleOf!==0&&failValidation("MultipleOf",MultipleOf),Pattern&&null===value.match(Pattern)&&failValidation("Pattern",Pattern),UniqueItems&&value.some(function(item,i,ar){return ar.indexOf(item)!==i})&&failValidation("UniqueItems",UniqueItems)}},Serializer.prototype.serialize=function(mapper,object,objectName){var payload={},mapperType=mapper.type.name;objectName||(objectName=mapper.serializedName),null!==mapperType.match(/^Sequence$/gi)&&(payload=[]),null!=object||null==mapper.defaultValue&&!mapper.isConstant||(object=mapper.defaultValue);var required=mapper.required,nullable=mapper.nullable;if(required&&nullable&&void 0===object)throw new Error(objectName+" cannot be undefined.");if(required&&!nullable&&null==object)throw new Error(objectName+" cannot be null or undefined.");if(!required&&!1===nullable&&null===object)throw new Error(objectName+" cannot be null.");if(null==object)payload=object;else if(this.validateConstraints(mapper,object,objectName),null!==mapperType.match(/^any$/gi))payload=object;else if(null!==mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/gi))payload=function serializeBasicTypes(typeName,objectName,value){if(null!=value)if(null!==typeName.match(/^Number$/gi)){if("number"!=typeof value)throw new Error(objectName+" with value "+value+" must be of type number.")}else if(null!==typeName.match(/^String$/gi)){if("string"!=typeof value.valueOf())throw new Error(objectName+' with value "'+value+'" must be of type string.')}else if(null!==typeName.match(/^Uuid$/gi)){if("string"!=typeof value.valueOf()||!function isValidUuid(uuid){return new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","ig").test(uuid)}(value))throw new Error(objectName+' with value "'+value+'" must be of type string and a valid uuid.')}else if(null!==typeName.match(/^Boolean$/gi)){if("boolean"!=typeof value)throw new Error(objectName+" with value "+value+" must be of type boolean.")}else if(null!==typeName.match(/^Stream$/gi)){var objectType=typeof value;if(!("string"===objectType||"function"===objectType||value instanceof ArrayBuffer||ArrayBuffer.isView(value)||("function"==typeof Blob||"object"==typeof Blob)&&value instanceof Blob))throw new Error(objectName+" must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.")}return value}(mapperType,objectName,object);else if(null!==mapperType.match(/^Enum$/gi)){payload=function serializeEnumType(objectName,allowedValues,value){if(!allowedValues)throw new Error("Please provide a set of allowedValues to validate "+objectName+" as an Enum Type.");if(!allowedValues.some(function(item){return"string"==typeof item.valueOf()?item.toLowerCase()===value.toLowerCase():item===value}))throw new Error(value+" is not a valid value for "+objectName+". The valid values are: "+JSON.stringify(allowedValues)+".");return value}(objectName,mapper.type.allowedValues,object)}else null!==mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/gi)?payload=function serializeDateTypes(typeName,value,objectName){if(null!=value)if(null!==typeName.match(/^Date$/gi)){if(!(value instanceof Date||"string"==typeof value.valueOf()&&!isNaN(Date.parse(value))))throw new Error(objectName+" must be an instanceof Date or a string in ISO8601 format.");value=value instanceof Date?value.toISOString().substring(0,10):new Date(value).toISOString().substring(0,10)}else if(null!==typeName.match(/^DateTime$/gi)){if(!(value instanceof Date||"string"==typeof value.valueOf()&&!isNaN(Date.parse(value))))throw new Error(objectName+" must be an instanceof Date or a string in ISO8601 format.");value=value instanceof Date?value.toISOString():new Date(value).toISOString()}else if(null!==typeName.match(/^DateTimeRfc1123$/gi)){if(!(value instanceof Date||"string"==typeof value.valueOf()&&!isNaN(Date.parse(value))))throw new Error(objectName+" must be an instanceof Date or a string in RFC-1123 format.");value=value instanceof Date?value.toUTCString():new Date(value).toUTCString()}else if(null!==typeName.match(/^UnixTime$/gi)){if(!(value instanceof Date||"string"==typeof value.valueOf()&&!isNaN(Date.parse(value))))throw new Error(objectName+" must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.");value=function dateToUnixTime(d){if(!d)return;"string"==typeof d.valueOf()&&(d=new Date(d));return Math.floor(d.getTime()/1e3)}(value)}else if(null!==typeName.match(/^TimeSpan$/gi)&&!function isDuration(value){return validateISODuration.test(value)}(value))throw new Error(objectName+' must be a string in ISO 8601 format. Instead was "'+value+'".');return value}(mapperType,object,objectName):null!==mapperType.match(/^ByteArray$/gi)?payload=function serializeByteArrayType(objectName,value){if(null!=value){if(!(value instanceof Uint8Array))throw new Error(objectName+" must be of type Uint8Array.");value=encodeByteArray(value)}return value}(objectName,object):null!==mapperType.match(/^Base64Url$/gi)?payload=function serializeBase64UrlType(objectName,value){if(null!=value){if(!(value instanceof Uint8Array))throw new Error(objectName+" must be of type Uint8Array.");value=function bufferToBase64Url(buffer){if(!buffer)return;if(!(buffer instanceof Uint8Array))throw new Error("Please provide an input of type Uint8Array for converting to Base64Url.");return function trimEnd(str,ch){var len=str.length;for(;len-1>=0&&str[len-1]===ch;)--len;return str.substr(0,len)}(encodeByteArray(buffer),"=").replace(/\+/g,"-").replace(/\//g,"_")}(value)}return value}(objectName,object):null!==mapperType.match(/^Sequence$/gi)?payload=function serializeSequenceType(serializer,mapper,object,objectName){if(!Array.isArray(object))throw new Error(objectName+" must be of type Array.");var elementType=mapper.type.element;if(!elementType||"object"!=typeof elementType)throw new Error('element" metadata for an Array must be defined in the mapper and it must of type "object" in '+objectName+".");for(var tempArray=[],i=0;i<object.length;i++)tempArray[i]=serializer.serialize(elementType,object[i],objectName);return tempArray}(this,mapper,object,objectName):null!==mapperType.match(/^Dictionary$/gi)?payload=function serializeDictionaryType(serializer,mapper,object,objectName){if("object"!=typeof object)throw new Error(objectName+" must be of type object.");var valueType=mapper.type.value;if(!valueType||"object"!=typeof valueType)throw new Error('"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in '+objectName+".");for(var tempDictionary={},_i=0,_a=Object.keys(object);_i<_a.length;_i++){var key=_a[_i];tempDictionary[key]=serializer.serialize(valueType,object[key],objectName+"."+key)}return tempDictionary}(this,mapper,object,objectName):null!==mapperType.match(/^Composite$/gi)&&(payload=function serializeCompositeType(serializer,mapper,object,objectName){var _a;getPolymorphicDiscriminatorRecursively(serializer,mapper)&&(mapper=getPolymorphicMapper(serializer,mapper,object,"clientName"));if(null!=object){for(var payload={},modelProps=resolveModelProperties(serializer,mapper,objectName),_i=0,_b=Object.keys(modelProps);_i<_b.length;_i++){var key=_b[_i],propertyMapper=modelProps[key];if(!propertyMapper.readOnly){var propName=void 0,parentObject=payload;if(serializer.isXML)propName=propertyMapper.xmlIsWrapped?propertyMapper.xmlName:propertyMapper.xmlElementName||propertyMapper.xmlName;else{var paths=splitSerializeName(propertyMapper.serializedName);propName=paths.pop();for(var _c=0,paths_1=paths;_c<paths_1.length;_c++){var pathName=paths_1[_c];null==parentObject[pathName]&&null!=object[key]&&(parentObject[pathName]={}),parentObject=parentObject[pathName]}}if(null!=parentObject){var propertyObjectName=""!==propertyMapper.serializedName?objectName+"."+propertyMapper.serializedName:objectName,toSerialize=object[key],polymorphicDiscriminator=getPolymorphicDiscriminatorRecursively(serializer,mapper);polymorphicDiscriminator&&polymorphicDiscriminator.clientName===key&&null==toSerialize&&(toSerialize=mapper.serializedName);var serializedValue=serializer.serialize(propertyMapper,toSerialize,propertyObjectName);void 0!==serializedValue&&null!=propName&&(propertyMapper.xmlIsAttribute?(parentObject.$=parentObject.$||{},parentObject.$[propName]=serializedValue):propertyMapper.xmlIsWrapped?parentObject[propName]=((_a={})[propertyMapper.xmlElementName]=serializedValue,_a):parentObject[propName]=serializedValue)}}}var additionalPropertiesMapper=mapper.type.additionalProperties;if(additionalPropertiesMapper){var propNames=Object.keys(modelProps),_loop_1=function(clientPropName){propNames.every(function(pn){return pn!==clientPropName})&&(payload[clientPropName]=serializer.serialize(additionalPropertiesMapper,object[clientPropName],objectName+'["'+clientPropName+'"]'))};for(var clientPropName in object)_loop_1(clientPropName)}return payload}return object}(this,mapper,object,objectName));return payload},Serializer.prototype.deserialize=function(mapper,responseBody,objectName){if(null==responseBody)return this.isXML&&"Sequence"===mapper.type.name&&!mapper.xmlIsWrapped&&(responseBody=[]),responseBody;var payload,mapperType=mapper.type.name;return objectName||(objectName=mapper.serializedName),null!==mapperType.match(/^Composite$/gi)?payload=function deserializeCompositeType(serializer,mapper,responseBody,objectName){getPolymorphicDiscriminatorRecursively(serializer,mapper)&&(mapper=getPolymorphicMapper(serializer,mapper,responseBody,"serializedName"));for(var modelProps=resolveModelProperties(serializer,mapper,objectName),instance={},handledPropertyNames=[],_i=0,_a=Object.keys(modelProps);_i<_a.length;_i++){var key=_a[_i],propertyMapper=modelProps[key],paths=splitSerializeName(modelProps[key].serializedName);handledPropertyNames.push(paths[0]);var serializedName=propertyMapper.serializedName,xmlName=propertyMapper.xmlName,xmlElementName=propertyMapper.xmlElementName,propertyObjectName=objectName;""!==serializedName&&void 0!==serializedName&&(propertyObjectName=objectName+"."+serializedName);var headerCollectionPrefix=propertyMapper.headerCollectionPrefix;if(headerCollectionPrefix){for(var dictionary={},_b=0,_c=Object.keys(responseBody);_b<_c.length;_b++){var headerKey=_c[_b];headerKey.startsWith(headerCollectionPrefix)&&(dictionary[headerKey.substring(headerCollectionPrefix.length)]=serializer.deserialize(propertyMapper.type.value,responseBody[headerKey],propertyObjectName)),handledPropertyNames.push(headerKey)}instance[key]=dictionary}else if(serializer.isXML)if(propertyMapper.xmlIsAttribute&&responseBody.$)instance[key]=serializer.deserialize(propertyMapper,responseBody.$[xmlName],propertyObjectName);else{var unwrappedProperty=responseBody[xmlElementName||xmlName||serializedName];if(propertyMapper.xmlIsWrapped)void 0===(unwrappedProperty=(unwrappedProperty=responseBody[xmlName])&&unwrappedProperty[xmlElementName])&&(unwrappedProperty=[]);instance[key]=serializer.deserialize(propertyMapper,unwrappedProperty,propertyObjectName)}else{for(var propertyInstance=void 0,res=responseBody,_d=0,paths_2=paths;_d<paths_2.length;_d++){var item=paths_2[_d];if(!res)break;res=res[item]}propertyInstance=res;var polymorphicDiscriminator=mapper.type.polymorphicDiscriminator;polymorphicDiscriminator&&propertyMapper.serializedName===polymorphicDiscriminator.serializedName&&null==propertyInstance&&(propertyInstance=mapper.serializedName);var serializedValue=void 0;Array.isArray(responseBody[key])&&""===modelProps[key].serializedName?(propertyInstance=responseBody[key],instance=serializer.deserialize(propertyMapper,propertyInstance,propertyObjectName)):void 0!==propertyInstance&&(serializedValue=serializer.deserialize(propertyMapper,propertyInstance,propertyObjectName),instance[key]=serializedValue)}}var additionalPropertiesMapper=mapper.type.additionalProperties;if(additionalPropertiesMapper){var isAdditionalProperty=function(responsePropName){for(var clientPropName in modelProps){if(splitSerializeName(modelProps[clientPropName].serializedName)[0]===responsePropName)return!1}return!0};for(var responsePropName in responseBody)isAdditionalProperty(responsePropName)&&(instance[responsePropName]=serializer.deserialize(additionalPropertiesMapper,responseBody[responsePropName],objectName+'["'+responsePropName+'"]'))}else for(var _e=0,_f=Object.keys(responseBody);_e<_f.length;_e++){void 0!==instance[key=_f[_e]]||handledPropertyNames.includes(key)||isSpecialXmlProperty(key)||(instance[key]=responseBody[key])}return instance}(this,mapper,responseBody,objectName):(this.isXML&&null!=responseBody.$&&null!=responseBody._&&(responseBody=responseBody._),null!==mapperType.match(/^Number$/gi)?(payload=parseFloat(responseBody),isNaN(payload)&&(payload=responseBody)):null!==mapperType.match(/^Boolean$/gi)?payload="true"===responseBody||"false"!==responseBody&&responseBody:null!==mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/gi)?payload=responseBody:null!==mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/gi)?payload=new Date(responseBody):null!==mapperType.match(/^UnixTime$/gi)?payload=function unixTimeToDate(n){if(!n)return;return new Date(1e3*n)}(responseBody):null!==mapperType.match(/^ByteArray$/gi)?payload=decodeString(responseBody):null!==mapperType.match(/^Base64Url$/gi)?payload=function base64UrlToByteArray(str){if(!str)return;if(str&&"string"!=typeof str.valueOf())throw new Error("Please provide an input of type string for converting to Uint8Array");return decodeString(str=str.replace(/\-/g,"+").replace(/\_/g,"/"))}(responseBody):null!==mapperType.match(/^Sequence$/gi)?payload=function deserializeSequenceType(serializer,mapper,responseBody,objectName){var element=mapper.type.element;if(!element||"object"!=typeof element)throw new Error('element" metadata for an Array must be defined in the mapper and it must of type "object" in '+objectName);if(responseBody){Array.isArray(responseBody)||(responseBody=[responseBody]);for(var tempArray=[],i=0;i<responseBody.length;i++)tempArray[i]=serializer.deserialize(element,responseBody[i],objectName+"["+i+"]");return tempArray}return responseBody}(this,mapper,responseBody,objectName):null!==mapperType.match(/^Dictionary$/gi)&&(payload=function deserializeDictionaryType(serializer,mapper,responseBody,objectName){var value=mapper.type.value;if(!value||"object"!=typeof value)throw new Error('"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in '+objectName);if(responseBody){for(var tempDictionary={},_i=0,_a=Object.keys(responseBody);_i<_a.length;_i++){var key=_a[_i];tempDictionary[key]=serializer.deserialize(value,responseBody[key],objectName)}return tempDictionary}return responseBody}(this,mapper,responseBody,objectName))),mapper.isConstant&&(payload=mapper.defaultValue),payload},Serializer}();function splitSerializeName(prop){var classes=[],partialclass="";if(prop)for(var _i=0,subwords_1=prop.split(".");_i<subwords_1.length;_i++){var item=subwords_1[_i];"\\"===item.charAt(item.length-1)?partialclass+=item.substr(0,item.length-1)+".":(partialclass+=item,classes.push(partialclass),partialclass="")}return classes}function resolveModelProperties(serializer,mapper,objectName){var modelProps=mapper.type.modelProperties;if(!modelProps){var className=mapper.type.className;if(!className)throw new Error('Class name for model "'+objectName+'" is not provided in the mapper "'+JSON.stringify(mapper,void 0,2)+'".');var modelMapper=serializer.modelMappers[className];if(!modelMapper)throw new Error('mapper() cannot be null or undefined for model "'+className+'".');if(!(modelProps=modelMapper.type.modelProperties))throw new Error('modelProperties cannot be null or undefined in the mapper "'+JSON.stringify(modelMapper)+'" of type "'+className+'" for object "'+objectName+'".')}return modelProps}function isSpecialXmlProperty(propertyName){return["$","_"].includes(propertyName)}function getPolymorphicMapper(serializer,mapper,object,polymorphicPropertyName){var polymorphicDiscriminator=getPolymorphicDiscriminatorRecursively(serializer,mapper);if(polymorphicDiscriminator){var discriminatorName=polymorphicDiscriminator[polymorphicPropertyName];if(null!=discriminatorName){var discriminatorValue=object[discriminatorName];if(null!=discriminatorValue){var typeName=mapper.type.uberParent||mapper.type.className,indexDiscriminator=discriminatorValue===typeName?discriminatorValue:typeName+"."+discriminatorValue,polymorphicMapper=serializer.modelMappers.discriminators[indexDiscriminator];polymorphicMapper&&(mapper=polymorphicMapper)}}}return mapper}function getPolymorphicDiscriminatorRecursively(serializer,mapper){return mapper.type.polymorphicDiscriminator||getPolymorphicDiscriminatorSafely(serializer,mapper.type.uberParent)||getPolymorphicDiscriminatorSafely(serializer,mapper.type.className)}function getPolymorphicDiscriminatorSafely(serializer,typeName){return typeName&&serializer.modelMappers[typeName]&&serializer.modelMappers[typeName].type.polymorphicDiscriminator}var MapperType=function strEnum(o){for(var result={},_i=0,o_1=o;_i<o_1.length;_i++){var key=o_1[_i];result[key]=key}return result}(["Base64Url","Boolean","ByteArray","Composite","Date","DateTime","DateTimeRfc1123","Dictionary","Enum","Number","Object","Sequence","String","Stream","TimeSpan","UnixTime"]),WebResource=function(){function WebResource(url,method,body,query,headers,streamResponseBody,withCredentials,abortSignal,timeout,onUploadProgress,onDownloadProgress){this.streamResponseBody=streamResponseBody,this.url=url||"",this.method=method||"GET",this.headers=headers instanceof HttpHeaders?headers:new HttpHeaders(headers),this.body=body,this.query=query,this.formData=void 0,this.withCredentials=withCredentials||!1,this.abortSignal=abortSignal,this.timeout=timeout||0,this.onUploadProgress=onUploadProgress,this.onDownloadProgress=onDownloadProgress}return WebResource.prototype.validateRequestProperties=function(){if(!this.method)throw new Error("WebResource.method is required.");if(!this.url)throw new Error("WebResource.url is required.")},WebResource.prototype.prepare=function(options){if(!options)throw new Error("options object is required");if(null==options.method||"string"!=typeof options.method.valueOf())throw new Error("options.method must be a string.");if(options.url&&options.pathTemplate)throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them.");if(!(null!=options.pathTemplate&&"string"==typeof options.pathTemplate.valueOf()||null!=options.url&&"string"==typeof options.url.valueOf()))throw new Error("Please provide exactly one of options.pathTemplate or options.url.");if(options.url){if("string"!=typeof options.url)throw new Error('options.url must be of type "string".');this.url=options.url}if(options.method){var validMethods=["GET","PUT","HEAD","DELETE","OPTIONS","POST","PATCH","TRACE"];if(-1===validMethods.indexOf(options.method.toUpperCase()))throw new Error('The provided method "'+options.method+'" is invalid. Supported HTTP methods are: '+JSON.stringify(validMethods))}if(this.method=options.method.toUpperCase(),options.pathTemplate){var pathTemplate_1=options.pathTemplate,pathParameters_1=options.pathParameters;if("string"!=typeof pathTemplate_1)throw new Error('options.pathTemplate must be of type "string".');options.baseUrl||(options.baseUrl="https://management.azure.com");var baseUrl=options.baseUrl,url_1=baseUrl+(baseUrl.endsWith("/")?"":"/")+(pathTemplate_1.startsWith("/")?pathTemplate_1.slice(1):pathTemplate_1),segments=url_1.match(/({\w*\s*\w*})/gi);if(segments&&segments.length){if(!pathParameters_1)throw new Error("pathTemplate: "+pathTemplate_1+" has been provided. Hence, options.pathParameters must also be provided.");segments.forEach(function(item){var pathParamName=item.slice(1,-1),pathParam=pathParameters_1[pathParamName];if(null==pathParam||"string"!=typeof pathParam&&"object"!=typeof pathParam)throw new Error("pathTemplate: "+pathTemplate_1+" contains the path parameter "+pathParamName+" however, it is not present in "+pathParameters_1+" - "+JSON.stringify(pathParameters_1,void 0,2)+'.The value of the path parameter can either be a "string" of the form { '+pathParamName+': "some sample value" } or it can be an "object" of the form { "'+pathParamName+'": { value: "some sample value", skipUrlEncoding: true } }.');if("string"==typeof pathParam.valueOf()&&(url_1=url_1.replace(item,encodeURIComponent(pathParam))),"object"==typeof pathParam.valueOf()){if(!pathParam.value)throw new Error("options.pathParameters["+pathParamName+'] is of type "object" but it does not contain a "value" property.');url_1=pathParam.skipUrlEncoding?url_1.replace(item,pathParam.value):url_1.replace(item,encodeURIComponent(pathParam.value))}})}this.url=url_1}if(options.queryParameters){var queryParameters=options.queryParameters;if("object"!=typeof queryParameters)throw new Error('options.queryParameters must be of type object. It should be a JSON object of "query-parameter-name" as the key and the "query-parameter-value" as the value. The "query-parameter-value" may be fo type "string" or an "object" of the form { value: "query-parameter-value", skipUrlEncoding: true }.');this.url&&-1===this.url.indexOf("?")&&(this.url+="?");var queryParams=[];for(var queryParamName in this.query={},queryParameters){var queryParam=queryParameters[queryParamName];if(queryParam)if("string"==typeof queryParam)queryParams.push(queryParamName+"="+encodeURIComponent(queryParam)),this.query[queryParamName]=encodeURIComponent(queryParam);else if("object"==typeof queryParam){if(!queryParam.value)throw new Error("options.queryParameters["+queryParamName+'] is of type "object" but it does not contain a "value" property.');queryParam.skipUrlEncoding?(queryParams.push(queryParamName+"="+queryParam.value),this.query[queryParamName]=queryParam.value):(queryParams.push(queryParamName+"="+encodeURIComponent(queryParam.value)),this.query[queryParamName]=encodeURIComponent(queryParam.value))}}this.url+=queryParams.join("&")}if(options.headers)for(var headers=options.headers,_i=0,_a=Object.keys(options.headers);_i<_a.length;_i++){var headerName=_a[_i];this.headers.set(headerName,headers[headerName])}return this.headers.get("accept-language")||this.headers.set("accept-language","en-US"),this.headers.get("x-ms-client-request-id")||options.disableClientRequestId||this.headers.set("x-ms-client-request-id",generateUuid()),this.headers.get("Content-Type")||this.headers.set("Content-Type","application/json; charset=utf-8"),this.body=options.body,null!=options.body&&(options.bodyIsStream?(this.headers.get("Transfer-Encoding")||this.headers.set("Transfer-Encoding","chunked"),"application/octet-stream"!==this.headers.get("Content-Type")&&this.headers.set("Content-Type","application/octet-stream")):(options.serializationMapper&&(this.body=new Serializer(options.mappers).serialize(options.serializationMapper,options.body,"requestBody")),options.disableJsonStringifyOnBody||(this.body=JSON.stringify(options.body)))),this.abortSignal=options.abortSignal,this.onDownloadProgress=options.onDownloadProgress,this.onUploadProgress=options.onUploadProgress,this},WebResource.prototype.clone=function(){var result=new WebResource(this.url,this.method,this.body,this.query,this.headers&&this.headers.clone(),this.streamResponseBody,this.withCredentials,this.abortSignal,this.timeout,this.onUploadProgress,this.onDownloadProgress);return this.formData&&(result.formData=this.formData),this.operationSpec&&(result.operationSpec=this.operationSpec),this.shouldDeserialize&&(result.shouldDeserialize=this.shouldDeserialize),this.operationResponseGetter&&(result.operationResponseGetter=this.operationResponseGetter),result},WebResource}(),extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},extendStatics(d,b)};function __extends(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}var __assign=function(){return __assign=Object.assign||function __assign(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__assign.apply(this,arguments)};function __awaiter(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):new P(function(resolve){resolve(result.value)}).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})}function __generator(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function step(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=_.trys,(t=t.length>0&&t[t.length-1])||6!==op[0]&&2!==op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}}var HttpPipelineLogLevel,RestError=function(_super){function RestError(message,code,statusCode,request,response,body){var _this=_super.call(this,message)||this;return _this.code=code,_this.statusCode=statusCode,_this.request=request,_this.response=response,_this.body=body,Object.setPrototypeOf(_this,RestError.prototype),_this}return __extends(RestError,_super),RestError.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR",RestError.REQUEST_ABORTED_ERROR="REQUEST_ABORTED_ERROR",RestError.PARSE_ERROR="PARSE_ERROR",RestError}(Error),XhrHttpClient=function(){function XhrHttpClient(){}return XhrHttpClient.prototype.sendRequest=function(request){var xhr=new XMLHttpRequest,abortSignal=request.abortSignal;if(abortSignal){var listener_1=function(){xhr.abort()};abortSignal.addEventListener("abort",listener_1),xhr.addEventListener("readystatechange",function(){xhr.readyState===XMLHttpRequest.DONE&&abortSignal.removeEventListener("abort",listener_1)})}if(addProgressListener(xhr.upload,request.onUploadProgress),addProgressListener(xhr,request.onDownloadProgress),request.formData){for(var formData=request.formData,requestForm_1=new FormData,appendFormValue=function(key,value){value&&value.hasOwnProperty("value")&&value.hasOwnProperty("options")?requestForm_1.append(key,value.value,value.options):requestForm_1.append(key,value)},_i=0,_a=Object.keys(formData);_i<_a.length;_i++){var formKey=_a[_i],formValue=formData[formKey];if(Array.isArray(formValue))for(var j=0;j<formValue.length;j++)appendFormValue(formKey,formValue[j]);else appendFormValue(formKey,formValue)}request.body=requestForm_1,request.formData=void 0;var contentType=request.headers.get("Content-Type");contentType&&-1!==contentType.indexOf("multipart/form-data")&&request.headers.remove("Content-Type")}xhr.open(request.method,request.url),xhr.timeout=request.timeout,xhr.withCredentials=request.withCredentials;for(var _b=0,_c=request.headers.headersArray();_b<_c.length;_b++){var header=_c[_b];xhr.setRequestHeader(header.name,header.value)}return xhr.responseType=request.streamResponseBody?"blob":"text",xhr.send(void 0===request.body?null:request.body),request.streamResponseBody?new Promise(function(resolve,reject){xhr.addEventListener("readystatechange",function(){if(xhr.readyState===XMLHttpRequest.HEADERS_RECEIVED){var blobBody=new Promise(function(resolve,reject){xhr.addEventListener("load",function(){resolve(xhr.response)}),rejectOnTerminalEvent(request,xhr,reject)});resolve({request:request,status:xhr.status,headers:parseHeaders(xhr),blobBody:blobBody})}}),rejectOnTerminalEvent(request,xhr,reject)}):new Promise(function(resolve,reject){xhr.addEventListener("load",function(){return resolve({request:request,status:xhr.status,headers:parseHeaders(xhr),bodyAsText:xhr.responseText})}),rejectOnTerminalEvent(request,xhr,reject)})},XhrHttpClient}();function addProgressListener(xhr,listener){listener&&xhr.addEventListener("progress",function(rawEvent){return listener({loadedBytes:rawEvent.loaded})})}function parseHeaders(xhr){for(var responseHeaders=new HttpHeaders,_i=0,headerLines_1=xhr.getAllResponseHeaders().trim().split(/[\r\n]+/);_i<headerLines_1.length;_i++){var line=headerLines_1[_i],index=line.indexOf(":"),headerName=line.slice(0,index),headerValue=line.slice(index+2);responseHeaders.set(headerName,headerValue)}return responseHeaders}function rejectOnTerminalEvent(request,xhr,reject){xhr.addEventListener("error",function(){return reject(new RestError("Failed to send request to "+request.url,RestError.REQUEST_SEND_ERROR,void 0,request))}),xhr.addEventListener("abort",function(){return reject(new RestError("The request was aborted",RestError.REQUEST_ABORTED_ERROR,void 0,request))}),xhr.addEventListener("timeout",function(){return reject(new RestError("timeout of "+xhr.timeout+"ms exceeded",RestError.REQUEST_SEND_ERROR,void 0,request))})}function getPathStringFromParameter(parameter){return getPathStringFromParameterPath(parameter.parameterPath,parameter.mapper)}function getPathStringFromParameterPath(parameterPath,mapper){return"string"==typeof parameterPath?parameterPath:Array.isArray(parameterPath)?parameterPath.join("."):mapper.serializedName}function isStreamOperation(operationSpec){var result=!1;for(var statusCode in operationSpec.responses){var operationResponse=operationSpec.responses[statusCode];if(operationResponse.bodyMapper&&operationResponse.bodyMapper.type.name===MapperType.Stream){result=!0;break}}return result}(HttpPipelineLogLevel=exports.HttpPipelineLogLevel||(exports.HttpPipelineLogLevel={}))[HttpPipelineLogLevel.OFF=0]="OFF",HttpPipelineLogLevel[HttpPipelineLogLevel.ERROR=1]="ERROR",HttpPipelineLogLevel[HttpPipelineLogLevel.WARNING=2]="WARNING",HttpPipelineLogLevel[HttpPipelineLogLevel.INFO=3]="INFO";var parser=new DOMParser;function parseXML(str){try{var dom=parser.parseFromString(str,"application/xml");!function throwIfError(dom){if(errorNS){var parserErrors=dom.getElementsByTagNameNS(errorNS,"parsererror");if(parserErrors.length)throw new Error(parserErrors.item(0).innerHTML)}}(dom);var obj=domToObject(dom.childNodes[0]);return Promise.resolve(obj)}catch(err){return Promise.reject(err)}}var errorNS="";try{errorNS=parser.parseFromString("INVALID","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(ignored){}function domToObject(node){var result={},childNodeCount=node.childNodes.length,firstChildNode=node.childNodes[0],onlyChildTextValue=firstChildNode&&1===childNodeCount&&firstChildNode.nodeType===Node.TEXT_NODE&&firstChildNode.nodeValue||void 0,elementWithAttributes=function asElementWithAttributes(node){return function isElement(node){return!!node.attributes}(node)&&node.hasAttributes()?node:void 0}(node);if(elementWithAttributes){result.$={};for(var i=0;i<elementWithAttributes.attributes.length;i++){var attr=elementWithAttributes.attributes[i];result.$[attr.nodeName]=attr.nodeValue}onlyChildTextValue&&(result._=onlyChildTextValue)}else 0===childNodeCount?result="":onlyChildTextValue&&(result=onlyChildTextValue);if(!onlyChildTextValue)for(i=0;i<childNodeCount;i++){var child=node.childNodes[i];if(child.nodeType!==Node.TEXT_NODE){var childObject=domToObject(child);result[child.nodeName]?Array.isArray(result[child.nodeName])?result[child.nodeName].push(childObject):result[child.nodeName]=[result[child.nodeName],childObject]:result[child.nodeName]=childObject}}return result}var doc=document.implementation.createDocument(null,null,null),serializer=new XMLSerializer;function stringifyXML(obj,opts){var dom=buildNode(obj,opts&&opts.rootName||"root")[0];return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+serializer.serializeToString(dom)}function buildAttributes(attrs){for(var result=[],_i=0,_a=Object.keys(attrs);_i<_a.length;_i++){var key=_a[_i],attr=doc.createAttribute(key);attr.value=attrs[key].toString(),result.push(attr)}return result}function buildNode(obj,elementName){if("string"==typeof obj||"number"==typeof obj||"boolean"==typeof obj)return(elem=doc.createElement(elementName)).textContent=obj.toString(),[elem];if(Array.isArray(obj)){for(var result=[],_i=0,obj_1=obj;_i<obj_1.length;_i++)for(var _a=0,_b=buildNode(obj_1[_i],elementName);_a<_b.length;_a++){var child=_b[_a];result.push(child)}return result}if("object"==typeof obj){for(var elem=doc.createElement(elementName),_c=0,_d=Object.keys(obj);_c<_d.length;_c++){var key=_d[_c];if("$"===key)for(var _e=0,_f=buildAttributes(obj[key]);_e<_f.length;_e++){var attr=_f[_e];elem.attributes.setNamedItem(attr)}else for(var _g=0,_h=buildNode(obj[key],key);_g<_h.length;_g++){child=_h[_g];elem.appendChild(child)}}return[elem]}throw new Error("Illegal value passed to buildObject: "+obj)}var BaseRequestPolicy=function(){function BaseRequestPolicy(_nextPolicy,_options){this._nextPolicy=_nextPolicy,this._options=_options}return BaseRequestPolicy.prototype.shouldLog=function(logLevel){return this._options.shouldLog(logLevel)},BaseRequestPolicy.prototype.log=function(logLevel,message){this._options.log(logLevel,message)},BaseRequestPolicy}(),RequestPolicyOptions=function(){function RequestPolicyOptions(_logger){this._logger=_logger}return RequestPolicyOptions.prototype.shouldLog=function(logLevel){return!!this._logger&&logLevel!==exports.HttpPipelineLogLevel.OFF&&logLevel<=this._logger.minimumLogLevel},RequestPolicyOptions.prototype.log=function(logLevel,message){this._logger&&this.shouldLog(logLevel)&&this._logger.log(logLevel,message)},RequestPolicyOptions}();function deserializationPolicy(deserializationContentTypes){return{create:function(nextPolicy,options){return new DeserializationPolicy(nextPolicy,deserializationContentTypes,options)}}}var defaultJsonContentTypes=["application/json","text/json"],defaultXmlContentTypes=["application/xml","application/atom+xml"],DeserializationPolicy=function(_super){function DeserializationPolicy(nextPolicy,deserializationContentTypes,options){var _this=_super.call(this,nextPolicy,options)||this;return _this.jsonContentTypes=deserializationContentTypes&&deserializationContentTypes.json||defaultJsonContentTypes,_this.xmlContentTypes=deserializationContentTypes&&deserializationContentTypes.xml||defaultXmlContentTypes,_this}return __extends(DeserializationPolicy,_super),DeserializationPolicy.prototype.sendRequest=function(request){return __awaiter(this,void 0,void 0,function(){var _this=this;return __generator(this,function(_a){return[2,this._nextPolicy.sendRequest(request).then(function(response){return function deserializeResponseBody(jsonContentTypes,xmlContentTypes,response){return function parse(jsonContentTypes,xmlContentTypes,operationResponse){var errorHandler=function(err){var msg='Error "'+err+'" occurred while parsing the response body - '+operationResponse.bodyAsText+".",errCode=err.code||RestError.PARSE_ERROR,e=new RestError(msg,errCode,operationResponse.status,operationResponse.request,operationResponse,operationResponse.bodyAsText);return Promise.reject(e)};if(!operationResponse.request.streamResponseBody&&operationResponse.bodyAsText){var text_1=operationResponse.bodyAsText,contentType=operationResponse.headers.get("Content-Type")||"",contentComponents=contentType?contentType.split(";").map(function(component){return component.toLowerCase()}):[];if(0===contentComponents.length||contentComponents.some(function(component){return-1!==jsonContentTypes.indexOf(component)}))return new Promise(function(resolve){operationResponse.parsedBody=JSON.parse(text_1),resolve(operationResponse)}).catch(errorHandler);if(contentComponents.some(function(component){return-1!==xmlContentTypes.indexOf(component)}))return parseXML(text_1).then(function(body){return operationResponse.parsedBody=body,operationResponse}).catch(errorHandler)}return Promise.resolve(operationResponse)}(jsonContentTypes,xmlContentTypes,response).then(function(parsedResponse){var shouldDeserialize=function shouldDeserializeResponse(parsedResponse){var result,shouldDeserialize=parsedResponse.request.shouldDeserialize;result=void 0===shouldDeserialize||("boolean"==typeof shouldDeserialize?shouldDeserialize:shouldDeserialize(parsedResponse));return result}(parsedResponse);if(shouldDeserialize){var operationSpec=parsedResponse.request.operationSpec;if(operationSpec&&operationSpec.responses){var statusCode=parsedResponse.status,expectedStatusCodes=Object.keys(operationSpec.responses),hasNoExpectedStatusCodes=0===expectedStatusCodes.length||1===expectedStatusCodes.length&&"default"===expectedStatusCodes[0],responseSpec=function getOperationResponse(parsedResponse){var result,request=parsedResponse.request,operationSpec=request.operationSpec;if(operationSpec){var operationResponseGetter=request.operationResponseGetter;result=operationResponseGetter?operationResponseGetter(operationSpec,parsedResponse):operationSpec.responses[parsedResponse.status]}return result}(parsedResponse);if(hasNoExpectedStatusCodes?200<=statusCode&&statusCode<300:!!responseSpec){if(responseSpec){if(responseSpec.bodyMapper){valueToDeserialize=parsedResponse.parsedBody;operationSpec.isXML&&responseSpec.bodyMapper.type.name===MapperType.Sequence&&(valueToDeserialize="object"==typeof valueToDeserialize?valueToDeserialize[responseSpec.bodyMapper.xmlElementName]:[]);try{parsedResponse.parsedBody=operationSpec.serializer.deserialize(responseSpec.bodyMapper,valueToDeserialize,"operationRes.parsedBody")}catch(error){var restError=new RestError("Error "+error+" occurred in deserializing the responseBody - "+parsedResponse.bodyAsText);return restError.request=stripRequest(parsedResponse.request),restError.response=stripResponse(parsedResponse),Promise.reject(restError)}}else"HEAD"===operationSpec.httpMethod&&(parsedResponse.parsedBody=response.status>=200&&response.status<300);responseSpec.headersMapper&&(parsedResponse.parsedHeaders=operationSpec.serializer.deserialize(responseSpec.headersMapper,parsedResponse.headers.rawHeaders(),"operationRes.parsedHeaders"))}}else{var defaultResponseSpec=operationSpec.responses.default;if(defaultResponseSpec){var initialErrorMessage=isStreamOperation(operationSpec)?"Unexpected status code: "+statusCode:parsedResponse.bodyAsText,error=new RestError(initialErrorMessage);error.statusCode=statusCode,error.request=stripRequest(parsedResponse.request),error.response=stripResponse(parsedResponse);var parsedErrorResponse=parsedResponse.parsedBody;try{if(parsedErrorResponse){var defaultResponseBodyMapper=defaultResponseSpec.bodyMapper;if(defaultResponseBodyMapper&&"CloudError"===defaultResponseBodyMapper.serializedName)parsedErrorResponse.error&&(parsedErrorResponse=parsedErrorResponse.error),parsedErrorResponse.code&&(error.code=parsedErrorResponse.code),parsedErrorResponse.message&&(error.message=parsedErrorResponse.message);else{var internalError=parsedErrorResponse;parsedErrorResponse.error&&(internalError=parsedErrorResponse.error),error.code=internalError.code,internalError.message&&(error.message=internalError.message)}if(defaultResponseBodyMapper){var valueToDeserialize=parsedErrorResponse;operationSpec.isXML&&defaultResponseBodyMapper.type.name===MapperType.Sequence&&(valueToDeserialize="object"==typeof parsedErrorResponse?parsedErrorResponse[defaultResponseBodyMapper.xmlElementName]:[]),error.body=operationSpec.serializer.deserialize(defaultResponseBodyMapper,valueToDeserialize,"error.body")}}}catch(defaultError){error.message='Error "'+defaultError.message+'" occurred in deserializing the responseBody - "'+parsedResponse.bodyAsText+'" for the default response.'}return Promise.reject(error)}}}}return Promise.resolve(parsedResponse)})}(_this.jsonContentTypes,_this.xmlContentTypes,response)})]})})},DeserializationPolicy}(BaseRequestPolicy);var ExponentialRetryPolicy=function(_super){function ExponentialRetryPolicy(nextPolicy,options,retryCount,retryInterval,minRetryInterval,maxRetryInterval){var _this=_super.call(this,nextPolicy,options)||this;function isNumber(n){return"number"==typeof n}return _this.retryCount=isNumber(retryCount)?retryCount:3,_this.retryInterval=isNumber(retryInterval)?retryInterval:3e4,_this.minRetryInterval=isNumber(minRetryInterval)?minRetryInterval:3e3,_this.maxRetryInterval=isNumber(maxRetryInterval)?maxRetryInterval:9e4,_this}return __extends(ExponentialRetryPolicy,_super),ExponentialRetryPolicy.prototype.sendRequest=function(request){var _this=this;return this._nextPolicy.sendRequest(request.clone()).then(function(response){return retry(_this,request,response)}).catch(function(error){return retry(_this,request,error.response,void 0,error)})},ExponentialRetryPolicy}(BaseRequestPolicy);function retry(policy,request,response,retryData,requestError){retryData=function updateRetryData(policy,retryData,err){retryData||(retryData={retryCount:0,retryInterval:0}),err&&(retryData.error&&(err.innerError=retryData.error),retryData.error=err),retryData.retryCount++;var incrementDelta=Math.pow(2,retryData.retryCount)-1;return incrementDelta*=.8*policy.retryInterval+Math.floor(Math.random()*(1.2*policy.retryInterval-.8*policy.retryInterval)),retryData.retryInterval=Math.min(policy.minRetryInterval+incrementDelta,policy.maxRetryInterval),retryData}(policy,retryData,requestError);var isAborted=request.abortSignal&&request.abortSignal.aborted;if(!isAborted&&function shouldRetry(policy,statusCode,retryData){if(null==statusCode||statusCode<500&&408!==statusCode||501===statusCode||505===statusCode)return!1;if(!retryData)throw new Error("retryData for the ExponentialRetryPolicyFilter cannot be null.");return(retryData&&retryData.retryCount)<policy.retryCount}(policy,response&&response.status,retryData))return delay$1(retryData.retryInterval).then(function(){return policy._nextPolicy.sendRequest(request.clone())}).then(function(res){return retry(policy,request,res,retryData,void 0)}).catch(function(err){return retry(policy,request,response,retryData,err)});if(isAborted||requestError||!response){var err=retryData.error||new RestError("Failed to send the request.",RestError.REQUEST_SEND_ERROR,response&&response.status,response&&response.request,response);return Promise.reject(err)}return Promise.resolve(response)}var GenerateClientRequestIdPolicy=function(_super){function GenerateClientRequestIdPolicy(nextPolicy,options,_requestIdHeaderName){var _this=_super.call(this,nextPolicy,options)||this;return _this._requestIdHeaderName=_requestIdHeaderName,_this}return __extends(GenerateClientRequestIdPolicy,_super),GenerateClientRequestIdPolicy.prototype.sendRequest=function(request){return request.headers.contains(this._requestIdHeaderName)||request.headers.set(this._requestIdHeaderName,generateUuid()),this._nextPolicy.sendRequest(request)},GenerateClientRequestIdPolicy}(BaseRequestPolicy);function getDefaultUserAgentValue(){var runtimeInfo=function getRuntimeInfo(){return[{key:"ms-rest-js",value:Constants_msRestVersion}]}(),platformSpecificData=function getPlatformSpecificData(){var navigator=window.navigator;return[{key:"OS",value:(navigator.oscpu||navigator.platform).replace(" ","")}]}();return function getUserAgentString(telemetryInfo,keySeparator,valueSeparator){return void 0===keySeparator&&(keySeparator=" "),void 0===valueSeparator&&(valueSeparator="/"),telemetryInfo.map(function(info){var value=info.value?""+valueSeparator+info.value:"";return""+info.key+value}).join(keySeparator)}(runtimeInfo.concat(platformSpecificData))}var UserAgentPolicy=function(_super){function UserAgentPolicy(_nextPolicy,_options,headerKey,headerValue){var _this=_super.call(this,_nextPolicy,_options)||this;return _this._nextPolicy=_nextPolicy,_this._options=_options,_this.headerKey=headerKey,_this.headerValue=headerValue,_this}return __extends(UserAgentPolicy,_super),UserAgentPolicy.prototype.sendRequest=function(request){return this.addUserAgentHeader(request),this._nextPolicy.sendRequest(request)},UserAgentPolicy.prototype.addUserAgentHeader=function(request){request.headers||(request.headers=new HttpHeaders),!request.headers.get(this.headerKey)&&this.headerValue&&request.headers.set(this.headerKey,this.headerValue)},UserAgentPolicy}(BaseRequestPolicy),URLQuery=function(){function URLQuery(){this._rawQuery={}}return URLQuery.prototype.any=function(){return Object.keys(this._rawQuery).length>0},URLQuery.prototype.set=function(parameterName,parameterValue){if(parameterName)if(null!=parameterValue){var newValue=Array.isArray(parameterValue)?parameterValue:parameterValue.toString();this._rawQuery[parameterName]=newValue}else delete this._rawQuery[parameterName]},URLQuery.prototype.get=function(parameterName){return parameterName?this._rawQuery[parameterName]:void 0},URLQuery.prototype.toString=function(){var result="";for(var parameterName in this._rawQuery){result&&(result+="&");var parameterValue=this._rawQuery[parameterName];if(Array.isArray(parameterValue)){for(var parameterStrings=[],_i=0,parameterValue_1=parameterValue;_i<parameterValue_1.length;_i++){var parameterValueElement=parameterValue_1[_i];parameterStrings.push(parameterName+"="+parameterValueElement)}result+=parameterStrings.join("&")}else result+=parameterName+"="+parameterValue}return result},URLQuery.parse=function(text){var result=new URLQuery;if(text){text.startsWith("?")&&(text=text.substring(1));for(var currentState="ParameterName",parameterName="",parameterValue="",i=0;i<text.length;++i){var currentCharacter=text[i];switch(currentState){case"ParameterName":switch(currentCharacter){case"=":currentState="ParameterValue";break;case"&":parameterName="",parameterValue="";break;default:parameterName+=currentCharacter}break;case"ParameterValue":switch(currentCharacter){case"=":parameterName="",parameterValue="",currentState="Invalid";break;case"&":result.set(parameterName,parameterValue),parameterName="",parameterValue="",currentState="ParameterName";break;default:parameterValue+=currentCharacter}break;case"Invalid":"&"===currentCharacter&&(currentState="ParameterName");break;default:throw new Error("Unrecognized URLQuery parse state: "+currentState)}}"ParameterValue"===currentState&&result.set(parameterName,parameterValue)}return result},URLQuery}(),URLBuilder=function(){function URLBuilder(){}return URLBuilder.prototype.setScheme=function(scheme){scheme?this.set(scheme,"SCHEME"):this._scheme=void 0},URLBuilder.prototype.getScheme=function(){return this._scheme},URLBuilder.prototype.setHost=function(host){host?this.set(host,"SCHEME_OR_HOST"):this._host=void 0},URLBuilder.prototype.getHost=function(){return this._host},URLBuilder.prototype.setPort=function(port){null==port||""===port?this._port=void 0:this.set(port.toString(),"PORT")},URLBuilder.prototype.getPort=function(){return this._port},URLBuilder.prototype.setPath=function(path){path?-1!==path.indexOf("://")?this.set(path,"SCHEME"):this.set(path,"PATH"):this._path=void 0},URLBuilder.prototype.appendPath=function(path){if(path){var currentPath=this.getPath();currentPath&&(currentPath.endsWith("/")||(currentPath+="/"),path.startsWith("/")&&(path=path.substring(1)),path=currentPath+path),this.set(path,"PATH")}},URLBuilder.prototype.getPath=function(){return this._path},URLBuilder.prototype.setQuery=function(query){this._query=query?URLQuery.parse(query):void 0},URLBuilder.prototype.setQueryParameter=function(queryParameterName,queryParameterValue){queryParameterName&&(this._query||(this._query=new URLQuery),this._query.set(queryParameterName,queryParameterValue))},URLBuilder.prototype.getQueryParameterValue=function(queryParameterName){return this._query?this._query.get(queryParameterName):void 0},URLBuilder.prototype.getQuery=function(){return this._query?this._query.toString():void 0},URLBuilder.prototype.set=function(text,startState){for(var tokenizer=new URLTokenizer(text,startState);tokenizer.next();){var token=tokenizer.current();if(token)switch(token.type){case"SCHEME":this._scheme=token.text||void 0;break;case"HOST":this._host=token.text||void 0;break;case"PORT":this._port=token.text||void 0;break;case"PATH":var tokenPath=token.text||void 0;this._path&&"/"!==this._path&&"/"===tokenPath||(this._path=tokenPath);break;case"QUERY":this._query=URLQuery.parse(token.text);break;default:throw new Error("Unrecognized URLTokenType: "+token.type)}}},URLBuilder.prototype.toString=function(){var result="";return this._scheme&&(result+=this._scheme+"://"),this._host&&(result+=this._host),this._port&&(result+=":"+this._port),this._path&&(this._path.startsWith("/")||(result+="/"),result+=this._path),this._query&&this._query.any()&&(result+="?"+this._query.toString()),result},URLBuilder.prototype.replaceAll=function(searchValue,replaceValue){searchValue&&(this.setScheme(replaceAll(this.getScheme(),searchValue,replaceValue)),this.setHost(replaceAll(this.getHost(),searchValue,replaceValue)),this.setPort(replaceAll(this.getPort(),searchValue,replaceValue)),this.setPath(replaceAll(this.getPath(),searchValue,replaceValue)),this.setQuery(replaceAll(this.getQuery(),searchValue,replaceValue)))},URLBuilder.parse=function(text){var result=new URLBuilder;return result.set(text,"SCHEME_OR_HOST"),result},URLBuilder}(),URLToken=function(){function URLToken(text,type){this.text=text,this.type=type}return URLToken.scheme=function(text){return new URLToken(text,"SCHEME")},URLToken.host=function(text){return new URLToken(text,"HOST")},URLToken.port=function(text){return new URLToken(text,"PORT")},URLToken.path=function(text){return new URLToken(text,"PATH")},URLToken.query=function(text){return new URLToken(text,"QUERY")},URLToken}();var URLTokenizer=function(){function URLTokenizer(_text,state){this._text=_text,this._textLength=_text?_text.length:0,this._currentState=null!=state?state:"SCHEME_OR_HOST",this._currentIndex=0}return URLTokenizer.prototype.current=function(){return this._currentToken},URLTokenizer.prototype.next=function(){if(hasCurrentCharacter(this))switch(this._currentState){case"SCHEME":!function nextScheme(tokenizer){var scheme=function readWhileLetterOrDigit(tokenizer){return readWhile(tokenizer,function(character){return function isAlphaNumericCharacter(character){var characterCode=character.charCodeAt(0);return 48<=characterCode&&characterCode<=57||65<=characterCode&&characterCode<=90||97<=characterCode&&characterCode<=122}(character)})}(tokenizer);tokenizer._currentToken=URLToken.scheme(scheme),hasCurrentCharacter(tokenizer)?tokenizer._currentState="HOST":tokenizer._currentState="DONE"}(this);break;case"SCHEME_OR_HOST":!function nextSchemeOrHost(tokenizer){var schemeOrHost=readUntilCharacter(tokenizer,":","/","?");hasCurrentCharacter(tokenizer)?":"===getCurrentCharacter(tokenizer)?"://"===peekCharacters(tokenizer,3)?(tokenizer._currentToken=URLToken.scheme(schemeOrHost),tokenizer._currentState="HOST"):(tokenizer._currentToken=URLToken.host(schemeOrHost),tokenizer._currentState="PORT"):(tokenizer._currentToken=URLToken.host(schemeOrHost),"/"===getCurrentCharacter(tokenizer)?tokenizer._currentState="PATH":tokenizer._currentState="QUERY"):(tokenizer._currentToken=URLToken.host(schemeOrHost),tokenizer._currentState="DONE")}(this);break;case"HOST":!function nextHost(tokenizer){"://"===peekCharacters(tokenizer,3)&&nextCharacter(tokenizer,3);var host=readUntilCharacter(tokenizer,":","/","?");tokenizer._currentToken=URLToken.host(host),hasCurrentCharacter(tokenizer)?":"===getCurrentCharacter(tokenizer)?tokenizer._currentState="PORT":"/"===getCurrentCharacter(tokenizer)?tokenizer._currentState="PATH":tokenizer._currentState="QUERY":tokenizer._currentState="DONE"}(this);break;case"PORT":!function nextPort(tokenizer){":"===getCurrentCharacter(tokenizer)&&nextCharacter(tokenizer);var port=readUntilCharacter(tokenizer,"/","?");tokenizer._currentToken=URLToken.port(port),hasCurrentCharacter(tokenizer)?"/"===getCurrentCharacter(tokenizer)?tokenizer._currentState="PATH":tokenizer._currentState="QUERY":tokenizer._currentState="DONE"}(this);break;case"PATH":!function nextPath(tokenizer){var path=readUntilCharacter(tokenizer,"?");tokenizer._currentToken=URLToken.path(path),hasCurrentCharacter(tokenizer)?tokenizer._currentState="QUERY":tokenizer._currentState="DONE"}(this);break;case"QUERY":!function nextQuery(tokenizer){"?"===getCurrentCharacter(tokenizer)&&nextCharacter(tokenizer);var query=function readRemaining(tokenizer){var result="";tokenizer._currentIndex<tokenizer._textLength&&(result=tokenizer._text.substring(tokenizer._currentIndex),tokenizer._currentIndex=tokenizer._textLength);return result}(tokenizer);tokenizer._currentToken=URLToken.query(query),tokenizer._currentState="DONE"}(this);break;default:throw new Error("Unrecognized URLTokenizerState: "+this._currentState)}else this._currentToken=void 0;return!!this._currentToken},URLTokenizer}();function hasCurrentCharacter(tokenizer){return tokenizer._currentIndex<tokenizer._textLength}function getCurrentCharacter(tokenizer){return tokenizer._text[tokenizer._currentIndex]}function nextCharacter(tokenizer,step){hasCurrentCharacter(tokenizer)&&(step||(step=1),tokenizer._currentIndex+=step)}function peekCharacters(tokenizer,charactersToPeek){var endIndex=tokenizer._currentIndex+charactersToPeek;return tokenizer._textLength<endIndex&&(endIndex=tokenizer._textLength),tokenizer._text.substring(tokenizer._currentIndex,endIndex)}function readWhile(tokenizer,condition){for(var result="";hasCurrentCharacter(tokenizer);){var currentCharacter=getCurrentCharacter(tokenizer);if(!condition(currentCharacter))break;result+=currentCharacter,nextCharacter(tokenizer)}return result}function readUntilCharacter(tokenizer){for(var terminatingCharacters=[],_i=1;_i<arguments.length;_i++)terminatingCharacters[_i-1]=arguments[_i];return readWhile(tokenizer,function(character){return-1===terminatingCharacters.indexOf(character)})}var RedirectPolicy=function(_super){function RedirectPolicy(nextPolicy,options,maxRetries){void 0===maxRetries&&(maxRetries=20);var _this=_super.call(this,nextPolicy,options)||this;return _this.maxRetries=maxRetries,_this}return __extends(RedirectPolicy,_super),RedirectPolicy.prototype.sendRequest=function(request){var _this=this;return this._nextPolicy.sendRequest(request).then(function(response){return handleRedirect(_this,response,0)})},RedirectPolicy}(BaseRequestPolicy);function handleRedirect(policy,response,currentRetries){var request=response.request,status=response.status,locationHeader=response.headers.get("location");if(locationHeader&&(300===status||307===status||303===status&&"POST"===request.method)&&(!policy.maxRetries||currentRetries<policy.maxRetries)){var builder=URLBuilder.parse(request.url);return builder.setPath(locationHeader),request.url=builder.toString(),303===status&&(request.method="GET"),policy._nextPolicy.sendRequest(request).then(function(res){return handleRedirect(policy,res,currentRetries+1)})}return Promise.resolve(response)}var RPRegistrationPolicy=function(_super){function RPRegistrationPolicy(nextPolicy,options,_retryTimeout){void 0===_retryTimeout&&(_retryTimeout=30);var _this=_super.call(this,nextPolicy,options)||this;return _this._retryTimeout=_retryTimeout,_this}return __extends(RPRegistrationPolicy,_super),RPRegistrationPolicy.prototype.sendRequest=function(request){var _this=this;return this._nextPolicy.sendRequest(request.clone()).then(function(response){return function registerIfNeeded(policy,request,response){if(409===response.status){var rpName=function checkRPNotRegisteredError(body){var result,responseBody;if(body){try{responseBody=JSON.parse(body)}catch(err){}if(responseBody&&responseBody.error&&responseBody.error.message&&responseBody.error.code&&"MissingSubscriptionRegistration"===responseBody.error.code){var matchRes=responseBody.error.message.match(/.*'(.*)'/i);matchRes&&(result=matchRes.pop())}}return result}(response.bodyAsText);if(rpName){var urlPrefix=function extractSubscriptionUrl(url){var result,matchRes=url.match(/.*\/subscriptions\/[a-f0-9-]+\//gi);if(!matchRes||!matchRes[0])throw new Error("Unable to extract subscriptionId from the given url - "+url+".");result=matchRes[0];return result}(request.url);return function registerRP(policy,urlPrefix,provider,originalRequest){var postUrl=urlPrefix+"providers/"+provider+"/register?api-version=2016-02-01",getUrl=urlPrefix+"providers/"+provider+"?api-version=2016-02-01",reqOptions=getRequestEssentials(originalRequest);return reqOptions.method="POST",reqOptions.url=postUrl,policy._nextPolicy.sendRequest(reqOptions).then(function(response){if(200!==response.status)throw new Error("Autoregistration of "+provider+" failed. Please try registering manually.");return getRegistrationStatus(policy,getUrl,originalRequest)})}(policy,urlPrefix,rpName,request).catch(function(){return!1}).then(function(registrationStatus){return registrationStatus?(request.headers.set("x-ms-client-request-id",generateUuid()),policy._nextPolicy.sendRequest(request.clone())):response})}}return Promise.resolve(response)}(_this,request,response)})},RPRegistrationPolicy}(BaseRequestPolicy);function getRequestEssentials(originalRequest,reuseUrlToo){void 0===reuseUrlToo&&(reuseUrlToo=!1);var reqOptions={headers:{}};for(var h in reuseUrlToo&&(reqOptions.url=originalRequest.url),originalRequest.headers)reqOptions.headers.set(h,originalRequest.headers.get(h));return reqOptions.headers["x-ms-client-request-id"]=generateUuid(),reqOptions.headers["Content-Type"]="application/json; charset=utf-8",reqOptions}function getRegistrationStatus(policy,url,originalRequest){var reqOptions=getRequestEssentials(originalRequest);return reqOptions.url=url,reqOptions.method="GET",policy._nextPolicy.sendRequest(reqOptions).then(function(res){var obj=res.parsedBody;return!(!res.parsedBody||!obj.registrationState||"Registered"!==obj.registrationState)||delay$1(1e3*policy._retryTimeout).then(function(){return getRegistrationStatus(policy,url,originalRequest)})})}var SigningPolicy=function(_super){function SigningPolicy(nextPolicy,options,authenticationProvider){var _this=_super.call(this,nextPolicy,options)||this;return _this.authenticationProvider=authenticationProvider,_this}return __extends(SigningPolicy,_super),SigningPolicy.prototype.signRequest=function(request){return this.authenticationProvider.signRequest(request)},SigningPolicy.prototype.sendRequest=function(request){var _this=this;return this.signRequest(request).then(function(nextRequest){return _this._nextPolicy.sendRequest(nextRequest)})},SigningPolicy}(BaseRequestPolicy);var QueryCollectionFormat,SystemErrorRetryPolicy=function(_super){function SystemErrorRetryPolicy(nextPolicy,options,retryCount,retryInterval,minRetryInterval,maxRetryInterval){var _this=_super.call(this,nextPolicy,options)||this;return _this.DEFAULT_CLIENT_RETRY_INTERVAL=3e4,_this.DEFAULT_CLIENT_RETRY_COUNT=3,_this.DEFAULT_CLIENT_MAX_RETRY_INTERVAL=9e4,_this.DEFAULT_CLIENT_MIN_RETRY_INTERVAL=3e3,_this.retryCount="number"==typeof retryCount?retryCount:_this.DEFAULT_CLIENT_RETRY_COUNT,_this.retryInterval="number"==typeof retryInterval?retryInterval:_this.DEFAULT_CLIENT_RETRY_INTERVAL,_this.minRetryInterval="number"==typeof minRetryInterval?minRetryInterval:_this.DEFAULT_CLIENT_MIN_RETRY_INTERVAL,_this.maxRetryInterval="number"==typeof maxRetryInterval?maxRetryInterval:_this.DEFAULT_CLIENT_MAX_RETRY_INTERVAL,_this}return __extends(SystemErrorRetryPolicy,_super),SystemErrorRetryPolicy.prototype.sendRequest=function(request){var _this=this;return this._nextPolicy.sendRequest(request.clone()).then(function(response){return retry$1(_this,request,response)})},SystemErrorRetryPolicy}(BaseRequestPolicy);function retry$1(policy,request,operationResponse,retryData,err){return retryData=function updateRetryData$1(policy,retryData,err){retryData||(retryData={retryCount:0,retryInterval:0}),err&&(retryData.error&&(err.innerError=retryData.error),retryData.error=err),retryData.retryCount++;var incrementDelta=Math.pow(2,retryData.retryCount)-1;return incrementDelta*=.8*policy.retryInterval+Math.floor(Math.random()*(1.2*policy.retryInterval-.8*policy.retryInterval)),retryData.retryInterval=Math.min(policy.minRetryInterval+incrementDelta,policy.maxRetryInterval),retryData}(policy,retryData,err),err&&err.code&&function shouldRetry$1(policy,retryData){if(!retryData)throw new Error("retryData for the SystemErrorRetryPolicyFilter cannot be null.");return(retryData&&retryData.retryCount)<policy.retryCount}(policy,retryData)&&("ETIMEDOUT"===err.code||"ESOCKETTIMEDOUT"===err.code||"ECONNREFUSED"===err.code||"ECONNRESET"===err.code||"ENOENT"===err.code)?delay$1(retryData.retryInterval).then(function(){return policy._nextPolicy.sendRequest(request.clone())}).then(function(res){return retry$1(policy,request,res,retryData,err)}).catch(function(err){return retry$1(policy,request,operationResponse,retryData,err)}):null!=err?(err=retryData.error,Promise.reject(err)):Promise.resolve(operationResponse)}!function(QueryCollectionFormat){QueryCollectionFormat.Csv=",",QueryCollectionFormat.Ssv=" ",QueryCollectionFormat.Tsv="\t",QueryCollectionFormat.Pipes="|",QueryCollectionFormat.Multi="Multi"}(QueryCollectionFormat||(QueryCollectionFormat={}));var StatusCodes=Constants_HttpConstants.StatusCodes;var ThrottlingRetryPolicy=function(_super){function ThrottlingRetryPolicy(nextPolicy,options,_handleResponse){var _this=_super.call(this,nextPolicy,options)||this;return _this._handleResponse=_handleResponse||_this._defaultResponseHandler,_this}return __extends(ThrottlingRetryPolicy,_super),ThrottlingRetryPolicy.prototype.sendRequest=function(httpRequest){return __awaiter(this,void 0,void 0,function(){var _this=this;return __generator(this,function(_a){return[2,this._nextPolicy.sendRequest(httpRequest.clone()).then(function(response){return response.status!==StatusCodes.TooManyRequests?response:_this._handleResponse(httpRequest,response)})]})})},ThrottlingRetryPolicy.prototype._defaultResponseHandler=function(httpRequest,httpResponse){return __awaiter(this,void 0,void 0,function(){var retryAfterHeader,delayInMs,_this=this;return __generator(this,function(_a){return(retryAfterHeader=httpResponse.headers.get(Constants_HeaderConstants.RETRY_AFTER))&&(delayInMs=ThrottlingRetryPolicy.parseRetryAfterHeader(retryAfterHeader))?[2,delay(delayInMs).then(function(_){return _this._nextPolicy.sendRequest(httpRequest)})]:[2,httpResponse]})})},ThrottlingRetryPolicy.parseRetryAfterHeader=function(headerValue){var retryAfterInSeconds=Number(headerValue);return Number.isNaN(retryAfterInSeconds)?ThrottlingRetryPolicy.parseDateRetryAfterHeader(headerValue):1e3*retryAfterInSeconds},ThrottlingRetryPolicy.parseDateRetryAfterHeader=function(headerValue){try{var now=Date.now(),diff=Date.parse(headerValue)-now;return Number.isNaN(diff)?void 0:diff}catch(error){return}},ThrottlingRetryPolicy}(BaseRequestPolicy),ServiceClient=function(){function ServiceClient(credentials,options){if(options||(options={}),credentials&&!credentials.signRequest)throw new Error("credentials argument needs to implement signRequest method");this._withCredentials=options.withCredentials||!1,this._httpClient=options.httpClient||new XhrHttpClient,this._requestPolicyOptions=new RequestPolicyOptions(options.httpPipelineLogger),this._requestPolicyFactories=options.requestPolicyFactories||function createDefaultRequestPolicyFactories(credentials,options){var factories=[];options.generateClientRequestIdHeader&&factories.push(function generateClientRequestIdPolicy(requestIdHeaderName){return void 0===requestIdHeaderName&&(requestIdHeaderName="x-ms-client-request-id"),{create:function(nextPolicy,options){return new GenerateClientRequestIdPolicy(nextPolicy,options,requestIdHeaderName)}}}(options.clientRequestIdHeaderName));credentials&&(!function isRequestPolicyFactory(instance){return"function"==typeof instance.create}(credentials)?factories.push(function signingPolicy(authenticationProvider){return{create:function(nextPolicy,options){return new SigningPolicy(nextPolicy,options,authenticationProvider)}}}(credentials)):factories.push(credentials));factories.push(function userAgentPolicy(userAgentData){var key=userAgentData&&null!=userAgentData.key?userAgentData.key:"x-ms-command-name",value=userAgentData&&null!=userAgentData.value?userAgentData.value:getDefaultUserAgentValue();return{create:function(nextPolicy,options){return new UserAgentPolicy(nextPolicy,options,key,value)}}}({value:options.userAgent})),factories.push(function redirectPolicy(maximumRetries){return void 0===maximumRetries&&(maximumRetries=20),{create:function(nextPolicy,options){return new RedirectPolicy(nextPolicy,options,maximumRetries)}}}()),factories.push(function rpRegistrationPolicy(retryTimeout){return void 0===retryTimeout&&(retryTimeout=30),{create:function(nextPolicy,options){return new RPRegistrationPolicy(nextPolicy,options,retryTimeout)}}}(options.rpRegistrationRetryTimeout)),options.noRetryPolicy||(factories.push(function exponentialRetryPolicy(retryCount,retryInterval,minRetryInterval,maxRetryInterval){return{create:function(nextPolicy,options){return new ExponentialRetryPolicy(nextPolicy,options,retryCount,retryInterval,minRetryInterval,maxRetryInterval)}}}()),factories.push(function systemErrorRetryPolicy(retryCount,retryInterval,minRetryInterval,maxRetryInterval){return{create:function(nextPolicy,options){return new SystemErrorRetryPolicy(nextPolicy,options,retryCount,retryInterval,minRetryInterval,maxRetryInterval)}}}()),factories.push(function throttlingRetryPolicy(){return{create:function(nextPolicy,options){return new ThrottlingRetryPolicy(nextPolicy,options)}}}()));return factories.push(deserializationPolicy(options.deserializationContentTypes)),factories}(credentials,options)}return ServiceClient.prototype.sendRequest=function(options){if(null==options||"object"!=typeof options)throw new Error("options cannot be null or undefined and it must be of type object.");var httpRequest;try{options instanceof WebResource?(options.validateRequestProperties(),httpRequest=options):httpRequest=(httpRequest=new WebResource).prepare(options)}catch(error){return Promise.reject(error)}var httpPipeline=this._httpClient;if(this._requestPolicyFactories&&this._requestPolicyFactories.length>0)for(var i=this._requestPolicyFactories.length-1;i>=0;--i)httpPipeline=this._requestPolicyFactories[i].create(httpPipeline,this._requestPolicyOptions);return httpPipeline.sendRequest(httpRequest)},ServiceClient.prototype.sendOperationRequest=function(operationArguments,operationSpec,callback){"function"==typeof operationArguments.options&&(callback=operationArguments.options,operationArguments.options=void 0);var result,httpRequest=new WebResource;try{var baseUri=operationSpec.baseUrl||this.baseUri;if(!baseUri)throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use.");httpRequest.method=operationSpec.httpMethod,httpRequest.operationSpec=operationSpec;var requestUrl=URLBuilder.parse(baseUri);if(operationSpec.path&&requestUrl.appendPath(operationSpec.path),operationSpec.urlParameters&&operationSpec.urlParameters.length>0)for(var _i=0,_a=operationSpec.urlParameters;_i<_a.length;_i++){var urlParameter=_a[_i],urlParameterValue=getOperationArgumentValueFromParameter(this,operationArguments,urlParameter,operationSpec.serializer);urlParameterValue=operationSpec.serializer.serialize(urlParameter.mapper,urlParameterValue,getPathStringFromParameter(urlParameter)),urlParameter.skipEncoding||(urlParameterValue=encodeURIComponent(urlParameterValue)),requestUrl.replaceAll("{"+(urlParameter.mapper.serializedName||getPathStringFromParameter(urlParameter))+"}",urlParameterValue)}if(operationSpec.queryParameters&&operationSpec.queryParameters.length>0)for(var _b=0,_c=operationSpec.queryParameters;_b<_c.length;_b++){var queryParameter=_c[_b],queryParameterValue=getOperationArgumentValueFromParameter(this,operationArguments,queryParameter,operationSpec.serializer);if(null!=queryParameterValue){if(queryParameterValue=operationSpec.serializer.serialize(queryParameter.mapper,queryParameterValue,getPathStringFromParameter(queryParameter)),null!=queryParameter.collectionFormat)if(queryParameter.collectionFormat===QueryCollectionFormat.Multi)if(0===queryParameterValue.length)queryParameterValue="";else for(var index in queryParameterValue){var item=queryParameterValue[index];queryParameterValue[index]=null==item?"":item.toString()}else queryParameterValue=queryParameterValue.join(queryParameter.collectionFormat);if(!queryParameter.skipEncoding)if(Array.isArray(queryParameterValue))for(var index in queryParameterValue)queryParameterValue[index]=encodeURIComponent(queryParameterValue[index]);else queryParameterValue=encodeURIComponent(queryParameterValue);requestUrl.setQueryParameter(queryParameter.mapper.serializedName||getPathStringFromParameter(queryParameter),queryParameterValue)}}httpRequest.url=requestUrl.toString();var contentType=operationSpec.contentType||this.requestContentType;if(contentType&&httpRequest.headers.set("Content-Type",contentType),operationSpec.headerParameters)for(var _d=0,_e=operationSpec.headerParameters;_d<_e.length;_d++){var headerParameter=_e[_d],headerValue=getOperationArgumentValueFromParameter(this,operationArguments,headerParameter,operationSpec.serializer);if(null!=headerValue){headerValue=operationSpec.serializer.serialize(headerParameter.mapper,headerValue,getPathStringFromParameter(headerParameter));var headerCollectionPrefix=headerParameter.mapper.headerCollectionPrefix;if(headerCollectionPrefix)for(var _f=0,_g=Object.keys(headerValue);_f<_g.length;_f++){var key=_g[_f];httpRequest.headers.set(headerCollectionPrefix+key,headerValue[key])}else httpRequest.headers.set(headerParameter.mapper.serializedName||getPathStringFromParameter(headerParameter),headerValue)}}var options=operationArguments.options;if(options){if(options.customHeaders)for(var customHeaderName in options.customHeaders)httpRequest.headers.set(customHeaderName,options.customHeaders[customHeaderName]);options.abortSignal&&(httpRequest.abortSignal=options.abortSignal),options.timeout&&(httpRequest.timeout=options.timeout),options.onUploadProgress&&(httpRequest.onUploadProgress=options.onUploadProgress),options.onDownloadProgress&&(httpRequest.onDownloadProgress=options.onDownloadProgress)}httpRequest.withCredentials=this._withCredentials,function serializeRequestBody(serviceClient,httpRequest,operationArguments,operationSpec){if(operationSpec.requestBody&&operationSpec.requestBody.mapper){httpRequest.body=getOperationArgumentValueFromParameter(serviceClient,operationArguments,operationSpec.requestBody,operationSpec.serializer);var bodyMapper=operationSpec.requestBody.mapper,required=bodyMapper.required,xmlName=bodyMapper.xmlName,xmlElementName=bodyMapper.xmlElementName,serializedName=bodyMapper.serializedName,typeName=bodyMapper.type.name;try{if(null!=httpRequest.body||required){var requestBodyParameterPathString=getPathStringFromParameter(operationSpec.requestBody);httpRequest.body=operationSpec.serializer.serialize(bodyMapper,httpRequest.body,requestBodyParameterPathString);var isStream=typeName===MapperType.Stream;operationSpec.isXML?typeName===MapperType.Sequence?httpRequest.body=stringifyXML(function prepareXMLRootList(obj,elementName){var _a;return Array.isArray(obj)||(obj=[obj]),(_a={})[elementName]=obj,_a}(httpRequest.body,xmlElementName||xmlName||serializedName),{rootName:xmlName||serializedName}):isStream||(httpRequest.body=stringifyXML(httpRequest.body,{rootName:xmlName||serializedName})):isStream||(httpRequest.body=JSON.stringify(httpRequest.body))}}catch(error){throw new Error('Error "'+error.message+'" occurred in serializing the payload - '+JSON.stringify(serializedName,void 0,"  ")+".")}}else if(operationSpec.formDataParameters&&operationSpec.formDataParameters.length>0){httpRequest.formData={};for(var _i=0,_a=operationSpec.formDataParameters;_i<_a.length;_i++){var formDataParameter=_a[_i],formDataParameterValue=getOperationArgumentValueFromParameter(serviceClient,operationArguments,formDataParameter,operationSpec.serializer);if(null!=formDataParameterValue){var formDataParameterPropertyName=formDataParameter.mapper.serializedName||getPathStringFromParameter(formDataParameter);httpRequest.formData[formDataParameterPropertyName]=operationSpec.serializer.serialize(formDataParameter.mapper,formDataParameterValue,getPathStringFromParameter(formDataParameter))}}}}(this,httpRequest,operationArguments,operationSpec),null==httpRequest.streamResponseBody&&(httpRequest.streamResponseBody=isStreamOperation(operationSpec)),result=this.sendRequest(httpRequest).then(function(res){return function flattenResponse(_response,responseSpec){var parsedHeaders=_response.parsedHeaders,bodyMapper=responseSpec&&responseSpec.bodyMapper,addOperationResponse=function(obj){return Object.defineProperty(obj,"_response",{value:_response})};if(bodyMapper){var typeName=bodyMapper.type.name;if("Stream"===typeName)return addOperationResponse(__assign({},parsedHeaders,{blobBody:_response.blobBody,readableStreamBody:_response.readableStreamBody}));var modelProperties_1="Composite"===typeName&&bodyMapper.type.modelProperties||{},isPageableResponse=Object.keys(modelProperties_1).some(function(k){return""===modelProperties_1[k].serializedName});if("Sequence"===typeName||isPageableResponse){for(var arrayResponse=(_response.parsedBody||[]).slice(),_i=0,_a=Object.keys(modelProperties_1);_i<_a.length;_i++){var key=_a[_i];modelProperties_1[key].serializedName&&(arrayResponse[key]=_response.parsedBody[key])}if(parsedHeaders)for(var _b=0,_c=Object.keys(parsedHeaders);_b<_c.length;_b++){arrayResponse[key=_c[_b]]=parsedHeaders[key]}return addOperationResponse(arrayResponse),arrayResponse}if("Composite"===typeName||"Dictionary"===typeName)return addOperationResponse(__assign({},parsedHeaders,_response.parsedBody))}if(bodyMapper||"HEAD"===_response.request.method)return addOperationResponse(__assign({},parsedHeaders,{body:_response.parsedBody}));return addOperationResponse(__assign({},parsedHeaders,_response.parsedBody))}(res,operationSpec.responses[res.status])})}catch(error){result=Promise.reject(error)}var cb=callback;return cb&&result.then(function(res){return cb(null,res._response.parsedBody,res._response.request,res._response)}).catch(function(err){return cb(err)}),result},ServiceClient}();function getOperationArgumentValueFromParameter(serviceClient,operationArguments,parameter,serializer){return getOperationArgumentValueFromParameterPath(serviceClient,operationArguments,parameter.parameterPath,parameter.mapper,serializer)}function getOperationArgumentValueFromParameterPath(serviceClient,operationArguments,parameterPath,parameterMapper,serializer){var value;if("string"==typeof parameterPath&&(parameterPath=[parameterPath]),Array.isArray(parameterPath)){if(parameterPath.length>0){if(parameterMapper.isConstant)value=parameterMapper.defaultValue;else{var propertySearchResult=getPropertyFromParameterPath(operationArguments,parameterPath);propertySearchResult.propertyFound||(propertySearchResult=getPropertyFromParameterPath(serviceClient,parameterPath));var useDefaultValue=!1;propertySearchResult.propertyFound||(useDefaultValue=parameterMapper.required||"options"===parameterPath[0]&&2===parameterPath.length),value=useDefaultValue?parameterMapper.defaultValue:propertySearchResult.propertyValue}var parameterPathString=getPathStringFromParameterPath(parameterPath,parameterMapper);serializer.serialize(parameterMapper,value,parameterPathString)}}else for(var propertyName in parameterPath){var propertyMapper=parameterMapper.type.modelProperties[propertyName],propertyPath=parameterPath[propertyName],propertyValue=getOperationArgumentValueFromParameterPath(serviceClient,operationArguments,propertyPath,propertyMapper,serializer),propertyPathString=getPathStringFromParameterPath(propertyPath,propertyMapper);serializer.serialize(propertyMapper,propertyValue,propertyPathString),void 0!==propertyValue&&(value||(value={}),value[propertyName]=propertyValue)}return value}function getPropertyFromParameterPath(parent,parameterPath){for(var result={propertyFound:!1},i=0;i<parameterPath.length;++i){var parameterPathPart=parameterPath[i];if(null==parent||!(parameterPathPart in parent))break;parent=parent[parameterPathPart]}return i===parameterPath.length&&(result.propertyValue=parent,result.propertyFound=!0),result}!function(_super){function LogPolicy(nextPolicy,options,logger){void 0===logger&&(logger=console.log);var _this=_super.call(this,nextPolicy,options)||this;return _this.logger=logger,_this}__extends(LogPolicy,_super),LogPolicy.prototype.sendRequest=function(request){var _this=this;return this._nextPolicy.sendRequest(request).then(function(response){return function logResponse(policy,response){policy.logger(">> Request: "+JSON.stringify(response.request,void 0,2)),policy.logger(">> Response status code: "+response.status);var responseBody=response.bodyAsText;return policy.logger(">> Body: "+responseBody),Promise.resolve(response)}(_this,response)})}}(BaseRequestPolicy);var ApiKeyCredentials=function(){function ApiKeyCredentials(options){if(!options||options&&!options.inHeader&&!options.inQuery)throw new Error('options cannot be null or undefined. Either "inHeader" or "inQuery" property of the options object needs to be provided.');this.inHeader=options.inHeader,this.inQuery=options.inQuery}return ApiKeyCredentials.prototype.signRequest=function(webResource){if(!webResource)return Promise.reject(new Error('webResource cannot be null or undefined and must be of type "object".'));if(this.inHeader)for(var headerName in webResource.headers||(webResource.headers=new HttpHeaders),this.inHeader)webResource.headers.set(headerName,this.inHeader[headerName]);if(this.inQuery){if(!webResource.url)return Promise.reject(new Error("url cannot be null in the request object."));for(var key in webResource.url.indexOf("?")<0&&(webResource.url+="?"),this.inQuery)webResource.url.endsWith("?")||(webResource.url+="&"),webResource.url+=key+"="+this.inQuery[key]}return Promise.resolve(webResource)},ApiKeyCredentials}(),index=(function(_super){function TopicCredentials(topicKey){if(!topicKey||topicKey&&"string"!=typeof topicKey)throw new Error("topicKey cannot be null or undefined and must be of type string.");var options={inHeader:{"aeg-sas-key":topicKey}};return _super.call(this,options)||this}__extends(TopicCredentials,_super)}(ApiKeyCredentials),Object.freeze({})),Aborter=function(){function Aborter(parent,timeout,key,value){void 0===timeout&&(timeout=0);var _this=this;this._aborted=!1,this.children=[],this.abortEventListeners=[],this.parent=parent,this.key=key,this.value=value,timeout>0&&(this.timer=setTimeout(function(){_this.abort.call(_this)},timeout),this.timer&&isNode&&this.timer.unref())}return Object.defineProperty(Aborter.prototype,"aborted",{get:function(){return this._aborted},enumerable:!0,configurable:!0}),Object.defineProperty(Aborter,"none",{get:function(){return new Aborter(void 0,0)},enumerable:!0,configurable:!0}),Aborter.timeout=function(timeout){return new Aborter(void 0,timeout)},Aborter.prototype.withTimeout=function(timeout){var childCancelContext=new Aborter(this,timeout);return this.children.push(childCancelContext),childCancelContext},Aborter.prototype.withValue=function(key,value){var childCancelContext=new Aborter(this,0,key,value);return this.children.push(childCancelContext),childCancelContext},Aborter.prototype.getValue=function(key){for(var parent_1=this;parent_1;parent_1=parent_1.parent)if(parent_1.key===key)return parent_1.value},Aborter.prototype.abort=function(){var _this=this;this.aborted||(this.cancelTimer(),this.onabort&&this.onabort.call(this),this.abortEventListeners.forEach(function(listener){listener.call(_this)}),this.children.forEach(function(child){return child.cancelByParent()}),this._aborted=!0)},Aborter.prototype.addEventListener=function(_type,listener){this.abortEventListeners.push(listener)},Aborter.prototype.removeEventListener=function(_type,listener){var index=this.abortEventListeners.indexOf(listener);index>-1&&this.abortEventListeners.splice(index,1)},Aborter.prototype.cancelByParent=function(){this.abort()},Aborter.prototype.cancelTimer=function(){this.timer&&clearTimeout(this.timer)},Aborter}(),StorageError={serializedName:"StorageError",type:{name:"Composite",className:"StorageError",modelProperties:{message:{xmlName:"Message",serializedName:"Message",type:{name:"String"}}}}},ListBlobsFlatSegmentResponse={xmlName:"EnumerationResults",serializedName:"ListBlobsFlatSegmentResponse",type:{name:"Composite",className:"ListBlobsFlatSegmentResponse",modelProperties:{serviceEndpoint:{xmlIsAttribute:!0,xmlName:"ServiceEndpoint",required:!0,serializedName:"ServiceEndpoint",type:{name:"String"}},containerName:{xmlIsAttribute:!0,xmlName:"ContainerName",required:!0,serializedName:"ContainerName",type:{name:"String"}},prefix:{xmlName:"Prefix",required:!0,serializedName:"Prefix",type:{name:"String"}},marker:{xmlName:"Marker",required:!0,serializedName:"Marker",type:{name:"String"}},maxResults:{xmlName:"MaxResults",required:!0,serializedName:"MaxResults",type:{name:"Number"}},delimiter:{xmlName:"Delimiter",required:!0,serializedName:"Delimiter",type:{name:"String"}},segment:{xmlName:"Blobs",required:!0,serializedName:"Segment",type:{name:"Composite",className:"BlobFlatListSegment"}},nextMarker:{xmlName:"NextMarker",required:!0,serializedName:"NextMarker",type:{name:"String"}}}}},ListBlobsHierarchySegmentResponse={xmlName:"EnumerationResults",serializedName:"ListBlobsHierarchySegmentResponse",type:{name:"Composite",className:"ListBlobsHierarchySegmentResponse",modelProperties:{serviceEndpoint:{xmlIsAttribute:!0,xmlName:"ServiceEndpoint",required:!0,serializedName:"ServiceEndpoint",type:{name:"String"}},containerName:{xmlIsAttribute:!0,xmlName:"ContainerName",required:!0,serializedName:"ContainerName",type:{name:"String"}},prefix:{xmlName:"Prefix",required:!0,serializedName:"Prefix",type:{name:"String"}},marker:{xmlName:"Marker",required:!0,serializedName:"Marker",type:{name:"String"}},maxResults:{xmlName:"MaxResults",required:!0,serializedName:"MaxResults",type:{name:"Number"}},delimiter:{xmlName:"Delimiter",required:!0,serializedName:"Delimiter",type:{name:"String"}},segment:{xmlName:"Blobs",required:!0,serializedName:"Segment",type:{name:"Composite",className:"BlobHierarchyListSegment"}},nextMarker:{xmlName:"NextMarker",required:!0,serializedName:"NextMarker",type:{name:"String"}}}}},BlockList={serializedName:"BlockList",type:{name:"Composite",className:"BlockList",modelProperties:{committedBlocks:{xmlIsWrapped:!0,xmlName:"CommittedBlocks",xmlElementName:"Block",serializedName:"CommittedBlocks",type:{name:"Sequence",element:{type:{name:"Composite",className:"Block"}}}},uncommittedBlocks:{xmlIsWrapped:!0,xmlName:"UncommittedBlocks",xmlElementName:"Block",serializedName:"UncommittedBlocks",type:{name:"Sequence",element:{type:{name:"Composite",className:"Block"}}}}}}},BlockLookupList={xmlName:"BlockList",serializedName:"BlockLookupList",type:{name:"Composite",className:"BlockLookupList",modelProperties:{committed:{xmlName:"Committed",xmlElementName:"Committed",serializedName:"Committed",type:{name:"Sequence",element:{type:{name:"String"}}}},uncommitted:{xmlName:"Uncommitted",xmlElementName:"Uncommitted",serializedName:"Uncommitted",type:{name:"Sequence",element:{type:{name:"String"}}}},latest:{xmlName:"Latest",xmlElementName:"Latest",serializedName:"Latest",type:{name:"Sequence",element:{type:{name:"String"}}}}}}},ListContainersSegmentResponse={xmlName:"EnumerationResults",serializedName:"ListContainersSegmentResponse",type:{name:"Composite",className:"ListContainersSegmentResponse",modelProperties:{serviceEndpoint:{xmlIsAttribute:!0,xmlName:"ServiceEndpoint",required:!0,serializedName:"ServiceEndpoint",type:{name:"String"}},prefix:{xmlName:"Prefix",required:!0,serializedName:"Prefix",type:{name:"String"}},marker:{xmlName:"Marker",serializedName:"Marker",type:{name:"String"}},maxResults:{xmlName:"MaxResults",required:!0,serializedName:"MaxResults",type:{name:"Number"}},containerItems:{xmlIsWrapped:!0,xmlName:"Containers",xmlElementName:"Container",required:!0,serializedName:"ContainerItems",type:{name:"Sequence",element:{type:{name:"Composite",className:"ContainerItem"}}}},nextMarker:{xmlName:"NextMarker",required:!0,serializedName:"NextMarker",type:{name:"String"}}}}},PageList={serializedName:"PageList",type:{name:"Composite",className:"PageList",modelProperties:{pageRange:{xmlName:"PageRange",xmlElementName:"PageRange",serializedName:"PageRange",type:{name:"Sequence",element:{type:{name:"Composite",className:"PageRange"}}}},clearRange:{xmlName:"ClearRange",xmlElementName:"ClearRange",serializedName:"ClearRange",type:{name:"Sequence",element:{type:{name:"Composite",className:"ClearRange"}}}}}}},StorageServiceProperties={serializedName:"StorageServiceProperties",type:{name:"Composite",className:"StorageServiceProperties",modelProperties:{logging:{xmlName:"Logging",serializedName:"Logging",type:{name:"Composite",className:"Logging"}},hourMetrics:{xmlName:"HourMetrics",serializedName:"HourMetrics",type:{name:"Composite",className:"Metrics"}},minuteMetrics:{xmlName:"MinuteMetrics",serializedName:"MinuteMetrics",type:{name:"Composite",className:"Metrics"}},cors:{xmlIsWrapped:!0,xmlName:"Cors",xmlElementName:"CorsRule",serializedName:"Cors",type:{name:"Sequence",element:{type:{name:"Composite",className:"CorsRule"}}}},defaultServiceVersion:{xmlName:"DefaultServiceVersion",serializedName:"DefaultServiceVersion",type:{name:"String"}},deleteRetentionPolicy:{xmlName:"DeleteRetentionPolicy",serializedName:"DeleteRetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}},staticWebsite:{xmlName:"StaticWebsite",serializedName:"StaticWebsite",type:{name:"Composite",className:"StaticWebsite"}}}}},StorageServiceStats={serializedName:"StorageServiceStats",type:{name:"Composite",className:"StorageServiceStats",modelProperties:{geoReplication:{xmlName:"GeoReplication",serializedName:"GeoReplication",type:{name:"Composite",className:"GeoReplication"}}}}},ServiceSetPropertiesHeaders={serializedName:"service-setproperties-headers",type:{name:"Composite",className:"ServiceSetPropertiesHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ServiceGetPropertiesHeaders={serializedName:"service-getproperties-headers",type:{name:"Composite",className:"ServiceGetPropertiesHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ServiceGetStatisticsHeaders={serializedName:"service-getstatistics-headers",type:{name:"Composite",className:"ServiceGetStatisticsHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ServiceListContainersSegmentHeaders={serializedName:"service-listcontainerssegment-headers",type:{name:"Composite",className:"ServiceListContainersSegmentHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ServiceGetAccountInfoHeaders={serializedName:"service-getaccountinfo-headers",type:{name:"Composite",className:"ServiceGetAccountInfoHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},skuName:{serializedName:"x-ms-sku-name",type:{name:"Enum",allowedValues:["Standard_LRS","Standard_GRS","Standard_RAGRS","Standard_ZRS","Premium_LRS"]}},accountKind:{serializedName:"x-ms-account-kind",type:{name:"Enum",allowedValues:["Storage","BlobStorage","StorageV2"]}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerCreateHeaders={serializedName:"container-create-headers",type:{name:"Composite",className:"ContainerCreateHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerGetPropertiesHeaders={serializedName:"container-getproperties-headers",type:{name:"Composite",className:"ContainerGetPropertiesHeaders",modelProperties:{metadata:{serializedName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"},eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseDuration:{serializedName:"x-ms-lease-duration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},leaseState:{serializedName:"x-ms-lease-state",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseStatus:{serializedName:"x-ms-lease-status",type:{name:"Enum",allowedValues:["locked","unlocked"]}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},blobPublicAccess:{serializedName:"x-ms-blob-public-access",type:{name:"String"}},hasImmutabilityPolicy:{serializedName:"x-ms-has-immutability-policy",type:{name:"Boolean"}},hasLegalHold:{serializedName:"x-ms-has-legal-hold",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerDeleteHeaders={serializedName:"container-delete-headers",type:{name:"Composite",className:"ContainerDeleteHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerSetMetadataHeaders={serializedName:"container-setmetadata-headers",type:{name:"Composite",className:"ContainerSetMetadataHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerGetAccessPolicyHeaders={serializedName:"container-getaccesspolicy-headers",type:{name:"Composite",className:"ContainerGetAccessPolicyHeaders",modelProperties:{blobPublicAccess:{serializedName:"x-ms-blob-public-access",type:{name:"String"}},eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerSetAccessPolicyHeaders={serializedName:"container-setaccesspolicy-headers",type:{name:"Composite",className:"ContainerSetAccessPolicyHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerAcquireLeaseHeaders={serializedName:"container-acquirelease-headers",type:{name:"Composite",className:"ContainerAcquireLeaseHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerReleaseLeaseHeaders={serializedName:"container-releaselease-headers",type:{name:"Composite",className:"ContainerReleaseLeaseHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerRenewLeaseHeaders={serializedName:"container-renewlease-headers",type:{name:"Composite",className:"ContainerRenewLeaseHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerBreakLeaseHeaders={serializedName:"container-breaklease-headers",type:{name:"Composite",className:"ContainerBreakLeaseHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseTime:{serializedName:"x-ms-lease-time",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerChangeLeaseHeaders={serializedName:"container-changelease-headers",type:{name:"Composite",className:"ContainerChangeLeaseHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerListBlobFlatSegmentHeaders={serializedName:"container-listblobflatsegment-headers",type:{name:"Composite",className:"ContainerListBlobFlatSegmentHeaders",modelProperties:{contentType:{serializedName:"content-type",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerListBlobHierarchySegmentHeaders={serializedName:"container-listblobhierarchysegment-headers",type:{name:"Composite",className:"ContainerListBlobHierarchySegmentHeaders",modelProperties:{contentType:{serializedName:"content-type",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},ContainerGetAccountInfoHeaders={serializedName:"container-getaccountinfo-headers",type:{name:"Composite",className:"ContainerGetAccountInfoHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},skuName:{serializedName:"x-ms-sku-name",type:{name:"Enum",allowedValues:["Standard_LRS","Standard_GRS","Standard_RAGRS","Standard_ZRS","Premium_LRS"]}},accountKind:{serializedName:"x-ms-account-kind",type:{name:"Enum",allowedValues:["Storage","BlobStorage","StorageV2"]}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobDownloadHeaders={serializedName:"blob-download-headers",type:{name:"Composite",className:"BlobDownloadHeaders",modelProperties:{lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},metadata:{serializedName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"},contentLength:{serializedName:"content-length",type:{name:"Number"}},contentType:{serializedName:"content-type",type:{name:"String"}},contentRange:{serializedName:"content-range",type:{name:"String"}},eTag:{serializedName:"etag",type:{name:"String"}},contentMD5:{serializedName:"content-md5",type:{name:"ByteArray"}},contentEncoding:{serializedName:"content-encoding",type:{name:"String"}},cacheControl:{serializedName:"cache-control",type:{name:"String"}},contentDisposition:{serializedName:"content-disposition",type:{name:"String"}},contentLanguage:{serializedName:"content-language",type:{name:"String"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",type:{name:"Number"}},blobType:{serializedName:"x-ms-blob-type",type:{name:"Enum",allowedValues:["BlockBlob","PageBlob","AppendBlob"]}},copyCompletionTime:{serializedName:"x-ms-copy-completion-time",type:{name:"DateTimeRfc1123"}},copyStatusDescription:{serializedName:"x-ms-copy-status-description",type:{name:"String"}},copyId:{serializedName:"x-ms-copy-id",type:{name:"String"}},copyProgress:{serializedName:"x-ms-copy-progress",type:{name:"String"}},copySource:{serializedName:"x-ms-copy-source",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},leaseDuration:{serializedName:"x-ms-lease-duration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},leaseState:{serializedName:"x-ms-lease-state",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseStatus:{serializedName:"x-ms-lease-status",type:{name:"Enum",allowedValues:["locked","unlocked"]}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},acceptRanges:{serializedName:"accept-ranges",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",type:{name:"Number"}},isServerEncrypted:{serializedName:"x-ms-server-encrypted",type:{name:"Boolean"}},blobContentMD5:{serializedName:"x-ms-blob-content-md5",type:{name:"ByteArray"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobGetPropertiesHeaders={serializedName:"blob-getproperties-headers",type:{name:"Composite",className:"BlobGetPropertiesHeaders",modelProperties:{lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},creationTime:{serializedName:"x-ms-creation-time",type:{name:"DateTimeRfc1123"}},metadata:{serializedName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"},blobType:{serializedName:"x-ms-blob-type",type:{name:"Enum",allowedValues:["BlockBlob","PageBlob","AppendBlob"]}},copyCompletionTime:{serializedName:"x-ms-copy-completion-time",type:{name:"DateTimeRfc1123"}},copyStatusDescription:{serializedName:"x-ms-copy-status-description",type:{name:"String"}},copyId:{serializedName:"x-ms-copy-id",type:{name:"String"}},copyProgress:{serializedName:"x-ms-copy-progress",type:{name:"String"}},copySource:{serializedName:"x-ms-copy-source",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},isIncrementalCopy:{serializedName:"x-ms-incremental-copy",type:{name:"Boolean"}},destinationSnapshot:{serializedName:"x-ms-copy-destination-snapshot",type:{name:"String"}},leaseDuration:{serializedName:"x-ms-lease-duration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},leaseState:{serializedName:"x-ms-lease-state",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseStatus:{serializedName:"x-ms-lease-status",type:{name:"Enum",allowedValues:["locked","unlocked"]}},contentLength:{serializedName:"content-length",type:{name:"Number"}},contentType:{serializedName:"content-type",type:{name:"String"}},eTag:{serializedName:"etag",type:{name:"String"}},contentMD5:{serializedName:"content-md5",type:{name:"ByteArray"}},contentEncoding:{serializedName:"content-encoding",type:{name:"String"}},contentDisposition:{serializedName:"content-disposition",type:{name:"String"}},contentLanguage:{serializedName:"content-language",type:{name:"String"}},cacheControl:{serializedName:"cache-control",type:{name:"String"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},acceptRanges:{serializedName:"accept-ranges",type:{name:"String"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",type:{name:"Number"}},isServerEncrypted:{serializedName:"x-ms-server-encrypted",type:{name:"Boolean"}},accessTier:{serializedName:"x-ms-access-tier",type:{name:"String"}},accessTierInferred:{serializedName:"x-ms-access-tier-inferred",type:{name:"Boolean"}},archiveStatus:{serializedName:"x-ms-archive-status",type:{name:"String"}},accessTierChangeTime:{serializedName:"x-ms-access-tier-change-time",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobDeleteHeaders={serializedName:"blob-delete-headers",type:{name:"Composite",className:"BlobDeleteHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},PageBlobCreateHeaders={serializedName:"pageblob-create-headers",type:{name:"Composite",className:"PageBlobCreateHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",type:{name:"ByteArray"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},AppendBlobCreateHeaders={serializedName:"appendblob-create-headers",type:{name:"Composite",className:"AppendBlobCreateHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",type:{name:"ByteArray"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlockBlobUploadHeaders={serializedName:"blockblob-upload-headers",type:{name:"Composite",className:"BlockBlobUploadHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",type:{name:"ByteArray"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobUndeleteHeaders={serializedName:"blob-undelete-headers",type:{name:"Composite",className:"BlobUndeleteHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobSetHTTPHeadersHeaders={serializedName:"blob-sethttpheaders-headers",type:{name:"Composite",className:"BlobSetHTTPHeadersHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobSetMetadataHeaders={serializedName:"blob-setmetadata-headers",type:{name:"Composite",className:"BlobSetMetadataHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobAcquireLeaseHeaders={serializedName:"blob-acquirelease-headers",type:{name:"Composite",className:"BlobAcquireLeaseHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobReleaseLeaseHeaders={serializedName:"blob-releaselease-headers",type:{name:"Composite",className:"BlobReleaseLeaseHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobRenewLeaseHeaders={serializedName:"blob-renewlease-headers",type:{name:"Composite",className:"BlobRenewLeaseHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseId:{serializedName:"x-ms-lease-id",type:{name:"String"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobChangeLeaseHeaders={serializedName:"blob-changelease-headers",type:{name:"Composite",className:"BlobChangeLeaseHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},leaseId:{serializedName:"x-ms-lease-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobBreakLeaseHeaders={serializedName:"blob-breaklease-headers",type:{name:"Composite",className:"BlobBreakLeaseHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},leaseTime:{serializedName:"x-ms-lease-time",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobCreateSnapshotHeaders={serializedName:"blob-createsnapshot-headers",type:{name:"Composite",className:"BlobCreateSnapshotHeaders",modelProperties:{snapshot:{serializedName:"x-ms-snapshot",type:{name:"String"}},eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobStartCopyFromURLHeaders={serializedName:"blob-startcopyfromurl-headers",type:{name:"Composite",className:"BlobStartCopyFromURLHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},copyId:{serializedName:"x-ms-copy-id",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobAbortCopyFromURLHeaders={serializedName:"blob-abortcopyfromurl-headers",type:{name:"Composite",className:"BlobAbortCopyFromURLHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobSetTierHeaders={serializedName:"blob-settier-headers",type:{name:"Composite",className:"BlobSetTierHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlobGetAccountInfoHeaders={serializedName:"blob-getaccountinfo-headers",type:{name:"Composite",className:"BlobGetAccountInfoHeaders",modelProperties:{requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},skuName:{serializedName:"x-ms-sku-name",type:{name:"Enum",allowedValues:["Standard_LRS","Standard_GRS","Standard_RAGRS","Standard_ZRS","Premium_LRS"]}},accountKind:{serializedName:"x-ms-account-kind",type:{name:"Enum",allowedValues:["Storage","BlobStorage","StorageV2"]}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlockBlobStageBlockHeaders={serializedName:"blockblob-stageblock-headers",type:{name:"Composite",className:"BlockBlobStageBlockHeaders",modelProperties:{contentMD5:{serializedName:"content-md5",type:{name:"ByteArray"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlockBlobStageBlockFromURLHeaders={serializedName:"blockblob-stageblockfromurl-headers",type:{name:"Composite",className:"BlockBlobStageBlockFromURLHeaders",modelProperties:{contentMD5:{serializedName:"content-md5",type:{name:"ByteArray"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlockBlobCommitBlockListHeaders={serializedName:"blockblob-commitblocklist-headers",type:{name:"Composite",className:"BlockBlobCommitBlockListHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",type:{name:"ByteArray"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},BlockBlobGetBlockListHeaders={serializedName:"blockblob-getblocklist-headers",type:{name:"Composite",className:"BlockBlobGetBlockListHeaders",modelProperties:{lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},eTag:{serializedName:"etag",type:{name:"String"}},contentType:{serializedName:"content-type",type:{name:"String"}},blobContentLength:{serializedName:"x-ms-blob-content-length",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},PageBlobUploadPagesHeaders={serializedName:"pageblob-uploadpages-headers",type:{name:"Composite",className:"PageBlobUploadPagesHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",type:{name:"ByteArray"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},isServerEncrypted:{serializedName:"x-ms-request-server-encrypted",type:{name:"Boolean"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},PageBlobClearPagesHeaders={serializedName:"pageblob-clearpages-headers",type:{name:"Composite",className:"PageBlobClearPagesHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",type:{name:"ByteArray"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},PageBlobGetPageRangesHeaders={serializedName:"pageblob-getpageranges-headers",type:{name:"Composite",className:"PageBlobGetPageRangesHeaders",modelProperties:{lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},eTag:{serializedName:"etag",type:{name:"String"}},blobContentLength:{serializedName:"x-ms-blob-content-length",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},PageBlobGetPageRangesDiffHeaders={serializedName:"pageblob-getpagerangesdiff-headers",type:{name:"Composite",className:"PageBlobGetPageRangesDiffHeaders",modelProperties:{lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},eTag:{serializedName:"etag",type:{name:"String"}},blobContentLength:{serializedName:"x-ms-blob-content-length",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},PageBlobResizeHeaders={serializedName:"pageblob-resize-headers",type:{name:"Composite",className:"PageBlobResizeHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},PageBlobUpdateSequenceNumberHeaders={serializedName:"pageblob-updatesequencenumber-headers",type:{name:"Composite",className:"PageBlobUpdateSequenceNumberHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},blobSequenceNumber:{serializedName:"x-ms-blob-sequence-number",type:{name:"Number"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},PageBlobCopyIncrementalHeaders={serializedName:"pageblob-copyincremental-headers",type:{name:"Composite",className:"PageBlobCopyIncrementalHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},copyId:{serializedName:"x-ms-copy-id",type:{name:"String"}},copyStatus:{serializedName:"x-ms-copy-status",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},AppendBlobAppendBlockHeaders={serializedName:"appendblob-appendblock-headers",type:{name:"Composite",className:"AppendBlobAppendBlockHeaders",modelProperties:{eTag:{serializedName:"etag",type:{name:"String"}},lastModified:{serializedName:"last-modified",type:{name:"DateTimeRfc1123"}},contentMD5:{serializedName:"content-md5",type:{name:"ByteArray"}},requestId:{serializedName:"x-ms-request-id",type:{name:"String"}},version:{serializedName:"x-ms-version",type:{name:"String"}},date:{serializedName:"date",type:{name:"DateTimeRfc1123"}},blobAppendOffset:{serializedName:"x-ms-blob-append-offset",type:{name:"String"}},blobCommittedBlockCount:{serializedName:"x-ms-blob-committed-block-count",type:{name:"Number"}},errorCode:{serializedName:"x-ms-error-code",type:{name:"String"}}}}},Mappers=Object.freeze({StorageServiceProperties:StorageServiceProperties,Logging:{serializedName:"Logging",type:{name:"Composite",className:"Logging",modelProperties:{version:{xmlName:"Version",required:!0,serializedName:"Version",type:{name:"String"}},deleteProperty:{xmlName:"Delete",required:!0,serializedName:"Delete",type:{name:"Boolean"}},read:{xmlName:"Read",required:!0,serializedName:"Read",type:{name:"Boolean"}},write:{xmlName:"Write",required:!0,serializedName:"Write",type:{name:"Boolean"}},retentionPolicy:{xmlName:"RetentionPolicy",required:!0,serializedName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}}}}},RetentionPolicy:{serializedName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy",modelProperties:{enabled:{xmlName:"Enabled",required:!0,serializedName:"Enabled",type:{name:"Boolean"}},days:{xmlName:"Days",serializedName:"Days",constraints:{InclusiveMinimum:1},type:{name:"Number"}}}}},Metrics:{serializedName:"Metrics",type:{name:"Composite",className:"Metrics",modelProperties:{version:{xmlName:"Version",serializedName:"Version",type:{name:"String"}},enabled:{xmlName:"Enabled",required:!0,serializedName:"Enabled",type:{name:"Boolean"}},includeAPIs:{xmlName:"IncludeAPIs",serializedName:"IncludeAPIs",type:{name:"Boolean"}},retentionPolicy:{xmlName:"RetentionPolicy",serializedName:"RetentionPolicy",type:{name:"Composite",className:"RetentionPolicy"}}}}},CorsRule:{serializedName:"CorsRule",type:{name:"Composite",className:"CorsRule",modelProperties:{allowedOrigins:{xmlName:"AllowedOrigins",required:!0,serializedName:"AllowedOrigins",type:{name:"String"}},allowedMethods:{xmlName:"AllowedMethods",required:!0,serializedName:"AllowedMethods",type:{name:"String"}},allowedHeaders:{xmlName:"AllowedHeaders",required:!0,serializedName:"AllowedHeaders",type:{name:"String"}},exposedHeaders:{xmlName:"ExposedHeaders",required:!0,serializedName:"ExposedHeaders",type:{name:"String"}},maxAgeInSeconds:{xmlName:"MaxAgeInSeconds",required:!0,serializedName:"MaxAgeInSeconds",constraints:{InclusiveMinimum:0},type:{name:"Number"}}}}},StaticWebsite:{serializedName:"StaticWebsite",type:{name:"Composite",className:"StaticWebsite",modelProperties:{enabled:{xmlName:"Enabled",required:!0,serializedName:"Enabled",type:{name:"Boolean"}},indexDocument:{xmlName:"IndexDocument",serializedName:"IndexDocument",type:{name:"String"}},errorDocument404Path:{xmlName:"ErrorDocument404Path",serializedName:"ErrorDocument404Path",type:{name:"String"}}}}},ServiceSetPropertiesHeaders:ServiceSetPropertiesHeaders,StorageError:StorageError,ServiceGetPropertiesHeaders:ServiceGetPropertiesHeaders,StorageServiceStats:StorageServiceStats,GeoReplication:{serializedName:"GeoReplication",type:{name:"Composite",className:"GeoReplication",modelProperties:{status:{xmlName:"Status",required:!0,serializedName:"Status",type:{name:"String"}},lastSyncTime:{xmlName:"LastSyncTime",required:!0,serializedName:"LastSyncTime",type:{name:"DateTimeRfc1123"}}}}},ServiceGetStatisticsHeaders:ServiceGetStatisticsHeaders,ListContainersSegmentResponse:ListContainersSegmentResponse,ContainerItem:{xmlName:"Container",serializedName:"ContainerItem",type:{name:"Composite",className:"ContainerItem",modelProperties:{name:{xmlName:"Name",required:!0,serializedName:"Name",type:{name:"String"}},properties:{xmlName:"Properties",required:!0,serializedName:"Properties",type:{name:"Composite",className:"ContainerProperties"}},metadata:{xmlName:"Metadata",serializedName:"Metadata",type:{name:"Dictionary",value:{type:{name:"String"}}}}}}},ContainerProperties:{serializedName:"ContainerProperties",type:{name:"Composite",className:"ContainerProperties",modelProperties:{lastModified:{xmlName:"Last-Modified",required:!0,serializedName:"Last-Modified",type:{name:"DateTimeRfc1123"}},etag:{xmlName:"Etag",required:!0,serializedName:"Etag",type:{name:"String"}},leaseStatus:{xmlName:"LeaseStatus",serializedName:"LeaseStatus",type:{name:"Enum",allowedValues:["locked","unlocked"]}},leaseState:{xmlName:"LeaseState",serializedName:"LeaseState",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseDuration:{xmlName:"LeaseDuration",serializedName:"LeaseDuration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},publicAccess:{xmlName:"PublicAccess",serializedName:"PublicAccess",type:{name:"String"}},hasImmutabilityPolicy:{xmlName:"HasImmutabilityPolicy",serializedName:"HasImmutabilityPolicy",type:{name:"Boolean"}},hasLegalHold:{xmlName:"HasLegalHold",serializedName:"HasLegalHold",type:{name:"Boolean"}}}}},ServiceListContainersSegmentHeaders:ServiceListContainersSegmentHeaders,ServiceGetAccountInfoHeaders:ServiceGetAccountInfoHeaders}),access={parameterPath:["options","access"],mapper:{serializedName:"x-ms-blob-public-access",type:{name:"String"}}},action0={parameterPath:"action",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-lease-action",defaultValue:"acquire",type:{name:"String"}}},action1={parameterPath:"action",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-lease-action",defaultValue:"release",type:{name:"String"}}},action2={parameterPath:"action",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-lease-action",defaultValue:"renew",type:{name:"String"}}},action3={parameterPath:"action",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-lease-action",defaultValue:"break",type:{name:"String"}}},action4={parameterPath:"action",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-lease-action",defaultValue:"change",type:{name:"String"}}},blobCacheControl={parameterPath:["options","blobHTTPHeaders","blobCacheControl"],mapper:{serializedName:"x-ms-blob-cache-control",type:{name:"String"}}},blobContentDisposition={parameterPath:["options","blobHTTPHeaders","blobContentDisposition"],mapper:{serializedName:"x-ms-blob-content-disposition",type:{name:"String"}}},blobContentEncoding={parameterPath:["options","blobHTTPHeaders","blobContentEncoding"],mapper:{serializedName:"x-ms-blob-content-encoding",type:{name:"String"}}},blobContentLanguage={parameterPath:["options","blobHTTPHeaders","blobContentLanguage"],mapper:{serializedName:"x-ms-blob-content-language",type:{name:"String"}}},blobContentLength={parameterPath:"blobContentLength",mapper:{required:!0,serializedName:"x-ms-blob-content-length",type:{name:"Number"}}},blobContentMD5={parameterPath:["options","blobHTTPHeaders","blobContentMD5"],mapper:{serializedName:"x-ms-blob-content-md5",type:{name:"ByteArray"}}},blobContentType={parameterPath:["options","blobHTTPHeaders","blobContentType"],mapper:{serializedName:"x-ms-blob-content-type",type:{name:"String"}}},blobSequenceNumber={parameterPath:["options","blobSequenceNumber"],mapper:{serializedName:"x-ms-blob-sequence-number",defaultValue:0,type:{name:"Number"}}},blockId={parameterPath:"blockId",mapper:{required:!0,serializedName:"blockid",type:{name:"String"}}},breakPeriod={parameterPath:["options","breakPeriod"],mapper:{serializedName:"x-ms-lease-break-period",type:{name:"Number"}}},comp0={parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"properties",type:{name:"String"}}},comp10={parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"page",type:{name:"String"}}},comp11={parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"pagelist",type:{name:"String"}}},comp14={parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"block",type:{name:"String"}}},comp15={parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"blocklist",type:{name:"String"}}},comp2={parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"list",type:{name:"String"}}},comp3={parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"metadata",type:{name:"String"}}},comp4={parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"acl",type:{name:"String"}}},comp5={parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"lease",type:{name:"String"}}},contentLength={parameterPath:"contentLength",mapper:{required:!0,serializedName:"Content-Length",type:{name:"Number"}}},copySource={parameterPath:"copySource",mapper:{required:!0,serializedName:"x-ms-copy-source",type:{name:"String"}}},duration={parameterPath:["options","duration"],mapper:{serializedName:"x-ms-lease-duration",type:{name:"Number"}}},ifMatch={parameterPath:["options","modifiedAccessConditions","ifMatch"],mapper:{serializedName:"If-Match",type:{name:"String"}}},ifModifiedSince={parameterPath:["options","modifiedAccessConditions","ifModifiedSince"],mapper:{serializedName:"If-Modified-Since",type:{name:"DateTimeRfc1123"}}},ifNoneMatch={parameterPath:["options","modifiedAccessConditions","ifNoneMatch"],mapper:{serializedName:"If-None-Match",type:{name:"String"}}},ifSequenceNumberEqualTo={parameterPath:["options","sequenceNumberAccessConditions","ifSequenceNumberEqualTo"],mapper:{serializedName:"x-ms-if-sequence-number-eq",type:{name:"Number"}}},ifSequenceNumberLessThan={parameterPath:["options","sequenceNumberAccessConditions","ifSequenceNumberLessThan"],mapper:{serializedName:"x-ms-if-sequence-number-lt",type:{name:"Number"}}},ifSequenceNumberLessThanOrEqualTo={parameterPath:["options","sequenceNumberAccessConditions","ifSequenceNumberLessThanOrEqualTo"],mapper:{serializedName:"x-ms-if-sequence-number-le",type:{name:"Number"}}},ifUnmodifiedSince={parameterPath:["options","modifiedAccessConditions","ifUnmodifiedSince"],mapper:{serializedName:"If-Unmodified-Since",type:{name:"DateTimeRfc1123"}}},include1={parameterPath:["options","include"],mapper:{serializedName:"include",type:{name:"Sequence",element:{type:{name:"Enum",allowedValues:["snapshots","metadata","uncommittedblobs","copy","deleted"]}}}},collectionFormat:QueryCollectionFormat.Csv},leaseId0={parameterPath:["options","leaseAccessConditions","leaseId"],mapper:{serializedName:"x-ms-lease-id",type:{name:"String"}}},leaseId1={parameterPath:"leaseId",mapper:{required:!0,serializedName:"x-ms-lease-id",type:{name:"String"}}},marker={parameterPath:["options","marker"],mapper:{serializedName:"marker",type:{name:"String"}}},maxresults={parameterPath:["options","maxresults"],mapper:{serializedName:"maxresults",constraints:{InclusiveMinimum:1},type:{name:"Number"}}},metadata={parameterPath:["options","metadata"],mapper:{serializedName:"x-ms-meta",type:{name:"Dictionary",value:{type:{name:"String"}}},headerCollectionPrefix:"x-ms-meta-"}},prefix={parameterPath:["options","prefix"],mapper:{serializedName:"prefix",type:{name:"String"}}},proposedLeaseId0={parameterPath:["options","proposedLeaseId"],mapper:{serializedName:"x-ms-proposed-lease-id",type:{name:"String"}}},proposedLeaseId1={parameterPath:"proposedLeaseId",mapper:{required:!0,serializedName:"x-ms-proposed-lease-id",type:{name:"String"}}},range={parameterPath:["options","range"],mapper:{serializedName:"x-ms-range",type:{name:"String"}}},requestId={parameterPath:["options","requestId"],mapper:{serializedName:"x-ms-client-request-id",type:{name:"String"}}},restype0={parameterPath:"restype",mapper:{required:!0,isConstant:!0,serializedName:"restype",defaultValue:"service",type:{name:"String"}}},restype1={parameterPath:"restype",mapper:{required:!0,isConstant:!0,serializedName:"restype",defaultValue:"account",type:{name:"String"}}},restype2={parameterPath:"restype",mapper:{required:!0,isConstant:!0,serializedName:"restype",defaultValue:"container",type:{name:"String"}}},snapshot={parameterPath:["options","snapshot"],mapper:{serializedName:"snapshot",type:{name:"String"}}},timeout={parameterPath:["options","timeout"],mapper:{serializedName:"timeout",constraints:{InclusiveMinimum:0},type:{name:"Number"}}},transactionalContentMD5={parameterPath:["options","transactionalContentMD5"],mapper:{serializedName:"Content-MD5",type:{name:"ByteArray"}}},url={parameterPath:"url",mapper:{required:!0,serializedName:"url",defaultValue:"",type:{name:"String"}},skipEncoding:!0},version={parameterPath:"version",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-version",defaultValue:"2018-03-28",type:{name:"String"}}},Service=function(){function Service(client){this.client=client}return Service.prototype.setProperties=function(storageServiceProperties,options,callback){return this.client.sendOperationRequest({storageServiceProperties:storageServiceProperties,options:options},setPropertiesOperationSpec,callback)},Service.prototype.getProperties=function(options,callback){return this.client.sendOperationRequest({options:options},getPropertiesOperationSpec,callback)},Service.prototype.getStatistics=function(options,callback){return this.client.sendOperationRequest({options:options},getStatisticsOperationSpec,callback)},Service.prototype.listContainersSegment=function(options,callback){return this.client.sendOperationRequest({options:options},listContainersSegmentOperationSpec,callback)},Service.prototype.getAccountInfo=function(options,callback){return this.client.sendOperationRequest({options:options},getAccountInfoOperationSpec,callback)},Service}(),serializer$1=new Serializer(Mappers,!0),setPropertiesOperationSpec={httpMethod:"PUT",urlParameters:[url],queryParameters:[timeout,restype0,comp0],headerParameters:[version,requestId],requestBody:{parameterPath:"storageServiceProperties",mapper:__assign({},StorageServiceProperties,{required:!0})},contentType:"application/xml; charset=utf-8",responses:{202:{headersMapper:ServiceSetPropertiesHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$1},getPropertiesOperationSpec={httpMethod:"GET",urlParameters:[url],queryParameters:[timeout,restype0,comp0],headerParameters:[version,requestId],responses:{200:{bodyMapper:StorageServiceProperties,headersMapper:ServiceGetPropertiesHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$1},getStatisticsOperationSpec={httpMethod:"GET",urlParameters:[url],queryParameters:[timeout,restype0,{parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"stats",type:{name:"String"}}}],headerParameters:[version,requestId],responses:{200:{bodyMapper:StorageServiceStats,headersMapper:ServiceGetStatisticsHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$1},listContainersSegmentOperationSpec={httpMethod:"GET",urlParameters:[url],queryParameters:[prefix,marker,maxresults,{parameterPath:["options","include"],mapper:{serializedName:"include",type:{name:"Enum",allowedValues:["metadata"]}}},timeout,comp2],headerParameters:[version,requestId],responses:{200:{bodyMapper:ListContainersSegmentResponse,headersMapper:ServiceListContainersSegmentHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$1},getAccountInfoOperationSpec={httpMethod:"GET",urlParameters:[url],queryParameters:[restype1,comp0],headerParameters:[version],responses:{200:{headersMapper:ServiceGetAccountInfoHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$1},Mappers$1=Object.freeze({ContainerCreateHeaders:ContainerCreateHeaders,StorageError:StorageError,ContainerGetPropertiesHeaders:ContainerGetPropertiesHeaders,ContainerDeleteHeaders:ContainerDeleteHeaders,ContainerSetMetadataHeaders:ContainerSetMetadataHeaders,SignedIdentifier:{serializedName:"SignedIdentifier",type:{name:"Composite",className:"SignedIdentifier",modelProperties:{id:{xmlName:"Id",required:!0,serializedName:"Id",type:{name:"String"}},accessPolicy:{xmlName:"AccessPolicy",required:!0,serializedName:"AccessPolicy",type:{name:"Composite",className:"AccessPolicy"}}}}},AccessPolicy:{serializedName:"AccessPolicy",type:{name:"Composite",className:"AccessPolicy",modelProperties:{start:{xmlName:"Start",required:!0,serializedName:"Start",type:{name:"String"}},expiry:{xmlName:"Expiry",required:!0,serializedName:"Expiry",type:{name:"String"}},permission:{xmlName:"Permission",required:!0,serializedName:"Permission",type:{name:"String"}}}}},ContainerGetAccessPolicyHeaders:ContainerGetAccessPolicyHeaders,ContainerSetAccessPolicyHeaders:ContainerSetAccessPolicyHeaders,ContainerAcquireLeaseHeaders:ContainerAcquireLeaseHeaders,ContainerReleaseLeaseHeaders:ContainerReleaseLeaseHeaders,ContainerRenewLeaseHeaders:ContainerRenewLeaseHeaders,ContainerBreakLeaseHeaders:ContainerBreakLeaseHeaders,ContainerChangeLeaseHeaders:ContainerChangeLeaseHeaders,ListBlobsFlatSegmentResponse:ListBlobsFlatSegmentResponse,BlobFlatListSegment:{xmlName:"Blobs",serializedName:"BlobFlatListSegment",type:{name:"Composite",className:"BlobFlatListSegment",modelProperties:{blobItems:{xmlName:"BlobItems",xmlElementName:"Blob",required:!0,serializedName:"BlobItems",type:{name:"Sequence",element:{type:{name:"Composite",className:"BlobItem"}}}}}}},BlobItem:{xmlName:"Blob",serializedName:"BlobItem",type:{name:"Composite",className:"BlobItem",modelProperties:{name:{xmlName:"Name",required:!0,serializedName:"Name",type:{name:"String"}},deleted:{xmlName:"Deleted",required:!0,serializedName:"Deleted",type:{name:"Boolean"}},snapshot:{xmlName:"Snapshot",required:!0,serializedName:"Snapshot",type:{name:"String"}},properties:{xmlName:"Properties",required:!0,serializedName:"Properties",type:{name:"Composite",className:"BlobProperties"}},metadata:{xmlName:"Metadata",serializedName:"Metadata",type:{name:"Dictionary",value:{type:{name:"String"}}}}}}},BlobProperties:{xmlName:"Properties",serializedName:"BlobProperties",type:{name:"Composite",className:"BlobProperties",modelProperties:{creationTime:{xmlName:"Creation-Time",serializedName:"Creation-Time",type:{name:"DateTimeRfc1123"}},lastModified:{xmlName:"Last-Modified",required:!0,serializedName:"Last-Modified",type:{name:"DateTimeRfc1123"}},etag:{xmlName:"Etag",required:!0,serializedName:"Etag",type:{name:"String"}},contentLength:{xmlName:"Content-Length",serializedName:"Content-Length",type:{name:"Number"}},contentType:{xmlName:"Content-Type",serializedName:"Content-Type",type:{name:"String"}},contentEncoding:{xmlName:"Content-Encoding",serializedName:"Content-Encoding",type:{name:"String"}},contentLanguage:{xmlName:"Content-Language",serializedName:"Content-Language",type:{name:"String"}},contentMD5:{xmlName:"Content-MD5",serializedName:"Content-MD5",type:{name:"ByteArray"}},contentDisposition:{xmlName:"Content-Disposition",serializedName:"Content-Disposition",type:{name:"String"}},cacheControl:{xmlName:"Cache-Control",serializedName:"Cache-Control",type:{name:"String"}},blobSequenceNumber:{xmlName:"x-ms-blob-sequence-number",serializedName:"x-ms-blob-sequence-number",type:{name:"Number"}},blobType:{xmlName:"BlobType",serializedName:"BlobType",type:{name:"Enum",allowedValues:["BlockBlob","PageBlob","AppendBlob"]}},leaseStatus:{xmlName:"LeaseStatus",serializedName:"LeaseStatus",type:{name:"Enum",allowedValues:["locked","unlocked"]}},leaseState:{xmlName:"LeaseState",serializedName:"LeaseState",type:{name:"Enum",allowedValues:["available","leased","expired","breaking","broken"]}},leaseDuration:{xmlName:"LeaseDuration",serializedName:"LeaseDuration",type:{name:"Enum",allowedValues:["infinite","fixed"]}},copyId:{xmlName:"CopyId",serializedName:"CopyId",type:{name:"String"}},copyStatus:{xmlName:"CopyStatus",serializedName:"CopyStatus",type:{name:"Enum",allowedValues:["pending","success","aborted","failed"]}},copySource:{xmlName:"CopySource",serializedName:"CopySource",type:{name:"String"}},copyProgress:{xmlName:"CopyProgress",serializedName:"CopyProgress",type:{name:"String"}},copyCompletionTime:{xmlName:"CopyCompletionTime",serializedName:"CopyCompletionTime",type:{name:"DateTimeRfc1123"}},copyStatusDescription:{xmlName:"CopyStatusDescription",serializedName:"CopyStatusDescription",type:{name:"String"}},serverEncrypted:{xmlName:"ServerEncrypted",serializedName:"ServerEncrypted",type:{name:"Boolean"}},incrementalCopy:{xmlName:"IncrementalCopy",serializedName:"IncrementalCopy",type:{name:"Boolean"}},destinationSnapshot:{xmlName:"DestinationSnapshot",serializedName:"DestinationSnapshot",type:{name:"String"}},deletedTime:{xmlName:"DeletedTime",serializedName:"DeletedTime",type:{name:"DateTimeRfc1123"}},remainingRetentionDays:{xmlName:"RemainingRetentionDays",serializedName:"RemainingRetentionDays",type:{name:"Number"}},accessTier:{xmlName:"AccessTier",serializedName:"AccessTier",type:{name:"String"}},accessTierInferred:{xmlName:"AccessTierInferred",serializedName:"AccessTierInferred",type:{name:"Boolean"}},archiveStatus:{xmlName:"ArchiveStatus",serializedName:"ArchiveStatus",type:{name:"String"}},accessTierChangeTime:{xmlName:"AccessTierChangeTime",serializedName:"AccessTierChangeTime",type:{name:"DateTimeRfc1123"}}}}},ContainerListBlobFlatSegmentHeaders:ContainerListBlobFlatSegmentHeaders,ListBlobsHierarchySegmentResponse:ListBlobsHierarchySegmentResponse,BlobHierarchyListSegment:{xmlName:"Blobs",serializedName:"BlobHierarchyListSegment",type:{name:"Composite",className:"BlobHierarchyListSegment",modelProperties:{blobPrefixes:{xmlName:"BlobPrefixes",xmlElementName:"BlobPrefix",serializedName:"BlobPrefixes",type:{name:"Sequence",element:{type:{name:"Composite",className:"BlobPrefix"}}}},blobItems:{xmlName:"BlobItems",xmlElementName:"Blob",required:!0,serializedName:"BlobItems",type:{name:"Sequence",element:{type:{name:"Composite",className:"BlobItem"}}}}}}},BlobPrefix:{serializedName:"BlobPrefix",type:{name:"Composite",className:"BlobPrefix",modelProperties:{name:{xmlName:"Name",required:!0,serializedName:"Name",type:{name:"String"}}}}},ContainerListBlobHierarchySegmentHeaders:ContainerListBlobHierarchySegmentHeaders,ContainerGetAccountInfoHeaders:ContainerGetAccountInfoHeaders}),Container=function(){function Container(client){this.client=client}return Container.prototype.create=function(options,callback){return this.client.sendOperationRequest({options:options},createOperationSpec,callback)},Container.prototype.getProperties=function(options,callback){return this.client.sendOperationRequest({options:options},getPropertiesOperationSpec$1,callback)},Container.prototype.deleteMethod=function(options,callback){return this.client.sendOperationRequest({options:options},deleteMethodOperationSpec,callback)},Container.prototype.setMetadata=function(options,callback){return this.client.sendOperationRequest({options:options},setMetadataOperationSpec,callback)},Container.prototype.getAccessPolicy=function(options,callback){return this.client.sendOperationRequest({options:options},getAccessPolicyOperationSpec,callback)},Container.prototype.setAccessPolicy=function(options,callback){return this.client.sendOperationRequest({options:options},setAccessPolicyOperationSpec,callback)},Container.prototype.acquireLease=function(options,callback){return this.client.sendOperationRequest({options:options},acquireLeaseOperationSpec,callback)},Container.prototype.releaseLease=function(leaseId,options,callback){return this.client.sendOperationRequest({leaseId:leaseId,options:options},releaseLeaseOperationSpec,callback)},Container.prototype.renewLease=function(leaseId,options,callback){return this.client.sendOperationRequest({leaseId:leaseId,options:options},renewLeaseOperationSpec,callback)},Container.prototype.breakLease=function(options,callback){return this.client.sendOperationRequest({options:options},breakLeaseOperationSpec,callback)},Container.prototype.changeLease=function(leaseId,proposedLeaseId,options,callback){return this.client.sendOperationRequest({leaseId:leaseId,proposedLeaseId:proposedLeaseId,options:options},changeLeaseOperationSpec,callback)},Container.prototype.listBlobFlatSegment=function(options,callback){return this.client.sendOperationRequest({options:options},listBlobFlatSegmentOperationSpec,callback)},Container.prototype.listBlobHierarchySegment=function(delimiter$$1,options,callback){return this.client.sendOperationRequest({delimiter:delimiter$$1,options:options},listBlobHierarchySegmentOperationSpec,callback)},Container.prototype.getAccountInfo=function(options,callback){return this.client.sendOperationRequest({options:options},getAccountInfoOperationSpec$1,callback)},Container}(),serializer$2=new Serializer(Mappers$1,!0),createOperationSpec={httpMethod:"PUT",path:"{containerName}",urlParameters:[url],queryParameters:[timeout,restype2],headerParameters:[metadata,access,version,requestId],responses:{201:{headersMapper:ContainerCreateHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},getPropertiesOperationSpec$1={httpMethod:"GET",path:"{containerName}",urlParameters:[url],queryParameters:[timeout,restype2],headerParameters:[version,requestId,leaseId0],responses:{200:{headersMapper:ContainerGetPropertiesHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},deleteMethodOperationSpec={httpMethod:"DELETE",path:"{containerName}",urlParameters:[url],queryParameters:[timeout,restype2],headerParameters:[version,requestId,leaseId0,ifModifiedSince,ifUnmodifiedSince],responses:{202:{headersMapper:ContainerDeleteHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},setMetadataOperationSpec={httpMethod:"PUT",path:"{containerName}",urlParameters:[url],queryParameters:[timeout,restype2,comp3],headerParameters:[metadata,version,requestId,leaseId0,ifModifiedSince],responses:{200:{headersMapper:ContainerSetMetadataHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},getAccessPolicyOperationSpec={httpMethod:"GET",path:"{containerName}",urlParameters:[url],queryParameters:[timeout,restype2,comp4],headerParameters:[version,requestId,leaseId0],responses:{200:{bodyMapper:{xmlElementName:"SignedIdentifier",serializedName:"parsedResponse",type:{name:"Sequence",element:{type:{name:"Composite",className:"SignedIdentifier"}}}},headersMapper:ContainerGetAccessPolicyHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},setAccessPolicyOperationSpec={httpMethod:"PUT",path:"{containerName}",urlParameters:[url],queryParameters:[timeout,restype2,comp4],headerParameters:[access,version,requestId,leaseId0,ifModifiedSince,ifUnmodifiedSince],requestBody:{parameterPath:["options","containerAcl"],mapper:{xmlName:"SignedIdentifiers",xmlElementName:"SignedIdentifier",serializedName:"containerAcl",type:{name:"Sequence",element:{type:{name:"Composite",className:"SignedIdentifier"}}}}},contentType:"application/xml; charset=utf-8",responses:{200:{headersMapper:ContainerSetAccessPolicyHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},acquireLeaseOperationSpec={httpMethod:"PUT",path:"{containerName}",urlParameters:[url],queryParameters:[timeout,comp5,restype2],headerParameters:[duration,proposedLeaseId0,version,requestId,action0,ifModifiedSince,ifUnmodifiedSince],responses:{201:{headersMapper:ContainerAcquireLeaseHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},releaseLeaseOperationSpec={httpMethod:"PUT",path:"{containerName}",urlParameters:[url],queryParameters:[timeout,comp5,restype2],headerParameters:[leaseId1,version,requestId,action1,ifModifiedSince,ifUnmodifiedSince],responses:{200:{headersMapper:ContainerReleaseLeaseHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},renewLeaseOperationSpec={httpMethod:"PUT",path:"{containerName}",urlParameters:[url],queryParameters:[timeout,comp5,restype2],headerParameters:[leaseId1,version,requestId,action2,ifModifiedSince,ifUnmodifiedSince],responses:{200:{headersMapper:ContainerRenewLeaseHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},breakLeaseOperationSpec={httpMethod:"PUT",path:"{containerName}",urlParameters:[url],queryParameters:[timeout,comp5,restype2],headerParameters:[breakPeriod,version,requestId,action3,ifModifiedSince,ifUnmodifiedSince],responses:{202:{headersMapper:ContainerBreakLeaseHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},changeLeaseOperationSpec={httpMethod:"PUT",path:"{containerName}",urlParameters:[url],queryParameters:[timeout,comp5,restype2],headerParameters:[leaseId1,proposedLeaseId1,version,requestId,action4,ifModifiedSince,ifUnmodifiedSince],responses:{200:{headersMapper:ContainerChangeLeaseHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},listBlobFlatSegmentOperationSpec={httpMethod:"GET",path:"{containerName}",urlParameters:[url],queryParameters:[prefix,marker,maxresults,include1,timeout,restype2,comp2],headerParameters:[version,requestId],responses:{200:{bodyMapper:ListBlobsFlatSegmentResponse,headersMapper:ContainerListBlobFlatSegmentHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},listBlobHierarchySegmentOperationSpec={httpMethod:"GET",path:"{containerName}",urlParameters:[url],queryParameters:[prefix,{parameterPath:"delimiter",mapper:{required:!0,serializedName:"delimiter",type:{name:"String"}}},marker,maxresults,include1,timeout,restype2,comp2],headerParameters:[version,requestId],responses:{200:{bodyMapper:ListBlobsHierarchySegmentResponse,headersMapper:ContainerListBlobHierarchySegmentHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},getAccountInfoOperationSpec$1={httpMethod:"GET",path:"{containerName}",urlParameters:[url],queryParameters:[restype1,comp0],headerParameters:[version],responses:{200:{headersMapper:ContainerGetAccountInfoHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$2},Mappers$2=Object.freeze({BlobDownloadHeaders:BlobDownloadHeaders,StorageError:StorageError,BlobGetPropertiesHeaders:BlobGetPropertiesHeaders,BlobDeleteHeaders:BlobDeleteHeaders,BlobUndeleteHeaders:BlobUndeleteHeaders,BlobSetHTTPHeadersHeaders:BlobSetHTTPHeadersHeaders,BlobSetMetadataHeaders:BlobSetMetadataHeaders,BlobAcquireLeaseHeaders:BlobAcquireLeaseHeaders,BlobReleaseLeaseHeaders:BlobReleaseLeaseHeaders,BlobRenewLeaseHeaders:BlobRenewLeaseHeaders,BlobChangeLeaseHeaders:BlobChangeLeaseHeaders,BlobBreakLeaseHeaders:BlobBreakLeaseHeaders,BlobCreateSnapshotHeaders:BlobCreateSnapshotHeaders,BlobStartCopyFromURLHeaders:BlobStartCopyFromURLHeaders,BlobAbortCopyFromURLHeaders:BlobAbortCopyFromURLHeaders,BlobSetTierHeaders:BlobSetTierHeaders,BlobGetAccountInfoHeaders:BlobGetAccountInfoHeaders}),Blob$1=function(){function Blob(client){this.client=client}return Blob.prototype.download=function(options,callback){return this.client.sendOperationRequest({options:options},downloadOperationSpec,callback)},Blob.prototype.getProperties=function(options,callback){return this.client.sendOperationRequest({options:options},getPropertiesOperationSpec$2,callback)},Blob.prototype.deleteMethod=function(options,callback){return this.client.sendOperationRequest({options:options},deleteMethodOperationSpec$1,callback)},Blob.prototype.undelete=function(options,callback){return this.client.sendOperationRequest({options:options},undeleteOperationSpec,callback)},Blob.prototype.setHTTPHeaders=function(options,callback){return this.client.sendOperationRequest({options:options},setHTTPHeadersOperationSpec,callback)},Blob.prototype.setMetadata=function(options,callback){return this.client.sendOperationRequest({options:options},setMetadataOperationSpec$1,callback)},Blob.prototype.acquireLease=function(options,callback){return this.client.sendOperationRequest({options:options},acquireLeaseOperationSpec$1,callback)},Blob.prototype.releaseLease=function(leaseId,options,callback){return this.client.sendOperationRequest({leaseId:leaseId,options:options},releaseLeaseOperationSpec$1,callback)},Blob.prototype.renewLease=function(leaseId,options,callback){return this.client.sendOperationRequest({leaseId:leaseId,options:options},renewLeaseOperationSpec$1,callback)},Blob.prototype.changeLease=function(leaseId,proposedLeaseId,options,callback){return this.client.sendOperationRequest({leaseId:leaseId,proposedLeaseId:proposedLeaseId,options:options},changeLeaseOperationSpec$1,callback)},Blob.prototype.breakLease=function(options,callback){return this.client.sendOperationRequest({options:options},breakLeaseOperationSpec$1,callback)},Blob.prototype.createSnapshot=function(options,callback){return this.client.sendOperationRequest({options:options},createSnapshotOperationSpec,callback)},Blob.prototype.startCopyFromURL=function(copySource$$1,options,callback){return this.client.sendOperationRequest({copySource:copySource$$1,options:options},startCopyFromURLOperationSpec,callback)},Blob.prototype.abortCopyFromURL=function(copyId$$1,options,callback){return this.client.sendOperationRequest({copyId:copyId$$1,options:options},abortCopyFromURLOperationSpec,callback)},Blob.prototype.setTier=function(tier$$1,options,callback){return this.client.sendOperationRequest({tier:tier$$1,options:options},setTierOperationSpec,callback)},Blob.prototype.getAccountInfo=function(options,callback){return this.client.sendOperationRequest({options:options},getAccountInfoOperationSpec$2,callback)},Blob}(),serializer$3=new Serializer(Mappers$2,!0),downloadOperationSpec={httpMethod:"GET",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[snapshot,timeout],headerParameters:[range,{parameterPath:["options","rangeGetContentMD5"],mapper:{serializedName:"x-ms-range-get-content-md5",type:{name:"Boolean"}}},version,requestId,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{200:{bodyMapper:{serializedName:"parsedResponse",type:{name:"Stream"}},headersMapper:BlobDownloadHeaders},206:{bodyMapper:{serializedName:"parsedResponse",type:{name:"Stream"}},headersMapper:BlobDownloadHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},getPropertiesOperationSpec$2={httpMethod:"HEAD",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[snapshot,timeout],headerParameters:[version,requestId,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{200:{headersMapper:BlobGetPropertiesHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},deleteMethodOperationSpec$1={httpMethod:"DELETE",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[snapshot,timeout],headerParameters:[{parameterPath:["options","deleteSnapshots"],mapper:{serializedName:"x-ms-delete-snapshots",type:{name:"Enum",allowedValues:["include","only"]}}},version,requestId,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{202:{headersMapper:BlobDeleteHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},undeleteOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,{parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"undelete",type:{name:"String"}}}],headerParameters:[version,requestId],responses:{200:{headersMapper:BlobUndeleteHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},setHTTPHeadersOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp0],headerParameters:[version,requestId,blobCacheControl,blobContentType,blobContentMD5,blobContentEncoding,blobContentLanguage,blobContentDisposition,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{200:{headersMapper:BlobSetHTTPHeadersHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},setMetadataOperationSpec$1={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp3],headerParameters:[metadata,version,requestId,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{200:{headersMapper:BlobSetMetadataHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},acquireLeaseOperationSpec$1={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp5],headerParameters:[duration,proposedLeaseId0,version,requestId,action0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{201:{headersMapper:BlobAcquireLeaseHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},releaseLeaseOperationSpec$1={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp5],headerParameters:[leaseId1,version,requestId,action1,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{200:{headersMapper:BlobReleaseLeaseHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},renewLeaseOperationSpec$1={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp5],headerParameters:[leaseId1,version,requestId,action2,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{200:{headersMapper:BlobRenewLeaseHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},changeLeaseOperationSpec$1={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp5],headerParameters:[leaseId1,proposedLeaseId1,version,requestId,action4,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{200:{headersMapper:BlobChangeLeaseHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},breakLeaseOperationSpec$1={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp5],headerParameters:[breakPeriod,version,requestId,action3,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{202:{headersMapper:BlobBreakLeaseHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},createSnapshotOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,{parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"snapshot",type:{name:"String"}}}],headerParameters:[metadata,version,requestId,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch,leaseId0],responses:{201:{headersMapper:BlobCreateSnapshotHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},startCopyFromURLOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout],headerParameters:[metadata,copySource,version,requestId,{parameterPath:["options","sourceModifiedAccessConditions","sourceIfModifiedSince"],mapper:{serializedName:"x-ms-source-if-modified-since",type:{name:"DateTimeRfc1123"}}},{parameterPath:["options","sourceModifiedAccessConditions","sourceIfUnmodifiedSince"],mapper:{serializedName:"x-ms-source-if-unmodified-since",type:{name:"DateTimeRfc1123"}}},{parameterPath:["options","sourceModifiedAccessConditions","sourceIfMatch"],mapper:{serializedName:"x-ms-source-if-match",type:{name:"String"}}},{parameterPath:["options","sourceModifiedAccessConditions","sourceIfNoneMatch"],mapper:{serializedName:"x-ms-source-if-none-match",type:{name:"String"}}},ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch,leaseId0],responses:{202:{headersMapper:BlobStartCopyFromURLHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},abortCopyFromURLOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[{parameterPath:"copyId",mapper:{required:!0,serializedName:"copyid",type:{name:"String"}}},timeout,{parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"copy",type:{name:"String"}}}],headerParameters:[version,requestId,{parameterPath:"copyActionAbortConstant",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-copy-action",defaultValue:"abort",type:{name:"String"}}},leaseId0],responses:{204:{headersMapper:BlobAbortCopyFromURLHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},setTierOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,{parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"tier",type:{name:"String"}}}],headerParameters:[{parameterPath:"tier",mapper:{required:!0,serializedName:"x-ms-access-tier",type:{name:"String"}}},version,requestId,leaseId0],responses:{200:{headersMapper:BlobSetTierHeaders},202:{headersMapper:BlobSetTierHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},getAccountInfoOperationSpec$2={httpMethod:"GET",path:"{containerName}/{blobName}",urlParameters:[url],queryParameters:[restype1,comp0],headerParameters:[version],responses:{200:{headersMapper:BlobGetAccountInfoHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$3},Mappers$3=Object.freeze({PageBlobCreateHeaders:PageBlobCreateHeaders,StorageError:StorageError,PageBlobUploadPagesHeaders:PageBlobUploadPagesHeaders,PageBlobClearPagesHeaders:PageBlobClearPagesHeaders,PageList:PageList,PageRange:{serializedName:"PageRange",type:{name:"Composite",className:"PageRange",modelProperties:{start:{xmlName:"Start",required:!0,serializedName:"Start",type:{name:"Number"}},end:{xmlName:"End",required:!0,serializedName:"End",type:{name:"Number"}}}}},ClearRange:{serializedName:"ClearRange",type:{name:"Composite",className:"ClearRange",modelProperties:{start:{xmlName:"Start",required:!0,serializedName:"Start",type:{name:"Number"}},end:{xmlName:"End",required:!0,serializedName:"End",type:{name:"Number"}}}}},PageBlobGetPageRangesHeaders:PageBlobGetPageRangesHeaders,PageBlobGetPageRangesDiffHeaders:PageBlobGetPageRangesDiffHeaders,PageBlobResizeHeaders:PageBlobResizeHeaders,PageBlobUpdateSequenceNumberHeaders:PageBlobUpdateSequenceNumberHeaders,PageBlobCopyIncrementalHeaders:PageBlobCopyIncrementalHeaders}),PageBlob=function(){function PageBlob(client){this.client=client}return PageBlob.prototype.create=function(contentLength$$1,blobContentLength$$1,options,callback){return this.client.sendOperationRequest({contentLength:contentLength$$1,blobContentLength:blobContentLength$$1,options:options},createOperationSpec$1,callback)},PageBlob.prototype.uploadPages=function(body,contentLength$$1,options,callback){return this.client.sendOperationRequest({body:body,contentLength:contentLength$$1,options:options},uploadPagesOperationSpec,callback)},PageBlob.prototype.clearPages=function(contentLength$$1,options,callback){return this.client.sendOperationRequest({contentLength:contentLength$$1,options:options},clearPagesOperationSpec,callback)},PageBlob.prototype.getPageRanges=function(options,callback){return this.client.sendOperationRequest({options:options},getPageRangesOperationSpec,callback)},PageBlob.prototype.getPageRangesDiff=function(options,callback){return this.client.sendOperationRequest({options:options},getPageRangesDiffOperationSpec,callback)},PageBlob.prototype.resize=function(blobContentLength$$1,options,callback){return this.client.sendOperationRequest({blobContentLength:blobContentLength$$1,options:options},resizeOperationSpec,callback)},PageBlob.prototype.updateSequenceNumber=function(sequenceNumberAction$$1,options,callback){return this.client.sendOperationRequest({sequenceNumberAction:sequenceNumberAction$$1,options:options},updateSequenceNumberOperationSpec,callback)},PageBlob.prototype.copyIncremental=function(copySource$$1,options,callback){return this.client.sendOperationRequest({copySource:copySource$$1,options:options},copyIncrementalOperationSpec,callback)},PageBlob}(),serializer$4=new Serializer(Mappers$3,!0),createOperationSpec$1={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout],headerParameters:[contentLength,metadata,blobContentLength,blobSequenceNumber,version,requestId,{parameterPath:"blobType",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-blob-type",defaultValue:"PageBlob",type:{name:"String"}}},blobContentType,blobContentEncoding,blobContentLanguage,blobContentMD5,blobCacheControl,blobContentDisposition,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{201:{headersMapper:PageBlobCreateHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$4},uploadPagesOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp10],headerParameters:[contentLength,transactionalContentMD5,range,version,requestId,{parameterPath:"pageWrite",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-page-write",defaultValue:"update",type:{name:"String"}}},leaseId0,ifSequenceNumberLessThanOrEqualTo,ifSequenceNumberLessThan,ifSequenceNumberEqualTo,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],requestBody:{parameterPath:"body",mapper:{required:!0,serializedName:"body",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{201:{headersMapper:PageBlobUploadPagesHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$4},clearPagesOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp10],headerParameters:[contentLength,range,version,requestId,{parameterPath:"pageWrite",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-page-write",defaultValue:"clear",type:{name:"String"}}},leaseId0,ifSequenceNumberLessThanOrEqualTo,ifSequenceNumberLessThan,ifSequenceNumberEqualTo,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{201:{headersMapper:PageBlobClearPagesHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$4},getPageRangesOperationSpec={httpMethod:"GET",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[snapshot,timeout,comp11],headerParameters:[range,version,requestId,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{200:{bodyMapper:PageList,headersMapper:PageBlobGetPageRangesHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$4},getPageRangesDiffOperationSpec={httpMethod:"GET",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[snapshot,timeout,{parameterPath:["options","prevsnapshot"],mapper:{serializedName:"prevsnapshot",type:{name:"String"}}},comp11],headerParameters:[range,version,requestId,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{200:{bodyMapper:PageList,headersMapper:PageBlobGetPageRangesDiffHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$4},resizeOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp0],headerParameters:[blobContentLength,version,requestId,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{200:{headersMapper:PageBlobResizeHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$4},updateSequenceNumberOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp0],headerParameters:[{parameterPath:"sequenceNumberAction",mapper:{required:!0,serializedName:"x-ms-sequence-number-action",type:{name:"Enum",allowedValues:["max","update","increment"]}}},blobSequenceNumber,version,requestId,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{200:{headersMapper:PageBlobUpdateSequenceNumberHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$4},copyIncrementalOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,{parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"incrementalcopy",type:{name:"String"}}}],headerParameters:[copySource,version,requestId,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{202:{headersMapper:PageBlobCopyIncrementalHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$4},Mappers$4=Object.freeze({AppendBlobCreateHeaders:AppendBlobCreateHeaders,StorageError:StorageError,AppendBlobAppendBlockHeaders:AppendBlobAppendBlockHeaders}),AppendBlob=function(){function AppendBlob(client){this.client=client}return AppendBlob.prototype.create=function(contentLength$$1,options,callback){return this.client.sendOperationRequest({contentLength:contentLength$$1,options:options},createOperationSpec$2,callback)},AppendBlob.prototype.appendBlock=function(body,contentLength$$1,options,callback){return this.client.sendOperationRequest({body:body,contentLength:contentLength$$1,options:options},appendBlockOperationSpec,callback)},AppendBlob}(),serializer$5=new Serializer(Mappers$4,!0),createOperationSpec$2={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout],headerParameters:[contentLength,metadata,version,requestId,{parameterPath:"blobType",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-blob-type",defaultValue:"AppendBlob",type:{name:"String"}}},blobContentType,blobContentEncoding,blobContentLanguage,blobContentMD5,blobCacheControl,blobContentDisposition,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],responses:{201:{headersMapper:AppendBlobCreateHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$5},appendBlockOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,{parameterPath:"comp",mapper:{required:!0,isConstant:!0,serializedName:"comp",defaultValue:"appendblock",type:{name:"String"}}}],headerParameters:[contentLength,transactionalContentMD5,version,requestId,leaseId0,{parameterPath:["options","appendPositionAccessConditions","maxSize"],mapper:{serializedName:"x-ms-blob-condition-maxsize",type:{name:"Number"}}},{parameterPath:["options","appendPositionAccessConditions","appendPosition"],mapper:{serializedName:"x-ms-blob-condition-appendpos",type:{name:"Number"}}},ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],requestBody:{parameterPath:"body",mapper:{required:!0,serializedName:"body",type:{name:"Stream"}}},contentType:"application/xml; charset=utf-8",responses:{201:{headersMapper:AppendBlobAppendBlockHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$5},Mappers$5=Object.freeze({BlockBlobUploadHeaders:BlockBlobUploadHeaders,StorageError:StorageError,BlockBlobStageBlockHeaders:BlockBlobStageBlockHeaders,BlockBlobStageBlockFromURLHeaders:BlockBlobStageBlockFromURLHeaders,BlockLookupList:BlockLookupList,BlockBlobCommitBlockListHeaders:BlockBlobCommitBlockListHeaders,BlockList:BlockList,Block:{serializedName:"Block",type:{name:"Composite",className:"Block",modelProperties:{name:{xmlName:"Name",required:!0,serializedName:"Name",type:{name:"String"}},size:{xmlName:"Size",required:!0,serializedName:"Size",type:{name:"Number"}}}}},BlockBlobGetBlockListHeaders:BlockBlobGetBlockListHeaders}),BlockBlob=function(){function BlockBlob(client){this.client=client}return BlockBlob.prototype.upload=function(body,contentLength$$1,options,callback){return this.client.sendOperationRequest({body:body,contentLength:contentLength$$1,options:options},uploadOperationSpec,callback)},BlockBlob.prototype.stageBlock=function(blockId$$1,contentLength$$1,body,options,callback){return this.client.sendOperationRequest({blockId:blockId$$1,contentLength:contentLength$$1,body:body,options:options},stageBlockOperationSpec,callback)},BlockBlob.prototype.stageBlockFromURL=function(blockId$$1,contentLength$$1,sourceUrl$$1,options,callback){return this.client.sendOperationRequest({blockId:blockId$$1,contentLength:contentLength$$1,sourceUrl:sourceUrl$$1,options:options},stageBlockFromURLOperationSpec,callback)},BlockBlob.prototype.commitBlockList=function(blocks,options,callback){return this.client.sendOperationRequest({blocks:blocks,options:options},commitBlockListOperationSpec,callback)},BlockBlob.prototype.getBlockList=function(listType$$1,options,callback){return this.client.sendOperationRequest({listType:listType$$1,options:options},getBlockListOperationSpec,callback)},BlockBlob}(),serializer$6=new Serializer(Mappers$5,!0),uploadOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout],headerParameters:[contentLength,metadata,version,requestId,{parameterPath:"blobType",mapper:{required:!0,isConstant:!0,serializedName:"x-ms-blob-type",defaultValue:"BlockBlob",type:{name:"String"}}},blobContentType,blobContentEncoding,blobContentLanguage,blobContentMD5,blobCacheControl,blobContentDisposition,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],requestBody:{parameterPath:"body",mapper:{required:!0,serializedName:"body",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{201:{headersMapper:BlockBlobUploadHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$6},stageBlockOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[blockId,timeout,comp14],headerParameters:[contentLength,transactionalContentMD5,version,requestId,leaseId0],requestBody:{parameterPath:"body",mapper:{required:!0,serializedName:"body",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{201:{headersMapper:BlockBlobStageBlockHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$6},stageBlockFromURLOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[blockId,timeout,comp14],headerParameters:[contentLength,{parameterPath:"sourceUrl",mapper:{required:!0,serializedName:"x-ms-copy-source",type:{name:"String"}}},{parameterPath:["options","sourceRange"],mapper:{serializedName:"x-ms-source-range",type:{name:"String"}}},{parameterPath:["options","sourceContentMD5"],mapper:{serializedName:"x-ms-source-content-md5",type:{name:"ByteArray"}}},version,requestId,leaseId0],responses:{201:{headersMapper:BlockBlobStageBlockFromURLHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$6},commitBlockListOperationSpec={httpMethod:"PUT",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[timeout,comp15],headerParameters:[metadata,version,requestId,blobCacheControl,blobContentType,blobContentEncoding,blobContentLanguage,blobContentMD5,blobContentDisposition,leaseId0,ifModifiedSince,ifUnmodifiedSince,ifMatch,ifNoneMatch],requestBody:{parameterPath:"blocks",mapper:__assign({},BlockLookupList,{required:!0})},contentType:"application/xml; charset=utf-8",responses:{201:{headersMapper:BlockBlobCommitBlockListHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$6},getBlockListOperationSpec={httpMethod:"GET",path:"{containerName}/{blob}",urlParameters:[url],queryParameters:[snapshot,{parameterPath:"listType",mapper:{required:!0,serializedName:"blocklisttype",defaultValue:"committed",type:{name:"Enum",allowedValues:["committed","uncommitted","all"]}}},timeout,comp15],headerParameters:[version,requestId,leaseId0],responses:{200:{bodyMapper:BlockList,headersMapper:BlockBlobGetBlockListHeaders},default:{bodyMapper:StorageError}},isXML:!0,serializer:serializer$6};function rangeToString(iRange){if(iRange.offset<0)throw new RangeError("IRange.offset cannot be smaller than 0.");if(iRange.count&&iRange.count<=0)throw new RangeError("IRange.count must be larger than 0. Leave it undefined if you want a range from offset to the end.");return iRange.count?"bytes="+iRange.offset+"-"+(iRange.offset+iRange.count-1):"bytes="+iRange.offset+"-"}var URLConstants_Parameters={FORCE_BROWSER_NO_CACHE:"_",SIGNATURE:"sig",SNAPSHOT:"snapshot",TIMEOUT:"timeout"},HTTPURLConnection_HTTP_CONFLICT=409,HTTPURLConnection_HTTP_NOT_FOUND=404,HTTPURLConnection_HTTP_PRECON_FAILED=412,HTTPURLConnection_HTTP_RANGE_NOT_SATISFIABLE=416,HeaderConstants$2_AUTHORIZATION="authorization",HeaderConstants$2_AUTHORIZATION_SCHEME="Bearer",HeaderConstants$2_CONTENT_LENGTH="content-length",HeaderConstants$2_COOKIE="Cookie",HeaderConstants$2_X_MS_CLIENT_REQUEST_ID="x-ms-client-request-id";function escapeURLPath(url){var urlParsed=URLBuilder.parse(url),path=urlParsed.getPath();return path=function escape(text){return encodeURIComponent(text).replace(/%2F/g,"/").replace(/'/g,"%27").replace(/\+/g,"%20").replace(/%25/g,"%")}(path=path||"/"),urlParsed.setPath(path),urlParsed.toString()}function appendToURLPath(url,name){var urlParsed=URLBuilder.parse(url),path=urlParsed.getPath();return path=path?path.endsWith("/")?""+path+name:path+"/"+name:name,urlParsed.setPath(path),urlParsed.toString()}function setURLParameter(url,name,value){var urlParsed=URLBuilder.parse(url);return urlParsed.setQueryParameter(name,value),urlParsed.toString()}function truncatedISO8061Date(date,withMilliseconds){void 0===withMilliseconds&&(withMilliseconds=!0);var dateString=date.toISOString();return withMilliseconds?dateString.substring(0,dateString.length-1)+"0000Z":dateString.substring(0,dateString.length-5)+"Z"}function generateBlockID(blockIDPrefix,blockIndex){return blockIDPrefix.length>42&&(blockIDPrefix=blockIDPrefix.slice(0,42)),function base64encode(content){return isNode?Buffer.from(content).toString("base64"):btoa(content)}(blockIDPrefix+function padStart(currentString,targetLength,padString){void 0===padString&&(padString=" ");if(String.prototype.padStart)return currentString.padStart(targetLength,padString);return padString=padString||" ",currentString.length>targetLength?currentString:((targetLength-=currentString.length)>padString.length&&(padString+=padString.repeat(targetLength/padString.length)),padString.slice(0,targetLength)+currentString)}(blockIndex.toString(),48-blockIDPrefix.length,"0"))}var RetryPolicyType,BrowserPolicy=function(_super){function BrowserPolicy(nextPolicy,options){return _super.call(this,nextPolicy,options)||this}return __extends(BrowserPolicy,_super),BrowserPolicy.prototype.sendRequest=function(request){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return"GET"!==request.method.toUpperCase()&&"HEAD"!==request.method.toUpperCase()||(request.url=setURLParameter(request.url,URLConstants_Parameters.FORCE_BROWSER_NO_CACHE,(new Date).getTime().toString())),request.headers.remove(HeaderConstants$2_COOKIE),request.headers.remove(HeaderConstants$2_CONTENT_LENGTH),[2,this._nextPolicy.sendRequest(request)]})})},BrowserPolicy}(BaseRequestPolicy),BrowserPolicyFactory=function(){function BrowserPolicyFactory(){}return BrowserPolicyFactory.prototype.create=function(nextPolicy,options){return new BrowserPolicy(nextPolicy,options)},BrowserPolicyFactory}(),StorageClientContext=function(_super){function StorageClientContext(url,options){var _this=this;if(null==url)throw new Error("'url' cannot be null.");if(options||(options={}),!options.userAgent){var defaultUserAgent=getDefaultUserAgentValue();options.userAgent="azure-storage-blob/1.0.0 "+defaultUserAgent}return(_this=_super.call(this,void 0,options)||this).version="2018-03-28",_this.baseUri="{url}",_this.requestContentType="application/json; charset=utf-8",_this.url=url,_this}return __extends(StorageClientContext,_super),StorageClientContext}(ServiceClient),DEFAULT_REQUEST_LOG_OPTIONS={logWarningIfTryOverThreshold:3e3},LoggingPolicy=function(_super){function LoggingPolicy(nextPolicy,options,loggingOptions){void 0===loggingOptions&&(loggingOptions=DEFAULT_REQUEST_LOG_OPTIONS);var _this=_super.call(this,nextPolicy,options)||this;return _this.tryCount=0,_this.operationStartTime=new Date,_this.requestStartTime=new Date,_this.loggingOptions=loggingOptions,_this}return __extends(LoggingPolicy,_super),LoggingPolicy.prototype.sendRequest=function(request){return __awaiter(this,void 0,void 0,function(){var safeURL,response,requestEndTime,requestCompletionTime,operationDuration,currentLevel,logMessage,errorString,messageInfo,err_1;return __generator(this,function(_a){switch(_a.label){case 0:this.tryCount++,this.requestStartTime=new Date,1===this.tryCount&&(this.operationStartTime=this.requestStartTime),function getURLParameter(url,name){return URLBuilder.parse(url).getQueryParameterValue(name)}(safeURL=request.url,URLConstants_Parameters.SIGNATURE)&&(safeURL=setURLParameter(safeURL,URLConstants_Parameters.SIGNATURE,"*****")),this.log(exports.HttpPipelineLogLevel.INFO,"'"+safeURL+"'==> OUTGOING REQUEST (Try number="+this.tryCount+")."),_a.label=1;case 1:return _a.trys.push([1,3,,4]),[4,this._nextPolicy.sendRequest(request)];case 2:return response=_a.sent(),requestEndTime=new Date,requestCompletionTime=requestEndTime.getTime()-this.requestStartTime.getTime(),operationDuration=requestEndTime.getTime()-this.operationStartTime.getTime(),currentLevel=exports.HttpPipelineLogLevel.INFO,logMessage="",this.shouldLog(exports.HttpPipelineLogLevel.INFO)&&(logMessage="Successfully Received Response. "),requestCompletionTime>=this.loggingOptions.logWarningIfTryOverThreshold&&this.shouldLog(exports.HttpPipelineLogLevel.WARNING)&&(currentLevel=exports.HttpPipelineLogLevel.WARNING,logMessage="SLOW OPERATION. Duration > "+this.loggingOptions.logWarningIfTryOverThreshold+" ms. "),(response.status>=400&&response.status<=499&&response.status!==HTTPURLConnection_HTTP_NOT_FOUND&&response.status!==HTTPURLConnection_HTTP_CONFLICT&&response.status!==HTTPURLConnection_HTTP_PRECON_FAILED&&response.status!==HTTPURLConnection_HTTP_RANGE_NOT_SATISFIABLE||response.status>=500&&response.status<=509)&&(errorString="REQUEST ERROR: HTTP request failed with status code: "+response.status+". ",logMessage=errorString,currentLevel=exports.HttpPipelineLogLevel.ERROR),messageInfo="Request try:"+this.tryCount+", status:"+response.status+" request duration:"+requestCompletionTime+" ms, operation duration:"+operationDuration+" ms\n",this.log(currentLevel,logMessage+messageInfo),[2,response];case 3:throw err_1=_a.sent(),this.log(exports.HttpPipelineLogLevel.ERROR,"Unexpected failure attempting to make request. Error message: "+err_1.message),err_1;case 4:return[2]}})})},LoggingPolicy}(BaseRequestPolicy),LoggingPolicyFactory=function(){function LoggingPolicyFactory(loggingOptions){this.loggingOptions=loggingOptions}return LoggingPolicyFactory.prototype.create=function(nextPolicy,options){return new LoggingPolicy(nextPolicy,options,this.loggingOptions)},LoggingPolicyFactory}(),Pipeline=function(){function Pipeline(factories,options){void 0===options&&(options={}),this.factories=factories,this.options=options}return Pipeline.prototype.toServiceClientOptions=function(){return{httpClient:this.options.HTTPClient,httpPipelineLogger:this.options.logger,requestPolicyFactories:this.factories}},Pipeline}();!function(RetryPolicyType){RetryPolicyType[RetryPolicyType.EXPONENTIAL=0]="EXPONENTIAL",RetryPolicyType[RetryPolicyType.FIXED=1]="FIXED"}(RetryPolicyType||(RetryPolicyType={}));var ReflectOwnKeys,DEFAULT_RETRY_OPTIONS={maxRetryDelayInMs:12e4,maxTries:4,retryDelayInMs:4e3,retryPolicyType:RetryPolicyType.EXPONENTIAL,secondaryHost:"",tryTimeoutInMs:void 0},RetryPolicy=function(_super){function RetryPolicy(nextPolicy,options,retryOptions){void 0===retryOptions&&(retryOptions=DEFAULT_RETRY_OPTIONS);var _this=_super.call(this,nextPolicy,options)||this;return _this.retryOptions={retryPolicyType:retryOptions.retryPolicyType?retryOptions.retryPolicyType:DEFAULT_RETRY_OPTIONS.retryPolicyType,maxTries:retryOptions.maxTries&&retryOptions.maxTries>=1?Math.floor(retryOptions.maxTries):DEFAULT_RETRY_OPTIONS.maxTries,tryTimeoutInMs:retryOptions.tryTimeoutInMs&&retryOptions.tryTimeoutInMs>=0?retryOptions.tryTimeoutInMs:DEFAULT_RETRY_OPTIONS.tryTimeoutInMs,retryDelayInMs:retryOptions.retryDelayInMs&&retryOptions.retryDelayInMs>=0?Math.min(retryOptions.retryDelayInMs,retryOptions.maxRetryDelayInMs?retryOptions.maxRetryDelayInMs:DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs):DEFAULT_RETRY_OPTIONS.retryDelayInMs,maxRetryDelayInMs:retryOptions.maxRetryDelayInMs&&retryOptions.maxRetryDelayInMs>=0?retryOptions.maxRetryDelayInMs:DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,secondaryHost:retryOptions.secondaryHost?retryOptions.secondaryHost:DEFAULT_RETRY_OPTIONS.secondaryHost},_this}return __extends(RetryPolicy,_super),RetryPolicy.prototype.sendRequest=function(request){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.attemptSendRequest(request,!1,1)]})})},RetryPolicy.prototype.attemptSendRequest=function(request,secondaryHas404,attempt){return __awaiter(this,void 0,void 0,function(){var newRequest,isPrimaryRetry,response,err_1;return __generator(this,function(_a){switch(_a.label){case 0:newRequest=request.clone(),(isPrimaryRetry=secondaryHas404||!this.retryOptions.secondaryHost||!("GET"===request.method||"HEAD"===request.method||"OPTIONS"===request.method)||attempt%2==1)||(newRequest.url=function setURLHost(url,host){var urlParsed=URLBuilder.parse(url);return urlParsed.setHost(host),urlParsed.toString()}(newRequest.url,this.retryOptions.secondaryHost)),this.retryOptions.tryTimeoutInMs&&(newRequest.url=setURLParameter(newRequest.url,URLConstants_Parameters.TIMEOUT,Math.floor(this.retryOptions.tryTimeoutInMs/1e3).toString())),_a.label=1;case 1:return _a.trys.push([1,3,,4]),this.logf(exports.HttpPipelineLogLevel.INFO,"RetryPolicy: =====> Try="+attempt+" "+(isPrimaryRetry?"Primary":"Secondary")),[4,this._nextPolicy.sendRequest(newRequest)];case 2:return response=_a.sent(),this.shouldRetry(isPrimaryRetry,attempt,response)?(secondaryHas404=secondaryHas404||!isPrimaryRetry&&404===response.status,[3,4]):[2,response];case 3:if(err_1=_a.sent(),this.logf(exports.HttpPipelineLogLevel.ERROR,"RetryPolicy: Caught error, message: "+err_1.message+", code: "+err_1.code),!this.shouldRetry(isPrimaryRetry,attempt,response,err_1))throw err_1;return[3,4];case 4:return[4,this.delay(isPrimaryRetry,attempt)];case 5:return _a.sent(),[4,this.attemptSendRequest(request,secondaryHas404,++attempt)];case 6:return[2,_a.sent()]}})})},RetryPolicy.prototype.shouldRetry=function(isPrimaryRetry,attempt,response,err){if(attempt>=this.retryOptions.maxTries)return this.logf(exports.HttpPipelineLogLevel.INFO,"RetryPolicy: Attempt(s) "+attempt+" >= maxTries "+this.retryOptions.maxTries+", no further try."),!1;if(err)for(var _i=0,retriableErrors_1=["ETIMEDOUT","ESOCKETTIMEDOUT","ECONNREFUSED","ECONNRESET","ENOENT","ENOTFOUND","TIMEOUT","REQUEST_SEND_ERROR"];_i<retriableErrors_1.length;_i++){var retriableError=retriableErrors_1[_i];if(err.name.toUpperCase().includes(retriableError)||err.message.toUpperCase().includes(retriableError)||err.code&&err.code.toUpperCase().includes(retriableError))return this.logf(exports.HttpPipelineLogLevel.INFO,"RetryPolicy: Network error "+retriableError+" found, will retry."),!0}if(response||err){var statusCode=response?response.status:err?err.statusCode:0;if(!isPrimaryRetry&&404===statusCode)return this.logf(exports.HttpPipelineLogLevel.INFO,"RetryPolicy: Secondary access with 404, will retry."),!0;if(503===statusCode||500===statusCode)return this.logf(exports.HttpPipelineLogLevel.INFO,"RetryPolicy: Will retry for status code "+statusCode+"."),!0}return!1},RetryPolicy.prototype.logf=function(_level,_message){},RetryPolicy.prototype.delay=function(isPrimaryRetry,attempt){return __awaiter(this,void 0,void 0,function(){var delayTimeInMs;return __generator(this,function(_a){if(delayTimeInMs=0,isPrimaryRetry)switch(this.retryOptions.retryPolicyType){case RetryPolicyType.EXPONENTIAL:delayTimeInMs=Math.min((Math.pow(2,attempt-1)-1)*this.retryOptions.retryDelayInMs,this.retryOptions.maxRetryDelayInMs);break;case RetryPolicyType.FIXED:delayTimeInMs=this.retryOptions.retryDelayInMs}else delayTimeInMs=1e3*Math.random();return this.logf(exports.HttpPipelineLogLevel.INFO,"RetryPolicy: Delay for "+delayTimeInMs+"ms"),[2,delay$1(delayTimeInMs)]})})},RetryPolicy}(BaseRequestPolicy),RetryPolicyFactory=function(){function RetryPolicyFactory(retryOptions){this.retryOptions=retryOptions}return RetryPolicyFactory.prototype.create=function(nextPolicy,options){return new RetryPolicy(nextPolicy,options,this.retryOptions)},RetryPolicyFactory}(),TelemetryPolicy=function(_super){function TelemetryPolicy(nextPolicy,options,telemetry){var _this=_super.call(this,nextPolicy,options)||this;return _this.telemetry=telemetry,_this}return __extends(TelemetryPolicy,_super),TelemetryPolicy.prototype.sendRequest=function(request){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this._nextPolicy.sendRequest(request)]})})},TelemetryPolicy}(BaseRequestPolicy),TelemetryPolicyFactory=function(){function TelemetryPolicyFactory(telemetry){this.telemetryString=[].join(" ")}return TelemetryPolicyFactory.prototype.create=function(nextPolicy,options){return new TelemetryPolicy(nextPolicy,options,this.telemetryString)},TelemetryPolicyFactory}(),UniqueRequestIDPolicy=function(_super){function UniqueRequestIDPolicy(nextPolicy,options){return _super.call(this,nextPolicy,options)||this}return __extends(UniqueRequestIDPolicy,_super),UniqueRequestIDPolicy.prototype.sendRequest=function(request){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return request.headers.contains(HeaderConstants$2_X_MS_CLIENT_REQUEST_ID)||request.headers.set(HeaderConstants$2_X_MS_CLIENT_REQUEST_ID,generateUuid()),[2,this._nextPolicy.sendRequest(request)]})})},UniqueRequestIDPolicy}(BaseRequestPolicy),UniqueRequestIDPolicyFactory=function(){function UniqueRequestIDPolicyFactory(){}return UniqueRequestIDPolicyFactory.prototype.create=function(nextPolicy,options){return new UniqueRequestIDPolicy(nextPolicy,options)},UniqueRequestIDPolicyFactory}(),StorageURL=function(){function StorageURL(url,pipeline){this.url=escapeURLPath(url),this.pipeline=pipeline,this.storageClientContext=new StorageClientContext(this.url,pipeline.toServiceClientOptions()),this.storageClientContext.requestContentType=void 0}return StorageURL.newPipeline=function(credential,pipelineOptions){void 0===pipelineOptions&&(pipelineOptions={});var factories=[new TelemetryPolicyFactory(pipelineOptions.telemetry),new UniqueRequestIDPolicyFactory,new BrowserPolicyFactory,deserializationPolicy(),new RetryPolicyFactory(pipelineOptions.retryOptions),new LoggingPolicyFactory,credential];return new Pipeline(factories,{HTTPClient:pipelineOptions.httpClient,logger:pipelineOptions.logger})},StorageURL}(),BlobURL=function(_super){function BlobURL(url,pipeline){var _this=_super.call(this,url,pipeline)||this;return _this.blobContext=new Blob$1(_this.storageClientContext),_this}return __extends(BlobURL,_super),BlobURL.fromContainerURL=function(containerURL,blobName){return new BlobURL(appendToURLPath(containerURL.url,encodeURIComponent(blobName)),containerURL.pipeline)},BlobURL.prototype.withPipeline=function(pipeline){return new BlobURL(this.url,pipeline)},BlobURL.prototype.withSnapshot=function(snapshot){return new BlobURL(setURLParameter(this.url,URLConstants_Parameters.SNAPSHOT,0===snapshot.length?void 0:snapshot),this.pipeline)},BlobURL.prototype.download=function(aborter,offset,count,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){var res,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return options.blobAccessConditions=options.blobAccessConditions||{},options.blobAccessConditions.modifiedAccessConditions=options.blobAccessConditions.modifiedAccessConditions||{},[4,this.blobContext.download({abortSignal:aborter,leaseAccessConditions:options.blobAccessConditions.leaseAccessConditions,modifiedAccessConditions:options.blobAccessConditions.modifiedAccessConditions,onDownloadProgress:isNode?void 0:options.progress,range:0!==offset||count?rangeToString({offset:offset,count:count}):void 0,rangeGetContentMD5:options.rangeGetContentMD5,snapshot:options.snapshot})];case 1:if(res=_a.sent(),!isNode)return[2,res];if((void 0===options.maxRetryRequests||options.maxRetryRequests<0)&&(options.maxRetryRequests=5),void 0===res.contentLength)throw new RangeError("File download response doesn't contain valid content length header");if(!res.eTag)throw new RangeError("File download response doesn't contain valid etag header");return[2,new 1(aborter,res,function(start){return __awaiter(_this,void 0,void 0,function(){var updatedOptions;return __generator(this,function(_a){switch(_a.label){case 0:return updatedOptions={leaseAccessConditions:options.blobAccessConditions.leaseAccessConditions,modifiedAccessConditions:{ifMatch:options.blobAccessConditions.modifiedAccessConditions.ifMatch||res.eTag,ifModifiedSince:options.blobAccessConditions.modifiedAccessConditions.ifModifiedSince,ifNoneMatch:options.blobAccessConditions.modifiedAccessConditions.ifNoneMatch,ifUnmodifiedSince:options.blobAccessConditions.modifiedAccessConditions.ifUnmodifiedSince},range:rangeToString({count:offset+res.contentLength-start,offset:start}),snapshot:options.snapshot},[4,this.blobContext.download(__assign({abortSignal:aborter},updatedOptions))];case 1:return[2,_a.sent().readableStreamBody]}})})},offset,res.contentLength,{maxRetryRequests:options.maxRetryRequests,progress:options.progress})]}})})},BlobURL.prototype.getProperties=function(aborter,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.blobAccessConditions=options.blobAccessConditions||{},[2,this.blobContext.getProperties({abortSignal:aborter,leaseAccessConditions:options.blobAccessConditions.leaseAccessConditions,modifiedAccessConditions:options.blobAccessConditions.modifiedAccessConditions})]})})},BlobURL.prototype.delete=function(aborter,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.blobAccessConditions=options.blobAccessConditions||{},[2,this.blobContext.deleteMethod({abortSignal:aborter,deleteSnapshots:options.deleteSnapshots,leaseAccessConditions:options.blobAccessConditions.leaseAccessConditions,modifiedAccessConditions:options.blobAccessConditions.modifiedAccessConditions})]})})},BlobURL.prototype.undelete=function(aborter){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.blobContext.undelete({abortSignal:aborter})]})})},BlobURL.prototype.setHTTPHeaders=function(aborter,blobHTTPHeaders,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.blobAccessConditions=options.blobAccessConditions||{},[2,this.blobContext.setHTTPHeaders({abortSignal:aborter,blobHTTPHeaders:blobHTTPHeaders,leaseAccessConditions:options.blobAccessConditions.leaseAccessConditions,modifiedAccessConditions:options.blobAccessConditions.modifiedAccessConditions})]})})},BlobURL.prototype.setMetadata=function(aborter,metadata,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.blobAccessConditions=options.blobAccessConditions||{},[2,this.blobContext.setMetadata({abortSignal:aborter,leaseAccessConditions:options.blobAccessConditions.leaseAccessConditions,metadata:metadata,modifiedAccessConditions:options.blobAccessConditions.modifiedAccessConditions})]})})},BlobURL.prototype.acquireLease=function(aborter,proposedLeaseId,duration,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.blobContext.acquireLease({abortSignal:aborter,duration:duration,modifiedAccessConditions:options.modifiedAccessConditions,proposedLeaseId:proposedLeaseId})]})})},BlobURL.prototype.releaseLease=function(aborter,leaseId,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.blobContext.releaseLease(leaseId,{abortSignal:aborter,modifiedAccessConditions:options.modifiedAccessConditions})]})})},BlobURL.prototype.renewLease=function(aborter,leaseId,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.blobContext.renewLease(leaseId,{abortSignal:aborter,modifiedAccessConditions:options.modifiedAccessConditions})]})})},BlobURL.prototype.changeLease=function(aborter,leaseId,proposedLeaseId,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.blobContext.changeLease(leaseId,proposedLeaseId,{abortSignal:aborter,modifiedAccessConditions:options.modifiedAccessConditions})]})})},BlobURL.prototype.breakLease=function(aborter,breakPeriod,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.blobContext.breakLease({abortSignal:aborter,breakPeriod:breakPeriod,modifiedAccessConditions:options.modifiedAccessConditions})]})})},BlobURL.prototype.createSnapshot=function(aborter,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.blobAccessConditions=options.blobAccessConditions||{},[2,this.blobContext.createSnapshot({abortSignal:aborter,leaseAccessConditions:options.blobAccessConditions.leaseAccessConditions,metadata:options.metadata,modifiedAccessConditions:options.blobAccessConditions.modifiedAccessConditions})]})})},BlobURL.prototype.startCopyFromURL=function(aborter,copySource,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.blobAccessConditions=options.blobAccessConditions||{},options.sourceModifiedAccessConditions=options.sourceModifiedAccessConditions||{},[2,this.blobContext.startCopyFromURL(copySource,{abortSignal:aborter,leaseAccessConditions:options.blobAccessConditions.leaseAccessConditions,metadata:options.metadata,modifiedAccessConditions:options.blobAccessConditions.modifiedAccessConditions,sourceModifiedAccessConditions:{sourceIfMatch:options.sourceModifiedAccessConditions.ifMatch,sourceIfModifiedSince:options.sourceModifiedAccessConditions.ifModifiedSince,sourceIfNoneMatch:options.sourceModifiedAccessConditions.ifNoneMatch,sourceIfUnmodifiedSince:options.sourceModifiedAccessConditions.ifUnmodifiedSince}})]})})},BlobURL.prototype.abortCopyFromURL=function(aborter,copyId,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.blobContext.abortCopyFromURL(copyId,{abortSignal:aborter,leaseAccessConditions:options.leaseAccessConditions})]})})},BlobURL.prototype.setTier=function(aborter,tier,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.blobContext.setTier(tier,{abortSignal:aborter,leaseAccessConditions:options.leaseAccessConditions})];case 1:return[2,_a.sent()]}})})},BlobURL}(StorageURL),AppendBlobURL=function(_super){function AppendBlobURL(url,pipeline){var _this=_super.call(this,url,pipeline)||this;return _this.appendBlobContext=new AppendBlob(_this.storageClientContext),_this}return __extends(AppendBlobURL,_super),AppendBlobURL.fromContainerURL=function(containerURL,blobName){return new AppendBlobURL(appendToURLPath(containerURL.url,encodeURIComponent(blobName)),containerURL.pipeline)},AppendBlobURL.fromBlobURL=function(blobURL){return new AppendBlobURL(blobURL.url,blobURL.pipeline)},AppendBlobURL.prototype.withPipeline=function(pipeline){return new AppendBlobURL(this.url,pipeline)},AppendBlobURL.prototype.withSnapshot=function(snapshot){return new AppendBlobURL(setURLParameter(this.url,URLConstants_Parameters.SNAPSHOT,0===snapshot.length?void 0:snapshot),this.pipeline)},AppendBlobURL.prototype.create=function(aborter,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.accessConditions=options.accessConditions||{},[2,this.appendBlobContext.create(0,{abortSignal:aborter,blobHTTPHeaders:options.blobHTTPHeaders,leaseAccessConditions:options.accessConditions.leaseAccessConditions,metadata:options.metadata,modifiedAccessConditions:options.accessConditions.modifiedAccessConditions})]})})},AppendBlobURL.prototype.appendBlock=function(aborter,body,contentLength,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.accessConditions=options.accessConditions||{},[2,this.appendBlobContext.appendBlock(body,contentLength,{abortSignal:aborter,appendPositionAccessConditions:options.accessConditions.appendPositionAccessConditions,leaseAccessConditions:options.accessConditions.leaseAccessConditions,modifiedAccessConditions:options.accessConditions.modifiedAccessConditions,onUploadProgress:options.progress,transactionalContentMD5:options.transactionalContentMD5})]})})},AppendBlobURL}(BlobURL),BlockBlobURL=function(_super){function BlockBlobURL(url,pipeline){var _this=_super.call(this,url,pipeline)||this;return _this.blockBlobContext=new BlockBlob(_this.storageClientContext),_this}return __extends(BlockBlobURL,_super),BlockBlobURL.fromContainerURL=function(containerURL,blobName){return new BlockBlobURL(appendToURLPath(containerURL.url,encodeURIComponent(blobName)),containerURL.pipeline)},BlockBlobURL.fromBlobURL=function(blobURL){return new BlockBlobURL(blobURL.url,blobURL.pipeline)},BlockBlobURL.prototype.withPipeline=function(pipeline){return new BlockBlobURL(this.url,pipeline)},BlockBlobURL.prototype.withSnapshot=function(snapshot){return new BlockBlobURL(setURLParameter(this.url,URLConstants_Parameters.SNAPSHOT,0===snapshot.length?void 0:snapshot),this.pipeline)},BlockBlobURL.prototype.upload=function(aborter,body,contentLength,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.accessConditions=options.accessConditions||{},[2,this.blockBlobContext.upload(body,contentLength,{abortSignal:aborter,blobHTTPHeaders:options.blobHTTPHeaders,leaseAccessConditions:options.accessConditions.leaseAccessConditions,metadata:options.metadata,modifiedAccessConditions:options.accessConditions.modifiedAccessConditions,onUploadProgress:options.progress})]})})},BlockBlobURL.prototype.stageBlock=function(aborter,blockId,body,contentLength,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.blockBlobContext.stageBlock(blockId,contentLength,body,{abortSignal:aborter,leaseAccessConditions:options.leaseAccessConditions,onUploadProgress:options.progress,transactionalContentMD5:options.transactionalContentMD5})]})})},BlockBlobURL.prototype.stageBlockFromURL=function(aborter,blockId,sourceURL,offset,count,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.blockBlobContext.stageBlockFromURL(blockId,0,sourceURL,{abortSignal:aborter,leaseAccessConditions:options.leaseAccessConditions,sourceContentMD5:options.sourceContentMD5,sourceRange:0!==offset||count?rangeToString({offset:offset,count:count}):void 0})]})})},BlockBlobURL.prototype.commitBlockList=function(aborter,blocks,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.accessConditions=options.accessConditions||{},[2,this.blockBlobContext.commitBlockList({latest:blocks},{abortSignal:aborter,blobHTTPHeaders:options.blobHTTPHeaders,leaseAccessConditions:options.accessConditions.leaseAccessConditions,metadata:options.metadata,modifiedAccessConditions:options.accessConditions.modifiedAccessConditions})]})})},BlockBlobURL.prototype.getBlockList=function(aborter,listType,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){var res;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.blockBlobContext.getBlockList(listType,{abortSignal:aborter,leaseAccessConditions:options.leaseAccessConditions})];case 1:return(res=_a.sent()).committedBlocks||(res.committedBlocks=[]),res.uncommittedBlocks||(res.uncommittedBlocks=[]),[2,res]}})})},BlockBlobURL}(BlobURL),ContainerURL=function(_super){function ContainerURL(url,pipeline){var _this=_super.call(this,url,pipeline)||this;return _this.containerContext=new Container(_this.storageClientContext),_this}return __extends(ContainerURL,_super),ContainerURL.fromServiceURL=function(serviceURL,containerName){return new ContainerURL(appendToURLPath(serviceURL.url,encodeURIComponent(containerName)),serviceURL.pipeline)},ContainerURL.prototype.withPipeline=function(pipeline){return new ContainerURL(this.url,pipeline)},ContainerURL.prototype.create=function(aborter,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.containerContext.create(__assign({},options,{abortSignal:aborter}))]})})},ContainerURL.prototype.getProperties=function(aborter,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.leaseAccessConditions||(options.leaseAccessConditions={}),[2,this.containerContext.getProperties(__assign({abortSignal:aborter},options.leaseAccessConditions))]})})},ContainerURL.prototype.delete=function(aborter,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(options.containerAccessConditions||(options.containerAccessConditions={}),options.containerAccessConditions.modifiedAccessConditions||(options.containerAccessConditions.modifiedAccessConditions={}),options.containerAccessConditions.leaseAccessConditions||(options.containerAccessConditions.leaseAccessConditions={}),options.containerAccessConditions.modifiedAccessConditions.ifMatch&&""!==options.containerAccessConditions.modifiedAccessConditions.ifMatch||options.containerAccessConditions.modifiedAccessConditions.ifNoneMatch&&""!==options.containerAccessConditions.modifiedAccessConditions.ifNoneMatch)throw new RangeError("the IfMatch and IfNoneMatch access conditions must have their default        values because they are ignored by the service");return[2,this.containerContext.deleteMethod({abortSignal:aborter,leaseAccessConditions:options.containerAccessConditions.leaseAccessConditions,modifiedAccessConditions:options.containerAccessConditions.modifiedAccessConditions})]})})},ContainerURL.prototype.setMetadata=function(aborter,metadata,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){if(options.containerAccessConditions||(options.containerAccessConditions={}),options.containerAccessConditions.modifiedAccessConditions||(options.containerAccessConditions.modifiedAccessConditions={}),options.containerAccessConditions.leaseAccessConditions||(options.containerAccessConditions.leaseAccessConditions={}),options.containerAccessConditions.modifiedAccessConditions.ifUnmodifiedSince||options.containerAccessConditions.modifiedAccessConditions.ifMatch&&""!==options.containerAccessConditions.modifiedAccessConditions.ifMatch||options.containerAccessConditions.modifiedAccessConditions.ifNoneMatch&&""!==options.containerAccessConditions.modifiedAccessConditions.ifNoneMatch)throw new RangeError("the IfUnmodifiedSince, IfMatch, and IfNoneMatch must have their default values        because they are ignored by the blob service");return[2,this.containerContext.setMetadata({abortSignal:aborter,leaseAccessConditions:options.containerAccessConditions.leaseAccessConditions,metadata:metadata,modifiedAccessConditions:options.containerAccessConditions.modifiedAccessConditions})]})})},ContainerURL.prototype.getAccessPolicy=function(aborter,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){var response,res,_i,response_1,identifier;return __generator(this,function(_a){switch(_a.label){case 0:return options.leaseAccessConditions||(options.leaseAccessConditions={}),[4,this.containerContext.getAccessPolicy({abortSignal:aborter,leaseAccessConditions:options.leaseAccessConditions})];case 1:for(response=_a.sent(),res={_response:response._response,blobPublicAccess:response.blobPublicAccess,date:response.date,eTag:response.eTag,errorCode:response.errorCode,lastModified:response.lastModified,requestId:response.requestId,signedIdentifiers:[],version:response.version},_i=0,response_1=response;_i<response_1.length;_i++)identifier=response_1[_i],res.signedIdentifiers.push({accessPolicy:{expiry:new Date(identifier.accessPolicy.expiry),permission:identifier.accessPolicy.permission,start:new Date(identifier.accessPolicy.start)},id:identifier.id});return[2,res]}})})},ContainerURL.prototype.setAccessPolicy=function(aborter,access,containerAcl,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){var acl,_i,_a,identifier;return __generator(this,function(_b){for(options.containerAccessConditions=options.containerAccessConditions||{},acl=[],_i=0,_a=containerAcl||[];_i<_a.length;_i++)identifier=_a[_i],acl.push({accessPolicy:{expiry:truncatedISO8061Date(identifier.accessPolicy.expiry),permission:identifier.accessPolicy.permission,start:truncatedISO8061Date(identifier.accessPolicy.start)},id:identifier.id});return[2,this.containerContext.setAccessPolicy({abortSignal:aborter,access:access,containerAcl:acl,leaseAccessConditions:options.containerAccessConditions.leaseAccessConditions,modifiedAccessConditions:options.containerAccessConditions.modifiedAccessConditions})]})})},ContainerURL.prototype.acquireLease=function(aborter,proposedLeaseId,duration,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.containerContext.acquireLease({abortSignal:aborter,duration:duration,modifiedAccessConditions:options.modifiedAccessConditions,proposedLeaseId:proposedLeaseId})]})})},ContainerURL.prototype.releaseLease=function(aborter,leaseId,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.containerContext.releaseLease(leaseId,{abortSignal:aborter,modifiedAccessConditions:options.modifiedAccessConditions})]})})},ContainerURL.prototype.renewLease=function(aborter,leaseId,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.containerContext.renewLease(leaseId,{abortSignal:aborter,modifiedAccessConditions:options.modifiedAccessConditions})]})})},ContainerURL.prototype.breakLease=function(aborter,period,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.containerContext.breakLease({abortSignal:aborter,breakPeriod:period,modifiedAccessConditions:options.modifiedAccessConditions})]})})},ContainerURL.prototype.changeLease=function(aborter,leaseId,proposedLeaseId,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.containerContext.changeLease(leaseId,proposedLeaseId,{abortSignal:aborter,modifiedAccessConditions:options.modifiedAccessConditions})]})})},ContainerURL.prototype.listBlobFlatSegment=function(aborter,marker,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.containerContext.listBlobFlatSegment(__assign({abortSignal:aborter,marker:marker},options))]})})},ContainerURL.prototype.listBlobHierarchySegment=function(aborter,delimiter,marker,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.containerContext.listBlobHierarchySegment(delimiter,__assign({abortSignal:aborter,marker:marker},options))]})})},ContainerURL}(StorageURL),CredentialPolicy=function(_super){function CredentialPolicy(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(CredentialPolicy,_super),CredentialPolicy.prototype.sendRequest=function(request){return this._nextPolicy.sendRequest(this.signRequest(request))},CredentialPolicy.prototype.signRequest=function(request){return request},CredentialPolicy}(BaseRequestPolicy),AnonymousCredentialPolicy=function(_super){function AnonymousCredentialPolicy(nextPolicy,options){return _super.call(this,nextPolicy,options)||this}return __extends(AnonymousCredentialPolicy,_super),AnonymousCredentialPolicy}(CredentialPolicy),Credential=function(){function Credential(){}return Credential.prototype.create=function(_nextPolicy,_options){throw new Error("Method should be implemented in children classes.")},Credential}(),AnonymousCredential=function(_super){function AnonymousCredential(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(AnonymousCredential,_super),AnonymousCredential.prototype.create=function(nextPolicy,options){return new AnonymousCredentialPolicy(nextPolicy,options)},AnonymousCredential}(Credential),TokenCredentialPolicy=function(_super){function TokenCredentialPolicy(nextPolicy,options,tokenCredential){var _this=_super.call(this,nextPolicy,options)||this;return _this.tokenCredential=tokenCredential,_this.authorizationScheme=HeaderConstants$2_AUTHORIZATION_SCHEME,_this}return __extends(TokenCredentialPolicy,_super),TokenCredentialPolicy.prototype.signRequest=function(request){return request.headers||(request.headers=new HttpHeaders),request.headers.set(HeaderConstants$2_AUTHORIZATION,this.authorizationScheme+" "+this.tokenCredential.token),request},TokenCredentialPolicy}(CredentialPolicy),TokenCredential=function(_super){function TokenCredential(token){var _this=_super.call(this)||this;return _this.token=token,_this}return __extends(TokenCredential,_super),TokenCredential.prototype.create=function(nextPolicy,options){return new TokenCredentialPolicy(nextPolicy,options,this)},TokenCredential}(Credential),R="object"==typeof Reflect?Reflect:null,ReflectApply=R&&"function"==typeof R.apply?R.apply:function ReflectApply(target,receiver,args){return Function.prototype.apply.call(target,receiver,args)};ReflectOwnKeys=R&&"function"==typeof R.ownKeys?R.ownKeys:Object.getOwnPropertySymbols?function ReflectOwnKeys(target){return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))}:function ReflectOwnKeys(target){return Object.getOwnPropertyNames(target)};var NumberIsNaN=Number.isNaN||function NumberIsNaN(value){return value!=value};function EventEmitter(){EventEmitter.init.call(this)}var events=EventEmitter;EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var defaultMaxListeners=10;function $getMaxListeners(that){return void 0===that._maxListeners?EventEmitter.defaultMaxListeners:that._maxListeners}function _addListener(target,type,listener,prepend){var m,events,existing;if("function"!=typeof listener)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof listener);if(void 0===(events=target._events)?(events=target._events=Object.create(null),target._eventsCount=0):(void 0!==events.newListener&&(target.emit("newListener",type,listener.listener?listener.listener:listener),events=target._events),existing=events[type]),void 0===existing)existing=events[type]=listener,++target._eventsCount;else if("function"==typeof existing?existing=events[type]=prepend?[listener,existing]:[existing,listener]:prepend?existing.unshift(listener):existing.push(listener),(m=$getMaxListeners(target))>0&&existing.length>m&&!existing.warned){existing.warned=!0;var w=new Error("Possible EventEmitter memory leak detected. "+existing.length+" "+String(type)+" listeners added. Use emitter.setMaxListeners() to increase limit");w.name="MaxListenersExceededWarning",w.emitter=target,w.type=type,w.count=existing.length,function ProcessEmitWarning(warning){console&&console.warn&&console.warn(warning)}(w)}return target}function onceWrapper(){for(var args=[],i=0;i<arguments.length;i++)args.push(arguments[i]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,ReflectApply(this.listener,this.target,args))}function _onceWrap(target,type,listener){var state={fired:!1,wrapFn:void 0,target:target,type:type,listener:listener},wrapped=onceWrapper.bind(state);return wrapped.listener=listener,state.wrapFn=wrapped,wrapped}function _listeners(target,type,unwrap){var events=target._events;if(void 0===events)return[];var evlistener=events[type];return void 0===evlistener?[]:"function"==typeof evlistener?unwrap?[evlistener.listener||evlistener]:[evlistener]:unwrap?function unwrapListeners(arr){for(var ret=new Array(arr.length),i=0;i<ret.length;++i)ret[i]=arr[i].listener||arr[i];return ret}(evlistener):arrayClone(evlistener,evlistener.length)}function listenerCount(type){var events=this._events;if(void 0!==events){var evlistener=events[type];if("function"==typeof evlistener)return 1;if(void 0!==evlistener)return evlistener.length}return 0}function arrayClone(arr,n){for(var copy=new Array(n),i=0;i<n;++i)copy[i]=arr[i];return copy}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(arg){if("number"!=typeof arg||arg<0||NumberIsNaN(arg))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+arg+".");defaultMaxListeners=arg}}),EventEmitter.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function setMaxListeners(n){if("number"!=typeof n||n<0||NumberIsNaN(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this},EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return $getMaxListeners(this)},EventEmitter.prototype.emit=function emit(type){for(var args=[],i=1;i<arguments.length;i++)args.push(arguments[i]);var doError="error"===type,events=this._events;if(void 0!==events)doError=doError&&void 0===events.error;else if(!doError)return!1;if(doError){var er;if(args.length>0&&(er=args[0]),er instanceof Error)throw er;var err=new Error("Unhandled error."+(er?" ("+er.message+")":""));throw err.context=er,err}var handler=events[type];if(void 0===handler)return!1;if("function"==typeof handler)ReflectApply(handler,this,args);else{var len=handler.length,listeners=arrayClone(handler,len);for(i=0;i<len;++i)ReflectApply(listeners[i],this,args)}return!0},EventEmitter.prototype.addListener=function addListener(type,listener){return _addListener(this,type,listener,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function prependListener(type,listener){return _addListener(this,type,listener,!0)},EventEmitter.prototype.once=function once(type,listener){if("function"!=typeof listener)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof listener);return this.on(type,_onceWrap(this,type,listener)),this},EventEmitter.prototype.prependOnceListener=function prependOnceListener(type,listener){if("function"!=typeof listener)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof listener);return this.prependListener(type,_onceWrap(this,type,listener)),this},EventEmitter.prototype.removeListener=function removeListener(type,listener){var list,events,position,i,originalListener;if("function"!=typeof listener)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof listener);if(void 0===(events=this._events))return this;if(void 0===(list=events[type]))return this;if(list===listener||list.listener===listener)0===--this._eventsCount?this._events=Object.create(null):(delete events[type],events.removeListener&&this.emit("removeListener",type,list.listener||listener));else if("function"!=typeof list){for(position=-1,i=list.length-1;i>=0;i--)if(list[i]===listener||list[i].listener===listener){originalListener=list[i].listener,position=i;break}if(position<0)return this;0===position?list.shift():function spliceOne(list,index){for(;index+1<list.length;index++)list[index]=list[index+1];list.pop()}(list,position),1===list.length&&(events[type]=list[0]),void 0!==events.removeListener&&this.emit("removeListener",type,originalListener||listener)}return this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.removeAllListeners=function removeAllListeners(type){var listeners,events,i;if(void 0===(events=this._events))return this;if(void 0===events.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==events[type]&&(0===--this._eventsCount?this._events=Object.create(null):delete events[type]),this;if(0===arguments.length){var key,keys=Object.keys(events);for(i=0;i<keys.length;++i)"removeListener"!==(key=keys[i])&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(listeners=events[type]))this.removeListener(type,listeners);else if(void 0!==listeners)for(i=listeners.length-1;i>=0;i--)this.removeListener(type,listeners[i]);return this},EventEmitter.prototype.listeners=function listeners(type){return _listeners(this,type,!0)},EventEmitter.prototype.rawListeners=function rawListeners(type){return _listeners(this,type,!1)},EventEmitter.listenerCount=function(emitter,type){return"function"==typeof emitter.listenerCount?emitter.listenerCount(type):listenerCount.call(emitter,type)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};var BatchStates,events_1=events.EventEmitter;!function(BatchStates){BatchStates[BatchStates.Good=0]="Good",BatchStates[BatchStates.Error=1]="Error"}(BatchStates||(BatchStates={}));var Batch=function(){function Batch(concurrency){if(void 0===concurrency&&(concurrency=5),this.actives=0,this.completed=0,this.offset=0,this.operations=[],this.state=BatchStates.Good,concurrency<1)throw new RangeError("concurrency must be larger than 0");this.concurrency=concurrency,this.emitter=new events_1}return Batch.prototype.addOperation=function(operation){var _this=this;this.operations.push(function(){return __awaiter(_this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),this.actives++,[4,operation()];case 1:return _a.sent(),this.actives--,this.completed++,this.parallelExecute(),[3,3];case 2:return error_1=_a.sent(),this.emitter.emit("error",error_1),[3,3];case 3:return[2]}})})})},Batch.prototype.do=function(){return __awaiter(this,void 0,void 0,function(){var _this=this;return __generator(this,function(_a){return this.parallelExecute(),[2,new Promise(function(resolve,reject){_this.emitter.on("finish",resolve),_this.emitter.on("error",function(error){_this.state=BatchStates.Error,reject(error)})})]})})},Batch.prototype.nextOperation=function(){return this.offset<this.operations.length?this.operations[this.offset++]:null},Batch.prototype.parallelExecute=function(){if(this.state!==BatchStates.Error)if(this.completed>=this.operations.length)this.emitter.emit("finish");else for(;this.actives<this.concurrency;){var operation=this.nextOperation();if(!operation)return;operation()}},Batch}();function UploadSeekableBlobToBlockBlob(aborter,blobFactory,size,blockBlobURL,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){var numBlocks,blockList,blockIDPrefix,transferProgress,batch,_loop_1,i,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:if(options.blockSize||(options.blockSize=0),options.blockSize<0||options.blockSize>104857600)throw new RangeError("blockSize option must be >= 0 and <= 104857600");if(0===options.maxSingleShotSize||options.maxSingleShotSize||(options.maxSingleShotSize=268435456),options.maxSingleShotSize<0||options.maxSingleShotSize>268435456)throw new RangeError("maxSingleShotSize option must be >= 0 and <= 268435456");if(0===options.blockSize){if(size>524288e7)throw new RangeError(size+" is too larger to upload to a block blob.");size>options.maxSingleShotSize&&(options.blockSize=Math.ceil(size/5e4),options.blockSize<4194304&&(options.blockSize=4194304))}if(options.blobHTTPHeaders||(options.blobHTTPHeaders={}),options.blobAccessConditions||(options.blobAccessConditions={}),size<=options.maxSingleShotSize)return[2,blockBlobURL.upload(aborter,blobFactory(0,size),size,options)];if((numBlocks=Math.floor((size-1)/options.blockSize)+1)>5e4)throw new RangeError("The buffer's size is too big or the BlockSize is too small;the number of blocks must be <= 50000");for(blockList=[],blockIDPrefix=generateUuid(),transferProgress=0,batch=new Batch(options.parallelism),_loop_1=function(i){batch.addOperation(function(){return __awaiter(_this,void 0,void 0,function(){var blockID,start,end,contentLength;return __generator(this,function(_a){switch(_a.label){case 0:return blockID=generateBlockID(blockIDPrefix,i),start=options.blockSize*i,end=i===numBlocks-1?size:start+options.blockSize,contentLength=end-start,blockList.push(blockID),[4,blockBlobURL.stageBlock(aborter,blockID,blobFactory(start,contentLength),contentLength,{leaseAccessConditions:options.blobAccessConditions.leaseAccessConditions})];case 1:return _a.sent(),transferProgress+=contentLength,options.progress&&options.progress({loadedBytes:transferProgress}),[2]}})})})},i=0;i<numBlocks;i++)_loop_1(i);return[4,batch.do()];case 1:return _a.sent(),[2,blockBlobURL.commitBlockList(aborter,blockList,options)]}})})}var PageBlobURL=function(_super){function PageBlobURL(url,pipeline){var _this=_super.call(this,url,pipeline)||this;return _this.pageBlobContext=new PageBlob(_this.storageClientContext),_this}return __extends(PageBlobURL,_super),PageBlobURL.fromContainerURL=function(containerURL,blobName){return new PageBlobURL(appendToURLPath(containerURL.url,encodeURIComponent(blobName)),containerURL.pipeline)},PageBlobURL.fromBlobURL=function(blobURL){return new PageBlobURL(blobURL.url,blobURL.pipeline)},PageBlobURL.prototype.withPipeline=function(pipeline){return new PageBlobURL(this.url,pipeline)},PageBlobURL.prototype.withSnapshot=function(snapshot){return new PageBlobURL(setURLParameter(this.url,URLConstants_Parameters.SNAPSHOT,0===snapshot.length?void 0:snapshot),this.pipeline)},PageBlobURL.prototype.create=function(aborter,size,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.accessConditions=options.accessConditions||{},[2,this.pageBlobContext.create(0,size,{abortSignal:aborter,blobHTTPHeaders:options.blobHTTPHeaders,blobSequenceNumber:options.blobSequenceNumber,leaseAccessConditions:options.accessConditions.leaseAccessConditions,metadata:options.metadata,modifiedAccessConditions:options.accessConditions.modifiedAccessConditions})]})})},PageBlobURL.prototype.uploadPages=function(aborter,body,offset,count,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.accessConditions=options.accessConditions||{},[2,this.pageBlobContext.uploadPages(body,count,{abortSignal:aborter,leaseAccessConditions:options.accessConditions.leaseAccessConditions,modifiedAccessConditions:options.accessConditions.modifiedAccessConditions,onUploadProgress:options.progress,range:rangeToString({offset:offset,count:count}),sequenceNumberAccessConditions:options.accessConditions.sequenceNumberAccessConditions,transactionalContentMD5:options.transactionalContentMD5})]})})},PageBlobURL.prototype.clearPages=function(aborter,offset,count,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.accessConditions=options.accessConditions||{},[2,this.pageBlobContext.clearPages(0,{abortSignal:aborter,leaseAccessConditions:options.accessConditions.leaseAccessConditions,modifiedAccessConditions:options.accessConditions.modifiedAccessConditions,range:rangeToString({offset:offset,count:count}),sequenceNumberAccessConditions:options.accessConditions.sequenceNumberAccessConditions})]})})},PageBlobURL.prototype.getPageRanges=function(aborter,offset,count,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.accessConditions=options.accessConditions||{},[2,this.pageBlobContext.getPageRanges({abortSignal:aborter,leaseAccessConditions:options.accessConditions.leaseAccessConditions,modifiedAccessConditions:options.accessConditions.modifiedAccessConditions,range:rangeToString({offset:offset,count:count})})]})})},PageBlobURL.prototype.getPageRangesDiff=function(aborter,offset,count,prevSnapshot,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.accessConditions=options.accessConditions||{},[2,this.pageBlobContext.getPageRangesDiff({abortSignal:aborter,leaseAccessConditions:options.accessConditions.leaseAccessConditions,modifiedAccessConditions:options.accessConditions.modifiedAccessConditions,prevsnapshot:prevSnapshot,range:rangeToString({offset:offset,count:count})})]})})},PageBlobURL.prototype.resize=function(aborter,size,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.accessConditions=options.accessConditions||{},[2,this.pageBlobContext.resize(size,{abortSignal:aborter,leaseAccessConditions:options.accessConditions.leaseAccessConditions,modifiedAccessConditions:options.accessConditions.modifiedAccessConditions})]})})},PageBlobURL.prototype.updateSequenceNumber=function(aborter,sequenceNumberAction,sequenceNumber,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return options.accessConditions=options.accessConditions||{},[2,this.pageBlobContext.updateSequenceNumber(sequenceNumberAction,{abortSignal:aborter,blobSequenceNumber:sequenceNumber,leaseAccessConditions:options.accessConditions.leaseAccessConditions,modifiedAccessConditions:options.accessConditions.modifiedAccessConditions})]})})},PageBlobURL.prototype.startCopyIncremental=function(aborter,copySource,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.pageBlobContext.copyIncremental(copySource,{abortSignal:aborter,modifiedAccessConditions:options.modifiedAccessConditions})]})})},PageBlobURL}(BlobURL),ServiceURL=function(_super){function ServiceURL(url,pipeline){var _this=_super.call(this,url,pipeline)||this;return _this.serviceContext=new Service(_this.storageClientContext),_this}return __extends(ServiceURL,_super),ServiceURL.prototype.withPipeline=function(pipeline){return new ServiceURL(this.url,pipeline)},ServiceURL.prototype.getProperties=function(aborter){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.serviceContext.getProperties({abortSignal:aborter})]})})},ServiceURL.prototype.setProperties=function(aborter,properties){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.serviceContext.setProperties(properties,{abortSignal:aborter})]})})},ServiceURL.prototype.getStatistics=function(aborter){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.serviceContext.getStatistics({abortSignal:aborter})]})})},ServiceURL.prototype.getAccountInfo=function(aborter){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.serviceContext.getAccountInfo({abortSignal:aborter})]})})},ServiceURL.prototype.listContainersSegment=function(aborter,marker,options){return void 0===options&&(options={}),__awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.serviceContext.listContainersSegment(__assign({abortSignal:aborter,marker:marker},options))]})})},ServiceURL}(StorageURL);exports.Models=index,exports.RestError=RestError,exports.Aborter=Aborter,exports.AppendBlobURL=AppendBlobURL,exports.BlobURL=BlobURL,exports.BlockBlobURL=BlockBlobURL,exports.BrowserPolicyFactory=BrowserPolicyFactory,exports.ContainerURL=ContainerURL,exports.AnonymousCredential=AnonymousCredential,exports.Credential=Credential,exports.TokenCredential=TokenCredential,exports.uploadBrowserDataToBlockBlob=function uploadBrowserDataToBlockBlob(aborter,browserData,blockBlobURL,options){return __awaiter(this,void 0,void 0,function(){var browserBlob;return __generator(this,function(_a){return browserBlob=new Blob([browserData]),[2,UploadSeekableBlobToBlockBlob(aborter,function(offset,size){return browserBlob.slice(offset,offset+size)},browserBlob.size,blockBlobURL,options)]})})},exports.PageBlobURL=PageBlobURL,exports.HttpHeaders=HttpHeaders,exports.WebResource=WebResource,exports.BaseRequestPolicy=BaseRequestPolicy,exports.RequestPolicyOptions=RequestPolicyOptions,exports.Pipeline=Pipeline,exports.AnonymousCredentialPolicy=AnonymousCredentialPolicy,exports.CredentialPolicy=CredentialPolicy,exports.RetryPolicyFactory=RetryPolicyFactory,exports.LoggingPolicyFactory=LoggingPolicyFactory,exports.TelemetryPolicyFactory=TelemetryPolicyFactory,exports.TokenCredentialPolicy=TokenCredentialPolicy,exports.UniqueRequestIDPolicyFactory=UniqueRequestIDPolicyFactory,exports.ServiceURL=ServiceURL,exports.deserializationPolicy=deserializationPolicy,exports.StorageURL=StorageURL,Object.defineProperty(exports,"__esModule",{value:!0})}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).markerjs2={})}(this,function(t){"use strict";
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,i)};function i(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}function o(t,e,i,o){return new(i||(i=Promise))(function(s,r){function n(t){try{h(o.next(t))}catch(t){r(t)}}function a(t){try{h(o.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(n,a)}h((o=o.apply(t,e||[])).next())})}function s(t,e){var i,o,s,r,n={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,o&&(s=2&r[0]?o.return:r[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,r[1])).done)return s;switch(o=0,s&&(r=[2&r[0],s.value]),r[0]){case 0:case 1:s=r;break;case 4:return n.label++,{value:r[1],done:!1};case 5:n.label++,o=r[1],r=[0];continue;case 7:r=n.ops.pop(),n.trys.pop();continue;default:if(!((s=(s=n.trys).length>0&&s[s.length-1])||6!==r[0]&&2!==r[0])){n=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){n.label=r[1];break}if(6===r[0]&&n.label<s[1]){n.label=s[1],s=r;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(r);break}s[2]&&n.ops.pop(),n.trys.pop();continue}r=e.call(t,n)}catch(t){r=[6,t],o=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function r(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var o=Array(t),s=0;for(e=0;e<i;e++)for(var r=arguments[e],n=0,a=r.length;n<a;n++,s++)o[s]=r[n];return o}var n=function(){function t(){}return t.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},t.setAttributes=function(t,e){for(var i=0,o=e;i<o.length;i++){var s=o[i],r=s[0],n=s[1];t.setAttribute(r,n)}},t.createRect=function(e,i,o){var s=document.createElementNS("http://www.w3.org/2000/svg","rect");return s.setAttribute("width",e.toString()),s.setAttribute("height",i.toString()),o&&t.setAttributes(s,o),s},t.createLine=function(e,i,o,s,r){var n=document.createElementNS("http://www.w3.org/2000/svg","line");return n.setAttribute("x1",e.toString()),n.setAttribute("y1",i.toString()),n.setAttribute("x2",o.toString()),n.setAttribute("y2",s.toString()),r&&t.setAttributes(n,r),n},t.createPolygon=function(e,i){var o=document.createElementNS("http://www.w3.org/2000/svg","polygon");return o.setAttribute("points",e),i&&t.setAttributes(o,i),o},t.createCircle=function(e,i){var o=document.createElementNS("http://www.w3.org/2000/svg","circle");return o.setAttribute("cx",(e/2).toString()),o.setAttribute("cy",(e/2).toString()),o.setAttribute("r",e.toString()),i&&t.setAttributes(o,i),o},t.createEllipse=function(e,i,o){var s=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return s.setAttribute("cx",(e/2).toString()),s.setAttribute("cy",(i/2).toString()),s.setAttribute("rx",(e/2).toString()),s.setAttribute("ry",(i/2).toString()),o&&t.setAttributes(s,o),s},t.createGroup=function(e){var i=document.createElementNS("http://www.w3.org/2000/svg","g");return e&&t.setAttributes(i,e),i},t.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},t.createMarker=function(e,i,o,s,r,n,a){var h=document.createElementNS("http://www.w3.org/2000/svg","marker");return t.setAttributes(h,[["id",e],["orient",i],["markerWidth",o.toString()],["markerHeight",s.toString()],["refX",r.toString()],["refY",n.toString()]]),h.appendChild(a),h},t.createText=function(e){var i=document.createElementNS("http://www.w3.org/2000/svg","text");return i.setAttribute("x","0"),i.setAttribute("y","0"),e&&t.setAttributes(i,e),i},t.createTSpan=function(e,i){var o=document.createElementNS("http://www.w3.org/2000/svg","tspan");return o.textContent=e,i&&t.setAttributes(o,i),o},t.createImage=function(e){var i=document.createElementNS("http://www.w3.org/2000/svg","image");return e&&t.setAttributes(i,e),i},t.createPoint=function(t,e){var i=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return i.x=t,i.y=e,i},t.createPath=function(e,i){var o=document.createElementNS("http://www.w3.org/2000/svg","path");return o.setAttribute("d",e),i&&t.setAttributes(o,i),o},t}(),a=function(){function t(){}return t.addKey=function(e){t.key=e},Object.defineProperty(t,"isLicensed",{get:function(){return!!t.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(t.key)},enumerable:!1,configurable:!0}),t}(),h=function(){function t(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return t.prototype.rasterize=function(t,e,i){var o=this;return new Promise(function(s){var r=void 0!==i?i:document.createElement("canvas");null===t&&(o.markersOnly=!0,o.naturalSize=!1);var n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.setAttribute("width",e.width.baseVal.valueAsString),n.setAttribute("height",e.height.baseVal.valueAsString),n.setAttribute("viewBox","0 0 "+e.viewBox.baseVal.width.toString()+" "+e.viewBox.baseVal.height.toString()),n.innerHTML=e.innerHTML,!0===o.naturalSize?(n.width.baseVal.value=t.naturalWidth,n.height.baseVal.value=t.naturalHeight):void 0!==o.width&&void 0!==o.height&&(n.width.baseVal.value=o.width,n.height.baseVal.value=o.height),r.width=n.width.baseVal.value,r.height=n.height.baseVal.value;var a=n.outerHTML,h=r.getContext("2d");!0!==o.markersOnly&&h.drawImage(t,0,0,r.width,r.height);var l=window.URL,p=new Image(r.width,r.height);p.setAttribute("crossOrigin","anonymous");var c=new Blob([a],{type:"image/svg+xml"}),u=l.createObjectURL(c);p.onload=function(){h.drawImage(p,0,0),l.revokeObjectURL(u);var t=r.toDataURL(o.imageType,o.imageQuality);s(t)},p.src=u})},t}(),l=function(){function t(){}return Object.defineProperty(t,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"fadeInAnimationClassName",{get:function(){return t.CLASS_PREFIX+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"fadeOutAnimationClassName",{get:function(){return t.CLASS_PREFIX+"fade_out"},enumerable:!1,configurable:!0}),t.addClass=function(e){return void 0===t.styleSheet&&t.addStyleSheet(),t.classes.push(e),t.styleSheet.sheet.insertRule("."+e.name+" {"+e.style+"}",t.styleSheet.sheet.cssRules.length),e},t.addRule=function(e){void 0===t.styleSheet&&t.addStyleSheet(),t.rules.push(e),t.styleSheet.sheet.insertRule(e.selector+" {"+e.style+"}",t.styleSheet.sheet.cssRules.length)},t.addStyleSheet=function(){var e;t.styleSheet=document.createElement("style"),(null!==(e=t.styleSheetRoot)&&void 0!==e?e:document.head).appendChild(t.styleSheet),t.addRule(new p("."+t.CLASS_PREFIX+" h3","font-family: sans-serif")),t.addRule(new p("@keyframes "+t.CLASS_PREFIX+"_fade_in_animation_frames","\n        from {\n          opacity: 0;\n        }\n        to {\n          opacity: 1;\n        }\n    ")),t.addRule(new p("@keyframes "+t.CLASS_PREFIX+"_fade_out_animation_frames","\n        from {\n          opacity: 1;\n        }\n        to {\n          opacity: 0;\n        }\n    ")),t.addClass(new c("fade_in","\n      animation-duration: 0.3s;\n      animation-name: "+t.CLASS_PREFIX+"_fade_in_animation_frames;\n    ")),t.addClass(new c("fade_out","\n      animation-duration: 0.3s;\n      animation-name: "+t.CLASS_PREFIX+"_fade_out_animation_frames;\n    "))},t.removeStyleSheet=function(){var e;t.styleSheet&&((null!==(e=t.styleSheetRoot)&&void 0!==e?e:document.head).removeChild(t.styleSheet),t.styleSheet=void 0)},t.CLASS_PREFIX="__markerjs2_",t.classes=[],t.rules=[],t.settings=t.defaultSettings,t}(),p=function(t,e){this.selector=t,this.style=e},c=function(){function t(t,e){this._localName=t,this.style=e}return Object.defineProperty(t.prototype,"name",{get:function(){return""+l.CLASS_PREFIX+this._localName},enumerable:!1,configurable:!0}),t}(),u=function(){function t(t,e,i,o){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=t,this.displayMode=e,this.markerItems=i,this.uiStyleSettings=o,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return t.prototype.show=function(t){var e=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=t,this.uiContainer.className=this.toolbarStyleClass.name+" "+l.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var i=document.createElement("div");i.className=this.toolbarBlockStyleClass.name,i.style.whiteSpace="nowrap",this.uiContainer.appendChild(i),this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(t){var i=document.createElement("div");i.className=""+e.toolbarButtonStyleClass.name,i.setAttribute("data-type-name",t.typeName),i.innerHTML=t.icon,i.addEventListener("click",function(){e.markerToolbarButtonClicked(i,t)}),e.buttons.push(i),e.markerButtons.push(i)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var o=document.createElement("div");o.className=this.toolbarBlockStyleClass.name,o.style.whiteSpace="nowrap",o.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(o),this.addActionButton(o,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(o,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},t.prototype.addButtonClickListener=function(t){this.buttonClickListeners.push(t)},t.prototype.removeButtonClickListener=function(t){this.buttonClickListeners.indexOf(t)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(t),1)},t.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},t.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var t=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var e=0;e<this.markerButtons.length;e++)e<t||e===t&&this.markerButtons.length-1===t?this.markerButtonBlock.appendChild(this.markerButtons[e]):(e===t&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[e]))}},t.prototype.overflowButtonClicked=function(){"none"!==this.markerButtonOverflowBlock.style.display?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(l.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+l.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},t.prototype.resetButtonStyles=function(){var t=this;this.buttons.forEach(function(e){e.className=e.className.replace(t.uiStyleSettings.toolbarButtonStyleColorsClassName?t.uiStyleSettings.toolbarButtonStyleColorsClassName:t.toolbarButtonStyleColorsClass.name,"").trim(),e.className=e.className.replace(t.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?t.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:t.toolbarActiveButtonStyleColorsClass.name,"").trim(),e.className+=" "+(t.uiStyleSettings.toolbarButtonStyleColorsClassName?t.uiStyleSettings.toolbarButtonStyleColorsClassName:t.toolbarButtonStyleColorsClass.name)})},t.prototype.addActionButton=function(t,e,i){var o=this,s=document.createElement("div");switch(s.className=""+this.toolbarButtonStyleClass.name,s.innerHTML=e,s.setAttribute("data-action",i),s.addEventListener("click",function(){o.actionToolbarButtonClicked(s,i)}),i){case"select":case"undo":case"redo":s.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":s.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"render":s.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":s.style.fill=this.uiStyleSettings.closeButtonColor}t.appendChild(s),this.buttons.push(s)},t.prototype.addStyles=function(){this.toolbarStyleClass=l.addClass(new c("toolbar","\n      width: 100%;\n      flex-shrink: 0;\n      display: flex;\n      flex-direction: row;\n      justify-content: space-between;      \n      height: "+this.uiStyleSettings.toolbarHeight+"px;\n      box-sizing: content-box;\n      "+("inline"===this.displayMode?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n      "+("inline"===this.displayMode?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n      overflow: hidden;\n    ")),this.toolbarStyleColorsClass=l.addClass(new c("toolbar_colors","\n      background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n      box-shadow: 0px 3px rgba(33, 33, 33, 0.1);\n    ")),this.toolbarBlockStyleClass=l.addClass(new c("toolbar-block","\n        display: inline-block;\n        box-sizing: content-box;\n    ")),this.toolbarOverflowBlockStyleClass=l.addClass(new c("toolbar-overflow-block","\n        position: absolute;\n        top: "+this.uiStyleSettings.toolbarHeight+"px;\n        max-width: "+2*this.uiStyleSettings.toolbarHeight+"px;\n        z-index: 10;\n        box-sizing: content-box;\n      ")),this.toolbarOverflowBlockStyleColorsClass=l.addClass(new c("toolbar-overflow-block_colors","\n        background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n      "));var t=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=l.addClass(new c("toolbar_button","\n      display: inline-block;\n      width: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n      height: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n      padding: "+t+"px;\n      box-sizing: content-box;\n    ")),this.toolbarButtonStyleColorsClass=l.addClass(new c("toolbar_button_colors","\n      fill: "+this.uiStyleSettings.toolbarColor+";\n    ")),this.toolbarActiveButtonStyleColorsClass=l.addClass(new c("toolbar_active_button","\n      fill: "+this.uiStyleSettings.toolbarColor+";\n      background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n    ")),l.addRule(new p("."+this.toolbarButtonStyleClass.name+" svg","\n      height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n    ")),l.addRule(new p("."+this.toolbarButtonStyleColorsClass.name+":hover","\n        background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n    "))},t.prototype.markerToolbarButtonClicked=function(t,e){this.setActiveButton(t),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(t){return t("marker",e)}),this.markerButtonOverflowBlock.style.display="none"},t.prototype.actionToolbarButtonClicked=function(t,e){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(t){return t("action",e)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},t.prototype.setActiveButton=function(t){this.resetButtonStyles(),t.className=t.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),t.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},t.prototype.setActiveMarkerButton=function(t){var e=this.markerButtons.find(function(e){return e.getAttribute("data-type-name")===t});e&&this.setActiveButton(e)},t.prototype.setCurrentMarker=function(t){var e=this;this.currentMarker=t,this.buttons.filter(function(t){return/delete|notes/.test(t.getAttribute("data-action"))}).forEach(function(t){void 0===e.currentMarker?(t.style.fillOpacity="0.4",t.style.pointerEvents="none"):(t.style.fillOpacity="1",t.style.pointerEvents="all")})},t}(),d=function(){function t(t,e,i){this.panels=[],this.panelButtons=[],this.markerjsContainer=t,this.displayMode=e,this.uiStyleSettings=i,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return t.prototype.addStyles=function(){var t;this.toolboxStyleClass=l.addClass(new c("toolbox","\n      width: 100%;\n      flex-shrink: 0;\n      display: flex;\n      flex-direction: column;\n      font-family: sans-serif;\n      "+("popup"===this.displayMode?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+"\n      box-sizing: content-box;\n      "+("popup"===this.displayMode?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+"\n      "+("inline"===this.displayMode?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n      "+("inline"===this.displayMode?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n      overflow: hidden;\n    ")),this.toolboxStyleColorsClass=l.addClass(new c("toolbox_colors","\n      color: "+this.uiStyleSettings.toolboxColor+";\n    "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=l.addClass(new c("toolbox-button-row","\n      display: flex;\n      cursor: default;\n      box-sizing: content-box;\n    ")),this.toolboxButtonRowStyleColorsClass=l.addClass(new c("toolbox-button-row_colors","\n      background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n    ")),this.toolboxPanelRowStyleClass=l.addClass(new c("toolbox-panel-row","\n      display: flex;\n      "+("inline"===this.displayMode?"position: absolute;":"")+"\n      "+("inline"===this.displayMode?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+"\n      cursor: default;\n      height: "+1.5*this.uiStyleSettings.toolbarHeight+"px;\n      "+("inline"===this.displayMode?"width: 100%;":"")+"\n      box-sizing: content-box;\n    ")),this.toolboxPanelRowStyleColorsClass=l.addClass(new c("toolbox-panel-row_colors","\n      background-color: "+(null!==(t=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==t?t:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n    ")),this.toolboxButtonStyleClass=l.addClass(new c("toolbox_button","\n      display: inline-block;\n      width: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n      height: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n      padding: "+e+"px;\n      box-sizing: content-box;\n    ")),this.toolboxButtonStyleColorsClass=l.addClass(new c("toolbox-button_colors","\n      fill: "+this.uiStyleSettings.toolbarColor+";\n    ")),this.toolboxActiveButtonStyleColorsClass=l.addClass(new c("toolbox-active-button_colors","\n      background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n      fill: "+this.uiStyleSettings.toolbarColor+";\n    ")),l.addRule(new p("."+this.toolboxButtonStyleColorsClass.name+":hover","\n        background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n    ")),l.addRule(new p("."+this.toolboxButtonStyleClass.name+" svg","\n      height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n    "))},t.prototype.show=function(t){var e;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=t,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==e?e:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},t.prototype.setPanelButtons=function(t){var e,i,o=this;this.panels=t,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==e?e:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(null!==(i=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==i?i:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(t){var e,i=document.createElement("div");i.className=o.toolboxButtonStyleClass.name+" "+(null!==(e=o.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==e?e:o.toolboxButtonStyleColorsClass.name),i.innerHTML=t.icon,i.title=t.title,i.addEventListener("click",function(){o.panelButtonClick(t)}),o.panelButtons.push(i),o.buttonRow.appendChild(i)}),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},t.prototype.panelButtonClick=function(t){var e=this,i=-1;if(t!==this.activePanel){i=this.panels.indexOf(t),this.panelRow.innerHTML="";var o=t.getUi();o.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(o),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(l.fadeOutAnimationClassName,""),this.panelRow.className+=" "+l.fadeInAnimationClassName,this.activePanel=t}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(l.fadeInAnimationClassName,""),this.panelRow.className+=" "+l.fadeOutAnimationClassName,setTimeout(function(){"inline"===e.displayMode?e.panelRow.style.display="none":e.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(t,o){var s,r;t.className=e.toolboxButtonStyleClass.name+" "+(o===i?""+(null!==(s=e.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==s?s:e.toolboxActiveButtonStyleColorsClass.name):""+(null!==(r=e.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==r?r:e.toolboxButtonStyleColorsClass.name))})},t}(),y=function(t,e){this.title=t,this.icon=e},g=function(t){function e(e,i,o,s){var r=t.call(this,e,s||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return r.colors=[],r.addTransparent=!1,r.colorBoxes=[],r.colors=i,r.currentColor=o,r.setCurrentColor=r.setCurrentColor.bind(r),r.getColorBox=r.getColorBox.bind(r),r}return i(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.whiteSpace="nowrap",this.colors.forEach(function(i){var o=t.getColorBox(i);e.appendChild(o),t.colorBoxes.push(o)}),e},e.prototype.getColorBox=function(t){var e=this,i=l.settings.toolbarHeight/4,o=l.settings.toolbarHeight-i,s=document.createElement("div");s.style.display="inline-block",s.style.boxSizing="content-box",s.style.width=o-2+"px",s.style.height=o-2+"px",s.style.padding="1px",s.style.marginRight="2px",s.style.marginBottom="2px",s.style.borderWidth="2px",s.style.borderStyle="solid",s.style.borderRadius=(o+2)/2+"px",s.style.borderColor=t===this.currentColor?l.settings.toolboxAccentColor:"transparent",s.addEventListener("click",function(){e.setCurrentColor(t,s)});var r=document.createElement("div");return r.style.display="inline-block",r.style.width=o-2+"px",r.style.height=o-2+"px",r.style.backgroundColor=t,r.style.borderRadius=o/2+"px","transparent"===t&&(r.style.fill=l.settings.toolboxAccentColor,r.innerHTML='<svg viewBox="0 0 24 24">\n        <path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />\n      </svg>'),s.appendChild(r),s},e.prototype.setCurrentColor=function(t,e){this.currentColor=t,this.colorBoxes.forEach(function(t){t.style.borderColor=t===e?l.settings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(t)},e}(y),f=function(){function t(t,e,i){this._state="new",this._isSelected=!1,this._container=t,this._overlayContainer=e,this.globalSettings=i}return Object.defineProperty(t.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!1},Object.defineProperty(t.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),t.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0},t.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1},t.prototype.pointerDown=function(t,e){},t.prototype.dblClick=function(t,e){},t.prototype.manipulate=function(t){},t.prototype.pointerUp=function(t){},t.prototype.dispose=function(){},t.prototype.addMarkerVisualToContainer=function(t){this.container.childNodes.length>0?this.container.insertBefore(t,this.container.childNodes[0]):this.container.appendChild(t)},t.prototype.getState=function(){return{typeName:t.typeName,state:this.state,notes:this.notes}},t.prototype.restoreState=function(t){this._state=t.state,this.notes=t.notes},t.prototype.scale=function(t,e){},t.prototype.colorChanged=function(t){this.onColorChanged&&this.onColorChanged(t)},t.prototype.fillColorChanged=function(t){this.onFillColorChanged&&this.onFillColorChanged(t)},t.typeName="MarkerBase",t}(),v=function(){function t(){this.findGripByVisual=this.findGripByVisual.bind(this)}return t.prototype.findGripByVisual=function(t){return this.topLeft.ownsTarget(t)?this.topLeft:this.topCenter.ownsTarget(t)?this.topCenter:this.topRight.ownsTarget(t)?this.topRight:this.centerLeft.ownsTarget(t)?this.centerLeft:this.centerRight.ownsTarget(t)?this.centerRight:this.bottomLeft.ownsTarget(t)?this.bottomLeft:this.bottomCenter.ownsTarget(t)?this.bottomCenter:this.bottomRight.ownsTarget(t)?this.bottomRight:void 0},t}(),m=function(){function t(){this.GRIP_SIZE=10,this.visual=n.createGroup(),this.visual.appendChild(n.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(n.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return t.prototype.ownsTarget=function(t){return t===this.visual||t===this.visual.childNodes[0]||t===this.visual.childNodes[1]},t}(),C=function(){function t(){}return t.toITransformMatrix=function(t){return{a:t.a,b:t.b,c:t.c,d:t.d,e:t.e,f:t.f}},t.toSVGMatrix=function(t,e){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f,t},t}(),b=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.left=0,s.top=0,s.width=0,s.height=0,s.defaultSize={x:50,y:20},s.offsetX=0,s.offsetY=0,s.rotationAngle=0,s.CB_DISTANCE=10,s.container.transform.baseVal.appendItem(n.createTransform()),s.setupControlBox(),s}return i(e,t),Object.defineProperty(e.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"visual",{get:function(){return this._visual},set:function(t){this._visual=t;var e=n.createTransform();this._visual.transform.baseVal.appendItem(e)},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!(void 0===this.controlGrips.findGripByVisual(e)&&!this.rotatorGrip.ownsTarget(e))},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"new"===this.state&&(this.left=e.x,this.top=e.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var o=this.unrotatePoint(e);if(this.manipulationStartX=o.x,this.manipulationStartY=o.y,this.offsetX=o.x-this.left,this.offsetY=o.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(i),void 0!==this.activeGrip)this._state="resize";else if(this.rotatorGrip.ownsTarget(i)){this.activeGrip=this.rotatorGrip;var s=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=s.x-this.width/2,this.top=s.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var r=this.container.transform.baseVal.getItem(0);r.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(r,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},e.prototype.pointerUp=function(e){var i=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(e),this._state="select","creating"===i&&this.onMarkerCreated&&this.onMarkerCreated(this)},e.prototype.moveVisual=function(t){this.visual.style.transform="translate("+t.x+"px, "+t.y+"px)"},e.prototype.manipulate=function(t){var e=this.unrotatePoint(t);"creating"===this.state?this.resize(t):"move"===this.state?(this.left=this.manipulationStartLeft+(e.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(e.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(e):"rotate"===this.state&&this.rotate(t)},e.prototype.resize=function(t){var e=this.manipulationStartLeft,i=this.manipulationStartWidth,o=this.manipulationStartTop,s=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:e=this.manipulationStartLeft+t.x-this.manipulationStartX,i=this.manipulationStartWidth+this.manipulationStartLeft-e;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:i=this.manipulationStartWidth+t.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:o=this.manipulationStartTop+t.y-this.manipulationStartY,s=this.manipulationStartHeight+this.manipulationStartTop-o;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:s=this.manipulationStartHeight+t.y-this.manipulationStartY}i>=0?(this.left=e,this.width=i):(this.left=e+i,this.width=-i),s>=0?(this.top=o,this.height=s):(this.top=o+s,this.height=-s),this.setSize()},e.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},e.prototype.rotate=function(t){if(Math.abs(t.x-this.centerX)>.1){var e=Math.sign(t.x-this.centerX);this.rotationAngle=180*Math.atan((t.y-this.centerY)/(t.x-this.centerX))/Math.PI+90*e,this.applyRotation()}},e.prototype.applyRotation=function(){var t=this.container.transform.baseVal.getItem(0);t.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(t,0)},e.prototype.rotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM(),i=n.createPoint(t.x,t.y);return{x:(i=i.matrixTransform(e)).x,y:i.y}},e.prototype.unrotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM();e=e.inverse();var i=n.createPoint(t.x,t.y);return{x:(i=i.matrixTransform(e)).x,y:i.y}},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=n.createGroup();var t=n.createTransform();t.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(t),this.container.appendChild(this.controlBox),this.controlRect=n.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.rotatorGripLine=n.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine),this.controlGrips=new v,this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){var t=this.controlBox.transform.baseVal.getItem(0);t.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(t,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString()),this.positionGrips()},e.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.rotatorGrip=this.createGrip(),this.positionGrips()},e.prototype.createGrip=function(){var t=new m;return t.visual.transform.baseVal.appendItem(n.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.controlGrips.topLeft.GRIP_SIZE,e=-t/2,i=e,o=(this.width+this.CB_DISTANCE)/2-t/2,s=(this.height+this.CB_DISTANCE)/2-t/2,r=this.height+this.CB_DISTANCE-t/2,n=this.width+this.CB_DISTANCE-t/2;this.positionGrip(this.controlGrips.topLeft.visual,e,i),this.positionGrip(this.controlGrips.topCenter.visual,o,i),this.positionGrip(this.controlGrips.topRight.visual,n,i),this.positionGrip(this.controlGrips.centerLeft.visual,e,s),this.positionGrip(this.controlGrips.centerRight.visual,n,s),this.positionGrip(this.controlGrips.bottomLeft.visual,e,r),this.positionGrip(this.controlGrips.bottomCenter.visual,o,r),this.positionGrip(this.controlGrips.bottomRight.visual,n,r),this.positionGrip(this.rotatorGrip.visual,o,i-3*this.CB_DISTANCE)},e.prototype.positionGrip=function(t,e,i){var o=t.transform.baseVal.getItem(0);o.setTranslate(e,i),t.transform.baseVal.replaceItem(o,0)},e.prototype.hideControlBox=function(){this.controlBox.style.display="none"},e.prototype.showControlBox=function(){this.controlBox.style.display=""},e.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:C.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:C.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.left=i.left,this.top=i.top,this.width=i.width,this.height=i.height,this.rotationAngle=i.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(C.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,i.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(C.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,i.containerTransformMatrix))},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i);var o=this.rotatePoint({x:this.left,y:this.top}),s=this.unrotatePoint({x:o.x*e,y:o.y*i});this.left=s.x,this.top=s.y,this.width=this.width*e,this.height=this.height*i,this.adjustControlBox()},e}(f),k=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.fillColor="transparent",s.strokeColor="transparent",s.strokeWidth=0,s.strokeDasharray="",s.opacity=1,s.setStrokeColor=s.setStrokeColor.bind(s),s.setFillColor=s.setFillColor.bind(s),s.setStrokeWidth=s.setStrokeWidth.bind(s),s.setStrokeDasharray=s.setStrokeDasharray.bind(s),s.createVisual=s.createVisual.bind(s),s}return i(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=n.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.setSize=function(){t.prototype.setSize.call(this),n.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&n.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t)},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&n.setAttributes(this.visual,[["fill",this.fillColor]])},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&n.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]])},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&n.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]])},e.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){var i=e;this.fillColor=i.fillColor,this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.opacity=i.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setSize()},e.title="Rectangle marker",e}(b),S=function(t){function e(e,i,o,s){var r=t.call(this,e,s||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return r.widths=[],r.widthBoxes=[],r.widths=i,r.currentWidth=o,r.setCurrentWidth=r.setCurrentWidth.bind(r),r}return i(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.widths.forEach(function(i){var o=document.createElement("div");o.style.display="flex",o.style.flexGrow="2",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.borderColor=i===t.currentWidth?l.settings.toolboxAccentColor:"transparent",o.addEventListener("click",function(){t.setCurrentWidth(i,o)}),e.appendChild(o);var s=document.createElement("div");s.innerText=i.toString(),s.style.marginRight="5px",o.appendChild(s);var r=document.createElement("div");r.style.minHeight="20px",r.style.flexGrow="2",r.style.display="flex",r.style.alignItems="center";var n=document.createElement("hr");n.style.minWidth="20px",n.style.border="0px",n.style.borderTop=i+"px solid "+l.settings.toolboxColor,n.style.flexGrow="2",r.appendChild(n),o.appendChild(r),t.widthBoxes.push(o)}),e},e.prototype.setCurrentWidth=function(t,e){this.currentWidth=t,this.widthBoxes.forEach(function(t){t.style.borderColor=t===e?l.settings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},e}(y),w=function(t){function e(e,i,o,s){var r=t.call(this,e,s||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return r.styles=[],r.styleBoxes=[],r.styles=i,r.currentStyle=o,r.setCurrentStyle=r.setCurrentStyle.bind(r),r}return i(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.styles.forEach(function(i){var o=document.createElement("div");o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.overflow="hidden",o.style.maxWidth=100/t.styles.length-5+"%",o.style.borderColor=i===t.currentStyle?l.settings.toolboxAccentColor:"transparent",o.addEventListener("click",function(){t.setCurrentStyle(i,o)}),e.appendChild(o);var s=document.createElement("div");s.style.minHeight="20px",s.style.flexGrow="2",s.style.overflow="hidden";var r='<svg width="100" height="20">\n      <line x1="0" y1="10" x2="100" y2="10" stroke="'+l.settings.toolboxColor+'" stroke-width="3" '+(""!==i?'stroke-dasharray="'+i+'"':"")+" />\n  </svg>";s.innerHTML=r,o.appendChild(s),t.styleBoxes.push(o)}),e},e.prototype.setCurrentStyle=function(t,e){this.currentStyle=t,this.styleBoxes.forEach(function(t){t.style.borderColor=t===e?l.settings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},e}(y),x=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.strokeColor=o.defaultColor,s.strokeWidth=o.defaultStrokeWidth,s.strokeDasharray=o.defaultStrokeDasharray,s.strokePanel=new g("Line color",o.defaultColorSet,o.defaultColor),s.strokePanel.onColorChanged=s.setStrokeColor,s.strokeWidthPanel=new S("Line width",o.defaultStrokeWidths,o.defaultStrokeWidth),s.strokeWidthPanel.onWidthChanged=s.setStrokeWidth,s.strokeStylePanel=new w("Line style",o.defaultStrokeDasharrays,o.defaultStrokeDasharray),s.strokeStylePanel.onStyleChanged=s.setStrokeDasharray,s}return i(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.typeName="FrameMarker",e.title="Frame marker",e.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',e}(k),M=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.defaultCalloutFillColor="#000000",this.defaultEllipseFillColor="transparent"},B=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.x1=0,s.y1=0,s.x2=0,s.y2=0,s.defaultLength=50,s.manipulationStartX=0,s.manipulationStartY=0,s.manipulationStartX1=0,s.manipulationStartY1=0,s.manipulationStartX2=0,s.manipulationStartY2=0,s.setupControlBox(),s}return i(e,t),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!(!this.grip1.ownsTarget(e)&&!this.grip2.ownsTarget(e))},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),this.manipulationStartX=e.x,this.manipulationStartY=e.y,"new"===this.state&&(this.x1=e.x,this.y1=e.y,this.x2=e.x,this.y2=e.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"new"!==this.state&&(this.select(),this.grip1.ownsTarget(i)?this.activeGrip=this.grip1:this.grip2.ownsTarget(i)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},e.prototype.pointerUp=function(e){var i=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(e),this._state="select","creating"===i&&this.onMarkerCreated&&this.onMarkerCreated(this)},e.prototype.adjustVisual=function(){},e.prototype.manipulate=function(t){"creating"===this.state?this.resize(t):"move"===this.state?(this.x1=this.manipulationStartX1+t.x-this.manipulationStartX,this.y1=this.manipulationStartY1+t.y-this.manipulationStartY,this.x2=this.manipulationStartX2+t.x-this.manipulationStartX,this.y2=this.manipulationStartY2+t.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(t)},e.prototype.resize=function(t){switch(this.activeGrip){case this.grip1:this.x1=t.x,this.y1=t.y;break;case this.grip2:case void 0:this.x2=t.x,this.y2=t.y}this.adjustVisual(),this.adjustControlBox()},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=n.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){this.positionGrips()},e.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},e.prototype.createGrip=function(){var t=new m;return t.visual.transform.baseVal.appendItem(n.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-t/2,this.y1-t/2),this.positionGrip(this.grip2.visual,this.x2-t/2,this.y2-t/2)},e.prototype.positionGrip=function(t,e,i){var o=t.transform.baseVal.getItem(0);o.setTranslate(e,i),t.transform.baseVal.replaceItem(o,0)},e.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.x1=i.x1,this.y1=i.y1,this.x2=i.x2,this.y2=i.y2},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.x1=this.x1*e,this.y1=this.y1*i,this.x2=this.x2*e,this.y2=this.y2*i,this.adjustVisual(),this.adjustControlBox()},e}(f),E=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.strokeColor="transparent",s.strokeWidth=0,s.strokeDasharray="",s.setStrokeColor=s.setStrokeColor.bind(s),s.setStrokeWidth=s.setStrokeWidth.bind(s),s.setStrokeDasharray=s.setStrokeDasharray.bind(s),s.strokeColor=o.defaultColor,s.strokeWidth=o.defaultStrokeWidth,s.strokeDasharray=o.defaultStrokeDasharray,s.strokePanel=new g("Line color",o.defaultColorSet,o.defaultColor),s.strokePanel.onColorChanged=s.setStrokeColor,s.strokeWidthPanel=new S("Line width",o.defaultStrokeWidths,o.defaultStrokeWidth),s.strokeWidthPanel.onWidthChanged=s.setStrokeWidth,s.strokeStylePanel=new w("Line style",o.defaultStrokeDasharrays,o.defaultStrokeDasharray),s.strokeStylePanel.onStyleChanged=s.setStrokeDasharray,s}return i(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorLine&&e!==this.visibleLine)},e.prototype.createVisual=function(){this.visual=n.createGroup(),this.selectorLine=n.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=n.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},e.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),n.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),n.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),n.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.createVisual(),this.adjustVisual()},e.typeName="LineMarker",e.title="Line marker",e.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',e}(B),P=function(t){function e(e,i,o,s){var r=t.call(this,e,s||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return r.fonts=[],r.fontBoxes=[],r.fonts=i,r.currentFont=o,r.setCurrentFont=r.setCurrentFont.bind(r),r}return i(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.flexGrow="2",this.fonts.forEach(function(i){var o=document.createElement("div");o.style.display="inline-block",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.overflow="hidden",o.style.maxWidth=100/t.fonts.length-5+"%",o.style.borderColor=i===t.currentFont?l.settings.toolboxAccentColor:"transparent",o.addEventListener("click",function(){t.setCurrentFont(i,o)}),e.appendChild(o);var s=document.createElement("div");s.style.display="flex",s.style.minHeight="20px",s.style.flexGrow="2",s.style.fontFamily=i,s.style.overflow="hidden";var r=document.createElement("div");r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.textOverflow="ellipsis",r.innerHTML="The quick brown fox jumps over the lazy dog",s.appendChild(r),o.appendChild(s),t.fontBoxes.push(o)}),e},e.prototype.setCurrentFont=function(t,e){this.currentFont=t,this.fontBoxes.forEach(function(t){t.style.borderColor=t===e?l.settings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},e}(y),T=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.color="transparent",s.padding=5,s.DEFAULT_TEXT="your text here",s.text=s.DEFAULT_TEXT,s.isMoved=!1,s.color=o.defaultColor,s.fontFamily=o.defaultFontFamily,s.defaultSize={x:100,y:30},s.setColor=s.setColor.bind(s),s.setFont=s.setFont.bind(s),s.renderText=s.renderText.bind(s),s.sizeText=s.sizeText.bind(s),s.textEditDivClicked=s.textEditDivClicked.bind(s),s.showTextEditor=s.showTextEditor.bind(s),s.setSize=s.setSize.bind(s),s.positionTextEditor=s.positionTextEditor.bind(s),s.colorPanel=new g("Color",o.defaultColorSet,o.defaultColor),s.colorPanel.onColorChanged=s.setColor,s.fontFamilyPanel=new P("Font",o.defaultFontFamilies,o.defaultFontFamily),s.fontFamilyPanel.onFontChanged=s.setFont,s}return i(e,t),e.prototype.ownsTarget=function(e){if(t.prototype.ownsTarget.call(this,e)||e===this.visual||e===this.textElement||e===this.bgRectangle)return!0;var i=!1;return this.textElement.childNodes.forEach(function(t){t===e&&(i=!0)}),i},e.prototype.createVisual=function(){this.visual=n.createGroup(),this.bgRectangle=n.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=n.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(n.createTransform()),this.textElement.transform.baseVal.appendItem(n.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),this.isMoved=!1,this.pointerDownPoint=e,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.renderText=function(){var t=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(e){t.textElement.appendChild(n.createTSpan(""===e.trim()?" ":e.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},e.prototype.getTextScale=function(){var t=this.textElement.getBBox(),e=1;if(t.width>0&&t.height>0){var i=(1*this.width-this.width*this.padding*2/100)/t.width,o=(1*this.height-this.height*this.padding*2/100)/t.height;e=Math.min(i,o)}return e},e.prototype.getTextPosition=function(t){var e=this.textElement.getBBox(),i=0,o=0;return e.width>0&&e.height>0&&(i=(this.width-e.width*t)/2,o=this.height/2-e.height*t/2),{x:i,y:o}},e.prototype.sizeText=function(){var t=this.textElement.getBBox(),e=this.getTextScale(),i=this.getTextPosition(e);i.y-=t.y*e,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+i.x+"px, "+i.y+"px) scale("+e+", "+e+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(i.x,i.y),this.textElement.transform.baseVal.getItem(1).setScale(e,e))},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(e.x-this.pointerDownPoint.x)>5||Math.abs(e.y-this.pointerDownPoint.y)>5)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.isMoved=!0,this.setSize(),this.sizeText()},e.prototype.setSize=function(){t.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(n.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),n.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},e.prototype.pointerUp=function(e){var i=this.state;t.prototype.pointerUp.call(this,e),this.setSize(),("creating"===i||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},e.prototype.showTextEditor=function(){var t=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(t){t.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var e=Number.parseFloat(t.textEditor.style.fontSize);t.textEditor.clientWidth>=Number.parseInt(t.textEditor.style.maxWidth)&&e>.9;)e-=.1,t.textEditor.style.fontSize=Math.max(e,.9)+"em"}),this.textEditor.addEventListener("keyup",function(t){t.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(t){if(t.clipboardData){var e=t.clipboardData.getData("text"),i=window.getSelection();if(!i.rangeCount)return!1;i.deleteFromDocument(),i.getRangeAt(0).insertNode(document.createTextNode(e)),t.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){t.textEditDivClicked(t.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},e.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var t=this.getTextScale(),e=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),i=this.textElement.getBBox(),o={x:i.width*t,y:i.height*t};e.x-=o.x/2,e.y-=o.y/2,this.textEditor.style.top=e.y+"px",this.textEditor.style.left=e.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-e.x+"px",this.textEditor.style.fontSize=Math.max(16*t,12)+"px",this.textElement.style.display="none"}},e.prototype.textEditDivClicked=function(t){this.text=t.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual()},e.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),t.prototype.deselect.call(this)},e.prototype.dblClick=function(e,i){t.prototype.dblClick.call(this,e,i),this.showTextEditor()},e.prototype.setColor=function(t){this.textElement&&n.setAttributes(this.textElement,[["fill",t]]),this.color=t,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(t)},e.prototype.setFont=function(t){this.textElement&&n.setAttributes(this.textElement,[["font-family",t]]),this.fontFamily=t,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText()},e.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},e.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){var i=e;this.color=i.color,this.fontFamily=i.fontFamily,this.padding=i.padding,this.text=i.text,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setSize(),this.sizeText(),this.positionTextEditor()},e.typeName="TextMarker",e.title="Text marker",e.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',e}(b),L=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.color="transparent",s.lineWidth=3,s.drawing=!1,s.pixelRatio=1,s.color=o.defaultColor,s.lineWidth=o.defaultStrokeWidth,s.pixelRatio=o.freehandPixelRatio,s.setColor=s.setColor.bind(s),s.addCanvas=s.addCanvas.bind(s),s.finishCreation=s.finishCreation.bind(s),s.setLineWidth=s.setLineWidth.bind(s),s.colorPanel=new g("Color",o.defaultColorSet,o.defaultColor),s.colorPanel.onColorChanged=s.setColor,s.lineWidthPanel=new S("Line width",o.defaultStrokeWidths,o.defaultStrokeWidth),s.lineWidthPanel.onWidthChanged=s.setLineWidth,s}return i(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.drawingImage)},e.prototype.createVisual=function(){this.visual=n.createGroup(),this.drawingImage=n.createImage(),this.visual.appendChild(this.drawingImage);var t=n.createTransform();this.visual.transform.baseVal.appendItem(t),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){"new"===this.state&&(this.addCanvas(),this.createVisual(),this._state="creating"),"creating"===this.state?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(e.x,e.y),this.drawing=!0):t.prototype.pointerDown.call(this,e,i)},e.prototype.manipulate=function(e){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(e.x,e.y),this.canvasContext.stroke()):t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),n.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),n.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):t.prototype.pointerUp.call(this,e)},e.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},e.prototype.select=function(){"creating"===this.state&&this.finishCreation(),t.prototype.select.call(this)},e.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),t.prototype.deselect.call(this)},e.prototype.finishCreation=function(){for(var t=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),e=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],i=e[0],o=e[1],s=e[2],r=e[3],n=!1,a=0;a<this.canvasElement.height;a++)for(var h=0;h<this.canvasElement.width;h++)t.data[a*this.canvasElement.width*4+4*h+3]>0&&(n=!0,a<o&&(o=a),h<i&&(i=h),a>r&&(r=a),h>s&&(s=h));if(n){this.left=i/this.pixelRatio,this.top=o/this.pixelRatio,this.width=(s-i)/this.pixelRatio,this.height=(r-o)/this.pixelRatio;var l=document.createElement("canvas");l.width=s-i,l.height=r-o,l.getContext("2d").putImageData(this.canvasContext.getImageData(i,o,s-i,r-o),0,0),this.drawingImgUrl=l.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},e.prototype.setDrawingImage=function(){n.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),n.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},e.prototype.setColor=function(t){this.color=t,this.colorChanged(t)},e.prototype.setLineWidth=function(t){this.lineWidth=t},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({drawingImgUrl:this.drawingImgUrl},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){this.createVisual(),t.prototype.restoreState.call(this,e),this.drawingImgUrl=e.drawingImgUrl,this.setDrawingImage()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setDrawingImage()},e.typeName="FreehandMarker",e.title="Freehand marker",e.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',e}(b),A=function(t){function e(e,i,o){var s=t.call(this,e,o||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return s.typeBoxes=[],s.currentType=i,s.setCurrentType=s.setCurrentType.bind(s),s}return i(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2";for(var i=function(i){var s="both";switch(i){case 0:s="both";break;case 1:s="start";break;case 2:s="end";break;case 3:s="none"}var r=document.createElement("div");if(r.style.display="flex",r.style.flexGrow="2",r.style.alignItems="center",r.style.justifyContent="space-between",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderColor=s===o.currentType?l.settings.toolboxAccentColor:"transparent",r.addEventListener("click",function(){t.setCurrentType(s,r)}),e.appendChild(r),"both"===s||"start"===s){var n=document.createElement("div");n.style.display="flex",n.style.alignItems="center",n.style.minHeight="20px",n.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n          <polygon points="0,5 10,0 10,10" fill="'+l.settings.toolboxColor+'" />\n        </svg>',n.style.marginLeft="5px",r.appendChild(n)}var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.style.flexGrow="2";var h=document.createElement("hr");if(h.style.minWidth="20px",h.style.border="0px",h.style.borderTop="3px solid "+l.settings.toolboxColor,h.style.flexGrow="2",a.appendChild(h),r.appendChild(a),"both"===s||"end"===s){var p=document.createElement("div");p.style.display="flex",p.style.alignItems="center",p.style.minHeight="20px",p.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n          <polygon points="0,0 10,5 0,10" fill="'+l.settings.toolboxColor+'" />\n        </svg>',p.style.marginRight="5px",r.appendChild(p)}o.typeBoxes.push(r)},o=this,s=0;s<4;s++)i(s);return e},e.prototype.setCurrentType=function(t,e){this.currentType=t,this.typeBoxes.forEach(function(t){t.style.borderColor=t===e?l.settings.toolboxAccentColor:"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},e}(y),D=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.arrowType="end",s.arrowBaseHeight=10,s.arrowBaseWidth=10,s.getArrowPoints=s.getArrowPoints.bind(s),s.setArrowType=s.setArrowType.bind(s),s.arrowTypePanel=new A("Arrow type","end"),s.arrowTypePanel.onArrowTypeChanged=s.setArrowType,s}return i(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.arrow1&&e!==this.arrow2)},e.prototype.getArrowPoints=function(t,e){var i=this.arrowBaseWidth+2*this.strokeWidth,o=this.arrowBaseHeight+2*this.strokeWidth;return t-i/2+","+(e+o/2)+" "+t+","+(e-o/2)+" "+(t+i/2)+","+(e+o/2)},e.prototype.createTips=function(){this.arrow1=n.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(n.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=n.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(n.createTransform()),this.visual.appendChild(this.arrow2)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display="both"===this.arrowType||"start"===this.arrowType?"":"none",this.arrow2.style.display="both"===this.arrowType||"end"===this.arrowType?"":"none",n.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),n.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),i=this.arrow1.transform.baseVal.getItem(0);i.setRotate(e,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(i,0);var o=this.arrow2.transform.baseVal.getItem(0);o.setRotate(e+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(o,0)}},e.prototype.setArrowType=function(t){this.arrowType=t,this.adjustVisual()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({arrowType:this.arrowType},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.arrowType=i.arrowType,this.createTips(),this.adjustVisual()},e.typeName="ArrowMarker",e.title="Arrow marker",e.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',e}(E),I=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.fillColor=o.defaultFillColor,s.strokeWidth=0,s.fillPanel=new g("Color",o.defaultColorSet,o.defaultFillColor),s.fillPanel.onColorChanged=s.setFillColor,s}return i(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.typeName="CoverMarker",e.title="Cover marker",e.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',e}(k),W=function(t){function e(e,i,o,s){var r=t.call(this,e,s||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return r.opacities=[],r.opacityBoxes=[],r.opacities=i,r.currentOpacity=o,r.setCurrentOpacity=r.setCurrentOpacity.bind(r),r}return i(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",e.style.justifyContent="space-between",this.opacities.forEach(function(i){var o=document.createElement("div");o.style.display="flex",o.style.alignItems="center",o.style.justifyContent="center",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.borderColor=i===t.currentOpacity?l.settings.toolboxAccentColor:"transparent",o.addEventListener("click",function(){t.setCurrentOpacity(i,o)}),e.appendChild(o);var s=document.createElement("div");s.innerText=100*i+"%",o.appendChild(s),t.opacityBoxes.push(o)}),e},e.prototype.setCurrentOpacity=function(t,e){this.currentOpacity=t,this.opacityBoxes.forEach(function(t){t.style.borderColor=t===e?l.settings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},e}(y),H=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.setOpacity=s.setOpacity.bind(s),s.fillColor=o.defaultHighlightColor,s.strokeWidth=0,s.opacity=o.defaultHighlightOpacity,s.fillPanel=new g("Color",o.defaultColorSet,s.fillColor),s.fillPanel.onColorChanged=s.setFillColor,s.opacityPanel=new W("Opacity",o.defaultOpacitySteps,s.opacity),s.opacityPanel.onOpacityChanged=s.setOpacity,s}return i(e,t),e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&n.setAttributes(this.visual,[["opacity",this.opacity.toString()]])},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.typeName="HighlightMarker",e.title="Highlight marker",e.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',e}(I),R='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',N=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.bgColor="transparent",s.tipPosition={x:0,y:0},s.tipBase1Position={x:0,y:0},s.tipBase2Position={x:0,y:0},s.tipMoving=!1,s.color=o.defaultStrokeColor,s.bgColor=o.defaultCalloutFillColor,s.fontFamily=o.defaultFontFamily,s.defaultSize={x:100,y:30},s.setBgColor=s.setBgColor.bind(s),s.getTipPoints=s.getTipPoints.bind(s),s.positionTip=s.positionTip.bind(s),s.setTipPoints=s.setTipPoints.bind(s),s.colorPanel=new g("Text color",o.defaultColorSet,s.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),s.colorPanel.onColorChanged=s.setColor,s.bgColorPanel=new g("Fill color",o.defaultColorSet,s.bgColor,R),s.bgColorPanel.onColorChanged=s.setBgColor,s.fontFamilyPanel=new P("Font",o.defaultFontFamilies,o.defaultFontFamily),s.fontFamilyPanel.onFontChanged=s.setFont,s.tipGrip=new m,s.tipGrip.visual.transform.baseVal.appendItem(n.createTransform()),s.controlBox.appendChild(s.tipGrip.visual),s}return i(e,t),e.prototype.ownsTarget=function(e){return t.prototype.ownsTarget.call(this,e)||this.tipGrip.ownsTarget(e)||this.tip===e},e.prototype.createTip=function(){n.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=n.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},e.prototype.pointerDown=function(e,i){"new"===this.state&&t.prototype.pointerDown.call(this,e,i),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(i)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):t.prototype.pointerDown.call(this,e,i)},e.prototype.pointerUp=function(e){if(this.tipMoving)this.tipMoving=!1;else{var i="creating"===this.state;t.prototype.pointerUp.call(this,e),this.setTipPoints(i),this.positionTip()}},e.prototype.manipulate=function(e){if(this.tipMoving){var i=this.unrotatePoint(e);this.tipPosition={x:i.x-this.manipulationStartLeft,y:i.y-this.manipulationStartTop},this.positionTip()}else t.prototype.manipulate.call(this,e)},e.prototype.setBgColor=function(t){this.bgRectangle&&this.tip&&(n.setAttributes(this.bgRectangle,[["fill",t]]),n.setAttributes(this.tip,[["fill",t]])),this.bgColor=t,this.fillColorChanged(t)},e.prototype.getTipPoints=function(){return this.setTipPoints("creating"===this.state),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},e.prototype.setTipPoints=function(t){void 0===t&&(t=!1);var e=Math.min(this.height/2,15),i=this.height/5;t&&(this.tipPosition={x:e+i/2,y:this.height+20});var o=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?o<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(i=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:e,y:0},this.tipBase2Position={x:e+i,y:0}):(this.tipBase1Position={x:0,y:e},this.tipBase2Position={x:0,y:e+i}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?o<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(i=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-e-i,y:0},this.tipBase2Position={x:this.width-e,y:0}):(this.tipBase1Position={x:this.width,y:e},this.tipBase2Position={x:this.width,y:e+i}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?o<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(i=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-e-i,y:this.height},this.tipBase2Position={x:this.width-e,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-e-i},this.tipBase2Position={x:this.width,y:this.height-e}):o<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(i=this.width/5,e=Math.min(this.width/2,15),this.tipBase1Position={x:e,y:this.height},this.tipBase2Position={x:e+i,y:this.height}):(this.tipBase1Position={x:0,y:this.height-e},this.tipBase2Position={x:0,y:this.height-e-i})},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.positionTip()},e.prototype.positionTip=function(){n.setAttributes(this.tip,[["points",this.getTipPoints()]]);var t=this.tipGrip.visual.transform.baseVal.getItem(0);t.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(t,0)},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),e.prototype.select=function(){this.positionTip(),t.prototype.select.call(this)},e.prototype.getState=function(){var i=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){var i=e;this.bgColor=i.bgColor,this.tipPosition=i.tipPosition,t.prototype.restoreState.call(this,e),this.createTip(),this.setTipPoints()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.tipPosition={x:this.tipPosition.x*e,y:this.tipPosition.y*i},this.positionTip()},e.typeName="CalloutMarker",e.title="Callout marker",e.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',e}(T),O=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.fillColor="transparent",s.strokeColor="transparent",s.strokeWidth=0,s.strokeDasharray="",s.opacity=1,s.strokeColor=o.defaultColor,s.strokeWidth=o.defaultStrokeWidth,s.strokeDasharray=o.defaultStrokeDasharray,s.fillColor=o.defaultEllipseFillColor,s.setStrokeColor=s.setStrokeColor.bind(s),s.setFillColor=s.setFillColor.bind(s),s.setStrokeWidth=s.setStrokeWidth.bind(s),s.setStrokeDasharray=s.setStrokeDasharray.bind(s),s.setOpacity=s.setOpacity.bind(s),s.createVisual=s.createVisual.bind(s),s.strokePanel=new g("Line color",r(o.defaultColorSet,["transparent"]),o.defaultColor),s.strokePanel.onColorChanged=s.setStrokeColor,s.fillPanel=new g("Fill color",r(o.defaultColorSet,["transparent"]),s.fillColor,R),s.fillPanel.onColorChanged=s.setFillColor,s.strokeWidthPanel=new S("Line width",o.defaultStrokeWidths,o.defaultStrokeWidth),s.strokeWidthPanel.onWidthChanged=s.setStrokeWidth,s.strokeStylePanel=new w("Line style",o.defaultStrokeDasharrays,o.defaultStrokeDasharray),s.strokeStylePanel.onStyleChanged=s.setStrokeDasharray,s.opacityPanel=new W("Opacity",o.defaultOpacitySteps,s.opacity),s.opacityPanel.onOpacityChanged=s.setOpacity,s}return i(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=n.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.setSize=function(){t.prototype.setSize.call(this),n.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&n.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t)},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&n.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&n.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]])},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&n.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]])},e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&n.setAttributes(this.visual,[["opacity",this.opacity.toString()]])},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){var i=e;this.fillColor=i.fillColor,this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.opacity=i.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setSize()},e.typeName="EllipseMarker",e.title="Ellipse marker",e.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',e}(b),z=function(t){function e(e,i,o){return t.call(this,e,i,o)||this}return i(e,t),Object.defineProperty(e.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.tip1&&e!==this.tip2)},e.prototype.createTips=function(){this.tip1=n.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(n.createTransform()),this.visual.appendChild(this.tip1),this.tip2=n.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(n.createTransform()),this.visual.appendChild(this.tip2)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(n.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),n.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),i=this.tip1.transform.baseVal.getItem(0);i.setRotate(e,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(i,0);var o=this.tip2.transform.baseVal.getItem(0);o.setRotate(e+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(o,0)}},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e),this.createTips(),this.adjustVisual()},e.typeName="MeasurementMarker",e.title="Measurement marker",e.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',e}(E),V=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.strokePanel.colors=o.defaultColorSet,s.fillColor="transparent",s}return i(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.typeName="EllipseFrameMarker",e.title="Ellipse frame marker",e.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',e}(O),_=function(){function t(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(t.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),t.prototype.addUndoStep=function(t){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(t)||(this.undoStack.push(t),JSON.stringify(this.lastRedoStep)!==JSON.stringify(t)&&this.redoStack.splice(0,this.redoStack.length))},t.prototype.replaceLastUndoStep=function(t){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=t)},t.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},t.prototype.undo=function(){if(this.undoStack.length>1){var t=this.undoStack.pop();return void 0!==t&&this.redoStack.push(t),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},t.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},t}(),G=function(t){function e(e,i,o){var s=t.call(this,e,i,o)||this;return s.strokeColor="transparent",s.strokeWidth=0,s.strokeDasharray="",s.curveX=0,s.curveY=0,s.manipulationStartCurveX=0,s.manipulationStartCurveY=0,s.setStrokeColor=s.setStrokeColor.bind(s),s.setStrokeWidth=s.setStrokeWidth.bind(s),s.setStrokeDasharray=s.setStrokeDasharray.bind(s),s.positionGrips=s.positionGrips.bind(s),s.addControlGrips=s.addControlGrips.bind(s),s.adjustVisual=s.adjustVisual.bind(s),s.setupControlBox=s.setupControlBox.bind(s),s.resize=s.resize.bind(s),s.strokeColor=o.defaultColor,s.strokeWidth=o.defaultStrokeWidth,s.strokeDasharray=o.defaultStrokeDasharray,s.strokePanel=new g("Line color",o.defaultColorSet,o.defaultColor),s.strokePanel.onColorChanged=s.setStrokeColor,s.strokeWidthPanel=new S("Line width",o.defaultStrokeWidths,o.defaultStrokeWidth),s.strokeWidthPanel.onWidthChanged=s.setStrokeWidth,s.strokeStylePanel=new w("Line style",o.defaultStrokeDasharrays,o.defaultStrokeDasharray),s.strokeStylePanel.onStyleChanged=s.setStrokeDasharray,s}return i(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorCurve&&e!==this.visibleCurve&&!this.curveGrip.ownsTarget(e))},e.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},e.prototype.createVisual=function(){this.visual=n.createGroup(),this.selectorCurve=n.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=n.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=e.x,this.curveY=e.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(i)&&(this.activeGrip=this.curveGrip,this._state="resize")},e.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),n.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),n.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),n.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setupControlBox=function(){t.prototype.setupControlBox.call(this),this.curveControlLine1=n.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=n.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},e.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,t.prototype.addControlGrips.call(this)},e.prototype.positionGrips=function(){t.prototype.positionGrips.call(this);var e=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-e/2,this.curveY-e/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},e.prototype.manipulate=function(e){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+e.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+e.y-this.manipulationStartY),t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){this.activeGrip===this.curveGrip&&(this.curveX=e.x,this.curveY=e.y),t.prototype.resize.call(this,e),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual()},e.prototype.scale=function(e,i){this.curveX=this.curveX*e,this.curveY=this.curveY*i,t.prototype.scale.call(this,e,i)},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.curveX=i.curveX,this.curveY=i.curveY,this.createVisual(),this.adjustVisual()},e.typeName="CurveMarker",e.title="Curve marker",e.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',e}(B),F=function(){function t(t,e){void 0===e&&(e=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=t,this.cancelable=e}return Object.defineProperty(t.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this._defaultPrevented=!0},t}(),j=function(t){function e(e,i,o){var s=t.call(this,e,!1)||this;return s.dataUrl=i,s.state=o,s}return i(e,t),e}(F),U=function(t){function e(e,i,o){void 0===o&&(o=!1);var s=t.call(this,e,o)||this;return s.marker=i,s}return i(e,t),e}(F),X=function(){function t(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.focus=[],this.blur=[]}return t.prototype.addEventListener=function(t,e){this[t].push(e)},t.prototype.removeEventListener=function(t,e){var i=this[t].indexOf(e);i>-1&&this[t].splice(i,1)},t}(),Y=function(){function t(t){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new M,this._isOpen=!1,this.undoRedoManager=new _,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this.prevPanPoint={x:0,y:0},this.eventListeners=new X,this._silentRenderMode=!1,this._isFocused=!1,l.settings=l.defaultSettings,this.uiStyleSettings=l.settings,this.target=t,this.targetRoot=document.body,this.width=t.clientWidth,this.height=t.clientHeight,l.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this)}return Object.defineProperty(t.prototype,"ALL_MARKER_TYPES",{get:function(){return[x,L,D,T,V,O,H,N,z,I,E,G]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[x,L,D,T,O,H,N]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BASIC_MARKER_TYPES",{get:function(){return[x,L,D,T,H]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(t){var e=this;this._availableMarkerTypes.splice(0),t.forEach(function(t){if("string"==typeof t){var i=e.ALL_MARKER_TYPES.find(function(e){return e.typeName===t});void 0!==i&&e._availableMarkerTypes.push(i)}else e._availableMarkerTypes.push(t)})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(t){this._zoomLevel=t,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),t.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),a.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},t.prototype.show=function(){var t=this;this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(e){return e(new F(t))})},t.prototype.render=function(){return o(this,void 0,void 0,function(){var t;return s(this,function(e){switch(e.label){case 0:return this.setCurrentMarker(),(t=new h).naturalSize=this.renderAtNaturalSize,t.imageType=this.renderImageType,t.imageQuality=this.renderImageQuality,t.markersOnly=this.renderMarkersOnly,t.width=this.renderWidth,t.height=this.renderHeight,[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return e.sent(),[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,e.sent()]}})})},t.prototype.close=function(t){var e=this;if(void 0===t&&(t=!1),this.isOpen){var i=!1;t||this.eventListeners.beforeclose.forEach(function(t){var o=new F(e,!0);t(o),o.defaultPrevented&&(i=!0)}),i||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.settings.displayMode&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(t){return t(new F(e))}),this.detachEvents(),this._isOpen=!1)}},t.prototype.addMarkersToToolbar=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];(t=this._availableMarkerTypes).push.apply(t,e)},t.prototype.addRenderEventListener=function(t){this.addEventListener("render",function(e){t(e.dataUrl,e.state)})},t.prototype.removeRenderEventListener=function(t){},t.prototype.addCloseEventListener=function(t){this.addEventListener("close",function(){t()})},t.prototype.removeCloseEventListener=function(t){},t.prototype.setupResizeObserver=function(){var t=this;"inline"===this.settings.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){t.resize(t.target.clientWidth,t.target.clientHeight)}),this.targetObserver.observe(this.target)):"popup"===this.settings.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return t.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},t.prototype.onPopupTargetResize=function(){var t=1*this.target.clientWidth/this.target.clientHeight,e=this.editorCanvas.clientWidth/t>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*t:this.editorCanvas.clientWidth,i=e<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/t;this.resize(e,i)},t.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},t.prototype.resize=function(t,e){var i=t/this.imageWidth,o=e/this.imageHeight;this.imageWidth=Math.round(t)-10,this.imageHeight=Math.round(e)-17,this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px","popup"!==this.settings.displayMode?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),void 0!==this.toolbar&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(i,o)},t.prototype.scaleMarkers=function(t,e){var i;this.currentMarker&&this.currentMarker instanceof T||(i=this.currentMarker,this.setCurrentMarker()),this.markers.forEach(function(i){return i.scale(t,e)}),void 0!==i&&this.setCurrentMarker(i)},t.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},t.prototype.setTopLeft=function(){var t=this.editingTarget.getBoundingClientRect(),e=this.editorCanvas.getBoundingClientRect();this.left=t.left-e.left,this.top=t.top-e.top},t.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},t.prototype.addDefs=function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];this.defs=n.createDefs(),this.markerImage.insertBefore(this.defs,this.markerImage.firstChild),(t=this.defs).append.apply(t,e)},t.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},t.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},t.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},t.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},t.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},t.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},t.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var t=document.createElement("a");t.href="https://markerjs.com/",t.target="_blank",t.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',t.title="Powered by marker.js",t.style.display="grid",t.style.alignItems="center",t.style.justifyItems="center",t.style.padding="3px",t.style.width="20px",t.style.height="20px",this.logoUI.appendChild(t),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},t.prototype.positionLogo=function(){this.logoUI&&("right"!==this.uiStyleSettings.logoPosition?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},t.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},t.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},t.prototype.showUI=function(){switch("popup"===this.settings.displayMode&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=l.CLASS_PREFIX,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var t=this.target.getClientRects().item(0).y>l.settings.toolbarHeight?this.target.offsetTop-l.settings.toolbarHeight:0;this.coverDiv.style.top=t+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin="popup"===this.settings.displayMode?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new u(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1","popup"===this.settings.displayMode&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex","popup"===this.settings.displayMode&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<l.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-l.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new d(this.uiDiv,this.settings.displayMode,this.uiStyleSettings),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},t.prototype.closeUI=function(){"popup"===this.settings.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},t.prototype.removeMarker=function(t){this.markerImage.removeChild(t.container),this.markers.indexOf(t)>-1&&this.markers.splice(this.markers.indexOf(t),1),t.dispose()},t.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),void 0!==this.currentMarker&&("new"!==this.currentMarker.state?this.currentMarker.select():(this.removeMarker(this.currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},t.prototype.toolbarButtonClicked=function(t,e){if("marker"===t&&void 0!==e)this.createNewMarker(e);else if("action"===t)switch(e){case"select":this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.switchToSelectMode(),this.addUndoStep(),this.undo();break;case"redo":this.switchToSelectMode(),this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":void 0===this.notesArea?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},t.prototype.deleteSelectedMarker=function(){var t=this;if(void 0!==this.currentMarker){var e=!1;if(this.eventListeners.markerbeforedelete.forEach(function(i){var o=new U(t,t.currentMarker,!0);i(o),o.defaultPrevented&&(e=!0)}),!e){var i=this.currentMarker;this.currentMarker.dispose(),this.markerImage.removeChild(this.currentMarker.container),this.markers.splice(this.markers.indexOf(this.currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(e){return e(new U(t,i))})}}},t.prototype.clear=function(){this.setCurrentMarker();for(var t=this.markers.length-1;t>=0;t--)this.setCurrentMarker(this.markers[t]),this.currentMarker.dispose(),this.markerImage.removeChild(this.currentMarker.container),this.markers.splice(this.markers.indexOf(this.currentMarker),1);this.addUndoStep()},Object.defineProperty(t.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),t.prototype.showNotesEditor=function(){var t;void 0!==this.currentMarker&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=null!==(t=this.currentMarker.notes)&&void 0!==t?t:"",this.overlayContainer.appendChild(this.notesArea))},t.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(void 0!==this.currentMarker&&(this.currentMarker.notes=""!==this.notesArea.value.trim()?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},t.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},t.prototype.addUndoStep=function(){if(void 0===this.currentMarker||"edit"!==this.currentMarker.state){var t=this.getState(),e=this.undoRedoManager.getLastUndoStep();!e||e.width===t.width&&e.height===t.height?this.undoRedoManager.addUndoStep(t):this.undoRedoManager.replaceLastUndoStep(t)}},t.prototype.undo=function(){var t=this.undoRedoManager.undo();void 0!==t&&(this.restoreState(t),this.selectLastMarker())},t.prototype.redo=function(){var t=this.undoRedoManager.redo();void 0!==t&&(this.restoreState(t),this.selectLastMarker())},t.prototype.stepZoom=function(){var t=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=t<this.zoomSteps.length-1?this.zoomSteps[t+1]:this.zoomSteps[0]},t.prototype.panTo=function(t){this.contentDiv.scrollBy({left:this.prevPanPoint.x-t.x,top:this.prevPanPoint.y-t.y}),this.prevPanPoint=t},t.prototype.startRenderAndClose=function(){return o(this,void 0,void 0,function(){var t,e,i=this;return s(this,function(o){switch(o.label){case 0:return[4,this.render()];case 1:return t=o.sent(),e=this.getState(),this.eventListeners.render.forEach(function(o){return o(new j(i,t,e))}),this.close(!0),[2]}})})},t.prototype.getState=function(t){!0===t&&this.setCurrentMarker();var e={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(t){return e.markers.push(t.getState())}),e},t.prototype.restoreState=function(t){var e=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);t.markers.forEach(function(t){var i=e._availableMarkerTypes.find(function(e){return e.typeName===t.typeName});if(void 0!==i){var o=e.addNewMarker(i);o.restoreState(t),e.markers.push(o)}}),t.width&&t.height&&(t.width!==this.imageWidth||t.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/t.width,this.imageHeight/t.height),this.eventListeners.restorestate.forEach(function(t){return t(new F(e))})},t.prototype.addNewMarker=function(t){var e=n.createGroup();return this.markerImage.appendChild(e),new t(e,this.overlayContainer,this.settings)},t.prototype.createNewMarker=function(t){var e,i=this;(e="string"==typeof t?this._availableMarkerTypes.find(function(e){return e.typeName===t}):t)&&(this.setCurrentMarker(),this.addUndoStep(),this.currentMarker=this.addNewMarker(e),this.currentMarker.onMarkerCreated=this.markerCreated,this.currentMarker.onColorChanged=this.colorChanged,this.currentMarker.onFillColorChanged=this.fillColorChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(e.typeName),this.toolbox.setPanelButtons(this.currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(t){return t(new U(i,i.currentMarker))}))},t.prototype.markerCreated=function(t){var e=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(t),this.setCurrentMarker(t),t instanceof L&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(L):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(t){return t(new U(e,e.currentMarker))})},t.prototype.colorChanged=function(t){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=t,this.settings.defaultStrokeColor=t)},t.prototype.fillColorChanged=function(t){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=t)},t.prototype.setCurrentMarker=function(t){var e=this;this.currentMarker!==t&&void 0!==this.currentMarker&&(this.currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this.eventListeners.markerdeselect.forEach(function(t){return t(new U(e,e.currentMarker))})),this.currentMarker=t,void 0===this.currentMarker||this.currentMarker.isSelected||("new"!==this.currentMarker.state&&this.currentMarker.select(),this.toolbar.setCurrentMarker(this.currentMarker),this.toolbox.setPanelButtons(this.currentMarker.toolboxPanels),this.eventListeners.markerselect.forEach(function(t){return t(new U(e,e.currentMarker))}))},t.prototype.onPointerDown=function(t){if(this._isFocused||this.focus(),this.touchPoints++,1===this.touchPoints||"touch"!==t.pointerType)if(void 0===this.currentMarker||"new"!==this.currentMarker.state&&"creating"!==this.currentMarker.state){if("select"===this.mode){var e=this.markers.find(function(e){return e.ownsTarget(t.target)});void 0!==e?(this.setCurrentMarker(e),this.isDragging=!0,this.currentMarker.pointerDown(this.clientToLocalCoordinates(t.clientX,t.clientY),t.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:t.clientX,y:t.clientY})}}else this.isDragging=!0,this.currentMarker.pointerDown(this.clientToLocalCoordinates(t.clientX,t.clientY))},t.prototype.onDblClick=function(t){if(this._isFocused||this.focus(),"select"===this.mode){var e=this.markers.find(function(e){return e.ownsTarget(t.target)});void 0!==e&&e!==this.currentMarker&&this.setCurrentMarker(e),void 0!==this.currentMarker?this.currentMarker.dblClick(this.clientToLocalCoordinates(t.clientX,t.clientY),t.target):this.setCurrentMarker()}},t.prototype.onPointerMove=function(t){1!==this.touchPoints&&"touch"===t.pointerType||(void 0!==this.currentMarker||this.isDragging)&&(void 0!==this.currentMarker&&"edit"===this.currentMarker.state||t.preventDefault(),void 0!==this.currentMarker?this.currentMarker.manipulate(this.clientToLocalCoordinates(t.clientX,t.clientY)):this.zoomLevel>1&&this.panTo({x:t.clientX,y:t.clientY}))},t.prototype.onPointerUp=function(t){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this.currentMarker&&this.currentMarker.pointerUp(this.clientToLocalCoordinates(t.clientX,t.clientY)),this.isDragging=!1,this.addUndoStep()},t.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},t.prototype.onKeyUp=function(t){void 0===this.currentMarker||void 0!==this.notesArea||"Delete"!==t.key&&"Backspace"!==t.key||this.deleteSelectedMarker()},t.prototype.clientToLocalCoordinates=function(t,e){var i=this.markerImage.getBoundingClientRect();return{x:(t-i.left)/this.zoomLevel,y:(e-i.top)/this.zoomLevel}},t.prototype.onWindowResize=function(){this.positionUI()},t.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var t=this.target.offsetTop>l.settings.toolbarHeight?this.target.offsetTop-l.settings.toolbarHeight:0;this.coverDiv.style.top=t+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},t.prototype.addLicenseKey=function(t){a.addKey(t)},t.prototype.addEventListener=function(t,e){this.eventListeners.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.eventListeners.removeEventListener(t,e)},t.prototype.renderState=function(t){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(t),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(t.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),t.prototype.focus=function(){var t=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(e){return e(new F(t))}))},t.prototype.blur=function(){var t=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this.currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(e){return e(new F(t))}))},t}();t.Activator=a,t.ArrowMarker=D,t.ArrowTypePanel=A,t.CalloutMarker=N,t.ColorPickerPanel=g,t.CoverMarker=I,t.CurveMarker=G,t.EllipseFrameMarker=V,t.EllipseMarker=O,t.EventListenerRepository=X,t.FontFamilyPanel=P,t.FrameMarker=x,t.FreehandMarker=L,t.HighlightMarker=H,t.LineMarker=E,t.LineStylePanel=w,t.LineWidthPanel=S,t.LinearMarkerBase=B,t.MarkerArea=Y,t.MarkerAreaEvent=F,t.MarkerAreaRenderEvent=j,t.MarkerBase=f,t.MarkerEvent=U,t.MeasurementMarker=z,t.OpacityPanel=W,t.RectangleMarker=k,t.RectangularBoxMarkerBase=b,t.RectangularBoxMarkerGrips=v,t.ResizeGrip=m,t.Settings=M,t.Style=l,t.StyleClass=c,t.SvgHelper=n,t.TextMarker=T,t.ToolboxPanel=y,t.TransformMatrix=C,Object.defineProperty(t,"__esModule",{value:!0})});