@cloudcare/browser-rum 3.3.1 → 3.3.3

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.
Files changed (73) hide show
  1. package/bundle/dataflux-rum.js +1 -1
  2. package/cjs/boot/buildEnv.js +1 -1
  3. package/cjs/boot/perStartRum.js +11 -7
  4. package/cjs/boot/perStartRum.js.map +1 -1
  5. package/cjs/boot/recorderApi.js +2 -49
  6. package/cjs/boot/recorderApi.js.map +1 -1
  7. package/cjs/boot/recorderApiStub.js +53 -0
  8. package/cjs/boot/recorderApiStub.js.map +1 -0
  9. package/cjs/boot/rum.entry.js +6 -7
  10. package/cjs/boot/rum.entry.js.map +1 -1
  11. package/cjs/boot/rum.slim.entry.js +13 -0
  12. package/cjs/boot/rum.slim.entry.js.map +1 -0
  13. package/cjs/boot/rumEntryFactory.js +15 -0
  14. package/cjs/boot/rumEntryFactory.js.map +1 -0
  15. package/cjs/boot/rumPublicApi.js +8 -57
  16. package/cjs/boot/rumPublicApi.js.map +1 -1
  17. package/cjs/boot/rumRecorderApiStub.js +19 -0
  18. package/cjs/boot/rumRecorderApiStub.js.map +1 -0
  19. package/cjs/boot/rumSlimConfiguration.js +16 -0
  20. package/cjs/boot/rumSlimConfiguration.js.map +1 -0
  21. package/cjs/boot/sessionReplayPublicApi.js +62 -0
  22. package/cjs/boot/sessionReplayPublicApi.js.map +1 -0
  23. package/cjs/domain/deflate/deflateEncoder.js +2 -4
  24. package/cjs/domain/deflate/deflateEncoder.js.map +1 -1
  25. package/cjs/domain/deflate/deflateWorker.js +1 -1
  26. package/cjs/domain/encoderStreamId.js +11 -0
  27. package/cjs/domain/encoderStreamId.js.map +1 -0
  28. package/cjs/domain/replay/record/canvasEncodeWorker.js +1 -1
  29. package/cjs/transport/startRumBatch.js +2 -2
  30. package/cjs/transport/startRumBatch.js.map +1 -1
  31. package/esm/boot/buildEnv.js +1 -1
  32. package/esm/boot/perStartRum.js +11 -7
  33. package/esm/boot/perStartRum.js.map +1 -1
  34. package/esm/boot/recorderApi.js +2 -49
  35. package/esm/boot/recorderApi.js.map +1 -1
  36. package/esm/boot/recorderApiStub.js +47 -0
  37. package/esm/boot/recorderApiStub.js.map +1 -0
  38. package/esm/boot/rum.entry.js +6 -7
  39. package/esm/boot/rum.entry.js.map +1 -1
  40. package/esm/boot/rum.slim.entry.js +7 -0
  41. package/esm/boot/rum.slim.entry.js.map +1 -0
  42. package/esm/boot/rumEntryFactory.js +9 -0
  43. package/esm/boot/rumEntryFactory.js.map +1 -0
  44. package/esm/boot/rumPublicApi.js +8 -57
  45. package/esm/boot/rumPublicApi.js.map +1 -1
  46. package/esm/boot/rumRecorderApiStub.js +13 -0
  47. package/esm/boot/rumRecorderApiStub.js.map +1 -0
  48. package/esm/boot/rumSlimConfiguration.js +10 -0
  49. package/esm/boot/rumSlimConfiguration.js.map +1 -0
  50. package/esm/boot/sessionReplayPublicApi.js +56 -0
  51. package/esm/boot/sessionReplayPublicApi.js.map +1 -0
  52. package/esm/domain/deflate/deflateEncoder.js +2 -4
  53. package/esm/domain/deflate/deflateEncoder.js.map +1 -1
  54. package/esm/domain/deflate/deflateWorker.js +1 -1
  55. package/esm/domain/encoderStreamId.js +5 -0
  56. package/esm/domain/encoderStreamId.js.map +1 -0
  57. package/esm/domain/replay/record/canvasEncodeWorker.js +1 -1
  58. package/esm/transport/startRumBatch.js +2 -2
  59. package/esm/transport/startRumBatch.js.map +1 -1
  60. package/package.json +2 -2
  61. package/src/boot/perStartRum.js +11 -7
  62. package/src/boot/recorderApi.js +2 -49
  63. package/src/boot/recorderApiStub.js +47 -0
  64. package/src/boot/rum.entry.js +6 -8
  65. package/src/boot/rum.slim.entry.js +7 -0
  66. package/src/boot/rumEntryFactory.js +10 -0
  67. package/src/boot/rumPublicApi.js +14 -57
  68. package/src/boot/rumRecorderApiStub.js +14 -0
  69. package/src/boot/rumSlimConfiguration.js +11 -0
  70. package/src/boot/sessionReplayPublicApi.js +57 -0
  71. package/src/domain/deflate/deflateEncoder.js +2 -4
  72. package/src/domain/encoderStreamId.js +5 -0
  73. package/src/transport/startRumBatch.js +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"rumPublicApi.js","names":["_browserCore","require","_commonContext","_perStartRum","_resourceTrackerManager","_typeof","o","Symbol","iterator","constructor","prototype","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","createCustomerDataTrackerManager","CustomerDataCompressionStatus","Unknown","resourceTrackerManager","createResourceTrackerManager","globalContextManager","createContextManager","customerDataTracker","getOrCreateTracker","CustomerDataType","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","buildCommonContext","strategy","createPreStartStrategy","assign","configuration","deflateWorker","initialViewOptions","storeContextsToLocal","storeContextManager","setCompressionStatus","Enabled","Disabled","startRumResult","createDeflateEncoder","streamId","createIdentityEncoder","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","monitor","sanitizedOptions","context","View","updateCustomerData","addTelemetryUsage","feature","rumPublicApi","makePublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","deepClone","getRemoteConfiguration","callback","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addResource","handlingStack","createHandlingStack","callMonitored","sanitize","startClocks","clocksNow","ResourceType","CUSTOM","addTypeAction","sourceType","addAction","getType","ActionType","addError","error","addTiming","time","setUser","newUser","checkUser","sanitizeUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","setForcedSession","startSessionReplayRecording","start","force","isRecording","stopSessionReplayRecording","stop","takeSubsequentFullSnapshot","snapshotCanvas","canvas","getSerializedNodeIdForDebug","node","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastDomMutationForDebug","getDomMutationHistoryForDebug","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","getReplayPerformanceForDebug","flushReplayMutationsForDebug","createResourceTrackerId","createTrackerId","setResourceContext","trackerId","appendResourceContext","finishResource","getResource","preStartStrategy","displayAlreadyInitializedError"],"sources":["../../src/boot/rumPublicApi.js"],"sourcesContent":["import {\n makePublicApi,\n createContextManager,\n CustomerDataType,\n clocksNow,\n ActionType,\n ResourceType,\n deepClone,\n createHandlingStack,\n sanitizeUser,\n checkUser,\n callMonitored,\n assign,\n monitor,\n storeContextManager,\n createIdentityEncoder,\n addTelemetryUsage,\n sanitize,\n createCustomerDataTrackerManager,\n CustomerDataCompressionStatus,\n displayAlreadyInitializedError,\n getType\n} from '@cloudcare/browser-core'\nimport { buildCommonContext } from '../domain/contexts/commonContext'\nimport { createPreStartStrategy } from './perStartRum'\nimport { createResourceTrackerManager } from '../domain/rumEventsCollection/resource/resourceTrackerManager'\nvar RUM_STORAGE_KEY = 'rum'\nexport function makeRumPublicApi(startRumImpl, recorderApi, options) {\n if (options === undefined) {\n options = {}\n }\n const customerDataTrackerManager = createCustomerDataTrackerManager(\n CustomerDataCompressionStatus.Unknown\n )\n const resourceTrackerManager = createResourceTrackerManager()\n const globalContextManager = createContextManager('global', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.GlobalContext\n )\n })\n const userContextManager = createContextManager('user', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.User\n ),\n propertiesConfig: {\n id: { type: 'string' },\n name: { type: 'string' },\n email: { type: 'string' }\n }\n })\n function getCommonContext() {\n return buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n let strategy = createPreStartStrategy(\n assign({}, options, {\n resourceTrackerManager: resourceTrackerManager\n }),\n getCommonContext,\n function (configuration, deflateWorker, initialViewOptions) {\n if (configuration.storeContextsToLocal) {\n storeContextManager(\n configuration,\n globalContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.GlobalContext\n )\n storeContextManager(\n configuration,\n userContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.User\n )\n }\n customerDataTrackerManager.setCompressionStatus(\n deflateWorker\n ? CustomerDataCompressionStatus.Enabled\n : CustomerDataCompressionStatus.Disabled\n )\n var startRumResult = startRumImpl(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n deflateWorker && options.createDeflateEncoder\n ? function (streamId) {\n return options.createDeflateEncoder(deflateWorker, streamId)\n }\n : createIdentityEncoder,\n resourceTrackerManager\n )\n recorderApi.onRumStart(\n startRumResult.lifeCycle,\n configuration,\n startRumResult.session,\n startRumResult.viewContexts,\n deflateWorker\n )\n\n strategy = createPostStartStrategy(strategy, startRumResult)\n\n return startRumResult\n }\n )\n\n const startView = monitor(function (options) {\n const sanitizedOptions =\n typeof options === 'object' ? options : { name: options }\n strategy.startView(sanitizedOptions)\n if (sanitizedOptions.context) {\n customerDataTrackerManager\n .getOrCreateTracker(CustomerDataType.View)\n .updateCustomerData(sanitizedOptions.context)\n }\n addTelemetryUsage({ feature: 'start-view' })\n })\n\n var rumPublicApi = makePublicApi({\n init: monitor(function (initConfiguration) {\n strategy.init(initConfiguration)\n }),\n setViewName: monitor((name) => {\n strategy.setViewName(name)\n addTelemetryUsage({ feature: 'set-view-name' })\n }),\n\n setViewContext: monitor((context) => {\n strategy.setViewContext(context)\n addTelemetryUsage({ feature: 'set-view-context' })\n }),\n\n setViewContextProperty: monitor((key, value) => {\n strategy.setViewContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-view-context-property' })\n }),\n\n getViewContext: monitor(() => {\n addTelemetryUsage({ feature: 'set-view-context-property' })\n return strategy.getViewContext()\n }),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContextProperty: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n removeGlobalContextProperty: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n getGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n clearGlobalContext: monitor(function () {\n return globalContextManager.clearContext()\n }),\n\n getInitConfiguration: monitor(function () {\n return deepClone(strategy.initConfiguration)\n }),\n getRemoteConfiguration: monitor(function (callback) {\n return strategy.getRemoteConfiguration(callback)\n }),\n getInternalContext: monitor(function (startTime) {\n return strategy.getInternalContext(startTime)\n }),\n addDebugSession: monitor(function (id) {}),\n clearDebugSession: monitor(function () {}),\n getDebugSession: monitor(function () {}),\n addResource: monitor(function (context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addResource({\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ResourceType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-resource' })\n })\n }),\n addTypeAction: monitor(function (name, type, context) {\n const handlingStack = createHandlingStack()\n\n callMonitored(function () {\n const sourceType = sanitize(type)\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type:\n getType(sourceType) === 'string' ? sourceType : ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-type-action' })\n })\n }),\n addAction: monitor(function (name, context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-action' })\n })\n }),\n addError: monitor(function (error, context) {\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addError({\n error, // Do not sanitize error here, it is needed unserialized by computeRawError()\n handlingStack,\n context: sanitize(context),\n startClocks: clocksNow()\n })\n addTelemetryUsage({ feature: 'add-error' })\n })\n }),\n addTiming: monitor(function (name, time) {\n strategy.addTiming(sanitize(name), time)\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser))\n }\n addTelemetryUsage({ feature: 'set-user' })\n }),\n getUser: monitor(function () {\n return userContextManager.getContext()\n }),\n setUserProperty: monitor(function (key, property) {\n var newUser = {}\n newUser[key] = property\n var sanitizedProperty = sanitizeUser(newUser)[key]\n userContextManager.setContextProperty(key, sanitizedProperty)\n addTelemetryUsage({ feature: 'set-user' })\n }),\n removeUserProperty: monitor(function (key) {\n return userContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n clearUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n startView: startView,\n stopSession: monitor(function () {\n strategy.stopSession()\n addTelemetryUsage({ feature: 'stop-session' })\n }),\n setForcedSession: monitor(function () {\n strategy.setForcedSession()\n addTelemetryUsage({ feature: 'set-forced-session' })\n }),\n startSessionReplayRecording: monitor(function (options) {\n recorderApi.start(options)\n addTelemetryUsage({\n feature: 'start-session-replay-recording',\n force: options && options.force\n })\n }),\n isRecording: monitor(function () {\n return recorderApi.isRecording()\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop),\n takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot),\n snapshotCanvas: monitor(function (canvas, options) {\n return recorderApi.snapshotCanvas(canvas, options)\n }),\n getSerializedNodeIdForDebug: monitor(function (node) {\n return recorderApi.getSerializedNodeIdForDebug(node)\n }),\n getLastAutoCanvasSnapshotResultForDebug: monitor(function () {\n return recorderApi.getLastAutoCanvasSnapshotResultForDebug()\n }),\n getAutoCanvasSnapshotDebugHistoryForDebug: monitor(function () {\n return recorderApi.getAutoCanvasSnapshotDebugHistoryForDebug()\n }),\n getLastCanvasMutationForDebug: monitor(function () {\n return recorderApi.getLastCanvasMutationForDebug()\n }),\n getCanvasMutationHistoryForDebug: monitor(function () {\n return recorderApi.getCanvasMutationHistoryForDebug()\n }),\n getLastDomMutationForDebug: monitor(function () {\n return recorderApi.getLastDomMutationForDebug()\n }),\n getDomMutationHistoryForDebug: monitor(function () {\n return recorderApi.getDomMutationHistoryForDebug()\n }),\n getLastReplaySegmentFlushForDebug: monitor(function () {\n return recorderApi.getLastReplaySegmentFlushForDebug()\n }),\n getReplaySegmentFlushHistoryForDebug: monitor(function () {\n return recorderApi.getReplaySegmentFlushHistoryForDebug()\n }),\n getReplayPerformanceForDebug: monitor(function () {\n return recorderApi.getReplayPerformanceForDebug()\n }),\n flushReplayMutationsForDebug: monitor(function () {\n if (recorderApi.flushReplayMutationsForDebug) {\n recorderApi.flushReplayMutationsForDebug()\n }\n }),\n createResourceTrackerId: monitor(function () {\n return resourceTrackerManager.createTrackerId()\n }),\n setResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.setResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n appendResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.appendResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n finishResource: monitor(function (trackerId) {\n return resourceTrackerManager.finishResource(trackerId)\n }),\n getResource: monitor(function (trackerId) {\n return resourceTrackerManager.getResource(trackerId)\n })\n })\n return rumPublicApi\n}\nfunction createPostStartStrategy(preStartStrategy, startRumResult) {\n return assign(\n {\n init: function (initConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n },\n initConfiguration: preStartStrategy.getInitConfiguration(),\n getRemoteConfiguration: function (callback) {\n preStartStrategy.getRemoteConfiguration(callback)\n }\n },\n startRumResult\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAuBA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAH,OAAA;AAA4G,SAAAI,QAAAC,CAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,CAAA,kBAAAA,CAAA,gBAAAA,CAAA,WAAAA,CAAA,yBAAAC,MAAA,IAAAD,CAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,CAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,CAAA,KAAAD,OAAA,CAAAC,CAAA;AAC5G,IAAIK,eAAe,GAAG,KAAK;AACpB,SAASC,gBAAgBA,CAACC,YAAY,EAAEC,WAAW,EAAEC,OAAO,EAAE;EACnE,IAAIA,OAAO,KAAKC,SAAS,EAAE;IACzBD,OAAO,GAAG,CAAC,CAAC;EACd;EACA,IAAME,0BAA0B,GAAG,IAAAC,6CAAgC,EACjEC,0CAA6B,CAACC,OAChC,CAAC;EACD,IAAMC,sBAAsB,GAAG,IAAAC,oDAA4B,EAAC,CAAC;EAC7D,IAAMC,oBAAoB,GAAG,IAAAC,iCAAoB,EAAC,QAAQ,EAAE;IAC1DC,mBAAmB,EAAER,0BAA0B,CAACS,kBAAkB,CAChEC,6BAAgB,CAACC,aACnB;EACF,CAAC,CAAC;EACF,IAAMC,kBAAkB,GAAG,IAAAL,iCAAoB,EAAC,MAAM,EAAE;IACtDC,mBAAmB,EAAER,0BAA0B,CAACS,kBAAkB,CAChEC,6BAAgB,CAACG,IACnB,CAAC;IACDC,gBAAgB,EAAE;MAChBC,EAAE,EAAE;Q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qBAAQ,EAAC1C,OAAO,CAClB,CAAC;IACH,CAAC,CAAC;IACF8F,qBAAqB,EAAE,IAAAhG,oBAAO,EAAC,UAAU+F,SAAS,EAAE7F,OAAO,EAAE;MAC3D,OAAOxC,sBAAsB,CAACsI,qBAAqB,CACjDD,SAAS,EACT,IAAAnD,qBAAQ,EAAC1C,OAAO,CAClB,CAAC;IACH,CAAC,CAAC;IACF+F,cAAc,EAAE,IAAAjG,oBAAO,EAAC,UAAU+F,SAAS,EAAE;MAC3C,OAAOrI,sBAAsB,CAACuI,cAAc,CAACF,SAAS,CAAC;IACzD,CAAC,CAAC;IACFG,WAAW,EAAE,IAAAlG,oBAAO,EAAC,UAAU+F,SAAS,EAAE;MACxC,OAAOrI,sBAAsB,CAACwI,WAAW,CAACH,SAAS,CAAC;IACtD,CAAC;EACH,CAAC,CAAC;EACF,OAAOxF,YAAY;AACrB;AACA,SAAST,uBAAuBA,CAACqG,gBAAgB,EAAE7G,cAAc,EAAE;EACjE,OAAO,IAAAT,mBAAM,EACX;IACE4B,IAAI,EAAE,SAANA,IAAIA,CAAYC,iBAAiB,EAAE;MACjC,IAAA0F,2CAA8B,EAAC,cAAc,EAAE1F,iBAAiB,CAAC;IACnE,CAAC;IACDA,iBAAiB,EAAEyF,gBAAgB,CAACpE,oBAAoB,CAAC,CAAC;IAC1DE,sBAAsB,EAAE,SAAxBA,sBAAsBA,CAAYC,QAAQ,EAAE;MAC1CiE,gBAAgB,CAAClE,sBAAsB,CAACC,QAAQ,CAAC;IACnD;EACF,CAAC,EACD5C,cACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"rumPublicApi.js","names":["_browserCore","require","_commonContext","_perStartRum","_resourceTrackerManager","_typeof","o","Symbol","iterator","constructor","prototype","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","createCustomerDataTrackerManager","CustomerDataCompressionStatus","Unknown","resourceTrackerManager","createResourceTrackerManager","globalContextManager","createContextManager","customerDataTracker","getOrCreateTracker","CustomerDataType","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","buildCommonContext","strategy","createPreStartStrategy","assign","configuration","compressionWorker","initialViewOptions","storeContextsToLocal","storeContextManager","setCompressionStatus","Enabled","Disabled","startRumResult","createCompressionEncoder","streamId","createIdentityEncoder","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","monitor","sanitizedOptions","context","View","updateCustomerData","addTelemetryUsage","feature","recorderPublicApi","makeRecorderPublicApi","rumPublicApi","makePublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","deepClone","getRemoteConfiguration","callback","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addResource","handlingStack","createHandlingStack","callMonitored","sanitize","startClocks","clocksNow","ResourceType","CUSTOM","addTypeAction","sourceType","addAction","getType","ActionType","addError","error","addTiming","time","setUser","newUser","checkUser","sanitizeUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","setForcedSession","createResourceTrackerId","createTrackerId","setResourceContext","trackerId","appendResourceContext","finishResource","getResource","preStartStrategy","displayAlreadyInitializedError"],"sources":["../../src/boot/rumPublicApi.js"],"sourcesContent":["import {\n makePublicApi,\n createContextManager,\n CustomerDataType,\n clocksNow,\n ActionType,\n ResourceType,\n deepClone,\n createHandlingStack,\n sanitizeUser,\n checkUser,\n callMonitored,\n assign,\n monitor,\n storeContextManager,\n createIdentityEncoder,\n addTelemetryUsage,\n sanitize,\n createCustomerDataTrackerManager,\n CustomerDataCompressionStatus,\n displayAlreadyInitializedError,\n getType\n} from '@cloudcare/browser-core'\nimport { buildCommonContext } from '../domain/contexts/commonContext'\nimport { createPreStartStrategy } from './perStartRum'\nimport { createResourceTrackerManager } from '../domain/rumEventsCollection/resource/resourceTrackerManager'\nvar RUM_STORAGE_KEY = 'rum'\nexport function makeRumPublicApi(startRumImpl, recorderApi, options) {\n if (options === undefined) {\n options = {}\n }\n const customerDataTrackerManager = createCustomerDataTrackerManager(\n CustomerDataCompressionStatus.Unknown\n )\n const resourceTrackerManager = createResourceTrackerManager()\n const globalContextManager = createContextManager('global', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.GlobalContext\n )\n })\n const userContextManager = createContextManager('user', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.User\n ),\n propertiesConfig: {\n id: { type: 'string' },\n name: { type: 'string' },\n email: { type: 'string' }\n }\n })\n function getCommonContext() {\n return buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n let strategy = createPreStartStrategy(\n assign({}, options, {\n resourceTrackerManager: resourceTrackerManager\n }),\n getCommonContext,\n function (configuration, compressionWorker, initialViewOptions) {\n if (configuration.storeContextsToLocal) {\n storeContextManager(\n configuration,\n globalContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.GlobalContext\n )\n storeContextManager(\n configuration,\n userContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.User\n )\n }\n customerDataTrackerManager.setCompressionStatus(\n compressionWorker\n ? CustomerDataCompressionStatus.Enabled\n : CustomerDataCompressionStatus.Disabled\n )\n var startRumResult = startRumImpl(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n compressionWorker && options.createCompressionEncoder\n ? function (streamId) {\n return options.createCompressionEncoder(\n compressionWorker,\n streamId\n )\n }\n : createIdentityEncoder,\n resourceTrackerManager\n )\n recorderApi.onRumStart(\n startRumResult.lifeCycle,\n configuration,\n startRumResult.session,\n startRumResult.viewContexts,\n compressionWorker\n )\n\n strategy = createPostStartStrategy(strategy, startRumResult)\n\n return startRumResult\n }\n )\n\n const startView = monitor(function (options) {\n const sanitizedOptions =\n typeof options === 'object' ? options : { name: options }\n strategy.startView(sanitizedOptions)\n if (sanitizedOptions.context) {\n customerDataTrackerManager\n .getOrCreateTracker(CustomerDataType.View)\n .updateCustomerData(sanitizedOptions.context)\n }\n addTelemetryUsage({ feature: 'start-view' })\n })\n\n const recorderPublicApi = options.makeRecorderPublicApi\n ? options.makeRecorderPublicApi(recorderApi)\n : {}\n\n var rumPublicApi = makePublicApi(assign({\n init: monitor(function (initConfiguration) {\n strategy.init(initConfiguration)\n }),\n setViewName: monitor((name) => {\n strategy.setViewName(name)\n addTelemetryUsage({ feature: 'set-view-name' })\n }),\n\n setViewContext: monitor((context) => {\n strategy.setViewContext(context)\n addTelemetryUsage({ feature: 'set-view-context' })\n }),\n\n setViewContextProperty: monitor((key, value) => {\n strategy.setViewContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-view-context-property' })\n }),\n\n getViewContext: monitor(() => {\n addTelemetryUsage({ feature: 'set-view-context-property' })\n return strategy.getViewContext()\n }),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContextProperty: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n removeGlobalContextProperty: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n getGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n clearGlobalContext: monitor(function () {\n return globalContextManager.clearContext()\n }),\n\n getInitConfiguration: monitor(function () {\n return deepClone(strategy.initConfiguration)\n }),\n getRemoteConfiguration: monitor(function (callback) {\n return strategy.getRemoteConfiguration(callback)\n }),\n getInternalContext: monitor(function (startTime) {\n return strategy.getInternalContext(startTime)\n }),\n addDebugSession: monitor(function (id) {}),\n clearDebugSession: monitor(function () {}),\n getDebugSession: monitor(function () {}),\n addResource: monitor(function (context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addResource({\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ResourceType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-resource' })\n })\n }),\n addTypeAction: monitor(function (name, type, context) {\n const handlingStack = createHandlingStack()\n\n callMonitored(function () {\n const sourceType = sanitize(type)\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type:\n getType(sourceType) === 'string' ? sourceType : ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-type-action' })\n })\n }),\n addAction: monitor(function (name, context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-action' })\n })\n }),\n addError: monitor(function (error, context) {\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addError({\n error, // Do not sanitize error here, it is needed unserialized by computeRawError()\n handlingStack,\n context: sanitize(context),\n startClocks: clocksNow()\n })\n addTelemetryUsage({ feature: 'add-error' })\n })\n }),\n addTiming: monitor(function (name, time) {\n strategy.addTiming(sanitize(name), time)\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser))\n }\n addTelemetryUsage({ feature: 'set-user' })\n }),\n getUser: monitor(function () {\n return userContextManager.getContext()\n }),\n setUserProperty: monitor(function (key, property) {\n var newUser = {}\n newUser[key] = property\n var sanitizedProperty = sanitizeUser(newUser)[key]\n userContextManager.setContextProperty(key, sanitizedProperty)\n addTelemetryUsage({ feature: 'set-user' })\n }),\n removeUserProperty: monitor(function (key) {\n return userContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n clearUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n startView: startView,\n stopSession: monitor(function () {\n strategy.stopSession()\n addTelemetryUsage({ feature: 'stop-session' })\n }),\n setForcedSession: monitor(function () {\n strategy.setForcedSession()\n addTelemetryUsage({ feature: 'set-forced-session' })\n }),\n createResourceTrackerId: monitor(function () {\n return resourceTrackerManager.createTrackerId()\n }),\n setResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.setResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n appendResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.appendResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n finishResource: monitor(function (trackerId) {\n return resourceTrackerManager.finishResource(trackerId)\n }),\n getResource: monitor(function (trackerId) {\n return resourceTrackerManager.getResource(trackerId)\n })\n }, recorderPublicApi))\n return rumPublicApi\n}\nfunction createPostStartStrategy(preStartStrategy, startRumResult) {\n return assign(\n {\n init: function (initConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n },\n initConfiguration: preStartStrategy.getInitConfiguration(),\n getRemoteConfiguration: function (callback) {\n preStartStrategy.getRemoteConfiguration(callback)\n }\n },\n startRumResult\n )\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAuBA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAH,OAAA;AAA4G,SAAAI,QAAAC,CAAA,sCAAAD,OAAA,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AAC;IACnD;EACF,CAAC,EACD9C,cACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.makeRumRecorderApiStub = makeRumRecorderApiStub;
7
+ var _browserCore = require("@cloudcare/browser-core");
8
+ function makeRumRecorderApiStub() {
9
+ return {
10
+ getReplayStats: function getReplayStats() {
11
+ return undefined;
12
+ },
13
+ onRumStart: _browserCore.noop,
14
+ isRecording: function isRecording() {
15
+ return false;
16
+ }
17
+ };
18
+ }
19
+ //# sourceMappingURL=rumRecorderApiStub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rumRecorderApiStub.js","names":["_browserCore","require","makeRumRecorderApiStub","getReplayStats","undefined","onRumStart","noop","isRecording"],"sources":["../../src/boot/rumRecorderApiStub.js"],"sourcesContent":["import { noop } from '@cloudcare/browser-core'\n\nexport function makeRumRecorderApiStub() {\n return {\n getReplayStats: function () {\n return undefined\n },\n onRumStart: noop,\n isRecording: function () {\n return false\n }\n }\n}\n\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,SAASC,sBAAsBA,CAAA,EAAG;EACvC,OAAO;IACLC,cAAc,EAAE,SAAhBA,cAAcA,CAAA,EAAc;MAC1B,OAAOC,SAAS;IAClB,CAAC;IACDC,UAAU,EAAEC,iBAAI;IAChBC,WAAW,EAAE,SAAbA,WAAWA,CAAA,EAAc;MACvB,OAAO,KAAK;IACd;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.forceRumSlimConfiguration = forceRumSlimConfiguration;
7
+ var _browserCore = require("@cloudcare/browser-core");
8
+ function forceRumSlimConfiguration(initConfiguration) {
9
+ return (0, _browserCore.assign)({}, initConfiguration, {
10
+ sessionReplaySampleRate: 0,
11
+ sessionReplayOnErrorSampleRate: 0,
12
+ replayCanvasEnabled: false,
13
+ compressIntakeRequests: false
14
+ });
15
+ }
16
+ //# sourceMappingURL=rumSlimConfiguration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rumSlimConfiguration.js","names":["_browserCore","require","forceRumSlimConfiguration","initConfiguration","assign","sessionReplaySampleRate","sessionReplayOnErrorSampleRate","replayCanvasEnabled","compressIntakeRequests"],"sources":["../../src/boot/rumSlimConfiguration.js"],"sourcesContent":["import { assign } from '@cloudcare/browser-core'\n\nexport function forceRumSlimConfiguration(initConfiguration) {\n return assign({}, initConfiguration, {\n sessionReplaySampleRate: 0,\n sessionReplayOnErrorSampleRate: 0,\n replayCanvasEnabled: false,\n compressIntakeRequests: false\n })\n}\n\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,SAASC,yBAAyBA,CAACC,iBAAiB,EAAE;EAC3D,OAAO,IAAAC,mBAAM,EAAC,CAAC,CAAC,EAAED,iBAAiB,EAAE;IACnCE,uBAAuB,EAAE,CAAC;IAC1BC,8BAA8B,EAAE,CAAC;IACjCC,mBAAmB,EAAE,KAAK;IAC1BC,sBAAsB,EAAE;EAC1B,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.makeSessionReplayPublicApi = makeSessionReplayPublicApi;
7
+ var _browserCore = require("@cloudcare/browser-core");
8
+ function makeSessionReplayPublicApi(recorderApi) {
9
+ return {
10
+ startSessionReplayRecording: (0, _browserCore.monitor)(function (options) {
11
+ recorderApi.start(options);
12
+ (0, _browserCore.addTelemetryUsage)({
13
+ feature: 'start-session-replay-recording',
14
+ force: options && options.force
15
+ });
16
+ }),
17
+ isRecording: (0, _browserCore.monitor)(function () {
18
+ return recorderApi.isRecording();
19
+ }),
20
+ stopSessionReplayRecording: (0, _browserCore.monitor)(recorderApi.stop),
21
+ takeSubsequentFullSnapshot: (0, _browserCore.monitor)(recorderApi.takeSubsequentFullSnapshot),
22
+ snapshotCanvas: (0, _browserCore.monitor)(function (canvas, options) {
23
+ return recorderApi.snapshotCanvas(canvas, options);
24
+ }),
25
+ getSerializedNodeIdForDebug: (0, _browserCore.monitor)(function (node) {
26
+ return recorderApi.getSerializedNodeIdForDebug(node);
27
+ }),
28
+ getLastAutoCanvasSnapshotResultForDebug: (0, _browserCore.monitor)(function () {
29
+ return recorderApi.getLastAutoCanvasSnapshotResultForDebug();
30
+ }),
31
+ getAutoCanvasSnapshotDebugHistoryForDebug: (0, _browserCore.monitor)(function () {
32
+ return recorderApi.getAutoCanvasSnapshotDebugHistoryForDebug();
33
+ }),
34
+ getLastCanvasMutationForDebug: (0, _browserCore.monitor)(function () {
35
+ return recorderApi.getLastCanvasMutationForDebug();
36
+ }),
37
+ getCanvasMutationHistoryForDebug: (0, _browserCore.monitor)(function () {
38
+ return recorderApi.getCanvasMutationHistoryForDebug();
39
+ }),
40
+ getLastDomMutationForDebug: (0, _browserCore.monitor)(function () {
41
+ return recorderApi.getLastDomMutationForDebug();
42
+ }),
43
+ getDomMutationHistoryForDebug: (0, _browserCore.monitor)(function () {
44
+ return recorderApi.getDomMutationHistoryForDebug();
45
+ }),
46
+ getLastReplaySegmentFlushForDebug: (0, _browserCore.monitor)(function () {
47
+ return recorderApi.getLastReplaySegmentFlushForDebug();
48
+ }),
49
+ getReplaySegmentFlushHistoryForDebug: (0, _browserCore.monitor)(function () {
50
+ return recorderApi.getReplaySegmentFlushHistoryForDebug();
51
+ }),
52
+ getReplayPerformanceForDebug: (0, _browserCore.monitor)(function () {
53
+ return recorderApi.getReplayPerformanceForDebug();
54
+ }),
55
+ flushReplayMutationsForDebug: (0, _browserCore.monitor)(function () {
56
+ if (recorderApi.flushReplayMutationsForDebug) {
57
+ recorderApi.flushReplayMutationsForDebug();
58
+ }
59
+ })
60
+ };
61
+ }
62
+ //# sourceMappingURL=sessionReplayPublicApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionReplayPublicApi.js","names":["_browserCore","require","makeSessionReplayPublicApi","recorderApi","startSessionReplayRecording","monitor","options","start","addTelemetryUsage","feature","force","isRecording","stopSessionReplayRecording","stop","takeSubsequentFullSnapshot","snapshotCanvas","canvas","getSerializedNodeIdForDebug","node","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastDomMutationForDebug","getDomMutationHistoryForDebug","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","getReplayPerformanceForDebug","flushReplayMutationsForDebug"],"sources":["../../src/boot/sessionReplayPublicApi.js"],"sourcesContent":["import { addTelemetryUsage, monitor } from '@cloudcare/browser-core'\n\nexport function makeSessionReplayPublicApi(recorderApi) {\n return {\n startSessionReplayRecording: monitor(function (options) {\n recorderApi.start(options)\n addTelemetryUsage({\n feature: 'start-session-replay-recording',\n force: options && options.force\n })\n }),\n isRecording: monitor(function () {\n return recorderApi.isRecording()\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop),\n takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot),\n snapshotCanvas: monitor(function (canvas, options) {\n return recorderApi.snapshotCanvas(canvas, options)\n }),\n getSerializedNodeIdForDebug: monitor(function (node) {\n return recorderApi.getSerializedNodeIdForDebug(node)\n }),\n getLastAutoCanvasSnapshotResultForDebug: monitor(function () {\n return recorderApi.getLastAutoCanvasSnapshotResultForDebug()\n }),\n getAutoCanvasSnapshotDebugHistoryForDebug: monitor(function () {\n return recorderApi.getAutoCanvasSnapshotDebugHistoryForDebug()\n }),\n getLastCanvasMutationForDebug: monitor(function () {\n return recorderApi.getLastCanvasMutationForDebug()\n }),\n getCanvasMutationHistoryForDebug: monitor(function () {\n return recorderApi.getCanvasMutationHistoryForDebug()\n }),\n getLastDomMutationForDebug: monitor(function () {\n return recorderApi.getLastDomMutationForDebug()\n }),\n getDomMutationHistoryForDebug: monitor(function () {\n return recorderApi.getDomMutationHistoryForDebug()\n }),\n getLastReplaySegmentFlushForDebug: monitor(function () {\n return recorderApi.getLastReplaySegmentFlushForDebug()\n }),\n getReplaySegmentFlushHistoryForDebug: monitor(function () {\n return recorderApi.getReplaySegmentFlushHistoryForDebug()\n }),\n getReplayPerformanceForDebug: monitor(function () {\n return recorderApi.getReplayPerformanceForDebug()\n }),\n flushReplayMutationsForDebug: monitor(function () {\n if (recorderApi.flushReplayMutationsForDebug) {\n recorderApi.flushReplayMutationsForDebug()\n }\n })\n }\n}\n\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEO,SAASC,0BAA0BA,CAACC,WAAW,EAAE;EACtD,OAAO;IACLC,2BAA2B,EAAE,IAAAC,oBAAO,EAAC,UAAUC,OAAO,EAAE;MACtDH,WAAW,CAACI,KAAK,CAACD,OAAO,CAAC;MAC1B,IAAAE,8BAAiB,EAAC;QAChBC,OAAO,EAAE,gCAAgC;QACzCC,KAAK,EAAEJ,OAAO,IAAIA,OAAO,CAACI;MAC5B,CAAC,CAAC;IACJ,CAAC,CAAC;IACFC,WAAW,EAAE,IAAAN,oBAAO,EAAC,YAAY;MAC/B,OAAOF,WAAW,CAACQ,WAAW,CAAC,CAAC;IAClC,CAAC,CAAC;IACFC,0BAA0B,EAAE,IAAAP,oBAAO,EAACF,WAAW,CAACU,IAAI,CAAC;IACrDC,0BAA0B,EAAE,IAAAT,oBAAO,EAACF,WAAW,CAACW,0BAA0B,CAAC;IAC3EC,cAAc,EAAE,IAAAV,oBAAO,EAAC,UAAUW,MAAM,EAAEV,OAAO,EAAE;MACjD,OAAOH,WAAW,CAACY,cAAc,CAACC,MAAM,EAAEV,OAAO,CAAC;IACpD,CAAC,CAAC;IACFW,2BAA2B,EAAE,IAAAZ,oBAAO,EAAC,UAAUa,IAAI,EAAE;MACnD,OAAOf,WAAW,CAACc,2BAA2B,CAACC,IAAI,CAAC;IACtD,CAA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perty(exports, "__esModule", {
6
6
  exports.DeflateEncoderStreamId = void 0;
7
7
  exports.createDeflateEncoder = createDeflateEncoder;
8
8
  var _browserCore = require("@cloudcare/browser-core");
9
- var DeflateEncoderStreamId = exports.DeflateEncoderStreamId = {
10
- REPLAY: 1,
11
- RUM: 2
12
- };
9
+ var _encoderStreamId = require("../encoderStreamId");
10
+ var DeflateEncoderStreamId = exports.DeflateEncoderStreamId = _encoderStreamId.EncoderStreamId;
13
11
  function createDeflateEncoder(worker, streamId) {
14
12
  var rawBytesCount = 0;
15
13
  var compressedData = [];
@@ -1 +1 @@
1
- {"version":3,"file":"deflateEncoder.js","names":["_browserCore","require","DeflateEncoderStreamId","exports","REPLAY","RUM","createDeflateEncoder","worker","streamId","rawBytesCount","compressedData","compressedDataTrailer","isEmpty","nextWriteActionId","pendingWriteActions","wokerListener","addEventListener","params","workerResponse","data","type","nextPendingAction","id","shift","additionalBytesCount","push","result","trailer","writeCallback","byteLength","finishCallback","removeMessageListener","addTelemetryDebug","stop","consumeResult","output","length","Uint8Array","concatBuffers","concat","outputBytesCount","encoding","sendResetIfNeeded","postMessage","action","isAsync","write","callback","finish","forEach","pendingWriteAction","finishSync","pendingData","map","assign","estimateEncodedBytesCount"],"sources":["../../../src/domain/deflate/deflateEncoder.js"],"sourcesContent":["import {\n addEventListener,\n concatBuffers,\n addTelemetryDebug,\n assign\n} from '@cloudcare/browser-core'\nexport var DeflateEncoderStreamId = {\n REPLAY: 1,\n RUM: 2\n}\nexport function createDeflateEncoder(worker, streamId) {\n var rawBytesCount = 0\n var compressedData = []\n var compressedDataTrailer\n\n var isEmpty = true\n var nextWriteActionId = 0\n var pendingWriteActions = []\n\n var wokerListener = addEventListener(worker, 'message', function (params) {\n var workerResponse = params.data\n if (\n workerResponse.type !== 'wrote' ||\n (workerResponse.streamId && workerResponse.streamId !== streamId)\n ) {\n return\n }\n var nextPendingAction = pendingWriteActions[0]\n if (nextPendingAction) {\n if (nextPendingAction.id === workerResponse.id) {\n pendingWriteActions.shift()\n\n rawBytesCount += workerResponse.additionalBytesCount\n compressedData.push(workerResponse.result)\n compressedDataTrailer = workerResponse.trailer\n\n if (nextPendingAction.writeCallback) {\n nextPendingAction.writeCallback(workerResponse.result.byteLength)\n } else if (nextPendingAction.finishCallback) {\n nextPendingAction.finishCallback()\n }\n } else if (nextPendingAction.id < workerResponse.id) {\n removeMessageListener()\n addTelemetryDebug('Worker responses received out of order.')\n }\n }\n })\n\n var removeMessageListener = wokerListener.stop\n\n function consumeResult() {\n var output =\n compressedData.length === 0\n ? new Uint8Array(0)\n : concatBuffers(compressedData.concat(compressedDataTrailer))\n\n var result = {\n rawBytesCount: rawBytesCount,\n output: output,\n outputBytesCount: output.byteLength,\n encoding: 'deflate'\n }\n rawBytesCount = 0\n compressedData = []\n return result\n }\n\n function sendResetIfNeeded() {\n if (!isEmpty) {\n worker.postMessage({\n action: 'reset',\n streamId: streamId\n })\n isEmpty = true\n }\n }\n return {\n isAsync: true,\n isEmpty: function () {\n return isEmpty\n },\n\n write: function (data, callback) {\n worker.postMessage({\n action: 'write',\n id: nextWriteActionId,\n data: data,\n streamId: streamId\n })\n pendingWriteActions.push({\n id: nextWriteActionId,\n writeCallback: callback,\n data: data\n })\n isEmpty = false\n nextWriteActionId += 1\n },\n\n finish: function (callback) {\n sendResetIfNeeded()\n\n if (!pendingWriteActions.length) {\n callback(consumeResult())\n } else {\n // Make sure we do not call any write callback\n pendingWriteActions.forEach(function (pendingWriteAction) {\n delete pendingWriteAction.writeCallback\n })\n\n // Wait for the last action to finish before calling the finish callback\n pendingWriteActions[pendingWriteActions.length - 1].finishCallback =\n function () {\n return callback(consumeResult())\n }\n }\n },\n\n finishSync: function () {\n sendResetIfNeeded()\n\n var pendingData = pendingWriteActions.map(function (pendingWriteAction) {\n return pendingWriteAction.data\n })\n\n pendingWriteActions.length = 0\n return assign(consumeResult(), {\n pendingData: pendingData\n })\n },\n\n estimateEncodedBytesCount: function (data) {\n // This is a rough estimation of the data size once it'll be encoded by deflate. We observed\n // that if it's the first chunk of data pushed to the stream, the ratio is lower (3-4), but\n // after that the ratio is greater (10+). We chose 8 here, which (on average) seems to produce\n // requests of the expected size.\n return data.length / 8\n },\n\n stop: function () {\n removeMessageListener()\n }\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAMO,IAAIC,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG;EAClCE,MAAM,EAAE,CAAC;EACTC,GAAG,EAAE;AACP,CAAC;AACM,SAASC,oBAAoBA,CAACC,MAAM,EAAEC,QAAQ,EAAE;EACrD,IAAIC,aAAa,GAAG,CAAC;EACrB,IAAIC,cAAc,GAAG,EAAE;EACvB,IAAIC,qBAAqB;EAEzB,IAAIC,QAAO,GAAG,IAAI;EAClB,IAAIC,iBAAiB,GAAG,CAAC;EACzB,IAAIC,mBAAmB,GAAG,EAAE;EAE5B,IAAIC,aAAa,GAAG,IAAAC,6BAAgB,EAACT,MAAM,EAAE,SAAS,EAAE,UAAUU,MAAM,EAAE;IACxE,IAAIC,cAAc,GAAGD,MAAM,CAACE,IAAI;IAChC,IACED,cAAc,CAACE,IAAI,KAAK,OAAO,IAC9BF,cAAc,CAACV,QAAQ,IAAIU,cAAc,CAACV,QAAQ,KAAKA,QAAS,EACjE;MACA;IACF;IACA,IAAIa,iBAAiB,GAAGP,mBAAmB,CAAC,CAAC,CAAC;IAC9C,IAAIO,iBAAiB,EAAE;MACrB,IAAIA,iBAAiB,CAACC,EAAE,KAAKJ,cAAc,CAACI,EAAE,EAAE;QAC9CR,mBAAmB,CAACS,KAAK,CAAC,CAAC;QAE3Bd,aAAa,IAAIS,cAAc,CAACM,oBAAoB;QACpDd,cAAc,CAACe,IAAI,CAACP,cAAc,CAACQ,MAAM,CAAC;QAC1Cf,qBAAqB,GAAGO,cAAc,CAACS,OAAO;QAE9C,IAAIN,iBAAiB,CAACO,aAAa,EAAE;UACnCP,iBAAiB,CAACO,aAAa,CAACV,cAAc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AM,GAAG,CAAC;IACxB,CAAC;IAEDH,IAAI,EAAE,SAANA,IAAIA,CAAA,EAAc;MAChBF,qBAAqB,CAAC,CAAC;IACzB;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"deflateEncoder.js","names":["_browserCore","require","_encoderStreamId","DeflateEncoderStreamId","exports","EncoderStreamId","createDeflateEncoder","worker","streamId","rawBytesCount","compressedData","compressedDataTrailer","isEmpty","nextWriteActionId","pendingWriteActions","wokerListener","addEventListener","params","workerResponse","data","type","nextPendingAction","id","shift","additionalBytesCount","push","result","trailer","writeCallback","byteLength","finishCallback","removeMessageListener","addTelemetryDebug","stop","consumeResult","output","length","Uint8Array","concatBuffers","concat","outputBytesCount","encoding","sendResetIfNeeded","postMessage","action","isAsync","write","callback","finish","forEach","pendingWriteAction","finishSync","pendingData","map","assign","estimateEncodedBytesCount"],"sources":["../../../src/domain/deflate/deflateEncoder.js"],"sourcesContent":["import {\n addEventListener,\n concatBuffers,\n addTelemetryDebug,\n assign\n} from '@cloudcare/browser-core'\nimport { EncoderStreamId } from '../encoderStreamId'\nexport var DeflateEncoderStreamId = EncoderStreamId\nexport function createDeflateEncoder(worker, streamId) {\n var rawBytesCount = 0\n var compressedData = []\n var compressedDataTrailer\n\n var isEmpty = true\n var nextWriteActionId = 0\n var pendingWriteActions = []\n\n var wokerListener = addEventListener(worker, 'message', function (params) {\n var workerResponse = params.data\n if (\n workerResponse.type !== 'wrote' ||\n (workerResponse.streamId && workerResponse.streamId !== streamId)\n ) {\n return\n }\n var nextPendingAction = pendingWriteActions[0]\n if (nextPendingAction) {\n if (nextPendingAction.id === workerResponse.id) {\n pendingWriteActions.shift()\n\n rawBytesCount += workerResponse.additionalBytesCount\n compressedData.push(workerResponse.result)\n compressedDataTrailer = workerResponse.trailer\n\n if (nextPendingAction.writeCallback) {\n nextPendingAction.writeCallback(workerResponse.result.byteLength)\n } else if (nextPendingAction.finishCallback) {\n nextPendingAction.finishCallback()\n }\n } else if (nextPendingAction.id < workerResponse.id) {\n removeMessageListener()\n addTelemetryDebug('Worker responses received out of order.')\n }\n }\n })\n\n var removeMessageListener = wokerListener.stop\n\n function consumeResult() {\n var output =\n compressedData.length === 0\n ? new Uint8Array(0)\n : concatBuffers(compressedData.concat(compressedDataTrailer))\n\n var result = {\n rawBytesCount: rawBytesCount,\n output: output,\n outputBytesCount: output.byteLength,\n encoding: 'deflate'\n }\n rawBytesCount = 0\n compressedData = []\n return result\n }\n\n function sendResetIfNeeded() {\n if (!isEmpty) {\n worker.postMessage({\n action: 'reset',\n streamId: streamId\n })\n isEmpty = true\n }\n }\n return {\n isAsync: true,\n isEmpty: function () {\n return isEmpty\n },\n\n write: function (data, callback) {\n worker.postMessage({\n action: 'write',\n id: nextWriteActionId,\n data: data,\n streamId: streamId\n })\n pendingWriteActions.push({\n id: nextWriteActionId,\n writeCallback: callback,\n data: data\n })\n isEmpty = false\n nextWriteActionId += 1\n },\n\n finish: function (callback) {\n sendResetIfNeeded()\n\n if (!pendingWriteActions.length) {\n callback(consumeResult())\n } else {\n // Make sure we do not call any write callback\n pendingWriteActions.forEach(function (pendingWriteAction) {\n delete pendingWriteAction.writeCallback\n })\n\n // Wait for the last action to finish before calling the finish callback\n pendingWriteActions[pendingWriteActions.length - 1].finishCallback =\n function () {\n return callback(consumeResult())\n }\n }\n },\n\n finishSync: function () {\n sendResetIfNeeded()\n\n var pendingData = pendingWriteActions.map(function (pendingWriteAction) {\n return pendingWriteAction.data\n })\n\n pendingWriteActions.length = 0\n return assign(consumeResult(), {\n pendingData: pendingData\n })\n },\n\n estimateEncodedBytesCount: function (data) {\n // This is a rough estimation of the data size once it'll be encoded by deflate. We observed\n // that if it's the first chunk of data pushed to the stream, the ratio is lower (3-4), but\n // after that the ratio is greater (10+). We chose 8 here, which (on average) seems to produce\n // requests of the expected size.\n return data.length / 8\n },\n\n stop: function () {\n removeMessageListener()\n }\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;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FP,QAAO,GAAG,KAAK;MACfC,iBAAiB,IAAI,CAAC;IACxB,CAAC;IAEDmC,MAAM,EAAE,SAARA,MAAMA,CAAYD,QAAQ,EAAE;MAC1BL,iBAAiB,CAAC,CAAC;MAEnB,IAAI,CAAC5B,mBAAmB,CAACsB,MAAM,EAAE;QAC/BW,QAAQ,CAACb,aAAa,CAAC,CAAC,CAAC;MAC3B,CAAC,MAAM;QACL;QACApB,mBAAmB,CAACmC,OAAO,CAAC,UAAUC,kBAAkB,EAAE;UACxD,OAAOA,kBAAkB,CAACtB,aAAa;QACzC,CAAC,CAAC;;QAEF;QACAd,mBAAmB,CAACA,mBAAmB,CAACsB,MAAM,GAAG,CAAC,CAAC,CAACN,cAAc,GAChE,YAAY;UACV,OAAOiB,QAAQ,CAACb,aAAa,CAAC,CAAC,CAAC;QAClC,CAAC;MACL;IACF,CAAC;IAEDiB,UAAU,EAAE,SAAZA,UAAUA,CAAA,EAAc;MACtBT,iBAAiB,CAAC,CAAC;MAEnB,IAAIU,WAAW,GAAGtC,mBAAmB,CAACuC,GAAG,CAAC,UAAUH,kBAAkB,EAAE;QACtE,OAAOA,kBAAkB,CAAC/B,IAAI;MAChC,CAAC,CAAC;MAEFL,mBAAmB,CAACsB,MAAM,GAAG,CAAC;MAC9B,OAAO,IAAAkB,mBAAM,EAACpB,aAAa,CAAC,CAAC,EAAE;QAC7BkB,WAAW,EAAEA;MACf,CAAC,CAAC;IACJ,CAAC;IAEDG,yBAAyB,EAAE,SAA3BA,yBAAyBA,CAAYpC,IAAI,EAAE;MACzC;MACA;MACA;MACA;MACA,OAAOA,IAAI,CAACiB,MAAM,GAAG,CAAC;IACxB,CAAC;IAEDH,IAAI,EAAE,SAANA,IAAIA,CAAA,EAAc;MAChBF,qBAAqB,CAAC,CAAC;IACzB;EACF,CAAC;AACH","ignoreList":[]}
@@ -12,7 +12,7 @@ exports.startDeflateWorker = startDeflateWorker;
12
12
  var _browserCore = require("@cloudcare/browser-core");
13
13
  var INITIALIZATION_TIME_OUT_DELAY = exports.INITIALIZATION_TIME_OUT_DELAY = 10 * _browserCore.ONE_SECOND;
14
14
  function createDeflateWorker(configuration) {
15
- return new Worker(configuration.workerUrl || URL.createObjectURL(new Blob(["!function(){\"use strict\";function t(t){for(var e=t.reduce((function(t,e){return t+e.length}),0),a=new Uint8Array(e),n=0,r=0,i=t;r<i.length;r++){var s=i[r];a.set(s,n),n+=s.length}return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),h=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,w,v=new Array(r);function b(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(v);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},k=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},z=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},x=function(t,e,a){z(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},U=function(t,e,a){var n,r,s=new Array(16),h=0;for(n=1;n<=i;n++)s[n]=h=h+a[n-1]<<1;for(r=0;r<=e;r++){var l=t[2*r+1];0!==l&&(t[2*r]=A(s[l]++,l))}},I=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<r;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},B=function(t){t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},E=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},S=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&E(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!E(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},C=function(t,e,n){var r,i,l,_,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(l=f[i],x(t,l+a+1,e),0!==(_=s[l])&&(i-=c[l],z(t,i,_)),r--,l=y(r),x(t,l,n),0!==(_=h[l])&&(r-=v[l],z(t,r,_)))}while(o<t.last_lit);x(t,256,e)},D=function(t,e){var a,n,r,s=e.dyn_tree,h=e.stat_desc.static_tree,l=e.stat_desc.has_stree,_=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<_;a++)0!==s[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,l&&(t.static_len-=h[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)S(t,s,a);r=_;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,h,l,_=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(_[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=_[2*_[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),_[2*n+1]=s,n>o||(t.bl_count[s]++,h=0,n>=c&&(h=f[n-c]),l=_[2*n],t.opt_len+=l*(s+h),u&&(t.static_len+=l*(d[2*n+1]+h)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(_[2*r+1]!==s&&(t.opt_len+=(s-_[2*r+1])*_[2*r],_[2*r+1]=s),n--)}}(t,e),U(s,o,t.bl_count)},j=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},M=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{x(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),h--),x(t,16,t.bl_tree),z(t,h-3,2)):h<=10?(x(t,17,t.bl_tree),z(t,h-3,3)):(x(t,18,t.bl_tree),z(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},L=!1,T=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){B(t),n&&(k(t,a),k(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},H=function(t,e,n,r){var i,s,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),D(t,t.l_desc),D(t,t.d_desc),h=function(t){var e;for(j(t,t.dyn_ltree,t.l_desc.max_code),j(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*_[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?T(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),C(t,o,d)):(z(t,4+(r?1:0),3),function(t,e,a,n){var r;for(z(t,e-257,5),z(t,a-1,5),z(t,n-4,4),r=0;r<n;r++)z(t,t.bl_tree[2*_[r]+1],3);M(t,t.dyn_ltree,e-1),M(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),C(t,t.dyn_ltree,t.dyn_dtree)),I(t),r&&B(t)},R={_tr_init:function(t){L||(!function(){var t,e,a,_,m,y=new Array(16);for(a=0,_=0;_<28;_++)for(c[_]=a,t=0;t<1<<s[_];t++)f[a++]=_;for(f[a-1]=_,m=0,_=0;_<16;_++)for(v[_]=m,t=0;t<1<<h[_];t++)u[m++]=_;for(m>>=7;_<r;_++)for(v[_]=m<<7,t=0;t<1<<h[_]-7;t++)u[256+m++]=_;for(e=0;e<=i;e++)y[e]=0;for(t=0;t<=143;)o[2*t+1]=8,t++,y[8]++;for(;t<=255;)o[2*t+1]=9,t++,y[9]++;for(;t<=279;)o[2*t+1]=7,t++,y[7]++;for(;t<=287;)o[2*t+1]=8,t++,y[8]++;for(U(o,287,y),t=0;t<r;t++)d[2*t+1]=5,d[2*t]=A(t,5);p=new b(o,s,257,n,i),g=new b(d,h,0,r,i),w=new b(new Array(0),l,0,19,7)}(),L=!0),t.l_desc=new m(t.dyn_ltree,p),t.d_desc=new m(t.dyn_dtree,g),t.bl_desc=new m(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,I(t)},_tr_stored_block:T,_tr_flush_block:H,_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){z(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},K=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},N=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),O=function(t,e,a,n){var r=N,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},q={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},F=0,G=2,J=3,P=4,Q=0,V=1,W=-1,X=0,Y=8,Z=R._tr_init,$=R._tr_stored_block,tt=R._tr_flush_block,et=R._tr_tally,at=R._tr_align,nt=F,rt=1,it=J,st=P,ht=5,lt=Q,_t=V,ot=-2,dt=-3,ut=-5,ft=W,ct=1,pt=2,gt=3,wt=4,vt=X,bt=2,mt=Y,yt=258,kt=262,zt=103,xt=113,At=666,Ut=function(t,e){return t.msg=q[e],e},It=function(t){return(t<<1)-(t>4?9:0)},Bt=function(t){for(var e=t.length;--e>=0;)t[e]=0},Et=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},St=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Ct=function(t,e){tt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,St(t.strm)},Dt=function(t,e){t.pending_buf[t.pending++]=e},jt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Mt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-kt?t.strstart-(t.w_size-kt):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+yt,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=yt-(u-i),i=u-yt,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Lt=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-kt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=K(s.adler,h,o,l):2===s.state.wrap&&(s.adler=O(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Et(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Et(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<kt&&0!==t.strm.avail_in)},Tt=function(t,e){for(var a,n;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a)),t.match_length>=3)if(n=et(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Et(t,t.ins_h,t.window[t.strstart+1]);else n=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2},Ht=function(t,e){for(var a,n,r;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a),t.match_length<=5&&(t.strategy===ct||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=et(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Ct(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=et(t,0,t.window[t.strstart-1]))&&Ct(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=et(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Kt=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Lt(t),0===t.lookahead&&e===nt)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Ct(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-kt&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ct(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Tt),new Rt(4,5,16,8,Tt),new Rt(4,6,32,32,Tt),new Rt(4,4,16,16,Ht),new Rt(8,16,32,32,Ht),new Rt(8,16,128,128,Ht),new Rt(8,32,128,256,Ht),new Rt(32,128,258,1024,Ht),new Rt(32,258,258,4096,Ht)];function Nt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=mt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Bt(this.dyn_ltree),Bt(this.dyn_dtree),Bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return Ut(t,ot);t.total_in=t.total_out=0,t.data_type=bt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:xt,t.adler=2===e.wrap?0:1,e.last_flush=nt,Z(e),lt},qt=function(t){var e,a=Ot(t);return a===lt&&((e=t.state).window_size=2*e.w_size,Bt(e.head),e.max_lazy_match=Kt[e.level].max_lazy,e.good_match=Kt[e.level].good_length,e.nice_match=Kt[e.level].nice_length,e.max_chain_length=Kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ft=function(t,e,a,n,r,i){if(!t)return ot;var s=1;if(e===ft&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==mt||n<8||n>15||e<0||e>9||i<0||i>wt)return Ut(t,ot);8===n&&(n=9);var h=new Nt;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,qt(t)},Gt={deflateInit:function(t,e){return Ft(t,e,mt,15,8,vt)},deflateInit2:Ft,deflateReset:qt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?ot:(t.state.gzhead=e,lt):ot},deflate:function(t,e){var a,n;if(!t||!t.state||e>ht||e<0)return t?Ut(t,ot):ot;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===At&&e!==st)return Ut(t,0===t.avail_out?ut:ot);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Dt(r,31),Dt(r,139),Dt(r,8),r.gzhead?(Dt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Dt(r,255&r.gzhead.time),Dt(r,r.gzhead.time>>8&255),Dt(r,r.gzhead.time>>16&255),Dt(r,r.gzhead.time>>24&255),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Dt(r,255&r.gzhead.extra.length),Dt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=O(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,3),r.status=xt);else{var s=mt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=pt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=xt,jt(r,s),0!==r.strstart&&(jt(r,t.adler>>>16),jt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending!==r.pending_buf_size));)Dt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=zt)}else r.status=zt;if(r.status===zt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&St(t),r.pending+2<=r.pending_buf_size&&(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),t.adler=0,r.status=xt)):r.status=xt),0!==r.pending){if(St(t),0===t.avail_out)return r.last_flush=-1,lt}else if(0===t.avail_in&&It(e)<=It(i)&&e!==st)return Ut(t,ut);if(r.status===At&&0!==t.avail_in)return Ut(t,ut);if(0!==t.avail_in||0!==r.lookahead||e!==nt&&r.status!==At){var h=r.strategy===pt?function(t,e){for(var a;;){if(0===t.lookahead&&(Lt(t),0===t.lookahead)){if(e===nt)return 1;break}if(t.match_length=0,a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===gt?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=yt){if(Lt(t),t.lookahead<=yt&&e===nt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+yt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=yt-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=et(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):Kt[r.level].func(r,e);if(3!==h&&4!==h||(r.status=At),1===h||3===h)return 0===t.avail_out&&(r.last_flush=-1),lt;if(2===h&&(e===rt?at(r):e!==ht&&($(r,0,0,!1),e===it&&(Bt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),St(t),0===t.avail_out))return r.last_flush=-1,lt}return e!==st?lt:r.wrap<=0?_t:(2===r.wrap?(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),Dt(r,t.adler>>16&255),Dt(r,t.adler>>24&255),Dt(r,255&t.total_in),Dt(r,t.total_in>>8&255),Dt(r,t.total_in>>16&255),Dt(r,t.total_in>>24&255)):(jt(r,t.adler>>>16),jt(r,65535&t.adler)),St(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?lt:_t)},deflateEnd:function(t){if(!t||!t.state)return ot;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==zt&&e!==xt&&e!==At?Ut(t,ot):(t.state=null,e===xt?Ut(t,dt):lt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return ot;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return ot;if(1===r&&(t.adler=K(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(Bt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Lt(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=Et(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,Lt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,lt},deflateInfo:\"pako deflate (from Nodeca project)\"};for(var Jt=new Uint8Array(256),Pt=0;Pt<256;Pt++)Jt[Pt]=Pt>=252?6:Pt>=248?5:Pt>=240?4:Pt>=224?3:Pt>=192?2:1;Jt[254]=Jt[254]=1;var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0},Vt=Object.prototype.toString,Wt=F,Xt=G,Yt=J,Zt=P,$t=Q,te=V,ee=W,ae=X,ne=Y;function re(){this.options={level:ee,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:ae};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var e=Gt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==$t)throw new Error(q[e]);if(t.header&&Gt.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a=\"[object ArrayBuffer]\"===Vt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Gt.deflateSetDictionary(this.strm,a))!==$t)throw new Error(q[e]);this._dict_set=!0}}function ie(t,e,a){try{t.postMessage({type:\"errored\",error:e,streamId:a})}catch(n){t.postMessage({type:\"errored\",error:String(e),streamId:a})}}function se(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}re.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Zt:Wt,\"[object ArrayBuffer]\"===Vt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Xt||n===Yt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Gt.deflate(r,n))===te)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Gt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===$t;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},re.prototype.onData=function(t){this.chunks.push(t)},re.prototype.onEnd=function(t){t===$t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e){void 0===e&&(e=self);try{var a=new Map;e.addEventListener(\"message\",(function(n){try{var r=function(e,a){switch(a.action){case\"init\":return{type:\"initialized\",version:\"3.3.1\"};case\"write\":var n=e.get(a.streamId);n||(n=new re,e.set(a.streamId,n));var r=n.chunks.length,i=function(t){if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,G),{type:\"wrote\",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:se(n),additionalBytesCount:i.length};case\"reset\":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){ie(e,t,n.data&&\"streamId\"in n.data?n.data.streamId:void 0)}}))}catch(t){ie(e,t)}}()}();"])));
15
+ return new Worker(configuration.workerUrl || URL.createObjectURL(new Blob(["!function(){\"use strict\";function t(t){for(var e=t.reduce((function(t,e){return t+e.length}),0),a=new Uint8Array(e),n=0,r=0,i=t;r<i.length;r++){var s=i[r];a.set(s,n),n+=s.length}return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),h=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,w,v=new Array(r);function b(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(v);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},k=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},z=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},x=function(t,e,a){z(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},U=function(t,e,a){var n,r,s=new Array(16),h=0;for(n=1;n<=i;n++)s[n]=h=h+a[n-1]<<1;for(r=0;r<=e;r++){var l=t[2*r+1];0!==l&&(t[2*r]=A(s[l]++,l))}},I=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<r;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},B=function(t){t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},E=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},S=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&E(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!E(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},C=function(t,e,n){var r,i,l,_,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(l=f[i],x(t,l+a+1,e),0!==(_=s[l])&&(i-=c[l],z(t,i,_)),r--,l=y(r),x(t,l,n),0!==(_=h[l])&&(r-=v[l],z(t,r,_)))}while(o<t.last_lit);x(t,256,e)},D=function(t,e){var a,n,r,s=e.dyn_tree,h=e.stat_desc.static_tree,l=e.stat_desc.has_stree,_=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<_;a++)0!==s[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,l&&(t.static_len-=h[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)S(t,s,a);r=_;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,h,l,_=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(_[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=_[2*_[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),_[2*n+1]=s,n>o||(t.bl_count[s]++,h=0,n>=c&&(h=f[n-c]),l=_[2*n],t.opt_len+=l*(s+h),u&&(t.static_len+=l*(d[2*n+1]+h)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(_[2*r+1]!==s&&(t.opt_len+=(s-_[2*r+1])*_[2*r],_[2*r+1]=s),n--)}}(t,e),U(s,o,t.bl_count)},j=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},M=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{x(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),h--),x(t,16,t.bl_tree),z(t,h-3,2)):h<=10?(x(t,17,t.bl_tree),z(t,h-3,3)):(x(t,18,t.bl_tree),z(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},L=!1,T=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){B(t),n&&(k(t,a),k(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},H=function(t,e,n,r){var i,s,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),D(t,t.l_desc),D(t,t.d_desc),h=function(t){var e;for(j(t,t.dyn_ltree,t.l_desc.max_code),j(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*_[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?T(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),C(t,o,d)):(z(t,4+(r?1:0),3),function(t,e,a,n){var r;for(z(t,e-257,5),z(t,a-1,5),z(t,n-4,4),r=0;r<n;r++)z(t,t.bl_tree[2*_[r]+1],3);M(t,t.dyn_ltree,e-1),M(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),C(t,t.dyn_ltree,t.dyn_dtree)),I(t),r&&B(t)},R={_tr_init:function(t){L||(!function(){var t,e,a,_,m,y=new Array(16);for(a=0,_=0;_<28;_++)for(c[_]=a,t=0;t<1<<s[_];t++)f[a++]=_;for(f[a-1]=_,m=0,_=0;_<16;_++)for(v[_]=m,t=0;t<1<<h[_];t++)u[m++]=_;for(m>>=7;_<r;_++)for(v[_]=m<<7,t=0;t<1<<h[_]-7;t++)u[256+m++]=_;for(e=0;e<=i;e++)y[e]=0;for(t=0;t<=143;)o[2*t+1]=8,t++,y[8]++;for(;t<=255;)o[2*t+1]=9,t++,y[9]++;for(;t<=279;)o[2*t+1]=7,t++,y[7]++;for(;t<=287;)o[2*t+1]=8,t++,y[8]++;for(U(o,287,y),t=0;t<r;t++)d[2*t+1]=5,d[2*t]=A(t,5);p=new b(o,s,257,n,i),g=new b(d,h,0,r,i),w=new b(new Array(0),l,0,19,7)}(),L=!0),t.l_desc=new m(t.dyn_ltree,p),t.d_desc=new m(t.dyn_dtree,g),t.bl_desc=new m(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,I(t)},_tr_stored_block:T,_tr_flush_block:H,_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){z(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},K=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},N=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),O=function(t,e,a,n){var r=N,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},q={2:\"need dictionary\",1:\"stream end\",0:\"\",\"-1\":\"file error\",\"-2\":\"stream error\",\"-3\":\"data error\",\"-4\":\"insufficient memory\",\"-5\":\"buffer error\",\"-6\":\"incompatible version\"},F=0,G=2,J=3,P=4,Q=0,V=1,W=-1,X=0,Y=8,Z=R._tr_init,$=R._tr_stored_block,tt=R._tr_flush_block,et=R._tr_tally,at=R._tr_align,nt=F,rt=1,it=J,st=P,ht=5,lt=Q,_t=V,ot=-2,dt=-3,ut=-5,ft=W,ct=1,pt=2,gt=3,wt=4,vt=X,bt=2,mt=Y,yt=258,kt=262,zt=103,xt=113,At=666,Ut=function(t,e){return t.msg=q[e],e},It=function(t){return(t<<1)-(t>4?9:0)},Bt=function(t){for(var e=t.length;--e>=0;)t[e]=0},Et=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},St=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Ct=function(t,e){tt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,St(t.strm)},Dt=function(t,e){t.pending_buf[t.pending++]=e},jt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Mt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-kt?t.strstart-(t.w_size-kt):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+yt,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=yt-(u-i),i=u-yt,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Lt=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-kt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=K(s.adler,h,o,l):2===s.state.wrap&&(s.adler=O(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Et(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Et(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<kt&&0!==t.strm.avail_in)},Tt=function(t,e){for(var a,n;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a)),t.match_length>=3)if(n=et(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Et(t,t.ins_h,t.window[t.strstart+1]);else n=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2},Ht=function(t,e){for(var a,n,r;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a),t.match_length<=5&&(t.strategy===ct||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=et(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Ct(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=et(t,0,t.window[t.strstart-1]))&&Ct(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=et(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Kt=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Lt(t),0===t.lookahead&&e===nt)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Ct(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-kt&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ct(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Tt),new Rt(4,5,16,8,Tt),new Rt(4,6,32,32,Tt),new Rt(4,4,16,16,Ht),new Rt(8,16,32,32,Ht),new Rt(8,16,128,128,Ht),new Rt(8,32,128,256,Ht),new Rt(32,128,258,1024,Ht),new Rt(32,258,258,4096,Ht)];function Nt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=mt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Bt(this.dyn_ltree),Bt(this.dyn_dtree),Bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return Ut(t,ot);t.total_in=t.total_out=0,t.data_type=bt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:xt,t.adler=2===e.wrap?0:1,e.last_flush=nt,Z(e),lt},qt=function(t){var e,a=Ot(t);return a===lt&&((e=t.state).window_size=2*e.w_size,Bt(e.head),e.max_lazy_match=Kt[e.level].max_lazy,e.good_match=Kt[e.level].good_length,e.nice_match=Kt[e.level].nice_length,e.max_chain_length=Kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ft=function(t,e,a,n,r,i){if(!t)return ot;var s=1;if(e===ft&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==mt||n<8||n>15||e<0||e>9||i<0||i>wt)return Ut(t,ot);8===n&&(n=9);var h=new Nt;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,qt(t)},Gt={deflateInit:function(t,e){return Ft(t,e,mt,15,8,vt)},deflateInit2:Ft,deflateReset:qt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?ot:(t.state.gzhead=e,lt):ot},deflate:function(t,e){var a,n;if(!t||!t.state||e>ht||e<0)return t?Ut(t,ot):ot;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===At&&e!==st)return Ut(t,0===t.avail_out?ut:ot);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Dt(r,31),Dt(r,139),Dt(r,8),r.gzhead?(Dt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Dt(r,255&r.gzhead.time),Dt(r,r.gzhead.time>>8&255),Dt(r,r.gzhead.time>>16&255),Dt(r,r.gzhead.time>>24&255),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Dt(r,255&r.gzhead.extra.length),Dt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=O(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,3),r.status=xt);else{var s=mt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=pt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=xt,jt(r,s),0!==r.strstart&&(jt(r,t.adler>>>16),jt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending!==r.pending_buf_size));)Dt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=zt)}else r.status=zt;if(r.status===zt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&St(t),r.pending+2<=r.pending_buf_size&&(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),t.adler=0,r.status=xt)):r.status=xt),0!==r.pending){if(St(t),0===t.avail_out)return r.last_flush=-1,lt}else if(0===t.avail_in&&It(e)<=It(i)&&e!==st)return Ut(t,ut);if(r.status===At&&0!==t.avail_in)return Ut(t,ut);if(0!==t.avail_in||0!==r.lookahead||e!==nt&&r.status!==At){var h=r.strategy===pt?function(t,e){for(var a;;){if(0===t.lookahead&&(Lt(t),0===t.lookahead)){if(e===nt)return 1;break}if(t.match_length=0,a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===gt?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=yt){if(Lt(t),t.lookahead<=yt&&e===nt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+yt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=yt-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=et(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):Kt[r.level].func(r,e);if(3!==h&&4!==h||(r.status=At),1===h||3===h)return 0===t.avail_out&&(r.last_flush=-1),lt;if(2===h&&(e===rt?at(r):e!==ht&&($(r,0,0,!1),e===it&&(Bt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),St(t),0===t.avail_out))return r.last_flush=-1,lt}return e!==st?lt:r.wrap<=0?_t:(2===r.wrap?(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),Dt(r,t.adler>>16&255),Dt(r,t.adler>>24&255),Dt(r,255&t.total_in),Dt(r,t.total_in>>8&255),Dt(r,t.total_in>>16&255),Dt(r,t.total_in>>24&255)):(jt(r,t.adler>>>16),jt(r,65535&t.adler)),St(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?lt:_t)},deflateEnd:function(t){if(!t||!t.state)return ot;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==zt&&e!==xt&&e!==At?Ut(t,ot):(t.state=null,e===xt?Ut(t,dt):lt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return ot;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return ot;if(1===r&&(t.adler=K(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(Bt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Lt(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=Et(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,Lt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,lt},deflateInfo:\"pako deflate (from Nodeca project)\"};for(var Jt=new Uint8Array(256),Pt=0;Pt<256;Pt++)Jt[Pt]=Pt>=252?6:Pt>=248?5:Pt>=240?4:Pt>=224?3:Pt>=192?2:1;Jt[254]=Jt[254]=1;var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=\"\",this.state=null,this.data_type=2,this.adler=0},Vt=Object.prototype.toString,Wt=F,Xt=G,Yt=J,Zt=P,$t=Q,te=V,ee=W,ae=X,ne=Y;function re(){this.options={level:ee,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:ae};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=\"\",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var e=Gt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==$t)throw new Error(q[e]);if(t.header&&Gt.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a=\"[object ArrayBuffer]\"===Vt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Gt.deflateSetDictionary(this.strm,a))!==$t)throw new Error(q[e]);this._dict_set=!0}}function ie(t,e,a){try{t.postMessage({type:\"errored\",error:e,streamId:a})}catch(n){t.postMessage({type:\"errored\",error:String(e),streamId:a})}}function se(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}re.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Zt:Wt,\"[object ArrayBuffer]\"===Vt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Xt||n===Yt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Gt.deflate(r,n))===te)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Gt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===$t;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},re.prototype.onData=function(t){this.chunks.push(t)},re.prototype.onEnd=function(t){t===$t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e){void 0===e&&(e=self);try{var a=new Map;e.addEventListener(\"message\",(function(n){try{var r=function(e,a){switch(a.action){case\"init\":return{type:\"initialized\",version:\"3.3.3\"};case\"write\":var n=e.get(a.streamId);n||(n=new re,e.set(a.streamId,n));var r=n.chunks.length,i=function(t){if(\"function\"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)55296==(64512&(a=t.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=t.charCodeAt(r+1)))&&(a=65536+(a-55296<<10)+(n-56320),r++),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,G),{type:\"wrote\",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:se(n),additionalBytesCount:i.length};case\"reset\":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){ie(e,t,n.data&&\"streamId\"in n.data?n.data.streamId:void 0)}}))}catch(t){ie(e,t)}}()}();"])));
16
16
  }
17
17
  /**
18
18
  * In order to be sure that the worker is correctly working, we need a round trip of
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EncoderStreamId = void 0;
7
+ var EncoderStreamId = exports.EncoderStreamId = {
8
+ REPLAY: 1,
9
+ RUM: 2
10
+ };
11
+ //# sourceMappingURL=encoderStreamId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encoderStreamId.js","names":["EncoderStreamId","exports","REPLAY","RUM"],"sources":["../../src/domain/encoderStreamId.js"],"sourcesContent":["export var EncoderStreamId = {\n REPLAY: 1,\n RUM: 2\n}\n\n"],"mappings":";;;;;;AAAO,IAAIA,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG;EAC3BE,MAAM,EAAE,CAAC;EACTC,GAAG,EAAE;AACP,CAAC","ignoreList":[]}
@@ -18,7 +18,7 @@ function createCanvasEncodeWorker(configuration, workerCtor, urlObject) {
18
18
  var workerUrl = configuration.replayCanvasWorkerUrl;
19
19
  var usesExternalUrl = !!workerUrl;
20
20
  if (!workerUrl) {
21
- workerUrl = urlObject.createObjectURL(new Blob(["!function(){\"use strict\";function t(t){for(var e=new Uint8Array(t),n=[],r=0;r<e.length;r+=8192){for(var i=e.subarray(r,r+8192),o=\"\",a=0;a<i.length;a+=1)o+=String.fromCharCode(i[a]);n.push(o)}return btoa(n.join(\"\"))}function e(t,e){try{t.postMessage(e)}catch(n){t.postMessage({action:\"errored\",id:e&&e.id,error:String(n&&n.message?n.message:n)})}}var n;void 0===n&&(n=self),n.addEventListener(\"message\",(function(r){var i=r.data;i&&(\"init\"!==i.action?\"encode\"===i.action&&Promise.resolve().then((function(){var e=function(t,e,n){if(!t||!e||!n)return{width:t,height:e};if(t<=n&&e<=n)return{width:t,height:e};var r=t>e?n/t:n/e;return{width:Math.max(1,Math.round(t*r)),height:Math.max(1,Math.round(e*r))}}(i.width,i.height,i.maxSize),n=new OffscreenCanvas(e.width,e.height),r=n.getContext(\"2d\");if(!r)throw new Error(\"Cannot create offscreen canvas 2d context for encoding\");if(r.drawImage(i.bitmap,0,0,e.width,e.height),i.bitmap&&\"function\"==typeof i.bitmap.close&&i.bitmap.close(),\"function\"!=typeof n.convertToBlob)throw new Error(\"OffscreenCanvas convertToBlob is not supported\");return n.convertToBlob({type:i.mimeType,quality:i.quality}).then((function(n){return n.arrayBuffer().then((function(r){var o=n.type||i.mimeType;return{action:\"encoded\",id:i.id,dataUrl:\"data:\"+o+\";base64,\"+t(r),width:e.width,height:e.height}}))}))})).then((function(t){e(n,t)})).catch((function(t){e(n,{action:\"errored\",id:i.id,error:String(t&&t.message?t.message:t)})})):e(n,{action:\"initialized\",version:\"3.3.1\"}))}))}();"]));
21
+ workerUrl = urlObject.createObjectURL(new Blob(["!function(){\"use strict\";function t(t){for(var e=new Uint8Array(t),n=[],r=0;r<e.length;r+=8192){for(var i=e.subarray(r,r+8192),o=\"\",a=0;a<i.length;a+=1)o+=String.fromCharCode(i[a]);n.push(o)}return btoa(n.join(\"\"))}function e(t,e){try{t.postMessage(e)}catch(n){t.postMessage({action:\"errored\",id:e&&e.id,error:String(n&&n.message?n.message:n)})}}var n;void 0===n&&(n=self),n.addEventListener(\"message\",(function(r){var i=r.data;i&&(\"init\"!==i.action?\"encode\"===i.action&&Promise.resolve().then((function(){var e=function(t,e,n){if(!t||!e||!n)return{width:t,height:e};if(t<=n&&e<=n)return{width:t,height:e};var r=t>e?n/t:n/e;return{width:Math.max(1,Math.round(t*r)),height:Math.max(1,Math.round(e*r))}}(i.width,i.height,i.maxSize),n=new OffscreenCanvas(e.width,e.height),r=n.getContext(\"2d\");if(!r)throw new Error(\"Cannot create offscreen canvas 2d context for encoding\");if(r.drawImage(i.bitmap,0,0,e.width,e.height),i.bitmap&&\"function\"==typeof i.bitmap.close&&i.bitmap.close(),\"function\"!=typeof n.convertToBlob)throw new Error(\"OffscreenCanvas convertToBlob is not supported\");return n.convertToBlob({type:i.mimeType,quality:i.quality}).then((function(n){return n.arrayBuffer().then((function(r){var o=n.type||i.mimeType;return{action:\"encoded\",id:i.id,dataUrl:\"data:\"+o+\";base64,\"+t(r),width:e.width,height:e.height}}))}))})).then((function(t){e(n,t)})).catch((function(t){e(n,{action:\"errored\",id:i.id,error:String(t&&t.message?t.message:t)})})):e(n,{action:\"initialized\",version:\"3.3.3\"}))}))}();"]));
22
22
  }
23
23
  return {
24
24
  worker: new workerCtor(workerUrl),
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.startRumBatch = startRumBatch;
7
7
  var _browserCore = require("@cloudcare/browser-core");
8
- var _deflate = require("../domain/deflate");
8
+ var _encoderStreamId = require("../domain/encoderStreamId");
9
9
  function startRumBatch(configuration, lifeCycle, telemetryEventObservable, reportError, pageExitObservable, sessionExpireObservable, createEncoder) {
10
10
  var batch = (0, _browserCore.startBatchWithReplica)(configuration, {
11
11
  endpoint: configuration.rumEndpoint,
12
- encoder: createEncoder(_deflate.DeflateEncoderStreamId.RUM)
12
+ encoder: createEncoder(_encoderStreamId.EncoderStreamId.RUM)
13
13
  }, reportError, pageExitObservable, sessionExpireObservable);
14
14
  lifeCycle.subscribe(_browserCore.LifeCycleEventType.RUM_EVENT_COLLECTED, function (serverRumEvent) {
15
15
  if (serverRumEvent.type === _browserCore.RumEventType.VIEW) {
@@ -1 +1 @@
1
- {"version":3,"file":"startRumBatch.js","names":["_browserCore","require","_deflate","startRumBatch","configuration","lifeCycle","telemetryEventObservable","reportError","pageExitObservable","sessionExpireObservable","createEncoder","batch","startBatchWithReplica","endpoint","rumEndpoint","encoder","DeflateEncoderStreamId","RUM","subscribe","LifeCycleEventType","RUM_EVENT_COLLECTED","serverRumEvent","type","RumEventType","VIEW","upsert","view","id","add","event"],"sources":["../../src/transport/startRumBatch.js"],"sourcesContent":["import {\n LifeCycleEventType,\n RumEventType,\n startBatchWithReplica\n} from '@cloudcare/browser-core'\nimport { DeflateEncoderStreamId } from '../domain/deflate'\nexport function startRumBatch(\n configuration,\n lifeCycle,\n telemetryEventObservable,\n reportError,\n pageExitObservable,\n sessionExpireObservable,\n createEncoder\n) {\n const batch = startBatchWithReplica(\n configuration,\n {\n endpoint: configuration.rumEndpoint,\n encoder: createEncoder(DeflateEncoderStreamId.RUM)\n },\n reportError,\n pageExitObservable,\n sessionExpireObservable\n )\n lifeCycle.subscribe(\n LifeCycleEventType.RUM_EVENT_COLLECTED,\n function (serverRumEvent) {\n if (serverRumEvent.type === RumEventType.VIEW) {\n batch.upsert(serverRumEvent, serverRumEvent.view.id)\n } else {\n batch.add(serverRumEvent)\n }\n }\n )\n telemetryEventObservable.subscribe(function (event) {\n batch.add(event)\n })\n return batch\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACO,SAASE,aAAaA,CAC3BC,aAAa,EACbC,SAAS,EACTC,wBAAwB,EACxBC,WAAW,EACXC,kBAAkB,EAClBC,uBAAuB,EACvBC,aAAa,EACb;EACA,IAAMC,KAAK,GAAG,IAAAC,kCAAqB,EACjCR,aAAa,EACb;IACES,QAAQ,EAAET,aAAa,CAACU,WAAW;IACnCC,OAAO,EAAEL,aAAa,CAACM,+BAAsB,CAACC,GAAG;EACnD,CAAC,EACDV,WAAW,EACXC,kBAAkB,EAClBC,uBACF,CAAC;EACDJ,SAAS,CAACa,SAAS,CACjBC,+BAAkB,CAACC,mBAAmB,EACtC,UAAUC,cAAc,EAAE;IACxB,IAAIA,cAAc,CAACC,IAAI,KAAKC,yBAAY,CAACC,IAAI,EAAE;MAC7Cb,KAAK,CAACc,MAAM,CAACJ,cAAc,EAAEA,cAAc,CAACK,IAAI,CAACC,EAAE,CAAC;IACtD,CAAC,MAAM;MACLhB,KAAK,CAACiB,GAAG,CAACP,cAAc,CAAC;IAC3B;EACF,CACF,CAAC;EACDf,wBAAwB,CAACY,SAAS,CAAC,UAAUW,KAAK,EAAE;IAClDlB,KAAK,CAACiB,GAAG,CAACC,KAAK,CAAC;EAClB,CAAC,CAAC;EACF,OAAOlB,KAAK;AACd","ignoreList":[]}
1
+ {"version":3,"file":"startRumBatch.js","names":["_browserCore","require","_encoderStreamId","startRumBatch","configuration","lifeCycle","telemetryEventObservable","reportError","pageExitObservable","sessionExpireObservable","createEncoder","batch","startBatchWithReplica","endpoint","rumEndpoint","encoder","EncoderStreamId","RUM","subscribe","LifeCycleEventType","RUM_EVENT_COLLECTED","serverRumEvent","type","RumEventType","VIEW","upsert","view","id","add","event"],"sources":["../../src/transport/startRumBatch.js"],"sourcesContent":["import {\n LifeCycleEventType,\n RumEventType,\n startBatchWithReplica\n} from '@cloudcare/browser-core'\nimport { EncoderStreamId } from '../domain/encoderStreamId'\nexport function startRumBatch(\n configuration,\n lifeCycle,\n telemetryEventObservable,\n reportError,\n pageExitObservable,\n sessionExpireObservable,\n createEncoder\n) {\n const batch = startBatchWithReplica(\n configuration,\n {\n endpoint: configuration.rumEndpoint,\n encoder: createEncoder(EncoderStreamId.RUM)\n },\n reportError,\n pageExitObservable,\n sessionExpireObservable\n )\n lifeCycle.subscribe(\n LifeCycleEventType.RUM_EVENT_COLLECTED,\n function (serverRumEvent) {\n if (serverRumEvent.type === RumEventType.VIEW) {\n batch.upsert(serverRumEvent, serverRumEvent.view.id)\n } else {\n batch.add(serverRumEvent)\n }\n }\n )\n telemetryEventObservable.subscribe(function (event) {\n batch.add(event)\n })\n return batch\n}\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,gBAAA,GAAAD,OAAA;AACO,SAASE,aAAaA,CAC3BC,aAAa,EACbC,SAAS,EACTC,wBAAwB,EACxBC,WAAW,EACXC,kBAAkB,EAClBC,uBAAuB,EACvBC,aAAa,EACb;EACA,IAAMC,KAAK,GAAG,IAAAC,kCAAqB,EACjCR,aAAa,EACb;IACES,QAAQ,EAAET,aAAa,CAACU,WAAW;IACnCC,OAAO,EAAEL,aAAa,CAACM,gCAAe,CAACC,GAAG;EAC5C,CAAC,EACDV,WAAW,EACXC,kBAAkB,EAClBC,uBACF,CAAC;EACDJ,SAAS,CAACa,SAAS,CACjBC,+BAAkB,CAACC,mBAAmB,EACtC,UAAUC,cAAc,EAAE;IACxB,IAAIA,cAAc,CAACC,IAAI,KAAKC,yBAAY,CAACC,IAAI,EAAE;MAC7Cb,KAAK,CAACc,MAAM,CAACJ,cAAc,EAAEA,cAAc,CAACK,IAAI,CAACC,EAAE,CAAC;IACtD,CAAC,MAAM;MACLhB,KAAK,CAACiB,GAAG,CAACP,cAAc,CAAC;IAC3B;EACF,CACF,CAAC;EACDf,wBAAwB,CAACY,SAAS,CAAC,UAAUW,KAAK,EAAE;IAClDlB,KAAK,CAACiB,GAAG,CAACC,KAAK,CAAC;EAClB,CAAC,CAAC;EACF,OAAOlB,KAAK;AACd","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  export var buildEnv = {
2
- sdkVersion: "3.3.1",
2
+ sdkVersion: "3.3.3",
3
3
  sdkName: 'df_web_rum_sdk'
4
4
  };
5
5
  //# sourceMappingURL=buildEnv.js.map
@@ -2,11 +2,12 @@ import { createBoundedBuffer, display, canUseEventBridge, displayAlreadyInitiali
2
2
  import { validateAndBuildRumConfiguration } from '../domain/configuration';
3
3
  export function createPreStartStrategy(rumPublicApiOptions, getCommonContext, doStartRum) {
4
4
  var ignoreInitIfSyntheticsWillInjectRum = rumPublicApiOptions.ignoreInitIfSyntheticsWillInjectRum;
5
- var startDeflateWorker = rumPublicApiOptions.startDeflateWorker;
5
+ var startCompressionWorker = rumPublicApiOptions.startCompressionWorker;
6
+ var overrideInitConfiguration = rumPublicApiOptions.overrideInitConfiguration;
6
7
  var bufferApiCalls = createBoundedBuffer();
7
8
  var remoteConfigrationCallbacks = createBoundedBuffer();
8
9
  var firstStartViewCall;
9
- var deflateWorker;
10
+ var compressionWorker;
10
11
  var cachedInitConfiguration;
11
12
  var cachedConfiguration;
12
13
  var cachedRemoteConfiguration;
@@ -29,7 +30,7 @@ export function createPreStartStrategy(rumPublicApiOptions, getCommonContext, do
29
30
  bufferApiCalls.remove(firstStartViewCall.callback);
30
31
  initialViewOptions = firstStartViewCall.options;
31
32
  }
32
- var startRumResult = doStartRum(cachedConfiguration, deflateWorker, initialViewOptions);
33
+ var startRumResult = doStartRum(cachedConfiguration, compressionWorker, initialViewOptions);
33
34
  bufferApiCalls.drain(startRumResult);
34
35
  }
35
36
  function doInit(initConfiguration, remoteConfiguration) {
@@ -37,6 +38,9 @@ export function createPreStartStrategy(rumPublicApiOptions, getCommonContext, do
37
38
  if (eventBridgeAvailable) {
38
39
  initConfiguration = overrideInitConfigurationForBridge(initConfiguration);
39
40
  }
41
+ if (overrideInitConfiguration) {
42
+ initConfiguration = overrideInitConfiguration(initConfiguration);
43
+ }
40
44
 
41
45
  // Update the exposed initConfiguration to reflect the bridge and remote configuration overrides
42
46
  cachedInitConfiguration = initConfiguration;
@@ -55,14 +59,14 @@ export function createPreStartStrategy(rumPublicApiOptions, getCommonContext, do
55
59
  display.warn('No storage available for session. We will not send any data.');
56
60
  return;
57
61
  }
58
- if (configuration.compressIntakeRequests && !configuration.sendContentTypeByJson && !eventBridgeAvailable && startDeflateWorker) {
59
- deflateWorker = startDeflateWorker(configuration, 'RUM',
62
+ if (configuration.compressIntakeRequests && !configuration.sendContentTypeByJson && !eventBridgeAvailable && startCompressionWorker) {
63
+ compressionWorker = startCompressionWorker(configuration, 'RUM',
60
64
  // Worker initialization can fail asynchronously, especially in Firefox where even CSP
61
65
  // issues are reported asynchronously. For now, the SDK will continue its execution even if
62
66
  // data won't be sent to Datadog. We could improve this behavior in the future.
63
67
  noop);
64
- if (!deflateWorker) {
65
- // `startDeflateWorker` should have logged an error message explaining the issue
68
+ if (!compressionWorker) {
69
+ // The compression worker starter should have logged an error message explaining the issue
66
70
  return;
67
71
  }
68
72
  }