@sketch-hq/sketch-web-renderer 4.1.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/module-debug.wasm +0 -0
- package/dist/module-release.wasm +0 -0
- package/dist/ts/canvas-renderer/CanvasRenderer.d.ts.map +1 -1
- package/dist/ts/prototype-renderer/PrototypeRenderer.d.ts.map +1 -1
- package/dist/ts/types/Events.d.ts +7 -1
- package/dist/ts/types/Events.d.ts.map +1 -1
- package/dist/ts/utils/featureFlags.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{createContext as e,useContext as n,useRef as o,useReducer as i,useCallback as r,useMemo as s,useEffect as a,useState as u}from"react";const c=new Int32Array(2);var d,l;new Float32Array(c.buffer),new Float64Array(c.buffer),new Uint16Array(new Uint8Array([1,0]).buffer)[0],function(t){t[t.UTF8_BYTES=1]="UTF8_BYTES",t[t.UTF16_STRING=2]="UTF16_STRING"}(d||(d={})),function(t){t[t.Default=0]="Default",t[t.None=1]="None",t[t.Low=2]="Low",t[t.Medium=3]="Medium",t[t.High=4]="High"}(l||(l={}));var h,b=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.x=function(){return this.bb.readFloat32(this.bb_pos)},t.prototype.y=function(){return this.bb.readFloat32(this.bb_pos+4)},t.sizeOf=function(){return 8},t.createPoint=function(t,e,n){return t.prep(4,8),t.writeFloat32(n),t.writeFloat32(e),t.offset()},t}(),p=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.width=function(){return this.bb.readFloat32(this.bb_pos)},t.prototype.height=function(){return this.bb.readFloat32(this.bb_pos+4)},t.sizeOf=function(){return 8},t.createSize=function(t,e,n){return t.prep(4,8),t.writeFloat32(n),t.writeFloat32(e),t.offset()},t}(),f=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.origin=function(t){return(t||new b).__init(this.bb_pos,this.bb)},t.prototype.size=function(t){return(t||new p).__init(this.bb_pos+8,this.bb)},t.sizeOf=function(){return 16},t.createRect=function(t,e,n,o,i){return t.prep(4,16),t.prep(4,8),t.writeFloat32(i),t.writeFloat32(o),t.prep(4,8),t.writeFloat32(n),t.writeFloat32(e),t.offset()},t}(),_=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsImageDrawing=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsImageDrawing=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.imageIndex=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0},t.prototype.rect=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.prototype.interpolationQuality=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt8(this.bb_pos+t):l.High},t.startImageDrawing=function(t){t.startObject(3)},t.addImageIndex=function(t,e){t.addFieldInt32(0,e,0)},t.addRect=function(t,e){t.addFieldStruct(1,e,0)},t.addInterpolationQuality=function(t,e){t.addFieldInt8(2,e,l.High)},t.endImageDrawing=function(t){return t.endObject()},t}(),g=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsShapeEllipse=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsShapeEllipse=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.rect=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.startShapeEllipse=function(t){t.startObject(1)},t.addRect=function(t,e){t.addFieldStruct(0,e,0)},t.endShapeEllipse=function(t){return t.endObject()},t.createShapeEllipse=function(e,n){return t.startShapeEllipse(e),t.addRect(e,n),t.endShapeEllipse(e)},t}();!function(t){t[t.Winding=0]="Winding",t[t.EvenOdd=1]="EvenOdd"}(h||(h={}));var m,v=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsPath=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsPath=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.points=function(t,e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new b).__init(this.bb.__vector(this.bb_pos+n)+8*t,this.bb):null},t.prototype.pointsLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.operations=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb.__vector(this.bb_pos+e)+t):0},t.prototype.operationsLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.operationsArray=function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Int8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.startPath=function(t){t.startObject(2)},t.addPoints=function(t,e){t.addFieldOffset(0,e,0)},t.startPointsVector=function(t,e){t.startVector(8,e,4)},t.addOperations=function(t,e){t.addFieldOffset(1,e,0)},t.createOperationsVector=function(t,e){t.startVector(1,e.length,1);for(var n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()},t.startOperationsVector=function(t,e){t.startVector(1,e,1)},t.endPath=function(t){var e=t.endObject();return t.requiredField(e,4),t.requiredField(e,6),e},t.createPath=function(e,n,o){return t.startPath(e),t.addPoints(e,n),t.addOperations(e,o),t.endPath(e)},t}(),w=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsShapePath=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsShapePath=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.path=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new v).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.fillRule=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):h.Winding},t.startShapePath=function(t){t.startObject(2)},t.addPath=function(t,e){t.addFieldOffset(0,e,0)},t.addFillRule=function(t,e){t.addFieldInt8(1,e,h.Winding)},t.endShapePath=function(t){var e=t.endObject();return t.requiredField(e,4),e},t.createShapePath=function(e,n,o){return t.startShapePath(e),t.addPath(e,n),t.addFillRule(e,o),t.endShapePath(e)},t}(),y=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsShapeRect=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsShapeRect=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.rect=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.startShapeRect=function(t){t.startObject(1)},t.addRect=function(t,e){t.addFieldStruct(0,e,0)},t.endShapeRect=function(t){return t.endObject()},t.createShapeRect=function(e,n){return t.startShapeRect(e),t.addRect(e,n),t.endShapeRect(e)},t}();!function(t){t[t.NONE=0]="NONE",t[t.ShapePath=1]="ShapePath",t[t.ShapeRect=2]="ShapeRect",t[t.ShapeEllipse=3]="ShapeEllipse"}(m||(m={}));var C,F=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsBackgroundFilterComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsBackgroundFilterComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.shapeType=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint8(this.bb_pos+t):m.NONE},t.prototype.shape=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__union(t,this.bb_pos+e):null},t.prototype.image=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?(t||new _).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.saturation=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readFloat32(this.bb_pos+t):1},t.startBackgroundFilterComponent=function(t){t.startObject(5)},t.addShapeType=function(t,e){t.addFieldInt8(0,e,m.NONE)},t.addShape=function(t,e){t.addFieldOffset(1,e,0)},t.addImage=function(t,e){t.addFieldOffset(2,e,0)},t.addRadius=function(t,e){t.addFieldFloat32(3,e,0)},t.addSaturation=function(t,e){t.addFieldFloat32(4,e,1)},t.endBackgroundFilterComponent=function(t){return t.endObject()},t}();!function(t){t[t.Normal=0]="Normal",t[t.DestAtop=1]="DestAtop",t[t.Clear=2]="Clear",t[t.Source=3]="Source",t[t.Darken=4]="Darken",t[t.Multiply=5]="Multiply",t[t.ColorBurn=6]="ColorBurn",t[t.Lighten=7]="Lighten",t[t.Screen=8]="Screen",t[t.ColorDodge=9]="ColorDodge",t[t.Overlay=10]="Overlay",t[t.SoftLight=11]="SoftLight",t[t.HardLight=12]="HardLight",t[t.Difference=13]="Difference",t[t.Exclusion=14]="Exclusion",t[t.Hue=15]="Hue",t[t.Saturation=16]="Saturation",t[t.Color=17]="Color",t[t.Luminosity=18]="Luminosity",t[t.PlusDarker=19]="PlusDarker",t[t.PlusLighter=20]="PlusLighter"}(C||(C={}));var P,I,S,R,E=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsBlendComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsBlendComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.mode=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):C.Normal},t.prototype.opacity=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat32(this.bb_pos+t):1},t.startBlendComponent=function(t){t.startObject(2)},t.addMode=function(t,e){t.addFieldInt8(0,e,C.Normal)},t.addOpacity=function(t,e){t.addFieldFloat32(1,e,1)},t.endBlendComponent=function(t){return t.endObject()},t.createBlendComponent=function(e,n,o){return t.startBlendComponent(e),t.addMode(e,n),t.addOpacity(e,o),t.endBlendComponent(e)},t}(),M=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsCachedExtentComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsCachedExtentComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.rect=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.startCachedExtentComponent=function(t){t.startObject(1)},t.addRect=function(t,e){t.addFieldStruct(0,e,0)},t.endCachedExtentComponent=function(t){return t.endObject()},t.createCachedExtentComponent=function(e,n){return t.startCachedExtentComponent(e),t.addRect(e,n),t.endCachedExtentComponent(e)},t}(),L=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.r=function(){return this.bb.readFloat32(this.bb_pos)},t.prototype.g=function(){return this.bb.readFloat32(this.bb_pos+4)},t.prototype.b=function(){return this.bb.readFloat32(this.bb_pos+8)},t.prototype.a=function(){return this.bb.readFloat32(this.bb_pos+12)},t.sizeOf=function(){return 16},t.createRGBAColor=function(t,e,n,o,i){return t.prep(4,16),t.writeFloat32(i),t.writeFloat32(o),t.writeFloat32(n),t.writeFloat32(e),t.offset()},t}(),D=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentAngularGradient=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentAngularGradient=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.center=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new b).__init(this.bb_pos+e,this.bb):null},t.prototype.angle=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.locations=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},t.prototype.locationsLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.locationsArray=function(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.colors=function(t,e){var n=this.bb.__offset(this.bb_pos,10);return n?(e||new L).__init(this.bb.__vector(this.bb_pos+n)+16*t,this.bb):null},t.prototype.colorsLength=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0},t.startDrawingContentAngularGradient=function(t){t.startObject(4)},t.addCenter=function(t,e){t.addFieldStruct(0,e,0)},t.addAngle=function(t,e){t.addFieldFloat32(1,e,0)},t.addLocations=function(t,e){t.addFieldOffset(2,e,0)},t.createLocationsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()},t.startLocationsVector=function(t,e){t.startVector(4,e,4)},t.addColors=function(t,e){t.addFieldOffset(3,e,0)},t.startColorsVector=function(t,e){t.startVector(16,e,4)},t.endDrawingContentAngularGradient=function(t){var e=t.endObject();return t.requiredField(e,8),t.requiredField(e,10),e},t.createDrawingContentAngularGradient=function(e,n,o,i,r){return t.startDrawingContentAngularGradient(e),t.addCenter(e,n),t.addAngle(e,o),t.addLocations(e,i),t.addColors(e,r),t.endDrawingContentAngularGradient(e)},t}(),O=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentColor=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentColor=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.color=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new L).__init(this.bb_pos+e,this.bb):null},t.startDrawingContentColor=function(t){t.startObject(1)},t.addColor=function(t,e){t.addFieldStruct(0,e,0)},t.endDrawingContentColor=function(t){return t.endObject()},t.createDrawingContentColor=function(e,n){return t.startDrawingContentColor(e),t.addColor(e,n),t.endDrawingContentColor(e)},t}(),x=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentImage=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentImage=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.image=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new _).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.tile=function(){var t=this.bb.__offset(this.bb_pos,6);return!!t&&!!this.bb.readInt8(this.bb_pos+t)},t.startDrawingContentImage=function(t){t.startObject(2)},t.addImage=function(t,e){t.addFieldOffset(0,e,0)},t.addTile=function(t,e){t.addFieldInt8(1,+e,0)},t.endDrawingContentImage=function(t){var e=t.endObject();return t.requiredField(e,4),e},t.createDrawingContentImage=function(e,n,o){return t.startDrawingContentImage(e),t.addImage(e,n),t.addTile(e,o),t.endDrawingContentImage(e)},t}(),T=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentLinearGradient=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentLinearGradient=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.start=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new b).__init(this.bb_pos+e,this.bb):null},t.prototype.end=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?(t||new b).__init(this.bb_pos+e,this.bb):null},t.prototype.locations=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},t.prototype.locationsLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.locationsArray=function(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.colors=function(t,e){var n=this.bb.__offset(this.bb_pos,10);return n?(e||new L).__init(this.bb.__vector(this.bb_pos+n)+16*t,this.bb):null},t.prototype.colorsLength=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0},t.startDrawingContentLinearGradient=function(t){t.startObject(4)},t.addStart=function(t,e){t.addFieldStruct(0,e,0)},t.addEnd=function(t,e){t.addFieldStruct(1,e,0)},t.addLocations=function(t,e){t.addFieldOffset(2,e,0)},t.createLocationsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()},t.startLocationsVector=function(t,e){t.startVector(4,e,4)},t.addColors=function(t,e){t.addFieldOffset(3,e,0)},t.startColorsVector=function(t,e){t.startVector(16,e,4)},t.endDrawingContentLinearGradient=function(t){var e=t.endObject();return t.requiredField(e,8),t.requiredField(e,10),e},t}(),A=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.a=function(){return this.bb.readFloat32(this.bb_pos)},t.prototype.b=function(){return this.bb.readFloat32(this.bb_pos+4)},t.prototype.c=function(){return this.bb.readFloat32(this.bb_pos+8)},t.prototype.d=function(){return this.bb.readFloat32(this.bb_pos+12)},t.prototype.tx=function(){return this.bb.readFloat32(this.bb_pos+16)},t.prototype.ty=function(){return this.bb.readFloat32(this.bb_pos+20)},t.sizeOf=function(){return 24},t.createMatrix=function(t,e,n,o,i,r,s){return t.prep(4,24),t.writeFloat32(s),t.writeFloat32(r),t.writeFloat32(i),t.writeFloat32(o),t.writeFloat32(n),t.writeFloat32(e),t.offset()},t}(),B=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentRadialGradient=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentRadialGradient=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.center=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new b).__init(this.bb_pos+e,this.bb):null},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.locations=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},t.prototype.locationsLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.locationsArray=function(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.colors=function(t,e){var n=this.bb.__offset(this.bb_pos,10);return n?(e||new L).__init(this.bb.__vector(this.bb_pos+n)+16*t,this.bb):null},t.prototype.colorsLength=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.ellipseTransform=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?(t||new A).__init(this.bb_pos+e,this.bb):null},t.startDrawingContentRadialGradient=function(t){t.startObject(5)},t.addCenter=function(t,e){t.addFieldStruct(0,e,0)},t.addRadius=function(t,e){t.addFieldFloat32(1,e,0)},t.addLocations=function(t,e){t.addFieldOffset(2,e,0)},t.createLocationsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()},t.startLocationsVector=function(t,e){t.startVector(4,e,4)},t.addColors=function(t,e){t.addFieldOffset(3,e,0)},t.startColorsVector=function(t,e){t.startVector(16,e,4)},t.addEllipseTransform=function(t,e){t.addFieldStruct(4,e,0)},t.endDrawingContentRadialGradient=function(t){var e=t.endObject();return t.requiredField(e,8),t.requiredField(e,10),e},t}(),W=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentText=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentText=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startDrawingContentText=function(t){t.startObject(0)},t.endDrawingContentText=function(t){return t.endObject()},t.createDrawingContentText=function(e){return t.startDrawingContentText(e),t.endDrawingContentText(e)},t}();!function(t){t[t.NONE=0]="NONE",t[t.DrawingContentColor=1]="DrawingContentColor",t[t.DrawingContentLinearGradient=2]="DrawingContentLinearGradient",t[t.DrawingContentAngularGradient=3]="DrawingContentAngularGradient",t[t.DrawingContentRadialGradient=4]="DrawingContentRadialGradient",t[t.DrawingContentImage=5]="DrawingContentImage",t[t.DrawingContentText=6]="DrawingContentText"}(P||(P={})),function(t){t[t.Fill=0]="Fill",t[t.Stroke=1]="Stroke",t[t.Knockout=2]="Knockout"}(I||(I={})),function(t){t[t.Butt=0]="Butt",t[t.Round=1]="Round",t[t.Square=2]="Square"}(S||(S={})),function(t){t[t.Miter=0]="Miter",t[t.Round=1]="Round",t[t.Bevel=2]="Bevel"}(R||(R={}));var k,G=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsStroke=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsStroke=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.lineWidth=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.lineCap=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):S.Butt},t.prototype.lineJoin=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt8(this.bb_pos+t):R.Miter},t.prototype.lineDashPhase=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.lineDashPattern=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},t.prototype.lineDashPatternLength=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.lineDashPatternArray=function(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.miterLimit=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readFloat32(this.bb_pos+t):10},t.startStroke=function(t){t.startObject(6)},t.addLineWidth=function(t,e){t.addFieldFloat32(0,e,0)},t.addLineCap=function(t,e){t.addFieldInt8(1,e,S.Butt)},t.addLineJoin=function(t,e){t.addFieldInt8(2,e,R.Miter)},t.addLineDashPhase=function(t,e){t.addFieldFloat32(3,e,0)},t.addLineDashPattern=function(t,e){t.addFieldOffset(4,e,0)},t.createLineDashPatternVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()},t.startLineDashPatternVector=function(t,e){t.startVector(4,e,4)},t.addMiterLimit=function(t,e){t.addFieldFloat32(5,e,10)},t.endStroke=function(t){var e=t.endObject();return t.requiredField(e,12),e},t.createStroke=function(e,n,o,i,r,s,a){return t.startStroke(e),t.addLineWidth(e,n),t.addLineCap(e,o),t.addLineJoin(e,i),t.addLineDashPhase(e,r),t.addLineDashPattern(e,s),t.addMiterLimit(e,a),t.endStroke(e)},t}(),N=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingMask=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingMask=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.mode=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):I.Fill},t.prototype.shapeType=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):m.NONE},t.prototype.shape=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null},t.prototype.stroke=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?(t||new G).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.strokedPath=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?(t||new v).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.knockoutRect=function(t){var e=this.bb.__offset(this.bb_pos,14);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.startDrawingMask=function(t){t.startObject(6)},t.addMode=function(t,e){t.addFieldInt8(0,e,I.Fill)},t.addShapeType=function(t,e){t.addFieldInt8(1,e,m.NONE)},t.addShape=function(t,e){t.addFieldOffset(2,e,0)},t.addStroke=function(t,e){t.addFieldOffset(3,e,0)},t.addStrokedPath=function(t,e){t.addFieldOffset(4,e,0)},t.addKnockoutRect=function(t,e){t.addFieldStruct(5,e,0)},t.endDrawingMask=function(t){return t.endObject()},t}(),z=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.contentType=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint8(this.bb_pos+t):P.NONE},t.prototype.content=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__union(t,this.bb_pos+e):null},t.prototype.mask=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?(t||new N).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.startDrawingComponent=function(t){t.startObject(3)},t.addContentType=function(t,e){t.addFieldInt8(0,e,P.NONE)},t.addContent=function(t,e){t.addFieldOffset(1,e,0)},t.addMask=function(t,e){t.addFieldOffset(2,e,0)},t.endDrawingComponent=function(t){var e=t.endObject();return t.requiredField(e,6),e},t}(),j=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsLayerInfoComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsLayerInfoComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.bounds=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.prototype.objectId=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},t.prototype.traits=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint32(this.bb_pos+t):0},t.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null},t.startLayerInfoComponent=function(t){t.startObject(4)},t.addBounds=function(t,e){t.addFieldStruct(0,e,0)},t.addObjectId=function(t,e){t.addFieldOffset(1,e,0)},t.addTraits=function(t,e){t.addFieldInt32(2,e,0)},t.addName=function(t,e){t.addFieldOffset(3,e,0)},t.endLayerInfoComponent=function(t){var e=t.endObject();return t.requiredField(e,6),t.requiredField(e,10),e},t.createLayerInfoComponent=function(e,n,o,i,r){return t.startLayerInfoComponent(e),t.addBounds(e,n),t.addObjectId(e,o),t.addTraits(e,i),t.addName(e,r),t.endLayerInfoComponent(e)},t}();!function(t){t[t.Node=0]="Node",t[t.Clip=1]="Clip",t[t.Knockout=2]="Knockout"}(k||(k={}));var U,Z=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFragment=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFragment=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.objectId=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},t.startFragment=function(t){t.startObject(1)},t.addObjectId=function(t,e){t.addFieldOffset(0,e,0)},t.endFragment=function(t){return t.endObject()},t.createFragment=function(e,n){return t.startFragment(e),t.addObjectId(e,n),t.endFragment(e)},t}(),V=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFilterColorControls=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFilterColorControls=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.saturation=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):1},t.prototype.brightness=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.contrast=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.hue=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0},t.startFilterColorControls=function(t){t.startObject(4)},t.addSaturation=function(t,e){t.addFieldFloat32(0,e,1)},t.addBrightness=function(t,e){t.addFieldFloat32(1,e,0)},t.addContrast=function(t,e){t.addFieldFloat32(2,e,0)},t.addHue=function(t,e){t.addFieldFloat32(3,e,0)},t.endFilterColorControls=function(t){return t.endObject()},t.createFilterColorControls=function(e,n,o,i,r){return t.startFilterColorControls(e),t.addSaturation(e,n),t.addBrightness(e,o),t.addContrast(e,i),t.addHue(e,r),t.endFilterColorControls(e)},t}(),q=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFilterGaussianBlur=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFilterGaussianBlur=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):0},t.startFilterGaussianBlur=function(t){t.startObject(1)},t.addRadius=function(t,e){t.addFieldFloat32(0,e,0)},t.endFilterGaussianBlur=function(t){return t.endObject()},t.createFilterGaussianBlur=function(e,n){return t.startFilterGaussianBlur(e),t.addRadius(e,n),t.endFilterGaussianBlur(e)},t}(),H=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFilterMotionBlur=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFilterMotionBlur=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.angle=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat32(this.bb_pos+t):0},t.startFilterMotionBlur=function(t){t.startObject(2)},t.addRadius=function(t,e){t.addFieldFloat32(0,e,0)},t.addAngle=function(t,e){t.addFieldFloat32(1,e,0)},t.endFilterMotionBlur=function(t){return t.endObject()},t.createFilterMotionBlur=function(e,n,o){return t.startFilterMotionBlur(e),t.addRadius(e,n),t.addAngle(e,o),t.endFilterMotionBlur(e)},t}(),K=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsShadow=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsShadow=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.offset=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?(t||new p).__init(this.bb_pos+e,this.bb):null},t.prototype.spread=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.color=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?(t||new L).__init(this.bb_pos+e,this.bb):null},t.startShadow=function(t){t.startObject(4)},t.addRadius=function(t,e){t.addFieldFloat32(0,e,0)},t.addOffset=function(t,e){t.addFieldStruct(1,e,0)},t.addSpread=function(t,e){t.addFieldFloat32(2,e,0)},t.addColor=function(t,e){t.addFieldStruct(3,e,0)},t.endShadow=function(t){return t.endObject()},t}(),Y=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFilterShadow=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFilterShadow=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.shadow=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new K).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.startFilterShadow=function(t){t.startObject(1)},t.addShadow=function(t,e){t.addFieldOffset(0,e,0)},t.endFilterShadow=function(t){var e=t.endObject();return t.requiredField(e,4),e},t.createFilterShadow=function(e,n){return t.startFilterShadow(e),t.addShadow(e,n),t.endFilterShadow(e)},t}(),$=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFilterZoomBlur=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFilterZoomBlur=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.center=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?(t||new b).__init(this.bb_pos+e,this.bb):null},t.startFilterZoomBlur=function(t){t.startObject(2)},t.addRadius=function(t,e){t.addFieldFloat32(0,e,0)},t.addCenter=function(t,e){t.addFieldStruct(1,e,0)},t.endFilterZoomBlur=function(t){return t.endObject()},t}();!function(t){t[t.NONE=0]="NONE",t[t.FilterColorControls=1]="FilterColorControls",t[t.FilterGaussianBlur=2]="FilterGaussianBlur",t[t.FilterMotionBlur=3]="FilterMotionBlur",t[t.FilterZoomBlur=4]="FilterZoomBlur",t[t.FilterShadow=5]="FilterShadow"}(U||(U={}));var X,J=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsSurfaceComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsSurfaceComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.shouldBlendSourceOver=function(){var t=this.bb.__offset(this.bb_pos,4);return!!t&&!!this.bb.readInt8(this.bb_pos+t)},t.prototype.filterType=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):U.NONE},t.prototype.filter=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null},t.startSurfaceComponent=function(t){t.startObject(3)},t.addShouldBlendSourceOver=function(t,e){t.addFieldInt8(0,+e,0)},t.addFilterType=function(t,e){t.addFieldInt8(1,e,U.NONE)},t.addFilter=function(t,e){t.addFieldOffset(2,e,0)},t.endSurfaceComponent=function(t){return t.endObject()},t.createSurfaceComponent=function(e,n,o,i){return t.startSurfaceComponent(e),t.addShouldBlendSourceOver(e,n),t.addFilterType(e,o),t.addFilter(e,i),t.endSurfaceComponent(e)},t}(),Q=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsTransformComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsTransformComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.matrix=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new A).__init(this.bb_pos+e,this.bb):null},t.startTransformComponent=function(t){t.startObject(1)},t.addMatrix=function(t,e){t.addFieldStruct(0,e,0)},t.endTransformComponent=function(t){return t.endObject()},t.createTransformComponent=function(e,n){return t.startTransformComponent(e),t.addMatrix(e,n),t.endTransformComponent(e)},t}(),tt=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsNode=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsNode=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.children=function(e,n){var o=this.bb.__offset(this.bb_pos,4);return o?(n||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+o)+4*e),this.bb):null},t.prototype.childrenLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.enabled=function(){var t=this.bb.__offset(this.bb_pos,6);return!t||!!this.bb.readInt8(this.bb_pos+t)},t.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null},t.prototype.componentsType=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},t.prototype.componentsTypeLength=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.componentsTypeArray=function(){var t=this.bb.__offset(this.bb_pos,10);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.components=function(t,e){var n=this.bb.__offset(this.bb_pos,12);return n?this.bb.__union(e,this.bb.__vector(this.bb_pos+n)+4*t):null},t.prototype.componentsLength=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.drawing=function(t){var e=this.bb.__offset(this.bb_pos,14);return e?(t||new z).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.layerInfo=function(t){var e=this.bb.__offset(this.bb_pos,16);return e?(t||new j).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.transform=function(t){var e=this.bb.__offset(this.bb_pos,18);return e?(t||new Q).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.mask=function(t){var e=this.bb.__offset(this.bb_pos,20);return e?(t||new et).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.blend=function(t){var e=this.bb.__offset(this.bb_pos,22);return e?(t||new E).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.surface=function(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new J).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.backgroundFilter=function(t){var e=this.bb.__offset(this.bb_pos,26);return e?(t||new F).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.cachedExtent=function(t){var e=this.bb.__offset(this.bb_pos,28);return e?(t||new M).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.fragment=function(t){var e=this.bb.__offset(this.bb_pos,30);return e?(t||new Z).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.startNode=function(t){t.startObject(14)},t.addChildren=function(t,e){t.addFieldOffset(0,e,0)},t.createChildrenVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},t.startChildrenVector=function(t,e){t.startVector(4,e,4)},t.addEnabled=function(t,e){t.addFieldInt8(1,+e,1)},t.addName=function(t,e){t.addFieldOffset(2,e,0)},t.addComponentsType=function(t,e){t.addFieldOffset(3,e,0)},t.createComponentsTypeVector=function(t,e){t.startVector(1,e.length,1);for(var n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()},t.startComponentsTypeVector=function(t,e){t.startVector(1,e,1)},t.addComponents=function(t,e){t.addFieldOffset(4,e,0)},t.createComponentsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},t.startComponentsVector=function(t,e){t.startVector(4,e,4)},t.addDrawing=function(t,e){t.addFieldOffset(5,e,0)},t.addLayerInfo=function(t,e){t.addFieldOffset(6,e,0)},t.addTransform=function(t,e){t.addFieldOffset(7,e,0)},t.addMask=function(t,e){t.addFieldOffset(8,e,0)},t.addBlend=function(t,e){t.addFieldOffset(9,e,0)},t.addSurface=function(t,e){t.addFieldOffset(10,e,0)},t.addBackgroundFilter=function(t,e){t.addFieldOffset(11,e,0)},t.addCachedExtent=function(t,e){t.addFieldOffset(12,e,0)},t.addFragment=function(t,e){t.addFieldOffset(13,e,0)},t.endNode=function(t){var e=t.endObject();return t.requiredField(e,4),e},t}(),et=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsMaskComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsMaskComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.mode=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):k.Node},t.prototype.clipShapeType=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):m.NONE},t.prototype.clipShape=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null},t.prototype.node=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?(t||new tt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.knockoutRect=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.startMaskComponent=function(t){t.startObject(5)},t.addMode=function(t,e){t.addFieldInt8(0,e,k.Node)},t.addClipShapeType=function(t,e){t.addFieldInt8(1,e,m.NONE)},t.addClipShape=function(t,e){t.addFieldOffset(2,e,0)},t.addNode=function(t,e){t.addFieldOffset(3,e,0)},t.addKnockoutRect=function(t,e){t.addFieldStruct(4,e,0)},t.endMaskComponent=function(t){return t.endObject()},t}();!function(t){t[t.NONE=0]="NONE",t[t.TransformComponent=1]="TransformComponent",t[t.BlendComponent=2]="BlendComponent",t[t.MaskComponent=3]="MaskComponent",t[t.DrawingComponent=4]="DrawingComponent",t[t.CachedExtentComponent=5]="CachedExtentComponent",t[t.LayerInfoComponent=6]="LayerInfoComponent",t[t.SurfaceComponent=7]="SurfaceComponent",t[t.BackgroundFilterComponent=8]="BackgroundFilterComponent"}(X||(X={}));var nt,ot=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsImage=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsImage=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.uuid=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},t.prototype.width=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint32(this.bb_pos+t):0},t.prototype.height=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint32(this.bb_pos+t):0},t.prototype.format=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null},t.startImage=function(t){t.startObject(4)},t.addUuid=function(t,e){t.addFieldOffset(0,e,0)},t.addWidth=function(t,e){t.addFieldInt32(1,e,0)},t.addHeight=function(t,e){t.addFieldInt32(2,e,0)},t.addFormat=function(t,e){t.addFieldOffset(3,e,0)},t.endImage=function(t){var e=t.endObject();return t.requiredField(e,10),e},t.createImage=function(e,n,o,i,r){return t.startImage(e),t.addUuid(e,n),t.addWidth(e,o),t.addHeight(e,i),t.addFormat(e,r),t.endImage(e)},t}();!function(t){t[t.MoveTo=0]="MoveTo",t[t.LineTo=1]="LineTo",t[t.QuadTo=2]="QuadTo",t[t.CubicTo=3]="CubicTo",t[t.Close=4]="Close"}(nt||(nt={}));var it=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsPresentation=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsPresentation=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.bufferHasIdentifier=function(t){return t.__has_identifier("PRMR")},t.prototype.images=function(t,e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new ot).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null},t.prototype.imagesLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.root=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?(t||new tt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.schemaVersion=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null},t.startPresentation=function(t){t.startObject(3)},t.addImages=function(t,e){t.addFieldOffset(0,e,0)},t.createImagesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},t.startImagesVector=function(t,e){t.startVector(4,e,4)},t.addRoot=function(t,e){t.addFieldOffset(1,e,0)},t.addSchemaVersion=function(t,e){t.addFieldOffset(2,e,0)},t.endPresentation=function(t){var e=t.endObject();return t.requiredField(e,4),t.requiredField(e,6),t.requiredField(e,8),e},t.finishPresentationBuffer=function(t,e){t.finish(e,"PRMR")},t.finishSizePrefixedPresentationBuffer=function(t,e){t.finish(e,"PRMR",!0)},t}(),rt=Object.freeze({__proto__:null,SCHEMA_VERSION:"0.1.5",FILE_IDENTIFIER:"PRMR",BackgroundFilterComponent:F,BlendComponent:E,get BlendMode(){return C},CachedExtentComponent:M,get Component(){return X},unionToComponent:function(t,e){switch(X[t]){case"NONE":default:return null;case"TransformComponent":return e(new Q);case"BlendComponent":return e(new E);case"MaskComponent":return e(new et);case"DrawingComponent":return e(new z);case"CachedExtentComponent":return e(new M);case"LayerInfoComponent":return e(new j);case"SurfaceComponent":return e(new J);case"BackgroundFilterComponent":return e(new F)}},unionListToComponent:function(t,e,n){switch(X[t]){case"NONE":default:return null;case"TransformComponent":return e(n,new Q);case"BlendComponent":return e(n,new E);case"MaskComponent":return e(n,new et);case"DrawingComponent":return e(n,new z);case"CachedExtentComponent":return e(n,new M);case"LayerInfoComponent":return e(n,new j);case"SurfaceComponent":return e(n,new J);case"BackgroundFilterComponent":return e(n,new F)}},DrawingComponent:z,get DrawingContent(){return P},unionToDrawingContent:function(t,e){switch(P[t]){case"NONE":default:return null;case"DrawingContentColor":return e(new O);case"DrawingContentLinearGradient":return e(new T);case"DrawingContentAngularGradient":return e(new D);case"DrawingContentRadialGradient":return e(new B);case"DrawingContentImage":return e(new x);case"DrawingContentText":return e(new W)}},unionListToDrawingContent:function(t,e,n){switch(P[t]){case"NONE":default:return null;case"DrawingContentColor":return e(n,new O);case"DrawingContentLinearGradient":return e(n,new T);case"DrawingContentAngularGradient":return e(n,new D);case"DrawingContentRadialGradient":return e(n,new B);case"DrawingContentImage":return e(n,new x);case"DrawingContentText":return e(n,new W)}},DrawingContentAngularGradient:D,DrawingContentColor:O,DrawingContentImage:x,DrawingContentLinearGradient:T,DrawingContentRadialGradient:B,DrawingContentText:W,DrawingMask:N,get DrawingMaskMode(){return I},get FillRule(){return h},get Filter(){return U},unionToFilter:function(t,e){switch(U[t]){case"NONE":default:return null;case"FilterColorControls":return e(new V);case"FilterGaussianBlur":return e(new q);case"FilterMotionBlur":return e(new H);case"FilterZoomBlur":return e(new $);case"FilterShadow":return e(new Y)}},unionListToFilter:function(t,e,n){switch(U[t]){case"NONE":default:return null;case"FilterColorControls":return e(n,new V);case"FilterGaussianBlur":return e(n,new q);case"FilterMotionBlur":return e(n,new H);case"FilterZoomBlur":return e(n,new $);case"FilterShadow":return e(n,new Y)}},FilterColorControls:V,FilterGaussianBlur:q,FilterMotionBlur:H,FilterShadow:Y,FilterZoomBlur:$,Fragment:Z,Image:ot,ImageDrawing:_,get InterpolationQuality(){return l},LayerInfoComponent:j,get LineCap(){return S},get LineJoin(){return R},MaskComponent:et,get MaskComponentMode(){return k},Matrix:A,Node:tt,Path:v,get PathOperation(){return nt},Point:b,Presentation:it,RGBAColor:L,Rect:f,Shadow:K,get Shape(){return m},unionToShape:function(t,e){switch(m[t]){case"NONE":default:return null;case"ShapePath":return e(new w);case"ShapeRect":return e(new y);case"ShapeEllipse":return e(new g)}},unionListToShape:function(t,e,n){switch(m[t]){case"NONE":default:return null;case"ShapePath":return e(n,new w);case"ShapeRect":return e(n,new y);case"ShapeEllipse":return e(n,new g)}},ShapeEllipse:g,ShapePath:w,ShapeRect:y,Size:p,Stroke:G,SurfaceComponent:J,TransformComponent:Q}),st=function(t,e){return st=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},st(t,e)};function at(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}st(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var ut=function(){return ut=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ut.apply(this,arguments)};function ct(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{u(o.next(t))}catch(t){r(t)}}function a(t){try{u(o.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((o=o.apply(t,e||[])).next())}))}function dt(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,a[0]&&(s=0)),s;)try{if(n=1,o&&(i=2&a[0]?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],o=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function lt(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}function ht(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{u(o.next(t))}catch(t){r(t)}}function a(t){try{u(o.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((o=o.apply(t,e||[])).next())}))}const bt=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function pt(t){return t.toLowerCase().replace(/^angle ?\((.+)\)*$/,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const ft="undefined"==typeof window,_t=(()=>{if(ft)return;const{userAgent:t,platform:e,maxTouchPoints:n}=window.navigator,o=/(iphone|ipod|ipad)/i.test(t),i="iPad"===e||"MacIntel"===e&&n>0&&!window.MSStream;return{isIpad:i,isMobile:/android/i.test(t)||o||i,isSafari12:/Version\/12.+Safari/.test(t)}})();const gt=[],mt=[];function vt(t,e){if(t===e)return 0;const n=t;t.length>e.length&&(t=e,e=n);let o=t.length,i=e.length;for(;o>0&&t.charCodeAt(~-o)===e.charCodeAt(~-i);)o--,i--;let r,s=0;for(;s<o&&t.charCodeAt(s)===e.charCodeAt(s);)s++;if(o-=s,i-=s,0===o)return i;let a,u,c=0,d=0,l=0;for(;d<o;)mt[d]=t.charCodeAt(s+d),gt[d]=++d;for(;l<i;)for(r=e.charCodeAt(s+l),a=l++,c=l,d=0;d<o;d++)u=r===mt[d]?a:a+1,a=gt[d],c=gt[d]=a>c?u>c?c+1:u:u>a?a+1:u;return c}function wt(t){return null!=t}class yt extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}const Ct=({mobileTiers:t=[0,15,30,60],desktopTiers:e=[0,15,30,60],override:n={},glContext:o,failIfMajorPerformanceCaveat:i=!1,benchmarksURL:r="https://unpkg.com/detect-gpu@4.0.47/dist/benchmarks"}={})=>ht(void 0,void 0,void 0,(function*(){const s={};if(ft)return{tier:0,type:"SSR"};const{isIpad:a=!!(null==_t?void 0:_t.isIpad),isMobile:u=!!(null==_t?void 0:_t.isMobile),screenSize:c=window.screen,loadBenchmarks:d=(t=>ht(void 0,void 0,void 0,(function*(){const e=yield fetch(`${r}/${t}`).then((t=>t.json()));if(parseInt(e.shift().split(".")[0],10)<4)throw new yt("Detect GPU benchmark data is out of date. Please update to version 4x");return e})))}=n;let{renderer:l}=n;const h=(t,e,n,o,i)=>({device:i,fps:o,gpu:n,isMobile:u,tier:t,type:e});let b,p="";if(l)l=pt(l),b=[l];else{const t=o||function(t,e=!1){const n={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:e,powerPreference:"high-performance",stencil:!1};t&&delete n.powerPreference;const o=window.document.createElement("canvas"),i=o.getContext("webgl",n)||o.getContext("experimental-webgl",n);return null!=i?i:void 0}(null==_t?void 0:_t.isSafari12,i);if(!t)return h(0,"WEBGL_UNSUPPORTED");const e=t.getExtension("WEBGL_debug_renderer_info");if(e&&(l=t.getParameter(e.UNMASKED_RENDERER_WEBGL)),!l)return h(1,"FALLBACK");p=l,l=pt(l),b=function(t,e,n){return"apple gpu"===e?function(t,e,n){if(!n)return[e];const o=function(t){const e=t.createShader(35633),n=t.createShader(35632),o=t.createProgram();if(!(n&&e&&o))return;t.shaderSource(e,"\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n "),t.shaderSource(n,"\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n "),t.compileShader(e),t.compileShader(n),t.attachShader(o,e),t.attachShader(o,n),t.linkProgram(o),t.detachShader(o,e),t.detachShader(o,n),t.deleteShader(e),t.deleteShader(n),t.useProgram(o);const i=t.createBuffer();t.bindBuffer(34962,i),t.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const r=t.getAttribLocation(o,"aPosition");t.vertexAttribPointer(r,3,5126,!1,0,0),t.enableVertexAttribArray(r),t.clearColor(1,1,1,1),t.clear(16384),t.viewport(0,0,1,1),t.drawArrays(4,0,3);const s=new Uint8Array(4);return t.readPixels(0,0,1,1,6408,5121,s),t.deleteProgram(o),t.deleteBuffer(i),s.join("")}(t),i="801621810",r="8016218135",s="80162181161",a=(null==_t?void 0:_t.isIpad)?[["a7",s,12],["a8",r,15],["a8x",r,15],["a9",r,15],["a9x",r,15],["a10",r,15],["a10x",r,15],["a12",i,15],["a12x",i,15],["a12z",i,15],["a14",i,15],["m1",i,15]]:[["a7",s,12],["a8",r,12],["a9",r,15],["a10",r,15],["a11",i,15],["a12",i,15],["a13",i,15],["a14",i,15]];let u;return"80162181255"===o?u=a.filter((([,,t])=>t>=14)):(u=a.filter((([,t])=>t===o)),u.length||(u=a)),u.map((([t])=>`apple ${t} gpu`))}(t,e,n):[e]}(t,l,u)}const f=(yield Promise.all(b.map((function(t){var e;return ht(this,void 0,void 0,(function*(){const n=(t=>{const e=u?["adreno","apple","mali-t","mali","nvidia","powervr"]:["intel","apple","amd","radeon","nvidia","geforce"];for(const n of e)if(t.includes(n))return n})(t);if(!n)return;const o=`${u?"m":"d"}-${n}${a?"-ipad":""}.json`,i=s[o]=null!==(e=s[o])&&void 0!==e?e:d(o);let r;try{r=yield i}catch(n){if(n instanceof yt)throw n;return}const l=function(t){var e;const n=(t=t.replace(/\([^)]+\)/,"")).match(/\d+/)||t.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(e=null==n?void 0:n.join("").replace(/\W|amd/g,""))&&void 0!==e?e:""}(t);let h=r.filter((([,t])=>t===l));h.length||(h=r.filter((([e])=>e.includes(t))));const b=h.length;if(0===b)return;let p,[f,,,_]=b>1?h.map((e=>[e,vt(t,e[0])])).sort((([,t],[,e])=>t-e))[0][0]:h[0],g=Number.MAX_VALUE;const{devicePixelRatio:m}=window,v=c.width*m*c.height*m;for(const t of _){const[e,n]=t,o=e*n,i=Math.abs(v-o);i<g&&(g=i,p=t)}if(!p)return;const[,,w,y]=p;return[g,w,f,y]}))})))).filter(wt).sort((([t=Number.MAX_VALUE,e],[n=Number.MAX_VALUE,o])=>t===n?e-o:t-n));if(!f.length){const t=bt.find((t=>l.includes(t)));return t?h(0,"BLOCKLISTED",t):h(1,"FALLBACK",`${l} (${p})`)}const[,_,g,m]=f[0];if(-1===_)return h(0,"BLOCKLISTED",g,_,m);const v=u?t:e;let w=0;for(let t=0;t<v.length;t++)_>=v[t]&&(w=t);return h(w,"BENCHMARK",g,_,m)}));var Ft,Pt=function(t){function e(n,o,i){var r=this.constructor,s=t.call(this,"(".concat(n,") ").concat(o))||this;return s.code=n,s.cause=i,s.name=e.name,Object.setPrototypeOf(s,r.prototype),s}return at(e,t),e}(Error);!function(t){t.debug="debug",t.release="release"}(Ft||(Ft={}));var It=function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){var n,o;this.listeners[t]=null!==(n=this.listeners[t])&&void 0!==n?n:new Set,null===(o=this.listeners[t])||void 0===o||o.add(e)},t.prototype.off=function(t,e){var n;null===(n=this.listeners[t])||void 0===n||n.delete(e)},t.prototype.forwardEvent=function(t,e){this.on(e,(function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];t.emit.apply(t,lt([e],n,!1))}))},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this.listeners[t];(null==o?void 0:o.size)&&o.forEach((function(t){Promise.resolve().then((function(){t.apply(void 0,e)}))}))},t.prototype.detachAllListeners=function(){this.listeners={}},t}(),St=function(){function t(){this.removeListenerCallbacks=[]}return t.prototype.add=function(t,e,n,o){t.addEventListener(e,n,o);var i=function(){t.removeEventListener(e,n,o)};return this.removeListenerCallbacks.push(i),i},t.prototype.dispose=function(){this.removeListenerCallbacks.forEach((function(t){return t()}))},t}(),Rt={delayedDraw:!0,offscreenCanvas:!1,useDirtyRectsRendering:!0,safariWebGL2:!1,pageBoundariesLimit:!1},Et=function(t){return parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(t)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||!1},Mt=/(iPhone|Macintosh|iPad)(.*)(Version)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.?(0|[1-9]\d*)?/,Lt=function(t){if(void 0===t&&(t=window.navigator.userAgent),t.includes("Chrome/")||t.includes("Chromium/")||t.includes("Opera/")||t.includes("Firefox/"))return null;var e=t.match(Mt);if(!e)return null;var n=e[1];return"Macintosh"!==n&&"iPad"!==n&&"iPhone"!==n?null:{hardware:n,version:{major:parseInt(e[4])||0,minor:parseInt(e[5])||0,patch:parseInt(e[6])||0}}};function Dt(t,e){var n;function o(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];clearTimeout(n),n=setTimeout((function(){t.apply(void 0,o)}),e)}return o.cancel=function(){n&&clearTimeout(n)},o}function Ot(t){var e,n,o,i,r,s=null!==(n=null===(e=t.touches)||void 0===e?void 0:e[0])&&void 0!==n?n:null===(o=t.changedTouches)||void 0===o?void 0:o[0];return{x:null!==(i=null==s?void 0:s.clientX)&&void 0!==i?i:t.clientX,y:null!==(r=null==s?void 0:s.clientY)&&void 0!==r?r:t.clientY}}function xt(t,e,n){return Math.max(e,Math.min(n,t))}function Tt(){return Lt()&&!Rt.safariWebGL2?1:"undefined"!=typeof WebGL2RenderingContext?2:1}function At(t){for(var e=t.size(),n=[],o=0;o<e;++o){var i=t.get(o);if(null==i)throw Error("Error converting embind vector to array");n.push(i)}return n}function Bt(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function Wt(t){var e=t;return Object.keys(e).forEach((function(t){void 0===e[t]&&delete e[t]})),e}function kt(t){return Bt()?{onTouchEnd:t}:{onClick:t}}var Gt=function(t){function e(e){var n=t.call(this)||this;return n.listenersCollector=new St,n.state={pinchToZoomLastDistance:0,lastGestureScale:1,isCtrlPressed:!1},n.handleGestureStart=function(t){t.preventDefault(),n.state.lastGestureScale=t.scale},n.handleGestureChange=function(t){t.preventDefault();var e=t.scale/n.state.lastGestureScale;n.state.lastGestureScale=t.scale;var o=n.getCorrectPointerPosition(t);n.emitZoomEvent(e,o)},n.handleGestureEnd=function(t){t.preventDefault()},n.handleTouchStart=function(t){t.preventDefault(),n.handleTouchPinchToZoomStart(t),n.emit("pointerdown",{type:"touch",position:n.getCorrectPointerPosition(t),button:0,touchesCount:t.touches.length})},n.handleMouseDown=function(t){t.ctrlKey||(t.preventDefault(),n.emit("pointerdown",{type:"mouse",position:n.getCorrectPointerPosition(t),button:t.button,touchesCount:0}))},n.handleTouchMove=function(t){n.handleTouchPinchToZoomChange(t),n.emit("pointermove",{type:"touch",position:n.getCorrectPointerPosition(t),button:0,touchesCount:t.touches.length})},n.handleMouseMove=function(t){n.updateMousePosition(t)},n.handleGlobalTouchMove=function(t){n.emit("globalpointermove",{type:"touch",position:n.getCorrectPointerPosition(t),button:0,touchesCount:t.touches.length})},n.handleGlobalMouseMove=function(t){n.updateGlobalMousePosition(t)},n.handleTouchPinchToZoomStart=function(t){var e;!t.touches||(null===(e=t.touches)||void 0===e?void 0:e.length)<2||(n.state.pinchToZoomLastDistance=n.calculateDistanceBetweenTouches(t.touches[0],t.touches[1]))},n.handleTouchPinchToZoomChange=function(t){var e;if(t.touches&&!((null===(e=t.touches)||void 0===e?void 0:e.length)<2)){var o=n.calculateDistanceBetweenTouches(t.touches[0],t.touches[1]),i=n.getCorrectPointerPosition(t),r=1+.004*(o-n.state.pinchToZoomLastDistance);n.state.pinchToZoomLastDistance=o,n.emitZoomEvent(r,i)}},n.handleTouchEnd=function(t){var e=n.getCorrectPointerPosition(t);n.emit("pointerup",{position:e,type:"touch",button:0,touchesCount:t.touches.length})},n.handleMouseUp=function(t){n.emit("pointerup",{type:"mouse",position:n.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},n.handleMouseWheel=function(t){t.preventDefault();var e=t.ctrlKey&&!n.state.isCtrlPressed,o=t.metaKey||e||n.state.isCtrlPressed;if(n.updateMousePosition(t),n.updateGlobalMousePosition(t),o){var i=e?-1:1,r=n.getCorrectPointerPosition(t),s=1+.005*t.deltaY*i;n.emitZoomEvent(s,r)}else n.emit("wheel",{x:-t.deltaX,y:-t.deltaY},{type:"mouse",position:n.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},n.target=e,n.targetBounds=e.getBoundingClientRect(),n.addListeners(),n}return at(e,t),e.prototype.updateTargetBounds=function(){this.targetBounds=this.target.getBoundingClientRect()},e.prototype.addListeners=function(){this.addTouchEventListeners(),this.addMouseEventListeners(),this.addKeyboardEventListeners(),this.addSafariGesturesEventListeners()},e.prototype.addKeyboardEventListeners=function(){var t=this;this.listenersCollector.add(document,"keydown",(function(e){"Control"===e.key&&(t.state.isCtrlPressed=!0)})),this.listenersCollector.add(document,"keyup",(function(e){"Control"===e.key&&(t.state.isCtrlPressed=!1)})),this.listenersCollector.add(document,"contextmenu",(function(e){e.ctrlKey&&(t.state.isCtrlPressed=!1)}))},e.prototype.addMouseEventListeners=function(){this.listenersCollector.add(this.target,"mousedown",this.handleMouseDown),this.listenersCollector.add(this.target,"mousemove",this.handleMouseMove),this.listenersCollector.add(document,"mousemove",this.handleGlobalMouseMove),this.listenersCollector.add(document,"mouseup",this.handleMouseUp),this.listenersCollector.add(this.target,"wheel",this.handleMouseWheel)},e.prototype.addTouchEventListeners=function(){this.listenersCollector.add(this.target,"touchstart",this.handleTouchStart),this.listenersCollector.add(document,"touchmove",this.handleGlobalTouchMove,{passive:!0,capture:!0}),this.listenersCollector.add(this.target,"touchmove",this.handleTouchMove,{passive:!0,capture:!0}),this.listenersCollector.add(document,"touchcancel",this.handleTouchEnd),this.listenersCollector.add(document,"touchend",this.handleTouchEnd)},e.prototype.addSafariGesturesEventListeners=function(){Bt()||(this.listenersCollector.add(this.target,"gesturestart",this.handleGestureStart,{capture:!0}),this.listenersCollector.add(this.target,"gesturechange",this.handleGestureChange,{capture:!0}),this.listenersCollector.add(this.target,"gestureend",this.handleGestureEnd,{capture:!0}))},e.prototype.clampPointerToTargetBounds=function(t){return{x:xt(t.x-this.targetBounds.x,0,this.target.clientWidth),y:xt(t.y-this.targetBounds.y,0,this.target.clientHeight)}},e.prototype.getCorrectPointerPosition=function(t){var e,n={x:0,y:0};if((null===(e=t.touches)||void 0===e?void 0:e.length)>1){var o=t,i=o.touches[0],r=o.touches[1];n={x:(i.clientX+r.clientX)/2,y:(i.clientY+r.clientY)/2}}else n=Ot(t);return this.clampPointerToTargetBounds(n)},e.prototype.updateMousePosition=function(t){this.emit("pointermove",{type:"mouse",position:this.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},e.prototype.updateGlobalMousePosition=function(t){this.emit("globalpointermove",{type:"mouse",position:this.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},e.prototype.calculateDistanceBetweenTouches=function(t,e){return Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)},e.prototype.emitZoomEvent=function(t,e){this.emit("pinchToZoom",t,e)},e.prototype.dispose=function(){this.listenersCollector.dispose()},e}(It),Nt=function(t){function e(e){var n=t.call(this)||this;return n.listenersCollector=new St,n.handleKeyUp=function(t){n.emit("keyUp",t.code)},n.target=e,n.addListeners(),n}return at(e,t),e.prototype.addListeners=function(){this.listenersCollector.add(this.target,"keyup",this.handleKeyUp)},e.prototype.dispose=function(){this.listenersCollector.dispose()},e}(It),zt=function(){function t(){this.active=!0}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.active&&console.debug.apply(console,lt(["[WR:Debug]"],t,!1))},t.prototype.warning=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.active&&console.warn.apply(console,lt(["[WR:Warn]"],t,!1))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.error.apply(console,lt(["[WR:Error]"],t,!1))},t}(),jt=new zt,Ut=function(){function t(t){this.label=t,this.startTime=performance.now(),this.startTimestamp=Date.now(),jt.debug("[Performance] Start: ".concat(this.label))}return t.prototype.measure=function(){return{duration:performance.now()-this.startTime,end:Date.now(),start:this.startTimestamp,id:this.label}},t.prototype.printMeasurement=function(){var t=this.measure().duration;if(t<1e3){var e=t.toFixed(2);jt.debug("[Performance] End: ".concat(this.label," -> ").concat(e," ms"))}else{var n=(t/1e3).toFixed(2);jt.debug("[Performance] End: ".concat(this.label," -> ").concat(n," s"))}},t}();function Zt(t){setTimeout((function(){t()}),0)}var Vt=function(t){function e(e){var n=t.call(this)||this;return n.listenersCollector=new St,n.size={width:0,height:0},n.pixelRatio=1,n.handleCanvasResizeObserver=function(t){n.resizeCanvas(t[0].contentRect)},n.resizeCanvas=function(t){var e=t.width,o=t.height;window.requestAnimationFrame((function(){n.setSize(e,o),n.emit("resize",e,o,n.getDevicePixelRatio())}))},n.getCanvasCenterPoint=function(){var t=n.getBoundingClientRect();return{x:t.width/2+t.x,y:t.height/2+t.y}},n.container=e.container,n.canvas=e.canvas,n.canvasResizeObserver=new ResizeObserver(n.handleCanvasResizeObserver),n.canvasResizeObserver.observe(n.container),n.listenersCollector.add(window,"orientationchange",n.handleDeviceOrientationChange),n.setSize(n.container.clientWidth,n.container.clientHeight),n}return at(e,t),e.prototype.setSize=function(t,e){this.pixelRatio=this.getDevicePixelRatio(),this.canvas.style.width="".concat(t,"px"),this.canvas.style.height="".concat(e,"px"),this.size.width=t*this.pixelRatio,this.size.height=e*this.pixelRatio,this.canvas.width=this.size.width,this.canvas.height=this.size.height},e.prototype.handleDeviceOrientationChange=function(){this.resizeCanvas({width:this.container.clientWidth,height:this.container.clientHeight})},e.prototype.getDevicePixelRatio=function(){return xt(window.devicePixelRatio,1,2)},e.prototype.getBoundingClientRect=function(){return this.canvas.getBoundingClientRect()},e.prototype.dispose=function(){this.detachAllListeners(),this.canvasResizeObserver.disconnect(),this.listenersCollector.dispose()},e}(It),qt=function(){function t(t){this.settings=t}return t.prototype.isReleaseMode=function(){return this.settings.mode===Ft.release},t.prototype.init=function(){return ct(this,void 0,void 0,(function(){var t,e,n,o,i,r=this;return dt(this,(function(s){switch(s.label){case 0:return[4,this.importModule()];case 1:t=s.sent(),e=t.default,s.label=2;case 2:return s.trys.push([2,4,,5]),n=this,[4,e({FeatureFlags:this.settings.featureFlags,currentWebGLVersion:Tt(),bridge:this.settings.jsBridge,locateFile:function(t){return r.settings.locateFile.replace("{file}",t)}})];case 3:return n.instance=s.sent(),[3,5];case 4:throw o=s.sent(),new Pt("WASM_ERROR","An error occurred while trying to create the wasm module.",o);case 5:return this.pointerTypeToWASMMap={unset:this.instance.PRUserPointerType.Unset,mouse:this.instance.PRUserPointerType.Mouse,touch:this.instance.PRUserPointerType.Touch},this.prCursorTypeToCSSCursorMap=((i={})[this.instance.PRCursorType.Auto.value]="auto",i[this.instance.PRCursorType.Default.value]="default",i[this.instance.PRCursorType.Pointer.value]="pointer",i[this.instance.PRCursorType.Grab.value]="grab",i[this.instance.PRCursorType.Grabbing.value]="grabbing",i),[2]}}))}))},t.prototype.makeWebGLContext=function(t,e){void 0===e&&(e={});var n=ut({antialias:!1,alpha:!1,stencil:!1,depth:!1,powerPreference:"high-performance",preserveDrawingBuffer:!1,desynchronized:!0},e);jt.debug("Using WebGL ".concat(n.majorVersion));var o=this.instance.GL.createContext(t,n);if(!o)throw new Pt("WEBGL_ERROR","Unable to create WebGL context. WebGL might be unsupported, disabled, or this device is not able to run WebGL correctly.");return o},t.prototype.destroyWebGLContext=function(t){var e,n=null===(e=this.instance)||void 0===e?void 0:e.GL.getContext(t);if(n){var o=n.GLctx.getExtension("WEBGL_lose_context");o?o.loseContext():jt.warning("Unable to retrieve WEBGL_lose_context extension")}else jt.warning("Unable to loose context. WebGL rendering context not found")},t.prototype.importModule=function(){return this.isReleaseMode()?import("./module-release-0b378fd1.js"):import("./module-debug-7ee9ba03.js")},t.prototype.mapToCSSCursor=function(t){return this.prCursorTypeToCSSCursorMap[t.value]},t.prototype.mapToPRPointerType=function(t){var e;return null!==(e=this.pointerTypeToWASMMap[t])&&void 0!==e?e:this.instance.PRUserPointerType.Unset},t.prototype.mapPointerInfo=function(t){return ut(ut({},t),{type:this.mapToPRPointerType(t.type)})},t}(),Ht=function(t){function e(e){var n=t.call(this)||this;return n.status={type:"INIT"},n.handleCanvasResize=function(t,e,o){var i;null===(i=n.pageCanvasWasm)||void 0===i||i.resize(t,e,o)},n.handleWebGLContextLost=function(){n.setStatus({type:"WEBGL_CONTEXT_LOST"})},n.handlePinchToZoomEvent=function(t,e){var o;null===(o=n.userEventsCollectorWasm)||void 0===o||o.dispatchPinchToZoomEvent(t,e.x,e.y)},n.handleWheelEvent=function(t,e){var o;null===(o=n.userEventsCollectorWasm)||void 0===o||o.dispatchWheelEvent(t.x,t.y,n.wasmModule.mapPointerInfo(e))},n.handlePointerDownEvent=function(t){var e;null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchPointerDownEvent(n.wasmModule.mapPointerInfo(t))},n.handlePointerMoveEvent=function(t){var e;null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchPointerMoveEvent(n.wasmModule.mapPointerInfo(t))},n.handleGlobalPointerMoveEvent=function(t){var e;null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchGlobalPointerMoveEvent(n.wasmModule.mapPointerInfo(t))},n.handlePointerUpEvent=function(t){var e;null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchPointerUpEvent(n.wasmModule.mapPointerInfo(t))},n.settings=ut(ut({backgroundColor:{r:1,g:1,b:1,a:1},showTilesBorders:!1,preserveDrawingBuffer:!1,panBoundariesPadding:0},Wt(e)),{featureFlags:ut(ut({},Rt),e.featureFlags)}),jt.active=n.settings.mode===Ft.debug,n.gestureManager=new Gt(n.settings.container),n.canvasManager=new Vt({container:n.settings.container,canvas:n.settings.canvas}),n.wasmModule=new qt({mode:n.settings.mode,locateFile:n.settings.locateFile,jsBridge:n.createJSBridge(),featureFlags:n.settings.featureFlags}),n.settings.manualInitialization||n.init(),n}return at(e,t),e.prototype.addListeners=function(){this.canvasManager.on("resize",this.handleCanvasResize),this.gestureManager.on("wheel",this.handleWheelEvent),this.gestureManager.on("pointerup",this.handlePointerUpEvent),this.gestureManager.on("pointermove",this.handlePointerMoveEvent),this.gestureManager.on("globalpointermove",this.handleGlobalPointerMoveEvent),this.gestureManager.on("pointerdown",this.handlePointerDownEvent),this.gestureManager.on("pinchToZoom",this.handlePinchToZoomEvent),this.settings.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost)},e.prototype.collectAndEmitDeviceInfo=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:return[4,Ct()];case 1:return t=e.sent(),this.deviceInfo=ut(ut({},t),{hardwareConcurrency:navigator.hardwareConcurrency}),this.emit("deviceInfo",this.deviceInfo),[2]}}))}))},e.prototype.init=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:this.traceFirstPaint=new Ut("FirstPaint"),this.setStatus({type:"INIT"}),this.collectAndEmitDeviceInfo(),e.label=1;case 1:return e.trys.push([1,6,,7]),[4,this.initWasmModule()];case 2:return e.sent(),[4,this.initCanvasRendererWasm()];case 3:return e.sent(),[4,this.setFile(this.settings.filePath)];case 4:return e.sent(),[4,this.preloadImages()];case 5:return e.sent(),[3,7];case 6:return t=e.sent(),[2,this.fail(t instanceof Pt?t:new Pt("ERROR","Unexpected exception initializing the web renderer",t))];case 7:return this.setInitialCameraState(),this.startRendering(),this.addListeners(),[2]}}))}))},e.prototype.setInitialCameraState=function(){var t,e,n,o=void 0!==this.settings.initialZoom,i=void 0!==this.settings.initialPan;o||i?(o&&this.setZoom(this.settings.initialZoom||1),i&&this.setPan((null===(t=this.settings.initialPan)||void 0===t?void 0:t.x)||0,(null===(e=this.settings.initialPan)||void 0===e?void 0:e.y)||0,null===(n=this.settings.initialPan)||void 0===n?void 0:n.centerPointInViewport)):this.zoomToFit()},e.prototype.preloadImages=function(){var t=this;return new Promise((function(e){var n;null===(n=t.pageCanvasWasm)||void 0===n||n.preloadImages((function(){e()}))}))},e.prototype.startRendering=function(){this.traceInitialRender=new Ut("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),this.pageCanvasWasm.startRenderLoop()},e.prototype.createJSBridge=function(){var t=this;return{logDebug:function(t){jt.debug("[C++] ".concat(t))},logWarning:function(t){jt.warning("[C++] ".concat(t))},logError:function(t){jt.error("[C++] ".concat(t))},emitMetric:function(e,n,o,i){t.emit("metric",{id:e,start:n,end:o,duration:i})},resolveImageUrl:function(e){return t.settings.imagesURLFormat?t.settings.imagesURLFormat.replace(":imageId",e):t.settings.imagesURLMap&&t.settings.imagesURLMap[e]?t.settings.imagesURLMap[e]:(jt.warning("Not able to resolve the url for the image with UUID: ".concat(e)),"")},onDrawComplete:this.handleDrawComplete.bind(this),onAllImagesReady:function(){t.emit("allImagesReady")},onCameraMoveStart:function(){t.emit("cameraMoveStart")},onCameraMoveEnd:function(){t.emit("cameraMoveEnd")},onCameraZoomStart:function(){t.emit("cameraZoomStart")},onCameraZoomEnd:function(){t.emit("cameraZoomEnd")},onCameraZoomChange:function(e){t.emit("cameraZoomChange",e)},onCameraPanChange:function(){var e=t.getPan();t.emit("cameraPanChange",(null==e?void 0:e.x)||0,(null==e?void 0:e.y)||0)},onCursorChange:function(e){var n=t.wasmModule.mapToCSSCursor(e);t.emit("cursorChange",n)},onPlayStateChange:function(){}}},e.prototype.downloadImages=function(){var t=this;return new Promise((function(e){var n,o=new Ut("ImagesDownload");null===(n=t.pageCanvasWasm)||void 0===n||n.downloadImages((function(){o.printMeasurement(),t.emit("metric",o.measure()),jt.debug("Images downloaded"),e()}))}))},e.prototype.initWasmModule=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:return t=new Ut("WasmModuleDownload"),[4,this.wasmModule.init()];case 1:return e.sent(),t.printMeasurement(),this.emit("metric",t.measure()),[2]}}))}))},e.prototype.initCanvasRendererWasm=function(){return ct(this,void 0,void 0,(function(){return dt(this,(function(t){try{this.webglCtxHandle=this.wasmModule.makeWebGLContext(this.settings.canvas,{preserveDrawingBuffer:this.settings.preserveDrawingBuffer,majorVersion:Tt()}),this.renderTarget=this.wasmModule.instance.RenderTarget.MakeWebGL(this.webglCtxHandle,this.canvasManager.size.width,this.canvasManager.size.height,this.canvasManager.pixelRatio),this.pageCanvasWasm=new this.wasmModule.instance.CanvasRenderer(this.renderTarget,{showTilesBorders:this.settings.showTilesBorders})}catch(t){throw new Pt("WASM_ERROR","An error occurred while trying to create the wasm object.",t)}return this.userEventsCollectorWasm=this.pageCanvasWasm.getUserEventsCollector(),this.pageCanvasWasm.setBackgroundColor(this.settings.backgroundColor.r,this.settings.backgroundColor.g,this.settings.backgroundColor.b,this.settings.backgroundColor.a),this.pageCanvasWasm.setZoomLevels(this.settings.minimumZoomLevel,this.settings.maximumZoomLevel),this.pageCanvasWasm.setPanBoundariesPadding(this.settings.panBoundariesPadding),[2]}))}))},e.prototype.setIsCameraLocked=function(t){this.pageCanvasWasm.setIsCameraLocked(t)},e.prototype.setBackgroundColor=function(t){t.r===this.settings.backgroundColor.r&&t.g===this.settings.backgroundColor.g&&t.b===this.settings.backgroundColor.b&&t.a===this.settings.backgroundColor.a||(this.pageCanvasWasm.setBackgroundColor(t.r,t.g,t.b,t.a),this.settings.backgroundColor=t)},e.prototype.generateDocumentPNG=function(){return ct(this,void 0,void 0,(function(){return dt(this,(function(t){switch(t.label){case 0:return[4,this.downloadImages()];case 1:return t.sent(),[2,this.pageCanvasWasm.generateDocumentPNG()]}}))}))},e.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(this.traceInitialRender.printMeasurement(),this.emit("metric",this.traceInitialRender.measure()),this.traceFirstPaint.printMeasurement(),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}),this.downloadImages())},e.prototype.looseWebGLContext=function(){this.wasmModule.destroyWebGLContext(this.webglCtxHandle),this.webglCtxHandle=-1},e.prototype.zoomToFit=function(){this.pageCanvasWasm.scaleDocumentToFit()},e.prototype.setFile=function(t){return ct(this,void 0,void 0,(function(){var e=this;return dt(this,(function(n){return this.setStatus({type:"LOADING_FILE"}),[2,new Promise((function(n,o){e.pageCanvasWasm.setFile(t,(function(t,o,i,r){if(void 0===r&&(r=[]),r.length){jt.debug("Parser warnings: ".concat(r));var s=r.map((function(t){return{key:t}}));e.emit("warnings",s)}e.setStatus({type:"FILE_READY"}),e.emit("fileReady",e.getDocument(),t,o,i),n()}),(function(){return o(new Pt("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))]}))}))},e.prototype.fail=function(t){this.setStatus({type:"FAILURE",code:t.code,message:"".concat(t.toString()).concat(t.cause?"\nWrapped Error: ".concat(t.cause.toString()):"")}),jt.error(t),t.cause&&jt.error(t.cause)},e.prototype.setStatus=function(t){"FAILURE"!==this.status.type&&(jt.debug("Status transition ".concat(this.status.type," => ").concat(t.type,"}")),this.status=t,this.emit("status",t))},e.prototype.getDocument=function(){if(!this.cachedDocumentInfo||this.cachedDocumentInfo.filePath!==this.settings.filePath){var t=this.pageCanvasWasm.getPRFile();this.cachedDocumentInfo={filePath:this.settings.filePath,document:ut(ut({},t),{artboards:At(t.artboards)})}}return this.cachedDocumentInfo.document},e.prototype.getArtboardAtPosition=function(t,e){if(this.pageCanvasWasm){var n=this.getDocument();if(n){for(var o=this.pageCanvasWasm.getPan(),i=this.pageCanvasWasm.getZoom(),r=(t-o.x)/i,s=(e-o.y)/i,a=0,u=n.artboards;a<u.length;a++){var c=u[a],d=c.bounds.x+c.bounds.width,l=c.bounds.y+c.bounds.height;if(r>=c.bounds.x&&s>=c.bounds.y&&r<=d&&s<=l)return c.objectId}return null}}},e.prototype.getPanAtPosition=function(t,e){var n=this.getPan(),o=Math.max(this.getZoom(),Number.EPSILON),i=t/o,r=e/o;return{x:n.x-i,y:n.y-r}},e.prototype.getStatus=function(){return this.status},e.prototype.setZoom=function(t,e){var n,o=null!=e?e:this.canvasManager.getCanvasCenterPoint();null===(n=this.pageCanvasWasm)||void 0===n||n.setZoom(t,o.x,o.y)},e.prototype.getPan=function(){var t=this.getDocument().bounds,e=this.pageCanvasWasm.getPan(),n=this.pageCanvasWasm.getZoom();return{x:e.x/n+t.x,y:e.y/n+t.y}},e.prototype.getZoom=function(){return this.pageCanvasWasm.getZoom()},e.prototype.setPan=function(t,e,n){void 0===n&&(n=!1);var o=t,i=e,r=this.getDocument().bounds,s=this.pageCanvasWasm.getZoom();if(n){var a=Math.max(2*s*this.canvasManager.pixelRatio,Number.EPSILON);o+=this.canvasManager.size.width/a,i+=this.canvasManager.size.height/a}var u=(o-r.x)*s,c=(i-r.y)*s;this.pageCanvasWasm.setPan(u,c)},e.prototype.dispose=function(){try{this.detachAllListeners(),this.canvasManager.dispose(),this.gestureManager.dispose(),this.pageCanvasWasm.stopRenderLoop(),this.pageCanvasWasm.delete(),this.renderTarget.delete()}catch(t){this.fail(new Pt("ERROR","Unexpected exception while disposing the wasm object",t))}},e}(It),Kt=e(void 0),Yt=e(void 0),$t=e(void 0),Xt=e(void 0),Jt=e(void 0),Qt=e(void 0),te=e("auto"),ee=e(void 0),ne=function(){var t=n(ee);if(void 0===t)throw Error("useInternalContext must be used within a provider");return t},oe=function(t,e){switch(e.type){case"on-status":return ut(ut({},t),{status:e.status});case"on-file-ready":return ut(ut({},t),{document:e.document});case"on-zoom":return ut(ut({},t),{zoom:e.zoom});case"on-pan":return ut(ut({},t),{pan:e.pan});case"dispose":return ut(ut({},t),{status:null,zoom:null,pan:null,cursor:"auto"});case"on-camera-zoom-start":return ut(ut({},t),{isCameraZooming:!0});case"on-camera-zoom-end":return ut(ut({},t),{isCameraZooming:!1});case"on-camera-move-start":return ut(ut({},t),{isCameraMoving:!0});case"on-camera-move-end":return ut(ut({},t),{isCameraMoving:!1});case"on-cursor-change":return ut(ut({},t),{cursor:e.cursor});default:return t}},ie=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return jt.debug.apply(jt,lt(["CanvasRendererReact"],t,!1))},re=function(e){var n=o(null),a=o(null),u=i(oe,{pan:null,zoom:null,status:null,document:null,isCameraZooming:!1,isCameraMoving:!1,cursor:"auto"}),c=u[0],d=c.status,l=c.document,h=c.zoom,b=c.pan,p=c.isCameraZooming,f=c.isCameraMoving,_=c.cursor,g=u[1],m=r((function(t){return g({type:"on-zoom",zoom:t})}),[]),v=r((function(t,e){return g({type:"on-pan",pan:{x:t,y:e}})}),[]),w=r((function(t){g({type:"on-status",status:t})}),[]),y=r((function(t){g({type:"on-file-ready",document:t})}),[]),C=r((function(){return g({type:"on-camera-zoom-start"})}),[]),F=r((function(){return g({type:"on-camera-zoom-end"})}),[]),P=r((function(){return g({type:"on-camera-move-start"})}),[]),I=r((function(){return g({type:"on-camera-move-end"})}),[]),S=r((function(t){return g({type:"on-cursor-change",cursor:t})}),[]),R=r((function(){var t=n.current;t&&(ie("dispose"),t.off("status",w),t.off("fileReady",y),t.off("cameraZoomChange",m),t.off("cameraPanChange",v),t.off("cameraZoomStart",C),t.off("cameraZoomEnd",F),t.off("cameraMoveStart",P),t.off("cameraMoveEnd",I),t.off("cursorChange",S),t.dispose(),n.current=null,g({type:"dispose"}))}),[w,y,v,m,C,F,P,I,S]),E=r((function(t,e,o){if(""!==t&&e&&o&&a.current){ie("init");var i=new Ht(ut(ut({},a.current),{filePath:t,container:o,canvas:e}));i.on("status",w),i.on("fileReady",y),i.on("cameraZoomChange",m),i.on("cameraPanChange",v),i.on("cameraZoomStart",C),i.on("cameraZoomEnd",F),i.on("cameraMoveStart",P),i.on("cameraMoveEnd",I),i.on("cursorChange",S),n.current=i}}),[w,y,m,v,C,F,P,I,S]),M=r((function(t){var e;ie("setSettings",t),t.backgroundColor&&(null===(e=n.current)||void 0===e||e.setBackgroundColor(t.backgroundColor)),a.current=t}),[]),L=r((function(){return n.current}),[]),D=s((function(){return{dispose:R,init:E,setSettings:M,getInstance:L,dispatch:g}}),[R,E,M,L]);return t.createElement(ee.Provider,{value:D},t.createElement(Kt.Provider,{value:d},t.createElement(Yt.Provider,{value:l},t.createElement($t.Provider,{value:h},t.createElement(Qt.Provider,{value:b},t.createElement(Xt.Provider,{value:p},t.createElement(Jt.Provider,{value:f},t.createElement(te.Provider,{value:_},e.children))))))))},se=function(){var t=n(Kt);if(void 0===t)throw Error("useStatus must be used within a provider");return t},ae=function(){var t=n(Yt);if(void 0===t)throw Error("useDocument must be used within a provider");return t},ue=function(){var t=n($t);if(void 0===t)throw Error("useZoom must be used within a provider");return t},ce=function(){var t=n(Qt);if(void 0===t)throw Error("usePan must be used within a provider");return t},de=function(){var t=n(te);if(void 0===t)throw Error("useCursor must be used within a provider");return t},le=function(){var t=n(Xt);if(void 0===status)throw Error("useIsCameraZooming must be used within a provider");return t},he=function(){var t=n(Jt);if(void 0===status)throw Error("useIsCameraMoving must be used within a provider");return t},be=function(){var t=(0,ne().getInstance)();return r((function(e){ie("setZoom",e),null==t||t.setZoom(e)}),[t])},pe=function(){var t=be(),e=ue();return r((function(){var n;(ie("incrementZoom"),"number"==typeof e)&&(n=e>=1?Math.round(2*e):e>.5?1:2*e,t(n))}),[t,e])},fe=function(){var t=be(),e=ue();return r((function(){ie("decrementZoom"),"number"==typeof e&&t(e/2)}),[t,e])},_e=function(){var t=(0,ne().getInstance)();return r((function(e){var n=e.x,o=e.y,i=e.centerPointInViewport;ie("setPan",n,o,"centerPointInViewport",i),null==t||t.setPan(n,o,i)}),[t])},ge=function(){var t=(0,ne().getInstance)();return r((function(){ie("zoomToFit"),null==t||t.zoomToFit()}),[t])},me=function(){var t=(0,ne().getInstance)();return r((function(){ie("looseWebGLContext"),null==t||t.looseWebGLContext()}),[t])},ve=function(){var t=(0,ne().getInstance)();return r((function(){return ct(void 0,void 0,void 0,(function(){return dt(this,(function(e){switch(e.label){case 0:return ie("generateDocumentPNG"),[4,null==t?void 0:t.generateDocumentPNG()];case 1:return[2,e.sent()]}}))}))}),[t])},we=function(){var t=(0,ne().getInstance)();return r((function(e,n){return ct(void 0,void 0,void 0,(function(){return dt(this,(function(o){switch(o.label){case 0:return ie("getArtboardAtPosition",e,n),[4,null==t?void 0:t.getArtboardAtPosition(e,n)];case 1:return[2,o.sent()||null]}}))}))}),[t])},ye=function(){var t=(0,ne().getInstance)();return r((function(e,n){return ct(void 0,void 0,void 0,(function(){return dt(this,(function(o){switch(o.label){case 0:return ie("getPanAtPosition",e,n),[4,null==t?void 0:t.getPanAtPosition(e,n)];case 1:return[2,o.sent()||null]}}))}))}),[t])},Ce=function(){var t=(0,ne().getInstance)();return r((function(e){ie("setIsCameraLocked",e),null==t||t.setIsCameraLocked(e)}),[t])},Fe=function(t,e){var n=(0,ne().getInstance)();a((function(){return null==n||n.on(t,e),function(){null==n||n.off(t,e)}}),[t,n,e])},Pe={position:"relative",width:"100%",height:"100%",touchAction:"manipulation"},Ie={position:"absolute",top:0,left:0},Se=function(e){jt.active=e.mode===Ft.debug;var n=e.filePath,i=e.locateFile,c=e.imagesURLFormat,d=e.imagesURLMap,l=e.backgroundColor,h=e.mode,b=e.showTilesBorders,p=e.minimumZoomLevel,f=e.maximumZoomLevel,_=e.preserveDrawingBuffer,g=e.panBoundariesPadding,m=e.initialPan,v=e.initialZoom,w=e.children,y=e.containerProps,C=void 0===y?{}:y,F=e.canvasProps,P=void 0===F?{}:F,I=e.featureFlags,S=void 0===I?{}:I,R=o(null),E=o(null),M=u(!1),L=M[0],D=M[1],O=r((function(){return D(!0)}),[]),x=ne(),T=x.dispose,A=x.init,B=x.setSettings,W=de(),k=se();Fe("allImagesReady",O),a((function(){B({locateFile:i,imagesURLFormat:c,imagesURLMap:d,backgroundColor:l,mode:h,showTilesBorders:b,minimumZoomLevel:p,maximumZoomLevel:f,preserveDrawingBuffer:_,panBoundariesPadding:g,initialPan:m,initialZoom:v,featureFlags:S})}),[B,i,c,d,l,h,b,p,f,_,g,m,v,S]),a((function(){if(n)return A(n,R.current,E.current),function(){T()}}),[T,A,n]);var G=s((function(){var t;return null!==(t=e.cursor)&&void 0!==t?t:W}),[e.cursor,W]),N=s((function(){return ut(ut({},Pe),{cursor:G})}),[G]);return t.createElement("div",ut({},C,{ref:E,style:N}),n&&t.createElement("canvas",ut({},P,{key:n,ref:R,"data-sketchweb-all-images-ready":L,"data-testid":"sketchweb-canvas","data-sketchweb-status":"sketchweb-status-".concat((null==k?void 0:k.type.toLowerCase())||"null"),style:Ie})),"READY"===(null==k?void 0:k.type)&&w)},Re=function(t){function e(e){var n=t.call(this)||this;return n.status={type:"INIT"},n.handleCanvasResize=function(t,e,o){var i;null===(i=n.playerWasm)||void 0===i||i.resize(t,e,o)},n.handleWebGLContextLost=function(){n.setStatus({type:"WEBGL_CONTEXT_LOST"})},n.handlePinchToZoomEvent=function(t,e){var o;null===(o=n.userEventsCollectorWasm)||void 0===o||o.dispatchPinchToZoomEvent(t,e.x,e.y)},n.handleWheelEvent=function(t,e){n.userEventsCollectorWasm.dispatchWheelEvent(t.x,t.y,n.wasmModule.mapPointerInfo(e))},n.handlePointerDownEvent=function(t){n.userEventsCollectorWasm.dispatchPointerDownEvent(n.wasmModule.mapPointerInfo(t))},n.handlePointerMoveEvent=function(t){n.userEventsCollectorWasm.dispatchPointerMoveEvent(n.wasmModule.mapPointerInfo(t))},n.handleGlobalPointerMoveEvent=function(t){n.userEventsCollectorWasm.dispatchGlobalPointerMoveEvent(n.wasmModule.mapPointerInfo(t))},n.handlePointerUpEvent=function(t){n.userEventsCollectorWasm.dispatchPointerUpEvent(n.wasmModule.mapPointerInfo(t))},n.restartPrototype=function(t){n.playerWasm.restartPrototype(t)},n.goBack=function(){n.playerWasm.goBack()},n.goForwards=function(){n.playerWasm.goForwards()},n.settings=ut(ut({backgroundColor:{r:1,g:1,b:1,a:1},showTilesBorders:!1,preserveDrawingBuffer:!1},Wt(e)),{featureFlags:ut(ut({},Rt),e.featureFlags)}),jt.active=n.settings.mode===Ft.debug,n.gestureManager=new Gt(n.settings.container),n.canvasManager=new Vt({container:n.settings.container,canvas:n.settings.canvas}),n.wasmModule=new qt({mode:n.settings.mode,locateFile:n.settings.locateFile,jsBridge:n.createJSBridge(),featureFlags:n.settings.featureFlags}),n.settings.manualInitialization||n.init(),n}return at(e,t),e.prototype.addListeners=function(){this.canvasManager.on("resize",this.handleCanvasResize),this.gestureManager.on("wheel",this.handleWheelEvent),this.gestureManager.on("pointerup",this.handlePointerUpEvent),this.gestureManager.on("pointermove",this.handlePointerMoveEvent),this.gestureManager.on("globalpointermove",this.handleGlobalPointerMoveEvent),this.gestureManager.on("pointerdown",this.handlePointerDownEvent),this.gestureManager.on("pinchToZoom",this.handlePinchToZoomEvent),this.settings.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost)},e.prototype.collectAndEmitDeviceInfo=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:return[4,Ct()];case 1:return t=e.sent(),this.deviceInfo=ut(ut({},t),{hardwareConcurrency:navigator.hardwareConcurrency}),this.emit("deviceInfo",this.deviceInfo),[2]}}))}))},e.prototype.init=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:this.traceFirstPaint=new Ut("FirstPaint"),this.setStatus({type:"INIT"}),this.collectAndEmitDeviceInfo(),e.label=1;case 1:return e.trys.push([1,6,,7]),[4,this.initWasmModule()];case 2:return e.sent(),[4,this.initPlayerWasm()];case 3:return e.sent(),[4,this.setFile(this.settings.filePath)];case 4:return e.sent(),[4,this.preloadImages()];case 5:return e.sent(),[3,7];case 6:return t=e.sent(),[2,this.fail(t instanceof Pt?t:new Pt("ERROR","Unexpected exception initializing the web renderer",t))];case 7:return this.setInitialCameraState(),this.startRendering(),this.addListeners(),[2]}}))}))},e.prototype.initWasmModule=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:return t=new Ut("WasmModuleDownload"),[4,this.wasmModule.init()];case 1:return e.sent(),t.printMeasurement(),this.emit("metric",t.measure()),[2]}}))}))},e.prototype.setInitialCameraState=function(){this.zoomToFit()},e.prototype.preloadImages=function(){var t=this;return new Promise((function(e){var n;null===(n=t.playerWasm)||void 0===n||n.preloadImages((function(){e()}))}))},e.prototype.startRendering=function(){this.traceInitialRender=new Ut("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),this.playerWasm.startRenderLoop()},e.prototype.createJSBridge=function(){var t=this;return{logDebug:function(t){jt.debug("[C++] ".concat(t))},logWarning:function(t){jt.warning("[C++] ".concat(t))},logError:function(t){jt.error("[C++] ".concat(t))},emitMetric:function(e,n,o,i){t.emit("metric",{id:e,start:n,end:o,duration:i})},resolveImageUrl:function(e){return t.settings.imagesURLFormat?t.settings.imagesURLFormat.replace(":imageId",e):t.settings.imagesURLMap&&t.settings.imagesURLMap[e]?t.settings.imagesURLMap[e]:(jt.warning("Not able to resolve the url for the image with UUID: ".concat(e)),"")},onDrawComplete:this.handleDrawComplete.bind(this),onAllImagesReady:function(){t.emit("allImagesReady")},onCameraMoveStart:function(){t.emit("cameraMoveStart")},onCameraMoveEnd:function(){t.emit("cameraMoveEnd")},onCameraZoomStart:function(){t.emit("cameraZoomStart")},onCameraZoomEnd:function(){t.emit("cameraZoomEnd")},onCameraZoomChange:function(e){t.emit("cameraZoomChange",e)},onCameraPanChange:function(e,n){t.emit("cameraPanChange",e,n)},onCursorChange:function(e){var n=t.wasmModule.mapToCSSCursor(e);t.emit("cursorChange",n)},onPlayStateChange:function(e,n,o){t.emit("playStateChange",{screenArtboardId:e,canGoBack:n,canGoForwards:o})}}},e.prototype.downloadImages=function(){var t=this;return new Promise((function(e){var n,o=new Ut("ImagesDownload");null===(n=t.playerWasm)||void 0===n||n.downloadImages((function(){o.printMeasurement(),t.emit("metric",o.measure()),jt.debug("Images downloaded"),e()}))}))},e.prototype.initPlayerWasm=function(){return ct(this,void 0,void 0,(function(){return dt(this,(function(t){try{this.webglCtxHandle=this.wasmModule.makeWebGLContext(this.settings.canvas,{preserveDrawingBuffer:this.settings.preserveDrawingBuffer,majorVersion:Tt()}),this.renderTarget=this.wasmModule.instance.RenderTarget.MakeWebGL(this.webglCtxHandle,this.canvasManager.size.width,this.canvasManager.size.height,this.canvasManager.pixelRatio),this.playerWasm=new this.wasmModule.instance.PrototypeRenderer(this.renderTarget,{showTilesBorders:this.settings.showTilesBorders},this.settings.startArtboardUUID)}catch(t){throw new Pt("WASM_ERROR","An error occurred while trying to create the WebRendererWasm object.",t)}return this.userEventsCollectorWasm=this.playerWasm.getUserEventsCollector(),this.playerWasm.setBackgroundColor(this.settings.backgroundColor.r,this.settings.backgroundColor.g,this.settings.backgroundColor.b,this.settings.backgroundColor.a),this.playerWasm.setZoomLevels(this.settings.minimumZoomLevel,this.settings.maximumZoomLevel),[2]}))}))},e.prototype.setIsCameraLocked=function(t){var e;null===(e=this.playerWasm)||void 0===e||e.setIsCameraLocked(t)},e.prototype.setBackgroundColor=function(t){var e;t.r===this.settings.backgroundColor.r&&t.g===this.settings.backgroundColor.g&&t.b===this.settings.backgroundColor.b&&t.a===this.settings.backgroundColor.a||(null===(e=this.playerWasm)||void 0===e||e.setBackgroundColor(t.r,t.g,t.b,t.a),this.settings.backgroundColor=t)},e.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(this.traceInitialRender.printMeasurement(),this.emit("metric",this.traceInitialRender.measure()),this.traceFirstPaint.printMeasurement(),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}),this.downloadImages())},e.prototype.looseWebGLContext=function(){this.wasmModule.destroyWebGLContext(this.webglCtxHandle),this.webglCtxHandle=-1},e.prototype.zoomToFit=function(){this.playerWasm.scaleDocumentToFit()},e.prototype.setFile=function(t){return ct(this,void 0,void 0,(function(){var e=this;return dt(this,(function(n){return this.setStatus({type:"LOADING_FILE"}),[2,new Promise((function(n,o){e.playerWasm.setFile(t,(function(t,o,i,r){if(void 0===r&&(r=[]),r.length){jt.debug("Parser warnings: ".concat(r));var s=r.map((function(t){return{key:t}}));e.emit("warnings",s)}e.setStatus({type:"FILE_READY"}),e.emit("fileReady",e.getDocument(),t,o,i),n()}),(function(){return o(new Pt("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))]}))}))},e.prototype.fail=function(t){this.setStatus({type:"FAILURE",code:t.code,message:"".concat(t.toString()).concat(t.cause?"\nWrapped Error: ".concat(t.cause.toString()):"")}),jt.error(t),t.cause&&jt.error(t.cause)},e.prototype.setStatus=function(t){"FAILURE"!==this.status.type&&(jt.debug("Status transition ".concat(this.status.type," => ").concat(t.type,"}")),this.status=t,this.emit("status",t))},e.prototype.getStatus=function(){return this.status},e.prototype.getDocument=function(){if(!this.cachedDocumentInfo||this.cachedDocumentInfo.filePath!==this.settings.filePath){var t=this.playerWasm.getPRFile();this.cachedDocumentInfo={filePath:this.settings.filePath,document:ut(ut({},t),{artboards:At(t.artboards)})}}return this.cachedDocumentInfo.document},e.prototype.dispose=function(){try{this.detachAllListeners(),this.canvasManager.dispose(),this.gestureManager.dispose(),this.playerWasm.stopRenderLoop(),this.playerWasm.delete(),this.renderTarget.delete()}catch(t){this.fail(new Pt("ERROR","Unexpected exception while disposing the WebRendererWasm object",t))}},e}(It),Ee=e(void 0),Me=e("auto"),Le=e(void 0),De=e(void 0),Oe=function(){var t=n(De);if(void 0===t)throw Error("useInternalContext must be used within a provider");return t},xe=function(t,e){switch(e.type){case"on-status":return ut(ut({},t),{status:e.status});case"dispose":return ut(ut({},t),{status:null,cursor:"auto"});case"on-cursor-change":return ut(ut({},t),{cursor:e.cursor});case"on-play-state-change":return ut(ut({},t),{playState:ut(ut({},t.playState),e.playState)});default:return t}},Te=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return jt.debug.apply(jt,lt(["PrototypeRendererReact"],t,!1))},Ae=function(e){var n=o(null),a=o(null),u=i(xe,{status:null,cursor:"auto",playState:{screenArtboardId:"",canGoBack:!0,canGoForwards:!0}}),c=u[0],d=c.status,l=c.cursor,h=c.playState,b=u[1],p=r((function(t){b({type:"on-status",status:t})}),[]),f=r((function(t){return b({type:"on-cursor-change",cursor:t})}),[]),_=r((function(t){return b({type:"on-play-state-change",playState:t})}),[]),g=r((function(){var t=n.current;t&&(Te("dispose"),t.off("status",p),t.off("cursorChange",f),t.off("playStateChange",_),t.dispose(),n.current=null,b({type:"dispose"}))}),[p,f,_]),m=r((function(t,e,o){if(""!==t&&e&&o&&a.current){Te("init");var i=new Re(ut(ut({},a.current),{filePath:t,container:o,canvas:e}));i.on("status",p),i.on("cursorChange",f),i.on("playStateChange",_),n.current=i}}),[p,f,_]),v=r((function(t){var e;Te("setSettings",t),t.backgroundColor&&(null===(e=n.current)||void 0===e||e.setBackgroundColor(t.backgroundColor)),a.current=t}),[]),w=r((function(){return n.current}),[]),y=s((function(){return{dispose:g,init:m,setSettings:v,getInstance:w,dispatch:b}}),[g,m,v,w]);return t.createElement(De.Provider,{value:y},t.createElement(Ee.Provider,{value:d},t.createElement(Me.Provider,{value:l},t.createElement(Le.Provider,{value:h},e.children))))},Be=function(){var t=(0,Oe().getInstance)();return r((function(e){null==t||t.restartPrototype(e)}),[t])},We=function(){var t=(0,Oe().getInstance)();return r((function(){null==t||t.goBack()}),[t])},ke=function(){var t=(0,Oe().getInstance)();return r((function(){null==t||t.goForwards()}),[t])},Ge=function(){var t=n(Ee);if(void 0===t)throw Error("usePrototypeStatus must be used within a provider");return t},Ne=function(){var t=n(Me);if(void 0===t)throw Error("usePrototypeCursor must be used within a provider");return t},ze=function(){var t=n(Le);if(void 0===t)throw Error("usePrototypePlayState must be used within a provider");return t},je=function(t,e){var n=(0,Oe().getInstance)();a((function(){return null==n||n.on(t,e),function(){null==n||n.off(t,e)}}),[t,n,e])},Ue={position:"relative",width:"100%",height:"100%",touchAction:"manipulation"},Ze={position:"absolute",top:0,left:0},Ve=function(e){jt.active=e.mode===Ft.debug;var n=e.filePath,i=e.locateFile,r=e.imagesURLFormat,u=e.imagesURLMap,c=e.backgroundColor,d=e.mode,l=e.showTilesBorders,h=e.minimumZoomLevel,b=e.maximumZoomLevel,p=e.preserveDrawingBuffer,f=e.children,_=e.containerProps,g=void 0===_?{}:_,m=e.canvasProps,v=void 0===m?{}:m,w=e.featureFlags,y=void 0===w?{}:w,C=e.startArtboardUUID,F=o(null),P=o(null),I=Oe(),S=I.dispose,R=I.init,E=I.setSettings,M=Ne(),L=Ge();a((function(){E({locateFile:i,imagesURLFormat:r,imagesURLMap:u,backgroundColor:c,mode:d,showTilesBorders:l,minimumZoomLevel:h,maximumZoomLevel:b,preserveDrawingBuffer:p,featureFlags:y,startArtboardUUID:C})}),[E,i,r,u,c,d,l,h,b,p,y,C]),a((function(){if(n)return R(n,F.current,P.current),function(){S()}}),[S,R,n]);var D=s((function(){return ut(ut({},Ue),{cursor:M})}),[M]);return t.createElement("div",ut({},g,{ref:P,style:D}),n&&t.createElement("canvas",ut({},v,{key:n,ref:F,"data-testid":"prototype-canvas","data-prototype-status":"prototype-status-".concat((null==L?void 0:L.type.toLowerCase())||"null"),style:Ze})),"READY"===(null==L?void 0:L.type)&&f)};export{Jt as CameraMoveContext,Xt as CameraZoomingContext,Ht as CanvasRenderer,re as CanvasRendererProvider,Se as CanvasRendererReact,te as CursorContext,Rt as DefaultFeatureFlags,Yt as DocumentContext,It as EventEmitter,rt as FileFormat,Gt as GestureManager,Nt as KeyboardManager,St as ListenersCollector,zt as Logger,Qt as PanContext,Ut as Performance,Re as PrototypeRenderer,Ae as PrototypeRendererProvider,Ve as PrototypeRendererReact,Kt as StatusContext,Pt as WebRendererError,Ft as WebRendererMode,$t as ZoomContext,xt as clamp,At as convertEmbindVectorToArray,Dt as debounce,Ot as extractPointer,Tt as getSupportedWebGLVersion,Et as getiOSVersion,Bt as isTouchDevice,jt as logger,Zt as nextTick,Lt as parseSafariUserAgent,oe as reducer,Wt as removeUndefinedKeys,kt as touchableClick,de as useCursor,fe as useDecrementZoom,ae as useDocument,Fe as useEvent,ve as useGenerateDocumentPNG,we as useGetArtboardAtPosititon,ye as useGetPanAtPosition,We as useGoBack,ke as useGoForwards,pe as useIncrementZoom,he as useIsCameraMoving,le as useIsCameraZooming,Ce as useLockCamera,me as useLooseWebGLContext,ce as usePan,Ne as usePrototypeCursor,je as usePrototypeEvent,ze as usePrototypePlayState,Ge as usePrototypeStatus,Be as useRestartPrototype,_e as useSetPan,be as useSetZoom,se as useStatus,ue as useZoom,ge as useZoomToFit};
|
|
1
|
+
import t,{createContext as e,useContext as n,useRef as o,useReducer as i,useCallback as r,useMemo as s,useEffect as a,useState as u}from"react";const c=new Int32Array(2);var d,l;new Float32Array(c.buffer),new Float64Array(c.buffer),new Uint16Array(new Uint8Array([1,0]).buffer)[0],function(t){t[t.UTF8_BYTES=1]="UTF8_BYTES",t[t.UTF16_STRING=2]="UTF16_STRING"}(d||(d={})),function(t){t[t.Default=0]="Default",t[t.None=1]="None",t[t.Low=2]="Low",t[t.Medium=3]="Medium",t[t.High=4]="High"}(l||(l={}));var h,b=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.x=function(){return this.bb.readFloat32(this.bb_pos)},t.prototype.y=function(){return this.bb.readFloat32(this.bb_pos+4)},t.sizeOf=function(){return 8},t.createPoint=function(t,e,n){return t.prep(4,8),t.writeFloat32(n),t.writeFloat32(e),t.offset()},t}(),p=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.width=function(){return this.bb.readFloat32(this.bb_pos)},t.prototype.height=function(){return this.bb.readFloat32(this.bb_pos+4)},t.sizeOf=function(){return 8},t.createSize=function(t,e,n){return t.prep(4,8),t.writeFloat32(n),t.writeFloat32(e),t.offset()},t}(),f=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.origin=function(t){return(t||new b).__init(this.bb_pos,this.bb)},t.prototype.size=function(t){return(t||new p).__init(this.bb_pos+8,this.bb)},t.sizeOf=function(){return 16},t.createRect=function(t,e,n,o,i){return t.prep(4,16),t.prep(4,8),t.writeFloat32(i),t.writeFloat32(o),t.prep(4,8),t.writeFloat32(n),t.writeFloat32(e),t.offset()},t}(),_=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsImageDrawing=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsImageDrawing=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.imageIndex=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0},t.prototype.rect=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.prototype.interpolationQuality=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt8(this.bb_pos+t):l.High},t.startImageDrawing=function(t){t.startObject(3)},t.addImageIndex=function(t,e){t.addFieldInt32(0,e,0)},t.addRect=function(t,e){t.addFieldStruct(1,e,0)},t.addInterpolationQuality=function(t,e){t.addFieldInt8(2,e,l.High)},t.endImageDrawing=function(t){return t.endObject()},t}(),g=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsShapeEllipse=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsShapeEllipse=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.rect=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.startShapeEllipse=function(t){t.startObject(1)},t.addRect=function(t,e){t.addFieldStruct(0,e,0)},t.endShapeEllipse=function(t){return t.endObject()},t.createShapeEllipse=function(e,n){return t.startShapeEllipse(e),t.addRect(e,n),t.endShapeEllipse(e)},t}();!function(t){t[t.Winding=0]="Winding",t[t.EvenOdd=1]="EvenOdd"}(h||(h={}));var m,v=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsPath=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsPath=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.points=function(t,e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new b).__init(this.bb.__vector(this.bb_pos+n)+8*t,this.bb):null},t.prototype.pointsLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.operations=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb.__vector(this.bb_pos+e)+t):0},t.prototype.operationsLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.operationsArray=function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Int8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.startPath=function(t){t.startObject(2)},t.addPoints=function(t,e){t.addFieldOffset(0,e,0)},t.startPointsVector=function(t,e){t.startVector(8,e,4)},t.addOperations=function(t,e){t.addFieldOffset(1,e,0)},t.createOperationsVector=function(t,e){t.startVector(1,e.length,1);for(var n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()},t.startOperationsVector=function(t,e){t.startVector(1,e,1)},t.endPath=function(t){var e=t.endObject();return t.requiredField(e,4),t.requiredField(e,6),e},t.createPath=function(e,n,o){return t.startPath(e),t.addPoints(e,n),t.addOperations(e,o),t.endPath(e)},t}(),w=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsShapePath=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsShapePath=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.path=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new v).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.fillRule=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):h.Winding},t.startShapePath=function(t){t.startObject(2)},t.addPath=function(t,e){t.addFieldOffset(0,e,0)},t.addFillRule=function(t,e){t.addFieldInt8(1,e,h.Winding)},t.endShapePath=function(t){var e=t.endObject();return t.requiredField(e,4),e},t.createShapePath=function(e,n,o){return t.startShapePath(e),t.addPath(e,n),t.addFillRule(e,o),t.endShapePath(e)},t}(),y=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsShapeRect=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsShapeRect=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.rect=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.startShapeRect=function(t){t.startObject(1)},t.addRect=function(t,e){t.addFieldStruct(0,e,0)},t.endShapeRect=function(t){return t.endObject()},t.createShapeRect=function(e,n){return t.startShapeRect(e),t.addRect(e,n),t.endShapeRect(e)},t}();!function(t){t[t.NONE=0]="NONE",t[t.ShapePath=1]="ShapePath",t[t.ShapeRect=2]="ShapeRect",t[t.ShapeEllipse=3]="ShapeEllipse"}(m||(m={}));var C,F=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsBackgroundFilterComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsBackgroundFilterComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.shapeType=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint8(this.bb_pos+t):m.NONE},t.prototype.shape=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__union(t,this.bb_pos+e):null},t.prototype.image=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?(t||new _).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.saturation=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readFloat32(this.bb_pos+t):1},t.startBackgroundFilterComponent=function(t){t.startObject(5)},t.addShapeType=function(t,e){t.addFieldInt8(0,e,m.NONE)},t.addShape=function(t,e){t.addFieldOffset(1,e,0)},t.addImage=function(t,e){t.addFieldOffset(2,e,0)},t.addRadius=function(t,e){t.addFieldFloat32(3,e,0)},t.addSaturation=function(t,e){t.addFieldFloat32(4,e,1)},t.endBackgroundFilterComponent=function(t){return t.endObject()},t}();!function(t){t[t.Normal=0]="Normal",t[t.DestAtop=1]="DestAtop",t[t.Clear=2]="Clear",t[t.Source=3]="Source",t[t.Darken=4]="Darken",t[t.Multiply=5]="Multiply",t[t.ColorBurn=6]="ColorBurn",t[t.Lighten=7]="Lighten",t[t.Screen=8]="Screen",t[t.ColorDodge=9]="ColorDodge",t[t.Overlay=10]="Overlay",t[t.SoftLight=11]="SoftLight",t[t.HardLight=12]="HardLight",t[t.Difference=13]="Difference",t[t.Exclusion=14]="Exclusion",t[t.Hue=15]="Hue",t[t.Saturation=16]="Saturation",t[t.Color=17]="Color",t[t.Luminosity=18]="Luminosity",t[t.PlusDarker=19]="PlusDarker",t[t.PlusLighter=20]="PlusLighter"}(C||(C={}));var P,I,S,R,E=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsBlendComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsBlendComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.mode=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):C.Normal},t.prototype.opacity=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat32(this.bb_pos+t):1},t.startBlendComponent=function(t){t.startObject(2)},t.addMode=function(t,e){t.addFieldInt8(0,e,C.Normal)},t.addOpacity=function(t,e){t.addFieldFloat32(1,e,1)},t.endBlendComponent=function(t){return t.endObject()},t.createBlendComponent=function(e,n,o){return t.startBlendComponent(e),t.addMode(e,n),t.addOpacity(e,o),t.endBlendComponent(e)},t}(),M=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsCachedExtentComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsCachedExtentComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.rect=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.startCachedExtentComponent=function(t){t.startObject(1)},t.addRect=function(t,e){t.addFieldStruct(0,e,0)},t.endCachedExtentComponent=function(t){return t.endObject()},t.createCachedExtentComponent=function(e,n){return t.startCachedExtentComponent(e),t.addRect(e,n),t.endCachedExtentComponent(e)},t}(),L=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.r=function(){return this.bb.readFloat32(this.bb_pos)},t.prototype.g=function(){return this.bb.readFloat32(this.bb_pos+4)},t.prototype.b=function(){return this.bb.readFloat32(this.bb_pos+8)},t.prototype.a=function(){return this.bb.readFloat32(this.bb_pos+12)},t.sizeOf=function(){return 16},t.createRGBAColor=function(t,e,n,o,i){return t.prep(4,16),t.writeFloat32(i),t.writeFloat32(o),t.writeFloat32(n),t.writeFloat32(e),t.offset()},t}(),D=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentAngularGradient=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentAngularGradient=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.center=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new b).__init(this.bb_pos+e,this.bb):null},t.prototype.angle=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.locations=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},t.prototype.locationsLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.locationsArray=function(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.colors=function(t,e){var n=this.bb.__offset(this.bb_pos,10);return n?(e||new L).__init(this.bb.__vector(this.bb_pos+n)+16*t,this.bb):null},t.prototype.colorsLength=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0},t.startDrawingContentAngularGradient=function(t){t.startObject(4)},t.addCenter=function(t,e){t.addFieldStruct(0,e,0)},t.addAngle=function(t,e){t.addFieldFloat32(1,e,0)},t.addLocations=function(t,e){t.addFieldOffset(2,e,0)},t.createLocationsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()},t.startLocationsVector=function(t,e){t.startVector(4,e,4)},t.addColors=function(t,e){t.addFieldOffset(3,e,0)},t.startColorsVector=function(t,e){t.startVector(16,e,4)},t.endDrawingContentAngularGradient=function(t){var e=t.endObject();return t.requiredField(e,8),t.requiredField(e,10),e},t.createDrawingContentAngularGradient=function(e,n,o,i,r){return t.startDrawingContentAngularGradient(e),t.addCenter(e,n),t.addAngle(e,o),t.addLocations(e,i),t.addColors(e,r),t.endDrawingContentAngularGradient(e)},t}(),O=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentColor=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentColor=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.color=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new L).__init(this.bb_pos+e,this.bb):null},t.startDrawingContentColor=function(t){t.startObject(1)},t.addColor=function(t,e){t.addFieldStruct(0,e,0)},t.endDrawingContentColor=function(t){return t.endObject()},t.createDrawingContentColor=function(e,n){return t.startDrawingContentColor(e),t.addColor(e,n),t.endDrawingContentColor(e)},t}(),x=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentImage=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentImage=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.image=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new _).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.tile=function(){var t=this.bb.__offset(this.bb_pos,6);return!!t&&!!this.bb.readInt8(this.bb_pos+t)},t.startDrawingContentImage=function(t){t.startObject(2)},t.addImage=function(t,e){t.addFieldOffset(0,e,0)},t.addTile=function(t,e){t.addFieldInt8(1,+e,0)},t.endDrawingContentImage=function(t){var e=t.endObject();return t.requiredField(e,4),e},t.createDrawingContentImage=function(e,n,o){return t.startDrawingContentImage(e),t.addImage(e,n),t.addTile(e,o),t.endDrawingContentImage(e)},t}(),T=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentLinearGradient=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentLinearGradient=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.start=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new b).__init(this.bb_pos+e,this.bb):null},t.prototype.end=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?(t||new b).__init(this.bb_pos+e,this.bb):null},t.prototype.locations=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},t.prototype.locationsLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.locationsArray=function(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.colors=function(t,e){var n=this.bb.__offset(this.bb_pos,10);return n?(e||new L).__init(this.bb.__vector(this.bb_pos+n)+16*t,this.bb):null},t.prototype.colorsLength=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0},t.startDrawingContentLinearGradient=function(t){t.startObject(4)},t.addStart=function(t,e){t.addFieldStruct(0,e,0)},t.addEnd=function(t,e){t.addFieldStruct(1,e,0)},t.addLocations=function(t,e){t.addFieldOffset(2,e,0)},t.createLocationsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()},t.startLocationsVector=function(t,e){t.startVector(4,e,4)},t.addColors=function(t,e){t.addFieldOffset(3,e,0)},t.startColorsVector=function(t,e){t.startVector(16,e,4)},t.endDrawingContentLinearGradient=function(t){var e=t.endObject();return t.requiredField(e,8),t.requiredField(e,10),e},t}(),A=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.a=function(){return this.bb.readFloat32(this.bb_pos)},t.prototype.b=function(){return this.bb.readFloat32(this.bb_pos+4)},t.prototype.c=function(){return this.bb.readFloat32(this.bb_pos+8)},t.prototype.d=function(){return this.bb.readFloat32(this.bb_pos+12)},t.prototype.tx=function(){return this.bb.readFloat32(this.bb_pos+16)},t.prototype.ty=function(){return this.bb.readFloat32(this.bb_pos+20)},t.sizeOf=function(){return 24},t.createMatrix=function(t,e,n,o,i,r,s){return t.prep(4,24),t.writeFloat32(s),t.writeFloat32(r),t.writeFloat32(i),t.writeFloat32(o),t.writeFloat32(n),t.writeFloat32(e),t.offset()},t}(),B=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentRadialGradient=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentRadialGradient=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.center=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new b).__init(this.bb_pos+e,this.bb):null},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.locations=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},t.prototype.locationsLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.locationsArray=function(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.colors=function(t,e){var n=this.bb.__offset(this.bb_pos,10);return n?(e||new L).__init(this.bb.__vector(this.bb_pos+n)+16*t,this.bb):null},t.prototype.colorsLength=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.ellipseTransform=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?(t||new A).__init(this.bb_pos+e,this.bb):null},t.startDrawingContentRadialGradient=function(t){t.startObject(5)},t.addCenter=function(t,e){t.addFieldStruct(0,e,0)},t.addRadius=function(t,e){t.addFieldFloat32(1,e,0)},t.addLocations=function(t,e){t.addFieldOffset(2,e,0)},t.createLocationsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()},t.startLocationsVector=function(t,e){t.startVector(4,e,4)},t.addColors=function(t,e){t.addFieldOffset(3,e,0)},t.startColorsVector=function(t,e){t.startVector(16,e,4)},t.addEllipseTransform=function(t,e){t.addFieldStruct(4,e,0)},t.endDrawingContentRadialGradient=function(t){var e=t.endObject();return t.requiredField(e,8),t.requiredField(e,10),e},t}(),W=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingContentText=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingContentText=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.startDrawingContentText=function(t){t.startObject(0)},t.endDrawingContentText=function(t){return t.endObject()},t.createDrawingContentText=function(e){return t.startDrawingContentText(e),t.endDrawingContentText(e)},t}();!function(t){t[t.NONE=0]="NONE",t[t.DrawingContentColor=1]="DrawingContentColor",t[t.DrawingContentLinearGradient=2]="DrawingContentLinearGradient",t[t.DrawingContentAngularGradient=3]="DrawingContentAngularGradient",t[t.DrawingContentRadialGradient=4]="DrawingContentRadialGradient",t[t.DrawingContentImage=5]="DrawingContentImage",t[t.DrawingContentText=6]="DrawingContentText"}(P||(P={})),function(t){t[t.Fill=0]="Fill",t[t.Stroke=1]="Stroke",t[t.Knockout=2]="Knockout"}(I||(I={})),function(t){t[t.Butt=0]="Butt",t[t.Round=1]="Round",t[t.Square=2]="Square"}(S||(S={})),function(t){t[t.Miter=0]="Miter",t[t.Round=1]="Round",t[t.Bevel=2]="Bevel"}(R||(R={}));var k,G=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsStroke=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsStroke=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.lineWidth=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.lineCap=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt8(this.bb_pos+t):S.Butt},t.prototype.lineJoin=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt8(this.bb_pos+t):R.Miter},t.prototype.lineDashPhase=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.lineDashPattern=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},t.prototype.lineDashPatternLength=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.lineDashPatternArray=function(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.miterLimit=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readFloat32(this.bb_pos+t):10},t.startStroke=function(t){t.startObject(6)},t.addLineWidth=function(t,e){t.addFieldFloat32(0,e,0)},t.addLineCap=function(t,e){t.addFieldInt8(1,e,S.Butt)},t.addLineJoin=function(t,e){t.addFieldInt8(2,e,R.Miter)},t.addLineDashPhase=function(t,e){t.addFieldFloat32(3,e,0)},t.addLineDashPattern=function(t,e){t.addFieldOffset(4,e,0)},t.createLineDashPatternVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()},t.startLineDashPatternVector=function(t,e){t.startVector(4,e,4)},t.addMiterLimit=function(t,e){t.addFieldFloat32(5,e,10)},t.endStroke=function(t){var e=t.endObject();return t.requiredField(e,12),e},t.createStroke=function(e,n,o,i,r,s,a){return t.startStroke(e),t.addLineWidth(e,n),t.addLineCap(e,o),t.addLineJoin(e,i),t.addLineDashPhase(e,r),t.addLineDashPattern(e,s),t.addMiterLimit(e,a),t.endStroke(e)},t}(),z=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingMask=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingMask=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.mode=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):I.Fill},t.prototype.shapeType=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):m.NONE},t.prototype.shape=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null},t.prototype.stroke=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?(t||new G).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.strokedPath=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?(t||new v).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.knockoutRect=function(t){var e=this.bb.__offset(this.bb_pos,14);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.startDrawingMask=function(t){t.startObject(6)},t.addMode=function(t,e){t.addFieldInt8(0,e,I.Fill)},t.addShapeType=function(t,e){t.addFieldInt8(1,e,m.NONE)},t.addShape=function(t,e){t.addFieldOffset(2,e,0)},t.addStroke=function(t,e){t.addFieldOffset(3,e,0)},t.addStrokedPath=function(t,e){t.addFieldOffset(4,e,0)},t.addKnockoutRect=function(t,e){t.addFieldStruct(5,e,0)},t.endDrawingMask=function(t){return t.endObject()},t}(),N=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsDrawingComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsDrawingComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.contentType=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint8(this.bb_pos+t):P.NONE},t.prototype.content=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__union(t,this.bb_pos+e):null},t.prototype.mask=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?(t||new z).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.startDrawingComponent=function(t){t.startObject(3)},t.addContentType=function(t,e){t.addFieldInt8(0,e,P.NONE)},t.addContent=function(t,e){t.addFieldOffset(1,e,0)},t.addMask=function(t,e){t.addFieldOffset(2,e,0)},t.endDrawingComponent=function(t){var e=t.endObject();return t.requiredField(e,6),e},t}(),j=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsLayerInfoComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsLayerInfoComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.bounds=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.prototype.objectId=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},t.prototype.traits=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint32(this.bb_pos+t):0},t.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null},t.startLayerInfoComponent=function(t){t.startObject(4)},t.addBounds=function(t,e){t.addFieldStruct(0,e,0)},t.addObjectId=function(t,e){t.addFieldOffset(1,e,0)},t.addTraits=function(t,e){t.addFieldInt32(2,e,0)},t.addName=function(t,e){t.addFieldOffset(3,e,0)},t.endLayerInfoComponent=function(t){var e=t.endObject();return t.requiredField(e,6),t.requiredField(e,10),e},t.createLayerInfoComponent=function(e,n,o,i,r){return t.startLayerInfoComponent(e),t.addBounds(e,n),t.addObjectId(e,o),t.addTraits(e,i),t.addName(e,r),t.endLayerInfoComponent(e)},t}();!function(t){t[t.Node=0]="Node",t[t.Clip=1]="Clip",t[t.Knockout=2]="Knockout"}(k||(k={}));var U,Z=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFragment=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFragment=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.objectId=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},t.startFragment=function(t){t.startObject(1)},t.addObjectId=function(t,e){t.addFieldOffset(0,e,0)},t.endFragment=function(t){return t.endObject()},t.createFragment=function(e,n){return t.startFragment(e),t.addObjectId(e,n),t.endFragment(e)},t}(),V=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFilterColorControls=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFilterColorControls=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.saturation=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):1},t.prototype.brightness=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.contrast=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.hue=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0},t.startFilterColorControls=function(t){t.startObject(4)},t.addSaturation=function(t,e){t.addFieldFloat32(0,e,1)},t.addBrightness=function(t,e){t.addFieldFloat32(1,e,0)},t.addContrast=function(t,e){t.addFieldFloat32(2,e,0)},t.addHue=function(t,e){t.addFieldFloat32(3,e,0)},t.endFilterColorControls=function(t){return t.endObject()},t.createFilterColorControls=function(e,n,o,i,r){return t.startFilterColorControls(e),t.addSaturation(e,n),t.addBrightness(e,o),t.addContrast(e,i),t.addHue(e,r),t.endFilterColorControls(e)},t}(),q=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFilterGaussianBlur=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFilterGaussianBlur=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):0},t.startFilterGaussianBlur=function(t){t.startObject(1)},t.addRadius=function(t,e){t.addFieldFloat32(0,e,0)},t.endFilterGaussianBlur=function(t){return t.endObject()},t.createFilterGaussianBlur=function(e,n){return t.startFilterGaussianBlur(e),t.addRadius(e,n),t.endFilterGaussianBlur(e)},t}(),H=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFilterMotionBlur=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFilterMotionBlur=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.angle=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat32(this.bb_pos+t):0},t.startFilterMotionBlur=function(t){t.startObject(2)},t.addRadius=function(t,e){t.addFieldFloat32(0,e,0)},t.addAngle=function(t,e){t.addFieldFloat32(1,e,0)},t.endFilterMotionBlur=function(t){return t.endObject()},t.createFilterMotionBlur=function(e,n,o){return t.startFilterMotionBlur(e),t.addRadius(e,n),t.addAngle(e,o),t.endFilterMotionBlur(e)},t}(),K=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsShadow=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsShadow=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.offset=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?(t||new p).__init(this.bb_pos+e,this.bb):null},t.prototype.spread=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.color=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?(t||new L).__init(this.bb_pos+e,this.bb):null},t.startShadow=function(t){t.startObject(4)},t.addRadius=function(t,e){t.addFieldFloat32(0,e,0)},t.addOffset=function(t,e){t.addFieldStruct(1,e,0)},t.addSpread=function(t,e){t.addFieldFloat32(2,e,0)},t.addColor=function(t,e){t.addFieldStruct(3,e,0)},t.endShadow=function(t){return t.endObject()},t}(),Y=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFilterShadow=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFilterShadow=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.shadow=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new K).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.startFilterShadow=function(t){t.startObject(1)},t.addShadow=function(t,e){t.addFieldOffset(0,e,0)},t.endFilterShadow=function(t){var e=t.endObject();return t.requiredField(e,4),e},t.createFilterShadow=function(e,n){return t.startFilterShadow(e),t.addShadow(e,n),t.endFilterShadow(e)},t}(),$=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsFilterZoomBlur=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsFilterZoomBlur=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.radius=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readFloat32(this.bb_pos+t):0},t.prototype.center=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?(t||new b).__init(this.bb_pos+e,this.bb):null},t.startFilterZoomBlur=function(t){t.startObject(2)},t.addRadius=function(t,e){t.addFieldFloat32(0,e,0)},t.addCenter=function(t,e){t.addFieldStruct(1,e,0)},t.endFilterZoomBlur=function(t){return t.endObject()},t}();!function(t){t[t.NONE=0]="NONE",t[t.FilterColorControls=1]="FilterColorControls",t[t.FilterGaussianBlur=2]="FilterGaussianBlur",t[t.FilterMotionBlur=3]="FilterMotionBlur",t[t.FilterZoomBlur=4]="FilterZoomBlur",t[t.FilterShadow=5]="FilterShadow"}(U||(U={}));var X,J=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsSurfaceComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsSurfaceComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.shouldBlendSourceOver=function(){var t=this.bb.__offset(this.bb_pos,4);return!!t&&!!this.bb.readInt8(this.bb_pos+t)},t.prototype.filterType=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):U.NONE},t.prototype.filter=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null},t.startSurfaceComponent=function(t){t.startObject(3)},t.addShouldBlendSourceOver=function(t,e){t.addFieldInt8(0,+e,0)},t.addFilterType=function(t,e){t.addFieldInt8(1,e,U.NONE)},t.addFilter=function(t,e){t.addFieldOffset(2,e,0)},t.endSurfaceComponent=function(t){return t.endObject()},t.createSurfaceComponent=function(e,n,o,i){return t.startSurfaceComponent(e),t.addShouldBlendSourceOver(e,n),t.addFilterType(e,o),t.addFilter(e,i),t.endSurfaceComponent(e)},t}(),Q=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsTransformComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsTransformComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.matrix=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new A).__init(this.bb_pos+e,this.bb):null},t.startTransformComponent=function(t){t.startObject(1)},t.addMatrix=function(t,e){t.addFieldStruct(0,e,0)},t.endTransformComponent=function(t){return t.endObject()},t.createTransformComponent=function(e,n){return t.startTransformComponent(e),t.addMatrix(e,n),t.endTransformComponent(e)},t}(),tt=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsNode=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsNode=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.children=function(e,n){var o=this.bb.__offset(this.bb_pos,4);return o?(n||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+o)+4*e),this.bb):null},t.prototype.childrenLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.enabled=function(){var t=this.bb.__offset(this.bb_pos,6);return!t||!!this.bb.readInt8(this.bb_pos+t)},t.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null},t.prototype.componentsType=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},t.prototype.componentsTypeLength=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.componentsTypeArray=function(){var t=this.bb.__offset(this.bb_pos,10);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.components=function(t,e){var n=this.bb.__offset(this.bb_pos,12);return n?this.bb.__union(e,this.bb.__vector(this.bb_pos+n)+4*t):null},t.prototype.componentsLength=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.drawing=function(t){var e=this.bb.__offset(this.bb_pos,14);return e?(t||new N).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.layerInfo=function(t){var e=this.bb.__offset(this.bb_pos,16);return e?(t||new j).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.transform=function(t){var e=this.bb.__offset(this.bb_pos,18);return e?(t||new Q).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.mask=function(t){var e=this.bb.__offset(this.bb_pos,20);return e?(t||new et).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.blend=function(t){var e=this.bb.__offset(this.bb_pos,22);return e?(t||new E).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.surface=function(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new J).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.backgroundFilter=function(t){var e=this.bb.__offset(this.bb_pos,26);return e?(t||new F).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.cachedExtent=function(t){var e=this.bb.__offset(this.bb_pos,28);return e?(t||new M).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.fragment=function(t){var e=this.bb.__offset(this.bb_pos,30);return e?(t||new Z).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.startNode=function(t){t.startObject(14)},t.addChildren=function(t,e){t.addFieldOffset(0,e,0)},t.createChildrenVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},t.startChildrenVector=function(t,e){t.startVector(4,e,4)},t.addEnabled=function(t,e){t.addFieldInt8(1,+e,1)},t.addName=function(t,e){t.addFieldOffset(2,e,0)},t.addComponentsType=function(t,e){t.addFieldOffset(3,e,0)},t.createComponentsTypeVector=function(t,e){t.startVector(1,e.length,1);for(var n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()},t.startComponentsTypeVector=function(t,e){t.startVector(1,e,1)},t.addComponents=function(t,e){t.addFieldOffset(4,e,0)},t.createComponentsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},t.startComponentsVector=function(t,e){t.startVector(4,e,4)},t.addDrawing=function(t,e){t.addFieldOffset(5,e,0)},t.addLayerInfo=function(t,e){t.addFieldOffset(6,e,0)},t.addTransform=function(t,e){t.addFieldOffset(7,e,0)},t.addMask=function(t,e){t.addFieldOffset(8,e,0)},t.addBlend=function(t,e){t.addFieldOffset(9,e,0)},t.addSurface=function(t,e){t.addFieldOffset(10,e,0)},t.addBackgroundFilter=function(t,e){t.addFieldOffset(11,e,0)},t.addCachedExtent=function(t,e){t.addFieldOffset(12,e,0)},t.addFragment=function(t,e){t.addFieldOffset(13,e,0)},t.endNode=function(t){var e=t.endObject();return t.requiredField(e,4),e},t}(),et=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsMaskComponent=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsMaskComponent=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.mode=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):k.Node},t.prototype.clipShapeType=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):m.NONE},t.prototype.clipShape=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null},t.prototype.node=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?(t||new tt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.prototype.knockoutRect=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?(t||new f).__init(this.bb_pos+e,this.bb):null},t.startMaskComponent=function(t){t.startObject(5)},t.addMode=function(t,e){t.addFieldInt8(0,e,k.Node)},t.addClipShapeType=function(t,e){t.addFieldInt8(1,e,m.NONE)},t.addClipShape=function(t,e){t.addFieldOffset(2,e,0)},t.addNode=function(t,e){t.addFieldOffset(3,e,0)},t.addKnockoutRect=function(t,e){t.addFieldStruct(4,e,0)},t.endMaskComponent=function(t){return t.endObject()},t}();!function(t){t[t.NONE=0]="NONE",t[t.TransformComponent=1]="TransformComponent",t[t.BlendComponent=2]="BlendComponent",t[t.MaskComponent=3]="MaskComponent",t[t.DrawingComponent=4]="DrawingComponent",t[t.CachedExtentComponent=5]="CachedExtentComponent",t[t.LayerInfoComponent=6]="LayerInfoComponent",t[t.SurfaceComponent=7]="SurfaceComponent",t[t.BackgroundFilterComponent=8]="BackgroundFilterComponent"}(X||(X={}));var nt,ot=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsImage=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsImage=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.uuid=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},t.prototype.width=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint32(this.bb_pos+t):0},t.prototype.height=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint32(this.bb_pos+t):0},t.prototype.format=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null},t.startImage=function(t){t.startObject(4)},t.addUuid=function(t,e){t.addFieldOffset(0,e,0)},t.addWidth=function(t,e){t.addFieldInt32(1,e,0)},t.addHeight=function(t,e){t.addFieldInt32(2,e,0)},t.addFormat=function(t,e){t.addFieldOffset(3,e,0)},t.endImage=function(t){var e=t.endObject();return t.requiredField(e,10),e},t.createImage=function(e,n,o,i,r){return t.startImage(e),t.addUuid(e,n),t.addWidth(e,o),t.addHeight(e,i),t.addFormat(e,r),t.endImage(e)},t}();!function(t){t[t.MoveTo=0]="MoveTo",t[t.LineTo=1]="LineTo",t[t.QuadTo=2]="QuadTo",t[t.CubicTo=3]="CubicTo",t[t.Close=4]="Close"}(nt||(nt={}));var it=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsPresentation=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsPresentation=function(e,n){return e.setPosition(e.position()+4),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.bufferHasIdentifier=function(t){return t.__has_identifier("PRMR")},t.prototype.images=function(t,e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new ot).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null},t.prototype.imagesLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.root=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?(t||new tt).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null},t.startPresentation=function(t){t.startObject(3)},t.addImages=function(t,e){t.addFieldOffset(0,e,0)},t.createImagesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},t.startImagesVector=function(t,e){t.startVector(4,e,4)},t.addRoot=function(t,e){t.addFieldOffset(1,e,0)},t.endPresentation=function(t){var e=t.endObject();return t.requiredField(e,4),t.requiredField(e,6),e},t.finishPresentationBuffer=function(t,e){t.finish(e,"PRMR")},t.finishSizePrefixedPresentationBuffer=function(t,e){t.finish(e,"PRMR",!0)},t}(),rt=Object.freeze({__proto__:null,BackgroundFilterComponent:F,BlendComponent:E,get BlendMode(){return C},CachedExtentComponent:M,get Component(){return X},unionToComponent:function(t,e){switch(X[t]){case"NONE":default:return null;case"TransformComponent":return e(new Q);case"BlendComponent":return e(new E);case"MaskComponent":return e(new et);case"DrawingComponent":return e(new N);case"CachedExtentComponent":return e(new M);case"LayerInfoComponent":return e(new j);case"SurfaceComponent":return e(new J);case"BackgroundFilterComponent":return e(new F)}},unionListToComponent:function(t,e,n){switch(X[t]){case"NONE":default:return null;case"TransformComponent":return e(n,new Q);case"BlendComponent":return e(n,new E);case"MaskComponent":return e(n,new et);case"DrawingComponent":return e(n,new N);case"CachedExtentComponent":return e(n,new M);case"LayerInfoComponent":return e(n,new j);case"SurfaceComponent":return e(n,new J);case"BackgroundFilterComponent":return e(n,new F)}},DrawingComponent:N,get DrawingContent(){return P},unionToDrawingContent:function(t,e){switch(P[t]){case"NONE":default:return null;case"DrawingContentColor":return e(new O);case"DrawingContentLinearGradient":return e(new T);case"DrawingContentAngularGradient":return e(new D);case"DrawingContentRadialGradient":return e(new B);case"DrawingContentImage":return e(new x);case"DrawingContentText":return e(new W)}},unionListToDrawingContent:function(t,e,n){switch(P[t]){case"NONE":default:return null;case"DrawingContentColor":return e(n,new O);case"DrawingContentLinearGradient":return e(n,new T);case"DrawingContentAngularGradient":return e(n,new D);case"DrawingContentRadialGradient":return e(n,new B);case"DrawingContentImage":return e(n,new x);case"DrawingContentText":return e(n,new W)}},DrawingContentAngularGradient:D,DrawingContentColor:O,DrawingContentImage:x,DrawingContentLinearGradient:T,DrawingContentRadialGradient:B,DrawingContentText:W,DrawingMask:z,get DrawingMaskMode(){return I},get FillRule(){return h},get Filter(){return U},unionToFilter:function(t,e){switch(U[t]){case"NONE":default:return null;case"FilterColorControls":return e(new V);case"FilterGaussianBlur":return e(new q);case"FilterMotionBlur":return e(new H);case"FilterZoomBlur":return e(new $);case"FilterShadow":return e(new Y)}},unionListToFilter:function(t,e,n){switch(U[t]){case"NONE":default:return null;case"FilterColorControls":return e(n,new V);case"FilterGaussianBlur":return e(n,new q);case"FilterMotionBlur":return e(n,new H);case"FilterZoomBlur":return e(n,new $);case"FilterShadow":return e(n,new Y)}},FilterColorControls:V,FilterGaussianBlur:q,FilterMotionBlur:H,FilterShadow:Y,FilterZoomBlur:$,Fragment:Z,Image:ot,ImageDrawing:_,get InterpolationQuality(){return l},LayerInfoComponent:j,get LineCap(){return S},get LineJoin(){return R},MaskComponent:et,get MaskComponentMode(){return k},Matrix:A,Node:tt,Path:v,get PathOperation(){return nt},Point:b,Presentation:it,RGBAColor:L,Rect:f,Shadow:K,get Shape(){return m},unionToShape:function(t,e){switch(m[t]){case"NONE":default:return null;case"ShapePath":return e(new w);case"ShapeRect":return e(new y);case"ShapeEllipse":return e(new g)}},unionListToShape:function(t,e,n){switch(m[t]){case"NONE":default:return null;case"ShapePath":return e(n,new w);case"ShapeRect":return e(n,new y);case"ShapeEllipse":return e(n,new g)}},ShapeEllipse:g,ShapePath:w,ShapeRect:y,Size:p,Stroke:G,SurfaceComponent:J,TransformComponent:Q}),st=function(t,e){return st=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},st(t,e)};function at(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}st(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var ut=function(){return ut=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ut.apply(this,arguments)};function ct(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{u(o.next(t))}catch(t){r(t)}}function a(t){try{u(o.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((o=o.apply(t,e||[])).next())}))}function dt(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,a[0]&&(s=0)),s;)try{if(n=1,o&&(i=2&a[0]?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],o=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function lt(t,e,n){if(n||2===arguments.length)for(var o,i=0,r=e.length;i<r;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}function ht(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{u(o.next(t))}catch(t){r(t)}}function a(t){try{u(o.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((o=o.apply(t,e||[])).next())}))}const bt=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function pt(t){return t.toLowerCase().replace(/^angle ?\((.+)\)*$/,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"").replace(/(?:vulkan|opengl) \d+\.\d+(?:\.\d+)?(?: \((.*)\))?/,"$1")}const ft="undefined"==typeof window,_t=(()=>{if(ft)return;const{userAgent:t,platform:e,maxTouchPoints:n}=window.navigator,o=/(iphone|ipod|ipad)/i.test(t),i="iPad"===e||"MacIntel"===e&&n>0&&!window.MSStream;return{isIpad:i,isMobile:/android/i.test(t)||o||i,isSafari12:/Version\/12.+Safari/.test(t)}})();const gt=[],mt=[];function vt(t,e){if(t===e)return 0;const n=t;t.length>e.length&&(t=e,e=n);let o=t.length,i=e.length;for(;o>0&&t.charCodeAt(~-o)===e.charCodeAt(~-i);)o--,i--;let r,s=0;for(;s<o&&t.charCodeAt(s)===e.charCodeAt(s);)s++;if(o-=s,i-=s,0===o)return i;let a,u,c=0,d=0,l=0;for(;d<o;)mt[d]=t.charCodeAt(s+d),gt[d]=++d;for(;l<i;)for(r=e.charCodeAt(s+l),a=l++,c=l,d=0;d<o;d++)u=r===mt[d]?a:a+1,a=gt[d],c=gt[d]=a>c?u>c?c+1:u:u>a?a+1:u;return c}function wt(t){return null!=t}class yt extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}const Ct=({mobileTiers:t=[0,15,30,60],desktopTiers:e=[0,15,30,60],override:n={},glContext:o,failIfMajorPerformanceCaveat:i=!1,benchmarksURL:r="https://unpkg.com/detect-gpu@4.0.47/dist/benchmarks"}={})=>ht(void 0,void 0,void 0,(function*(){const s={};if(ft)return{tier:0,type:"SSR"};const{isIpad:a=!!(null==_t?void 0:_t.isIpad),isMobile:u=!!(null==_t?void 0:_t.isMobile),screenSize:c=window.screen,loadBenchmarks:d=(t=>ht(void 0,void 0,void 0,(function*(){const e=yield fetch(`${r}/${t}`).then((t=>t.json()));if(parseInt(e.shift().split(".")[0],10)<4)throw new yt("Detect GPU benchmark data is out of date. Please update to version 4x");return e})))}=n;let{renderer:l}=n;const h=(t,e,n,o,i)=>({device:i,fps:o,gpu:n,isMobile:u,tier:t,type:e});let b,p="";if(l)l=pt(l),b=[l];else{const t=o||function(t,e=!1){const n={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:e,powerPreference:"high-performance",stencil:!1};t&&delete n.powerPreference;const o=window.document.createElement("canvas"),i=o.getContext("webgl",n)||o.getContext("experimental-webgl",n);return null!=i?i:void 0}(null==_t?void 0:_t.isSafari12,i);if(!t)return h(0,"WEBGL_UNSUPPORTED");const e=t.getExtension("WEBGL_debug_renderer_info");if(e&&(l=t.getParameter(e.UNMASKED_RENDERER_WEBGL)),!l)return h(1,"FALLBACK");p=l,l=pt(l),b=function(t,e,n){return"apple gpu"===e?function(t,e,n){if(!n)return[e];const o=function(t){const e=t.createShader(35633),n=t.createShader(35632),o=t.createProgram();if(!(n&&e&&o))return;t.shaderSource(e,"\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n "),t.shaderSource(n,"\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n "),t.compileShader(e),t.compileShader(n),t.attachShader(o,e),t.attachShader(o,n),t.linkProgram(o),t.detachShader(o,e),t.detachShader(o,n),t.deleteShader(e),t.deleteShader(n),t.useProgram(o);const i=t.createBuffer();t.bindBuffer(34962,i),t.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const r=t.getAttribLocation(o,"aPosition");t.vertexAttribPointer(r,3,5126,!1,0,0),t.enableVertexAttribArray(r),t.clearColor(1,1,1,1),t.clear(16384),t.viewport(0,0,1,1),t.drawArrays(4,0,3);const s=new Uint8Array(4);return t.readPixels(0,0,1,1,6408,5121,s),t.deleteProgram(o),t.deleteBuffer(i),s.join("")}(t),i="801621810",r="8016218135",s="80162181161",a=(null==_t?void 0:_t.isIpad)?[["a7",s,12],["a8",r,15],["a8x",r,15],["a9",r,15],["a9x",r,15],["a10",r,15],["a10x",r,15],["a12",i,15],["a12x",i,15],["a12z",i,15],["a14",i,15],["m1",i,15]]:[["a7",s,12],["a8",r,12],["a9",r,15],["a10",r,15],["a11",i,15],["a12",i,15],["a13",i,15],["a14",i,15]];let u;return"80162181255"===o?u=a.filter((([,,t])=>t>=14)):(u=a.filter((([,t])=>t===o)),u.length||(u=a)),u.map((([t])=>`apple ${t} gpu`))}(t,e,n):[e]}(t,l,u)}const f=(yield Promise.all(b.map((function(t){var e;return ht(this,void 0,void 0,(function*(){const n=(t=>{const e=u?["adreno","apple","mali-t","mali","nvidia","powervr"]:["intel","apple","amd","radeon","nvidia","geforce"];for(const n of e)if(t.includes(n))return n})(t);if(!n)return;const o=`${u?"m":"d"}-${n}${a?"-ipad":""}.json`,i=s[o]=null!==(e=s[o])&&void 0!==e?e:d(o);let r;try{r=yield i}catch(n){if(n instanceof yt)throw n;return}const l=function(t){var e;const n=(t=t.replace(/\([^)]+\)/,"")).match(/\d+/)||t.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(e=null==n?void 0:n.join("").replace(/\W|amd/g,""))&&void 0!==e?e:""}(t);let h=r.filter((([,t])=>t===l));h.length||(h=r.filter((([e])=>e.includes(t))));const b=h.length;if(0===b)return;let p,[f,,,_]=b>1?h.map((e=>[e,vt(t,e[0])])).sort((([,t],[,e])=>t-e))[0][0]:h[0],g=Number.MAX_VALUE;const{devicePixelRatio:m}=window,v=c.width*m*c.height*m;for(const t of _){const[e,n]=t,o=e*n,i=Math.abs(v-o);i<g&&(g=i,p=t)}if(!p)return;const[,,w,y]=p;return[g,w,f,y]}))})))).filter(wt).sort((([t=Number.MAX_VALUE,e],[n=Number.MAX_VALUE,o])=>t===n?e-o:t-n));if(!f.length){const t=bt.find((t=>l.includes(t)));return t?h(0,"BLOCKLISTED",t):h(1,"FALLBACK",`${l} (${p})`)}const[,_,g,m]=f[0];if(-1===_)return h(0,"BLOCKLISTED",g,_,m);const v=u?t:e;let w=0;for(let t=0;t<v.length;t++)_>=v[t]&&(w=t);return h(w,"BENCHMARK",g,_,m)}));var Ft,Pt=function(t){function e(n,o,i){var r=this.constructor,s=t.call(this,"(".concat(n,") ").concat(o))||this;return s.code=n,s.cause=i,s.name=e.name,Object.setPrototypeOf(s,r.prototype),s}return at(e,t),e}(Error);!function(t){t.debug="debug",t.release="release"}(Ft||(Ft={}));var It=function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){var n,o;this.listeners[t]=null!==(n=this.listeners[t])&&void 0!==n?n:new Set,null===(o=this.listeners[t])||void 0===o||o.add(e)},t.prototype.off=function(t,e){var n;null===(n=this.listeners[t])||void 0===n||n.delete(e)},t.prototype.forwardEvent=function(t,e){this.on(e,(function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];t.emit.apply(t,lt([e],n,!1))}))},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this.listeners[t];(null==o?void 0:o.size)&&o.forEach((function(t){Promise.resolve().then((function(){t.apply(void 0,e)}))}))},t.prototype.detachAllListeners=function(){this.listeners={}},t}(),St=function(){function t(){this.removeListenerCallbacks=[]}return t.prototype.add=function(t,e,n,o){t.addEventListener(e,n,o);var i=function(){t.removeEventListener(e,n,o)};return this.removeListenerCallbacks.push(i),i},t.prototype.dispose=function(){this.removeListenerCallbacks.forEach((function(t){return t()}))},t}(),Rt={delayedDraw:!0,offscreenCanvas:!1,useDirtyRectsRendering:!0,safariWebGL2:!1,pageBoundariesLimit:!1},Et=function(t){return parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(t)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||!1},Mt=/(iPhone|Macintosh|iPad)(.*)(Version)\/(0|[1-9]\d*)\.(0|[1-9]\d*)\.?(0|[1-9]\d*)?/,Lt=function(t){if(void 0===t&&(t=window.navigator.userAgent),t.includes("Chrome/")||t.includes("Chromium/")||t.includes("Opera/")||t.includes("Firefox/"))return null;var e=t.match(Mt);if(!e)return null;var n=e[1];return"Macintosh"!==n&&"iPad"!==n&&"iPhone"!==n?null:{hardware:n,version:{major:parseInt(e[4])||0,minor:parseInt(e[5])||0,patch:parseInt(e[6])||0}}};function Dt(t,e){var n;function o(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];clearTimeout(n),n=setTimeout((function(){t.apply(void 0,o)}),e)}return o.cancel=function(){n&&clearTimeout(n)},o}function Ot(t){var e,n,o,i,r,s=null!==(n=null===(e=t.touches)||void 0===e?void 0:e[0])&&void 0!==n?n:null===(o=t.changedTouches)||void 0===o?void 0:o[0];return{x:null!==(i=null==s?void 0:s.clientX)&&void 0!==i?i:t.clientX,y:null!==(r=null==s?void 0:s.clientY)&&void 0!==r?r:t.clientY}}function xt(t,e,n){return Math.max(e,Math.min(n,t))}function Tt(){return Lt()&&!Rt.safariWebGL2?1:"undefined"!=typeof WebGL2RenderingContext?2:1}function At(t){for(var e=t.size(),n=[],o=0;o<e;++o){var i=t.get(o);if(null==i)throw Error("Error converting embind vector to array");n.push(i)}return n}function Bt(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function Wt(t){var e=t;return Object.keys(e).forEach((function(t){void 0===e[t]&&delete e[t]})),e}function kt(t){return Bt()?{onTouchEnd:t}:{onClick:t}}var Gt=function(t){function e(e){var n=t.call(this)||this;return n.listenersCollector=new St,n.state={pinchToZoomLastDistance:0,lastGestureScale:1,isCtrlPressed:!1},n.handleGestureStart=function(t){t.preventDefault(),n.state.lastGestureScale=t.scale},n.handleGestureChange=function(t){t.preventDefault();var e=t.scale/n.state.lastGestureScale;n.state.lastGestureScale=t.scale;var o=n.getCorrectPointerPosition(t);n.emitZoomEvent(e,o)},n.handleGestureEnd=function(t){t.preventDefault()},n.handleTouchStart=function(t){t.preventDefault(),n.handleTouchPinchToZoomStart(t),n.emit("pointerdown",{type:"touch",position:n.getCorrectPointerPosition(t),button:0,touchesCount:t.touches.length})},n.handleMouseDown=function(t){t.ctrlKey||(t.preventDefault(),n.emit("pointerdown",{type:"mouse",position:n.getCorrectPointerPosition(t),button:t.button,touchesCount:0}))},n.handleTouchMove=function(t){n.handleTouchPinchToZoomChange(t),n.emit("pointermove",{type:"touch",position:n.getCorrectPointerPosition(t),button:0,touchesCount:t.touches.length})},n.handleMouseMove=function(t){n.updateMousePosition(t)},n.handleGlobalTouchMove=function(t){n.emit("globalpointermove",{type:"touch",position:n.getCorrectPointerPosition(t),button:0,touchesCount:t.touches.length})},n.handleGlobalMouseMove=function(t){n.updateGlobalMousePosition(t)},n.handleTouchPinchToZoomStart=function(t){var e;!t.touches||(null===(e=t.touches)||void 0===e?void 0:e.length)<2||(n.state.pinchToZoomLastDistance=n.calculateDistanceBetweenTouches(t.touches[0],t.touches[1]))},n.handleTouchPinchToZoomChange=function(t){var e;if(t.touches&&!((null===(e=t.touches)||void 0===e?void 0:e.length)<2)){var o=n.calculateDistanceBetweenTouches(t.touches[0],t.touches[1]),i=n.getCorrectPointerPosition(t),r=1+.004*(o-n.state.pinchToZoomLastDistance);n.state.pinchToZoomLastDistance=o,n.emitZoomEvent(r,i)}},n.handleTouchEnd=function(t){var e=n.getCorrectPointerPosition(t);n.emit("pointerup",{position:e,type:"touch",button:0,touchesCount:t.touches.length})},n.handleMouseUp=function(t){n.emit("pointerup",{type:"mouse",position:n.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},n.handleMouseWheel=function(t){t.preventDefault();var e=t.ctrlKey&&!n.state.isCtrlPressed,o=t.metaKey||e||n.state.isCtrlPressed;if(n.updateMousePosition(t),n.updateGlobalMousePosition(t),o){var i=e?-1:1,r=n.getCorrectPointerPosition(t),s=1+.005*t.deltaY*i;n.emitZoomEvent(s,r)}else n.emit("wheel",{x:-t.deltaX,y:-t.deltaY},{type:"mouse",position:n.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},n.target=e,n.targetBounds=e.getBoundingClientRect(),n.addListeners(),n}return at(e,t),e.prototype.updateTargetBounds=function(){this.targetBounds=this.target.getBoundingClientRect()},e.prototype.addListeners=function(){this.addTouchEventListeners(),this.addMouseEventListeners(),this.addKeyboardEventListeners(),this.addSafariGesturesEventListeners()},e.prototype.addKeyboardEventListeners=function(){var t=this;this.listenersCollector.add(document,"keydown",(function(e){"Control"===e.key&&(t.state.isCtrlPressed=!0)})),this.listenersCollector.add(document,"keyup",(function(e){"Control"===e.key&&(t.state.isCtrlPressed=!1)})),this.listenersCollector.add(document,"contextmenu",(function(e){e.ctrlKey&&(t.state.isCtrlPressed=!1)}))},e.prototype.addMouseEventListeners=function(){this.listenersCollector.add(this.target,"mousedown",this.handleMouseDown),this.listenersCollector.add(this.target,"mousemove",this.handleMouseMove),this.listenersCollector.add(document,"mousemove",this.handleGlobalMouseMove),this.listenersCollector.add(document,"mouseup",this.handleMouseUp),this.listenersCollector.add(this.target,"wheel",this.handleMouseWheel)},e.prototype.addTouchEventListeners=function(){this.listenersCollector.add(this.target,"touchstart",this.handleTouchStart),this.listenersCollector.add(document,"touchmove",this.handleGlobalTouchMove,{passive:!0,capture:!0}),this.listenersCollector.add(this.target,"touchmove",this.handleTouchMove,{passive:!0,capture:!0}),this.listenersCollector.add(document,"touchcancel",this.handleTouchEnd),this.listenersCollector.add(document,"touchend",this.handleTouchEnd)},e.prototype.addSafariGesturesEventListeners=function(){Bt()||(this.listenersCollector.add(this.target,"gesturestart",this.handleGestureStart,{capture:!0}),this.listenersCollector.add(this.target,"gesturechange",this.handleGestureChange,{capture:!0}),this.listenersCollector.add(this.target,"gestureend",this.handleGestureEnd,{capture:!0}))},e.prototype.clampPointerToTargetBounds=function(t){return{x:xt(t.x-this.targetBounds.x,0,this.target.clientWidth),y:xt(t.y-this.targetBounds.y,0,this.target.clientHeight)}},e.prototype.getCorrectPointerPosition=function(t){var e,n={x:0,y:0};if((null===(e=t.touches)||void 0===e?void 0:e.length)>1){var o=t,i=o.touches[0],r=o.touches[1];n={x:(i.clientX+r.clientX)/2,y:(i.clientY+r.clientY)/2}}else n=Ot(t);return this.clampPointerToTargetBounds(n)},e.prototype.updateMousePosition=function(t){this.emit("pointermove",{type:"mouse",position:this.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},e.prototype.updateGlobalMousePosition=function(t){this.emit("globalpointermove",{type:"mouse",position:this.getCorrectPointerPosition(t),button:t.button,touchesCount:0})},e.prototype.calculateDistanceBetweenTouches=function(t,e){return Math.hypot(t.clientX-e.clientX,t.clientY-e.clientY)},e.prototype.emitZoomEvent=function(t,e){this.emit("pinchToZoom",t,e)},e.prototype.dispose=function(){this.listenersCollector.dispose()},e}(It),zt=function(t){function e(e){var n=t.call(this)||this;return n.listenersCollector=new St,n.handleKeyUp=function(t){n.emit("keyUp",t.code)},n.target=e,n.addListeners(),n}return at(e,t),e.prototype.addListeners=function(){this.listenersCollector.add(this.target,"keyup",this.handleKeyUp)},e.prototype.dispose=function(){this.listenersCollector.dispose()},e}(It),Nt=function(){function t(){this.active=!0}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.active&&console.debug.apply(console,lt(["[WR:Debug]"],t,!1))},t.prototype.warning=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.active&&console.warn.apply(console,lt(["[WR:Warn]"],t,!1))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.error.apply(console,lt(["[WR:Error]"],t,!1))},t}(),jt=new Nt,Ut=function(){function t(t){this.label=t,this.startTime=performance.now(),this.startTimestamp=Date.now(),jt.debug("[Performance] Start: ".concat(this.label))}return t.prototype.measure=function(){return{duration:performance.now()-this.startTime,end:Date.now(),start:this.startTimestamp,id:this.label}},t.prototype.printMeasurement=function(){var t=this.measure().duration;if(t<1e3){var e=t.toFixed(2);jt.debug("[Performance] End: ".concat(this.label," -> ").concat(e," ms"))}else{var n=(t/1e3).toFixed(2);jt.debug("[Performance] End: ".concat(this.label," -> ").concat(n," s"))}},t}();function Zt(t){setTimeout((function(){t()}),0)}var Vt=function(t){function e(e){var n=t.call(this)||this;return n.listenersCollector=new St,n.size={width:0,height:0},n.pixelRatio=1,n.handleCanvasResizeObserver=function(t){n.resizeCanvas(t[0].contentRect)},n.resizeCanvas=function(t){var e=t.width,o=t.height;window.requestAnimationFrame((function(){n.setSize(e,o),n.emit("resize",e,o,n.getDevicePixelRatio())}))},n.getCanvasCenterPoint=function(){var t=n.getBoundingClientRect();return{x:t.width/2+t.x,y:t.height/2+t.y}},n.container=e.container,n.canvas=e.canvas,n.canvasResizeObserver=new ResizeObserver(n.handleCanvasResizeObserver),n.canvasResizeObserver.observe(n.container),n.listenersCollector.add(window,"orientationchange",n.handleDeviceOrientationChange),n.setSize(n.container.clientWidth,n.container.clientHeight),n}return at(e,t),e.prototype.setSize=function(t,e){this.pixelRatio=this.getDevicePixelRatio(),this.canvas.style.width="".concat(t,"px"),this.canvas.style.height="".concat(e,"px"),this.size.width=t*this.pixelRatio,this.size.height=e*this.pixelRatio,this.canvas.width=this.size.width,this.canvas.height=this.size.height},e.prototype.handleDeviceOrientationChange=function(){this.resizeCanvas({width:this.container.clientWidth,height:this.container.clientHeight})},e.prototype.getDevicePixelRatio=function(){return xt(window.devicePixelRatio,1,2)},e.prototype.getBoundingClientRect=function(){return this.canvas.getBoundingClientRect()},e.prototype.dispose=function(){this.detachAllListeners(),this.canvasResizeObserver.disconnect(),this.listenersCollector.dispose()},e}(It),qt=function(){function t(t){this.settings=t}return t.prototype.isReleaseMode=function(){return this.settings.mode===Ft.release},t.prototype.init=function(){return ct(this,void 0,void 0,(function(){var t,e,n,o,i,r=this;return dt(this,(function(s){switch(s.label){case 0:return[4,this.importModule()];case 1:t=s.sent(),e=t.default,s.label=2;case 2:return s.trys.push([2,4,,5]),n=this,[4,e({FeatureFlags:this.settings.featureFlags,currentWebGLVersion:Tt(),bridge:this.settings.jsBridge,locateFile:function(t){return r.settings.locateFile.replace("{file}",t)}})];case 3:return n.instance=s.sent(),[3,5];case 4:throw o=s.sent(),new Pt("WASM_ERROR","An error occurred while trying to create the wasm module.",o);case 5:return this.pointerTypeToWASMMap={unset:this.instance.PRUserPointerType.Unset,mouse:this.instance.PRUserPointerType.Mouse,touch:this.instance.PRUserPointerType.Touch},this.prCursorTypeToCSSCursorMap=((i={})[this.instance.PRCursorType.Auto.value]="auto",i[this.instance.PRCursorType.Default.value]="default",i[this.instance.PRCursorType.Pointer.value]="pointer",i[this.instance.PRCursorType.Grab.value]="grab",i[this.instance.PRCursorType.Grabbing.value]="grabbing",i),[2]}}))}))},t.prototype.makeWebGLContext=function(t,e){void 0===e&&(e={});var n=ut({antialias:!1,alpha:!1,stencil:!1,depth:!1,powerPreference:"high-performance",preserveDrawingBuffer:!1,desynchronized:!0},e);jt.debug("Using WebGL ".concat(n.majorVersion));var o=this.instance.GL.createContext(t,n);if(!o)throw new Pt("WEBGL_ERROR","Unable to create WebGL context. WebGL might be unsupported, disabled, or this device is not able to run WebGL correctly.");return o},t.prototype.destroyWebGLContext=function(t){var e,n=null===(e=this.instance)||void 0===e?void 0:e.GL.getContext(t);if(n){var o=n.GLctx.getExtension("WEBGL_lose_context");o?o.loseContext():jt.warning("Unable to retrieve WEBGL_lose_context extension")}else jt.warning("Unable to loose context. WebGL rendering context not found")},t.prototype.importModule=function(){return this.isReleaseMode()?import("./module-release-0b378fd1.js"):import("./module-debug-7ee9ba03.js")},t.prototype.mapToCSSCursor=function(t){return this.prCursorTypeToCSSCursorMap[t.value]},t.prototype.mapToPRPointerType=function(t){var e;return null!==(e=this.pointerTypeToWASMMap[t])&&void 0!==e?e:this.instance.PRUserPointerType.Unset},t.prototype.mapPointerInfo=function(t){return ut(ut({},t),{type:this.mapToPRPointerType(t.type)})},t}(),Ht=function(t){function e(e){var n=t.call(this)||this;return n.status={type:"INIT"},n.handleCanvasResize=function(t,e,o){var i;null===(i=n.pageCanvasWasm)||void 0===i||i.resize(t,e,o)},n.handleWebGLContextLost=function(){n.setStatus({type:"WEBGL_CONTEXT_LOST"})},n.handlePinchToZoomEvent=function(t,e){var o;null===(o=n.userEventsCollectorWasm)||void 0===o||o.dispatchPinchToZoomEvent(t,e.x,e.y)},n.handleWheelEvent=function(t,e){var o;null===(o=n.userEventsCollectorWasm)||void 0===o||o.dispatchWheelEvent(t.x,t.y,n.wasmModule.mapPointerInfo(e))},n.handlePointerDownEvent=function(t){var e;null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchPointerDownEvent(n.wasmModule.mapPointerInfo(t))},n.handlePointerMoveEvent=function(t){var e;null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchPointerMoveEvent(n.wasmModule.mapPointerInfo(t))},n.handleGlobalPointerMoveEvent=function(t){var e;null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchGlobalPointerMoveEvent(n.wasmModule.mapPointerInfo(t))},n.handlePointerUpEvent=function(t){var e;null===(e=n.userEventsCollectorWasm)||void 0===e||e.dispatchPointerUpEvent(n.wasmModule.mapPointerInfo(t))},n.settings=ut(ut({backgroundColor:{r:1,g:1,b:1,a:1},showTilesBorders:!1,preserveDrawingBuffer:!1,panBoundariesPadding:0},Wt(e)),{featureFlags:ut(ut({},Rt),e.featureFlags)}),jt.active=n.settings.mode===Ft.debug,n.gestureManager=new Gt(n.settings.container),n.canvasManager=new Vt({container:n.settings.container,canvas:n.settings.canvas}),n.wasmModule=new qt({mode:n.settings.mode,locateFile:n.settings.locateFile,jsBridge:n.createJSBridge(),featureFlags:n.settings.featureFlags}),n.settings.manualInitialization||n.init(),n}return at(e,t),e.prototype.addListeners=function(){this.canvasManager.on("resize",this.handleCanvasResize),this.gestureManager.on("wheel",this.handleWheelEvent),this.gestureManager.on("pointerup",this.handlePointerUpEvent),this.gestureManager.on("pointermove",this.handlePointerMoveEvent),this.gestureManager.on("globalpointermove",this.handleGlobalPointerMoveEvent),this.gestureManager.on("pointerdown",this.handlePointerDownEvent),this.gestureManager.on("pinchToZoom",this.handlePinchToZoomEvent),this.settings.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost)},e.prototype.collectAndEmitDeviceInfo=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:return[4,Ct()];case 1:return t=e.sent(),this.deviceInfo=ut(ut({},t),{hardwareConcurrency:navigator.hardwareConcurrency}),this.emit("deviceInfo",this.deviceInfo),[2]}}))}))},e.prototype.init=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:this.traceFirstPaint=new Ut("FirstPaint"),this.setStatus({type:"INIT"}),this.collectAndEmitDeviceInfo(),e.label=1;case 1:return e.trys.push([1,6,,7]),[4,this.initWasmModule()];case 2:return e.sent(),[4,this.initCanvasRendererWasm()];case 3:return e.sent(),[4,this.setFile(this.settings.filePath)];case 4:return e.sent(),[4,this.preloadImages()];case 5:return e.sent(),[3,7];case 6:return t=e.sent(),[2,this.fail(t instanceof Pt?t:new Pt("ERROR","Unexpected exception initializing the web renderer",t))];case 7:return this.setInitialCameraState(),this.startRendering(),this.addListeners(),[2]}}))}))},e.prototype.setInitialCameraState=function(){var t,e,n,o=void 0!==this.settings.initialZoom,i=void 0!==this.settings.initialPan;o||i?(o&&this.setZoom(this.settings.initialZoom||1),i&&this.setPan((null===(t=this.settings.initialPan)||void 0===t?void 0:t.x)||0,(null===(e=this.settings.initialPan)||void 0===e?void 0:e.y)||0,null===(n=this.settings.initialPan)||void 0===n?void 0:n.centerPointInViewport)):this.zoomToFit()},e.prototype.preloadImages=function(){var t=this;return new Promise((function(e){var n;null===(n=t.pageCanvasWasm)||void 0===n||n.preloadImages((function(){e()}))}))},e.prototype.startRendering=function(){this.traceInitialRender=new Ut("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),this.pageCanvasWasm.startRenderLoop()},e.prototype.createJSBridge=function(){var t=this;return{logDebug:function(t){jt.debug("[C++] ".concat(t))},logWarning:function(t){jt.warning("[C++] ".concat(t))},logError:function(t){jt.error("[C++] ".concat(t))},emitMetric:function(e,n,o,i){t.emit("metric",{id:e,start:n,end:o,duration:i})},resolveImageUrl:function(e){return t.settings.imagesURLFormat?t.settings.imagesURLFormat.replace(":imageId",e):t.settings.imagesURLMap&&t.settings.imagesURLMap[e]?t.settings.imagesURLMap[e]:(jt.warning("Not able to resolve the url for the image with UUID: ".concat(e)),"")},onDrawComplete:this.handleDrawComplete.bind(this),onAllImagesReady:function(){t.emit("allImagesReady")},onCameraMoveStart:function(){t.emit("cameraMoveStart")},onCameraMoveEnd:function(){t.emit("cameraMoveEnd")},onCameraZoomStart:function(){t.emit("cameraZoomStart")},onCameraZoomEnd:function(){t.emit("cameraZoomEnd")},onCameraZoomChange:function(e){t.emit("cameraZoomChange",e)},onCameraPanChange:function(){var e=t.getPan();t.emit("cameraPanChange",(null==e?void 0:e.x)||0,(null==e?void 0:e.y)||0)},onCursorChange:function(e){var n=t.wasmModule.mapToCSSCursor(e);t.emit("cursorChange",n)},onPlayStateChange:function(){}}},e.prototype.downloadImages=function(){var t=this;return new Promise((function(e){var n,o=new Ut("ImagesDownload");null===(n=t.pageCanvasWasm)||void 0===n||n.downloadImages((function(){o.printMeasurement(),t.emit("metric",o.measure()),jt.debug("Images downloaded"),e()}))}))},e.prototype.initWasmModule=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:return t=new Ut("WasmModuleDownload"),[4,this.wasmModule.init()];case 1:return e.sent(),t.printMeasurement(),this.emit("metric",t.measure()),[2]}}))}))},e.prototype.initCanvasRendererWasm=function(){return ct(this,void 0,void 0,(function(){return dt(this,(function(t){try{this.webglCtxHandle=this.wasmModule.makeWebGLContext(this.settings.canvas,{preserveDrawingBuffer:this.settings.preserveDrawingBuffer,majorVersion:Tt()}),this.renderTarget=this.wasmModule.instance.RenderTarget.MakeWebGL(this.webglCtxHandle,this.canvasManager.size.width,this.canvasManager.size.height,this.canvasManager.pixelRatio),this.pageCanvasWasm=new this.wasmModule.instance.CanvasRenderer(this.renderTarget,{showTilesBorders:this.settings.showTilesBorders})}catch(t){throw new Pt("WASM_ERROR","An error occurred while trying to create the wasm object.",t)}return this.userEventsCollectorWasm=this.pageCanvasWasm.getUserEventsCollector(),this.pageCanvasWasm.setBackgroundColor(this.settings.backgroundColor.r,this.settings.backgroundColor.g,this.settings.backgroundColor.b,this.settings.backgroundColor.a),this.pageCanvasWasm.setZoomLevels(this.settings.minimumZoomLevel,this.settings.maximumZoomLevel),this.pageCanvasWasm.setPanBoundariesPadding(this.settings.panBoundariesPadding),[2]}))}))},e.prototype.setIsCameraLocked=function(t){this.pageCanvasWasm.setIsCameraLocked(t)},e.prototype.setBackgroundColor=function(t){t.r===this.settings.backgroundColor.r&&t.g===this.settings.backgroundColor.g&&t.b===this.settings.backgroundColor.b&&t.a===this.settings.backgroundColor.a||(this.pageCanvasWasm.setBackgroundColor(t.r,t.g,t.b,t.a),this.settings.backgroundColor=t)},e.prototype.generateDocumentPNG=function(){return ct(this,void 0,void 0,(function(){return dt(this,(function(t){switch(t.label){case 0:return[4,this.downloadImages()];case 1:return t.sent(),[2,this.pageCanvasWasm.generateDocumentPNG()]}}))}))},e.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(this.traceInitialRender.printMeasurement(),this.emit("metric",this.traceInitialRender.measure()),this.traceFirstPaint.printMeasurement(),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}),this.downloadImages())},e.prototype.looseWebGLContext=function(){this.wasmModule.destroyWebGLContext(this.webglCtxHandle),this.webglCtxHandle=-1},e.prototype.zoomToFit=function(){this.pageCanvasWasm.scaleDocumentToFit()},e.prototype.setFile=function(t){return ct(this,void 0,void 0,(function(){var e=this;return dt(this,(function(n){return this.setStatus({type:"LOADING_FILE"}),[2,new Promise((function(n,o){e.pageCanvasWasm.setFile(t,(function(t,o,i,r){if(void 0===r&&(r=[]),r.length){jt.debug("Parser warnings: ".concat(r));var s=r.map((function(t){return{key:t}}));e.emit("warnings",s)}e.setStatus({type:"FILE_READY"});var a="".concat(t,"-v").concat("5.0.0");e.emit("fileReady",e.getDocument(),a,o,i),n()}),(function(){return o(new Pt("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))]}))}))},e.prototype.fail=function(t){this.setStatus({type:"FAILURE",code:t.code,message:"".concat(t.toString()).concat(t.cause?"\nWrapped Error: ".concat(t.cause.toString()):"")}),jt.error(t),t.cause&&jt.error(t.cause)},e.prototype.setStatus=function(t){"FAILURE"!==this.status.type&&(jt.debug("Status transition ".concat(this.status.type," => ").concat(t.type,"}")),this.status=t,this.emit("status",t))},e.prototype.getDocument=function(){if(!this.cachedDocumentInfo||this.cachedDocumentInfo.filePath!==this.settings.filePath){var t=this.pageCanvasWasm.getPRFile();this.cachedDocumentInfo={filePath:this.settings.filePath,document:ut(ut({},t),{artboards:At(t.artboards)})}}return this.cachedDocumentInfo.document},e.prototype.getArtboardAtPosition=function(t,e){if(this.pageCanvasWasm){var n=this.getDocument();if(n){for(var o=this.pageCanvasWasm.getPan(),i=this.pageCanvasWasm.getZoom(),r=(t-o.x)/i,s=(e-o.y)/i,a=0,u=n.artboards;a<u.length;a++){var c=u[a],d=c.bounds.x+c.bounds.width,l=c.bounds.y+c.bounds.height;if(r>=c.bounds.x&&s>=c.bounds.y&&r<=d&&s<=l)return c.objectId}return null}}},e.prototype.getPanAtPosition=function(t,e){var n=this.getPan(),o=Math.max(this.getZoom(),Number.EPSILON),i=t/o,r=e/o;return{x:n.x-i,y:n.y-r}},e.prototype.getStatus=function(){return this.status},e.prototype.setZoom=function(t,e){var n,o=null!=e?e:this.canvasManager.getCanvasCenterPoint();null===(n=this.pageCanvasWasm)||void 0===n||n.setZoom(t,o.x,o.y)},e.prototype.getPan=function(){var t=this.getDocument().bounds,e=this.pageCanvasWasm.getPan(),n=this.pageCanvasWasm.getZoom();return{x:e.x/n+t.x,y:e.y/n+t.y}},e.prototype.getZoom=function(){return this.pageCanvasWasm.getZoom()},e.prototype.setPan=function(t,e,n){void 0===n&&(n=!1);var o=t,i=e,r=this.getDocument().bounds,s=this.pageCanvasWasm.getZoom();if(n){var a=Math.max(2*s*this.canvasManager.pixelRatio,Number.EPSILON);o+=this.canvasManager.size.width/a,i+=this.canvasManager.size.height/a}var u=(o-r.x)*s,c=(i-r.y)*s;this.pageCanvasWasm.setPan(u,c)},e.prototype.dispose=function(){try{this.detachAllListeners(),this.canvasManager.dispose(),this.gestureManager.dispose(),this.pageCanvasWasm.stopRenderLoop(),this.pageCanvasWasm.delete(),this.renderTarget.delete()}catch(t){this.fail(new Pt("ERROR","Unexpected exception while disposing the wasm object",t))}},e}(It),Kt=e(void 0),Yt=e(void 0),$t=e(void 0),Xt=e(void 0),Jt=e(void 0),Qt=e(void 0),te=e("auto"),ee=e(void 0),ne=function(){var t=n(ee);if(void 0===t)throw Error("useInternalContext must be used within a provider");return t},oe=function(t,e){switch(e.type){case"on-status":return ut(ut({},t),{status:e.status});case"on-file-ready":return ut(ut({},t),{document:e.document});case"on-zoom":return ut(ut({},t),{zoom:e.zoom});case"on-pan":return ut(ut({},t),{pan:e.pan});case"dispose":return ut(ut({},t),{status:null,zoom:null,pan:null,cursor:"auto"});case"on-camera-zoom-start":return ut(ut({},t),{isCameraZooming:!0});case"on-camera-zoom-end":return ut(ut({},t),{isCameraZooming:!1});case"on-camera-move-start":return ut(ut({},t),{isCameraMoving:!0});case"on-camera-move-end":return ut(ut({},t),{isCameraMoving:!1});case"on-cursor-change":return ut(ut({},t),{cursor:e.cursor});default:return t}},ie=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return jt.debug.apply(jt,lt(["CanvasRendererReact"],t,!1))},re=function(e){var n=o(null),a=o(null),u=i(oe,{pan:null,zoom:null,status:null,document:null,isCameraZooming:!1,isCameraMoving:!1,cursor:"auto"}),c=u[0],d=c.status,l=c.document,h=c.zoom,b=c.pan,p=c.isCameraZooming,f=c.isCameraMoving,_=c.cursor,g=u[1],m=r((function(t){return g({type:"on-zoom",zoom:t})}),[]),v=r((function(t,e){return g({type:"on-pan",pan:{x:t,y:e}})}),[]),w=r((function(t){g({type:"on-status",status:t})}),[]),y=r((function(t){g({type:"on-file-ready",document:t})}),[]),C=r((function(){return g({type:"on-camera-zoom-start"})}),[]),F=r((function(){return g({type:"on-camera-zoom-end"})}),[]),P=r((function(){return g({type:"on-camera-move-start"})}),[]),I=r((function(){return g({type:"on-camera-move-end"})}),[]),S=r((function(t){return g({type:"on-cursor-change",cursor:t})}),[]),R=r((function(){var t=n.current;t&&(ie("dispose"),t.off("status",w),t.off("fileReady",y),t.off("cameraZoomChange",m),t.off("cameraPanChange",v),t.off("cameraZoomStart",C),t.off("cameraZoomEnd",F),t.off("cameraMoveStart",P),t.off("cameraMoveEnd",I),t.off("cursorChange",S),t.dispose(),n.current=null,g({type:"dispose"}))}),[w,y,v,m,C,F,P,I,S]),E=r((function(t,e,o){if(""!==t&&e&&o&&a.current){ie("init");var i=new Ht(ut(ut({},a.current),{filePath:t,container:o,canvas:e}));i.on("status",w),i.on("fileReady",y),i.on("cameraZoomChange",m),i.on("cameraPanChange",v),i.on("cameraZoomStart",C),i.on("cameraZoomEnd",F),i.on("cameraMoveStart",P),i.on("cameraMoveEnd",I),i.on("cursorChange",S),n.current=i}}),[w,y,m,v,C,F,P,I,S]),M=r((function(t){var e;ie("setSettings",t),t.backgroundColor&&(null===(e=n.current)||void 0===e||e.setBackgroundColor(t.backgroundColor)),a.current=t}),[]),L=r((function(){return n.current}),[]),D=s((function(){return{dispose:R,init:E,setSettings:M,getInstance:L,dispatch:g}}),[R,E,M,L]);return t.createElement(ee.Provider,{value:D},t.createElement(Kt.Provider,{value:d},t.createElement(Yt.Provider,{value:l},t.createElement($t.Provider,{value:h},t.createElement(Qt.Provider,{value:b},t.createElement(Xt.Provider,{value:p},t.createElement(Jt.Provider,{value:f},t.createElement(te.Provider,{value:_},e.children))))))))},se=function(){var t=n(Kt);if(void 0===t)throw Error("useStatus must be used within a provider");return t},ae=function(){var t=n(Yt);if(void 0===t)throw Error("useDocument must be used within a provider");return t},ue=function(){var t=n($t);if(void 0===t)throw Error("useZoom must be used within a provider");return t},ce=function(){var t=n(Qt);if(void 0===t)throw Error("usePan must be used within a provider");return t},de=function(){var t=n(te);if(void 0===t)throw Error("useCursor must be used within a provider");return t},le=function(){var t=n(Xt);if(void 0===status)throw Error("useIsCameraZooming must be used within a provider");return t},he=function(){var t=n(Jt);if(void 0===status)throw Error("useIsCameraMoving must be used within a provider");return t},be=function(){var t=(0,ne().getInstance)();return r((function(e){ie("setZoom",e),null==t||t.setZoom(e)}),[t])},pe=function(){var t=be(),e=ue();return r((function(){var n;(ie("incrementZoom"),"number"==typeof e)&&(n=e>=1?Math.round(2*e):e>.5?1:2*e,t(n))}),[t,e])},fe=function(){var t=be(),e=ue();return r((function(){ie("decrementZoom"),"number"==typeof e&&t(e/2)}),[t,e])},_e=function(){var t=(0,ne().getInstance)();return r((function(e){var n=e.x,o=e.y,i=e.centerPointInViewport;ie("setPan",n,o,"centerPointInViewport",i),null==t||t.setPan(n,o,i)}),[t])},ge=function(){var t=(0,ne().getInstance)();return r((function(){ie("zoomToFit"),null==t||t.zoomToFit()}),[t])},me=function(){var t=(0,ne().getInstance)();return r((function(){ie("looseWebGLContext"),null==t||t.looseWebGLContext()}),[t])},ve=function(){var t=(0,ne().getInstance)();return r((function(){return ct(void 0,void 0,void 0,(function(){return dt(this,(function(e){switch(e.label){case 0:return ie("generateDocumentPNG"),[4,null==t?void 0:t.generateDocumentPNG()];case 1:return[2,e.sent()]}}))}))}),[t])},we=function(){var t=(0,ne().getInstance)();return r((function(e,n){return ct(void 0,void 0,void 0,(function(){return dt(this,(function(o){switch(o.label){case 0:return ie("getArtboardAtPosition",e,n),[4,null==t?void 0:t.getArtboardAtPosition(e,n)];case 1:return[2,o.sent()||null]}}))}))}),[t])},ye=function(){var t=(0,ne().getInstance)();return r((function(e,n){return ct(void 0,void 0,void 0,(function(){return dt(this,(function(o){switch(o.label){case 0:return ie("getPanAtPosition",e,n),[4,null==t?void 0:t.getPanAtPosition(e,n)];case 1:return[2,o.sent()||null]}}))}))}),[t])},Ce=function(){var t=(0,ne().getInstance)();return r((function(e){ie("setIsCameraLocked",e),null==t||t.setIsCameraLocked(e)}),[t])},Fe=function(t,e){var n=(0,ne().getInstance)();a((function(){return null==n||n.on(t,e),function(){null==n||n.off(t,e)}}),[t,n,e])},Pe={position:"relative",width:"100%",height:"100%",touchAction:"manipulation"},Ie={position:"absolute",top:0,left:0},Se=function(e){jt.active=e.mode===Ft.debug;var n=e.filePath,i=e.locateFile,c=e.imagesURLFormat,d=e.imagesURLMap,l=e.backgroundColor,h=e.mode,b=e.showTilesBorders,p=e.minimumZoomLevel,f=e.maximumZoomLevel,_=e.preserveDrawingBuffer,g=e.panBoundariesPadding,m=e.initialPan,v=e.initialZoom,w=e.children,y=e.containerProps,C=void 0===y?{}:y,F=e.canvasProps,P=void 0===F?{}:F,I=e.featureFlags,S=void 0===I?{}:I,R=o(null),E=o(null),M=u(!1),L=M[0],D=M[1],O=r((function(){return D(!0)}),[]),x=ne(),T=x.dispose,A=x.init,B=x.setSettings,W=de(),k=se();Fe("allImagesReady",O),a((function(){B({locateFile:i,imagesURLFormat:c,imagesURLMap:d,backgroundColor:l,mode:h,showTilesBorders:b,minimumZoomLevel:p,maximumZoomLevel:f,preserveDrawingBuffer:_,panBoundariesPadding:g,initialPan:m,initialZoom:v,featureFlags:S})}),[B,i,c,d,l,h,b,p,f,_,g,m,v,S]),a((function(){if(n)return A(n,R.current,E.current),function(){T()}}),[T,A,n]);var G=s((function(){var t;return null!==(t=e.cursor)&&void 0!==t?t:W}),[e.cursor,W]),z=s((function(){return ut(ut({},Pe),{cursor:G})}),[G]);return t.createElement("div",ut({},C,{ref:E,style:z}),n&&t.createElement("canvas",ut({},P,{key:n,ref:R,"data-sketchweb-all-images-ready":L,"data-testid":"sketchweb-canvas","data-sketchweb-status":"sketchweb-status-".concat((null==k?void 0:k.type.toLowerCase())||"null"),style:Ie})),"READY"===(null==k?void 0:k.type)&&w)},Re=function(t){function e(e){var n=t.call(this)||this;return n.status={type:"INIT"},n.handleCanvasResize=function(t,e,o){var i;null===(i=n.playerWasm)||void 0===i||i.resize(t,e,o)},n.handleWebGLContextLost=function(){n.setStatus({type:"WEBGL_CONTEXT_LOST"})},n.handlePinchToZoomEvent=function(t,e){var o;null===(o=n.userEventsCollectorWasm)||void 0===o||o.dispatchPinchToZoomEvent(t,e.x,e.y)},n.handleWheelEvent=function(t,e){n.userEventsCollectorWasm.dispatchWheelEvent(t.x,t.y,n.wasmModule.mapPointerInfo(e))},n.handlePointerDownEvent=function(t){n.userEventsCollectorWasm.dispatchPointerDownEvent(n.wasmModule.mapPointerInfo(t))},n.handlePointerMoveEvent=function(t){n.userEventsCollectorWasm.dispatchPointerMoveEvent(n.wasmModule.mapPointerInfo(t))},n.handleGlobalPointerMoveEvent=function(t){n.userEventsCollectorWasm.dispatchGlobalPointerMoveEvent(n.wasmModule.mapPointerInfo(t))},n.handlePointerUpEvent=function(t){n.userEventsCollectorWasm.dispatchPointerUpEvent(n.wasmModule.mapPointerInfo(t))},n.restartPrototype=function(t){n.playerWasm.restartPrototype(t)},n.goBack=function(){n.playerWasm.goBack()},n.goForwards=function(){n.playerWasm.goForwards()},n.settings=ut(ut({backgroundColor:{r:1,g:1,b:1,a:1},showTilesBorders:!1,preserveDrawingBuffer:!1},Wt(e)),{featureFlags:ut(ut({},Rt),e.featureFlags)}),jt.active=n.settings.mode===Ft.debug,n.gestureManager=new Gt(n.settings.container),n.canvasManager=new Vt({container:n.settings.container,canvas:n.settings.canvas}),n.wasmModule=new qt({mode:n.settings.mode,locateFile:n.settings.locateFile,jsBridge:n.createJSBridge(),featureFlags:n.settings.featureFlags}),n.settings.manualInitialization||n.init(),n}return at(e,t),e.prototype.addListeners=function(){this.canvasManager.on("resize",this.handleCanvasResize),this.gestureManager.on("wheel",this.handleWheelEvent),this.gestureManager.on("pointerup",this.handlePointerUpEvent),this.gestureManager.on("pointermove",this.handlePointerMoveEvent),this.gestureManager.on("globalpointermove",this.handleGlobalPointerMoveEvent),this.gestureManager.on("pointerdown",this.handlePointerDownEvent),this.gestureManager.on("pinchToZoom",this.handlePinchToZoomEvent),this.settings.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLost)},e.prototype.collectAndEmitDeviceInfo=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:return[4,Ct()];case 1:return t=e.sent(),this.deviceInfo=ut(ut({},t),{hardwareConcurrency:navigator.hardwareConcurrency}),this.emit("deviceInfo",this.deviceInfo),[2]}}))}))},e.prototype.init=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:this.traceFirstPaint=new Ut("FirstPaint"),this.setStatus({type:"INIT"}),this.collectAndEmitDeviceInfo(),e.label=1;case 1:return e.trys.push([1,6,,7]),[4,this.initWasmModule()];case 2:return e.sent(),[4,this.initPlayerWasm()];case 3:return e.sent(),[4,this.setFile(this.settings.filePath)];case 4:return e.sent(),[4,this.preloadImages()];case 5:return e.sent(),[3,7];case 6:return t=e.sent(),[2,this.fail(t instanceof Pt?t:new Pt("ERROR","Unexpected exception initializing the web renderer",t))];case 7:return this.setInitialCameraState(),this.startRendering(),this.addListeners(),[2]}}))}))},e.prototype.initWasmModule=function(){return ct(this,void 0,void 0,(function(){var t;return dt(this,(function(e){switch(e.label){case 0:return t=new Ut("WasmModuleDownload"),[4,this.wasmModule.init()];case 1:return e.sent(),t.printMeasurement(),this.emit("metric",t.measure()),[2]}}))}))},e.prototype.setInitialCameraState=function(){this.zoomToFit()},e.prototype.preloadImages=function(){var t=this;return new Promise((function(e){var n;null===(n=t.playerWasm)||void 0===n||n.preloadImages((function(){e()}))}))},e.prototype.startRendering=function(){this.traceInitialRender=new Ut("InitialRender"),this.setStatus({type:"DRAWING_FILE"}),this.playerWasm.startRenderLoop()},e.prototype.createJSBridge=function(){var t=this;return{logDebug:function(t){jt.debug("[C++] ".concat(t))},logWarning:function(t){jt.warning("[C++] ".concat(t))},logError:function(t){jt.error("[C++] ".concat(t))},emitMetric:function(e,n,o,i){t.emit("metric",{id:e,start:n,end:o,duration:i})},resolveImageUrl:function(e){return t.settings.imagesURLFormat?t.settings.imagesURLFormat.replace(":imageId",e):t.settings.imagesURLMap&&t.settings.imagesURLMap[e]?t.settings.imagesURLMap[e]:(jt.warning("Not able to resolve the url for the image with UUID: ".concat(e)),"")},onDrawComplete:this.handleDrawComplete.bind(this),onAllImagesReady:function(){t.emit("allImagesReady")},onCameraMoveStart:function(){t.emit("cameraMoveStart")},onCameraMoveEnd:function(){t.emit("cameraMoveEnd")},onCameraZoomStart:function(){t.emit("cameraZoomStart")},onCameraZoomEnd:function(){t.emit("cameraZoomEnd")},onCameraZoomChange:function(e){t.emit("cameraZoomChange",e)},onCameraPanChange:function(e,n){t.emit("cameraPanChange",e,n)},onCursorChange:function(e){var n=t.wasmModule.mapToCSSCursor(e);t.emit("cursorChange",n)},onPlayStateChange:function(e,n,o){t.emit("playStateChange",{screenArtboardId:e,canGoBack:n,canGoForwards:o})}}},e.prototype.downloadImages=function(){var t=this;return new Promise((function(e){var n,o=new Ut("ImagesDownload");null===(n=t.playerWasm)||void 0===n||n.downloadImages((function(){o.printMeasurement(),t.emit("metric",o.measure()),jt.debug("Images downloaded"),e()}))}))},e.prototype.initPlayerWasm=function(){return ct(this,void 0,void 0,(function(){return dt(this,(function(t){try{this.webglCtxHandle=this.wasmModule.makeWebGLContext(this.settings.canvas,{preserveDrawingBuffer:this.settings.preserveDrawingBuffer,majorVersion:Tt()}),this.renderTarget=this.wasmModule.instance.RenderTarget.MakeWebGL(this.webglCtxHandle,this.canvasManager.size.width,this.canvasManager.size.height,this.canvasManager.pixelRatio),this.playerWasm=new this.wasmModule.instance.PrototypeRenderer(this.renderTarget,{showTilesBorders:this.settings.showTilesBorders},this.settings.startArtboardUUID)}catch(t){throw new Pt("WASM_ERROR","An error occurred while trying to create the WebRendererWasm object.",t)}return this.userEventsCollectorWasm=this.playerWasm.getUserEventsCollector(),this.playerWasm.setBackgroundColor(this.settings.backgroundColor.r,this.settings.backgroundColor.g,this.settings.backgroundColor.b,this.settings.backgroundColor.a),this.playerWasm.setZoomLevels(this.settings.minimumZoomLevel,this.settings.maximumZoomLevel),[2]}))}))},e.prototype.setIsCameraLocked=function(t){var e;null===(e=this.playerWasm)||void 0===e||e.setIsCameraLocked(t)},e.prototype.setBackgroundColor=function(t){var e;t.r===this.settings.backgroundColor.r&&t.g===this.settings.backgroundColor.g&&t.b===this.settings.backgroundColor.b&&t.a===this.settings.backgroundColor.a||(null===(e=this.playerWasm)||void 0===e||e.setBackgroundColor(t.r,t.g,t.b,t.a),this.settings.backgroundColor=t)},e.prototype.handleDrawComplete=function(){"DRAWING_FILE"===this.status.type&&(this.traceInitialRender.printMeasurement(),this.emit("metric",this.traceInitialRender.measure()),this.traceFirstPaint.printMeasurement(),this.emit("metric",this.traceFirstPaint.measure()),this.setStatus({type:"READY"}),this.downloadImages())},e.prototype.looseWebGLContext=function(){this.wasmModule.destroyWebGLContext(this.webglCtxHandle),this.webglCtxHandle=-1},e.prototype.zoomToFit=function(){this.playerWasm.scaleDocumentToFit()},e.prototype.setFile=function(t){return ct(this,void 0,void 0,(function(){var e=this;return dt(this,(function(n){return this.setStatus({type:"LOADING_FILE"}),[2,new Promise((function(n,o){e.playerWasm.setFile(t,(function(t,o,i,r){if(void 0===r&&(r=[]),r.length){jt.debug("Parser warnings: ".concat(r));var s=r.map((function(t){return{key:t}}));e.emit("warnings",s)}e.setStatus({type:"FILE_READY"});var a="".concat(t,"-v").concat("5.0.0");e.emit("fileReady",e.getDocument(),a,o,i),n()}),(function(){return o(new Pt("FILE_ERROR","Error encountered while fetching and parsing the file"))}))}))]}))}))},e.prototype.fail=function(t){this.setStatus({type:"FAILURE",code:t.code,message:"".concat(t.toString()).concat(t.cause?"\nWrapped Error: ".concat(t.cause.toString()):"")}),jt.error(t),t.cause&&jt.error(t.cause)},e.prototype.setStatus=function(t){"FAILURE"!==this.status.type&&(jt.debug("Status transition ".concat(this.status.type," => ").concat(t.type,"}")),this.status=t,this.emit("status",t))},e.prototype.getStatus=function(){return this.status},e.prototype.getDocument=function(){if(!this.cachedDocumentInfo||this.cachedDocumentInfo.filePath!==this.settings.filePath){var t=this.playerWasm.getPRFile();this.cachedDocumentInfo={filePath:this.settings.filePath,document:ut(ut({},t),{artboards:At(t.artboards)})}}return this.cachedDocumentInfo.document},e.prototype.dispose=function(){try{this.detachAllListeners(),this.canvasManager.dispose(),this.gestureManager.dispose(),this.playerWasm.stopRenderLoop(),this.playerWasm.delete(),this.renderTarget.delete()}catch(t){this.fail(new Pt("ERROR","Unexpected exception while disposing the WebRendererWasm object",t))}},e}(It),Ee=e(void 0),Me=e("auto"),Le=e(void 0),De=e(void 0),Oe=function(){var t=n(De);if(void 0===t)throw Error("useInternalContext must be used within a provider");return t},xe=function(t,e){switch(e.type){case"on-status":return ut(ut({},t),{status:e.status});case"dispose":return ut(ut({},t),{status:null,cursor:"auto"});case"on-cursor-change":return ut(ut({},t),{cursor:e.cursor});case"on-play-state-change":return ut(ut({},t),{playState:ut(ut({},t.playState),e.playState)});default:return t}},Te=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return jt.debug.apply(jt,lt(["PrototypeRendererReact"],t,!1))},Ae=function(e){var n=o(null),a=o(null),u=i(xe,{status:null,cursor:"auto",playState:{screenArtboardId:"",canGoBack:!0,canGoForwards:!0}}),c=u[0],d=c.status,l=c.cursor,h=c.playState,b=u[1],p=r((function(t){b({type:"on-status",status:t})}),[]),f=r((function(t){return b({type:"on-cursor-change",cursor:t})}),[]),_=r((function(t){return b({type:"on-play-state-change",playState:t})}),[]),g=r((function(){var t=n.current;t&&(Te("dispose"),t.off("status",p),t.off("cursorChange",f),t.off("playStateChange",_),t.dispose(),n.current=null,b({type:"dispose"}))}),[p,f,_]),m=r((function(t,e,o){if(""!==t&&e&&o&&a.current){Te("init");var i=new Re(ut(ut({},a.current),{filePath:t,container:o,canvas:e}));i.on("status",p),i.on("cursorChange",f),i.on("playStateChange",_),n.current=i}}),[p,f,_]),v=r((function(t){var e;Te("setSettings",t),t.backgroundColor&&(null===(e=n.current)||void 0===e||e.setBackgroundColor(t.backgroundColor)),a.current=t}),[]),w=r((function(){return n.current}),[]),y=s((function(){return{dispose:g,init:m,setSettings:v,getInstance:w,dispatch:b}}),[g,m,v,w]);return t.createElement(De.Provider,{value:y},t.createElement(Ee.Provider,{value:d},t.createElement(Me.Provider,{value:l},t.createElement(Le.Provider,{value:h},e.children))))},Be=function(){var t=(0,Oe().getInstance)();return r((function(e){null==t||t.restartPrototype(e)}),[t])},We=function(){var t=(0,Oe().getInstance)();return r((function(){null==t||t.goBack()}),[t])},ke=function(){var t=(0,Oe().getInstance)();return r((function(){null==t||t.goForwards()}),[t])},Ge=function(){var t=n(Ee);if(void 0===t)throw Error("usePrototypeStatus must be used within a provider");return t},ze=function(){var t=n(Me);if(void 0===t)throw Error("usePrototypeCursor must be used within a provider");return t},Ne=function(){var t=n(Le);if(void 0===t)throw Error("usePrototypePlayState must be used within a provider");return t},je=function(t,e){var n=(0,Oe().getInstance)();a((function(){return null==n||n.on(t,e),function(){null==n||n.off(t,e)}}),[t,n,e])},Ue={position:"relative",width:"100%",height:"100%",touchAction:"manipulation"},Ze={position:"absolute",top:0,left:0},Ve=function(e){jt.active=e.mode===Ft.debug;var n=e.filePath,i=e.locateFile,r=e.imagesURLFormat,u=e.imagesURLMap,c=e.backgroundColor,d=e.mode,l=e.showTilesBorders,h=e.minimumZoomLevel,b=e.maximumZoomLevel,p=e.preserveDrawingBuffer,f=e.children,_=e.containerProps,g=void 0===_?{}:_,m=e.canvasProps,v=void 0===m?{}:m,w=e.featureFlags,y=void 0===w?{}:w,C=e.startArtboardUUID,F=o(null),P=o(null),I=Oe(),S=I.dispose,R=I.init,E=I.setSettings,M=ze(),L=Ge();a((function(){E({locateFile:i,imagesURLFormat:r,imagesURLMap:u,backgroundColor:c,mode:d,showTilesBorders:l,minimumZoomLevel:h,maximumZoomLevel:b,preserveDrawingBuffer:p,featureFlags:y,startArtboardUUID:C})}),[E,i,r,u,c,d,l,h,b,p,y,C]),a((function(){if(n)return R(n,F.current,P.current),function(){S()}}),[S,R,n]);var D=s((function(){return ut(ut({},Ue),{cursor:M})}),[M]);return t.createElement("div",ut({},g,{ref:P,style:D}),n&&t.createElement("canvas",ut({},v,{key:n,ref:F,"data-testid":"prototype-canvas","data-prototype-status":"prototype-status-".concat((null==L?void 0:L.type.toLowerCase())||"null"),style:Ze})),"READY"===(null==L?void 0:L.type)&&f)};export{Jt as CameraMoveContext,Xt as CameraZoomingContext,Ht as CanvasRenderer,re as CanvasRendererProvider,Se as CanvasRendererReact,te as CursorContext,Rt as DefaultFeatureFlags,Yt as DocumentContext,It as EventEmitter,rt as FileFormat,Gt as GestureManager,zt as KeyboardManager,St as ListenersCollector,Nt as Logger,Qt as PanContext,Ut as Performance,Re as PrototypeRenderer,Ae as PrototypeRendererProvider,Ve as PrototypeRendererReact,Kt as StatusContext,Pt as WebRendererError,Ft as WebRendererMode,$t as ZoomContext,xt as clamp,At as convertEmbindVectorToArray,Dt as debounce,Ot as extractPointer,Tt as getSupportedWebGLVersion,Et as getiOSVersion,Bt as isTouchDevice,jt as logger,Zt as nextTick,Lt as parseSafariUserAgent,oe as reducer,Wt as removeUndefinedKeys,kt as touchableClick,de as useCursor,fe as useDecrementZoom,ae as useDocument,Fe as useEvent,ve as useGenerateDocumentPNG,we as useGetArtboardAtPosititon,ye as useGetPanAtPosition,We as useGoBack,ke as useGoForwards,pe as useIncrementZoom,he as useIsCameraMoving,le as useIsCameraZooming,Ce as useLockCamera,me as useLooseWebGLContext,ce as usePan,ze as usePrototypeCursor,je as usePrototypeEvent,Ne as usePrototypePlayState,Ge as usePrototypeStatus,Be as useRestartPrototype,_e as useSetPan,be as useSetZoom,se as useStatus,ue as useZoom,ge as useZoomToFit};
|
package/dist/module-debug.wasm
CHANGED
|
Binary file
|
package/dist/module-release.wasm
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasRenderer.d.ts","sourceRoot":"","sources":["../../../src/ts/canvas-renderer/CanvasRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EAMjB,WAAW,EAEX,mBAAmB,EAGpB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,YAAY,EACZ,cAAc,EAId,mBAAmB,EAGpB,MAAM,UAAU,CAAA;AAUjB,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,cAAc,CAAA;IACzB,MAAM,EAAE,iBAAiB,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B,IAAI,EAAE,eAAe,CAAA;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAI/B,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAA;IAIlD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,qBAAqB,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IAGtE,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAYD,qBAAa,cAAe,SAAQ,YAAY,CAAC,iBAAiB,CAAC;IACjE,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,MAAM,CAAsC;IACpD,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,uBAAuB,CAAwB;IACvD,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,eAAe,CAAc;IACrC,OAAO,CAAC,kBAAkB,CAAc;IAEjC,cAAc,EAAE,cAAc,CAAA;IAC9B,kBAAkB,EAAG;QAC1B,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,mBAAmB,CAAA;KAC9B,CAAA;gBAEW,QAAQ,EAAE,sBAAsB;IAqC5C,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,kBAAkB,CAMzB;IAEK,wBAAwB;IAcjB,IAAI;IA6BjB,qBAAqB;IAyBd,aAAa;IAQb,cAAc;IAMrB,OAAO,CAAC,cAAc;IA6Ef,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;YAaxB,cAAc;YASd,sBAAsB;IAoD7B,iBAAiB,CAAC,QAAQ,EAAE,OAAO;IAInC,kBAAkB,CAAC,KAAK,EAAE,SAAS;IAa7B,mBAAmB,IAAI,OAAO,CAAC,UAAU,CAAC;IAKvD,OAAO,CAAC,sBAAsB,CAE7B;IAED,OAAO,CAAC,kBAAkB;IAiB1B;;OAEG;IACI,iBAAiB;IAKxB;;;OAGG;IACI,SAAS;IAIhB,oEAAoE;YACtD,OAAO;
|
|
1
|
+
{"version":3,"file":"CanvasRenderer.d.ts","sourceRoot":"","sources":["../../../src/ts/canvas-renderer/CanvasRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EAMjB,WAAW,EAEX,mBAAmB,EAGpB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,YAAY,EACZ,cAAc,EAId,mBAAmB,EAGpB,MAAM,UAAU,CAAA;AAUjB,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,cAAc,CAAA;IACzB,MAAM,EAAE,iBAAiB,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B,IAAI,EAAE,eAAe,CAAA;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAI/B,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAA;IAIlD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,qBAAqB,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IAGtE,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAYD,qBAAa,cAAe,SAAQ,YAAY,CAAC,iBAAiB,CAAC;IACjE,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,MAAM,CAAsC;IACpD,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,uBAAuB,CAAwB;IACvD,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,eAAe,CAAc;IACrC,OAAO,CAAC,kBAAkB,CAAc;IAEjC,cAAc,EAAE,cAAc,CAAA;IAC9B,kBAAkB,EAAG;QAC1B,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,mBAAmB,CAAA;KAC9B,CAAA;gBAEW,QAAQ,EAAE,sBAAsB;IAqC5C,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,kBAAkB,CAMzB;IAEK,wBAAwB;IAcjB,IAAI;IA6BjB,qBAAqB;IAyBd,aAAa;IAQb,cAAc;IAMrB,OAAO,CAAC,cAAc;IA6Ef,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;YAaxB,cAAc;YASd,sBAAsB;IAoD7B,iBAAiB,CAAC,QAAQ,EAAE,OAAO;IAInC,kBAAkB,CAAC,KAAK,EAAE,SAAS;IAa7B,mBAAmB,IAAI,OAAO,CAAC,UAAU,CAAC;IAKvD,OAAO,CAAC,sBAAsB,CAE7B;IAED,OAAO,CAAC,kBAAkB;IAiB1B;;OAEG;IACI,iBAAiB;IAKxB;;;OAGG;IACI,SAAS;IAIhB,oEAAoE;YACtD,OAAO;IA6CrB,OAAO,CAAC,IAAI;IAYZ,OAAO,CAAC,SAAS;IAUjB;;;OAGG;IACI,WAAW;IAqBlB;;;;OAIG;IACI,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAgCjD;;;;OAIG;IACI,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;;;;IAarC,SAAS,IAAI,iBAAiB;IAI9B,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAKxD,MAAM;;;;IAYN,OAAO;IAIP,sBAAsB,eACf,MAAM,UACV;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,UAOjC;IAEM,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,qBAAqB,UAAQ;IA2B1D,gBAAgB,UACd;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,eAClB,WAAW,UAOzB;IAEM,sBAAsB,gBAAiB,WAAW,UAIxD;IAEM,sBAAsB,gBAAiB,WAAW,UAIxD;IAEM,4BAA4B,gBAAiB,WAAW,UAI9D;IAEM,oBAAoB,gBAAiB,WAAW,UAItD;IAEM,OAAO;CAkBf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrototypeRenderer.d.ts","sourceRoot":"","sources":["../../../src/ts/prototype-renderer/PrototypeRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EAIT,WAAW,EAIX,mBAAmB,EAEnB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EAElB,MAAM,UAAU,CAAA;AACjB,OAAO,EAEL,mBAAmB,EACnB,YAAY,EACZ,cAAc,EAKf,MAAM,UAAU,CAAA;AAUjB,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,cAAc,CAAA;IACzB,MAAM,EAAE,iBAAiB,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B,IAAI,EAAE,eAAe,CAAA;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAA;IAGlD,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAWD,qBAAa,iBAAkB,SAAQ,YAAY,CAAC,iBAAiB,CAAC;IACpE,OAAO,CAAC,QAAQ,CAAmC;IACnD,OAAO,CAAC,MAAM,CAAsC;IACpD,OAAO,CAAC,UAAU,CAAY;IAC9B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,UAAU,CAAwB;IAC1C,OAAO,CAAC,uBAAuB,CAAwB;IACvD,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,eAAe,CAAc;IACrC,OAAO,CAAC,kBAAkB,CAAc;IAEjC,kBAAkB,EAAG;QAC1B,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,mBAAmB,CAAA;KAC9B,CAAA;IACM,cAAc,EAAE,cAAc,CAAA;gBAEzB,QAAQ,EAAE,yBAAyB;IAoC/C,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,kBAAkB,CAMzB;IAEK,wBAAwB;IAcjB,IAAI;YA6BH,cAAc;IAS5B,qBAAqB;IAKd,aAAa;IAQb,cAAc;IAMrB,OAAO,CAAC,cAAc;IAgFf,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;YAaxB,cAAc;IAiDrB,iBAAiB,CAAC,QAAQ,EAAE,OAAO;IAInC,kBAAkB,CAAC,KAAK,EAAE,SAAS;IAa1C,OAAO,CAAC,sBAAsB,CAE7B;IAED,OAAO,CAAC,kBAAkB;IAiB1B;;OAEG;IACI,iBAAiB;IAKxB;;;OAGG;IACI,SAAS;IAIhB,oEAAoE;YACtD,OAAO;
|
|
1
|
+
{"version":3,"file":"PrototypeRenderer.d.ts","sourceRoot":"","sources":["../../../src/ts/prototype-renderer/PrototypeRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EAIT,WAAW,EAIX,mBAAmB,EAEnB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EAElB,MAAM,UAAU,CAAA;AACjB,OAAO,EAEL,mBAAmB,EACnB,YAAY,EACZ,cAAc,EAKf,MAAM,UAAU,CAAA;AAUjB,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,cAAc,CAAA;IACzB,MAAM,EAAE,iBAAiB,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B,IAAI,EAAE,eAAe,CAAA;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,gBAAgB,EAAE,MAAM,CAAA;IACxB,gBAAgB,EAAE,MAAM,CAAA;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC,OAAO,mBAAmB,CAAC,CAAA;IAGlD,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAWD,qBAAa,iBAAkB,SAAQ,YAAY,CAAC,iBAAiB,CAAC;IACpE,OAAO,CAAC,QAAQ,CAAmC;IACnD,OAAO,CAAC,MAAM,CAAsC;IACpD,OAAO,CAAC,UAAU,CAAY;IAC9B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,UAAU,CAAwB;IAC1C,OAAO,CAAC,uBAAuB,CAAwB;IACvD,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,eAAe,CAAc;IACrC,OAAO,CAAC,kBAAkB,CAAc;IAEjC,kBAAkB,EAAG;QAC1B,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,mBAAmB,CAAA;KAC9B,CAAA;IACM,cAAc,EAAE,cAAc,CAAA;gBAEzB,QAAQ,EAAE,yBAAyB;IAoC/C,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,kBAAkB,CAMzB;IAEK,wBAAwB;IAcjB,IAAI;YA6BH,cAAc;IAS5B,qBAAqB;IAKd,aAAa;IAQb,cAAc;IAMrB,OAAO,CAAC,cAAc;IAgFf,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;YAaxB,cAAc;IAiDrB,iBAAiB,CAAC,QAAQ,EAAE,OAAO;IAInC,kBAAkB,CAAC,KAAK,EAAE,SAAS;IAa1C,OAAO,CAAC,sBAAsB,CAE7B;IAED,OAAO,CAAC,kBAAkB;IAiB1B;;OAEG;IACI,iBAAiB;IAKxB;;;OAGG;IACI,SAAS;IAIhB,oEAAoE;YACtD,OAAO;IA6CrB,OAAO,CAAC,IAAI;IAYZ,OAAO,CAAC,SAAS;IAUV,SAAS,IAAI,iBAAiB;IAI9B,sBAAsB,eACf,MAAM,UACV;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,UAOjC;IAEM,gBAAgB,UACd;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,eAClB,WAAW,UAOzB;IAEM,sBAAsB,gBAAiB,WAAW,UAIxD;IAEM,sBAAsB,gBAAiB,WAAW,UAIxD;IAEM,4BAA4B,gBAAiB,WAAW,UAI9D;IAEM,oBAAoB,gBAAiB,WAAW,UAItD;IAEM,gBAAgB,iBAAkB,MAAM,UAE9C;IAEM,MAAM,aAEZ;IAEM,UAAU,aAEhB;IAED;;;OAGG;IACI,WAAW;IAqBX,OAAO;CAkBf"}
|
|
@@ -10,7 +10,13 @@ export interface WebRendererEvents {
|
|
|
10
10
|
warnings: (warnings: WebRendererWarning[]) => void;
|
|
11
11
|
metric: (metric: Metric) => void;
|
|
12
12
|
allImagesReady: () => void;
|
|
13
|
-
fileReady: (document: WebRendererDocument,
|
|
13
|
+
fileReady: (document: WebRendererDocument,
|
|
14
|
+
/**
|
|
15
|
+
* A metadata string in the format `ABCD-vX.X.X`, where ABCD is the file
|
|
16
|
+
* identifier in the loaded flatbuffer, and vX.X.X is the version of the
|
|
17
|
+
* web renderer/flatbuffer schema used to parse the file.
|
|
18
|
+
*/
|
|
19
|
+
fileIdentifierAndVersion: string, weightInBytes: number, imagesCount: number) => void;
|
|
14
20
|
deviceInfo: (deviceInfo: DeviceInfo) => void;
|
|
15
21
|
cameraMoveStart: () => void;
|
|
16
22
|
cameraMoveEnd: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Events.d.ts","sourceRoot":"","sources":["../../../src/ts/types/Events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAA;IAC3C,QAAQ,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAA;IAClD,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,SAAS,EAAE,CACT,QAAQ,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"Events.d.ts","sourceRoot":"","sources":["../../../src/ts/types/Events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAA;IAC3C,QAAQ,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAA;IAClD,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,SAAS,EAAE,CACT,QAAQ,EAAE,mBAAmB;IAC7B;;;;OAIG;IACH,wBAAwB,EAAE,MAAM,EAChC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,KAChB,IAAI,CAAA;IACT,UAAU,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAA;IAC5C,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC/C,YAAY,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAA;IACzC,eAAe,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAA;CAC7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../../../src/ts/utils/featureFlags.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;
|
|
1
|
+
{"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../../../src/ts/utils/featureFlags.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;CAO/B,CAAA;AAED,oBAAY,kBAAkB,GAAG,OAAO,mBAAmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sketch-hq/sketch-web-renderer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Sketch Web Renderer",
|
|
6
6
|
"repository": "git@github.com:sketch-hq/web-renderer",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@rollup/plugin-replace": "5.0.1",
|
|
53
53
|
"@rollup/plugin-terser": "0.1.0",
|
|
54
54
|
"@rollup/plugin-typescript": "9.0.2",
|
|
55
|
-
"@sketch-hq/sketch-file-format-marina": "
|
|
55
|
+
"@sketch-hq/sketch-file-format-marina": "5.0.0",
|
|
56
56
|
"@sketch-hq/sketch-presentation-file-format": "0.11.1",
|
|
57
57
|
"@types/jest": "29.2.2",
|
|
58
58
|
"@types/node": "18.11.9",
|