1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6761],{96761:function(t,e,i){var r;self,t.exports=(r=i(67294),(()=>{var t={303:(t,e,i)=>{t.exports=i(302),i(200),i(630),i(16),i(677),i(635),i(166),i(140),i(922)},635:(t,e,i)=>{var r,n,a;!function(s){"use strict";n=[i(302),i(677)],void 0===(a="function"==typeof(r=function(t){var e=t.ExifMap.prototype;e.tags={256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",34665:{36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"E
1xposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber"},34853:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},40965:{1:"InteroperabilityIndex"}},e.tags.ifd1=e.tags,e.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"Original",2:"Horizontal flip",3:"Rotate 180\xb0 CCW",4:"Vertical flip",5:"Vertical flip + Rotate 90\xb0 CW",6:"Rotate 90\xb0 CW",7:"Horizontal flip + Rotate 90\xb0 CW",8:"Rotate 90\xb0 CCW"}},e.getText=function(t){var e=this.get(t);switch(t){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":case"Orientation":return this.stringValues[t][e];case"ExifVersion":case"FlashpixVersion":if(!e)return;return String.fromCharCode(e[0],e[1],e[2],e[3]);case"ComponentsConfiguration":if(!e)return;return this.stringValues[t][e[0]]+this.stringValues[t][e[1]]+this.stringValues[t][e[2]]+this.stringValues[t][e[3]];case"GPSVersionID":if(!e)return;return e[0]+"."+e[1]+"."+e[2]+"."+e[3]}return String(e)},e.getAll=function(){var t,e,i,r={};for(t in this)Object.prototype.hasOwnProperty.call(this,t)&&((e=this[t])&&e.getAll?r[this.ifds[t].name]=e.getAll():(i=this.tags[t])&&(r[i]=this.getText(i)));return r},e.getName=function(t){var e=this.tags[t];return"object"==typeof e?this.ifds[t].name:e},function(){var t,i,r,n=e.tags;for(t in n)if(Object.prototype.hasOwnProperty.call(n,t))if(i=e.ifds[t])for(t in r=n[t])Object.prototype.hasOwnProperty.call(r,t)&&(i.map[r[t]]=Number(t));else e.map[n[t]]=Number(t)}()})?r.apply(e,n):r)||(t.exports=a)}()},677:(t,e,i)=>{var r,n,a;!function(s){"use strict";n=[i(302),i(630)],void 0===(a="function"==typeof(r=function(t){function e(t){t&&(Object.defineProperty(this,"map",{value:this.ifds[t].map}),Object.defineProperty(this,"tags",{value:this.tags&&this.tags[t]||{}}))}e.prototype.map={Orientation:274,Thumbnail:"ifd1",Blob:513,Exif:34665,GPSInfo:34853,Interoperability:40965}
1,e.prototype.ifds={ifd1:{name:"Thumbnail",map:e.prototype.map},34665:{name:"Exif",map:{}},34853:{name:"GPSInfo",map:{}},40965:{name:"Interoperability",map:{}}},e.prototype.get=function(t){return this[t]||this[this.map[t]]};var i={1:{getValue:function(t,e){return t.getUint8(e)},size:1},2:{getValue:function(t,e){return String.fromCharCode(t.getUint8(e))},size:1,ascii:!0},3:{getValue:function(t,e,i){return t.getUint16(e,i)},size:2},4:{getValue:function(t,e,i){return t.getUint32(e,i)},size:4},5:{getValue:function(t,e,i){return t.getUint32(e,i)/t.getUint32(e+4,i)},size:8},9:{getValue:function(t,e,i){return t.getInt32(e,i)},size:4},10:{getValue:function(t,e,i){return t.getInt32(e,i)/t.getInt32(e+4,i)},size:8}};function r(t,e,r,n,a,s){var o,h,l,c,d,u,g=i[n];if(g){if(!((h=(o=g.size*a)>4?e+t.getUint32(r+8,s):r+8)+o>t.byteLength)){if(1===a)return g.getValue(t,h,s);for(l=[],c=0;c<a;c+=1)l[c]=g.getValue(t,h+c*g.size,s);if(g.ascii){for(d="",c=0;c<l.length&&"\0"!==(u=l[c]);c+=1)d+=u;return d}return l}console.log("Invalid Exif data: Invalid data offset.")}else console.log("Invalid Exif data: Invalid tag type.")}function n(t,e,i){return(!t||t[i])&&(!e||!0!==e[i])}function a(t,e,i,a,s,o,h,l){var c,d,u,g,f,p;if(i+6>t.byteLength)console.log("Invalid Exif data: Invalid directory offset.");else{if(!((d=i+2+12*(c=t.getUint16(i,a)))+4>t.byteLength)){for(u=0;u<c;u+=1)g=i+2+12*u,n(h,l,f=t.getUint16(g,a))&&(p=r(t,e,g,t.getUint16(g+2,a),t.getUint32(g+4,a),a),s[f]=p,o&&(o[f]=g));return t.getUint32(d,a)}console.log("Invalid Exif data: Invalid directory size.")}}i[7]=i[1],t.parseExifData=function(i,r,s,o,h){if(!h.disableExif){var l,c,d,u=h.includeExifTags,g=h.excludeExifTags||{34665:{37500:!0}},f=r+10;if(1165519206===i.getUint32(r+4))if(f+8>i.byteLength)console.log("Invalid Exif data: Invalid segment size.");else if(0===i.getUint16(r+8)){switch(i.getUint16(f)){case 18761:l=!0;break;case 19789:l=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}42===i.getUint16(f+2,l)?(c=i.getUint32(f+4,l),o.exif=new e,h.disableExifOffsets||(o.exifOffsets=new e,o.exifTiffOffset=f,o.exifLittleEndian=l),(c=a(i,f,f+c,l,o.exif,o.exifOffsets,u,g))&&n(u,g,"ifd1")&&(o.exif.ifd1=c,o.exifOffsets&&(o.exifOffsets.ifd1=f+c)),Object.keys(o.exif.ifds).forEach((function(t){!function(t,i,r,n,s,o,h){var l=t.exif[i];l&&(t.exif[i]=new e(i),t.exifOffsets&&(t.exifOffsets[i]=new e(i)),a(r,n,n+l,s,t.exif[i],t.exifOffsets&&t.exifOffsets[i],o&&o[i],h&&h[i]))}(o,t,i,f,l,u,g)})),(d=o.exif.ifd1)&&d[513]&&(d[513]=function(e,i,r){if(r){if(!(i+r>e.byteLength))return new Blob([t.bufferSlice.call(e.buffer,i,i+r)],{type:"image/jpeg"});console.log("Invalid Exif data: Invalid thumbnail data.")}}(i,f+d[513],d[514]))):console.log("Invalid Exif data: Missing TIFF marker.")}else console.log("Invalid Exif data: Missing byte alignment offset.")}},t.metaDataParsers.jpeg[65505].push(t.parseExifData),t.exifWriters={274:function(t,e,i){var r=e.exifOffsets[274];return r?(new DataView(t,r+8,2).setUint16(0,i,e.exifLittleEndian),t):t}},t.writeExifData=function(e,i,r,n){return t.exifWriters[i.exif.map[r]](e,i,n)},t.ExifMap=e})?r.apply(e,n):r)||(t.exports=a)}()},16:(t,e,i)=>{var r,n,a;!function(s){"use strict";n=[i(302)],void 0===(a="function"==typeof(r=function(t){var e=t.global;e.fetch&&e.Request&&e.Response&&e.Response.prototype.blob?t.fetchBlob=function(t,i,r){function n(t){return t.blob()}if(e.Promise&&"function"!=typeof i)return fetch(new Request(t,i)).then(n);fetch(new Request(t,r)).then(n).then(i).catch((function(t){i(null,t)}))}:e.XMLHttpRequest&&""===(new XMLHttpRequest).responseType&&(t.fetchBlob=function(t,i,r){function n(e,i){r=r||{};var n=new XMLHttpRequest;n.open(r.method||"GET",t),r.headers&&Object.keys(r.headers).forEach((function(t){n.setRequestHeader(t,r.headers[t])})),n.withCredentials="include"===r.credentials,n.responseType="blob",n.onload=function(){e(n.response)},n.onerror=n.onabort=n.ontimeout=function(t){e===i?i(null,t):i(t)},n.send(r.body)}return e.Promise&&"function"!=typeof i?(r=i,new Promise(n)):n(i,i)})})?r.apply(e,n):r)||(t.exports=a)}()}
1,140:(t,e,i)=>{var r,n,a;!function(s){"use strict";n=[i(302),i(166)],void 0===(a="function"==typeof(r=function(t){var e=t.IptcMap.prototype;e.tags={0:"ApplicationRecordVersion",3:"ObjectTypeReference",4:"ObjectAttributeReference",5:"ObjectName",7:"EditStatus",8:"EditorialUpdate",10:"Urgency",12:"SubjectReference",15:"Category",20:"SupplementalCategories",22:"FixtureIdentifier",25:"Keywords",26:"ContentLocationCode",27:"ContentLocationName",30:"ReleaseDate",35:"ReleaseTime",37:"ExpirationDate",38:"ExpirationTime",40:"SpecialInstructions",42:"ActionAdvised",45:"ReferenceService",47:"ReferenceDate",50:"ReferenceNumber",55:"DateCreated",60:"TimeCreated",62:"DigitalCreationDate",63:"DigitalCreationTime",65:"OriginatingProgram",70:"ProgramVersion",75:"ObjectCycle",80:"Byline",85:"BylineTitle",90:"City",92:"Sublocation",95:"State",100:"CountryCode",101:"Country",103:"OriginalTransmissionReference",105:"Headline",110:"Credit",115:"Source",116:"CopyrightNotice",118:"Contact",120:"Caption",121:"LocalCaption",122:"Writer",125:"RasterizedCaption",130:"ImageType",131:"ImageOrientation",135:"LanguageIdentifier",150:"AudioType",151:"AudioSamplingRate",152:"AudioSamplingResolution",153:"AudioDuration",154:"AudioOutcue",184:"JobID",185:"MasterDocumentID",186:"ShortDocumentID",187:"UniqueDocumentID",188:"OwnerID",200:"ObjectPreviewFileFormat",201:"ObjectPreviewFileVersion",202:"ObjectPreviewData",221:"Prefs",225:"ClassifyState",228:"Similarity
1Index",230:"DocumentNotes",231:"DocumentHistory",232:"ExifCameraInfo",255:"CatalogSets"},e.stringValues={10:{0:"0 (reserved)",1:"1 (most urgent)",2:"2",3:"3",4:"4",5:"5 (normal urgency)",6:"6",7:"7",8:"8 (least urgent)",9:"9 (user-defined priority)"},75:{a:"Morning",b:"Both Morning and Evening",p:"Evening"},131:{L:"Landscape",P:"Portrait",S:"Square"}},e.getText=function(t){var e=this.get(t),i=this.map[t],r=this.stringValues[i];return r?r[e]:String(e)},e.getAll=function(){var t,e,i={};for(t in this)Object.prototype.hasOwnProperty.call(this,t)&&(e=this.tags[t])&&(i[e]=this.getText(e));return i},e.getName=function(t){return this.tags[t]},function(){var t,i=e.tags,r=e.map||{};for(t in i)Object.prototype.hasOwnProperty.call(i,t)&&(r[i[t]]=Number(t))}()})?r.apply(e,n):r)||(t.exports=a)}()},166:(t,e,i)=>{var r,n,a;!function(s){"use strict";n=[i(302),i(630)],void 0===(a="function"==typeof(r=function(t){function e(){}function i(t,e,i,r,n){return"binary"===e.types[t]?new Blob([i.buffer.slice(r,r+n)]):"Uint16"===e.types[t]?i.getUint16(r):function(t,e,i){for(var r="",n=e+i,a=e;a<n;a+=1)r+=String.fromCharCode(t.getUint8(a));return r}(i,r,n)}function r(t,e){return void 0===t?e:t instanceof Array?(t.push(e),t):[t,e]}function n(t,e,n,a,s,o){for(var h,l,c,d=e+n,u=e;u<d;)28===t.getUint8(u)&&2===t.getUint8(u+1)&&(c=t.getUint8(u+2),s&&!s[c]||o&&o[c]||(l=t.getInt16(u+3),h=i(c,a.iptc,t,u+5,l),a.iptc[c]=r(a.iptc[c],h),a.iptcOffsets&&(a.iptcOffsets[c]=u))),u+=1}function a(t,e){return 943868237===t.getUint32(e)&&1028===t.getUint16(e+4)}function s(t,e){var i=t.getUint8(e+7);return i%2!=0&&(i+=1),0===i&&(i=4),i}e.prototype.map={ObjectName:5},e.prototype.types={0:"Uint16",200:"Uint16",201:"Uint16",202:"binary"},e.prototype.get=function(t){return this[t]||this[this.map[t]]},t.parseIptcData=function(t,i,r,o,h){if(!h.disableIptc)for(var l=i+r;i+8<l;){if(a(t,i)){var c=s(t,i),d=i+8+c;if(d>l){console.log("Invalid IPTC data: Invalid segment offset.");break}var u=t.getUint16(i+6+c);if(i+u>l){console.log("Invalid IPTC data: Invalid segment size.");break}return o.iptc=new e,h.disableIptcOffsets||(o.iptcOffsets=new e),void n(t,d,u,o,h.includeIptcTags,h.excludeIptcTags||{202:!0})}i+=1}},t.metaDataParsers.jpeg[65517].push(t.parseIptcData),t.IptcMap=e})?r.apply(e,n):r)||(t.exports=a)}()},630:(t,e,i)=>{var r,n,a;!function(s){"use strict";n=[i(302)],void 0===(a="function"==typeof(r=function(t){var e=t.global,i=t.transform,r=e.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),n=e.ArrayBuffer&&ArrayBuffer.prototype.slice||function(t,e){e=e||this.byteLength-t;var i=new Uint8Array(this,t,e),r=new Uint8Array(e);return r.set(i),r.buffer},a={jpeg:{65505:[],65517:[]}};function s(i,s,o,h){var l=this;function c(s,c){if(!(e.DataView&&r&&i&&i.size>=12&&"image/jpeg"===i.type))return s(h);var d=o.maxMetaDataSize||262144;t.readFile(r.call(i,0,d),(function(t){var e=new DataView(t);if(65496!==e.getUint16(0))return c(new Error("Invalid JPEG file: Missing JPEG marker."));for(var i,r,d,u,g=2,f=e.byteLength-4,p=g;g<f&&((i=e.getUint16(g))>=65504&&i<=65519||65534===i);){if(g+(r=e.getUint16(g+2)+2)>e.byteLength){console.log("Invalid JPEG metadata: Invalid segment size.");break}if((d=a.jpeg[i])&&!o.disableMetaDataParsers)for(u=0;u<d.length;u+=1)d[u].call(l,e,g,r,h,o);p=g+=r}!o.disableImageHead&&p>6&&(h.imageHead=n.call(t,0,p)),s(h)}),c,"readAsArrayBuffer")||s(h)}return o=o||{},e.Promise&&"function"!=typeof s?(h=o=s||{},new Promise(c)):(h=h||{},c(s,s))}function o(t,e,i){return t&&e&&i?new Blob([i,r.call(t,e.byteLength)],{type:"image/jpeg"}):null}t.transform=function(r,n,a,o,h){t.requiresMetaData(n)?s(o,(function(s){s!==h&&(e.console&&console.log(s),s=h),i.call(t,r,n,a,o,s)}),n,h=h||{}):i.apply(t,arguments)},t.blobSlice=r,t.bufferSlice=n,t.replaceHead=function(t,i,r){var n={maxMetaDataSize:256,disableMetaDataParsers:!0};if(!r&&e.Promise)return s(t,n).then((function(e){return o(t,e.imageHead,i)}));s(t,(function(e){r(o(t,e.imageHead,i))}),n)},t.parseMetaData=s,t.metaDataParsers=a})?r.apply(e,n):r)||(t.exports=a)}()},922:(t,e,i)=>{var r,n,a;!function(s){"use strict";n=[i(302),i(200),i(630)],void 0===(a="function"==typeof(r=function(t){var e=t.transform,i=t.requiresCanvas,r=t.requiresMetaData,n=t.transformCoordinates,a=t.getTransformedOptions;function s(e,i){var r=e&&e.orientation;return!0===r&&!t.orientation||1===r&&t.orientation||(!i||t.orientation)&&r>1&&r<9}function o(t,e){return t!==e&&(1===t&&e>1&&e<9||t>1&&t<9)}function h(t,e){if(e>1&&e<9)switch(t){case 2:case 4:return e>4;case 5:case 7:return e%2==0;case 6:case 8:return 2===e||4===e||5===e||7===e}return!1}(function(t){if(t.global.document){var e=document.createElement("img");e.onload=function(){if(t.orientation=2===e.width&&3===e.height,t.orientation){var i=t.createCanvas(1,1,!0).getContext("2d");i.drawImage(e,1,1,1,1,0,0,1,1),t.orientationCropBug="255,255,255,255"!==i.getImageData(0,0,1,1).data.toString()}},e.src="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/xABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAAAAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQvoP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXwH
1/9k="}})(t),t.requiresCanvas=function(e){return s(e)||i.call(t,e)},t.requiresMetaData=function(e){return s(e,!0)||r.call(t,e)},t.transform=function(i,r,n,a,s){e.call(t,i,r,(function(e,i){if(i){var r=t.orientation&&i.exif&&i.exif.get("Orientation");if(r>4&&r<9){var a=i.originalWidth,s=i.originalHeight;i.originalWidth=s,i.originalHeight=a}}n(e,i)}),a,s)},t.getTransformedOptions=function(e,i,r){var n=a.call(t,e,i),s=r.exif&&r.exif.get("Orientation"),l=n.orientation,c=t.orientation&&s;if(!0===l&&(l=s),!o(l,c))return n;var d=n.top,u=n.right,g=n.bottom,f=n.left,p={};for(var m in n)Object.prototype.hasOwnProperty.call(n,m)&&(p[m]=n[m]);if(p.orientation=l,(l>4&&!(c>4)||l<5&&c>4)&&(p.maxWidth=n.maxHeight,p.maxHeight=n.maxWidth,p.minWidth=n.minHeight,p.minHeight=n.minWidth,p.sourceWidth=n.sourceHeight,p.sourceHeight=n.sourceWidth),c>1){switch(c){case 2:u=n.left,f=n.right;break;case 3:d=n.bottom,u=n.left,g=n.top,f=n.right;break;case 4:d=n.bottom,g=n.top;break;case 5:d=n.left,u=n.bottom,g=n.right,f=n.top;break;case 6:d=n.left,u=n.top,g=n.right,f=n.bottom;break;case 7:d=n.right,u=n.top,g=n.left,f=n.bottom;break;case 8:d=n.right,u=n.bottom,g=n.left,f=n.top}if(h(l,c)){var v=d,y=u;d=g,u=f,g=v,f=y}}switch(p.top=d,p.right=u,p.bottom=g,p.left=f,l){case 2:p.right=f,p.left=u;break;case 3:p.top=g,p.right=f,p.bottom=d,p.left=u;break;case 4:p.top=g,p.bottom=d;break;case 5:p.top=f,p.right=g,p.bottom=u,p.left=d;break;
1case 6:p.top=u,p.right=g,p.bottom=f,p.left=d;break;case 7:p.top=u,p.right=d,p.bottom=f,p.left=g;break;case 8:p.top=f,p.right=d,p.bottom=u,p.left=g}return p},t.transformCoordinates=function(e,i,r){n.call(t,e,i,r);var a=i.orientation,s=t.orientation&&r.exif&&r.exif.get("Orientation");if(o(a,s)){var l=e.getContext("2d"),c=e.width,d=e.height,u=c,g=d;switch((a>4&&!(s>4)||a<5&&s>4)&&(e.width=d,e.height=c),a>4&&(u=d,g=c),s){case 2:l.translate(u,0),l.scale(-1,1);break;case 3:l.translate(u,g),l.rotate(Math.PI);break;case 4:l.translate(0,g),l.scale(1,-1);break;case 5:l.rotate(-.5*Math.PI),l.scale(-1,1);break;case 6:l.rotate(-.5*Math.PI),l.translate(-u,0);break;case 7:l.rotate(-.5*Math.PI),l.translate(-u,g),l.scale(1,-1);break;case 8:l.rotate(.5*Math.PI),l.translate(0,-g)}switch(h(a,s)&&(l.translate(u,g),l.rotate(Math.PI)),a){case 2:l.translate(c,0),l.scale(-1,1);break;case 3:l.translate(c,d),l.rotate(Math.PI);break;case 4:l.translate(0,d),l.scale(1,-1);break;case 5:l.rotate(.5*Math.PI),l.scale(1,-1);break;case 6:l.rotate(.5*Math.PI),l.translate(0,-d);break;case 7:l.rotate(.5*Math.PI),l.translate(c,-d),l.scale(-1,1);break;case 8:l.rotate(-.5*Math.PI),l.translate(-c,0)}}}})?r.apply(e,n):r)||(t.exports=a)}()},200:(t,e,i)=>{var r,n,a;!function(s){"use strict";n=[i(302)],void 0===(a="function"==typeof(r=function(t){var e=t.transform;t.createCanvas=function(e,i,r){if(r&&t.global.OffscreenCanvas)return new OffscreenCanvas(e,i);var n=document.createElement("canvas");return n.width=e,n.height=i,n},t.transform=function(i,r,n,a,s){e.call(t,t.scale(i,r,s),r,n,a,s)},t.transformCoordinates=function(){},t.getTransformedOptions=function(t,e){var i,r,n,a,s=e.aspectRatio;if(!s)return e;for(r in i={},e)Object.prototype.hasOwnProperty.call(e,r)&&(i[r]=e[r]);return i.crop=!0,(n=t.naturalWidth||t.width)/(a=t.naturalHeight||t.height)>s?(i.maxWidth=a*s,i.maxHeight=a):(i.maxWidth=n,i.maxHeight=n/s),i},t.drawImage=function(t,e,i,r,n,a,s,o,h){var l=e.getContext("2d");return!1===h.imageSmoothingEnabled?(l.msImageSmoothingEnabled=!1,l.imageSmoothingEnabled=!1):h.imageSmoothingQuality&&(l.imageSmoothingQuality=h.imageSmoothingQuality),l.drawImage(t,i,r,n,a,0,0,s,o),l},t.requiresCanvas=function(t){return t.canvas||t.crop||!!t.aspectRatio},t.scale=function(e,i,r){i=i||{},r=r||{};var n,a,s,o,h,l,c,d,u,g,f,p,m=e.getContext||t.requiresCanvas(i)&&!!t.global.HTMLCanvasElement,v=e.naturalWidth||e.width,y=e.naturalHeight||e.height,b=v,C=y;function _(){var t=Math.max((s||b)/b,(o||C)/C);t>1&&(b*=t,C*=t)}function S(){var t=Math.min((n||b)/b,(a||C)/C);t<1&&(b*=t,C*=t)}if(m&&(c=(i=t.getTransformedOptions(e,i,r)).left||0,d=i.top||0,i.sourceWidth?(h=i.sourceWidth,void 0!==i.right&&void 0===i.left&&(c=v-h-i.right)):h=v-c-(i.right||0),i.sourceHeight?(l=i.sourceHeight,void 0!==i.bottom&&void 0===i.top&&(d=y-l-i.bottom)):l=y-d-(i.bottom||0),b=h,C=l),n=i.maxWidth,a=i.maxHeight,s=i.minWidth,o=i.minHeight,m&&n&&a&&i.crop?(b=n,C=a,(f=h/l-n/a)<0?(l=a*h/n,void 0===i.top&&void 0===i.bottom&&(d=(y-l)/2)):f>0&&(h=n*l/a,void 0===i.left&&void 0===i.right&&(c=(v-h)/2))):((i.contain||i.cover)&&(s=n=n||s,o=a=a||o),i.cover?(S(),_()):(_(),S())),m){if((u=i.pixelRatio)>1&&(!e.style.width||Math.floor(parseFloat(e.style.width,10))!==Math.floor(v/u))&&(b*=u,C*=u),t.orientationCropBug&&!e.getContext&&(c||d||h!==v||l!==y)&&(f=e,e=t.createCanvas(v,y,!0),t.drawImage(f,e,0,0,v,y,v,y,i)),(g=i.downsamplingRatio)>0&&g<1&&b<h&&C<l)for(;h*g>b;)p=t.createCanvas(h*g,l*g,!0),t.drawImage(e,p,c,d,h,l,p.width,p.height,i),c=0,d=0,h=p.width,l=p.height,e=p;return p=t.createCanvas(b,C),t.transformCoordinates(p,i,r),u>1&&(p.style.width=p.width/u+"px"),t.drawImage(e,p,c,d,h,l,b,C,i).setTransform(1,0,0,1,0,0),p}return e.width=b,e.height=C,e}})?r.apply(e,n):r)||(t.exports=a)}()},302:function(t,e,i){var r;!function(n){"use strict";var a=n.URL||n.webkitURL;function s(t){return!!a&&a.createObjectURL(t)}function o(t){return!!a&&a.revokeObjectURL(t)}function h(t,e){!t||"blob:"!==t.slice(0,5)||e&&e.noRevoke||o(t)}function l(t,e,i,r){if(!n.FileReader)return!1;var a=new FileReader;a.onload=function(){e.call(a,this.result)},i&&(a.onabort=a.onerror=function(){i.call(a,this.error)});
1var s=a[r||"readAsDataURL"];return s?(s.call(a,t),a):void 0}function c(t,e){return Object.prototype.toString.call(e)==="[object "+t+"]"}function d(t,e,i){function r(e,r){var a,o=document.createElement("img");function u(t,i){e!==r?t instanceof Error?r(t):((i=i||{}).image=t,e(i)):e&&e(t,i)}function g(e,r){r&&n.console&&console.log(r),e&&c("Blob",e)?a=s(t=e):(a=t,i&&i.crossOrigin&&(o.crossOrigin=i.crossOrigin)),o.src=a}return o.onerror=function(t){h(a,i),r&&r.call(o,t)},o.onload=function(){h(a,i);var e={originalWidth:o.naturalWidth||o.width,originalHeight:o.naturalHeight||o.height};try{d.transform(o,i,u,t,e)}catch(t){r&&r(t)}},"string"==typeof t?(d.requiresMetaData(i)?d.fetchBlob(t,g,i):g(),o):c("Blob",t)||c("File",t)?(a=s(t))?(o.src=a,o):l(t,(function(t){o.src=t}),r):void 0}return n.Promise&&"function"!=typeof e?(i=e,new Promise(r)):r(e,e)}d.requiresMetaData=function(t){return t&&t.meta},d.fetchBlob=function(t,e){e()},d.transform=function(t,e,i,r,n){i(t,n)},d.global=n,d.readFile=l,d.isInstanceOf=c,d.createObjectURL=s,d.revokeObjectURL=o,void 0===(r=function(){return d}.call(e,i,e,t))||(t.exports=r)}("undefined"!=typeof window&&window||this)},918:function(t,e){var i;(function(){var r=function(t){return t instanceof r?t:this instanceof r?void(this.EXIFwrapped=t):new r(t)};t.exports&&(e=t.exports=r),e.EXIF=r;var a=r.Tags={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"E
1xposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"},s=r.TiffTags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},o=r.GPSTags={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"},h=r.IFD1Tags={256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",296:"ResolutionUnit",513:"JpegIFOffset",514:"JpegIFByteCount",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite"},l=r.StringValues={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}};function c(t){return!!t.exifdata}function d(t,e){function i(i){var n=u(i);t.exifdata=n||{};var a=function(t){var e=new DataView(t);if(255!=e.getUint8(0)||216!=e.getUint8(1))return!1;for(var i=2,r=t.byteLength,n=function(t,e){return 56===t.getUint8(e)&&66===t.getUint8(e+1)&&73===t.getUint8(e+2)&&77===t.getUint8(e+3)&&4===t.getUint8(e+4)&&4===t.getUint8(e+5)};i<r;){if(n(e,i)){var a=e.getUint8(i+7);return a%2!=0&&(a+=1),0===a&&(a=4),f(t,i+8+a,e.getUint16(i+6+a))}i++}}(i);if(t.iptcdata=a||{},r.isXmpEnabled){var s=function(t){if("DOMParser"in self){var e=new DataView(t);if(255!=e.getUint8(0)||216!=e.getUint8(1))return!1;for(var i=2,r=t.byteLength,n=new DOMParser;i<r-4;){if("http"==v(e,i,4)){var a=i-1,s=e.getUint16(i-2)-1,o=v(e,a,s),h=o.indexOf("xmpmeta>")+8,l=(o=o.substring(o.indexOf("<x:xmpmeta"),h)).indexOf("x:xmpmeta")+10;return o=o.slice(0,l)+'xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus" xmlns:ext="http://www.gettyimages.com/xsltExtension/1.0" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.
10/" xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" '+o.slice(l),C(n.parseFromString(o,"text/xml"))}i++}}}(i);t.xmpdata=s||{}}e&&e.call(t)}if(t.src)if(/^data\:/i.test(t.src))i(function(t,e){e=e||t.match(/^data\:([^\;]+)\;base64,/im)[1]||"",t=t.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var i=atob(t),r=i.length,n=new ArrayBuffer(r),a=new Uint8Array(n),s=0;s<r;s++)a[s]=i.charCodeAt(s);return n}(t.src));else if(/^blob\:/i.test(t.src))(a=new FileReader).onload=function(t){i(t.target.result)},function(t,e){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="blob",i.onload=function(t){var e;200!=this.status&&0!==this.status||(e=this.response,a.readAsArrayBuffer(e))},i.send()}(t.src);else{var n=new XMLHttpRequest;n.onload=function(){if(200!=this.status&&0!==this.status)throw"Could not load image";i(n.response),n=null},n.open("GET",t.src,!0),n.responseType="arraybuffer",n.send(null)}else if(self.FileReader&&(t instanceof self.Blob||t instanceof self.File)){var a;(a=new FileReader).onload=function(t){i(t.target.result)},a.readAsArrayBuffer(t)}}function u(t){var e=new DataView(t);if(255!=e.getUint8(0)||216!=e.getUint8(1))return!1;for(var i=2,r=t.byteLength;i<r;){if(255!=e.getUint8(i))return!1;if(225==e.getUint8(i+1))return y(e,i+4,e.getUint16(i+2));i+=2+e.getUint16(i+2)}}var g={120:"caption",110:"credit",25:"keywords",55:"dateCreated",80:"byline",85:"bylineTitle",122:"captionWriter",105:"headline",116:"copyright",15:"category"};function f(t,e,i){for(var r,n,a,s,o=new DataView(t),h={},l=e;l<e+i;)28===o.getUint8(l)&&2===o.getUint8(l+1)&&(s=o.getUint8(l+2))in g&&(a=o.getInt16(l+3),n=g[s],r=v(o,l+5,a),h.hasOwnProperty(n)?h[n]instanceof Array?h[n].push(r):h[n]=[h[n],r]:h[n]=r),l++;return h}function p(t,e,i,r,n){var a,s,o=t.getUint16(i,!n),h={};for(s=0;s<o;s++)a=i+12*s+2,h[r[t.getUint16(a,!n)]]=m(t,a,e,0,n);return h}function m(t,e,i,r,n){var a,s,o,h,l,c,d=t.getUint16(e+2,!n),u=t.getUint32(e+4,!n),g=t.getUint32(e+8,!n)+i;switch(d){case 1:case 7:if(1==u)return t.getUint8(e+8,!n);for(a=u>4?g:e+8,s=[],h=0;h<u;h++)s[h]=t.getUint8(a+h);return s;case 2:return v(t,a=u>4?g:e+8,u-1);case 3:if(1==u)return t.getUint16(e+8,!n);for(a=u>2?g:e+8,s=[],h=0;h<u;h++)s[h]=t.getUint16(a+2*h,!n);return s;case 4:if(1==u)return t.getUint32(e+8,!n);for(s=[],h=0;h<u;h++)s[h]=t.getUint32(g+4*h,!n);return s;case 5:if(1==u)return l=t.getUint32(g,!n),c=t.getUint32(g+4,!n),(o=new Number(l/c)).numerator=l,o.denominator=c,o;for(s=[],h=0;h<u;h++)l=t.getUint32(g+8*h,!n),c=t.getUint32(g+4+8*h,!n),s[h]=new Number(l/c),s[h].numerator=l,s[h].denominator=c;return s;case 9:if(1==u)return t.getInt32(e+8,!n);for(s=[],h=0;h<u;h++)s[h]=t.getInt32(g+4*h,!n);return s;case 10:if(1==u)return t.getInt32(g,!n)/t.getInt32(g+4,!n);for(s=[],h=0;h<u;h++)s[h]=t.getInt32(g+8*h,!n)/t.getInt32(g+4+8*h,!n);return s}}function v(t,e,i){var r="";for(n=e;n<e+i;n++)r+=String.fromCharCode(t.getUint8(n));return r}function y(t,e){if("Exif"!=v(t,e,4))return!1;var i,r,n,c,d,u=e+6;if(18761==t.getUint16(u))i=!1;else{if(19789!=t.getUint16(u))return!1;i=!0}if(42!=t.getUint16(u+2,!i))return!1;var g=t.getUint32(u+4,!i);if(g<8)return!1;if((r=p(t,u,u+g,s,i)).ExifIFDPointer)for(n in c=p(t,u,u+r.ExifIFDPointer,a,i)){switch(n){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":c[n]=l[n][c[n]];break;case"ExifVersion":case"FlashpixVersion":c[n]=String.fromCharCode(c[n][0],c[n][1],c[n][2],c[n][3]);break;case"ComponentsConfiguration":c[n]=l.Components[c[n][0]]+l.Components[c[n][1]]+l.Components[c[n][2]]+l.Components[c[n][3]]}r[n]=c[n]}if(r.GPSInfoIFDPointer)for(n in d=p(t,u,u+r.GPSInfoIFDPointer,o,i))"GPSVersionID"===n&&(d[n]=d[n][0]+"."+d[n][1]+"."+d[n][2]+"."+d[n][3]),r[n]=d[n];return r.thumbnail=function(t,e,i,r){var n=function(t,e,i){var r=t.getUint16(e,!i);return t.getUint32(e+2+12*r,!i)}(t,e+i,r);if(!n)return{};if(n>t.byteLength)return{};var a=p(t,e,e+n,h,r);
1if(a.Compression)switch(a.Compression){case 6:if(a.JpegIFOffset&&a.JpegIFByteCount){var s=e+a.JpegIFOffset,o=a.JpegIFByteCount;a.blob=new Blob([new Uint8Array(t.buffer,s,o)],{type:"image/jpeg"})}break;case 1:console.log("Thumbnail image format is TIFF, which is not implemented.");break;default:console.log("Unknown thumbnail image format '%s'",a.Compression)}else 2==a.PhotometricInterpretation&&console.log("Thumbnail image format is RGB, which is not implemented.");return a}(t,u,g,i),r}function b(t){var e={};if(1==t.nodeType){if(t.attributes.length>0){e["@attributes"]={};for(var i=0;i<t.attributes.length;i++){var r=t.attributes.item(i);e["@attributes"][r.nodeName]=r.nodeValue}}}else if(3==t.nodeType)return t.nodeValue;if(t.hasChildNodes())for(var n=0;n<t.childNodes.length;n++){var a=t.childNodes.item(n),s=a.nodeName;if(null==e[s])e[s]=b(a);else{if(null==e[s].push){var o=e[s];e[s]=[],e[s].push(o)}e[s].push(b(a))}}return e}function C(t){try{var e={};if(t.children.length>0)for(var i=0;i<t.children.length;i++){var r=t.children.item(i),n=r.attributes;for(var a in n){var s=n[a],o=s.nodeName,h=s.nodeValue;void 0!==o&&(e[o]=h)}var l=r.nodeName;if(void 0===e[l])e[l]=b(r);else{if(void 0===e[l].push){var c=e[l];e[l]=[],e[l].push(c)}e[l].push(b(r))}}else e=t.textContent;return e}catch(t){console.log(t.message)}}r.enableXmp=function(){r.isXmpEnabled=!0},r.disableXmp=function(){r.isXmpEnabled=!1},r.getData=function(t,e){return!((self.Image&&t instanceof self.Image||self.HTMLImageElement&&t instanceof self.HTMLImageElement)&&!t.complete||(c(t)?e&&e.call(t):d(t,e),0))},r.getTag=function(t,e){if(c(t))return t.exifdata[e]},r.getIptcTag=function(t,e){if(c(t))return t.iptcdata[e]},r.getAllTags=function(t){if(!c(t))return{};var e,i=t.exifdata,r={};for(e in i)i.hasOwnProperty(e)&&(r[e]=i[e]);return r},r.getAllIptcTags=function(t){if(!c(t))return{};
1var e,i=t.iptcdata,r={};for(e in i)i.hasOwnProperty(e)&&(r[e]=i[e]);return r},r.pretty=function(t){if(!c(t))return"";var e,i=t.exifdata,r="";for(e in i)i.hasOwnProperty(e)&&("object"==typeof i[e]?i[e]instanceof Number?r+=e+" : "+i[e]+" ["+i[e].numerator+"/"+i[e].denominator+"]\r\n":r+=e+" : ["+i[e].length+" values]\r\n":r+=e+" : "+i[e]+"\r\n");return r},r.readFromBinaryFile=function(t){return u(t)},void 0===(i=function(){return r}.apply(e,[]))||(t.exports=i)}).call(this)},297:t=>{"use strict";t.exports=r}},e={};function a(i){if(e[i])return e[i].exports;var r=e[i]={exports:{}};return t[i].call(r.exports,r,r.exports,a),r.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var i in e)a.o(e,i)&&!a.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};return(()=>{"use strict";a.r(s),a.d(s,{default:()=>_e});var t=a(297),e=a.n(t),r=Math.PI/180;const n="undefined"!=typeof i.g?i.g:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},o={_global:n,version:"8.3.5",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(t){}.toString()),dblClickWindow:400,getAngle:t=>o.angleDeg?t*r:t,enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>o.DD.isDragging,isDragReady:()=>!!o.DD.node,document:n.document,_injectGlobal(t){n.Konva=t}},h=t=>{o[t.prototype.getClassName()]=t};o._injectGlobal(o);class l{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new l(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var e=this.m;return{x:e[0]*t.x+e[2]*t.y+e[4],y:e[1]*t.x+e[3]*t.y+e[5]}}translate(t,e){return this.m[4]+=this.m[0]*t+this.m[2]*e,this.m[5]+=this.m[1]*t+this.m[3]*e,this}scale(t,e){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=e,this.m[3]*=e,this}rotate(t){var e=Math.cos(t),i=Math.sin(t),r=this.m[0]*e+this.m[2]*i,n=this.m[1]*e+this.m[3]*i,a=this.m[0]*-i+this.m[2]*e,s=this.m[1]*-i+this.m[3]*e;return this.m[0]=r,this.m[1]=n,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,e){var i=this.m[0]+this.m[2]*e,r=this.m[1]+this.m[3]*e,n=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=i,this.m[1]=r,this.m[2]=n,this.m[3]=a,this}multiply(t){var e=this.m[0]*t.m[0]+this.m[2]*t.m[1],i=this.m[1]*t.m[0]+this.m[3]*t.m[1],r=this.m[0]*t.m[2]+this.m[2]*t.m[3],n=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=e,this.m[1]=i,this.m[2]=r,this.m[3]=n,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),e=this.m[3]*t,i=-this.m[1]*t,r=-this.m[2]*t,n=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=e,this.m[1]=i,this.m[2]=r,this.m[3]=n,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}setAbsolutePosition(t,e){var i=this.m[0],r=this.m[1],n=this.m[2],a=this.m[3],s=this.m[4],o=(i*(e-this.m[5])-r*(t-s))/(i*a-r*n),h=(t-s-n*o)/i;return this.translate(h,o)}decompose(){var t=this.m[0],e=this.m[1],i=this.m[2],r=this.m[3],n=t*r-e*i;let a={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=t||0!=e){var s=Math.sqrt(t*t+e*e);a.rotation=e>0?Math.acos(t/s):-Math.acos(t/s),a.scaleX=s,a.scaleY=n/s,a.skewX=(t*i+e*r)/n,a.skewY=0}
1else if(0!=i||0!=r){var o=Math.sqrt(i*i+r*r);a.rotation=Math.PI/2-(r>0?Math.acos(-i/o):-Math.acos(i/o)),a.scaleX=n/o,a.scaleY=o,a.skewX=0,a.skewY=(t*i+e*r)/n}return a.rotation=v._getRotation(a.rotation),a}}var c=Math.PI/180,d=180/Math.PI,u="Konva error: ",g={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},f=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,p=[];const m="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(t){setTimeout(t,60)},v={_isElement:t=>!(!t||1!=t.nodeType),_isFunction:t=>!!(t&&t.constructor&&t.call&&t.apply),_isPlainObject:t=>!!t&&t.constructor===Object,_isArray:t=>"[object Array]"===Object.prototype.toString.call(t),_isNumber:t=>"[object Number]"===Object.prototype.toString.call(t)&&!isNaN(t)&&isFinite(t),_isString:t=>"[object String]"===Object.prototype.toString.call(t),_isBoolean:t=>"[object Boolean]"===Object.prototype.toString.call(t),isObject:t=>t instanceof Object,isValidSelector(t){if("string"!=typeof t)return!1;var e=t[0];return"#"===e||"."===e||e===e.toUpperCase()},_sign:t=>0===t||t>
10?1:-1,requestAnimFrame(t){p.push(t),1===p.length&&m((function(){const t=p;p=[],t.forEach((function(t){t()}))}))},createCanvasElement(){var t=document.createElement("canvas");try{t.style=t.style||{}}catch(t){}return t},createImageElement:()=>document.createElement("img"),_isInDocument(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_urlToImage(t,e){var i=v.createImageElement();i.onload=function(){e(i)},i.src=t},_rgbToHex:(t,e,i)=>((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1),_hexToRgb(t){t=t.replace("#","");var e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:255&e}},getRandomColor(){for(var t=(16777215*Math.random()<<0).toString(16);t.length<6;)t="0"+t;return"#"+t},getRGB(t){var e;return t in g?{r:(e=g[t])[0],g:e[1],b:e[2]}:"#"===t[0]?this._hexToRgb(t.substring(1)):"rgb("===t.substr(0,4)?(e=f.exec(t.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA:t=>(t=t||"black",v._namedColorToRBA(t)||v._hex3ColorToRGBA(t)||v._hex6ColorToRGBA(t)||v._rgbColorToRGBA(t)||v._rgbaColorToRGBA(t)||v._hslColorToRGBA(t)),_namedColorToRBA(t){var e=g[t.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(t){if(0===t.indexOf("rgb(")){var e=(t=t.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(t){if(0===t.indexOf("rgba(")){var e=(t=t.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(((t,e)=>"%"===t.slice(-1)?3===e?parseInt(t)/100:parseInt(t)/100*255:Number(t)));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex6ColorToRGBA(t){if("#"===t[0]&&7===t.length)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex3ColorToRGBA(t){if("#"===t[0]&&4===t.length)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:1}},_hslColorToRGBA(t){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(t)){const[e,...i]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t),r=Number(i[0])/360,n=Number(i[1])/100,a=Number(i[2])/100;let s,o,h;if(0===n)return h=255*a,{r:Math.round(h),g:Math.round(h),b:Math.round(h),a:1};s=a<.5?a*(1+n):a+n-a*n;const l=2*a-s,c=[0,0,0];for(let t=0;t<3;t++)o=r+1/3*-(t-1),o<0&&o++,o>1&&o--,h=6*o<1?l+6*(s-l)*o:2*o<1?s:3*o<2?l+(s-l)*(2/3-o)*6:l,c[t]=255*h;return{r:Math.round(c[0]),g:Math.round(c[1]),b:Math.round(c[2]),a:1}}},haveIntersection:(t,e)=>!(e.x>t.x+t.width||e.x+e.width<t.x||e.y>t.y+t.height||e.y+e.height<t.y),cloneObject(t){var e={};for(var i in t)this._isPlainObject(t[i])?e[i]=this.cloneObject(t[i]):this._isArray(t[i])?e[i]=this.cloneArray(t[i]):e[i]=t[i];return e},cloneArray:t=>t.slice(0),degToRad:t=>t*c,radToDeg:t=>t*d,_degToRad:t=>(v.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),v.degToRad(t)),_radToDeg:t=>(v.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),v.radToDeg(t)),_getRotation:t=>o.angleDeg?v.radToDeg(t):t,_capitalize:t=>t.charAt(0).toUpperCase()+t.slice(1),throw(t){throw new Error(u+t)},error(t){console.error(u+t)},warn(t){o.showWarnings&&console.warn("Konva warning: "+t)},each(t,e){for(var i in t)e(i,t[i])},_inRange:(t,e,i)=>e<=t&&t<i,_getProjectionToSegment(t,e,i,r,n,a){var s,o,h,l=(t-i)*(t-i)+(e-r)*(e-r);if(0==l)s=t,o=e,h=(n-i)*(n-i)+(a-r)*(a-r);else{var c=((n-t)*(i-t)+(a-e)*(r-e))/l;c<0?(s=t,o=e,h=(t-n)*(t-n)+(e-a)*(e-a)):c>1?(s=i,o=r,h=(i-n)*(i-n)+(r-a)*(r-a)):h=((s=t+c*(i-t))-n)*(s-n)+((o=e+c*(r-e))-a)*(o-a)}return[s,o,h]},_getProjectionToLine(t,e,i){var r=v.cloneObject(t),n=Number.MAX_VALUE;return e.forEach((function(a,s){if(i||s!==e.length-1){var o=e[(s+1)%e.length],h=v._getProjectionToSegment(a.x,a.y,o.x,o.y,t.x,t.y),l=h[0],c=h[1],d=h[2];d<n&&(r.x=l,r.y=c,n=d)}})),r},_prepareArrayForTween(t,e,i){var r,n=[],a=[];if(t.length>e.length){var s=e;e=t,t=s}for(r=0;r<t.length;r+=2)n.push({x:t[r],y:t[r+1]});for(r=0;r<e.length;r+=2)a.push({x:e[r],y:e[r+1]});var o=[];return a.forEach((function(t){var e=v._getProjectionToLine(t,n,i);o.push(e.x),o.push(e.y)})),o},_prepareToStringify(t){var e;for(var i in t.visitedByCircularReferenceRemoval=!0,t)if(t.hasOwnProperty(i)&&t[i]&&"object"==typeof t[i])if(e=Object.getOwnPropertyDescriptor(t,i),t[i].visitedByCircularReferenceRemoval||v._isElement(t[i])){if(!e.configurable)return null;delete t[i]}else if(null===v._prepareToStringify(t[i])){if(!e.configurable)return null;delete t[i]}return delete t.visitedByCircularReferenceRemoval,t},_assign(t,e){for(var i in e)t[i]=e[i];return t},_getFirstPointerId:t=>t.touches?t.changedTouches[0].identifier:t.pointerId||999};function y(t){return v._isString(t)?'"'+t+'"':"[object Number]"===Object.prototype.toString.call(t)||v._isBoolean(t)?t:Object.prototype.toString.call(t)}function b(){if(o.isUnminified)return function(t,e){return v._isNumber(t)||v.warn(y(t)+' is a not val
1id value for "'+e+'" attribute. The value should be a number.'),t}}function C(){if(o.isUnminified)return function(t,e){return v._isString(t)||v.warn(y(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function _(){if(o.isUnminified)return function(t,e){const i=v._isString(t),r="[object CanvasGradient]"===Object.prototype.toString.call(t)||t&&t.addColorStop;return i||r||v.warn(y(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function S(){if(o.isUnminified)return function(t,e){return!0===t||!1===t||v.warn(y(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}var w="get",x="set";const P={addGetterSetter(t,e,i,r,n){P.addGetter(t,e,i),P.addSetter(t,e,r,n),P.addOverloadedGetterSetter(t,e)},addGetter(t,e,i){var r=w+v._capitalize(e);t.prototype[r]=t.prototype[r]||function(){var t=this.attrs[e];return void 0===t?i:t}},addSetter(t,e,i,r){var n=x+v._capitalize(e);t.prototype[n]||P.overWriteSetter(t,e,i,r)},overWriteSetter(t,e,i,r){var n=x+v._capitalize(e);t.prototype[n]=function(t){return i&&null!=t&&(t=i.call(this,t,e)),this._setAttr(e,t),r&&r.call(this),this}},addComponentsGetterSetter(t,e,i,r,n){var a,s,h=i.length,l=v._capitalize,c=w+l(e),d=x+l(e);t.prototype[c]=function(){var t={};for(a=0;a<h;a++)t[s=i[a]]=this.getAttr(e+l(s));return t};var u=function(t){if(o.isUnminified)return function(e,i){return v.isObject(e)||v.warn(y(e)+' is a not val
1id value for "'+i+'" attribute. The value should be an object with properties '+t),e}}(i);t.prototype[d]=function(t){var i,a=this.attrs[e];for(i in r&&(t=r.call(this,t)),u&&u.call(this,t,e),t)t.hasOwnProperty(i)&&this._setAttr(e+l(i),t[i]);return this._fireChangeEvent(e,a,t),n&&n.call(this),this},P.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){var i=v._capitalize(e),r=x+i,n=w+i;t.prototype[e]=function(){return arguments.length?(this[r](arguments[0]),this):this[n]()}},addDeprecatedGetterSetter(t,e,i,r){v.error("Adding deprecated "+e);var n=w+v._capitalize(e),a=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[n]=function(){v.error(a);var t=this.attrs[e];return void 0===t?i:t},P.addSetter(t,e,r,(function(){v.error(a)})),P.addOverloadedGetterSetter(t,e)},backCompat(t,e){v.each(e,(function(e,i){var r=t.prototype[i],n=w+v._capitalize(e),a=x+v._capitalize(e);function s(){r.apply(this,arguments),v.error('"'+e+'" method is deprecated and will be removed soon. Use ""'+i+'" instead.')}t.prototype[e]=s,t.prototype[n]=s,t.prototype[a]=s}))},afterSetFilter(){this._filterUpToDate=!1}};function A(t){var e,i,r=[],n=t.length,a=v;for(e=0;e<n;e++)i=t[e],a._isNumber(i)?i=Math.round(1e3*i)/1e3:a._isString(i)||(i+=""),r.push(i);return r}var k,E=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"];class D{constructor(t){this.canvas=t,this._context=t._canvas.getContext("2d"),o.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,e){var i,r,n,a,s=this.traceArr,o=s.length,h="";for(i=0;i<o;i++)(n=(r=s[i]).method)?(a=r.args,h+=n,t?h+="()":v._isArray(a[0])?h+="(["+a.join(",")+"])":(e&&(a=a.map((t=>"number"==typeof t?Math.floor(t):t))),h+="("+a.join(",")+")")):(h+=r.property,t||(h+="="+r.val)),h+=";";return h}clearTrace(){this.traceArr=[]}_trace(t){var e=this.traceArr;e.push(t),e.length>=100&&e.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var e=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,e.getWidth()/e.pixelRatio,e.getHeight()/e.pixelRatio)}_applyLineCap(t){var e=t.getLineCap();e&&this.setAttr("lineCap",e)}_applyOpacity(t){var e=t.getAbsoluteOpacity();1!==e&&this.setAttr("globalAlpha",e)}_applyLineJoin(t){var e=t.attrs.lineJoin;e&&this.setAttr("lineJoin",e)}setAttr(t,e){this._context[t]=e}arc(t,e,i,r,n,a){this._context.arc(t,e,i,r,n,a)}arcTo(t,e,i,r,n){this._context.arcTo(t,e,i,r,n)}beginPath(){this._context.beginPath()}bezierCurveTo(t,e,i,r,n,a){this._context.bezierCurveTo(t,e,i,r,n,a)}clearRect(t,e,i,r){this._context.clearRect(t,e,i,r)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,e){var i=arguments;return 2===i.length?this._context.createImageData(t,e):1===i.length?this._context.createImageData(t):void 0}createLinearGradient(t,e,i,r){return this._context.createLinearGradient(t,e,i,r)}createPattern(t,e){return this._context.createPattern(t,e)}createRadialGradient(t,e,i,r,n,a){return this._context.createRadialGradient(t,e,i,r,n,a)}drawImage(t,e,i,r,n,a,s,o,h){var l=arguments,c=this._context;3===l.length?c.drawImage(t,e,i):5===l.length?c.drawImage(t,e,i,r,n):9===l.length&&c.drawImage(t,e,i,r,n,a,s,o,h)}ellipse(t,e,i,r,n,a,s,o){this._context.ellipse(t,e,i,r,n,a,s,o)}isPointInPath(t,e){return this._context.isPointInPath(t,e)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,e,i,r){this._context.fillRect(t,e,i,r)}strokeRect(t,e,i,r){this._context.strokeRect(t,e,i,r)}fillText(t,e,i,r){r?this._context.fillText(t,e,i,r):this._context.fillText(t,e,i)}measureText(t){return this._context.measureText(t)}
1getImageData(t,e,i,r){return this._context.getImageData(t,e,i,r)}lineTo(t,e){this._context.lineTo(t,e)}moveTo(t,e){this._context.moveTo(t,e)}rect(t,e,i,r){this._context.rect(t,e,i,r)}putImageData(t,e,i){this._context.putImageData(t,e,i)}quadraticCurveTo(t,e,i,r){this._context.quadraticCurveTo(t,e,i,r)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,e){this._context.scale(t,e)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,e,i,r,n,a){this._context.setTransform(t,e,i,r,n,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,e,i,r){this._context.strokeText(t,e,i,r)}transform(t,e,i,r,n,a){this._context.transform(t,e,i,r,n,a)}translate(t,e){this._context.translate(t,e)}_enableTrace(){var t,e,i=this,r=E.length,n=this.setAttr,a=function(t){var r,n=i[t];i[t]=function(){return e=A(Array.prototype.slice.call(arguments,0)),r=n.apply(i,arguments),i._trace({method:t,args:e}),r}};for(t=0;t<r;t++)a(E[t]);i.setAttr=function(){n.apply(i,arguments);var t=arguments[0],e=arguments[1];"shadowOffsetX"!==t&&"shadowOffsetY"!==t&&"shadowBlur"!==t||(e/=this.canvas.getPixelRatio()),i._trace({property:t,val:e})}}_applyGlobalCompositeOperation(t){const e=t.attrs.globalCompositeOperation;!e||"source-over"===e||this.setAttr("globalCompositeOperation",e)}}["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"].forEach((function(t){Object.defineProperty(D.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})}));class T extends D{_fillColor(t){var e=t.fill();this.setAttr("fillStyle",e),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var e=t._getLinearGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))}_fillRadialGradient(t){var e=t._getRadialGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))}_fill(t){var e=t.fill(),i=t.getFillPriority();if(e&&"color"===i)this._fillColor(t);else{var r=t.getFillPatternImage();if(r&&"pattern"===i)this._fillPattern(t);else{var n=t.getFillLinearGradientColorStops();if(n&&"linear-gradient"===i)this._fillLinearGradient(t);else{var a=t.getFillRadialGradientColorStops();a&&"radial-gradient"===i?this._fillRadialGradient(t):e?this._fillColor(t):r?this._fillPattern(t):n?this._fillLinearGradient(t):a&&this._fillRadialGradient(t)}}}}_strokeLinearGradient(t){var e=t.getStrokeLinearGradientStartPoint(),i=t.getStrokeLinearGradientEndPoint(),r=t.getStrokeLinearGradientColorStops(),n=this.createLinearGradient(e.x,e.y,i.x,i.y);if(r){for(var a=0;a<r.length;a+=2)n.addColorStop(r[a],r[a+1]);this.setAttr("strokeStyle",n)}}_stroke(t){var e=t.dash(),i=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!i){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t),e&&t.dashEnabled()&&(this.setLineDash(e),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),t.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),i||this.restore()}}_applyShadow(t){var e,i,r,n=null!==(e=t.getShadowRGBA())&&void 0!==e?e:"black",a=null!==(i=t.getShadowBlur())&&void 0!==i?i:5,s=null!==(r=t.getShadowOffset())&&void 0!==r?r:{x:0,y:0},o=t.getAbsoluteScale(),h=this.canvas.getPixelRatio(),l=o.x*h,c=o.y*h;this.setAttr("shadowColor",n),this.setAttr("shadowBlur",a*Math.min(Math.abs(l),Math.abs(c))),this.setAttr("shadowOffsetX",s.x*l),this.setAttr("shadowOffsetY",s.y*c)}}class I extends D{_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){var e=t.getStrokeScaleEnabled();if(!e){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t);var r=t.hitStrokeWidth(),n="auto"===r?t.strokeWidth():r;this.setAttr("lineWidth",n),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),e||this.restore(
1)}}}class R{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var e=(t||{}).pixelRatio||o.pixelRatio||function(){if(k)return k;var t=v.createCanvasElement().getContext("2d");return k=(o._global.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}();this.pixelRatio=e,this._canvas=v.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var e=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/e,this.getHeight()/e)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var e=this.pixelRatio;this.getContext()._context.scale(e,e)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var e=this.pixelRatio;this.getContext()._context.scale(e,e)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,e){this.setWidth(t||0),this.setHeight(e||0)}toDataURL(t,e){try{return this._canvas.toDataURL(t,e)}catch(t){try{return this._canvas.toDataURL()}catch(t){return v.error("Unable to get data URL. "+t.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}P.addGetterSetter(R,"pixelRatio",void 0,b());class L extends R{constructor(t={width:0,height:0}){super(t),this.context=new T(this),this.setSize(t.width,t.height)}}class O extends R{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new I(this),this.setSize(t.width,t.height)}}const G={get isDragging(){var t=!1;return G._dragElements.forEach((e=>{"dragging"===e.dragStatus&&(t=!0)})),t},justDragged:!1,get node(){var t;return G._dragElements.forEach((e=>{t=e.node})),t},_dragElements:new Map,_drag(t){const e=[];G._dragElements.forEach(((i,r)=>{const{node:n}=i,a=n.getStage();a.setPointersPositions(t),void 0===i.pointerId&&(i.pointerId=v._getFirstPointerId(t));const s=a._changedPointerPositions.find((t=>t.id===i.pointerId));if(s){if("dragging"!==i.dragStatus){var o=n.dragDistance();if(Math.max(Math.abs(s.x-i.startPointerPos.x),Math.abs(s.y-i.startPointerPos.y))<o)return;if(n.startDrag({evt:t}),!n.isDragging())return}n._setDragPosition(t,i),e.push(n)}})),e.forEach((e=>{e.fire("dragmove",{type:"dragmove",target:e,evt:t},!0)}))},_endDragBefore(t){G._dragElements.forEach((e=>{const{node:i}=e,r=i.getStage();if(t&&r.setPointersPositions(t),!r._changedPointerPositions.find((t=>t.id===e.pointerId)))return;"dragging"!==e.dragStatus&&"stopped"!==e.dragStatus||(G.justDragged=!0,o._mouseListenClick=!1,o._touchListenClick=!1,o._pointerListenClick=!1,e.dragStatus="stopped");const n=e.node.getLayer()||e.node instanceof o.Stage&&e.node;n&&n.batchDraw()}))},_endDragAfter(t){G._dragElements.forEach(((e,i)=>{"stopped"===e.dragStatus&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:t},!0),"dragging"!==e.dragStatus&&G._dragElements.delete(i)}))}};o.isBrowser&&(window.addEventListener("mouseup",G._endDragBefore,!0),window.addEventListener("touchend",G._endDragBefore,!0),window.addEventListener("mousemove",G._drag),window.addEventListener("touchmove",G._drag),window.addEventListener("mouseup",G._endDragAfter,!1),window.addEventListener("touchend",G._endDragAfter,!1));var M="absoluteOpacity",F="allEventListeners",B="absoluteTransform",U="absoluteScale",j="canvas",H="listening",N="mouseenter",W="mouseleave",z="Shape",Y=" ",X="stage",V="transform",q="visible",Q=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Y);let K=1;class J{constructor(t){this._id=K++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){t!==V&&t!==B||!this._cache.get(t)?t?this._cache.delete(t):this._cache.clear():this._cache.get(t).dirty=!0}_getCache(t,e){var i=this._cache.get(t);return(void 0===i||(t===V||t===B)&&!0===i.dirty)&&(i=e.call(this),this._cache.set(t,i)),i}_calculate(t,e,i){if(!this._attachedDepsListeners.get(t)){const i=e.map((t=>t+"Change.konva")).join(Y);this.on(i,(()=>{this._clearCache(t)})),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,i)}_getCanvasCache(){return this._cache.get(j)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===B&&this.fire("absoluteTransformChange")}clearCache(){return this._cache.delete(j),this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var e=t||{},i={};void 0!==e.x&&void 0!==e.y&&void 0!==e.width&&void 0!==e.height||(i=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var r=Math.ceil(e.width||i.width),n=Math.ceil(e.height||i.height),a=e.pixelRatio,s=void 0===e.x?Math.floor(i.x):e.x,o=void 0===e.y?Math.floor(i.y):e.y,h=e.offset||0,l=e.drawBorder||!1,c=e.hit
1CanvasPixelRatio||1;if(r&&n){s-=h,o-=h;var d=new L({pixelRatio:a,width:r+=2*h+1,height:n+=2*h+1}),u=new L({pixelRatio:a,width:0,height:0}),g=new O({pixelRatio:c,width:r,height:n}),f=d.getContext(),p=g.getContext();return g.isCache=!0,d.isCache=!0,this._cache.delete(j),this._filterUpToDate=!1,!1===e.imageSmoothingEnabled&&(d.getContext()._context.imageSmoothingEnabled=!1,u.getContext()._context.imageSmoothingEnabled=!1),f.save(),p.save(),f.translate(-s,-o),p.translate(-s,-o),this._isUnderCache=!0,this._clearSelfAndDescendantCache(M),this._clearSelfAndDescendantCache(U),this.drawScene(d,this),this.drawHit(g,this),this._isUnderCache=!1,f.restore(),p.restore(),l&&(f.save(),f.beginPath(),f.rect(0,0,r,n),f.closePath(),f.setAttr("strokeStyle","red"),f.setAttr("lineWidth",5),f.stroke(),f.restore()),this._cache.set(j,{scene:d,filter:u,hit:g,x:s,y:o}),this._requestDraw(),this}v.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")}isCached(){return this._cache.has(j)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,e){var i,r,n,a,s=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],o=this.getAbsoluteTransform(e);return s.forEach((function(t){var e=o.point(t);void 0===i&&(i=n=e.x,r=a=e.y),i=Math.min(i,e.x),r=Math.min(r,e.y),n=Math.max(n,e.x),a=Math.max(a,e.y)})),{x:i,y:r,width:n-i,height:a-r}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const e=this._getCanvasCache();t.translate(e.x,e.y);var i=this._getCachedSceneCanvas(),r=i.pixelRatio;t.drawImage(i._canvas,0,0,i.width/r,i.height/r),t.restore()}_drawCachedHitCanvas(t){var e=this._getCanvasCache(),i=e.hit;t.save(),t.translate(e.x,e.y),t.drawImage(i._canvas,0,0,i.width/i.pixelRatio,i.height/i.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t,e,i,r,n=this.filters(),a=this._getCanvasCache(),s=a.scene,o=a.filter,h=o.getContext();if(n){if(!this._filterUpToDate){var l=s.pixelRatio;o.setSize(s.width/s.pixelRatio,s.height/s.pixelRatio);try{for(t=n.length,h.clear(),h.drawImage(s._canvas,0,0,s.getWidth()/l,s.getHeight()/l),e=h.getImageData(0,0,o.getWidth(),o.getHeight()),i=0;i<t;i++)"function"==typeof(r=n[i])?(r.call(this,e),h.putImageData(e,0,0)):v.error("Filter should be type of function, but got "+typeof r+" instead. Please check correct filters")}catch(t){v.error("Unable to apply filter. "+t.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return o}return s}on(t,e){if(this._cache&&this._cache.delete(F),3===arguments.length)return this._delegate.apply(this,arguments);var i,r,n,a,s=t.split(Y),o=s.length;for(i=0;i<o;i++)n=(r=s[i].split("."))[0],a=r[1]||"",this.eventListeners[n]||(this.eventListeners[n]=[]),this.eventListeners[n].push({name:a,handler:e});return this}off(t,e){var i,r,n,a,s,o=(t||"").split(Y),h=o.length;if(this._cache&&this._cache.delete(F),!t)for(r in this.eventListeners)this._off(r);for(i=0;i<h;i++)if(a=(n=o[i].split("."))[0],s=n[1],a)this.eventListeners[a]&&this._off(a,s,e);else for(r in this.eventListeners)this._off(r,s,e);return this}dispatchEvent(t){var e={target:this,type:t.type,evt:t};return this.fire(t.type,e),this}addEventListener(t,e){return this.on(t,(function(t){e.call(this,t.evt)})),this}removeEventListener(t){return this.off(t),this}_delegate(t,e,i){var r=this;this.on(t,(function(t){for(var n=t.target.findAncestors(e,!0,r),a=0;a<n.length;a++)(t=v.cloneObject(t)).currentTarget=n[a],i.call(n[a],t)}))}
1remove(){return this.isDragging()&&this.stopDrag(),G._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(B),this._clearSelfAndDescendantCache(M),this._clearSelfAndDescendantCache(U),this._clearSelfAndDescendantCache(X),this._clearSelfAndDescendantCache(q),this._clearSelfAndDescendantCache(H)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this}getAttr(t){var e="get"+v._capitalize(t);return v._isFunction(this[e])?this[e]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),e=[];t;)e.push(t),t=t.getParent();return e}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges((()=>{var e,i;if(!t)return this;for(e in t)"children"!==e&&(i="set"+v._capitalize(e),v._isFunction(this[i])?this[i](t[e]):this._setAttr(e,t[e]))})),this}isListening(){return this._getCache(H,this._isListening)}_isListening(t){if(!this.listening())return!1;const e=this.getParent();return!e||e===t||this===t||e._isListening(t)}isVisible(){return this._getCache(q,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const e=this.getParent();return!e||e===t||this===t||e._isVisible(t)}shouldDrawHit(t,e=!1){if(t)return this._isVisible(t)&&this._isListening(t);var i=this.getLayer(),r=!1;G._dragElements.forEach((t=>{"dragging"===t.dragStatus&&("Stage"===t.node.nodeType||t.node.getLayer()===i)&&(r=!0)}));var n=!e&&!o.hitOnDragEnabled&&r;return this.isListening()&&this.isVisible()&&!n}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t,e,i,r,n=this.getDepth(),a=this,s=0;return"Stage"!==a.nodeType&&function o(h){for(t=[],e=h.length,i=0;i<e;i++)r=h[i],s++,r.nodeType!==z&&(t=t.concat(r.getChildren().slice())),r._id===a._id&&(i=e);t.length>0&&t[0].getDepth()<=n&&o(t)}(a.getStage().getChildren()),s}getDepth(){for(var t=0,e=this.parent;e;)t++,e=e.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(V),this._clearSelfAndDescendantCache(B)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges((()=>{this.x(t.x),this.y(t.y)})),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var e=this.getAbsoluteTransform().copy();return e.invert(),e.point(t)}getAbsolutePosition(t){let e=!1,i=this.parent;for(;i;){if(i.isCached()){e=!0;break}i=i.parent}e&&!t&&(t=!0);var r=this.getAbsoluteTransform(t).getMatrix(),n=new l,a=this.offset();return n.m=r.slice(),n.translate(a.x,a.y),n.getTranslation()}setAbsolutePosition(t){var e=this._clearTransform();this.attrs.x=e.x,this.attrs.y=e.y,delete e.x,delete e.y,this._clearCache(V);var i=this._getAbsoluteTransform().copy();return i.invert(),i.translate(t.x,t.y),t={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this._setTransform(e),this.setPosition({x:t.x,y:t.y}),this._clearCache(V),this._clearSelfAndDescendantCache(B),this}_setTransform(t){var e;for(e in t)this.attrs[e]=t[e]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var e=t.x,i=t.y,r=this.x(),n=this.y();return void 0!==e&&(r+=e),void 0!==i&&(n+=i),this.setPosition({x:r,y:n}),this}_eachAncestorReverse(t,e){var i,r,n=[],a=this.getParent();if(!e||e._id!==this._id){for(n.unshift(this);a&&(!e||a._id!==e._id);)n.unshift(a),a=a.parent;for(i=n.length,r=0;r<i;r++)t(n[r])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return v.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index;return t<this.parent.getChildren().length-1&&(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0)}moveUp(){if(!this.parent)return v.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index;return t<this.parent.getChildren().length-1&&(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0)}moveDown(){if(!this.parent)return v.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0&&(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0)}moveToBottom(){if(!this.parent)return v.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0&&(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)}setZIndex(t){if(!this.parent)return v.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&v.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var e=this.index;return this.parent.children.splice(e,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(M,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),e=this.getParent();return e&&!e._isUnderCache&&(t*=e.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t,e,i,r,n={},a=this.getAttrs();for(t in n.attrs={},a)e=a[t],v.isObject(e)&&!v._isPlainObject(e)&&!v._isArray(e)||(i="function"==typeof this[t]&&this[t],delete a[t],r=i?i.call(this):null,a[t]=e,r!==e&&(n.attrs[t]=e));return n.className=this.getClassName(),v._prepareToStringify(n)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,e,i){var r=[];e&&this._isMatch(t)&&r.push(this);for(var n=this.parent;n;){if(n===i)return r;n._isMatch(t)&&r.push(n),n=n.parent}return r}isAncestorOf(t){return!1}
1findAncestor(t,e,i){return this.findAncestors(t,e,i)[0]}_isMatch(t){if(!t)return!1;if("function"==typeof t)return t(this);var e,i,r=t.replace(/ /g,"").split(","),n=r.length;for(e=0;e<n;e++)if(i=r[e],v.isValidSelector(i)||(v.warn('Selector "'+i+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),v.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),v.warn("Konva is awesome, right?")),"#"===i.charAt(0)){if(this.id()===i.slice(1))return!0}else if("."===i.charAt(0)){if(this.hasName(i.slice(1)))return!0}else if(this.className===i||this.nodeType===i)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(X,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():void 0}fire(t,e={},i){return e.target=e.target||this,i?this._fireAndBubble(t,e):this._fire(t,e),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(B,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var e;if(t)return e=new l,this._eachAncestorReverse((function(t){var i=t.transformsEnabled();"all"===i?e.multiply(t.getTransform()):"position"===i&&e.translate(t.x()-t.offsetX(),t.y()-t.offsetY())}),t),e;e=this._cache.get(B)||new l,this.parent?this.parent.getAbsoluteTransform().copyInto(e):e.reset();var i=this.transformsEnabled();if("all"===i)e.multiply(this.getTransform());else if("position"===i){const t=this.attrs.x||0,i=this.attrs.y||0,r=this.attrs.offsetX||0,n=this.attrs.offsetY||0;e.translate(t-r,i-n)}return e.dirty=!1,e}getAbsoluteScale(t){for(var e=this;e;)e._isUnderCache&&(t=e),e=e.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(V,this._getTransform)}_getTransform(){var t,e,i=this._cache.get(V)||new l;i.reset();var r=this.x(),n=this.y(),a=o.getAngle(this.rotation()),s=null!==(t=this.attrs.scaleX)&&void 0!==t?t:1,h=null!==(e=this.attrs.scaleY)&&void 0!==e?e:1,c=this.attrs.skewX||0,d=this.attrs.skewY||0,u=this.attrs.offsetX||0,g=this.attrs.offsetY||0;return 0===r&&0===n||i.translate(r,n),0!==a&&i.rotate(a),0===c&&0===d||i.skew(c,d),1===s&&1===h||i.scale(s,h),0===u&&0===g||i.translate(-1*u,-1*g),i.dirty=!1,i}clone(t){var e,i,r,n,a,s=v.cloneObject(this.attrs);for(e in t)s[e]=t[e];var o=new this.constructor(s);for(e in this.eventListeners)for(r=(i=this.eventListeners[e]).length,n=0;n<r;n++)(a=i[n]).name.indexOf("konva")<0&&(o.eventListeners[e]||(o.eventListeners[e]=[]),o.eventListeners[e].push(a));return o}_toKonvaCanvas(t){t=t||{};var e=this.getClientRect(),i=this.getStage(),r=void 0!==t.x?t.x:Math.floor(e.x),n=void 0!==t.y?t.y:Math.floor(e.y),a=t.pixelRatio||1,s=new L({width:t.width||Math.ceil(e.width)||(i?i.width():0),height:t.height||Math.ceil(e.height)||(i?i.height():0),pixelRatio:a}),o=s.getContext();return o.save(),(r||n)&&o.translate(-1*r,-1*n),this.drawScene(s),o.restore(),s}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){var e=(t=t||{}).mimeType||null,i=t.quality||null,r=this._toKonvaCanvas(t).toDataURL(e,i);return t.callback&&t.callback(r),r}toImage(t){if(!t||!t.callback)throw"callback required for toImage method config argument";var e=t.callback;delete t.callback,v._urlToImage(this.toDataURL(t),(function(t){e(t)}))}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():o.dragDistance}_off(t,e,i){var r,n,a,s=this.eventListeners[t];for(r=0;r<s.length;r++)if(n=s[r].name,a=s[r].handler,!("konva"===n&&"konva"!==e||e&&n!==e||i&&i!==a)){if(s.splice(r,1),0===s.length){delete this.eventListeners[t];break}r--}}_fireChangeEvent(t,e,i){this._fire(t+"Change",{oldVal:e,newVal:i})}addName(t){if(!this.hasName(t)){var e=this.name(),i=e?e+" "+t:t;this.name(i)}return this}hasName(t){if(!t)return!1;const e=this.name();return!!e&&-1!==(e||"").split(/\s/g).indexOf(t)}removeName(t){var e=(this.name()||"").split(/\s/g),i=e.indexOf(t);return-1!==i&&(e.splice(i,1),this.name(e.join(" "))),this}
1setAttr(t,e){var i=this["set"+v._capitalize(t)];return v._isFunction(i)?i.call(this,e):this._setAttr(t,e),this}_requestDraw(){if(o.autoDrawEnabled){const t=this.getLayer()||this.getStage();null==t||t.batchDraw()}}_setAttr(t,e){var i=this.attrs[t];(i!==e||v.isObject(e))&&(null==e?delete this.attrs[t]:this.attrs[t]=e,this._shouldFireChangeEvents&&this._fireChangeEvent(t,i,e),this._requestDraw())}_setComponentAttr(t,e,i){var r;void 0!==i&&((r=this.attrs[t])||(this.attrs[t]=this.getAttr(t)),this.attrs[t][e]=i,this._fireChangeEvent(t,r,i))}_fireAndBubble(t,e,i){if(e&&this.nodeType===z&&(e.target=this),t!==N&&t!==W||!(i&&(this===i||this.isAncestorOf&&this.isAncestorOf(i))||"Stage"===this.nodeType&&!i)){this._fire(t,e);var r=(t===N||t===W)&&i&&i.isAncestorOf&&i.isAncestorOf(this)&&!i.isAncestorOf(this.parent);(e&&!e.cancelBubble||!e)&&this.parent&&this.parent.isListening()&&!r&&(i&&i.parent?this._fireAndBubble.call(this.parent,t,e,i):this._fireAndBubble.call(this.parent,t,e))}}_getProtoListeners(t){let e=this._cache.get(F);if(!e){e={};let t=Object.getPrototypeOf(this);for(;t;)if(t.eventListeners){for(var i in t.eventListeners){const r=t.eventListeners[i],n=e[i]||[];e[i]=r.concat(n)}t=Object.getPrototypeOf(t)}else t=Object.getPrototypeOf(t);this._cache.set(F,e)}return e[t]}_fire(t,e){(e=e||{}).currentTarget=this,e.type=t;const i=this._getProtoListeners(t);if(i)for(var r=0;r<i.length;r++)i[r].handler.call(this,e);const n=this.eventListeners[t];if(n)for(r=0;r<n.length;r++)n[r].handler.call(this,e)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var e=t?t.pointerId:void 0,i=this.getStage(),r=this.getAbsolutePosition(),n=i._getPointerById(e)||i._changedPointerPositions[0]||r;G._dragElements.set(this._id,{node:this,startPointerPos:n,offset:{x:n.x-r.x,y:n.y-r.y},dragStatus:"ready",pointerId:e})}startDrag(t,e=!0){G._dragElements.has(this._id)||this._createDragElement(t),G._dragElements.get(this._id).dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},e)}_setDragPosition(t,e){const i=this.getStage()._getPointerById(e.pointerId);if(i){var r={x:i.x-e.offset.x,y:i.y-e.offset.y},n=this.dragBoundFunc();if(void 0!==n){const e=n.call(this,r,t);e?r=e:v.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}this._lastPos&&this._lastPos.x===r.x&&this._lastPos.y===r.y||(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}}stopDrag(t){const e=G._dragElements.get(this._id);e&&(e.dragStatus="stopped"),G._endDragBefore(t),G._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=G._dragElements.get(this._id);return!!t&&"dragging"===t.dragStatus}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",(function(t){if((void 0===t.evt.button||o.dragButtons.indexOf(t.evt.button)>=0)&&!this.isDragging()){var e=!1;G._dragElements.forEach((t=>{this.isAncestorOf(t.node)&&(e=!0)})),e||this._createDragElement(t)}}))}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const t=G._dragElements.get(this._id),e=t&&"dragging"===t.dragStatus,i=t&&"ready"===t.dragStatus;
1e?this.stopDrag():i&&G._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const e=this.getStage();if(!e)return!1;const i={x:-t.x,y:-t.y,width:e.width()+2*t.x,height:e.height()+2*t.y};return v.haveIntersection(i,this.getClientRect())}static create(t,e){return v._isString(t)&&(t=JSON.parse(t)),this._createNode(t,e)}static _createNode(t,e){var i,r,n,a=J.prototype.getClassName.call(t),s=t.children;if(e&&(t.attrs.container=e),o[a]||(v.warn('Can not find a node with class name "'+a+'". Fallback to "Shape".'),a="Shape"),i=new(0,o[a])(t.attrs),s)for(r=s.length,n=0;n<r;n++)i.add(J._createNode(s[n]));return i}}J.prototype.nodeType="Node",J.prototype._attrsAffectingSize=[],J.prototype.eventListeners={},J.prototype.on.call(J.prototype,Q,(function(){this._batchingTransformChange?this._needClearTransformCache=!0:(this._clearCache(V),this._clearSelfAndDescendantCache(B))})),J.prototype.on.call(J.prototype,"visibleChange.konva",(function(){this._clearSelfAndDescendantCache(q)})),J.prototype.on.call(J.prototype,"listeningChange.konva",(function(){this._clearSelfAndDescendantCache(H)})),J.prototype.on.call(J.prototype,"opacityChange.konva",(function(){this._clearSelfAndDescendantCache(M)}));const Z=P.addGetterSetter;Z(J,"zIndex"),Z(J,"absolutePosition"),Z(J,"position"),Z(J,"x",0,b()),Z(J,"y",0,b()),Z(J,"globalCompositeOperation","source-over",C()),Z(J,"opacity",1,b()),Z(J,"name","",C()),Z(J,"id","",C()),Z(J,"rotation",0,b()),P.addComponentsGetterSetter(J,"scale",["x","y"]),Z(J,"scaleX",1,b()),Z(J,"scaleY",1,b()),P.addComponentsGetterSetter(J,"skew",["x","y"]),Z(J,"skewX",0,b()),Z(J,"skewY",0,b()),P.addComponentsGetterSetter(J,"offset",["x","y"]),Z(J,"offsetX",0,b()),Z(J,"offsetY",0,b()),Z(J,"dragDistance",null,b()),Z(J,"width",0,b()),Z(J,"height",0,b()),Z(J,"listening",!0,S()),Z(J,"preventDefault",!0,S()),Z(J,"filters",null,(function(t){return this._filterUpToDate=!1,t})),Z(J,"visible",!0,S()),Z(J,"transformsEnabled","all",C()),Z(J,"size"),Z(J,"dragBoundFunc"),Z(J,"draggable",!1,S()),P.backCompat(J,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class $ extends J{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const e=this.children||[];var i=[];return e.forEach((function(e){t(e)&&i.push(e)})),i}hasChildren(){return this.getChildren().length>0}
1removeChildren(){return this.getChildren().forEach((t=>{t.parent=null,t.index=0,t.remove()})),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach((t=>{t.parent=null,t.index=0,t.destroy()})),this.children=[],this._requestDraw(),this}add(...t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}var i=t[0];return i.getParent()?(i.moveTo(this),this):(this._validateAdd(i),i.index=this.getChildren().length,i.parent=this,i._clearCaches(),this.getChildren().push(i),this._fire("add",{child:i}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var e=this._generalFind(t,!0);return e.length>0?e[0]:void 0}_generalFind(t,e){var i=[];return this._descendants((r=>{const n=r._isMatch(t);return n&&i.push(r),!(!n||!e)})),i}_descendants(t){let e=!1;const i=this.getChildren();for(const r of i){if(e=t(r),e)return!0;if(r.hasChildren()&&(e=r._descendants(t),e))return!0}return!1}toObject(){var t=J.prototype.toObject.call(this);
1return t.children=[],this.getChildren().forEach((e=>{t.children.push(e.toObject())})),t}isAncestorOf(t){for(var e=t.getParent();e;){if(e._id===this._id)return!0;e=e.getParent()}return!1}clone(t){var e=J.prototype.clone.call(this,t);return this.getChildren().forEach((function(t){e.add(t.clone())})),e}getAllIntersections(t){var e=[];return this.find("Shape").forEach((function(i){i.isVisible()&&i.intersects(t)&&e.push(i)})),e}_clearSelfAndDescendantCache(t){var e;super._clearSelfAndDescendantCache(t),this.isCached()||null===(e=this.children)||void 0===e||e.forEach((function(e){e._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;null===(t=this.children)||void 0===t||t.forEach((function(t,e){t.index=e})),this._requestDraw()}drawScene(t,e){var i=this.getLayer(),r=t||i&&i.getCanvas(),n=r&&r.getContext(),a=this._getCanvasCache(),s=a&&a.scene,o=r&&r.isCache;if(!this.isVisible()&&!o)return this;if(s){n.save();var h=this.getAbsoluteTransform(e).getMatrix();n.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedSceneCanvas(n),n.restore()}else this._drawChildren("drawScene",r,e);return this}drawHit(t,e){if(!this.shouldDrawHit(e))return this;var i=this.getLayer(),r=t||i&&i.hitCanvas,n=r&&r.getContext(),a=this._getCanvasCache();if(a&&a.hit){n.save();var s=this.getAbsoluteTransform(e).getMatrix();n.transform(s[0],s[1],s[2],s[3],s[4],s[5]),this._drawCachedHitCanvas(n),n.restore()}else this._drawChildren("drawHit",r,e);return this}_drawChildren(t,e,i){var r,n=e&&e.getContext(),a=this.clipWidth(),s=this.clipHeight(),o=this.clipFunc(),h=a&&s||o;const l=i===this;if(h){n.save();var c=this.getAbsoluteTransform(i),d=c.getMatrix();if(n.transform(d[0],d[1],d[2],d[3],d[4],d[5]),n.beginPath(),o)o.call(this,n,this);else{var u=this.clipX(),g=this.clipY();n.rect(u,g,a,s)}n.clip(),d=c.copy().invert().getMatrix(),n.transform(d[0],d[1],d[2],d[3],d[4],d[5])}var f=!l&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===t;f&&(n.save(),n._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach((function(r){r[t](e,i)})),f&&n.restore(),h&&n.restore()}getClientRect(t){var e,i,r,n,a,s,o=(t=t||{}).skipTransform,h=t.relativeTo,l=this;null===(e=this.children)||void 0===e||e.forEach((function(e){if(e.visible()){var s=e.getClientRect({relativeTo:l,skipShadow:t.skipShadow,skipStroke:t.skipStroke});0===s.width&&0===s.height||(void 0===i?(i=s.x,r=s.y,n=s.x+s.width,a=s.y+s.height):(i=Math.min(i,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x+s.width),a=Math.max(a,s.y+s.height)))}}));for(var c=this.find("Shape"),d=!1,u=0;u<c.length;u++)if(c[u]._isVisible(this)){d=!0;break}return s=d&&void 0!==i?{x:i,y:r,width:n-i,height:a-r}:{x:0,y:0,width:0,height:0},o?s:this._transformedRect(s,h)}}P.addComponentsGetterSetter($,"clip",["x","y","width","height"]),P.addGetterSetter($,"clipX",void 0,b()),P.addGetterSetter($,"clipY",void 0,b()),P.addGetterSetter($,"clipWidth",void 0,b()),P.addGetterSetter($,"clipHeight",void 0,b()),P.addGetterSetter($,"clipFunc");const tt=new Map,et=void 0!==o._global.PointerEvent;function it(t){return tt.get(t)}function rt(t){return{evt:t,pointerId:t.pointerId}}function nt(t,e){return tt.get(t)===e}function at(t,e){st(t),e.getStage()&&(tt.set(t,e),et&&e._fire("gotpointercapture",rt(new PointerEvent("gotpointercapture"))))}function st(t,e){const i=tt.get(t);if(!i)return;const r=i.getStage();r&&r.content,tt.delete(t),et&&i._fire("lostpointercapture",rt(new PointerEvent("lostpointercapture")))}var ot="mouseleave",ht="mouseover",lt="mouseenter",ct="mousemove",dt="mousedown",ut="mouseup",gt="pointermove",ft="pointerdown",pt="pointerup",mt="pointercancel",vt="pointerout",yt="pointerleave",bt="pointerover",Ct="pointerenter",_t="contextmenu",St="touchstart",wt="touchend",xt="touchmove",Pt="touchcancel",At="wheel",kt=[[lt,"_pointerenter"],[dt,"_pointerdown"],[ct,"_pointermove"],[ut,"_pointerup"],[ot,"_pointerleave"],[St,"_pointerdown"],[xt,"_pointermove"],[wt,"_pointerup"],[Pt,"_pointercancel"],[ht,"_pointerover"],[At,"_wheel"],[_t,"_contextmenu"],[ft,"_pointerdown"],[gt,"_pointermove"],[pt,"_pointerup"],[mt,"_pointercancel"],["lostpointercapture","_lostpointercapture"]];const Et={mouse:{[vt]:"mouseout",[yt]:ot,[bt]:ht,[Ct]:lt,[gt]:ct,[ft]:dt,[pt]:ut,[mt]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[vt]:"touchout",[yt]:"touchleave",[bt]:"touchover",[Ct]:"touchenter",[gt]:xt,[ft]:St,[pt]:wt,[mt]:Pt,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[vt]:vt,[yt]:yt,[bt]:bt,[Ct]:Ct,[gt]:gt,[ft]:ft,[pt]:pt,[mt]:mt,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},Dt=t=>t.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",Tt=t=>{const e=Dt(t);return"pointer"===e?o.pointerEventsEnabled&&Et.pointer:"touch"===e?Et.touch:"mouse"===e?Et.mouse:void 0};function It(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&v.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}const Rt=[];class Lt extends ${constructor(t){super(It(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),Rt.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(()=>{It(this.attrs)})),this._checkVisibility()}_validateAdd(t){const e="Layer"===t.getType(),i="FastLayer"===t.getType();e||i||v.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if("string"==typeof t){if("."===t.charAt(0)){var e=t.slice(1);t=document.getElementsByClassName(e)[0]}else{var i;i="#"!==t.charAt(0)?t:t.slice(1),t=document.getElementById(i)}if(!t)throw"Can not find container in document with id "+i}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t,e=this.children,i=e.length;for(t=0;t<i;t++)e[t].clear();return this}clone(t){return t||(t={}),t.container="undefined"!=typeof document&&document.createElement("div"),$.prototype.clone.call(this,t)}destroy(){super.destroy();var t=this.content;t&&v._isInDocument(t)&&this.container().removeChild(t);var e=Rt.indexOf(this);return e>-1&&Rt.splice(e,1),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(v.warn("Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);"),null)}_getPointerById(t){return this._pointerPositions.find((e=>e.id===t))}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){(t=t||{}).x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var e=new L({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),i=e.getContext()._context,r=this.children;return(t.x||t.y)&&i.translate(-1*t.x,-1*t.y),r.forEach((function(e){if(e.isVisible()){var r=e._toKonvaCanvas(t);i.drawImage(r._canvas,t.x,t.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}})),e}getIntersection(t){if(!t)return null;var e,i=this.children;for(e=i.length-1;e>=0;e--){const r=i[e].getIntersection(t);
1if(r)return r}return null}_resizeDOM(){var t=this.width(),e=this.height();this.content&&(this.content.style.width=t+"px",this.content.style.height=e+"px"),this.bufferCanvas.setSize(t,e),this.bufferHitCanvas.setSize(t,e),this.children.forEach((i=>{i.setSize({width:t,height:e}),i.draw()}))}add(t,...e){if(arguments.length>1){for(var i=0;i<arguments.length;i++)this.add(arguments[i]);return this}super.add(t);var r=this.children.length;return r>5&&v.warn("The stage has "+r+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),o.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return nt(t,this)}setPointerCapture(t){at(t,this)}releaseCapture(t){st(t)}getLayers(){return this.children}_bindContentEvents(){o.isBrowser&&kt.forEach((([t,e])=>{this.content.addEventListener(t,(t=>{this[e](t)}))}))}_pointerenter(t){this.setPointersPositions(t);const e=Tt(t.type);this._fire(e.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const e=Tt(t.type);this._fire(e.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let e=this[t+"targetShape"];return e&&!e.getStage()&&(e=null),e}_pointerleave(t){const e=Tt(t.type),i=Dt(t.type);if(e){this.setPointersPositions(t);var r=this._getTargetShape(i),n=!G.isDragging||o.hitOnDragEnabled;r&&n?(r._fireAndBubble(e.pointerout,{evt:t}),r._fireAndBubble(e.pointerleave,{evt:t}),this._fire(e.pointerleave,{evt:t,target:this,currentTarget:this}),this[i+"targetShape"]=null):n&&(this._fire(e.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(e.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){const e=Tt(t.type),i=Dt(t.type);if(e){this.setPointersPositions(t);var r=!1;this._changedPointerPositions.forEach((n=>{var a=this.getIntersection(n);if(G.justDragged=!1,o["_"+i+"ListenClick"]=!0,!a||!a.isListening())return;o.capturePointerEventsEnabled&&a.setPointerCapture(n.id),this[i+"ClickStartShape"]=a,a._fireAndBubble(e.pointerdown,{evt:t,pointerId:n.id}),r=!0;const s=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&s&&t.preventDefault()})),r||this._fire(e.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){const e=Tt(t.type),i=Dt(t.type);if(!e)return;if(G.isDragging&&G.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t),G.isDragging&&!o.hitOnDragEnabled)return;var r={};let n=!1;var a=this._getTargetShape(i);this._changedPointerPositions.forEach((s=>{const o=it(s.id)||this.getIntersection(s),h=s.id,l={evt:t,pointerId:h};var c=a!==o;if(c&&a&&(a._fireAndBubble(e.pointerout,Object.assign({},l),o),a._fireAndBubble(e.pointerleave,Object.assign({},l),o)),o){if(r[o._id])return;r[o._id]=!0}o&&o.isListening()?(n=!0,c&&(o._fireAndBubble(e.pointerover,Object.assign({},l),a),o._fireAndBubble(e.pointerenter,Object.assign({},l),a),this[i+"targetShape"]=o),o._fireAndBubble(e.pointermove,Object.assign({},l))):a&&(this._fire(e.pointerover,{evt:t,target:this,currentTarget:this,pointerId:h}),this[i+"targetShape"]=null)})),n||this._fire(e.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const e=Tt(t.type),i=Dt(t.type);if(!e)return;this.setPointersPositions(t);const r=this[i+"ClickStartShape"],n=this[i+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach((h=>{const l=it(h.id)||this.getIntersection(h);if(l){if(l.releaseCapture(h.id),a[l._id])return;a[l._id]=!0}const c=h.id,d={evt:t,pointerId:c};let u=!1;o["_"+i+"InDblClickWindow"]?(u=!0,clearTimeout(this[i+"DblTimeout"])):G.justDragged||(o["_"+i+"InDblClickWindow"]=!0,clearTimeout(this[i+"DblTimeout"])),this[i+"DblTimeout"]=setTimeout((function(){o["_"+i+"InDblClickWindow"]=!1}),o.dblClickWindow),l&&l.isListening()?(s=!0,this[i+"ClickEndShape"]=l,l._fireAndBubble(e.pointerup,Object.assign({},d)),o["_"+i+"ListenClick"]&&r&&r===l&&(l._fireAndBubble(e.pointerclick,Object.assign({},d)),u&&n&&n===l&&l._fireAndBubble(e.pointerdblclick,Object.assign({},d)))):(this[i+"ClickEndShape"]=null,o["_"+i+"ListenClick"]&&this._fire(e.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:c}),u&&this._fire(e.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:c}))}
1)),s||this._fire(e.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),o["_"+i+"ListenClick"]=!1,t.cancelable&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble(_t,{evt:t}):this._fire(_t,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble(At,{evt:t}):this._fire(At,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const e=it(t.pointerId)||this.getIntersection(this.getPointerPosition());e&&e._fireAndBubble(pt,rt(t)),st(t.pointerId)}_lostpointercapture(t){st(t.pointerId)}setPointersPositions(t){var e=this._getContentPosition(),i=null,r=null;void 0!==(t=t||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,(t=>{this._pointerPositions.push({id:t.identifier,x:(t.clientX-e.left)/e.scaleX,y:(t.clientY-e.top)/e.scaleY})})),Array.prototype.forEach.call(t.changedTouches||t.touches,(t=>{this._changedPointerPositions.push({id:t.identifier,x:(t.clientX-e.left)/e.scaleX,y:(t.clientY-e.top)/e.scaleY})}))):(i=(t.clientX-e.left)/e.scaleX,r=(t.clientY-e.top)/e.scaleY,this.pointerPos={x:i,y:r},this._pointerPositions=[{x:i,y:r,id:v._getFirstPointerId(t)}],this._changedPointerPositions=[{x:i,y:r,id:v._getFirstPointerId(t)}])}_setPointerPosition(t){v.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new L({width:this.width(),height:this.height()}),this.bufferHitCanvas=new O({pixelRatio:1,width:this.width(),height:this.height()}),o.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}}cache(){return v.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}
1batchDraw(){return this.getChildren().forEach((function(t){t.batchDraw()})),this}}Lt.prototype.nodeType="Stage",h(Lt),P.addGetterSetter(Lt,"container");var Ot="hasShadow",Gt="shadowRGBA",Mt="patternImage",Ft="linearGradient",Bt="radialGradient";let Ut;function jt(){return Ut||(Ut=v.createCanvasElement().getContext("2d"),Ut)}const Ht={};class Nt extends J{constructor(t){let e;for(super(t);e=v.getRandomColor(),!e||e in Ht;);this.colorKey=e,Ht[e]=this}getContext(){return v.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return v.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(Ot,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(Mt,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const t=jt().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(t&&t.setTransform){const e=new l;e.translate(this.fillPatternX(),this.fillPatternY()),e.rotate(o.getAngle(this.fillPatternRotation())),e.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),e.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=e.getMatrix(),r="undefined"==typeof DOMMatrix?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);t.setTransform(r)}return t}}_getLinearGradient(){return this._getCache(Ft,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var e=jt(),i=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),n=e.createLinearGradient(i.x,i.y,r.x,r.y),a=0;a<t.length;
1a+=2)n.addColorStop(t[a],t[a+1]);return n}}_getRadialGradient(){return this._getCache(Bt,this.__getRadialGradient)}__getRadialGradient(){var t=this.fillRadialGradientColorStops();if(t){for(var e=jt(),i=this.fillRadialGradientStartPoint(),r=this.fillRadialGradientEndPoint(),n=e.createRadialGradient(i.x,i.y,this.fillRadialGradientStartRadius(),r.x,r.y,this.fillRadialGradientEndRadius()),a=0;a<t.length;a+=2)n.addColorStop(t[a],t[a+1]);return n}}getShadowRGBA(){return this._getCache(Gt,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var t=v.colorToRGBA(this.shadowColor());return"rgba("+t.r+","+t.g+","+t.b+","+t.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],(()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],(()=>this.strokeEnabled()&&this.strokeWidth()&&!(!this.stroke()&&!this.strokeLinearGradientColorStops())))}hasHitStroke(){const t=this.hitStrokeWidth();return"auto"===t?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){var e=this.getStage().bufferHitCanvas;return e.getContext().clear(),this.drawHit(e,null,!0),e.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data[3]>0}destroy(){return J.prototype.destroy.call(this),delete Ht[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var e;if(!this.getStage())return!1;if(null!==(e=this.attrs.perfectDrawEnabled)&&void 0!==e&&!e)return!1;const i=t||this.hasFill(),r=this.hasStroke(),n=1!==this.getAbsoluteOpacity();if(i&&r&&n)return!0;const a=this.hasShadow(),s=this.shadowForStrokeEnabled();return!!(i&&r&&a&&s)}setStrokeHitEnabled(t){v.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return 0!==this.hitStrokeWidth()}getSelfRect(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){const e=t.skipTransform,i=t.relativeTo,r=this.getSelfRect(),n=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,a=r.width+n,s=r.height+n,o=!t.skipShadow&&this.hasShadow(),h=o?this.shadowOffsetX():0,l=o?this.shadowOffsetY():0,c=a+Math.abs(h),d=s+Math.abs(l),u=o&&this.shadowBlur()||0,g={width:c+2*u,height:d+2*u,x:-(n/2+u)+Math.min(h,0)+r.x,y:-(n/2+u)+Math.min(l,0)+r.y};return e?g:this._transformedRect(g,i)}drawScene(t,e){var i,r,n=this.getLayer(),a=t||n.getCanvas(),s=a.getContext(),o=this._getCanvasCache(),h=this.getSceneFunc(),l=this.hasShadow(),c=a.isCache,d=e===this;if(!this.isVisible()&&!d)return this;if(o){s.save();var u=this.getAbsoluteTransform(e).getMatrix();return s.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(s),s.restore(),this}if(!h)return this;if(s.save(),this._useBufferCanvas()&&!c){(r=(i=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var g=this.getAbsoluteTransform(e).getMatrix();r.transform(g[0],g[1],g[2],g[3],g[4],g[5]),h.call(this,r,this),r.restore();var f=i.pixelRatio;l&&s._applyShadow(this),s._applyOpacity(this),s._applyGlobalCompositeOperation(this),s.drawImage(i._canvas,0,0,i.width/f,i.height/f)}else s._applyLineJoin(this),d||(g=this.getAbsoluteTransform(e).getMatrix(),s.transform(g[0],g[1],g[2],g[3],g[4],g[5]),s._applyOpacity(this),s._applyGlobalCompositeOperation(this)),l&&s._applyShadow(this),h.call(this,s,this);return s.restore(),this}drawHit(t,e,i=!1){if(!this.shouldDrawHit(e,i))return this;var r=this.getLayer(),n=t||r.hitCanvas,a=n&&n.getContext(),s=this.hitFunc()||this.sceneFunc(),o=this._getCanvasCache(),h=o&&o.hit;if(this.colorKey||v.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),h){a.save();var l=this.getAbsoluteTransform(e).getMatrix();return a.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(a),a.restore(
1),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),this!==e){var c=this.getAbsoluteTransform(e).getMatrix();a.transform(c[0],c[1],c[2],c[3],c[4],c[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var e,i,r,n,a,s=this._getCanvasCache(),o=this._getCachedSceneCanvas(),h=s.hit,l=h.getContext(),c=h.getWidth(),d=h.getHeight();l.clear(),l.drawImage(o._canvas,0,0,c,d);try{for(r=(i=(e=l.getImageData(0,0,c,d)).data).length,n=v._hexToRgb(this.colorKey),a=0;a<r;a+=4)i[a+3]>t?(i[a]=n.r,i[a+1]=n.g,i[a+2]=n.b,i[a+3]=255):i[a+3]=0;l.putImageData(e,0,0)}catch(t){v.error("Unable to draw hit graph from cached scene canvas. "+t.message)}return this}hasPointerCapture(t){return nt(t,this)}setPointerCapture(t){at(t,this)}releaseCapture(t){st(t)}}Nt.prototype._fillFunc=function(t){t.fill()},Nt.prototype._strokeFunc=function(t){t.stroke()},Nt.prototype._fillFuncHit=function(t){t.fill()},Nt.prototype._strokeFuncHit=function(t){t.stroke()},Nt.prototype._centroid=!1,Nt.prototype.nodeType="Shape",h(Nt),Nt.prototype.eventListeners={},Nt.prototype.on.call(Nt.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(Ot)})),Nt.prototype.on.call(Nt.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",(function(){this._clearCache(Gt)})),Nt.prototype.on.call(Nt.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",(function(){this._clearCache(Mt)})),Nt.prototype.on.call(Nt.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",(function(){this._clearCache(Ft)})),Nt.prototype.on.call(Nt.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",(function(){this._clearCache(Bt)})),P.addGetterSetter(Nt,"stroke",void 0,_()),P.addGetterSetter(Nt,"strokeWidth",2,b()),P.addGetterSetter(Nt,"fillAfterStrokeEnabled",!1),P.addGetterSetter(Nt,"hitStrokeWidth","auto",function(){if(o.isUnminified)return function(t,e){return v._isNumber(t)||"auto"===t||v.warn(y(t)+' is a not val
1id value for "'+e+'" attribute. The value should be a number or "auto".'),t}}()),P.addGetterSetter(Nt,"strokeHitEnabled",!0,S()),P.addGetterSetter(Nt,"perfectDrawEnabled",!0,S()),P.addGetterSetter(Nt,"shadowForStrokeEnabled",!0,S()),P.addGetterSetter(Nt,"lineJoin"),P.addGetterSetter(Nt,"lineCap"),P.addGetterSetter(Nt,"sceneFunc"),P.addGetterSetter(Nt,"hitFunc"),P.addGetterSetter(Nt,"dash"),P.addGetterSetter(Nt,"dashOffset",0,b()),P.addGetterSetter(Nt,"shadowColor",void 0,C()),P.addGetterSetter(Nt,"shadowBlur",0,b()),P.addGetterSetter(Nt,"shadowOpacity",1,b()),P.addComponentsGetterSetter(Nt,"shadowOffset",["x","y"]),P.addGetterSetter(Nt,"shadowOffsetX",0,b()),P.addGetterSetter(Nt,"shadowOffsetY",0,b()),P.addGetterSetter(Nt,"fillPatternImage"),P.addGetterSetter(Nt,"fill",void 0,_()),P.addGetterSetter(Nt,"fillPatternX",0,b()),P.addGetterSetter(Nt,"fillPatternY",0,b()),P.addGetterSetter(Nt,"fillLinearGradientColorStops"),P.addGetterSetter(Nt,"strokeLinearGradientColorStops"),P.addGetterSetter(Nt,"fillRadialGradientStartRadius",0),P.addGetterSetter(Nt,"fillRadialGradientEndRadius",0),P.addGetterSetter(Nt,"fillRadialGradientColorStops"),P.addGetterSetter(Nt,"fillPatternRepeat","repeat"),P.addGetterSetter(Nt,"fillEnabled",!0),P.addGetterSetter(Nt,"strokeEnabled",!0),P.addGetterSetter(Nt,"shadowEnabled",!0),P.addGetterSetter(Nt,"dashEnabled",!0),P.addGetterSetter(Nt,"strokeScaleEnabled",!0),P.addGetterSetter(Nt,"fillPriority","color"),P.addComponentsGetterSetter(Nt,"fillPatternOffset",["x","y"]),P.addGetterSetter(Nt,"fillPatternOffsetX",0,b()),P.addGetterSetter(Nt,"fillPatternOffsetY",0,b()),P.addComponentsGetterSetter(Nt,"fillPatternScale",["x","y"]),P.addGetterSetter(Nt,"fillPatternScaleX",1,b()),P.addGetterSetter(Nt,"fillPatternScaleY",1,b()),P.addComponentsGetterSetter(Nt,"fillLinearGradientStartPoint",["x","y"]),P.addComponentsGetterSetter(Nt,"strokeLinearGradientStartPoint",["x","y"]),P.addGetterSetter(Nt,"fillLinearGradientStartPointX",0),P.addGetterSetter(Nt,"strokeLinearGradientStartPointX",0),P.addGetterSetter(Nt,"fillLinearGradientStartPointY",0),P.addGetterSetter(Nt,"strokeLinearGradientStartPointY",0),P.addComponentsGetterSetter(Nt,"fillLinearGradientEndPoint",["x","y"]),P.addComponentsGetterSetter(Nt,"strokeLinearGradientEndPoint",["x","y"]),P.addGetterSetter(Nt,"fillLinearGradientEndPointX",0),P.addGetterSetter(Nt,"strokeLinearGradientEndPointX",0),P.addGetterSetter(Nt,"fillLinearGradientEndPointY",0),P.addGetterSetter(Nt,"strokeLinearGradientEndPointY",0),P.addComponentsGetterSetter(Nt,"fillRadialGradientStartPoint",["x","y"]),P.addGetterSetter(Nt,"fillRadialGradientStartPointX",0),P.addGetterSetter(Nt,"fillRadialGradientStartPointY",0),P.addComponentsGetterSetter(Nt,"fillRadialGradientEndPoint",["x","y"]),P.addGetterSetter(Nt,"fillRadialGradientEndPointX",0),P.addGetterSetter(Nt,"fillRadialGradientEndPointY",0),P.addGetterSetter(Nt,"fillPatternRotation",0),P.backCompat(Nt,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var Wt=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],zt=Wt.length;class Yt extends ${constructor(t){super(t),this.canvas=new L,this.hitCanvas=new O({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),t<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[t+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){J.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!J.prototype.moveUp.call(this))return!1;var t=this.getStage();return!(!t||!t.content||(t.content.removeChild(this.getNativeCanvasElement()),this.index<t.children.length-1?t.content.insertBefore(this.getNativeCanvasElement(),t.children[this.index+1].getCanvas()._canvas):t.content.appendChild(this.getNativeCanvasElement()),0))}moveDown(){if(J.prototype.moveDown.call(this)){var t=this.getStage();if(t){var e=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),e[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(J.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var e=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),e[1].getCanvas()._canvas))}return!0}return!1}
1getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return J.prototype.remove.call(this),t&&t.parentNode&&v._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:e}){return this.canvas.setSize(t,e),this.hitCanvas.setSize(t,e),this._setSmoothEnabled(),this}_validateAdd(t){var e=t.getType();"Group"!==e&&"Shape"!==e&&v.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return(t=t||{}).width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=void 0!==t.x?t.x:this.x(),t.y=void 0!==t.y?t.y:this.y(),J.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){const t=this.visible();this.canvas._canvas.style.display=t?"block":"none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){v.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){v.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,v.requestAnimFrame((()=>{this.draw(),this._waitingForDraw=!1}))),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var e=1,i=!1;;){for(let r=0;r<zt;r++){const n=Wt[r],a=this._getIntersection({x:t.x+n.x*e,y:t.y+n.y*e}),s=a.shape;if(s)return s;if(i=!!a.antialiased,!a.antialiased)break}if(!i)return null;e+=1}}_getIntersection(t){const e=this.hitCanvas.pixelRatio,i=this.hitCanvas.context.getImageData(Math.round(t.x*e),Math.round(t.y*e),1,1).data,r=i[3];if(255===r){const t=v._rgbToHex(i[0],i[1],i[2]),e=Ht["#"+t];return e?{shape:e}:{antialiased:!0}}return r>0?{antialiased:!0}:{}}drawScene(t,e){var i=this.getLayer(),r=t||i&&i.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),$.prototype.drawScene.call(this,r,e),this._fire("draw",{node:this}),this}drawHit(t,e){var i=this.getLayer(),r=t||i&&i.hitCanvas;return i&&i.clearBeforeDraw()&&i.getHitCanvas().getContext().clear(),$.prototype.drawHit.call(this,r,e),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){v.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return v.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(this.parent&&this.parent.content){var t=this.parent;this.hitCanvas._canvas.parentNode?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}}Yt.prototype.nodeType="Layer",h(Yt),P.addGetterSetter(Yt,"imageSmoothingEnabled",!0),P.addGetterSetter(Yt,"clearBeforeDraw",!0),P.addGetterSetter(Yt,"hitGraphEnabled",!0,S());class Xt extends Yt{constructor(t){super(t),this.listening(!1),v.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Xt.prototype.nodeType="FastLayer",h(Xt);class Vt extends ${_validateAdd(t){var e=t.getType();"Group"!==e&&"Shape"!==e&&v.throw("You may only add groups and shapes to groups.")}}Vt.prototype.nodeType="Group",h(Vt);var qt=n.performance&&n.performance.now?function(){return n.performance.now()}:function(){return(new Date).getTime()};class Qt{constructor(t,e){this.id=Qt.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:qt(),frameRate:0},this.func=t,this.setLayers(e)}setLayers(t){var e;return e=t?t.length>0?t:[t]:[],this.layers=e,this}getLayers(){return this.layers}addLayer(t){var e,i=this.layers,r=i.length;for(e=0;e<r;e++)if(i[e]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){var t,e=Qt.animations,i=e.length;for(t=0;t<i;t++)if(e[t].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=qt(),Qt._addAnimation(this),this}stop(){return Qt._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){var e,i=t.id,r=this.animations,n=r.length;for(e=0;e<n;e++)if(r[e].id===i){this.animations.splice(e,1);break}}static _runFrames(){var t,e,i,r,n,a,s,o,h={},l=this.animations;for(r=0;r<l.length;r++)if(e=(t=l[r]).layers,i=t.func,t._updateFrameObject(qt()),a=e.length,!i||!1!==i.call(t,t.frame))for(n=0;n<a;n++)void 0!==(s=e[n])._id&&(h[s._id]=s);for(o in h)h.hasOwnProperty(o)&&h[o].batchDraw()}static _animationLoop(){var t=Qt;
1t.animations.length?(t._runFrames(),v.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,v.requestAnimFrame(this._animationLoop))}}Qt.animations=[],Qt.animIdCounter=0,Qt.animRunning=!1;var Kt={node:1,duration:1,easing:1,onFinish:1,yoyo:1},Jt=0,Zt=["fill","stroke","shadowColor"];class $t{constructor(t,e,i,r,n,a,s){this.prop=t,this.propFunc=e,this.begin=r,this._pos=r,this.duration=a,this._change=0,this.prevPos=0,this.yoyo=s,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=i,this._change=n-this.begin,this.pause()}fire(t){var e=this[t];e&&e()}setTime(t){t>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return void 0===t&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var t=this.getTimer()-this._startTime;2===this.state?this.setTime(t):3===this.state&&this.setTime(this.duration-t)}pause(){this.state=1,this.fire("onPause")}getTimer(){return(new Date).getTime()}}class te{constructor(t){var e,i,r=this,n=t.node,a=n._id,s=t.easing||ee.Linear,h=!!t.yoyo;e=void 0===t.duration?.3:0===t.duration?.001:t.duration,this.node=n,this._id=Jt++;var l=n.getLayer()||(n instanceof o.Stage?n.getLayers():null);for(i in l||v.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Qt((function(){r.tween.onEnterFrame()}),l),this.tween=new $t(i,(function(t){r._tweenFunc(t)}),s,0,1,1e3*e,h),this._addListeners(),te.attrs[a]||(te.attrs[a]={}),te.attrs[a][this._id]||(te.attrs[a][this._id]={}),te.tweens[a]||(te.tweens[a]={}),t)void 0===Kt[i]&&this._addAttr(i,t[i]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,e){var i,r,n,a,s,o,h,l,c=this.node,d=c._id;if((n=te.tweens[d][t])&&delete te.attrs[d][n][t],i=c.getAttr(t),v._isArray(e))if(r=[],s=Math.max(e.length,i.length),"points"===t&&e.length!==i.length&&(e.length>i.length?(h=i,i=v._prepareArrayForTween(i,e,c.closed())):(o=e,e=v._prepareArrayForTween(e,i,c.closed()))),0===t.indexOf("fill"))for(a=0;a<s;a++)if(a%2==0)r.push(e[a]-i[a]);else{var u=v.colorToRGBA(i[a]);l=v.colorToRGBA(e[a]),i[a]=u,r.push({r:l.r-u.r,g:l.g-u.g,b:l.b-u.b,a:l.a-u.a})}else for(a=0;a<s;a++)r.push(e[a]-i[a]);else-1!==Zt.indexOf(t)?(i=v.colorToRGBA(i),r={r:(l=v.colorToRGBA(e)).r-i.r,g:l.g-i.g,b:l.b-i.b,a:l.a-i.a}):r=e-i;te.attrs[d][this._id][t]={start:i,diff:r,end:e,trueEnd:o,trueStart:h},te.tweens[d][t]=this._id}_tweenFunc(t){var e,i,r,n,a,s,o,h,l=this.node,c=te.attrs[l._id][this._id];for(e in c){if(r=(i=c[e]).start,n=i.diff,h=i.end,v._isArray(r))if(a=[],o=Math.max(r.length,h.length),0===e.indexOf("fill"))for(s=0;s<o;s++)s%2==0?a.push((r[s]||0)+n[s]*t):a.push("rgba("+Math.round(r[s].r+n[s].r*t)+","+Math.round(r[s].g+n[s].g*t)+","+Math.round(r[s].b+n[s].b*t)+","+(r[s].a+n[s].a*t)+")");else for(s=0;s<o;s++)a.push((r[s]||0)+n[s]*t);else a=-1!==Zt.indexOf(e)?"rgba("+Math.round(r.r+n.r*t)+","+Math.round(r.g+n.g*t)+","+Math.round(r.b+n.b*t)+","+(r.a+n.a*t)+")":r+n*t;l.setAttr(e,a)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,e=te.attrs[t._id][this._id];e.points&&e.points.trueEnd&&t.setAttr("points",e.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,e=te.attrs[t._id][this._id];e.points&&e.points.trueStart&&t.points(e.points.trueStart),this.onReset&&this.onReset()}
1,this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(1e3*t),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t,e=this.node._id,i=this._id,r=te.tweens[e];for(t in this.pause(),r)delete te.tweens[e][t];delete te.attrs[e][i]}}te.attrs={},te.tweens={},J.prototype.to=function(t){var e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new te(t).play()};const ee={BackEaseIn(t,e,i,r){var n=1.70158;return i*(t/=r)*t*((n+1)*t-n)+e},BackEaseOut(t,e,i,r){var n=1.70158;return i*((t=t/r-1)*t*((n+1)*t+n)+1)+e},BackEaseInOut(t,e,i,r){var n=1.70158;return(t/=r/2)<1?i/2*(t*t*((1+(n*=1.525))*t-n))+e:i/2*((t-=2)*t*((1+(n*=1.525))*t+n)+2)+e},ElasticEaseIn(t,e,i,r,n,a){var s=0;return 0===t?e:1==(t/=r)?e+i:(a||(a=.3*r),!n||n<Math.abs(i)?(n=i,s=a/4):s=a/(2*Math.PI)*Math.asin(i/n),-n*Math.pow(2,10*(t-=1))*Math.sin((t*r-s)*(2*Math.PI)/a)+e)},ElasticEaseOut(t,e,i,r,n,a){var s=0;return 0===t?e:1==(t/=r)?e+i:(a||(a=.3*r),!n||n<Math.abs(i)?(n=i,s=a/4):s=a/(2*Math.PI)*Math.asin(i/n),n*Math.pow(2,-10*t)*Math.sin((t*r-s)*(2*Math.PI)/a)+i+e)},ElasticEaseInOut(t,e,i,r,n,a){var s=0;return 0===t?e:2==(t/=r/2)?e+i:(a||(a=r*(.3*1.5)),!n||n<Math.abs(i)?(n=i,s=a/4):s=a/(2*Math.PI)*Math.asin(i/n),t<1?n*Math.pow(2,10*(t-=1))*Math.sin((t*r-s)*(2*Math.PI)/a)*-.5+e:n*Math.pow(2,-10*(t-=1))*Math.sin((t*r-s)*(2*Math.PI)/a)*.5+i+e)},BounceEaseOut:(t,e,i,r)=>(t/=r)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e,BounceEaseIn:(t,e,i,r)=>i-ee.BounceEaseOut(r-t,0,i,r)+e,BounceEaseInOut:(t,e,i,r)=>t<r/2?.5*ee.BounceEaseIn(2*t,0,i,r)+e:.5*ee.BounceEaseOut(2*t-r,0,i,r)+.5*i+e,EaseIn:(t,e,i,r)=>i*(t/=r)*t+e,EaseOut:(t,e,i,r)=>-i*(t/=r)*(t-2)+e,EaseInOut:(t,e,i,r)=>(t/=r/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e,StrongEaseIn:(t,e,i,r)=>i*(t/=r)*t*t*t*t+e,StrongEaseOut:(t,e,i,r)=>i*((t=t/r-1)*t*t*t*t+1)+e,StrongEaseInOut:(t,e,i,r)=>(t/=r/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e,Linear:(t,e,i,r)=>i*t/r+e},ie=v._assign(o,{Util:v,Transform:l,Node:J,Container:$,Stage:Lt,stages:Rt,Layer:Yt,FastLayer:Xt,Group:Vt,DD:G,Shape:Nt,shapes:Ht,Animation:Qt,Tween:te,Easings:ee,Context:D,Canvas:R});var re=a(918),ne=a.n(re),ae=a(303),se=a.n(ae);class oe extends Nt{constructor(t){super(t),this.on("imageChange.konva",(()=>{this._setImageLoad()})),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&4===t.readyState||t&&t.addEventListener&&t.addEventListener("load",(()=>{this._requestDraw()}))}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const e=this.getWidth(),i=this.getHeight(),r=this.attrs.image;let n;if(r){const t=this.attrs.cropWidth,a=this.attrs.cropHeight;n=t&&a?[r,this.cropX(),this.cropY(),t,a,0,0,e,i]:[r,0,0,e,i]}(this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)),r&&t.drawImage.apply(t,n)}_hitFunc(t){var e=this.width(),i=this.height();t.beginPath(),t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,e;return null!==(t=this.attrs.width)&&void 0!==t?t:null===(e=this.image())||void 0===e?void 0:e.width}getHeight(){var t,e;return null!==(t=this.attrs.height)&&void 0!==t?t:null===(e=this.image())||void 0===e?void 0:e.height}static fromURL(t,e,i=null){var r=v.createImageElement();r.onload=function(){var t=new oe({image:r});e(t)},r.onerror=i,r.crossOrigin="Anonymous",r.src=t}}oe.prototype.className="Image",h(oe),P.addGetterSetter(oe,"image"),P.addComponentsGetterSetter(oe,"crop",["x","y","width","height"]),P.addGetterSetter(oe,"cropX",0,b()),P.addGetterSetter(oe,"cropY",0,b()),P.addGetterSetter(oe,"cropWidth",0,b()),P.addGetterSetter(oe,"cropHeight",0,b());class he extends Nt{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}}he.prototype._centroid=!0,he.prototype.className="Circle",he.prototype._attrsAffectingSize=["radiu
1s"],h(he),P.addGetterSetter(he,"radius",0,b());class le extends Nt{_sceneFunc(t){var e=this.cornerRadius(),i=this.width(),r=this.height();if(t.beginPath(),e){let n=0,a=0,s=0,o=0;"number"==typeof e?n=a=s=o=Math.min(e,i/2,r/2):(n=Math.min(e[0]||0,i/2,r/2),a=Math.min(e[1]||0,i/2,r/2),o=Math.min(e[2]||0,i/2,r/2),s=Math.min(e[3]||0,i/2,r/2)),t.moveTo(n,0),t.lineTo(i-a,0),t.arc(i-a,a,a,3*Math.PI/2,0,!1),t.lineTo(i,r-o),t.arc(i-o,r-o,o,0,Math.PI/2,!1),t.lineTo(s,r),t.arc(s,r-s,s,Math.PI/2,Math.PI,!1),t.lineTo(0,n),t.arc(n,n,n,Math.PI,3*Math.PI/2,!1)}else t.rect(0,0,i,r);t.closePath(),t.fillStrokeShape(this)}}le.prototype.className="Rect",h(le),P.addGetterSetter(le,"cornerRadius",0,function(t){if(o.isUnminified)return function(t,e){let i=v._isNumber(t),r=v._isArray(t)&&4==t.length;return i||r||v.warn(y(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or Array<number>(4)'),t}}());class ce extends Nt{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this.dataArray=ce.parsePathData(this.data()),this.pathLength=0;for(var e=0;e<this.dataArray.length;++e)this.pathLength+=this.dataArray[e].pathLength;this.on("dataChange.konva",(function(){this.dataArray=ce.parsePathData(this.data()),this.pathLength=0;for(var t=0;t<this.dataArray.length;++t)this.pathLength+=this.dataArray[t].pathLength}))}_sceneFunc(t){var e=this.dataArray;t.beginPath();for(var i=!1,r=0;r<e.length;r++){var n=e[r].command,a=e[r].points;switch(n){case"L":t.lineTo(a[0],a[1]);break;case"M":t.moveTo(a[0],a[1]);break;case"C":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":var s=a[0],o=a[1],h=a[2],l=a[3],c=a[4],d=a[5],u=a[6],g=a[7],f=h>l?h:l,p=h>l?1:h/l,m=h>l?l/h:1;t.translate(s,o),t.rotate(u),t.scale(p,m),t.arc(0,0,f,c,c+d,1-g),t.scale(1/p,1/m),t.rotate(-u),t.translate(-s,-o);break;case"z":i=!0,t.closePath()}}i||this.hasFill()?t.fillStrokeShape(this):t.strokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach((function(e){if("A"===e.command){var i=e.points[4],r=e.points[5],n=e.points[4]+r,a=Math.PI/180;if(Math.abs(i-n)<a&&(a=Math.abs(i-n)),r<0)for(let r=i-a;r>n;r-=a){const i=ce.getPointOnEllipticalArc(e.points[0],e.points[1],e.points[2],e.points[3],r,0);t.push(i.x,i.y)}else for(let r=i+a;r<n;r+=a){const i=ce.getPointOnEllipticalArc(e.points[0],e.points[1],e.points[2],e.points[3],r,0);t.push(i.x,i.y)}}else if("C"===e.command)for(let s=0;s<=1;s+=.01){const i=ce.getPointOnCubicBezier(s,e.start.x,e.start.y,e.points[0],e.points[1],e.points[2],e.points[3],e.points[4],e.points[5]);t.push(i.x,i.y)}else t=t.concat(e.points)}));for(var e,i,r=t[0],n=t[0],a=t[1],s=t[1],o=0;o<t.length/2;o++)e=t[2*o],i=t[2*o+1],isNaN(e)||(r=Math.min(r,e),n=Math.max(n,e)),isNaN(i)||(a=Math.min(a,i),s=Math.max(s,i));return{x:r,y:a,width:n-r,height:s-a}}getLength(){return this.pathLength}getPointAtLength(t){var e,i=0,r=this.dataArray.length;if(!r)return null;for(;i<r&&t>this.dataArray[i].pathLength;)t-=this.dataArray[i].pathLength,++i;if(i===r)return{x:(e=this.dataArray[i-1].points.slice(-2))[0],y:e[1]};if(t<.01)return{x:(e=this.dataArray[i].points.slice(0,2))[0],y:e[1]};var n=this.dataArray[i],a=n.points;switch(n.command){case"L":return ce.getPointOnLine(t,n.start.x,n.start.y,a[0],a[1]);case"C":return ce.getPointOnCubicBezier(t/n.pathLength,n.start.x,n.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return ce.getPointOnQuadraticBezier(t/n.pathLength,n.start.x,n.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],o=a[1],h=a[2],l=a[3],c=a[4],d=a[5],u=a[6];return c+=d*t/n.pathLength,ce.getPointOnEllipticalArc(s,o,h,l,c,u)}return null}static getLineLength(t,e,i,r){return Math.sqrt((i-t)*(i-t)+(r-e)*(r-e))}static getPointOnLine(t,e,i,r,n,a,s){void 0===a&&(a=e),void 0===s&&(s=i);var o=(n-i)/(r-e+1e-8),h=Math.sqrt(t*t/(1+o*o));r<e&&(h*=-1);var l,c=o*h;if(r===e)l={x:a,y:s+c};else if((s-i)/(a-e+1e-8)===o)l={x:a+h,y:s+c};else{var d,u,g=this.getLineLength(e,i,r,n),f=(a-e)*(r-e)+(s-i)*(n-i);d=e+(f/=g*g)*(r-e),u=i+f*(n-i);var p=this.getLineLength(a,s,d,u),m=Math.sqrt(t*t-p*p);h=Math.sqrt(m*m/(1+o*o)),r<e&&(h*=-1),l={x:d+h,y:u+(c=o*h)}}return l}static getPointOnCubicBezier(t,e,i,r,n,a,s,o,h){function l(t){return t*t*t}function c(t){return 3*t*t*(1-t)}function d(t){return 3*t*(1-t)*(1-t)}function u(t){return(1-t)*(1-t)*(1-t)}return{x:o*l(t)+a*c(t)+r*d(t)+e*u(t),y:h*l(t)+s*c(t)+n*d(t)+i*u(t)}}static getPointOnQuadraticBezier(t,e,i,r,n,a,s){function o(t){return t*t}function h(t){return 2*t*(1-t)}function l(t){return(1-t)*(1-t)}return{x:a*o(t)+r*h(t)+e*l(t),y:s*o(t)+n*h(t)+i*l(t)}}static getPointOnEllipticalArc(t,e,i,r,n,a){var s=Math.cos(a),o=Math.sin(a),h=i*Math.cos(n),l=r*Math.sin(n);return{x:t+(h*s-l*o),y:e+(h*o+l*s)}}static parsePathData(t){if(!t)return[];var e=t,i=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];e=e.replace(new RegExp(" ","g"),",");for(var r=0;r<i.length;r++)e=e.replace(new RegExp(i[r],"g"),"|"+i[r]);var n,a=e.split("|"),s=[],o=[],h=0,l=0,c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;for(r=1;r<a.length;r++){var d=a[r],u=d.charAt(0);for(d=d.slice(1),o.length=0;n=c.exec(d);)o.push(n[0]);for(var g=[],f=0,p=o.length;f<p;f++)if("00"!==o[f]){var m=parseFloat(o[f]);isNaN(m)?g.push(0):g.push(m)}else g.push(0,0);for(;g.length>0&&!isNaN(g[0]);){var v,y,b,C,_,S,w,x,P,A,k=null,E=[],D=h,T=l;switch(u){case"l":h+=g.shift(),l+=g.shift(),k="L",E.push(h,l);break;case"L":h=g.shift(),l=g.shift(),E.push(h,l);break;case"m":var I=g.shift(),R=g.shift();if(h+=I,l+=R,k="M",s.length>2&&"z"===s[s.length-1].command)for(var L=s.length-2;L>=0;L--)if("M"===s[L].command){h=s[L].points[0]+I,l=s[L].points[1]+R;break}E.push(h,l),u="l";break;case"M":h=g.shift(),l=g.shift(),k="M",E.push(h,l),u="L";break;case"h":h+=g.shift(),k="L",E.push(h,l);break;case"H":h=g.shift(),k="L",E.push(h,l);break;case"v":l+=g.shift(),k="L",E.push(h,l);break;case"V":l=g.shift(),k="L",E.push(h,l);break;case"C":E.push(g.shift(),g.shift(),g.shift(),g.shift()),h=g.shift(),l=g.shift(),E.push(h,l);break;case"c":E.push(h+g.shift(),l+g.shift(),h+g.shift(),l+g.shift()),h+=g.shift(),l+=g.shift(),k="C",E.push(h,l);break;case"S":y=h,b=l,"C"===(v=s[s.length-1]).command&&(y=h+(h-v.points[2]),b=l+(l-v.points[3])),E.push(y,b,g.shift(),g.shift()),h=g.shift(),l=g.shift(),k="C",E.push(h,l);break;case"s":y=h,b=l,"C"===(v=s[s.length-1]).command&&(y=h+(h-v.points[2]),b=l+(l-v.points[3])),E.push(y,b,h+g.shift(),l+g.shift()),h+=g.shift(),l+=g.shift(),k="C",E.push(h,l);break;case"Q":E.push(g.shift(),g.shift()),h=g.shift(),l=g.shift(),E.push(h,l);break;case"q":E.push(h+g.shift(),l+g.shift()),h+=g.shift(),l+=g.shift(),k="Q",E.push(h,l);break;case"T":y=h,b=l,"Q"===(v=s[s.length-1]).command&&(y=h+(h-v.points[0]),b=l+(l-v.points[1])),h=g.shift(),l=g.shift(),k="Q",E.push(y,b,h,l);break;case"t":y=h,b=l,"Q"===(v=s[s.length-1]).command&&(y=h+(h-v.points[0]),b=l+(l-v.points[1])),h+=g.shift(),l+=g.shift(),k="Q",E.push(y,b,h,l);break;case"A":C=g.shift(),_=g.shift(),S=g.shift(),w=g.shift(),x=g.shift(),P=h,A=l,h=g.shift(),l=g.shift(),k="A",E=this.convertEndpointToCenterParameterization(P,A,h,l,w,x,C,_,S);break;case"a":C=g.shift(),_=g.shift(),S=g.shift(),w=g.shift(),x=g.shift(),P=h,A=l,h+=g.shift(),l+=g.shift(),k="A",E=this.convertEndpointToCenterParameterization(P,A,h,l,w,x,C,_,S)}s.push({command:k||u,points:E,start:{x:D,y:T},pathLength:this.calcLength(D,T,k||u,E)})}"z"!==u&&"Z"!==u||s.push({command:"z",points:[],start:void 0,pathLength:0})}return s}static calcLength(t,e,i,r){var n,a,s,o,h=ce;switch(i){case"L":return h.getLineLength(t,e,r[0],r[1]);case"C":for(n=0,a=h.getPointOnCubicBezier(0,t,e,r[0],r[1],r[2],r[3],r[4],r[5]),o=.01;o<=1;o+=.01)s=h.getPointOnCubicBezier(o,t,e,r[0],r[1],r[2],r[3],r[4],r[5]),n+=h.getLineLength(a.x,a.y,s.x,s.y),a=s;return n;case"Q":for(n=0,a=h.getPointOnQuadraticBezier(0,t,e,r[0],r[1],r[2],r[3]),o=.01;o<=1;o+=.01)s=h.getPointOnQuadraticBezier(o,t,e,r[0],r[1],r[2],r[3]),n+=h.getLineLength(a.x,a.y,s.x,s.y),a=s;return n;case"A":n=0;var l=r[4],c=r[5],d=r[4]+c,u=Math.PI/180;
1if(Math.abs(l-d)<u&&(u=Math.abs(l-d)),a=h.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],l,0),c<0)for(o=l-u;o>d;o-=u)s=h.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],o,0),n+=h.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(o=l+u;o<d;o+=u)s=h.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],o,0),n+=h.getLineLength(a.x,a.y,s.x,s.y),a=s;return s=h.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],d,0),n+h.getLineLength(a.x,a.y,s.x,s.y)}return 0}static convertEndpointToCenterParameterization(t,e,i,r,n,a,s,o,h){var l=h*(Math.PI/180),c=Math.cos(l)*(t-i)/2+Math.sin(l)*(e-r)/2,d=-1*Math.sin(l)*(t-i)/2+Math.cos(l)*(e-r)/2,u=c*c/(s*s)+d*d/(o*o);u>1&&(s*=Math.sqrt(u),o*=Math.sqrt(u));var g=Math.sqrt((s*s*(o*o)-s*s*(d*d)-o*o*(c*c))/(s*s*(d*d)+o*o*(c*c)));n===a&&(g*=-1),isNaN(g)&&(g=0);var f=g*s*d/o,p=g*-o*c/s,m=(t+i)/2+Math.cos(l)*f-Math.sin(l)*p,v=(e+r)/2+Math.sin(l)*f+Math.cos(l)*p,y=function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},b=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(y(t)*y(e))},C=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(b(t,e))},_=C([1,0],[(c-f)/s,(d-p)/o]),S=[(c-f)/s,(d-p)/o],w=[(-1*c-f)/s,(-1*d-p)/o],x=C(S,w);return b(S,w)<=-1&&(x=Math.PI),b(S,w)>=1&&(x=0),0===a&&x>0&&(x-=2*Math.PI),1===a&&x<0&&(x+=2*Math.PI),[m,v,s,o,_,x,l,a]}}function de(t){return(de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ue(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function ge(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ue(Object(i),!0).forEach((function(e){be(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ue(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function fe(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function pe(t,e){return(pe=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function me(t,e){return!e||"object"!==de(e)&&"function"!=typeof e?ve(t):e}function ve(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ye(t){return(ye=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function be(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}ce.prototype.className="Path",ce.prototype._attrsAffectingSize=["data"],h(ce),P.addGetterSetter(ce,"data");var Ce=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&pe(t,e)}(s,t);var i,r,n,a=(r=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=ye(r);if(n){var i=ye(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return me(this,t)});function s(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var i=(e=a.call(this,t)).generateHash("avatar_container"),r=e.generateHash("avatar_loader");return e.onFileLoad=e.onFileLoad.bind(ve(e)),e.onCloseClick=e.onCloseClick.bind(ve(e)),e.state={imgWidth:0,imgHeight:0,scale:1,containerId:i,loaderId:r,lastMouseY:0,showLoader:!(e.props.src||e.props.img)},e}return(i=[{key:"generateHash",value:function(t){var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return t+"-"+e()+"-"+e()+"-"+e()}},{key:"onCloseCallback",value:function(){this.props.onClose()}},{key:"onCropCallback",value:function(t){this.props.onCrop(t)}},{key:"onFileLoadCallback",value:function(t){this.props.onFileLoad(t)}},{key:"onBeforeFileLoadCallback",value:function(t){this.props.onBeforeFileLoad(t)}},{key:"onImageLoadCallback",value:function(t){this.props.onImageLoad(t)}},{key:"componentDidMount",value:function(){var t=this;if(!this.state.showLoader){var e=this.props.img||new Image;e.crossOrigin="Anonymous",!this.props.img&&this.props.src&&(e.src=this.props.src),this.setState({image:e},(function(){if(t.image.complete)return t.init();t.image.onload=function(){t.onImageLoadCallback(t.image),t.init()}}))}}},{key:"componentDidUpdate",value:function(t,e){t.src!==this.props.src&&(this.image.src=this.props.src)}},{key:"onFileLoad",value:function(t){if(t.preventDefault(),this.onBeforeFileLoadCallback(t),t.target.value){var e=t.target.files[0];this.onFileLoadCallback(e);var i=this;ne().getData(e,(function(){var t=ne().getTag(this,"Orientation");se()(e,(function(t,r){i.setState({image:t,file:e,showLoader:!1},(function(){i.init()}))}),{orientation:t,meta:!0})}))}}},{key:"onCloseClick",value:function(){var t=this;this.setState({showLoader:!0},(function(){return t.onCloseCallback()}))}},{key:"init",value:function(){var t,e,i=this.props,r=i.height,n=i.minCropRadius,a=i.cropRadius,s=this.image.width,o=this.image.height,h=o/s,l=this.props,c=l.imageWidth,d=l.imageHeight;d&&c&&console.warn("The imageWidth and imageHeight properties can not be set together, using only imageWidth."),d&&!c?e=(t=d||o)/h:c?t=(e=c)*h||o:e=(t=r||o)/h;var u=t/o,g=Math.max(n,a||Math.min(e,t)/3);this.setState({imgWidth:e,imgHeight:t,scale:u,cropRadius:g},this.initCanvas)}},{key:"initCanvas",value:function(){var t=this,e=this.initStage(),i=this.initBackgroun
1d(),r=this.initShading(),n=this.initCrop(),a=this.initCropStroke(),s=this.initResize(),o=this.initResizeIcon(),h=new ie.Layer;h.add(i),h.add(r),h.add(a),h.add(n),h.add(s),h.add(o),e.add(h);var l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return n.radius()-t},c=function(t){return n.x()-l(t)<0},d=function(t){return n.y()-l(t)<0},u=function(t){return n.x()+l(t)>e.width()},g=function(t){return n.y()+l(t)>e.height()},f=function(e){return l(e)>=t.minCropRadius?e:n.radius()-t.minCropRadius},p=function(t){return t+.86*n.radius()},m=function(t){return t-.5*n.radius()},v=function(t,e){s.x(p(t)-8),s.y(m(e)-8),o.x(p(t)-8),o.y(m(e)-10)},y=function(){if(t.props.exportAsSquare){var e=new ie.Image({image:t.image}),r=e.width()/i.width(),a=e.height()/i.height(),s=2*n.radius()*r,o=2*n.radius()*a,h=t.props.exportSize?t.props.exportSize/s:void 0;return e.toDataURL({x:(n.x()-n.radius())*r,y:(n.y()-n.radius())*a,width:s,height:o,pixelRatio:h,mimeType:t.props.exportMimeType,quality:t.props.exportQuality})}var l=2*n.radius(),c=2*n.radius(),d=t.props.exportSize?t.props.exportSize/l:void 0;return n.toDataURL({x:n.x()-n.radius(),y:n.y()-n.radius(),width:l,height:c,pixelRatio:d,mimeType:t.props.exportMimeType,quality:t.props.exportQuality})},b=function(t){var e=t>0||function(t){return!(c(t)||u(t)||g(t)||d(t))}(t)?t:0;a.radius(a.radius()-f(e)),n.radius(n.radius()-f(e)),s.fire("resize")};this.onCropCallback(y()),n.on("dragmove",(function(){return n.fire("resize")})),n.on("dragend",(function(){return t.onCropCallback(y())})),n.on("resize",(function(){var i=c()?n.radius()+1:u()?e.width()-n.radius()-1:n.x(),r=d()?n.radius()+1:g()?e.height()-n.radius()-1:n.y();v(i,r),n.setFillPatternOffset({x:i/t.scale,y:r/t.scale}),n.x(i),a.x(i),n.y(r),a.y(r)})),n.on("mouseenter",(function(){return e.container().style.cursor="move"})),n.on("mouseleave",(function(){return e.container().style.cursor="default"})),n.on("dragstart",(function(){return e.container().style.cursor="move"})),n.on("dragend",(function(){return e.container().style.cursor="default"})),s.on("touchstart",(function(e){s.on("dragmove",(function(i){if("touchmove"===i.evt.type){var r=i.evt.changedTouches[0].pageY-e.evt.changedTouches[0].pageY||0;b(r*t.mobileScaleSpeed)}}))})),s.on("dragmove",(function(e){if("touchmove"!==e.evt.type){var i=e.evt.y,r=i?i-t.state.lastMouseY:void 0,n=e.evt.movementY||r||0;t.setState({lastMouseY:i}),b(n)}})),s.on("dragend",(function(){return t.onCropCallback(y())})),s.on("resize",(function(){return v(n.x(),n.y())})),s.on("mouseenter",(function(){return e.container().style.cursor="nesw-resize"})),s.on("mouseleave",(function(){return e.container().style.cursor="default"})),s.on("dragstart",(function(i){t.setState({lastMouseY:i.evt.y}),e.container().style.cursor="nesw-resize"})),s.on("dragend",(function(){return e.container().style.cursor="default"}))}},{key:"initStage",value:function(){return new ie.Stage({container:this.containerId,width:this.width,height:this.height})}}
1,{key:"initBackground",value:function(){return new ie.Image({x:0,y:0,width:this.width,height:this.height,image:this.image})}},{key:"initShading",value:function(){return new ie.Rect({x:0,y:0,width:this.width,height:this.height,fill:this.shadingColor,strokeWidth:4,opacity:this.shadingOpacity})}},{key:"initCrop",value:function(){return new ie.Circle({x:this.halfWidth,y:this.halfHeight,radius:this.cropRadius,fillPatternImage:this.image,fillPatternOffset:{x:this.halfWidth/this.scale,y:this.halfHeight/this.scale},fillPatternScale:{x:this.scale,y:this.scale},opacity:1,draggable:!0,dashEnabled:!0,dash:[10,5]})}},{key:"initCropStroke",value:function(){return new ie.Circle({x:this.halfWidth,y:this.halfHeight,radius:this.cropRadius,stroke:this.cropColor,strokeWidth:this.lineWidth,strokeScaleEnabled:!0,dashEnabled:!0,dash:[10,5]})}},{key:"initResize",value:function(){return new ie.Rect({x:this.halfWidth+.86*this.cropRadius-8,y:this.halfHeight+-.5*this.cropRadius-8,width:16,height:16,draggable:!0,dragBoundFunc:function(t){return{x:this.getAbsolutePosition().x,y:t.y}}})}},{key:"initResizeIcon",value:function(){return new ie.Path({x:this.halfWidth+.86*this.cropRadius-8,y:this.halfHeight+-.5*this.cropRadius-10,data:"M47.624,0.124l12.021,9.73L44.5,24.5l10,10l14.661-15.161l9.963,12.285v-31.5H47.624z M24.5,44.5 L9.847,59.653L0,47.5V79h31.5l-12.153-9.847L34.5,54.5L24.5,44.5z",fill:this.cropColor,scale:{x:.2,y:.2}})}},{key:"render",value:function(){var t=this,i=this.props,r=i.width,n=i.height,a={display:"flex",justifyContent:"center",backgroundColor:this.backgroundColor,width:r||this.width,position:"relative"},s=this.props.label,o=ge(ge({},this.props.labelStyle),{lineHeight:(n||200)+"px"}),h=ge(ge({},this.props.borderStyle),{width:r||200,height:n||200});return e().createElement("div",null,this.state.showLoader?e().createElement("div",{style:h},e().createElement("input",{onChange:function(e){return t.onFileLoad(e)},name:this.loaderId,type:"file",id:this.loaderId,style:{width:.1,height:.1,opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},accept:this.mimeTypes}),e().createElement("label",{htmlFor:this.loaderId,style:o},s)):e().createElement("div",{style:a},e().createElement("svg",{onClick:this.onCloseClick,style:{position:"absolute",zIndex:999,cursor:"pointer",left:"10px",top:"10px"},viewBox:"0 0 475.2 475.2",width:"20px",height:"20px"},e().createElement("g",null,e().createElement("path",{d:"M405.6,69.6C360.7,24.7,301.1,0,237.6,0s-123.1,24.7-168,69.6S0,174.1,0,237.6s24.7,123.1,69.6,168s104.5,69.6,168,69.6 s123.1-24.7,168-69.6s69.6-104.5,69.6-168S450.5,114.5,405.6,69.6z M386.5,386.5c-39.8,39.8-92.7,61.7-148.9,61.7 s-109.1-21.9-148.9-61.7c-82.1-82.1-82.1-215.7,0-297.8C128.5,48.9,181.4,27,237.6,27s109.1,21.9,148.9,61.7 C468.6,170.8,468.6,304.4,386.5,386.5z",fill:this.closeIconColor}),e().createElement("path",{d:"M342.3,132.9c-5.3-5.3-13.8-5.3-19.1,0l-85.6,85.6L152,132.9c-5.3-5.3-13.8-5.3-19.1,0c-5.3,5.3-5.3,13.8,0,19.1 l85.6,85.6l-85.6,85.6c-5.3,5.3-5.3,13.8,0,19.1c2.6,2.6,6.1,4,9.5,4s6.9-1.3,9.5-4l85.6-85.6l85.6,85.6c2.6,2.6,6.1,4,9.5,4 c3.5,0,6.9-1.3,9.5-4c5.3-5.3,5.3-13.8,0-19.1l-85.4-85.6l85.6-85.6C347.6,146.7,347.6,138.2,342.3,132.9z",fill:this.closeIconColor}))),e().createElement("div",{id:this.containerId})))}},{key:"lineWidth",get:function(){return this.props.lineWidth}},{key:"containerId",get:function(){return this.state.containerId}},{key:"closeIconColor",get:function(){return this.props.closeIconColor}},{key:"cropColor",get:function(){return this.props.cropColor}},{key:"loaderId",get:function(){return this.state.loaderId}},{key:"mimeTypes",get:function(){return this.props.mimeTypes}},{key:"backgroundColor",get:function(){return this.props.backgroundColor}},{key:"shadingColor",get:function(){return this.props.shadingColor}},{key:"shadingOpacity",get:function(){return this.props.shadingOpacity}},{key:"mobileScaleSpeed",get:function(){return this.props.mobileScaleSpeed}},{key:"cropRadius",get:function(){return this.state.cropRadius}},{key:"minCropRadius",get:function(){return this.props.minCropRadius}},{key:"scale",get:function(){return this.state.scale}},{key:"width",get:function(){return this.state.imgWidth}},{key:"halfWidth",get:function(){return this.state.imgWidth/2}},{key:"height",get:function(){return this.state.imgHeight}},{key:"halfHeight",get:function(){return this.state.imgHeight/2}},{key:"image",get:function(){return this.state.image}}
1])&&fe(s.prototype,i),s}(e().Component);be(Ce,"defaultProps",{shadingColor:"grey",shadingOpacity:.6,cropColor:"white",closeIconColor:"white",lineWidth:4,minCropRadius:30,backgroundColor:"grey",mimeTypes:"image/jpeg,image/png",exportAsSquare:!1,exportSize:void 0,exportMimeType:"image/png",exportQuality:1,mobileScaleSpeed:.5,onClose:function(){},onCrop:function(){},onFileLoad:function(){},onImageLoad:function(){},onBeforeFileLoad:function(){},label:"Choose a file",labelStyle:{fontSize:"1.25em",fontWeight:"700",color:"black",display:"inline-block",fontFamily:"sans-serif",cursor:"pointer"},borderStyle:{border:"2px solid #979797",borderStyle:"dashed",borderRadius:"8px",textAlign:"center"}});const _e=Ce})(),s})())}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.