@arcgis/core 6.0.0-next.1 → 6.0.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/AreaMeasurementAnalysis.d.ts +11 -1
- package/analysis/DimensionSimpleStyle.js +1 -1
- package/analysis/DirectLineMeasurementAnalysis.d.ts +11 -1
- package/analysis/DistanceMeasurementAnalysis.d.ts +8 -0
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/geometry/unitConversion.js +1 -1
- package/arcgisGlobal.d.ts +5 -5
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01803f76bc0d9f2cd566.js +1 -0
- package/assets/esri/core/workers/chunks/{f09c9d9a554c33a753b4.js → 02253bdffbd580af22d8.js} +1 -1
- package/assets/esri/core/workers/chunks/{5078b66ba31b770b689f.js → 037a8cc19debbaaa4e10.js} +1 -1
- package/assets/esri/core/workers/chunks/066550852483ab8f77bc.js +1 -0
- package/assets/esri/core/workers/chunks/{1ede8666d804c553803e.js → 0b6941781e35ce0f7274.js} +1 -1
- package/assets/esri/core/workers/chunks/0ccab50877b24f862d6e.js +1 -0
- package/assets/esri/core/workers/chunks/0f725cf79ce00e790a7d.js +1 -0
- package/assets/esri/core/workers/chunks/{a0d459bdb91ee892d4b6.js → 116293b1ee788a89ce1e.js} +1 -1
- package/assets/esri/core/workers/chunks/12a7997a40c77f5c9160.js +1 -0
- package/assets/esri/core/workers/chunks/{a7325ebb7edf3273bb34.js → 12b84262dedc6b393136.js} +1 -1
- package/assets/esri/core/workers/chunks/1b077c92345ffb5916c2.js +1 -0
- package/assets/esri/core/workers/chunks/{6dd0b79fa3a629ab4f27.js → 1bca39e0e651426bdbb5.js} +1 -1
- package/assets/esri/core/workers/chunks/1c0c5cb13c2590aae906.js +1 -0
- package/assets/esri/core/workers/chunks/{8959a825f5e1ce6f38ac.js → 1c65ab9ed611c322ce27.js} +1 -1
- package/assets/esri/core/workers/chunks/1e0d2715d603f48a7e0b.js +1 -0
- package/assets/esri/core/workers/chunks/261fea092ee7d27608a0.js +1 -0
- package/assets/esri/core/workers/chunks/2686fe5b62dd0be699c0.js +1 -0
- package/assets/esri/core/workers/chunks/2a97268000c6d03ef720.js +1 -0
- package/assets/esri/core/workers/chunks/{83589144eeeb08f45557.js → 2aeb5cc32284dd3e4d22.js} +1 -1
- package/assets/esri/core/workers/chunks/2d9a1f23ec6ce90723ac.js +1 -0
- package/assets/esri/core/workers/chunks/2e096537a3a5555a4a93.js +1 -0
- package/assets/esri/core/workers/chunks/{7a05b18f655c1167ce0a.js → 2ef5237e4c876d6a4ee0.js} +1 -1
- package/assets/esri/core/workers/chunks/37d6a264a3f1d8072aa0.js +1 -0
- package/assets/esri/core/workers/chunks/3b3e519f15ed52c83f0c.js +1 -0
- package/assets/esri/core/workers/chunks/3c0ed15b544df6fb0903.js +1 -0
- package/assets/esri/core/workers/chunks/{b612de42ee86c0d95247.js → 3d9d7d3a40b51eb7ee3d.js} +1 -1
- package/assets/esri/core/workers/chunks/3df5500a85345577480a.js +1 -0
- package/assets/esri/core/workers/chunks/3ffda5bf0b91700dc308.js +1 -0
- package/assets/esri/core/workers/chunks/40a584cb952e94326e9e.js +1 -0
- package/assets/esri/core/workers/chunks/{1317ecdfd0cfa683a493.js → 42323093827adffe56d3.js} +1 -1
- package/assets/esri/core/workers/chunks/{1ba0dfbe0958cdbd7c9f.js → 42fd2a7b22b03dacc6a7.js} +1 -1
- package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +1 -0
- package/assets/esri/core/workers/chunks/{d201fbf3ceff946d2bd6.js → 44d5508042cacdfcac47.js} +1 -1
- package/assets/esri/core/workers/chunks/4503b20ca6a80fb63d72.js +1 -0
- package/assets/esri/core/workers/chunks/45367aa8e5c5d574de94.js +1 -0
- package/assets/esri/core/workers/chunks/45800373650fbc8262e6.js +1 -0
- package/assets/esri/core/workers/chunks/{6a7ab1ef9a37e87db5ae.js → 46a7da93a63663878583.js} +1 -1
- package/assets/esri/core/workers/chunks/46b4fb6a7fe4877b0efc.js +1120 -0
- package/assets/esri/core/workers/chunks/47d074136a7f8e551a9a.js +1 -0
- package/assets/esri/core/workers/chunks/4911ce62421a6c3320b0.js +1 -0
- package/assets/esri/core/workers/chunks/4a1e23e021bac37a88ab.js +1 -0
- package/assets/esri/core/workers/chunks/4a6b92ecbb1f1c55cc43.js +1 -0
- package/assets/esri/core/workers/chunks/4debf2d9c3465250ef7a.js +1 -0
- package/assets/esri/core/workers/chunks/4e544de61f07ca660236.js +1 -0
- package/assets/esri/core/workers/chunks/4e8e322b469657ac22e2.js +1 -0
- package/assets/esri/core/workers/chunks/505227797bcf2a1d908d.js +1 -0
- package/assets/esri/core/workers/chunks/{67ac6b326bf80fc3d33d.js → 53be85d04cd2da4f391d.js} +1 -1
- package/assets/esri/core/workers/chunks/54778dec1598818d93cb.js +1 -0
- package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +1 -0
- package/assets/esri/core/workers/chunks/557671c897ca5563be6c.js +1 -0
- package/assets/esri/core/workers/chunks/567a65f4203f6e81f4b4.js +1 -0
- package/assets/esri/core/workers/chunks/5c7780f804d789cb37f5.js +1 -0
- package/assets/esri/core/workers/chunks/606ea251075fe81a1206.js +1 -0
- package/assets/esri/core/workers/chunks/{ceb680688fe7e570a774.js → 608be1172a908e92b9f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{e521bb9ee2030245c3ce.js → 612104dff305ff062dfa.js} +2 -2
- package/assets/esri/core/workers/chunks/6299be5e7e26bf3c6859.js +1 -0
- package/assets/esri/core/workers/chunks/{3ac9dcbb0571a2580236.js → 62c8c9ad09e0166207fd.js} +1 -1
- package/assets/esri/core/workers/chunks/6400446b7615b97c3521.js +1 -0
- package/assets/esri/core/workers/chunks/6431480ba0fa8c8d487f.js +1 -0
- package/assets/esri/core/workers/chunks/6588725275c75fae0d9c.js +1 -0
- package/assets/esri/core/workers/chunks/665e31c494d2af505acc.js +1 -0
- package/assets/esri/core/workers/chunks/{9232f57623e1fa3ccabc.js → 67e4b5651fd7ff7d8cf0.js} +1 -1
- package/assets/esri/core/workers/chunks/68be3fb88ca61f82fb90.js +1 -0
- package/assets/esri/core/workers/chunks/6c9266120d46e8c69dbf.js +1 -0
- package/assets/esri/core/workers/chunks/6c9acd9e4e201dc380e9.js +1 -0
- package/assets/esri/core/workers/chunks/6ebe73f69ae822053b70.js +1 -0
- package/assets/esri/core/workers/chunks/709e019885822b1f6f3e.js +1 -0
- package/assets/esri/core/workers/chunks/70cc2d79653d66e85b58.js +1 -0
- package/assets/esri/core/workers/chunks/7449568eb2305bf2d650.js +1 -0
- package/assets/esri/core/workers/chunks/745a153d0cd34faa124e.js +1 -0
- package/assets/esri/core/workers/chunks/7572c2bc5062e66f6330.js +1 -0
- package/assets/esri/core/workers/chunks/76196c414e48834f7b92.js +1 -0
- package/assets/esri/core/workers/chunks/78472a57c2ba146fec65.js +1 -0
- package/assets/esri/core/workers/chunks/7ef182e24cad50815b4e.js +1 -0
- package/assets/esri/core/workers/chunks/7f0f9dddc44b1f1600f0.js +1 -0
- package/assets/esri/core/workers/chunks/814751e705c05099f864.js +1 -0
- package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +1 -0
- package/assets/esri/core/workers/chunks/8487727f1197cf7dbf50.js +1 -0
- package/assets/esri/core/workers/chunks/88e54449261ef94e390d.js +1 -0
- package/assets/esri/core/workers/chunks/8b0d5551978ab0aac0d1.js +1 -0
- package/assets/esri/core/workers/chunks/8d0c2de92770a1567536.js +1 -0
- package/assets/esri/core/workers/chunks/900181f68449d8f82eeb.js +1 -0
- package/assets/esri/core/workers/chunks/939942b00ba380e2957e.js +1 -0
- package/assets/esri/core/workers/chunks/943a0f140813ee4ab04a.js +1 -0
- package/assets/esri/core/workers/chunks/96c3900685cfb2a8ca12.js +1 -0
- package/assets/esri/core/workers/chunks/9ce91a909eccc4dfe388.js +1 -0
- package/assets/esri/core/workers/chunks/{c76c42c74eedd43263d3.js → 9dd1fc56eb1ea6eb705e.js} +1 -1
- package/assets/esri/core/workers/chunks/{86a051e9fe71aa356108.js → 9e3e442a9874ed23a043.js} +1 -1
- package/assets/esri/core/workers/chunks/{aa1054834738aef48bda.js → a0356702f2d3f787aeac.js} +1 -1
- package/assets/esri/core/workers/chunks/a40b6d8b5c73e06e14d4.js +1 -0
- package/assets/esri/core/workers/chunks/{1ba1f705b6ce5c8ea702.js → a655ebdb4bf0660615a2.js} +1 -1
- package/assets/esri/core/workers/chunks/a8286febe371dc186aaa.js +1 -0
- package/assets/esri/core/workers/chunks/aaba33611753c6aada68.js +1 -0
- package/assets/esri/core/workers/chunks/aba42885c5d6b2b5fe7f.js +1 -0
- package/assets/esri/core/workers/chunks/ad76f7ab2f3e6d5a5b3c.js +1 -0
- package/assets/esri/core/workers/chunks/ae40eac1eadd1a537bf4.js +1 -0
- package/assets/esri/core/workers/chunks/aeaaff7a4b1a99540f52.js +1 -0
- package/assets/esri/core/workers/chunks/af349c7bc8ef41a0e1bd.js +1 -0
- package/assets/esri/core/workers/chunks/af75747b06d79446a855.js +1 -0
- package/assets/esri/core/workers/chunks/b564ec4e03478f5659db.js +1 -0
- package/assets/esri/core/workers/chunks/bbf993dba74850bbf9d7.js +1 -0
- package/assets/esri/core/workers/chunks/bc0f54a2c15502b630ec.js +1 -0
- package/assets/esri/core/workers/chunks/{ff3a53c3f00335552317.js → c29c474c4b1049352d3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ab25ee06041f907b9a2.js → c2c1f51a4668055c2838.js} +1 -1
- package/assets/esri/core/workers/chunks/c337fc0e6dc69c233e6d.js +1 -0
- package/assets/esri/core/workers/chunks/{a7985d20fa6e8d4878e7.js → d0f5bee9db1ad51ae687.js} +1 -1
- package/assets/esri/core/workers/chunks/d6ad4390df576198e45b.js +1 -0
- package/assets/esri/core/workers/chunks/d7f6021fd41b9571a02c.js +1 -0
- package/assets/esri/core/workers/chunks/d90a3bfd45b5ed4092e0.js +1 -0
- package/assets/esri/core/workers/chunks/dba280c370df13196711.js +1 -0
- package/assets/esri/core/workers/chunks/ddf0671976648f621269.js +1 -0
- package/assets/esri/core/workers/chunks/{c18189710d6198516175.js → de5ecb567bd69c613e9d.js} +1 -1
- package/assets/esri/core/workers/chunks/e10b57aefcc89671116e.js +1 -0
- package/assets/esri/core/workers/chunks/{534186fc921a0ccf58dc.js → e1f5d00878f27e1d413e.js} +1 -1
- package/assets/esri/core/workers/chunks/e65dfa19f030ec298437.js +1 -0
- package/assets/esri/core/workers/chunks/e932951598499befabf5.js +1 -0
- package/assets/esri/core/workers/chunks/{e1ba915dae7747932c0f.js → eb04e1717a1002cda3ab.js} +1 -1
- package/assets/esri/core/workers/chunks/f122c18af10e56f9ec2b.js +1 -0
- package/assets/esri/core/workers/chunks/f1df76f098a3cc924832.js +1 -0
- package/assets/esri/core/workers/chunks/f1f90adae13b04898008.js +1 -0
- package/assets/esri/core/workers/chunks/f46d9a19f79d4a4bd354.js +1 -0
- package/assets/esri/core/workers/chunks/f4f9d08b2df856e3b694.js +1 -0
- package/assets/esri/core/workers/chunks/{711cfb84659cb4437679.js → f528ac5c648ca6a98582.js} +1 -1
- package/assets/esri/core/workers/chunks/f92364afaefbac7e8f77.js +1 -0
- package/assets/esri/core/workers/chunks/fb444954be74c1962ced.js +1 -0
- package/assets/esri/core/workers/chunks/fc44227c1756f65b95df.js +1 -0
- package/assets/esri/core/workers/chunks/{72019baeba520edb6bb0.js → fc44d45598a7476bc606.js} +1 -1
- package/assets/esri/core/workers/chunks/fecaf0bc28aeea4d15db.js +1 -0
- package/assets/esri/libs/librust-parquet/pkg/parquet_bg.wasm +0 -0
- package/assets/esri/themes/base/_mixins.scss +2 -2
- package/assets/esri/themes/base/widgets/_Attribution.scss +1 -1
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +2 -2
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -5
- package/assets/esri/themes/base/widgets/_Bookmarks.scss +1 -1
- package/assets/esri/themes/base/widgets/_BuildingLevelPicker.scss +2 -2
- package/assets/esri/themes/base/widgets/_BuildingPhasePicker.scss +5 -5
- package/assets/esri/themes/base/widgets/_CatalogLayerList.scss +1 -1
- package/assets/esri/themes/base/widgets/_Compass.scss +0 -2
- package/assets/esri/themes/base/widgets/_DirectionalPad.scss +4 -10
- package/assets/esri/themes/base/widgets/_Directions.scss +40 -40
- package/assets/esri/themes/base/widgets/_Editor.scss +7 -7
- package/assets/esri/themes/base/widgets/_Expand.scss +1 -1
- package/assets/esri/themes/base/widgets/_Feature.scss +1 -1
- package/assets/esri/themes/base/widgets/_FeatureForm.scss +6 -6
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +1 -1
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationList.scss +1 -1
- package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationSettings.scss +4 -4
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +27 -27
- package/assets/esri/themes/base/widgets/_FeatureTemplates.scss +1 -1
- package/assets/esri/themes/base/widgets/_Features.scss +6 -6
- package/assets/esri/themes/base/widgets/_FilterBuilder.scss +1 -1
- package/assets/esri/themes/base/widgets/_FilterCondition.scss +1 -1
- package/assets/esri/themes/base/widgets/_Grid.scss +18 -18
- package/assets/esri/themes/base/widgets/_GridControls.scss +11 -11
- package/assets/esri/themes/base/widgets/_LayerList.scss +1 -1
- package/assets/esri/themes/base/widgets/_Legend.scss +5 -5
- package/assets/esri/themes/base/widgets/_NavigationToggle.scss +4 -1
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +23 -28
- package/assets/esri/themes/base/widgets/_ResponsiveToolbar.scss +0 -2
- package/assets/esri/themes/base/widgets/_SearchResultRenderer.scss +1 -1
- package/assets/esri/themes/base/widgets/_SelectionList.scss +15 -15
- package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +3 -5
- package/assets/esri/themes/base/widgets/_ShadowCast.scss +11 -11
- package/assets/esri/themes/base/widgets/_Sketch.scss +1 -1
- package/assets/esri/themes/base/widgets/_Slice.scss +3 -3
- package/assets/esri/themes/base/widgets/_SnappingControls.scss +1 -1
- package/assets/esri/themes/base/widgets/_TimeSlider.scss +5 -5
- package/assets/esri/themes/base/widgets/_TimeZoneLabel.scss +5 -4
- package/assets/esri/themes/base/widgets/_Tooltip.scss +14 -17
- package/assets/esri/themes/base/widgets/_UtilityNetworkAssociations.scss +2 -2
- package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +1 -1
- package/assets/esri/themes/base/widgets/_UtilityNetworkValidateTopology.scss +2 -2
- package/assets/esri/themes/base/widgets/_ValuePicker.scss +2 -2
- package/assets/esri/themes/base/widgets/_VideoPlayer.scss +5 -5
- package/assets/esri/themes/base/widgets/_Widget.scss +5 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/messages.en.json +1 -1
- package/{basemaps/BasemapCollection.d.ts → basemapGallery/BasemapGalleryModel.d.ts} +8 -8
- package/{basemaps/BasemapCollection.js → basemapGallery/BasemapGalleryModel.js} +1 -1
- package/{basemaps → basemapGallery}/BasemapsSource.d.ts +1 -1
- package/{basemaps → basemapGallery}/BasemapsSource.js +1 -1
- package/{basemaps → basemapGallery}/LocalBasemapsSource.d.ts +2 -2
- package/{basemaps → basemapGallery}/LocalBasemapsSource.js +1 -1
- package/{basemaps → basemapGallery}/PortalBasemapsSource.d.ts +2 -2
- package/{basemaps → basemapGallery}/PortalBasemapsSource.js +1 -1
- package/{basemaps → basemapGallery}/support/BasemapItem.d.ts +2 -2
- package/{basemaps → basemapGallery}/support/BasemapItem.js +1 -1
- package/{basemaps → basemapGallery}/types.d.ts +2 -2
- package/chunks/AtmosphereCompositing.glsl.js +1 -1
- package/chunks/ChapmanAtmosphere.glsl.js +3 -3
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/Component.glsl.js +41 -41
- package/chunks/DefaultMaterial.glsl.js +2 -2
- package/chunks/EdgeShader.glsl.js +9 -9
- package/chunks/Fog.glsl.js +5 -5
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/GlobalIllumination.glsl.js +13 -11
- package/chunks/GlobalIlluminationBlur.glsl.js +3 -5
- package/chunks/GlobalIlluminationUpscale.glsl.js +1 -1
- package/chunks/HUDMaterial.glsl.js +13 -13
- package/chunks/Haze.glsl.js +6 -6
- package/chunks/HazeCompositing.glsl.js +1 -1
- package/chunks/LaserlinePath.glsl.js +6 -6
- package/chunks/LineCallout.glsl.js +1 -1
- package/chunks/LineMarker.glsl.js +5 -5
- package/chunks/NavigationDepth.glsl.js +2 -2
- package/chunks/Path.glsl.js +1 -1
- package/chunks/Pattern.glsl.js +26 -26
- package/chunks/Precipitation.glsl.js +7 -7
- package/chunks/RealisticTree.glsl.js +2 -2
- package/chunks/RibbonLine.glsl.js +80 -73
- package/chunks/ShadowCastAccumulate.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +5 -5
- package/chunks/ShadowHighlightBuffer.glsl.js +1 -1
- package/chunks/SimpleAtmosphere.glsl.js +4 -4
- package/chunks/Terrain.glsl.js +29 -32
- package/chunks/Viewshed.glsl.js +2 -2
- package/chunks/Water.glsl.js +2 -2
- package/config.js +1 -1
- package/core/Loadable.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/colorUtils.js +1 -1
- package/core/has.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/units.js +1 -1
- package/core/workers/workerFactory.js +1 -1
- package/form/elements/inputs/DynamicChoiceInput.d.ts +35 -5
- package/geometry/HeightModelInfo.js +1 -1
- package/geometry/operators/proximityOperator.js +1 -1
- package/geometry/projectionUtils.js +1 -1
- package/geometry/support/meshUtils.d.ts +1 -1
- package/geometry/support/scaleUtils.js +1 -1
- package/geometry/support/wkt.js +2 -0
- package/kernel.js +1 -1
- package/layers/BaseDynamicLayer.d.ts +1 -0
- package/layers/BaseElevationLayer.d.ts +2 -0
- package/layers/BaseTileLayer.d.ts +12 -9
- package/layers/CSVLayer.d.ts +0 -15
- package/layers/FeatureLayer.d.ts +2 -15
- package/layers/GeoJSONLayer.d.ts +0 -52
- package/layers/GeoRSSLayer.d.ts +0 -44
- package/layers/GeospatialPDFLayer.d.ts +2 -5
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/ParquetLayer.d.ts +100 -12
- package/layers/ParquetLayer.js +1 -1
- package/layers/SketchLayer.d.ts +0 -1
- package/layers/VectorTileLayer.d.ts +2 -12
- package/layers/geospatialPDF/renderExtentUtils.js +1 -1
- package/layers/graphics/data/FeatureStore.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/geometryUtils.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/sources/FeatureLayerSource.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/transferFeatures.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/knowledgeGraph/nodeMovementUtils.js +1 -1
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/mixins/RefreshableLayer.d.ts +1 -3
- package/layers/mixins/ScaleRangeLayer.js +1 -1
- package/layers/mixins/SublayersOwner.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/datasets/byteStreamUtils.js +1 -1
- package/layers/raster/formats/tiffParser.js +1 -1
- package/layers/support/ParquetPortalItemData.d.ts +2 -0
- package/layers/support/ParquetPortalItemData.js +1 -1
- package/layers/support/PortalItemData.d.ts +21 -0
- package/layers/support/PortalItemData.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/layersLoader.js +1 -1
- package/layers/support/parquetUtils.d.ts +1 -1
- package/layers/support/types.d.ts +1 -1
- package/package.json +3 -3
- package/popup/FeaturesModel.d.ts +27 -6
- package/popup/FeaturesModel.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/renderers/VectorFieldRenderer.d.ts +4 -4
- package/rest/print.d.ts +49 -3
- package/rest/print.js +1 -1
- package/rest/query/operations/pbfFlatFeatureSet.js +1 -1
- package/rest/support/printTaskUtils.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/dotDensity.js +1 -1
- package/smartMapping/renderers/heatmap.js +1 -1
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/renderers/support/spikeUtils.js +3 -3
- package/smartMapping/renderers/type.js +1 -1
- package/smartMapping/statistics/heatmapStatistics.js +1 -1
- package/smartMapping/statistics/histogram.js +1 -1
- package/smartMapping/statistics/summaryStatistics.js +1 -1
- package/smartMapping/statistics/summaryStatisticsForAttributes.js +1 -1
- package/smartMapping/statistics/uniqueValues.js +1 -1
- package/smartMapping/support/adapters/support/layerUtils.js +1 -1
- package/smartMapping/types.d.ts +3 -1
- package/symbols/LineSymbol3DLayer.js +1 -1
- package/symbols/callouts/LineCallout3D.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/edges/Edges3D.js +1 -1
- package/symbols/support/Symbol3DIconOutline.js +1 -1
- package/symbols/support/Symbol3DOutline.js +1 -1
- package/symbols/support/Symbol3DTextBorder.js +1 -1
- package/symbols/support/defaults3D.js +1 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +6 -4
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
- package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +6 -4
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeatureSourceEventLog.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
- package/views/2d/layers/features/sources/strategies/AFeatureTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
- package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
- package/views/3d/analysis/Viewshed/types.d.ts +3 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +3 -0
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +2 -1
- package/views/3d/environment/Environment.d.ts +2 -2
- package/views/3d/environment/Environment.js +1 -1
- package/views/3d/environment/EnvironmentView.js +2 -0
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/originGeometryVisualElementUtils.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
- package/views/3d/layers/FlowSubView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/MediaLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DBufferGraphicLayer.js +2 -0
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DDrapedBufferGraphicLayer.js +2 -0
- package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayerBase.js +2 -0
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DStageObjectGraphicLayer.js +2 -0
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/LabelInfo.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
- package/views/3d/layers/graphics/pointUtils.js +1 -1
- package/views/3d/layers/support/FeatureMemory.js +1 -1
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
- package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +1 -1
- package/views/3d/layers/support/featureTileQuery3D.js +1 -1
- package/views/3d/support/PBFDecoder.js +1 -1
- package/views/3d/support/elevationUpdateUtils.js +1 -1
- package/views/3d/support/popupHitTest.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/Component.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +13 -13
- package/views/3d/webgl-engine/core/shaderLibrary/bindUniforms.js +2 -0
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/lastFrameUniforms.js +2 -0
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +31 -29
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +26 -12
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +14 -14
- package/views/3d/webgl-engine/core/shaderLibrary/shading/NormalUtils.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadGlobalIllumination.glsl.js +16 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/evaluateSceneLightingFragment.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/lightingUniforms.js +2 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/pbrGlobals.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
- package/views/3d/webgl-engine/effects/WeatherFader.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanApproximation.glsl.js +3 -3
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanRaymarching.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/SimpleAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationColorQuantization.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +5 -5
- package/views/3d/webgl-engine/effects/haze/Haze.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/haze/HazeCompositing.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/raymarching/DistanceFalloff.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/shadowAccumulation/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
- package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/affectsGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/bufferGeometryUtils.js +2 -0
- package/views/3d/webgl-engine/lib/edgeRendering/AdjustProjectedPosition.glsl.js +5 -5
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeUtil.glsl.js +11 -11
- package/views/3d/webgl-engine/materials/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/materials/Water.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/AtmosphereCompositing.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Viewshed.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/lineUniforms.js +2 -0
- package/views/DOMContainer.d.ts +28 -9
- package/views/DOMContainer.js +1 -1
- package/views/PopupView.d.ts +6 -0
- package/views/SceneView.d.ts +4 -10
- package/views/SceneView.js +1 -1
- package/views/VideoView.d.ts +27 -9
- package/views/View.d.ts +20 -19
- package/views/View.js +1 -1
- package/views/View2D.d.ts +13 -13
- package/views/draw/Draw.d.ts +1 -1
- package/views/draw/support/InteractiveHandle.js +1 -1
- package/views/draw/support/PluginContext.js +1 -1
- package/views/draw/support/managers/TooltipManager.js +1 -1
- package/views/interactive/options/SnappingOptions.d.ts +29 -12
- package/views/interactive/options/TooltipOptions.d.ts +9 -1
- package/views/interactive/options/ValueOptions.d.ts +9 -2
- package/views/interactive/options/ViewOptions.d.ts +82 -6
- package/views/interactive/snapping/FeatureSnappingSourceInfo.js +1 -1
- package/views/interactive/snapping/SnappingManagerPool.js +1 -1
- package/views/interactive/snapping/SnappingOptions.d.ts +1 -1
- package/views/interactive/snapping/SnappingVisualizer.js +1 -1
- package/views/interactive/support/Units.d.ts +1 -0
- package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
- package/views/interactive/tooltip/components/ElevationModeSelect.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
- package/views/layers/FeatureLikeLayerView.d.ts +2 -2
- package/views/layers/GraphicsLayerView.d.ts +1 -0
- package/views/layers/ImageryLayerView.d.ts +1 -0
- package/views/layers/LayerView.js +1 -1
- package/views/layers/LineOfSightLayerView.d.ts +3 -4
- package/views/layers/ParquetLayerView.d.ts +15 -0
- package/views/layers/ParquetLayerView.js +1 -1
- package/views/layers/ViewshedLayerView.d.ts +5 -6
- package/views/support/layerViewUtils.js +1 -1
- package/views/support/projectionUtils.js +1 -1
- package/views/types.d.ts +3 -1
- package/webdoc/support/saveUtils.js +1 -1
- package/webdoc/support/unsupportedErrors.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.d.ts +2 -2
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery/support/BasemapGalleryItem.d.ts +3 -3
- package/widgets/BasemapGallery/support/LocalBasemapsSource.d.ts +2 -2
- package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -2
- package/widgets/BasemapGallery/types.d.ts +3 -3
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/expressions/expressionUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +6 -0
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +13 -8
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.d.ts +19 -9
- package/widgets/Expand.js +1 -1
- package/widgets/FeatureForm.d.ts +2 -2
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/Legend.d.ts +1 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/draw/HeightMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
- package/widgets/OrientedImageryViewer/types.d.ts +20 -0
- package/widgets/OrientedImageryViewer.d.ts +9 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/Print/PrintViewModel.d.ts +3 -2
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +14 -9
- package/widgets/Sketch/support/ResponsiveToolbar/ResponsiveToolbar.js +1 -1
- package/widgets/Sketch.d.ts +10 -10
- package/widgets/Track/TrackViewModel.d.ts +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace/types.d.ts +2 -2
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/PluginSettingsControls.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.d.ts +9 -2
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/SnappingControls.d.ts +1 -1
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/componentsUtils.js +1 -1
- package/arcade/geometry/wkt.js +0 -2
- package/assets/esri/core/workers/chunks/00a600c71ceebe7bfeee.js +0 -1
- package/assets/esri/core/workers/chunks/00d24415bdeb0adae3df.js +0 -1
- package/assets/esri/core/workers/chunks/0193df3f9fb23633da87.js +0 -1
- package/assets/esri/core/workers/chunks/01b00fbf6a6a22d573ee.js +0 -1
- package/assets/esri/core/workers/chunks/02d4f91652a79d2b637e.js +0 -1
- package/assets/esri/core/workers/chunks/050c4b212f2b5691db34.js +0 -1
- package/assets/esri/core/workers/chunks/05963f57cbe5a5249496.js +0 -1
- package/assets/esri/core/workers/chunks/05d865b2736f452ad2aa.js +0 -1
- package/assets/esri/core/workers/chunks/06e7400f5ebe0719b81c.js +0 -1
- package/assets/esri/core/workers/chunks/07aa6d36f1006b6ab7ff.js +0 -1
- package/assets/esri/core/workers/chunks/084222c00d263a534952.js +0 -1
- package/assets/esri/core/workers/chunks/0b36abcbf03037b4073d.js +0 -1
- package/assets/esri/core/workers/chunks/107b025dc5b09465a78f.js +0 -1
- package/assets/esri/core/workers/chunks/1b551ef3d84d9c1e93f9.js +0 -1
- package/assets/esri/core/workers/chunks/1ef39aef6b33c530cbe4.js +0 -1
- package/assets/esri/core/workers/chunks/1f3148cebee1961249a4.js +0 -1
- package/assets/esri/core/workers/chunks/1f43e06dcfe56229bb0f.js +0 -1
- package/assets/esri/core/workers/chunks/2164fcaced72b0fda31f.js +0 -1
- package/assets/esri/core/workers/chunks/25b0885d3bc190b28c04.js +0 -1
- package/assets/esri/core/workers/chunks/25d6c674b1c4829f040f.js +0 -1
- package/assets/esri/core/workers/chunks/260dcb79dfd0f981949f.js +0 -1
- package/assets/esri/core/workers/chunks/2a570ce6b99dac6ee996.js +0 -1
- package/assets/esri/core/workers/chunks/2e6a2f4d686b71249c0e.js +0 -1
- package/assets/esri/core/workers/chunks/2f9033890c465acff698.js +0 -1
- package/assets/esri/core/workers/chunks/303676d1b10676c9cab4.js +0 -1
- package/assets/esri/core/workers/chunks/303fde8f3459dde16555.js +0 -1
- package/assets/esri/core/workers/chunks/32d08b571bbd996d4e6d.js +0 -1
- package/assets/esri/core/workers/chunks/33956f12505e72e60293.js +0 -1
- package/assets/esri/core/workers/chunks/350540770781b281c39a.js +0 -1
- package/assets/esri/core/workers/chunks/37a636f61cfe89c6bfd1.js +0 -1
- package/assets/esri/core/workers/chunks/380cc538c1ab453870fa.js +0 -1
- package/assets/esri/core/workers/chunks/3880d2c7fb14955d7f93.js +0 -1
- package/assets/esri/core/workers/chunks/3b017b718ea2d4ed498f.js +0 -1
- package/assets/esri/core/workers/chunks/40fb1910f780e78c128c.js +0 -1
- package/assets/esri/core/workers/chunks/4310c8d2b40ae69c3681.js +0 -1
- package/assets/esri/core/workers/chunks/43fc42405167a5537039.js +0 -1
- package/assets/esri/core/workers/chunks/4848f195eb93cc93dd15.js +0 -1
- package/assets/esri/core/workers/chunks/4cddd217383b9333f32e.js +0 -1
- package/assets/esri/core/workers/chunks/4d82db661365daa513a6.js +0 -1
- package/assets/esri/core/workers/chunks/4fa59f8ed3b7b6239548.js +0 -1
- package/assets/esri/core/workers/chunks/57970d43cdcc5cf57a30.js +0 -1
- package/assets/esri/core/workers/chunks/5e184fd47e76eb976fa9.js +0 -1
- package/assets/esri/core/workers/chunks/5ea8809b6519c05ad9f6.js +0 -1
- package/assets/esri/core/workers/chunks/5f3ab77a79c408423fde.js +0 -1
- package/assets/esri/core/workers/chunks/5fd099ca1024707387b2.js +0 -1
- package/assets/esri/core/workers/chunks/604344e45c0f27497188.js +0 -1
- package/assets/esri/core/workers/chunks/61ad8306ab79aca79505.js +0 -1
- package/assets/esri/core/workers/chunks/633a9051580c5302d2f7.js +0 -1
- package/assets/esri/core/workers/chunks/6469c0d18d3663e7da4b.js +0 -1
- package/assets/esri/core/workers/chunks/65654e481cce9ae40e54.js +0 -1
- package/assets/esri/core/workers/chunks/669e39c3437d7273f0c7.js +0 -1
- package/assets/esri/core/workers/chunks/68e24fa3f564c2a5c9fd.js +0 -1
- package/assets/esri/core/workers/chunks/6aebf7cfd294e88bf926.js +0 -1
- package/assets/esri/core/workers/chunks/71f739bb3f7350704af6.js +0 -1
- package/assets/esri/core/workers/chunks/750a9f3cdb96b966274a.js +0 -1
- package/assets/esri/core/workers/chunks/776565dd9741ba2ba151.js +0 -1
- package/assets/esri/core/workers/chunks/798a63653f82c0e842c5.js +0 -1
- package/assets/esri/core/workers/chunks/841f67baf6a1634ada48.js +0 -1
- package/assets/esri/core/workers/chunks/84fcbf7a1d04f01685d1.js +0 -1
- package/assets/esri/core/workers/chunks/897fc8e78a0d54a5ff5a.js +0 -1
- package/assets/esri/core/workers/chunks/8af92bcc075e03e3e902.js +0 -1742
- package/assets/esri/core/workers/chunks/8e511079918e2fd9261f.js +0 -1
- package/assets/esri/core/workers/chunks/8e7a33cc1f83063043f2.js +0 -1
- package/assets/esri/core/workers/chunks/8fcfd515ee1b18c902e5.js +0 -1
- package/assets/esri/core/workers/chunks/9001e9a1e81bce175ddd.js +0 -1
- package/assets/esri/core/workers/chunks/9432feca48ca3e5849bd.js +0 -1
- package/assets/esri/core/workers/chunks/956a40f40bde416efe93.js +0 -1
- package/assets/esri/core/workers/chunks/95b82cbbe355266c65d7.js +0 -1
- package/assets/esri/core/workers/chunks/9673a9efec86040b8c13.js +0 -1
- package/assets/esri/core/workers/chunks/97dbbedea9fe03bd1306.js +0 -1
- package/assets/esri/core/workers/chunks/985b3f18cee87c3fe022.js +0 -1
- package/assets/esri/core/workers/chunks/9a7fc93cc693fd12b5d8.js +0 -1
- package/assets/esri/core/workers/chunks/9c0fd8baa00ee9733ba4.js +0 -1
- package/assets/esri/core/workers/chunks/a010d2e4e34eb7bc1fec.js +0 -1
- package/assets/esri/core/workers/chunks/a20526996d01386ec3b7.js +0 -1
- package/assets/esri/core/workers/chunks/a23272a7a47a95f6ddea.js +0 -1
- package/assets/esri/core/workers/chunks/a7edf7541569fef77cb3.js +0 -1
- package/assets/esri/core/workers/chunks/aa5b42e44d2959fdacd3.js +0 -1
- package/assets/esri/core/workers/chunks/ae2181805d8ba130babc.js +0 -1
- package/assets/esri/core/workers/chunks/b05a41a60e30935644be.js +0 -1
- package/assets/esri/core/workers/chunks/b0cfec11c758eed8095f.js +0 -1
- package/assets/esri/core/workers/chunks/bff767ec5bb4c0d6b324.js +0 -1
- package/assets/esri/core/workers/chunks/c906f984b2b6e7578c06.js +0 -1
- package/assets/esri/core/workers/chunks/ca7fb75e2c62e7d37122.js +0 -1
- package/assets/esri/core/workers/chunks/cbdebdfa5f2cded29d0d.js +0 -1
- package/assets/esri/core/workers/chunks/cbe6c0f32608cb504695.js +0 -1
- package/assets/esri/core/workers/chunks/cfae60b9d2f2939e9c16.js +0 -1
- package/assets/esri/core/workers/chunks/d270cc9807161033686e.js +0 -1
- package/assets/esri/core/workers/chunks/d56780290e0218d3e9de.js +0 -1
- package/assets/esri/core/workers/chunks/d6d5a9e73ee43d6066d3.js +0 -1
- package/assets/esri/core/workers/chunks/d89fe41c71c9621c41ae.js +0 -1
- package/assets/esri/core/workers/chunks/da18d96b35af20e73b3b.js +0 -1
- package/assets/esri/core/workers/chunks/de02a6a1f4810f99e9bb.js +0 -1
- package/assets/esri/core/workers/chunks/df0481bcc1613ee4b7af.js +0 -1
- package/assets/esri/core/workers/chunks/e22d45aeef293a5ffb78.js +0 -1
- package/assets/esri/core/workers/chunks/e5943f3a4bbc12c06c4d.js +0 -1
- package/assets/esri/core/workers/chunks/e7c60bd85abbd36cdc64.js +0 -1
- package/assets/esri/core/workers/chunks/ec9a2425b4a498054a19.js +0 -1
- package/assets/esri/core/workers/chunks/edf3be87a997f4f05b96.js +0 -1
- package/assets/esri/core/workers/chunks/f05de08e194a3f9b96f2.js +0 -1
- package/assets/esri/core/workers/chunks/f0a68d2900d24f56afa0.js +0 -1
- package/assets/esri/core/workers/chunks/f0aaa646b17ffdbdcefa.js +0 -1
- package/assets/esri/core/workers/chunks/f0c0c02730fe0d948fc1.js +0 -1
- package/assets/esri/core/workers/chunks/fd0254c6fc6c03ec11ba.js +0 -1
- package/assets/esri/core/workers/chunks/ffb3728e6ac428f62af1.js +0 -1
- package/views/3d/environment/EnvironmentManager.js +0 -2
- /package/{basemaps → basemapGallery}/support/basemapCompatibilityUtils.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[895,3276,4144,6875],{61691(e,t,i){i.d(t,{G:()=>r});class r{*[Symbol.iterator](){let e=this.next();for(;e;)yield e,e=this.next()}}},76061(e,t,i){i.d(t,{S:()=>s});var r=i(61691);class s extends r.G{m_aGeoms;m_iGeom=-1;constructor(e){super(),this.m_aGeoms=e?e.slice():[]}next(){if(this.m_iGeom<this.m_aGeoms.length-1){let e=this.m_aGeoms[++this.m_iGeom];return this.m_aGeoms[this.m_iGeom]=null,e}return null}tock(){return!1}getGeometryID(){return this.m_iGeom}getRank(){return 1}}},11053(e,t,i){i.d(t,{c:()=>r,g:()=>s});var r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof i.g<"u"?i.g:typeof self<"u"?self:{};function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}},4144(e,t,i){i.r(t),i.d(t,{clipToSpatialReference:()=>l,execute:()=>u,executeMany:()=>h,foldInto360Range:()=>d,foldInto360RangeGeodetic:()=>c,isLoaded:()=>a,load:()=>o,normalizeGeometry:()=>p,supportsCurves:()=>m,transform:()=>g});var r=i(76061),s=i(83290);let n;function a(){return!!n&&(0,s.i)()}async function o(){if(!a()){let[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(9192)]).then(()=>i(9192)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(5756)]).then(()=>i(15756)).then(({injectPe:e})=>e),(0,s.l)()]);n=new e.OperatorProject,t(s.p)}}function l(e,t,i){return n.clipToSpatialReference(e,t,null,i)}function u(e,t){return n.execute(e,t,null)}function h(e,t){let i=n.executeMany(new r.S(e),t,null);return Array.from(i)}function d(e,t){return n.foldInto360Range(e,t)}function c(e,t,i){return n.foldInto360RangeGeodetic(e,t,i)}function p(e,t,i){return n.normalizeGeometry(e,t,i)}function m(){return n.supportsCurves()}function g(e,t,i,r,s){return n.transform(e,t,i,r,s)}},83276(e,t,i){i.r(t),i.d(t,{execute:()=>_,executeMany:()=>v,isLoaded:()=>m,load:()=>f,projectExecute:()=>y,projectExecuteMany:()=>b,projectIsLoaded:()=>p,projectLoad:()=>g,projectSupportsCurves:()=>d,supportsCurves:()=>c});var r=i(4144),s=i(85036),n=i(17499);let a,o,l,u,h,d,c;function p(){return!!a&&(0,r.isLoaded)()}function m(){return(0,s.Q)("projectOperator","isLoaded","projectIsLoaded"),p()}async function g(){if(!p()){let[e,t]=await Promise.all([Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(3299),i.e(9567),i.e(9829),i.e(1666)]).then(()=>i(78125)),Promise.all([i.e(9187),i.e(8885),i.e(9117),i.e(6129)]).then(()=>i(86129)),(0,r.load)()]);a=e.fromGeometry,o=e.fromSpatialReference,l=e.getSpatialReference,u=e.toGeometry,h=t.createProjectionTransformation,d=(0,r.supportsCurves)(),c=d}}function f(){return(0,s.Q)("projectOperator","load","projectLoad"),g()}function y(e,t,i){let s=l(e),d=h(o(s),o(t),i),c=u((0,r.execute)(a(e),d),t);return!i?.zConversionDisabled&&c?.hasZ&&(0,n.g)([c],s,t),c}function _(e,t,i){return(0,s.Q)("projectOperator","execute","projectExecute"),y(e,t,i)}function b(e,t,i){let s=e.map(a),d=l(e),c=h(o(d),o(t),i),p=(0,r.executeMany)(s,c).map(e=>u(e,t));return!i?.zConversionDisabled&&p&&(0,n.g)(p,d,t),p}function v(e,t,i){return(0,s.Q)("projectOperator","executeMany","projectExecuteMany"),b(e,t,i)}},85036(e,t,i){i.d(t,{Q:()=>n});var r=i(51447),s=i(53966);function n(e,t,i){(0,r.io)(s.A.getLogger(`esri.geometry.operators.${e}`),`${t} is deprecated. Refactor using @arcgis/codemod or manually replace usages with ${i} instead.`,{replacement:i,warnOnce:!0})}},17499(e,t,i){i.d(t,{g:()=>n});var r=i(60408),s=i(62815);function n(e,t,i){let n;for(let a of e)if(a&&(0,r.Pv)(a)&&!("vertexAttributes"in a)){if(!n){let e="type"in a?a.type:(0,r.$B)(a);if(n=(0,s.N)(e,t,i),!n)return}n(a)}}},62815(e,t,i){i.d(t,{N:()=>o,d:()=>l});var r=i(86211),s=i(73941),n=i(21325),a=i(52006);function o(e,t,i){let r=l(t,i);if(1!==r)switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,r);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e){if(e.curvePaths)for(let i of e.curvePaths)for(let e of i){let i=(0,a.yP)(e);i.length>2&&(i[2]*=t)}if(e.paths)for(let i of e.paths)for(let e of i)e.length>2&&(e[2]*=t)}}(e,r);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e){if(e.curveRings)for(let i of e.curveRings)for(let e of i){let i=(0,a.yP)(e);i.length>2&&(i[2]*=t)}if(e.rings)for(let i of e.rings)for(let e of i)e.length>2&&(e[2]*=t)}}(e,r);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(let i of e.points)i.length>2&&(i[2]*=t)}(e,r);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,r);default:return}}function l(e,t){return null==e||null==t||(0,n.aI)(e,t)||(0,s.xP)(e)||(0,s.xP)(t)?1:(0,r.G9)(e)/(0,r.G9)(t)}},86875(e,t,i){i.r(t),i.d(t,{default:()=>tp});var r=i(32198),s=i(68197),n=i(56507),a=i(51447),o=i(49186),l=i(53966),u=i(34727),h=i(25728),d=i(17676),c=i(36708),p=i(91429),m=i(78888),g=i(5443),f=i(86738),y=i(39829),_=i(82799),b=i(16930),v=i(4146),T=i(18768),S=i(63074),C=i(69208),E=i(34287),w=i(8303),k=i(25036),I=i(60694),x=i(10873),A=i(73179),P=i(69540),M=i(25482);let D=class extends((0,P.OU)(M.o)){constructor(e){super(e),this.framerate=null,this.containerFormat=null,this.gop=null,this.aspectRatio=null,this.klv=null}};(0,r.Cg)([(0,p.MZ)({type:String})],D.prototype,"framerate",void 0),(0,r.Cg)([(0,p.MZ)({type:String})],D.prototype,"containerFormat",void 0),(0,r.Cg)([(0,p.MZ)({type:Number})],D.prototype,"gop",void 0),(0,r.Cg)([(0,p.MZ)({type:String})],D.prototype,"aspectRatio",void 0),(0,r.Cg)([(0,p.MZ)({type:Object})],D.prototype,"klv",void 0),D=(0,r.Cg)([(0,p.$K)("esri.layers.support.PlaybackInfo")],D);const L=D;var O=i(6666);let N=class extends((0,P.OU)(M.o)){constructor(e){super(e),this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorPath=null,this.sensorTrail=null}};(0,r.Cg)([(0,p.MZ)({type:f.A})],N.prototype,"frameCenter",void 0),(0,r.Cg)([(0,p.MZ)({type:y.A})],N.prototype,"frameOutline",void 0),(0,r.Cg)([(0,p.MZ)({type:_.A})],N.prototype,"lineOfSight",void 0),(0,r.Cg)([(0,p.MZ)({type:f.A})],N.prototype,"sensorLocation",void 0),(0,r.Cg)([(0,p.MZ)({type:_.A})],N.prototype,"sensorPath",void 0),(0,r.Cg)([(0,p.MZ)({type:_.A})],N.prototype,"sensorTrail",void 0),N=(0,r.Cg)([(0,p.$K)("esri.layers.support.TelemetryData")],N);const R={type:Boolean,json:{write:!0}};let U=class extends((0,P.OU)(M.o)){constructor(e){super(e),this.frame=!1,this.frameCenter=!1,this.frameOutline=!0,this.lineOfSight=!0,this.sensorLocation=!0,this.sensorPath=!0,this.sensorTrail=!0}};(0,r.Cg)([(0,p.MZ)(R)],U.prototype,"frame",void 0),(0,r.Cg)([(0,p.MZ)(R)],U.prototype,"frameCenter",void 0),(0,r.Cg)([(0,p.MZ)(R)],U.prototype,"frameOutline",void 0),(0,r.Cg)([(0,p.MZ)(R)],U.prototype,"lineOfSight",void 0),(0,r.Cg)([(0,p.MZ)(R)],U.prototype,"sensorLocation",void 0),(0,r.Cg)([(0,p.MZ)(R)],U.prototype,"sensorPath",void 0),(0,r.Cg)([(0,p.MZ)(R)],U.prototype,"sensorTrail",void 0),U=(0,r.Cg)([(0,p.$K)("esri.layers.support.TelemetryDisplay")],U);var B=i(56560),F=i(36005),q=i(43937);let j=class extends((0,P.OU)(M.o)){constructor(e){super(e),this.frame=null,this.controlPoints=null}readControlPoints(e){return e.map(e=>({sourcePoint:{x:e.frameX,y:e.frameY},mapPoint:new f.A(e.point)}))}writeControlPoints(e,t){null!=e&&function(e){return null!=e?.sourcePoint&&null!=e.mapPoint}(e[0])&&(t.controlPoints=e.map(e=>{let t=e.sourcePoint,i=e.mapPoint;return{frameX:t.x,frameY:t.y,point:i.toJSON()}}))}};(0,r.Cg)([(0,p.MZ)({type:String})],j.prototype,"frame",void 0),(0,r.Cg)([(0,p.MZ)({type:[B.A],json:{write:{allowNull:!1,isRequired:!0}}})],j.prototype,"controlPoints",void 0),(0,r.Cg)([(0,F.w)("controlPoints")],j.prototype,"readControlPoints",null),(0,r.Cg)([(0,q.K)("controlPoints")],j.prototype,"writeControlPoints",null),j=(0,r.Cg)([(0,p.$K)("esri.layers.support.VideoFrame")],j);const H=j;let $=class extends((0,P.OU)(M.o)){constructor(e){super(e),this.duration=null,this.end=null,this.start=null,this.timezone="UTC"}readEnd(e,t){return null==t.end?null:new Date(t.end)}writeEnd(e,t){t.end=e?e.getTime():null}readStart(e,t){return null==t.start?null:new Date(t.start)}writeStart(e,t){t.start=e?e.getTime():null}};(0,r.Cg)([(0,p.MZ)({type:Number,json:{write:{allowNull:!0}}})],$.prototype,"duration",void 0),(0,r.Cg)([(0,p.MZ)({type:Date,json:{write:{allowNull:!0}}})],$.prototype,"end",void 0),(0,r.Cg)([(0,F.w)("end")],$.prototype,"readEnd",null),(0,r.Cg)([(0,q.K)("end")],$.prototype,"writeEnd",null),(0,r.Cg)([(0,p.MZ)({type:Date,json:{write:{allowNull:!0}}})],$.prototype,"start",void 0),(0,r.Cg)([(0,F.w)("start")],$.prototype,"readStart",null),(0,r.Cg)([(0,q.K)("start")],$.prototype,"writeStart",null),(0,r.Cg)([(0,p.MZ)({type:String})],$.prototype,"timezone",void 0),$=(0,r.Cg)([(0,p.$K)("esri.layers.support.VideoTimeExtent")],$);const V=$;var z=i(69622),W=i(65592);class G extends EventTarget{constructor(){super(...arguments),this._readyState=0,this._responseType="",this.timeout=0,this._withCredentials=!1,this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.onreadystatechange=null,this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this._abortController=null,this._error=null,this._options={},this._response=null,this._sendFlag=!1,this._url=""}get readyState(){return this._readyState}get response(){return""===this.responseType||"text"===this.responseType?this.responseText:this.readyState!==this.DONE||this._error||!this._response?null:this._response.data}get responseText(){return""!==this.responseType&&"text"!==this.responseType&&this._throwDOMException(),this.readyState===this.DONE?this._response?this._response.data:null==this._error?.raw?"":"string"==typeof this._error.raw?this._error.raw:JSON.stringify(this._error.raw):""}get responseType(){return this._responseType}set responseType(e){("document"!==e||globalThis instanceof Window)&&((this.readyState===this.LOADING||this.readyState===this.DONE)&&this._throwDOMException(),this._responseType=e)}get responseURL(){return(this._response||this._error)?.url??""}get responseXML(){return""!==this.responseType&&"document"!==this.responseType&&this._throwDOMException(),this.readyState===this.DONE?this._response?.data??null:null}get status(){return(this._response||this._error)?.httpStatus??0}get statusText(){return""}get upload(){return console.warn("upload not implemented"),null}get withCredentials(){return this._withCredentials}set withCredentials(e){this.readyState!==this.UNSENT&&this.readyState!==this.OPENED&&this._throwDOMException(),this._withCredentials=e}static{this.UNSENT=0}static{this.OPENED=1}static{this.HEADERS_RECEIVED=2}static{this.LOADING=3}static{this.DONE=4}abort(){this.readyState===this.OPENED&&this._sendFlag||this.readyState===this.HEADERS_RECEIVED||this.readyState===this.LOADING?(this._sendFlag=!1,this._error=null,this._response=null,this._abortController?.abort(),this._updateReadyState(this.DONE),this._dispatchProgressEvent("abort"),this._dispatchProgressEvent("loadend")):this.readyState===this.DONE&&this._updateReadyState(this.UNSENT)}getAllResponseHeaders(){let e="",t=(this._response||this._error)?.getAllHeaders?.();if(t)for(let[i,r]of t)e+=`${i}: ${r}\r\n`;return e}getResponseHeader(e){return(this._response||this._error)?.getHeader?.(e)??null}open(e,t){switch(this._sendFlag=!1,this._options={},e){case"GET":this._options.method="auto";break;case"POST":this._options.method="post";break;case"HEAD":this._options.method="head";break;case"DELETE":this._options.method="delete";break;case"PUT":this._options.method="put"}this._url=t,this._error=null,this._response=null,this._abortController=new AbortController,this._updateReadyState(this.OPENED)}overrideMimeType(e){throw Error("overrideMimeType not implemented")}send(e){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._sendFlag=!0,this._updateReadyState(this.LOADING),this._dispatchProgressEvent("loadstart");let t=this._options;t.body=e instanceof URLSearchParams?e.toString():e,t.responseType=""===this.responseType?"text":"arraybuffer"===this.responseType?"array-buffer":this.responseType,t.signal=this._abortController?.signal,this.timeout&&(t.timeout=this.timeout),this.withCredentials&&(t.withCredentials=!0),(0,n.A)(this._url,t).then(e=>{this._response=e,this._updateReadyState(this.DONE),this._dispatchProgressEvent("load")}).catch(e=>{this._sendFlag&&(this._error=e.details,this._updateReadyState(this.DONE),(0,W.c8)(e)?this._dispatchProgressEvent("timeout"):"AbortError"===e.name?this._dispatchProgressEvent("abort"):this._dispatchProgressEvent("error"))}).finally(()=>{this._sendFlag&&this._dispatchProgressEvent("loadend")})}setRequestHeader(e,t){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._options.headers??={},this._options.headers[e]=t}_dispatchProgressEvent(e){let t=new ProgressEvent(e,{loaded:0,total:0});this.dispatchEvent(t),this[`on${e}`]?.(t)}_throwDOMException(){throw new DOMException("","InvalidStateError")}_updateReadyState(e){if(this._readyState!==e&&(this._readyState=e,e!==this.UNSENT)){let e=new Event("readystatechange");this.dispatchEvent(e),this.onreadystatechange?.(e)}}}var X=i(29242),K=i(51850),Z=i(77690),Y=i(35522),Q=i(98764),J=i(9762),ee=i(79258),te=(i(83276),i(62046)),ie=i(37531);const re="application/x-mpegURL",se=10013,ne=10014,ae=10015,oe=10023,le=10024,ue=10025,he=90001,de=90002;function ce(e,t,i){if(!e)return null;let r=e.clone();switch(r.type){case"simple-fill":(0,ie.dt)(r,i),r.outline.color=t;break;case"simple-line":(0,ie.dt)(r,t);break;case"simple-marker":(0,ie.dt)(r,t),r?.outline?.color&&(r.outline.color=t);break;case"cim":(0,te.Fe)(r,t)}return r}function pe(e,t){if(!e||!t)return null;let i=[e.x,e.y,e.z??0],r=[t.x,t.y,t.z??0];return new _.A({hasZ:!0,hasM:!1,paths:[[i,r]]})}const me=Math.PI/180;let ge=class extends z.A{constructor(e){super(),this.averageElevation=0,this.imageHeight=0,this.imageWidth=0,this.metadataSupportsTransforms=!1,this.platformHeadingAngle=0,this.platformPitchAngle=0,this.platformRollAngle=0,this.sensorHeadingAngle=0,this.sensorAltitude=0,this.sensorHorizontalFieldOfView=0,this.sensorLatitude=0,this.sensorLongitude=0,this.sensorPitchAngle=0,this.sensorRollAngle=0,this.sensorVerticalFieldOfView=0,this.vttMetadata=new Map,this._createMat3FromValues=e=>{let t=e[0],i=e[1],r=e[2];return(0,X.fA)(t[0],i[0],r[0],t[1],i[1],r[1],t[2],i[2],r[2])},this._multiplyMat3=(e,t)=>{let i=(0,X.vt)();return(0,Z.lw)(i,e,t),i},this._transposeMat3=e=>{let t=(0,X.vt)();return(0,Z.mg)(t,e),t},this._calculateCameraFovForward=()=>this._createMat3FromValues([[0,0,1],[Math.tan(.5*this.sensorHorizontalFieldOfView*me),0,0],[0,Math.tan(.5*this.sensorVerticalFieldOfView*me),0]]),this._calculateCameraFovReverse=()=>this._createMat3FromValues([[0,1/Math.tan(.5*this.sensorHorizontalFieldOfView*me),0],[0,0,1/Math.tan(.5*this.sensorVerticalFieldOfView*me)],[1,0,0]]),this._calculateCameraLook=()=>this._getRotationMatrixZYX(this.sensorHeadingAngle*me,this.sensorPitchAngle*me,this.sensorRollAngle*me),this._calculateImageDimensionsForward=()=>this._createMat3FromValues([[2/this.imageWidth,0,-1],[0,-2/this.imageHeight,-1],[0,0,1]]),this._calculateImageDimensionsReverse=()=>this._createMat3FromValues([[this.imageWidth/2,0,this.imageWidth/2],[0,-this.imageHeight/2,-this.imageHeight/2],[0,0,1]]),this._calculatePlatformPositionMatrix=()=>{let e=Math.sin(this.sensorLatitude*me),t=Math.cos(this.sensorLatitude*me),i=Math.sin(this.sensorLongitude*me),r=Math.cos(this.sensorLongitude*me);return this._createMat3FromValues([[-e*r,-i,-t*r],[-e*i,r,-t*i],[t,0,-e]])},this._calculatePlatformOrientation=()=>this._getRotationMatrixZYX(this.platformHeadingAngle*me,this.platformPitchAngle*me,this.platformRollAngle*me),this._extractValues=e=>{this.imageWidth=e.get(he)?.value,this.imageHeight=e.get(de)?.value;let t=e.get(10075)?.value;this.sensorAltitude=t??e.get(ae)?.value,this.sensorLatitude=e.get(se)?.value,this.sensorLongitude=e.get(ne)?.value,this.sensorHeadingAngle=e.get(10018)?.value,this.sensorPitchAngle=e.get(10019)?.value,this.sensorRollAngle=e.get(10020)?.value,this.sensorHorizontalFieldOfView=e.get(10016)?.value,this.sensorVerticalFieldOfView=e.get(10017)?.value,this.platformHeadingAngle=e.get(10005)?.value,this.platformPitchAngle=e.get(10006)?.value,this.platformRollAngle=e.get(10007)?.value,this.averageElevation=e.get(ue)?.value||0},this._getRotationMatrixZYX=(e,t,i)=>{let r=Math.cos(e),s=Math.sin(e),n=Math.cos(t),a=Math.sin(t),o=Math.cos(i),l=Math.sin(i);return this._createMat3FromValues([[r*n,r*a*l-o*s,s*l+r*o*a],[n*s,r*o+s*a*l,o*s*a-r*l],[-a,n*l,n*o]])},this._initCameraSensor=()=>{let e=this._calculateCameraFovForward(),t=this._calculateCameraFovReverse(),i=this._calculateCameraLook(),r=this._calculateImageDimensionsForward(),s=this._calculateImageDimensionsReverse(),n=this._calculatePlatformPositionMatrix(),a=this._calculatePlatformOrientation(),o=this._multiplyMat3(this._multiplyMat3(n,a),i);this._imageToEarthTransform=this._multiplyMat3(this._multiplyMat3(o,e),r);let l=this._multiplyMat3(s,t);this._earthToImageTransform=this._multiplyMat3(l,this._transposeMat3(o)),this._platformPositionEcef=this._projectPointToECEF(this.sensorLongitude,this.sensorLatitude,this.sensorAltitude||this.averageElevation)},this._metadataSupportsTransforms=e=>{if(!e?.size)return!1;let t=e.get(he)?.value??0,i=e.get(de)?.value??0;if(t<=0||i<=0)return!1;let r=e.get(10075)?.value,s=e.get(ae)?.value,n=e.get(se)?.value,a=e.get(ne)?.value;if(null==r&&null==s||null==n||null==a)return!1;let o=e.get(10005)?.value,l=e.get(10006)?.value,u=e.get(10007)?.value;if(null==o||null==l||null==u)return!1;let h=e.get(10016)?.value,d=e.get(10017)?.value;if(null==h||null==d)return!1;let c=e.get(10018)?.value,p=e.get(10019)?.value,m=e.get(10020)?.value;return null!=c&&null!=p&&null!=m},this._projectPointToECEF=(e,t,i)=>{let r=[];return(0,J.projectBuffer)([e,t,i],b.A.WGS84,0,r,Q.Y0,0),new f.A({x:r[0],y:r[1],z:r[2],spatialReference:Q.Y0})},this._projectImageVectorToEllipsoid=(e,t)=>{let i=ee.$O.semiMajorAxis+t,r=ee.$O.semiMinorAxis+t,s=r/i,n=i/r,{x:a,y:o,z:l}=this._platformPositionEcef,u=l??this.averageElevation,h=(0,K.fA)(a,o,n*u),d=(0,Y.Om)(e,e),c=(0,Y.Om)(e,h),p=(0,Y.Om)(h,h)-i*i,m=(-c-Math.sqrt(c*c-d*p))/d;if(m<0)return[NaN,NaN,NaN];let g=(0,K.vt)();return(0,Y.Ln)(g,h,e,m),g[2]*=s,g};let t=e?.videoMetadata;this.updateSensorModel(t)}updateSensorModel(e){e?.size&&(this._set("metadataSupportsTransforms",this._metadataSupportsTransforms(e)),this.metadataSupportsTransforms&&(this._extractValues(e),this._initCameraSensor()))}transformGeoToImage(e,t,i){let r=this._platformPositionEcef;if(!r)return[0,0];let{x:s,y:n,z:a}=r,o=(0,K.fA)(s,n,a),l=this._projectPointToECEF(e,t,i||this.averageElevation),u=(0,K.vt)(),h=(0,K.fA)(l.x,l.y,l.z);(0,Y.Re)(u,h,o),(0,Y.ei)(u,u,this._earthToImageTransform);let d=u[0],c=u[1],p=u[2],m=(0,K.fA)(NaN,NaN,NaN);return isNaN(p)||(m=(0,K.fA)(d/p,c/p,p/p)),[m[0],m[1]]}transformImageToGeo(e,t){let i=(0,K.fA)(e,t,1),r=(0,K.vt)();(0,Y.ei)(r,i,this._imageToEarthTransform);let s,n=this._projectImageVectorToEllipsoid(r,this.averageElevation);if(!isNaN(n[0])){let e=[];(0,J.projectBuffer)([n[0],n[1],n[2]],Q.Y0,0,e,b.A.WGS84,0),s=new f.A({x:e[0],y:e[1],z:e[2],spatialReference:b.A.WGS84})}return s}};(0,r.Cg)([(0,p.MZ)()],ge.prototype,"averageElevation",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"imageHeight",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"imageWidth",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ge.prototype,"metadataSupportsTransforms",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"platformHeadingAngle",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"platformPitchAngle",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"platformRollAngle",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"sensorHeadingAngle",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"sensorAltitude",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"sensorHorizontalFieldOfView",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"sensorLatitude",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"sensorLongitude",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"sensorPitchAngle",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"sensorRollAngle",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"sensorVerticalFieldOfView",void 0),(0,r.Cg)([(0,p.MZ)()],ge.prototype,"vttMetadata",void 0),ge=(0,r.Cg)([(0,p.$K)("esri.layers.video.VideoCameraSensorModel")],ge);var fe,ye,_e=i(11053);function be(){return ye||(ye=1,fe=typeof window<"u"?window:void 0===_e.c?typeof self<"u"?self:{}:_e.c),fe}var ve=be();const Te=(0,_e.g)(ve);var Se,Ce,Ee,we,ke,Ie,xe,Ae,Pe,Me,De,Le,Oe,Ne,Re,Ue,Be,Fe,qe,je,He,$e,Ve,ze,We,Ge;function Xe(){if(Ce)return Se;Ce=1;var e=Array.prototype.slice;return Se=function(t,i){for(("length"in t||(t=[t]),t=e.call(t));t.length;){var r=t.shift(),s=i(r);if(s)return s;r.childNodes&&r.childNodes.length&&(t=e.call(r.childNodes).concat(t))}},Se}function Ke(){return Ae||(Ae=1,xe=function(e){var t=this,i=e.type;e.target||=t,t.listeners||={};var r=t.listeners[i];if(r)return r.forEach(function(i){e.currentTarget=t,"function"==typeof i?i(e):i.handleEvent(e)});t.parentNode&&t.parentNode.dispatchEvent(e)}),xe}function Ze(){return Me||(Me=1,Pe=function(e,t){var i=this;i.listeners||={},i.listeners[e]||(i.listeners[e]=[]),-1===i.listeners[e].indexOf(t)&&i.listeners[e].push(t)}),Pe}function Ye(){return Le||(Le=1,De=function(e,t){var i=this;if(i.listeners&&i.listeners[e]){var r=i.listeners[e],s=r.indexOf(t);-1!==s&&r.splice(s,1)}}),De}function Qe(){if(Ue)return Re;Ue=1;var e=Xe(),t=Ke(),i=Ze(),r=Ye(),s=function(){if(Ne)return Oe;Ne=1;var e=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function t(e){switch(e.nodeType){case 3:return a(e.data);case 8:return"\x3c!--"+e.data+"--\x3e";default:return i(e)}}function i(i){var r=[],o=i.tagName;return"http://www.w3.org/1999/xhtml"===i.namespaceURI&&(o=o.toLowerCase()),r.push("<"+o+n(i)+function(e){var t=e.dataset,i=[];for(var r in t)i.push({name:"data-"+r,value:t[r]});return i.length?s(i):""}(i)),e.indexOf(o)>-1?r.push(" />"):(r.push(">"),i.childNodes.length?r.push.apply(r,i.childNodes.map(t)):i.textContent||i.innerText?r.push(a(i.textContent||i.innerText)):i.innerHTML&&r.push(i.innerHTML),r.push("</"+o+">")),r.join("")}function r(e,t){var i=typeof e[t];return"style"===t&&Object.keys(e.style).length>0||e.hasOwnProperty(t)&&("string"===i||"boolean"===i||"number"===i)&&"nodeName"!==t&&"className"!==t&&"tagName"!==t&&"textContent"!==t&&"innerText"!==t&&"namespaceURI"!==t&&"innerHTML"!==t}function s(e){var t=[];return e.forEach(function(e){var i=e.name,r=e.value;"style"===i&&(r=function(e){if("string"==typeof e)return e;var t="";return Object.keys(e).forEach(function(i){var r=e[i];i=i.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()}),t+=i+":"+r+";"}),t}(r)),t.push(i+'="'+function(e){return a(e).replace(/"/g,""")}(r)+'"')}),t.length?" "+t.join(" "):""}function n(e){var t=[];for(var i in e)r(e,i)&&t.push({name:i,value:e[i]});for(var n in e._attributes)for(var a in e._attributes[n]){var o=e._attributes[n][a],l=(o.prefix?o.prefix+":":"")+a;t.push({name:l,value:o.value})}return e.className&&t.push({name:"class",value:e.className}),t.length?s(t):""}function a(e){var t="";return"string"==typeof e?t=e:e&&(t=e.toString()),t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}return Oe=t}(),n="http://www.w3.org/1999/xhtml";function a(e,t,i){if(!(this instanceof a))return new a(e);var r=void 0===i?n:i||null;this.tagName=r===n?String(e).toUpperCase():e,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=t||null,this.namespaceURI=r,this._attributes={},"INPUT"===this.tagName&&(this.type="text")}return Re=a,a.prototype.type="DOMElement",a.prototype.nodeType=1,a.prototype.appendChild=function(e){return e.parentNode&&e.parentNode.removeChild(e),this.childNodes.push(e),e.parentNode=this,e},a.prototype.replaceChild=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var i=this.childNodes.indexOf(t);return t.parentNode=null,this.childNodes[i]=e,e.parentNode=this,t},a.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);return this.childNodes.splice(t,1),e.parentNode=null,e},a.prototype.insertBefore=function(e,t){e.parentNode&&e.parentNode.removeChild(e);var i=null==t?-1:this.childNodes.indexOf(t);return i>-1?this.childNodes.splice(i,0,e):this.childNodes.push(e),e.parentNode=this,e},a.prototype.setAttributeNS=function(e,t,i){var r=null,s=t,n=t.indexOf(":");n>-1&&(r=t.substr(0,n),s=t.substr(n+1)),"INPUT"===this.tagName&&"type"===t?this.type=i:(this._attributes[e]||(this._attributes[e]={}))[s]={value:i,prefix:r}},a.prototype.getAttributeNS=function(e,t){var i=this._attributes[e],r=i&&i[t]&&i[t].value;return"INPUT"===this.tagName&&"type"===t?this.type:"string"==typeof r?r:null},a.prototype.removeAttributeNS=function(e,t){if(Object.prototype.hasOwnProperty.call(this._attributes,e)){var i=this._attributes[e];i&&Object.prototype.hasOwnProperty.call(i,t)&&delete i[t]}},a.prototype.hasAttributeNS=function(e,t){var i=this._attributes[e];return!!i&&t in i},a.prototype.setAttribute=function(e,t){return this.setAttributeNS(null,e,t)},a.prototype.getAttribute=function(e){return this.getAttributeNS(null,e)},a.prototype.removeAttribute=function(e){return this.removeAttributeNS(null,e)},a.prototype.hasAttribute=function(e){return this.hasAttributeNS(null,e)},a.prototype.removeEventListener=r,a.prototype.addEventListener=i,a.prototype.dispatchEvent=t,a.prototype.focus=function(){},a.prototype.toString=function(){return s(this)},a.prototype.getElementsByClassName=function(t){var i=t.split(" "),r=[];return e(this,function(e){if(1===e.nodeType){var t=(e.className||"").split(" ");i.every(function(e){return-1!==t.indexOf(e)})&&r.push(e)}}),r},a.prototype.getElementsByTagName=function(t){t=t.toLowerCase();var i=[];return e(this.childNodes,function(e){1===e.nodeType&&("*"===t||e.tagName.toLowerCase()===t)&&i.push(e)}),i},a.prototype.contains=function(t){return e(this,function(e){return t===e})||!1},Re}function Je(){if(Ge)return We;Ge=1;var e,t=void 0===_e.c?typeof window<"u"?window:{}:_e.c,i=(ze||(ze=1,Ve=new(function(){if($e)return He;$e=1;var e=Xe(),t=function(){if(we)return Ee;function e(t,i){if(!(this instanceof e))return new e(t,i);this.data=t,this.nodeValue=t,this.length=t.length,this.ownerDocument=i||null}return we=1,Ee=e,e.prototype.nodeType=8,e.prototype.nodeName="#comment",e.prototype.toString=function(){return"[object Comment]"},Ee}(),i=function(){if(Ie)return ke;function e(t,i){if(!(this instanceof e))return new e(t);this.data=t||"",this.length=this.data.length,this.ownerDocument=i||null}return Ie=1,ke=e,e.prototype.type="DOMTextNode",e.prototype.nodeType=3,e.prototype.nodeName="#text",e.prototype.toString=function(){return this.data},e.prototype.replaceData=function(e,t,i){var r=this.data,s=r.substring(0,e),n=r.substring(e+t,r.length);this.data=s+i+n,this.length=this.data.length},ke}(),r=Qe(),s=function(){if(Fe)return Be;Fe=1;var e=Qe();function t(e){if(!(this instanceof t))return new t;this.childNodes=[],this.parentNode=null,this.ownerDocument=e||null}return Be=t,t.prototype.type="DocumentFragment",t.prototype.nodeType=11,t.prototype.nodeName="#document-fragment",t.prototype.appendChild=e.prototype.appendChild,t.prototype.replaceChild=e.prototype.replaceChild,t.prototype.removeChild=e.prototype.removeChild,t.prototype.toString=function(){return this.childNodes.map(function(e){return String(e)}).join("")},Be}(),n=function(){if(je)return qe;function e(e){}return je=1,qe=e,e.prototype.initEvent=function(e,t,i){this.type=e,this.bubbles=t,this.cancelable=i},e.prototype.preventDefault=function(){},qe}(),a=Ke(),o=Ze(),l=Ye();function u(){if(!(this instanceof u))return new u;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}He=u;var h=u.prototype;return h.createTextNode=function(e){return new i(e,this)},h.createElementNS=function(e,t){var i=null===e?null:String(e);return new r(t,this,i)},h.createElement=function(e){return new r(e,this)},h.createDocumentFragment=function(){return new s(this)},h.createEvent=function(e){return new n(e)},h.createComment=function(e){return new t(e,this)},h.getElementById=function(t){return t=String(t),e(this.childNodes,function(e){if(String(e.id)===t)return e})||null},h.getElementsByClassName=r.prototype.getElementsByClassName,h.getElementsByTagName=r.prototype.getElementsByTagName,h.contains=r.prototype.contains,h.removeEventListener=l,h.addEventListener=o,h.dispatchEvent=a,He}())),Ve);return typeof document<"u"?e=document:(e=t["__GLOBAL_DOCUMENT_CACHE@4"],e||=t["__GLOBAL_DOCUMENT_CACHE@4"]=i),We=e}var et=Je();const tt=(0,_e.g)(et);var it,rt,st,nt,at,ot,lt,ut,ht,dt,ct={exports:{}},pt={exports:{}},mt=function(){if(dt)return ct.exports;dt=1;var e=be(),t=(it||(it=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(pt)),pt.exports),i=function(){if(st)return rt;st=1,rt=function(t){if(!t)return!1;var i=e.call(t);return"[object Function]"===i||"function"==typeof t&&"[object RegExp]"!==i||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)};var e=Object.prototype.toString;return rt}(),r=function(){if(at)return nt;function e(e,i){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=t(e))||i){r&&(e=r);var s=0;return function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function t(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=Array(t);i<t;i++)r[i]=e[i];return r}return at=1,nt=function(){function t(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var i=t.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},i.addInterceptor=function(e,t){this.typeToInterceptorsMap_.has(e)||this.typeToInterceptorsMap_.set(e,new Set);var i=this.typeToInterceptorsMap_.get(e);return!i.has(t)&&(i.add(t),!0)},i.removeInterceptor=function(e,t){var i=this.typeToInterceptorsMap_.get(e);return!(!i||!i.has(t)||(i.delete(t),0))},i.clearInterceptorsByType=function(e){return!!this.typeToInterceptorsMap_.get(e)&&(this.typeToInterceptorsMap_.delete(e),this.typeToInterceptorsMap_.set(e,new Set),!0)},i.clear=function(){return!!this.typeToInterceptorsMap_.size&&(this.typeToInterceptorsMap_=new Map,!0)},i.getForType=function(e){return this.typeToInterceptorsMap_.get(e)||new Set},i.execute=function(t,i){for(var r,s=e(this.getForType(t));!(r=s()).done;){var n=r.value;try{i=n(i)}catch{}}return i},t}(),nt}(),s=function(){if(lt)return ot;lt=1;var e=function(){function e(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var i=e.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},i.getMaxAttempts=function(){return this.maxAttempts_},i.setMaxAttempts=function(e){this.maxAttempts_=e},i.getDelayFactor=function(){return this.delayFactor_},i.setDelayFactor=function(e){this.delayFactor_=e},i.getFuzzFactor=function(){return this.fuzzFactor_},i.setFuzzFactor=function(e){this.fuzzFactor_=e},i.getInitialDelay=function(){return this.initialDelay_},i.setInitialDelay=function(e){this.initialDelay_=e},i.createRetry=function(e){var i=void 0===e?{}:e,r=i.maxAttempts,s=i.delayFactor,n=i.fuzzFactor,a=i.initialDelay;return new t({maxAttempts:r||this.maxAttempts_,delayFactor:s||this.delayFactor_,fuzzFactor:n||this.fuzzFactor_,initialDelay:a||this.initialDelay_})},e}(),t=function(){function e(e){this.maxAttempts_=e.maxAttempts,this.delayFactor_=e.delayFactor,this.fuzzFactor_=e.fuzzFactor,this.currentDelay_=e.initialDelay,this.currentAttempt_=1}var t=e.prototype;return t.moveToNextAttempt=function(){this.currentAttempt_++;var e=this.currentDelay_*this.delayFactor_;this.currentDelay_+=e},t.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},t.getCurrentDelay=function(){return this.currentDelay_},t.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},t.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},t.getCurrentFuzzedDelay=function(){var e=this.getCurrentMinPossibleDelay(),t=this.getCurrentMaxPossibleDelay();return e+Math.random()*(t-e)},e}();return ot=e}();o.httpHandler=function(){if(ht)return ut;ht=1;var e=be();return ut=function(t,i){return void 0===i&&(i=!1),function(r,s,n){if(r)t(r);else if(s.statusCode>=400&&s.statusCode<=599){var a=n;if(i)if(e.TextDecoder){var o=function(e){return void 0===e&&(e=""),e.toLowerCase().split(";").reduce(function(e,t){var i=t.split("="),r=i[0],s=i[1];return"charset"===r.trim()?s.trim():e},"utf-8")}(s.headers&&s.headers["content-type"]);try{a=new TextDecoder(o).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));t({cause:a})}else t(null,n)}},ut}(),o.requestInterceptorsStorage=new r,o.responseInterceptorsStorage=new r,o.retryManager=new s;var n=function(e){var t={};return e&&e.trim().split("\n").forEach(function(e){var i=e.indexOf(":"),r=e.slice(0,i).trim().toLowerCase(),s=e.slice(i+1).trim();void 0===t[r]?t[r]=s:Array.isArray(t[r])?t[r].push(s):t[r]=[t[r],s]}),t};function a(e,r,s){var n=e;return i(r)?(s=r,"string"==typeof e&&(n={uri:e})):n=t({},r,{uri:e}),n.callback=s,n}function o(e,t,i){return l(t=a(e,t,i))}function l(e){if(void 0===e.callback)throw Error("callback argument missing");if(e.requestType&&o.requestInterceptorsStorage.getIsEnabled()){var t={uri:e.uri||e.url,headers:e.headers||{},body:e.body,metadata:e.metadata||{},retry:e.retry,timeout:e.timeout},i=o.requestInterceptorsStorage.execute(e.requestType,t);e.uri=i.uri,e.headers=i.headers,e.body=i.body,e.metadata=i.metadata,e.retry=i.retry,e.timeout=i.timeout}var r=!1,s=function(t,i,s){r||(r=!0,e.callback(t,i,s))};function a(){var e=void 0;if(e=d.response?d.response:d.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch{}return null}(d),v)try{e=JSON.parse(e)}catch{}return e}function u(t){if(clearTimeout(m),clearTimeout(e.retryTimeout),t instanceof Error||(t=Error(""+(t||"Unknown XMLHttpRequest Error"))),t.statusCode=0,p||!o.retryManager.getIsEnabled()||!e.retry||!e.retry.shouldRetry()){if(e.requestType&&o.responseInterceptorsStorage.getIsEnabled()){var i={headers:T.headers||{},body:T.body,responseUrl:d.responseURL,responseType:d.responseType},r=o.responseInterceptorsStorage.execute(e.requestType,i);T.body=r.body,T.headers=r.headers}return s(t,T)}e.retryTimeout=setTimeout(function(){e.retry.moveToNextAttempt(),e.xhr=d,l(e)},e.retry.getCurrentFuzzedDelay())}function h(){if(!p){var t;clearTimeout(m),clearTimeout(e.retryTimeout),t=e.useXDR&&void 0===d.status?200:1223===d.status?204:d.status;var i=T,r=null;if(0===t?r=Error("Internal XMLHttpRequest Error"):(i={body:a(),statusCode:t,method:f,headers:{},url:g,rawRequest:d},d.getAllResponseHeaders&&(i.headers=n(d.getAllResponseHeaders()))),e.requestType&&o.responseInterceptorsStorage.getIsEnabled()){var l={headers:i.headers||{},body:i.body,responseUrl:d.responseURL,responseType:d.responseType},u=o.responseInterceptorsStorage.execute(e.requestType,l);i.body=u.body,i.headers=u.headers}return s(r,i,i.body)}}var d=e.xhr||null;d||=e.cors||e.useXDR?new o.XDomainRequest:new o.XMLHttpRequest;var c,p,m,g=d.url=e.uri||e.url,f=d.method=e.method||"GET",y=e.body||e.data,_=d.headers=e.headers||{},b=!!e.sync,v=!1,T={body:void 0,headers:{},statusCode:0,method:f,url:g,rawRequest:d};if("json"in e&&!1!==e.json&&(v=!0,_.accept||_.Accept||(_.Accept="application/json"),"GET"!==f&&"HEAD"!==f&&(_["content-type"]||_["Content-Type"]||(_["Content-Type"]="application/json"),y=JSON.stringify(!0===e.json?y:e.json))),d.onreadystatechange=function(){4===d.readyState&&!o.responseInterceptorsStorage.getIsEnabled()&&setTimeout(h,0)},d.onload=h,d.onerror=u,d.onprogress=function(){},d.onabort=function(){p=!0,clearTimeout(e.retryTimeout)},d.ontimeout=u,d.open(f,g,!b,e.username,e.password),b||(d.withCredentials=!!e.withCredentials),!b&&e.timeout>0&&(m=setTimeout(function(){if(!p){p=!0,d.abort("timeout");var e=Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",u(e)}},e.timeout)),d.setRequestHeader)for(c in _)_.hasOwnProperty(c)&&d.setRequestHeader(c,_[c]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(d.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(d),d.send(y||null),d}return ct.exports=o,ct.exports.default=o,o.XMLHttpRequest=e.XMLHttpRequest||function(){},o.XDomainRequest="withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:e.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)t(e[i])}(["get","put","post","patch","head","delete"],function(e){o["delete"===e?"del":e]=function(t,i,r){return(i=a(t,i,r)).method=e.toUpperCase(),l(i)}}),ct.exports}();const gt=(0,_e.g)(mt);var ft,yt,_t,bt,vt,Tt,St,Ct={exports:{}};function Et(){if(yt)return ft;yt=1;var e=Je(),t=Object.create||function(){function e(){}return function(t){if(1!==arguments.length)throw Error("Object.create shim only accepts one parameter.");return e.prototype=t,new e}}();function i(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function r(e){function t(e,t,i,r){return 3600*(0|e)+60*(0|t)+(0|i)+(0|r)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?t(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function s(){this.values=t(null)}function n(e,t,i,r){var s=r?e.split(r):[e];for(var n in s)if("string"==typeof s[n]){var a=s[n].split(i);2===a.length&&t(a[0].trim(),a[1].trim())}}function a(e,t,a){var o=e;function l(){var t=r(e);if(null===t)throw new i(i.Errors.BadTimeStamp,"Malformed timestamp: "+o);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function u(){e=e.replace(/^\s+/,"")}if(u(),t.startTime=l(),u(),"--\x3e"!==e.substr(0,3))throw new i(i.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+o);e=e.substr(3),u(),t.endTime=l(),u(),function(e,t){var i=new s;n(e,function(e,t){switch(e){case"region":for(var r=a.length-1;r>=0;r--)if(a[r].id===t){i.set(e,a[r].region);break}break;case"vertical":i.alt(e,t,["rl","lr"]);break;case"line":var s=t.split(","),n=s[0];i.integer(e,n),i.percent(e,n)&&i.set("snapToLines",!1),i.alt(e,n,["auto"]),2===s.length&&i.alt("lineAlign",s[1],["start","center","end"]);break;case"position":s=t.split(","),i.percent(e,s[0]),2===s.length&&i.alt("positionAlign",s[1],["start","center","end"]);break;case"size":i.percent(e,t);break;case"align":i.alt(e,t,["start","center","end","left","right"])}},/:/,/\s/),t.region=i.get("region",null),t.vertical=i.get("vertical","");try{t.line=i.get("line","auto")}catch{}t.lineAlign=i.get("lineAlign","start"),t.snapToLines=i.get("snapToLines",!0),t.size=i.get("size",100);try{t.align=i.get("align","center")}catch{t.align=i.get("align","middle")}try{t.position=i.get("position","auto")}catch{t.position=i.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=i.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}i.prototype=t(Error.prototype),i.prototype.constructor=i,i.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},s.prototype={set:function(e,t){!this.get(e)&&""!==t&&(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var r=0;r<i.length;++r)if(t===i[r]){this.set(e,t);break}},integer:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(t=parseFloat(t),t>=0&&t<=100))&&(this.set(e,t),!0)}};var o=e.createElement&&e.createElement("textarea"),l={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},u={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},h={v:"title",lang:"lang"},d={rt:"ruby"};function c(e,t){function i(){if(!t)return null;var e=t.match(/^([^<]*)(<[^>]*>?)?/);return function(e){return t=t.substr(e.length),e}(e[1]?e[1]:e[2])}function s(e){return o.innerHTML=e,e=o.textContent,o.textContent="",e}function n(e,t){return!d[t.localName]||d[t.localName]===e.localName}function a(t,i){var r=l[t];if(!r)return null;var s=e.document.createElement(r),n=h[t];return n&&i&&(s[n]=i.trim()),s}for(var c,p=e.document.createElement("div"),m=p,g=[];null!==(c=i());)if("<"===c[0]){if("/"===c[1]){g.length&&g[g.length-1]===c.substr(2).replace(">","")&&(g.pop(),m=m.parentNode);continue}var f,y=r(c.substr(1,c.length-2));if(y){f=e.document.createProcessingInstruction("timestamp",y),m.appendChild(f);continue}var _=c.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!_||!(f=a(_[1],_[3]))||!n(m,f))continue;if(_[2]){var b=_[2].split(".");b.forEach(function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(u.hasOwnProperty(i)){var r=t?"background-color":"color",s=u[i];f.style[r]=s}}),f.className=b.join(" ")}g.push(_[1]),m.appendChild(f),m=f}else m.appendChild(e.document.createTextNode(s(c)));return p}var p=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function m(e){for(var t=0;t<p.length;t++){var i=p[t];if(e>=i[0]&&e<=i[1])return!0}return!1}function g(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function s(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var n=i.match(/^.*(\n|\r)/);return n?(e.length=0,n[0]):i}return"ruby"===t.tagName?s(e):t.childNodes?(r(e,t),s(e)):void 0}for(r(t,e);i=s(t);)for(var n=0;n<i.length;n++)if(m(i.charCodeAt(n)))return"rtl";return"ltr"}function f(){}function y(e,t,i){f.call(this),this.cue=t,this.cueDiv=c(e,t.text);var r={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(r,this.cueDiv),this.div=e.document.createElement("div"),r={direction:g(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(r),this.div.appendChild(this.cueDiv);var s=0;switch(t.positionAlign){case"start":case"line-left":s=t.position;break;case"center":s=t.position-t.size/2;break;case"end":case"line-right":s=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(s,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(s,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function _(e){var t,i,r,s;if(e.div){i=e.div.offsetHeight,r=e.div.offsetWidth,s=e.div.offsetTop;var n=(n=e.div.childNodes)&&(n=n[0])&&n.getClientRects&&n.getClientRects();e=e.div.getBoundingClientRect(),t=n?Math.max(n[0]&&n[0].height||0,e.height/n.length):0}this.left=e.left,this.right=e.right,this.top=e.top||s,this.height=e.height||i,this.bottom=e.bottom||s+(e.height||i),this.width=e.width||r,this.lineHeight=void 0===t?e.lineHeight:t}function b(e,t,i,r){var s=new _(t),n=t.cue,a=function(e){if("number"==typeof e.line&&(e.snapToLines||e.line>=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,r=0,s=0;s<i.length&&i[s]!==t;s++)"showing"===i[s].mode&&r++;return-1*++r}(n),o=[];if(n.snapToLines){var l;switch(n.vertical){case"":o=["+y","-y"],l="height";break;case"rl":o=["+x","-x"],l="width";break;case"lr":o=["-x","+x"],l="width"}var u=s.lineHeight,h=u*Math.round(a),d=i[l]+u,c=o[0];Math.abs(h)>d&&(h=h<0?-1:1,h*=Math.ceil(d/u)*u),a<0&&(h+=""===n.vertical?i.height:i.width,o=o.reverse()),s.move(c,h)}else{var p=s.lineHeight/i.height*100;switch(n.lineAlign){case"center":a-=p/2;break;case"end":a-=p}switch(n.vertical){case"":t.applyStyles({top:t.formatStyle(a,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(a,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(a,"%")})}o=["+y","-x","+x","-y"],s=new _(t)}var m=function(e,t){for(var s,n=new _(e),a=1,o=0;o<t.length;o++){for(;e.overlapsOppositeAxis(i,t[o])||e.within(i)&&e.overlapsAny(r);)e.move(t[o]);if(e.within(i))return e;var l=e.intersectPercentage(i);a>l&&(s=new _(e),a=l),e=new _(n)}return s||n}(s,o);t.move(m.toCSSCompatValues(i))}function v(){}return f.prototype.applyStyles=function(e,t){for(var i in t||=this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},f.prototype.formatStyle=function(e,t){return 0===e?0:e+t},y.prototype=t(f.prototype),y.prototype.constructor=y,_.prototype.move=function(e,t){switch(t=void 0===t?this.lineHeight:t,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},_.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},_.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},_.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},_.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},_.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},_.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},_.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,r=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||r,height:e.height||t,bottom:e.bottom||r+(e.height||t),width:e.width||i}},v.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},v.convertCueToDOMTree=function(e,t){return e&&t?c(e,t):null},v.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var r=e.document.createElement("div");if(r.style.position="absolute",r.style.left="0",r.style.right="0",r.style.top="0",r.style.bottom="0",r.style.margin="1.5%",i.appendChild(r),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return!0;return!1}(t)){var s=[],n=_.getSimpleBoxPosition(r),a={font:Math.round(.05*n.height*100)/100+"px sans-serif"};!function(){for(var i,o,l=0;l<t.length;l++)o=t[l],i=new y(e,o,a),r.appendChild(i.div),b(0,i,n,s),o.displayState=i.div,s.push(_.getSimpleBoxPosition(i))}()}else for(var o=0;o<t.length;o++)r.appendChild(t[o].displayState)},v.Parser=function(e,t,i){i||(i=t,t={}),t||={},this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]},v.Parser.prototype={reportOrThrowError:function(e){if(!(e instanceof i))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){var t=this;function o(){for(var e=t.buffer,i=0;i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var r=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),r}function l(e){var i=new s;if(n(e,function(e,t){switch(e){case"id":i.set(e,t);break;case"width":i.percent(e,t);break;case"lines":i.integer(e,t);break;case"regionanchor":case"viewportanchor":var r=t.split(",");if(2!==r.length)break;var n=new s;if(n.percent("x",r[0]),n.percent("y",r[1]),!n.has("x")||!n.has("y"))break;i.set(e+"X",n.get("x")),i.set(e+"Y",n.get("y"));break;case"scroll":i.alt(e,t,["up"])}},/=/,/\s/),i.has("id")){var r=new(t.vttjs.VTTRegion||t.window.VTTRegion);r.width=i.get("width",100),r.lines=i.get("lines",3),r.regionAnchorX=i.get("regionanchorX",0),r.regionAnchorY=i.get("regionanchorY",100),r.viewportAnchorX=i.get("viewportanchorX",0),r.viewportAnchorY=i.get("viewportanchorY",100),r.scroll=i.get("scroll",""),t.onregion&&t.onregion(r),t.regionList.push({id:i.get("id"),region:r})}}function u(e){var i=new s;n(e,function(e,t){switch(e){case"MPEGT":i.integer(e+"S",t);break;case"LOCA":i.set(e+"L",r(t))}},/[^\d]:/,/,/),t.ontimestampmap&&t.ontimestampmap({MPEGTS:i.get("MPEGTS"),LOCAL:i.get("LOCAL")})}function h(e){e.match(/X-TIMESTAMP-MAP/)?n(e,function(e,t){"X-TIMESTAMP-MAP"===e&&u(t)},/=/):n(e,function(e,t){"Region"===e&&l(t)},/:/)}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var d;if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var c=(d=o()).match(/^WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new i(i.Errors.BadSignature);t.state="HEADER"}for(var p=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(p?p=!1:d=o(),t.state){case"HEADER":/:/.test(d)?h(d):d||(t.state="ID");continue;case"NOTE":d||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(d)){t.state="NOTE";break}if(!d)continue;t.cue=new(t.vttjs.VTTCue||t.window.VTTCue)(0,0,"");try{t.cue.align="center"}catch{t.cue.align="middle"}if(t.state="CUE",-1===d.indexOf("--\x3e")){t.cue.id=d;continue}case"CUE":try{a(d,t.cue,t.regionList)}catch(e){t.reportOrThrowError(e),t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var m=-1!==d.indexOf("--\x3e");if(!d||m&&(p=!0)){t.oncue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}t.cue.text&&(t.cue.text+="\n"),t.cue.text+=d.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":d||(t.state="ID");continue}}}catch(e){t.reportOrThrowError(e),"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),(e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new i(i.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}},ft=v}function wt(){if(bt)return _t;bt=1;var e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(t){return!("string"!=typeof t||!e[t.toLowerCase()])&&t.toLowerCase()}function r(e){return!("string"!=typeof e||!t[e.toLowerCase()])&&e.toLowerCase()}function s(e,t,s){this.hasBeenReset=!1;var n="",a=!1,o=e,l=t,u=s,h=null,d="",c=!0,p="auto",m="start",g="auto",f="auto",y=100,_="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(e){n=""+e}},pauseOnExit:{enumerable:!0,get:function(){return a},set:function(e){a=!!e}},startTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw TypeError("Start time must be set to a number.");o=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return l},set:function(e){if("number"!=typeof e)throw TypeError("End time must be set to a number.");l=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return u},set:function(e){u=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return h},set:function(e){h=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return d},set:function(e){var t=i(e);if(!1===t)throw SyntaxError("Vertical: an invalid or illegal direction string was specified.");d=t,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return c},set:function(e){c=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e&&"auto"!==e)throw SyntaxError("Line: an invalid number or illegal string was specified.");p=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return m},set:function(e){var t=r(e);t?(m=t,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return g},set:function(e){if(e<0||e>100)throw Error("Position must be between 0 and 100.");g=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=r(e);t?(f=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return y},set:function(e){if(e<0||e>100)throw Error("Size must be between 0 and 100.");y=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return _},set:function(e){var t=r(e);if(!t)throw SyntaxError("align: an invalid or illegal alignment string was specified.");_=t,this.hasBeenReset=!0}}}),this.displayState=void 0}return s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},_t=s}function kt(){if(Tt)return vt;Tt=1;var e={"":!0,up:!0};function t(t){return!("string"!=typeof t||!e[t.toLowerCase()])&&t.toLowerCase()}function i(e){return"number"==typeof e&&e>=0&&e<=100}return vt=function(){var e=100,r=3,s=0,n=100,a=0,o=100,l="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!i(t))throw Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return r},set:function(e){if("number"!=typeof e)throw TypeError("Lines must be set to a number.");r=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!i(e))throw Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return s},set:function(e){if(!i(e))throw Error("RegionAnchorY must be between 0 and 100.");s=e}},viewportAnchorY:{enumerable:!0,get:function(){return o},set:function(e){if(!i(e))throw Error("ViewportAnchorY must be between 0 and 100.");o=e}},viewportAnchorX:{enumerable:!0,get:function(){return a},set:function(e){if(!i(e))throw Error("ViewportAnchorX must be between 0 and 100.");a=e}},scroll:{enumerable:!0,get:function(){return l},set:function(e){var i=t(e);!1===i?console.warn("Scroll: an invalid or illegal string was specified."):l=i}}})},vt}var It=function(){if(St)return Ct.exports;St=1;var e=be(),t=Ct.exports={WebVTT:Et(),VTTCue:wt(),VTTRegion:kt()};e.vttjs=t,e.WebVTT=t.WebVTT;var i=t.VTTCue,r=t.VTTRegion,s=e.VTTCue,n=e.VTTRegion;return t.shim=function(){e.VTTCue=i,e.VTTRegion=r},t.restore=function(){e.VTTCue=s,e.VTTRegion=n},e.VTTCue||t.shim(),Ct.exports}();const xt=(0,_e.g)(It);function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},At.apply(null,arguments)}var Pt=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=Te.location&&Te.location.href||"");var i=/^\/\//.test(e),r=!Te.location&&!/\/\//i.test(e);e=new Te.URL(e,Te.location||"https://example.com");var s=new URL(t,e);return r?s.href.slice(19):i?s.href.slice(s.protocol.length):s.href},Mt=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,r=0;r<i;++r)t[r].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),n=t.length,a=0;a<n;++a)t[a].apply(this,s)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}();function Dt(e){for(var t=function(e){return Te.atob?Te.atob(e):Buffer.from(e,"base64").toString("binary")}(e),i=new Uint8Array(t.length),r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return i}class Lt extends Mt{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf("\n");t>-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const Ot=function(e){let t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},Nt=function(e){let t={};if(!e)return t;let i,r=e.split(RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),s=r.length;for(;s--;)""!==r[s]&&(i=/([^=]*)=(.*)/.exec(r[s]).slice(1),i[0]=i[0].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^\s+|\s+$/g,""),i[1]=i[1].replace(/^['"](.*)['"]$/g,"$1"),t[i[0]]=i[1]);return t},Rt=e=>{let t=e.split("x"),i={};return t[0]&&(i.width=parseInt(t[0],10)),t[1]&&(i.height=parseInt(t[1],10)),i};class Ut extends Mt{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,i;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce((t,i)=>{let r=i(e);return r===e?t:t.concat([r])},[e]).forEach(e=>{for(let t=0;t<this.customParsers.length;t++)if(this.customParsers[t].call(this,e))return;if(0!==e.indexOf("#EXT"))this.trigger("data",{type:"comment",text:e.slice(1)});else if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e),t)this.trigger("data",{type:"tag",tagType:"m3u"});else if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(e),t)i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),this.trigger("data",i);else if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(e),t)i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),this.trigger("data",i);else if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(e),t)i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),this.trigger("data",i);else if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);else if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(e),t)i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),this.trigger("data",i);else if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(e),t)i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),this.trigger("data",i);else if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(e),t)i=At(Ot(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",i);else if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(e),t)i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),this.trigger("data",i);else if(t=/^#EXT-X-MAP:(.*)$/.exec(e),t){if(i={type:"tag",tagType:"map"},t[1]){let e=Nt(t[1]);e.URI&&(i.uri=e.URI),e.BYTERANGE&&(i.byterange=Ot(e.BYTERANGE))}this.trigger("data",i)}else if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(e),t)i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=Nt(t[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=Rt(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),this.trigger("data",i);else if(t=/^#EXT-X-MEDIA:(.*)$/.exec(e),t)i={type:"tag",tagType:"media"},t[1]&&(i.attributes=Nt(t[1])),this.trigger("data",i);else if(t=/^#EXT-X-ENDLIST/.exec(e),t)this.trigger("data",{type:"tag",tagType:"endlist"});else if(t=/^#EXT-X-DISCONTINUITY/.exec(e),t)this.trigger("data",{type:"tag",tagType:"discontinuity"});else if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(e),t)i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),this.trigger("data",i);else if(t=/^#EXT-X-KEY:(.*)$/.exec(e),t)i={type:"tag",tagType:"key"},t[1]&&(i.attributes=Nt(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),this.trigger("data",i);else if(t=/^#EXT-X-START:(.*)$/.exec(e),t)i={type:"tag",tagType:"start"},t[1]&&(i.attributes=Nt(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),this.trigger("data",i);else if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(e),t)i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);else if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(e),t)i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);else if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e),t)i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",this.trigger("data",i);else if(t=/^#EXT-X-SKIP:(.*)$/.exec(e),t&&t[1])i={type:"tag",tagType:"skip"},i.attributes=Nt(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split("\t")),this.trigger("data",i);else if(t=/^#EXT-X-PART:(.*)$/.exec(e),t&&t[1])i={type:"tag",tagType:"part"},i.attributes=Nt(t[1]),["DURATION"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["INDEPENDENT","GAP"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=Ot(i.attributes.BYTERANGE)),this.trigger("data",i);else if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e),t&&t[1])i={type:"tag",tagType:"server-control"},i.attributes=Nt(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),this.trigger("data",i);else if(t=/^#EXT-X-PART-INF:(.*)$/.exec(e),t&&t[1])i={type:"tag",tagType:"part-inf"},i.attributes=Nt(t[1]),["PART-TARGET"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),this.trigger("data",i);else if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e),t&&t[1])i={type:"tag",tagType:"preload-hint"},i.attributes=Nt(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){if(i.attributes.hasOwnProperty(e)){i.attributes[e]=parseInt(i.attributes[e],10);let t="BYTERANGE-LENGTH"===e?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e]}}),this.trigger("data",i);else if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e),t&&t[1])i={type:"tag",tagType:"rendition-report"},i.attributes=Nt(t[1]),["LAST-MSN","LAST-PART"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))}),this.trigger("data",i);else if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(e),t&&t[1]){i={type:"tag",tagType:"daterange"},i.attributes=Nt(t[1]),["ID","CLASS"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=String(i.attributes[e]))}),["START-DATE","END-DATE"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=new Date(i.attributes[e]))}),["DURATION","PLANNED-DURATION"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["END-ON-NEXT"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/i.test(i.attributes[e]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=i.attributes[e].toString(16))});let e=/^X-([A-Z]+-)+[A-Z]+$/;for(let t in i.attributes){if(!e.test(t))continue;let r=/[0-9A-Fa-f]{6}/g.test(i.attributes[t]),s=/^\d+(\.\d+)?$/.test(i.attributes[t]);i.attributes[t]=r?i.attributes[t].toString(16):s?parseFloat(i.attributes[t]):String(i.attributes[t])}this.trigger("data",i)}else t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(e),t?this.trigger("data",{type:"tag",tagType:"independent-segments"}):(t=/^#EXT-X-I-FRAMES-ONLY/.exec(e),t?this.trigger("data",{type:"tag",tagType:"i-frames-only"}):(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(e),t?(i={type:"tag",tagType:"content-steering"},i.attributes=Nt(t[1]),this.trigger("data",i)):(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(e),t?(i={type:"tag",tagType:"i-frame-playlist"},i.attributes=Nt(t[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=Rt(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),this.trigger("data",i)):(t=/^#EXT-X-DEFINE:(.*)$/.exec(e),t?(i={type:"tag",tagType:"define"},i.attributes=Nt(t[1]),this.trigger("data",i)):this.trigger("data",{type:"tag",data:e.slice(4)})))))}):this.trigger("data",{type:"uri",uri:e}))}addParser({expression:e,customType:t,dataParser:i,segment:r}){"function"!=typeof i&&(i=e=>e),this.customParsers.push(s=>{if(e.exec(s))return this.trigger("data",{type:"custom",data:i(s),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){this.tagMappers.push(i=>e.test(i)?t(i):i)}}const Bt=function(e){let t={};return Object.keys(e).forEach(function(i){t[(e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()))(i)]=e[i]}),t},Ft=function(e){let{serverControl:t,targetDuration:i,partTargetDuration:r}=e;if(!t)return;let s="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=i&&3*i,l=r&&2*r;i&&!t.hasOwnProperty(n)&&(t[n]=o,this.trigger("info",{message:`${s} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&t[n]<o&&(this.trigger("warn",{message:`${s} clamping HOLD-BACK (${t[n]}) to targetDuration * 3 (${o})`}),t[n]=o),r&&!t.hasOwnProperty(a)&&(t[a]=3*r,this.trigger("info",{message:`${s} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${t[a]}).`})),r&&t[a]<l&&(this.trigger("warn",{message:`${s} clamping PART-HOLD-BACK (${t[a]}) to partTargetDuration * 2 (${l}).`}),t[a]=l)};class qt extends Mt{constructor(e={}){super(),this.lineStream=new Lt,this.parseStream=new Ut,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;let t,i,r=this,s=[],n={},a=!1,o=function(){},l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},u=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let h=0,d=0,c={};this.on("end",()=>{n.uri||!n.parts&&!n.preloadHints||(!n.map&&t&&(n.map=t),!n.key&&i&&(n.key=i),!n.timeline&&"number"==typeof u&&(n.timeline=u),this.manifest.preloadSegment=n)}),this.parseStream.on("data",function(e){let p,m;if(r.manifest.definitions)for(let t in r.manifest.definitions)if(e.uri&&=e.uri.replace(`{$${t}}`,r.manifest.definitions[t]),e.attributes)for(let i in e.attributes)"string"==typeof e.attributes[i]&&(e.attributes[i]=e.attributes[i].replace(`{$${t}}`,r.manifest.definitions[t]));({tag(){({version(){e.version&&(this.manifest.version=e.version)},"allow-cache"(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){let t={};"length"in e&&(n.byterange=t,t.length=e.length,"offset"in e||(e.offset=h)),"offset"in e&&(n.byterange=t,t.offset=e.offset),h=t.offset+t.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),e.title&&(n.title=e.title),e.duration>0&&(n.duration=e.duration),0===e.duration&&(n.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=s},key(){if(e.attributes)if("NONE"===e.attributes.METHOD)i=null;else if(e.attributes.URI)if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes};else if("com.microsoft.playready"===e.attributes.KEYFORMAT)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI};else if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT){if(-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD))return void this.trigger("warn",{message:"invalid key method provided for Widevine"});if("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23))return void this.trigger("warn",{message:"invalid key URI provided for Widevine"});if(!e.attributes.KEYID||"0x"!==e.attributes.KEYID.substring(0,2))return void this.trigger("warn",{message:"invalid key ID provided for Widevine"});this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:Dt(e.attributes.URI.split(",")[1])}}else e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),i={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(i.iv=e.attributes.IV);else this.trigger("warn",{message:"ignoring key declaration without URI"});else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence"(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,u=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type"(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map(){t={},e.uri&&(t.uri=e.uri),e.byterange&&(t.byterange=e.byterange),i&&(t.key=i)},"stream-inf"(){this.manifest.playlists=s,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(n.attributes||(n.attributes={}),At(n.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});let t=this.manifest.mediaGroups[e.attributes.TYPE];t[e.attributes["GROUP-ID"]]=t[e.attributes["GROUP-ID"]]||{},p=t[e.attributes["GROUP-ID"]],m={default:/yes/i.test(e.attributes.DEFAULT)},m.default?m.autoselect=!0:m.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(m.language=e.attributes.LANGUAGE),e.attributes.URI&&(m.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(m.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(m.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(m.forced=/yes/i.test(e.attributes.FORCED)),p[e.attributes.NAME]=m},discontinuity(){u+=1,n.discontinuity=!0,this.manifest.discontinuityStarts.push(s.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),n.dateTimeString=e.dateTimeString,n.dateTimeObject=e.dateTimeObject;let{lastProgramDateTime:t}=this;this.lastProgramDateTime=new Date(e.dateTimeString).getTime(),null===t&&this.manifest.segments.reduceRight((e,t)=>(t.programDateTime=e-1e3*t.duration,t.programDateTime),this.lastProgramDateTime)},targetduration(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,Ft.call(this,this.manifest))},start(){!e.attributes||isNaN(e.attributes["TIME-OFFSET"])?this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"}):this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}},"cue-out"(){n.cueOut=e.data},"cue-out-cont"(){n.cueOutCont=e.data},"cue-in"(){n.cueIn=e.data},skip(){this.manifest.skip=Bt(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;let t=this.manifest.segments.length,i=Bt(e.attributes);n.parts=n.parts||[],n.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=d),d=i.byterange.offset+i.byterange.length);let r=n.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${r} for segment #${t}`,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((e,t)=>{e.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})})},"server-control"(){let t=this.manifest.serverControl=Bt(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Ft.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){let t=this.manifest.segments.length,i=Bt(e.attributes),r=i.type&&"PART"===i.type;n.preloadHints=n.preloadHints||[],n.preloadHints.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=r?d:0,r&&(d=i.byterange.offset+i.byterange.length)));let s=n.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${s} for segment #${t}`,e.attributes,["TYPE","URI"]),i.type)for(let e=0;e<n.preloadHints.length-1;e++){let r=n.preloadHints[e];r.type&&r.type===i.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${s} for segment #${t} has the same TYPE ${i.type} as preload hint #${e}`})}},"rendition-report"(){let t=Bt(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);let i=this.manifest.renditionReports.length-1,r=["LAST-MSN","URI"];a&&r.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${i}`,e.attributes,r)},"part-inf"(){this.manifest.partInf=Bt(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),Ft.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(Bt(e.attributes));let t=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${t}`,e.attributes,["ID","START-DATE"]);let i=this.manifest.dateRanges[t];i.endDate&&i.startDate&&new Date(i.endDate)<new Date(i.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),i.duration&&i.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),i.plannedDuration&&i.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});let r=!!i.endOnNext;if(r&&!i.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),r&&(i.duration||i.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),i.duration&&i.endDate){let e=i.startDate.getTime()+1e3*i.duration;this.manifest.dateRanges[t].endDate=new Date(e)}if(c[i.id]){for(let e in c[i.id])if(i[e]&&JSON.stringify(c[i.id][e])!==JSON.stringify(i[e])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}let e=this.manifest.dateRanges.findIndex(e=>e.id===i.id);this.manifest.dateRanges[e]=At(this.manifest.dateRanges[e],i),c[i.id]=At(c[i.id],i),this.manifest.dateRanges.pop()}else c[i.id]=i},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=Bt(e.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",e.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};let t=(e,t)=>{e in this.manifest.definitions?this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${e}`}):this.manifest.definitions[e]=t};if("QUERYPARAM"in e.attributes){if("NAME"in e.attributes||"IMPORT"in e.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});let i=this.params.get(e.attributes.QUERYPARAM);if(!i)return void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${e.attributes.QUERYPARAM}`});t(e.attributes.QUERYPARAM,decodeURIComponent(i))}else if("NAME"in e.attributes){if("IMPORT"in e.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});if(!("VALUE"in e.attributes)||"string"!=typeof e.attributes.VALUE)return void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${e.attributes.NAME}`});t(e.attributes.NAME,e.attributes.VALUE)}else if("IMPORT"in e.attributes){if(!this.mainDefinitions[e.attributes.IMPORT])return void this.trigger("error",{message:`EXT-X-DEFINE: No value ${e.attributes.IMPORT} to import, or IMPORT used on main playlist`});t(e.attributes.IMPORT,this.mainDefinitions[e.attributes.IMPORT])}else this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:e.attributes,uri:e.uri,timeline:u}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",e.attributes,["BANDWIDTH","URI"])}}[e.tagType]||o).call(r)},uri(){n.uri=e.uri,s.push(n),this.manifest.targetDuration&&!("duration"in n)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),n.duration=this.manifest.targetDuration),i&&(n.key=i),n.timeline=u,t&&(n.map=t),d=0,null!==this.lastProgramDateTime&&(n.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*n.duration),n={}},comment(){},custom(){e.segment?(n.custom=n.custom||{},n.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,i){let r=[];i.forEach(function(e){t.hasOwnProperty(e)||r.push(e)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var jt,Ht,$t={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},Vt=["video","audio","text"],zt=["Video","Audio","Text"],Wt=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})},Gt=function(e){void 0===e&&(e="");var t=e.split(","),i=[];return t.forEach(function(e){var t;e=e.trim(),Vt.forEach(function(r){var s=$t[r].exec(e.toLowerCase());if(s&&!(s.length<=1)){t=r;var n=e.substring(0,s[1].length),a=e.replace(n,"");i.push({type:n,details:a,mediaType:r})}}),t||i.push({type:e,details:"",mediaType:"unknown"})}),i},Xt=function(e){return void 0===e&&(e=""),$t.audio.test(e.trim().toLowerCase())},Kt=function(e){if(e&&"string"==typeof e){var t=e.toLowerCase().split(",").map(function(e){return Wt(e.trim())}),i="video";1===t.length&&Xt(t[0])?i="audio":1===t.length&&function(e){return void 0===e&&(e=""),$t.text.test(e.trim().toLowerCase())}(t[0])&&(i="application");var r="mp4";return t.every(function(e){return $t.mp4.test(e)})?r="mp4":t.every(function(e){return $t.webm.test(e)})?r="webm":t.every(function(e){return $t.ogg.test(e)})&&(r="ogg"),i+"/"+r+';codecs="'+e+'"'}},Zt=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=!1),Te.MediaSource&&Te.MediaSource.isTypeSupported&&Te.MediaSource.isTypeSupported(Kt(e))||t&&Te.ManagedMediaSource&&Te.ManagedMediaSource.isTypeSupported&&Te.ManagedMediaSource.isTypeSupported(Kt(e))||!1},Yt=function(e){return void 0===e&&(e=""),e.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<zt.length;t++)if($t["muxer"+zt[t]].test(e))return!0;return!1})},Qt="mp4a.40.2",Jt=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,ei=/^application\/dash\+xml/i,ti=function(e){return Jt.test(e)?"hls":ei.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null},ii=function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},ri=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!function(e){return ii(e)}(e)&&!(e instanceof ArrayBuffer)&&(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},si=Te.BigInt||Number,ni=[si("0x1"),si("0x100"),si("0x10000"),si("0x1000000"),si("0x100000000"),si("0x10000000000"),si("0x1000000000000"),si("0x100000000000000"),si("0x10000000000000000")];jt=new Uint16Array([65484]),255===(Ht=new Uint8Array(jt.buffer,jt.byteOffset,jt.byteLength))[0]||Ht[0];var ai,oi,li=function(e,t){var i=void 0===t?{}:t,r=i.signed,s=void 0!==r&&r,n=i.le,a=void 0!==n&&n;e=ri(e);var o=a?"reduce":"reduceRight",l=(e[o]?e[o]:Array.prototype[o]).call(e,function(t,i,r){var s=a?r:Math.abs(r+1-e.length);return t+si(i)*ni[s]},si(0));if(s){var u=ni[e.length]/si(2)-si(1);(l=si(l))>u&&(l-=u,l-=u,l-=si(2))}return Number(l)},ui=function(e,t){if("string"!=typeof e&&e&&"function"==typeof e.toString&&(e=e.toString()),"string"!=typeof e)return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return i},hi=function(e,t,i){var r=void 0===i?{}:i,s=r.offset,n=void 0===s?0:s,a=r.mask,o=void 0===a?[]:a;e=ri(e);var l=(t=ri(t)).every?t.every:Array.prototype.every;return t.length&&e.length-n>=t.length&&l.call(t,function(t,i){return t===(o[i]?o[i]&e[n+i]:e[n+i])})},di={},ci={},pi={};function mi(){if(ai)return pi;function e(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}ai=1;var t=e({HTML:"text/html",isHTML:function(e){return e===t.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),i=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===i.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),r=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,s=RegExp("[\\-\\.0-9"+r.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),n=RegExp("^"+r.source+s.source+"*(?::"+r.source+s.source+"*)?$");return pi.assign=function(e,t){if("object"!=typeof e||!e)throw TypeError("target is not an object");for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},pi.find=function(e,t,i){if(void 0===i&&(i=Array.prototype),e&&"function"==typeof i.find)return i.find.call(e,t);for(var r=0;r<e.length;r++)if(Object.prototype.hasOwnProperty.call(e,r)){var s=e[r];if(t.call(void 0,s,r,e))return s}},pi.freeze=e,pi.MIME_TYPE=t,pi.NAMESPACE=i,pi.nameStartChar=r,pi.nameChar=s,pi.tagNamePattern=n,pi}function gi(){if(oi)return ci;oi=1;var e=mi(),t=e.find,i=e.NAMESPACE,r=e.tagNamePattern;function s(e){return""!==e}function n(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function a(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(s):[]}(e);return Object.keys(t.reduce(n,{}))}function o(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}function l(e,t){var i=e.prototype;if(!(i instanceof t)){function r(){}r.prototype=t.prototype,o(i,r=new r),e.prototype=i=r}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var u={},h=u.ELEMENT_NODE=1,d=u.ATTRIBUTE_NODE=2,c=u.TEXT_NODE=3,p=u.CDATA_SECTION_NODE=4,m=u.ENTITY_REFERENCE_NODE=5,g=u.ENTITY_NODE=6,f=u.PROCESSING_INSTRUCTION_NODE=7,y=u.COMMENT_NODE=8,_=u.DOCUMENT_NODE=9,b=u.DOCUMENT_TYPE_NODE=10,v=u.DOCUMENT_FRAGMENT_NODE=11,T=u.NOTATION_NODE=12,S={},C={};S.INDEX_SIZE_ERR=(C[1]="Index size error",1),S.DOMSTRING_SIZE_ERR=(C[2]="DOMString size error",2);var E=S.HIERARCHY_REQUEST_ERR=(C[3]="Hierarchy request error",3);S.WRONG_DOCUMENT_ERR=(C[4]="Wrong document",4);var w=S.INVALID_CHARACTER_ERR=(C[5]="Invalid character",5);S.NO_DATA_ALLOWED_ERR=(C[6]="No data allowed",6),S.NO_MODIFICATION_ALLOWED_ERR=(C[7]="No modification allowed",7);var k=S.NOT_FOUND_ERR=(C[8]="Not found",8);S.NOT_SUPPORTED_ERR=(C[9]="Not supported",9);var I=S.INUSE_ATTRIBUTE_ERR=(C[10]="Attribute in use",10),x=S.INVALID_STATE_ERR=(C[11]="Invalid state",11);function A(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,C[e]),this.message=C[e],Error.captureStackTrace&&Error.captureStackTrace(this,A);return i.code=e,t&&(this.message=this.message+": "+t),i}function P(){}function M(e,t){this._node=e,this._refresh=t,D(this)}function D(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var i=e._refresh(e._node);if(Te(e,"length",i.length),!e.$$length||i.length<e.$$length)for(var r=i.length;r in e;r++)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];o(i,e),e._inc=t}}function L(){this._nameIndex=Object.create(null)}function O(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function N(e,t){e._nameIndex[t.nodeName]===t&&delete e._nameIndex[t.nodeName]}function R(e,t,i,r){if(r?(t[O(t,r)]=i,N(t,r)):t[t.length++]=i,function(e,t){e._nameIndex[t.nodeName]=t}(t,i),e){i.ownerElement=e;var s=e.ownerDocument;s&&(r&&z(s,e,r),V(s,e,i))}}function U(e,t,i){var r=O(t,i);if(!(r>=0))throw new A(k,Error(e.tagName+"@"+i));for(var s=t.length-1;r<s;)t[r]=t[++r];if(t.length=s,N(t,i),e){var n=e.ownerDocument;n&&(z(n,e,i),i.ownerElement=null)}}function B(){}function F(){}function q(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function j(e,t){return H(e,null,{enter:function(e){return!t(e)||H.STOP}})===H.STOP}function H(e,t,i){for(var r=[{node:e,context:t,phase:H.ENTER}];r.length>0;){var s=r.pop();if(s.phase===H.ENTER){var n=i.enter(s.node,s.context);if(n===H.STOP)return H.STOP;if(r.push({node:s.node,context:n,phase:H.EXIT}),null==n)continue;for(var a=s.node.lastChild;a;)r.push({node:a,context:n,phase:H.ENTER}),a=a.previousSibling}else i.exit&&i.exit(s.node,s.context)}}function $(){this.ownerDocument=this}function V(e,t,r){e&&e._inc++,r.namespaceURI===i.XMLNS&&(t._nsMap[r.prefix?r.localName:""]=r.value)}function z(e,t,r,s){e&&e._inc++,r.namespaceURI===i.XMLNS&&delete t._nsMap[r.prefix?r.localName:""]}function W(e,t,i){if(e&&e._inc){e._inc++;var r=t.childNodes;if(i)r[r.length++]=i;else{for(var s=t.firstChild,n=0;s;)r[n++]=s,s=s.nextSibling;r.length=n,delete r[r.length]}}}function G(e,t){var i=t.previousSibling,r=t.nextSibling;return i?i.nextSibling=r:e.firstChild=r,r?r.previousSibling=i:e.lastChild=i,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,W(e.ownerDocument,e),t}function X(e){return e&&e.nodeType===F.DOCUMENT_TYPE_NODE}function K(e){return e&&e.nodeType===F.ELEMENT_NODE}function Z(e){return e&&e.nodeType===F.TEXT_NODE}function Y(e,i){var r=e.childNodes||[];if(t(r,K)||X(i))return!1;var s=t(r,X);return!(i&&s&&r.indexOf(s)>r.indexOf(i))}function Q(e,i){var r=e.childNodes||[];if(t(r,function(e){return K(e)&&e!==i}))return!1;var s=t(r,X);return!(i&&s&&r.indexOf(s)>r.indexOf(i))}function J(e,i,r){var s=e.childNodes||[],n=i.childNodes||[];if(i.nodeType===F.DOCUMENT_FRAGMENT_NODE){var a=n.filter(K);if(a.length>1||t(n,Z))throw new A(E,"More than one element or text in fragment");if(1===a.length&&!Y(e,r))throw new A(E,"Element in fragment can not be inserted before doctype")}if(K(i)&&!Y(e,r))throw new A(E,"Only one element can be added and only after doctype");if(X(i)){if(t(s,X))throw new A(E,"Only one doctype is allowed");var o=t(s,K);if(r&&s.indexOf(o)<s.indexOf(r))throw new A(E,"Doctype can only be inserted before an element");if(!r&&o)throw new A(E,"Doctype can not be appended since element is present")}}function ee(e,i,r){var s=e.childNodes||[],n=i.childNodes||[];if(i.nodeType===F.DOCUMENT_FRAGMENT_NODE){var a=n.filter(K);if(a.length>1||t(n,Z))throw new A(E,"More than one element or text in fragment");if(1===a.length&&!Q(e,r))throw new A(E,"Element in fragment can not be inserted before doctype")}if(K(i)&&!Q(e,r))throw new A(E,"Only one element can be added and only after doctype");if(X(i)){function l(e){return X(e)&&e!==r}if(t(s,l))throw new A(E,"Only one doctype is allowed");var o=t(s,K);if(r&&s.indexOf(o)<s.indexOf(r))throw new A(E,"Doctype can only be inserted before an element")}}function te(e,t,i,r){(function(e,t,i){if(!function(e){return e&&(e.nodeType===F.DOCUMENT_NODE||e.nodeType===F.DOCUMENT_FRAGMENT_NODE||e.nodeType===F.ELEMENT_NODE)}(e))throw new A(E,"Unexpected parent node type "+e.nodeType);if(i&&i.parentNode!==e)throw new A(k,"child not in parent");if(!function(e){return e&&(K(e)||Z(e)||X(e)||e.nodeType===F.DOCUMENT_FRAGMENT_NODE||e.nodeType===F.COMMENT_NODE||e.nodeType===F.PROCESSING_INSTRUCTION_NODE)}(t)||X(t)&&e.nodeType!==F.DOCUMENT_NODE)throw new A(E,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)})(e,t,i),e.nodeType===F.DOCUMENT_NODE&&(r||J)(e,t,i);var s=t.parentNode;if(s&&s.removeChild(t),t.nodeType===v){var n=t.firstChild;if(null==n)return t;var a=t.lastChild}else n=a=t;var o=i?i.previousSibling:e.lastChild;n.previousSibling=o,a.nextSibling=i,o?o.nextSibling=n:e.firstChild=n,null==i?e.lastChild=a:i.previousSibling=a;do{n.parentNode=e,ie(n,e.ownerDocument||e)}while(n!==a&&(n=n.nextSibling));return W(e.ownerDocument||e,e),t.nodeType==v&&(t.firstChild=t.lastChild=null),t}function ie(e,t){if(e.ownerDocument!==t){if(e.ownerDocument=t,e.nodeType===h&&e.attributes)for(var i=0;i<e.attributes.length;i++){var r=e.attributes.item(i);r&&(r.ownerDocument=t)}for(var s=e.firstChild;s;)ie(s,t),s=s.nextSibling}}function re(){this._nsMap={}}function se(){}function ne(){}function ae(){}function oe(){}function le(){}function ue(){}function he(){}function de(){}function ce(){}function pe(){}function me(){}function ge(){}function fe(e,t,i){var r=!!i&&!!i.requireWellFormed,s=[],n=9==this.nodeType&&this.documentElement||this,a=n.prefix,o=n.namespaceURI;if(o&&null==a&&null==(a=n.lookupPrefix(o)))var l=[{namespace:o,prefix:null}];return be(this,s,e,t,l,r),s.join("")}function ye(e,t,r){var s=e.prefix||"",n=e.namespaceURI;if(!n||"xml"===s&&n===i.XML||n===i.XMLNS)return!1;for(var a=r.length;a--;){var o=r[a];if(o.prefix===s)return o.namespace!==n}return!0}function _e(e,t,i,s){if(s&&!r.test(t))throw new A(x,'The attribute name "'+t+'" is not a valid XML QName');e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,q),'"')}function be(e,t,s,n,a,o){a||=[],H(e,{ns:a,isHTML:s},{enter:function(e,s){var a=s.ns,l=s.isHTML;if(n){if(!(e=n(e)))return null;if("string"==typeof e)return t.push(e),null}switch(e.nodeType){case h:var u=e.attributes,g=u.length,T=e.tagName,S=T;if(!(l=i.isHTML(e.namespaceURI)||l)&&!e.prefix&&e.namespaceURI){for(var C,E=0;E<u.length;E++)if("xmlns"===u.item(E).name){C=u.item(E).value;break}if(!C)for(var w=a.length-1;w>=0;w--)if(""===(k=a[w]).prefix&&k.namespace===e.namespaceURI){C=k.namespace;break}if(C!==e.namespaceURI)for(w=a.length-1;w>=0;w--){var k;if((k=a[w]).namespace===e.namespaceURI){k.prefix&&(S=k.prefix+":"+T);break}}}if(o&&!r.test(S))throw new A(x,'The element name "'+S+'" is not a valid XML QName');t.push("<",S);for(var I=a.slice(),P=0;P<g;P++)"xmlns"==(M=u.item(P)).prefix?I.push({prefix:M.localName,namespace:M.value}):"xmlns"==M.nodeName&&I.push({prefix:"",namespace:M.value});for(P=0;P<g;P++){var M;if(ye(M=u.item(P),0,I)){var D=M.prefix||"",L=M.namespaceURI;_e(t,D?"xmlns:"+D:"xmlns",L,o),I.push({prefix:D,namespace:L})}var O=n?n(M):M;O&&("string"==typeof O?t.push(O):_e(t,O.name,O.value,o))}if(T===S&&ye(e,0,I)){var N=e.prefix||"";L=e.namespaceURI,_e(t,N?"xmlns:"+N:"xmlns",L,o),I.push({prefix:N,namespace:L})}var R=e.firstChild;if(R||l&&!/^(?:meta|link|img|br|hr|input)$/i.test(T)){if(t.push(">"),l&&/^script$/i.test(T)){for(;R;)R.data?t.push(R.data):be(R,t,l,n,I.slice(),o),R=R.nextSibling;return t.push("</",T,">"),null}return{ns:I,isHTML:l,tag:S}}return t.push("/>"),null;case _:case v:return{ns:a.slice(),isHTML:l,tag:null};case d:return _e(t,e.name,e.value,o),null;case c:return t.push(e.data.replace(/[<&>]/g,q)),null;case p:if(o&&-1!==e.data.indexOf("]]>"))throw new A(x,'The CDATASection data contains "]]>"');return t.push("<![CDATA[",e.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case y:if(o&&-1!==e.data.indexOf("--\x3e"))throw new A(x,'The comment node data contains "--\x3e"');return t.push("\x3c!--",e.data,"--\x3e"),null;case b:if(o){if(!r.test(e.name))throw new A(x,'The doctype name "'+e.name+'" is not a valid XML Name');if(e.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(e.publicId))throw new A(x,"DocumentType publicId is not a valid PubidLiteral");if(e.systemId&&!/^("[^"]*"|'[^']*')$/.test(e.systemId))throw new A(x,"DocumentType systemId is not a valid SystemLiteral");if(e.internalSubset&&-1!==e.internalSubset.indexOf("]>"))throw new A(x,'DocumentType internalSubset contains "]>"')}var U=e.publicId,B=e.systemId;if(t.push("<!DOCTYPE ",e.name),U)t.push(" PUBLIC ",U),B&&"."!=B&&t.push(" ",B),t.push(">");else if(B&&"."!=B)t.push(" SYSTEM ",B,">");else{var F=e.internalSubset;F&&t.push(" [",F,"]"),t.push(">")}return null;case f:if(o){if(!r.test(e.target)||-1!==e.target.indexOf(":")||"xml"===e.target.toLowerCase())throw new A(x,'The processing instruction target "'+e.target+'" is not a valid XML NCName or is reserved');if(-1!==e.data.indexOf("?>"))throw new A(x,'The ProcessingInstruction data contains "?>"')}return t.push("<?",e.target," ",e.data,"?>"),null;case m:if(o&&!r.test(e.nodeName))throw new A(x,'The entity reference name "'+e.nodeName+'" is not a valid XML Name');return t.push("&",e.nodeName,";"),null;default:return t.push("??",e.nodeName),null}},exit:function(e,i){i&&i.tag&&t.push("</",i.tag,">")}})}function ve(e,t,i){var r;return H(t,null,{enter:function(t,s){var n=new t.constructor;for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var o=t[a];"object"!=typeof o&&o!=n[a]&&(n[a]=o)}t.childNodes&&(n.childNodes=new P),n.ownerDocument=e;var l=i;switch(n.nodeType){case h:var u=t.attributes,c=n.attributes=new L,p=u.length;c._ownerElement=n;for(var m=0;m<p;m++)n.setAttributeNode(ve(e,u.item(m),!0));break;case d:l=!0}return null===s?r=n:s.appendChild(n),l?n:null}}),r}function Te(e,t,i){e[t]=i}S.SYNTAX_ERR=(C[12]="Syntax error",12),S.INVALID_MODIFICATION_ERR=(C[13]="Invalid modification",13),S.NAMESPACE_ERR=(C[14]="Invalid namespace",14),S.INVALID_ACCESS_ERR=(C[15]="Invalid access",15),A.prototype=Error.prototype,o(S,A),P.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e,t,i){for(var r=!!i&&!!i.requireWellFormed,s=[],n=0;n<this.length;n++)be(this[n],s,e,t,null,r);return s.join("")},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},M.prototype.item=function(e){return D(this),this[e]||null},l(M,P),L.prototype={length:0,item:P.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new A(I);var i=this._nameIndex[e.nodeName];return R(this._ownerElement,this,e,i),i},setNamedItemNS:function(e){var t,i=e.ownerElement;if(i&&i!=this._ownerElement)throw new A(I);return t=this.getNamedItemNS(e.namespaceURI,e.localName),R(this._ownerElement,this,e,t),t},removeNamedItem:function(e){var t=this.getNamedItem(e);return U(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var i=this.getNamedItemNS(e,t);return U(this._ownerElement,this,i),i},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var r=this[i];if(r.localName==t&&r.namespaceURI==e)return r}return null}},B.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,i){var r=new $;if(r.implementation=this,r.childNodes=new P,r.doctype=i||null,i&&r.appendChild(i),t){var s=r.createElementNS(e,t);r.appendChild(s)}return r},createDocumentType:function(e,t,i){var r=new ue;return r.name=e,r.nodeName=e,r.publicId=t||"",r.systemId=i||"",r}},F.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return te(this,e,t)},replaceChild:function(e,t){te(this,e,t,ee),t&&this.removeChild(t)},removeChild:function(e){return G(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return ve(this.ownerDocument||this,this,e)},normalize:function(){H(this,null,{enter:function(e){for(var t=e.firstChild;t;){var i=t.nextSibling;if(null!==i&&i.nodeType===c&&t.nodeType===c){for(var r=[],s=i;null!==s&&s.nodeType===c;)r.push(s.data),s=s.nextSibling;for(var n=t.nextSibling;n!==s;){var a=n.nextSibling;n.parentNode=null,n.previousSibling=null,n.nextSibling=null,n=a}t.nextSibling=s,null===s?e.lastChild=t:s.previousSibling=t,t.appendData(r.join("")),W(e.ownerDocument,e),t=s}else t=i}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)&&i[r]===e)return r;t=t.nodeType==d?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,e))return i[e];t=t.nodeType==d?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},o(u,F),o(u,F.prototype),H.STOP=Symbol("walkDOM.STOP"),H.ENTER=0,H.EXIT=1,$.prototype={nodeName:"#document",nodeType:_,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==v){for(var i=e.firstChild;i;){var r=i.nextSibling;this.insertBefore(i,t),i=r}return e}return te(this,e,t),ie(e,this),null===this.documentElement&&e.nodeType===h&&(this.documentElement=e),e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),G(this,e)},replaceChild:function(e,t){te(this,e,t,ee),ie(e,this),t&&this.removeChild(t),K(e)&&(this.documentElement=e)},importNode:function(e,t){return function(e,t,i){var r;return H(t,null,{enter:function(t,s){var n=t.cloneNode(!1);return n.ownerDocument=e,n.parentNode=null,null===s?r=n:s.appendChild(n),t.nodeType===d||i?n:null}}),r}(this,e,t)},getElementById:function(e){var t=null;return j(this.documentElement,function(i){if(i.nodeType==h&&i.getAttribute("id")==e)return t=i,!0}),t},getElementsByClassName:function(e){var t=a(e);return new M(this,function(i){var r=[];return t.length>0&&j(i.documentElement,function(s){if(s!==i&&s.nodeType===h){var n=s.getAttribute("class");if(n){var o=e===n;if(!o){var l=a(n);o=t.every(function(e){return function(t){return e&&-1!==e.indexOf(t)}}(l))}o&&r.push(s)}}}),r})},createElement:function(e){var t=new re;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new P,(t.attributes=new L)._ownerElement=t,t},createDocumentFragment:function(){var e=new pe;return e.ownerDocument=this,e.childNodes=new P,e},createTextNode:function(e){var t=new ae;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new oe;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){if(-1!==e.indexOf("]]>"))throw new A(w,'data contains "]]>"');var t=new le;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new me;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new se;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!r.test(e))throw new A(w,'not a valid xml name "'+e+'"');var t=new ce;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new re,r=t.split(":"),s=i.attributes=new L;return i.childNodes=new P,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==r.length?(i.prefix=r[0],i.localName=r[1]):i.localName=t,s._ownerElement=i,i},createAttributeNS:function(e,t){var i=new se,r=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==r.length?(i.prefix=r[0],i.localName=r[1]):i.localName=t,i}},l($,F),re.prototype={nodeType:h,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===v?this.insertBefore(e,null):function(e,t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=e,t.previousSibling=e.lastChild,t.nextSibling=null,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,e.lastChild=t,W(e.ownerDocument,e,t),ie(t,e.ownerDocument||e),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+i,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new M(this,function(t){var i=[];return j(t,function(r){r!==t&&r.nodeType==h&&("*"===e||r.tagName==e)&&i.push(r)}),i})},getElementsByTagNameNS:function(e,t){return new M(this,function(i){var r=[];return j(i,function(s){s!==i&&s.nodeType===h&&("*"===e||s.namespaceURI===e)&&("*"===t||s.localName==t)&&r.push(s)}),r})}},$.prototype.getElementsByTagName=re.prototype.getElementsByTagName,$.prototype.getElementsByTagNameNS=re.prototype.getElementsByTagNameNS,l(re,F),se.prototype.nodeType=d,l(se,F),ne.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw Error(C[E])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},l(ne,F),ae.prototype={nodeName:"#text",nodeType:c,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},l(ae,ne),oe.prototype={nodeName:"#comment",nodeType:y},l(oe,ne),le.prototype={nodeName:"#cdata-section",nodeType:p},l(le,ne),ue.prototype.nodeType=b,l(ue,F),he.prototype.nodeType=T,l(he,F),de.prototype.nodeType=g,l(de,F),ce.prototype.nodeType=m,l(ce,F),pe.prototype.nodeName="#document-fragment",pe.prototype.nodeType=v,l(pe,F),me.prototype.nodeType=f,l(me,F),ge.prototype.serializeToString=function(e,t,i,r){return fe.call(e,t,i,r)},F.prototype.toString=fe;try{Object.defineProperty&&(Object.defineProperty(M.prototype,"length",{get:function(){return D(this),this.$$length}}),Object.defineProperty(F.prototype,"textContent",{get:function(){if(this.nodeType===h||this.nodeType===v){var e=[];return H(this,null,{enter:function(t){return t.nodeType===h||t.nodeType===v||(t.nodeType===f||t.nodeType===y?null:void e.push(t.nodeValue))}}),e.join("")}return this.nodeValue},set:function(e){switch(this.nodeType){case h:case v:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Te=function(e,t,i){e["$$"+t]=i})}catch{}return ci.DocumentType=ue,ci.DOMException=A,ci.DOMImplementation=B,ci.Element=re,ci.Node=F,ci.NodeList=P,ci.walkDOM=H,ci.XMLSerializer=ge,ci}var fi,yi,_i,bi,vi={},Ti={},Si={};function Ci(){if(_i)return vi;_i=1;var e=mi(),t=gi(),i=(fi||(fi=1,function(e){var t=mi().freeze;e.XML_ENTITIES=t({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=t({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:"\t",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}),e.entityMap=e.HTML_ENTITIES}(Ti)),Ti),r=function(){if(yi)return Si;yi=1;var e=mi().NAMESPACE,t=mi().tagNamePattern;function i(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,i)}function r(){}function s(r,s,p,m,g){function f(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(p,t)?p[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(g.error("entity not found:"+e),e)}function y(e){if(e>w){var t=r.substring(w,e).replace(/&#?\w+;/g,f);S&&_(w),m.characters(t,0,e-w),w=e}}function _(e,t){for(;e>=v&&(t=T.exec(r));)b=t.index,v=b+t[0].length,S.lineNumber++;S.columnNumber=e-b+1}for(var b=0,v=0,T=/.*(?:\r\n?|\n)|.*$/g,S=m.locator,C=[{currentNSMap:s}],E={},w=0;;){try{var k=r.indexOf("<",w);if(k<0){if(!r.substr(w).match(/^\s*$/)){var I=m.doc,x=I.createTextNode(r.substr(w));I.appendChild(x),m.currentElement=x}return}switch(k>w&&y(k),r.charAt(k+1)){case"/":var A=r.indexOf(">",k+3),P=r.substring(k+2,A).replace(/^([\s\S]*?[^ \t\n\r])?[ \t\n\r]*$/,"$1"),M=C.pop();A<0?(P=r.substring(k+2).replace(/[\s<].*/,""),g.error("end tag name: "+P+" is not complete:"+M.tagName),A=k+1+P.length):P.match(/\s</)?(P=P.replace(/[\s<].*/,""),g.error("end tag name: "+P+" maybe not complete"),A=k+1+P.length):/[ \t\n\r]/.test(P)&&t.test(P.split(/[ \t\n\r]/)[0])&&g.error('end tag name is followed by whitespace and trailing content: "'+P+'"');var D=M.localNSMap,L=M.tagName==P;if(L||M.tagName&&M.tagName.toLowerCase()==P.toLowerCase()){if(m.endElement(M.uri,M.localName,P),D)for(var O in D)Object.prototype.hasOwnProperty.call(D,O)&&m.endPrefixMapping(O);L||g.fatalError("end tag name: "+P+" is not match the current start tagName:"+M.tagName)}else C.push(M);A++;break;case"?":S&&_(k),A=d(r,k,m);break;case"!":S&&_(k),A=h(r,k,m,g);break;default:S&&_(k);var N=new c,R=C[C.length-1].currentNSMap,U=(A=a(r,k,N,R,f,g),N.length);if(!N.closed&&u(r,A,N.tagName,E)&&(N.closed=!0,p.nbsp||g.warning("unclosed xml attribute")),S&&U){for(var B=n(S,{}),F=0;F<U;F++){var q=N[F];_(q.offset),q.locator=n(S,{})}m.locator=B,o(N,m,R)&&C.push(N),m.locator=S}else o(N,m,R)&&C.push(N);e.isHTML(N.uri)&&!N.closed?A=l(r,A,N.tagName,f,m):A++}}catch(e){if(e instanceof i)throw e;g.error("element parse error: "+e),A=-1}A>w?w=A:y(Math.max(k,w)+1)}}function n(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function a(t,i,r,s,n,a){function o(e,t,i){r.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),r.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,n),i)}for(var l,u=++i,h=0;;){var d=t.charAt(u);if(0===h&&"<"===d)throw Error("unexpected < in tag name: "+t.slice(i,u));switch(d){case"=":if(1===h)l=t.slice(i,u),h=3;else{if(2!==h)throw Error("attribute equal must after attrName");h=3}break;case"'":case'"':if(3===h||1===h){if(1===h&&(a.warning('attribute value must after "="'),l=t.slice(i,u)),i=u+1,!((u=t.indexOf(d,i))>0))throw Error("attribute value no end '"+d+"' match");o(l,c=t.slice(i,u),i-1),h=5}else{if(4!=h)throw Error('attribute value must after "="');o(l,c=t.slice(i,u),i),a.warning('attribute "'+l+'" missed start quot('+d+")!!"),i=u+1,h=5}break;case"/":switch(h){case 0:r.setTagName(t.slice(i,u));case 5:case 6:case 7:h=7,r.closed=!0;case 4:case 1:break;case 2:r.closed=!0;break;default:throw Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==h&&r.setTagName(t.slice(i,u)),u;case">":switch(h){case 0:r.setTagName(t.slice(i,u));case 5:case 6:case 7:break;case 4:case 1:"/"===(c=t.slice(i,u)).slice(-1)&&(r.closed=!0,c=c.slice(0,-1));case 2:2===h&&(c=l),4==h?(a.warning('attribute "'+c+'" missed quot(")!'),o(l,c,i)):((!e.isHTML(s[""])||!c.match(/^(?:disabled|checked|selected)$/i))&&a.warning('attribute "'+c+'" missed value!! "'+c+'" instead!!'),o(c,c,i));break;case 3:throw Error("attribute value missed!!")}return u;case"":d=" ";default:if(d<=" ")switch(h){case 0:r.setTagName(t.slice(i,u)),h=6;break;case 1:l=t.slice(i,u),h=2;break;case 4:var c=t.slice(i,u);a.warning('attribute "'+c+'" missed quot(")!!'),o(l,c,i);case 5:h=6}else switch(h){case 2:r.tagName,(!e.isHTML(s[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&a.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),o(l,l,i),i=u,h=1;break;case 5:a.warning('attribute space is required"'+l+'"!!');case 6:h=1,i=u;break;case 3:h=4,i=u;break;case 7:throw Error("elements closed character '/' and '>' must be connected to")}}u++}}function o(t,i,r){for(var s=t.tagName,n=null,a=t.length;a--;){var o=t[a],l=o.qName,u=o.value;if((p=l.indexOf(":"))>0)var h=o.prefix=l.slice(0,p),d=l.slice(p+1),c="xmlns"===h&&d;else d=l,h=null,c="xmlns"===l&&"";o.localName=d,!1!==c&&(n??(n={},r=Object.create(r)),r[c]=n[c]=u,o.uri=e.XMLNS,i.startPrefixMapping(c,u))}for(a=t.length;a--;)(h=(o=t[a]).prefix)&&("xml"===h&&(o.uri=e.XML),"xmlns"!==h&&(o.uri=r[h||""]));var p;(p=s.indexOf(":"))>0?(h=t.prefix=s.slice(0,p),d=t.localName=s.slice(p+1)):(h=null,d=t.localName=s);var m=t.uri=r[h||""];if(i.startElement(m,d,s,t),!t.closed)return t.currentNSMap=r,t.localNSMap=n,!0;if(i.endElement(m,d,s),n)for(h in n)Object.prototype.hasOwnProperty.call(n,h)&&i.endPrefixMapping(h)}function l(e,t,i,r,s){if(/^(?:script|textarea)$/i.test(i)){var n=e.indexOf("</"+i+">",t),a=e.substring(t+1,n);if(/[&<]/.test(a))return/^script$/i.test(i)?(s.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,r),s.characters(a,0,a.length),n)}return t+1}function u(e,t,i,r){var s=r[i];return s??((s=e.lastIndexOf("</"+i+">"))<t&&(s=e.lastIndexOf("</"+i)),r[i]=s),s<t}function h(e,t,i,r){if("-"===e.charAt(t+2))return"-"===e.charAt(t+3)?(s=e.indexOf("--\x3e",t+4))>t?(i.comment(e,t+4,s-t-4),s+3):(r.error("Unclosed comment"),-1):-1;if("CDATA["==e.substr(t+3,6)){var s=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,s-t-9),i.endCDATA(),s+3}var n=function(e,t){var i,r=[],s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(s.lastIndex=t,s.exec(e);i=s.exec(e);)if(r.push(i),i[1])return r}(e,t),a=n.length;if(a>1&&/!doctype/i.test(n[0][0])){var o=n[1][0],l=!1,u=!1;a>3&&(/^public$/i.test(n[2][0])?(l=n[3][0],u=a>4&&n[4][0]):/^system$/i.test(n[2][0])&&(u=n[3][0]));var h=n[a-1];return i.startDTD(o,l,u),i.endDTD(),h.index+h[0].length}return-1}function d(e,t,i){var r=e.indexOf("?>",t);if(r){var s=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)$/);return s?(s[0].length,i.processingInstruction(s[1],s[2]),r+2):-1}return-1}function c(){this.attributeNames={}}return i.prototype=Error(),i.prototype.name=i.name,r.prototype={parse:function(e,t,i){var r=this.domBuilder;r.startDocument(),function(e,t){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}(t,t={}),s(e,t,i,r,this.errorHandler),r.endDocument()}},c.prototype={setTagName:function(e){if(!t.test(e))throw Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,i,r){if(!t.test(e))throw Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:i,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},Si.XMLReader=r,Si.ParseError=i,Si}(),s=t.DOMImplementation,n=e.NAMESPACE,a=r.ParseError,o=r.XMLReader;function l(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function u(e){this.options=e||{locator:{}}}function h(e,t,i){if(!e){if(t instanceof d)return t;e=t}var r={},s=e instanceof Function;function n(t){var n=e[t];!n&&s&&(n=2==e.length?function(i){e(t,i)}:e),r[t]=n&&function(e){n("[xmldom "+t+"]\t"+e+p(i))}||function(){}}return i||={},n("warning"),n("error"),n("fatalError"),r}function d(){this.cdata=!1}function c(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function p(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function m(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function g(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}return u.prototype.parseFromString=function(e,t){var r=this.options,s=new o,a=r.domBuilder||new d,u=r.errorHandler,c=r.locator,p=r.xmlns||{},m=/\/x?html?$/.test(t),g=m?i.HTML_ENTITIES:i.XML_ENTITIES;c&&a.setDocumentLocator(c),s.errorHandler=h(u,a,c),s.domBuilder=r.domBuilder||a,m&&(p[""]=n.HTML),p.xml=p.xml||n.XML;var f=r.normalizeLineEndings||l;return e&&"string"==typeof e?s.parse(f(e),p,g):s.errorHandler.error("invalid doc source"),a.doc},d.prototype={startDocument:function(){this.doc=(new s).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,r){var s=this.doc,n=s.createElementNS(e,i||t),a=r.length;g(this,n),this.currentElement=n,this.locator&&c(this.locator,n);for(var o=0;o<a;o++){e=r.getURI(o);var l=r.getValue(o),u=(i=r.getQName(o),s.createAttributeNS(e,i));this.locator&&c(r.getLocator(o),u),u.value=u.nodeValue=l,n.setAttributeNode(u)}},endElement:function(e,t,i){var r=this.currentElement;r.tagName,this.currentElement=r.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var i=this.doc.createProcessingInstruction(e,t);this.locator&&c(this.locator,i),g(this,i)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){if(e=m.apply(this,arguments)){if(this.cdata)var r=this.doc.createCDATASection(e);else r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&c(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=m.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&c(this.locator,r),g(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var r=this.doc.implementation;if(r&&r.createDocumentType){var s=r.createDocumentType(e,t,i);this.locator&&c(this.locator,s),g(this,s),this.doc.doctype=s}},warning:function(e){console.warn("[xmldom warning]\t"+e,p(this.locator))},error:function(e){console.error("[xmldom error]\t"+e,p(this.locator))},fatalError:function(e){throw new a(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){d.prototype[e]=function(){return null}}),vi.__DOMHandler=d,vi.normalizeLineEndings=l,vi.DOMParser=u,vi}var Ei=function(){if(bi)return di;bi=1;var e=gi();return di.DOMImplementation=e.DOMImplementation,di.XMLSerializer=e.XMLSerializer,di.DOMParser=Ci().DOMParser,di}();const wi=e=>!!e&&"object"==typeof e,ki=(...e)=>e.reduce((e,t)=>("object"==typeof t&&Object.keys(t).forEach(i=>{e[i]=Array.isArray(e[i])&&Array.isArray(t[i])?e[i].concat(t[i]):wi(e[i])&&wi(t[i])?ki(e[i],t[i]):t[i]}),e),{}),Ii=e=>Object.keys(e).map(t=>e[t]),xi=e=>e.reduce((e,t)=>e.concat(t),[]),Ai=e=>{if(!e.length)return[];let t=[];for(let i=0;i<e.length;i++)t.push(e[i]);return t};var Pi="INVALID_NUMBER_OF_PERIOD",Mi="DASH_EMPTY_MANIFEST",Di="DASH_INVALID_XML",Li="NO_BASE_URL",Oi="SEGMENT_TIME_UNSPECIFIED",Ni="UNSUPPORTED_UTC_TIMING_SCHEME";const Ri=({baseUrl:e="",source:t="",range:i="",indexRange:r=""})=>{let s={uri:t,resolvedUri:Pt(e||"",t)};if(i||r){let e,t=(i||r).split("-"),n=Te.BigInt?Te.BigInt(t[0]):parseInt(t[0],10),a=Te.BigInt?Te.BigInt(t[1]):parseInt(t[1],10);n<2**53-1&&"bigint"==typeof n&&(n=Number(n)),a<2**53-1&&"bigint"==typeof a&&(a=Number(a)),e="bigint"==typeof a||"bigint"==typeof n?Te.BigInt(a)-Te.BigInt(n)+Te.BigInt(1):a-n+1,"bigint"==typeof e&&e<2**53-1&&(e=Number(e)),s.byterange={length:e,offset:n}}return s},Ui=e=>(e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e),Bi={static(e){let{duration:t,timescale:i=1,sourceDuration:r,periodDuration:s}=e,n=Ui(e.endNumber),a=t/i;return"number"==typeof n?{start:0,end:n}:"number"==typeof s?{start:0,end:s/a}:{start:0,end:r/a}},dynamic(e){let{NOW:t,clientOffset:i,availabilityStartTime:r,timescale:s=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=e,u=Ui(e.endNumber),h=(t+i)/1e3,d=r+a,c=h+o-d,p=Math.ceil(c*s/n),m=Math.floor((h-d-l)*s/n),g=Math.floor((h-d)*s/n);return{start:Math.max(0,m),end:"number"==typeof u?u:Math.min(p,g)}}},Fi=e=>{let{type:t,duration:i,timescale:r=1,periodDuration:s,sourceDuration:n}=e,{start:a,end:o}=Bi[t](e),l=((e,t)=>{let i=[];for(let r=e;r<t;r++)i.push(r);return i})(a,o).map((e=>t=>{let{duration:i,timescale:r=1,periodStart:s,startNumber:n=1}=e;return{number:n+t,duration:i/r,timeline:s,time:t*i}})(e));if("static"===t){let e=l.length-1,t="number"==typeof s?s:n;l[e].duration=t-i/r*e}return l},qi=e=>{let{baseUrl:t,initialization:i={},sourceDuration:r,indexRange:s="",periodStart:n,presentationTime:a,number:o=0,duration:l}=e;if(!t)throw Error(Li);let u=Ri({baseUrl:t,source:i.sourceURL,range:i.range}),h=Ri({baseUrl:t,source:t,indexRange:s});if(h.map=u,l){let t=Fi(e);t.length&&(h.duration=t[0].duration,h.timeline=t[0].timeline)}else r&&(h.duration=r,h.timeline=n);return h.presentationTime=a||n,h.number=o,[h]},ji=(e,t,i)=>{let r,s=e.sidx.map?e.sidx.map:null,n=e.sidx.duration,a=e.timeline||0,o=e.sidx.byterange,l=o.offset+o.length,u=t.timescale,h=t.references.filter(e=>1!==e.referenceType),d=[],c=e.endList?"static":"dynamic",p=e.sidx.timeline,m=p,g=e.mediaSequence||0;r="bigint"==typeof t.firstOffset?Te.BigInt(l)+t.firstOffset:l+t.firstOffset;for(let e=0;e<h.length;e++){let o,l=t.references[e],h=l.referencedSize,f=l.subsegmentDuration;o="bigint"==typeof r?r+Te.BigInt(h)-Te.BigInt(1):r+h-1;let y=qi({baseUrl:i,timescale:u,timeline:a,periodStart:p,presentationTime:m,number:g,duration:f,sourceDuration:n,indexRange:`${r}-${o}`,type:c})[0];s&&(y.map=s),d.push(y),r+="bigint"==typeof r?Te.BigInt(h):h,m+=f/u,g++}return e.segments=d,e},Hi=["AUDIO","SUBTITLES"],$i=e=>(e=>Ii(e.reduce((e,t)=>(t.forEach(t=>{e[(({timeline:e})=>e)(t)]=t}),e),{})))(e).sort((e,t)=>e.timeline>t.timeline?1:-1),Vi=e=>{let t=[];return function(e,t,i){t.forEach(function(t){for(var r in e.mediaGroups[t])for(var s in e.mediaGroups[t][r]){var n=e.mediaGroups[t][r][s];i(n)}})}(e,Hi,(e,i,r,s)=>{t=t.concat(e.playlists||[])}),t},zi=({playlist:e,mediaSequence:t})=>{e.mediaSequence=t,e.segments.forEach((t,i)=>{t.number=e.mediaSequence+i})},Wi=e=>e&&e.uri+"-"+(e=>{let t;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?Te.BigInt(e.offset)+Te.BigInt(e.length)-Te.BigInt(1):e.offset+e.length-1,`${e.offset}-${t}`})(e.byterange),Gi=e=>{let t=e.reduce(function(e,t){return e[t.attributes.baseUrl]||(e[t.attributes.baseUrl]=[]),e[t.attributes.baseUrl].push(t),e},{}),i=[];return Object.values(t).forEach(e=>{let t=Ii(e.reduce((e,t)=>{let i=t.attributes.id+(t.attributes.lang||"");return e[i]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),e[i].segments.push(...t.segments)),t.attributes.contentProtection&&(e[i].attributes.contentProtection=t.attributes.contentProtection)):(e[i]=t,e[i].attributes.timelineStarts=[]),e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{}));i=i.concat(t)}),i.map(e=>(e.discontinuityStarts=(e=>e.reduce((e,t,i)=>(t.discontinuity&&e.push(i),e),[]))(e.segments||[]),e))},Xi=(e,t)=>{let i=Wi(e.sidx),r=i&&t[i]&&t[i].sidx;return r&&ji(e,r,e.sidx.resolvedUri),e},Ki=(e,t={})=>{if(!Object.keys(t).length)return e;for(let i in e)e[i]=Xi(e[i],t);return e},Zi=({attributes:e,segments:t,sidx:i,discontinuityStarts:r})=>{let s={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:r,timelineStarts:e.timelineStarts,segments:t};return e.frameRate&&(s.attributes["FRAME-RATE"]=e.frameRate),void 0!==e.qualityRanking&&(s.attributes.SCORE=1/(e.qualityRanking+1)),e.contentProtection&&(s.contentProtection=e.contentProtection),e.serviceLocation&&(s.attributes.serviceLocation=e.serviceLocation),i&&(s.sidx=i),s},Yi=({attributes:e})=>"video/mp4"===e.mimeType||"video/webm"===e.mimeType||"video"===e.contentType,Qi=({attributes:e})=>"audio/mp4"===e.mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType,Ji=({attributes:e})=>"text/vtt"===e.mimeType||"text"===e.contentType,er=e=>e?Object.keys(e).reduce((t,i)=>{let r=e[i];return t.concat(r.playlists)},[]):[],tr=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:r={},previousManifest:s,eventStream:n})=>{if(!e.length)return{};let{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:u}=e[0].attributes,h=Gi(e.filter(Yi)).map(Zi),d=Gi(e.filter(Qi)),c=Gi(e.filter(Ji)),p=e.map(e=>e.attributes.captionServices).filter(Boolean),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:Ki(h,r)};u>=0&&(m.minimumUpdatePeriod=1e3*u),t&&(m.locations=t),i&&(m.contentSteering=i),"dynamic"===o&&(m.suggestedPresentationDelay=l),n&&n.length>0&&(m.eventStream=n);let g=0===m.playlists.length,f=d.length?((e,t={},i=!1)=>{let r,s=e.reduce((e,s)=>{let n=s.attributes.role&&s.attributes.role.value||"",a=s.attributes.lang||"",o=s.attributes.label||"main";if(a&&!s.attributes.label){let e=n?` (${n})`:"";o=`${s.attributes.lang}${e}`}e[o]||(e[o]={language:a,autoselect:!0,default:"main"===n,playlists:[],uri:""});let l=Xi((({attributes:e,segments:t,sidx:i,mediaSequence:r,discontinuitySequence:s,discontinuityStarts:n},a)=>{let o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,"PROGRAM-ID":1},uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:s,discontinuityStarts:n,timelineStarts:e.timelineStarts,mediaSequence:r,segments:t};return e.contentProtection&&(o.contentProtection=e.contentProtection),e.serviceLocation&&(o.attributes.serviceLocation=e.serviceLocation),i&&(o.sidx=i),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o})(s,i),t);return e[o].playlists.push(l),void 0===r&&"main"===n&&(r=s,r.default=!0),e},{});return r||(s[Object.keys(s)[0]].default=!0),s})(d,r,g):null,y=c.length?((e,t={})=>e.reduce((e,i)=>{let r=i.attributes.label||i.attributes.lang||"text",s=i.attributes.lang||"und";return e[r]||(e[r]={language:s,default:!1,autoselect:!1,playlists:[],uri:""}),e[r].playlists.push(Xi((({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:r,discontinuitySequence:s})=>{void 0===t&&(t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}],e.duration=e.sourceDuration);let n={NAME:e.id,BANDWIDTH:e.bandwidth,"PROGRAM-ID":1};e.codecs&&(n.CODECS=e.codecs);let a={attributes:n,uri:"",endList:"static"===e.type,timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:r,discontinuitySequence:s,mediaSequence:i,segments:t};return e.serviceLocation&&(a.attributes.serviceLocation=e.serviceLocation),a})(i),t)),e},{}))(c,r):null,_=h.concat(er(f),er(y)),b=_.map(({timelineStarts:e})=>e);return m.timelineStarts=$i(b),((e,t)=>{e.forEach(e=>{e.mediaSequence=0,e.discontinuitySequence=t.findIndex(function({timeline:t}){return t===e.timeline}),e.segments&&e.segments.forEach((e,t)=>{e.number=t})})})(_,m.timelineStarts),f&&(m.mediaGroups.AUDIO.audio=f),y&&(m.mediaGroups.SUBTITLES.subs=y),p.length&&(m.mediaGroups["CLOSED-CAPTIONS"].cc=(e=>e.reduce((e,t)=>(t&&t.forEach(t=>{let{channel:i,language:r}=t;e[r]={autoselect:!1,default:!1,instreamId:i,language:r},t.hasOwnProperty("aspectRatio")&&(e[r].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[r].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[r]["3D"]=t["3D"])}),e),{}))(p)),s?(({oldManifest:e,newManifest:t})=>{let i=e.playlists.concat(Vi(e)),r=t.playlists.concat(Vi(t));return t.timelineStarts=$i([e.timelineStarts,t.timelineStarts]),(({oldPlaylists:e,newPlaylists:t,timelineStarts:i})=>{t.forEach(t=>{t.discontinuitySequence=i.findIndex(function({timeline:e}){return e===t.timeline});let r=((e,t)=>{for(let i=0;i<e.length;i++)if(e[i].attributes.NAME===t)return e[i];return null})(e,t.attributes.NAME);if(!r||t.sidx)return;let s=t.segments[0],n=r.segments.findIndex(function(e){return Math.abs(e.presentationTime-s.presentationTime)<.016666666666666666});-1===n?(zi({playlist:t,mediaSequence:r.mediaSequence+r.segments.length}),t.segments[0].discontinuity=!0,t.discontinuityStarts.unshift(0),(!r.segments.length&&t.timeline>r.timeline||r.segments.length&&t.timeline>r.segments[r.segments.length-1].timeline)&&t.discontinuitySequence--):(r.segments[n].discontinuity&&!s.discontinuity&&(s.discontinuity=!0,t.discontinuityStarts.unshift(0),t.discontinuitySequence--),zi({playlist:t,mediaSequence:r.segments[n].number}))})})({oldPlaylists:i,newPlaylists:r,timelineStarts:t.timelineStarts}),t})({oldManifest:s,newManifest:m}):m},ir=(e,t,i)=>{let{NOW:r,clientOffset:s,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e,u=(r+s)/1e3+l-(n+o);return Math.ceil((u*a-t)/i)},rr=(e,t)=>{let{type:i,minimumUpdatePeriod:r=0,media:s="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=e,u=[],h=-1;for(let d=0;d<t.length;d++){let c,p=t[d],m=p.d,g=p.r||0,f=p.t||0;if(h<0&&(h=f),f&&f>h&&(h=f),g<0){let o=d+1;c=o===t.length?"dynamic"===i&&r>0&&s.indexOf("$Number$")>0?ir(e,h,m):(n*a-h)/m:(t[o].t-h)/m}else c=g+1;let y=o+u.length+c,_=o+u.length;for(;_<y;)u.push({number:_,duration:m/a,time:h,timeline:l}),h+=m,_++}return u},sr=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,nr=(e,t)=>e.replace(sr,(e=>(t,i,r,s)=>{if("$$"===t)return"$";if(void 0===e[i])return t;let n=""+e[i];return"RepresentationID"===i||(s=r?parseInt(s,10):1,n.length>=s)?n:`${Array(s-n.length+1).join("0")}${n}`})(t)),ar=(e,t)=>{let i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},{initialization:r={sourceURL:"",range:""}}=e,s=Ri({baseUrl:e.baseUrl,source:nr(r.sourceURL,i),range:r.range});return((e,t)=>e.duration||t?e.duration?Fi(e):rr(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}])(e,t).map(t=>{i.Number=t.number,i.Time=t.time;let r=nr(e.media||"",i),n=e.timescale||1,a=e.presentationTimeOffset||0,o=e.periodStart+(t.time-a)/n;return{uri:r,timeline:t.timeline,duration:t.duration,resolvedUri:Pt(e.baseUrl||"",r),map:s,number:t.number,presentationTime:o}})},or=(e,t)=>{let{duration:i,segmentUrls:r=[],periodStart:s}=e;if(!i&&!t||i&&t)throw Error(Oi);let n,a=r.map(t=>((e,t)=>{let{baseUrl:i,initialization:r={}}=e,s=Ri({baseUrl:i,source:r.sourceURL,range:r.range}),n=Ri({baseUrl:i,source:t.media,range:t.mediaRange});return n.map=s,n})(e,t));return i&&(n=Fi(e)),t&&(n=rr(e,t)),n.map((t,i)=>{if(a[i]){let r=a[i],n=e.timescale||1,o=e.presentationTimeOffset||0;return r.timeline=t.timeline,r.duration=t.duration,r.number=t.number,r.presentationTime=s+(t.time-o)/n,r}}).filter(e=>e)},lr=({attributes:e,segmentInfo:t})=>{let i,r;t.template?(r=ar,i=ki(e,t.template)):t.base?(r=qi,i=ki(e,t.base)):t.list&&(r=or,i=ki(e,t.list));let s={attributes:e};if(!r)return s;let n=r(i,t.segmentTimeline);if(i.duration){let{duration:e,timescale:t=1}=i;i.duration=e/t}else n.length?i.duration=n.reduce((e,t)=>Math.max(e,Math.ceil(t.duration)),0):i.duration=0;return s.attributes=i,s.segments=n,t.base&&i.indexRange&&(s.sidx=n[0],s.segments=[]),s},ur=(e,t)=>Ai(e.childNodes).filter(({tagName:e})=>e===t),hr=e=>e.textContent.trim(),dr=e=>{let t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;let[i,r,s,n,a,o]=t.slice(1);return 31536e3*parseFloat(i||0)+2592e3*parseFloat(r||0)+86400*parseFloat(s||0)+3600*parseFloat(n||0)+60*parseFloat(a||0)+parseFloat(o||0)},cr={mediaPresentationDuration:e=>dr(e),availabilityStartTime:e=>(e=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e)&&(e+="Z"),Date.parse(e)))(e)/1e3,minimumUpdatePeriod:e=>dr(e),suggestedPresentationDelay:e=>dr(e),type:e=>e,timeShiftBufferDepth:e=>dr(e),start:e=>dr(e),width:e=>parseInt(e,10),height:e=>parseInt(e,10),bandwidth:e=>parseInt(e,10),frameRate:e=>(e=>parseFloat(e.split("/").reduce((e,t)=>e/t)))(e),startNumber:e=>parseInt(e,10),timescale:e=>parseInt(e,10),presentationTimeOffset:e=>parseInt(e,10),duration(e){let t=parseInt(e,10);return isNaN(t)?dr(e):t},d:e=>parseInt(e,10),t:e=>parseInt(e,10),r:e=>parseInt(e,10),presentationTime:e=>parseInt(e,10),qualityRanking:e=>parseInt(e,10),qualityranking:e=>parseInt(e,10),DEFAULT:e=>e},pr={qualityranking:"qualityRanking"},mr=e=>e&&e.attributes?Ai(e.attributes).reduce((e,t)=>{let i=cr[t.name]||cr.DEFAULT;return e[pr[t.name]||t.name]=i(t.value),e},{}):{},gr={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},fr=(e,t)=>t.length?xi(e.map(function(e){return t.map(function(t){let i=hr(t),r=Pt(e.baseUrl,i),s=ki(mr(t),{baseUrl:r});return r!==i&&!s.serviceLocation&&e.serviceLocation&&(s.serviceLocation=e.serviceLocation),s})})):e,yr=e=>{let t=ur(e,"SegmentTemplate")[0],i=ur(e,"SegmentList")[0],r=i&&ur(i,"SegmentURL").map(e=>ki({tag:"SegmentURL"},mr(e))),s=ur(e,"SegmentBase")[0],n=i||t,a=n&&ur(n,"SegmentTimeline")[0],o=i||s||t,l=o&&ur(o,"Initialization")[0],u=t&&mr(t);u&&l?u.initialization=l&&mr(l):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});let h={template:u,segmentTimeline:a&&ur(a,"S").map(e=>mr(e)),list:i&&ki(mr(i),{segmentUrls:r,initialization:mr(l)}),base:s&&ki(mr(s),{initialization:mr(l)})};return Object.keys(h).forEach(e=>{h[e]||delete h[e]}),h},_r=e=>xi(ur(e.node,"EventStream").map(t=>{let i=mr(t),r=i.schemeIdUri;return ur(t,"Event").map(t=>{let s=mr(t),n=s.presentationTime||0,a=i.timescale||1,o=s.duration||0,l=n/a+e.attributes.start;return{schemeIdUri:r,value:i.value,id:s.id,start:l,end:l+o/a,messageData:hr(t)||s.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}})})),br=(e,t)=>(i,r)=>{let s=fr(t,ur(i.node,"BaseURL")),n=ki(e,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(n.periodDuration=i.attributes.duration);let a=ur(i.node,"AdaptationSet"),o=yr(i.node);return xi(a.map(((e,t,i)=>r=>{let s=mr(r),n=fr(t,ur(r,"BaseURL")),a=ur(r,"Role")[0],o={role:mr(a)},l=ki(e,s,o),u=ur(r,"Accessibility")[0],h=(e=>"urn:scte:dash:cc:cea-608:2015"===e.schemeIdUri?("string"==typeof e.value?e.value.split(";"):[]).map(e=>{let t,i;return i=e,/^CC\d=/.test(e)?[t,i]=e.split("="):/^CC\d$/.test(e)&&(t=e),{channel:t,language:i}}):"urn:scte:dash:cc:cea-708:2015"===e.schemeIdUri?("string"==typeof e.value?e.value.split(";"):[]).map(e=>{let t={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){let[i,r=""]=e.split("=");t.channel=i,t.language=e,r.split(",").forEach(e=>{let[i,r]=e.split(":");"lang"===i?t.language=r:"er"===i?t.easyReader=Number(r):"war"===i?t.aspectRatio=Number(r):"3D"===i&&(t["3D"]=Number(r))})}else t.language=e;return t.channel&&="SERVICE"+t.channel,t}):void 0)(mr(u));h&&(l=ki(l,{captionServices:h}));let d=ur(r,"Label")[0];if(d&&d.childNodes.length){let e=d.childNodes[0].nodeValue.trim();l=ki(l,{label:e})}let c=(e=>e.reduce((e,t)=>{let i=mr(t);i.schemeIdUri&&=i.schemeIdUri.toLowerCase();let r=gr[i.schemeIdUri];if(r){e[r]={attributes:i};let s=ur(t,"cenc:pssh")[0];if(s){let t=hr(s);e[r].pssh=t&&Dt(t)}}return e},{}))(ur(r,"ContentProtection"));Object.keys(c).length&&(l=ki(l,{contentProtection:c}));let p=yr(r),m=ur(r,"Representation"),g=ki(i,p);return xi(m.map(((e,t,i)=>r=>{let s=ur(r,"BaseURL"),n=fr(t,s),a=ki(e,mr(r)),o=yr(r);return n.map(e=>({segmentInfo:ki(i,o),attributes:ki(a,e)}))})(l,n,g)))})(n,s,o)))},vr=(e,t)=>{if(e.length>1&&t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!e.length)return null;let i=ki({serverURL:hr(e[0])},mr(e[0]));return i.queryBeforeStart="true"===i.queryBeforeStart,i},Tr=e=>{if(""===e)throw Error(Mi);let t,i,r=new Ei.DOMParser;try{t=r.parseFromString(e,"application/xml"),i=t&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch{}if(!i||i&&i.getElementsByTagName("parsererror").length>0)throw Error(Di);return i};var Sr,Cr,Er,wr,kr=function(){if(wr)return Er;wr=1;var e=function(){if(Cr)return Sr;Cr=1;var e=2**32;return Sr={getUint64:function(t){var i,r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getBigUint64?(i=r.getBigUint64(0))<2**53-1?Number(i):i:r.getUint32(0)*e+r.getUint32(4)},MAX_UINT32:e},Sr}().getUint64;return Er=function(t){var i=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8)},s=12;0===r.version?(r.earliestPresentationTime=i.getUint32(s),r.firstOffset=i.getUint32(s+4),s+=8):(r.earliestPresentationTime=e(t.subarray(s)),r.firstOffset=e(t.subarray(s+8)),s+=16),s+=2;var n=i.getUint16(s);for(s+=2;n>0;s+=12,n--)r.references.push({referenceType:(128&t[s])>>>7,referencedSize:2147483647&i.getUint32(s),subsegmentDuration:i.getUint32(s+4),startsWithSap:!!(128&t[s+8]),sapType:(112&t[s+8])>>>4,sapDeltaTime:268435455&i.getUint32(s+8)});return r},Er}();const Ir=(0,_e.g)(kr);var xr=ri([73,68,51]),Ar=function e(t,i){return void 0===i&&(i=0),(t=ri(t)).length-i<10||!hi(t,xr,{offset:i})?i:(i+=function(e,t){void 0===t&&(t=0);var i=(e=ri(e))[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?r+20:r+10}(t,i),e(t,i))},Pr=function(e){return"string"==typeof e?ui(e):e},Mr=function e(t,i,r){void 0===r&&(r=!1),i=function(e){return Array.isArray(e)?e.map(function(e){return Pr(e)}):[Pr(e)]}(i),t=ri(t);var s=[];if(!i.length)return s;for(var n=0;n<t.length;){var a=(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0,o=t.subarray(n+4,n+8);if(0===a)break;var l=n+a;if(l>t.length){if(r)break;l=t.length}var u=t.subarray(n+8,l);hi(o,i[0])&&(1===i.length?s.push(u):s.push.apply(s,e(u,i.slice(1),r))),n=l}return s},Dr={EBML:ri([26,69,223,163]),DocType:ri([66,130]),Segment:ri([24,83,128,103]),SegmentInfo:ri([21,73,169,102]),Tracks:ri([22,84,174,107]),Track:ri([174]),TrackNumber:ri([215]),DefaultDuration:ri([35,227,131]),TrackEntry:ri([174]),TrackType:ri([131]),FlagDefault:ri([136]),CodecID:ri([134]),CodecPrivate:ri([99,162]),VideoTrack:ri([224]),AudioTrack:ri([225]),Cluster:ri([31,67,182,117]),Timestamp:ri([231]),TimestampScale:ri([42,215,177]),BlockGroup:ri([160]),BlockDuration:ri([155]),Block:ri([161]),SimpleBlock:ri([163])},Lr=[128,64,32,16,8,4,2,1],Or=function(e,t,i,r){void 0===i&&(i=!0),void 0===r&&(r=!1);var s=function(e){for(var t=1,i=0;i<Lr.length&&!(e&Lr[i]);i++)t++;return t}(e[t]),n=e.subarray(t,t+s);return i&&((n=Array.prototype.slice.call(e,t,t+s))[0]^=Lr[s-1]),{length:s,value:li(n,{signed:r}),bytes:n}},Nr=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map(function(t){return e(t)}):"number"==typeof t?function(e){var t={}.le,i=void 0!==t&&t;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var r=function(e){return Math.ceil(function(e){return e.toString(2).length}(e)/8)}(e=si(e)),s=new Uint8Array(new ArrayBuffer(r)),n=0;n<r;n++){var a=i?n:Math.abs(n+1-s.length);s[a]=Number(e/ni[n]&si(255)),e<0&&(s[a]=Math.abs(~s[a]),s[a]-=0===n?1:2)}return s}(t):t},Rr=function e(t,i,r){if(r>=i.length)return i.length;var s=Or(i,r,!1);if(hi(t.bytes,s.bytes))return r;var n=Or(i,r+s.length);return e(t,i,r+n.length+n.value+s.length)},Ur=function e(t,i){i=function(e){return Array.isArray(e)?e.map(function(e){return Nr(e)}):[Nr(e)]}(i),t=ri(t);var r=[];if(!i.length)return r;for(var s=0;s<t.length;){var n=Or(t,s,!1),a=Or(t,s+n.length),o=s+n.length+a.length;127===a.value&&(a.value=Rr(n,t,o),a.value!==t.length&&(a.value-=o));var l=o+a.value>t.length?t.length:o+a.value,u=t.subarray(o,l);hi(i[0],n.bytes)&&(1===i.length?r.push(u):r=r.concat(e(u,i.slice(1)))),s+=n.length+a.length+u.length}return r},Br=ri([0,0,0,1]),Fr=ri([0,0,1]),qr=ri([0,0,3]),jr=function(e){for(var t=[],i=1;i<e.length-2;)hi(e.subarray(i,i+3),qr)&&(t.push(i+2),i++),i++;if(0===t.length)return e;var r=e.length-t.length,s=new Uint8Array(r),n=0;for(i=0;i<r;n++,i++)n===t[0]&&(n++,t.shift()),s[i]=e[n];return s},Hr=function(e,t,i,r){e=ri(e),i=[].concat(i);for(var s,n=0,a=0;n<e.length&&(a<r||s);){var o=void 0;if(hi(e.subarray(n),Br)?o=4:hi(e.subarray(n),Fr)&&(o=3),o){if(a++,s)return jr(e.subarray(s,n));var l=void 0;"h264"===t?l=31&e[n+o]:"h265"===t&&(l=e[n+o]>>1&63),-1!==i.indexOf(l)&&(s=n+o),n+=o+("h264"===t?1:2)}else n++}return e.subarray(0,0)},$r={webm:ri([119,101,98,109]),matroska:ri([109,97,116,114,111,115,107,97]),flac:ri([102,76,97,67]),ogg:ri([79,103,103,83]),ac3:ri([11,119]),riff:ri([82,73,70,70]),avi:ri([65,86,73]),wav:ri([87,65,86,69]),"3gp":ri([102,116,121,112,51,103]),mp4:ri([102,116,121,112]),fmp4:ri([115,116,121,112]),mov:ri([102,116,121,112,113,116]),moov:ri([109,111,111,118]),moof:ri([109,111,111,102]),vtt:ri([87,69,66,86,84,84])},Vr={aac:function(e){return hi(e,[255,16],{offset:Ar(e),mask:[255,22]})},mp3:function(e){return hi(e,[255,2],{offset:Ar(e),mask:[255,6]})},webm:function(e){var t=Ur(e,[Dr.EBML,Dr.DocType])[0];return hi(t,$r.webm)},mkv:function(e){var t=Ur(e,[Dr.EBML,Dr.DocType])[0];return hi(t,$r.matroska)},mp4:function(e){return!Vr["3gp"](e)&&!Vr.mov(e)&&(!!(hi(e,$r.mp4,{offset:4})||hi(e,$r.fmp4,{offset:4})||hi(e,$r.moof,{offset:4})||hi(e,$r.moov,{offset:4}))||void 0)},mov:function(e){return hi(e,$r.mov,{offset:4})},"3gp":function(e){return hi(e,$r["3gp"],{offset:4})},ac3:function(e){var t=Ar(e);return hi(e,$r.ac3,{offset:t})},vtt:function(e){return hi(e,$r.vtt)},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=Ar(e);return hi(e,$r.flac,{offset:t})},ogg:function(e){return hi(e,$r.ogg)},avi:function(e){return hi(e,$r.riff)&&hi(e,$r.avi,{offset:8})},wav:function(e){return hi(e,$r.riff)&&hi(e,$r.wav,{offset:8})},h264:function(e){return function(e){return Hr(e,"h264",7,3)}(e).length},h265:function(e){return function(e){return Hr(e,"h265",[32,33],3)}(e).length}},zr=Object.keys(Vr).filter(function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e}).concat(["ts","h264","h265"]);zr.forEach(function(e){var t=Vr[e];Vr[e]=function(e){return t(ri(e))}});var Wr,Gr,Xr=Vr,Kr=function(e){e=ri(e);for(var t=0;t<zr.length;t++){var i=zr[t];if(Xr[i](e))return i}return""},Zr=function(){if(Gr)return Wr;Gr=1;var e=9e4,t=function(t){return t*e},i=function(e,t){return e*t},r=function(t){return t/e},s=function(e,t){return e/t};return Wr={ONE_SECOND_IN_TS:e,secondsToVideoTs:t,secondsToAudioTs:i,videoTsToSeconds:r,audioTsToSeconds:s,audioTsToVideoTs:function(e,i){return t(s(e,i))},videoTsToAudioTs:function(e,t){return i(r(e),t)},metadataTsToSeconds:function(e,t,i){return r(i?e:e-t)}},Wr}(),Yr="8.24.1";const Qr={},Jr=function(e,t){return Qr[e]=Qr[e]||[],t&&(Qr[e]=Qr[e].concat(t)),Qr[e]},es=function(e,t){let i=Jr(e).indexOf(t);return!(i<=-1||(Qr[e]=Qr[e].slice(),Qr[e].splice(i,1),0))},ts={prefixed:!0},is=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],rs=is[0];let ss;for(let e=0;e<is.length;e++)if(is[e][1]in tt){ss=is[e];break}if(ss){for(let e=0;e<ss.length;e++)ts[rs[e]]=ss[e];ts.prefixed=ss[0]!==rs[0]}let ns=[];const as=function e(t,i=":",r=""){let s,n="info";function a(...e){s("log",n,e)}return s=((e,t,i)=>(r,s,n)=>{let a=t.levels[s],o=RegExp(`^(${a})$`),l=e;if("log"!==r&&n.unshift(r.toUpperCase()+":"),i&&(l=`%c${e}`,n.unshift(i)),n.unshift(l+":"),ns){ns.push([].concat(n));let e=ns.length-1e3;ns.splice(0,e>0?e:0)}if(!Te.console)return;let u=Te.console[r];!u&&"debug"===r&&(u=Te.console.info||Te.console.log),u&&a&&o.test(r)&&u[Array.isArray(n)?"apply":"call"](Te.console,n)})(t,a,r),a.createLogger=(s,n,a)=>{let o=void 0===n?i:n;return e(`${t} ${o} ${s}`,o,void 0===a?r:a)},a.createNewLogger=(t,i,r)=>e(t,i,r),a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},a.level=e=>{if("string"==typeof e){if(!a.levels.hasOwnProperty(e))throw Error(`"${e}" in not a valid log level`);n=e}return n},a.history=()=>ns?[].concat(ns):[],a.history.filter=e=>(ns||[]).filter(t=>RegExp(`.*${e}.*`).test(t[0])),a.history.clear=()=>{ns&&(ns.length=0)},a.history.disable=()=>{null!==ns&&(ns.length=0,ns=null)},a.history.enable=()=>{null===ns&&(ns=[])},a.error=(...e)=>s("error",n,e),a.warn=(...e)=>s("warn",n,e),a.debug=(...e)=>s("debug",n,e),a}("VIDEOJS"),os=as.createLogger,ls=Object.prototype.toString,us=function(e){return cs(e)?Object.keys(e):[]};function hs(e,t){us(e).forEach(i=>t(e[i],i))}function ds(e,t,i=0){return us(e).reduce((i,r)=>t(i,e[r],r),i)}function cs(e){return!!e&&"object"==typeof e}function ps(e){return cs(e)&&"[object Object]"===ls.call(e)&&e.constructor===Object}function ms(...e){let t={};return e.forEach(e=>{e&&hs(e,(e,i)=>{ps(e)?(ps(t[i])||(t[i]={}),t[i]=ms(t[i],e)):t[i]=e})}),t}function gs(e={}){let t=[];for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t.push(r)}return t}function fs(e,t,i,r=!0){let s=i=>Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){let e=i();return s(e),e}};return r&&(n.set=s),Object.defineProperty(e,t,n)}var ys=Object.freeze({__proto__:null,each:hs,reduce:ds,isObject:cs,isPlain:ps,merge:ms,values:gs,defineLazyProperty:fs});let _s,bs=!1,vs=null,Ts=!1,Ss=!1,Cs=!1,Es=!1,ws=!1,ks=null,Is=null;const xs=!!(Te.cast&&Te.cast.framework&&Te.cast.framework.CastReceiverContext);let As=null,Ps=!1,Ms=!1,Ds=!1,Ls=!1,Os=!1,Ns=!1,Rs=!1;const Us=!(!$s()||!("ontouchstart"in Te||Te.navigator.maxTouchPoints||Te.DocumentTouch&&Te.document instanceof Te.DocumentTouch)),Bs=Te.navigator&&Te.navigator.userAgentData;if(Bs&&Bs.platform&&Bs.brands&&(Ts="Android"===Bs.platform,Cs=!!Bs.brands.find(e=>"Microsoft Edge"===e.brand),Es=!!Bs.brands.find(e=>"Chromium"===e.brand),ws=!Cs&&Es,ks=Is=(Bs.brands.find(e=>"Chromium"===e.brand)||{}).version||null,Ms="Windows"===Bs.platform),!Es){let e=Te.navigator&&Te.navigator.userAgent||"";bs=/iPod/i.test(e),vs=function(){let t=e.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),Ts=/Android/i.test(e),_s=function(){let t=e.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;let i=t[1]&&parseFloat(t[1]),r=t[2]&&parseFloat(t[2]);return i&&r?parseFloat(t[1]+"."+t[2]):i||null}(),Ss=/Firefox/i.test(e),Cs=/Edg/i.test(e),Es=/Chrome/i.test(e)||/CriOS/i.test(e),ws=!Cs&&Es,ks=Is=function(){let t=e.match(/(Chrome|CriOS)\/(\d+)/);return t&&t[2]?parseFloat(t[2]):null}(),As=function(){let t=/MSIE\s(\d+)\.\d/.exec(e),i=t&&parseFloat(t[1]);return!i&&/Trident\/7.0/i.test(e)&&/rv:11.0/.test(e)&&(i=11),i}(),Os=/Tizen/i.test(e),Ns=/Web0S/i.test(e),Rs=Os||Ns,Ps=/Safari/i.test(e)&&!ws&&!Ts&&!Cs&&!Rs,Ms=/Windows/i.test(e),Ds=/iPad/i.test(e)||Ps&&Us&&!/iPhone/i.test(e),Ls=/iPhone/i.test(e)&&!Ds}const Fs=Ls||Ds||bs,qs=(Ps||Fs)&&!ws;var js=Object.freeze({__proto__:null,get IS_IPOD(){return bs},get IOS_VERSION(){return vs},get IS_ANDROID(){return Ts},get ANDROID_VERSION(){return _s},get IS_FIREFOX(){return Ss},get IS_EDGE(){return Cs},get IS_CHROMIUM(){return Es},get IS_CHROME(){return ws},get CHROMIUM_VERSION(){return ks},get CHROME_VERSION(){return Is},IS_CHROMECAST_RECEIVER:xs,get IE_VERSION(){return As},get IS_SAFARI(){return Ps},get IS_WINDOWS(){return Ms},get IS_IPAD(){return Ds},get IS_IPHONE(){return Ls},get IS_TIZEN(){return Os},get IS_WEBOS(){return Ns},get IS_SMART_TV(){return Rs},TOUCH_ENABLED:Us,IS_IOS:Fs,IS_ANY_SAFARI:qs});function Hs(e){return"string"==typeof e&&!!e.trim()}function $s(){return tt===Te.document}function Vs(e){return cs(e)&&1===e.nodeType}function zs(){try{return Te.parent!==Te.self}catch{return!0}}function Ws(e){return function(t,i){if(!Hs(t))return tt[e](null);Hs(i)&&(i=tt.querySelector(i));let r=Vs(i)?i:tt;return r[e]&&r[e](t)}}function Gs(e="div",t={},i={},r){let s=tt.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){let i=t[e];"textContent"===e?Xs(s,i):(s[e]!==i||"tabIndex"===e)&&(s[e]=i)}),Object.getOwnPropertyNames(i).forEach(function(e){s.setAttribute(e,i[e])}),r&&mn(s,r),s}function Xs(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function Ks(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function Zs(e,t){return function(e){if(e.indexOf(" ")>=0)throw Error("class has illegal whitespace characters")}(t),e.classList.contains(t)}function Ys(e,...t){return e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e}function Qs(e,...t){return e?(e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[])),e):(as.warn("removeClass was called with an element that doesn't exist"),null)}function Js(e,t,i){return"function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=void 0),t.split(/\s+/).forEach(t=>e.classList.toggle(t,i)),e}function en(e,t){Object.getOwnPropertyNames(t).forEach(function(i){let r=t[i];null==r||!1===r?e.removeAttribute(i):e.setAttribute(i,!0===r?"":r)})}function tn(e){let t={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){let r=e.attributes;for(let e=r.length-1;e>=0;e--){let s=r[e].name,n=r[e].value;i.includes(s)&&(n=null!==n),t[s]=n}}return t}function rn(e,t){return e.getAttribute(t)}function sn(e,t,i){e.setAttribute(t,i)}function nn(e,t){e.removeAttribute(t)}function an(){tt.body.focus(),tt.onselectstart=function(){return!1}}function on(){tt.onselectstart=function(){return!0}}function ln(e){if(e&&e.getBoundingClientRect&&e.parentNode){let t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(e=>{void 0!==t[e]&&(i[e]=t[e])}),i.height||=parseFloat(bn(e,"height")),i.width||=parseFloat(bn(e,"width")),i}}function un(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};let t=e.offsetWidth,i=e.offsetHeight,r=0,s=0;for(;e.offsetParent&&e!==tt[ts.fullscreenElement];)r+=e.offsetLeft,s+=e.offsetTop,e=e.offsetParent;return{left:r,top:s,width:t,height:i}}function hn(e,t){let i={x:0,y:0};if(Fs){let t=e;for(;t&&"html"!==t.nodeName.toLowerCase();){let e=bn(t,"transform");if(/^matrix/.test(e)){let t=e.slice(7,-1).split(/,\s/).map(Number);i.x+=t[4],i.y+=t[5]}else if(/^matrix3d/.test(e)){let t=e.slice(9,-1).split(/,\s/).map(Number);i.x+=t[12],i.y+=t[13]}if(t.assignedSlot&&t.assignedSlot.parentElement&&Te.WebKitCSSMatrix){let e=Te.getComputedStyle(t.assignedSlot.parentElement).transform,r=new Te.WebKitCSSMatrix(e);i.x+=r.m41,i.y+=r.m42}t=t.parentNode||t.host}}let r={},s=un(t.target),n=un(e),a=n.width,o=n.height,l=t.offsetY-(n.top-s.top),u=t.offsetX-(n.left-s.left);return t.changedTouches&&(u=t.changedTouches[0].pageX-n.left,l=t.changedTouches[0].pageY+n.top,Fs&&(u-=i.x,l-=i.y)),r.y=1-Math.max(0,Math.min(1,l/o)),r.x=Math.max(0,Math.min(1,u/a)),r}function dn(e){return cs(e)&&3===e.nodeType}function cn(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function pn(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(e=>("function"==typeof e&&(e=e()),Vs(e)||dn(e)?e:"string"==typeof e&&/\S/.test(e)?tt.createTextNode(e):void 0)).filter(e=>e)}function mn(e,t){return pn(t).forEach(t=>e.appendChild(t)),e}function gn(e,t){return mn(cn(e),t)}function fn(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||"mousedown"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}const yn=Ws("querySelector"),_n=Ws("querySelectorAll");function bn(e,t){if(!e||!t)return"";if("function"==typeof Te.getComputedStyle){let i;try{i=Te.getComputedStyle(e)}catch{return""}return i?i.getPropertyValue(t)||i[t]:""}return""}function vn(e){[...tt.styleSheets].forEach(t=>{try{let i=[...t.cssRules].map(e=>e.cssText).join(""),r=tt.createElement("style");r.textContent=i,e.document.head.appendChild(r)}catch{let i=tt.createElement("link");i.rel="stylesheet",i.type=t.type,i.media=t.media.mediaText,i.href=t.href,e.document.head.appendChild(i)}})}var Tn=Object.freeze({__proto__:null,isReal:$s,isEl:Vs,isInFrame:zs,createEl:Gs,textContent:Xs,prependTo:Ks,hasClass:Zs,addClass:Ys,removeClass:Qs,toggleClass:Js,setAttributes:en,getAttributes:tn,getAttribute:rn,setAttribute:sn,removeAttribute:nn,blockTextSelection:an,unblockTextSelection:on,getBoundingClientRect:ln,findPosition:un,getPointerPosition:hn,isTextNode:dn,emptyEl:cn,normalizeContent:pn,appendContent:mn,insertContent:gn,isSingleLeftClick:fn,$:yn,$$:_n,computedStyle:bn,copyStyleSheetsToWindow:vn});let Sn,Cn=!1;const En=function(){if(!1===Sn.options.autoSetup)return;let e=Array.prototype.slice.call(tt.getElementsByTagName("video")),t=Array.prototype.slice.call(tt.getElementsByTagName("audio")),i=Array.prototype.slice.call(tt.getElementsByTagName("video-js")),r=e.concat(t,i);if(r&&r.length>0)for(let e=0,t=r.length;e<t;e++){let t=r[e];if(!t||!t.getAttribute){wn(1);break}void 0===t.player&&null!==t.getAttribute("data-setup")&&Sn(t)}else Cn||wn(1)};function wn(e,t){$s()&&(t&&(Sn=t),Te.setTimeout(En,e))}function kn(){Cn=!0,Te.removeEventListener("load",kn)}$s()&&("complete"===tt.readyState?kn():Te.addEventListener("load",kn));const In=function(e){let t=tt.createElement("style");return t.className=e,t},xn=function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t};var An=new WeakMap;let Pn,Mn=3;function Dn(){return Mn++}function Ln(e,t){if(!An.has(e))return;let i=An.get(e);0===i.handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&An.delete(e)}function On(e,t,i,r){i.forEach(function(i){e(t,i,r)})}function Nn(e){if(e.fixed_)return e;function t(){return!0}function i(){return!1}if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){let r=e||Te.event;e={};let s=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(let t in r)s.includes(t)||"returnValue"===t&&r.preventDefault||(e[t]=r[t]);if(e.target||(e.target=e.srcElement||tt),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){r.preventDefault&&r.preventDefault(),e.returnValue=!1,r.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){r.stopPropagation&&r.stopPropagation(),e.cancelBubble=!0,r.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){r.stopImmediatePropagation&&r.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX){let t=tt.documentElement,i=tt.body;e.pageX=e.clientX+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0),e.pageY=e.clientY+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)}e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}const Rn=["touchstart","touchmove"];function Un(e,t,i){if(Array.isArray(t))return On(Un,e,t,i);An.has(e)||An.set(e,{});let r=An.get(e);if(r.handlers||={},r.handlers[t]||(r.handlers[t]=[]),i.guid||=Dn(),r.handlers[t].push(i),r.dispatcher||=(r.disabled=!1,function(t,i){if(r.disabled)return;t=Nn(t);let s=r.handlers[t.type];if(s){let r=s.slice(0);for(let s=0,n=r.length;s<n&&!t.isImmediatePropagationStopped();s++)try{r[s].call(e,t,i)}catch(e){as.error(e)}}}),1===r.handlers[t].length)if(e.addEventListener){let i=!1;(function(){if("boolean"!=typeof Pn){Pn=!1;try{let e=Object.defineProperty({},"passive",{get(){Pn=!0}});Te.addEventListener("test",null,e),Te.removeEventListener("test",null,e)}catch{}}return Pn})()&&Rn.indexOf(t)>-1&&(i={passive:!0}),e.addEventListener(t,r.dispatcher,i)}else e.attachEvent&&e.attachEvent("on"+t,r.dispatcher)}function Bn(e,t,i){if(!An.has(e))return;let r=An.get(e);if(!r.handlers)return;if(Array.isArray(t))return On(Bn,e,t,i);let s=function(e,t){r.handlers[t]=[],Ln(e,t)};if(void 0===t){for(let t in r.handlers)Object.prototype.hasOwnProperty.call(r.handlers||{},t)&&s(e,t);return}let n=r.handlers[t];if(n)if(i){if(i.guid)for(let e=0;e<n.length;e++)n[e].guid===i.guid&&n.splice(e--,1);Ln(e,t)}else s(e,t)}function Fn(e,t,i){let r=An.has(e)?An.get(e):{},s=e.parentNode||e.ownerDocument;if("string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=Nn(t),r.dispatcher&&r.dispatcher.call(e,t,i),s&&!t.isPropagationStopped()&&!0===t.bubbles)Fn.call(null,s,t,i);else if(!s&&!t.defaultPrevented&&t.target&&t.target[t.type]){An.has(t.target)||An.set(t.target,{});let e=An.get(t.target);t.target[t.type]&&(e.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),e.disabled=!1)}return!t.defaultPrevented}function qn(e,t,i){if(Array.isArray(t))return On(qn,e,t,i);let r=function(){Bn(e,t,r),i.apply(this,arguments)};r.guid=i.guid=i.guid||Dn(),Un(e,t,r)}function jn(e,t,i){let r=function(){Bn(e,t,r),i.apply(this,arguments)};r.guid=i.guid=i.guid||Dn(),Un(e,t,r)}var Hn=Object.freeze({__proto__:null,fixEvent:Nn,on:Un,off:Bn,trigger:Fn,one:qn,any:jn});const $n=function(e,t,i){t.guid||=Dn();let r=t.bind(e);return r.guid=i?i+"_"+t.guid:t.guid,r},Vn=function(e,t){let i=Te.performance.now();return function(...r){let s=Te.performance.now();s-i>=t&&(e(...r),i=s)}},zn=function(e,t,i,r=Te){let s,n=function(){let n=this,a=arguments,o=function(){s=null,o=null,i||e.apply(n,a)};!s&&i&&e.apply(n,a),r.clearTimeout(s),s=r.setTimeout(o,t)};return n.cancel=()=>{r.clearTimeout(s),s=null},n};var Wn=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:$n,throttle:Vn,debounce:zn});let Gn;class Xn{on(e,t){let i=this.addEventListener;this.addEventListener=()=>{},Un(this,e,t),this.addEventListener=i}off(e,t){Bn(this,e,t)}one(e,t){let i=this.addEventListener;this.addEventListener=()=>{},qn(this,e,t),this.addEventListener=i}any(e,t){let i=this.addEventListener;this.addEventListener=()=>{},jn(this,e,t),this.addEventListener=i}trigger(e){let t=e.type||e;"string"==typeof e&&(e={type:t}),e=Nn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Fn(this,e)}queueTrigger(e){Gn||=new Map;let t=e.type||e,i=Gn.get(this);i||(i=new Map,Gn.set(this,i));let r=i.get(t);i.delete(t),Te.clearTimeout(r);let s=Te.setTimeout(()=>{i.delete(t),0===i.size&&(i=null,Gn.delete(this)),this.trigger(e)},0);i.set(t,s)}}Xn.prototype.allowedEvents_={},Xn.prototype.addEventListener=Xn.prototype.on,Xn.prototype.removeEventListener=Xn.prototype.off,Xn.prototype.dispatchEvent=Xn.prototype.trigger;const Kn=e=>"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e,Zn=e=>e instanceof Xn||!!e.eventBusEl_&&["on","one","off","trigger"].every(t=>"function"==typeof e[t]),Yn=e=>"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length,Qn=(e,t,i)=>{if(!e||!e.nodeName&&!Zn(e))throw Error(`Invalid target for ${Kn(t)}#${i}; must be a DOM node or evented object.`)},Jn=(e,t,i)=>{if(!Yn(e))throw Error(`Invalid event type for ${Kn(t)}#${i}; must be a non-empty string or array.`)},ea=(e,t,i)=>{if("function"!=typeof e)throw Error(`Invalid listener for ${Kn(t)}#${i}; must be a function.`)},ta=(e,t,i)=>{let r,s,n,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return a?(r=e.eventBusEl_,t.length>=3&&t.shift(),[s,n]=t):(r=t[0],s=t[1],n=t[2]),Qn(r,e,i),Jn(s,e,i),ea(n,e,i),n=$n(e,n),{isTargetingSelf:a,target:r,type:s,listener:n}},ia=(e,t,i,r)=>{Qn(e,e,t),e.nodeName?Hn[t](e,i,r):e[t](i,r)},ra={on(...e){let{isTargetingSelf:t,target:i,type:r,listener:s}=ta(this,e,"on");if(ia(i,"on",r,s),!t){let e=()=>this.off(i,r,s);e.guid=s.guid;let t=()=>this.off("dispose",e);t.guid=s.guid,ia(this,"on","dispose",e),ia(i,"on","dispose",t)}},one(...e){let{isTargetingSelf:t,target:i,type:r,listener:s}=ta(this,e,"one");if(t)ia(i,"one",r,s);else{let e=(...t)=>{this.off(i,r,e),s.apply(null,t)};e.guid=s.guid,ia(i,"one",r,e)}},any(...e){let{isTargetingSelf:t,target:i,type:r,listener:s}=ta(this,e,"any");if(t)ia(i,"any",r,s);else{let e=(...t)=>{this.off(i,r,e),s.apply(null,t)};e.guid=s.guid,ia(i,"any",r,e)}},off(e,t,i){if(!e||Yn(e))Bn(this.eventBusEl_,e,t);else{let r=e,s=t;Qn(r,this,"off"),Jn(s,this,"off"),ea(i,this,"off"),i=$n(this,i),this.off("dispose",i),r.nodeName?(Bn(r,s,i),Bn(r,"dispose",i)):Zn(r)&&(r.off(s,i),r.off("dispose",i))}},trigger(e,t){Qn(this.eventBusEl_,this,"trigger");let i=e&&"string"!=typeof e?e.type:e;if(!Yn(i))throw Error(`Invalid event type for ${Kn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Fn(this.eventBusEl_,e,t)}};function sa(e,t={}){let{eventBusKey:i}=t;if(i){if(!e[i].nodeName)throw Error(`The eventBusKey "${i}" does not refer to an element.`);e.eventBusEl_=e[i]}else e.eventBusEl_=Gs("span",{className:"vjs-event-bus"});return Object.assign(e,ra),e.eventedCallbacks&&e.eventedCallbacks.forEach(e=>{e()}),e.on("dispose",()=>{e.off(),[e,e.el_,e.eventBusEl_].forEach(function(e){e&&An.has(e)&&An.delete(e)}),Te.setTimeout(()=>{e.eventBusEl_=null},0)}),e}const na={state:{},setState(e){let t;return"function"==typeof e&&(e=e()),hs(e,(e,i)=>{this.state[i]!==e&&(t||={},t[i]={from:this.state[i],to:e}),this.state[i]=e}),t&&Zn(this)&&this.trigger({changes:t,type:"statechanged"}),t}};function aa(e,t){return Object.assign(e,na),e.state=Object.assign({},e.state,t),"function"==typeof e.handleStateChanged&&Zn(e)&&e.on("statechanged",e.handleStateChanged),e}const oa=function(e){return"string"==typeof e?e.replace(/./,e=>e.toLowerCase()):e},la=function(e){return"string"==typeof e?e.replace(/./,e=>e.toUpperCase()):e},ua=function(e,t){return la(e)===la(t)};var ha=Object.freeze({__proto__:null,toLowerCase:oa,toTitleCase:la,titleCaseEquals:ua});class da{constructor(e,t,i){if(this.player_=!e&&this.play?e=this:e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ms({},this.options_),t=this.options_=ms(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){let t=e&&e.id&&e.id()||"no_player";this.id_=`${t}_component_${Dn()}`}this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(e=>this.addClass(e)),["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0}),!1!==t.evented&&(sa(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),aa(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&=(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e&&(this.options_=ms(this.options_,e)),this.options_}el(){return this.el_}createEl(e,t,i){return Gs(e,t,i)}localize(e,t,i=e){let r=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),n=s&&s[r],a=r&&r.split("-")[0],o=s&&s[a],l=i;return n&&n[e]?l=n[e]:o&&o[e]&&(l=o[e]),t&&(l=l.replace(/\{(\d+)\}/g,function(e,i){let r=t[i-1],s=r;return void 0===r&&(s=e),s})),l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((e,t)=>e.concat(t),[]);let t=this;for(let i=0;i<e.length;i++)if(t=t.getChild(e[i]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;let i="http://www.w3.org/2000/svg",r=Gs("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),s=tt.createElementNS(i,"svg");s.setAttributeNS(null,"viewBox","0 0 512 512");let n=tt.createElementNS(i,"use");return s.appendChild(n),n.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(s),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},i=this.children_.length){let r,s;if("string"==typeof e){s=la(e);let i=t.componentClass||s;t.name=s;let n=da.getComponent(i);if(!n)throw Error(`Component ${i} does not exist`);if("function"!=typeof n)return null;r=new n(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(i,0,r),r.parentComponent_=this,"function"==typeof r.id&&(this.childIndex_[r.id()]=r),s||=r.name&&la(r.name()),s&&(this.childNameIndex_[s]=r,this.childNameIndex_[oa(s)]=r),"function"==typeof r.el&&r.el()){let e=null;this.children_[i+1]&&(this.children_[i+1].el_?e=this.children_[i+1].el_:Vs(this.children_[i+1])&&(e=this.children_[i+1])),this.contentEl().insertBefore(r.el(),e)}return r}removeChild(e){if("string"==typeof e&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[la(e.name())]=null,this.childNameIndex_[oa(e.name())]=null;let i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){let e=this.options_.children;if(e){let t,i=this.options_,r=e=>{let t=e.name,r=e.opts;if(void 0!==i[t]&&(r=i[t]),!1===r)return;!0===r&&(r={}),r.playerOptions=this.options_.playerOptions;let s=this.addChild(t,r);s&&(this[t]=s)},s=da.getComponent("Tech");t=Array.isArray(e)?e:Object.keys(e),t.concat(Object.keys(this.options_).filter(function(e){return!t.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(t=>{let i,r;return"string"==typeof t?(i=t,r=e[i]||this.options_[i]||{}):(i=t.name,r=t),{name:i,opts:r}}).filter(e=>{let t=da.getComponent(e.opts.componentClass||la(e.name));return t&&!s.isTech(t)}).forEach(r)}}buildCSSClass(){return""}ready(e,t=!1){e&&(this.isReady_?t?e.call(this):this.setTimeout(e,1):(this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e)))}triggerReady(){this.isReady_=!0,this.setTimeout(function(){let e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)}$(e,t){return yn(e,t||this.contentEl())}$$(e,t){return _n(e,t||this.contentEl())}hasClass(e){return Zs(this.el_,e)}addClass(...e){Ys(this.el_,...e)}removeClass(...e){Qs(this.el_,...e)}toggleClass(e,t){Js(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return rn(this.el_,e)}setAttribute(e,t){sn(this.el_,e,t)}removeAttribute(e){nn(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,i){if(void 0!==t)return(null===t||t!=t)&&(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;let r=this.el_.style[e],s=r.indexOf("px");return parseInt(-1===s?this.el_["offset"+la(e)]:r.slice(0,s),10)}currentDimension(e){let t=0;if("width"!==e&&"height"!==e)throw Error("currentDimension only accepts width or height value");if(t=bn(this.el_,e),t=parseFloat(t),0===t||isNaN(t)){let i=`offset${la(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){let e=this.el_.getBoundingClientRect();return{boundingClientRect:{x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},center:{x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&("Tab"!==e.key&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e,t=0,i=null;this.on("touchstart",function(r){1===r.touches.length&&(i={pageX:r.touches[0].pageX,pageY:r.touches[0].pageY},t=Te.performance.now(),e=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(i){let r=t.touches[0].pageX-i.pageX,s=t.touches[0].pageY-i.pageY;Math.sqrt(r*r+s*s)>10&&(e=!1)}});let r=function(){e=!1};this.on("touchleave",r),this.on("touchcancel",r),this.on("touchend",function(r){i=null,!0===e&&Te.performance.now()-t<200&&(r.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;let e,t=$n(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});let i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(e,t){var i;return e=$n(this,e),this.clearTimersOnDispose_(),i=Te.setTimeout(()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),Te.clearTimeout(e)),e}setInterval(e,t){e=$n(this,e),this.clearTimersOnDispose_();let i=Te.setInterval(e,t);return this.setIntervalIds_.add(i),i}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),Te.clearInterval(e)),e}requestAnimationFrame(e){var t;return this.clearTimersOnDispose_(),e=$n(this,e),t=Te.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=$n(this,t);let i=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,i),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),Te.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((e,i)=>this[t](i))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(e){let t=Te.getComputedStyle(e,null),i=t.getPropertyValue("visibility");return"none"!==t.getPropertyValue("display")&&!["hidden","collapse"].includes(i)}return e||=this.el(),!(!function(e){if(e.offsetWidth+e.offsetHeight+e.getBoundingClientRect().height+e.getBoundingClientRect().width===0)return!1;let t={x:e.getBoundingClientRect().left+e.offsetWidth/2,y:e.getBoundingClientRect().top+e.offsetHeight/2};if(t.x<0||t.x>(tt.documentElement.clientWidth||Te.innerWidth)||t.y<0||t.y>(tt.documentElement.clientHeight||Te.innerHeight))return!1;let i=tt.elementFromPoint(t.x,t.y);for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}}(e)||!function(e){return!(!t(e.parentElement)||!t(e)||"0"===e.style.opacity||"0px"===Te.getComputedStyle(e).height||"0px"===Te.getComputedStyle(e).width)}(e)||e.parentElement&&!(e.tabIndex>=0))}static registerComponent(e,t){if("string"!=typeof e||!e)throw Error(`Illegal component name, "${e}"; must be a non-empty string.`);let i=da.getComponent("Tech"),r=i&&i.isTech(t),s=da===t||da.prototype.isPrototypeOf(t.prototype);if(r||!s){let t;throw t=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass",Error(`Illegal component, "${e}"; ${t}.`)}e=la(e),da.components_||={};let n=da.getComponent("Player");if("Player"===e&&n&&n.players){let e=n.players,t=Object.keys(e);if(e&&t.length>0)for(let i=0;i<t.length;i++)if(null!==e[t[i]])throw Error("Can not register Player component after player has been created.")}return da.components_[e]=t,da.components_[oa(e)]=t,t}static getComponent(e){if(e&&da.components_)return da.components_[e]}}function ca(e,t,i,r){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}(e,r,i.length-1),i[r][t]}function pa(e){let t;return t=void 0===e||0===e.length?{length:0,start(){throw Error("This TimeRanges object is empty")},end(){throw Error("This TimeRanges object is empty")}}:{length:e.length,start:ca.bind(null,"start",0,e),end:ca.bind(null,"end",1,e)},Te.Symbol&&Te.Symbol.iterator&&(t[Te.Symbol.iterator]=()=>(e||[]).values()),t}function ma(e,t){return Array.isArray(e)?pa(e):void 0===e||void 0===t?pa():pa([[e,t]])}da.registerComponent("Component",da);const ga=function(e,t){e=e<0?0:e;let i=Math.floor(e%60),r=Math.floor(e/60%60),s=Math.floor(e/3600),n=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(s=r=i="-"),s=s>0||a>0?s+":":"",r=((s||n>=10)&&r<10?"0"+r:r)+":",i=i<10?"0"+i:i,s+r+i};let fa=ga;function ya(e){fa=e}function _a(){fa=ga}function ba(e,t=e){return fa(e,t)}var va=Object.freeze({__proto__:null,createTimeRanges:ma,createTimeRange:ma,setFormatTime:ya,resetFormatTime:_a,formatTime:ba});function Ta(e,t){let i,r,s=0;if(!t)return 0;(!e||!e.length)&&(e=ma(0,0));for(let n=0;n<e.length;n++)i=e.start(n),r=e.end(n),r>t&&(r=t),s+=r-i;return s/t}function Sa(e){if(e instanceof Sa)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:cs(e)&&("number"==typeof e.code&&(this.code=e.code),Object.assign(this,e)),this.message||=Sa.defaultMessages[this.code]||""}function Ca(e){return null!=e&&"function"==typeof e.then}function Ea(e){Ca(e)&&e.then(null,e=>{})}Sa.prototype.code=0,Sa.prototype.message="",Sa.prototype.status=null,Sa.prototype.metadata=null,Sa.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Sa.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},Sa.MEDIA_ERR_CUSTOM=0,Sa.prototype.MEDIA_ERR_CUSTOM=0,Sa.MEDIA_ERR_ABORTED=1,Sa.prototype.MEDIA_ERR_ABORTED=1,Sa.MEDIA_ERR_NETWORK=2,Sa.prototype.MEDIA_ERR_NETWORK=2,Sa.MEDIA_ERR_DECODE=3,Sa.prototype.MEDIA_ERR_DECODE=3,Sa.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Sa.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Sa.MEDIA_ERR_ENCRYPTED=5,Sa.prototype.MEDIA_ERR_ENCRYPTED=5;const wa=function(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,i,r)=>(e[i]&&(t[i]=e[i]),t),{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})};var ka=wa;const Ia="vjs-modal-dialog";class xa extends da{constructor(e,t){super(e,t),this.handleKeyDown_=e=>this.handleKeyDown(e),this.close_=e=>this.close(e),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=Gs("div",{className:`${Ia}-content`},{role:"document"}),this.descEl_=Gs("p",{className:`${Ia}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Xs(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Ia} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());let e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;let e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if("boolean"==typeof e){let t=this.closeable_=!!e,i=this.getChild("closeButton");if(t&&!i){let e=this.contentEl_;this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)}!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){let t=this.contentEl(),i=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),gn(t,e),this.trigger("modalfill"),r?i.insertBefore(t,r):i.appendChild(t);let s=this.getChild("closeButton");s&&i.appendChild(s.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),cn(this.contentEl()),this.trigger("modalempty")}content(e){return void 0!==e&&(this.content_=e),this.content_}conditionalFocus_(){let e=tt.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&=(this.previouslyActiveEl_.focus(),null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),"Escape"===e.key&&this.closeable())return e.preventDefault(),void this.close();if("Tab"!==e.key)return;let t,i=this.focusableEls_(),r=this.el_.querySelector(":focus");for(let e=0;e<i.length;e++)if(r===i[e]){t=e;break}tt.activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(i[i.length-1].focus(),e.preventDefault()):!e.shiftKey&&t===i.length-1&&(i[0].focus(),e.preventDefault())}focusableEls_(){let e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,e=>(e instanceof Te.HTMLAnchorElement||e instanceof Te.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof Te.HTMLInputElement||e instanceof Te.HTMLSelectElement||e instanceof Te.HTMLTextAreaElement||e instanceof Te.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof Te.HTMLIFrameElement||e instanceof Te.HTMLObjectElement||e instanceof Te.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable"))}}xa.prototype.options_={pauseOnOpen:!0,temporary:!0},da.registerComponent("ModalDialog",xa);class Aa extends Xn{constructor(e=[]){super(),this.tracks_=[];for(let t=0;t<e.length;t++)this.addTrack(e[t])}get length(){return this.tracks_.length}addTrack(e){let t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},Zn(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this[i],t.off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let i=0,r=this.length;i<r;i++){let r=this[i];if(r.id===e){t=r;break}}return t}}Aa.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(let e in Aa.prototype.allowedEvents_)Aa.prototype["on"+e]=null;const Pa=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)};class Ma extends Aa{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Pa(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Pa(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Pa(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Da=function(e,t){for(let i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)};class La extends Aa{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Da(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set(){}})}addTrack(e){e.selected&&Da(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Da(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Oa extends Aa{addTrack(e){super.addTrack(e),this.queueChange_||=()=>this.queueTrigger("change"),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(e.kind)&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class Na{constructor(e){Na.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){let t=this.length||0,i=0,r=e.length;this.cues_=e,this.length_=e.length;let s=function(e){""+e in this||Object.defineProperty(this,""+e,{get(){return this.cues_[e]}})};if(t<r)for(i=t;i<r;i++)s.call(this,i)}getCueById(e){let t=null;for(let i=0,r=this.length;i<r;i++){let r=this[i];if(r.id===e){t=r;break}}return t}}const Ra={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Ua={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Ba={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Fa={disabled:"disabled",hidden:"hidden",showing:"showing"};class qa extends Xn{constructor(e={}){super();let t={id:e.id||"vjs_track_"+Dn(),kind:e.kind||"",language:e.language||""},i=e.label||"";for(let e in t)Object.defineProperty(this,e,{get:()=>t[e],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(e){e!==i&&(i=e,this.trigger("labelchange"))}})}}const ja=function(e){return new URL(e,tt.baseURI)},Ha=function(e){return new URL(e,tt.baseURI).href},$a=function(e){if("string"==typeof e){let t=e.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},Va=function(e,t=Te.location){return ja(e).origin!==t.origin};var za=Object.freeze({__proto__:null,parseUrl:ja,getAbsoluteURL:Ha,getFileExtension:$a,isCrossOrigin:Va});const Wa=function(e,t){let i=new Te.WebVTT.Parser(Te,Te.vttjs,Te.WebVTT.StringDecoder()),r=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){r.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),r.length>0&&(Te.console&&Te.console.groupCollapsed&&Te.console.groupCollapsed(`Text Track parsing errors for ${t.src}`),r.forEach(e=>as.error(e)),Te.console&&Te.console.groupEnd&&Te.console.groupEnd()),i.flush()},Ga=function(e,t){let i={uri:e},r=Va(e);r&&(i.cors=r);let s="use-credentials"===t.tech_.crossOrigin();s&&(i.withCredentials=s),gt(i,$n(this,function(e,i,r){if(e)return as.error(e,i);t.loaded_=!0,"function"==typeof Te.WebVTT?Wa(r,t):t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],e=>{if("vttjserror"!==e.type)return Wa(r,t);as.error(`vttjs failed to load, stopping trying to process ${t.src}`)})}))};class Xa extends qa{constructor(e={}){if(!e.tech)throw Error("A tech was not provided.");let t=ms(e,{kind:Ba[e.kind]||"subtitles",language:e.language||e.srclang||""}),i=Fa[t.mode]||"disabled",r=t.default;("metadata"===t.kind||"chapters"===t.kind)&&(i="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;let s=new Na(this.cues_),n=new Na(this.activeCues_),a=!1;this.timeupdateHandler=$n(this,function(e={}){this.tech_.isDisposed()||(this.tech_.isReady_&&(this.activeCues=this.activeCues,a&&=(this.trigger("cuechange"),!1)),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}),this.tech_.one("dispose",()=>{this.stopTracking()}),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>r,set(){}},mode:{get:()=>i,set(e){Fa[e]&&i!==e&&(i=e,!this.preload_&&"disabled"!==i&&0===this.cues.length&&Ga(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?s:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return n;let e=this.tech_.currentTime(),t=[];for(let i=0,r=this.cues.length;i<r;i++){let r=this.cues[i];r.startTime<=e&&r.endTime>=e&&t.push(r)}if(a=!1,t.length!==this.activeCues_.length)a=!0;else for(let e=0;e<t.length;e++)-1===this.activeCues_.indexOf(t[e])&&(a=!0);return this.activeCues_=t,n.setCues_(this.activeCues_),n},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&Ga(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&=void this.tech_.cancelVideoFrameCallback(this.rvf_),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new Te.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(let i in e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}let i=this.tech_.textTracks();for(let e=0;e<i.length;e++)i[e]!==this&&i[e].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return ka(this)}removeCue(e){let t=this.cues_.length;for(;t--;){let i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}Xa.prototype.allowedEvents_={cuechange:"cuechange"};class Ka extends qa{constructor(e={}){let t=ms(e,{kind:Ua[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"enabled",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class Za extends qa{constructor(e={}){let t=ms(e,{kind:Ra[e.kind]||""});super(t);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(e){"boolean"==typeof e&&e!==i&&(i=e,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class Ya extends Xn{constructor(e={}){super();let t,i=new Xa(e);this.kind=i.kind,this.src=i.src,this.srclang=i.language,this.label=i.label,this.default=i.default,Object.defineProperties(this,{readyState:{get:()=>t},track:{get:()=>i}}),t=Ya.NONE,i.addEventListener("loadeddata",()=>{t=Ya.LOADED,this.trigger({type:"load",target:this})})}}Ya.prototype.allowedEvents_={load:"load"},Ya.NONE=0,Ya.LOADING=1,Ya.LOADED=2,Ya.ERROR=3;const Qa={audio:{ListClass:Ma,TrackClass:Ka,capitalName:"Audio"},video:{ListClass:La,TrackClass:Za,capitalName:"Video"},text:{ListClass:Oa,TrackClass:Xa,capitalName:"Text"}};Object.keys(Qa).forEach(function(e){Qa[e].getterName=`${e}Tracks`,Qa[e].privateName=`${e}Tracks_`});const Ja={remoteText:{ListClass:Oa,TrackClass:Xa,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}addTrackElement_(e){let t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let i=0,r=this.trackElements_.length;i<r;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t}removeTrackElement_(e){for(let t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}},TrackClass:Ya,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},eo=Object.assign({},Qa,Ja);Ja.names=Object.keys(Ja),Qa.names=Object.keys(Qa),eo.names=[].concat(Ja.names,Qa.names);class to extends da{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=e=>this.onDurationChange(e),this.trackProgress_=e=>this.trackProgress(e),this.trackCurrentTime_=e=>this.trackCurrentTime(e),this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e),this.disposeSourceHandler_=e=>this.disposeSourceHandler(e),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),eo.names.forEach(t=>{let i=eo[t];e&&e[i.getterName]&&(this[i.privateName]=e[i.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(t=>{!1===e[`native${t}Tracks`]&&(this[`featuresNative${t}Tracks`]=!1)}),!1===e.nativeCaptions||!1===e.nativeTextTracks?this.featuresNativeTextTracks=!1:(!0===e.nativeCaptions||!0===e.nativeTextTracks)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==e.preloadTextTracks,this.autoRemoteTextTracks_=new eo.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval($n(this,function(){let e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return ma(0,0)}bufferedPercent(){return Ta(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(Qa.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){(e=[].concat(e)).forEach(e=>{let t=this[`${e}Tracks`]()||[],i=t.length;for(;i--;){let r=t[i];"text"===e&&this.removeRemoteTextTrack(r),t.removeTrack(r)}})}cleanupAutoTextTracks(){let e=this.autoRemoteTextTracks_||[],t=e.length;for(;t--;){let i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return void 0!==e&&(this.error_=new Sa(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?ma(0,0):ma()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){Qa.names.forEach(e=>{let t=Qa[e],i=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),this.on("dispose",()=>{r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(!Te.WebVTT)if(tt.body.contains(this.el())){if(!this.options_["vtt.js"]&&ps(xt)&&Object.keys(xt).length>0)return void this.trigger("vttjsloaded");let e=tt.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),Te.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){let e=this.textTracks(),t=this.remoteTextTracks(),i=t=>e.addTrack(t.track),r=t=>e.removeTrack(t.track);t.on("addtrack",i),t.on("removetrack",r),this.addWebVttScript_();let s=()=>this.trigger("texttrackchange"),n=()=>{s();for(let t=0;t<e.length;t++){let i=e[t];i.removeEventListener("cuechange",s),"showing"===i.mode&&i.addEventListener("cuechange",s)}};n(),e.addEventListener("change",n),e.addEventListener("addtrack",n),e.addEventListener("removetrack",n),this.on("dispose",function(){t.off("addtrack",i),t.off("removetrack",r),e.removeEventListener("change",n),e.removeEventListener("addtrack",n),e.removeEventListener("removetrack",n);for(let t=0;t<e.length;t++)e[t].removeEventListener("cuechange",s)})}addTextTrack(e,t,i){if(!e)throw Error("TextTrack kind is required but was not provided");return function(e,t,i,r,s={}){let n=e.textTracks();s.kind=t,i&&(s.label=i),r&&(s.language=r),s.tech=e;let a=new eo.text.TrackClass(s);return n.addTrack(a),a}(this,e,t,i)}createRemoteTextTrack(e){let t=ms(e,{tech:this});return new Ja.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){let i=this.createRemoteTextTrack(e);return"boolean"!=typeof t&&(t=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===t&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(i.track)),i}removeRemoteTextTrack(e){let t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){let t=Dn();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return to.canPlayType(e.type)}static isTech(e){return e.prototype instanceof to||e instanceof to||e===to}static registerTech(e,t){if(to.techs_||={},!to.isTech(t))throw Error(`Tech ${e} must be a Tech`);if(!to.canPlayType)throw Error("Techs must have a static canPlayType method on them");if(!to.canPlaySource)throw Error("Techs must have a static canPlaySource method on them");return e=la(e),to.techs_[e]=t,to.techs_[oa(e)]=t,"Tech"!==e&&to.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(to.techs_&&to.techs_[e])return to.techs_[e];if(e=la(e),Te&&Te.videojs&&Te.videojs[e])return as.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),Te.videojs[e]}}}eo.names.forEach(function(e){let t=eo[e];to.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),to.prototype.featuresVolumeControl=!0,to.prototype.featuresMuteControl=!0,to.prototype.featuresFullscreenResize=!1,to.prototype.featuresPlaybackRate=!1,to.prototype.featuresProgressEvents=!1,to.prototype.featuresSourceset=!1,to.prototype.featuresTimeupdateEvents=!1,to.prototype.featuresNativeTextTracks=!1,to.prototype.featuresVideoFrameCallback=!1,to.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){let r=e.sourceHandlers;r||=e.sourceHandlers=[],void 0===i&&(i=r.length),r.splice(i,0,t)},e.canPlayType=function(t){let i,r=e.sourceHandlers||[];for(let e=0;e<r.length;e++)if(i=r[e].canPlayType(t),i)return i;return""},e.selectSourceHandler=function(t,i){let r,s=e.sourceHandlers||[];for(let e=0;e<s.length;e++)if(r=s[e].canHandleSource(t,i),r)return s[e];return null},e.canPlaySource=function(t,i){let r=e.selectSourceHandler(t,i);return r?r.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach(function(e){let t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(t){let i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:as.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&=(this.clearTracks(["audio","video"]),null),this.cleanupAutoTextTracks(),this.sourceHandler_&&=(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),null)}},da.registerComponent("Tech",to),to.registerTech("Tech",to),to.defaultTechOrder_=[];const io={},ro={},so={};function no(e,t,i){e.setTimeout(()=>co(t,io[t.type],i,e),1)}function ao(e,t,i,r=null){let s="call"+la(i),n=e.reduce(ho(s),r),a=n===so,o=a?null:t[i](n);return function(e,t,i,r){for(let s=e.length-1;s>=0;s--){let n=e[s];n[t]&&n[t](r,i)}}(e,i,o,a),o}const oo={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},lo={setCurrentTime:1,setMuted:1,setVolume:1},uo={play:1,pause:1};function ho(e){return(t,i)=>t===so?so:i[e]?i[e](t):t}function co(e={},t=[],i,r,s=[],n=!1){let[a,...o]=t;if("string"==typeof a)co(e,io[a],i,r,s,n);else if(a){let t=function(e,t){let i=ro[e.id()],r=null;if(null==i)return r=t(e),ro[e.id()]=[[t,r]],r;for(let e=0;e<i.length;e++){let[s,n]=i[e];s===t&&(r=n)}return null===r&&(r=t(e),i.push([t,r])),r}(r,a);if(!t.setSource)return s.push(t),co(e,o,i,r,s,n);t.setSource(Object.assign({},e),function(a,l){if(a)return co(e,o,i,r,s,n);s.push(t),co(l,e.type===l.type?o:io[l.type],i,r,s,n)})}else o.length?co(e,o,i,r,s,n):n?i(e,s):co(e,io["*"],i,r,s,!0)}const po={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},mo=function(e=""){let t=$a(e);return po[t.toLowerCase()]||""},go=function(e){if(Array.isArray(e)){let t=[];e.forEach(function(e){e=go(e),Array.isArray(e)?t=t.concat(e):cs(e)&&t.push(e)}),e=t}else e="string"==typeof e&&e.trim()?[fo({src:e})]:cs(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[fo(e)]:[];return e};function fo(e){if(!e.type){let t=mo(e.src);t&&(e.type=t)}return e}const yo=Os?10009:Ns?461:8,_o={codes:{play:415,pause:19,ff:417,rw:412,back:yo},names:{415:"play",19:"pause",417:"ff",412:"rw",[yo]:"back"},isEventKey(e,t){return t=t.toLowerCase(),!(!this.names[e.keyCode]||this.names[e.keyCode]!==t)},getEventName(e){if(this.names[e.keyCode])return this.names[e.keyCode];if(this.codes[e.code]){let t=this.codes[e.code];return this.names[t]}return null}};class bo extends Xn{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){let t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();let e=t.key.substring(5).toLowerCase();this.move(e)}else if(_o.isEventKey(t,"play")||_o.isEventKey(t,"pause")||_o.isEventKey(t,"ff")||_o.isEventKey(t,"rw")){t.preventDefault();let e=_o.getEventName(t);this.performMediaAction_(e)}else _o.isEventKey(t,"Back")&&e.target&&"function"==typeof e.target.closeable&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+5);break;case"rw":this.userSeek_(this.player_.currentTime()-5)}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){let t=e.relatedTarget,i=null,r=this.getCurrentComponent(e.target);t&&(i=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!i||!t)&&(r&&"CloseButton"===r.name()?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){let e=this.player_,t=[];function i(e){for(let r of e)r.hasOwnProperty("el_")&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())&&t.push(r),r.hasOwnProperty("children_")&&r.children_.length>0&&i(r.children_)}return e.children_.forEach(e=>{if(e.hasOwnProperty("el_")){if(e.getIsFocusable&&e.getIsAvailableToBeFocused&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el()))return void t.push(e);e.hasOwnProperty("children_")&&e.children_.length>0?i(e.children_):e.hasOwnProperty("items")&&e.items.length>0?i(e.items):this.findSuitableDOMChild(e)&&t.push(e)}if("ErrorDisplay"===e.name_&&e.opened_){let i=e.el_.querySelector(".vjs-errors-ok-button-container");i&&i.querySelectorAll("button").forEach((e,i)=>{t.push({name:()=>"ModalButton"+(i+1),el:()=>e,getPositions:()=>{let t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{x:t.left+t.width/2,y:t.top+t.height/2,width:0,height:0,top:t.top+t.height/2,right:t.left+t.width/2,bottom:t.top+t.height/2,left:t.left+t.width/2}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:e=>!0,focus:()=>e.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){return e.el()?function t(i){if(e.getIsFocusable(i)&&e.getIsAvailableToBeFocused(i))return i;for(let e=0;e<i.children.length;e++){let r=t(i.children[e]);if(r)return r}return null}(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();let t=e||document.activeElement;if(this.focusableComponents.length)for(let e of this.focusableComponents)if(e.el()===t)return e}add(e){let t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name())return this.focusableComponents.splice(t,1),void this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){let t=this.getCurrentComponent();if(!t)return;let i=t.getPositions(),r=this.focusableComponents.filter(r=>r!==t&&this.isInDirection_(i.boundingClientRect,r.getPositions().boundingClientRect,e)),s=this.findBestCandidate_(i.center,r,e);s?this.focus(s):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,i){let r=1/0,s=null;for(let n of t){let t=n.getPositions().center,a=this.calculateDistance_(e,t,i);a<r&&(r=a,s=n)}return s}isInDirection_(e,t,i){switch(i){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name())return void this.focus(this.focusableComponents[e])}else this.focus(this.updateFocusableComponents()[0])}focus(e){"object"==typeof e&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,i){let r,s=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);switch(i){case"right":case"left":r=s+100*n;break;case"up":r=2*n+.5*s;break;case"down":r=5*n+s;break;default:r=s+n}return r}searchForTrackSelect_(){let e=this;for(let t of e.updateFocusableComponents())if("TextTrackSelect"===t.constructor.name){e.focus(t);break}}}da.registerComponent("MediaLoader",class extends da{constructor(e,t,i){if(super(e,ms({createEl:!1},t),i),t.playerOptions.sources&&0!==t.playerOptions.sources.length)e.src(t.playerOptions.sources);else for(let i=0,r=t.playerOptions.techOrder;i<r.length;i++){let t=la(r[i]),s=to.getTech(t);if(t||(s=da.getComponent(t)),s&&s.isSupported()){e.loadTech_(t);break}}}});class vo extends da{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=e=>this.handleMouseOver(e),this.handleMouseOut_=e=>this.handleMouseOut(e),this.handleClick_=e=>this.handleClick(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.emitTapEvents(),this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),"button"===e&&as.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),i=Object.assign({role:"button"},i),this.tabIndex_=t.tabIndex;let r=Gs(e,t,i);return this.player_.options_.experimentalSvgIcons||r.appendChild(Gs("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=Gs("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(void 0===e)return this.controlText_||"Need Text";let i=this.localize(e);this.controlText_=e,Xs(this.controlTextEl_,i),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){" "===e.key||"Enter"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}da.registerComponent("ClickableComponent",vo);class To extends vo{constructor(e,t){super(e,t);let{mainContent:i}=t&&t.playerOptions||{};this.isMainContent=i,this.update(),this.update_=e=>this.update(e),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return Gs("div",{className:"vjs-poster"})}crossOrigin(e){if(void 0===e)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null!==e&&"anonymous"!==e&&"use-credentials"!==e?this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`):this.$("img")&&(this.$("img").crossOrigin=e)}update(e){let t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){e?(this.$("img")||this.el_.appendChild(Gs("picture",{className:"vjs-poster",tabIndex:-1},{},Gs("img",{loading:this.isMainContent?"eager":"lazy",fetchPriority:this.isMainContent?"high":"auto",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e):this.el_.textContent=""}handleClick(e){if(!this.player_.controls())return;let t=this.player_.getChild("controlBar"),i=t&&t.getChild("playToggle");Cs?(i||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Ea(this.player_.play()):this.player_.pause()}}To.prototype.crossorigin=To.prototype.crossOrigin,da.registerComponent("PosterImage",To);const So="#222",Co="#ccc",Eo={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function wo(e,t){let i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function ko(e,t,i){try{e.style[t]=i}catch{return}}function Io(e){return e?`${e}px`:""}da.registerComponent("TextTrackDisplay",class extends da{constructor(e,t,i){super(e,t,i);let r=e=>this.updateDisplay(e),s=e=>{this.updateDisplayOverlay(),this.updateDisplay(e)};e.on("loadstart",e=>this.toggleDisplay(e)),e.on("useractive",r),e.on("userinactive",r),e.on("texttrackchange",r),e.on("loadedmetadata",e=>{this.updateDisplayOverlay(),this.preselectTrack(e)}),e.ready($n(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks)return void this.hide();e.on("fullscreenchange",s),e.on("playerresize",s);let t=Te.screen.orientation||Te,i=Te.screen.orientation?"change":"orientationchange";t.addEventListener(i,s),e.on("dispose",()=>t.removeEventListener(i,s));let r=this.options_.playerOptions.tracks||[];for(let e=0;e<r.length;e++)this.player_.addRemoteTextTrack(r[e],!0);this.preselectTrack()}))}preselectTrack(){let e,t,i,r={captions:1,subtitles:1},s=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage;for(let a=0;a<s.length;a++){let o=s[a];n&&n.enabled&&n.language&&n.language===o.language&&o.kind in r?o.kind===n.kind?i=o:i||=o:n&&!n.enabled?(i=null,e=null,t=null):o.default&&("descriptions"!==o.kind||e?o.kind in r&&!t&&(t=o):e=o)}i?i.mode="showing":t?t.mode="showing":e&&(e.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof Te.WebVTT&&Te.WebVTT.processCues(Te,[],this.el_)}updateDisplay(){let e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){let t=[];for(let i=0;i<e.length;++i){let r=e[i];"showing"===r.mode&&t.push(r)}return void this.updateForTrack(t)}let i=null,r=null,s=e.length;for(;s--;){let t=e[s];"showing"===t.mode&&("descriptions"===t.kind?i=t:r=t)}if(r?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),void 0===Te.CSS||!Te.CSS.supports("inset","10px")){let e=this.el_,t=e.querySelectorAll(".vjs-text-track-cue"),i=this.player_.controlBar.el_.getBoundingClientRect().height,r=this.player_.el_.getBoundingClientRect().height;e.style="",ko(e,"position","relative"),ko(e,"height",r-i+"px"),ko(e,"top","unset"),ko(e,"bottom",Rs?r+"px":"0px"),t.length>0&&t.forEach(e=>{if(e.style.inset){let t=e.style.inset.split(" ");3===t.length&&Object.assign(e.style,{top:t[0],right:t[1],bottom:t[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||void 0===Te.CSS||!Te.CSS.supports("inset-inline: 10px"))return;let e=this.player_.currentWidth(),t=this.player_.currentHeight(),i=e/t,r=this.player_.videoWidth()/this.player_.videoHeight(),s=0,n=0;Math.abs(i-r)>.1&&(i>r?s=Math.round((e-t*r)/2):n=Math.round((t-e/r)/2)),ko(this.el_,"insetInline",Io(s)),ko(this.el_,"insetBlock",Io(n))}updateDisplayState(e){let t=this.player_.textTrackSettings.getValues(),i=e.activeCues,r=i.length;for(;r--;){let e=i[r];if(!e)continue;let s=e.displayState;if(t.color&&(s.firstChild.style.color=t.color),t.textOpacity&&ko(s.firstChild,"color",wo(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(s.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&ko(s.firstChild,"backgroundColor",wo(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?ko(s,"backgroundColor",wo(t.windowColor,t.windowOpacity)):s.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?s.firstChild.style.textShadow=`2px 2px 3px ${So}, 2px 2px 4px ${So}, 2px 2px 5px ${So}`:"raised"===t.edgeStyle?s.firstChild.style.textShadow=`1px 1px ${So}, 2px 2px ${So}, 3px 3px ${So}`:"depressed"===t.edgeStyle?s.firstChild.style.textShadow=`1px 1px ${Co}, 0 1px ${Co}, -1px -1px ${So}, 0 -1px ${So}`:"uniform"===t.edgeStyle&&(s.firstChild.style.textShadow=`0 0 4px ${So}, 0 0 4px ${So}, 0 0 4px ${So}, 0 0 4px ${So}`)),t.fontPercent&&1!==t.fontPercent){let e=Te.parseFloat(s.style.fontSize);s.style.fontSize=e*t.fontPercent+"px",s.style.height="auto",s.style.top="auto"}t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?s.firstChild.style.fontVariant="small-caps":s.firstChild.style.fontFamily=Eo[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),"function"!=typeof Te.WebVTT||e.every(e=>!e.activeCues))return;let t=[];for(let i=0;i<e.length;++i){let r=e[i];for(let e=0;e<r.activeCues.length;++e)t.push(r.activeCues[e])}Te.WebVTT.processCues(Te,t,this.el_);for(let t=0;t<e.length;++t){let i=e[t];for(let e=0;e<i.activeCues.length;++e){let r=i.activeCues[e].displayState;Ys(r,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:t)),i.language&&sn(r,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}}),da.registerComponent("LoadingSpinner",class extends da{createEl(){let e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),i=Gs("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(i),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class xo extends vo{createEl(e,t={},i={}){let r=Gs("button",t=Object.assign({className:this.buildCSSClass()},t),i=Object.assign({type:"button"},i));return this.player_.options_.experimentalSvgIcons||r.appendChild(Gs("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){let i=this.constructor.name;return as.warn(`Adding an actionable (user controllable) child to a Button (${i}) is not supported; use a ClickableComponent instead.`),da.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){" "===e.key||"Enter"===e.key?e.stopPropagation():super.handleKeyDown(e)}}da.registerComponent("Button",xo);class Ao extends xo{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",e=>this.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){let t=this.player_.play(),i=this.player_.getChild("controlBar"),r=i&&i.getChild("playToggle");if("tap"===e.type||this.mouseused_&&"clientX"in e&&"clientY"in e)return Ea(t),void(Cs?(r||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus());if(!r)return void this.player_.tech(!0).focus();let s=()=>r.focus();Ca(t)?t.then(s,()=>{}):this.setTimeout(s,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}Ao.prototype.controlText_="Play Video",da.registerComponent("BigPlayButton",Ao),da.registerComponent("CloseButton",class extends xo{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){"Escape"===e.key?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}});class Po extends xo{constructor(e,t={}){super(e,t),t.replay=void 0===t.replay||t.replay,this.setIcon("play"),this.on(e,"play",e=>this.handlePlay(e)),this.on(e,"pause",e=>this.handlePause(e)),t.replay&&this.on(e,"ended",e=>this.handleEnded(e))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?Ea(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}Po.prototype.controlText_="Play",da.registerComponent("PlayToggle",Po);class Mo extends da{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],e=>this.update(e)),this.updateTextNode_()}createEl(){let e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),i=Gs("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(i),this.contentEl_=Gs("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){(this.player_.options_.enableSmoothSeeking||"seeking"!==e.type)&&this.updateContent(e)}updateTextNode_(e=0){e=ba(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let e=this.textNode_;e&&this.contentEl_.firstChild!==e&&(e=null,as.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=tt.createTextNode(this.formattedTime_),this.textNode_&&(e?this.contentEl_.replaceChild(this.textNode_,e):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Mo.prototype.labelText_="Time",Mo.prototype.controlText_="Time",da.registerComponent("TimeDisplay",Mo);class Do extends Mo{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;t=this.player_.ended()?this.player_.duration():e&&e.target&&"function"==typeof e.target.pendingSeekTime&&null!==e.target.pendingSeekTime()?e.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}Do.prototype.labelText_="Current Time",Do.prototype.controlText_="Current Time",da.registerComponent("CurrentTimeDisplay",Do);class Lo extends Mo{constructor(e,t){super(e,t);let i=e=>this.updateContent(e);this.on(e,"durationchange",i),this.on(e,"loadstart",i),this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){let t=this.player_.duration();this.updateTextNode_(t)}}Lo.prototype.labelText_="Duration",Lo.prototype.controlText_="Duration",da.registerComponent("DurationDisplay",Lo),da.registerComponent("TimeDivider",class extends da{createEl(){let e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return t.appendChild(i),e.appendChild(t),e}});class Oo extends Mo{constructor(e,t){super(e,t),this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){let e=super.createEl();return!1!==this.options_.displayNegative&&e.insertBefore(Gs("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if("number"!=typeof this.player_.duration())return;let t;t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t)}}Oo.prototype.labelText_="Remaining Time",Oo.prototype.controlText_="Remaining Time",da.registerComponent("RemainingTimeDisplay",Oo),da.registerComponent("LiveDisplay",class extends da{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){let e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Gs("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Gs("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(tt.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}});class No extends xo{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){let e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=Gs("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function Ro(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}No.prototype.controlText_="Seek to live, currently playing live",da.registerComponent("SeekToLive",No);var Uo=Object.freeze({__proto__:null,clamp:Ro});class Bo extends da{constructor(e,t){super(e,t),this.handleMouseDown_=e=>this.handleMouseDown(e),this.handleMouseUp_=e=>this.handleMouseUp(e),this.handleKeyDown_=e=>this.handleKeyDown(e),this.handleClick_=e=>this.handleClick(e),this.handleMouseMove_=e=>this.handleMouseMove(e),this.update_=e=>this.update(e),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;let e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},i={}){return t.className+=" vjs-slider",t=Object.assign({tabIndex:0},t),i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i),super.createEl(e,t,i)}handleMouseDown(e){let t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"===e.type&&!ws&&e.preventDefault(),an(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){let t=this.bar.el_.ownerDocument;on(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;let e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{let t=this.vertical()?"height":"width";this.bar.el().style[t]=(100*e).toFixed(2)+"%"})),e}getProgress(){return Number(Ro(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){let t=hn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){let t=this.options_.playerOptions.spatialNavigation,i=t&&t.enabled,r=t&&t.horizontalSeek;i?r&&"ArrowLeft"===e.key||!r&&"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&"ArrowRight"===e.key||!r&&"ArrowUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepBack()):"ArrowUp"===e.key||"ArrowRight"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}da.registerComponent("Slider",Bo);const Fo=(e,t)=>Ro(e/t*100,0,100).toFixed(2)+"%";da.registerComponent("LoadProgressBar",class extends da{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",e=>this.update(e))}createEl(){let e=super.createEl("div",{className:"vjs-load-progress"}),t=Gs("span",{className:"vjs-control-text"}),i=Gs("span",{textContent:this.localize("Loaded")}),r=tt.createTextNode(": ");return this.percentageEl_=Gs("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(i),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{let e=this.player_.liveTracker,t=this.player_.buffered(),i=e&&e.isLive()?e.seekableEnd():this.player_.duration(),r=this.player_.bufferedEnd(),s=this.partEls_,n=Fo(r,i);this.percent_!==n&&(this.el_.style.width=n,Xs(this.percentageEl_,n),this.percent_=n);for(let e=0;e<t.length;e++){let i=t.start(e),n=t.end(e),a=s[e];a||(a=this.el_.appendChild(Gs()),s[e]=a),(a.dataset.start!==i||a.dataset.end!==n)&&(a.dataset.start=i,a.dataset.end=n,a.style.left=Fo(i,r),a.style.width=Fo(n-i,r))}for(let e=s.length;e>t.length;e--)this.el_.removeChild(s[e-1]);s.length=t.length})}}),da.registerComponent("TimeTooltip",class extends da{constructor(e,t){super(e,t),this.update=Vn($n(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){let r=un(this.el_),s=ln(this.player_.el()),n=e.width*t;if(!s||!r)return;let a=e.left-s.left+n,o=e.width-n+(s.right-e.right);o||(o=e.width-n,a=n);let l=r.width/2;a<l?l+=l-a:o<l&&(l=o),l<0?l=0:l>r.width&&(l=r.width),l=Math.round(l),this.el_.style.right=`-${l}px`,this.write(i)}write(e){Xs(this.el_,e)}updateTime(e,t,i,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let s,n=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){let e=this.player_.liveTracker.liveWindow(),i=e-t*e;s=(i<1?"":"-")+ba(i,e)}else s=ba(i,n);this.update(e,t,s),r&&r()})}});class qo extends da{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=Vn($n(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,i){let r=this.getChild("timeTooltip");if(!r)return;let s=i&&i.target&&"function"==typeof i.target.pendingSeekTime?i.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,s)}}qo.prototype.options_={children:[]},!Fs&&!Ts&&qo.prototype.options_.children.push("timeTooltip"),da.registerComponent("PlayProgressBar",qo);class jo extends da{constructor(e,t){super(e,t),this.update=Vn($n(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){let i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=e.width*t+"px"})}}jo.prototype.options_={children:["timeTooltip"]},da.registerComponent("MouseTimeDisplay",jo);class Ho extends Bo{constructor(e,t){(t=ms(Ho.prototype.options_,t)).children=[...t.children];let i=e.options_.disableSeekWhileScrubbingOnMobile&&(Fs||Ts)||e.options_.disableSeekWhileScrubbingOnSTV;(!Fs&&!Ts||i)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=$n(this,this.update),this.update=Vn(this.update_,30),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in tt&&"visibilityState"in tt&&this.on(tt,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){"hidden"===tt.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||=this.setInterval(this.update,30)}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||(this.updateInterval&&=(this.clearInterval(this.updateInterval),null))}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if("hidden"===tt.visibilityState)return;let t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{let i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker,s=this.player_.duration();r&&r.isLive()&&(s=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(100*t).toFixed(2)),this.percent_=t),(this.currentTime_!==i||this.duration_!==s)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ba(i,s),ba(s,s)],"{1} of {2}")),this.currentTime_=i,this.duration_=s),this.bar&&this.bar.update(ln(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(void 0!==e)if(null!==e){let t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(null!==this.pendingSeekTime())return this.pendingSeekTime()/this.player_.duration();let e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e}handleMouseDown(e){fn(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!fn(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let i,r=this.calculateDistance(e),s=this.player_.liveTracker;if(s&&s.isLive()){if(r>=.99)return void s.seekToLiveEdge();let e=s.seekableStart(),t=s.liveCurrentTime();if(i=e+r*s.liveWindow(),i>=t&&(i=t),i<=e&&(i=e+.1),i===1/0)return}else i=r*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(i):this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();let e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();let e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Ea(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();let t=null===this.pendingSeekTime()?this.player_.currentTime():this.pendingSeekTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){let t=this.player_.liveTracker;if(" "===e.key||"Enter"===e.key)e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if("Home"===e.key)e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if("End"===e.key)e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();let i=.1*parseInt(e.key,10);t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else"PageDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):"PageUp"===e.key?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in tt&&"visibilityState"in tt&&this.off(tt,"visibilitychange",this.toggleVisibility_),super.dispose()}}Ho.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},da.registerComponent("SeekBar",Ho);class $o extends da{constructor(e,t){super(e,t),this.handleMouseMove=Vn($n(this,this.handleMouseMove),30),this.throttledHandleMouseSeek=Vn($n(this,this.handleMouseSeek),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.handleMouseDownHandler_=e=>this.handleMouseDown(e),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){let t=this.getChild("seekBar");if(!t)return;let i=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!i&&!r)return;let s=t.el(),n=un(s),a=hn(s,e).x;a=Ro(a,0,1),r&&r.update(n,a),i&&i.update(n,t.getProgress())}handleMouseSeek(e){let t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){let e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&Ea(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){let e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){let t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}$o.prototype.options_={children:["seekBar"]},da.registerComponent("ProgressControl",$o);class Vo extends xo{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){tt.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in Te?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof tt.exitPictureInPicture&&super.show()}}Vo.prototype.controlText_="Picture-in-Picture",da.registerComponent("PictureInPictureToggle",Vo);class zo extends xo{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e)),!1===tt[e.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}zo.prototype.controlText_="Fullscreen",da.registerComponent("FullscreenToggle",zo),da.registerComponent("VolumeLevel",class extends da{createEl(){let e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}),da.registerComponent("VolumeLevelTooltip",class extends da{constructor(e,t){super(e,t),this.update=Vn($n(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,i,r){if(!i){let i=ln(this.el_),r=ln(this.player_.el()),s=e.width*t;if(!r||!i)return;let n=e.left-r.left+s,a=e.width-s+(r.right-e.right),o=i.width/2;n<o?o+=o-n:a<o&&(o=a),o<0?o=0:o>i.width&&(o=i.width),this.el_.style.right=`-${o}px`}this.write(`${r}%`)}write(e){Xs(this.el_,e)}updateVolume(e,t,i,r,s){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,r.toFixed(0)),s&&s()})}});class Wo extends da{constructor(e,t){super(e,t),this.update=Vn($n(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){let r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,()=>{i?this.el_.style.bottom=e.height*t+"px":this.el_.style.left=e.width*t+"px"})}}Wo.prototype.options_={children:["volumeLevelTooltip"]},da.registerComponent("MouseVolumeLevelDisplay",Wo);class Go extends Bo{constructor(e,t){super(e,t),this.on("slideractive",e=>this.updateLastVolume_(e)),this.on(e,"volumechange",e=>this.updateARIAAttributes(e)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){fn(e)&&super.handleMouseDown(e)}handleMouseMove(e){let t=this.getChild("mouseVolumeLevelDisplay");if(t){let i=this.el(),r=ln(i),s=this.vertical(),n=hn(i,e);n=s?n.y:n.x,n=Ro(n,0,1),t.update(r,n,s)}fn(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){let t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){let e=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(e)})}}Go.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!Fs&&!Ts&&Go.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Go.prototype.playerEvent="volumechange",da.registerComponent("VolumeBar",Go);class Xo extends da{constructor(e,t={}){t.vertical=t.vertical||!1,(void 0===t.volumeBar||ps(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})}(this,e),this.throttledHandleMouseMove=Vn($n(this,this.handleMouseMove),30),this.handleMouseUpHandler_=e=>this.handleMouseUp(e),this.on("mousedown",e=>this.handleMouseDown(e)),this.on("touchstart",e=>this.handleMouseDown(e)),this.on("mousemove",e=>this.handleMouseMove(e)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){let t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){let t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Xo.prototype.options_={children:["volumeBar"]},da.registerComponent("VolumeControl",Xo);class Ko extends xo{constructor(e,t){super(e,t),function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})}(this,e),this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){let t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){let e=i<.1?.1:i;this.player_.volume(e),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){let e=this.player_.volume(),t=3;this.setIcon("volume-high"),Fs&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Qs(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-${t}`,"")),Ys(this.el_,`vjs-vol-${t}`)}updateControlText_(){let e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)}}Ko.prototype.controlText_="Mute",da.registerComponent("MuteToggle",Ko);class Zo extends da{constructor(e,t={}){t.inline=void 0===t.inline||t.inline,(void 0===t.volumeControl||ps(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=e=>this.handleKeyPress(e),this.on(e,["loadstart"],e=>this.volumePanelState_(e)),this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e)),this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e)),this.on("keydown",e=>this.handleKeyPress(e)),this.on("mouseover",e=>this.handleMouseOver(e)),this.on("mouseout",e=>this.handleMouseOut(e)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){"Escape"===e.key&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Un(tt,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Bn(tt,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){"Escape"===e.key&&this.handleMouseOut()}}Zo.prototype.options_={children:["muteToggle","volumeControl"]},da.registerComponent("VolumePanel",Zo);class Yo extends xo{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;let t,i=this.player_.currentTime(),r=this.player_.liveTracker,s=r&&r.isLive()?r.seekableEnd():this.player_.duration();t=i+this.skipTime<=s?i+this.skipTime:s,this.player_.currentTime(t)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Yo.prototype.controlText_="Skip Forward",da.registerComponent("SkipForward",Yo);class Qo extends xo{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){let e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){let t,i=this.player_.currentTime(),r=this.player_.liveTracker,s=r&&r.isLive()&&r.seekableStart();t=s&&i-this.skipTime<=s?s:i>=this.skipTime?i-this.skipTime:0,this.player_.currentTime(t)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Qo.prototype.controlText_="Skip Backward",da.registerComponent("SkipBackward",Qo);class Jo extends da{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",e=>this.handleKeyDown(e)),this.boundHandleBlur_=e=>this.handleBlur(e),this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){e instanceof da&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof da&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){"string"==typeof e&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){let t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){let e=this.options_.contentElType||"ul";this.contentEl_=Gs(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");let t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Un(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){let t=e.relatedTarget||tt.activeElement;if(!this.children().some(e=>e.el()===t)){let e=this.menuButton_;e&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();let t=this.children();if(!Array.isArray(t))return;let i=t.filter(t=>t.el()===e.target)[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(e){"ArrowLeft"===e.key||"ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),this.stepForward()):("ArrowRight"===e.key||"ArrowUp"===e.key)&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){let t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}da.registerComponent("Menu",Jo);class el extends da{constructor(e,t={}){super(e,t),this.menuButton_=new xo(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");let i=xo.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;let r=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Un(tt,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",e=>this.handleMouseLeave(e)),this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){let e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){let e=new Jo(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){let t=Gs("li",{className:"vjs-menu-title",textContent:la(this.options_.title),tabIndex:-1}),i=new da(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){return super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${xo.prototype.buildCSSClass()} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return!0===this.options_.inline?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),Bn(tt,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){"Escape"===e.key||"Tab"===e.key?(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus())):("Up"===e.key||"Down"===e.key&&(!this.player_.options_.playerOptions.spatialNavigation||!this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){("Escape"===e.key||"Tab"===e.key)&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){("Escape"===e.key||"Tab"===e.key)&&(this.buttonPressed_&&this.unpressButton(),"Tab"===!e.key&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Fs&&zs())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}da.registerComponent("MenuButton",el);class tl extends el{constructor(e,t){let i=t.tracks;super(e,t),this.items.length<=1&&this.hide(),i&&(this.updateHandler_=$n(this,this.update),this.cleanupHandler_=$n(this,this.cleanupTrackListeners_),i.addEventListener("removetrack",this.updateHandler_),i.addEventListener("addtrack",this.updateHandler_),i.addEventListener("labelchange",this.updateHandler_),this.player_.on("ready",this.updateHandler_),this.player_.on("dispose",this.cleanupHandler_))}cleanupTrackListeners_(){if(!this.updateHandler_)return;let e=this.options_.tracks;e&&(e.removeEventListener("removetrack",this.updateHandler_),e.removeEventListener("addtrack",this.updateHandler_),e.removeEventListener("labelchange",this.updateHandler_)),this.player_&&(this.player_.off("ready",this.updateHandler_),this.player_.off("dispose",this.cleanupHandler_)),this.updateHandler_=null,this.cleanupHandler_=null}dispose(){this.cleanupTrackListeners_(),super.dispose()}}da.registerComponent("TrackButton",tl);class il extends vo{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,i){this.nonIconControl=!0;let r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),i),s=Gs("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(s):r.replaceChild(s,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}da.registerComponent("MenuItem",il);class rl extends il{constructor(e,t){let i=t.track,r=e.textTracks();t.label=i.label||i.language||"Unknown",t.selected="showing"===i.mode,super(e,t),this.track=i,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);let s=(...e)=>{this.handleTracksChange.apply(this,e)},n=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};if(e.on(["loadstart","texttrackchange"],s),r.addEventListener("change",s),r.addEventListener("selectedlanguagechange",n),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],s),r.removeEventListener("change",s),r.removeEventListener("selectedlanguagechange",n)}),void 0===r.onchange){let e;this.on(["tap","click"],function(){if("object"!=typeof Te.Event)try{e=new Te.Event("change")}catch{}e||(e=tt.createEvent("Event"),e.initEvent("change",!0,!0)),r.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){let t=this.track,i=this.player_.textTracks();if(super.handleClick(e),i)for(let e=0;e<i.length;e++){let r=i[e];-1!==this.kinds.indexOf(r.kind)&&(r===t?"showing"!==r.mode&&(r.mode="showing"):"disabled"!==r.mode&&(r.mode="disabled"))}}handleTracksChange(e){let t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if("showing"===this.track.mode){let e=this.player_.cache_.selectedLanguage;if(e&&e.enabled&&e.language===this.track.language&&e.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}da.registerComponent("TextTrackMenuItem",rl);class sl extends rl{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||=[t.kind],t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){let t=this.player().textTracks(),i=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(this.options_.kinds.indexOf(r.kind)>-1&&"showing"===r.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(e){let t=this.player().textTracks(),i=!0;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(["captions","descriptions","subtitles"].indexOf(r.kind)>-1&&"showing"===r.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}da.registerComponent("OffTextTrackMenuItem",sl);class nl extends tl{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=rl){let i;this.label_&&(i=`${this.label_} off`),e.push(new sl(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;let r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let i=0;i<r.length;i++){let s=r[i];if(this.kinds_.indexOf(s.kind)>-1){let i=new t(this.player_,{track:s,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});i.addClass(`vjs-${s.kind}-menu-item`),e.push(i)}}return e}}da.registerComponent("TextTrackButton",nl);class al extends il{constructor(e,t){let i=t.track,r=t.cue,s=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=s&&s<r.endTime,super(e,t),this.track=i,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}da.registerComponent("ChaptersTrackMenuItem",al);class ol extends nl{constructor(e,t,i){super(e,t,i),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&"chapters"!==e.track.kind)return;let t=this.findChaptersTrack();t===this.track_?(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update():(this.setTrack(t),super.update())}setTrack(e){if(this.track_!==e){if(this.updateHandler_||=this.update.bind(this),this.track_){let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";let e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);e&&e.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){let e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){let i=e[t];if(i.kind===this.kind_)return i}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(la(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){let e=[];if(!this.track_)return e;let t=this.track_.cues;if(!t)return e;for(let i=0,r=t.length;i<r;i++){let r=t[i],s=new al(this.player_,{track:this.track_,cue:r});e.push(s)}return e}}ol.prototype.kind_="chapters",ol.prototype.controlText_="Chapters",da.registerComponent("ChaptersButton",ol);class ll extends nl{constructor(e,t,i){super(e,t,i),this.setIcon("audio-description");let r=e.textTracks(),s=$n(this,this.handleTracksChange);r.addEventListener("change",s),this.on("dispose",function(){r.removeEventListener("change",s)})}handleTracksChange(e){let t=this.player().textTracks(),i=!1;for(let e=0,r=t.length;e<r;e++){let r=t[e];if(r.kind!==this.kind_&&"showing"===r.mode){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}ll.prototype.kind_="descriptions",ll.prototype.controlText_="Descriptions",da.registerComponent("DescriptionsButton",ll);class ul extends nl{constructor(e,t,i){super(e,t,i),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}ul.prototype.kind_="subtitles",ul.prototype.controlText_="Subtitles",da.registerComponent("SubtitlesButton",ul);class hl extends rl{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}da.registerComponent("CaptionSettingsMenuItem",hl);class dl extends nl{constructor(e,t,i){super(e,t,i),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new hl(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}dl.prototype.kind_="captions",dl.prototype.controlText_="Captions",da.registerComponent("CaptionsButton",dl);class cl extends rl{createEl(e,t,i){let r=super.createEl(e,t,i),s=r.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):s.appendChild(Gs("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(Gs("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}da.registerComponent("SubsCapsMenuItem",cl);class pl extends nl{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(la(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new hl(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,cl),e}}pl.prototype.kinds_=["captions","subtitles"],pl.prototype.controlText_="Subtitles",da.registerComponent("SubsCapsButton",pl);class ml extends il{constructor(e,t){let i=t.track,r=e.audioTracks();t.label=i.label||i.language||"Unknown",t.selected=i.enabled,super(e,t),this.track=i,this.addClass(`vjs-${i.kind}-menu-item`);let s=(...e)=>{this.handleTracksChange.apply(this,e)};r.addEventListener("change",s),this.on("dispose",()=>{r.removeEventListener("change",s)})}createEl(e,t,i){let r=super.createEl(e,t,i),s=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions","description"].indexOf(this.options_.track.kind)>=0&&(s.appendChild(Gs("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(Gs("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){let e=this.player_.audioTracks();for(let t=0;t<e.length;t++){let i=e[t];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}da.registerComponent("AudioTrackMenuItem",ml);class gl extends tl{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;let t=this.player_.audioTracks();for(let i=0;i<t.length;i++){let r=t[i];e.push(new ml(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}gl.prototype.controlText_="Audio Track",da.registerComponent("AudioTrackButton",gl);class fl extends il{constructor(e,t){let i=t.rate,r=parseFloat(i,10);t.label=i,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=i,this.rate=r,this.on(e,"ratechange",e=>this.update(e))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}fl.prototype.contentElType="button",da.registerComponent("PlaybackRateMenuItem",fl);class yl extends el{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",e=>this.updateVisibility(e)),this.on(e,"ratechange",e=>this.updateLabel(e)),this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){let e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=Gs("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){let e=this.playbackRates(),t=[];for(let i=e.length-1;i>=0;i--)t.push(new fl(this.player(),{rate:e[i]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){let e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}yl.prototype.controlText_="Playback Rate",da.registerComponent("PlaybackRateMenuButton",yl);class _l extends da{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){return t.className||=this.buildCSSClass(),super.createEl(e,t,i)}}da.registerComponent("Spacer",_l),da.registerComponent("CustomControlSpacer",class extends _l{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}});class bl extends da{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}bl.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},da.registerComponent("ControlBar",bl);class vl extends xa{constructor(e,t){super(e,t),this.on(e,"error",e=>{this.open(e)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){let e=this.player().error();return e?this.localize(e.message):""}}vl.prototype.options_=Object.assign({},xa.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),da.registerComponent("ErrorDisplay",vl);class Tl extends da{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),Gs("select",{id:this.options_.id},{},this.options_.SelectOptions.map(e=>{let t=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Dn()}`)+"-"+e[1].replace(/\W+/g,""),i=Gs("option",{id:t,value:this.localize(e[0]),textContent:this.localize(e[1])});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${t}`),i}))}}da.registerComponent("TextTrackSelect",Tl);class Sl extends da{constructor(e,t={}){super(e,t);let i=Gs("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(i);let r=this.options_.selects;for(let t of r){let i=this.options_.selectConfigs[t],r=i.className,s=i.id.replace("%s",this.options_.id_),n=null,a=`vjs_select_${Dn()}`;if("colors"===this.options_.type){n=Gs("span",{className:r});let e=Gs("label",{id:s,className:"vjs-label",textContent:this.localize(i.label)});e.setAttribute("for",a),n.appendChild(e)}let o=new Tl(e,{SelectOptions:i.options,legendId:this.options_.legendId,id:a,labelId:s});this.addChild(o),"colors"===this.options_.type&&(n.appendChild(o.el()),this.el().appendChild(n))}}createEl(){return Gs("fieldset",{className:this.options_.className})}}da.registerComponent("TextTrackFieldset",Sl);class Cl extends da{constructor(e,t={}){super(e,t);let i=this.options_.textTrackComponentid,r=new Sl(e,{id_:i,legendId:`captions-text-legend-${i}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);let s=new Sl(e,{id_:i,legendId:`captions-background-${i}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);let n=new Sl(e,{id_:i,legendId:`captions-window-${i}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(n)}createEl(){return Gs("div",{className:"vjs-track-settings-colors"})}}da.registerComponent("TextTrackSettingsColors",Cl);class El extends da{constructor(e,t={}){super(e,t);let i=this.options_.textTrackComponentid,r=new Sl(e,{id_:i,legendId:`captions-font-size-${i}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);let s=new Sl(e,{id_:i,legendId:`captions-edge-style-${i}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);let n=new Sl(e,{id_:i,legendId:`captions-font-family-${i}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(n)}createEl(){return Gs("div",{className:"vjs-track-settings-font"})}}da.registerComponent("TextTrackSettingsFont",El);class wl extends da{constructor(e,t={}){super(e,t);let i=new xo(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);let r=this.localize("Done"),s=new xo(e,{controlText:r,className:"vjs-done-button"});s.el().classList.remove("vjs-control","vjs-button"),s.el().textContent=r,this.addChild(s)}createEl(){return Gs("div",{className:"vjs-track-settings-controls"})}}da.registerComponent("TrackSettingsControls",wl);const kl="vjs-text-track-settings",Il=["#000","Black"],xl=["#00F","Blue"],Al=["#0FF","Cyan"],Pl=["#0F0","Green"],Ml=["#F0F","Magenta"],Dl=["#F00","Red"],Ll=["#FFF","White"],Ol=["#FF0","Yellow"],Nl=["1","Opaque"],Rl=["0.5","Semi-Transparent"],Ul=["0","Transparent"],Bl={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Il,Ll,Dl,Pl,xl,Ol,Ml,Al],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Nl,Rl,Ul],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ll,Il,Dl,Pl,xl,Ol,Ml,Al],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>"1.00"===e?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Nl,Rl],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Ul,Rl,Nl],className:"vjs-window-opacity vjs-opacity"}};function Fl(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}Bl.windowColor.options=Bl.backgroundColor.options,da.registerComponent("TextTrackSettings",class extends xa{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=Gs("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===t.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){let t=new Cl(e,{textTrackComponentid:this.id_,selectConfigs:Bl,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);let i=new El(e,{textTrackComponentid:this.id_,selectConfigs:Bl,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);let r=new wl(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),hs(Bl,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return ds(Bl,(e,t,i)=>{let r=function(e,t){return Fl(e.options[e.options.selectedIndex].value,t)}(this.$(t.selector),t.parser);return void 0!==r&&(e[i]=r),e},{})}setValues(e){hs(Bl,(t,i)=>{!function(e,t,i){if(t)for(let r=0;r<e.options.length;r++)if(Fl(e.options[r].value,i)===t){e.selectedIndex=r;break}}(this.$(t.selector),e[i],t.parser)})}setDefaults(){hs(Bl,e=>{let t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(Te.localStorage.getItem(kl))}catch(e){as.warn(e)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;let e=this.getValues();try{Object.keys(e).length?Te.localStorage.setItem(kl,JSON.stringify(e)):Te.localStorage.removeItem(kl)}catch(e){as.warn(e)}}updateDisplay(){let e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}),da.registerComponent("ResizeManager",class extends da{constructor(e,t){let i=t.ResizeObserver||Te.ResizeObserver;null===t.ResizeObserver&&(i=!1),super(e,ms({createEl:!i,reportTouchActivity:!1},t)),this.ResizeObserver=t.ResizeObserver||Te.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=zn(()=>{this.resizeHandler()},100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;let e=this.debouncedHandler_,t=this.unloadListener_=function(){Bn(this,"resize",e),Bn(this,"unload",t),t=null};Un(this.el_.contentWindow,"unload",t),Un(this.el_.contentWindow,"resize",e)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const ql={trackingThreshold:20,liveTolerance:15};da.registerComponent("LiveTracker",class extends da{constructor(e,t){super(e,ms(ql,t,{createEl:!1})),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=e=>this.handlePlay(e),this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e),this.handleSeeked_=e=>this.handleSeeked(e),this.seekToLiveEdge_=e=>this.seekToLiveEdge(e),this.reset_(),this.on(this.player_,"durationchange",e=>this.handleDurationchange(e)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){let e=this.player_.seekable();if(!e||!e.length)return;let t=Number(Te.performance.now().toFixed(4)),i=-1===this.lastTime_?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+i;let r=this.liveCurrentTime(),s=this.player_.currentTime(),n=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-s)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(n=!1),n!==this.behindLiveEdge_&&(this.behindLiveEdge_=n,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||=this.player_.hasStarted(),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){let e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){let e=this.player_.seekable(),t=[],i=e?e.length:0;for(;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){let e=this.player_.seekable(),t=[],i=e?e.length:0;for(;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0}liveWindow(){let e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){let e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}),da.registerComponent("TitleBar",class extends da{constructor(e,t){super(e,t),this.on("statechanged",e=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:Gs("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Dn()}`}),description:Gs("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Dn()}`})},Gs("div",{className:"vjs-title-bar"},{},gs(this.els))}updateDom_(){let e=this.player_.tech_,t=e&&e.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{let r=this.state[e],s=this.els[e],n=i[e];cn(s),r&&Xs(s,r),t&&(t.removeAttribute(n),r&&t.setAttribute(n,s.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){let e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const jl={initialDisplay:4e3,position:[],takeFocus:!1};da.registerComponent("TransientButton",class extends xo{constructor(e,t){super(e,t=ms(jl,t)),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],e=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){let e=Gs("button",{},{type:"button",class:this.buildCSSClass()},Gs("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}});const Hl=e=>{let t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;let i=e.$$("source"),r=[],s="";if(!i.length)return!1;for(let e=0;e<i.length;e++){let t=i[e].src;t&&-1===r.indexOf(t)&&r.push(t)}return!!r.length&&(1===r.length&&(s=r[0]),e.triggerSourceset(s),!0)},$l=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(e){let t=tt.createElement(this.nodeName.toLowerCase());t.innerHTML=e;let i=tt.createDocumentFragment();for(;t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",Te.Element.prototype.appendChild.call(this,i),this.innerHTML}}),Vl=(e,t)=>{let i={};for(let r=0;r<e.length&&(i=Object.getOwnPropertyDescriptor(e[r],t),!(i&&i.set&&i.get));r++);return i.enumerable=!0,i.configurable=!0,i},zl=function(e){let t=e.el();if(t.resetSourceWatch_)return;let i={},r=(e=>Vl([e.el(),Te.HTMLMediaElement.prototype,Te.Element.prototype,$l],"innerHTML"))(e),s=i=>(...r)=>{let s=i.apply(t,r);return Hl(e),s};["append","appendChild","insertAdjacentHTML"].forEach(e=>{t[e]&&(i[e]=t[e],t[e]=s(i[e]))}),Object.defineProperty(t,"innerHTML",ms(r,{set:s(r.set)})),t.resetSourceWatch_=()=>{t.resetSourceWatch_=null,Object.keys(i).forEach(e=>{t[e]=i[e]}),Object.defineProperty(t,"innerHTML",r)},e.one("sourceset",t.resetSourceWatch_)},Wl=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Ha(Te.Element.prototype.getAttribute.call(this,"src")):""},set(e){return Te.Element.prototype.setAttribute.call(this,"src",e),e}});class Gl extends to{constructor(e,t){super(e,t);let i=e.source,r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||e.tag&&3===e.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){let e=this.el_.childNodes,t=e.length,i=[];for(;t--;){let s=e[t];"track"===s.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(s),this.remoteTextTracks().addTrack(s.track),this.textTracks().addTrack(s.track),!r&&!this.el_.hasAttribute("crossorigin")&&Va(s.src)&&(r=!0)):i.push(s))}for(let e=0;e<i.length;e++)this.el_.removeChild(i[e])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&as.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(Us||Ls)&&!0===e.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),Gl.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){!function(e){if(!e.featuresSourceset)return;let t=e.el();if(t.resetSourceset_)return;let i=(e=>Vl([e.el(),Te.HTMLMediaElement.prototype,Wl],"src"))(e),r=t.setAttribute,s=t.load;Object.defineProperty(t,"src",ms(i,{set:r=>{let s=i.set.call(t,r);return e.triggerSourceset(t.src),s}})),t.setAttribute=(i,s)=>{let n=r.call(t,i,s);return/src/i.test(i)&&e.triggerSourceset(t.src),n},t.load=()=>{let i=s.call(t);return Hl(e)||(e.triggerSourceset(""),zl(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):Hl(e)||zl(e),t.resetSourceset_=()=>{t.resetSourceset_=null,t.load=s,t.setAttribute=r,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}}(this)}restoreMetadataTracksInIOSNativePlayer_(){let e,t=this.textTracks(),i=()=>{e=[];for(let i=0;i<t.length;i++){let r=t[i];"metadata"===r.kind&&e.push({track:r,storedMode:r.mode})}};i(),t.addEventListener("change",i),this.on("dispose",()=>t.removeEventListener("change",i));let r=()=>{for(let t=0;t<e.length;t++){let i=e[t];"disabled"===i.track.mode&&i.track.mode!==i.storedMode&&(i.track.mode=i.storedMode)}t.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{t.removeEventListener("change",i),t.removeEventListener("change",r),t.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{t.removeEventListener("change",i),t.addEventListener("change",i),t.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;let i=e.toLowerCase();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach(e=>{this.el()[`${i}Tracks`].removeEventListener(e,this[`${i}TracksListeners_`][e])}),this[`featuresNative${e}Tracks`]=!t,this[`${i}TracksListeners_`]=null,this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){let t=Qa[e],i=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!i||!i.addEventListener)return;let s={change:t=>{let i={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(i),"text"===e&&this[Ja.remoteText.getterName]().trigger(i)},addtrack(e){r.addTrack(e.track)},removetrack(e){r.removeTrack(e.track)}},n=function(){let e=[];for(let t=0;t<r.length;t++){let s=!1;for(let e=0;e<i.length;e++)if(i[e]===r[t]){s=!0;break}s||e.push(r[t])}for(;e.length;)r.removeTrack(e.shift())};this[t.getterName+"Listeners_"]=s,Object.keys(s).forEach(e=>{let t=s[e];i.addEventListener(e,t),this.on("dispose",r=>i.removeEventListener(e,t))}),this.on("loadstart",n),this.on("dispose",e=>this.off("loadstart",n))}proxyNativeTracks_(){Qa.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){let t=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(t,e),Gl.disposeMediaElement(e),e=t}else{e=tt.createElement("video");let t=ms({},this.options_.tag&&tn(this.options_.tag));(!Us||!0!==this.options_.nativeControlsForTouch)&&delete t.controls,en(e,Object.assign(t,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}void 0!==this.options_.preload&&sn(e,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);let t=["loop","muted","playsinline","autoplay"];for(let i=0;i<t.length;i++){let r=t[i],s=this.options_[r];void 0!==s&&(s?sn(e,r,r):nn(e,r),e[r]=s)}return e}handleLateInit_(e){if(0===e.networkState||3===e.networkState)return;if(0===e.readyState){let e=!1,t=function(){e=!0};this.on("loadstart",t);let i=function(){e||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready(function(){this.off("loadstart",t),this.off("loadedmetadata",i),e||this.trigger("loadstart")})}let t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&qs?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){as(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Ts&&ws&&0===this.el_.currentTime){let e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;let e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){let e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)Ea(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(void 0===e)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return as.error("Invalid source URL."),!1;let i={src:e};t&&(i.type=t);let r=Gs("source",{},i);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return as.error("Source URL is required to remove the source element."),!1;let t=this.el_.querySelectorAll("source");for(let i of t)if(i.src===e)return this.el_.removeChild(i),!0;return as.warn(`No matching source element found with src: ${e}`),!1}reset(){Gl.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,i):super.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);let t=tt.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){let i=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){let t=this.$$("track"),i=t.length;for(;i--;)(e===t[i]||e===t[i].track)&&this.el().removeChild(t[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();let e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),Te.performance&&(e.creationTime=Te.performance.now()),e}}fs(Gl,"TEST_VID",function(){if(!$s())return;let e=tt.createElement("video"),t=tt.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}),Gl.isSupported=function(){try{Gl.TEST_VID.volume=.5}catch{return!1}return!(!Gl.TEST_VID||!Gl.TEST_VID.canPlayType)},Gl.canPlayType=function(e){return Gl.TEST_VID.canPlayType(e)},Gl.canPlaySource=function(e,t){return Gl.canPlayType(e.type)},Gl.canControlVolume=function(){try{let e=Gl.TEST_VID.volume;Gl.TEST_VID.volume=e/2+.1;let t=e!==Gl.TEST_VID.volume;return t&&Fs?(Te.setTimeout(()=>{Gl&&Gl.prototype&&(Gl.prototype.featuresVolumeControl=e!==Gl.TEST_VID.volume)}),!1):t}catch{return!1}},Gl.canMuteVolume=function(){try{let e=Gl.TEST_VID.muted;return Gl.TEST_VID.muted=!e,Gl.TEST_VID.muted?sn(Gl.TEST_VID,"muted","muted"):nn(Gl.TEST_VID,"muted"),e!==Gl.TEST_VID.muted}catch{return!1}},Gl.canControlPlaybackRate=function(){if(Ts&&ws&&Is<58)return!1;try{let e=Gl.TEST_VID.playbackRate;return Gl.TEST_VID.playbackRate=e/2+.1,e!==Gl.TEST_VID.playbackRate}catch{return!1}},Gl.canOverrideAttributes=function(){try{let e=()=>{};Object.defineProperty(tt.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(tt.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(tt.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(tt.createElement("audio"),"innerHTML",{get:e,set:e})}catch{return!1}return!0},Gl.supportsNativeTextTracks=function(){return qs||Fs&&ws},Gl.supportsNativeVideoTracks=function(){return!(!Gl.TEST_VID||!Gl.TEST_VID.videoTracks)},Gl.supportsNativeAudioTracks=function(){return!(!Gl.TEST_VID||!Gl.TEST_VID.audioTracks)},Gl.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([e,t]){fs(Gl.prototype,e,()=>Gl[t](),!0)}),Gl.prototype.featuresVolumeControl=Gl.canControlVolume(),Gl.prototype.movingMediaElementInDOM=!Fs,Gl.prototype.featuresFullscreenResize=!0,Gl.prototype.featuresProgressEvents=!0,Gl.prototype.featuresTimeupdateEvents=!0,Gl.prototype.featuresVideoFrameCallback=!(!Gl.TEST_VID||!Gl.TEST_VID.requestVideoFrameCallback),Gl.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch{}}()}},Gl.resetMediaElement=function(e){if(!e)return;let t=e.querySelectorAll("source"),i=t.length;for(;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch{}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){Gl.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){Gl.prototype["set"+la(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){Gl.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){Gl.prototype["set"+la(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){Gl.prototype[e]=function(){return this.el_[e]()}}),to.withSourceHandlers(Gl),Gl.nativeSourceHandler={},Gl.nativeSourceHandler.canPlayType=function(e){try{return Gl.TEST_VID.canPlayType(e)}catch{return""}},Gl.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Gl.nativeSourceHandler.canPlayType(e.type);if(e.src){let t=$a(e.src);return Gl.nativeSourceHandler.canPlayType(`video/${t}`)}return""},Gl.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},Gl.nativeSourceHandler.dispose=function(){},Gl.registerSourceHandler(Gl.nativeSourceHandler),to.registerTech("Html5",Gl);const Xl=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Kl={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Zl=["tiny","xsmall","small","medium","large","xlarge","huge"],Yl={};Zl.forEach(e=>{let t="x"===e.charAt(0)?`x-${e.substring(1)}`:e;Yl[e]=`vjs-layout-${t}`});const Ql={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Jl extends da{constructor(e,t,i){if(e.id=e.id||t.id||`vjs_video_${Dn()}`,(t=Object.assign(Jl.getTagSettings(e),t)).initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){let i=e.closest("[lang]");i&&(t.language=i.getAttribute("lang"))}if(super(null,t,i),this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e),this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e),this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e),this.boundApplyInitTime_=e=>this.applyInitTime_(e),this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e),this.boundHandleTechClick_=e=>this.handleTechClick_(e),this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e),this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e),this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e),this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e),this.boundHandleTechTap_=e=>this.handleTechTap_(e),this.boundUpdatePlayerHeightOnAudioOnlyMode_=e=>this.updatePlayerHeightOnAudioOnlyMode_(e),this.isFullscreen_=!1,this.log=os(this.id_),this.fsApi_=ts,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&tn(e),this.language(this.options_.language),t.languages){let e={};Object.getOwnPropertyNames(t.languages).forEach(function(i){e[i.toLowerCase()]=t.languages[i]}),this.languages_=e}else this.languages_=Jl.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(e=>{if("function"!=typeof this[e])throw Error(`plugin "${e}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),sa(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Un(tt,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);let r=ms(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){let e=(new Te.DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <defs>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play">\n <path d="M16 10v28l22-14z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-pause">\n <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-audio">\n <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-captions">\n <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">\n <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">\n <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">\n <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">\n <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">\n <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">\n <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">\n <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">\n <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>\n </symbol>\n <symbol viewBox="0 0 24 24" id="vjs-icon-hd">\n <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">\n <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>\n </symbol>\n <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">\n <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">\n <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">\n <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">\n <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-share">\n <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cog">\n <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-square">\n <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle">\n <circle cx="24" cy="24" r="20"></circle>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">\n <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">\n <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-replay">\n <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">\n <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">\n <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">\n <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">\n <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">\n <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">\n <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>\n </symbol>\n <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">\n <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>\n </symbol>\n <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">\n <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">\n <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">\n <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">\n <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-cast">\n <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>\n </symbol>\n <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">\n <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>\n </symbol>\n <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">\n <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>\n <path fill="none" d="M-1-3h24v24H-1z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">\n <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">\n <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>\n </symbol>\n <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">\n <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">\n <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>\n </symbol>\n <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">\n <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>\n </symbol>\n </defs>\n</svg>',"image/svg+xml");if(e.querySelector("parsererror"))as.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{let t=e.documentElement;t.style.display="none",this.el_.appendChild(t),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===e.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new bo(this),this.addClass("vjs-spatial-navigation-enabled")),Us&&this.addClass("vjs-touch-enabled"),Fs||this.addClass("vjs-workinghover"),Jl.players[this.id_]=this;let s=Yr.split(".")[0];this.addClass(`vjs-v${s}`),this.userActive(!0),this.reportUserActivity(),this.one("play",e=>this.listenForUserActivity_(e)),this.on("keydown",e=>this.handleKeyDown(e)),this.on("languagechange",e=>this.handleLanguagechange(e)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Bn(tt,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Bn(tt,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Jl.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&=null,this.tag&&=null,function(e){ro.hasOwnProperty(e.id())&&delete ro[e.id()]}(this),eo.names.forEach(e=>{let t=this[eo[e].getterName]();t&&t.off&&t.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e,t=this.tag,i=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();i?e=this.el_=t.parentNode:r||(e=this.el_=super.createEl("div"));let s=tn(t);if(r){for(e=this.el_=t,t=this.tag=tt.createElement("video");e.children.length;)t.appendChild(e.firstChild);Zs(e,"video-js")||Ys(e,"video-js"),e.appendChild(t),i=this.playerElIngest_=e,Object.keys(e).forEach(i=>{try{t[i]=e[i]}catch{}})}t.setAttribute("tabindex","-1"),s.tabindex="-1",ws&&Ms&&(t.setAttribute("role","application"),s.role="application"),t.removeAttribute("width"),t.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach(function(i){r&&"class"===i||e.setAttribute(i,s[i]),r&&t.setAttribute(i,s[i])}),t.playerId=t.id,t.id+="_html5_api",t.className="vjs-tech",t.player=e.player=this,this.addClass("vjs-paused");let n=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(e=>js[e]).map(e=>"vjs-device-"+e.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...n),!0!==Te.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=In("vjs-styles-dimensions");let e=yn(".vjs-styles-defaults"),t=yn("head");t.insertBefore(this.styleEl_,e?e.nextSibling:t.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);let a=t.getElementsByTagName("a");for(let e=0;e<a.length;e++){let t=a.item(e);Ys(t,"vjs-hidden"),t.setAttribute("hidden","hidden")}return t.initNetworkState_=t.networkState,t.parentNode&&!i&&t.parentNode.insertBefore(e,t),Ks(t,e),this.children_.unshift(t),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=e,e}crossOrigin(e){if(void 0===e)return this.techGet_("crossOrigin");null!==e&&"anonymous"!==e&&"use-credentials"!==e?as.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`):(this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e))}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){let i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();let r=parseFloat(t);isNaN(r)?as.error(`Improper value "${t}" supplied for for ${e}`):(this[i]=r,this.updateStyleEl_())}fluid(e){if(void 0===e)return!!this.fluid_;this.fluid_=!!e,Zn(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),((e,t)=>{Zn(e)?t():(e.eventedCallbacks||=[],e.eventedCallbacks.push(t))})(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===Te.VIDEOJS_NO_DYNAMIC_STYLE){let e="number"==typeof this.width_?this.width_:this.options_.width,t="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();return void(i&&(e>=0&&(i.width=e),t>=0&&(i.height=t)))}let e,t,i,r;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";let s=i.split(":"),n=s[1]/s[0];e=void 0===this.width_?void 0===this.height_?this.videoWidth()||300:this.height_/n:this.width_,t=void 0===this.height_?e*n:this.height_,r=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(r),xn(this.styleEl_,`\n .${r} {\n width: ${e}px;\n height: ${t}px;\n }\n\n .${r}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*n}%;\n }\n `)}loadTech_(e,t){this.tech_&&this.unloadTech_();let i=la(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==i&&this.tag&&(to.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let s=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(s=!1);let n={source:t,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};eo.names.forEach(e=>{let t=eo[e];n[t.getterName]=this[t.privateName]}),Object.assign(n,this.options_[i]),Object.assign(n,this.options_[r]),Object.assign(n,this.options_[e.toLowerCase()]),this.tag&&(n.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(n.startTime=this.cache_.currentTime);let a=to.getTech(e);if(!a)throw Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);this.tech_=new a(n),this.tech_.ready($n(this,this.handleTechReady_),!0),function(e,t){e.forEach(function(e){let i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(e=>i.addCue(e))}),t.textTracks()}(this.textTracksJson_||[],this.tech_),Xl.forEach(e=>{this.on(this.tech_,e,t=>this[`handleTech${la(e)}_`](t))}),Object.keys(Kl).forEach(e=>{this.on(this.tech_,e,t=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${Kl[e]}_`].bind(this),event:t}):this[`handleTech${Kl[e]}_`](t)})}),this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e)),this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e)),this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e)),this.on(this.tech_,"ended",e=>this.handleTechEnded_(e)),this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e)),this.on(this.tech_,"play",e=>this.handleTechPlay_(e)),this.on(this.tech_,"pause",e=>this.handleTechPause_(e)),this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e)),this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t)),this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t)),this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e)),this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e)),this.on(this.tech_,"error",e=>this.handleTechError_(e)),this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e)),this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e)),this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&("Html5"!==i||!this.tag)&&Ks(this.tech_.el(),this.el()),this.tag&&=(this.tag.player=null,null)}unloadTech_(){eo.names.forEach(e=>{let t=eo[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=function(e){let t=e.$$("track"),i=Array.prototype.map.call(t,e=>e.track);return Array.prototype.map.call(t,function(e){let t=wa(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===i.indexOf(e)}).map(wa))}(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return void 0===e&&as.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":Yr}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()&&this.hasStarted(!1),this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||"string"!=typeof e)return;let t,i=()=>{let e=this.muted();this.muted(!0);let t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);let i=this.play();if(Ca(i))return i.catch(e=>{throw t(),Error(`Rejection at manualAutoplay. Restoring muted value. ${e||""}`)})};return"any"!==e||this.muted()?t="muted"!==e||this.muted()?this.play():i():(t=this.play(),Ca(t)&&(t=t.catch(i))),Ca(t)?t.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})}):void 0}updateSourceCaches_(e=""){let t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=((e,t)=>{if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;let i=e.cache_.sources.filter(e=>e.src===t);if(i.length)return i[0].type;let r=e.$$("source");for(let e=0;e<r.length;e++){let i=r[e];if(i.type&&i.src&&i.src===t)return i.type}return mo(t)})(this,t)),this.cache_.source=ms({},e,{src:t,type:i});let r=this.cache_.sources.filter(e=>e.src&&e.src===t),s=[],n=this.$$("source"),a=[];for(let e=0;e<n.length;e++){let i=tn(n[e]);s.push(i),i.src&&i.src===t&&a.push(i.src)}a.length&&!r.length?this.cache_.sources=s:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=e=>this.updateSourceCaches_(e),i=this.currentSource().src,r=e.src;i&&!/^blob:/.test(i)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==i)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],e=>{if("sourceset"===e.type)return;let t=this.techGet_("currentSrc");this.lastSource_.tech=t,this.updateSourceCaches_(t)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");let e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.click||!1!==this.options_.userActions.click)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?Ea(this.play()):this.pause())}handleTechDoubleClick_(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),t=>t.contains(e.target))||(void 0===this.options_||void 0===this.options_.userActions||void 0===this.options_.userActions.doubleClick||!1!==this.options_.userActions.doubleClick)&&(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!tt.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){let t=e.target.player;if(t&&t!==this)return;let i=this.el(),r=tt[this.fsApi_.fullscreenElement]===i;!r&&i.matches&&(r=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){let e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in lo)return function(e,t,i,r){return t[i](e.reduce(ho(i),r))}(this.middleware_,this.tech_,e,t);if(e in uo)return ao(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw as(e),e}},!0)}techGet_(e){if(this.tech_&&this.tech_.isReady_){if(e in oo)return function(e,t,i){return e.reduceRight(ho(i),t[i]())}(this.middleware_,this.tech_,e);if(e in uo)return ao(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw void 0===this.tech_[e]?(as(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):"TypeError"===t.name?(as(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(as(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=Ea){this.playCallbacks_.push(e);let t=!(this.changingSrc_||!this.src()&&!this.currentSrc()),i=!(!qs&&!Fs);if(this.waitToPlay_&&=(this.off(["ready","loadstart"],this.waitToPlay_),null),!this.isReady_||!t)return this.waitToPlay_=e=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!t&&i&&this.load());let r=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===r?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){let e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})}runPlayCallbacks_(e){let t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})}pause(){this.techCall_("pause")}paused(){return!1!==this.techGet_("paused")}played(){return this.techGet_("played")||ma(0,0)}scrubbing(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(void 0===e)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(void 0===e)return void 0===this.cache_.duration?NaN:this.cache_.duration;(e=parseFloat(e))<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=ma(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=ma(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Ta(this.buffered(),this.duration())}bufferedEnd(){let e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i}volume(e){let t;if(void 0===e)return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t;t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t)}muted(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)}defaultMuted(e){return void 0!==e&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(void 0===e)return this.isFullscreen_;{let t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_()}}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();let t=this;return new Promise((i,r)=>{function s(){t.off("fullscreenerror",a),t.off("fullscreenchange",n)}function n(){s(),i()}function a(e,t){s(),r(t)}t.one("fullscreenchange",n),t.one("fullscreenerror",a);let o=t.requestFullscreenHelper_(e);o&&(o.then(s,s),o.then(i,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){let e=this.el_[this.fsApi_.requestFullscreen](t);return e&&e.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),e}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){let e=this;return new Promise((t,i)=>{function r(){e.off("fullscreenerror",n),e.off("fullscreenchange",s)}function s(){r(),t()}function n(e,t){r(),i(t)}e.one("fullscreenchange",s),e.one("fullscreenerror",n);let a=e.exitFullscreenHelper_();a&&(a.then(r,r),a.then(t,i))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){let e=tt[this.fsApi_.exitFullscreen]();return e&&Ea(e.then(()=>this.isFullscreen(!1))),e}this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=tt.documentElement.style.overflow,Un(tt,"keydown",this.boundFullWindowOnEscKey_),tt.documentElement.style.overflow="hidden",Ys(tt.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){"Escape"===e.key&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Bn(tt,"keydown",this.boundFullWindowOnEscKey_),tt.documentElement.style.overflow=this.docOrigOverflow,Qs(tt.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(void 0===e)return!!this.isInPictureInPicture_;this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_()}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&Te.documentPictureInPicture){let e=tt.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(Gs("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),Te.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(vn(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",t=>{let i=t.target.querySelector(".video-js");e.parentNode.replaceChild(i,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in tt&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return Te.documentPictureInPicture&&Te.documentPictureInPicture.window?(Te.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in tt?tt.exitPictureInPicture():void 0}handleKeyDown(e){let{userActions:t}=this.options_;t&&t.hotkeys&&!(e=>{let t=e.tagName.toLowerCase();return!!e.isContentEditable||("input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t))})(this.el_.ownerDocument.activeElement)&&("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){let{fullscreenKey:t=t=>"f"===e.key.toLowerCase(),muteKey:i=t=>"m"===e.key.toLowerCase(),playPauseKey:r=t=>"k"===e.key.toLowerCase()||" "===e.key.toLowerCase()}=this.options_.userActions?this.options_.userActions.hotkeys:{};if(t.call(this,e)){e.preventDefault(),e.stopPropagation();let t=da.getComponent("FullscreenToggle");!1!==tt[this.fsApi_.fullscreenEnabled]&&t.prototype.handleClick.call(this,e)}else i.call(this,e)?(e.preventDefault(),e.stopPropagation(),da.getComponent("MuteToggle").prototype.handleClick.call(this,e)):r.call(this,e)&&(e.preventDefault(),e.stopPropagation(),da.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let i=0,r=this.options_.techOrder;i<r.length;i++){let s=r[i],n=to.getTech(s);if(n||=da.getComponent(s),n){if(n.isSupported()&&(t=n.canPlayType(e),t))return t}else as.error(`The "${s}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(e){let t,i=this.options_.techOrder.map(e=>[e,to.getTech(e)]).filter(([e,t])=>t?t.isSupported():(as.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`),!1)),r=function(e,t,i){let r;return e.some(e=>t.some(t=>{if(r=i(e,t),r)return!0})),r},s=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()]))return{source:i,tech:e}};return t=this.options_.sourceOrder?r(e,i,(e=>(t,i)=>e(i,t))(s)):r(i,e,s),t||!1}handleSrc_(e,t){if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();let i=go(e);if(i.length){if(this.changingSrc_=!0,t||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),no(this,i[0],(e,r)=>{if(this.middleware_=r,t||(this.cache_.sources=i),this.updateSourceCaches_(e),this.src_(e)){if(i.length>1)return this.handleSrc_(i.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady()}else!function(e,t){e.forEach(e=>e.setTech&&e.setTech(t))}(r,this.tech_)}),i.length>1){let e=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},t=()=>{this.off("error",e)};this.one("error",e),this.one("playing",t),this.resetRetryOnError_=()=>{this.off("error",e),this.off("playing",t)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)}src(e){return this.handleSrc_(e,!1)}src_(e){let t=this.selectSource([e]);return!t||(ua(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1))}addSourceElement(e,t){return!!this.tech_&&this.tech_.addSourceElement(e,t)}removeSourceElement(e){return!!this.tech_&&this.tech_.removeSourceElement(e)}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){this.paused()?this.doReset_():Ea(this.play().then(()=>this.doReset_()))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Zn(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);let{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:s}=i||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),s&&(s.update(),s.loadProgressBar&&s.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){let e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(void 0===e)return this.techGet_("preload");this.techCall_("setPreload",e),this.options_.preload=e}autoplay(e){if(void 0===e)return this.options_.autoplay||!1;let t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return void 0!==e&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(void 0===e)return this.techGet_("loop");this.techCall_("setLoop",e),this.options_.loop=e}poster(e){if(void 0===e)return this.poster_;e||="",e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){let e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(void 0===e)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(void 0===e)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(void 0===e)return this.error_||null;if(Jr("beforeerror").forEach(t=>{let i=t(this,e);cs(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?e=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){let t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)})}else null===e?(this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close()):(this.error_=new Sa(e),this.addClass("vjs-error"),as.error(`(CODE:${this.error_.code} ${Sa.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Jr("error").forEach(e=>e(this,this.error_)))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(void 0===e)return this.userActive_;(e=!!e)!==this.userActive_&&(this.userActive_=e,this.userActive_?(this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive")):(this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")))}listenForUserActivity_(){let e,t,i,r=$n(this,this.reportUserActivity),s=function(t){r(),this.clearInterval(e)};this.on("mousedown",function(){r(),this.clearInterval(e),e=this.setInterval(r,250)}),this.on("mousemove",function(e){(e.screenX!==t||e.screenY!==i)&&(t=e.screenX,i=e.screenY,r())}),this.on("mouseup",s),this.on("mouseleave",s);let n,a=this.getChild("controlBar");a&&!Fs&&!Ts&&(a.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),a.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r),this.setInterval(function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(n);let e=this.options_.inactivityTimeout;e<=0||(n=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))},250)}playbackRate(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)}defaultPlaybackRate(e){return void 0===e?this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1:this.techCall_("setDefaultPlaybackRate",e)}isAudio(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e}updatePlayerHeightOnAudioOnlyMode_(){let e=this.getChild("ControlBar");e&&this.audioOnlyCache_.controlBarHeight!==e.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");let e=this.children(),t=this.getChild("ControlBar"),i=t&&t.currentHeight();e.forEach(e=>{e!==t&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=i,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(i),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){let e=[];return this.isInPictureInPicture()&&e.push(this.exitPictureInPicture()),this.isFullscreen()&&e.push(this.exitFullscreen()),this.audioPosterMode()&&e.push(this.audioPosterMode(!1)),Promise.all(e).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return"boolean"!=typeof e||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||=e,this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Zn(this)&&this.trigger("languagechange"))}languages(){return ms(Jl.prototype.options_.languages,this.languages_)}toJSON(){let e=ms(this.options_),t=e.tracks;e.tracks=[];for(let i=0;i<t.length;i++){let r=t[i];r=ms(r),r.player=void 0,e.tracks[i]=r}return e}createModal(e,t){t||={},t.content=e||"";let i=new xa(this,t);return this.addChild(i),i.on("dispose",()=>{this.removeChild(i)}),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;let e=this.currentBreakpoint(),t=this.currentWidth();for(let i=0;i<Zl.length;i++){let r=Zl[i];if(t<=this.breakpoints_[r]){if(e===r)return;e&&this.removeClass(Yl[e]),this.addClass(Yl[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){let e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return void 0===e||(this.removeCurrentBreakpoint_(),this.breakpoints_=Object.assign({},Ql,e),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(e){return void 0===e?this.responsive_:(e=!!e)!==this.responsive_?(this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Yl[this.breakpoint_]||""}loadMedia(e,t){if(!e||"object"!=typeof e)return;let i=this.crossOrigin();this.reset(),this.cache_.media=ms(e);let{artist:r,artwork:s,description:n,poster:a,src:o,textTracks:l,title:u}=this.cache_.media;!s&&a&&(this.cache_.media.artwork=[{src:a,type:mo(a)}]),i&&this.crossOrigin(i),o&&this.src(o),a&&this.poster(a),Array.isArray(l)&&l.forEach(e=>this.addRemoteTextTrack(e,!1)),this.titleBar&&this.titleBar.update({title:u,description:n||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){let e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}))};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:mo(t.poster)}]),t}return ms(this.cache_.media)}static getTagSettings(e){let t={sources:[],tracks:[]},i=tn(e),r=i["data-setup"];if(Zs(e,"vjs-fill")&&(i.fill=!0),Zs(e,"vjs-fluid")&&(i.fluid=!0),null!==r)try{Object.assign(i,JSON.parse(r||"{}"))}catch(e){as.error("data-setup",e)}if(Object.assign(t,i),e.hasChildNodes()){let i=e.childNodes;for(let e=0,r=i.length;e<r;e++){let r=i[e],s=r.nodeName.toLowerCase();"source"===s?t.sources.push(tn(r)):"track"===s&&t.tracks.push(tn(r))}}return t}debug(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every(e=>"number"==typeof e)&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}Jl.prototype.videoTracks=()=>{},Jl.prototype.audioTracks=()=>{},Jl.prototype.textTracks=()=>{},Jl.prototype.remoteTextTracks=()=>{},Jl.prototype.remoteTextTrackEls=()=>{},eo.names.forEach(function(e){let t=eo[e];Jl.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),Jl.prototype.crossorigin=Jl.prototype.crossOrigin,Jl.players={};const eu=Te.navigator;Jl.prototype.options_={techOrder:to.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:eu&&(eu.languages&&eu.languages[0]||eu.userLanguage||eu.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},Xl.forEach(function(e){Jl.prototype[`handleTech${la(e)}_`]=function(){return this.trigger(e)}}),da.registerComponent("Player",Jl);const tu="plugin",iu="activePlugins_",ru={},su=e=>ru.hasOwnProperty(e),nu=e=>su(e)?ru[e]:void 0,au=(e,t)=>{e[iu]=e[iu]||{},e[iu][t]=!0},ou=(e,t,i)=>{let r=(i?"before":"")+"pluginsetup";e.trigger(r,t),e.trigger(r+":"+t.name,t)},lu=(e,t)=>(t.prototype.name=e,function(...i){ou(this,{name:e,plugin:t,instance:null},!0);let r=new t(this,...i);return this[e]=()=>r,ou(this,r.getEventHash()),r});class uu{constructor(e){if(this.constructor===uu)throw Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||=this.player.log.createLogger(this.name),sa(this),delete this.trigger,aa(this,this.constructor.defaultState),au(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Fn(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){let{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[iu][e]=!1,this.player=this.state=null,t[e]=lu(e,ru[e])}static isBasic(e){let t="string"==typeof e?nu(e):e;return"function"==typeof t&&!uu.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if("string"!=typeof e)throw Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(su(e))as.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Jl.prototype.hasOwnProperty(e))throw Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if("function"!=typeof t)throw Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return ru[e]=t,e!==tu&&(uu.isBasic(t)?Jl.prototype[e]=function(e,t){let i=function(){ou(this,{name:e,plugin:t,instance:null},!0);let i=t.apply(this,arguments);return au(this,e),ou(this,{name:e,plugin:t,instance:i}),i};return Object.keys(t).forEach(function(e){i[e]=t[e]}),i}(e,t):Jl.prototype[e]=lu(e,t)),t}static deregisterPlugin(e){if(e===tu)throw Error("Cannot de-register base plugin.");su(e)&&(delete ru[e],delete Jl.prototype[e])}static getPlugins(e=Object.keys(ru)){let t;return e.forEach(e=>{let i=nu(e);i&&(t||={},t[e]=i)}),t}static getPluginVersion(e){let t=nu(e);return t&&t.VERSION||""}}function hu(e,t,i,r){return function(e,t){let i=!1;return function(...r){return i||as.warn(e),i=!0,t.apply(this,r)}}(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,r)}uu.getPlugin=nu,uu.BASE_PLUGIN_NAME=tu,uu.registerPlugin(tu,uu),Jl.prototype.usingPlugin=function(e){return!!this[iu]&&!0===this[iu][e]},Jl.prototype.hasPlugin=function(e){return!!su(e)};const du=e=>0===e.indexOf("#")?e.slice(1):e;function cu(e,t,i){let r=cu.getPlayer(e);if(r)return t&&as.warn(`Player "${e}" is already initialised. Options will not be applied.`),i&&r.ready(i),r;let s="string"==typeof e?yn("#"+du(e)):e;if(!Vs(s))throw TypeError("The element or ID supplied is not valid. (videojs)");let n="getRootNode"in s&&s.getRootNode()instanceof Te.ShadowRoot?s.getRootNode():s.ownerDocument.body;return(!s.ownerDocument.defaultView||!n.contains(s))&&as.warn("The element supplied is not included in the DOM"),t||={},!0===t.restoreEl&&(t.restoreEl=(s.parentNode&&s.parentNode.hasAttribute&&s.parentNode.hasAttribute("data-vjs-player")?s.parentNode:s).cloneNode(!0)),Jr("beforesetup").forEach(e=>{let i=e(s,ms(t));!cs(i)||Array.isArray(i)?as.error("please return an object in beforesetup hooks"):t=ms(t,i)}),r=new(da.getComponent("Player"))(s,t,i),Jr("setup").forEach(e=>e(r)),r}if(cu.hooks_=Qr,cu.hooks=Jr,cu.hook=function(e,t){Jr(e,t)},cu.hookOnce=function(e,t){Jr(e,[].concat(t).map(t=>{let i=(...r)=>(es(e,i),t(...r));return i}))},cu.removeHook=es,!0!==Te.VIDEOJS_NO_DYNAMIC_STYLE&&$s()){let e=yn(".vjs-styles-defaults");if(!e){e=In("vjs-styles-defaults");let t=yn("head");t&&t.insertBefore(e,t.firstChild),xn(e,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}wn(1,cu),cu.VERSION=Yr,cu.options=Jl.prototype.options_,cu.getPlayers=()=>Jl.players,cu.getPlayer=e=>{let t,i=Jl.players;if("string"==typeof e){let r=du(e),s=i[r];if(s)return s;t=yn("#"+r)}else t=e;if(Vs(t)){let{player:e,playerId:r}=t;if(e||i[r])return e||i[r]}},cu.getAllPlayers=()=>Object.keys(Jl.players).map(e=>Jl.players[e]).filter(Boolean),cu.players=Jl.players,cu.getComponent=da.getComponent,cu.registerComponent=(e,t)=>(to.isTech(t)&&as.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),da.registerComponent.call(da,e,t)),cu.getTech=to.getTech,cu.registerTech=to.registerTech,cu.use=function(e,t){io[e]=io[e]||[],io[e].push(t)},Object.defineProperty(cu,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(cu.middleware,"TERMINATOR",{value:so,writeable:!1,enumerable:!0}),cu.browser=js,cu.obj=ys,cu.mergeOptions=hu(9,"videojs.mergeOptions","videojs.obj.merge",ms),cu.defineLazyProperty=hu(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",fs),cu.bind=hu(9,"videojs.bind","native Function.prototype.bind",$n),cu.registerPlugin=uu.registerPlugin,cu.deregisterPlugin=uu.deregisterPlugin,cu.plugin=(e,t)=>(as.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),uu.registerPlugin(e,t)),cu.getPlugins=uu.getPlugins,cu.getPlugin=uu.getPlugin,cu.getPluginVersion=uu.getPluginVersion,cu.addLanguage=function(e,t){return e=(""+e).toLowerCase(),cu.options.languages=ms(cu.options.languages,{[e]:t}),cu.options.languages[e]},cu.log=as,cu.createLogger=os,cu.time=va,cu.createTimeRange=hu(9,"videojs.createTimeRange","videojs.time.createTimeRanges",ma),cu.createTimeRanges=hu(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",ma),cu.formatTime=hu(9,"videojs.formatTime","videojs.time.formatTime",ba),cu.setFormatTime=hu(9,"videojs.setFormatTime","videojs.time.setFormatTime",ya),cu.resetFormatTime=hu(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",_a),cu.parseUrl=hu(9,"videojs.parseUrl","videojs.url.parseUrl",ja),cu.isCrossOrigin=hu(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Va),cu.EventTarget=Xn,cu.any=jn,cu.on=Un,cu.one=qn,cu.off=Bn,cu.trigger=Fn,cu.xhr=gt,cu.TrackList=Aa,cu.TextTrack=Xa,cu.TextTrackList=Oa,cu.AudioTrack=Ka,cu.AudioTrackList=Ma,cu.VideoTrack=Za,cu.VideoTrackList=La,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{cu[e]=function(){return as.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`),Tn[e].apply(null,arguments)}}),cu.computedStyle=hu(9,"videojs.computedStyle","videojs.dom.computedStyle",bn),cu.dom=Tn,cu.fn=Wn,cu.num=Uo,cu.str=ha,cu.url=za,cu.Error={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};class pu{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get:()=>t.enabled_(),set(e){t.enabled_(e)}}),t}}class mu extends cu.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get:()=>e.selectedIndex_}),Object.defineProperty(e,"length",{get:()=>e.levels_.length}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;let i=this.levels_.length;return t=new pu(e),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let i=0,r=this.length;i<r;i++)if(this[i]===e){t=this.levels_.splice(i,1)[0],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,i=this.length;t<i;t++){let i=this[t];if(i.id===e)return i}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}mu.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(let e in mu.prototype.allowedEvents_)mu.prototype["on"+e]=null;var gu="4.1.0";const fu=function(e){return function(e){let t=e.qualityLevels,i=new mu,r=function(){i.dispose(),e.qualityLevels=t,e.off("dispose",r)};return e.on("dispose",r),e.qualityLevels=()=>i,e.qualityLevels.VERSION=gu,i}(this,cu.obj.merge({},e))};cu.registerPlugin("qualityLevels",fu),fu.VERSION=gu;const yu=Pt,_u=(e,t)=>t&&t.responseURL&&e!==t.responseURL?t.responseURL:e,bu=e=>cu.log.debug?cu.log.debug.bind(cu,"VHS:",`${e} >`):function(){};function vu(...e){let t=cu.obj||cu;return(t.merge||t.mergeOptions).apply(t,e)}function Tu(...e){let t=cu.time||cu;return(t.createTimeRanges||t.createTimeRanges).apply(t,e)}const Su=1/30,Cu=.1,Eu=function(e,t){let i,r=[];if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&r.push([e.start(i),e.end(i)]);return Tu(r)},wu=function(e,t){return Eu(e,function(e,i){return e-Cu<=t&&i+Cu>=t})},ku=function(e,t){return Eu(e,function(e){return e-Su>=t})},Iu=e=>{let t=[];if(!e||!e.length)return"";for(let i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")},xu=e=>{let t=[];for(let i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t},Au=function(e){if(e&&e.length&&e.end)return e.end(e.length-1)},Pu=function(e,t){let i=0;if(!e||!e.length)return i;for(let r=0;r<e.length;r++){let s=e.start(r),n=e.end(r);t>n||(i+=t>s&&t<=n?n-t:n-s)}return i},Mu=(e,t)=>{if(!t.preload)return t.duration;let i=0;return(t.parts||[]).forEach(function(e){i+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(i+=e.partTargetDuration)}),i},Du=e=>(e.segments||[]).reduce((e,t,i)=>(t.parts?t.parts.forEach(function(r,s){e.push({duration:r.duration,segmentIndex:i,partIndex:s,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e),[]),Lu=e=>{let t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},Ou=({preloadSegment:e})=>{if(!e)return;let{parts:t,preloadHints:i}=e,r=(i||[]).reduce((e,t)=>e+ +("PART"===t.type),0);return r+=t&&t.length?t.length:0,r},Nu=(e,t)=>{if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;let i=Lu(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},Ru=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),t<e.mediaSequence)return 0;let r=function(e,t){let i=0,r=t-e.mediaSequence,s=e.segments[r];if(s){if(void 0!==s.start)return{result:s.start,precise:!0};if(void 0!==s.end)return{result:s.end-s.duration,precise:!0}}for(;r--;){if(s=e.segments[r],void 0!==s.end)return{result:i+s.end,precise:!0};if(i+=Mu(e,s),void 0!==s.start)return{result:i+s.start,precise:!0}}return{result:i,precise:!1}}(e,t);if(r.precise)return r.result;let s=function(e,t){let i,r=0,s=t-e.mediaSequence;for(;s<e.segments.length;s++){if(i=e.segments[s],void 0!==i.start)return{result:i.start-r,precise:!0};if(r+=Mu(e,i),void 0!==i.end)return{result:i.end-r,precise:!0}}return{result:-1,precise:!1}}(e,t);return s.precise?s.result:r.result+i},Uu=function(e,t,i){if(!e)return 0;if("number"!=typeof i&&(i=0),void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return Te.Infinity}return Ru(e,t,i)},Bu=function({defaultDuration:e,durationList:t,startIndex:i,endIndex:r}){let s=0;if(i>r&&([i,r]=[r,i]),i<0){for(let t=i;t<Math.min(0,r);t++)s+=e;i=0}for(let e=i;e<r;e++)s+=t[e].duration;return s},Fu=function(e,t,i,r){if(!e||!e.segments)return null;if(e.endList)return Uu(e);if(null===t)return null;t||=0;let s=Ru(e,e.mediaSequence+e.segments.length,t);return i&&(s-=r="number"==typeof r?r:Nu(null,e)),Math.max(0,s)},qu=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()},ju=function(e){return e.excludeUntil&&e.excludeUntil===1/0},Hu=function(e){let t=qu(e);return!e.disabled&&!t},$u=function(e,t){return t.attributes&&t.attributes[e]},Vu=(e,t)=>{if(1===e.playlists.length)return!0;let i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(e=>!!Hu(e)&&(e.attributes.BANDWIDTH||0)<i).length},zu=(e,t)=>!(!e&&!t||!e&&t||e&&!t||!(e===t||e.id&&t.id&&e.id===t.id||e.resolvedUri&&t.resolvedUri&&e.resolvedUri===t.resolvedUri||e.uri&&t.uri&&e.uri===t.uri)),Wu=function(e,t){let i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},r=!1;for(let e in i){for(let s in i[e])if(r=t(i[e][s]),r)break;if(r)break}return!!r},Gu=e=>{if(!e||!e.playlists||!e.playlists.length)return Wu(e,e=>e.playlists&&e.playlists.length||e.uri);for(let t=0;t<e.playlists.length;t++){let i=e.playlists[t],r=i.attributes&&i.attributes.CODECS;if(!(r&&r.split(",").every(e=>Xt(e))||Wu(e,e=>zu(i,e))))return!1}return!0};var Xu={liveEdgeDelay:Nu,duration:Uu,seekable:function(e,t,i){let r=t||0,s=Fu(e,t,!0,i);return null===s?Tu():(s<r&&(s=r),Tu(r,s))},getMediaInfoForTime:function({playlist:e,currentTime:t,startingSegmentIndex:i,startingPartIndex:r,startTime:s,exactManifestTimings:n}){let a=t-s,o=Du(e),l=0;for(let e=0;e<o.length;e++){let t=o[e];if(i===t.segmentIndex&&("number"!=typeof r||"number"!=typeof t.partIndex||r===t.partIndex)){l=e;break}}if(a<0){if(l>0)for(let t=l-1;t>=0;t--){let i=o[t];if(a+=i.duration,n){if(a<0)continue}else if(a+Su<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:s-Bu({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t}}if(l<0){for(let i=l;i<0;i++)if(a-=e.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:t};l=0}for(let t=l;t<o.length;t++){let i=o[t];a-=i.duration;let r=i.duration>Su;if(0!==a&&!(r&&a+Su>=0)||t===o.length-1){if(n){if(a>0)continue}else if(a-Su>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:s+Bu({defaultDuration:e.targetDuration,durationList:o,startIndex:l,endIndex:t})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:t}},isEnabled:Hu,isDisabled:function(e){return e.disabled},isExcluded:qu,isIncompatible:ju,playlistEnd:Fu,isAes:function(e){for(let t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:$u,estimateSegmentRequestTime:function(e,t,i,r=0){return $u("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*r)/t:NaN},isLowestEnabledRendition:Vu,isAudioOnly:Gu,playlistMatch:zu,segmentDurationWithParts:Mu};const{log:Ku}=cu,Zu=(e,t)=>`${e}-${t}`,Yu=(e,t,i)=>`placeholder-uri-${e}-${t}-${i}`,Qu=(e,t)=>{e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>{if(e.mediaGroups[i])for(let r in e.mediaGroups[i])for(let s in e.mediaGroups[i][r]){let n=e.mediaGroups[i][r][s];t(n,i,r,s)}})},Ju=({playlist:e,uri:t,id:i})=>{e.id=i,e.playlistErrors_=0,t&&(e.uri=t),e.attributes=e.attributes||{}},eh=(e,t,i=Yu)=>{e.uri=t;for(let t=0;t<e.playlists.length;t++)if(!e.playlists[t].uri){let i=`placeholder-uri-${t}`;e.playlists[t].uri=i}let r=Gu(e);Qu(e,(t,s,n,a)=>{if(!t.playlists||!t.playlists.length){if(r&&"AUDIO"===s&&!t.uri)for(let t=0;t<e.playlists.length;t++){let i=e.playlists[t];if(i.attributes&&i.attributes.AUDIO&&i.attributes.AUDIO===n)return}t.playlists=[At({},t)]}t.playlists.forEach(function(t,r){let o=i(s,n,a,t),l=Zu(r,o);t.uri?t.resolvedUri=t.resolvedUri||yu(e.uri,t.uri):(t.uri=0===r?o:l,t.resolvedUri=t.uri),t.id=t.id||l,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t})}),(e=>{let t=e.playlists.length;for(;t--;){let i=e.playlists[t];Ju({playlist:i,id:Zu(t,i.uri)}),i.resolvedUri=yu(e.uri,i.uri),e.playlists[i.id]=i,e.playlists[i.uri]=i,i.attributes.BANDWIDTH||Ku.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(e),(e=>{Qu(e,t=>{t.uri&&(t.resolvedUri=yu(e.uri,t.uri))})})(e)};class th{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(null!==this.offset_||!e.length)return;let[t]=e;void 0!==t.programDateTime&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;let[t]=e,i=t.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=e.reduce((e,t)=>(e.set(t.id,t),e),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(null===this.offset_)return[];let e={},t=[];this.pendingDateRanges_.forEach((i,r)=>{this.processedDateRanges_.has(r)||(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),t.push(i),i.class&&(e[i.class]?i.classListIndex=e[i.class].push(i)-1:(e[i.class]=[i],i.classListIndex=0)))});for(let i of t){let t=e[i.class]||[];i.endTime=i.endDate?i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&t[i.classListIndex+1]?t[i.classListIndex+1].startTime:i.duration?i.startTime+i.duration:i.plannedDuration?i.startTime+i.plannedDuration:i.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((t,i)=>{t.startDate.getTime()<e&&this.processedDateRanges_.delete(i)})}}const ih=({requestType:e,request:t,error:i,parseFailure:r})=>{let s=t.status<200||t.status>299,n=t.status>=400&&t.status<=499,a={uri:t.uri,requestType:e},o=s&&!n||r;return i&&n?(a.error=At({},i),a.errorType=cu.Error.NetworkRequestFailed):t.aborted?a.errorType=cu.Error.NetworkRequestAborted:t.timedout?a.errorType=cu.Error.NetworkRequestTimeout:o&&(a.errorType=r?cu.Error.NetworkBodyParserFailed:cu.Error.NetworkBadStatus,a.status=t.status,a.headers=t.headers),a},rh=bu("CodecUtils"),sh=function(e){let t=e.attributes||{};if(t.CODECS)return Gt(t.CODECS)},nh=(e,t)=>{let i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]},ah=function(e){let t={};return e.forEach(({mediaType:e,type:i,details:r})=>{t[e]=t[e]||[],t[e].push(Wt(`${i}${r}`))}),Object.keys(t).forEach(function(e){t[e].length>1?(rh(`multiple ${e} codecs found as attributes: ${t[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),t[e]=null):t[e]=t[e][0]}),t},oh=function(e){let t=0;return e.audio&&t++,e.video&&t++,t},lh=function(e,t){let i=t.attributes||{},r=ah(sh(t)||[]);if(nh(e,t)&&!r.audio&&!((e,t)=>{if(!nh(e,t))return!0;let i=t.attributes||{},r=e.mediaGroups.AUDIO[i.AUDIO];for(let e in r)if(!r[e].uri&&!r[e].playlists)return!0;return!1})(e,t)){let t=ah(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var r in i){var s=i[r];if(s.default&&s.playlists)return Gt(s.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[]);t.audio&&(r.audio=t.audio)}return r},{EventTarget:uh}=cu,hh=(e,t)=>{if(!e)return t;let i=vu(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(let r=0;r<t.parts.length;r++)e.parts&&e.parts[r]&&(i.parts[r]=vu(e.parts[r],t.parts[r]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i},dh=(e,t)=>{!e.resolvedUri&&e.uri&&(e.resolvedUri=yu(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=yu(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=yu(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=yu(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(e=>{e.resolvedUri||=yu(t,e.uri)}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(e=>{e.resolvedUri||=yu(t,e.uri)})},ch=function(e){let t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(let e=0;e<i.preloadHints.length;e++)if("MAP"===i.preloadHints[e].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t},ph=(e,t)=>e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment,mh=(e,t,i=ph)=>{let r=vu(e,{}),s=r.playlists[t.id];if(!s||i(s,t))return null;t.segments=ch(t);let n=vu(s,t);if(n.preloadSegment&&!t.preloadSegment&&delete n.preloadSegment,s.segments){if(t.skip){t.segments=t.segments||[];for(let e=0;e<t.skip.skippedSegments;e++)t.segments.unshift({skipped:!0})}n.segments=((e,t,i)=>{let r=e.slice(),s=t.slice();i||=0;let n,a=[];for(let e=0;e<s.length;e++){let t=r[e+i],o=s[e];t?(n=t.map||n,a.push(hh(t,o))):(n&&!o.map&&(o.map=n),a.push(o))}return a})(s.segments,t.segments,t.mediaSequence-s.mediaSequence)}n.segments.forEach(e=>{dh(e,n.resolvedUri)});for(let e=0;e<r.playlists.length;e++)r.playlists[e].id===t.id&&(r.playlists[e]=n);return r.playlists[t.id]=n,r.playlists[t.uri]=n,Qu(e,(e,i,r,s)=>{if(e.playlists)for(let i=0;i<e.playlists.length;i++)t.id===e.playlists[i].id&&(e.playlists[i]=n)}),r},gh=(e,t)=>{let i=e.segments||[],r=i[i.length-1],s=r&&r.parts&&r.parts[r.parts.length-1],n=s&&s.duration||r&&r.duration;return t&&n?1e3*n:500*(e.partTargetDuration||e.targetDuration||10)},fh=(e,t,i)=>{if(!e)return;let r=[];return e.forEach(e=>{if(!e.attributes)return;let{BANDWIDTH:t,RESOLUTION:i,CODECS:s}=e.attributes;r.push({id:e.id,bandwidth:t,resolution:i,codecs:s})}),{type:t,isLive:i,renditions:r}};class yh extends uh{constructor(e,t,i={}){if(super(),!e)throw Error("A non-empty playlist URL or object is required");this.logger_=bu("PlaylistLoader");let{withCredentials:r=!1}=i;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;let s=t.options_;this.customTagParsers=s&&s.customTagParsers||[],this.customTagMappers=s&&s.customTagMappers||[],this.llhls=s&&s.llhls,this.dateRangesStorage_=new th,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){let e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);let t=this.dateRangesStorage_.getDateRangesToProcess();t.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;let e=this.media(),t=yu(this.main.uri,e.uri);this.llhls&&(t=((e,t)=>{if(t.endList||!t.serverControl)return e;let i={};if(t.serverControl.canBlockReload){let{preloadSegment:e}=t,r=t.mediaSequence+t.segments.length;if(e){let s=e.parts||[],n=Ou(t)-1;n>-1&&n!==s.length-1&&(i._HLS_part=n),(n>-1||s.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){let t=new Te.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){i.hasOwnProperty(e)&&t.searchParams.set(e,i[e])}),e=t.toString()}return e})(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(e,t)=>{if(this.request){if(e)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,i){let{uri:r,id:s}=t;this.request=null,i&&(this.state=i),this.error={playlist:this.main.playlists[s],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:ih({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{let i=(({onwarn:e,oninfo:t,manifestString:i,customTagParsers:r=[],customTagMappers:s=[],llhls:n})=>{let a=new qt;e&&a.on("warn",e),t&&a.on("info",t),r.forEach(e=>a.addParser(e)),s.forEach(e=>a.addTagMapper(e)),a.push(i),a.end();let o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){o.hasOwnProperty(e)&&delete o[e]}),o.segments&&o.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!o.targetDuration){let t=10;o.segments&&o.segments.length&&(t=o.segments.reduce((e,t)=>Math.max(e,t.duration),0)),e&&e({message:`manifest has no targetDuration defaulting to ${t}`}),o.targetDuration=t}let l=Lu(o);if(l.length&&!o.partTargetDuration){let t=l.reduce((e,t)=>Math.max(e,t.duration),0);e&&(e({message:`manifest has no partTargetDuration defaulting to ${t}`}),Ku.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=t}return o})({onwarn:({message:t})=>this.logger_(`m3u8-parser warn for ${e}: ${t}`),oninfo:({message:t})=>this.logger_(`m3u8-parser info for ${e}: ${t}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!i.playlists||!i.playlists.length||this.excludeAudioOnlyVariants(i.playlists),i}catch(e){this.error=e,this.error.metadata={errorType:cu.Error.StreamingHlsPlaylistParserError,error:e}}}excludeAudioOnlyVariants(e){let t=e=>{let{width:t,height:i}=(e.attributes||{}).RESOLUTION||{};if(t&&i)return!0;let r=sh(e)||[];return!!ah(r).video};e.some(t)&&e.forEach(e=>{t(e)||(e.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:r}){this.request=null,this.state="HAVE_METADATA";let s={playlistInfo:{type:"media",uri:i}};this.trigger({type:"playlistparsestart",metadata:s});let n=t||this.parseManifest_({url:i,manifestString:e});n.lastRequest=Date.now(),Ju({playlist:n,uri:i,id:r});let a=mh(this.main,n);this.targetDuration=n.partTargetDuration||n.targetDuration,this.pendingMedia_=null,a?(this.main=a,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(gh(this.media(),!!a)),s.parsedPlaylist=fh(this.main.playlists,s.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:s}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),Te.clearTimeout(this.mediaUpdateTimeout),Te.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new th,this.off()}stopRequest(){if(this.request){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.main.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(Te.clearTimeout(this.finalRenditionTimeout),t){let t=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=Te.setTimeout(this.media.bind(this,e,!1),t))}let i=this.state,r=!this.media_||e.id!==this.media_.id,s=this.main.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length)return this.request&&=(this.request.onreadystatechange=null,this.request.abort(),null),this.state="HAVE_METADATA",this.media_=e,void(r&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(gh(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;let n={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:n}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,r)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=_u(e.resolvedUri,r),t)return this.playlistRequestError(this.request,e,i);this.trigger({type:"playlistrequestcomplete",metadata:n}),this.haveMetadata({playlistString:r.responseText,url:e.uri,id:e.id}),"HAVE_MAIN_MANIFEST"===i?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&=(Te.clearTimeout(this.mediaUpdateTimeout),null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.state=this.media_?"HAVE_METADATA":"HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&=(Te.clearTimeout(this.mediaUpdateTimeout),null);let t=this.media();if(e){let e=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=Te.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},e)}else this.started?t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&=(Te.clearTimeout(this.mediaUpdateTimeout),null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=Te.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=Te.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);let e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,i)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:ih({requestType:i.requestType,request:i,error:t})},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=_u(this.src,i),this.trigger({type:"playlistparsestart",metadata:e});let r=this.parseManifest_({manifestString:i.responseText,url:this.src});e.parsedPlaylist=fh(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists)return this.main=e,eh(this.main,this.srcUri()),e.playlists.forEach(e=>{e.segments=ch(e),e.segments.forEach(t=>{dh(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));let t=this.srcUri()||Te.location.href;this.main=((e,t)=>{let i=Zu(0,t),r={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:Te.location.href,resolvedUri:Te.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return r.playlists[i]=r.playlists[0],r.playlists[t]=r.playlists[0],r})(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){let i=this.main,r=e.ID,s=i.playlists.length;for(;s--;){let n=i.playlists[s];if(n.attributes["PATHWAY-ID"]===r){let a=n.resolvedUri,o=n.id;if(t){let t=this.createCloneURI_(n.resolvedUri,e),a=Zu(r,t),o=this.createCloneAttributes_(r,n.attributes),l=this.createClonePlaylist_(n,a,e,o);i.playlists[s]=l,i.playlists[a]=l,i.playlists[t]=l}else i.playlists.splice(s,1);delete i.playlists[o],delete i.playlists[a]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){let i=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{if(i.mediaGroups[e]&&i.mediaGroups[e][r])for(let t in i.mediaGroups[e])if(t===r){for(let r in i.mediaGroups[e][t])i.mediaGroups[e][t][r].playlists.forEach((e,t)=>{let r=i.playlists[e.id],s=r.id,n=r.resolvedUri;delete i.playlists[s],delete i.playlists[n]});delete i.mediaGroups[e][t]}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){let i=this.main,r=i.playlists.length,s=this.createCloneURI_(t.resolvedUri,e),n=Zu(e.ID,s),a=this.createCloneAttributes_(e.ID,t.attributes),o=this.createClonePlaylist_(t,n,e,a);i.playlists[r]=o,i.playlists[n]=o,i.playlists[s]=o,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){let t=e.ID,i=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{if(r.mediaGroups[s]&&!r.mediaGroups[s][t])for(let n in r.mediaGroups[s])if(n===i){r.mediaGroups[s][t]={};for(let i in r.mediaGroups[s][n]){let a=r.mediaGroups[s][n][i];r.mediaGroups[s][t][i]=At({},a);let o=r.mediaGroups[s][t][i],l=this.createCloneURI_(a.resolvedUri,e);o.resolvedUri=l,o.uri=l,o.playlists=[],a.playlists.forEach((n,a)=>{let l=r.playlists[n.id],u=Yu(s,t,i),h=Zu(t,u);if(l&&!r.playlists[h]){let t=this.createClonePlaylist_(l,h,e),i=t.resolvedUri;r.playlists[h]=t,r.playlists[i]=t}o.playlists[a]=this.createClonePlaylist_(n,h,e)})}}})}createClonePlaylist_(e,t,i,r){let s=this.createCloneURI_(e.resolvedUri,i),n={resolvedUri:s,uri:s,id:t};return e.segments&&(n.segments=[]),r&&(n.attributes=r),vu(e,n)}createCloneURI_(e,t){let i=new URL(e);i.hostname=t["URI-REPLACEMENT"].HOST;let r=t["URI-REPLACEMENT"].PARAMS;for(let e of Object.keys(r))i.searchParams.set(e,r[e]);return i.href}createCloneAttributes_(e,t){let i={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(i[r]=e)}),i}getKeyIdSet(e){let t=new Set;if(!e||!e.contentProtection)return t;for(let i in e.contentProtection)if(e.contentProtection[i]&&e.contentProtection[i].attributes&&e.contentProtection[i].attributes.keyId){let r=e.contentProtection[i].attributes.keyId;t.add(r.toLowerCase())}return t}}const _h=function(e,t,i,r){let s="arraybuffer"===e.responseType?e.response:e.responseText;!t&&s&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=s.byteLength||s.length,e.bandwidth||=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3)),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),!t&&!e.aborted&&200!==i.statusCode&&206!==i.statusCode&&0!==i.statusCode&&(t=Error("XHR Failed with a response of: "+(e&&(s||e.responseText)))),r(t,e)},bh=function(){let e=function e(t,i){t=vu({timeout:45e3},t);let r=e.beforeRequest||cu.Vhs.xhr.beforeRequest,s=e._requestCallbackSet||cu.Vhs.xhr._requestCallbackSet||new Set,n=e._responseCallbackSet||cu.Vhs.xhr._responseCallbackSet;r&&"function"==typeof r&&(cu.log.warn("beforeRequest is deprecated, use onRequest instead."),s.add(r));let a=!0===cu.Vhs.xhr.original?cu.xhr:cu.Vhs.xhr,o=((e,t)=>{if(!e||!e.size)return;let i=t;return e.forEach(e=>{i=e(i)}),i})(s,t);s.delete(r);let l=a(o||t,function(e,t){return((e,t,i,r)=>{e&&e.size&&e.forEach(e=>{e(t,i,r)})})(n,l,e,t),_h(l,e,t,i)}),u=l.abort;return l.abort=function(){return l.aborted=!0,u.apply(l,arguments)},l.uri=t.uri,l.requestType=t.requestType,l.requestTime=Date.now(),l};return e.original=!0,e},vh=function(e){let t={};return e.byterange&&(t.Range=function(e){let t,i=e.offset;return t="bigint"==typeof e.offset||"bigint"==typeof e.length?Te.BigInt(e.offset)+Te.BigInt(e.length)-Te.BigInt(1):e.offset+e.length-1,"bytes="+i+"-"+t}(e.byterange)),t},Th=function(e,t){return e.start(t)+"-"+e.end(t)},Sh=function(e,t){let i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},Ch=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Eh=function(e){let t={};return Object.keys(e).forEach(i=>{let r=e[i];ii(r)?t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}:t[i]=r}),t},wh=function(e){let t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},kh=function(e){return e.resolvedUri},Ih=e=>{let t,i,r=Array.prototype.slice.call(e),s="";for(let e=0;e<r.length/16;e++)t=r.slice(16*e,16*e+16).map(Sh).join(""),i=r.slice(16*e,16*e+16).map(Ch).join(""),s+=t+" "+i+"\n";return s};var xh=Object.freeze({__proto__:null,createTransferableMessage:Eh,initSegmentId:wh,segmentKeyId:kh,hexDump:Ih,tagDump:({bytes:e})=>Ih(e),textRanges:e=>{let t="",i=0;for(;i<e.length;i++)t+=Th(e,i)+" ";return t}});const Ah=({programTime:e,playlist:t,retryCount:i=2,seekTo:r,pauseAfterSeek:s=!0,tech:n,callback:a})=>{if(!a)throw Error("seekToProgramTime: callback must be provided");if(void 0===e||!t||!r)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!t.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!(e=>{if(!e.segments||0===e.segments.length)return!1;for(let t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0})(t))return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri});let o=((e,t)=>{let i;try{i=new Date(e)}catch{return null}if(!t||!t.segments||0===t.segments.length)return null;let r=t.segments[0];if(i<new Date(r.dateTimeObject))return null;for(let e=0;e<t.segments.length-1&&(r=t.segments[e],!(i<new Date(t.segments[e+1].dateTimeObject)));e++);let s=t.segments[t.segments.length-1],n=s.dateTimeObject,a=s.videoTimingInfo?(e=>e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds)(s.videoTimingInfo):s.duration+.25*s.duration;return i>new Date(n.getTime()+1e3*a)?null:(i>new Date(n)&&(r=s),{segment:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Xu.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"})})(e,t);if(!o)return a({message:`${e} was not found in the stream`});let l=o.segment,u=((e,t)=>{let i,r;try{i=new Date(e),r=new Date(t)}catch{}let s=i.getTime();return(r.getTime()-s)/1e3})(l.dateTimeObject,e);if("estimate"===o.type)return 0===i?a({message:`${e} is not buffered yet. Try again`}):(r(o.estimatedStart+u),void n.one("seeked",()=>{Ah({programTime:e,playlist:t,retryCount:i-1,seekTo:r,pauseAfterSeek:s,tech:n,callback:a})}));let h=l.start+u;n.one("seeked",()=>a(null,n.currentTime())),s&&n.pause(),r(h)},Ph=(e,t)=>{if(4===e.readyState)return t()},{EventTarget:Mh}=cu,Dh=function(e,t){if(!ph(e,t)||e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length)||!e.sidx&&t.sidx||e.sidx&&!t.sidx||e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(let i=0;i<e.segments.length;i++){let r=e.segments[i],s=t.segments[i];if(r.uri!==s.uri)return!1;if(!r.byterange&&!s.byterange)continue;let n=r.byterange,a=s.byterange;if(n&&!a||!n&&a||n.offset!==a.offset||n.length!==a.length)return!1}return!0},Lh=(e,t,i,r)=>`placeholder-uri-${e}-${t}-${r.attributes.NAME||i}`,Oh=(e,t)=>(!e.map&&!t.map||!(!e.map||!t.map||e.map.byterange.offset!==t.map.byterange.offset||e.map.byterange.length!==t.map.byterange.length))&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length,Nh=(e,t)=>{let i={};for(let r in e){let s=e[r].sidx;if(s){let e=Wi(s);if(!t[e])break;let r=t[e].sidxInfo;Oh(r,s)&&(i[e]=t[e])}}return i};class Rh extends Mh{constructor(e,t,i={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);let{withCredentials:s=!1}=i;if(this.vhs_=t,this.withCredentials=s,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!e)throw Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=bu("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(e,t,i){let r=e.sidx&&Wi(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r])return Te.clearTimeout(this.mediaRequest_),void(this.mediaRequest_=Te.setTimeout(()=>i(!1),0));let s=_u(e.sidx.resolvedUri),n=(s,n)=>{if(this.requestErrored_(s,n,t))return;let a,o=this.mainPlaylistLoader_.sidxMapping_,{requestType:l}=n;try{a=Ir(ri(n.response).subarray(8))}catch(e){return e.metadata=ih({requestType:l,request:n,parseFailure:!0}),void this.requestErrored_(e,n,t)}return o[r]={sidxInfo:e.sidx,sidx:a},ji(e,a,e.sidx.resolvedUri),i(!0)};this.request=((e,t,i,r)=>{let s,n=[],a=!1,o=function(e,t,r,s){return t.abort(),a=!0,i(e,t,r,s)},l=function(e,t){if(a)return;if(e)return e.metadata=ih({requestType:r,request:t,error:e}),o(e,t,"",n);let i=t.responseText.substring(n&&n.byteLength||0,t.responseText.length);if(n=function(){var e=[...arguments];if((e=e.filter(function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e})).length<=1)return ri(e[0]);var t=e.reduce(function(e,t,i){return e+(t.byteLength||t.length)},0),i=new Uint8Array(t),r=0;return e.forEach(function(e){e=ri(e),i.set(e,r),r+=e.byteLength}),i}(n,ui(i,!0)),s||=Ar(n),n.length<10||s&&n.length<s+2)return Ph(t,()=>o(e,t,"",n));let l=Kr(n);return"ts"===l&&n.length<188||!l&&n.length<376?Ph(t,()=>o(e,t,"",n)):o(null,t,l,n)},u=t({uri:e,beforeSend(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",function({total:t,loaded:i}){return _h(e,null,{statusCode:e.status},l)})}},function(e,t){return _h(u,e,t,l)});return u})(s,this.vhs_.xhr,(t,i,r,a)=>{if(t)return n(t,i);if(!r||"mp4"!==r){let t=r||"unknown";return n({status:i.status,message:`Unsupported ${t} container type for sidx segment at URL: ${s}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},i)}let{offset:o,length:l}=e.sidx.byterange;if(a.length>=l+o)return n(t,{response:a.subarray(o,o+l),status:i.status,uri:i.uri});this.request=this.vhs_.xhr({uri:s,responseType:"arraybuffer",requestType:"dash-sidx",headers:vh({byterange:e.sidx.byterange})},n)},"dash-sidx")}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},Te.clearTimeout(this.minimumUpdatePeriodTimeout_),Te.clearTimeout(this.mediaRequest_),Te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){let e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);let t=this.state;if("string"==typeof e){if(!this.mainPlaylistLoader_.main.playlists[e])throw Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}let i=!this.media_||e.id!==this.media_.id;i&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList?(this.state="HAVE_METADATA",this.media_=e,i&&(this.trigger("mediachanging"),this.trigger("mediachange"))):i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,i=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,Te.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),"HAVE_MAIN_MANIFEST"===e?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),Te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(Te.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(e){this.isPaused_=!1,Te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;let t=this.media();if(e){let e=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=Te.setTimeout(()=>this.load(),e)}else this.started?t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0,this.isMain_?this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])}):(Te.clearTimeout(this.mediaRequest_),this.mediaRequest_=Te.setTimeout(()=>this.haveMain_(),0))}requestMain_(e){let t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(i,r)=>{if(i){let{requestType:e}=r;i.metadata=ih({requestType:e,request:r,error:i})}if(this.requestErrored_(i,r))return void("HAVE_NOTHING"===this.state&&(this.started=!1));this.trigger({type:"manifestrequestcomplete",metadata:t});let s=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,this.mainLoaded_=r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):Date.now(),this.mainPlaylistLoader_.srcUrl=_u(this.mainPlaylistLoader_.srcUrl,r),!s)return e(r,s);this.handleMain_(),this.syncClientServerClock_(()=>e(r,s))})}syncClientServerClock_(e){let t=(e=>(e=>{let t=ur(e,"UTCTiming")[0];if(!t)return null;let i=mr(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;default:throw Error(Ni)}return i})(Tr(e)))(this.mainPlaylistLoader_.mainXml_);return null===t?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()):"DIRECT"===t.method?(this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:yu(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(i,r)=>{if(!this.request)return;if(i){let{requestType:t}=r;return this.error.metadata=ih({requestType:t,request:r,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let s;s="HEAD"===t.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):this.mainLoaded_:Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=s-Date.now(),e()}))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){Te.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;let e,t=this.mainPlaylistLoader_.main,i={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:i});try{e=(({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:r,previousManifest:s})=>{let n=((e,t={})=>{let i=((e,t={})=>{let{manifestUri:i="",NOW:r=Date.now(),clientOffset:s=0,eventHandler:n=function(){}}=t,a=ur(e,"Period");if(!a.length)throw Error(Pi);let o=ur(e,"Location"),l=mr(e),u=fr([{baseUrl:i}],ur(e,"BaseURL")),h=ur(e,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=r,l.clientOffset=s,o.length&&(l.locations=o.map(hr));let d=[];return a.forEach((e,t)=>{let i=mr(e),r=d[t-1];i.start=(({attributes:e,priorPeriodAttributes:t,mpdType:i})=>"number"==typeof e.start?e.start:t&&"number"==typeof t.start&&"number"==typeof t.duration?t.start+t.duration:t||"static"!==i?null:0)({attributes:i,priorPeriodAttributes:r?r.attributes:null,mpdType:l.type}),d.push({node:e,attributes:i})}),{locations:l.locations,contentSteeringInfo:vr(h,n),representationInfo:xi(d.map(br(l,u))),eventStream:xi(d.map(_r))}})(Tr(e),t),r=(e=>e.map(lr))(i.representationInfo);return tr({dashPlaylists:r,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})})(e,{manifestUri:t,clientOffset:i,sidxMapping:r,previousManifest:s});return eh(n,t,Lh),n})({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:t})}catch(t){this.error=t,this.error.metadata={errorType:cu.Error.StreamingDashManifestParserError,error:t},this.trigger("error")}t&&(e=((e,t,i)=>{let r=!0,s=vu(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e<t.playlists.length;e++){let n=t.playlists[e];if(n.sidx){let e=Wi(n.sidx);i&&i[e]&&i[e].sidx&&ji(n,i[e].sidx,n.sidx.resolvedUri)}let a=mh(s,n,Dh);a&&(s=a,r=!1)}return Qu(t,(e,t,i,n)=>{if(e.playlists&&e.playlists.length){let a=e.playlists[0].id,o=mh(s,e.playlists[0],Dh);o&&(s=o,n in s.mediaGroups[t][i]||(s.mediaGroups[t][i][n]=e),s.mediaGroups[t][i][n].playlists[0]=s.playlists[a],r=!1)}}),((e,t)=>{Qu(e,(i,r,s,n)=>{(!t.mediaGroups[r][s]||!(n in t.mediaGroups[r][s]))&&delete e.mediaGroups[r][s][n]})})(s,t),t.minimumUpdatePeriod!==e.minimumUpdatePeriod&&(r=!1),r?null:s})(t,e,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=e||t;let r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!t||e&&e.minimumUpdatePeriod!==t.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(e),e){let{duration:t,endList:r}=e,s=[];e.playlists.forEach(e=>{s.push({id:e.id,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS})}),i.parsedManifest={duration:t,isLive:!r,renditions:s},this.trigger({type:"manifestparsecomplete",metadata:i})}return!!e}updateMinimumUpdatePeriodTimeout_(){let e=this.mainPlaylistLoader_;e.createMupOnMedia_&&=(e.off("loadedmetadata",e.createMupOnMedia_),null),e.minimumUpdatePeriodTimeout_&&=(Te.clearTimeout(e.minimumUpdatePeriodTimeout_),null);let t=e.main&&e.main.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),"number"!=typeof t||t<=0?t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`):this.createMUPTimeout_(t)}createMUPTimeout_(e){let t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=Te.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&=this.mainPlaylistLoader_.main.playlists[this.media_.id],this.mainPlaylistLoader_.sidxMapping_=((e,t)=>{let i=Nh(e.playlists,t);return Qu(e,(e,r,s,n)=>{if(e.playlists&&e.playlists.length){let r=e.playlists;i=vu(i,Nh(r,t))}}),i})(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();let t=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==t[e];if(i?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){let e=()=>{this.media().endList||(this.mediaUpdateTimeout=Te.setTimeout(()=>{this.trigger("mediaupdatetimeout"),e()},gh(this.media(),!!i)))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){let e=this.mainPlaylistLoader_.main.eventStream.map(e=>({cueTime:e.start,frames:[{data:e.messageData}]}));this.addMetadataToTextTrack("EventStream",e,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){let t=new Set;for(let i in e.contentProtection){let r=e.contentProtection[i].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Uh={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const Bh=function(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e},Fh=function(e){return function(){let t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch{let t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}}(e),i=Bh(new Worker(t));i.objURL=t;let r=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),r.call(this)},i}},qh=function(e){return`var browserWorkerPolyFill = ${Bh.toString()};\nbrowserWorkerPolyFill(self);\n`+e},jh=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)};var Hh=Fh(qh(jh(function(){var e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof i.g<"u"?i.g:typeof self<"u"?self:{},t=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){var r;return!!e[t]&&(r=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(r,1),r>-1)},this.trigger=function(t){var i,r,s,n=e[t];if(n)if(2===arguments.length)for(r=n.length,i=0;i<r;++i)n[i].call(this,arguments[1]);else{for(s=[],i=arguments.length,i=1;i<arguments.length;++i)s.push(arguments[i]);for(r=n.length,i=0;i<r;++i)n[i].apply(this,s)}},this.dispose=function(){e={}}}};t.prototype.pipe=function(e){return this.on("data",function(t){e.push(t)}),this.on("done",function(t){e.flush(t)}),this.on("partialdone",function(t){e.partialFlush(t)}),this.on("endedtimeline",function(t){e.endTimeline(t)}),this.on("reset",function(t){e.reset(t)}),e},t.prototype.push=function(e){this.trigger("data",e)},t.prototype.flush=function(e){this.trigger("done",e)},t.prototype.partialFlush=function(e){this.trigger("partialdone",e)},t.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},t.prototype.reset=function(e){this.trigger("reset",e)};var r,s,n,a,o,l,u,h,d,c,p,m,g,f,y,_,b,v,T,S,C,E,w,k,I,x,A,P,M,D,L,O,N,R,U,B,F=t,q=2**32,j=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))<2**53-1?Number(t):t:i.getUint32(0)*q+i.getUint32(4)},H=q;(function(){var e;if(w={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},typeof Uint8Array<"u"){for(e in w)w.hasOwnProperty(e)&&(w[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);k=new Uint8Array([105,115,111,109]),x=new Uint8Array([97,118,99,49]),I=new Uint8Array([0,0,0,1]),A=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),P=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),M={video:A,audio:P},O=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),L=new Uint8Array([0,0,0,0,0,0,0,0]),N=new Uint8Array([0,0,0,0,0,0,0,0]),R=N,U=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),B=N,D=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),r=function(e){for(var t,i=[],r=0,s=1;s<arguments.length;s++)i.push(arguments[s]);for(s=i.length;s--;)r+=i[s].byteLength;for(t=new Uint8Array(r+8),new DataView(t.buffer,t.byteOffset,t.byteLength).setUint32(0,t.byteLength),t.set(e,4),s=0,r=8;s<i.length;s++)t.set(i[s],r),r+=i[s].byteLength;return t},s=function(){return r(w.dinf,r(w.dref,O))},n=function(e){return r(w.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},a=function(){return r(w.ftyp,k,I,k,x)},_=function(e){return r(w.hdlr,M[e])},o=function(e){return r(w.mdat,e)},y=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),r(w.mdhd,t)},f=function(e){return r(w.mdia,y(e),_(e.type),u(e))},l=function(e){return r(w.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},u=function(e){return r(w.minf,"video"===e.type?r(w.vmhd,D):r(w.smhd,L),s(),v(e))},h=function(e,t){for(var i=[],s=t.length;s--;)i[s]=S(t[s]);return r.apply(null,[w.moof,l(e)].concat(i))},d=function(e){for(var t=e.length,i=[];t--;)i[t]=m(e[t]);return r.apply(null,[w.moov,p(4294967295)].concat(i,c(e)))},c=function(e){for(var t=e.length,i=[];t--;)i[t]=C(e[t]);return r.apply(null,[w.mvex].concat(i))},p=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return r(w.mvhd,t)},b=function(e){for(var t,i=e.samples||[],s=new Uint8Array(4+i.length),n=0;n<i.length;n++)t=i[n].flags,s[n+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return r(w.sdtp,s)},v=function(e){return r(w.stbl,T(e),r(w.stts,B),r(w.stsc,R),r(w.stsz,U),r(w.stco,N))},function(){var e,t;T=function(i){return r(w.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===i.type?e(i):t(i))},e=function(e){for(var t,i=e.sps||[],s=e.pps||[],n=[],a=[],o=0;o<i.length;o++)n.push((65280&i[o].byteLength)>>>8),n.push(255&i[o].byteLength),n=n.concat(Array.prototype.slice.call(i[o]));for(o=0;o<s.length;o++)a.push((65280&s[o].byteLength)>>>8),a.push(255&s[o].byteLength),a=a.concat(Array.prototype.slice.call(s[o]));if(t=[w.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),r(w.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255,i.length].concat(n,[s.length],a))),r(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var l=e.sarRatio[0],u=e.sarRatio[1];t.push(r(w.pasp,new Uint8Array([(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l,(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u])))}return r.apply(null,t)},t=function(e){return r(w.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))}}(),g=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return r(w.tkhd,t)},S=function(e){var t,i,s,n=r(w.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),a=Math.floor(e.baseMediaDecodeTime/H),o=Math.floor(e.baseMediaDecodeTime%H);return t=r(w.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type?(i=E(e,92),r(w.traf,n,t,i)):(s=b(e),i=E(e,s.length+92),r(w.traf,n,t,i,s))},m=function(e){return e.duration=e.duration||4294967295,r(w.trak,g(e),f(e))},C=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),r(w.trex,t)},function(){var e,t,i=function(e,t){var i=0,r=0,s=0,n=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(r=2),void 0!==e[0].flags&&(s=4),void 0!==e[0].compositionTimeOffset&&(n=8)),[0,0,i|r|s|n,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]};t=function(e,t){var s,n,a,o,l,u=e.samples||[];for(t+=20+16*u.length,a=i(u,t),(n=new Uint8Array(a.length+16*u.length)).set(a),s=a.length,l=0;l<u.length;l++)o=u[l],n[s++]=(4278190080&o.duration)>>>24,n[s++]=(16711680&o.duration)>>>16,n[s++]=(65280&o.duration)>>>8,n[s++]=255&o.duration,n[s++]=(4278190080&o.size)>>>24,n[s++]=(16711680&o.size)>>>16,n[s++]=(65280&o.size)>>>8,n[s++]=255&o.size,n[s++]=o.flags.isLeading<<2|o.flags.dependsOn,n[s++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,n[s++]=61440&o.flags.degradationPriority,n[s++]=15&o.flags.degradationPriority,n[s++]=(4278190080&o.compositionTimeOffset)>>>24,n[s++]=(16711680&o.compositionTimeOffset)>>>16,n[s++]=(65280&o.compositionTimeOffset)>>>8,n[s++]=255&o.compositionTimeOffset;return r(w.trun,n)},e=function(e,t){var s,n,a,o,l,u=e.samples||[];for(t+=20+8*u.length,a=i(u,t),(s=new Uint8Array(a.length+8*u.length)).set(a),n=a.length,l=0;l<u.length;l++)o=u[l],s[n++]=(4278190080&o.duration)>>>24,s[n++]=(16711680&o.duration)>>>16,s[n++]=(65280&o.duration)>>>8,s[n++]=255&o.duration,s[n++]=(4278190080&o.size)>>>24,s[n++]=(16711680&o.size)>>>16,s[n++]=(65280&o.size)>>>8,s[n++]=255&o.size;return r(w.trun,s)},E=function(i,r){return"audio"===i.type?e(i,r):t(i,r)}}();var $,V={ftyp:a,mdat:o,moof:h,moov:d,initSegment:function(e){var t=a(),i=d(e),r=new Uint8Array(t.byteLength+i.byteLength);return r.set(t),r.set(i,t.byteLength),r}},z=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},W={groupNalsIntoFrames:function(e){var t,i,r=[],s=[];for(s.byteLength=0,s.nalCount=0,s.duration=0,r.byteLength=0,t=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(r.length&&(r.duration=i.dts-r.dts,s.byteLength+=r.byteLength,s.nalCount+=r.length,s.duration+=r.duration,s.push(r)),(r=[i]).byteLength=i.data.byteLength,r.pts=i.pts,r.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(r.keyFrame=!0),r.duration=i.dts-r.dts,r.byteLength+=i.data.byteLength,r.push(i));return s.length&&(!r.duration||r.duration<=0)&&(r.duration=s[s.length-1].duration),s.byteLength+=r.byteLength,s.nalCount+=r.length,s.duration+=r.duration,s.push(r),s},groupFramesIntoGops:function(e){var t,i,r=[],s=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,s.byteLength=0,s.nalCount=0,s.duration=0,s.pts=e[0].pts,s.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(r.length&&(s.push(r),s.byteLength+=r.byteLength,s.nalCount+=r.nalCount,s.duration+=r.duration),(r=[i]).nalCount=i.length,r.byteLength=i.byteLength,r.pts=i.pts,r.dts=i.dts,r.duration=i.duration):(r.duration+=i.duration,r.nalCount+=i.length,r.byteLength+=i.byteLength,r.push(i));return s.length&&r.duration<=0&&(r.duration=s[s.length-1].duration),s.byteLength+=r.byteLength,s.nalCount+=r.nalCount,s.duration+=r.duration,s.push(r),s},extendFirstKeyFrame:function(e){var t;return!e[0][0].keyFrame&&e.length>1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},generateSampleTable:function(e,t){var i,r,s,n,a,o=t||0,l=[];for(i=0;i<e.length;i++)for(n=e[i],r=0;r<n.length;r++)a=n[r],o+=(s=z(a,o)).size,l.push(s);return l},concatenateNalData:function(e){var t,i,r,s,n,a,o=0,l=e.byteLength+4*e.nalCount,u=new Uint8Array(l),h=new DataView(u.buffer);for(t=0;t<e.length;t++)for(s=e[t],i=0;i<s.length;i++)for(n=s[i],r=0;r<n.length;r++)a=n[r],h.setUint32(o,a.data.byteLength),o+=4,u.set(a.data,o),o+=a.data.byteLength;return u},generateSampleTableForFrame:function(e,t){var i,r=[];return i=z(e,t||0),r.push(i),r},concatenateNalDataForFrame:function(e){var t,i,r=0,s=e.byteLength+4*e.length,n=new Uint8Array(s),a=new DataView(n.buffer);for(t=0;t<e.length;t++)i=e[t],a.setUint32(r,i.data.byteLength),r+=4,n.set(i.data,r),r+=i.data.byteLength;return n}},G=[33,16,5,32,164,27],X=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],K=function(e){for(var t=[];e--;)t.push(0);return t},Z=9e4,Y=function(e){return e*Z},Q=function(e,t){return e*t},J=function(e){return e/Z},ee=function(e,t){return e/t},te={ONE_SECOND_IN_TS:Z,secondsToVideoTs:Y,secondsToAudioTs:Q,videoTsToSeconds:J,audioTsToSeconds:ee,audioTsToVideoTs:function(e,t){return Y(ee(e,t))},videoTsToAudioTs:function(e,t){return Q(J(e),t)},metadataTsToSeconds:function(e,t,i){return J(i?e:e-t)}},ie=te,re={prefixWithSilence:function(e,t,i,r){var s,n,a,o,l=0,u=0,h=0,d=0;if(t.length&&(s=ie.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),l=Math.ceil(ie.ONE_SECOND_IN_TS/(e.samplerate/1024)),i&&r&&(u=s-Math.max(i,r),d=(h=Math.floor(u/l))*l),!(h<1||d>ie.ONE_SECOND_IN_TS/2))){for(n=($||=function(e){return Object.keys(e).reduce(function(t,i){return t[i]=new Uint8Array(e[i].reduce(function(e,t){return e.concat(t)},[])),t},{})}({96e3:[G,[227,64],K(154),[56]],88200:[G,[231],K(170),[56]],64e3:[G,[248,192],K(240),[56]],48e3:[G,[255,192],K(268),[55,148,128],K(54),[112]],44100:[G,[255,192],K(268),[55,163,128],K(84),[112]],32e3:[G,[255,192],K(268),[55,234],K(226),[112]],24e3:[G,[255,192],K(268),[55,255,128],K(268),[111,112],K(126),[224]],16e3:[G,[255,192],K(268),[55,255,128],K(268),[111,255],K(269),[223,108],K(195),[1,192]],12e3:[X,K(268),[3,127,248],K(268),[6,255,240],K(268),[13,255,224],K(268),[27,253,128],K(259),[56]],11025:[X,K(268),[3,127,248],K(268),[6,255,240],K(268),[13,255,224],K(268),[27,255,192],K(268),[55,175,128],K(108),[112]],8e3:[X,K(268),[3,121,16],K(47),[7]]}),$)[e.samplerate],n||=t[0].data,a=0;a<h;a++)o=t[0],t.splice(0,0,{data:n,dts:o.dts-l,pts:o.pts-l});return e.baseMediaDecodeTime-=Math.floor(ie.videoTsToAudioTs(d,e.samplerate)),d}},trimAdtsFramesByEarliestDts:function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},generateSampleTable:function(e){var t,i,r=[];for(t=0;t<e.length;t++)i=e[t],r.push({size:i.data.byteLength,duration:1024});return r},concatenateFrameData:function(e){var t,i,r=0,s=new Uint8Array(function(e){var t,i=0;for(t=0;t<e.length;t++)i+=e[t].data.byteLength;return i}(e));for(t=0;t<e.length;t++)i=e[t],s.set(i.data,r),r+=i.data.byteLength;return s}},se=te.ONE_SECOND_IN_TS,ne={clearDtsInfo:function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(e,t){var i,r=e.minSegmentDts;return t||(r-=e.timelineStartInfo.dts),i=e.timelineStartInfo.baseMediaDecodeTime,i+=r,i=Math.max(0,i),"audio"===e.type&&(i*=e.samplerate/se,i=Math.floor(i)),i},collectDtsInfo:function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),e.minSegmentPts=void 0===e.minSegmentPts?t.pts:Math.min(e.minSegmentPts,t.pts),e.maxSegmentPts=void 0===e.maxSegmentPts?t.pts:Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),e.minSegmentDts=void 0===e.minSegmentDts?t.dts:Math.min(e.minSegmentDts,t.dts),e.maxSegmentDts=void 0===e.maxSegmentDts?t.dts:Math.max(e.maxSegmentDts,t.dts))}},ae={parseSei:function(e){for(var t=0,i={payloadType:-1,payloadSize:0},r=0,s=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)r+=255,t++;for(r+=e[t++];255===e[t];)s+=255,t++;if(s+=e[t++],!i.payload&&4===r){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=r,i.payloadSize=s,i.payload=e.subarray(t,t+s);break}i.payload=void 0}t+=s,r=0,s=0}return i},parseUserData:function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},parseCaptionPackets:function(e,t){var i,r,s,n,a=[];if(!(64&t[0]))return a;for(r=31&t[0],i=0;i<r;i++)n={type:3&t[2+(s=3*i)],pts:e},4&t[s+2]&&(n.ccData=t[s+3]<<8|t[s+4],a.push(n));return a},discardEmulationPreventionBytes:function(e){for(var t,i,r=e.byteLength,s=[],n=1;n<r-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(s.push(n+2),n+=2):n++;if(0===s.length)return e;t=r-s.length,i=new Uint8Array(t);var a=0;for(n=0;n<t;a++,n++)a===s[0]&&(a++,s.shift()),i[n]=e[a];return i},USER_DATA_REGISTERED_ITU_T_T35:4},oe=F,le=ae,ue=function(e){e||={},ue.prototype.init.call(this),this.parse708captions_="boolean"!=typeof e.parse708captions||e.parse708captions,this.captionPackets_=[],this.ccStreams_=[new be(0,0),new be(0,1),new be(1,0),new be(1,1)],this.parse708captions_&&(this.cc708Stream_=new me({captionServices:e.captionServices})),this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};ue.prototype=new oe,ue.prototype.push=function(e){var t,i,r;"sei_rbsp"===e.nalUnitType&&(t=le.parseSei(e.escapedRBSP)).payload&&t.payloadType===le.USER_DATA_REGISTERED_ITU_T_T35&&(i=le.parseUserData(t))&&(e.dts<this.latestDts_?this.ignoreNextEqualDts_=!0:e.dts===this.latestDts_&&this.ignoreNextEqualDts_?(this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1)):(r=le.parseCaptionPackets(e.pts,i),this.captionPackets_=this.captionPackets_.concat(r),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts))},ue.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)},ue.prototype.flushStream=function(e){this.captionPackets_.length&&(this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts}),this.captionPackets_.forEach(function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)},this),this.captionPackets_.length=0),this.flushCCStreams(e)},ue.prototype.flush=function(){return this.flushStream("flush")},ue.prototype.partialFlush=function(){return this.flushStream("partialFlush")},ue.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},ue.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},ue.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},ue.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},ue.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},ue.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var he={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},de=function(e){return 32<=e&&e<=127||160<=e&&e<=255},ce=function(e){this.windowNum=e,this.reset()};ce.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},ce.prototype.getText=function(){return this.rows.join("\n")},ce.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ce.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ce.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},ce.prototype.addText=function(e){this.rows[this.rowIdx]+=e},ce.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var pe=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new ce(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};pe.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new ce(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},pe.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},pe.prototype.createTextDecoder=function(e){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var me=function(e){e||={},me.prototype.init.call(this);var t,i=this,r=e.captionServices||{},s={};Object.keys(r).forEach(e=>{t=r[e],/^SERVICE/.test(e)&&(s[e]=t.encoding)}),this.serviceEncodings=s,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(i.new708Packet(),i.add708Bytes(e)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(e))}};me.prototype=new oe,me.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},me.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,r=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(r)},me.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,r=null,s=0,n=t[s++];for(e.seq=n>>6,e.sizeCode=63&n;s<t.length;s++)r=31&(n=t[s++]),7==(i=n>>5)&&r>0&&(i=n=t[s++]),this.pushServiceBlock(i,s,r),r>0&&(s+=r-1)},me.prototype.pushServiceBlock=function(e,t,i){var r,s=t,n=this.current708Packet.data,a=this.services[e];for(a||=this.initService(e,s);s<t+i&&s<n.length;s++)r=n[s],de(r)?s=this.handleText(s,a):24===r?s=this.multiByteCharacter(s,a):16===r?s=this.extendedCommands(s,a):128<=r&&r<=135?s=this.setCurrentWindow(s,a):152<=r&&r<=159?s=this.defineWindow(s,a):136===r?s=this.clearWindows(s,a):140===r?s=this.deleteWindows(s,a):137===r?s=this.displayWindows(s,a):138===r?s=this.hideWindows(s,a):139===r?s=this.toggleWindows(s,a):151===r?s=this.setWindowAttributes(s,a):144===r?s=this.setPenAttributes(s,a):145===r?s=this.setPenColor(s,a):146===r?s=this.setPenLocation(s,a):143===r?a=this.reset(s,a):8===r?a.currentWindow.backspace():12===r?a.currentWindow.clearText():13===r?a.currentWindow.pendingNewLine=!0:14===r?a.currentWindow.clearText():141===r&&s++},me.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data[++e];return de(i)&&(e=this.handleText(e,t,{isExtended:!0})),e},me.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},me.prototype.initService=function(e,t){var i,r,s=this;return(i="SERVICE"+e)in this.serviceEncodings&&(r=this.serviceEncodings[i]),this.services[e]=new pe(e,r,s),this.services[e].init(this.getPts(t),function(t){s.flushDisplayed(t,s.services[e])}),this.services[e]},me.prototype.handleText=function(e,t,i){var r,s,n=i&&i.isExtended,a=i&&i.isMultiByte,o=this.current708Packet.data,l=n?4096:0,u=o[e],h=o[e+1],d=t.currentWindow;if(a?(s=[u,h],e++):s=[u],t.textDecoder_&&!n)r=t.textDecoder_.decode(new Uint8Array(s));else if(a){let e=function(e){return e.map(e=>("0"+(255&e).toString(16)).slice(-2)).join("")}(s);r=String.fromCharCode(parseInt(e,16))}else r=function(e){var t=he[e]||e;return 4096&e&&e===t?"":String.fromCharCode(t)}(l|u);return d.pendingNewLine&&!d.isEmpty()&&d.newLine(this.getPts(e)),d.pendingNewLine=!1,d.addText(r),e},me.prototype.multiByteCharacter=function(e,t){var i=this.current708Packet.data,r=i[e+1],s=i[e+2];return de(r)&&de(s)&&(e=this.handleText(++e,t,{isMultiByte:!0})),e},me.prototype.setCurrentWindow=function(e,t){var i=7&this.current708Packet.data[e];return t.setCurrentWindow(i),e},me.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,r=i[e],s=7&r;t.setCurrentWindow(s);var n=t.currentWindow;return r=i[++e],n.visible=(32&r)>>5,n.rowLock=(16&r)>>4,n.columnLock=(8&r)>>3,n.priority=7&r,r=i[++e],n.relativePositioning=(128&r)>>7,n.anchorVertical=127&r,r=i[++e],n.anchorHorizontal=r,r=i[++e],n.anchorPoint=(240&r)>>4,n.rowCount=15&r,r=i[++e],n.columnCount=63&r,r=i[++e],n.windowStyle=(56&r)>>3,n.penStyle=7&r,n.virtualRowCount=n.rowCount+1,e},me.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.winAttr;return r=i[++e],s.fillOpacity=(192&r)>>6,s.fillRed=(48&r)>>4,s.fillGreen=(12&r)>>2,s.fillBlue=3&r,r=i[++e],s.borderType=(192&r)>>6,s.borderRed=(48&r)>>4,s.borderGreen=(12&r)>>2,s.borderBlue=3&r,r=i[++e],s.borderType+=(128&r)>>5,s.wordWrap=(64&r)>>6,s.printDirection=(48&r)>>4,s.scrollDirection=(12&r)>>2,s.justify=3&r,r=i[++e],s.effectSpeed=(240&r)>>4,s.effectDirection=(12&r)>>2,s.displayEffect=3&r,e},me.prototype.flushDisplayed=function(e,t){for(var i=[],r=0;r<8;r++)t.windows[r].visible&&!t.windows[r].isEmpty()&&i.push(t.windows[r].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},me.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},me.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible=1);return e},me.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible=0);return e},me.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)i&1<<s&&(t.windows[s].visible^=1);return e},me.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)i&1<<s&&t.windows[s].clearText();return e},me.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],r=this.getPts(e);this.flushDisplayed(r,t);for(var s=0;s<8;s++)i&1<<s&&t.windows[s].reset();return e},me.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.penAttr;return r=i[++e],s.textTag=(240&r)>>4,s.offset=(12&r)>>2,s.penSize=3&r,r=i[++e],s.italics=(128&r)>>7,s.underline=(64&r)>>6,s.edgeType=(56&r)>>3,s.fontStyle=7&r,e},me.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.penColor;return r=i[++e],s.fgOpacity=(192&r)>>6,s.fgRed=(48&r)>>4,s.fgGreen=(12&r)>>2,s.fgBlue=3&r,r=i[++e],s.bgOpacity=(192&r)>>6,s.bgRed=(48&r)>>4,s.bgGreen=(12&r)>>2,s.bgBlue=3&r,r=i[++e],s.edgeRed=(48&r)>>4,s.edgeGreen=(12&r)>>2,s.edgeBlue=3&r,e},me.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,r=i[e],s=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,r=i[++e],s.row=15&r,r=i[++e],s.column=63&r,e},me.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var ge={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},fe=function(e){return null===e?"":(e=ge[e]||e,String.fromCharCode(e))},ye=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],_e=function(){for(var e=[],t=15;t--;)e.push({text:"",indent:0,offset:0});return e},be=function(e,t){be.prototype.init.call(this),this.field_=e||0,this.dataChannel_=t||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,r,s,n=32639&e.ccData;if(n===this.lastControlCode_)this.lastControlCode_=null;else if(4096==(61440&n)?this.lastControlCode_=n:n!==this.PADDING_&&(this.lastControlCode_=null),i=n>>>8,r=255&n,n!==this.PADDING_)if(n===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(n===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),t=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=t,this.startPts_=e.pts;else if(n===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(n===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(n===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(n===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(n===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(n===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=_e();else if(n===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=_e();else if(n===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=_e()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(i,r))s=fe((i=(3&i)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isExtCharacter(i,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),s=fe((i=(3&i)<<8)|r),this[this.mode_](e.pts,s),this.column_++;else if(this.isMidRowCode(i,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,!(14&~r)&&this.addFormatting(e.pts,["i"]),!(1&~r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(i,r)){let e=3&r;this.nonDisplayed_[this.row_].offset=e,this.column_+=e}else if(this.isPAC(i,r)){var a=ye.indexOf(7968&n);if("rollUp"===this.mode_&&(a-this.rollUpRows_+1<0&&(a=this.rollUpRows_-1),this.setRollUp(e.pts,a)),a!==this.row_&&a>=0&&a<=14&&(this.clearFormatting(e.pts),this.row_=a),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),!(16&~n)){let e=(14&n)>>1;this.column_=4*e,this.nonDisplayed_[this.row_].indent+=e}this.isColorPAC(r)&&!(14&~r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(i)&&(0===r&&(r=null),s=fe(i),s+=fe(r),this[this.mode_](e.pts,s),this.column_+=s.length)}};be.prototype=new oe,be.prototype.flushDisplayed=function(e){let t=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})},i=[];this.displayed_.forEach((e,r)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch{t(r)}e.text.length&&i.push({text:e.text,line:r+1,position:10+Math.min(70,10*e.indent)+2.5*e.offset})}else e??t(r)}),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,content:i,stream:this.name_})},be.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=_e(),this.nonDisplayed_=_e(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},be.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},be.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},be.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},be.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},be.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},be.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&t>=64&&t<=127},be.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},be.prototype.isNormalChar=function(e){return e>=32&&e<=127},be.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=_e(),this.displayed_=_e()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]={text:"",indent:0,offset:0};void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},be.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t);var i=t.reduce(function(e,t){return e+"<"+t+">"},"");this[this.mode_](e,i)},be.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},"");this.formatting_=[],this[this.mode_](e,t)}},be.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t,this.nonDisplayed_[this.row_].text=i},be.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i},be.prototype.shiftRowsUp_=function(){for(var e=0;e<this.topRow_;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.row_+1;e<15;e++)this.displayed_[e]={text:"",indent:0,offset:0};for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},be.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_].text;i+=t,this.displayed_[this.row_].text=i};var ve={CaptionStream:ue,Cea608Stream:be,Cea708Stream:me},Te={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Se=F,Ce="shared",Ee=function(e,t){var i=1;for(e>t&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},we=function(e){var t,i;we.prototype.init.call(this),this.type_=e||Ce,this.push=function(e){"metadata"===e.type?this.trigger("data",e):(this.type_===Ce||e.type===this.type_)&&(void 0===i&&(i=e.dts),e.dts=Ee(e.dts,i),e.pts=Ee(e.pts,i),t=e.dts,this.trigger("data",e))},this.flush=function(){i=t,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=void 0,t=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};we.prototype=new Se;var ke={TimestampRolloverStream:we,handleRollover:Ee},Ie=(e,t,i)=>{if(!e)return-1;for(var r=i;r<e.length;r++)if(e[r]===t)return r;return-1},xe=function(e,t,i){var r,s="";for(r=t;r<i;r++)s+="%"+("00"+e[r].toString(16)).slice(-2);return s},Ae=function(e,t,i){return decodeURIComponent(xe(e,t,i))},Pe=function(e,t,i){return unescape(xe(e,t,i))},Me=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},De={APIC:function(e){var t,i,r=1;3===e.data[0]&&!((t=Ie(e.data,0,r))<0)&&(e.mimeType=Pe(e.data,r,t),r=t+1,e.pictureType=e.data[r],r++,!((i=Ie(e.data,0,r))<0)&&(e.description=Ae(e.data,r,i),r=i+1,"--\x3e"===e.mimeType?e.url=Pe(e.data,r,e.data.length):e.pictureData=e.data.subarray(r,e.data.length)))},"T*":function(e){3===e.data[0]&&(e.value=Ae(e.data,1,e.data.length).replace(/\0*$/,""),e.values=e.value.split("\0"))},TXXX:function(e){var t;3===e.data[0]&&-1!==(t=Ie(e.data,0,1))&&(e.description=Ae(e.data,1,t),e.value=Ae(e.data,t+1,e.data.length).replace(/\0*$/,""),e.data=e.value)},"W*":function(e){e.url=Pe(e.data,0,e.data.length).replace(/\0.*$/,"")},WXXX:function(e){var t;3===e.data[0]&&-1!==(t=Ie(e.data,0,1))&&(e.description=Ae(e.data,1,t),e.url=Pe(e.data,t+1,e.data.length).replace(/\0.*$/,""))},PRIV:function(e){for(var t=0;t<e.data.length;t++)if(0===e.data[t]){e.owner=Pe(e.data,0,t);break}e.privateData=e.data.subarray(t+1),e.data=e.privateData}},Le={parseId3Frames:function(e){var t,i=10,r=0,s=[];if(!(e.length<10||73!==e[0]||68!==e[1]||51!==e[2])){r=Me(e.subarray(6,10)),r+=10,64&e[5]&&(i+=4,i+=Me(e.subarray(10,14)),r-=Me(e.subarray(16,20)));do{if((t=Me(e.subarray(i+4,i+8)))<1)break;var n={id:String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]),data:e.subarray(i+10,i+t+10)};n.key=n.id,De[n.id]?De[n.id](n):"T"===n.id[0]?De["T*"](n):"W"===n.id[0]&&De["W*"](n),s.push(n),i+=10,i+=t}while(i<r);return s}},parseSyncSafeInteger:Me,frameParsers:De},Oe=F,Ne=Te,Re=Le,Ue=function(e){var t,i={descriptor:e&&e.descriptor},r=0,s=[],n=0;if(Ue.prototype.init.call(this),this.dispatchType=Ne.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,a,o,l;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(n=0,s.length=0),0===s.length&&(e.data.length<10||73!==e.data[0]||68!==e.data[1]||51!==e.data[2]))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(s.push(e),n+=e.data.byteLength,1===s.length&&(r=Re.parseSyncSafeInteger(e.data.subarray(6,10)),r+=10),!(n<r)){for(t={data:new Uint8Array(r),frames:[],pts:s[0].pts,dts:s[0].dts},l=0;l<r;)t.data.set(s[0].data.subarray(0,r-l),l),l+=s[0].data.byteLength,n-=s[0].data.byteLength,s.shift();i=10,64&t.data[5]&&(i+=4,i+=Re.parseSyncSafeInteger(t.data.subarray(10,14)),r-=Re.parseSyncSafeInteger(t.data.subarray(16,20)));do{if((a=Re.parseSyncSafeInteger(t.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((o={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+a+10)}).key=o.id,Re.frameParsers[o.id]?Re.frameParsers[o.id](o):"T"===o.id[0]?Re.frameParsers["T*"](o):"W"===o.id[0]&&Re.frameParsers["W*"](o),"com.apple.streaming.transportStreamTimestamp"===o.owner){var u=o.data,h=(1&u[3])<<30|u[4]<<22|u[5]<<14|u[6]<<6|u[7]>>>2;h*=4,h+=3&u[7],o.timeStamp=h,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=a}while(i<r);this.trigger("data",t)}}};Ue.prototype=new Oe;var Be,Fe,qe,je=Ue,He=F,$e=ve,Ve=Te,ze=ke.TimestampRolloverStream,We=188;Be=function(){var e=new Uint8Array(We),t=0;Be.prototype.init.call(this),this.push=function(i){var r,s=0,n=We;for(t?((r=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),r.set(i,t),t=0):r=i;n<r.byteLength;)71===r[s]&&71===r[n]?(this.trigger("data",r.subarray(s,n)),s+=We,n+=We):(s++,n++);s<r.byteLength&&(e.set(r.subarray(s),0),t=r.byteLength-s)},this.flush=function(){t===We&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}},Be.prototype=new He,Fe=function(){var e,t,i,r;Fe.prototype.init.call(this),r=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,r){var s=0;r.payloadUnitStartIndicator&&(s+=e[s]+1),"pat"===r.type?t(e.subarray(s),r):i(e.subarray(s),r)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],r.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=r.pmtPid},i=function(e,t){var i,s;if(1&e[5]){for(r.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,s=12+((15&e[10])<<8|e[11]);s<i;){var n=e[s],a=(31&e[s+1])<<8|e[s+2];n===Ve.H264_STREAM_TYPE&&null===r.programMapTable.video?r.programMapTable.video=a:n===Ve.ADTS_STREAM_TYPE&&null===r.programMapTable.audio?r.programMapTable.audio=a:n===Ve.METADATA_STREAM_TYPE&&(r.programMapTable["timed-metadata"][a]=n),s+=5+((15&e[s+3])<<8|e[s+4])}t.programMapTable=r.programMapTable}},this.push=function(t){var i={},r=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],(48&t[3])>>>4>1&&(r+=t[r]+1),0===i.pid)i.type="pat",e(t.subarray(r),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(r),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,r,i]):this.processPes_(t,r,i)},this.processPes_=function(e,t,i){i.streamType=i.pid===this.programMapTable.video?Ve.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?Ve.ADTS_STREAM_TYPE:this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}},Fe.prototype=new He,Fe.STREAM_TYPES={h264:27,adts:15},qe=function(){var e,t=this,i=!1,r={data:[],size:0},s={data:[],size:0},n={data:[],size:0},a=function(e,i,r){var s,n=new Uint8Array(e.size),a={type:i},o=0,l=0,u=!1;if(e.data.length&&!(e.size<9)){for(a.trackId=e.data[0].pid,o=0;o<e.data.length;o++)s=e.data[o],n.set(s.data,l),l+=s.data.byteLength;(function(e,t){var i;let r=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array,1===r&&(t.packetLength=6+(e[4]<<8|e[5]),t.dataAlignmentIndicator=!!(4&e[6]),192&(i=e[7])&&(t.pts=(14&e[9])<<27|(255&e[10])<<20|(254&e[11])<<12|(255&e[12])<<5|(254&e[13])>>>3,t.pts*=4,t.pts+=(6&e[13])>>>1,t.dts=t.pts,64&i&&(t.dts=(14&e[14])<<27|(255&e[15])<<20|(254&e[16])<<12|(255&e[17])<<5|(254&e[18])>>>3,t.dts*=4,t.dts+=(6&e[18])>>>1)),t.data=e.subarray(9+e[8]))})(n,a),u="video"===i||a.packetLength<=e.size,(r||u)&&(e.size=0,e.data.length=0),u&&t.trigger("data",a)}};qe.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case Ve.H264_STREAM_TYPE:e=r,t="video";break;case Ve.ADTS_STREAM_TYPE:e=s,t="audio";break;case Ve.METADATA_STREAM_TYPE:e=n,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&a(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var r={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",r)}})[o.type]()},this.reset=function(){r.size=0,r.data.length=0,s.size=0,s.data.length=0,this.trigger("reset")},this.flushStreams_=function(){a(r,"video"),a(s,"audio"),a(n,"timed-metadata")},this.flush=function(){if(!i&&e){var r={type:"metadata",tracks:[]};null!==e.video&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&r.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",r)}i=!1,this.flushStreams_(),this.trigger("done")}},qe.prototype=new He;var Ge={PAT_PID:0,MP2T_PACKET_LENGTH:We,TransportPacketStream:Be,TransportParseStream:Fe,ElementaryStream:qe,TimestampRolloverStream:ze,CaptionStream:$e.CaptionStream,Cea608Stream:$e.Cea608Stream,Cea708Stream:$e.Cea708Stream,MetadataStream:je};for(var Xe in Ve)Ve.hasOwnProperty(Xe)&&(Ge[Xe]=Ve[Xe]);var Ke,Ze=Ge,Ye=F,Qe=te.ONE_SECOND_IN_TS,Je=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];Ke=function(e){var t,i=0;Ke.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:`adts skiping bytes ${e} to ${t} in frame ${i} outside syncword`})},this.push=function(r){var s,n,a,o,l,u=0;if(e||(i=0),"audio"===r.type){t&&t.length?(a=t,(t=new Uint8Array(a.byteLength+r.data.byteLength)).set(a),t.set(r.data,a.byteLength)):t=r.data;for(var h;u+7<t.length;)if(255!==t[u]||240!=(246&t[u+1]))"number"!=typeof h&&(h=u),u++;else{if("number"==typeof h&&(this.skipWarn_(h,u),h=null),n=2*(1&~t[u+1]),s=(3&t[u+3])<<11|t[u+4]<<3|(224&t[u+5])>>5,l=(o=1024*(1+(3&t[u+6])))*Qe/Je[(60&t[u+2])>>>2],t.byteLength-u<s)break;this.trigger("data",{pts:r.pts+i*l,dts:r.dts+i*l,sampleCount:o,audioobjecttype:1+(t[u+2]>>>6&3),channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:Je[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+n,u+s)}),i++,u+=s}"number"==typeof h&&(this.skipWarn_(h,u),h=null),t=t.subarray(u)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}},Ke.prototype=new Ye;var et,tt,it=Ke,rt=F,st=function(e){var t=e.byteLength,i=0,r=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+r},this.loadWord=function(){var s=e.byteLength-t,n=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw Error("no bytes available");n.set(e.subarray(s,s+a)),i=new DataView(n.buffer).getUint32(0),r=8*a,t-=a},this.skipBits=function(e){var s;r>e?(i<<=e,r-=e):(e-=r,e-=8*(s=Math.floor(e/8)),t-=s,this.loadWord(),i<<=e,r-=e)},this.readBits=function(e){var s=Math.min(r,e),n=i>>>32-s;return(r-=s)>0?i<<=s:t>0&&this.loadWord(),(s=e-s)>0?n<<s|this.readBits(s):n},this.skipLeadingZeros=function(){for(var e=0;e<r;++e)if(i&2147483648>>>e)return i<<=e,r-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},nt=function(){var e,t,i=0;nt.prototype.init.call(this),this.push=function(r){var s;t?((s=new Uint8Array(t.byteLength+r.data.byteLength)).set(t),s.set(r.data,t.byteLength),t=s):t=r.data;for(var n=t.byteLength;i<n-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<n;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));do{e++}while(1!==t[e]&&e<n);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&t.byteLength>3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}};nt.prototype=new rt,tt={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},et=function(){var e,t,i,r,s,n,a,o=new nt;et.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,r=e.dts,o.push(e))},o.on("data",function(a){var o={trackId:t,pts:i,dts:r,data:a,nalUnitTypeCode:31&a[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=s(a.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=s(a.subarray(1)),o.config=n(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)}),o.on("done",function(){e.trigger("done")}),o.on("partialdone",function(){e.trigger("partialdone")}),o.on("reset",function(){e.trigger("reset")}),o.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},a=function(e,t){for(var i=8,r=8,s=0;s<e;s++)0!==r&&(r=(i+t.readExpGolomb()+256)%256),i=0===r?i:r},s=function(e){for(var t,i,r=e.byteLength,s=[],n=1;n<r-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(s.push(n+2),n+=2):n++;if(0===s.length)return e;t=r-s.length,i=new Uint8Array(t);var a=0;for(n=0;n<t;a++,n++)a===s[0]&&(a++,s.shift()),i[n]=e[a];return i},n=function(e){var t,i,r,s,n,o,l,u,h,d,c,p,m=0,g=0,f=0,y=0,_=[1,1];if(i=(t=new st(e)).readUnsignedByte(),s=t.readUnsignedByte(),r=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),tt[i]&&(3===(n=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(c=3===n?12:8,p=0;p<c;p++)t.readBoolean()&&a(p<6?16:64,t);if(t.skipUnsignedExpGolomb(),0===(o=t.readUnsignedExpGolomb()))t.readUnsignedExpGolomb();else if(1===o)for(t.skipBits(1),t.skipExpGolomb(),t.skipExpGolomb(),l=t.readUnsignedExpGolomb(),p=0;p<l;p++)t.skipExpGolomb();if(t.skipUnsignedExpGolomb(),t.skipBits(1),u=t.readUnsignedExpGolomb(),h=t.readUnsignedExpGolomb(),0===(d=t.readBits(1))&&t.skipBits(1),t.skipBits(1),t.readBoolean()&&(m=t.readUnsignedExpGolomb(),g=t.readUnsignedExpGolomb(),f=t.readUnsignedExpGolomb(),y=t.readUnsignedExpGolomb()),t.readBoolean()&&t.readBoolean()){switch(t.readUnsignedByte()){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:_=[t.readUnsignedByte()<<8|t.readUnsignedByte(),t.readUnsignedByte()<<8|t.readUnsignedByte()]}_&&(_[0],_[1])}return{profileIdc:i,levelIdc:r,profileCompatibility:s,width:16*(u+1)-2*m-2*g,height:(2-d)*(h+1)*16-2*f-2*y,sarRatio:_}}},et.prototype=new rt;var at={H264Stream:et},ot=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],lt=function(e,t){var i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return i=i>=0?i:0,(16&e[t+5])>>4?i+20:i+10},ut=function(e,t){return e.length-t<10||73!==e[t]||68!==e[t+1]||51!==e[t+2]?t:(t+=lt(e,t),ut(e,t))},ht=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},dt=function(e,t,i){return unescape(function(e,t,i){var r,s="";for(r=t;r<i;r++)s+="%"+("00"+e[r].toString(16)).slice(-2);return s}(e,t,i))},ct={isLikelyAacData:function(e){var t=ut(e,0);return e.length>=t+2&&!(255&~e[t])&&!(240&~e[t+1])&&16==(22&e[t+1])},parseId3TagSize:lt,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,r=e[t+4]<<3;return 6144&e[t+3]|r|i},parseType:function(e,t){return 73===e[t]&&68===e[t+1]&&51===e[t+2]?"timed-metadata":!0&e[t]&&!(240&~e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return ot[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i,r=10;64&e[5]&&(r+=4,r+=ht(e.subarray(10,14)));do{if((t=ht(e.subarray(r+4,r+8)))<1)return null;if("PRIV"===String.fromCharCode(e[r],e[r+1],e[r+2],e[r+3])){i=e.subarray(r+10,r+t+10);for(var s=0;s<i.byteLength;s++)if(0===i[s]){if("com.apple.streaming.transportStreamTimestamp"===dt(i,0,s)){var n=i.subarray(s+1),a=(1&n[3])<<30|n[4]<<22|n[5]<<14|n[6]<<6|n[7]>>>2;return(a*=4)+(3&n[7])}break}}r+=10,r+=t}while(r<e.byteLength);return null}},pt=F,mt=ct,gt=function(){var e=new Uint8Array,t=0;gt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var r,s,n,a,o=0,l=0;for(e.length?(a=e.length,(e=new Uint8Array(i.byteLength+a)).set(e.subarray(0,a)),e.set(i,a)):e=i;e.length-l>=3;)if(73===e[l]&&68===e[l+1]&&51===e[l+2]){if(e.length-l<10||l+(o=mt.parseId3TagSize(e,l))>e.length)break;s={type:"timed-metadata",data:e.subarray(l,l+o)},this.trigger("data",s),l+=o}else if(255&~e[l]||240&~e[l+1])l++;else{if(e.length-l<7||l+(o=mt.parseAdtsSize(e,l))>e.length)break;n={type:"audio",data:e.subarray(l,l+o),pts:t,dts:t},this.trigger("data",n),l+=o}r=e.length-l,e=r>0?e.subarray(l):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}};gt.prototype=new pt;var ft,yt,_t,bt,vt=F,Tt=V,St=W,Ct=re,Et=ne,wt=Ze,kt=te,It=it,xt=at.H264Stream,At=gt,Pt=ct.isLikelyAacData,Mt=te.ONE_SECOND_IN_TS,Dt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Lt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Ot=function(e,t){t.stream=e,this.trigger("log",t)},Nt=function(e,t){for(var i=Object.keys(t),r=0;r<i.length;r++){var s=i[r];"headOfPipeline"!==s&&t[s].on&&t[s].on("log",Ot.bind(e,s))}},Rt=function(e,t){var i;if(e.length!==t.length)return!1;for(i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},Ut=function(e,t,i,r,s,n){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(r-t),pts:e+(s-i)},prependedContentDuration:n,baseMediaDecodeTime:e}};yt=function(e,t){var i,r=[],s=0,n=0,a=1/0;t||={},i=t.firstSequenceNumber||0,yt.prototype.init.call(this),this.push=function(t){Et.collectDtsInfo(e,t),e&&Dt.forEach(function(i){e[i]=t[i]}),r.push(t)},this.setEarliestDts=function(e){s=e},this.setVideoBaseMediaDecodeTime=function(e){a=e},this.setAudioAppendStart=function(e){n=e},this.flush=function(){var o,l,u,h,d,c,p;0===r.length||(o=Ct.trimAdtsFramesByEarliestDts(r,e,s),e.baseMediaDecodeTime=Et.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),p=Ct.prefixWithSilence(e,o,n,a),e.samples=Ct.generateSampleTable(o),u=Tt.mdat(Ct.concatenateFrameData(o)),r=[],l=Tt.moof(i,[e]),h=new Uint8Array(l.byteLength+u.byteLength),i++,h.set(l),h.set(u,l.byteLength),Et.clearDtsInfo(e),d=Math.ceil(1024*Mt/e.samplerate),o.length&&(c=o.length*d,this.trigger("segmentTimingInfo",Ut(kt.audioTsToVideoTs(e.baseMediaDecodeTime,e.samplerate),o[0].dts,o[0].pts,o[0].dts+c,o[0].pts+c,p||0)),this.trigger("timingInfo",{start:o[0].pts,end:o[0].pts+c})),this.trigger("data",{track:e,boxes:h})),this.trigger("done","AudioSegmentStream")},this.reset=function(){Et.clearDtsInfo(e),r=[],this.trigger("reset")}},yt.prototype=new vt,ft=function(e,t){var i,r,s,n=[],a=[];t||={},i=t.firstSequenceNumber||0,ft.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){Et.collectDtsInfo(e,t),"seq_parameter_set_rbsp"===t.nalUnitType&&!r&&(r=t.config,e.sps=[t.data],Lt.forEach(function(t){e[t]=r[t]},this)),"pic_parameter_set_rbsp"===t.nalUnitType&&!s&&(s=t.data,e.pps=[t.data]),n.push(t)},this.flush=function(){for(var r,s,o,l,u,h,d,c,p=0;n.length&&"access_unit_delimiter_rbsp"!==n[0].nalUnitType;)n.shift();if(0===n.length)this.resetStream_(),this.trigger("done","VideoSegmentStream");else{if(r=St.groupNalsIntoFrames(n),(o=St.groupFramesIntoGops(r))[0][0].keyFrame||((s=this.getGopForFusion_(n[0],e))?(p=s.duration,o.unshift(s),o.byteLength+=s.byteLength,o.nalCount+=s.nalCount,o.pts=s.pts,o.dts=s.dts,o.duration+=s.duration):o=St.extendFirstKeyFrame(o)),a.length){var m=t.alignGopsAtEnd?this.alignGopsAtEnd_(o):this.alignGopsAtStart_(o);if(!m)return this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),n=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Et.clearDtsInfo(e),o=m}Et.collectDtsInfo(e,o),e.samples=St.generateSampleTable(o),u=Tt.mdat(St.concatenateNalData(o)),e.baseMediaDecodeTime=Et.calculateTrackBaseMediaDecodeTime(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",o.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),d=o[0],c=o[o.length-1],this.trigger("segmentTimingInfo",Ut(e.baseMediaDecodeTime,d.dts,d.pts,c.dts+c.duration,c.pts+c.duration,p)),this.trigger("timingInfo",{start:o[0].pts,end:o[o.length-1].pts+o[o.length-1].duration}),this.gopCache_.unshift({gop:o.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),n=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=Tt.moof(i,[e]),h=new Uint8Array(l.byteLength+u.byteLength),i++,h.set(l),h.set(u,l.byteLength),this.trigger("data",{track:e,boxes:h}),this.resetStream_(),this.trigger("done","VideoSegmentStream")}},this.reset=function(){this.resetStream_(),n=[],this.gopCache_.length=0,a.length=0,this.trigger("reset")},this.resetStream_=function(){Et.clearDtsInfo(e),r=void 0,s=void 0},this.getGopForFusion_=function(t){for(var i,r,s,n,a=1/0,o=0;o<this.gopCache_.length;o++)s=(n=this.gopCache_[o]).gop,e.pps&&Rt(e.pps[0],n.pps[0])&&e.sps&&Rt(e.sps[0],n.sps[0])&&(s.dts<e.timelineStartInfo.dts||(i=t.dts-s.dts-s.duration)>=-1e4&&i<=45e3&&(!r||a>i)&&(r=n,a=i));return r?r.gop:null},this.alignGopsAtStart_=function(e){var t,i,r,s,n,o=e.byteLength,l=e.nalCount,u=e.duration;for(t=i=0;t<a.length&&i<e.length&&(r=a[t],s=e[i],r.pts!==s.pts);)s.pts>r.pts?t++:(i++,o-=s.byteLength,l-=s.nalCount,u-=s.duration);return 0===i?e:i===e.length?null:((n=e.slice(i)).byteLength=o,n.duration=u,n.nalCount=l,n.pts=n[0].pts,n.dts=n[0].dts,n)},this.alignGopsAtEnd_=function(e){for(var t,i,r=a.length-1,s=e.length-1,n=null,o=!1;r>=0&&s>=0;){if(t=a[r],i=e[s],t.pts===i.pts){o=!0;break}t.pts>i.pts?r--:(r===a.length-1&&(n=s),s--)}if(!o&&null===n)return null;var l=o?s:n;if(0===l)return e;var u=e.slice(l),h=u.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return u.byteLength=h.byteLength,u.duration=h.duration,u.nalCount=h.nalCount,u.pts=u[0].pts,u.dts=u[0].dts,u},this.alignGopsWith=function(e){a=e}},ft.prototype=new vt,bt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,e||={},this.remuxTracks=void 0===e.remux||!!e.remux,this.keepOriginalTimestamps="boolean"==typeof e.keepOriginalTimestamps&&e.keepOriginalTimestamps,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,bt.prototype.init.call(this),this.push=function(e){return e.content||e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}},bt.prototype=new vt,bt.prototype.flush=function(e){var t,i,r,s,n=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e||this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,Lt.forEach(function(e){a.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,Dt.forEach(function(e){a.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(a.type=1===this.pendingTracks.length?this.pendingTracks[0].type:"combined",this.emittedTracks+=this.pendingTracks.length,r=Tt.initSegment(this.pendingTracks),a.initSegment=new Uint8Array(r.byteLength),a.initSegment.set(r),a.data=new Uint8Array(this.pendingBytes),s=0;s<this.pendingBoxes.length;s++)a.data.set(this.pendingBoxes[s],n),n+=this.pendingBoxes[s].byteLength;for(s=0;s<this.pendingCaptions.length;s++)(t=this.pendingCaptions[s]).startTime=kt.metadataTsToSeconds(t.startPts,o,this.keepOriginalTimestamps),t.endTime=kt.metadataTsToSeconds(t.endPts,o,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(s=0;s<this.pendingMetadata.length;s++)(i=this.pendingMetadata[s]).cueTime=kt.metadataTsToSeconds(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",a),s=0;s<a.captions.length;s++)t=a.captions[s],this.trigger("caption",t);for(s=0;s<a.metadata.length;s++)i=a.metadata[s],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},bt.prototype.setRemux=function(e){this.remuxTracks=e},_t=function(e){var t,i,r=this,s=!0;_t.prototype.init.call(this),e||={},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="aac",s.metadataStream=new wt.MetadataStream,s.aacStream=new At,s.audioTimestampRolloverStream=new wt.TimestampRolloverStream("audio"),s.timedMetadataTimestampRolloverStream=new wt.TimestampRolloverStream("timed-metadata"),s.adtsStream=new It,s.coalesceStream=new bt(e,s.metadataStream),s.headOfPipeline=s.aacStream,s.aacStream.pipe(s.audioTimestampRolloverStream).pipe(s.adtsStream),s.aacStream.pipe(s.timedMetadataTimestampRolloverStream).pipe(s.metadataStream).pipe(s.coalesceStream),s.metadataStream.on("timestamp",function(e){s.aacStream.setTimestamp(e.timeStamp)}),s.aacStream.on("data",function(n){"timed-metadata"!==n.type&&"audio"!==n.type||s.audioSegmentStream||(i||={timelineStartInfo:{baseMediaDecodeTime:r.baseMediaDecodeTime},codec:"adts",type:"audio"},s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new yt(i,e),s.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream),r.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))}),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),Nt(this,s)},this.setupTsPipeline=function(){var s={};this.transmuxPipeline_=s,s.type="ts",s.metadataStream=new wt.MetadataStream,s.packetStream=new wt.TransportPacketStream,s.parseStream=new wt.TransportParseStream,s.elementaryStream=new wt.ElementaryStream,s.timestampRolloverStream=new wt.TimestampRolloverStream,s.adtsStream=new It,s.h264Stream=new xt,s.captionStream=new wt.CaptionStream(e),s.coalesceStream=new bt(e,s.metadataStream),s.headOfPipeline=s.packetStream,s.packetStream.pipe(s.parseStream).pipe(s.elementaryStream).pipe(s.timestampRolloverStream),s.timestampRolloverStream.pipe(s.h264Stream),s.timestampRolloverStream.pipe(s.adtsStream),s.timestampRolloverStream.pipe(s.metadataStream).pipe(s.coalesceStream),s.h264Stream.pipe(s.captionStream).pipe(s.coalesceStream),s.elementaryStream.on("data",function(n){var a;if("metadata"===n.type){for(a=n.tracks.length;a--;)t||"video"!==n.tracks[a].type?!i&&"audio"===n.tracks[a].type&&((i=n.tracks[a]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime):(t=n.tracks[a]).timelineStartInfo.baseMediaDecodeTime=r.baseMediaDecodeTime;t&&!s.videoSegmentStream&&(s.coalesceStream.numberOfTracks++,s.videoSegmentStream=new ft(t,e),s.videoSegmentStream.on("log",r.getLogTrigger_("videoSegmentStream")),s.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,s.audioSegmentStream.setEarliestDts(t.dts-r.baseMediaDecodeTime))}),s.videoSegmentStream.on("processedGopsInfo",r.trigger.bind(r,"gopInfo")),s.videoSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"videoSegmentTimingInfo")),s.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&s.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),s.videoSegmentStream.on("timingInfo",r.trigger.bind(r,"videoTimingInfo")),s.h264Stream.pipe(s.videoSegmentStream).pipe(s.coalesceStream)),i&&!s.audioSegmentStream&&(s.coalesceStream.numberOfTracks++,s.audioSegmentStream=new yt(i,e),s.audioSegmentStream.on("log",r.getLogTrigger_("audioSegmentStream")),s.audioSegmentStream.on("timingInfo",r.trigger.bind(r,"audioTimingInfo")),s.audioSegmentStream.on("segmentTimingInfo",r.trigger.bind(r,"audioSegmentTimingInfo")),s.adtsStream.pipe(s.audioSegmentStream).pipe(s.coalesceStream)),r.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}}),s.coalesceStream.on("data",this.trigger.bind(this,"data")),s.coalesceStream.on("id3Frame",function(e){e.dispatchType=s.metadataStream.dispatchType,r.trigger("id3Frame",e)}),s.coalesceStream.on("caption",this.trigger.bind(this,"caption")),s.coalesceStream.on("done",this.trigger.bind(this,"done")),Nt(this,s)},this.setBaseMediaDecodeTime=function(r){var s=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=r),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Et.clearDtsInfo(i),s.audioTimestampRolloverStream&&s.audioTimestampRolloverStream.discontinuity()),t&&(s.videoSegmentStream&&(s.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Et.clearDtsInfo(t),s.captionStream.reset()),s.timestampRolloverStream&&s.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(s){var t=Pt(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():!t&&"ts"!==this.transmuxPipeline_.type&&this.setupTsPipeline(),s=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){s=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},_t.prototype=new vt;var Bt,Ft,qt,jt,Ht,$t,Vt,zt={Transmuxer:_t},Wt=function(e){return e>>>0},Gt=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},Xt=Wt,Kt=Gt,Zt=function(e,t){var i,r,s,n,a,o=[];if(!t.length)return null;for(i=0;i<e.byteLength;)r=Xt(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]),s=Kt(e.subarray(i+4,i+8)),n=r>1?i+r:e.byteLength,s===t[0]&&(1===t.length?o.push(e.subarray(i+8,n)):(a=Zt(e.subarray(i+8,n),t.slice(1))).length&&(o=o.concat(a))),i=n;return o},Yt=Zt,Qt=Wt,Jt=j,ei=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return t.baseMediaDecodeTime=1===t.version?Jt(e.subarray(4)):Qt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t},ti=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4)},r=1&i.flags[2],s=2&i.flags[2],n=8&i.flags[2],a=16&i.flags[2],o=32&i.flags[2],l=65536&i.flags[0],u=131072&i.flags[0],h=8;return r&&(h+=4,i.baseDataOffset=t.getUint32(12),h+=4),s&&(i.sampleDescriptionIndex=t.getUint32(h),h+=4),n&&(i.defaultSampleDuration=t.getUint32(h),h+=4),a&&(i.defaultSampleSize=t.getUint32(h),h+=4),o&&(i.defaultSampleFlags=t.getUint32(h)),l&&(i.durationIsEmpty=!0),!r&&u&&(i.baseDataOffsetIsMoof=!0),i},ii=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},ri=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},r=new DataView(e.buffer,e.byteOffset,e.byteLength),s=1&i.flags[2],n=4&i.flags[2],a=1&i.flags[1],o=2&i.flags[1],l=4&i.flags[1],u=8&i.flags[1],h=r.getUint32(4),d=8;for(s&&(i.dataOffset=r.getInt32(d),d+=4),n&&h&&(t={flags:ii(e.subarray(d,d+4))},d+=4,a&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),u&&(1===i.version?t.compositionTimeOffset=r.getInt32(d):t.compositionTimeOffset=r.getUint32(d),d+=4),i.samples.push(t),h--);h--;)t={},a&&(t.duration=r.getUint32(d),d+=4),o&&(t.size=r.getUint32(d),d+=4),l&&(t.flags=ii(e.subarray(d,d+4)),d+=4),u&&(1===i.version?t.compositionTimeOffset=r.getInt32(d):t.compositionTimeOffset=r.getUint32(d),d+=4),i.samples.push(t);return i},si={tfdt:ei,trun:ri},ni={parseTfdt:si.tfdt,parseTrun:si.trun},ai=function(e){for(var t=0,i=String.fromCharCode(e[t]),r="";"\0"!==i;)r+=i,t++,i=String.fromCharCode(e[t]);return r+i},oi=j,li=function(e){return void 0!==e||null!==e},ui={parseEmsgBox:function(e){var t,i,r,s,n,a,o,l=4,u=e[0];if(0===u)l+=(t=ai(e.subarray(l))).length,l+=(i=ai(e.subarray(l))).length,r=(h=new DataView(e.buffer)).getUint32(l),l+=4,n=h.getUint32(l),l+=4,a=h.getUint32(l),l+=4,o=h.getUint32(l),l+=4;else if(1===u){var h;r=(h=new DataView(e.buffer)).getUint32(l),l+=4,s=oi(e.subarray(l)),l+=8,a=h.getUint32(l),l+=4,o=h.getUint32(l),l+=4,l+=(t=ai(e.subarray(l))).length,l+=(i=ai(e.subarray(l))).length}var d={scheme_id_uri:t,value:i,timescale:r||1,presentation_time:s,presentation_time_delta:n,event_duration:a,id:o,message_data:new Uint8Array(e.subarray(l,e.byteLength))};return function(e,t){var i="\0"!==t.scheme_id_uri,r=0===e&&li(t.presentation_time_delta)&&i,s=1===e&&li(t.presentation_time)&&i;return!(e>1)&&r||s}(u,d)?d:void 0},scaleTime:function(e,t,i,r){return e||0===e?e/t:r+i/t}},hi=typeof window<"u"?window:void 0===e?typeof self<"u"?self:{}:e,di=Wt,ci=function(e){return("00"+e.toString(16)).slice(-2)},pi=Yt,mi=Gt,gi=ui,fi=ti,yi=ri,_i=ei,bi=j,vi=hi,Ti=Le.parseId3Frames;Bt=function(e){return pi(e,["moov","trak"]).reduce(function(e,t){var i,r,s,n,a=pi(t,["tkhd"])[0];return a&&(i=a[0],s=di(a[r=0===i?12:20]<<24|a[r+1]<<16|a[r+2]<<8|a[r+3]),n=pi(t,["mdia","mdhd"])[0])?(r=0===(i=n[0])?12:20,e[s]=di(n[r]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3]),e):null},{})},Ft=function(e,t){var i=pi(t,["moof","traf"]).reduce(function(t,i){var r=pi(i,["tfhd"])[0],s=e[di(r[4]<<24|r[5]<<16|r[6]<<8|r[7])]||9e4,n=pi(i,["tfdt"])[0],a=new DataView(n.buffer,n.byteOffset,n.byteLength),o=1===n[0]?bi(n.subarray(4,12)):a.getUint32(4);let l;return"bigint"==typeof o?l=o/vi.BigInt(s):"number"==typeof o&&!isNaN(o)&&(l=o/s),l<2**53-1&&(l=Number(l)),l<t&&(t=l),t},1/0);return"bigint"==typeof i||isFinite(i)?i:0},qt=function(e,t){var i,r=pi(t,["moof","traf"]),s=0,n=0;if(r&&r.length){var a=pi(r[0],["tfhd"])[0],o=pi(r[0],["trun"])[0],l=pi(r[0],["tfdt"])[0];if(a&&(i=fi(a).trackId),l&&(s=_i(l).baseMediaDecodeTime),o){var u=yi(o);u.samples&&u.samples.length&&(n=u.samples[0].compositionTimeOffset||0)}}var h=e[i]||9e4;"bigint"==typeof s&&(n=vi.BigInt(n),h=vi.BigInt(h));var d=(s+n)/h;return"bigint"==typeof d&&d<2**53-1&&(d=Number(d)),d},jt=function(e){var t=pi(e,["moov","trak"]),i=[];return t.forEach(function(e){var t=pi(e,["mdia","hdlr"]),r=pi(e,["tkhd"]);t.forEach(function(e,t){var s,n,a=mi(e.subarray(8,12)),o=r[t];"vide"===a&&(n=0===(s=new DataView(o.buffer,o.byteOffset,o.byteLength)).getUint8(0)?s.getUint32(12):s.getUint32(20),i.push(n))})}),i},$t=function(e){var t=0===e[0]?12:20;return di(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},Ht=function(e){var t=pi(e,["moov","trak"]),i=[];return t.forEach(function(e){var t,r,s={},n=pi(e,["tkhd"])[0];n&&(r=(t=new DataView(n.buffer,n.byteOffset,n.byteLength)).getUint8(0),s.id=0===r?t.getUint32(12):t.getUint32(20));var a=pi(e,["mdia","hdlr"])[0];if(a){var o=mi(a.subarray(8,12));s.type="vide"===o?"video":"soun"===o?"audio":o}var l=pi(e,["mdia","minf","stbl","stsd"])[0];if(l){var u=l.subarray(8);s.codec=mi(u.subarray(4,8));var h,d=pi(u,[s.codec])[0];d&&(/^[asm]vc[1-9]$/i.test(s.codec)?(h=d.subarray(78),"avcC"===mi(h.subarray(4,8))&&h.length>11?(s.codec+=".",s.codec+=ci(h[9]),s.codec+=ci(h[10]),s.codec+=ci(h[11])):s.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(s.codec)?(h=d.subarray(28),"esds"===mi(h.subarray(4,8))&&h.length>20&&0!==h[19]?(s.codec+="."+ci(h[19]),s.codec+="."+ci(h[20]>>>2&63).replace(/^0/,"")):s.codec="mp4a.40.2"):s.codec=s.codec.toLowerCase())}var c=pi(e,["mdia","mdhd"])[0];c&&(s.timescale=$t(c)),i.push(s)}),i},Vt=function(e,t=0){return pi(e,["emsg"]).map(e=>{var i=gi.parseEmsgBox(new Uint8Array(e)),r=Ti(i.message_data);return{cueTime:gi.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,t),duration:gi.scaleTime(i.event_duration,i.timescale),frames:r}})};var Si={findBox:pi,parseType:mi,timescale:Bt,startTime:Ft,compositionStartTime:qt,videoTrackIds:jt,tracks:Ht,getTimescaleFromMediaHeader:$t,getEmsgID3:Vt};let{parseTrun:Ci}=ni,{findBox:Ei}=Si;var wi=hi,ki={getMdatTrafPairs:function(e){var t=Ei(e,["moof","traf"]),i=Ei(e,["mdat"]),r=[];return i.forEach(function(e,i){var s=t[i];r.push({mdat:e,traf:s})}),r},parseSamples:function(e,t,i){var r=t,s=i.defaultSampleDuration||0,n=i.defaultSampleSize||0,a=i.trackId,o=[];return e.forEach(function(e){var t=Ci(e).samples;t.forEach(function(e){void 0===e.duration&&(e.duration=s),void 0===e.size&&(e.size=n),e.trackId=a,e.dts=r,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),"bigint"==typeof r?(e.pts=r+wi.BigInt(e.compositionTimeOffset),r+=wi.BigInt(e.duration)):(e.pts=r+e.compositionTimeOffset,r+=e.duration)}),o=o.concat(t)}),o}},Ii=ae.discardEmulationPreventionBytes,xi=ve.CaptionStream,Ai=Yt,Pi=ei,Mi=ti,{getMdatTrafPairs:Di,parseSamples:Li}=ki,Oi=function(e,t){for(var i=e,r=0;r<t.length;r++){var s=t[r];if(i<s.size)return s;i-=s.size}return null},Ni=function(){var e,t,i,r,s,n,a=!1;this.isInitialized=function(){return a},this.init=function(t){e=new xi,a=!0,n=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/r,e.endTime=e.endPts/r,s.captions.push(e),s.captionStreams[e.stream]=!0}),e.on("log",function(e){s.logs.push(e)})},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||i===e[0]&&r===t[i])},this.parse=function(e,n,a){var o;if(!this.isInitialized()||!n||!a)return null;if(this.isNewInit(n,a))i=n[0],r=a[i];else if(null===i||!r)return t.push(e),null;for(;t.length>0;){var l=t.shift();this.parse(l,n,a)}return o=function(e,t,i){if(null===t)return null;var r=function(e,t){var i={};return Di(e).forEach(function(e){var r,s=e.mdat,n=e.traf,a=Mi(Ai(n,["tfhd"])[0]),o=a.trackId,l=Ai(n,["tfdt"]),u=l.length>0?Pi(l[0]).baseMediaDecodeTime:0,h=Ai(n,["trun"]);t===o&&h.length>0&&(r=function(e,t,i){for(var r,s,n,a=new DataView(e.buffer,e.byteOffset,e.byteLength),o={logs:[],seiNals:[]},l=0;l+4<e.length;l+=s)if(s=a.getUint32(l),l+=4,!(s<=0))switch(31&e[l]){case 6:var u=e.subarray(l+1,l+1+s),h=Oi(l,t);if(r={nalUnitType:"sei_rbsp",size:s,data:u,escapedRBSP:Ii(u),trackId:i},h)r.pts=h.pts,r.dts=h.dts,n=h;else{if(!n){o.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+l+" for trackId "+i+". See mux.js#223."});break}r.pts=n.pts,r.dts=n.dts}o.seiNals.push(r)}return o}(s,Li(h,u,a),o),i[o]||(i[o]={seiNals:[],logs:[]}),i[o].seiNals=i[o].seiNals.concat(r.seiNals),i[o].logs=i[o].logs.concat(r.logs))}),i}(e,t)[t]||{};return{seiNals:r.seiNals,logs:r.logs,timescale:i}}(e,i,r),o&&o.logs&&(s.logs=s.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),s):s.logs.length?{logs:s.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;n?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){s.captions=[],s.captionStreams={},s.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,r=null,s?this.clearParsedCaptions():s={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()};let{parseTfdt:Ri}=ni,Ui=Yt,{getTimescaleFromMediaHeader:Bi}=Si,{parseSamples:Fi,getMdatTrafPairs:qi}=ki;var ji=function(){let e=9e4;this.init=function(t){let i=Ui(t,["moov","trak","mdia","mdhd"])[0];i&&(e=Bi(i))},this.parseSegment=function(t){let i=[],r=qi(t),s=0;return r.forEach(function(t){let r=t.mdat,n=t.traf,a=Ui(n,["tfdt"])[0],o=Ui(n,["tfhd"])[0],l=Ui(n,["trun"]);if(a&&(s=Ri(a).baseMediaDecodeTime),l.length&&o){let t=Fi(l,s,o),n=0;t.forEach(function(t){let s=new TextDecoder("utf-8"),a=r.slice(n,n+t.size);Ui(a,["vtte"])[0]||Ui(a,["vttc"]).forEach(function(r){let n,a,o=Ui(r,["payl"])[0],l=Ui(r,["sttg"])[0],u=t.pts/e,h=(t.pts+t.duration)/e;if(o)try{n=s.decode(o)}catch(e){console.error(e)}if(l)try{a=s.decode(l)}catch(e){console.error(e)}t.duration&&n&&i.push({cueText:n,start:u,end:h,settings:a})}),n+=t.size})}}),i}},Hi=Te,$i=function(e){var t=31&e[1];return(t<<=8)|e[2]},Vi=function(e){return!!(64&e[1])},zi=function(e){var t=0;return(48&e[3])>>>4>1&&(t+=e[4]+1),t},Wi=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Gi={parseType:function(e,t){var i=$i(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=Vi(e),i=4+zi(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=Vi(e),r=4+zi(e);if(i&&(r+=e[r]+1),1&e[r+5]){for(var s=3+((15&e[r+1])<<8|e[r+2])-4,n=12+((15&e[r+10])<<8|e[r+11]);n<s;){var a=r+n;t[(31&e[a+1])<<8|e[a+2]]=e[a],n+=5+((15&e[a+3])<<8|e[a+4])}return t}},parsePayloadUnitStartIndicator:Vi,parsePesType:function(e,t){switch(t[$i(e)]){case Hi.H264_STREAM_TYPE:return"video";case Hi.ADTS_STREAM_TYPE:return"audio";case Hi.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!Vi(e))return null;var t=4+zi(e);if(t>=e.byteLength)return null;var i=null,r=e[t+7];return 192&r&&((i={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,i.pts*=4,i.pts+=(6&e[t+13])>>>1,i.dts=i.pts,64&r&&(i.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,i.dts*=4,i.dts+=(6&e[t+18])>>>1)),i},videoPacketContainsKeyFrame:function(e){for(var t=4+zi(e),i=e.subarray(t),r=0,s=0,n=!1;s<i.byteLength-3;s++)if(1===i[s+2]){r=s+5;break}for(;r<i.byteLength;)switch(i[r]){case 0:if(0!==i[r-1]){r+=2;break}if(0!==i[r-2]){r++;break}s+3!==r-2&&"slice_layer_without_partitioning_rbsp_idr"===Wi(31&i[s+3])&&(n=!0);do{r++}while(1!==i[r]&&r<i.length);s=r-2,r+=3;break;case 1:if(0!==i[r-1]||0!==i[r-2]){r+=3;break}"slice_layer_without_partitioning_rbsp_idr"===Wi(31&i[s+3])&&(n=!0),s=r-2,r+=3;break;default:r+=3}return i=i.subarray(s),r-=s,s=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===Wi(31&i[s+3])&&(n=!0),n}},Xi=Te,Ki=ke.handleRollover,Zi={};Zi.ts=Gi,Zi.aac=ct;var Yi=te.ONE_SECOND_IN_TS,Qi=188,Ji=71,er=function(e,t,i){for(var r,s,n,a,o=0,l=Qi,u=!1;l<=e.byteLength;)if(e[o]!==Ji||e[l]!==Ji&&l!==e.byteLength)o++,l++;else{if(r=e.subarray(o,l),"pes"===Zi.ts.parseType(r,t.pid)&&(s=Zi.ts.parsePesType(r,t.table),n=Zi.ts.parsePayloadUnitStartIndicator(r),"audio"===s&&n&&(a=Zi.ts.parsePesTime(r))&&(a.type="audio",i.audio.push(a),u=!0)),u)break;o+=Qi,l+=Qi}for(o=(l=e.byteLength)-Qi,u=!1;o>=0;)if(e[o]!==Ji||e[l]!==Ji&&l!==e.byteLength)o--,l--;else{if(r=e.subarray(o,l),"pes"===Zi.ts.parseType(r,t.pid)&&(s=Zi.ts.parsePesType(r,t.table),n=Zi.ts.parsePayloadUnitStartIndicator(r),"audio"===s&&n&&(a=Zi.ts.parsePesTime(r))&&(a.type="audio",i.audio.push(a),u=!0)),u)break;o-=Qi,l-=Qi}},tr=function(e,t,i){for(var r,s,n,a,o,l,u,h=0,d=Qi,c=!1,p={data:[],size:0};d<e.byteLength;)if(e[h]===Ji&&e[d]===Ji){if(r=e.subarray(h,d),"pes"===Zi.ts.parseType(r,t.pid)&&(s=Zi.ts.parsePesType(r,t.table),n=Zi.ts.parsePayloadUnitStartIndicator(r),"video"===s&&(n&&!c&&(a=Zi.ts.parsePesTime(r))&&(a.type="video",i.video.push(a),c=!0),!i.firstKeyFrame))){if(n&&0!==p.size){for(o=new Uint8Array(p.size),l=0;p.data.length;)u=p.data.shift(),o.set(u,l),l+=u.byteLength;if(Zi.ts.videoPacketContainsKeyFrame(o)){var m=Zi.ts.parsePesTime(o);m?(i.firstKeyFrame=m,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}p.size=0}p.data.push(r),p.size+=r.byteLength}if(c&&i.firstKeyFrame)break;h+=Qi,d+=Qi}else h++,d++;for(h=(d=e.byteLength)-Qi,c=!1;h>=0;)if(e[h]===Ji&&e[d]===Ji){if(r=e.subarray(h,d),"pes"===Zi.ts.parseType(r,t.pid)&&(s=Zi.ts.parsePesType(r,t.table),n=Zi.ts.parsePayloadUnitStartIndicator(r),"video"===s&&n&&(a=Zi.ts.parsePesTime(r))&&(a.type="video",i.video.push(a),c=!0)),c)break;h-=Qi,d-=Qi}else h--,d--},ir=function(e,t){var i=Zi.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,r=0,s=null,n=null,a=0,o=0;e.length-o>=3;){switch(Zi.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10||(a=Zi.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===n&&(t=e.subarray(o,o+a),n=Zi.aac.parseAacTimestamp(t)),o+=a;break;case"audio":if(e.length-o<7||(a=Zi.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===s&&(t=e.subarray(o,o+a),s=Zi.aac.parseSampleRate(t)),r++,o+=a;break;default:o++}if(i)return null}if(null===s||null===n)return null;var l=Yi/s;return{audio:[{type:"audio",dts:n,pts:n},{type:"audio",dts:n+1024*r*l,pts:n+1024*r*l}]}}(e):function(e){var t={pid:null,table:null},i={};for(var r in function(e,t){for(var i,r=0,s=Qi;s<e.byteLength;)if(e[r]===Ji&&e[s]===Ji){switch(i=e.subarray(r,s),Zi.ts.parseType(i,t.pid)){case"pat":t.pid=Zi.ts.parsePat(i);break;case"pmt":var n=Zi.ts.parsePmt(i);t.table=t.table||{},Object.keys(n).forEach(function(e){t.table[e]=n[e]})}r+=Qi,s+=Qi}else r++,s++}(e,t),t.table)if(t.table.hasOwnProperty(r))switch(t.table[r]){case Xi.H264_STREAM_TYPE:i.video=[],tr(e,t,i),0===i.video.length&&delete i.video;break;case Xi.ADTS_STREAM_TYPE:i.audio=[],er(e,t,i),0===i.audio.length&&delete i.audio}return i}(e);return i&&(i.audio||i.video)?(function(e,t){if(e.audio&&e.audio.length){var i=t;(void 0===i||isNaN(i))&&(i=e.audio[0].dts),e.audio.forEach(function(e){e.dts=Ki(e.dts,i),e.pts=Ki(e.pts,i),e.dtsTime=e.dts/Yi,e.ptsTime=e.pts/Yi})}if(e.video&&e.video.length){var r=t;if((void 0===r||isNaN(r))&&(r=e.video[0].dts),e.video.forEach(function(e){e.dts=Ki(e.dts,r),e.pts=Ki(e.pts,r),e.dtsTime=e.dts/Yi,e.ptsTime=e.pts/Yi}),e.firstKeyFrame){var s=e.firstKeyFrame;s.dts=Ki(s.dts,r),s.pts=Ki(s.pts,r),s.dtsTime=s.dts/Yi,s.ptsTime=s.pts/Yi}}}(i,t),i):null};class rr{constructor(e,t){this.options=t||{},this.self=e,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new zt.Transmuxer(this.options),function(e,t){t.on("data",function(t){let i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength};let r=t.data;t.data=r.buffer,e.postMessage({action:"data",segment:t,byteOffset:r.byteOffset,byteLength:r.byteLength},[t.data])}),t.on("done",function(t){e.postMessage({action:"done"})}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})}),t.on("videoSegmentTimingInfo",function(t){let i={start:{decode:te.videoTsToSeconds(t.start.dts),presentation:te.videoTsToSeconds(t.start.pts)},end:{decode:te.videoTsToSeconds(t.end.dts),presentation:te.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:te.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=te.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}),t.on("audioSegmentTimingInfo",function(t){let i={start:{decode:te.videoTsToSeconds(t.start.dts),presentation:te.videoTsToSeconds(t.start.pts)},end:{decode:te.videoTsToSeconds(t.end.dts),presentation:te.videoTsToSeconds(t.end.pts)},baseMediaDecodeTime:te.videoTsToSeconds(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=te.videoTsToSeconds(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t})}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t})}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t})}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:te.videoTsToSeconds(t.start),end:te.videoTsToSeconds(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:te.videoTsToSeconds(t.start),end:te.videoTsToSeconds(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})}(this.self,this.transmuxer)}pushMp4Captions(e){this.captionParser||(this.captionParser=new Ni,this.captionParser.init());let t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}initMp4WebVttParser(e){this.webVttParser||=new ji;let t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.webVttParser.init(t)}getMp4WebVttText(e){this.webVttParser||=new ji;let t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.webVttParser.parseSegment(t);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:i||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){let i=Si.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){let t=Si.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){let i=Si.getEmsgID3(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){let i="number"!=typeof t||isNaN(t)?void 0:t*te.ONE_SECOND_IN_TS,r=ir(e,i),s=null;r&&(s={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1},s.hasVideo&&(s.videoStart=r.video[0].ptsTime),s.hasAudio&&(s.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:s,data:e},[e.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(e){let t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){let t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(te.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(te.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new rr(self,e.data.options):(this.messageHandlers||=new rr(self),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}})));const $h=e=>{let{transmuxer:t,bytes:i,audioAppendStart:r,gopsToAlignWith:s,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:u,onVideoSegmentTimingInfo:h,onAudioSegmentTimingInfo:d,onId3:c,onCaptions:p,onDone:m,onEndedTimeline:g,onTransmuxerLog:f,isEndOfTimeline:y,segment:_,triggerSegmentEventFn:b}=e,v={buffer:[]},T=y;if(t.onmessage=i=>{t.currentTransmux===e&&("data"===i.data.action&&((e,t,i)=>{let{type:r,initSegment:s,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:u}=e.data.segment;t.buffer.push({captions:n,captionStreams:a,metadata:o});let h=e.data.segment.boxes||{data:e.data.segment.data},d={type:r,data:new Uint8Array(h.data,h.data.byteOffset,h.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};void 0!==l&&(d.videoFrameDtsTime=l),void 0!==u&&(d.videoFramePtsTime=u),i(d)})(i,v,a),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&((e,t)=>{t.gopInfo=e.data.gopInfo})(i,v),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&u(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&h(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&d(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&c([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(T=!1,g()),"log"===i.data.action&&f(i.data.log),"transmuxed"===i.data.type&&(T||(t.onmessage=null,(({transmuxedData:e,callback:t})=>{e.buffer=[],t(e)})({transmuxedData:v,callback:m}),Vh(t))))},t.onerror=()=>{let e={message:"Received an error message from the transmuxer worker",metadata:{errorType:cu.Error.StreamingFailedToTransmuxSegment,segmentInfo:Cd({segment:_})}};m(null,e)},r&&t.postMessage({action:"setAudioAppendStart",appendStart:r}),Array.isArray(s)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:s}),void 0!==n&&t.postMessage({action:"setRemux",remux:n}),i.byteLength){let e=i instanceof ArrayBuffer?i:i.buffer,r=i instanceof ArrayBuffer?0:i.byteOffset;b({type:"segmenttransmuxingstart",segment:_}),t.postMessage({action:"push",data:e,byteOffset:r,byteLength:i.byteLength},[e])}y&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},Vh=e=>{e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():$h(e.currentTransmux))},zh=(e,t)=>{e.postMessage({action:t}),Vh(e)};var Wh=e=>{((e,t)=>{t.currentTransmux?t.transmuxQueue.push(zh.bind(null,t,e)):(t.currentTransmux=e,zh(t,e))})("reset",e)};const Gh=function(e){let t=e.transmuxer,i=e.endAction||e.action,r=e.callback,s=At({},e,{endAction:null,transmuxer:null,callback:null}),n=s=>{s.data.action===i&&(t.removeEventListener("message",n),s.data.data&&(s.data.data=new Uint8Array(s.data.data,e.byteOffset||0,e.byteLength||s.data.data.byteLength),e.data&&=s.data.data),r(s.data))};if(t.addEventListener("message",n),e.data){let i=e.data instanceof ArrayBuffer;s.byteOffset=i?0:e.data.byteOffset,s.byteLength=e.data.byteLength;let r=[i?e.data:e.data.buffer];t.postMessage(s,r)}else t.postMessage(s)},Xh=-101,Kh=-102,Zh="wvtt",Yh=e=>{e.forEach(e=>{e.abort()})},Qh=(e,t)=>{let{requestType:i}=t,r=ih({requestType:i,request:t,error:e});return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:Xh,xhr:t,metadata:r}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:Kh,xhr:t,metadata:r}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t,metadata:r}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t,metadata:r}:null},Jh=(e,t,i,r)=>(s,n)=>{let a=n.response,o=Qh(s,n);if(o)return i(o,e);if(16!==a.byteLength)return i({status:n.status,message:"Invalid HLS key at URL: "+n.uri,code:2,xhr:n},e);let l=new DataView(a),u=new Uint32Array([l.getUint32(0),l.getUint32(4),l.getUint32(8),l.getUint32(12)]);for(let e=0;e<t.length;e++)t[e].bytes=u;return r({type:"segmentkeyloadcomplete",segment:e,keyInfo:{uri:n.uri}}),i(null,e)},ed=(e,t)=>{let i=Kr(e.map.bytes);if("mp4"!==i){let r=e.map.resolvedUri||e.map.uri,s=i||"unknown";return t({internal:!0,message:`Found unsupported ${s} container for initialization segment at URL: ${r}`,code:2,metadata:{mediaType:s}})}Gh({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:({tracks:i,data:r})=>(e.map.bytes=r,i.forEach(function(t){e.map.tracks=e.map.tracks||{},!e.map.tracks[t.type]&&(e.map.tracks[t.type]=t,"number"==typeof t.id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale),"text"===t.type&&((e,t)=>{t===Zh&&e.transmuxer.postMessage({action:"initMp4WebVttParser",data:e.map.bytes})})(e,t.codec))}),t(null))})},td=({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:h,doneFn:d,onTransmuxerLog:c,triggerSegmentEventFn:p})=>{let m=new Uint8Array(t);if(function(e){return Mr(e,["moof"]).length>0}(m)){e.isFmp4=!0;let{tracks:s}=e.map;if(s.text&&(!s.audio||!s.video))return h(e,{data:m,type:"text"}),void((e,t,i)=>{t===Zh&&Gh({action:"getMp4WebVttText",data:e.bytes,transmuxer:e.transmuxer,callback:({data:t,mp4VttCues:r})=>{e.bytes=t,i(null,e,{mp4VttCues:r})}})})(e,s.text.codec,d);let n={isFmp4:!0,hasVideo:!!s.video,hasAudio:!!s.audio};s.audio&&s.audio.codec&&"enca"!==s.audio.codec&&(n.audioCodec=s.audio.codec),s.video&&s.video.codec&&"encv"!==s.video.codec&&(n.videoCodec=s.video.codec),s.video&&s.audio&&(n.isMuxed=!0),i(e,n);let l=(t,i)=>{h(e,{data:m,type:n.hasAudio&&!n.isMuxed?"audio":"video"}),i&&i.length&&a(e,i),t&&t.length&&o(e,t),d(null,e,{})};Gh({action:"probeMp4StartTime",timescales:e.map.timescales,data:m,transmuxer:e.transmuxer,callback:({data:i,startTime:a})=>{t=i.buffer,e.bytes=m=i,n.hasAudio&&!n.isMuxed&&r(e,"audio","start",a),n.hasVideo&&r(e,"video","start",a),Gh({action:"probeEmsgID3",data:m,transmuxer:e.transmuxer,offset:a,callback:({emsgData:i,id3Frames:r})=>{t=i.buffer,e.bytes=m=i,s.video&&i.byteLength&&e.transmuxer?Gh({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:e.transmuxer,data:m,timescales:e.map.timescales,trackIds:[s.video.id],callback:i=>{t=i.data.buffer,e.bytes=m=i.data,i.logs.forEach(function(e){c(vu(e,{stream:"mp4CaptionParser"}))}),l(i.captions,r)}}):l(void 0,r)}})}})}else e.transmuxer?(void 0===e.container&&(e.container=Kr(m)),"ts"!==e.container&&"aac"!==e.container?(i(e,{hasAudio:!1,hasVideo:!1}),d(null,e,{})):(({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:h,doneFn:d,onTransmuxerLog:c,triggerSegmentEventFn:p})=>{let m=e.map&&e.map.tracks||{},g=!(!m.audio||!m.video),f=r.bind(null,e,"audio","start"),y=r.bind(null,e,"audio","end"),_=r.bind(null,e,"video","start"),b=r.bind(null,e,"video","end"),v=()=>(e=>{e.transmuxer.currentTransmux?e.transmuxer.transmuxQueue.push(e):(e.transmuxer.currentTransmux=e,$h(e))})({bytes:t,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,remux:g,onData:t=>{t.type="combined"===t.type?"video":t.type,h(e,t)},onTrackInfo:t=>{i&&(g&&(t.isMuxed=!0),i(e,t))},onAudioTimingInfo:e=>{f&&void 0!==e.start&&(f(e.start),f=null),y&&void 0!==e.end&&y(e.end)},onVideoTimingInfo:e=>{_&&void 0!==e.start&&(_(e.start),_=null),b&&void 0!==e.end&&b(e.end)},onVideoSegmentTimingInfo:t=>{p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:{pts:{start:t.start.presentation,end:t.end.presentation},dts:{start:t.start.decode,end:t.end.decode}}}),s(t)},onAudioSegmentTimingInfo:t=>{p({type:"segmenttransmuxingtiminginfoavailable",segment:e,timingInfo:{pts:{start:t.start.pts,end:t.end.pts},dts:{start:t.start.dts,end:t.end.dts}}}),n(t)},onId3:(t,i)=>{a(e,t,i)},onCaptions:t=>{o(e,[t])},isEndOfTimeline:l,onEndedTimeline:()=>{u()},onTransmuxerLog:c,onDone:(t,i)=>{d&&(t.type="combined"===t.type?"video":t.type,p({type:"segmenttransmuxingcomplete",segment:e}),d(i,e,t))},segment:e,triggerSegmentEventFn:p});Gh({action:"probeTs",transmuxer:e.transmuxer,data:t,baseStartTime:e.baseStartTime,callback:r=>{e.bytes=t=r.data;let s=r.result;s&&(i(e,{hasAudio:s.hasAudio,hasVideo:s.hasVideo,isMuxed:g}),i=null),v()}})})({segment:e,bytes:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:h,doneFn:d,onTransmuxerLog:c,triggerSegmentEventFn:p})):d(null,e,{})},id=function({id:e,key:t,encryptedBytes:i,decryptionWorker:r,segment:s,doneFn:n},a){let o,l=t=>{if(t.data.source===e){r.removeEventListener("message",l);let e=t.data.decrypted;a(new Uint8Array(e.bytes,e.byteOffset,e.byteLength))}};r.onerror=()=>{let e="An error occurred in the decryption worker",t=Cd({segment:s});n({message:e,metadata:{error:Error(e),errorType:cu.Error.StreamingFailedToDecryptSegment,segmentInfo:t,keyInfo:{uri:s.key.resolvedUri||s.map.key.resolvedUri}}},s)},r.addEventListener("message",l),o=t.bytes.slice?t.bytes.slice():new Uint32Array(Array.prototype.slice.call(t.bytes)),r.postMessage(Eh({source:e,encrypted:i,key:o,iv:t.iv}),[i.buffer,o.buffer])},rd=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:r,abortFn:s,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f,triggerSegmentEventFn:y})=>{let _=[],b=(({activeXhrs:e,decryptionWorker:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:h,doneFn:d,onTransmuxerLog:c,triggerSegmentEventFn:p})=>{let m=0,g=!1;return(f,y)=>{if(!g){if(f)return g=!0,Yh(e),d(f,y);if(m+=1,m===e.length){let m=function(){if(y.encryptedBytes)return(({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:h,doneFn:d,onTransmuxerLog:c,triggerSegmentEventFn:p})=>{p({type:"segmentdecryptionstart"}),id({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e,segment:t,doneFn:d},e=>{t.bytes=e,p({type:"segmentdecryptioncomplete",segment:t}),td({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:h,doneFn:d,onTransmuxerLog:c,triggerSegmentEventFn:p})})})({decryptionWorker:t,segment:y,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:h,doneFn:d,onTransmuxerLog:c,triggerSegmentEventFn:p});td({segment:y,bytes:y.bytes,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:h,doneFn:d,onTransmuxerLog:c,triggerSegmentEventFn:p})};if(y.endOfAllRequests=Date.now(),y.map&&y.map.encryptedBytes&&!y.map.bytes)return p({type:"segmentdecryptionstart",segment:y}),id({decryptionWorker:t,id:y.requestId+"-init",encryptedBytes:y.map.encryptedBytes,key:y.map.key,segment:y,doneFn:d},t=>{y.map.bytes=t,p({type:"segmentdecryptioncomplete",segment:y}),ed(y,t=>{if(t)return Yh(e),d(t,y);m()})});m()}}}})({activeXhrs:_,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m,doneFn:g,onTransmuxerLog:f,triggerSegmentEventFn:y});if(r.key&&!r.key.bytes){let i=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&i.push(r.map.key);let s=vu(t,{uri:r.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),n=Jh(r,i,b,y);y({type:"segmentkeyloadstart",segment:r,keyInfo:{uri:r.key.resolvedUri}});let a=e(s,n);_.push(a)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){let i=vu(t,{uri:r.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),s=Jh(r,[r.map.key],b,y);y({type:"segmentkeyloadstart",segment:r,keyInfo:{uri:r.map.key.resolvedUri}});let n=e(i,s);_.push(n)}let i=vu(t,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:vh(r.map),requestType:"segment-media-initialization"}),s=(({segment:e,finishProcessingFn:t,triggerSegmentEventFn:i})=>(r,s)=>{let n=Qh(r,s);if(n)return t(n,e);let a=new Uint8Array(s.response);if(i({type:"segmentloaded",segment:e}),e.map.key)return e.map.encryptedBytes=a,t(null,e);e.map.bytes=a,ed(e,function(i){if(i)return i.xhr=s,i.status=s.status,t(i,e);t(null,e)})})({segment:r,finishProcessingFn:b,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:r});let n=e(i,s);_.push(n)}let v=vu(t,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:vh(r),requestType:"segment"}),T=(({segment:e,finishProcessingFn:t,responseType:i,triggerSegmentEventFn:r})=>(s,n)=>{let a=Qh(s,n);if(a)return t(a,e);r({type:"segmentloaded",segment:e});let o="arraybuffer"!==i&&n.responseText?(e=>{let t=new Uint8Array(new ArrayBuffer(e.length));for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer})(n.responseText.substring(e.lastReachedChar||0)):n.response;return e.stats=(e=>({bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}))(n),e.key?e.encryptedBytes=new Uint8Array(o):e.bytes=new Uint8Array(o),t(null,e)})({segment:r,finishProcessingFn:b,responseType:v.responseType,triggerSegmentEventFn:y});y({type:"segmentloadstart",segment:r});let S=e(v,T);S.addEventListener("progress",(({segment:e,progressFn:t,trackInfoFn:i,timingInfoFn:r,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:u,dataFn:h})=>i=>{if(!i.target.aborted)return e.stats=vu(e.stats,(e=>{let t=e.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-t.requestTime||0};return i.bytesReceived=e.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i})(i)),!e.stats.firstBytesReceivedAt&&e.stats.bytesReceived&&(e.stats.firstBytesReceivedAt=Date.now()),t(i,e)})({segment:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:u,id3Fn:h,captionsFn:d,isEndOfTimeline:c,endedTimelineFn:p,dataFn:m})),_.push(S);let C={};return _.forEach(e=>{e.addEventListener("loadend",(({loadendState:e,abortFn:t})=>i=>{i.target.aborted&&t&&!e.calledAbortFn&&(t(),e.calledAbortFn=!0)})({loadendState:C,abortFn:s}))}),()=>Yh(_)},sd=bu("PlaylistSelector"),nd=function(e){if(!e||!e.playlist)return;let t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})},ad=function(e,t){if(!e)return"";let i=Te.getComputedStyle(e);return i?i[t]:""},od=function(e,t){let i=e.slice();e.sort(function(e,r){let s=t(e,r);return 0===s?i.indexOf(e)-i.indexOf(r):s})},ld=function(e,t){let i,r;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i||=Te.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(r=t.attributes.BANDWIDTH),r||=Te.Number.MAX_VALUE,i-r};let ud=function(e){let{main:t,bandwidth:i,playerWidth:r,playerHeight:s,playerObjectFit:n,limitRenditionByPlayerDimensions:a,playlistController:o}=e;if(!t)return;let l={bandwidth:i,width:r,height:s,limitRenditionByPlayerDimensions:a},u=t.playlists;Xu.isAudioOnly(t)&&(u=o.getAudioTrackPlaylists_(),l.audioOnly=!0);let h=u.map(e=>{let t,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,r=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return t=e.attributes&&e.attributes.BANDWIDTH,t||=Te.Number.MAX_VALUE,{bandwidth:t,width:i,height:r,playlist:e}});od(h,(e,t)=>e.bandwidth-t.bandwidth),h=h.filter(e=>!Xu.isIncompatible(e.playlist));let d=h.filter(e=>Xu.isEnabled(e.playlist));d.length||(d=h.filter(e=>!Xu.isDisabled(e.playlist)));let c=d.filter(e=>e.bandwidth*Uh.BANDWIDTH_VARIANCE<i),p=c[c.length-1],m=c.filter(e=>e.bandwidth===p.bandwidth)[0];if(!1===a){let e=m||d[0]||h[0];if(e&&e.playlist){let t="sortedPlaylistReps";return m&&(t="bandwidthBestRep"),d[0]&&(t="enabledPlaylistReps"),sd(`choosing ${nd(e)} using ${t} with options`,l),e.playlist}return sd("could not choose a playlist with options",l),null}let g=c.filter(e=>e.width&&e.height);od(g,(e,t)=>e.width-t.width);let f=g.filter(e=>e.width===r&&e.height===s);p=f[f.length-1];let y,_,b,v,T=f.filter(e=>e.bandwidth===p.bandwidth)[0];if(T||(y=g.filter(e=>"cover"===n?e.width>r&&e.height>s:e.width>r||e.height>s),_=y.filter(e=>e.width===y[0].width&&e.height===y[0].height),p=_[_.length-1],b=_.filter(e=>e.bandwidth===p.bandwidth)[0]),o.leastPixelDiffSelector){let e=g.map(e=>(e.pixelDiff=Math.abs(e.width-r)+Math.abs(e.height-s),e));od(e,(e,t)=>e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff),v=e[0]}let S=v||b||T||m||d[0]||h[0];if(S&&S.playlist){let e="sortedPlaylistReps";return v?e="leastPixelDiffRep":b?e="resolutionPlusOneRep":T?e="resolutionBestRep":m?e="bandwidthBestRep":d[0]&&(e="enabledPlaylistReps"),sd(`choosing ${nd(S)} using ${e} with options`,l),S.playlist}return sd("could not choose a playlist with options",l),null};const hd=function(){let e=this.useDevicePixelRatio&&Te.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(e=this.customPixelRatio),ud({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(ad(this.tech_.el(),"width"),10)*e,playerHeight:parseInt(ad(this.tech_.el(),"height"),10)*e,playerObjectFit:this.usePlayerObjectFit?ad(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})};function dd(e){try{return new URL(e).pathname.split("/").slice(-2).join("/")}catch{return""}}const cd={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},pd=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),md=(e,t,i)=>{e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,cu.browser.IS_ANY_SAFARI||(e.metadataTrack_.inBandMetadataTrackDispatchType=t))},gd=function(e,t,i){let r,s;if(i&&i.cues)for(r=i.cues.length;r--;)s=i.cues[r],s.startTime>=e&&s.endTime<=t&&i.removeCue(s)},fd=e=>"number"==typeof e&&isFinite(e),yd=1/60,_d=e=>{let{startOfSegment:t,duration:i,segment:r,part:s,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:u,timeline:h}=e,d=o.length-1,c="mediaIndex/partIndex increment";e.getMediaInfoForTime?c=`getMediaInfoForTime (${e.getMediaInfoForTime})`:e.isSyncRequest&&(c="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(c+=` with independent ${e.independent}`);let p="number"==typeof u,m=e.segment.uri?"segment":"pre-segment",g=p?Ou({preloadSegment:r})-1:0;return`${m} [${n+l}/${n+d}]`+(p?` part [${u}/${g}]`:"")+` segment start/end [${r.start} => ${r.end}]`+(p?` part start/end [${s.start} => ${s.end}]`:"")+` startOfSegment [${t}] duration [${i}] timeline [${h}] selected by [${c}] playlist [${a}]`},bd=e=>`${e}TimingInfo`,vd=({timelineChangeController:e,currentTimeline:t,segmentTimeline:i,loaderType:r,audioDisabled:s})=>{if(t===i)return!1;if("audio"===r){let t=e.lastTimelineChange({type:"main"});return!t||t.to!==i}if("main"===r&&s){let t=e.pendingTimelineChange({type:"audio"});return!(t&&t.to===i)}return!1},Td=e=>{let t=e.pendingSegment_;if(t&&vd({timelineChangeController:e.timelineChangeController_,currentTimeline:e.currentTimeline_,segmentTimeline:t.timeline,loaderType:e.loaderType_,audioDisabled:e.audioDisabled_})&&(e=>{if(!e)return!1;let t=e.pendingTimelineChange({type:"audio"}),i=e.pendingTimelineChange({type:"main"}),r=t&&i,s=r&&t.to!==i.to;return!(!r||-1===t.from||-1===i.from||!s)})(e.timelineChangeController_)){if((e=>{let t=e.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=e.timelineChangeController_.pendingTimelineChange({type:"main"});return t&&i&&t.to<i.to})(e))return void e.timelineChangeController_.trigger("audioTimelineBehind");e.timelineChangeController_.trigger("fixBadTimelineChange")}},Sd=({segmentDuration:e,maxDuration:t})=>!!e&&Math.round(e)>t+Su,Cd=({type:e,segment:t})=>{if(!t)return;let i=!!(t.key||t.map&&t.map.ke),r=!(!t.map||t.map.bytes),s=void 0===t.startOfSegment?t.start:t.startOfSegment;return{type:e||t.type,uri:t.resolvedUri||t.uri,start:s,duration:t.duration,isEncrypted:i,isMediaInitialization:r}};class Ed extends cu.EventTarget{constructor(e,t={}){if(super(),!e)throw TypeError("Initialization settings are required");if("function"!=typeof e.currentTime)throw TypeError("No currentTime getter specified");if(!e.mediaSource)throw TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=bu(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(e){e!==this.state_&&(this.logger_(`${this.state_} -> ${e}`),this.state_=e,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Td(this)}),this.sourceUpdater_.on("codecschange",e=>{this.trigger(At({type:"codecschange"},e))}),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Td(this)}),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",e=>{this.trigger(At({type:"timelinechange"},e)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Td(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Td(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return(e=>{let t=new Hh;t.currentTransmux=null,t.transmuxQueue=[];let i=t.terminate;return t.terminate=()=>(t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)),t.postMessage({action:"init",options:e}),t})({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&Te.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):(this.pendingSegment_&&=null,this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_))}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,Te.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)}error(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Wh(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){let e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Tu();if("main"===this.loaderType_){let{hasAudio:t,hasVideo:i,isMuxed:r}=e;if(i&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;let i=wh(e),r=this.initSegments_[i];return t&&!r&&e.bytes&&(this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;let i=kh(e),r=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[i]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});let s={resolvedUri:(r||e).resolvedUri};return r&&(s.bytes=r.bytes),s}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_){if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;let i=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));let s=null;if(i&&(i.id?s=i.id:i.uri&&(s=i.uri)),this.logger_(`playlist update [${s} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${Au(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&(e.endList||"number"!=typeof e.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");let n=e.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${n}]`),null!==this.mediaIndex)if(this.mediaIndex-=n,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{let e=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!e.parts||!e.parts.length||!e.parts[this.partIndex])){let e=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=e}}r&&(r.mediaIndex-=n,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){this.checkBufferTimeout_&&=(Te.clearTimeout(this.checkBufferTimeout_),null)}paused(){return null===this.checkBufferTimeout_}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Wh(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;let e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;"hls"===this.sourceType_&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,i=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let s=1,n=()=>{s--,0===s&&i()};(r||!this.audioDisabled_)&&(s++,this.sourceUpdater_.removeAudio(e,t,n)),(r||"main"===this.loaderType_)&&(this.gopBuffer_=((e,t,i,r)=>{let s=Math.ceil((t-r)*Zr.ONE_SECOND_IN_TS),n=Math.ceil((i-r)*Zr.ONE_SECOND_IN_TS),a=e.slice(),o=e.length;for(;o--&&!(e[o].pts<=n););if(-1===o)return a;let l=o+1;for(;l--&&!(e[l].pts<=s););return l=Math.max(l,0),a.splice(l,o-l+1),a})(this.gopBuffer_,e,t,this.timeMapping_),s++,this.sourceUpdater_.removeVideo(e,t,n));for(let i in this.inbandTextTracks_)gd(e,t,this.inbandTextTracks_[i]);gd(e,t,this.segmentMetadataTrack_),n()}monitorBuffer_(){this.checkBufferTimeout_&&Te.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Te.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&Te.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=Te.setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;let e=this.chooseNextRequest_();if(!e)return;let t={segmentInfo:Cd({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_)return!1;let r="number"==typeof e&&t.segments[e],s=e+1===t.segments.length,n=!r||!r.parts||i+1===r.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&s&&n}chooseNextRequest_(){let e=this.buffered_(),t=Au(e)||0,i=Pu(e,this.currentTime_()),r=!this.hasPlayed_()&&i>=1,s=i>=this.goalBufferLength_(),n=this.playlist_.segments;if(!n.length||r||s)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);let a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(a.isSyncRequest)a.mediaIndex=function(e,t,i){t||=[];let r=[],s=0;for(let n=0;n<t.length;n++){let a=t[n];if(e===a.timeline&&(r.push(n),s+=a.duration,s>i))return n}return 0===r.length?0:r[r.length-1]}(this.currentTimeline_,n,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${a.mediaIndex}`);else if(null!==this.mediaIndex){let e=n[this.mediaIndex],i="number"==typeof this.partIndex?this.partIndex:-1;a.startOfSegment=e.end?e.end:t,e.parts&&e.parts[i+1]?(a.mediaIndex=this.mediaIndex,a.partIndex=i+1):a.mediaIndex=this.mediaIndex+1}else{let e,i,r,s=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${s}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${t}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){let t=this.getSyncInfoFromMediaSequenceSync_(s);if(!t){let e="No sync info found while using media sequence sync";return this.error({message:e,metadata:{errorType:cu.Error.StreamingFailedToSelectNextSegment,error:Error(e)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${t.start} --\x3e ${t.end})`),e=t.segmentIndex,i=t.partIndex,r=t.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");let t=Xu.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:s,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});e=t.segmentIndex,i=t.partIndex,r=t.startTime}a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${s}`:`currentTime ${s}`,a.mediaIndex=e,a.startOfSegment=r,a.partIndex=i,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${a.mediaIndex} `)}let o=n[a.mediaIndex],l=o&&"number"==typeof a.partIndex&&o.parts&&o.parts[a.partIndex];if(!o||"number"==typeof a.partIndex&&!l)return null;"number"!=typeof a.partIndex&&o.parts&&(a.partIndex=0,l=o.parts[0]);let u=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!u&&!l.independent)if(0===a.partIndex){let e=n[a.mediaIndex-1],t=e.parts&&e.parts.length&&e.parts[e.parts.length-1];t&&t.independent&&(--a.mediaIndex,a.partIndex=e.parts.length-1,a.independent="previous segment")}else o.parts[a.partIndex-1].independent&&(--a.partIndex,a.independent="previous part");let h=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return a.mediaIndex>=n.length-1&&h&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,a.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(a))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;let t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);let i=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!i)return null;if(!i.isAppended)return i;let r=this.mediaSequenceSync_.getSyncInfoForTime(i.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){let{independent:t,playlist:i,mediaIndex:r,startOfSegment:s,isSyncRequest:n,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e,u=i.segments[r],h="number"==typeof a&&u.parts[a],d={requestId:"segment-loader-"+Math.random(),uri:h&&h.resolvedUri||u.resolvedUri,mediaIndex:r,partIndex:h?a:null,isSyncRequest:n,startOfSegment:s,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:u.timeline,duration:h&&h.duration||u.duration,segment:u,part:h,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t},c=void 0===o?this.isPendingTimestampOffset_:o;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:u.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),overrideCheck:c});let p=Au(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=((e,t,i)=>{if(null==t||!e.length)return[];let r=Math.ceil((t-i+3)*Zr.ONE_SECOND_IN_TS),s=0;for(;s<e.length&&!(e[s].pts>r);s++);return e.slice(s)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d}timestampOffsetForSegment_(e){return(({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:r,overrideCheck:s})=>s||e!==t?e<t?i:r.length?r.end(r.length-1):i:null)(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;let t=this.currentTime_(),i=e.bandwidth,r=this.pendingSegment_.duration,s=Xu.estimateSegmentRequestTime(r,i,this.playlist_,e.bytesReceived),n=function(e,t,i=1){return((e.length?e.end(e.length-1):0)-t)/i}(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(s<=n)return;let a=function(e){let{main:t,currentTime:i,bandwidth:r,duration:s,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=e,u=t.playlists.filter(e=>!Xu.isIncompatible(e)),h=u.filter(Xu.isEnabled);h.length||(h=u.filter(e=>!Xu.isDisabled(e)));let d=h.filter(Xu.hasAttribute.bind(null,"BANDWIDTH")).map(e=>{let t=l.getSyncPoint(e,s,o,i)?1:2;return{playlist:e,rebufferingImpact:Xu.estimateSegmentRequestTime(n,r,e)*t-a}}),c=d.filter(e=>e.rebufferingImpact<=0);return od(c,(e,t)=>ld(t.playlist,e.playlist)),c.length?c[0]:(od(d,(e,t)=>e.rebufferingImpact-t.rebufferingImpact),d[0]||null)}({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:n,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a)return;let o=s-n-a.rebufferingImpact,l=.5;n<=Su&&(l=1),a.playlist&&a.playlist.uri!==this.playlist_.uri&&!(o<l)&&(this.bandwidth=a.playlist.attributes.BANDWIDTH*Uh.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${_d(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){let{hasAudio:i,hasVideo:r}=t,s={segmentInfo:Cd({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:i,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:s}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t||={},function(e,t){if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;let i=Object.keys(e).sort(),r=Object.keys(t).sort();if(i.length!==r.length)return!1;for(let s=0;s<i.length;s++){let n=i[s];if(n!==r[s]||e[n]!==t[n])return!1}return!0}(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Td(this))))}handleTimingInfo_(e,t,i,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;let s=this.pendingSegment_,n=bd(t);s[n]=s[n]||{},s[n][i]=r,this.logger_(`timinginfo: ${t} - ${i} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Td(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(0===t.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));let i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r={};t.forEach(e=>{r[e.stream]=r[e.stream]||{startTime:1/0,captions:[],endTime:0};let t=r[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)}),Object.keys(r).forEach(e=>{let{startTime:t,endTime:s,captions:n}=r[e],a=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${s} for ${e}`),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"});let r=i;/^cc708_/.test(i)&&(r="SERVICE"+i.split("_")[1]);let s=t.textTracks().getTrackById(r);if(s)e[i]=s;else{let s=i,n=i,a=!1,o=(t.options_.vhs&&t.options_.vhs.captionServices||{})[r];o&&(s=o.label,n=o.language,a=o.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:r,default:a,label:s,language:n},!1).track}}}(a,this.vhs_.tech_,e),gd(t,s,a[e]),function({inbandTextTracks:e,captionArray:t,timestampOffset:i}){if(!t)return;let r=Te.WebKitDataCue||Te.VTTCue;t.forEach(t=>{let s=t.stream;t.content?t.content.forEach(n=>{let a=new r(t.startTime+i,t.endTime+i,n.text);a.line=n.line,a.align="left",a.position=n.position,a.positionAlign="line-left",e[s].addCue(a)}):e[s].addCue(new r(t.startTime+i,t.endTime+i,t.text))})}({captionArray:n,inbandTextTracks:a,timestampOffset:i})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,t,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){let e=this.callQueue_;this.callQueue_=[],e.forEach(e=>e())}processLoadQueue_(){let e=this.loadQueue_;this.loadQueue_=[],e.forEach(e=>e())}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;let e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&vd({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;let e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;let{hasAudio:i,hasVideo:r,isMuxed:s}=t;return!(r&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!s&&!e.audioTimingInfo||vd({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return Td(this),void this.callQueue_.push(this.handleData_.bind(this,e,t));let i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),i.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),i.isFmp4=e.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[bd(t.type)].start;else{let e,t=this.getCurrentMediaInfo_(),r="main"===this.loaderType_&&t&&t.hasVideo;r&&(e=i.videoTimingInfo.start),i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:r,firstVideoFrameTimeForData:e,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(i,t.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});let e=this.chooseNextRequest_();if(e.mediaIndex!==i.mediaIndex||e.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,t)}}updateAppendInitSegmentStatus(e,t){"main"===this.loaderType_&&"number"==typeof e.timestampOffset&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:r}){if(i){let e=wh(i);if(this.activeInitSegmentId_===e)return null;t=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=e}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},r){let s=this.sourceUpdater_.audioBuffered(),n=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+xu(s).join(", ")),n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+xu(n).join(", "));let a=s.length?s.start(0):0,o=s.length?s.end(s.length-1):0,l=n.length?n.start(0):0,u=n.length?n.end(n.length-1):0;if(o-a<=1&&u-l<=1)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${xu(s).join(", ")}, video buffer: ${xu(n).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));let h=this.currentTime_()-1;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${h}`),this.remove(0,h,()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=Te.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:i},r){r&&(22===r.code?this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i}):(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${i.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:cu.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")))}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:r,bytes:s}){if(!s){let e=[r],t=r.byteLength;i&&(e.unshift(i),t+=i.byteLength),s=(e=>{let t,i=0;return e.bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(e=>{t.set(e,i),i+=e.byteLength})),t})({bytes:t,segments:e})}let n={segmentInfo:Cd({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:n}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:s}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;let r=this.pendingSegment_.segment,s=`${e}TimingInfo`;r[s]||(r[s]={}),r[s].transmuxerPrependedSeconds=i.prependedContentDuration||0,r[s].transmuxedPresentationStart=i.start.presentation,r[s].transmuxedDecodeStart=i.start.decode,r[s].transmuxedPresentationEnd=i.end.presentation,r[s].transmuxedDecodeEnd=i.end.decode,r[s].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){let{type:i,data:r}=t;if(!r||!r.byteLength||"audio"===i&&this.audioDisabled_)return;let s=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:s,data:r})}loadSegment_(e){this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):(Td(this),this.loadQueue_.push(()=>{let t=At({},e,{forceTimestampOffset:!0});At(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)}))}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));let t=this.createSimplifiedSegmentObj_(e),i=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,s=e.timeline!==this.currentTimeline_&&e.timeline>0,n=i||r&&s;this.logger_(`Requesting\n${dd(e.uri)}\n${_d(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=rd({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:n,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:t,level:i,stream:r})=>{this.logger_(`${_d(e)} logged from transmuxer stream ${r} as a ${i}: ${t}`)},triggerSegmentEventFn:({type:e,segment:t,keyInfo:i,trackInfo:r,timingInfo:s})=>{let n={segmentInfo:Cd({segment:t})};i&&(n.keyInfo=i),r&&(n.trackInfo=r),s&&(n.timingInfo=s),this.trigger({type:e,metadata:n})}})}trimBackBuffer_(e){let t=((e,t,i)=>{let r=t-Uh.BACK_BUFFER_LENGTH;e.length&&(r=Math.max(r,e.start(0)));let s=t-i;return Math.min(s,r)})(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){let t=e.segment,i=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,s=e.segment.map&&!e.segment.map.bytes,n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:s},a=e.playlist.segments[e.mediaIndex-1];if(a&&a.timeline===t.timeline&&(a.videoTimingInfo?n.baseStartTime=a.videoTimingInfo.transmuxedDecodeEnd:a.audioTimingInfo&&(n.baseStartTime=a.audioTimingInfo.transmuxedDecodeEnd)),t.key){let i=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=i}return t.map&&(n.map=this.initSegmentForMap(t.map)),n}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<yd)return void this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${yd}`);let i={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:i}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,i){if(this.callQueue_.length)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===Kh)return;return this.pause(),e.code===Xh?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}let r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((e,t,i)=>{if(!t.length)return e;if(i)return t.slice();let r=t[0].pts,s=0;for(;s<e.length&&!(e[s].pts>=r);s++);return e.slice(0,s).concat(t)})(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){let t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:i,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:s,useVideoTimingInfo:n,videoTimingInfo:a,audioTimingInfo:o}){if(void 0!==e)return e;if(!n)return o.start;let l=t.segments[i-1];return 0!==i&&l&&void 0!==l.start&&l.end===r+s?a.start:r}waitForAppendsToComplete_(e){let t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),void this.trigger("error");let{hasAudio:i,hasVideo:r,isMuxed:s}=t,n="main"===this.loaderType_&&r,a=!this.audioDisabled_&&i&&!s;e.waitingOnAppends=0,e.hasAppendedData_?(n&&e.waitingOnAppends++,a&&e.waitingOnAppends++,n&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),a&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))):(!e.timingInfo&&"number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){let t=((e,t,i)=>"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null)(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(e){if(null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_)return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:i}){return this.useDtsForTimestampOffset_?e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};let t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){let e={segmentInfo:Cd({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:e})}if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());let e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});let t=((e,t)=>{if("hls"!==t)return null;let i=(e=>{let t=0;return["video","audio"].forEach(function(i){let r=e[`${i}TimingInfo`];if(!r)return;let s,{start:n,end:a}=r;"bigint"==typeof n||"bigint"==typeof a?s=Te.BigInt(a)-Te.BigInt(n):"number"==typeof n&&"number"==typeof a&&(s=a-n),void 0!==s&&s>t&&(t=s)}),"bigint"==typeof t&&t<2**53-1&&(t=Number(t)),t})({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i)return null;let r=e.playlist.targetDuration,s=Sd({segmentDuration:i,maxDuration:2*r}),n=Sd({segmentDuration:i,maxDuration:r}),a=`Segment with index ${e.mediaIndex} from playlist ${e.playlist.id} has a duration of ${i} when the reported duration is ${e.duration} and the target duration is ${r}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return s||n?{severity:s?"warn":"info",message:a}:null})(e,this.sourceType_);if(t&&("warn"===t.severity?cu.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${_d(e)}`);this.logger_(`Appended ${_d(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"===this.loaderType_&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");let i=e.segment,r=e.part,s=i.end&&this.currentTime_()-i.end>3*e.playlist.targetDuration,n=r&&r.end&&this.currentTime_()-r.end>3*e.playlist.partTargetDuration;s||n?(this.logger_(`bad ${s?"segment":"part"} ${_d(e)}`),this.resetEverything()):(null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_())}recordThroughput_(e){if(e.duration<yd)return void this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${yd}`);let t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;let t=e.segment,i=t.start,r=t.end;if(!fd(i)||!fd(r))return;gd(i,r,this.segmentMetadataTrack_);let s=Te.WebKitDataCue||Te.VTTCue,n={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:r},a=new s(i,r,JSON.stringify(n));a.value=n,this.segmentMetadataTrack_.addCue(a)}}function wd(){}const kd=function(e){return"string"==typeof e?e.replace(/./,e=>e.toUpperCase()):e},Id=["video","audio"],xd=(e,t)=>{let i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]},Ad=(e,t)=>{if(0===t.queue.length)return;let i=0,r=t.queue[i];if("mediaSource"===r.type)!t.updating()&&"closed"!==t.mediaSource.readyState&&(t.queue.shift(),r.action(t),r.doneFn&&r.doneFn(),Ad("audio",t),Ad("video",t));else if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!xd(e,t)){if(r.type!==e){if(i=((e,t)=>{for(let i=0;i<t.length;i++){let r=t[i];if("mediaSource"===r.type)return null;if(r.type===e)return i}return null})(e,t.queue),null===i)return;r=t.queue[i]}t.queue.splice(i,1),t.queuePending[e]=r,r.action(e,t),!r.doneFn&&(t.queuePending[e]=null,Ad(e,t))}},Pd=(e,t)=>{let i=t[`${e}Buffer`],r=kd(e);i&&(i.removeEventListener("updateend",t[`on${r}UpdateEnd_`]),i.removeEventListener("error",t[`on${r}Error_`]),t.codecs[e]=null,t[`${e}Buffer`]=null)},Md=(e,t)=>e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t),Dd=(e,t,i)=>(r,s)=>{let n=s[`${r}Buffer`];if(Md(s.mediaSource,n)){s.logger_(`Appending segment ${t.mediaIndex}'s ${e.length} bytes to ${r}Buffer`);try{n.appendBuffer(e)}catch(e){s.logger_(`Error with code ${e.code} `+(22===e.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${t.mediaIndex} to ${r}Buffer`),s.queuePending[r]=null,i(e)}}},Ld=(e,t)=>(i,r)=>{let s=r[`${i}Buffer`];if(Md(r.mediaSource,s)){r.logger_(`Removing ${e} to ${t} from ${i}Buffer`);try{s.remove(e,t)}catch{r.logger_(`Remove ${e} to ${t} from ${i}Buffer failed`)}}},Od=e=>(t,i)=>{let r=i[`${t}Buffer`];Md(i.mediaSource,r)&&(i.logger_(`Setting ${t}timestampOffset to ${e}`),r.timestampOffset=e)},Nd=e=>(t,i)=>{e()},Rd=e=>t=>{if("open"===t.mediaSource.readyState){t.logger_(`Calling mediaSource endOfStream(${e||""})`);try{t.mediaSource.endOfStream(e)}catch(e){cu.log.warn("Failed to call media source endOfStream",e)}}},Ud=e=>t=>{t.logger_(`Setting mediaSource duration to ${e}`);try{t.mediaSource.duration=e}catch(e){cu.log.warn("Failed to set media source duration",e)}},Bd=(e,t)=>i=>{let r=kd(e),s=Kt(t);i.logger_(`Adding ${e}Buffer with codec ${t} to mediaSource`);let n=i.mediaSource.addSourceBuffer(s);n.addEventListener("updateend",i[`on${r}UpdateEnd_`]),n.addEventListener("error",i[`on${r}Error_`]),i.codecs[e]=t,i[`${e}Buffer`]=n},Fd=e=>t=>{let i=t[`${e}Buffer`];if(Pd(e,t),Md(t.mediaSource,i)){t.logger_(`Removing ${e}Buffer with codec ${t.codecs[e]} from mediaSource`);try{t.mediaSource.removeSourceBuffer(i)}catch(t){cu.log.warn(`Failed to removeSourceBuffer ${e}Buffer`,t)}}},qd=e=>(t,i)=>{let r=i[`${t}Buffer`],s=Kt(e);if(!Md(i.mediaSource,r))return;let n=e.substring(0,e.indexOf(".")),a=i.codecs[t];if(a.substring(0,a.indexOf("."))===n)return;let o={codecsChangeInfo:{from:a,to:e}};i.trigger({type:"codecschange",metadata:o}),i.logger_(`changing ${t}Buffer codec from ${a} to ${e}`);try{r.changeType(s),i.codecs[t]=e}catch(e){o.errorType=cu.Error.StreamingCodecsChangeError,o.error=e,e.metadata=o,i.error_=e,i.trigger("error"),cu.log.warn(`Failed to changeType on ${t}Buffer`,e)}},jd=({type:e,sourceUpdater:t,action:i,doneFn:r,name:s})=>{t.queue.push({type:e,action:i,doneFn:r,name:s}),Ad(e,t)},Hd=(e,t)=>i=>{let r=function(e){if(0===e.length)return"Buffered Ranges are empty";let t="Buffered Ranges: \n";for(let i=0;i<e.length;i++){let r=e.start(i),s=e.end(i);t+=`${r} --\x3e ${s}. Duration (${s-r})\n`}return t}(t[`${e}Buffered`]());if(t.logger_(`received "updateend" event for ${e} Source Buffer: `,r),t.queuePending[e]){let i=t.queuePending[e].doneFn;t.queuePending[e]=null,i&&i(t[`${e}Error_`])}Ad(e,t)};class $d extends cu.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Ad("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=bu("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Hd("video",this),this.onAudioUpdateEnd_=Hd("audio",this),this.onVideoError_=e=>{this.videoError_=e},this.onAudioError_=e=>{this.audioError_=e},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){jd({type:"mediaSource",sourceUpdater:this,action:Bd(e,t),name:"addSourceBuffer"})}abort(e){jd({type:e,sourceUpdater:this,action:(e,t)=>{if("open"!==t.mediaSource.readyState)return;let i=t[`${e}Buffer`];if(Md(t.mediaSource,i)){t.logger_(`calling abort on ${e}Buffer`);try{i.abort()}catch(t){cu.log.warn(`Failed to abort on ${e}Buffer`,t)}}},name:"abort"})}removeSourceBuffer(e){this.canRemoveSourceBuffer()?jd({type:"mediaSource",sourceUpdater:this,action:Fd(e),name:"removeSourceBuffer"}):cu.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!cu.browser.IS_FIREFOX&&Te.MediaSource&&Te.MediaSource.prototype&&"function"==typeof Te.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return Te.SourceBuffer&&Te.SourceBuffer.prototype&&"function"==typeof Te.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){this.canChangeType()?jd({type:e,sourceUpdater:this,action:qd(t),name:"changeType"}):cu.log.error("changeType is not supported!")}addOrChangeSourceBuffers(e){if(!e||"object"!=typeof e||0===Object.keys(e).length)throw Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{let i=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,i);this.canChangeType()&&this.changeType(t,i)})}appendBuffer(e,t){let{segmentInfo:i,type:r,bytes:s}=e;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_(`delayed audio append of ${s.length} until video append`);if(jd({type:r,sourceUpdater:this,action:Dd(s,i||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===r){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;let e=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${e.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,e.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){return Md(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Tu()}videoBuffered(){return Md(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Tu()}buffered(){let e=Md(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Md(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){let i=null,r=null,s=0,n=[],a=[];if(!(e&&e.length&&t&&t.length))return Tu();let o=e.length;for(;o--;)n.push({time:e.start(o),type:"start"}),n.push({time:e.end(o),type:"end"});for(o=t.length;o--;)n.push({time:t.start(o),type:"start"}),n.push({time:t.end(o),type:"end"});for(n.sort(function(e,t){return e.time-t.time}),o=0;o<n.length;o++)"start"===n[o].type?(s++,2===s&&(i=n[o].time)):"end"===n[o].type&&(s--,1===s&&(r=n[o].time)),null!==i&&null!==r&&(a.push([i,r]),i=null,r=null);return Tu(a)}(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=wd){jd({type:"mediaSource",sourceUpdater:this,action:Ud(e),name:"duration",doneFn:t})}endOfStream(e=null,t=wd){"string"!=typeof e&&(e=void 0),jd({type:"mediaSource",sourceUpdater:this,action:Rd(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=wd){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?jd({type:"audio",sourceUpdater:this,action:Ld(e,t),doneFn:i,name:"remove"}):i()}removeVideo(e,t,i=wd){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?jd({type:"video",sourceUpdater:this,action:Ld(e,t),doneFn:i,name:"remove"}):i()}updating(){return!(!xd("audio",this)&&!xd("video",this))}audioTimestampOffset(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(jd({type:"audio",sourceUpdater:this,action:Od(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(jd({type:"video",sourceUpdater:this,action:Od(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&jd({type:"audio",sourceUpdater:this,action:Nd(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&jd({type:"video",sourceUpdater:this,action:Nd(e),name:"callback"})}dispose(){this.trigger("dispose"),Id.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Pd(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Vd=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e))),zd=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class Wd extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Gd extends Ed{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Tu();let e=this.subtitlesTrack_.cues;return Tu([[e[0].startTime,e[e.length-1].startTime]])}initSegmentForMap(e,t=!1){if(!e)return null;let i=wh(e),r=this.initSegments_[i];if(t&&!r&&e.bytes){let t=zd.byteLength+e.bytes.byteLength,s=new Uint8Array(t);s.set(e.bytes),s.set(zd,e.bytes.byteLength),this.initSegments_[i]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:s}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(e,t){gd(e,t,this.subtitlesTrack_)}fillBuffer_(){let e=this.chooseNextRequest_();e&&(null===this.syncController_.timestampOffsetForTimeline(e.timeline)?(this.syncController_.one("timestampoffset",()=>{this.state="READY",this.paused()||this.monitorBuffer_()}),this.state="WAITING_ON_TIMELINE"):this.loadSegment_(e))}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_)return void(this.state="READY");if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===Xh&&this.handleTimeout_(),e.code===Kh?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);let r=this.pendingSegment_,s=i.mp4VttCues&&i.mp4VttCues.length;s&&(r.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");let n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof Te.WebVTT&&"function"==typeof this.loadVttJs)this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));else{n.requested=!0;try{this.parseVTTCues_(r)}catch(e){return void this.stopForError({message:e.message,metadata:{errorType:cu.Error.StreamingVttParserError,error:e}})}s||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.timingInfo=r.cues.length?{start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:{start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest?(this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY"):(r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new Te.VTTCue(e.startTime,e.endTime,e.text):e)}),function(e){let t=e.cues;if(!t)return;let i={};for(let r=t.length-1;r>=0;r--){let s=t[r],n=`${s.startTime}-${s.endTime}-${s.text}`;i[n]?e.removeCue(s):i[n]=s}}(this.subtitlesTrack_),this.handleAppendsDone_())}}handleData_(e,t){let i=e&&"vtt"===e.type,r=t&&"text"===t.type;i&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){let t=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(i=>{let r=i.start+t,s=i.end+t,n=new Te.VTTCue(r,s,i.cueText);i.settings&&i.settings.split(" ").forEach(e=>{let t=e.split(":"),i=t[0],r=t[1];n[i]=isNaN(r)?r:Number(r)}),e.cues.push(n)})}parseVTTCues_(e){let t,i=!1;if("function"!=typeof Te.WebVTT)throw new Wd;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues)return void this.parseMp4VttCues_(e);"function"==typeof Te.TextDecoder?t=new Te.TextDecoder("utf8"):(t=Te.WebVTT.StringDecoder(),i=!0);let r=new Te.WebVTT.Parser(Te,Te.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=t=>{e.timestampmap=t},r.onparsingerror=e=>{cu.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){let t=e.segment.map.bytes;i&&(t=Vd(t)),r.parse(t)}let s=e.bytes;i&&(s=Vd(s)),r.parse(s),r.flush()}updateTimeMapping_(e,t,i){let r=e.segment;if(!t)return;if(!e.cues.length)return void(r.empty=!0);let{MPEGTS:s,LOCAL:n}=e.timestampmap,a=s/Zr.ONE_SECOND_IN_TS-n+t.mapping;if(e.cues.forEach(e=>{let i=e.endTime-e.startTime,r=this.handleRollover_(e.startTime+a,t.time);e.startTime=Math.max(r,0),e.endTime=Math.max(r+i,0)}),!i.syncInfo){let t=e.cues[0].startTime,s=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(t,s-r.duration)}}}handleRollover_(e,t){if(null===t)return e;let i,r=e*Zr.ONE_SECOND_IN_TS,s=t*Zr.ONE_SECOND_IN_TS;for(i=s<r?-8589934592:8589934592;Math.abs(r-s)>4294967296;)r+=i;return r/Zr.ONE_SECOND_IN_TS}}const Xd=function(e,t){let i=e.cues;for(let e=0;e<i.length;e++){let r=i[e];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null};class Kd{constructor({start:e,end:t,segmentIndex:i,partIndex:r=null,appended:s=!1}){this.start_=e,this.end_=t,this.segmentIndex_=i,this.partIndex_=r,this.appended_=s}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class Zd{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Yd{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){let{mediaSequence:i,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(i,r),this.isReliable_)return this.updateStorage_(r,i,this.calculateBaseTime_(i,r,t))}getSyncInfoForTime(e){for(let{segmentSyncInfo:t,partsSyncInfo:i}of this.storage_.values())if(i.length){for(let t of i)if(t.isInRange(e))return t}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,i){let r=new Map,s="\n",n=i,a=t;this.start_=n,e.forEach((e,t)=>{let i=this.storage_.get(a),o=n,l=o+e.duration,u=!!(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended),h=new Kd({start:o,end:l,appended:u,segmentIndex:t});e.syncInfo=h;let d=n,c=(e.parts||[]).map((e,r)=>{let n=d,o=d+e.duration,l=!!(i&&i.partsSyncInfo&&i.partsSyncInfo[r]&&i.partsSyncInfo[r].isAppended),u=new Kd({start:n,end:o,appended:l,segmentIndex:t,partIndex:r});return d=o,s+=`Media Sequence: ${a}.${r} | Range: ${n} --\x3e ${o} | Appended: ${l}\n`,e.syncInfo=u,u});r.set(a,new Zd(h,c)),s+=`${dd(e.resolvedUri)} | Media Sequence: ${a} | Range: ${o} --\x3e ${l} | Appended: ${u}\n`,a++,n=l}),this.end_=n,this.storage_=r,this.diagnostics_=s}calculateBaseTime_(e,t,i){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;let r=Math.min(...this.storage_.keys());if(e<r){let i=r-e,s=this.storage_.get(r).segmentSyncInfo.start;for(let e=0;e<i;e++)s-=t[e].duration;return s}return i}isReliablePlaylist_(e,t){return null!=e&&Array.isArray(t)&&t.length}}class Qd extends Yd{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,i){if(!this.storage_.size){let t=this.parent_.getSyncInfoForMediaSequence(e);return t?t.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,i)}}const Jd=[{name:"VOD",run:(e,t,i,r,s)=>i===1/0?null:{time:0,segmentIndex:0,partIndex:null}},{name:"MediaSequence",run:(e,t,i,r,s,n)=>{let a=e.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;let o=a.getSyncInfoForTime(s);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(e,t,i,r,s)=>{if(!Object.keys(e.timelineToDatetimeMappings).length)return null;let n=null,a=null,o=Du(t);s||=0;for(let i=0;i<o.length;i++){let r=o[t.endList||0===s?i:o.length-(i+1)],l=r.segment,u=e.timelineToDatetimeMappings[l.timeline];if(!u||!l.dateTimeObject)continue;let h=l.dateTimeObject.getTime()/1e3+u;if(l.parts&&"number"==typeof r.partIndex)for(let e=0;e<r.partIndex;e++)h+=l.parts[e].duration;let d=Math.abs(s-h);if(null!==a&&(0===d||a<d))break;a=d,n={time:h,segmentIndex:r.segmentIndex,partIndex:r.partIndex}}return n}},{name:"Segment",run:(e,t,i,r,s)=>{let n=null,a=null;s||=0;let o=Du(t);for(let e=0;e<o.length;e++){let i=o[t.endList||0===s?e:o.length-(e+1)],l=i.segment,u=i.part&&i.part.start||l&&l.start;if(l.timeline===r&&void 0!==u){let e=Math.abs(s-u);if(null!==a&&a<e)break;(!n||null===a||a>=e)&&(a=e,n={time:u,segmentIndex:i.segmentIndex,partIndex:i.partIndex})}}return n}},{name:"Discontinuity",run:(e,t,i,r,s)=>{let n=null;if(s||=0,t.discontinuityStarts&&t.discontinuityStarts.length){let i=null;for(let r=0;r<t.discontinuityStarts.length;r++){let a=t.discontinuityStarts[r],o=t.discontinuitySequence+r+1,l=e.discontinuities[o];if(l){let e=Math.abs(s-l.time);if(null!==i&&i<e)break;(!n||null===i||i>=e)&&(i=e,n={time:l.time,segmentIndex:a,partIndex:null})}}}return n}},{name:"Playlist",run:(e,t,i,r,s)=>t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}];class ec extends cu.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};let t=new Yd,i=new Qd(t),r=new Qd(t);this.mediaSequenceStorage_={main:t,audio:i,vtt:r},this.logger_=bu("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,i,r,s){if(t!==1/0)return Jd.find(({name:e})=>"VOD"===e).run(this,e,t);let n=this.runStrategies_(e,t,i,r,s);if(!n.length)return null;for(let t of n){let{syncPoint:i,strategy:s}=t,{segmentIndex:n,time:a}=i;if(n<0)continue;let o=a,l=o+e.segments[n].duration;if(this.logger_(`Strategy: ${s}. Current time: ${r}. selected segment: ${n}. Time: [${o} -> ${l}]}`),r>=o&&r<l)return this.logger_("Found sync point with exact match: ",i),i}return this.selectSyncPoint_(n,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;let i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;let r=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Bu({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,i,r,s){let n=[];for(let a=0;a<Jd.length;a++){let o=Jd[a],l=o.run(this,e,t,i,r,s);l&&(l.strategy=o.name,n.push({strategy:o.name,syncPoint:l}))}return n}selectSyncPoint_(e,t){let i=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),s=e[0].strategy;for(let n=1;n<e.length;n++){let a=Math.abs(e[n].syncPoint[t.key]-t.value);a<r&&(r=a,i=e[n].syncPoint,s=e[n].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${s}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+("number"==typeof i.partIndex?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(e,t){let i=t.mediaSequence-e.mediaSequence;if(i>86400)cu.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let r=i-1;r>=0;r--){let i=e.segments[r];if(i&&void 0!==i.start){t.syncInfo={mediaSequence:e.mediaSequence+r,time:i.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){let t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){let i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;i&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));let s=r.dateTimeObject;r.discontinuity&&t&&s&&(this.timelineToDatetimeMappings[r.timeline]=-s.getTime()/1e3)}timestampOffsetForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].time}mappingForTimeline(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){let r,s,n=e.segment,a=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),r=e.startOfSegment,s=t.end+o.mapping;else{if(!o)return!1;r=t.start+o.mapping,s=t.end+o.mapping}return a&&(a.start=r,a.end=s),(!n.start||r<n.start)&&(n.start=r),n.end=s,!0}saveDiscontinuitySyncInfo_(e){let t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){let s=t.discontinuityStarts[r],n=t.discontinuitySequence+r+1,a=s-e.mediaIndex,o=Math.abs(a);if(!this.discontinuities[n]||this.discontinuities[n].accuracy>o){let r;r=a<0?i.start-Bu({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:s}):i.end+Bu({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:s}),this.discontinuities[n]={time:r,accuracy:o}}}}dispose(){this.trigger("dispose"),this.off()}}class tc extends cu.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){return"number"==typeof t&&"number"==typeof i&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if("number"==typeof t&&"number"==typeof i){this.lastTimelineChanges_[e]={type:e,from:t,to:i},delete this.pendingTimelineChanges_[e];let r={timelineChangeInfo:{from:t,to:i}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}var ic=Fh(qh(jh(function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){if(!this.listeners[e])return!1;var i=this.listeners[e].indexOf(t);return this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(i,1),i>-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,r=0;r<i;++r)t[r].call(this,arguments[1]);else for(var s=Array.prototype.slice.call(arguments,1),n=t.length,a=0;a<n;++a)t[a].apply(this,s)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}();let t=null;class r{constructor(e){t||=function(){let e,t,i,r,s,n,a,o,l,u=[[[],[],[],[],[]],[[],[],[],[],[]]],h=u[0],d=u[1],c=h[4],p=d[4],m=[],g=[];for(e=0;e<256;e++)g[(m[e]=e<<1^283*(e>>7))^e]=e;for(t=i=0;!c[t];t^=r||1,i=g[i]||1)for(a=i^i<<1^i<<2^i<<3^i<<4,a=a>>8^255&a^99,c[t]=a,p[a]=t,n=m[s=m[r=m[t]]],l=16843009*n^65537*s^257*r^16843008*t,o=257*m[a]^16843008*a,e=0;e<4;e++)h[e][t]=o=o<<24^o>>>8,d[e][a]=l=l<<24^l>>>8;for(e=0;e<5;e++)h[e]=h[e].slice(0),d[e]=d[e].slice(0);return u}(),this._tables=[[t[0][0].slice(),t[0][1].slice(),t[0][2].slice(),t[0][3].slice(),t[0][4].slice()],[t[1][0].slice(),t[1][1].slice(),t[1][2].slice(),t[1][3].slice(),t[1][4].slice()]];let i,r,s,n=this._tables[0][4],a=this._tables[1],o=e.length,l=1;if(4!==o&&6!==o&&8!==o)throw Error("Invalid aes key size");let u=e.slice(0),h=[];for(this._key=[u,h],i=o;i<4*o+28;i++)s=u[i-1],(i%o===0||8===o&&i%o===4)&&(s=n[s>>>24]<<24^n[s>>16&255]<<16^n[s>>8&255]<<8^n[255&s],i%o===0&&(s=s<<8^s>>>24^l<<24,l=l<<1^283*(l>>7))),u[i]=u[i-o]^s;for(r=0;i;r++,i--)s=u[3&r?i:i-4],h[r]=i<=4||r<4?s:a[0][n[s>>>24]]^a[1][n[s>>16&255]]^a[2][n[s>>8&255]]^a[3][n[255&s]]}decrypt(e,t,i,r,s,n){let a,o,l,u,h=this._key[1],d=e^h[0],c=r^h[1],p=i^h[2],m=t^h[3],g=h.length/4-2,f=4,y=this._tables[1],_=y[0],b=y[1],v=y[2],T=y[3],S=y[4];for(u=0;u<g;u++)a=_[d>>>24]^b[c>>16&255]^v[p>>8&255]^T[255&m]^h[f],o=_[c>>>24]^b[p>>16&255]^v[m>>8&255]^T[255&d]^h[f+1],l=_[p>>>24]^b[m>>16&255]^v[d>>8&255]^T[255&c]^h[f+2],m=_[m>>>24]^b[d>>16&255]^v[c>>8&255]^T[255&p]^h[f+3],f+=4,d=a,c=o,p=l;for(u=0;u<4;u++)s[(3&-u)+n]=S[d>>>24]<<24^S[c>>16&255]<<16^S[p>>8&255]<<8^S[255&m]^h[f++],a=d,d=c,c=p,p=m,m=a}}class s extends e{constructor(){super(e),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.timeout_=this.jobs.length?setTimeout(this.processJob_.bind(this),this.delay):null}push(e){this.jobs.push(e),this.timeout_||=setTimeout(this.processJob_.bind(this),this.delay)}}let n=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},a=function(e,t,i){let s,a,o,l,u,h,d,c,p,m=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),g=new r(Array.prototype.slice.call(t)),f=new Uint8Array(e.byteLength),y=new Int32Array(f.buffer);for(s=i[0],a=i[1],o=i[2],l=i[3],p=0;p<m.length;p+=4)u=n(m[p]),h=n(m[p+1]),d=n(m[p+2]),c=n(m[p+3]),g.decrypt(u,h,d,c,y,p),y[p]=n(y[p]^s),y[p+1]=n(y[p+1]^a),y[p+2]=n(y[p+2]^o),y[p+3]=n(y[p+3]^l),s=u,a=h,o=d,l=c;return f};class o{constructor(e,t,i,r){let a=o.STEP,l=new Int32Array(e.buffer),u=new Uint8Array(e.byteLength),h=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+a),t,i,u)),h=a;h<l.length;h+=a)i=new Uint32Array([n(l[h-4]),n(l[h-3]),n(l[h-2]),n(l[h-1])]),this.asyncStream_.push(this.decryptChunk_(l.subarray(h,h+a),t,i,u));this.asyncStream_.push(function(){r(null,function(e){return e.subarray(0,e.byteLength-e[e.byteLength-1])}(u))})}static get STEP(){return 32e3}decryptChunk_(e,t,i,r){return function(){let s=a(e,t,i);r.set(s,e.byteOffset)}}}var l=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof i.g<"u"?i.g:typeof self<"u"?self:{},u=(typeof window<"u"?window:void 0===l?typeof self<"u"?self:{}:l).BigInt||Number;u("0x1"),u("0x100"),u("0x10000"),u("0x1000000"),u("0x100000000"),u("0x10000000000"),u("0x1000000000000"),u("0x100000000000000"),u("0x10000000000000000"),function(){var e=new Uint16Array([65484]),t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);255===t[0]||t[0]}();self.onmessage=function(e){let t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),r=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),s=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new o(i,r,s,function(e,i){self.postMessage(function(e){let t={};return Object.keys(e).forEach(i=>{let r=e[i];!function(e){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer}(r)?t[i]=r:t[i]={bytes:r.buffer,byteOffset:r.byteOffset,byteLength:r.byteLength}}),t}({source:t.source,decrypted:i}),[i.buffer])})}})));const rc=e=>{let t=e.default?"main":"alternative";return e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0&&(t="main-desc"),t},sc=(e,t)=>{e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},nc=(e,t)=>{t.activePlaylistLoader=e,e.load()},ac={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:i},excludePlaylist:r}=t,s=i.activeTrack(),n=i.activeGroup(),a=(n.filter(e=>e.default)[0]||n[0]).id,o=i.tracks[a];if(s===o)r({error:{message:"Problem encountered loading the default audio track."}});else{cu.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(let e in i.tracks)i.tracks[e].enabled=i.tracks[e]===o;i.onTrackChanged()}},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:i}}=t;cu.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");let r=i.activeTrack();r&&(r.mode="disabled"),i.onTrackChanged()}},oc={AUDIO:(e,t,i)=>{if(!t)return;let{tech:r,requestOptions:s,segmentLoaders:{[e]:n}}=i;t.on("loadedmetadata",()=>{let e=t.media();n.playlist(e,s),(!r.paused()||e.endList&&"none"!==r.preload())&&n.load()}),t.on("loadedplaylist",()=>{n.playlist(t.media(),s),r.paused()||n.load()}),t.on("error",ac[e](e,i))},SUBTITLES:(e,t,i)=>{let{tech:r,requestOptions:s,segmentLoaders:{[e]:n},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{let e=t.media();n.playlist(e,s),n.track(a.activeTrack()),(!r.paused()||e.endList&&"none"!==r.preload())&&n.load()}),t.on("loadedplaylist",()=>{n.playlist(t.media(),s),r.paused()||n.load()}),t.on("error",ac[e](e,i))}},lc={AUDIO:(e,t)=>{let{vhs:i,sourceType:r,segmentLoaders:{[e]:s},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[e]:{groups:o,tracks:l,logger_:u}},mainPlaylistLoader:h}=t,d=Gu(h.main);(!a[e]||0===Object.keys(a[e]).length)&&(a[e]={main:{default:{default:!0}}},d&&(a[e].main.default.playlists=h.main.playlists));for(let s in a[e]){o[s]||(o[s]=[]);for(let c in a[e][s]){let p,m=a[e][s][c];d?(u(`AUDIO group '${s}' label '${c}' is a main playlist`),m.isMainPlaylist=!0,p=null):p="vhs-json"===r&&m.playlists?new yh(m.playlists[0],i,n):m.resolvedUri?new yh(m.resolvedUri,i,n):m.playlists&&"dash"===r?new Rh(m.playlists[0],i,n,h):null,m=vu({id:c,playlistLoader:p},m),oc[e](e,m.playlistLoader,t),o[s].push(m),void 0===l[c]&&(l[c]=new cu.AudioTrack({id:c,kind:rc(m),enabled:!1,language:m.language,default:m.default,label:c}))}}s.on("error",ac[e](e,t))},SUBTITLES:(e,t)=>{let{tech:i,vhs:r,sourceType:s,segmentLoaders:{[e]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[e]:{groups:l,tracks:u}},mainPlaylistLoader:h}=t;for(let n in o[e]){l[n]||(l[n]=[]);for(let d in o[e][n]){if(!r.options_.useForcedSubtitles&&o[e][n][d].forced)continue;let c,p=o[e][n][d];if("hls"===s)c=new yh(p.resolvedUri,r,a);else if("dash"===s){if(!p.playlists.filter(e=>e.excludeUntil!==1/0).length)return;c=new Rh(p.playlists[0],r,a,h)}else"vhs-json"===s&&(c=new yh(p.playlists?p.playlists[0]:p.resolvedUri,r,a));p=vu({id:d,playlistLoader:c},p),oc[e](e,p.playlistLoader,t),l[n].push(p),void 0===u[d]&&(u[d]=i.addRemoteTextTrack({id:d,kind:"subtitles",default:p.default&&p.autoselect,language:p.language,label:d},!1).track)}}n.on("error",ac[e](e,t))},"CLOSED-CAPTIONS":(e,t)=>{let{tech:i,main:{mediaGroups:r},mediaTypes:{[e]:{groups:s,tracks:n}}}=t;for(let t in r[e]){s[t]||(s[t]=[]);for(let a in r[e][t]){let o=r[e][t][a];if(!/^(?:CC|SERVICE)/.test(o.instreamId))continue;let l=i.options_.vhs&&i.options_.vhs.captionServices||{},u={label:a,language:o.language,instreamId:o.instreamId,default:o.default&&o.autoselect};l[u.instreamId]&&(u=vu(u,l[u.instreamId])),void 0===u.default&&delete u.default,s[t].push(vu({id:a},o)),void 0===n[a]&&(n[a]=i.addRemoteTextTrack({id:u.instreamId,kind:"captions",default:u.default,language:u.language,label:u.label},!1).track)}}}},uc=(e,t)=>{for(let i=0;i<e.length;i++)if(zu(t,e[i])||e[i].playlists&&uc(e[i].playlists,t))return!0;return!1},hc={AUDIO:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:i}}}=t;for(let e in i)if(i[e].enabled)return i[e];return null},SUBTITLES:(e,t)=>()=>{let{mediaTypes:{[e]:{tracks:i}}}=t;for(let e in i)if("showing"===i[e].mode||"hidden"===i[e].mode)return i[e];return null}};class dc{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){1===e&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=yu(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(e=>[e.ID,e])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class cc extends cu.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new dc,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=bu("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";let i=t.serverUri||t.serverURL;i?i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=yu(e,i),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")):(this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),this.trigger("error"))}requestSteeringManifest(e){let t=this.steeringManifest.reloadUri;if(!t)return;let i=e?t:this.getRequestURI(t);if(!i)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();let r={contentSteeringInfo:{uri:i}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:i,requestType:"content-steering-manifest"},(e,t)=>{if(e){if(410===t.status)return this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(429===t.status){let i=t.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${i} seconds.`),void this.startTTLTimeout_(parseInt(i,10))}return this.logger_(`manifest failed to load ${e}.`),void this.startTTLTimeout_()}let s;this.trigger({type:"contentsteeringloadcomplete",metadata:r});try{s=JSON.parse(this.request_.responseText)}catch(e){let t={errorType:cu.Error.StreamingContentSteeringParserError,error:e};this.trigger({type:"error",metadata:t})}this.assignSteeringProperties_(s);let n={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:n}),this.startTTLTimeout_()})}setProxyServerUrl_(e){let t=new Te.URL(e),i=new Te.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(e){let t=JSON.parse(Te.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){let t=new Te.URL(e),i=this.getPathway(),r=this.getBandwidth_();if(i){let e=`_${this.manifestType_}_pathway`;t.searchParams.set(e,i)}if(r){let e=`_${this.manifestType_}_throughput`;t.searchParams.set(e,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),void this.trigger("error");this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());let t=(e=>{for(let t of e)if(this.availablePathways_.has(t))return t;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==t&&(this.currentPathway=t,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;let t=e=>this.excludedSteeringManifestURLs.has(e);if(this.proxyServerUrl_){let i=this.setProxyServerUrl_(e);if(!t(i))return i}let i=this.setSteeringParams_(e);return t(i)?null:i}startTTLTimeout_(e=this.steeringManifest.ttl){let t=1e3*e;this.ttlTimeout_=Te.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){Te.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new dc}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(yu(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let pc;const mc=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],gc=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};class fc extends cu.EventTarget{constructor(e){super(),this.fastQualityChange_=(e=>{let t=null;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{e.apply(null,i)},100)}})(this.fastQualityChange_.bind(this));let{src:t,withCredentials:i,tech:r,bandwidth:s,externVhs:n,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:l,sourceType:u,cacheEncryptionKeys:h,bufferBasedABR:d,leastPixelDiffSelector:c,captionServices:p,experimentalUseMMS:m}=e;if(!t)throw Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:g}=e;g??=1/0,pc=n,this.bufferBasedABR=!!d,this.leastPixelDiffSelector=!!c,this.withCredentials=i,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=u,this.useCueTags_=a,this.playlistExclusionDuration=o,this.maxPlaylistRetries=g,this.enableLowInitialPlaylist=l,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:g,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{let e={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{e[t]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:wd,activeTrack:wd,getActiveGroup:wd,onGroupChanged:wd,onTrackChanged:wd,lastTrack_:null,logger_:bu(`MediaGroups[${t}]`)}}),e})(),m&&Te.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new Te.ManagedMediaSource,this.usingManagedMediaSource_=!0,cu.log("Using ManagedMediaSource")):Te.MediaSource&&(this.mediaSource=new Te.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=Tu(),this.hasPlayed_=!1,this.syncController_=new ec(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new ic,this.sourceUpdater_=new $d(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new tc,this.keyStatusMap_=new Map;let f={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:p,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:h,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new Rh(t,this.vhs_,vu(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new yh(t,this.vhs_,vu(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Ed(vu(f,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Ed(vu(f,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new Gd(vu(f,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function i(){r.off("vttjserror",s),e()}function s(){r.off("vttjsloaded",i),t()}r.one("vttjsloaded",i),r.one("vttjserror",s),r.addWebVttScript_()})}),e),this.contentSteeringController_=new cc(this.vhs_.xhr,()=>this.mainSegmentLoader_.bandwidth),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),mc.forEach(e=>{this[e+"_"]=gc.bind(this,e)}),this.logger_=bu("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;let y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,()=>{let e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){let e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){let t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,i){let r=this.media(),s=r&&(r.id||r.uri),n=e&&(e.id||e.uri);if(s&&s!==n){this.logger_(`switch media ${s} -> ${n} from ${t}`);let i={renditionInfo:{id:n,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:i}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{let t=this.mediaTypes_[e],i=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(i&&r){let t=(i.length?i[0].playlists:i.playlists).filter(e=>e.attributes.serviceLocation===r);t.length&&this.mediaTypes_[e].activePlaylistLoader.media(t[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=Te.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(Te.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){let e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;let i,r=e.mediaGroups.AUDIO,s=Object.keys(r);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{let e=r.main||s.length&&r[s[0]];for(let t in e)if(e[t].default){i={label:t};break}}if(!i)return t;let n=[];for(let t in r)if(r[t][i.label]){let s=r[t][i.label];if(s.playlists&&s.playlists.length)n.push.apply(n,s.playlists);else if(s.uri)n.push(s);else if(e.playlists.length)for(let i=0;i<e.playlists.length;i++){let r=e.playlists[i];r.attributes&&r.attributes.AUDIO&&r.attributes.AUDIO===t&&n.push(r)}}return n.length?n:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{let e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Vu(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),(e=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(t=>{lc[t](t,e)});let{mediaTypes:t,mainPlaylistLoader:i,tech:r,vhs:s,segmentLoaders:{AUDIO:n,main:a}}=e;["AUDIO","SUBTITLES"].forEach(i=>{t[i].activeGroup=((e,t)=>i=>{let{mainPlaylistLoader:r,mediaTypes:{[e]:{groups:s}}}=t,n=r.media();if(!n)return null;let a=null;n.attributes[e]&&(a=s[n.attributes[e]]);let o=Object.keys(s);if(!a)if("AUDIO"===e&&o.length>1&&Gu(t.main))for(let e=0;e<o.length;e++){let t=s[o[e]];if(uc(t,n)){a=t;break}}else s.main?a=s.main:1===o.length&&(a=s[o[0]]);return void 0===i?a:null!==i&&a&&a.filter(e=>e.id===i.id)[0]||null})(i,e),t[i].activeTrack=hc[i](i,e),t[i].onGroupChanged=((e,t)=>()=>{let{segmentLoaders:{[e]:i,main:r},mediaTypes:{[e]:s}}=t,n=s.activeTrack(),a=s.getActiveGroup(),o=s.activePlaylistLoader,l=s.lastGroup_;a&&l&&a.id===l.id||(s.lastGroup_=a,s.lastTrack_=n,sc(i,s),a&&!a.isMainPlaylist&&(a.playlistLoader?(i.resyncLoader(),nc(a.playlistLoader,s)):o&&r.resetEverything()))})(i,e),t[i].onGroupChanging=((e,t)=>()=>{let{segmentLoaders:{[e]:i},mediaTypes:{[e]:r}}=t;r.lastGroup_=null,i.abort(),i.pause()})(i,e),t[i].onTrackChanged=((e,t)=>()=>{let{mainPlaylistLoader:i,segmentLoaders:{[e]:r,main:s},mediaTypes:{[e]:n}}=t,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,u=n.lastTrack_;if((!u||!a||u.id!==a.id)&&(n.lastGroup_=o,n.lastTrack_=a,sc(r,n),o))if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;let e=t.vhs.playlistController_,r=e.selectPlaylist();if(e.media()===r)return;n.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),i.pause(),s.resetEverything(),e.fastQualityChange_(r)}else{if("AUDIO"===e){if(!o.playlistLoader)return s.setAudio(!0),void s.resetEverything();r.setAudio(!0),s.setAudio(!1)}l===o.playlistLoader||(r.track&&r.track(a),r.resetEverything()),nc(o.playlistLoader,n)}})(i,e),t[i].getActiveGroup=((e,{mediaTypes:t})=>()=>{let i=t[e].activeTrack();return i?t[e].activeGroup(i):null})(i,e)});let o=t.AUDIO.activeGroup();if(o){let e=(o.filter(e=>e.default)[0]||o[0]).id;t.AUDIO.tracks[e].enabled=!0,t.AUDIO.onGroupChanged(),t.AUDIO.onTrackChanged(),t.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>t[e].onGroupChanging())});let l=()=>{t.AUDIO.onTrackChanged(),r.trigger({type:"usage",name:"vhs-audio-change"})};r.audioTracks().addEventListener("change",l),r.remoteTextTracks().addEventListener("change",t.SUBTITLES.onTrackChanged),s.on("dispose",()=>{r.audioTracks().removeEventListener("change",l),r.remoteTextTracks().removeEventListener("change",t.SUBTITLES.onTrackChanged)}),r.clearTracks("audio");for(let e in t.AUDIO.tracks)r.audioTracks().addTrack(t.AUDIO.tracks[e])})({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),e),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){let t;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||=this.selectPlaylist(),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),"vhs-json"!==this.sourceType_||!this.initialMedia_.segments))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),this.mainPlaylistLoader_.on("error",()=>{let e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{let e=this.mainPlaylistLoader_.media(),t=1.5*e.targetDuration*1e3;Vu(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,"dash"===this.sourceType_&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{let e=this.mainPlaylistLoader_.media();"playlist-unchanged"!==e.lastExcludeReason_&&this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(e=>{this.mainPlaylistLoader_.on(e,e=>{this.player_.trigger(At({},e))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){let i=e.mediaGroups||{},r=!0,s=Object.keys(i.AUDIO);for(let e in i.AUDIO)for(let t in i.AUDIO[e])i.AUDIO[e][t].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),pc.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(i.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){let t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),r=this.bufferLowWaterLine(),s=this.bufferHighWaterLine();return function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:r,bufferLowWaterLine:s,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!r)return cu.log.warn("We received no playlist to switch to. Please check your stream."),!1;let u=`allowing switch ${e&&e.id||"null"} -> ${r.id}`;if(!e)return l(`${u} as current playlist is not set`),!0;if(r.id===e.id)return!1;let h=!!wu(t,i).length;if(!e.endList)return h||"number"!=typeof e.partTargetDuration?(l(`${u} as current playlist is live`),!0):(l(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);let d=Pu(t,i),c=o?Uh.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Uh.MAX_BUFFER_LOW_WATER_LINE;if(a<c)return l(`${u} as duration < max low water line (${a} < ${c})`),!0;let p=r.attributes.BANDWIDTH,m=e.attributes.BANDWIDTH;if(p<m&&(!o||d<n)){let e=`${u} as next bandwidth < current bandwidth (${p} < ${m})`;return o&&(e+=` and forwardBuffer < bufferHighWaterLine (${d} < ${n})`),l(e),!0}if((!o||p>m)&&d>=s){let e=`${u} as forwardBuffer >= bufferLowWaterLine (${d} >= ${s})`;return o&&(e+=` and next bandwidth > current bandwidth (${p} > ${m})`),l(e),!0}return l(`not ${u} as no switching criteria met`),!1}({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{let e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{let e=this.audioSegmentLoader_.pendingSegment_;if(!e||!e.segment||!e.segment.syncInfo)return;let t=e.segment.syncInfo.end+.01;this.tech_.setCurrentTime(t)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",e=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))});let e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();let e=this.getCodecsOrExclude_();e&&this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||=(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||=(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(e=>{this.mainSegmentLoader_.on(e,e=>{this.player_.trigger(At({},e))}),this.audioSegmentLoader_.on(e,e=>{this.player_.trigger(At({},e))}),this.subtitleSegmentLoader_.on(e,e=>{this.player_.trigger(At({},e))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){e&&e===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();let e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}setupFirstPlay(){let e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){let t=this.seekable();if(!t.length)return!1;let i=t.end(0),r=i;if(e.start){let s=e.start.timeOffset;if(s<0){let n=this.mainPlaylistLoader_.main,a=i+pc.Playlist.liveEdgeDelay(n,e);r=Math.max(Math.min(a+s,i),t.start(0))}else r=Math.min(i,s)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){let e=this.tech_.play();void 0!==e&&"function"==typeof e.then&&e.then(null,e=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;let e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;let t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){let t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e&&=this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;let t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;let i=pc.Playlist.playlistEnd(e,t),r=this.tech_.currentTime(),s=this.tech_.buffered();if(!s.length)return i-r<=Cu;let n=s.end(s.length-1);return n-r<=Cu&&i-n<=Cu}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:i}){if(e||=this.mainPlaylistLoader_.media(),i=i||t.playlistExclusionDuration||this.playlistExclusionDuration,!e)return this.error=t,void("open"===this.mediaSource.readyState?this.sourceUpdater_.endOfStream("network"):this.trigger("error"));e.playlistErrors_++;let r,s=this.mainPlaylistLoader_.main.playlists,n=s.filter(Hu),a=1===n.length&&n[0]===e;if(1===s.length&&i!==1/0)return cu.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){let t=this.pathwayAttribute_(e),i=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(t),this.excludeThenChangePathway_(),void setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(t)},i)}let t=!1;s.forEach(i=>{if(i===e)return;let r=i.excludeUntil;void 0!==r&&r!==1/0&&(t=!0,delete i.excludeUntil)}),t&&(cu.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}r=e.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,e.excludeUntil=r,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});let o=this.selectPlaylist();if(!o)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");let l=t.internal?this.logger_:cu.log.warn,u=t.message?" "+t.message:"";l(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${u} Switching to playlist ${o.id}.`),o.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),o.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);let h=o.targetDuration/2*1e3||5e3,d="number"==typeof o.lastRequest&&Date.now()-o.lastRequest<=h;return this.switchMedia_(o,"exclude",a||d)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){let i=[],r="all"===e;(r||"main"===e)&&i.push(this.mainPlaylistLoader_);let s=[];(r||"audio"===e)&&s.push("AUDIO"),(r||"subtitle"===e)&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(e=>{let t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;t&&i.push(t)}),["main","audio","subtitle"].forEach(t=>{let r=this[`${t}SegmentLoader_`];r&&(e===t||"all"===e)&&i.push(r)}),i.forEach(e=>t.forEach(t=>{"function"==typeof e[t]&&e[t]()}))}setCurrentTime(e){let t=wu(this.tech_.buffered(),e);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;let e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:pc.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){let i=e.media();if(!i)return null;let r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){let e=r.start,t=r.end;if(!isFinite(e)||!isFinite(t))return null;let s=pc.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i);return Tu([[e,Math.max(e,t-s)]])}let s=this.syncController_.getExpiredTime(i,this.duration());if(null===s)return null;let n=pc.Playlist.seekable(i,s,pc.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return n.length?n:null}computeFinalSeekable_(e,t){if(!t)return e;let i=e.start(0),r=e.end(0),s=t.start(0),n=t.end(0);return s>r||i>n?e:Tu([[Math.max(i,s),Math.min(r,n)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;let e,t=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!t)return;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(e=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!e))return;let i=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(t,e),!this.seekable_||i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${Iu(this.seekable_)}]`);let r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&=(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){let e=this.seekable();if(!e.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<e.end(e.length-1))&&this.sourceUpdater_.setDuration(e.end(e.length-1)))}let t=this.tech_.buffered(),i=pc.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(i=Math.max(i,t.end(t.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{let t=this.mediaTypes_[e].groups;for(let e in t)t[e].forEach(e=>{e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){let e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)}getCodecsOrExclude_(){let e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;let i=lh(this.main(),t),r={},s=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=i.video||e.main.videoCodec||"avc1.4d400d"),e.main.isMuxed&&(r.video+=`,${i.audio||e.main.audioCodec||Qt}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||s)&&(r.audio=i.audio||e.main.audioCodec||e.audio.audioCodec||Qt,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video)return void this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});let n,a=(e,t)=>e?Zt(t,this.usingManagedMediaSource_):Yt(t),o={};if(["video","audio"].forEach(function(t){if(r.hasOwnProperty(t)&&!a(e[t].isFmp4,r[t])){let i=e[t].isFmp4?"browser":"muxer";o[i]=o[i]||[],o[i].push(r[t]),"audio"===t&&(n=i)}}),s&&n&&t.attributes.AUDIO){let e=t.attributes.AUDIO;this.main().playlists.forEach(i=>{(i.attributes&&i.attributes.AUDIO)===e&&i!==t&&(i.excludeUntil=1/0)}),this.logger_(`excluding audio group ${e} as ${n} does not support codec(s): "${r.audio}"`)}if(!Object.keys(o).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){let e=[];if(["video","audio"].forEach(t=>{let i=(Gt(this.sourceUpdater_.codecs[t]||"")[0]||{}).type,s=(Gt(r[t]||"")[0]||{}).type;i&&s&&i.toLowerCase()!==s.toLowerCase()&&e.push(`"${this.sourceUpdater_.codecs[t]}" -> "${r[t]}"`)}),e.length)return void this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${e.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return r}{let e=Object.keys(o).reduce((e,t)=>(e&&(e+=", "),e+`${t} does not support codec(s): "${o[t].join(",")}"`),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:e},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;let e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);let t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){let e=this.main().playlists,t=[];Object.keys(e).forEach(i=>{let r=e[i];if(-1!==t.indexOf(r.id))return;t.push(r.id);let s=lh(this.main,r),n=[];s.audio&&!Yt(s.audio)&&!Zt(s.audio,this.usingManagedMediaSource_)&&n.push(`audio codec ${s.audio}`),s.video&&!Yt(s.video)&&!Zt(s.video,this.usingManagedMediaSource_)&&n.push(`video codec ${s.video}`),s.text&&"stpp.ttml.im1t"===s.text&&n.push(`text codec ${s.text}`),n.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${n.join(", ")}`))})}excludeIncompatibleVariants_(e){let t=[],i=this.main().playlists,r=ah(Gt(e)),s=oh(r),n=r.video&&Gt(r.video)[0]||null,a=r.audio&&Gt(r.audio)[0]||null;Object.keys(i).forEach(e=>{let r=i[e];if(-1!==t.indexOf(r.id)||r.excludeUntil===1/0)return;t.push(r.id);let o=[],l=lh(this.mainPlaylistLoader_.main,r),u=oh(l);if(l.audio||l.video){if(u!==s&&o.push(`codec count "${u}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){let e=l.video&&Gt(l.video)[0]||null,t=l.audio&&Gt(l.audio)[0]||null;e&&n&&e.type.toLowerCase()!==n.type.toLowerCase()&&o.push(`video codec "${e.type}" !== "${n.type}"`),t&&a&&t.type.toLowerCase()!==a.type.toLowerCase()&&o.push(`audio codec "${t.type}" !== "${a.type}"`)}o.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id}: ${o.join(" && ")}`))}})}updateAdCues_(e){let t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i=0){if(!e.segments)return;let r,s=i;for(let i=0;i<e.segments.length;i++){let n=e.segments[i];if(r||=Xd(t,s+n.duration/2),r){if("cueIn"in n){r.endTime=s,r.adEndTime=s,s+=n.duration,r=null;continue}if(s<r.endTime){s+=n.duration;continue}r.endTime+=n.duration}else if("cueOut"in n&&(r=new Te.VTTCue(s,s+n.duration,n.cueOut),r.adStartTime=s,r.adEndTime=s+parseFloat(n.cueOut),t.addCue(r)),"cueOutCont"in n){let[e,i]=n.cueOutCont.split("/").map(parseFloat);r=new Te.VTTCue(s,s+n.duration,""),r.adStartTime=s-e,r.adEndTime=r.adStartTime+i,t.addCue(r)}s+=n.duration}}(e,this.cueTagsTrack_,t)}goalBufferLength(){let e=this.tech_.currentTime(),t=Uh.GOAL_BUFFER_LENGTH,i=Uh.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Uh.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,r)}bufferLowWaterLine(){let e=this.tech_.currentTime(),t=Uh.BUFFER_LOW_WATER_LINE,i=Uh.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Uh.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(t,Uh.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?s:r)}bufferHighWaterLine(){return Uh.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){md(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:e,dateRanges:t})=>{let i=e.metadataTrack_;if(!i)return;let r=Te.WebKitDataCue||Te.VTTCue;t.forEach(e=>{for(let t of Object.keys(e)){if(pd.has(t))continue;let s=new r(e.startTime,e.endTime,"");s.id=e.id,s.type="com.apple.quicktime.HLS",s.value={key:cd[t],data:e[t]},("scte35Out"===t||"scte35In"===t)&&(s.value.data=new Uint8Array(s.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(s)}e.processDateRange()})})({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){let r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();md(this.inbandTextTracks_,e,this.tech_),(({inbandTextTracks:e,metadataArray:t,timestampOffset:i,videoDuration:r})=>{if(!t)return;let s=Te.WebKitDataCue||Te.VTTCue,n=e.metadataTrack_;if(!n||(t.forEach(e=>{let t=e.cueTime+i;"number"!=typeof t||Te.isNaN(t)||t<0||!(t<1/0)||e.frames&&e.frames.length&&e.frames.forEach(e=>{let i=new s(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:()=>(cu.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key)},value:{get:()=>(cu.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data)},privateData:{get:()=>(cu.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data)}})}(i),n.addCue(i)})}),!n.cues||!n.cues.length))return;let a=n.cues,o=[];for(let e=0;e<a.length;e++)a[e]&&o.push(a[e]);let l=o.reduce((e,t)=>{let i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e},{}),u=Object.keys(l).sort((e,t)=>Number(e)-Number(t));u.forEach((e,t)=>{let i=l[e],s=isFinite(r)?r:e,n=Number(u[t+1])||s;i.forEach(e=>{e.endTime=n})})})({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:i})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){let e=this.main();if(e.contentSteering){for(let t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.contentSteeringController_.on(e,e=>{this.trigger(At({},e))})}),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{let e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{let t=this.contentSteeringController_.getAvailablePathways(),i=[];for(let r of e.playlists){let e=r.attributes.serviceLocation;if(e&&(i.push(e),!t.has(e)))return!0}return!(i.length||!t.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){let e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();let t=this.main().playlists,i=new Set,r=!1;Object.keys(t).forEach(s=>{let n=t[s],a=this.pathwayAttribute_(n),o=a&&e!==a;n.excludeUntil===1/0&&"content-steering"===n.lastExcludeReason_&&!o&&(delete n.excludeUntil,delete n.lastExcludeReason_,r=!0);let l=!n.excludeUntil&&n.excludeUntil!==1/0;!i.has(n.id)&&o&&l&&(i.add(n.id),n.excludeUntil=1/0,n.lastExcludeReason_="content-steering",this.logger_(`excluding ${n.id} for ${n.lastExcludeReason_}`))}),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach(t=>{let i=this.mediaTypes_[t];if(i.activePlaylistLoader){let t=i.activePlaylistLoader.media_;t&&t.attributes.serviceLocation!==e&&(r=!0)}}),r&&this.changeSegmentPathway_()}handlePathwayClones_(){let e=this.main().playlists,t=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(t&&t.size||i&&i.size){for(let[e,r]of t.entries())i.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(r),this.contentSteeringController_.excludePathway(e));for(let[r,s]of i.entries()){let i=t.get(r);i?this.equalPathwayClones_(i,s)||(this.mainPlaylistLoader_.updateOrDeleteClone(s,!0),this.contentSteeringController_.addAvailablePathway(r)):(e.filter(e=>e.attributes["PATHWAY-ID"]===s["BASE-ID"]).forEach(e=>{this.mainPlaylistLoader_.addClonePathway(s,e)}),this.contentSteeringController_.addAvailablePathway(r))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;let i=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(let e in i)if(i[e]!==r[e])return!1;for(let e in r)if(i[e]!==r[e])return!1;return!0}changeSegmentPathway_(){let e=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0,t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(i=>{let r=this.mainPlaylistLoader_.getKeyIdSet(i);r&&r.size&&r.forEach(r=>{let s="usable",n=this.keyStatusMap_.has(r)&&this.keyStatusMap_.get(r)===s,a=i.lastExcludeReason_===t&&i.excludeUntil===1/0;n?n&&a&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${r} is ${s}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==t&&(i.excludeUntil=1/0,i.lastExcludeReason_=t,this.logger_(`excluding playlist ${i.id} because the key ID ${r} doesn't exist in the keyStatusMap or is not ${s}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(e=>{let i=e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height<720,r=e.excludeUntil===1/0&&e.lastExcludeReason_===t;i&&r&&(delete e.excludeUntil,cu.log.warn(`enabling non-HD playlist ${e.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){let i=("string"==typeof e?e:(e=>{let t=new Uint8Array(e);return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")})(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}class yc{constructor(e,t,i){let{playlistController_:r}=e,s=r.fastQualityChange_.bind(r);if(t.attributes){let e=t.attributes.RESOLUTION;this.width=e&&e.width,this.height=e&&e.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=lh(r.main(),t),this.playlist=t,this.id=i,this.enabled=((e,t,i)=>r=>{let s=e.main.playlists[t],n=ju(s),a=Hu(s);if(void 0===r)return a;r?delete s.disabled:s.disabled=!0;let o={renditionInfo:{id:t,bandwidth:s.attributes.BANDWIDTH,resolution:s.attributes.RESOLUTION,codecs:s.attributes.CODECS},cause:"fast-quality"};return r!==a&&!n&&(r?(i(s),e.trigger({type:"renditionenabled",metadata:o})):e.trigger({type:"renditiondisabled",metadata:o})),r})(e.playlists,t.id,s)}}const _c=["seeking","seeked","pause","playing","error"];class bc extends cu.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=bu("PlaybackWatcher"),this.logger_("initialize");let t=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),s=()=>this.resetTimeUpdate_(),n=this.playlistController_,a=["main","subtitle","audio"],o={};a.forEach(e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)},n[`${e}SegmentLoader_`].on("appendsdone",o[e].updateend),n[`${e}SegmentLoader_`].on("playlistupdate",o[e].reset),this.tech_.on(["seeked","seeking"],o[e].reset)});let l=e=>{["main","audio"].forEach(t=>{n[`${t}SegmentLoader_`][e]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),l("off"))},this.clearSeekingAppendCheck_=()=>l("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),l("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(_c,s),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(_c,s),this.tech_.off("canplay",i),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),a.forEach(e=>{n[`${e}SegmentLoader_`].off("appendsdone",o[e].updateend),n[`${e}SegmentLoader_`].off("playlistupdate",o[e].reset),this.tech_.off(["seeked","seeking"],o[e].reset)}),this.checkCurrentTimeTimeout_&&Te.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&Te.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=Te.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){let t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){let t=this.playlistController_,i=t[`${e}SegmentLoader_`],r=i.buffered_(),s=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e||e.length!==t.length)return!0;for(let i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1}(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,s){let i={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:i}),this.resetSegmentDownloads_(e)}else this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:xu(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),"subtitle"!==e&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;let e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Cu>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Tu([this.lastRecordedTime,e]));let t={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:t}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;let e,t=this.seekable(),i=this.tech_.currentTime();if(this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){let i=t.start(0);e=i+(i===t.end(0)?0:Cu)}if(void 0!==e)return this.logger_(`Trying to seek outside of seekable at time ${i} with seekable range ${Iu(t)}. Seeking to ${e}.`),this.tech_.setCurrentTime(e),!0;let r=this.playlistController_.sourceUpdater_,s=this.tech_.buffered(),n=r.audioBuffer?r.audioBuffered():null,a=r.videoBuffer?r.videoBuffered():null,o=this.media(),l=o.partTargetDuration?o.partTargetDuration:2*(o.targetDuration-Su),u=[n,a];for(let e=0;e<u.length;e++)if(u[e]&&Pu(u[e],i)<l)return!1;let h=ku(s,i);return 0!==h.length&&(e=h.start(0)+Cu,this.logger_(`Buffered region starts (${h.start(0)}) just beyond seek point (${i}). Seeking to ${e}.`),this.tech_.setCurrentTime(e),!0)}waiting_(){if(this.techWaiting_())return;let e=this.tech_.currentTime(),t=this.tech_.buffered(),i=wu(t,e);i.length&&e+3<=i.end(0)&&(this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${i.start(0)} -> ${i.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}))}techWaiting_(){let e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){let i=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${i}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}let i=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;let s=ku(r,t);return s.length>0&&(this.logger_(`Stopped at ${t} and seeking to ${s.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0)}afterSeekableWindow_(e,t,i,r=!1){if(!e.length)return!1;let s=e.end(e.length-1)+Cu,n=!i.endList,a="number"==typeof i.partTargetDuration;return n&&(a||r)&&(s=e.end(e.length-1)+3*i.targetDuration),t>s}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:i}){if(!e)return;let r;if(e.length&&t.length){let s=wu(e,i-3),n=wu(e,i),a=wu(t,i);a.length&&!n.length&&s.length&&(r={start:s.end(0),end:a.end(0)})}else ku(e,i).length||(r=this.gapFromVideoUnderflow_(e,i));return!!r&&(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${i}`),!0)}skipTheGap_(e){let t=this.tech_.buffered(),i=this.tech_.currentTime(),r=ku(t,i);if(this.resetTimeUpdate_(),0===r.length||i!==e)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+Su);let s={gapInfo:{from:i,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:s}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){let i=function(e){if(e.length<2)return Tu();let t=[];for(let i=1;i<e.length;i++){let r=e.end(i-1),s=e.start(i);t.push([r,s])}return Tu(t)}(e);for(let e=0;e<i.length;e++){let r=i.start(e),s=i.end(e);if(t-r<4&&t-r>2)return{start:r,end:s}}return null}}const vc={errorInterval:30,getSource(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Tc=function(e,t){let i=0,r=0,s=vu(vc,t);e.ready(()=>{e.trigger({type:"usage",name:"vhs-error-reload-initialized"})});let n=function(){r&&e.currentTime(r)},a=function(t){null!=t&&(r=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",n),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.play())},o=function(){if(Date.now()-i<1e3*s.errorInterval)e.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(s.getSource&&"function"==typeof s.getSource)return i=Date.now(),s.getSource.call(e,a);cu.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},l=function(){e.off("loadedmetadata",n),e.off("error",o),e.off("dispose",l)};e.on("error",o),e.on("dispose",l),e.reloadSourceOnError=function(t){l(),Tc(e,t)}};var Sc="3.17.5";const Cc={PlaylistLoader:yh,Playlist:Xu,utils:xh,STANDARD_PLAYLIST_SELECTOR:hd,INITIAL_PLAYLIST_SELECTOR:function(){let e=this.playlists.main.playlists.filter(Xu.isEnabled);return od(e,(e,t)=>ld(e,t)),e.filter(e=>!!lh(this.playlists.main,e).video)[0]||null},lastBandwidthSelector:hd,movingAverageBandwidthSelector:function(e){let t=-1,i=-1;if(e<0||e>1)throw Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let r=this.useDevicePixelRatio&&Te.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(r=this.customPixelRatio),t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),ud({main:this.playlists.main,bandwidth:t,playerWidth:parseInt(ad(this.tech_.el(),"width"),10)*r,playerHeight:parseInt(ad(this.tech_.el(),"height"),10)*r,playerObjectFit:this.usePlayerObjectFit?ad(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},comparePlaylistBandwidth:ld,comparePlaylistResolution:function(e,t){let i,r;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i||=Te.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(r=t.attributes.RESOLUTION.width),r||=Te.Number.MAX_VALUE,i===r&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-r},xhr:bh()};Object.keys(Uh).forEach(e=>{Object.defineProperty(Cc,e,{get:()=>(cu.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),Uh[e]),set(t){cu.log.warn(`using Vhs.${e} is UNSAFE be sure you know what you are doing`),"number"!=typeof t||t<0?cu.log.warn(`value of Vhs.${e} must be greater than or equal to 0`):Uh[e]=t}})});const Ec="videojs-vhs",wc=function(e,t){let i=t.media(),r=-1;for(let t=0;t<e.length;t++)if(e[t].id===i.id){r=t;break}e.selectedIndex_=r,e.trigger({selectedIndex:r,type:"change"})};Cc.canPlaySource=function(){return cu.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const kc=()=>{if(!Te.localStorage)return null;let e=Te.localStorage.getItem(Ec);if(!e)return null;try{return JSON.parse(e)}catch{return null}},Ic=(e,t)=>{e._requestCallbackSet||=new Set,e._requestCallbackSet.add(t)},xc=(e,t)=>{e._responseCallbackSet||=new Set,e._responseCallbackSet.add(t)},Ac=(e,t)=>{e._requestCallbackSet&&(e._requestCallbackSet.delete(t),e._requestCallbackSet.size||delete e._requestCallbackSet)},Pc=(e,t)=>{e._responseCallbackSet&&(e._responseCallbackSet.delete(t),e._responseCallbackSet.size||delete e._responseCallbackSet)};Cc.supportsNativeHls=function(){if(!tt||!tt.createElement)return!1;let e=tt.createElement("video");return!!cu.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(e.canPlayType(t))})}(),Cc.supportsNativeDash=!!(tt&&tt.createElement&&cu.getTech("Html5").isSupported())&&/maybe|probably/i.test(tt.createElement("video").canPlayType("application/dash+xml")),Cc.supportsTypeNatively=e=>"hls"===e?Cc.supportsNativeHls:"dash"===e&&Cc.supportsNativeDash,Cc.isSupported=function(){return cu.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Cc.xhr.onRequest=function(e){Ic(Cc.xhr,e)},Cc.xhr.onResponse=function(e){xc(Cc.xhr,e)},Cc.xhr.offRequest=function(e){Ac(Cc.xhr,e)},Cc.xhr.offResponse=function(e){Pc(Cc.xhr,e)};const Mc=cu.getComponent("Component");class Dc extends Mc{constructor(e,t,i){if(super(t,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=bu("VhsHandler"),t.options_&&t.options_.playerId){let e=cu.getPlayer(t.options_.playerId);this.player_=e}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(tt,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{let t=tt.fullscreenElement||tt.webkitFullscreenElement||tt.mozFullScreenElement||tt.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=vu(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=void 0===this.source_.useBandwidthFromLocalStorage?this.options_.useBandwidthFromLocalStorage||!1:this.source_.useBandwidthFromLocalStorage,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=void 0===this.options_.useNetworkInformationApi||this.options_.useNetworkInformationApi,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){let e=kc();e&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Uh.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Uh.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{void 0!==this.source_[e]&&(this.options_[e]=this.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;let t=this.options_.customPixelRatio;"number"==typeof t&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=(e=>0===e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e)(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Cc,this.options_.sourceType=ti(t),this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)},this.options_.player_=this.player_,this.playlistController_=new fc(this.options_);let i=vu({liveRangeSafeTimeDelta:Cu},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new bc(i),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{let e=cu.players[this.tech_.options_.playerId],t=this.playlistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)});let r=this.options_.bufferBasedABR?Cc.movingAverageBandwidthSelector(.55):Cc.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Cc.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth,t=Te.navigator.connection||Te.navigator.mozConnection||Te.navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&t){let r=1e3*t.downlink*1e3;e=r>=i&&e>=i?Math.max(e,r):r}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){let e,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set(){cu.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>xu(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>xu(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&(e=>{if(!Te.localStorage)return!1;let t=kc();t=t?vu(t,e):e;try{Te.localStorage.setItem(Ec,JSON.stringify(t))}catch{return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{!function(e){e.representations=()=>{let t=e.playlistController_.main(),i=Gu(t)?e.playlistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(e=>!ju(e)).map((t,i)=>new yc(e,t,t.id)):[]}}(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=Te.URL.createObjectURL(this.playlistController_.mediaSource),(cu.browser.IS_ANY_SAFARI||cu.browser.IS_IOS)&&this.options_.overrideNative&&"hls"===this.options_.sourceType&&"function"==typeof this.tech_.addSourceElement?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),(({player:e,sourceKeySystems:t,audioMedia:i,mainPlaylists:r})=>{if(!e.eme.initializeMediaKeys)return Promise.resolve();let s=((e,t)=>e.reduce((e,i)=>{if(!i.contentProtection)return e;let r=t.reduce((e,t)=>{let r=i.contentProtection[t];return r&&r.pssh&&(e[t]={pssh:r.pssh}),e},{});return Object.keys(r).length&&e.push(r),e},[]))(i?r.concat([i]):r,Object.keys(t)),n=[],a=[];return s.forEach(t=>{a.push(new Promise((t,i)=>{e.tech_.one("keysessioncreated",t)})),n.push(new Promise((i,r)=>{e.eme.initializeMediaKeys({keySystems:t},e=>{e?r(e):i()})}))}),Promise.race([Promise.all(n),Promise.race(a)])})({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){let e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=(({player:e,sourceKeySystems:t,media:i,audioMedia:r})=>{let s=((e,t,i)=>{if(!e)return e;let r={};t&&t.attributes&&t.attributes.CODECS&&(r=ah(Gt(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(r.audio=i.attributes.CODECS);let s=Kt(r.video),n=Kt(r.audio),a={};for(let i in e)a[i]={},n&&(a[i].audioContentType=n),s&&(a[i].videoContentType=s),t.contentProtection&&t.contentProtection[i]&&t.contentProtection[i].pssh&&(a[i].pssh=t.contentProtection[i].pssh),"string"==typeof e[i]&&(a[i].url=e[i]);return vu(e,a)})(t,i,r);return!(!s||(e.currentSource().keySystems=s,s&&!e.eme&&(cu.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))})({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{this.playlistController_.updatePlaylistByKeyStatus(e.keyId,e.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),t?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){let e=cu.players[this.tech_.options_.playerId];e&&e.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{!function(e,t){t.representations().forEach(t=>{e.addQualityLevel(t)}),wc(e,t.playlists)}(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{wc(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Sc,"mux.js":"7.1.0","mpd-parser":"1.4.0","m3u8-parser":"7.2.0","aes-decrypter":"4.0.2"}}version(){return this.constructor.version()}canChangeType(){return $d.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&Te.URL.revokeObjectURL&&(Te.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return(({playlist:e,time:t,callback:i})=>{if(!i)throw Error("getProgramTime: callback must be provided");if(!e||void 0===t)return i({message:"getProgramTime: playlist and time must be provided"});let r=((e,t)=>{if(!t||!t.segments||0===t.segments.length)return null;let i,r=0;for(let s=0;s<t.segments.length&&(i=t.segments[s],r=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:r+i.duration,!(e<=r));s++);let s=t.segments[t.segments.length-1];if(s.videoTimingInfo&&s.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(e>r){if(e>r+.25*s.duration)return null;i=s}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:r-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}})(t,e);if(!r)return i({message:"valid programTime was not found"});if("estimate"===r.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:r.estimatedStart});let s={mediaSeconds:t},n=((e,t)=>{if(!t.dateTimeObject)return null;let i=t.videoTimingInfo.transmuxerPrependedSeconds,r=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*r)})(t,r.segment);return n&&(s.programDateTime=n.toISOString()),i(null,s)})({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=!0,r=2){return Ah({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Ic(this.xhr,e)},this.xhr.onResponse=e=>{xc(this.xhr,e)},this.xhr.offRequest=e=>{Ac(this.xhr,e)},this.xhr.offResponse=e=>{Pc(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(e=>{this.playlistController_.on(e,e=>{this.player_.trigger(At({},e))})}),["gapjumped","playedrangeschanged"].forEach(e=>{this.playbackWatcher_.on(e,e=>{this.player_.trigger(At({},e))})})}}const Lc={name:"videojs-http-streaming",VERSION:Sc,canHandleSource(e,t={}){let i=vu(cu.options,t);return!(!i.vhs.experimentalUseMMS&&!Zt("avc1.4d400d,mp4a.40.2",!1))&&Lc.canPlayType(e.type,i)},handleSource(e,t,i={}){let r=vu(cu.options,i);return t.vhs=new Dc(e,t,r),t.vhs.xhr=bh(),t.vhs.setupXhrHooks_(),t.vhs.src(e.src,e.type),t.vhs},canPlayType(e,t){let i=ti(e);if(!i)return"";let r=Lc.getOverrideNative(t);return!Cc.supportsTypeNatively(i)||r?"maybe":""},getOverrideNative(e={}){let{vhs:t={}}=e,i=!(cu.browser.IS_ANY_SAFARI||cu.browser.IS_IOS),{overrideNative:r=i}=t;return r}};Zt("avc1.4d400d,mp4a.40.2",!0)&&cu.getTech("Html5").registerSourceHandler(Lc,0),cu.VhsHandler=Dc,cu.VhsSourceHandler=Lc,cu.Vhs=Cc,cu.use||cu.registerComponent("Vhs",Cc),cu.options.vhs=cu.options.vhs||{},(!cu.getPlugin||!cu.getPlugin("reloadSourceOnError"))&&cu.registerPlugin("reloadSourceOnError",function(e){Tc(this,e)});let Oc=class extends z.A{constructor(){super(...arguments),this._controllerConfigs={autoplay:!1,autoSetup:!1,controls:!1,defaultVolume:.3,disablePictureInPicture:!0,enableDocumentPictureInPicture:!1,enableSmoothSeeking:!0,html5:{nativeAudioTracks:!1,nativeVideoTracks:!1,vhs:{llhls:!0,overrideNative:!0}},inactivityTimeout:0,liveTracker:{liveTolerance:10,trackingThreshold:15},loop:!1,muted:!1,nativeControlsForTouch:!1,normalizeAutoplay:!0,preload:"auto"},this._prevPlayingState=!1,this._retryCount=0,this._qualityLevels=[],this.autoplay=!1,this.currentMetadata=null,this.element=null,this.isLive=!1,this.mimeType=null,this.sensorModel=null,this.started=!1,this.state="not-ready",this.waitingTimestamp=null,this._initController=async()=>{if(!this._controller&&this.playerUrl)try{let e={...this._controllerConfigs};this.element=document.createElement("video"),cu.log.level("off"),this._controller=cu(this.element,e),this._controller.muted(this.muted),this._controller.loop(this.loop),this._controller.playbackRate(this.rate),this._controller.qualityLevels().on("addqualitylevel",e=>this._handleQualityLevel(e)),this._controller.ready(this._handleReady),this._controller.one("play",this._handleFirstPlay),this._controller.on("canplay",this._handleCanPlay),this._controller.on("durationchange",this._handleDurationChange),this._controller.on("ended",this._handleEnded),this._controller.on("error",this._handleError),this._controller.on("loadeddata",this._handleDataLoaded),this._controller.on("loadedmetadata",this._handleLoadedMetadata),this._controller.on("loadstart",this._handleLoadStart),this._controller.on("play",this._handlePlay),this._controller.on("playing",this._handlePlaying),this._controller.on("stalled",this._handleStalled),this._controller.on("timeupdate",this._handleTimeUpdate),this._controller.on("waiting",this._handleWaiting),this._controller.on("xhr-hooks-ready",this._handleXHRhooksReady),this._controller?.liveTracker.on("seekableendchange",()=>this.notifyChange("livestreamStatus")),this._controller?.liveTracker.on("liveedgechange",()=>this.notifyChange("livestreamStatus"))}catch{l.A.getLogger(this).error("Unable to initialize the player."),this._controller&&this._controller.dispose()}},this._handleQualityLevel=e=>{if(!e?.qualityLevel)return;let t=e.qualityLevel;this._qualityLevels.push(t),t?.enabled&&(this._set("videoWidth",t?.width??0),this._set("videoHeight",t?.height??0))},this._handleReady=()=>{this.state="ready"},this._handleFirstPlay=()=>{this._set("started",!0)},this._handleCanPlay=async()=>{if(this._prevPlayingState="playing"===this.state,this.state="can-play",this.autoplay&&!this.started)try{this.muted=!0,await this.play()}catch{l.A.getLogger(this).info("Unable to auto start playback. Blocked by the browser.")}},this._handleCueChange=()=>{if(!this.subtitleTrack?.activeCues?.length)return;let e=this.subtitleTrack?.activeCues,t=function(e,t=1e4){if(!e||!e.length)return[];let i=[],r=[];for(let t=0;t<e.length;t++){let r=e[t],s=r?.text?JSON.parse(r.text):null;"EsriVideoServer"===s?.source&&(i=[...s.data])}let s=i.find(e=>e.tagId===t);return Array.isArray(s?.value)&&(r=[...s.value]),r}(e);if(!t?.length)return;let i=new Map;for(let e of t)Array.isArray(e.value)?90064===e.tagId?i.set(e.tagId,e):e.value.forEach(e=>{i.set(e.tagId,e)}):i.set(e.tagId,e);i.set(he,{name:"Video Width",tagId:he,value:this._controller?.videoWidth()}),i.set(de,{name:"Video Height",tagId:de,value:this._controller?.videoHeight()}),this.currentMetadata=new Map(i)},this._handleDataLoaded=()=>{this._set("videoWidth",this._controller?.videoWidth()),this._set("videoHeight",this._controller?.videoHeight())},this._handleDurationChange=()=>{0!==this._controller?.duration()&&(this.notifyChange("duration"),this.isLive=this._controller?.duration()===1/0||!1,this._setLivestreamStatus(),this.started&&this._controller?.duration()===this._controller?.currentTime()&&this._controller?.trigger("ended"))},this._handleEnded=()=>{this._controller?.ended()&&this.notifyChange("ended")},this._handleError=()=>{let e=this._controller?.error()??null;if("number"==typeof e?.code&&e?.code<3&&0===this._retryCount)this._retryCount++,setTimeout(()=>{this._controller?.src({type:this.mimeType,src:this.playerUrl}),this._controller?.load()},2e3);else{let t=new o.A("Media Error",e?.message??"");l.A.getLogger(this).error(t),this.reset()}},this._handleLoadStart=()=>{this.state="can-play"},this._handleLoadedMetadata=()=>{this.state="can-play",this.notifyChange("buffered"),this.notifyChange("subtitleTrack")},this._handlePlay=()=>{this.notifyChange("ended")},this._handlePlaying=()=>{this.state="playing",this._retryCount=0,this.notifyChange("ended")},this._handleStalled=()=>{l.A.getLogger(this).warn("Playback is stalled and awaiting data")},this._handleTimeUpdate=()=>{this._setLivestreamStatus(),this.notifyChange("currentTime"),this.notifyChange("buffered"),this.notifyChange("bufferedPercent"),this._set("videoWidth",this._controller?.videoWidth()),this._set("videoHeight",this._controller?.videoHeight())},this._handleWaiting=()=>{this.waitingTimestamp=this._controller?.currentTime(),this.state="waiting"},this._handleXHRhooksReady=()=>{this._controller?.tech(!0)?.vhs.xhr.onRequest(e=>(e.xhr=new G,e))},this._updateSensorModel=()=>{this.currentMetadata?.size&&(this.sensorModel?this.sensorModel.updateSensorModel(this.currentMetadata):this.sensorModel=new ge({videoMetadata:this.currentMetadata}))},this._setLivestreamStatus=()=>{if(!this.isLive)return void(this.livestreamStatus=null);this._controller?.liveTracker.isTracking()||this._controller?.liveTracker.startTracking();let e={atLiveEdge:this._controller?.liveTracker.atLiveEdge()??null,behindLiveEdge:this._controller?.liveTracker.behindLiveEdge()??null,liveCurrentTime:this._controller?.liveTracker?.liveCurrentTime()??null,liveWindow:this._controller?.liveTracker?.liveWindow()??null,pastSeekEnd:this._controller?.liveTracker?.pastSeekEnd()??null,seekableEnd:this._controller?.liveTracker?.seekableEnd()??null,seekableStart:this._controller?.liveTracker?.seekableStart()??null};this.livestreamStatus={...e},this.notifyChange("livestreamStatus"),this._controller?.liveTracker.handlePlay(),this._controller?.liveTracker.handleFirstTimeupdate()}}initialize(){this.addHandles([(0,c.wB)(()=>this.playerUrl,e=>{e&&this._initController().then(()=>{this.mimeType=function(e){if(!e)return re;let t=e.match(/\.(\w{3,4})(?:$|\?)/i);if(!t)return re;switch(t[1].toLowerCase()){case"mp4":return"video/mp4";case"webm":return"video/webm";default:return re}}(e),this._controller?.src({src:this.playerUrl,type:this.mimeType})})},c.Vh),(0,c.wB)(()=>this.subtitleTrack,()=>{this.subtitleTrack&&(this.subtitleTrack.mode="showing")},c.Vh),(0,c.wB)(()=>this.isLive,async e=>{e&&(this._controller?.liveTracker.startTracking(),this.autoplay&&(this.muted=!0,await this.play()))}),(0,c.wB)(()=>this.currentMetadata,()=>this._updateSensorModel())]),this.addHandles((0,c.on)(()=>this.subtitleTrack,"cuechange",this._handleCueChange),c.Vh)}destroy(){this.removeAllHandles(),this._controller?.dispose()}get buffered(){return this._controller?.bufferedEnd()??0}get bufferedPercent(){return this._controller?.bufferedPercent()??0}get crossOrigin(){return this._controller?.crossOrigin()??this._get("crossOrigin")}set crossOrigin(e){this._controller?.crossOrigin(e),this._set("crossOrigin",e)}get currentTime(){return this._controller?.currentTime()??0}get duration(){return this._controller?.duration()??0}get ended(){return this._controller?.ended()??this._get("ended")??!0}set ended(e){this._controller?.trigger("ended"),this._set("ended",e)}get loop(){return this._controller?.loop()??this._get("loop")??!1}set loop(e){this._controller?.loop(e),this._set("loop",e)}get muted(){return this._controller?.muted()??this._get("muted")??!1}set muted(e){this._controller?.muted(e),this._set("muted",e)}get playerUrl(){return this._controller?.src()||""}set playerUrl(e){this._set("playerUrl",e)}get playing(){return!this.ended&&("can-play"===this.state?this._prevPlayingState:"playing"===this.state)}get playsInline(){return this._controller?.playsinline()??this._get("playsInline")??!1}set playsInline(e){this._controller?.playsinline(e),this._set("playsInline",e)}get rate(){return this._controller?.playbackRate()??this._get("rate")??1}set rate(e){this._controller?.playbackRate(e),this._set("rate",e)}get startMode(){return this._controller?.preload()??this._get("startMode")??"auto"}set startMode(e){this._controller?.preload(e),this._set("startMode",e)}get subtitleTrack(){let e=this._controller?.textTracks();return e?.length?Array.from(e).find(e=>"subtitles"===e.kind):null}get volume(){return this._controller?.volume()??0}set volume(e){let t=(0,u.qE)(e,0,1);isNaN(t)||this._controller?.volume(t)}get waiting(){return!(this.waitingTimestamp||this.waitingTimestamp!==this.currentTime&&(this.waitingTimestamp=null,1))}pause(){this._controller?.pause(),this.state="paused"}async play(){try{!this.started&&this.isLive&&this._controller?.muted(!0),await(this._controller?.play()),this.state="playing"}catch{}}reset(){this._controller&&(this._prevPlayingState=!1,this._retryCount=0,this._set("started",!1),this.setCurrentTime(0),this.notifyChange("buffered"),this.notifyChange("currentTime"),this.notifyChange("duration"),this.notifyChange("waiting"),this._controller?.trigger("can-play"),this.autoplay||this._controller?.pause())}seekToLiveEdge(){this.isLive?"playing"===this.state&&this._controller?.liveTracker.isTracking()&&this._controller?.liveTracker.seekToLiveEdge():l.A.getLogger(this).info("seekToLiveEdge method is only available for livestream playback.")}setCurrentTime(e){let t=(0,u.qE)(e,0,this.duration);this._controller?.currentTime(t),this.notifyChange("currentTime")}};(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"autoplay",void 0),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"buffered",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"bufferedPercent",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"crossOrigin",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],Oc.prototype,"currentTime",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"currentMetadata",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],Oc.prototype,"duration",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"element",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],Oc.prototype,"ended",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"isLive",void 0),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"livestreamStatus",void 0),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"loop",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"mimeType",void 0),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"muted",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"playerUrl",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],Oc.prototype,"playing",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"playsInline",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"rate",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"sensorModel",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],Oc.prototype,"started",void 0),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"startMode",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"state",void 0),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"subtitleTrack",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],Oc.prototype,"videoHeight",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],Oc.prototype,"videoWidth",void 0),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"volume",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],Oc.prototype,"waiting",null),(0,r.Cg)([(0,p.MZ)()],Oc.prototype,"waitingTimestamp",void 0),Oc=(0,r.Cg)([(0,p.$K)("esri.layers.video.VideoController")],Oc);var Nc=i(40863),Rc=i(58592),Uc=i(94985),Bc=i(31593),Fc=i(53930),qc=i(20378),jc=i(73838),Hc=i(59923);function $c(e,t){return{ignoreOrigin:this.originIdOf(t)<3}}const Vc=new s.A([255,127,0]),zc=new s.A([0,0,0,.05]),Wc=new Fc.A({angle:0,color:Vc,size:10,style:"cross"}),Gc=new Uc.A({color:zc,outline:new Bc.A({color:Vc,width:2})}),Xc=new Bc.A({color:Vc,style:"dash",width:1}),Kc=new Bc.A({color:Vc,width:1}),Zc=new Fc.A({angle:0,color:Vc,outline:{color:[255,255,255],width:1.33},size:10,style:"circle"}),Yc=new Bc.A({color:Vc,width:1}),Qc={types:{base:qc.A,key:"type",typeMap:{"simple-marker":Fc.A,"picture-marker":Rc.A,cim:Nc.A}},json:{name:"drawingInfo.sensorSymbol",write:{writer:jc.M9,overridePolicy:$c}}};function Jc(e,t){return{type:t,json:{name:e,write:{overridePolicy:$c}}}}let ep=class extends((0,S.dM)((0,k.j)((0,T.b)((0,E.q)((0,w.A)((0,h.M)((0,C.d)(v.A)))))))){constructor(e){super(e),this._trailPoints=[],this.cameraInfo=null,this.capabilities=null,this.codecs=null,this.connectionInfo=null,this.controller=new Oc,this.copyright=null,this.coverage=null,this.created=null,this.customParameters=null,this.description=null,this.elevationSource=null,this.frame=null,this.frameCenterSymbol=Wc.clone(),this.frameCount=null,this.frameEffect=null,this.frameOpacity=1,this.frameOutlineSymbol=Gc.clone(),this.fullExtent=null,this.fullTimeExtent=null,this.initialExtent=null,this.layerId=null,this.previewsInfo=null,this.operationalLayerType="ArcGISVideoLayer",this.playbackInfo=null,this.posterUrl=null,this.qualities=null,this.sensorSymbolOrientation={source:"platformHeading",symbolOffset:0},this.sensorPathSymbol=Xc.clone(),this.sensorSymbol=Zc.clone(),this.sensorSightLineSymbol=Kc.clone(),this.sensorTrailSymbol=Yc.clone(),this.serviceItemId=null,this.sourceJSON=null,this.sourceQuality=null,this.sourceType=null,this.spatialReference=b.A.WGS84,this.start=0,this.telemetryDisplay=new U,this.sublayerTitleMode="item-title",this.type="video",this.url=null,this.version=null,this.videoLayersInfo=null}initialize(){this.addHandles([(0,c.wB)(()=>this.metadata,()=>{this.notifyChange("telemetry"),this.notifyChange("groundControlPoints"),this.notifyChange("frameHorizonPoints")}),(0,c.wB)(()=>this.telemetry?.sensorLocation,e=>{this._setSensorPath(e),this._setSensorTrail(e)},c.Vh)]),(0,c.C_)(()=>this.loaded&&"can-play"===this.state&&this.duration>0).then(()=>{this.start>=0&&this.start<=this.duration&&this.setCurrentTime(this.start)})}destroy(){this.removeAllHandles(),this.controller&&this.controller.destroy()}load(e){let t=null==e?null:e.signal,i=this.loadFromPortal({supportedTypes:["Video Service"],supportsData:!0},e).catch(d.QP).then(()=>this._fetchService(t)).then(()=>this._fetchCoverage(t)).then(()=>this._fetchPreviewsInfo(t));return this.addResolvingPromise(i),Promise.resolve(this)}get autoplay(){return this.controller?.autoplay??!1}set autoplay(e){this.controller.autoplay=e}get buffered(){return this.controller.buffered}readCapabilitiesFromService(e,t){return(0,O.dw)(t)}readConnectionInfo(e,t){let i=Object.values(t.connectionUrl);return i?.length&&(this.controller.startMode="ondemand"===t.serviceType?"auto":"metadata",this.controller.playerUrl=i[0]),t.connectionUrl}get currentTime(){return this.controller.currentTime}get duration(){return this.controller.duration}get ended(){return this.controller.ended}get frameHorizonPoints(){return function(e){return e?.size?e.get(90063)?.value??null:null}(this.metadata)}get groundControlPoints(){return function(e){return e?.size?e.get(90064)?.value??null??null:null}(this.metadata)}get isLive(){return this.controller?.isLive??!1}get livestreamStatus(){return this.controller?.livestreamStatus}get loop(){return this.controller.loop}set loop(e){this.controller.loop=e}get metadata(){return this.controller?.currentMetadata}get mimeType(){return this.controller?.mimeType}get muted(){return this.controller.muted}set muted(e){this.controller.muted=e}get parsedUrl(){return(0,A.h)(this)}get playbackRate(){return this.controller.rate}set playbackRate(e){this.controller.rate=e}get playerUrl(){return this.controller.playerUrl}get playing(){return this.controller.playing}get started(){return this.controller?.started??!1}get state(){return this.controller.state}get telemetry(){return function(e){if(!e?.size)return new N;let t=function(e){if(!e?.size)return null;if(e.has(90061)){let t=e.get(90061)?.value;if(t)return f.A.fromJSON(t.geometry)}return e.has(ne)&&e.has(se)?new f.A({x:e.get(ne)?.value,y:e.get(se)?.value,z:e.get(ae)?.value}):null}(e),i=function(e){return function(e){return e&&e.has(90050)&&e.has(90051)?new f.A({x:e.get(90051).value,y:e.get(90050).value,z:e.get(10078)?.value??e.get(ue)?.value}):null}(e)??function(e){return e&&e.has(oe)&&e.has(le)?new f.A({x:e.get(le)?.value,y:e.get(oe)?.value,z:e.get(ue)?.value}):null}(e)}(e),r=function(e){if(!e)return null;let t=e.get(90060)?.value;return t?y.A.fromJSON(t.geometry):function(e){if(!(e.has(90052)&&e.has(90053)&&e.has(90054)&&e.has(90055)&&e.has(90056)&&e.has(90057)&&e.has(90058)&&e.has(90059)))return null;let t=[e.get(90053)?.value,e.get(90052)?.value],i=[e.get(90055)?.value,e.get(90054)?.value],r=[e.get(90057)?.value,e.get(90056)?.value],s=[e.get(90059)?.value,e.get(90058)?.value];return new y.A({rings:[[t,i,r,s]]})}(e)??function(e){if(!(e.has(10026)&&e.has(10027)&&e.has(10028)&&e.has(10029)&&e.has(10030)&&e.has(10031)&&e.has(10032)&&e.has(10033)&&e.has(oe)&&e.has(le)))return null;let t=e.get(oe)?.value,i=e.get(le)?.value,r=t+e.get(10026)?.value,s=i+e.get(10027)?.value,n=t+e.get(10028)?.value,a=i+e.get(10029)?.value,o=t+e.get(10030)?.value,l=i+e.get(10031)?.value,u=t+e.get(10032)?.value,h=i+e.get(10033)?.value;return new y.A({rings:[[[s,r],[a,n],[l,o],[h,u]]]})}(e)}(e),s=pe(t,i);return new N({frameCenter:i,frameOutline:r,lineOfSight:s,sensorLocation:t})}(this.metadata)}readTitleFromService(e,t){let{url:i}=this,r=t.name||(0,I.qg)(i)?.title;switch(this.sublayerTitleMode){case"item-title":if(i)return(0,I.yG)(i,r);break;case"item-title-and-service-name":{let e=this.portalItem?.title;if(e&&e!==r)return e=(0,I.cr)(e),r?`${e} - ${(0,I.cr)(r)}`:e;break}}return r?(0,I.cr)(r):void 0}readTitleFromPortalItem(e){return"item-title"===this.sublayerTitleMode?e:void 0}get videoElement(){return this.controller?.element}get videoHeight(){return this.controller?.videoHeight}readLayerInfosFromService(e,t){return function(e){let t=e?.layers;return t?.length?t.map(e=>({layerId:e.id,posterUrl:e.poster,sourceType:e.serviceType,title:e.name,type:e.type||"Video Layer"})):[]}(t)}get videoTimeExtent(){return(0,a.Lx)(l.A.getLogger(this),"videoTimeExtent",{replacement:"fullTimeExtent",version:"4.33",warnOnce:!0}),this.fullTimeExtent}get videoWidth(){return this.controller?.videoWidth}get volume(){return this.controller?.volume??0}set volume(e){this.controller.volume=e}get waiting(){return this.controller.waiting}play(){this.controller.play()}pause(){this.controller.pause()}reset(){this._trailPoints=[],this.controller.reset()}setCurrentTime(e){if(this.duration<0)return;let t=(0,u.qE)(e,0,this.duration);this.controller.setCurrentTime(t)}toGround(e,t){return this.controller?.sensorModel?.metadataSupportsTransforms?this.controller.sensorModel.transformImageToGeo(e,t):null}toVideo(e){if(!this.controller?.sensorModel?.metadataSupportsTransforms)return null;let t=this.controller.sensorModel.transformGeoToImage(e.x,e.y,e.z);return{x:t[0],y:t[1]}}updateTelemetryColor(e,t){if(!e)return;let i=new s.A(e);(!t||t?.frameCenter)&&(this.frameCenterSymbol=ce(this.frameCenterSymbol,i)??Wc),(!t||t?.frameOutline)&&(this.frameOutlineSymbol=ce(this.frameOutlineSymbol,i,zc)??Gc),(!t||t?.lineOfSight)&&(this.sensorSightLineSymbol=ce(this.sensorSightLineSymbol,i)??Kc),(!t||t?.sensorLocation)&&(this.sensorSymbol=ce(this.sensorSymbol,i)??Zc),(!t||t?.sensorPath)&&(this.sensorPathSymbol=ce(this.sensorPathSymbol,i)??Xc),(!t||t?.sensorTrail)&&(this.sensorTrailSymbol=ce(this.sensorTrailSymbol,i)??Yc)}write(e,t){return null==this.layerId?((0,Hc.U4)(t,this,"the ArcGIS server version must be greater than 11.2."),null):super.write(e,t)}async _fetchCoverage(e){if(!this.capabilities?.operations?.supportsCoverageQuery||"number"!=typeof this.layerId)return;let t=`${this.parsedUrl.path}/coverage`,{data:i}=await(0,n.A)(t,{query:{f:"json",...this.customParameters},signal:e}),{area:r=null,sensorPoints:s=null,telemetry:a=null}=i,o={area:null,path:null};if(r?.rings?.length&&(o.area=y.A.fromJSON(r)),s?.points?.length){let e=s.points;o.path=new _.A({hasM:!0,hasZ:!0,paths:[e]})}if(a?.start){let{frameCenter:e=null,frameOutline:t=null,sensor:i=null}=a?.start||{};if(t&&(this.telemetry.frameOutline=y.A.fromJSON(t)),i&&(this.telemetry.sensorLocation=f.A.fromJSON(i)),e&&(this.telemetry.frameCenter=f.A.fromJSON(e)),i&&e){let{sensorLocation:e,frameCenter:t}=this.telemetry;this.telemetry.lineOfSight=pe(e,t)}}this._set("coverage",o)}async _fetchPreviewsInfo(e){if("number"!=typeof this.layerId||!this.capabilities?.operations?.supportsPreviews)return;let t=`${this.parsedUrl.path}/content/preview/preview.json`,{data:i}=await(0,n.A)(t,{query:{f:"json"},signal:e});if(!i?.preview)return;let{frameCount:r=0,frameInterval:s=0,frames:a=[],height:o,nCol:l,nRow:u,preview:h,width:d}=i||{},c={count:r,height:o,interval:s,numCols:l,numRows:u,thumbnailInfo:a,urlFragment:h,width:d};this.read({previewsInfo:c},{origin:"service"})}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});let{data:t,ssl:i}=await(0,n.A)(this.url,{query:{f:"json",...this.parsedUrl.query,...this.customParameters},signal:e});if(i&&(this.url=this.url.replace(/^http:/i,"https:")),!t?.currentVersion)return t.currentVersion="11.2",this.sourceJSON=t,void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});if(this.layerId??=t.layers?.[0]?.id??null,null==this.layerId)throw new o.A("arcgis-layers:url-mismatch","The url is not a valid arcgis resource");let{data:r}=await(0,n.A)(this.parsedUrl.path,{query:{f:"json",...this.customParameters},signal:e});this.sourceJSON={...t,...r},this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl})}_setSensorTrail(e){if(!e)return;let t=function(e,t){let i=[...t],r=i.findIndex(t=>t.equals(e));return r>-1&&i.splice(r),i.push(e),i}(e,this._trailPoints);this._trailPoints=[...t];let i=this._trailPoints.map(e=>e.toArray()),r=new _.A({hasZ:e.hasZ,paths:[i]});this.telemetry.sensorTrail=r.clone()}_setSensorPath(e){if(!e||"polyline"!==this.coverage?.path?.type)return;let t=this.telemetry?.sensorPath??this.coverage.path.clone(),{spatialReference:i,hasZ:r,hasM:s,paths:n}=t;if(!s)return;let a=t.hasZ?3:2,o=1e3*this.currentTime,l=[];for(let e of n){let t=0,i=e.length,r=o>500?o+1500:o;for(;t<i&&e[t][a]<=r;)t++;t<e.length&&l.push(...e.slice(t))}this.telemetry.sensorPath=new _.A({hasZ:r,hasM:s,paths:[l],spatialReference:i})}};(0,r.Cg)([(0,p.MZ)({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ep.prototype,"autoplay",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"buffered",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"cameraInfo",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0,json:{read:!1}})],ep.prototype,"capabilities",void 0),(0,r.Cg)([(0,F.w)("service","capabilities",["supportsAppend","supportsCoverageQuery","supportsExportClip","supportsExportFrameset","supportsMensuration","supportsPreviews","supportsUpdate"])],ep.prototype,"readCapabilitiesFromService",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"codecs",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"connectionInfo",void 0),(0,r.Cg)([(0,F.w)("connectionInfo",["connectionUrl"])],ep.prototype,"readConnectionInfo",null),(0,r.Cg)([(0,p.MZ)()],ep.prototype,"controller",void 0),(0,r.Cg)([(0,p.MZ)({type:String})],ep.prototype,"copyright",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"coverage",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0,type:Date})],ep.prototype,"created",void 0),(0,r.Cg)([(0,p.MZ)({type:Number})],ep.prototype,"currentTime",null),(0,r.Cg)([(0,p.MZ)({json:{write:!1}})],ep.prototype,"customParameters",void 0),(0,r.Cg)([(0,p.MZ)({type:String})],ep.prototype,"description",void 0),(0,r.Cg)([(0,p.MZ)({type:Number})],ep.prototype,"duration",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"elevationSource",void 0),(0,r.Cg)([(0,p.MZ)({type:Boolean})],ep.prototype,"ended",null),(0,r.Cg)([(0,p.MZ)({type:H})],ep.prototype,"frame",void 0),(0,r.Cg)([(0,p.MZ)(Jc("drawingInfo.frameCenterSymbol",Fc.A))],ep.prototype,"frameCenterSymbol",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0,type:m.jz})],ep.prototype,"frameCount",void 0),(0,r.Cg)([(0,p.MZ)(S.LF)],ep.prototype,"frameEffect",void 0),(0,r.Cg)([(0,p.MZ)(x.ke)],ep.prototype,"frameOpacity",void 0),(0,r.Cg)([(0,p.MZ)(Jc("drawingInfo.frameOutlineSymbol",Uc.A))],ep.prototype,"frameOutlineSymbol",void 0),(0,r.Cg)([(0,p.MZ)({type:g.A})],ep.prototype,"fullExtent",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"frameHorizonPoints",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0,json:{read:{reader:function(e){let{duration:t,end:i,start:r,timezone:s="UTC"}=e||{};return[t,i,r].some(e=>"number"!=typeof e||e<0)?null:new V({duration:t||null,end:new Date(Number(i)),start:new Date(Number(r)),timezone:s})},source:"time"}},type:V})],ep.prototype,"fullTimeExtent",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"groundControlPoints",null),(0,r.Cg)([(0,p.MZ)(x.id)],ep.prototype,"id",void 0),(0,r.Cg)([(0,p.MZ)({type:g.A})],ep.prototype,"initialExtent",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"isLive",null),(0,r.Cg)([(0,p.MZ)({type:m.jz,json:{read:!1,origins:{service:{read:{source:"id"}}}}})],ep.prototype,"layerId",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"livestreamStatus",null),(0,r.Cg)([(0,p.MZ)({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ep.prototype,"loop",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"metadata",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"mimeType",null),(0,r.Cg)([(0,p.MZ)({type:Boolean,json:{write:{ignoreOrigin:!0}}})],ep.prototype,"muted",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"previewsInfo",void 0),(0,r.Cg)([(0,p.MZ)({type:["ArcGISVideoLayer"]})],ep.prototype,"operationalLayerType",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"parsedUrl",null),(0,r.Cg)([(0,p.MZ)({type:L})],ep.prototype,"playbackInfo",void 0),(0,r.Cg)([(0,p.MZ)({type:Number,json:{write:{ignoreOrigin:!0}}})],ep.prototype,"playbackRate",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0,type:String})],ep.prototype,"playerUrl",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"playing",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0,json:{read:{source:"poster"}}})],ep.prototype,"posterUrl",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"qualities",void 0),(0,r.Cg)([(0,p.MZ)()],ep.prototype,"sensorSymbolOrientation",void 0),(0,r.Cg)([(0,p.MZ)(Jc("drawingInfo.sensorPathSymbol",Bc.A))],ep.prototype,"sensorPathSymbol",void 0),(0,r.Cg)([(0,p.MZ)(Qc)],ep.prototype,"sensorSymbol",void 0),(0,r.Cg)([(0,p.MZ)(Jc("drawingInfo.sensorSightLineSymbol",Bc.A))],ep.prototype,"sensorSightLineSymbol",void 0),(0,r.Cg)([(0,p.MZ)(Jc("drawingInfo.sensorTrailSymbol",Bc.A))],ep.prototype,"sensorTrailSymbol",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"serviceItemId",void 0),(0,r.Cg)([(0,p.MZ)()],ep.prototype,"sourceJSON",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"sourceQuality",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0,json:{name:"serviceType"}})],ep.prototype,"sourceType",void 0),(0,r.Cg)([(0,p.MZ)({type:b.A})],ep.prototype,"spatialReference",void 0),(0,r.Cg)([(0,p.MZ)({json:{write:!0}})],ep.prototype,"start",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"started",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0,type:String})],ep.prototype,"state",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0,type:N})],ep.prototype,"telemetry",null),(0,r.Cg)([(0,p.MZ)({type:U,nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],ep.prototype,"telemetryDisplay",void 0),(0,r.Cg)([(0,F.w)("service","title",["name"])],ep.prototype,"readTitleFromService",null),(0,r.Cg)([(0,F.w)("portal-item","title")],ep.prototype,"readTitleFromPortalItem",null),(0,r.Cg)([(0,p.MZ)({type:String})],ep.prototype,"sublayerTitleMode",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"type",void 0),(0,r.Cg)([(0,p.MZ)((0,A.b)())],ep.prototype,"url",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0,type:Number,json:{read:{source:"currentVersion"}}})],ep.prototype,"version",void 0),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"videoElement",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"videoHeight",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0,json:{read:!1}})],ep.prototype,"videoLayersInfo",void 0),(0,r.Cg)([(0,F.w)("service","videoLayersInfo",["id","name","poster","serviceType","type"])],ep.prototype,"readLayerInfosFromService",null),(0,r.Cg)([(0,p.MZ)({type:V,readOnly:!0})],ep.prototype,"videoTimeExtent",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"videoWidth",null),(0,r.Cg)([(0,p.MZ)()],ep.prototype,"volume",null),(0,r.Cg)([(0,p.MZ)({readOnly:!0})],ep.prototype,"waiting",null),ep=(0,r.Cg)([(0,p.$K)("esri.layers.VideoLayer")],ep);const tp=ep},73179(e,t,i){i.d(t,{b:()=>l,h:()=>u});var r=i(4718),s=i(53966),n=i(84952),a=i(60694),o=i(10873);function l(e){let{nonStandardUrlAllowed:t=!1,separator:i}=e??{},n=(0,r.o8)(o.OZ),l=n.json?.write;return"object"==typeof l&&l&&(l.writer=function(e,t,r,s){(0,a.LS)(this,e,i,t,s)}),{...n,set:function(e){if(null==e)return void this._set("url",e);let i=(0,a.HZ)({layer:this,url:e,nonStandardUrlAllowed:t,logger:s.A.getLogger(this)});this._set("url",i.url),null!=i.layerId&&this._set("layerId",i.layerId)}}}function u(e,t){let{separator:i}=t??{},r=(0,n.An)(e.url);return null!=r&&(null==e.dynamicDataSource?null!=e.layerId&&(r.path=(0,n.fj)(r.path,i??"",e.layerId.toString())):r.path=(0,n.fj)(r.path,"dynamicLayer")),r}},28076(e,t,i){var r=i(13337);const s={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1,gradientMethod:"AcrossLine",gradientSize:75,gradientSizeUnits:r.h.Relative,gradientType:"Discrete",interval:5},CIMSolidFill:{enable:!0,colorlocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGradientFill:{enable:!0,angle:90,gradientMethod:"Linear",gradientSize:75,gradientSizeUnits:r.h.Relative,gradientType:"Discrete",interval:5},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCircularSector:{radius:25,startangle:0,endangle:45},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry",width:25},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRadial:{angle:0,length:5},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:"Loop",repeatdelay:0,easing:"Linear"},CIMSymbolAnimationSize:{tosize:10},CIMSymbolAnimationScale:{scalefactor:1},CIMSymbolAnimationColor:{tocolor:[255,255,255,1],colormode:"Multiply"},CIMSymbolAnimationTransparency:{totransparency:0},CIMSymbolAnimationRotation:{torotation:0,rotateclockwise:!1},CIMSymbolAnimationOffset:{offsetx:0,offsety:0},CIMSymbolAnimationMoveAlongLine:{speed:30,distancealong:100,movementtype:"Distance"}};i.d(t,["D",0,s])},13337(e,t,i){i.d(t,["h",0,{Relative:0,Absolute:1}])},93397(e,t,i){i.d(t,{Bu:()=>S,DW:()=>_,FM:()=>o,Kn:()=>y,Kq:()=>B,MM:()=>d,Nl:()=>C,O2:()=>E,YC:()=>x,YF:()=>w,_1:()=>v,_h:()=>a,bs:()=>I,e6:()=>u,gQ:()=>n,jn:()=>p,lW:()=>h,ll:()=>D,mA:()=>c,oI:()=>F,pM:()=>b,pV:()=>f,pk:()=>P,rB:()=>M,xo:()=>T,yX:()=>U,zb:()=>k,zr:()=>m});var r=i(28076);function s(e){let t=e.length;for(;t--;)if(!" /-,\n".includes(e.charAt(t)))return!1;return!0}function n(e,t){let i=[],r=0,n=-1;do{if(n=e.indexOf("[",r),n>=r){if(n>r){let t=e.slice(r,n);i.push([t,null,s(t)])}if(r=n+1,n=e.indexOf("]",r),n>=r){if(n>r){let s=t[e.slice(r,n)];s&&i.push([null,s,!1])}r=n+1}}}while(-1!==n);if(r<e.length){let t=e.slice(r);i.push([t,null,s(t)])}return i}function a(e,t,i){let r="",s=null;for(let i of t){let[t,n,a]=i;if(null!=t&&""!==t)a?s=t:(null!=s&&(r+=s,s=null),r+=t);else{let t=e.readAttribute(n);null!=t&&""!==t&&(null!==s&&(r+=s,s=null),r+=t)}}return l(r,i)}function o(e,t,i,r){let s="",n=null;for(let r of t){let[t,a,o]=r;if(null!=t&&""!==t)o?n=t:(null!=n&&(s+=n,n=null),s+=t);else{let t=a;null!=i&&(t=A(a,i));let r=e.attributes[t];null!=r&&""!==r&&(null!=n&&(s+=n,n=null),s+=r)}}return l(s,r)}function l(e,t){switch("string"!=typeof e&&(e=String(e)),t){case"LowerCase":return e.toLowerCase();case"Allcaps":return e.toUpperCase();default:return e}}function u(e){return e?[e[0],e[1],e[2],e[3]/255]:[0,0,0,0]}function h(e){return e.data?.symbol??null}function d(e){return"CIMVectorMarker"===e.type||"CIMPictureMarker"===e.type||"CIMBarChartMarker"===e.type||"CIMCharacterMarker"===e.type||"CIMPieChartMarker"===e.type||"CIMStackedBarChartMarker"===e.type}function c(e){return"CIMGradientStroke"===e.type||"CIMPictureStroke"===e.type||"CIMSolidStroke"===e.type}function p(e){return null!=e&&("CIMGradientFill"===e.type||"CIMHatchFill"===e.type||"CIMPictureFill"===e.type||"CIMSolidFill"===e.type||"CIMWaterFill"===e.type)}function m(e){return null!=e&&("CIMMarkerPlacementAlongLineRandomSize"===e.type||"CIMMarkerPlacementAlongLineSameSize"===e.type||"CIMMarkerPlacementAlongLineVariableSize"===e.type||"CIMMarkerPlacementAtExtremities"===e.type||"CIMMarkerPlacementAtMeasuredUnits"===e.type||"CIMMarkerPlacementAtRatioPositions"===e.type||"CIMMarkerPlacementOnLine"===e.type||"CIMMarkerPlacementOnVertices"===e.type)}const g=(e,t=0)=>null==e||isNaN(e)?t:e;function f(e){if(!e)return"normal";switch(e.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function y(e){if(!e)return"normal";switch(e.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function _(e){return e.underline?"underline":e.strikethrough?"line-through":"none"}function b(e){if(!e)return null;switch(e.type){case"CIMPolygonSymbol":if(e.symbolLayers)for(let t of e.symbolLayers){let e=b(t);if(null!=e)return e}break;case"CIMTextSymbol":return b(e.symbol);case"CIMSolidFill":return e.color}return null}function v(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{let t=e.symbolLayers;if(t)for(let e of t){let t=v(e);if(null!=t)return t}break}case"CIMTextSymbol":return v(e.symbol);case"CIMSolidStroke":return e.color}}function T(e){if(e)switch(e.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(e.symbolLayers)for(let t of e.symbolLayers){let e=T(t);if(void 0!==e)return e}break;case"CIMTextSymbol":return T(e.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return e.width}}function S(e){switch(e){case"Left":default:return"left";case"Right":return"right";case"Center":return"center";case"Justify":return"justify"}}function C(e){switch(e){default:case"Bottom":return"bottom";case"Top":return"top";case"Center":return"middle";case"Baseline":return"baseline"}}function E(e){return(e?Object.keys(e):[]).map(t=>({name:t,alias:t,type:"string"==typeof e[t]?"esriFieldTypeString":"esriFieldTypeDouble"}))}function w(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function k(e,t,i,r,s,n,a=!0){let{infos:o}=n,l=1,u=0,h=0,d=0,c=1;for(let{absoluteAnchorPoint:e,offsetX:t,offsetY:i,rotation:r,size:s,frameHeight:n,rotateClockWise:p,scaleSymbolsProportionally:m}of o)c=e?1:l,h=N(t,i,u,c,h),d=O(t,i,u,c,d),n&&(m||a)&&(l*=s/n),u=R(r,p,u);let p=N(r,s,u,c,h),m=O(r,s,u,c,d);return{size:e*l,rotation:R(t,i,u),offsetX:p,offsetY:m}}function I(e){if(null==e)return"Normal";switch(e.type){case"CIMTextSymbol":return e.textCase??"Normal";case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{let t=e.symbolLayers;if(!t)return"Normal";for(let e of t)if("CIMVectorMarker"===e.type)return I(e)}break;case"CIMVectorMarker":{let t=e.markerGraphics;if(!t)return"Normal";for(let e of t)if(e.symbol)return I(e.symbol)}}return"Normal"}function x(e){if(e)switch(e.type){case"CIMTextSymbol":return e.height;case"CIMPointSymbol":{let t=0;if(e.symbolLayers)for(let i of e.symbolLayers)if(i)switch(i.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{let e=i.size??r.D.CIMVectorMarker.size;e>t&&(t=e);break}}return t}case"CIMLineSymbol":case"CIMPolygonSymbol":{let t=0;if(e.symbolLayers)for(let i of e.symbolLayers)if(i)switch(i.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{let e=i.width;null!=e&&e>t&&(t=e);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(i.markerPlacement&&m(i.markerPlacement)){let e=i.size??r.D.CIMVectorMarker.size;e>t&&(t=e)}break;case"CIMPictureFill":{let e=i.height;null!=e&&e>t&&(t=e)}}return t}}}function A(e,t){if(null!==t){let i=t.get(e);return i?i.name:e}return e}function P(e){return e.map(e=>({...e,propertyName:w(e.propertyName)}))}function M(e){let t={};for(let i in e){let r=e[i];t[w(i)]=r}return t}function D(e){if(!e)return 0;let t=0;for(let i of e)t+=L(i);return t}function L(e){if(!e)return 0;if(B(e))return e.inflateSize??256;if(function(e){return"CIMSimpleLineCallout"===e.type||"CIMBackgroundCallout"===e.type||"CIMBalloonCallout"===e.type||"CIMPointSymbolCallout"===e.type}(e))return Math.abs(e.inflateSize);switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectCircularSector":return Math.abs(e.radius??25);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(g(e.offsetX)),Math.abs(g(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRadial":return Math.abs(e.length??5);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return.5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function O(e,t,i,r,s){let n=i*Math.PI/180;if(n){let i=Math.cos(n);return(Math.sin(n)*e+i*t)*r+s}return t*r+s}function N(e,t,i,r,s){let n=i*Math.PI/180;return n?(Math.cos(n)*e-Math.sin(n)*t)*r+s:e*r+s}function R(e,t,i){return t?i-e:i+e}function U(e,t){return Math.max(Math.min((e??t)/100,1),0)}function B(e){return e.type.startsWith("Private")}function F(e){return null!=e&&function(e){return"setControlPoint"in e&&"getControlPoint"in e&&"setControlPointAt"in e&&"getControlPointAt"in e}(e)?e:void 0}i.d(t,["$w",0,g,"UE",0,e=>e.includes("data:image/svg+xml")])},62046(e,t,i){i.d(t,{Fe:()=>m,KU:()=>_,Nk:()=>u,X5:()=>n});var r=i(68197),s=i(93397);function n(e,t,i){if(!e)return;let r=(0,s.lW)(e),n=function(e){let t=(0,s.lW)(e);if("CIMTextSymbol"===t?.type)return t.height??0;let i=0;if(t?.symbolLayers)for(let e of t.symbolLayers)(0,s.MM)(e)&&null!=e.size&&e.size>i?i=e.size:(0,s.mA)(e)&&null!=e.width&&e.width>i?i=e.width:(0,s.jn)(e);return i}(e);0===n?function(e,t){if(e)if("CIMTextSymbol"===e.type)e.height=t;else if(e.symbolLayers)for(let i of e.symbolLayers)switch(i.type){case"CIMPictureMarker":case"CIMVectorMarker":i.size=t;break;case"CIMPictureStroke":case"CIMSolidStroke":case"CIMGradientStroke":i.width=t}}(r,t):a(r,t/n,!1,i)}function a(e,t,i,r){if(e)if("CIMTextSymbol"===e.type)null!=e.height&&(e.height*=t);else{if(i&&e.effects)for(let i of e.effects)l(i,t);if(e.symbolLayers)for(let i of e.symbolLayers){switch(i.type){case"CIMPictureMarker":case"CIMVectorMarker":o(i,t,r);break;case"CIMPictureStroke":case"CIMSolidStroke":case"CIMGradientStroke":!r?.preserveOutlineWidth&&i.width&&(i.width*=t);break;case"CIMPictureFill":i.height&&(i.height*=t),i.offsetX&&(i.offsetX*=t),i.offsetY&&(i.offsetY*=t);break;case"CIMHatchFill":a(i.lineSymbol,t,!0,{...r,preserveOutlineWidth:!1}),i.offsetX&&(i.offsetX*=t),i.offsetY&&(i.offsetY*=t),i.separation&&(i.separation*=t)}if(i.effects)for(let e of i.effects)l(e,t)}}}function o(e,t,i){if(e&&(e.markerPlacement&&function(e,t){switch((0,s.zr)(e)&&e.offset&&(e.offset*=t),e.type){case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineSameSize":e.customEndingOffset&&(e.customEndingOffset*=t),e.offsetAlongLine&&(e.offsetAlongLine*=t),e.placementTemplate&&e.placementTemplate.length&&(e.placementTemplate=e.placementTemplate.map(e=>e*t));break;case"CIMMarkerPlacementAlongLineVariableSize":e.maxRandomOffset&&(e.maxRandomOffset*=t),e.placementTemplate&&e.placementTemplate.length&&(e.placementTemplate=e.placementTemplate.map(e=>e*t));break;case"CIMMarkerPlacementOnLine":e.startPointOffset&&(e.startPointOffset*=t);break;case"CIMMarkerPlacementAtExtremities":e.offsetAlongLine&&(e.offsetAlongLine*=t);break;case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementOnVertices":break;case"CIMMarkerPlacementAtRatioPositions":e.beginPosition&&(e.beginPosition*=t),e.endPosition&&(e.endPosition*=t);break;case"CIMMarkerPlacementPolygonCenter":e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t);break;case"CIMMarkerPlacementInsidePolygon":e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t),e.stepX&&(e.stepX*=t),e.stepY&&(e.stepY*=t)}}(e.markerPlacement,t),e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t),e.anchorPoint&&"Absolute"===e.anchorPointUnits&&(e.anchorPoint={x:e.anchorPoint.x*t,y:e.anchorPoint.y*t}),e.size=null==e.size?0:e.size*t,"CIMVectorMarker"===e.type&&e.markerGraphics))for(let r of e.markerGraphics)e.scaleSymbolsProportionally||a(r.symbol,t,!0,i)}function l(e,t){if(!(0,s.Kq)(e))switch(e.type){case"CIMGeometricEffectArrow":case"CIMGeometricEffectDonut":e.width&&(e.width*=t);break;case"CIMGeometricEffectBuffer":e.size&&(e.size*=t);break;case"CIMGeometricEffectCut":e.beginCut&&(e.beginCut*=t),e.endCut&&(e.endCut*=t),e.middleCut&&(e.middleCut*=t);break;case"CIMGeometricEffectDashes":e.customEndingOffset&&(e.customEndingOffset*=t),e.offsetAlongLine&&(e.offsetAlongLine*=t),e.dashTemplate&&e.dashTemplate.length&&(e.dashTemplate=e.dashTemplate.map(e=>e*t));break;case"CIMGeometricEffectExtension":case"CIMGeometricEffectJog":case"CIMGeometricEffectRadial":e.length&&(e.length*=t);break;case"CIMGeometricEffectMove":e.offsetX&&(e.offsetX*=t),e.offsetY&&(e.offsetY*=t);break;case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":e.offset&&(e.offset*=t);break;case"CIMGeometricEffectRegularPolygon":e.radius&&(e.radius*=t);break;case"CIMGeometricEffectTaperedPolygon":e.fromWidth&&(e.fromWidth*=t),e.length&&(e.length*=t),e.toWidth&&(e.toWidth*=t);break;case"CIMGeometricEffectWave":e.amplitude&&(e.amplitude*=t),e.period&&(e.period*=t)}}function u(e){let t=[];return h((0,s.lW)(e),t),t.length?new r.A((0,s.e6)(t[0])):null}function h(e,t){if(!e)return;let i;i="CIMTextSymbol"===e.type?e.symbol:e;let r="CIMPolygonSymbol"===e.type;if(i?.symbolLayers)for(let e of i.symbolLayers)if(!(e.colorLocked||r&&((0,s.mA)(e)||(0,s.MM)(e)&&e.markerPlacement&&(0,s.zr)(e.markerPlacement))))switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor&&d(t,e.tintColor);break;case"CIMVectorMarker":e.markerGraphics?.forEach(e=>{h(e.symbol,t)});break;case"CIMSolidStroke":case"CIMSolidFill":d(t,e.color);break;case"CIMGradientFill":c(t,e);break;case"CIMHatchFill":h(e.lineSymbol,t)}}function d(e,t){for(let i of e)if(i.join(".")===t.join("."))return;e.push(t)}function c(e,t){switch(t.colorRamp?.type){case"CIMMultipartColorRamp":t.colorRamp.colorRamps?.forEach(t=>{"CIMLinearContinuousColorRamp"===t.type&&p(e,t)});break;case"CIMLinearContinuousColorRamp":case"CIMPolarContinuousColorRamp":p(e,t.colorRamp)}}function p(e,t){t&&(t.fromColor&&d(e,t.fromColor),t.toColor&&d(e,t.toColor))}function m(e,t,i){t instanceof r.A||(t=new r.A(t));let n=(0,s.lW)(e);n&&g(n,t,i)}function g(e,t,i){if(!e)return;let r;r="CIMTextSymbol"===e.type?e.symbol:e;let n="CIMPolygonSymbol"===r?.type;if(r?.symbolLayers)for(let e of r.symbolLayers){if(e.colorLocked)continue;if(n)if(i){let{layersToColor:t}=i;if(((0,s.mA)(e)||(0,s.MM)(e)&&e.markerPlacement&&(0,s.zr)(e.markerPlacement))&&"fill"===t||(0,s.jn)(e)&&"outline"===t)continue}else if((0,s.mA)(e)||(0,s.MM)(e)&&e.markerPlacement&&(0,s.zr)(e.markerPlacement))continue;let r=t.toArray();switch(e.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":e.tintColor=r;break;case"CIMVectorMarker":e.markerGraphics?.forEach(e=>{g(e.symbol,t,i)});break;case"CIMSolidStroke":case"CIMSolidFill":e.color=r;break;case"CIMGradientFill":f(e,t);break;case"CIMHatchFill":g(e.lineSymbol,t,i)}}}function f(e,t){switch(e.colorRamp?.type){case"CIMMultipartColorRamp":e.colorRamp.colorRamps?.forEach(e=>{"CIMLinearContinuousColorRamp"===e.type&&y(e,t)});break;case"CIMLinearContinuousColorRamp":case"CIMPolarContinuousColorRamp":y(e.colorRamp,t)}}function y(e,t){if(e&&(e.fromColor&&=t.toArray(),e.toColor)){let i=t.clone();i.a=0,e.toColor=i.toArray()}}function _(e,t,i=!1){let r=(0,s.lW)(e);if(i&&(t=360-t),"CIMTextSymbol"===r?.type)r.angle=t;else if("CIMPointSymbol"===r?.type&&r.symbolLayers){let e=t-(r.angle||0);for(let t of r.symbolLayers)if((0,s.MM)(t)){let i=t.rotation||0;t.rotateClockwise?i-=e:i+=e,t.rotation=i}r.angle=t}}},59868(e,t,i){var r=i(94985),s=i(31593),n=i(53930),a=i(68249),o=i(93470);const l=n.A.fromJSON(o.Cb),u=s.A.fromJSON(o.yM),h=r.A.fromJSON(o.WR),d=a.A.fromJSON(o.JZ);n.A.fromJSON(o.nC),s.A.fromJSON(o.HW),r.A.fromJSON(o.b6),i.d(t,["A7",0,u,"Cx",0,h,"Hk",0,d,"UK",0,l])},93470(e,t,i){const r=[252,146,31,255],s={type:"esriSMS",style:"esriSMSCircle",size:6,color:r,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},n={type:"esriSLS",style:"esriSLSSolid",width:.75,color:r};i.d(t,["Cb",0,s,"HW",0,{type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},"JR",0,[153,153,153,255],"JZ",0,{type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},"WR",0,{type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},"b6",0,{type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null},"fT",0,r,"nC",0,{type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},"yM",0,n])},73838(e,t,i){i.d(t,{rS:()=>N,M9:()=>M,oO:()=>D});var r=i(93637),s=i(77548),n=i(29169),a=i(49186),o=i(13313),l=i(97887),u=i(68548),h=i(58592),d=i(75981),c=i(65365),p=i(94985),m=i(31593),g=i(53930),f=i(68249),y=i(68197),_=i(7762),b=i(90629),v=i(27845),T=i(11506),S=i(39065),C=i(59868),E=i(93470);d.A.fromSimpleMarkerSymbol(C.UK),l.A.fromSimpleLineSymbol(C.A7),c.A.fromSimpleFillSymbol(C.Cx),new u.A({symbolLayers:new _.A([new v.A({material:{color:E.fT},edges:new S.A({size:b.ps,color:new y.A(E.JR)})})])});const w=new l.A({symbolLayers:new _.A([new T.A({material:{color:new y.A([0,0,0])},size:b.ps})])}),k=new c.A({symbolLayers:new _.A([new v.A({outline:{color:new y.A([0,0,0]),size:b.ps}})])});var I=i(33910);const x="#useCIMFallbackSymbology()",A={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};var P=i(59923);function M(e,t,i,s){let n=O(e,{},{context:s,isLabelSymbol:!1});null!=n&&(0,r.sM)(i,n,t)}function D(e,t,i,r){let s=O(e,{},{context:r,isLabelSymbol:!0});null!=s&&(t[i]=s)}function L(e){return(0,I.wk)(e)||e instanceof n.A}function O(e,t,i){if(null==e)return null;let{context:r,isLabelSymbol:y}=i,_=r?.origin;if("web-scene"===_&&!L(e)){let i=function(e,t=A){if(!e)return{symbol:null};let{retainId:i=A.retainId,ignoreDrivers:r=A.ignoreDrivers,hasLabelingContext:s=A.hasLabelingContext,retainCIM:y=A.retainCIM,cimFallbackEnabled:_=A.cimFallbackEnabled}=t,b=null;if((0,I.wk)(e))b=e.clone();else if("web-style"===e.type)b=e.clone();else if("cim"===e.type){let i=e.data?.symbol?.type;switch(i){case"CIMPointSymbol":b=y?e.clone():d.A.fromCIMSymbol(e);break;case"CIMLineSymbol":_&&(b=w.clone(),t?.logWarning?.(x,"Unsupported CIM line symbology converted to fallback 3D line symbology"));break;case"CIMPolygonSymbol":_&&(b=k.clone(),t?.logWarning?.(x,"Unsupported CIM polygon symbology converted to fallback 3D polygon symbology"))}if(!b)return{error:new a.A("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${i||"unknown"}' is unsupported in 3D`,{symbol:e})}}else if(e instanceof m.A)b=l.A.fromSimpleLineSymbol(e);else if(e instanceof g.A)b=d.A.fromSimpleMarkerSymbol(e);else if(e instanceof h.A)b=d.A.fromPictureMarkerSymbol(e);else if(e instanceof p.A)b=t.geometryType&&"mesh"===t.geometryType?u.A.fromSimpleFillSymbol(e):c.A.fromSimpleFillSymbol(e);else{if(!(e instanceof f.A))return{error:new a.A("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${e.type||e.declaredClass}' is unsupported in 3D`,{symbol:e})};b=s?o.A.fromTextSymbol(e):d.A.fromTextSymbol(e)}return i&&b&&"cim"!==b.type&&(b.id=e.id),r&&"cim"!==b.type&&!(b instanceof n.A)&&b.symbolLayers.forEach(e=>e.ignoreDrivers=!0),{symbol:b}}(e,{retainCIM:!0,hasLabelingContext:y});return null==i.symbol?((0,P.bA)(r,e,"Use 3D symbology instead when working with WebScene and SceneView",{error:i.error}),null):i.symbol.write(t,r)}return(0,s.TU)(r?.layer)&&function(e){return"polygon-3d"===e?.type||"line-3d"===e?.type}(e)?((0,P.bA)(r,e,`unsupported in layers of type ${r?.layer?.declaredClass}`),null):("web-map"===_||"portal-item"===_&&!(0,s.TU)(r?.layer))&&L(e)?((0,P.bA)(r,e,"Use 2D symbology and CIMSymbol instead when working with MapView"),null):e.write(t,r)}function N(e,t){return(0,I.Bu)(e,null,t)}},37531(e,t,i){i.d(t,{dt:()=>c,GG:()=>y,UQ:()=>f,Sx:()=>h});var r=i(68197),s=i(60999),n=(i(90629),i(51850)),a=(i(76369),i(62046)),o=(i(2741),i(56507),i(66344));new Map([["dash",[4,3]],["dashdot",[4,3,1,3]],["dot",[1,3]],["longdash",[8,3]],["longdashdot",[8,3,1,3]],["longdashdotdot",[8,3,1,3,1,3]],["shortdash",[4,1]],["shortdashdot",[4,1,1,1]],["shortdashdotdot",[4,1,1,1,1,1]],["shortdot",[1,1]],["solid",[]]]),new o.q(1e3),new r.A([128,128,128]);var l=i(28975),u=i(33910);function h(e,t){if(!e)return null;let i=null;return(0,u.wk)(e)?i=function(e){let t=e.symbolLayers;if(!t)return null;let i=null;return t.forEach(e=>{"object"===e.type&&e.resource?.href||(i="water"===e.type?e.color:e.material?e.material.color:null)}),i?new r.A(i):null}(e):(0,u.$y)(e)&&(i="cim"===e.type?(0,a.Nk)(e):e.color?new r.A(e.color):null),i?d(i,t):null}function d(e,t){if(null==t||null==e)return e;let i=e.toRgba();return i[3]*=t,new r.A(i)}function c(e,t,i){e&&(t||null!=i)&&(t&&=new r.A(t),(0,u.wk)(e)?function(e,t,i){let s=e.symbolLayers;if(!s)return;let n=(e,s=!1)=>{let n=t??e??null;return null!=i?.override&&(!n&&s&&(n=new r.A([255,255,255])),n&&(n.a=i.override)),d(n,i?.add)};s.forEach(e=>{if("water"===e.type)return void(e.color=d(e.color,i?.add));let t=null==e.material?null:e.material.color,r=n(t,"icon"===e.type&&null!=e.resource?.href);null==e.material?e.material=new l.A({color:r}):e.material.color=r,"outline"in e&&e.outline?.color&&null!=i?.add&&(e.outline.color=d(e.outline.color,i.add)),"marker"in e&&null!=e.marker&&(e.marker.color=n(e.marker.color))})}(e,t,i):(0,u.$y)(e)&&function(e,t,i){t??=e.color,null!=i?.override&&t&&(t.a=i.override),t&&(e.color=d(t,i?.add)),"outline"in e&&e.outline?.color&&(e.outline.color=d(e.outline.color,i?.add))}(e,t,i))}function p(e){for(let t of e)if("number"==typeof t)return t;return null}function m(e,t,i){for(let r=0;r<3;r++){let s=e[r];switch(s){case"symbol-value":{let e=i[r];return null==e?1:e/t[r]}case"proportional":break;default:if(null!=s&&t[r])return s/t[r]}}return null}function g(e,t,i,r){switch(e){case"proportional":return i*r;case"symbol-value":return t??i;default:return e}}async function f(e,t){if(e&&t){if((0,u.wk)(e))return async function(e,t){let r=e.symbolLayers;r&&await(0,s.jJ)(r,async e=>async function(e,t){switch(e.type){case"extrude":!function(e,t){let i=t[2];"number"==typeof i&&(e.size=i)}(e,t);break;case"icon":case"line":case"text":!function(e,t){let i=p(t);null!=i&&(e.size=i)}(e,t);break;case"path":!function(e,t){let i=m(t,n.Un,[e.width,void 0,e.height]);null!=i&&(e.width=g(t[0],e.width,1,i),e.height=g(t[2],e.height,1,i))}(e,t);break;case"object":await async function(e,t){let{resourceSize:r,symbolSize:s}=await async function(e){let{computeObjectLayerResourceSize:t}=await i.e(5404).then(()=>i(95404)),r=await t(e,10),{width:s,height:n,depth:a}=e,o=[s,a,n],l=1;for(let e=0;e<3;e++){let t=o[e];if(null!=t){l=t/r[e];break}}for(let e=0;e<3;e++)o[e]??(o[e]=r[e]*l);return{resourceSize:r,symbolSize:o}}(e),n=m(t,r,s);null!=n&&(e.width=g(t[0],s[0],r[0],n),e.depth=g(t[1],s[1],r[1],n),e.height=g(t[2],s[2],r[2],n))}(e,t)}}(e,t))}(e,t);(0,u.$y)(e)&&function(e,t){let i=p(t);if(null!=i)switch(e.type){case"simple-marker":e.size=i;break;case"picture-marker":{let t=e.width/e.height;t>1?(e.width=i,e.height=i*t):(e.width=i*t,e.height=i);break}case"simple-line":e.width=i;break;case"text":e.font.size=i;break;case"simple-fill":case"picture-fill":break;case"cim":(0,a.X5)(e,i,{preserveOutlineWidth:!1})}}(e,t)}}function y(e,t,i){if(e&&null!=t)if((0,u.wk)(e)){let r=e.symbolLayers;r&&r.forEach(e=>{if("object"===e.type)switch(i){case"tilt":e.tilt=(e.tilt??0)+t;break;case"roll":e.roll=(e.roll??0)+t;break;default:e.heading=(e.heading??0)+t}"icon"===e.type&&(e.angle+=t)})}else if((0,u.$y)(e))switch(e.type){case"simple-marker":case"picture-marker":case"text":e.angle+=t;break;case"cim":(0,a.KU)(e,t,!0)}}}}]);
|