gwchq-textjam 0.5.20 → 0.5.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -12550,6 +12550,644 @@ const SvgWavFile = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.crea
12550
12550
 
12551
12551
  /***/ }),
12552
12552
 
12553
+ /***/ 56058:
12554
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
12555
+
12556
+ __webpack_require__.r(__webpack_exports__);
12557
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12558
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
12559
+ /* harmony export */ });
12560
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
12561
+ var _path, _path2, _path3, _path4, _path5, _path6, _path7, _path8, _path9, _path0, _path1, _path10, _path11, _path12, _path13, _path14, _path15, _path16, _path17, _path18, _path19, _path20, _path21, _path22, _path23, _path24, _path25, _path26, _path27, _path28, _path29, _path30, _path31, _path32, _path33, _path34, _path35, _path36, _path37, _path38, _path39, _path40, _path41, _path42, _path43, _path44, _path45, _path46, _path47, _path48, _path49, _path50, _path51, _path52, _path53, _path54, _path55, _path56, _path57, _path58, _path59, _path60, _path61, _path62, _path63, _path64, _path65, _path66, _path67, _path68, _path69, _path70, _path71, _path72, _path73, _path74, _path75, _path76, _path77, _path78, _path79, _path80, _path81, _path82, _path83, _path84, _path85, _path86, _path87, _path88, _path89, _path90, _path91, _path92, _path93, _path94, _path95, _path96, _path97, _path98, _path99, _path100, _path101, _path102, _path103, _path104, _path105, _path106, _path107, _path108, _path109, _path110, _path111, _path112, _path113, _path114, _path115, _path116, _path117, _path118, _path119, _path120, _path121, _path122, _path123, _path124, _path125, _path126, _path127, _path128, _path129, _path130, _path131, _path132, _path133, _path134, _path135, _path136, _path137, _path138, _path139;
12562
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
12563
+
12564
+ const SvgNoProject = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
12565
+ xmlns: "http://www.w3.org/2000/svg",
12566
+ width: 276,
12567
+ height: 147,
12568
+ fill: "none"
12569
+ }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12570
+ fill: "#D7E7E3",
12571
+ d: "M271.242 36.052V9.492l-4.758-4.747H9.528L4.77 9.492v26.56z"
12572
+ })), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12573
+ fill: "#33625E",
12574
+ fillRule: "evenodd",
12575
+ d: "M271.241 4.75v4.745h-4.757V4.75z",
12576
+ clipRule: "evenodd"
12577
+ })), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12578
+ fill: "#33625E",
12579
+ fillRule: "evenodd",
12580
+ d: "M275.996 9.494v4.746h-4.76V9.494z",
12581
+ clipRule: "evenodd"
12582
+ })), _path4 || (_path4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12583
+ fill: "#33625E",
12584
+ fillRule: "evenodd",
12585
+ d: "M275.996 14.237v4.746h-4.76v-4.746z",
12586
+ clipRule: "evenodd"
12587
+ })), _path5 || (_path5 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12588
+ fill: "#33625E",
12589
+ fillRule: "evenodd",
12590
+ d: "M275.996 18.98v4.746h-4.76V18.98zM275.996 23.732v4.746h-4.76v-4.746zM275.996 28.492v4.746h-4.76v-4.746z",
12591
+ clipRule: "evenodd"
12592
+ })), _path6 || (_path6 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12593
+ fill: "#33625E",
12594
+ fillRule: "evenodd",
12595
+ d: "M275.996 33.226v4.746h-4.76v-4.746zM275.996 37.978v4.746h-4.76v-4.746zM275.996 109.187v4.746h-4.76v-4.746z",
12596
+ clipRule: "evenodd"
12597
+ })), _path7 || (_path7 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12598
+ fill: "#33625E",
12599
+ fillRule: "evenodd",
12600
+ d: "M276.003 113.93v13.852h-4.761V113.93zM4.757 109.187v4.746H0v-4.746z",
12601
+ clipRule: "evenodd"
12602
+ })), _path8 || (_path8 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12603
+ fill: "#33625E",
12604
+ fillRule: "evenodd",
12605
+ d: "M4.758 113.93v13.852H0V113.93zM4.757 42.721v4.746H0v-4.746z",
12606
+ clipRule: "evenodd"
12607
+ })), _path9 || (_path9 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12608
+ fill: "#33625E",
12609
+ fillRule: "evenodd",
12610
+ d: "M4.757 47.464v4.746H0v-4.746zM4.757 52.225v4.746H0v-4.746z",
12611
+ clipRule: "evenodd"
12612
+ })), _path0 || (_path0 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12613
+ fill: "#33625E",
12614
+ d: "M4.757 56.968H0v4.746h4.757z"
12615
+ })), _path1 || (_path1 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12616
+ fill: "#33625E",
12617
+ fillRule: "evenodd",
12618
+ d: "M4.757 61.712v4.746H0v-4.746z",
12619
+ clipRule: "evenodd"
12620
+ })), _path10 || (_path10 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12621
+ fill: "#33625E",
12622
+ fillRule: "evenodd",
12623
+ d: "M4.757 66.447v4.746H0v-4.746zM4.757 71.199v4.748H0V71.2zM4.757 75.96v4.745H0V75.96z",
12624
+ clipRule: "evenodd"
12625
+ })), _path11 || (_path11 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12626
+ fill: "#33625E",
12627
+ fillRule: "evenodd",
12628
+ d: "M4.757 80.703v4.746H0v-4.746z",
12629
+ clipRule: "evenodd"
12630
+ })), _path12 || (_path12 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12631
+ fill: "#33625E",
12632
+ fillRule: "evenodd",
12633
+ d: "M4.757 85.446v4.746H0v-4.746z",
12634
+ clipRule: "evenodd"
12635
+ })), _path13 || (_path13 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12636
+ fill: "#33625E",
12637
+ fillRule: "evenodd",
12638
+ d: "M4.757 90.189v4.746H0v-4.746zM4.757 94.949v4.746H0v-4.746zM4.757 99.7v4.747H0v-4.746z",
12639
+ clipRule: "evenodd"
12640
+ })), _path14 || (_path14 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12641
+ fill: "#33625E",
12642
+ fillRule: "evenodd",
12643
+ d: "M4.757 104.435v4.746H0v-4.746zM4.757 37.978v4.746H0v-4.746zM4.757 33.226v4.746H0v-4.746z",
12644
+ clipRule: "evenodd"
12645
+ })), _path15 || (_path15 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12646
+ fill: "#33625E",
12647
+ fillRule: "evenodd",
12648
+ d: "M4.757 28.492v4.746H0v-4.746zM4.757 23.732v4.746H0v-4.746zM4.757 18.98v4.746H0V18.98z",
12649
+ clipRule: "evenodd"
12650
+ })), _path16 || (_path16 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12651
+ fill: "#33625E",
12652
+ fillRule: "evenodd",
12653
+ d: "M4.757 14.237v4.746H0v-4.746z",
12654
+ clipRule: "evenodd"
12655
+ })), _path17 || (_path17 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12656
+ fill: "#33625E",
12657
+ fillRule: "evenodd",
12658
+ d: "M4.757 9.494v4.746H0V9.494zM9.527 4.75v4.745H4.77V4.75zM19.042 0v4.746h-4.757V0zM23.802 0v4.746h-4.757V0zM28.562 0v4.746h-4.757V0z",
12659
+ clipRule: "evenodd"
12660
+ })), _path18 || (_path18 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12661
+ fill: "#33625E",
12662
+ fillRule: "evenodd",
12663
+ d: "M33.314 0v4.746h-4.757V0zM38.083 0v4.746h-4.757V0z",
12664
+ clipRule: "evenodd"
12665
+ })), _path19 || (_path19 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12666
+ fill: "#33625E",
12667
+ fillRule: "evenodd",
12668
+ d: "M42.835 0v4.746h-4.757V0z",
12669
+ clipRule: "evenodd"
12670
+ })), _path20 || (_path20 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12671
+ fill: "#33625E",
12672
+ fillRule: "evenodd",
12673
+ d: "M47.58 0v4.746h-4.758V0zM52.339 0v4.746h-4.757V0zM57.118 0v4.746h-4.757V0z",
12674
+ clipRule: "evenodd"
12675
+ })), _path21 || (_path21 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12676
+ fill: "#33625E",
12677
+ fillRule: "evenodd",
12678
+ d: "M61.87 0v4.746h-4.757V0zM66.63 0v4.746h-4.757V0z",
12679
+ clipRule: "evenodd"
12680
+ })), _path22 || (_path22 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12681
+ fill: "#33625E",
12682
+ fillRule: "evenodd",
12683
+ d: "M71.382 0v4.746h-4.757V0zM76.152 0v4.746h-4.758V0z",
12684
+ clipRule: "evenodd"
12685
+ })), _path23 || (_path23 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12686
+ fill: "#33625E",
12687
+ fillRule: "evenodd",
12688
+ d: "M80.889 0v4.746h-4.76V0zM85.665 0v4.746h-4.757V0z",
12689
+ clipRule: "evenodd"
12690
+ })), _path24 || (_path24 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12691
+ fill: "#33625E",
12692
+ fillRule: "evenodd",
12693
+ d: "M90.415 0v4.746h-4.757V0z",
12694
+ clipRule: "evenodd"
12695
+ })), _path25 || (_path25 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12696
+ fill: "#33625E",
12697
+ fillRule: "evenodd",
12698
+ d: "M95.167 0v4.746H90.41V0zM99.937 0v4.746H95.18V0z",
12699
+ clipRule: "evenodd"
12700
+ })), _path26 || (_path26 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12701
+ fill: "#33625E",
12702
+ fillRule: "evenodd",
12703
+ d: "M104.681 0v4.746h-4.757V0zM109.45 0v4.746h-4.757V0z",
12704
+ clipRule: "evenodd"
12705
+ })), _path27 || (_path27 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12706
+ fill: "#33625E",
12707
+ fillRule: "evenodd",
12708
+ d: "M114.202 0v4.746h-4.757V0zM118.972 0v4.746h-4.757V0z",
12709
+ clipRule: "evenodd"
12710
+ })), _path28 || (_path28 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12711
+ fill: "#33625E",
12712
+ fillRule: "evenodd",
12713
+ d: "M123.724 0v4.746h-4.757V0zM128.484 0v4.746h-4.757V0z",
12714
+ clipRule: "evenodd"
12715
+ })), _path29 || (_path29 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12716
+ fill: "#33625E",
12717
+ fillRule: "evenodd",
12718
+ d: "M133.236 0v4.746h-4.757V0zM138.005 0v4.746h-4.757V0z",
12719
+ clipRule: "evenodd"
12720
+ })), _path30 || (_path30 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12721
+ fill: "#33625E",
12722
+ fillRule: "evenodd",
12723
+ d: "M142.749 0v4.746h-4.757V0zM147.519 0v4.746h-4.757V0z",
12724
+ clipRule: "evenodd"
12725
+ })), _path31 || (_path31 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12726
+ fill: "#33625E",
12727
+ fillRule: "evenodd",
12728
+ d: "M152.271 0v4.746h-4.757V0zM157.038 0v4.746h-4.757V0zM161.8 0v4.746h-4.757V0zM166.562 0v4.746h-4.757V0zM171.321 0v4.746h-4.757V0zM176.081 0v4.746h-4.757V0z",
12729
+ clipRule: "evenodd"
12730
+ })), _path32 || (_path32 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12731
+ fill: "#33625E",
12732
+ fillRule: "evenodd",
12733
+ d: "M180.825 0v4.746h-4.757V0zM185.595 0v4.746h-4.757V0zM190.355 0v4.746h-4.757V0z",
12734
+ clipRule: "evenodd"
12735
+ })), _path33 || (_path33 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12736
+ fill: "#33625E",
12737
+ fillRule: "evenodd",
12738
+ d: "M195.107 0v4.746h-4.757V0z",
12739
+ clipRule: "evenodd"
12740
+ })), _path34 || (_path34 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12741
+ fill: "#33625E",
12742
+ fillRule: "evenodd",
12743
+ d: "M199.859 0v4.746h-4.757V0z",
12744
+ clipRule: "evenodd"
12745
+ })), _path35 || (_path35 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12746
+ fill: "#33625E",
12747
+ d: "M204.628 0h-4.757v4.746h4.757z"
12748
+ })), _path36 || (_path36 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12749
+ fill: "#33625E",
12750
+ fillRule: "evenodd",
12751
+ d: "M209.38 0v4.746h-4.757V0zM214.15 0v4.746h-4.757V0z",
12752
+ clipRule: "evenodd"
12753
+ })), _path37 || (_path37 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12754
+ fill: "#33625E",
12755
+ fillRule: "evenodd",
12756
+ d: "M218.894 0v4.746h-4.757V0zM223.663 0v4.746h-4.757V0z",
12757
+ clipRule: "evenodd"
12758
+ })), _path38 || (_path38 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12759
+ fill: "#33625E",
12760
+ fillRule: "evenodd",
12761
+ d: "M228.415 0v4.746h-4.757V0zM233.175 0v4.746h-4.757V0zM237.945 0v4.746h-4.757V0z",
12762
+ clipRule: "evenodd"
12763
+ })), _path39 || (_path39 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12764
+ fill: "#33625E",
12765
+ fillRule: "evenodd",
12766
+ d: "M242.687 0v4.746h-4.757V0zM247.458 0v4.746h-4.757V0z",
12767
+ clipRule: "evenodd"
12768
+ })), _path40 || (_path40 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12769
+ fill: "#33625E",
12770
+ fillRule: "evenodd",
12771
+ d: "M252.21 0v4.746h-4.757V0zM256.978 0v4.746h-4.757V0z",
12772
+ clipRule: "evenodd"
12773
+ })), _path41 || (_path41 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12774
+ fill: "#33625E",
12775
+ fillRule: "evenodd",
12776
+ d: "M261.722 0v4.746h-4.757V0z",
12777
+ clipRule: "evenodd"
12778
+ })), _path42 || (_path42 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12779
+ fill: "#33625E",
12780
+ d: "M266.499 0h-4.757v4.746h4.757z"
12781
+ })), _path43 || (_path43 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12782
+ fill: "#33625E",
12783
+ fillRule: "evenodd",
12784
+ d: "M14.28 0v4.746H9.523V0zM19.042 33.226v4.746h-4.757v-4.746z",
12785
+ clipRule: "evenodd"
12786
+ })), _path44 || (_path44 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12787
+ fill: "#33625E",
12788
+ fillRule: "evenodd",
12789
+ d: "M23.794 33.226v4.746h-4.757v-4.746zM28.562 33.226v4.746h-4.757v-4.746z",
12790
+ clipRule: "evenodd"
12791
+ })), _path45 || (_path45 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12792
+ fill: "#33625E",
12793
+ fillRule: "evenodd",
12794
+ d: "M33.314 33.226v4.746h-4.757v-4.746z",
12795
+ clipRule: "evenodd"
12796
+ })), _path46 || (_path46 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12797
+ fill: "#33625E",
12798
+ fillRule: "evenodd",
12799
+ d: "M38.066 33.226v4.746h-4.757v-4.746zM42.835 33.226v4.746h-4.757v-4.746z",
12800
+ clipRule: "evenodd"
12801
+ })), _path47 || (_path47 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12802
+ fill: "#33625E",
12803
+ fillRule: "evenodd",
12804
+ d: "M47.58 33.226v4.746h-4.758v-4.746zM52.339 33.226v4.746h-4.757v-4.746zM57.118 33.226v4.746h-4.757v-4.746z",
12805
+ clipRule: "evenodd"
12806
+ })), _path48 || (_path48 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12807
+ fill: "#33625E",
12808
+ fillRule: "evenodd",
12809
+ d: "M61.853 33.226v4.746h-4.757v-4.746zM66.63 33.226v4.746h-4.757v-4.746z",
12810
+ clipRule: "evenodd"
12811
+ })), _path49 || (_path49 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12812
+ fill: "#33625E",
12813
+ fillRule: "evenodd",
12814
+ d: "M71.382 33.226v4.746h-4.757v-4.746zM76.144 33.226v4.746h-4.757v-4.746z",
12815
+ clipRule: "evenodd"
12816
+ })), _path50 || (_path50 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12817
+ fill: "#33625E",
12818
+ fillRule: "evenodd",
12819
+ d: "M80.889 33.226v4.746h-4.76v-4.746zM85.665 33.226v4.746h-4.757v-4.746z",
12820
+ clipRule: "evenodd"
12821
+ })), _path51 || (_path51 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12822
+ fill: "#33625E",
12823
+ fillRule: "evenodd",
12824
+ d: "M90.415 33.226v4.746h-4.757v-4.746z",
12825
+ clipRule: "evenodd"
12826
+ })), _path52 || (_path52 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12827
+ fill: "#33625E",
12828
+ fillRule: "evenodd",
12829
+ d: "M95.167 33.226v4.746H90.41v-4.746zM99.937 33.226v4.746H95.18v-4.746z",
12830
+ clipRule: "evenodd"
12831
+ })), _path53 || (_path53 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12832
+ fill: "#33625E",
12833
+ fillRule: "evenodd",
12834
+ d: "M104.681 33.226v4.746h-4.757v-4.746zM109.45 33.226v4.746h-4.757v-4.746z",
12835
+ clipRule: "evenodd"
12836
+ })), _path54 || (_path54 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12837
+ fill: "#33625E",
12838
+ fillRule: "evenodd",
12839
+ d: "M114.202 33.226v4.746h-4.757v-4.746zM118.972 33.226v4.746h-4.757v-4.746z",
12840
+ clipRule: "evenodd"
12841
+ })), _path55 || (_path55 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12842
+ fill: "#33625E",
12843
+ fillRule: "evenodd",
12844
+ d: "M123.724 33.226v4.746h-4.757v-4.746zM128.484 33.226v4.746h-4.757v-4.746z",
12845
+ clipRule: "evenodd"
12846
+ })), _path56 || (_path56 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12847
+ fill: "#33625E",
12848
+ fillRule: "evenodd",
12849
+ d: "M133.236 33.226v4.746h-4.757v-4.746zM138.005 33.226v4.746h-4.757v-4.746z",
12850
+ clipRule: "evenodd"
12851
+ })), _path57 || (_path57 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12852
+ fill: "#33625E",
12853
+ fillRule: "evenodd",
12854
+ d: "M142.739 33.226v4.746h-4.757v-4.746zM147.519 33.226v4.746h-4.757v-4.746z",
12855
+ clipRule: "evenodd"
12856
+ })), _path58 || (_path58 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12857
+ fill: "#33625E",
12858
+ fillRule: "evenodd",
12859
+ d: "M152.271 33.226v4.746h-4.757v-4.746zM157.038 33.226v4.746h-4.757v-4.746zM161.8 33.226v4.746h-4.757v-4.746zM166.562 33.226v4.746h-4.757v-4.746zM171.321 33.226v4.746h-4.757v-4.746zM176.081 33.226v4.746h-4.757v-4.746z",
12860
+ clipRule: "evenodd"
12861
+ })), _path59 || (_path59 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12862
+ fill: "#33625E",
12863
+ fillRule: "evenodd",
12864
+ d: "M180.825 33.226v4.746h-4.757v-4.746zM185.595 33.226v4.746h-4.757v-4.746zM190.355 33.226v4.746h-4.757v-4.746z",
12865
+ clipRule: "evenodd"
12866
+ })), _path60 || (_path60 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12867
+ fill: "#33625E",
12868
+ fillRule: "evenodd",
12869
+ d: "M195.099 33.226v4.746h-4.757v-4.746zM199.859 33.226v4.746h-4.757v-4.746z",
12870
+ clipRule: "evenodd"
12871
+ })), _path61 || (_path61 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12872
+ fill: "#33625E",
12873
+ d: "M204.628 33.226h-4.757v4.746h4.757z"
12874
+ })), _path62 || (_path62 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12875
+ fill: "#33625E",
12876
+ fillRule: "evenodd",
12877
+ d: "M209.38 33.226v4.746h-4.757v-4.746zM214.142 33.226v4.746h-4.757v-4.746z",
12878
+ clipRule: "evenodd"
12879
+ })), _path63 || (_path63 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12880
+ fill: "#33625E",
12881
+ fillRule: "evenodd",
12882
+ d: "M218.894 33.226v4.746h-4.757v-4.746zM223.663 33.226v4.746h-4.757v-4.746z",
12883
+ clipRule: "evenodd"
12884
+ })), _path64 || (_path64 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12885
+ fill: "#33625E",
12886
+ fillRule: "evenodd",
12887
+ d: "M228.415 33.226v4.746h-4.757v-4.746zM233.175 33.226v4.746h-4.757v-4.746zM237.945 33.226v4.746h-4.757v-4.746z",
12888
+ clipRule: "evenodd"
12889
+ })), _path65 || (_path65 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12890
+ fill: "#33625E",
12891
+ fillRule: "evenodd",
12892
+ d: "M242.687 33.226v4.746h-4.757v-4.746zM247.458 33.226v4.746h-4.757v-4.746z",
12893
+ clipRule: "evenodd"
12894
+ })), _path66 || (_path66 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12895
+ fill: "#33625E",
12896
+ fillRule: "evenodd",
12897
+ d: "M252.2 33.226v4.746h-4.757v-4.746zM256.978 33.226v4.746h-4.757v-4.746z",
12898
+ clipRule: "evenodd"
12899
+ })), _path67 || (_path67 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12900
+ fill: "#33625E",
12901
+ fillRule: "evenodd",
12902
+ d: "M261.722 33.226v4.746h-4.757v-4.746z",
12903
+ clipRule: "evenodd"
12904
+ })), _path68 || (_path68 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12905
+ fill: "#33625E",
12906
+ d: "M266.499 33.226h-4.757v4.746h4.757z"
12907
+ })), _path69 || (_path69 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12908
+ fill: "#33625E",
12909
+ fillRule: "evenodd",
12910
+ d: "M271.243 33.226v4.746h-4.757v-4.746zM14.28 33.226v4.746H9.523v-4.746z",
12911
+ clipRule: "evenodd"
12912
+ })), _path70 || (_path70 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12913
+ fill: "#33625E",
12914
+ fillRule: "evenodd",
12915
+ d: "M9.528 33.226v4.746H4.771v-4.746zM275.996 127.777v4.746h-4.76v-4.746zM275.996 132.537v4.746h-4.76v-4.746zM4.757 132.52v4.749H0v-4.749z",
12916
+ clipRule: "evenodd"
12917
+ })), _path71 || (_path71 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12918
+ fill: "#33625E",
12919
+ fillRule: "evenodd",
12920
+ d: "M4.757 127.777v4.746H0v-4.746zM9.527 137.28v4.746H4.77v-4.746z",
12921
+ clipRule: "evenodd"
12922
+ })), _path72 || (_path72 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12923
+ fill: "#33625E",
12924
+ fillRule: "evenodd",
12925
+ d: "M14.279 142.015v4.746H9.52v-4.746z",
12926
+ clipRule: "evenodd"
12927
+ })), _path73 || (_path73 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12928
+ fill: "#33625E",
12929
+ d: "M271.241 137.28h-4.757v4.746h4.757z"
12930
+ })), _path74 || (_path74 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12931
+ fill: "#33625E",
12932
+ fillRule: "evenodd",
12933
+ d: "M266.497 142.015v4.746h-4.757v-4.746zM261.72 142.015v4.746h-4.757v-4.746z",
12934
+ clipRule: "evenodd"
12935
+ })), _path75 || (_path75 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12936
+ fill: "#33625E",
12937
+ fillRule: "evenodd",
12938
+ d: "M256.976 142.015v4.746h-4.757v-4.746z",
12939
+ clipRule: "evenodd"
12940
+ })), _path76 || (_path76 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12941
+ fill: "#33625E",
12942
+ d: "M252.198 142.015h-4.757v4.746h4.757z"
12943
+ })), _path77 || (_path77 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12944
+ fill: "#33625E",
12945
+ fillRule: "evenodd",
12946
+ d: "M247.439 142.015v4.746h-4.757v-4.746z",
12947
+ clipRule: "evenodd"
12948
+ })), _path78 || (_path78 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12949
+ fill: "#33625E",
12950
+ fillRule: "evenodd",
12951
+ d: "M242.685 142.015v4.746h-4.757v-4.746zM237.925 142.015v4.746h-4.757v-4.746z",
12952
+ clipRule: "evenodd"
12953
+ })), _path79 || (_path79 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12954
+ fill: "#33625E",
12955
+ fillRule: "evenodd",
12956
+ d: "M233.173 142.015v4.746h-4.757v-4.746zM228.403 142.015v4.746h-4.757v-4.746zM223.644 142.015v4.746h-4.757v-4.746zM218.882 142.015v4.746h-4.757v-4.746z",
12957
+ clipRule: "evenodd"
12958
+ })), _path80 || (_path80 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12959
+ fill: "#33625E",
12960
+ d: "M214.14 142.015h-4.757v4.746h4.757z"
12961
+ })), _path81 || (_path81 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12962
+ fill: "#33625E",
12963
+ fillRule: "evenodd",
12964
+ d: "M209.37 142.015v4.746h-4.757v-4.746z",
12965
+ clipRule: "evenodd"
12966
+ })), _path82 || (_path82 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12967
+ fill: "#33625E",
12968
+ fillRule: "evenodd",
12969
+ d: "M204.618 142.015v4.746h-4.757v-4.746zM199.849 142.015v4.746h-4.757v-4.746z",
12970
+ clipRule: "evenodd"
12971
+ })), _path83 || (_path83 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12972
+ fill: "#33625E",
12973
+ fillRule: "evenodd",
12974
+ d: "M195.097 142.015v4.746h-4.757v-4.746zM190.337 142.015v4.746h-4.757v-4.746z",
12975
+ clipRule: "evenodd"
12976
+ })), _path84 || (_path84 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12977
+ fill: "#33625E",
12978
+ fillRule: "evenodd",
12979
+ d: "M185.583 142.015v4.746h-4.757v-4.746zM180.814 142.015v4.746h-4.757v-4.746z",
12980
+ clipRule: "evenodd"
12981
+ })), _path85 || (_path85 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12982
+ fill: "#33625E",
12983
+ fillRule: "evenodd",
12984
+ d: "M176.062 142.015v4.746h-4.757v-4.746zM171.302 142.015v4.746h-4.757v-4.746zM166.542 142.015v4.746h-4.757v-4.746zM161.78 142.015v4.746h-4.757v-4.746zM57.089 142.015v4.746h-4.757v-4.746zM61.85 142.015v4.746h-4.756v-4.746z",
12985
+ clipRule: "evenodd"
12986
+ })), _path86 || (_path86 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12987
+ fill: "#33625E",
12988
+ fillRule: "evenodd",
12989
+ d: "M66.603 142.015v4.746h-4.757v-4.746zM71.37 142.015v4.746h-4.757v-4.746zM76.142 142.015v4.746h-4.757v-4.746z",
12990
+ clipRule: "evenodd"
12991
+ })), _path87 || (_path87 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12992
+ fill: "#33625E",
12993
+ fillRule: "evenodd",
12994
+ d: "M80.866 142.015v4.746H76.11v-4.746zM85.646 142.015v4.746h-4.757v-4.746z",
12995
+ clipRule: "evenodd"
12996
+ })), _path88 || (_path88 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
12997
+ fill: "#33625E",
12998
+ fillRule: "evenodd",
12999
+ d: "M90.38 142.015v4.746h-4.757v-4.746zM95.157 142.015v4.746H90.4v-4.746zM99.917 142.015v4.746H95.16v-4.746zM104.679 142.015v4.746h-4.757v-4.746z",
13000
+ clipRule: "evenodd"
13001
+ })), _path89 || (_path89 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13002
+ fill: "#33625E",
13003
+ fillRule: "evenodd",
13004
+ d: "M109.431 142.015v4.746h-4.757v-4.746zM114.2 142.015v4.746h-4.757v-4.746zM118.96 142.015v4.746h-4.757v-4.746zM123.722 142.015v4.746h-4.757v-4.746z",
13005
+ clipRule: "evenodd"
13006
+ })), _path90 || (_path90 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13007
+ fill: "#33625E",
13008
+ fillRule: "evenodd",
13009
+ d: "M128.474 142.015v4.746h-4.757v-4.746zM133.234 142.015v4.746h-4.757v-4.746zM137.995 142.015v4.746h-4.757v-4.746z",
13010
+ clipRule: "evenodd"
13011
+ })), _path91 || (_path91 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13012
+ fill: "#33625E",
13013
+ fillRule: "evenodd",
13014
+ d: "M142.737 142.015v4.746h-4.757v-4.746zM147.507 142.015v4.746h-4.757v-4.746z",
13015
+ clipRule: "evenodd"
13016
+ })), _path92 || (_path92 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13017
+ fill: "#33625E",
13018
+ fillRule: "evenodd",
13019
+ d: "M152.262 142.015v4.746h-4.76v-4.746zM157.036 142.015v4.746h-4.757v-4.746zM52.33 142.015v4.746h-4.758v-4.746zM47.568 142.015v4.746H42.81v-4.746z",
13020
+ clipRule: "evenodd"
13021
+ })), _path93 || (_path93 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13022
+ fill: "#33625E",
13023
+ d: "M42.825 142.015h-4.757v4.746h4.757z"
13024
+ })), _path94 || (_path94 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13025
+ fill: "#33625E",
13026
+ fillRule: "evenodd",
13027
+ d: "M38.056 142.015v4.746h-4.757v-4.746zM33.294 142.015v4.746h-4.757v-4.746zM28.534 142.015v4.746h-4.757v-4.746z",
13028
+ clipRule: "evenodd"
13029
+ })), _path95 || (_path95 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13030
+ fill: "#33625E",
13031
+ fillRule: "evenodd",
13032
+ d: "M23.782 142.015v4.746h-4.757v-4.746z",
13033
+ clipRule: "evenodd"
13034
+ })), _path96 || (_path96 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13035
+ fill: "#33625E",
13036
+ fillRule: "evenodd",
13037
+ d: "M19.567 142.015v4.747h-5.862v-4.747zM275.996 42.721v4.746h-4.76v-4.746z",
13038
+ clipRule: "evenodd"
13039
+ })), _path97 || (_path97 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13040
+ fill: "#33625E",
13041
+ fillRule: "evenodd",
13042
+ d: "M275.996 47.464v4.746h-4.76v-4.746z",
13043
+ clipRule: "evenodd"
13044
+ })), _path98 || (_path98 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13045
+ fill: "#33625E",
13046
+ d: "M275.996 52.234h-4.76v4.746h4.76z"
13047
+ })), _path99 || (_path99 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13048
+ fill: "#33625E",
13049
+ fillRule: "evenodd",
13050
+ d: "M275.996 56.968v4.746h-4.76v-4.746z",
13051
+ clipRule: "evenodd"
13052
+ })), _path100 || (_path100 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13053
+ fill: "#33625E",
13054
+ fillRule: "evenodd",
13055
+ d: "M275.996 61.712v4.746h-4.76v-4.746z",
13056
+ clipRule: "evenodd"
13057
+ })), _path101 || (_path101 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13058
+ fill: "#33625E",
13059
+ fillRule: "evenodd",
13060
+ d: "M275.996 66.456V71.2h-4.76v-4.745z",
13061
+ clipRule: "evenodd"
13062
+ })), _path102 || (_path102 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13063
+ fill: "#33625E",
13064
+ fillRule: "evenodd",
13065
+ d: "M275.996 71.199v4.746h-4.76v-4.746zM275.996 75.968v4.746h-4.76v-4.746z",
13066
+ clipRule: "evenodd"
13067
+ })), _path103 || (_path103 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13068
+ fill: "#33625E",
13069
+ fillRule: "evenodd",
13070
+ d: "M275.996 80.703v4.746h-4.76v-4.746z",
13071
+ clipRule: "evenodd"
13072
+ })), _path104 || (_path104 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13073
+ fill: "#33625E",
13074
+ fillRule: "evenodd",
13075
+ d: "M275.996 85.446v4.746h-4.76v-4.746zM275.996 90.197v4.746h-4.76v-4.746zM275.996 94.949v4.746h-4.76v-4.746zM275.996 99.7v4.747h-4.76v-4.746z",
13076
+ clipRule: "evenodd"
13077
+ })), _path105 || (_path105 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13078
+ fill: "#33625E",
13079
+ fillRule: "evenodd",
13080
+ d: "M275.996 104.444v4.746h-4.76v-4.746zM258.405 17.477v4.746h-4.757v-4.746zM253.636 22.22v4.747h-4.757V22.22z",
13081
+ clipRule: "evenodd"
13082
+ })), _path106 || (_path106 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13083
+ fill: "#33625E",
13084
+ fillRule: "evenodd",
13085
+ d: "M263.157 22.22v4.747H258.4V22.22z",
13086
+ clipRule: "evenodd"
13087
+ })), _path107 || (_path107 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13088
+ fill: "#33625E",
13089
+ d: "M253.636 12.733h-4.757v4.746h4.757zM263.157 12.733H258.4v4.746h4.757z"
13090
+ })), _path108 || (_path108 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13091
+ fill: "#D7E7E3",
13092
+ d: "M98 55.985h84v62H98z"
13093
+ })), _path109 || (_path109 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13094
+ fill: "#33625E",
13095
+ d: "M96.195 96.138h4.196v-4.196h-4.196zM96.195 91.94h4.196v-4.195h-4.196z"
13096
+ })), _path110 || (_path110 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13097
+ fill: "#33625E",
13098
+ d: "M96.195 87.746h4.196V83.55h-4.196zM96.195 108.724h4.196v-4.196h-4.196z"
13099
+ })), _path111 || (_path111 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13100
+ fill: "#33625E",
13101
+ d: "M96.195 104.529h4.196v-4.196h-4.196zM96.195 100.333h4.196v-4.195h-4.196zM96.195 121.312h4.196v-4.196h-4.196zM96.195 117.115h4.196v-4.196h-4.196zM96.195 112.919h4.196v-4.195h-4.196zM96.195 83.55h4.196v-4.195h-4.196z"
13102
+ })), _path112 || (_path112 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13103
+ fill: "#33625E",
13104
+ d: "M96.195 79.355h4.196v-4.196h-4.196z"
13105
+ })), _path113 || (_path113 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13106
+ fill: "#33625E",
13107
+ d: "M96.195 75.16h4.196v-4.196h-4.196zM96.195 70.964h4.196V66.77h-4.196zM96.195 66.767h4.196V62.57h-4.196z"
13108
+ })), _path114 || (_path114 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13109
+ fill: "#33625E",
13110
+ d: "M96.195 62.572h4.196v-4.196h-4.196zM100.391 62.572h4.195v-4.196h-4.195zM180.109 96.138h4.196v-4.196h-4.196zM180.109 91.94h4.196v-4.195h-4.196z"
13111
+ })), _path115 || (_path115 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13112
+ fill: "#33625E",
13113
+ d: "M180.109 87.746h4.196V83.55h-4.196zM180.109 108.724h4.196v-4.196h-4.196z"
13114
+ })), _path116 || (_path116 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13115
+ fill: "#33625E",
13116
+ d: "M180.109 104.529h4.196v-4.196h-4.196zM180.109 100.333h4.196v-4.195h-4.196zM180.109 117.115h4.196v-4.196h-4.196zM180.109 112.919h4.196v-4.195h-4.196zM180.109 83.55h4.196v-4.195h-4.196z"
13117
+ })), _path117 || (_path117 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13118
+ fill: "#33625E",
13119
+ d: "M180.109 79.355h4.196v-4.196h-4.196z"
13120
+ })), _path118 || (_path118 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13121
+ fill: "#33625E",
13122
+ d: "M180.109 75.16h4.196v-4.196h-4.196zM180.109 70.964h4.196V66.77h-4.196zM180.109 66.767h4.196V62.57h-4.196z"
13123
+ })), _path119 || (_path119 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13124
+ fill: "#33625E",
13125
+ d: "M180.109 62.572h4.196v-4.196h-4.196zM138.153 121.312v-4.196h-4.196v4.196zM133.957 121.312v-4.196h-4.195v4.196zM129.76 121.312v-4.196h-4.196v4.196z"
13126
+ })), _path120 || (_path120 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13127
+ fill: "#33625E",
13128
+ d: "M142.348 121.312v-4.196h-4.196v4.196zM125.565 121.312v-4.196h-4.196v4.196zM121.369 121.312v-4.196h-4.195v4.196zM163.327 121.312v-4.196h-4.196v4.196zM159.131 121.312v-4.196h-4.195v4.196zM154.934 121.312v-4.196h-4.196v4.196z"
13129
+ })), _path121 || (_path121 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13130
+ fill: "#33625E",
13131
+ d: "M167.522 121.312v-4.196h-4.196v4.196zM180.108 121.312v-4.196h-4.196v4.196zM175.912 121.312v-4.196h-4.195v4.196z"
13132
+ })), _path122 || (_path122 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13133
+ fill: "#33625E",
13134
+ d: "M171.717 121.312v-4.196h-4.196v4.196zM184.305 121.312v-4.196h-4.196v4.196zM188.5 121.312v-4.196h-4.195v4.196zM180.108 117.115v-4.196h-4.196v4.196zM188.5 117.115v-4.196h-4.195v4.196zM180.108 125.507v-4.195h-4.196v4.195zM184.305 125.507v-4.195h-4.196v4.195zM188.5 125.507v-4.195h-4.195v4.195zM150.739 121.312v-4.196h-4.196v4.196zM146.543 121.312v-4.196h-4.195v4.196zM117.174 121.312v-4.196h-4.195v4.196zM112.979 121.312v-4.196h-4.196v4.196z"
13135
+ })), _path123 || (_path123 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13136
+ fill: "#33625E",
13137
+ d: "M108.784 121.312v-4.196h-4.196v4.196zM104.586 121.312v-4.196h-4.195v4.196zM96.195 58.376h4.196v-4.195h-4.196zM92 62.572h4.196v-4.196H92z"
13138
+ })), _path124 || (_path124 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13139
+ fill: "#33625E",
13140
+ d: "M92 58.376h4.196v-4.195H92zM138.153 58.376v-4.195h-4.196v4.195zM133.957 58.376v-4.195h-4.195v4.195zM129.76 58.376v-4.195h-4.196v4.195z"
13141
+ })), _path125 || (_path125 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13142
+ fill: "#33625E",
13143
+ d: "M142.348 58.376v-4.195h-4.196v4.195zM125.565 58.376v-4.195h-4.196v4.195zM121.369 58.376v-4.195h-4.195v4.195zM163.327 58.376v-4.195h-4.196v4.195zM159.131 58.376v-4.195h-4.195v4.195zM154.934 58.376v-4.195h-4.196v4.195z"
13144
+ })), _path126 || (_path126 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13145
+ fill: "#33625E",
13146
+ d: "M167.522 58.376v-4.195h-4.196v4.195zM180.108 58.376v-4.195h-4.196v4.195zM175.912 58.376v-4.195h-4.195v4.195z"
13147
+ })), _path127 || (_path127 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13148
+ fill: "#33625E",
13149
+ d: "M171.717 58.376v-4.195h-4.196v4.195zM184.305 58.376v-4.195h-4.196v4.195zM150.739 58.376v-4.195h-4.196v4.195zM146.543 58.376v-4.195h-4.195v4.195zM117.174 58.376v-4.195h-4.195v4.195zM112.979 58.376v-4.195h-4.196v4.195z"
13150
+ })), _path128 || (_path128 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13151
+ fill: "#33625E",
13152
+ d: "M108.784 58.376v-4.195h-4.196v4.195zM104.586 58.376v-4.195h-4.195v4.195zM96.195 54.181h4.196v-4.196h-4.196z"
13153
+ })), _path129 || (_path129 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13154
+ fill: "#33625E",
13155
+ d: "M92 54.181h4.196v-4.196H92zM104.586 54.181v-4.196h-4.195v4.196zM151.194 93.125v3.967h-3.967v-3.968zM155.161 97.092v3.967h-3.968v-3.967zM159.12 101.059v3.959h-3.96v-3.959zM163.086 105.018v3.967h-3.967v-3.967z"
13156
+ })), _path130 || (_path130 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13157
+ fill: "#33625E",
13158
+ d: "M151.194 97.09v3.968h-3.967v-3.967zM155.161 101.059v3.959h-3.968v-3.959zM159.12 105.018v3.967h-3.96v-3.967zM124.787 82.1v3.779H121v-3.78z"
13159
+ })), _path131 || (_path131 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13160
+ fill: "#33625E",
13161
+ d: "M124.787 85.874v3.78H121v-3.78zM124.787 78.322v3.772H121v-3.772z"
13162
+ })), _path132 || (_path132 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13163
+ fill: "#33625E",
13164
+ d: "M128.559 74.545v3.78h-3.772v-3.78zM132.329 70.762v3.78h-3.772v-3.78zM139.885 66.986v3.78h-3.772v-3.78zM143.671 66.986v3.78h-3.786v-3.78z"
13165
+ })), _path133 || (_path133 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13166
+ fill: "#33625E",
13167
+ d: "M136.113 66.986v3.78h-3.787v-3.78zM147.444 70.762v3.78h-3.772v-3.78zM151.215 74.545v3.78h-3.772v-3.78zM151.215 89.657v3.78h-3.772v-3.78z"
13168
+ })), _path134 || (_path134 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13169
+ fill: "#33625E",
13170
+ d: "M147.444 93.434v3.779h-3.772v-3.78zM139.885 97.214v3.772h-3.772v-3.772zM136.113 97.214v3.772h-3.787v-3.772zM143.671 97.214v3.772h-3.786v-3.772zM132.329 93.434v3.779h-3.772v-3.78z"
13171
+ })), _path135 || (_path135 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13172
+ fill: "#33625E",
13173
+ d: "M128.559 89.657v3.78h-3.772v-3.78zM155.004 82.101v3.78h-3.787V82.1z"
13174
+ })), _path136 || (_path136 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13175
+ fill: "#33625E",
13176
+ d: "M155.004 85.878v3.78h-3.787v-3.78z"
13177
+ })), _path137 || (_path137 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13178
+ fill: "#E5F6F1",
13179
+ d: "M151.221 78.325v11.331h-3.772v3.78h-3.772v3.78h-11.338v-3.78h-3.78v-3.78h-3.772v-11.33h3.772v-3.78h3.78v-3.78h11.338v3.78h3.772v3.78z"
13180
+ })), _path138 || (_path138 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13181
+ fill: "#33625E",
13182
+ d: "M155.004 78.322v3.772h-3.787v-3.772zM136.116 78.321v3.772h-3.772v-3.772zM139.887 82.098v3.78h-3.772v-3.78z"
13183
+ })), _path139 || (_path139 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
13184
+ fill: "#33625E",
13185
+ d: "M136.116 85.873v3.772h-3.772v-3.772zM143.668 78.321v3.772h-3.779v-3.772zM143.668 85.873v3.772h-3.779v-3.772z"
13186
+ })));
13187
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNoProject);
13188
+
13189
+ /***/ }),
13190
+
12553
13191
  /***/ 82281:
12554
13192
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
12555
13193
 
@@ -58125,6 +58763,2503 @@ exports.CDATA = ElementType.CDATA;
58125
58763
  exports.Doctype = ElementType.Doctype;
58126
58764
 
58127
58765
 
58766
+ /***/ }),
58767
+
58768
+ /***/ 25454:
58769
+ /***/ ((module) => {
58770
+
58771
+ /*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */
58772
+
58773
+
58774
+
58775
+ function _arrayLikeToArray(r, a) {
58776
+ (null == a || a > r.length) && (a = r.length);
58777
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
58778
+ return n;
58779
+ }
58780
+ function _arrayWithHoles(r) {
58781
+ if (Array.isArray(r)) return r;
58782
+ }
58783
+ function _iterableToArrayLimit(r, l) {
58784
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
58785
+ if (null != t) {
58786
+ var e,
58787
+ n,
58788
+ i,
58789
+ u,
58790
+ a = [],
58791
+ f = true,
58792
+ o = false;
58793
+ try {
58794
+ if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
58795
+ } catch (r) {
58796
+ o = true, n = r;
58797
+ } finally {
58798
+ try {
58799
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
58800
+ } finally {
58801
+ if (o) throw n;
58802
+ }
58803
+ }
58804
+ return a;
58805
+ }
58806
+ }
58807
+ function _nonIterableRest() {
58808
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
58809
+ }
58810
+ function _slicedToArray(r, e) {
58811
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
58812
+ }
58813
+ function _unsupportedIterableToArray(r, a) {
58814
+ if (r) {
58815
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
58816
+ var t = {}.toString.call(r).slice(8, -1);
58817
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
58818
+ }
58819
+ }
58820
+
58821
+ const entries = Object.entries,
58822
+ setPrototypeOf = Object.setPrototypeOf,
58823
+ isFrozen = Object.isFrozen,
58824
+ getPrototypeOf = Object.getPrototypeOf,
58825
+ getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
58826
+ let freeze = Object.freeze,
58827
+ seal = Object.seal,
58828
+ create = Object.create; // eslint-disable-line import/no-mutable-exports
58829
+ let _ref = typeof Reflect !== 'undefined' && Reflect,
58830
+ apply = _ref.apply,
58831
+ construct = _ref.construct;
58832
+ if (!freeze) {
58833
+ freeze = function freeze(x) {
58834
+ return x;
58835
+ };
58836
+ }
58837
+ if (!seal) {
58838
+ seal = function seal(x) {
58839
+ return x;
58840
+ };
58841
+ }
58842
+ if (!apply) {
58843
+ apply = function apply(func, thisArg) {
58844
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
58845
+ args[_key - 2] = arguments[_key];
58846
+ }
58847
+ return func.apply(thisArg, args);
58848
+ };
58849
+ }
58850
+ if (!construct) {
58851
+ construct = function construct(Func) {
58852
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
58853
+ args[_key2 - 1] = arguments[_key2];
58854
+ }
58855
+ return new Func(...args);
58856
+ };
58857
+ }
58858
+ const arrayForEach = unapply(Array.prototype.forEach);
58859
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
58860
+ const arrayPop = unapply(Array.prototype.pop);
58861
+ const arrayPush = unapply(Array.prototype.push);
58862
+ const arraySplice = unapply(Array.prototype.splice);
58863
+ const arrayIsArray = Array.isArray;
58864
+ const stringToLowerCase = unapply(String.prototype.toLowerCase);
58865
+ const stringToString = unapply(String.prototype.toString);
58866
+ const stringMatch = unapply(String.prototype.match);
58867
+ const stringReplace = unapply(String.prototype.replace);
58868
+ const stringIndexOf = unapply(String.prototype.indexOf);
58869
+ const stringTrim = unapply(String.prototype.trim);
58870
+ const numberToString = unapply(Number.prototype.toString);
58871
+ const booleanToString = unapply(Boolean.prototype.toString);
58872
+ const bigintToString = typeof BigInt === 'undefined' ? null : unapply(BigInt.prototype.toString);
58873
+ const symbolToString = typeof Symbol === 'undefined' ? null : unapply(Symbol.prototype.toString);
58874
+ const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
58875
+ const objectToString = unapply(Object.prototype.toString);
58876
+ const regExpTest = unapply(RegExp.prototype.test);
58877
+ const typeErrorCreate = unconstruct(TypeError);
58878
+ /**
58879
+ * Creates a new function that calls the given function with a specified thisArg and arguments.
58880
+ *
58881
+ * @param func - The function to be wrapped and called.
58882
+ * @returns A new function that calls the given function with a specified thisArg and arguments.
58883
+ */
58884
+ function unapply(func) {
58885
+ return function (thisArg) {
58886
+ if (thisArg instanceof RegExp) {
58887
+ thisArg.lastIndex = 0;
58888
+ }
58889
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
58890
+ args[_key3 - 1] = arguments[_key3];
58891
+ }
58892
+ return apply(func, thisArg, args);
58893
+ };
58894
+ }
58895
+ /**
58896
+ * Creates a new function that constructs an instance of the given constructor function with the provided arguments.
58897
+ *
58898
+ * @param func - The constructor function to be wrapped and called.
58899
+ * @returns A new function that constructs an instance of the given constructor function with the provided arguments.
58900
+ */
58901
+ function unconstruct(Func) {
58902
+ return function () {
58903
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
58904
+ args[_key4] = arguments[_key4];
58905
+ }
58906
+ return construct(Func, args);
58907
+ };
58908
+ }
58909
+ /**
58910
+ * Add properties to a lookup table
58911
+ *
58912
+ * @param set - The set to which elements will be added.
58913
+ * @param array - The array containing elements to be added to the set.
58914
+ * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
58915
+ * @returns The modified set with added elements.
58916
+ */
58917
+ function addToSet(set, array) {
58918
+ let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
58919
+ if (setPrototypeOf) {
58920
+ // Make 'in' and truthy checks like Boolean(set.constructor)
58921
+ // independent of any properties defined on Object.prototype.
58922
+ // Prevent prototype setters from intercepting set as a this value.
58923
+ setPrototypeOf(set, null);
58924
+ }
58925
+ if (!arrayIsArray(array)) {
58926
+ return set;
58927
+ }
58928
+ let l = array.length;
58929
+ while (l--) {
58930
+ let element = array[l];
58931
+ if (typeof element === 'string') {
58932
+ const lcElement = transformCaseFunc(element);
58933
+ if (lcElement !== element) {
58934
+ // Config presets (e.g. tags.js, attrs.js) are immutable.
58935
+ if (!isFrozen(array)) {
58936
+ array[l] = lcElement;
58937
+ }
58938
+ element = lcElement;
58939
+ }
58940
+ }
58941
+ set[element] = true;
58942
+ }
58943
+ return set;
58944
+ }
58945
+ /**
58946
+ * Clean up an array to harden against CSPP
58947
+ *
58948
+ * @param array - The array to be cleaned.
58949
+ * @returns The cleaned version of the array
58950
+ */
58951
+ function cleanArray(array) {
58952
+ for (let index = 0; index < array.length; index++) {
58953
+ const isPropertyExist = objectHasOwnProperty(array, index);
58954
+ if (!isPropertyExist) {
58955
+ array[index] = null;
58956
+ }
58957
+ }
58958
+ return array;
58959
+ }
58960
+ /**
58961
+ * Shallow clone an object
58962
+ *
58963
+ * @param object - The object to be cloned.
58964
+ * @returns A new object that copies the original.
58965
+ */
58966
+ function clone(object) {
58967
+ const newObject = create(null);
58968
+ for (const _ref2 of entries(object)) {
58969
+ var _ref3 = _slicedToArray(_ref2, 2);
58970
+ const property = _ref3[0];
58971
+ const value = _ref3[1];
58972
+ const isPropertyExist = objectHasOwnProperty(object, property);
58973
+ if (isPropertyExist) {
58974
+ if (arrayIsArray(value)) {
58975
+ newObject[property] = cleanArray(value);
58976
+ } else if (value && typeof value === 'object' && value.constructor === Object) {
58977
+ newObject[property] = clone(value);
58978
+ } else {
58979
+ newObject[property] = value;
58980
+ }
58981
+ }
58982
+ }
58983
+ return newObject;
58984
+ }
58985
+ /**
58986
+ * Convert non-node values into strings without depending on direct property access.
58987
+ *
58988
+ * @param value - The value to stringify.
58989
+ * @returns A string representation of the provided value.
58990
+ */
58991
+ function stringifyValue(value) {
58992
+ switch (typeof value) {
58993
+ case 'string':
58994
+ {
58995
+ return value;
58996
+ }
58997
+ case 'number':
58998
+ {
58999
+ return numberToString(value);
59000
+ }
59001
+ case 'boolean':
59002
+ {
59003
+ return booleanToString(value);
59004
+ }
59005
+ case 'bigint':
59006
+ {
59007
+ return bigintToString ? bigintToString(value) : '0';
59008
+ }
59009
+ case 'symbol':
59010
+ {
59011
+ return symbolToString ? symbolToString(value) : 'Symbol()';
59012
+ }
59013
+ case 'undefined':
59014
+ {
59015
+ return objectToString(value);
59016
+ }
59017
+ case 'function':
59018
+ case 'object':
59019
+ {
59020
+ if (value === null) {
59021
+ return objectToString(value);
59022
+ }
59023
+ const valueAsRecord = value;
59024
+ const valueToString = lookupGetter(valueAsRecord, 'toString');
59025
+ if (typeof valueToString === 'function') {
59026
+ const stringified = valueToString(valueAsRecord);
59027
+ return typeof stringified === 'string' ? stringified : objectToString(stringified);
59028
+ }
59029
+ return objectToString(value);
59030
+ }
59031
+ default:
59032
+ {
59033
+ return objectToString(value);
59034
+ }
59035
+ }
59036
+ }
59037
+ /**
59038
+ * This method automatically checks if the prop is function or getter and behaves accordingly.
59039
+ *
59040
+ * @param object - The object to look up the getter function in its prototype chain.
59041
+ * @param prop - The property name for which to find the getter function.
59042
+ * @returns The getter function found in the prototype chain or a fallback function.
59043
+ */
59044
+ function lookupGetter(object, prop) {
59045
+ while (object !== null) {
59046
+ const desc = getOwnPropertyDescriptor(object, prop);
59047
+ if (desc) {
59048
+ if (desc.get) {
59049
+ return unapply(desc.get);
59050
+ }
59051
+ if (typeof desc.value === 'function') {
59052
+ return unapply(desc.value);
59053
+ }
59054
+ }
59055
+ object = getPrototypeOf(object);
59056
+ }
59057
+ function fallbackValue() {
59058
+ return null;
59059
+ }
59060
+ return fallbackValue;
59061
+ }
59062
+ function isRegex(value) {
59063
+ try {
59064
+ regExpTest(value, '');
59065
+ return true;
59066
+ } catch (_unused) {
59067
+ return false;
59068
+ }
59069
+ }
59070
+
59071
+ const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
59072
+ const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
59073
+ const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
59074
+ // List of SVG elements that are disallowed by default.
59075
+ // We still need to know them so that we can do namespace
59076
+ // checks properly in case one wants to add them to
59077
+ // allow-list.
59078
+ const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
59079
+ const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
59080
+ // Similarly to SVG, we want to know all MathML elements,
59081
+ // even those that we disallow by default.
59082
+ const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
59083
+ const text = freeze(['#text']);
59084
+
59085
+ const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'command', 'commandfor', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns']);
59086
+ const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dominant-baseline', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-orientation', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
59087
+ const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnalign', 'columnlines', 'columnspacing', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lquote', 'lspace', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
59088
+ const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
59089
+
59090
+ const MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
59091
+ const ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
59092
+ const TMPLIT_EXPR = seal(/\${[\w\W]*/g);
59093
+ const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
59094
+ const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
59095
+ const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
59096
+ );
59097
+ const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
59098
+ const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
59099
+ );
59100
+ const DOCTYPE_NAME = seal(/^html$/i);
59101
+ const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
59102
+ // Markup-significant character probes used by _sanitizeElements.
59103
+ // Shared module-level instances are safe despite the sticky /g flags:
59104
+ // unapply() resets lastIndex for RegExp receivers before every call.
59105
+ const ELEMENT_MARKUP_PROBE = seal(/<[/\w!]/g);
59106
+ const COMMENT_MARKUP_PROBE = seal(/<[/\w]/g);
59107
+ const FALLBACK_TAG_CLOSE = seal(/<\/no(script|embed|frames)/i);
59108
+ const SELF_CLOSING_TAG = seal(/\/>/i);
59109
+
59110
+ // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
59111
+ const NODE_TYPE = {
59112
+ element: 1,
59113
+ attribute: 2,
59114
+ text: 3,
59115
+ cdataSection: 4,
59116
+ entityReference: 5,
59117
+ // Deprecated
59118
+ entityNode: 6,
59119
+ // Deprecated
59120
+ processingInstruction: 7,
59121
+ comment: 8,
59122
+ document: 9,
59123
+ documentType: 10,
59124
+ documentFragment: 11,
59125
+ notation: 12 // Deprecated
59126
+ };
59127
+ const getGlobal = function getGlobal() {
59128
+ return typeof window === 'undefined' ? null : window;
59129
+ };
59130
+ /**
59131
+ * Creates a no-op policy for internal use only.
59132
+ * Don't export this function outside this module!
59133
+ * @param trustedTypes The policy factory.
59134
+ * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
59135
+ * @return The policy created (or null, if Trusted Types
59136
+ * are not supported or creating the policy failed).
59137
+ */
59138
+ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
59139
+ if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
59140
+ return null;
59141
+ }
59142
+ // Allow the callers to control the unique policy name
59143
+ // by adding a data-tt-policy-suffix to the script element with the DOMPurify.
59144
+ // Policy creation with duplicate names throws in Trusted Types.
59145
+ let suffix = null;
59146
+ const ATTR_NAME = 'data-tt-policy-suffix';
59147
+ if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
59148
+ suffix = purifyHostElement.getAttribute(ATTR_NAME);
59149
+ }
59150
+ const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
59151
+ try {
59152
+ return trustedTypes.createPolicy(policyName, {
59153
+ createHTML(html) {
59154
+ return html;
59155
+ },
59156
+ createScriptURL(scriptUrl) {
59157
+ return scriptUrl;
59158
+ }
59159
+ });
59160
+ } catch (_) {
59161
+ // Policy creation failed (most likely another DOMPurify script has
59162
+ // already run). Skip creating the policy, as this will only cause errors
59163
+ // if TT are enforced.
59164
+ console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
59165
+ return null;
59166
+ }
59167
+ };
59168
+ const _createHooksMap = function _createHooksMap() {
59169
+ return {
59170
+ afterSanitizeAttributes: [],
59171
+ afterSanitizeElements: [],
59172
+ afterSanitizeShadowDOM: [],
59173
+ beforeSanitizeAttributes: [],
59174
+ beforeSanitizeElements: [],
59175
+ beforeSanitizeShadowDOM: [],
59176
+ uponSanitizeAttribute: [],
59177
+ uponSanitizeElement: [],
59178
+ uponSanitizeShadowNode: []
59179
+ };
59180
+ };
59181
+ /**
59182
+ * Resolve a set-valued configuration option: a fresh set built from
59183
+ * cfg[key] when it is an own array property (seeded with a clone of
59184
+ * options.base when given, case-normalized via options.transform),
59185
+ * the fallback set otherwise.
59186
+ *
59187
+ * @param cfg the cloned, prototype-free configuration object
59188
+ * @param key the configuration property to read
59189
+ * @param fallback the set to use when the option is absent or not an array
59190
+ * @param options transform and optional base set to merge into
59191
+ * @returns the resolved set
59192
+ */
59193
+ const _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {
59194
+ return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;
59195
+ };
59196
+ function createDOMPurify() {
59197
+ let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
59198
+ const DOMPurify = root => createDOMPurify(root);
59199
+ DOMPurify.version = '3.4.13';
59200
+ DOMPurify.removed = [];
59201
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
59202
+ // Not running in a browser, provide a factory function
59203
+ // so that you can pass your own Window
59204
+ DOMPurify.isSupported = false;
59205
+ return DOMPurify;
59206
+ }
59207
+ let document = window.document;
59208
+ const originalDocument = document;
59209
+ const currentScript = originalDocument.currentScript;
59210
+ window.DocumentFragment;
59211
+ const HTMLTemplateElement = window.HTMLTemplateElement,
59212
+ Node = window.Node,
59213
+ Element = window.Element,
59214
+ NodeFilter = window.NodeFilter,
59215
+ _window$NamedNodeMap = window.NamedNodeMap;
59216
+ _window$NamedNodeMap === void 0 ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap;
59217
+ window.HTMLFormElement;
59218
+ const DOMParser = window.DOMParser,
59219
+ trustedTypes = window.trustedTypes;
59220
+ const ElementPrototype = Element.prototype;
59221
+ const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
59222
+ const remove = lookupGetter(ElementPrototype, 'remove');
59223
+ const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
59224
+ const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
59225
+ const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
59226
+ const getShadowRoot = lookupGetter(ElementPrototype, 'shadowRoot');
59227
+ const getAttributes = lookupGetter(ElementPrototype, 'attributes');
59228
+ const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeType') : null;
59229
+ const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeName') : null;
59230
+ const getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, 'ownerDocument') : null;
59231
+ // As per issue #47, the web-components registry is inherited by a
59232
+ // new document created via createHTMLDocument. As per the spec
59233
+ // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
59234
+ // a new empty registry is used when creating a template contents owner
59235
+ // document, so we use that as our parent document to ensure nothing
59236
+ // is inherited.
59237
+ if (typeof HTMLTemplateElement === 'function') {
59238
+ const template = document.createElement('template');
59239
+ if (template.content && template.content.ownerDocument) {
59240
+ document = template.content.ownerDocument;
59241
+ }
59242
+ }
59243
+ let trustedTypesPolicy;
59244
+ let emptyHTML = '';
59245
+ // The instance's own internal Trusted Types policy. Unlike a caller-supplied
59246
+ // `TRUSTED_TYPES_POLICY`, this is created at most once — Trusted Types throws
59247
+ // on duplicate policy names — and is the only policy allowed to persist
59248
+ // across configurations and survive `clearConfig()`.
59249
+ let defaultTrustedTypesPolicy;
59250
+ let defaultTrustedTypesPolicyResolved = false;
59251
+ // Tracks whether we are already inside a call to the configured Trusted Types
59252
+ // policy (`createHTML` or `createScriptURL`). If a supplied policy callback
59253
+ // itself calls `DOMPurify.sanitize` (the cause of #1422), `sanitize` would
59254
+ // re-enter the policy and recurse until the stack overflows. We detect that
59255
+ // re-entry and throw a clear, actionable error instead. The guard is shared
59256
+ // across both callbacks, because either one re-entering `sanitize` triggers
59257
+ // the same unbounded recursion.
59258
+ let IN_TRUSTED_TYPES_POLICY = 0;
59259
+ const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {
59260
+ if (IN_TRUSTED_TYPES_POLICY > 0) {
59261
+ throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or ' + 'createScriptURL) must not call DOMPurify.sanitize, as that causes ' + 'infinite recursion. Do not pass a policy whose callbacks wrap ' + 'DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted ' + 'Types" section of the README.');
59262
+ }
59263
+ };
59264
+ const _createTrustedHTML = function _createTrustedHTML(html) {
59265
+ _assertNotInTrustedTypesPolicy();
59266
+ IN_TRUSTED_TYPES_POLICY++;
59267
+ try {
59268
+ return trustedTypesPolicy.createHTML(html);
59269
+ } finally {
59270
+ IN_TRUSTED_TYPES_POLICY--;
59271
+ }
59272
+ };
59273
+ const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {
59274
+ _assertNotInTrustedTypesPolicy();
59275
+ IN_TRUSTED_TYPES_POLICY++;
59276
+ try {
59277
+ return trustedTypesPolicy.createScriptURL(scriptUrl);
59278
+ } finally {
59279
+ IN_TRUSTED_TYPES_POLICY--;
59280
+ }
59281
+ };
59282
+ // Lazily resolve (and cache) the instance's internal default policy.
59283
+ // Resolution is attempted at most once: a successful `createPolicy` cannot be
59284
+ // repeated (Trusted Types throws on duplicate names), and a failed or
59285
+ // unsupported attempt must not be retried on every parse.
59286
+ const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {
59287
+ if (!defaultTrustedTypesPolicyResolved) {
59288
+ defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
59289
+ defaultTrustedTypesPolicyResolved = true;
59290
+ }
59291
+ return defaultTrustedTypesPolicy;
59292
+ };
59293
+ const _document = document,
59294
+ implementation = _document.implementation,
59295
+ createNodeIterator = _document.createNodeIterator,
59296
+ createDocumentFragment = _document.createDocumentFragment,
59297
+ getElementsByTagName = _document.getElementsByTagName;
59298
+ const importNode = originalDocument.importNode;
59299
+ let hooks = _createHooksMap();
59300
+ /**
59301
+ * Expose whether this browser supports running the full DOMPurify.
59302
+ */
59303
+ DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
59304
+ const MUSTACHE_EXPR$1 = MUSTACHE_EXPR,
59305
+ ERB_EXPR$1 = ERB_EXPR,
59306
+ TMPLIT_EXPR$1 = TMPLIT_EXPR,
59307
+ DATA_ATTR$1 = DATA_ATTR,
59308
+ ARIA_ATTR$1 = ARIA_ATTR,
59309
+ IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA,
59310
+ ATTR_WHITESPACE$1 = ATTR_WHITESPACE,
59311
+ CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;
59312
+ let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
59313
+ /**
59314
+ * We consider the elements and attributes below to be safe. Ideally
59315
+ * don't add any new ones but feel free to remove unwanted ones.
59316
+ */
59317
+ /* allowed element names */
59318
+ let ALLOWED_TAGS = null;
59319
+ const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
59320
+ /* Allowed attribute names */
59321
+ let ALLOWED_ATTR = null;
59322
+ const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
59323
+ /*
59324
+ * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
59325
+ * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
59326
+ * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
59327
+ * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
59328
+ */
59329
+ let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
59330
+ tagNameCheck: {
59331
+ writable: true,
59332
+ configurable: false,
59333
+ enumerable: true,
59334
+ value: null
59335
+ },
59336
+ attributeNameCheck: {
59337
+ writable: true,
59338
+ configurable: false,
59339
+ enumerable: true,
59340
+ value: null
59341
+ },
59342
+ allowCustomizedBuiltInElements: {
59343
+ writable: true,
59344
+ configurable: false,
59345
+ enumerable: true,
59346
+ value: false
59347
+ }
59348
+ }));
59349
+ /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
59350
+ let FORBID_TAGS = null;
59351
+ /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
59352
+ let FORBID_ATTR = null;
59353
+ /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */
59354
+ const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
59355
+ tagCheck: {
59356
+ writable: true,
59357
+ configurable: false,
59358
+ enumerable: true,
59359
+ value: null
59360
+ },
59361
+ attributeCheck: {
59362
+ writable: true,
59363
+ configurable: false,
59364
+ enumerable: true,
59365
+ value: null
59366
+ }
59367
+ }));
59368
+ /* Decide if ARIA attributes are okay */
59369
+ let ALLOW_ARIA_ATTR = true;
59370
+ /* Decide if custom data attributes are okay */
59371
+ let ALLOW_DATA_ATTR = true;
59372
+ /* Decide if unknown protocols are okay */
59373
+ let ALLOW_UNKNOWN_PROTOCOLS = false;
59374
+ /* Decide if self-closing tags in attributes are allowed.
59375
+ * Usually removed due to a mXSS issue in jQuery 3.0 */
59376
+ let ALLOW_SELF_CLOSE_IN_ATTR = true;
59377
+ /* Output should be safe for common template engines.
59378
+ * This means, DOMPurify removes data attributes, mustaches and ERB
59379
+ */
59380
+ let SAFE_FOR_TEMPLATES = false;
59381
+ /* Output should be safe even for XML used within HTML and alike.
59382
+ * This means, DOMPurify removes comments when containing risky content.
59383
+ */
59384
+ let SAFE_FOR_XML = true;
59385
+ /* Decide if document with <html>... should be returned */
59386
+ let WHOLE_DOCUMENT = false;
59387
+ /* Track whether config is already set on this instance of DOMPurify. */
59388
+ let SET_CONFIG = false;
59389
+ /* Pristine allowlist bindings captured at setConfig() time. On the
59390
+ * persistent-config path sanitize() restores the sets from these before
59391
+ * the per-walk hook clone-guard, so a hook's in-call widening cannot
59392
+ * carry across calls. Null until setConfig() is called; reset by
59393
+ * clearConfig(). */
59394
+ let SET_CONFIG_ALLOWED_TAGS = null;
59395
+ let SET_CONFIG_ALLOWED_ATTR = null;
59396
+ /* Decide if all elements (e.g. style, script) must be children of
59397
+ * document.body. By default, browsers might move them to document.head */
59398
+ let FORCE_BODY = false;
59399
+ /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
59400
+ * string (or a TrustedHTML object if Trusted Types are supported).
59401
+ * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
59402
+ */
59403
+ let RETURN_DOM = false;
59404
+ /* Decide if a DOM `DocumentFragment` should be returned, instead of a html
59405
+ * string (or a TrustedHTML object if Trusted Types are supported) */
59406
+ let RETURN_DOM_FRAGMENT = false;
59407
+ /* Try to return a Trusted Type object instead of a string, return a string in
59408
+ * case Trusted Types are not supported */
59409
+ let RETURN_TRUSTED_TYPE = false;
59410
+ /* Output should be free from DOM clobbering attacks?
59411
+ * This sanitizes markups named with colliding, clobberable built-in DOM APIs.
59412
+ */
59413
+ let SANITIZE_DOM = true;
59414
+ /* Achieve full DOM Clobbering protection by isolating the namespace of named
59415
+ * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
59416
+ *
59417
+ * HTML/DOM spec rules that enable DOM Clobbering:
59418
+ * - Named Access on Window (§7.3.3)
59419
+ * - DOM Tree Accessors (§3.1.5)
59420
+ * - Form Element Parent-Child Relations (§4.10.3)
59421
+ * - Iframe srcdoc / Nested WindowProxies (§4.8.5)
59422
+ * - HTMLCollection (§4.2.10.2)
59423
+ *
59424
+ * Namespace isolation is implemented by prefixing `id` and `name` attributes
59425
+ * with a constant string, i.e., `user-content-`
59426
+ */
59427
+ let SANITIZE_NAMED_PROPS = false;
59428
+ const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
59429
+ /* Keep element content when removing element? */
59430
+ let KEEP_CONTENT = true;
59431
+ /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
59432
+ * of importing it into a new Document and returning a sanitized copy */
59433
+ let IN_PLACE = false;
59434
+ /* Allow usage of profiles like html, svg and mathMl */
59435
+ let USE_PROFILES = {};
59436
+ /* Tags to ignore content of when KEEP_CONTENT is true */
59437
+ let FORBID_CONTENTS = null;
59438
+ const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',
59439
+ // <selectedcontent> mirrors the selected <option>'s subtree, cloned by
59440
+ // the UA (customizable <select>) — including any on* handlers — and the
59441
+ // engine re-mirrors synchronously whenever a removal changes which
59442
+ // option/selectedcontent is current, even inside DOMPurify's inert
59443
+ // DOMParser document. Hoisting its children on removal re-inserts a fresh
59444
+ // mirror target ahead of the walk, which the engine refills, looping
59445
+ // forever (DoS) and amplifying output. Dropping its content on removal
59446
+ // (rather than hoisting) breaks that cascade; the content is a duplicate
59447
+ // of the option, which is sanitized on its own. See campaign-3 F1/F6.
59448
+ 'selectedcontent', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
59449
+ /* Tags that are safe for data: URIs */
59450
+ let DATA_URI_TAGS = null;
59451
+ const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
59452
+ /* Attributes safe for values like "javascript:" */
59453
+ let URI_SAFE_ATTRIBUTES = null;
59454
+ const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
59455
+ const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
59456
+ const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
59457
+ const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
59458
+ /* Document namespace */
59459
+ let NAMESPACE = HTML_NAMESPACE;
59460
+ let IS_EMPTY_INPUT = false;
59461
+ /* Allowed XHTML+XML namespaces */
59462
+ let ALLOWED_NAMESPACES = null;
59463
+ const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
59464
+ const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(['mi', 'mo', 'mn', 'ms', 'mtext']);
59465
+ let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);
59466
+ const DEFAULT_HTML_INTEGRATION_POINTS = freeze(['annotation-xml']);
59467
+ let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);
59468
+ // Certain elements are allowed in both SVG and HTML
59469
+ // namespace. We need to specify them explicitly
59470
+ // so that they don't get erroneously deleted from
59471
+ // HTML namespace.
59472
+ const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
59473
+ /* Parsing of strict XHTML documents */
59474
+ let PARSER_MEDIA_TYPE = null;
59475
+ const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
59476
+ const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
59477
+ let transformCaseFunc = null;
59478
+ /* Keep a reference to config to pass to hooks */
59479
+ let CONFIG = null;
59480
+ /* Ideally, do not touch anything below this line */
59481
+ /* ______________________________________________ */
59482
+ const formElement = document.createElement('form');
59483
+ const isRegexOrFunction = function isRegexOrFunction(testValue) {
59484
+ return testValue instanceof RegExp || testValue instanceof Function;
59485
+ };
59486
+ /**
59487
+ * _parseConfig
59488
+ *
59489
+ * @param cfg optional config literal
59490
+ */
59491
+ // eslint-disable-next-line complexity
59492
+ const _parseConfig = function _parseConfig() {
59493
+ let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
59494
+ if (CONFIG && CONFIG === cfg) {
59495
+ return;
59496
+ }
59497
+ /* Shield configuration object from tampering */
59498
+ if (!cfg || typeof cfg !== 'object') {
59499
+ cfg = {};
59500
+ }
59501
+ /* Shield configuration object from prototype pollution */
59502
+ cfg = clone(cfg);
59503
+ PARSER_MEDIA_TYPE =
59504
+ // eslint-disable-next-line unicorn/prefer-includes
59505
+ SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
59506
+ // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
59507
+ transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
59508
+ /* Set configuration parameters */
59509
+ ALLOWED_TAGS = _resolveSetOption(cfg, 'ALLOWED_TAGS', DEFAULT_ALLOWED_TAGS, {
59510
+ transform: transformCaseFunc
59511
+ });
59512
+ ALLOWED_ATTR = _resolveSetOption(cfg, 'ALLOWED_ATTR', DEFAULT_ALLOWED_ATTR, {
59513
+ transform: transformCaseFunc
59514
+ });
59515
+ ALLOWED_NAMESPACES = _resolveSetOption(cfg, 'ALLOWED_NAMESPACES', DEFAULT_ALLOWED_NAMESPACES, {
59516
+ transform: stringToString
59517
+ });
59518
+ URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, 'ADD_URI_SAFE_ATTR', DEFAULT_URI_SAFE_ATTRIBUTES, {
59519
+ transform: transformCaseFunc,
59520
+ base: DEFAULT_URI_SAFE_ATTRIBUTES
59521
+ });
59522
+ DATA_URI_TAGS = _resolveSetOption(cfg, 'ADD_DATA_URI_TAGS', DEFAULT_DATA_URI_TAGS, {
59523
+ transform: transformCaseFunc,
59524
+ base: DEFAULT_DATA_URI_TAGS
59525
+ });
59526
+ FORBID_CONTENTS = _resolveSetOption(cfg, 'FORBID_CONTENTS', DEFAULT_FORBID_CONTENTS, {
59527
+ transform: transformCaseFunc
59528
+ });
59529
+ FORBID_TAGS = _resolveSetOption(cfg, 'FORBID_TAGS', clone({}), {
59530
+ transform: transformCaseFunc
59531
+ });
59532
+ FORBID_ATTR = _resolveSetOption(cfg, 'FORBID_ATTR', clone({}), {
59533
+ transform: transformCaseFunc
59534
+ });
59535
+ USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === 'object' ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
59536
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
59537
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
59538
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
59539
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
59540
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
59541
+ SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
59542
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
59543
+ RETURN_DOM = cfg.RETURN_DOM || false; // Default false
59544
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
59545
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
59546
+ FORCE_BODY = cfg.FORCE_BODY || false; // Default false
59547
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
59548
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
59549
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
59550
+ IN_PLACE = cfg.IN_PLACE || false; // Default false
59551
+ IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; // Default regexp
59552
+ NAMESPACE = typeof cfg.NAMESPACE === 'string' ? cfg.NAMESPACE : HTML_NAMESPACE; // Default HTML namespace
59553
+ MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'MATHML_TEXT_INTEGRATION_POINTS') && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === 'object' ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS); // Default built-in map
59554
+ HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS); // Default built-in map
59555
+ const customElementHandling = objectHasOwnProperty(cfg, 'CUSTOM_ELEMENT_HANDLING') && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === 'object' ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);
59556
+ CUSTOM_ELEMENT_HANDLING = create(null);
59557
+ if (objectHasOwnProperty(customElementHandling, 'tagNameCheck') && isRegexOrFunction(customElementHandling.tagNameCheck)) {
59558
+ CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck; // Default undefined
59559
+ }
59560
+ if (objectHasOwnProperty(customElementHandling, 'attributeNameCheck') && isRegexOrFunction(customElementHandling.attributeNameCheck)) {
59561
+ CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck; // Default undefined
59562
+ }
59563
+ if (objectHasOwnProperty(customElementHandling, 'allowCustomizedBuiltInElements') && typeof customElementHandling.allowCustomizedBuiltInElements === 'boolean') {
59564
+ CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; // Default undefined
59565
+ }
59566
+ seal(CUSTOM_ELEMENT_HANDLING);
59567
+ if (SAFE_FOR_TEMPLATES) {
59568
+ ALLOW_DATA_ATTR = false;
59569
+ }
59570
+ if (RETURN_DOM_FRAGMENT) {
59571
+ RETURN_DOM = true;
59572
+ }
59573
+ /* Parse profile info */
59574
+ if (USE_PROFILES) {
59575
+ ALLOWED_TAGS = addToSet({}, text);
59576
+ ALLOWED_ATTR = create(null);
59577
+ if (USE_PROFILES.html === true) {
59578
+ addToSet(ALLOWED_TAGS, html$1);
59579
+ addToSet(ALLOWED_ATTR, html);
59580
+ }
59581
+ if (USE_PROFILES.svg === true) {
59582
+ addToSet(ALLOWED_TAGS, svg$1);
59583
+ addToSet(ALLOWED_ATTR, svg);
59584
+ addToSet(ALLOWED_ATTR, xml);
59585
+ }
59586
+ if (USE_PROFILES.svgFilters === true) {
59587
+ addToSet(ALLOWED_TAGS, svgFilters);
59588
+ addToSet(ALLOWED_ATTR, svg);
59589
+ addToSet(ALLOWED_ATTR, xml);
59590
+ }
59591
+ if (USE_PROFILES.mathMl === true) {
59592
+ addToSet(ALLOWED_TAGS, mathMl$1);
59593
+ addToSet(ALLOWED_ATTR, mathMl);
59594
+ addToSet(ALLOWED_ATTR, xml);
59595
+ }
59596
+ }
59597
+ /* Always reset function-based ADD_TAGS / ADD_ATTR checks to prevent
59598
+ * leaking across calls when switching from function to array config */
59599
+ EXTRA_ELEMENT_HANDLING.tagCheck = null;
59600
+ EXTRA_ELEMENT_HANDLING.attributeCheck = null;
59601
+ /* Merge configuration parameters */
59602
+ if (objectHasOwnProperty(cfg, 'ADD_TAGS')) {
59603
+ if (typeof cfg.ADD_TAGS === 'function') {
59604
+ EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
59605
+ } else if (arrayIsArray(cfg.ADD_TAGS)) {
59606
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
59607
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
59608
+ }
59609
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
59610
+ }
59611
+ }
59612
+ if (objectHasOwnProperty(cfg, 'ADD_ATTR')) {
59613
+ if (typeof cfg.ADD_ATTR === 'function') {
59614
+ EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
59615
+ } else if (arrayIsArray(cfg.ADD_ATTR)) {
59616
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
59617
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
59618
+ }
59619
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
59620
+ }
59621
+ }
59622
+ if (objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') && arrayIsArray(cfg.ADD_URI_SAFE_ATTR)) {
59623
+ addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
59624
+ }
59625
+ if (objectHasOwnProperty(cfg, 'FORBID_CONTENTS') && arrayIsArray(cfg.FORBID_CONTENTS)) {
59626
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
59627
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
59628
+ }
59629
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
59630
+ }
59631
+ if (objectHasOwnProperty(cfg, 'ADD_FORBID_CONTENTS') && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
59632
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
59633
+ FORBID_CONTENTS = clone(FORBID_CONTENTS);
59634
+ }
59635
+ addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
59636
+ }
59637
+ /* Add #text in case KEEP_CONTENT is set to true */
59638
+ if (KEEP_CONTENT) {
59639
+ ALLOWED_TAGS['#text'] = true;
59640
+ }
59641
+ /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
59642
+ if (WHOLE_DOCUMENT) {
59643
+ addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
59644
+ }
59645
+ /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
59646
+ if (ALLOWED_TAGS.table) {
59647
+ addToSet(ALLOWED_TAGS, ['tbody']);
59648
+ delete FORBID_TAGS.tbody;
59649
+ }
59650
+ // Re-derive the active Trusted Types policy from this configuration on
59651
+ // every parse. The active policy must never be sticky closure state that
59652
+ // outlives the config that set it: a caller-supplied policy left in place
59653
+ // after `clearConfig()` — or after a later call that supplied none, or
59654
+ // `TRUSTED_TYPES_POLICY: null` — could sign a subsequent "default"
59655
+ // `RETURN_TRUSTED_TYPE` result with a foreign, possibly unsafe policy.
59656
+ // See GHSA-vxr8-fq34-vvx9.
59657
+ if (cfg.TRUSTED_TYPES_POLICY) {
59658
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
59659
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
59660
+ }
59661
+ if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
59662
+ throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
59663
+ }
59664
+ // A caller-supplied policy applies to this configuration only.
59665
+ const previousTrustedTypesPolicy = trustedTypesPolicy;
59666
+ trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
59667
+ // Sign local variables required by `sanitize`. If the supplied policy's
59668
+ // `createHTML` is circular (i.e. it calls `DOMPurify.sanitize`), this
59669
+ // throws via the re-entrancy guard. Restore the previous policy first so
59670
+ // the instance is not left in a poisoned state. See #1422.
59671
+ try {
59672
+ emptyHTML = _createTrustedHTML('');
59673
+ } catch (error) {
59674
+ trustedTypesPolicy = previousTrustedTypesPolicy;
59675
+ throw error;
59676
+ }
59677
+ } else if (cfg.TRUSTED_TYPES_POLICY === null) {
59678
+ // Explicit opt-out for this call: perform no Trusted Types signing and
59679
+ // create nothing (so a strict `trusted-types` CSP that disallows a
59680
+ // `dompurify` policy can still call `sanitize` from inside its own
59681
+ // policy — see #1422). Resetting to `undefined` rather than a sticky
59682
+ // `null` also drops any previously retained caller policy, so it cannot
59683
+ // resurface on a later call, while still allowing the next config-less
59684
+ // call to restore the internal default policy. See GHSA-vxr8-fq34-vvx9.
59685
+ trustedTypesPolicy = undefined;
59686
+ emptyHTML = '';
59687
+ } else {
59688
+ // No policy supplied: keep the currently active policy if one is set — a
59689
+ // previously supplied policy is intentionally sticky across config-less
59690
+ // calls — otherwise fall back to the instance's own internal policy,
59691
+ // created at most once. (A policy supplied for a *single* call still
59692
+ // lingers by design; what must not linger is a policy whose configuration
59693
+ // has been torn down via `clearConfig()`, which restores the default.)
59694
+ if (trustedTypesPolicy === undefined) {
59695
+ trustedTypesPolicy = _getDefaultTrustedTypesPolicy();
59696
+ }
59697
+ // Sign internal variables only when a policy is active. A falsy policy
59698
+ // (Trusted Types unsupported, creation failed, or an explicit opt-out)
59699
+ // leaves `emptyHTML` as a plain string, so we never call `.createHTML` on
59700
+ // a non-policy and throw. See #1422.
59701
+ if (trustedTypesPolicy && typeof emptyHTML === 'string') {
59702
+ emptyHTML = _createTrustedHTML('');
59703
+ }
59704
+ }
59705
+ // Prevent further manipulation of configuration.
59706
+ // Not available in IE8, Safari 5, etc.
59707
+ if (freeze) {
59708
+ freeze(cfg);
59709
+ }
59710
+ CONFIG = cfg;
59711
+ };
59712
+ /* Keep track of all possible SVG and MathML tags
59713
+ * so that we can perform the namespace checks
59714
+ * correctly. */
59715
+ const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
59716
+ const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
59717
+ /**
59718
+ * Namespace rules for an element in the SVG namespace.
59719
+ *
59720
+ * @param tagName the element's lowercase tag name
59721
+ * @param parent the (possibly simulated) parent node
59722
+ * @param parentTagName the parent's lowercase tag name
59723
+ * @returns true if a spec-compliant parser could produce this element
59724
+ */
59725
+ const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {
59726
+ // The only way to switch from HTML namespace to SVG
59727
+ // is via <svg>. If it happens via any other tag, then
59728
+ // it should be killed.
59729
+ if (parent.namespaceURI === HTML_NAMESPACE) {
59730
+ return tagName === 'svg';
59731
+ }
59732
+ // The only way to switch from MathML to SVG is via <svg>
59733
+ // if the parent is either <annotation-xml> or a MathML
59734
+ // text integration point.
59735
+ if (parent.namespaceURI === MATHML_NAMESPACE) {
59736
+ return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
59737
+ }
59738
+ // We only allow elements that are defined in SVG
59739
+ // spec. All others are disallowed in SVG namespace.
59740
+ return Boolean(ALL_SVG_TAGS[tagName]);
59741
+ };
59742
+ /**
59743
+ * Namespace rules for an element in the MathML namespace.
59744
+ *
59745
+ * @param tagName the element's lowercase tag name
59746
+ * @param parent the (possibly simulated) parent node
59747
+ * @param parentTagName the parent's lowercase tag name
59748
+ * @returns true if a spec-compliant parser could produce this element
59749
+ */
59750
+ const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {
59751
+ // The only way to switch from HTML namespace to MathML
59752
+ // is via <math>. If it happens via any other tag, then
59753
+ // it should be killed.
59754
+ if (parent.namespaceURI === HTML_NAMESPACE) {
59755
+ return tagName === 'math';
59756
+ }
59757
+ // The only way to switch from SVG to MathML is via
59758
+ // <math> and HTML integration points
59759
+ if (parent.namespaceURI === SVG_NAMESPACE) {
59760
+ return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
59761
+ }
59762
+ // We only allow elements that are defined in MathML
59763
+ // spec. All others are disallowed in MathML namespace.
59764
+ return Boolean(ALL_MATHML_TAGS[tagName]);
59765
+ };
59766
+ /**
59767
+ * Namespace rules for an element in the HTML namespace.
59768
+ *
59769
+ * @param tagName the element's lowercase tag name
59770
+ * @param parent the (possibly simulated) parent node
59771
+ * @param parentTagName the parent's lowercase tag name
59772
+ * @returns true if a spec-compliant parser could produce this element
59773
+ */
59774
+ const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {
59775
+ // The only way to switch from SVG to HTML is via
59776
+ // HTML integration points, and from MathML to HTML
59777
+ // is via MathML text integration points
59778
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
59779
+ return false;
59780
+ }
59781
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
59782
+ return false;
59783
+ }
59784
+ // We disallow tags that are specific for MathML
59785
+ // or SVG and should never appear in HTML namespace
59786
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
59787
+ };
59788
+ /**
59789
+ * @param element a DOM element whose namespace is being checked
59790
+ * @returns Return false if the element has a
59791
+ * namespace that a spec-compliant parser would never
59792
+ * return. Return true otherwise.
59793
+ */
59794
+ const _checkValidNamespace = function _checkValidNamespace(element) {
59795
+ let parent = getParentNode(element);
59796
+ // In JSDOM, if we're inside shadow DOM, then parentNode
59797
+ // can be null. We just simulate parent in this case.
59798
+ if (!parent || !parent.tagName) {
59799
+ parent = {
59800
+ namespaceURI: NAMESPACE,
59801
+ tagName: 'template'
59802
+ };
59803
+ }
59804
+ const tagName = stringToLowerCase(element.tagName);
59805
+ const parentTagName = stringToLowerCase(parent.tagName);
59806
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
59807
+ return false;
59808
+ }
59809
+ if (element.namespaceURI === SVG_NAMESPACE) {
59810
+ return _checkSvgNamespace(tagName, parent, parentTagName);
59811
+ }
59812
+ if (element.namespaceURI === MATHML_NAMESPACE) {
59813
+ return _checkMathMlNamespace(tagName, parent, parentTagName);
59814
+ }
59815
+ if (element.namespaceURI === HTML_NAMESPACE) {
59816
+ return _checkHtmlNamespace(tagName, parent, parentTagName);
59817
+ }
59818
+ // For XHTML and XML documents that support custom namespaces
59819
+ if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
59820
+ return true;
59821
+ }
59822
+ // The code should never reach this place (this means
59823
+ // that the element somehow got namespace that is not
59824
+ // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
59825
+ // Return false just in case.
59826
+ return false;
59827
+ };
59828
+ /**
59829
+ * _forceRemove
59830
+ *
59831
+ * @param node a DOM node
59832
+ */
59833
+ const _forceRemove = function _forceRemove(node) {
59834
+ arrayPush(DOMPurify.removed, {
59835
+ element: node
59836
+ });
59837
+ try {
59838
+ // eslint-disable-next-line unicorn/prefer-dom-node-remove
59839
+ getParentNode(node).removeChild(node);
59840
+ } catch (_) {
59841
+ /* The normal detach failed — this is reached for a parentless node
59842
+ (getParentNode() is null, so .removeChild throws). Element.prototype
59843
+ .remove() is itself a spec no-op on a parentless node, so a recorded
59844
+ "removal" would otherwise hand the caller back an intact,
59845
+ payload-bearing node (e.g. a detached IN_PLACE root the mXSS canary or
59846
+ the style-with-element-child rule decided to kill). Fail closed by
59847
+ throwing — exactly as a clobbered root does at the IN_PLACE entry —
59848
+ rather than trying to "neutralize" the node via its own methods.
59849
+ Neutralizing would mean calling getAttributeNames()/removeAttribute()
59850
+ on the node, both of which a <form> root can clobber via a named child
59851
+ (and _isClobbered does not even probe getAttributeNames), so the
59852
+ neutralize step could itself be silently defeated, leaving the payload
59853
+ intact. A throw touches only the cached, clobber-safe remove() and
59854
+ getParentNode(). Generalizes GHSA-r47g-fvhr-h676 (clobbered-form root)
59855
+ to every root-kill reason. REPORT-3.
59856
+ This lives inside the catch, so it never fires for a normally-removed
59857
+ in-tree node: those have a parent, removeChild() succeeds, and the
59858
+ catch is not entered. Only a kept (parentless) root reaches here. */
59859
+ remove(node);
59860
+ if (!getParentNode(node)) {
59861
+ throw typeErrorCreate('a node selected for removal could not be detached from its tree ' + 'and cannot be safely returned; refusing to sanitize in place');
59862
+ }
59863
+ }
59864
+ };
59865
+ /**
59866
+ * _neutralizeRoot
59867
+ *
59868
+ * Fail-closed teardown of an in-place root after the sanitize walk aborts
59869
+ * (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered
59870
+ * custom element's reaction detaches a node so `_forceRemove`'s deliberate
59871
+ * parentless guard throws, or any other re-entrant engine mutation — would
59872
+ * otherwise leave the caller's *live* tree half-sanitized, with everything
59873
+ * after the abort point still carrying its handlers. There is no safe way
59874
+ * to resume the walk (the tree mutated under us), so we strip the root bare:
59875
+ * remove every child and every attribute, then let the caller's catch see
59876
+ * the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`
59877
+ * getters; the root was already clobber-pre-flighted at the IN_PLACE entry).
59878
+ *
59879
+ * @param root the in-place root to empty
59880
+ */
59881
+ const _neutralizeRoot = function _neutralizeRoot(root) {
59882
+ /* Strip every disallowed attribute (on* handlers included) off the whole
59883
+ subtree BEFORE detaching anything. Detaching first would hand back
59884
+ handler-bearing originals (e.g. an already-loading `<img onerror>`)
59885
+ whose queued resource event still fires in page scope after we throw.
59886
+ Clobber-safe reads; a doomed clobbered node's own attributes are
59887
+ irrelevant while its non-clobbered descendants are reached and scrubbed. */
59888
+ _neutralizeSubtree(root);
59889
+ const childNodes = getChildNodes(root);
59890
+ if (childNodes) {
59891
+ const snapshot = [];
59892
+ arrayForEach(childNodes, child => {
59893
+ arrayPush(snapshot, child);
59894
+ });
59895
+ arrayForEach(snapshot, child => {
59896
+ try {
59897
+ remove(child);
59898
+ } catch (_) {
59899
+ /* Best-effort teardown; a still-attached child is handled below */
59900
+ }
59901
+ });
59902
+ }
59903
+ const attributes = getAttributes(root);
59904
+ if (attributes) {
59905
+ for (let i = attributes.length - 1; i >= 0; --i) {
59906
+ const attribute = attributes[i];
59907
+ const name = attribute && attribute.name;
59908
+ if (typeof name === 'string') {
59909
+ try {
59910
+ root.removeAttribute(name);
59911
+ } catch (_) {
59912
+ /* Clobbered removeAttribute — ignore (fail-closed best effort) */
59913
+ }
59914
+ }
59915
+ }
59916
+ }
59917
+ };
59918
+ /**
59919
+ * _removeAttribute
59920
+ *
59921
+ * @param name an Attribute name
59922
+ * @param element a DOM node
59923
+ */
59924
+ const _removeAttribute = function _removeAttribute(name, element) {
59925
+ try {
59926
+ arrayPush(DOMPurify.removed, {
59927
+ attribute: element.getAttributeNode(name),
59928
+ from: element
59929
+ });
59930
+ } catch (_) {
59931
+ arrayPush(DOMPurify.removed, {
59932
+ attribute: null,
59933
+ from: element
59934
+ });
59935
+ }
59936
+ element.removeAttribute(name);
59937
+ // We void attribute values for unremovable "is" attributes
59938
+ if (name === 'is') {
59939
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
59940
+ try {
59941
+ _forceRemove(element);
59942
+ } catch (_) {}
59943
+ } else {
59944
+ try {
59945
+ element.setAttribute(name, '');
59946
+ } catch (_) {}
59947
+ }
59948
+ }
59949
+ };
59950
+ /**
59951
+ * _stripDisallowedAttributes
59952
+ *
59953
+ * Removes every attribute the active configuration does not allow from a
59954
+ * single element, using the same allowlist as the main attribute pass (so
59955
+ * `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to
59956
+ * neutralise nodes that are being discarded from an in-place tree.
59957
+ *
59958
+ * @param element the element to strip
59959
+ */
59960
+ const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {
59961
+ const attributes = getAttributes(element);
59962
+ if (!attributes) {
59963
+ return;
59964
+ }
59965
+ for (let i = attributes.length - 1; i >= 0; --i) {
59966
+ const attribute = attributes[i];
59967
+ const name = attribute && attribute.name;
59968
+ if (typeof name !== 'string' || ALLOWED_ATTR[transformCaseFunc(name)]) {
59969
+ continue;
59970
+ }
59971
+ try {
59972
+ element.removeAttribute(name);
59973
+ } catch (_) {
59974
+ /* Clobbered removeAttribute on a doomed node — ignore */
59975
+ }
59976
+ }
59977
+ };
59978
+ /**
59979
+ * _neutralizeSubtree
59980
+ *
59981
+ * Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT
59982
+ * move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,
59983
+ * namespace, comment, processing-instruction and KEEP_CONTENT:false removals
59984
+ * all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path
59985
+ * those dropped nodes are detached from the caller's LIVE tree but a
59986
+ * handler-bearing original among them (an `<img onerror>`/`<video>` that was
59987
+ * loading) keeps its queued resource event, which fires in page scope after
59988
+ * sanitize returns. This walks a removed subtree and strips every attribute
59989
+ * the active configuration does not allow — so `on*` handlers are cancelled
59990
+ * through the SAME allowlist that governs kept nodes, not a separate `/^on/`
59991
+ * blocklist. Run synchronously before sanitize returns, i.e. before any
59992
+ * queued event can fire. Hook-free by design: these nodes leave the output,
59993
+ * so firing attribute hooks for them would be surprising. Clobber-safe reads;
59994
+ * a doomed clobbered node may shadow `removeAttribute` (its own attributes are
59995
+ * irrelevant — it is discarded — while its non-clobbered descendants, e.g.
59996
+ * the `<img>`, are reached and scrubbed).
59997
+ *
59998
+ * @param root the root of a removed subtree to neutralise
59999
+ */
60000
+ const _neutralizeSubtree = function _neutralizeSubtree(root) {
60001
+ const stack = [root];
60002
+ while (stack.length > 0) {
60003
+ const node = stack.pop();
60004
+ const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
60005
+ if (nodeType === NODE_TYPE.element) {
60006
+ _stripDisallowedAttributes(node);
60007
+ }
60008
+ const childNodes = getChildNodes(node);
60009
+ if (childNodes) {
60010
+ for (let i = childNodes.length - 1; i >= 0; --i) {
60011
+ stack.push(childNodes[i]);
60012
+ }
60013
+ }
60014
+ }
60015
+ };
60016
+ /**
60017
+ * _neutralizePatchLinkage
60018
+ *
60019
+ * IN_PLACE entry pre-pass (declarative-partial-updates / streaming
60020
+ * hardening, https://github.com/WICG/declarative-partial-updates).
60021
+ *
60022
+ * The main walk strips patch linkage (`for`/`patchsrc`) and removes range
60023
+ * markers (PIs / markup comments) node-by-node, in document order, AS it
60024
+ * reaches each node. On a live in-place root that leaves a window: from the
60025
+ * moment the root is connected until the walk arrives at a given node, that
60026
+ * node's linkage is live. A patch applied on connection/stream can fire as
60027
+ * a microtask during the walk and inject or teleport an unsanitized DOM
60028
+ * range into a region the iterator has already passed and will not revisit,
60029
+ * so the post-return "tree is sanitized" contract is violated. Sweep the
60030
+ * whole tree once up front and sever every linkage before the walk begins,
60031
+ * closing that window.
60032
+ *
60033
+ * This CANNOT undo a patch that already fired before sanitize ran — that is
60034
+ * the irreducible "do not IN_PLACE a live-connected attacker tree" caveat —
60035
+ * but it closes everything from sanitize-start onward. Gated on SAFE_FOR_XML
60036
+ * to group with the rest of the declarative-partial-updates handling and
60037
+ * stay overridable, consistent with the codebase.
60038
+ *
60039
+ * Clobber-safe traversal (cached childNodes getter); per-node try/catch so a
60040
+ * clobbered root cannot defeat the sweep of its non-clobbered descendants.
60041
+ *
60042
+ * NOTE (pending real-Chrome confirmation, see test/declarative-patch-probe
60043
+ * .html Q1): this mirrors the existing policy of keeping `for` on
60044
+ * <label>/<output>. If the shipping feature can drive a patch through a
60045
+ * surviving `for`-on-label/output + `id` pair, this pre-pass and the
60046
+ * attribute check at _isBasicCustomElement's caller must additionally drop
60047
+ * that pair on the IN_PLACE path. Left as-is until the taxonomy is verified.
60048
+ *
60049
+ * @param root the in-place root to sweep
60050
+ */
60051
+ const _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {
60052
+ if (!SAFE_FOR_XML) {
60053
+ return;
60054
+ }
60055
+ const stack = [root];
60056
+ while (stack.length > 0) {
60057
+ const node = stack.pop();
60058
+ const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
60059
+ /* Remove range markers (the target side of a patch linkage): every
60060
+ processing instruction, and any markup-bearing comment. */
60061
+ if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {
60062
+ try {
60063
+ remove(node);
60064
+ } catch (_) {
60065
+ /* Best-effort */
60066
+ }
60067
+ continue;
60068
+ }
60069
+ /* Strip patch-source attributes (the source side) off elements. */
60070
+ if (nodeType === NODE_TYPE.element) {
60071
+ const element = node;
60072
+ const lcTag = transformCaseFunc(getNodeName ? getNodeName(node) : node.nodeName);
60073
+ try {
60074
+ if (element.hasAttribute && element.hasAttribute('patchsrc')) {
60075
+ element.removeAttribute('patchsrc');
60076
+ }
60077
+ if (element.hasAttribute && element.hasAttribute('for') && lcTag !== 'label' && lcTag !== 'output') {
60078
+ element.removeAttribute('for');
60079
+ }
60080
+ } catch (_) {
60081
+ /* Clobbered removeAttribute/hasAttribute on a doomed node — ignore */
60082
+ }
60083
+ }
60084
+ const childNodes = getChildNodes(node);
60085
+ if (childNodes) {
60086
+ for (let i = childNodes.length - 1; i >= 0; --i) {
60087
+ stack.push(childNodes[i]);
60088
+ }
60089
+ }
60090
+ }
60091
+ };
60092
+ /**
60093
+ * _initDocument
60094
+ *
60095
+ * @param dirty - a string of dirty markup
60096
+ * @return a DOM, filled with the dirty markup
60097
+ */
60098
+ const _initDocument = function _initDocument(dirty) {
60099
+ /* Create a HTML document */
60100
+ let doc = null;
60101
+ let leadingWhitespace = null;
60102
+ if (FORCE_BODY) {
60103
+ dirty = '<remove></remove>' + dirty;
60104
+ } else {
60105
+ /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
60106
+ const matches = stringMatch(dirty, /^[\r\n\t ]+/);
60107
+ leadingWhitespace = matches && matches[0];
60108
+ }
60109
+ if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
60110
+ // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
60111
+ dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
60112
+ }
60113
+ const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;
60114
+ /*
60115
+ * Use the DOMParser API by default, fallback later if needs be
60116
+ * DOMParser not work for svg when has multiple root element.
60117
+ */
60118
+ if (NAMESPACE === HTML_NAMESPACE) {
60119
+ try {
60120
+ doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
60121
+ } catch (_) {}
60122
+ }
60123
+ /* Use createHTMLDocument in case DOMParser is not available */
60124
+ if (!doc || !doc.documentElement) {
60125
+ doc = implementation.createDocument(NAMESPACE, 'template', null);
60126
+ try {
60127
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
60128
+ } catch (_) {
60129
+ // Syntax error if dirtyPayload is invalid xml
60130
+ }
60131
+ }
60132
+ const body = doc.body || doc.documentElement;
60133
+ if (dirty && leadingWhitespace) {
60134
+ body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
60135
+ }
60136
+ /* Work on whole document or just its body */
60137
+ if (NAMESPACE === HTML_NAMESPACE) {
60138
+ return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
60139
+ }
60140
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
60141
+ };
60142
+ /**
60143
+ * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
60144
+ *
60145
+ * @param root The root element or node to start traversing on.
60146
+ * @return The created NodeIterator
60147
+ */
60148
+ const _createNodeIterator = function _createNodeIterator(root) {
60149
+ /* Read ownerDocument through the cached Node.prototype getter, never the
60150
+ direct property. HTMLFormElement has [LegacyOverrideBuiltIns], so a
60151
+ clobbering child (<input name="ownerDocument"> or a form-associated
60152
+ external input) shadows the prototype getter and makes a direct read
60153
+ return that <input>. createNodeIterator.call(<input>, ...) then throws
60154
+ "Illegal invocation", and on the IN_PLACE path that throw lands before
60155
+ the walk's fail-closed barrier - leaving the caller's live tree, with
60156
+ any already-armed handler in it, un-neutralized. The cached getter
60157
+ returns the real Document regardless of the clobber. */
60158
+ const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;
60159
+ return createNodeIterator.call(doc || root, root,
60160
+ // eslint-disable-next-line no-bitwise
60161
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
60162
+ };
60163
+ /**
60164
+ * Replace template expression syntax (mustache, ERB, template
60165
+ * literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub
60166
+ * sites. Order matters: mustache, then ERB, then template literal.
60167
+ *
60168
+ * @param value the string to scrub
60169
+ * @returns the scrubbed string
60170
+ */
60171
+ const _stripTemplateExpressions = function _stripTemplateExpressions(value) {
60172
+ value = stringReplace(value, MUSTACHE_EXPR$1, ' ');
60173
+ value = stringReplace(value, ERB_EXPR$1, ' ');
60174
+ value = stringReplace(value, TMPLIT_EXPR$1, ' ');
60175
+ return value;
60176
+ };
60177
+ /**
60178
+ * Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the
60179
+ * character data of an element subtree. Used as the final safety net for
60180
+ * SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions
60181
+ * which only form after text-node normalization (e.g. fragments split across
60182
+ * stripped elements) cannot survive into a template-evaluating framework.
60183
+ *
60184
+ * Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`
60185
+ * in place rather than round-tripping through innerHTML. This preserves
60186
+ * descendant node references (important for IN_PLACE callers), avoids a
60187
+ * serialize/reparse cycle, and reads literal character data — which means
60188
+ * `<%...%>` in text content matches the ERB regex against its real bytes
60189
+ * instead of the HTML-entity-escaped form innerHTML would produce.
60190
+ *
60191
+ * Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for
60192
+ * attributes is performed during the per-node `_sanitizeAttributes` pass.
60193
+ *
60194
+ * @param node The root element whose character data should be scrubbed.
60195
+ */
60196
+ const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {
60197
+ var _node$querySelectorAl;
60198
+ node.normalize();
60199
+ /* Clobber-safe ownerDocument read, same reasoning as _createNodeIterator:
60200
+ under SAFE_FOR_TEMPLATES this runs on the live IN_PLACE root, which may
60201
+ carry a form-named-getter override of ownerDocument. */
60202
+ const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;
60203
+ const walker = createNodeIterator.call(doc || node, node,
60204
+ // eslint-disable-next-line no-bitwise
60205
+ NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);
60206
+ let currentNode = walker.nextNode();
60207
+ while (currentNode) {
60208
+ currentNode.data = _stripTemplateExpressions(currentNode.data);
60209
+ currentNode = walker.nextNode();
60210
+ }
60211
+ // NodeIterator does not descend into <template>.content per the DOM spec,
60212
+ // so we must explicitly recurse into each template's content fragment,
60213
+ // mirroring the approach used by _sanitizeShadowDOM.
60214
+ const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, 'template');
60215
+ if (templates) {
60216
+ arrayForEach(templates, tmpl => {
60217
+ if (_isDocumentFragment(tmpl.content)) {
60218
+ _scrubTemplateExpressions2(tmpl.content);
60219
+ }
60220
+ });
60221
+ }
60222
+ };
60223
+ /**
60224
+ * _isClobbered
60225
+ *
60226
+ * Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML
60227
+ * interface with [LegacyOverrideBuiltIns]; a descendant element with a
60228
+ * `name` attribute matching a prototype property shadows that property
60229
+ * on direct reads. We use this check at the IN_PLACE entry-point and
60230
+ * during attribute sanitization to refuse clobbered forms.
60231
+ *
60232
+ * @param element element to check for clobbering attacks
60233
+ * @return true if clobbered, false if safe
60234
+ */
60235
+ const _isClobbered = function _isClobbered(element) {
60236
+ // Realm-independent tag-name probe. If we can't determine the tag
60237
+ // name at all, we can't reason about clobbering — return false
60238
+ // (the caller's other defences still apply).
60239
+ const realTagName = getNodeName ? getNodeName(element) : null;
60240
+ if (typeof realTagName !== 'string') {
60241
+ return false;
60242
+ }
60243
+ if (transformCaseFunc(realTagName) !== 'form') {
60244
+ return false;
60245
+ }
60246
+ return typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' ||
60247
+ // Realm-safe NamedNodeMap detection: equality against the cached
60248
+ // prototype getter. Clobbered .attributes (e.g. <input name="attributes">)
60249
+ // makes the direct read diverge from the cached read; a clean form
60250
+ // (same-realm OR foreign-realm) has both reads pointing at the same
60251
+ // canonical NamedNodeMap.
60252
+ element.attributes !== getAttributes(element) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function' ||
60253
+ // NodeType clobbering probe. Cached Node.prototype.nodeType getter
60254
+ // returns the integer 1 for any Element regardless of realm; direct
60255
+ // read on a clobbered form (e.g. <input name="nodeType">) returns
60256
+ // the named child element. Cheap addition — nodeType is read from
60257
+ // an internal slot, no serialization cost — and removes a residual
60258
+ // clobbering surface used by several mXSS / PI / comment branches
60259
+ // in _sanitizeElements that compare currentNode.nodeType directly.
60260
+ element.nodeType !== getNodeType(element) ||
60261
+ // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named
60262
+ // "childNodes" shadows the prototype getter. Direct reads of
60263
+ // form.childNodes from a clobbered form return the named child
60264
+ // instead of the real NodeList, so any walk that reads it directly
60265
+ // skips the form's real children. Compare the direct read to the
60266
+ // cached Node.prototype getter — when the form's named-property
60267
+ // getter intercepts the read, the two values differ and we flag
60268
+ // the form. This catches every clobbering child type (input,
60269
+ // select, etc.) regardless of whether the named child happens to
60270
+ // carry a numeric .length, which a typeof-based probe would miss
60271
+ // (e.g. HTMLSelectElement.length is a defined unsigned-long).
60272
+ element.childNodes !== getChildNodes(element);
60273
+ };
60274
+ /**
60275
+ * Checks whether the given value is a DocumentFragment from any realm.
60276
+ *
60277
+ * The realm-independent replacement reads `nodeType` through the cached
60278
+ * Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE
60279
+ * constant (11). nodeType is a numeric value resolved from the node's
60280
+ * internal slot, identical across realms for the same kind of node.
60281
+ *
60282
+ * @param value object to check
60283
+ * @return true if value is a DocumentFragment-shaped node from any realm
60284
+ */
60285
+ const _isDocumentFragment = function _isDocumentFragment(value) {
60286
+ if (!getNodeType || typeof value !== 'object' || value === null) {
60287
+ return false;
60288
+ }
60289
+ try {
60290
+ return getNodeType(value) === NODE_TYPE.documentFragment;
60291
+ } catch (_) {
60292
+ return false;
60293
+ }
60294
+ };
60295
+ /**
60296
+ * Checks whether the given object is a DOM node, including nodes that
60297
+ * originate from a different window/realm (e.g. an iframe's
60298
+ * contentDocument). The previous `value instanceof Node` check was
60299
+ * realm-bound: nodes from a different window failed it, causing
60300
+ * sanitize() to silently stringify them and reset IN_PLACE to false,
60301
+ * returning the original node unsanitized. See GHSA-4w3q-35jp-p934.
60302
+ *
60303
+ * @param value object to check whether it's a DOM node
60304
+ * @return true if value is a DOM node from any realm
60305
+ */
60306
+ const _isNode = function _isNode(value) {
60307
+ if (!getNodeType || typeof value !== 'object' || value === null) {
60308
+ return false;
60309
+ }
60310
+ try {
60311
+ return typeof getNodeType(value) === 'number';
60312
+ } catch (_) {
60313
+ return false;
60314
+ }
60315
+ };
60316
+ function _executeHooks(hooks, currentNode, data) {
60317
+ if (hooks.length === 0) {
60318
+ return;
60319
+ }
60320
+ arrayForEach(hooks, hook => {
60321
+ hook.call(DOMPurify, currentNode, data, CONFIG);
60322
+ });
60323
+ }
60324
+ /**
60325
+ * Structural-threat checks that condemn a node regardless of the
60326
+ * allowlists: mXSS via namespace confusion, risky CSS construction,
60327
+ * processing instructions, markup-bearing comments. Pure predicate;
60328
+ * the caller removes. Check order is load-bearing.
60329
+ *
60330
+ * @param currentNode the node to inspect
60331
+ * @param tagName the node's transformCaseFunc'd tag name
60332
+ * @return true if the node must be removed
60333
+ */
60334
+ const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {
60335
+ /* Detect mXSS attempts abusing namespace confusion */
60336
+ if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {
60337
+ return true;
60338
+ }
60339
+ /* Remove risky CSS construction leading to mXSS */
60340
+ if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) {
60341
+ return true;
60342
+ }
60343
+ /* Remove any occurrence of processing instructions */
60344
+ if (currentNode.nodeType === NODE_TYPE.processingInstruction) {
60345
+ return true;
60346
+ }
60347
+ /* Remove any kind of possibly harmful comments */
60348
+ if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {
60349
+ return true;
60350
+ }
60351
+ return false;
60352
+ };
60353
+ /**
60354
+ * Handle a node whose tag is forbidden or not allowlisted: keep
60355
+ * allowed custom elements (false return exits _sanitizeElements
60356
+ * early - the namespace and fallback-tag removal checks are
60357
+ * intentionally skipped for kept custom elements), else hoist
60358
+ * content per KEEP_CONTENT and remove.
60359
+ *
60360
+ * A kept custom element is the ONLY case in which this function
60361
+ * returns false, so the caller uses that return value to run the
60362
+ * afterSanitizeElements hook on the kept element and keep the
60363
+ * element-hook lifecycle consistent with normal allowlisted
60364
+ * elements (GHSA-c2j3-45gr-mqc4).
60365
+ *
60366
+ * @param currentNode the disallowed node
60367
+ * @param tagName the node's transformCaseFunc'd tag name
60368
+ * @return true if the node was removed, false if kept
60369
+ */
60370
+ const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {
60371
+ /* Check if we have a custom element to handle */
60372
+ if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
60373
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
60374
+ return false;
60375
+ }
60376
+ if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
60377
+ return false;
60378
+ }
60379
+ }
60380
+ /* Keep content except for bad-listed elements.
60381
+ Use the cached prototype getters exclusively — the previous code
60382
+ had `|| currentNode.parentNode` / `|| currentNode.childNodes`
60383
+ fallbacks, but the cached getters always return the canonical
60384
+ value (or null for a real parent-less node), so the fallback
60385
+ path was dead in safe cases and a clobbering surface in unsafe
60386
+ ones. Falsy cached results stay falsy; the `if (childNodes &&
60387
+ parentNode)` check already gates correctly. */
60388
+ if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
60389
+ const parentNode = getParentNode(currentNode);
60390
+ const childNodes = getChildNodes(currentNode);
60391
+ if (childNodes && parentNode) {
60392
+ const childCount = childNodes.length;
60393
+ /* Hoist by moving each child up one level rather than deep-cloning
60394
+ it. Moving transfers every descendant exactly once, so a chain of
60395
+ nested disallowed elements costs O(n) instead of the O(n^2) that
60396
+ re-cloning the shrinking subtree at each level produced; it also
60397
+ empties the removed original, so `DOMPurify.removed` no longer
60398
+ pins whole subtrees. Moving preserves the in-place guarantee too:
60399
+ an original carrying already-queued resource events (`<img
60400
+ onerror>`, `<video>`/`<audio>` error, lazy/`onload`, …) is
60401
+ relocated and sanitised rather than left detached but still armed.
60402
+ The sole case that must clone is removing the walk root itself.
60403
+ The result is serialised from the root's subtree, so a restrictive
60404
+ ALLOWED_TAGS that strips the root (`body` on the string path) must
60405
+ leave the content inside it, which only cloning does. In IN_PLACE
60406
+ the root is pre-validated as an allowed tag and so is never removed
60407
+ here, so that path always takes the move branch.
60408
+ `childNodes` is live; a tail-to-head walk keeps `childNodes[i]`
60409
+ valid whether we move (drops the trailing entry) or clone (leaves
60410
+ the list intact). */
60411
+ for (let i = childCount - 1; i >= 0; --i) {
60412
+ const hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];
60413
+ parentNode.insertBefore(hoisted, getNextSibling(currentNode));
60414
+ }
60415
+ }
60416
+ }
60417
+ _forceRemove(currentNode);
60418
+ return true;
60419
+ };
60420
+ /**
60421
+ * Fork a hook-mutable allowlist off its shared binding the first time a
60422
+ * (possibly lazily-installed) uponSanitize* hook is about to see it, so the
60423
+ * hook cannot widen the per-instance default or the setConfig binding by
60424
+ * reference and leak past the call. Returns the set unchanged once it is
60425
+ * already call-local, so repeated calls across elements are idempotent.
60426
+ *
60427
+ * @param hookList the uponSanitize* hook array for this event
60428
+ * @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding
60429
+ * @param defaultSet the per-instance DEFAULT_ALLOWED_* constant
60430
+ * @param setConfigSet the captured setConfig() binding, or null
60431
+ * @return a call-local clone if a hook is present and set is still shared,
60432
+ * else set unchanged
60433
+ */
60434
+ const _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {
60435
+ if (hookList.length === 0) {
60436
+ return set;
60437
+ }
60438
+ return set === defaultSet || set === setConfigSet ? clone(set) : set;
60439
+ };
60440
+ /**
60441
+ * _sanitizeElements
60442
+ *
60443
+ * @protect nodeName
60444
+ * @protect textContent
60445
+ * @protect removeChild
60446
+ * @param currentNode to check for permission to exist
60447
+ * @return true if node was killed, false if left alive
60448
+ */
60449
+ // eslint-disable-next-line complexity
60450
+ const _sanitizeElements = function _sanitizeElements(currentNode, root) {
60451
+ /* Execute a hook if present */
60452
+ _executeHooks(hooks.beforeSanitizeElements, currentNode, null);
60453
+ /* A hook may have detached the node - treat it as removed (see the
60454
+ detached-node comment after the uponSanitizeElement hook below). On
60455
+ the IN_PLACE path, neutralize the detached subtree first so a queued
60456
+ resource handler on it cannot fire in page scope after we return. */
60457
+ if (currentNode !== root && getParentNode(currentNode) === null) {
60458
+ if (IN_PLACE) {
60459
+ _neutralizeSubtree(currentNode);
60460
+ }
60461
+ return true;
60462
+ }
60463
+ /* Check if element is clobbered or can clobber */
60464
+ if (_isClobbered(currentNode)) {
60465
+ _forceRemove(currentNode);
60466
+ return true;
60467
+ }
60468
+ /* Now let's check the element's type and name */
60469
+ const tagName = transformCaseFunc(getNodeName ? getNodeName(currentNode) : currentNode.nodeName);
60470
+ /* Close the pre-walk clone-guard's timing gap: an uponSanitizeElement
60471
+ hook may have been installed after that guard sampled the hook arrays
60472
+ (e.g. lazily from beforeSanitizeElements), leaving ALLOWED_TAGS still
60473
+ aliasing a shared binding that a widening hook would mutate by
60474
+ reference. Fork it before exposing it to the hook. */
60475
+ ALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);
60476
+ /* Execute a hook if present */
60477
+ _executeHooks(hooks.uponSanitizeElement, currentNode, {
60478
+ tagName,
60479
+ allowedTags: ALLOWED_TAGS
60480
+ });
60481
+ /* A hook may have detached the node from the tree — a long-standing
60482
+ user pattern (issue #469; draw.io-style foreignObject filtering).
60483
+ Per the cached, unclobberable parentNode getter the node is
60484
+ genuinely out of the tree, so it can reach neither the serialized
60485
+ output nor an IN_PLACE live tree; treat it as removed and stop
60486
+ processing it. Without this guard, the unsafe-node / namespace
60487
+ checks below would call _forceRemove on a parentless node and hit
60488
+ the REPORT-3 fail-closed throw — which exists for nodes DOMPurify
60489
+ wants gone but *cannot* detach (clobbered / parentless roots), the
60490
+ opposite of a node that is already safely gone. The walk root is
60491
+ exempt: a detached IN_PLACE root is legitimate input and must still
60492
+ be fully sanitized, and a kill-decision on it must keep hitting the
60493
+ REPORT-3 throw. Nodes detached by hooks stay the hook's
60494
+ responsibility for placement: they are not recorded in
60495
+ DOMPurify.removed, so the post-walk IN_PLACE pass (which iterates
60496
+ DOMPurify.removed) does not reach them. But a hook-detached subtree
60497
+ can still hold a queued resource-event handler - e.g. an <img onload>
60498
+ that began loading when the caller built the live tree - which fires
60499
+ in page scope after sanitize returns even though the handler never
60500
+ reached the returned tree. That is the audit-5 F1 hazard, and the
60501
+ documented node.remove() hook pattern walks straight into it. So on
60502
+ the IN_PLACE path we neutralize the detached subtree inline here,
60503
+ stripping its non-allow-listed attributes before returning, exactly
60504
+ as the post-walk pass does for _forceRemove'd subtrees. */
60505
+ if (currentNode !== root && getParentNode(currentNode) === null) {
60506
+ if (IN_PLACE) {
60507
+ _neutralizeSubtree(currentNode);
60508
+ }
60509
+ return true;
60510
+ }
60511
+ /* Remove mXSS vectors, processing instructions and risky comments */
60512
+ if (_isUnsafeNode(currentNode, tagName)) {
60513
+ _forceRemove(currentNode);
60514
+ return true;
60515
+ }
60516
+ /* Remove element if anything forbids its presence */
60517
+ if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
60518
+ const removed = _sanitizeDisallowedNode(currentNode, tagName, root);
60519
+ /* A false return means the node is a custom element kept via
60520
+ CUSTOM_ELEMENT_HANDLING - the only keep path through
60521
+ _sanitizeDisallowedNode. Run afterSanitizeElements on it so the
60522
+ element-hook lifecycle matches normal allowlisted elements: a
60523
+ security policy applied in this hook (e.g. stripping an attribute
60524
+ from every surviving element) must not silently skip kept custom
60525
+ elements (GHSA-c2j3-45gr-mqc4). This mirrors the normal-element
60526
+ tail below - the hook runs, then the walker's subsequent
60527
+ _sanitizeAttributes pass sanitizes the element's attributes. The
60528
+ deliberately skipped namespace and fallback-tag removal checks stay
60529
+ skipped; they are removal decisions, not the hook contract. */
60530
+ if (removed === false) {
60531
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
60532
+ }
60533
+ return removed;
60534
+ }
60535
+ /* Check whether element has a valid namespace.
60536
+ Realm-safe check (GHSA-hpcv-96wg-7vj8): use the cached Node.prototype
60537
+ nodeType getter rather than `instanceof Element`, which is realm-
60538
+ bound and short-circuits to false for any node minted in a different
60539
+ realm — letting a foreign-realm element with a forbidden namespace
60540
+ slip past the namespace check entirely. */
60541
+ const nt = getNodeType ? getNodeType(currentNode) : currentNode.nodeType;
60542
+ if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {
60543
+ _forceRemove(currentNode);
60544
+ return true;
60545
+ }
60546
+ /* Make sure that older browsers don't get fallback-tag mXSS */
60547
+ if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {
60548
+ _forceRemove(currentNode);
60549
+ return true;
60550
+ }
60551
+ /* Sanitize element content to be template-safe */
60552
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
60553
+ /* Get the element's text content */
60554
+ const content = _stripTemplateExpressions(currentNode.textContent);
60555
+ if (currentNode.textContent !== content) {
60556
+ arrayPush(DOMPurify.removed, {
60557
+ element: currentNode.cloneNode()
60558
+ });
60559
+ currentNode.textContent = content;
60560
+ }
60561
+ }
60562
+ /* Execute a hook if present */
60563
+ _executeHooks(hooks.afterSanitizeElements, currentNode, null);
60564
+ return false;
60565
+ };
60566
+ /**
60567
+ * _isValidAttribute
60568
+ *
60569
+ * @param lcTag Lowercase tag name of containing element.
60570
+ * @param lcName Lowercase attribute name.
60571
+ * @param value Attribute value.
60572
+ * @return Returns true if `value` is valid, otherwise false.
60573
+ */
60574
+ // eslint-disable-next-line complexity
60575
+ const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
60576
+ /* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */
60577
+ if (FORBID_ATTR[lcName]) {
60578
+ return false;
60579
+ }
60580
+ /* Reject declarative-partial-updates patch-linkage attributes
60581
+ (https://github.com/WICG/declarative-partial-updates).
60582
+ Empirical note (Chrome 150, verified — see
60583
+ test/declarative-patch-probe-v3.html): expansion is NOT applied after
60584
+ sanitization. For the string path it fires during sanitize()'s own
60585
+ parse, so the walk sees and sanitizes the fully materialized expanded
60586
+ tree — teleports into MathML/SVG integration points included; a
60587
+ weaponized `<template for>`->`<img onerror>` comes back with the handler
60588
+ stripped. For the IN_PLACE path it fires on connection, before the walk.
60589
+ Either way DOMPurify is NOT blind to the patch.
60590
+ This removal is therefore defense-in-depth rather than the sole barrier:
60591
+ it prevents live linkage from surviving into the OUTPUT and re-expanding
60592
+ in the caller's context, and keeps behaviour deterministic if a future
60593
+ engine defers expansion. `for` is legitimate only on <label>/<output>;
60594
+ anywhere else (notably <template for>) it links the element to a patch
60595
+ target and teleports or removes an arbitrary DOM range by id/marker name.
60596
+ `patchsrc` fetches remote markup and is treated as a script-loading
60597
+ mechanism (CSP). Gated on SAFE_FOR_XML so the removal groups with the
60598
+ other structural-threat checks and stays overridable, consistent with
60599
+ the rest of the codebase. PI range markers are already removed by
60600
+ _isUnsafeNode. */
60601
+ if (SAFE_FOR_XML && lcName === 'patchsrc') {
60602
+ return false;
60603
+ }
60604
+ if (SAFE_FOR_XML && lcName === 'for' && lcTag !== 'label' && lcTag !== 'output') {
60605
+ return false;
60606
+ }
60607
+ /* Make sure attribute cannot clobber */
60608
+ if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
60609
+ return false;
60610
+ }
60611
+ const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
60612
+ /* Allow valid data-* attributes: At least one character after "-"
60613
+ (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
60614
+ XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
60615
+ We don't need to check the value; it's always URI safe. */
60616
+ if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) ; else if (!nameIsPermitted) {
60617
+ if (
60618
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
60619
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
60620
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
60621
+ _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) ||
60622
+ // Alternative, second condition checks if it's an `is`-attribute, AND
60623
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
60624
+ lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
60625
+ return false;
60626
+ }
60627
+ /* Check value is safe. First, is attr inert? If so, is safe */
60628
+ } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; else if (value) {
60629
+ return false;
60630
+ } else ;
60631
+ return true;
60632
+ };
60633
+ /* Names the HTML spec reserves from valid-custom-element-name; these must
60634
+ * never be treated as basic custom elements even when a permissive
60635
+ * CUSTOM_ELEMENT_HANDLING.tagNameCheck is configured. */
60636
+ const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ['annotation-xml', 'color-profile', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'missing-glyph']);
60637
+ /**
60638
+ * _isBasicCustomElement
60639
+ * checks if at least one dash is included in tagName, and it's not the first char
60640
+ * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
60641
+ *
60642
+ * @param tagName name of the tag of the node to sanitize
60643
+ * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
60644
+ */
60645
+ const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
60646
+ return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
60647
+ };
60648
+ /**
60649
+ * Wrap an attribute value in the matching Trusted Types object when
60650
+ * the active policy requires it. Namespaced attributes pass through
60651
+ * unchanged (no TT support yet, see
60652
+ * https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).
60653
+ *
60654
+ * @param lcTag lowercase tag name of the containing element
60655
+ * @param lcName lowercase attribute name
60656
+ * @param namespaceURI the attribute's namespace, if any
60657
+ * @param value the attribute value to wrap
60658
+ * @return the value, wrapped when Trusted Types demand it
60659
+ */
60660
+ const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {
60661
+ if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function' && !namespaceURI) {
60662
+ switch (trustedTypes.getAttributeType(lcTag, lcName)) {
60663
+ case 'TrustedHTML':
60664
+ {
60665
+ return _createTrustedHTML(value);
60666
+ }
60667
+ case 'TrustedScriptURL':
60668
+ {
60669
+ return _createTrustedScriptURL(value);
60670
+ }
60671
+ }
60672
+ }
60673
+ return value;
60674
+ };
60675
+ /**
60676
+ * Write a modified attribute value back onto the element. On
60677
+ * success, re-probe for clobbering introduced by the new value and
60678
+ * remove the element when found; otherwise pop the removal entry
60679
+ * recorded by the earlier _removeAttribute (long-standing pairing
60680
+ * with the SANITIZE_NAMED_PROPS path - do not "fix" casually). On
60681
+ * failure, remove the attribute instead.
60682
+ *
60683
+ * @param currentNode the element carrying the attribute
60684
+ * @param name the attribute name as present on the element
60685
+ * @param namespaceURI the attribute's namespace, if any
60686
+ * @param value the new attribute value
60687
+ */
60688
+ const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
60689
+ try {
60690
+ if (namespaceURI) {
60691
+ currentNode.setAttributeNS(namespaceURI, name, value);
60692
+ } else {
60693
+ /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
60694
+ currentNode.setAttribute(name, value);
60695
+ }
60696
+ if (_isClobbered(currentNode)) {
60697
+ _forceRemove(currentNode);
60698
+ } else {
60699
+ arrayPop(DOMPurify.removed);
60700
+ }
60701
+ } catch (_) {
60702
+ _removeAttribute(name, currentNode);
60703
+ }
60704
+ };
60705
+ /**
60706
+ * _sanitizeAttributes
60707
+ *
60708
+ * @protect attributes
60709
+ * @protect nodeName
60710
+ * @protect removeAttribute
60711
+ * @protect setAttribute
60712
+ *
60713
+ * @param currentNode to sanitize
60714
+ */
60715
+ const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
60716
+ /* Execute a hook if present */
60717
+ _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
60718
+ const attributes = currentNode.attributes;
60719
+ /* Check if we have attributes; if not we might have a text node */
60720
+ if (!attributes || _isClobbered(currentNode)) {
60721
+ return;
60722
+ }
60723
+ /* Same lazy-install guard as uponSanitizeElement (see there): fork the
60724
+ attribute allowlist off its shared binding before a hook can see it. */
60725
+ ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);
60726
+ const hookEvent = {
60727
+ attrName: '',
60728
+ attrValue: '',
60729
+ keepAttr: true,
60730
+ allowedAttributes: ALLOWED_ATTR,
60731
+ forceKeepAttr: undefined
60732
+ };
60733
+ let l = attributes.length;
60734
+ const lcTag = transformCaseFunc(currentNode.nodeName);
60735
+ /* Go backwards over all attributes; safely remove bad ones */
60736
+ while (l--) {
60737
+ const attr = attributes[l];
60738
+ const name = attr.name,
60739
+ namespaceURI = attr.namespaceURI,
60740
+ attrValue = attr.value;
60741
+ const lcName = transformCaseFunc(name);
60742
+ const initValue = attrValue;
60743
+ let value = name === 'value' ? initValue : stringTrim(initValue);
60744
+ /* Execute a hook if present */
60745
+ hookEvent.attrName = lcName;
60746
+ hookEvent.attrValue = value;
60747
+ hookEvent.keepAttr = true;
60748
+ hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
60749
+ _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
60750
+ value = hookEvent.attrValue;
60751
+ /* Full DOM Clobbering protection via namespace isolation,
60752
+ * Prefix id and name attributes with `user-content-`
60753
+ */
60754
+ if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name') && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
60755
+ // Remove the attribute with this value
60756
+ _removeAttribute(name, currentNode);
60757
+ // Prefix the value and later re-create the attribute with the sanitized value
60758
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
60759
+ }
60760
+ // Else: already prefixed, leave the attribute alone — the prefix is
60761
+ // itself the clobbering protection, and re-applying it is incorrect.
60762
+ /* Work around a security issue with comments inside attributes */
60763
+ if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
60764
+ _removeAttribute(name, currentNode);
60765
+ continue;
60766
+ }
60767
+ /* Make sure we cannot easily use animated hrefs, even if animations are allowed */
60768
+ if (lcName === 'attributename' && stringMatch(value, 'href')) {
60769
+ _removeAttribute(name, currentNode);
60770
+ continue;
60771
+ }
60772
+ /* Did the hooks force-keep the attribute? */
60773
+ if (hookEvent.forceKeepAttr) {
60774
+ continue;
60775
+ }
60776
+ /* Did the hooks approve of the attribute? */
60777
+ if (!hookEvent.keepAttr) {
60778
+ _removeAttribute(name, currentNode);
60779
+ continue;
60780
+ }
60781
+ /* Work around a security issue in jQuery 3.0 */
60782
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {
60783
+ _removeAttribute(name, currentNode);
60784
+ continue;
60785
+ }
60786
+ /* Sanitize attribute content to be template-safe */
60787
+ if (SAFE_FOR_TEMPLATES) {
60788
+ value = _stripTemplateExpressions(value);
60789
+ }
60790
+ /* Is `value` valid for this attribute? */
60791
+ if (!_isValidAttribute(lcTag, lcName, value)) {
60792
+ _removeAttribute(name, currentNode);
60793
+ continue;
60794
+ }
60795
+ /* Handle attributes that require Trusted Types */
60796
+ value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
60797
+ /* Handle invalid data-* attribute set by try-catching it */
60798
+ if (value !== initValue) {
60799
+ _setAttributeValue(currentNode, name, namespaceURI, value);
60800
+ }
60801
+ }
60802
+ /* Execute a hook if present */
60803
+ _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
60804
+ };
60805
+ /**
60806
+ * _sanitizeShadowDOM
60807
+ *
60808
+ * @param fragment to iterate over recursively
60809
+ */
60810
+ const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
60811
+ let shadowNode = null;
60812
+ const shadowIterator = _createNodeIterator(fragment);
60813
+ /* Execute a hook if present */
60814
+ _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
60815
+ while (shadowNode = shadowIterator.nextNode()) {
60816
+ /* Execute a hook if present */
60817
+ _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
60818
+ /* Sanitize tags and elements */
60819
+ _sanitizeElements(shadowNode, fragment);
60820
+ /* Check attributes next */
60821
+ _sanitizeAttributes(shadowNode);
60822
+ /* Deep shadow DOM detected.
60823
+ Realm-safe check (GHSA-hpcv-96wg-7vj8): use nodeType against the
60824
+ DOCUMENT_FRAGMENT_NODE constant rather than instanceof, so we
60825
+ recurse into <template>.content from foreign realms too. */
60826
+ if (_isDocumentFragment(shadowNode.content)) {
60827
+ _sanitizeShadowDOM2(shadowNode.content);
60828
+ }
60829
+ /* An element iterated here may itself host an attached
60830
+ shadow root. The default NodeIterator does not enter shadow
60831
+ trees, so a shadow root nested inside template.content was
60832
+ previously reached by no walk at all (the pre-pass at
60833
+ _sanitizeAttachedShadowRoots descends via childNodes, which
60834
+ doesn't enter template.content; the template-content recursion
60835
+ above iterates the content but never inspected shadowRoot).
60836
+ Walk it explicitly. The nodeType guard avoids reading
60837
+ shadowRoot off text / comment / CDATA / PI nodes that the
60838
+ iterator also surfaces. */
60839
+ const shadowNodeType = getNodeType ? getNodeType(shadowNode) : shadowNode.nodeType;
60840
+ if (shadowNodeType === NODE_TYPE.element) {
60841
+ const innerSr = getShadowRoot(shadowNode);
60842
+ if (_isDocumentFragment(innerSr)) {
60843
+ _sanitizeAttachedShadowRoots(innerSr);
60844
+ _sanitizeShadowDOM2(innerSr);
60845
+ }
60846
+ }
60847
+ }
60848
+ /* Execute a hook if present */
60849
+ _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
60850
+ };
60851
+ /**
60852
+ * _sanitizeAttachedShadowRoots
60853
+ *
60854
+ * Walks `root` and feeds every attached shadow root we encounter into
60855
+ * the existing _sanitizeShadowDOM pipeline. The default node iterator
60856
+ * does not descend into shadow trees, so nodes inside an attached
60857
+ * shadow root would otherwise be skipped entirely.
60858
+ *
60859
+ * Two real input paths put attached shadow roots in front of us:
60860
+ * 1. IN_PLACE on a DOM node that already has shadow roots attached.
60861
+ * 2. DOM-node input where importNode(dirty, true) deep-clones the
60862
+ * shadow root because it was created with `clonable: true`.
60863
+ *
60864
+ * This pass runs once, up front, so the main iteration loop (and the
60865
+ * existing _sanitizeShadowDOM template-content recursion) stay
60866
+ * untouched — string-input paths are not affected.
60867
+ *
60868
+ * @param root the subtree root to walk for attached shadow roots
60869
+ */
60870
+ const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {
60871
+ /* Iterative (explicit stack) rather than per-child recursion. DOM APIs
60872
+ impose no depth cap, so an attacker-shaped tree (JSON/CRDT/editor data
60873
+ built straight into the DOM — the IN_PLACE surface) deeper than the JS
60874
+ call-stack budget would otherwise overflow native recursion here and
60875
+ throw at the IN_PLACE entry pre-pass, before a single node is
60876
+ sanitized, leaving the caller's live tree untouched (fail-open). See
60877
+ campaign-3 F4. A heap stack keeps depth off the call stack.
60878
+ Each work item is either a node to descend into, or a deferred
60879
+ `_sanitizeShadowDOM` for an already-walked shadow root. The deferred
60880
+ form preserves the original post-order discipline: a shadow root's
60881
+ nested shadow roots are discovered before the outer shadow is
60882
+ sanitized (which may remove hosts). Pushes are in reverse of the
60883
+ desired processing order (LIFO): template content, then children, then
60884
+ the shadow-sanitize, then the shadow walk — so the order matches the
60885
+ previous recursion exactly. */
60886
+ const stack = [{
60887
+ node: root,
60888
+ shadow: null
60889
+ }];
60890
+ while (stack.length > 0) {
60891
+ const item = stack.pop();
60892
+ /* Deferred shadow-DOM sanitisation: runs after its subtree was walked. */
60893
+ if (item.shadow) {
60894
+ _sanitizeShadowDOM2(item.shadow);
60895
+ continue;
60896
+ }
60897
+ const node = item.node;
60898
+ const nodeType = getNodeType ? getNodeType(node) : node.nodeType;
60899
+ const isElement = nodeType === NODE_TYPE.element;
60900
+ /* (pushed last → processed first) Children, snapshotted in reverse so
60901
+ the first child is processed first. Snapshotting matters because a
60902
+ hook may detach siblings mid-walk. */
60903
+ const childNodes = getChildNodes(node);
60904
+ if (childNodes) {
60905
+ for (let i = childNodes.length - 1; i >= 0; --i) {
60906
+ stack.push({
60907
+ node: childNodes[i],
60908
+ shadow: null
60909
+ });
60910
+ }
60911
+ }
60912
+ /* (pushed before children → processed after them, matching the old
60913
+ "template content last" order) When the node is a <template>,
60914
+ descend into its content. */
60915
+ if (isElement) {
60916
+ const rootName = getNodeName ? getNodeName(node) : null;
60917
+ if (typeof rootName === 'string' && transformCaseFunc(rootName) === 'template') {
60918
+ const content = node.content;
60919
+ if (_isDocumentFragment(content)) {
60920
+ stack.push({
60921
+ node: content,
60922
+ shadow: null
60923
+ });
60924
+ }
60925
+ }
60926
+ }
60927
+ /* Shadow root (processed first): walk its subtree, then sanitise it.
60928
+ Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
60929
+ rather than `instanceof DocumentFragment`, which is realm-bound and
60930
+ silently skipped foreign-realm shadow roots (e.g.
60931
+ iframe.contentDocument attachShadow). */
60932
+ if (isElement) {
60933
+ const sr = getShadowRoot(node);
60934
+ if (_isDocumentFragment(sr)) {
60935
+ /* Push the deferred sanitise first so it pops after the shadow
60936
+ walk we push next, i.e. nested shadow roots are discovered
60937
+ before this one is sanitised. */
60938
+ stack.push({
60939
+ node: null,
60940
+ shadow: sr
60941
+ }, {
60942
+ node: sr,
60943
+ shadow: null
60944
+ });
60945
+ }
60946
+ }
60947
+ }
60948
+ };
60949
+ // eslint-disable-next-line complexity
60950
+ DOMPurify.sanitize = function (dirty) {
60951
+ let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
60952
+ let body = null;
60953
+ let importedNode = null;
60954
+ let currentNode = null;
60955
+ let returnNode = null;
60956
+ /* Make sure we have a string to sanitize.
60957
+ DO NOT return early, as this will return the wrong type if
60958
+ the user has requested a DOM object rather than a string */
60959
+ IS_EMPTY_INPUT = !dirty;
60960
+ if (IS_EMPTY_INPUT) {
60961
+ dirty = '<!-->';
60962
+ }
60963
+ /* Stringify, in case dirty is an object */
60964
+ if (typeof dirty !== 'string' && !_isNode(dirty)) {
60965
+ dirty = stringifyValue(dirty);
60966
+ if (typeof dirty !== 'string') {
60967
+ throw typeErrorCreate('dirty is not a string, aborting');
60968
+ }
60969
+ }
60970
+ /* Return dirty HTML if DOMPurify cannot run */
60971
+ if (!DOMPurify.isSupported) {
60972
+ return dirty;
60973
+ }
60974
+ /* Assign config vars */
60975
+ if (SET_CONFIG) {
60976
+ /* Persistent setConfig() path: _parseConfig is skipped, so the sets are
60977
+ * not re-derived per call. Restore them from the pristine bindings
60978
+ * captured at setConfig() time so a previous call's hook clone (mutated
60979
+ * below) does not carry over. */
60980
+ ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;
60981
+ ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;
60982
+ } else {
60983
+ _parseConfig(cfg);
60984
+ }
60985
+ /* Clone the hook-mutable allowlists before the walk whenever an
60986
+ * uponSanitize* hook is registered. The hook event exposes ALLOWED_TAGS
60987
+ * and ALLOWED_ATTR by reference (as allowedTags / allowedAttributes), so
60988
+ * a hook that widens them would otherwise mutate the shared set
60989
+ * permanently: across later calls and across every element. Cloning per
60990
+ * walk keeps documented in-call widening working while scoping it to the
60991
+ * call. A single guard for both config paths - the per-call path rebinds
60992
+ * the sets in _parseConfig each call, the persistent path restores them
60993
+ * from the captured bindings just above - so the two cannot diverge. */
60994
+ if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) {
60995
+ ALLOWED_TAGS = clone(ALLOWED_TAGS);
60996
+ }
60997
+ if (hooks.uponSanitizeAttribute.length > 0) {
60998
+ ALLOWED_ATTR = clone(ALLOWED_ATTR);
60999
+ }
61000
+ /* Clean up removed elements */
61001
+ DOMPurify.removed = [];
61002
+ /* Resolve IN_PLACE for this call without mutating persistent config.
61003
+ Writing the IN_PLACE closure variable here leaks under setConfig(),
61004
+ where _parseConfig is skipped on later calls: a single string call would
61005
+ disable in-place mode for every subsequent node call, returning a
61006
+ sanitized copy while leaving the caller's node — which in-place callers
61007
+ keep using and whose return value they ignore — unsanitized. REPORT-2. */
61008
+ const inPlace = IN_PLACE && typeof dirty !== 'string' && _isNode(dirty);
61009
+ if (inPlace) {
61010
+ /* Declarative-partial-updates / streaming pre-pass: sever every patch
61011
+ linkage across the live tree BEFORE the walk, so no patch can fire
61012
+ mid-walk and inject into an already-processed region. Runs first, so
61013
+ it also covers the forbidden/clobbered roots that throw below. */
61014
+ _neutralizePatchLinkage(dirty);
61015
+ /* Do some early pre-sanitization to avoid unsafe root nodes.
61016
+ Read nodeName through the cached prototype getter — a clobbering
61017
+ child named "nodeName" on the form root would otherwise shadow
61018
+ the property and let this check skip the root-allowlist
61019
+ validation entirely. */
61020
+ const nn = getNodeName ? getNodeName(dirty) : dirty.nodeName;
61021
+ if (typeof nn === 'string') {
61022
+ const tagName = transformCaseFunc(nn);
61023
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
61024
+ /* Fail closed on a live root: neutralize handlers/children before
61025
+ throwing, exactly as the mid-walk abort path does. */
61026
+ _neutralizeRoot(dirty);
61027
+ throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
61028
+ }
61029
+ }
61030
+ /* Pre-flight the root through _isClobbered. The iterator-driven
61031
+ removal path can not detach a parent-less root: _forceRemove
61032
+ falls through to Element.prototype.remove(), which per spec
61033
+ is a no-op on a node with no parent. A clobbered root would
61034
+ then survive the main loop with its attributes uninspected,
61035
+ because _sanitizeAttributes early-returns on _isClobbered. The
61036
+ result would be an attacker-controlled form, complete with any
61037
+ event-handler attributes the caller passed in, handed back to
61038
+ the application unsanitized. Refuse to sanitize such a root
61039
+ the same way we refuse a forbidden tag. GHSA-r47g-fvhr-h676. */
61040
+ if (_isClobbered(dirty)) {
61041
+ /* Fail closed on a live clobbered root before throwing.
61042
+ _neutralizeRoot's reads are clobber-safe (cached getters); the
61043
+ form's non-clobbered descendants, e.g. an armed <img>, are scrubbed. */
61044
+ _neutralizeRoot(dirty);
61045
+ throw typeErrorCreate('root node is clobbered and cannot be sanitized in-place');
61046
+ }
61047
+ /* Sanitize attached shadow roots before the main iterator runs.
61048
+ The iterator does not descend into shadow trees. Same fail-closed
61049
+ barrier as the main walk (campaign-3 F2): a custom-element reaction
61050
+ inside a shadow root could abort this pre-pass before the walk runs,
61051
+ which would otherwise leave the entire live tree unsanitized. */
61052
+ try {
61053
+ _sanitizeAttachedShadowRoots(dirty);
61054
+ } catch (error) {
61055
+ _neutralizeRoot(dirty);
61056
+ throw error;
61057
+ }
61058
+ } else if (_isNode(dirty)) {
61059
+ /* If dirty is a DOM element, append to an empty document to avoid
61060
+ elements being stripped by the parser */
61061
+ body = _initDocument('<!---->');
61062
+ importedNode = body.ownerDocument.importNode(dirty, true);
61063
+ if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
61064
+ /* Node is already a body, use as is */
61065
+ body = importedNode;
61066
+ } else if (importedNode.nodeName === 'HTML') {
61067
+ body = importedNode;
61068
+ } else {
61069
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
61070
+ body.appendChild(importedNode);
61071
+ }
61072
+ /* Clonable shadow roots are deep-cloned by importNode(); sanitize
61073
+ them before the main iterator runs, since the iterator does not
61074
+ descend into shadow trees. The walk routes every read through a
61075
+ cached prototype getter so clobbering descendants on a form root
61076
+ cannot hide a shadow host from this pass. */
61077
+ _sanitizeAttachedShadowRoots(importedNode);
61078
+ } else {
61079
+ /* Exit directly if we have nothing to do */
61080
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
61081
+ // eslint-disable-next-line unicorn/prefer-includes
61082
+ dirty.indexOf('<') === -1) {
61083
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;
61084
+ }
61085
+ /* Initialize the document to work on */
61086
+ body = _initDocument(dirty);
61087
+ /* Check we have a DOM node from the data */
61088
+ if (!body) {
61089
+ return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
61090
+ }
61091
+ }
61092
+ /* Remove first element node (ours) if FORCE_BODY is set */
61093
+ if (body && FORCE_BODY) {
61094
+ _forceRemove(body.firstChild);
61095
+ }
61096
+ /* Get node iterator */
61097
+ const walkRoot = inPlace ? dirty : body;
61098
+ /* Now start iterating over the created document.
61099
+ The walk runs inside an exception barrier (campaign-3 F2): a re-entrant
61100
+ engine/custom-element mutation can detach a node mid-walk so
61101
+ `_forceRemove`'s parentless guard throws, aborting the loop. Without the
61102
+ barrier the caller's in-place tree would be left half-sanitized with the
61103
+ unvisited tail still armed. _createNodeIterator itself is inside the
61104
+ barrier too: constructing the iterator dereferences the root's document,
61105
+ and any failure there (e.g. an exotic/clobbered root) must still fail
61106
+ closed rather than skip the neutralize. On any throw we fail closed -
61107
+ strip the in-place root bare - then rethrow so the existing throw
61108
+ contract is preserved. (String/DOM-copy paths never return the partial
61109
+ body, so the propagating throw is already fail-closed there.) */
61110
+ try {
61111
+ const nodeIterator = _createNodeIterator(walkRoot);
61112
+ while (currentNode = nodeIterator.nextNode()) {
61113
+ /* Sanitize tags and elements */
61114
+ _sanitizeElements(currentNode, walkRoot);
61115
+ /* Check attributes next */
61116
+ _sanitizeAttributes(currentNode);
61117
+ /* Shadow DOM detected, sanitize it.
61118
+ Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection
61119
+ instead of instanceof, so foreign-realm <template>.content is
61120
+ walked correctly. */
61121
+ if (_isDocumentFragment(currentNode.content)) {
61122
+ _sanitizeShadowDOM2(currentNode.content);
61123
+ }
61124
+ }
61125
+ } catch (error) {
61126
+ if (inPlace) {
61127
+ _neutralizeRoot(dirty);
61128
+ /* Nodes _forceRemove'd earlier in the aborted walk are already
61129
+ detached from the root, so _neutralizeRoot's subtree pass does not
61130
+ reach them. Defuse them too, mirroring the success-path loop below. */
61131
+ arrayForEach(DOMPurify.removed, entry => {
61132
+ if (entry.element) {
61133
+ _neutralizeSubtree(entry.element);
61134
+ }
61135
+ });
61136
+ }
61137
+ throw error;
61138
+ }
61139
+ /* If we sanitized `dirty` in-place, return it. */
61140
+ if (inPlace) {
61141
+ /* Fail-closed completion of the audit-5 F1 fix: every node removed from
61142
+ the caller's live tree is detached but may still hold a queued
61143
+ resource-event handler that fires in page scope after we return. The
61144
+ move-hoist covers only disallowed-tag KEEP_CONTENT removals; strip the
61145
+ non-allow-listed attributes off every other removed subtree (clobber,
61146
+ mXSS, namespace, comments, KEEP_CONTENT:false, …) so those handlers are
61147
+ cancelled before any event can fire. Runs synchronously, pre-return. */
61148
+ arrayForEach(DOMPurify.removed, entry => {
61149
+ if (entry.element) {
61150
+ _neutralizeSubtree(entry.element);
61151
+ }
61152
+ });
61153
+ if (SAFE_FOR_TEMPLATES) {
61154
+ _scrubTemplateExpressions2(dirty);
61155
+ }
61156
+ return dirty;
61157
+ }
61158
+ /* Return sanitized string or DOM */
61159
+ if (RETURN_DOM) {
61160
+ if (SAFE_FOR_TEMPLATES) {
61161
+ _scrubTemplateExpressions2(body);
61162
+ }
61163
+ if (RETURN_DOM_FRAGMENT) {
61164
+ returnNode = createDocumentFragment.call(body.ownerDocument);
61165
+ while (body.firstChild) {
61166
+ // eslint-disable-next-line unicorn/prefer-dom-node-append
61167
+ returnNode.appendChild(body.firstChild);
61168
+ }
61169
+ } else {
61170
+ returnNode = body;
61171
+ }
61172
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
61173
+ /*
61174
+ AdoptNode() is not used because internal state is not reset
61175
+ (e.g. the past names map of a HTMLFormElement), this is safe
61176
+ in theory but we would rather not risk another attack vector.
61177
+ The state that is cloned by importNode() is explicitly defined
61178
+ by the specs.
61179
+ */
61180
+ returnNode = importNode.call(originalDocument, returnNode, true);
61181
+ }
61182
+ return returnNode;
61183
+ }
61184
+ let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
61185
+ /* Serialize doctype if allowed */
61186
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
61187
+ serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
61188
+ }
61189
+ /* Sanitize final string template-safe */
61190
+ if (SAFE_FOR_TEMPLATES) {
61191
+ serializedHTML = _stripTemplateExpressions(serializedHTML);
61192
+ }
61193
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;
61194
+ };
61195
+ DOMPurify.setConfig = function () {
61196
+ let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
61197
+ _parseConfig(cfg);
61198
+ SET_CONFIG = true;
61199
+ SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;
61200
+ SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;
61201
+ };
61202
+ DOMPurify.clearConfig = function () {
61203
+ CONFIG = null;
61204
+ SET_CONFIG = false;
61205
+ SET_CONFIG_ALLOWED_TAGS = null;
61206
+ SET_CONFIG_ALLOWED_ATTR = null;
61207
+ // Drop any caller-supplied Trusted Types policy so it cannot poison later
61208
+ // `RETURN_TRUSTED_TYPE` output. The internal default policy (cached, and
61209
+ // never recreated — Trusted Types throws on duplicate names) is restored by
61210
+ // the next `_parseConfig`. See GHSA-vxr8-fq34-vvx9.
61211
+ trustedTypesPolicy = defaultTrustedTypesPolicy;
61212
+ emptyHTML = '';
61213
+ };
61214
+ DOMPurify.isValidAttribute = function (tag, attr, value) {
61215
+ /* Initialize shared config vars if necessary. */
61216
+ if (!CONFIG) {
61217
+ _parseConfig({});
61218
+ }
61219
+ const lcTag = transformCaseFunc(tag);
61220
+ const lcName = transformCaseFunc(attr);
61221
+ return _isValidAttribute(lcTag, lcName, value);
61222
+ };
61223
+ DOMPurify.addHook = function (entryPoint, hookFunction) {
61224
+ if (typeof hookFunction !== 'function') {
61225
+ return;
61226
+ }
61227
+ /* Reject unknown entry points. Without this, a non-hook key (e.g.
61228
+ * '__proto__') indexes off the prototype chain rather than a real
61229
+ * hook array, and arrayPush then writes to Object.prototype. Guard
61230
+ * with an own-property check against the known hook names. */
61231
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
61232
+ return;
61233
+ }
61234
+ arrayPush(hooks[entryPoint], hookFunction);
61235
+ };
61236
+ DOMPurify.removeHook = function (entryPoint, hookFunction) {
61237
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
61238
+ return undefined;
61239
+ }
61240
+ if (hookFunction !== undefined) {
61241
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
61242
+ return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
61243
+ }
61244
+ return arrayPop(hooks[entryPoint]);
61245
+ };
61246
+ DOMPurify.removeHooks = function (entryPoint) {
61247
+ if (!objectHasOwnProperty(hooks, entryPoint)) {
61248
+ return;
61249
+ }
61250
+ hooks[entryPoint] = [];
61251
+ };
61252
+ DOMPurify.removeAllHooks = function () {
61253
+ hooks = _createHooksMap();
61254
+ };
61255
+ return DOMPurify;
61256
+ }
61257
+ var purify = createDOMPurify();
61258
+
61259
+ module.exports = purify;
61260
+ //# sourceMappingURL=purify.cjs.js.map
61261
+
61262
+
58128
61263
  /***/ }),
58129
61264
 
58130
61265
  /***/ 44581:
@@ -62363,6 +65498,18 @@ __webpack_require__.r(__webpack_exports__);
62363
65498
 
62364
65499
  /***/ }),
62365
65500
 
65501
+ /***/ 59129:
65502
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
65503
+
65504
+ __webpack_require__.r(__webpack_exports__);
65505
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
65506
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
65507
+ /* harmony export */ });
65508
+ // extracted by mini-css-extract-plugin
65509
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"grey-rpi-grey-15":"#d5d7dc","grey-rpi-grey-40":"#9497a4","grey-rpi-grey-5":"#f1f2f3","grey-rpi-grey-70":"#4a4d59","grey-rpf-white":"#fff","container":"styles-module__container--9uU-+","title":"styles-module__title--urAGl","description":"styles-module__description--sbvSV","backButton":"styles-module__backButton--cHk5z","noProjectIcon":"styles-module__noProjectIcon--9Wb6s"});
65510
+
65511
+ /***/ }),
65512
+
62366
65513
  /***/ 10866:
62367
65514
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
62368
65515
 
@@ -78091,21 +81238,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
78091
81238
  };
78092
81239
  Object.defineProperty(exports, "__esModule", ({ value: true }));
78093
81240
  const jsx_runtime_1 = __webpack_require__(71178);
81241
+ const react_1 = __webpack_require__(13327);
78094
81242
  const stores_1 = __webpack_require__(32132);
81243
+ const sanitizeHtml_1 = __webpack_require__(16902);
78095
81244
  const styles_module_scss_1 = __importDefault(__webpack_require__(71244));
78096
- const react_1 = __webpack_require__(13327);
78097
81245
  const ErrorDetails_1 = __webpack_require__(80335);
78098
81246
  const ErrorMessage = () => {
78099
- const ref = (0, react_1.useRef)(null);
78100
81247
  const error = (0, stores_1.useAppSelector)((state) => state.editor.error);
78101
- (0, react_1.useEffect)(() => {
78102
- if (ref.current && error?.message) {
78103
- ref.current.innerHTML = error.message;
78104
- }
78105
- }, [error]);
81248
+ // Runner errors carry help links, so the markup has to render — but the rest
81249
+ // of the message is a traceback built from user code and cannot be trusted.
81250
+ const message = (0, react_1.useMemo)(() => (0, sanitizeHtml_1.sanitizeHtml)(error?.message), [error?.message]);
78106
81251
  if (!error)
78107
81252
  return null;
78108
- return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.container, role: "alert", "aria-label": "Run error", children: [(0, jsx_runtime_1.jsx)("pre", { ref: ref, className: styles_module_scss_1.default.message }), (0, jsx_runtime_1.jsx)(ErrorDetails_1.ErrorDetails, {})] }));
81253
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.container, role: "alert", "aria-label": "Run error", children: [(0, jsx_runtime_1.jsx)("pre", { className: styles_module_scss_1.default.message, dangerouslySetInnerHTML: { __html: message } }), (0, jsx_runtime_1.jsx)(ErrorDetails_1.ErrorDetails, {})] }));
78109
81254
  };
78110
81255
  exports["default"] = ErrorMessage;
78111
81256
 
@@ -80158,6 +83303,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
80158
83303
  const jsx_runtime_1 = __webpack_require__(71178);
80159
83304
  const react_1 = __webpack_require__(13327);
80160
83305
  const styles_module_scss_1 = __importDefault(__webpack_require__(12914));
83306
+ const sanitizeHtml_1 = __webpack_require__(16902);
80161
83307
  const VisualOutputPaneEmpty_1 = __importDefault(__webpack_require__(93290));
80162
83308
  const loadHighcharts = () => __webpack_require__.e(/* import() | highcharts */ 16).then(__webpack_require__.t.bind(__webpack_require__, 14783, 23)).then((module) => module.default ?? module);
80163
83309
  const loadPlotly = () => __webpack_require__.e(/* import() | plotly */ 787).then(__webpack_require__.t.bind(__webpack_require__, 28850, 23)).then((module) => module.default ?? module);
@@ -80194,7 +83340,9 @@ const VisualOutputPane = ({ visuals, setVisuals }) => {
80194
83340
  Highcharts.chart(output.current, chartContent);
80195
83341
  break;
80196
83342
  case "turtle":
80197
- output.current.innerHTML = elementFromProps(visual.content).outerHTML;
83343
+ // the scene is built from a worker message, and project Python can
83344
+ // emit one directly via basthon.kernel.display_event
83345
+ output.current.innerHTML = (0, sanitizeHtml_1.sanitizeVisualHtml)(elementFromProps(visual.content).outerHTML);
80198
83346
  break;
80199
83347
  case "matplotlib":
80200
83348
  // convert visual.content from Uint8Array to jpg
@@ -83754,6 +86902,26 @@ exports.ModalTypeToComponentMap = {
83754
86902
  };
83755
86903
 
83756
86904
 
86905
+ /***/ }),
86906
+
86907
+ /***/ 40068:
86908
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
86909
+
86910
+
86911
+ var __importDefault = (this && this.__importDefault) || function (mod) {
86912
+ return (mod && mod.__esModule) ? mod : { "default": mod };
86913
+ };
86914
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
86915
+ const jsx_runtime_1 = __webpack_require__(71178);
86916
+ const no_project_svg_1 = __importDefault(__webpack_require__(56058));
86917
+ const Button_1 = __importDefault(__webpack_require__(79428));
86918
+ const Text_1 = __webpack_require__(82803);
86919
+ const previewUrl_1 = __webpack_require__(89441);
86920
+ const styles_module_scss_1 = __importDefault(__webpack_require__(59129));
86921
+ const PreviewUnavailable = () => ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.container, children: [(0, jsx_runtime_1.jsx)(no_project_svg_1.default, { className: styles_module_scss_1.default.noProjectIcon, role: "img", "aria-label": "No project available" }), (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 20, weight: "bold", className: styles_module_scss_1.default.title, role: "heading", "aria-level": 1, children: "Preview unavailable" }), (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 14, className: styles_module_scss_1.default.description, children: "We couldn\u2019t load a preview for this project right now." }), (0, jsx_runtime_1.jsx)(Text_1.Text, { size: 14, className: styles_module_scss_1.default.description, children: "Please try running or saving the project first, then try again." }), (0, jsx_runtime_1.jsx)(Button_1.default, { variant: "primary", buttonText: "Back to the project", className: styles_module_scss_1.default.backButton, onClickHandler: () => window.location.replace((0, previewUrl_1.buildEditorUrl)(window.location.href)) })] }));
86922
+ exports["default"] = PreviewUnavailable;
86923
+
86924
+
83757
86925
  /***/ }),
83758
86926
 
83759
86927
  /***/ 75724:
@@ -84324,9 +87492,11 @@ __webpack_require__(41882);
84324
87492
  const WebComponentCustomEvents_1 = __webpack_require__(53841);
84325
87493
  const Loading_1 = __importDefault(__webpack_require__(34466));
84326
87494
  const SaveBeforeLeave_1 = __webpack_require__(47318);
87495
+ const PreviewUnavailable_1 = __importDefault(__webpack_require__(40068));
84327
87496
  const selectors_1 = __webpack_require__(43551);
84328
87497
  const stores_1 = __webpack_require__(32132);
84329
87498
  const useHostNotification_1 = __webpack_require__(11001);
87499
+ const previewUrl_1 = __webpack_require__(89441);
84330
87500
  const WebComponentLoader = (props) => {
84331
87501
  const { locale = "en", projectNameEditable = true, readOnly = false, sidebarOptions = [], project: projectData, saveProject, isSaving, loadProjectContent, projectContent = null, starterCodeContent = null, isLoading = false, packageApiUrl, user, isCodeVisible = true, isSharedProject = false, shareLinks, isContentLoaded = null, isSaveSuccess = null, notification = null, loadTemplateProjectData, isTemplateDataLoaded = false, curriculum, } = props;
84332
87502
  const dispatch = (0, react_redux_1.useDispatch)();
@@ -84340,7 +87510,7 @@ const WebComponentLoader = (props) => {
84340
87510
  const modalWindowShowing = (0, stores_1.useAppSelector)((state) => state.editor.modalWindowShowing);
84341
87511
  const projectIdentifier = (0, stores_1.useAppSelector)((state) => state.editor.project?.identifier);
84342
87512
  const { i18n } = (0, react_i18next_1.useTranslation)();
84343
- const isPreviewMode = searchParams.get("preview") === "1";
87513
+ const isPreviewMode = (0, previewUrl_1.isPreviewSearch)(searchParams);
84344
87514
  (0, react_1.useEffect)(() => {
84345
87515
  if (isPreviewMode) {
84346
87516
  dispatch((0, EditorSlice_1.setIsOutputOnly)(true));
@@ -84393,11 +87563,13 @@ const WebComponentLoader = (props) => {
84393
87563
  loadProjectContent,
84394
87564
  loadTemplateProjectData,
84395
87565
  isTemplateDataLoaded,
87566
+ isPreviewMode,
84396
87567
  });
84397
87568
  (0, useProjectStarterCode_1.useProjectStarterCode)({
84398
87569
  projectData,
84399
87570
  starterCodeContent,
84400
87571
  isLoading,
87572
+ isPreviewMode,
84401
87573
  });
84402
87574
  (0, useProjectRemix_1.useProjectRemix)({
84403
87575
  projectData,
@@ -84477,7 +87649,7 @@ const WebComponentLoader = (props) => {
84477
87649
  theme: themeDefault,
84478
87650
  fontSize: "small",
84479
87651
  }, children: (0, jsx_runtime_1.jsxs)("div", { id: "textjam-root", className: `editor-shell --${themeDefault}`, children: [(0, jsx_runtime_1.jsx)(WebComponentProject_1.default, { curriculumComponent: curriculum?.curriculumContent ?? null, nameEditable: projectNameEditable, sidebarOptions: sidebarOptions, packageApiUrl: packageApiUrl }), errorModalShowing && (0, jsx_runtime_1.jsx)(ErrorModal_1.default, {}), modal, shouldBlockNavigation && (0, jsx_runtime_1.jsx)(SaveBeforeLeave_1.SaveBeforeLeaveModal, {})] }) }) }));
84480
- const renderFailedState = () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("p", { children: t("webComponent.failed") }) }));
87652
+ const renderFailedState = () => isPreviewMode ? (0, jsx_runtime_1.jsx)(PreviewUnavailable_1.default, {}) : (0, jsx_runtime_1.jsx)("p", { children: t("webComponent.failed") });
84481
87653
  const renderLoadingState = () => (0, jsx_runtime_1.jsx)(Loading_1.default, {});
84482
87654
  const isLoadingState = ![types_1.LoadingState.SUCCESS, types_1.LoadingState.FAILED].includes(loading);
84483
87655
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [loading === types_1.LoadingState.SUCCESS && renderSuccessState(), loading === types_1.LoadingState.FAILED && renderFailedState(), isLoadingState && renderLoadingState()] }));
@@ -85310,26 +88482,24 @@ exports.useIsMounted = useIsMounted;
85310
88482
 
85311
88483
  Object.defineProperty(exports, "__esModule", ({ value: true }));
85312
88484
  exports.useProject = void 0;
88485
+ const helpers_1 = __webpack_require__(59578);
85313
88486
  const react_1 = __webpack_require__(13327);
85314
88487
  const react_redux_1 = __webpack_require__(14062);
85315
88488
  const EditorSlice_1 = __webpack_require__(68512);
85316
- const ProjectTypes_1 = __webpack_require__(27130);
85317
88489
  const stores_1 = __webpack_require__(32132);
85318
88490
  const projectHelpers_1 = __webpack_require__(2610);
88491
+ const projectSnapshotHelpers_1 = __webpack_require__(22390);
88492
+ const ProjectTypes_1 = __webpack_require__(27130);
85319
88493
  const loadProjectFromZip_1 = __webpack_require__(65404);
85320
88494
  const types_1 = __webpack_require__(92932);
85321
88495
  const useIsMounted_1 = __webpack_require__(76314);
85322
88496
  const useProjectCache_1 = __webpack_require__(69557);
85323
- const helpers_1 = __webpack_require__(59578);
85324
- const sendToast_1 = __webpack_require__(50068);
85325
88497
  const useUnsavedDraftResolution_1 = __webpack_require__(61171);
85326
- const projectSnapshotHelpers_1 = __webpack_require__(22390);
85327
88498
  const isFinalLoadingState = (state) => state === types_1.LoadingState.SUCCESS || state === types_1.LoadingState.FAILED;
85328
- const useProject = ({ projectData, projectContent = null, starterCodeContent = null, isContentLoaded = null, isLoading = false, loadProjectContent, loadTemplateProjectData, isTemplateDataLoaded, }) => {
88499
+ const useProject = ({ projectData, projectContent = null, starterCodeContent = null, isContentLoaded = null, isLoading = false, loadProjectContent, loadTemplateProjectData, isTemplateDataLoaded, isPreviewMode = false, }) => {
85329
88500
  const project = (0, stores_1.useAppSelector)((state) => state.editor.project);
85330
88501
  const loadingState = (0, stores_1.useAppSelector)((state) => state.editor.loading);
85331
88502
  const savingState = (0, stores_1.useAppSelector)((state) => state.editor.saving);
85332
- const isPreview = (0, stores_1.useAppSelector)((state) => state.editor.isOutputOnly);
85333
88503
  const commitIdLoadTriggered = (0, stores_1.useAppSelector)((state) => state.editor.commitIdLoadTriggered);
85334
88504
  const isLoadingCommit = (0, stores_1.useAppSelector)((state) => state.editor.isLoadingCommit);
85335
88505
  const saveTriggered = (0, stores_1.useAppSelector)((state) => state.editor.saveTriggered);
@@ -85403,12 +88573,12 @@ const useProject = ({ projectData, projectContent = null, starterCodeContent = n
85403
88573
  !shouldBypassCachedDraft &&
85404
88574
  (!isCurrentOutdated || isCacheNewerThanCurrentCommit);
85405
88575
  // for preview mode, always load current cached project
85406
- if (isPreview) {
85407
- if (cachedProject)
88576
+ if (isPreviewMode) {
88577
+ if (cachedProject) {
85408
88578
  dispatch((0, EditorSlice_1.setProject)(cachedProject));
88579
+ }
85409
88580
  else {
85410
- (0, sendToast_1.showError)("No project found for the preview mode");
85411
- dispatch((0, EditorSlice_1.setLoading)(types_1.LoadingState.SUCCESS));
88581
+ dispatch((0, EditorSlice_1.setLoading)(types_1.LoadingState.FAILED));
85412
88582
  }
85413
88583
  return;
85414
88584
  }
@@ -85482,7 +88652,7 @@ const useProject = ({ projectData, projectContent = null, starterCodeContent = n
85482
88652
  isCacheLoaded,
85483
88653
  dispatch,
85484
88654
  commitIdLoadTriggered,
85485
- isPreview,
88655
+ isPreviewMode,
85486
88656
  cacheKey,
85487
88657
  isContentLoaded,
85488
88658
  isTemplateDataLoaded,
@@ -85980,24 +89150,23 @@ const react_1 = __webpack_require__(13327);
85980
89150
  const react_redux_1 = __webpack_require__(14062);
85981
89151
  const EditorSlice_1 = __webpack_require__(68512);
85982
89152
  const stores_1 = __webpack_require__(32132);
89153
+ const projectSnapshotHelpers_1 = __webpack_require__(22390);
85983
89154
  const loadProjectFromZip_1 = __webpack_require__(65404);
85984
89155
  const types_1 = __webpack_require__(92932);
85985
89156
  const useIsMounted_1 = __webpack_require__(76314);
85986
89157
  const useProjectCache_1 = __webpack_require__(69557);
85987
89158
  const useUnsavedDraftResolution_1 = __webpack_require__(61171);
85988
- const projectSnapshotHelpers_1 = __webpack_require__(22390);
85989
89159
  const isFinalLoadingState = (state) => state === types_1.LoadingState.SUCCESS || state === types_1.LoadingState.FAILED;
85990
89160
  // distinguishes "not applied yet" from a project whose cache key is undefined
85991
89161
  const NOT_APPLIED = Symbol("starterCodeNotApplied");
85992
89162
  // unpacks a starter-code zip archive and applies it as the initial project
85993
- const useProjectStarterCode = ({ projectData, starterCodeContent = null, isLoading = false, }) => {
89163
+ const useProjectStarterCode = ({ projectData, starterCodeContent = null, isLoading = false, isPreviewMode = false, }) => {
85994
89164
  const dispatch = (0, react_redux_1.useDispatch)();
85995
89165
  const isMounted = (0, useIsMounted_1.useIsMounted)();
85996
89166
  const callIdRef = (0, react_1.useRef)(null);
85997
89167
  const appliedForCacheKeyRef = (0, react_1.useRef)(NOT_APPLIED);
85998
89168
  const loadingState = (0, stores_1.useAppSelector)((state) => state.editor.loading);
85999
89169
  const savingState = (0, stores_1.useAppSelector)((state) => state.editor.saving);
86000
- const isPreview = (0, stores_1.useAppSelector)((state) => state.editor.isOutputOnly);
86001
89170
  const commitIdLoadTriggered = (0, stores_1.useAppSelector)((state) => state.editor.commitIdLoadTriggered);
86002
89171
  const saveTriggered = (0, stores_1.useAppSelector)((state) => state.editor.saveTriggered);
86003
89172
  const projectFromStore = (0, stores_1.useAppSelector)((state) => state.editor.project);
@@ -86019,7 +89188,7 @@ const useProjectStarterCode = ({ projectData, starterCodeContent = null, isLoadi
86019
89188
  // another source of project content already owns this load
86020
89189
  const hasConflictingOperation = !!commitIdLoadTriggered ||
86021
89190
  !!projectData.commitId ||
86022
- isPreview ||
89191
+ isPreviewMode ||
86023
89192
  saveTriggered ||
86024
89193
  savingState === types_1.SavingState.PROCESS;
86025
89194
  // a cached draft, or a project that already finished loading, must not be
@@ -86079,7 +89248,7 @@ const useProjectStarterCode = ({ projectData, starterCodeContent = null, isLoadi
86079
89248
  cacheKey,
86080
89249
  cachedProject,
86081
89250
  commitIdLoadTriggered,
86082
- isPreview,
89251
+ isPreviewMode,
86083
89252
  loadingState,
86084
89253
  savingState,
86085
89254
  saveTriggered,
@@ -88224,6 +91393,29 @@ const filterOutMacSystemFiles = (files) => Array.from(files).filter((file) => !(
88224
91393
  exports.filterOutMacSystemFiles = filterOutMacSystemFiles;
88225
91394
 
88226
91395
 
91396
+ /***/ }),
91397
+
91398
+ /***/ 89441:
91399
+ /***/ ((__unused_webpack_module, exports) => {
91400
+
91401
+
91402
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
91403
+ exports.buildEditorUrl = exports.isPreviewSearch = exports.PAGE_PARAM = exports.PREVIEW_PARAM = void 0;
91404
+ exports.PREVIEW_PARAM = "preview";
91405
+ exports.PAGE_PARAM = "page";
91406
+ // A standalone preview view is flagged by `?preview=1` in the URL.
91407
+ const isPreviewSearch = (params) => params.get(exports.PREVIEW_PARAM) === "1";
91408
+ exports.isPreviewSearch = isPreviewSearch;
91409
+ // Drops the preview flags so the URL points at the project in the editor
91410
+ const buildEditorUrl = (href) => {
91411
+ const url = new URL(href);
91412
+ url.searchParams.delete(exports.PREVIEW_PARAM);
91413
+ url.searchParams.delete(exports.PAGE_PARAM);
91414
+ return url.toString();
91415
+ };
91416
+ exports.buildEditorUrl = buildEditorUrl;
91417
+
91418
+
88227
91419
  /***/ }),
88228
91420
 
88229
91421
  /***/ 3044:
@@ -88502,6 +91694,128 @@ const listenProjectUpdates = (expectedKey, onUpdate) => {
88502
91694
  exports.listenProjectUpdates = listenProjectUpdates;
88503
91695
 
88504
91696
 
91697
+ /***/ }),
91698
+
91699
+ /***/ 16902:
91700
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
91701
+
91702
+
91703
+ var __importDefault = (this && this.__importDefault) || function (mod) {
91704
+ return (mod && mod.__esModule) ? mod : { "default": mod };
91705
+ };
91706
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
91707
+ exports.sanitizeVisualHtml = exports.sanitizeHtml = void 0;
91708
+ const dompurify_1 = __importDefault(__webpack_require__(25454));
91709
+ /**
91710
+ * Sanitization for the few places where the editor renders HTML it did not
91711
+ * build itself.
91712
+ *
91713
+ * Runner errors are the main case: their text mixes Python traceback content
91714
+ * (fully user controlled — a shared project can put anything in there) with
91715
+ * help links the runner injects, so the markup has to survive but the payload
91716
+ * must not.
91717
+ */
91718
+ // Inline formatting plus links — enough for "Read this <a ...>article</a>"
91719
+ // style hints, nothing that can load or execute anything.
91720
+ const ALLOWED_TAGS = [
91721
+ "a",
91722
+ "b",
91723
+ "br",
91724
+ "code",
91725
+ "em",
91726
+ "i",
91727
+ "pre",
91728
+ "s",
91729
+ "small",
91730
+ "span",
91731
+ "strong",
91732
+ "sub",
91733
+ "sup",
91734
+ "u",
91735
+ ];
91736
+ const ALLOWED_ATTR = ["href", "hreflang", "lang", "rel", "target", "title"];
91737
+ // http(s), mail/phone links and anchors only — no javascript:, no data:.
91738
+ const ALLOWED_URI_REGEXP = /^(?:(?:https?|mailto|tel):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i;
91739
+ // Same, plus inline raster images: turtle scenes can embed bitmap shapes.
91740
+ // Still excludes data:image/svg+xml, which is scriptable.
91741
+ const VISUAL_ALLOWED_URI_REGEXP = /^(?:(?:https?|mailto|tel):|data:image\/(?:png|jpe?g|gif|webp);base64,|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i;
91742
+ let hooksRegistered = false;
91743
+ const registerHooks = () => {
91744
+ if (hooksRegistered)
91745
+ return;
91746
+ hooksRegistered = true;
91747
+ // Reverse tabnabbing protection: every surviving link opens in a new tab
91748
+ // and cannot reach back into the editor through window.opener.
91749
+ dompurify_1.default.addHook("afterSanitizeAttributes", (node) => {
91750
+ if (node.tagName === "A") {
91751
+ node.setAttribute("target", "_blank");
91752
+ node.setAttribute("rel", "noopener noreferrer");
91753
+ }
91754
+ });
91755
+ };
91756
+ const escapeHtml = (value) => value
91757
+ .replace(/&/g, "&amp;")
91758
+ .replace(/</g, "&lt;")
91759
+ .replace(/>/g, "&gt;")
91760
+ .replace(/"/g, "&quot;")
91761
+ .replace(/'/g, "&#39;");
91762
+ /**
91763
+ * Sanitize an HTML string before it is handed to `dangerouslySetInnerHTML`.
91764
+ *
91765
+ * @param html raw HTML from a runner, a worker or a project
91766
+ * @returns sanitized HTML, never `null`/`undefined`
91767
+ */
91768
+ const sanitizeHtml = (html) => {
91769
+ if (!html)
91770
+ return "";
91771
+ // No DOM to sanitize against (SSR, worker): degrade to plain text rather
91772
+ // than returning the markup untouched.
91773
+ if (!dompurify_1.default.isSupported)
91774
+ return escapeHtml(html);
91775
+ registerHooks();
91776
+ return dompurify_1.default.sanitize(html, {
91777
+ ALLOWED_TAGS,
91778
+ ALLOWED_ATTR,
91779
+ ALLOWED_URI_REGEXP,
91780
+ FORBID_TAGS: ["script", "style", "iframe", "object", "embed", "form"],
91781
+ FORBID_ATTR: ["srcdoc", "formaction", "ping", "xlink:href"],
91782
+ ALLOW_DATA_ATTR: false,
91783
+ });
91784
+ };
91785
+ exports.sanitizeHtml = sanitizeHtml;
91786
+ /**
91787
+ * Sanitize markup produced by a runner visual (currently turtle SVG scenes).
91788
+ *
91789
+ * `basthon.kernel.display_event` is callable from the project's own Python, so
91790
+ * the tag names and attributes reaching the DOM are user controlled. Keep SVG
91791
+ * and layout markup, drop anything executable.
91792
+ *
91793
+ * @param html serialized visual markup
91794
+ * @returns sanitized HTML, never `null`/`undefined`
91795
+ */
91796
+ const sanitizeVisualHtml = (html) => {
91797
+ if (!html)
91798
+ return "";
91799
+ if (!dompurify_1.default.isSupported)
91800
+ return escapeHtml(html);
91801
+ registerHooks();
91802
+ return dompurify_1.default.sanitize(html, {
91803
+ USE_PROFILES: { html: true, svg: true, svgFilters: true },
91804
+ ALLOWED_URI_REGEXP: VISUAL_ALLOWED_URI_REGEXP,
91805
+ FORBID_TAGS: [
91806
+ "script",
91807
+ "iframe",
91808
+ "object",
91809
+ "embed",
91810
+ "form",
91811
+ "foreignObject",
91812
+ ],
91813
+ FORBID_ATTR: ["srcdoc", "formaction", "ping"],
91814
+ });
91815
+ };
91816
+ exports.sanitizeVisualHtml = sanitizeVisualHtml;
91817
+
91818
+
88505
91819
  /***/ }),
88506
91820
 
88507
91821
  /***/ 41835: