Commit inicial powerservice

This commit is contained in:
Gabriel
2026-10-19 12:45:45 -06:00
commit ad85486fe2
10158 changed files with 2736804 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
# Security Policy
## Reporting Security Bugs
Please report security bugs found in the site-reviews plugin's source code through the [Patchstack Vulnerability Disclosure Program](https://patchstack.com/database/vdp/wp-rocket). The Patchstack team will assist you with verification, CVE assignment and take care of notifying the developers of this plugin.
---
@@ -0,0 +1,25 @@
.rocket-plugins-error{overflow:hidden; padding-left:20px; list-style-type:disc}
.rocket-plugins-error li{line-height:25px}
#wp-admin-bar-purge-all-all .dashicons{font:normal 1.5em/1 'dashicons'; -webkit-font-smoothing:antialiased; vertical-align:middle; padding-right:3px; display:inline-block}
.rocket-purchase, .dashicons.dashicons-update.rocket-dashicons:before{color:#D54E21}
.rocket-purchase{font-weight:900}
.rocket-renew{font-weight:400}
.rkt-disabled{color:#CCC}
.rkt-note{font-style:italic; font-weight:bold; font-size:smaller}
#wp-admin-bar-wp-rocket #wp-admin-bar-purge-all .ab-item>img, #wp-admin-bar-wp-rocket #wp-admin-bar-preload-cache .ab-item>img{max-width: 16px; max-height: 11px}
.rocket-promo-bubble {
display: inline-block;
vertical-align: top;
box-sizing: border-box;
margin: 1px 0 -1px 2px;
padding: 0 5px;
min-width: 18px;
height: 18px;
border-radius: 9px;
background-color: #00A66B;
color: #fff;
font-size: 11px;
line-height: 1.6;
text-align: center;
z-index: 26;
}
@@ -0,0 +1,332 @@
/*-----------------------------------------------*\
Author: Thomas Geisen (www.thomasgeisen.fr)
Method : SUITCSS (modified)
--- This file is only for RTL languages
\*-----------------------------------------------*/
.wpr-wrap {
margin: 0 -20px 0 0;
}
#hs-beacon iframe:nth-child(1) {
right: inherit !important;
left: 18px !important;
}
#hs-beacon iframe:nth-child(2) {
right: inherit !important;
left: 6px !important;
}
.wpr-Page-col--fixed {
margin-left: 0;
margin-right: 24px;
}
@media (max-width: 1239px) {
.wpr-Page-col--fixed {
margin-right: 0;
}
}
.wpr-Content {
border: 1px solid #E0E4E9;
border-right: none;
}
.wpr-Content-tips {
right: unset;
left: 24px;
}
.wpr-Sidebar-notice {
border: 1px solid #E8EBEE;
border-right: 2px solid #1EADBF;
}
.wpr-Sidebar .wpr-Sidebar-info h4 {
padding-left: inherit;
padding-right: 56px;
}
.wpr-menuItem {
padding: 16px 20px 18px 44px;
}
.wpr-menuItem:before {
right: inherit !important;
left: 18px !important;
}
.wpr-menuItem:after {
border-width: 12px 0 12px 10px;
border-color: transparent transparent transparent #fff;
left: 0;
right: inherit;
transform: translateX(-12px);
}
.wpr-menuItem:hover {
transform: translateX(0);
}
.wpr-menuItem.wpr-subMenuItem {
padding: 10px 25px 8px 20px;
}
.wpr-sectionHeader:before {
left: inherit;
right: 0;
}
.wpr-sectionHeader .wpr-title1:before {
margin-left: 24px;
margin-right: 0;
}
.wpr-optionHeader .wpr-title2 {
padding-right: 0;
padding-left: 40px;
}
.wpr-infoAction:before {
right: -26px;
}
.wpr-fieldWarning {
padding: 16px 56px 24px 16px;
}
.wpr-fieldWarning:after {
left: inherit;
right: 20px;
}
.wpr-fieldWarning:before {
left: inherit;
right: -16px;
}
.wpr-fieldWarning-title:before {
left: inherit;
right: -40px;
}
.wpr-fieldWarning.wpr-radio-warning {
margin-left: 0;
margin-right: -32px;
}
.wpr-fieldWarning.wpr-radio-warning:after {
left: inherit;
right: 40px;
}
@media only screen and (max-width: 400px) {
.wpr-fieldWarning.wpr-radio-warning {
margin-left: 0;
margin-right: -32px;
}
.wpr-fieldWarning.wpr-radio-warning .wpr-button {
padding-right: 8px;
padding-left: 32px;
}
}
@media only screen and (max-width: 350px) {
.wpr-radio-buttons {
padding-left: 0;
padding-right: 24px;
}
.wpr-fieldWarning.wpr-radio-warning {
margin-left: 0;
margin-right: -24px;
padding-left: 0;
padding-right: 30px;
}
.wpr-fieldWarning.wpr-radio-warning .wpr-button {
white-space: normal;
padding-right: 8px;
padding-left: 25px;
}
}
.wpr-checkbox {
padding-left: 0;
padding-right: 32px;
}
.wpr-checkbox [type=checkbox]:not(:checked),
.wpr-checkbox [type=checkbox]:checked {
right: -9999px;
}
.wpr-checkbox [type=checkbox]:not(:checked) + label:before,
.wpr-checkbox [type=checkbox]:checked + label:before {
left: inherit;
right: 0;
}
.wpr-checkbox [type=checkbox]:not(:checked) + label:after,
.wpr-checkbox [type=checkbox]:checked + label:after {
left: inherit;
right: 2px;
}
.wpr-radio {
padding-left: 0;
padding-right: 88px;
}
.wpr-radio [type=checkbox]:not(:checked),
.wpr-radio [type=checkbox]:checked {
right: -9999px;
}
.wpr-radio [type=checkbox]:not(:checked) + label:before,
.wpr-radio [type=checkbox]:checked + label:before {
left: inherit;
right: 0;
}
.wpr-radio [type=checkbox]:not(:checked) + label:after,
.wpr-radio [type=checkbox]:checked + label:after {
left: inherit;
right: 3px;
}
.wpr-radio [type=checkbox]:checked + label:after {
right: 33px;
}
.wpr-radio [type=checkbox]:checked + label .wpr-radio-ui,
.wpr-radio [type=checkbox]:not(:checked) + label .wpr-radio-ui:before,
.wpr-radio [type=checkbox]:checked + label .wpr-radio-ui:after {
right: 4px;
}
.wpr-radio [type=checkbox]:not(:checked) + label .wpr-radio-ui:before {
right: 27px;
}
.wpr-radio--reverse {
padding-left: 0;
padding-right: 72px;
}
.wpr-radio--reverse [type=checkbox]:not(:checked) + label:before,
.wpr-radio--reverse [type=checkbox]:checked + label:before {
right: 0;
left: inherit;
}
.wpr-radio--reverse [type=checkbox]:not(:checked) + label:after,
.wpr-radio--reverse [type=checkbox]:checked + label:after {
right: 33px;
left: inherit;
}
.wpr-radio--reverse [type=checkbox]:checked + label:after {
right: 3px;
left: inherit;
}
.wpr-radio--reverse [type=checkbox]:checked + label .wpr-radio-ui,
.wpr-radio--reverse [type=checkbox]:not(:checked) + label .wpr-radio-ui:before,
.wpr-radio--reverse [type=checkbox]:checked + label .wpr-radio-ui:after {
right: 15px;
left: inherit;
}
.wpr-radio--reverse [type=checkbox]:not(:checked) + label .wpr-radio-ui:before {
right: 6px;
left: inherit;
}
.wpr-multiple .wpr-button {
margin-right: 16px;
margin-left: 0;
}
.wpr-multiple-close {
margin-right: 0;
margin-left: 16px;
}
.wpr-addon .wpr-flex > div {
text-align: right;
}
.wpr-addon .wpr-addon-text {
margin-left: inherit;
margin-right: 32px;
}
@media (max-width: 1239px) {
.wpr-addon .wpr-addon-text {
margin-right: 16px;
}
}
@media (max-width: 1083px) {
.wpr-addon .wpr-addon-text {
margin-right: 32px;
}
}
@media (max-width: 783px) {
.wpr-addon .wpr-addon-text {
margin-right: 0;
}
}
.wpr-tools-col:first-child {
padding-right: 72px;
padding-left: 24px;
}
.wpr-tools-col:last-child {
text-align: left;
}
@media (max-width: 783px) {
.wpr-tools-col:last-child {
text-align: right;
}
}
.wpr-tools-label:before {
left: inherit;
right: 0;
}
.wpr-field .wpr-flex--egal > div:last-child {
text-align: left;
}
.wpr-field-list li:before {
display: inline-block;
margin-right: 0;
margin-left: 8px;
}
.wpr-field--split {
padding-right: 0;
}
.wpr-field--split + .wpr-field--split {
padding-left: 0;
padding-right: 16px;
}
.wpr-field--children {
padding-left: 0;
padding-right: 32px;
}
.wpr-field--children.wpr-field--textarea {
padding-left: 80px;
padding-right: 32px;
}
@media (max-width: 1239px) {
.wpr-field--children.wpr-field--textarea {
padding-left: 32px;
padding-right: 0;
}
}
@media (max-width: 783px) {
.wpr-field--children.wpr-field--textarea {
padding-left: 0;
}
}
.wpr-field--children.no-space {
padding-right: 0;
}
.wpr-field--checkbox .wpr-field-description {
margin-left: 0;
margin-right: 32px;
}
.wpr-field--radio .wpr-field-description {
margin-left: 0;
margin-right: 88px;
}
.wpr-adblock img {
margin-right: 0;
margin-left: 16px;
}
.wpr-adblock-close {
right: inherit;
left: 24px;
}
.wpr-notice {
background-position: 10% bottom;
}
.wpr-notice-container {
padding: 24px 40px 24px 25%;
}
.wpr-notice-close {
right: inherit;
left: 24px;
}
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,75 @@
.wpr-modal {
display: none;
}
.wpr-modal.is-open {
display: block;
}
.wpr-modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.6);
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
}
.wpr-modal-container {
background-color: #fff;
padding: 30px;
max-width: 645px;
max-height: 100vh;
overflow-y: auto;
box-sizing: border-box;
}
.wpr-modal-header,
.wpr-modal-footer {
display: flex;
justify-content: space-between;
align-items: center;
}
.wpr-modal-title {
font-size: 26px;
font-weight: 600;
line-height: 1.2;
margin: 0;
}
.wpr-modal-footer {
margin-top: 40px;
}
.wpr-modal-button {
border-radius: 4px;
cursor: pointer;
padding: 8px 20px;
text-transform: uppercase;
}
.wpr-modal-cancel {
background: transparent;
border: 1px solid #000;
}
.wpr-modal-confirm {
background: #F56F46;
border: none;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
color: #fff;
transition: box-shadow 500ms ease-in;
}
.wpr-modal-confirm:hover {
box-shadow: none;
}
.wpr-modal .wpr-sub-list {
padding-left: 25px;
}
@@ -0,0 +1,39 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="icomoon" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe900;" glyph-name="chevron-right" horiz-adv-x="695" d="M632.571 449.714l-424-424c-14.286-14.286-37.143-14.286-51.429 0l-94.857 94.857c-14.286 14.286-14.286 37.143 0 51.429l303.429 303.429-303.429 303.429c-14.286 14.286-14.286 37.143 0 51.429l94.857 94.857c14.286 14.286 37.143 14.286 51.429 0l424-424c14.286-14.286 14.286-37.143 0-51.429z" />
<glyph unicode="&#xe901;" glyph-name="chevron-down" d="M961.714 489.143l-424-423.429c-14.286-14.286-37.143-14.286-51.429 0l-424 423.429c-14.286 14.286-14.286 37.714 0 52l94.857 94.286c14.286 14.286 37.143 14.286 51.429 0l303.429-303.429 303.429 303.429c14.286 14.286 37.143 14.286 51.429 0l94.857-94.286c14.286-14.286 14.286-37.714 0-52z" />
<glyph unicode="&#xe902;" glyph-name="chevron-up" d="M961.714 190.286l-94.857-94.286c-14.286-14.286-37.143-14.286-51.429 0l-303.429 303.429-303.429-303.429c-14.286-14.286-37.143-14.286-51.429 0l-94.857 94.286c-14.286 14.286-14.286 37.714 0 52l424 423.429c14.286 14.286 37.143 14.286 51.429 0l424-423.429c14.286-14.286 14.286-37.714 0-52z" />
<glyph unicode="&#xe903;" glyph-name="rollback" d="M559.639 917.333c256.018 0 464.312-208.294 464.361-464.312 0-256.018-208.294-464.312-464.312-464.312-13.413 0-24.299 10.886-24.299 24.299s10.886 24.299 24.299 24.299c229.24 0 415.713 186.473 415.713 415.713s-186.473 415.713-415.713 415.713c-210.821 0-385.048-159.841-411.242-365.851l76.349 61.283c10.497 8.408 25.806 6.707 34.116-3.694 8.408-10.449 6.707-25.757-3.742-34.165l-119.65-96.031c-0.389-0.34-0.923-0.194-1.361-0.486-3.985-2.819-8.553-4.86-13.802-4.86-0.049 0-0.049 0-0.049 0-3.548 0-6.852 0.826-9.914 2.187-0.778 0.34-1.409 0.972-2.138 1.409-2.236 1.312-4.277 2.77-5.978 4.714-0.243 0.292-0.68 0.389-0.923 0.729l-96.031 119.65c-8.359 10.449-6.707 25.757 3.791 34.165 10.4 8.408 25.709 6.707 34.165-3.742l57.492-71.634c30.714 228.268 224.526 404.924 458.869 404.924zM631.41 328.761l-76.683 76.808-76.803-76.808c-5.88-5.821-13.561-8.761-21.241-8.761s-15.361 2.88-21.241 8.761c-11.7 11.701-11.7 30.723 0 42.424l76.803 76.808-76.803 76.808c-11.7 11.701-11.7 30.723 0 42.424s30.721 11.701 42.422 0l76.803-76.807 76.803 76.807c11.7 11.701 30.721 11.701 42.422 0s11.7-30.723 0-42.424l-76.803-76.808 76.803-76.808c11.7-11.701 11.7-30.723 0-42.424-5.88-5.821-13.561-8.761-21.241-8.761s-15.361 2.88-21.241 8.761z" />
<glyph unicode="&#xe904;" glyph-name="addon" horiz-adv-x="896" d="M444.42 960l-444.42-256.597v-512.427l444.42-254.976 444.25 254.976v512.427l-444.25 256.597zM79.915 688.128l364.501 210.432 364.373-210.432-364.373-210.133-364.501 210.133zM470.997 431.787l364.544 210.389v-420.395l-364.544-209.237v419.243zM53.205 221.781v420.395l364.629-210.389v-419.243l-364.629 209.237z" />
<glyph unicode="&#xe905;" glyph-name="addons" d="M1022.417 418.505c0 0.085-0.043 0.128-0.043 0.171-0.043 3.883-1.323 7.509-3.285 10.752-0.64 1.024-1.621 1.749-2.432 2.645-1.237 1.451-2.133 3.072-3.712 4.139-0.725 0.469-1.579 0.469-2.347 0.853-0.555 0.256-0.811 0.896-1.408 1.152l-241.323 98.944v301.739c0 0.043 0 0 0 0 0 0.043-0.043 0.085-0.043 0.213-0.043 3.883-1.28 7.467-3.243 10.667-0.64 1.067-1.621 1.707-2.432 2.688-1.237 1.451-2.219 3.115-3.84 4.224-0.64 0.427-1.451 0.384-2.091 0.725-0.512 0.213-0.768 0.853-1.323 1.109l-235.349 99.797c-5.333 2.261-11.392 2.261-16.725-0.043l-233.131-99.797c-0.555-0.213-0.768-0.853-1.28-1.067-0.683-0.341-1.408-0.299-2.048-0.725-1.664-1.067-2.603-2.773-3.883-4.224-0.811-0.981-1.792-1.621-2.432-2.688-1.963-3.2-3.157-6.784-3.243-10.667 0-0.128-0.085-0.171-0.085-0.213v-301.696l-243.456-98.987c-0.597-0.256-0.853-0.896-1.408-1.152-0.768-0.384-1.707-0.384-2.432-0.853-1.579-1.067-2.475-2.688-3.712-4.139-0.811-0.896-1.749-1.579-2.389-2.603-2.005-3.243-3.243-6.869-3.285-10.752 0-0.085-0.043-0.128-0.043-0.171v-334.336c0-8.661 5.248-16.512 13.227-19.712l256.725-105.643c2.645-1.067 5.376-1.664 8.107-1.664 2.987 0 6.016 0.683 8.832 1.92l224.384 101.632 226.517-101.675c2.773-1.195 5.803-1.877 8.747-1.877 2.731 0 5.547 0.597 8.149 1.664l254.549 105.643c7.979 3.243 13.184 11.093 13.184 19.712v334.293c0-0.043 0-0.043 0 0zM454.353 739.273l35.541-15.445v-272.427l-190.464 85.333v269.653l154.923-67.115zM725.201 536.777l-192.64-85.461v272.512l192.64 82.688v-269.739zM746.876 336.030l-183.339 82.347 183.339 81.323 198.272-81.323-198.272-82.347zM511.27 915.443l180.907-76.672-180.907-77.611-179.2 77.611 179.2 76.672zM277.67 499.699l181.589-81.323-181.632-82.347-199.979 82.347 200.021 81.323zM42.662 386.59l214.059-88.107v-288.128l-214.059 88.064v288.171zM299.43 299.038l190.464 86.315v-287.488l-190.464-86.229v287.403zM532.561 385.481l192.64-86.528v-287.488l-192.64 86.4v287.616zM979.75 98.419l-211.883-87.936v288.043l211.883 88.021v-288.128z" />
<glyph unicode="&#xe906;" glyph-name="book" d="M1001.942 893.98c-4.193 3.902-9.797 5.687-15.526 5.563 0 0-24.41-1.578-62.519-5.687v21.67c0 5.729-2.366 11.209-6.518 15.111s-9.507 5.812-15.485 5.604c-57.123-3.487-312.97-23.746-390.393-111.505-74.973 87.427-334.557 107.977-392.095 111.505-5.604 0.291-11.292-1.661-15.485-5.604-4.151-3.944-6.518-9.382-6.518-15.111v-21.961c-38.898 4.317-62.436 5.978-62.436 5.978-5.687 0.249-11.375-1.619-15.609-5.521-4.193-3.944-6.559-9.424-6.559-15.194v-803.453c0-5.853 2.449-11.375 6.767-15.318 4.276-3.902 10.046-5.895 15.858-5.355 169.085 14.986 442.16 6.476 454.698-80.868 0.083-0.415 0.332-0.789 0.415-1.204 0.249-1.162 0.664-2.159 1.079-3.238 0.54-1.37 1.079-2.657 1.868-3.819 0.623-0.955 1.328-1.744 2.117-2.574 0.955-1.038 1.951-1.993 3.114-2.823 0.913-0.664 1.868-1.204 2.906-1.744 1.328-0.664 2.74-1.121 4.193-1.494 0.664-0.166 1.245-0.581 1.951-0.706 0.996-0.125 1.951-0.208 2.906-0.208 0 0 0 0 0.042 0 0 0 0 0 0.042 0 0 0 0 0 0 0s0 0 0 0c0.498 0 0.955 0 1.453 0.042 0.955 0.083 1.744 0.54 2.657 0.706 1.37 0.291 2.74 0.54 3.985 1.079 1.121 0.498 2.034 1.162 3.030 1.827 1.079 0.706 2.159 1.37 3.072 2.283 0.872 0.83 1.494 1.744 2.2 2.698 0.789 1.079 1.536 2.117 2.117 3.321 0.498 1.079 0.83 2.2 1.121 3.363 0.249 0.872 0.706 1.619 0.83 2.532 12.579 87.344 285.696 95.938 454.698 80.868 6.061-0.374 11.582 1.453 15.9 5.355 4.317 3.944 6.725 9.507 6.725 15.318v803.411c-0.042 5.729-2.449 11.209-6.601 15.152zM882.384 893.232v-689.124c-77.381 5.397-266.475 12.039-350.997-41.43l-0.208 615.313c9.216 62.312 203.873 103.576 351.204 115.242zM138.918 893.232c147.331-11.665 341.988-52.805 350.997-112.211v-618.302c-57.745 36.449-164.269 44.918-250.617 44.918-40.061 0-75.845-1.827-100.338-3.529v689.124h-0.042zM54.314 97.834v758.41c10.877-0.996 25.489-2.449 43.091-4.442v-670.111c0-5.812 2.449-11.333 6.725-15.277s9.797-5.687 15.817-5.397c147.539 12.869 359.216 2.408 369.927-60.61v-58.202c-100.629 72.524-352.408 61.565-435.56 55.628zM966.988 97.834c-83.276 5.895-335.097 16.813-435.601-55.794v58.41c10.752 62.934 222.263 73.437 369.968 60.61 5.48-0.415 11.499 1.453 15.817 5.397s6.725 9.507 6.725 15.277v670.36c17.394 1.91 32.090 3.321 43.091 4.276v-758.535z" />
<glyph unicode="&#xe907;" glyph-name="cdn" d="M999.667 194.295c-15.061 33.451-53.973 56.661-99.285 36.395l-165.291-74.496c-9.045 10.411-21.376 18.133-36.139 22.4l-234.496 68.011c-105.429 30.507-288.597-0.171-376.619-14.976l-25.941-4.309c-30.933-4.907-54.912-27.947-61.099-58.667-3.456-17.067 4.523-49.28 20.437-102.656l3.84-13.056c10.667-38.315 50.944-61.611 89.557-51.627 18.432 4.608 36.224 9.472 53.12 14.165 56.107 15.317 109.184 29.781 132.224 19.669 99.627-44.075 194.005-65.451 288.469-65.451 95.659 0 98.645 1.408 254.293 72.747 32.512 14.933 71.893 32.939 120.405 54.869 43.307 19.584 51.115 64.597 36.523 96.981zM945.609 136.269c-48.683-21.973-88.064-40.064-120.661-54.955-150.144-68.907-150.144-68.907-236.501-68.907-88.405 0-177.109 20.224-271.232 61.781-11.136 4.864-23.851 6.997-38.059 6.997-33.067 0-74.325-11.349-122.667-24.576-16.64-4.523-34.133-9.344-52.309-13.952-16.213-4.011-33.493 5.547-38.016 21.803l-4.053 13.739c-5.163 17.408-20.907 70.144-19.499 82.091 2.645 13.099 12.8 22.827 25.899 24.917l26.368 4.437c84.907 14.251 261.547 43.819 357.675 16.043l234.453-68.096c8.661-2.517 14.891-6.869 18.56-13.056 0.299-1.493 0.811-2.987 1.408-4.437 0.427-0.939 0.896-1.835 1.451-2.688 0-0.043 0-0.085 0.043-0.171 2.773-11.349-1.195-24.96-9.728-33.109-7.637-7.381-17.493-9.387-29.397-5.845l-246.357 71.467c-11.349 3.328-23.168-3.243-26.411-14.549-3.285-11.307 3.243-23.168 14.549-26.453l246.315-71.467c26.453-7.637 52.267-1.877 70.869 16.043 16.939 16.299 25.6 40.363 23.381 63.573l166.187 74.795c28.416 12.8 40.704-10.155 42.923-14.976 5.803-12.885 5.333-31.232-15.189-40.448zM651.379 314.786c171.989 0 311.936 139.904 311.936 311.936s-139.904 311.936-311.936 311.936c-172.032 0-311.936-139.989-311.936-311.979s139.904-311.893 311.936-311.893zM651.379 895.949c148.437 0 269.269-120.789 269.269-269.269s-120.789-269.269-269.269-269.269c-148.48 0-269.269 120.789-269.269 269.269s120.789 269.269 269.269 269.269zM486.387 696.866c16.171 5.717 27.136 12.288 34.56 18.56 0.768-2.091 1.408-3.243 1.92-4.139 2.56-4.523 16.939-26.795 38.101-23.509 9.429 1.451 21.675 7.979 26.539 30.592l1.877 8.832c4.011 18.773 7.765 36.48 8.192 38.4 4.096 0 8.96 0.512 14.208 1.152 6.4 0.811 18.347 2.219 21.461-0.299 1.152-0.939 2.773-4.523 3.371-11.435 0.128-1.493 0.256-2.816 0.341-4.053-4.821-0.64-10.411-2.091-16.427-4.992-25.088-11.989-35.968-40.875-33.493-61.909 2.133-18.261 13.781-31.829 30.379-35.456 15.232-3.328 48.555-15.915 64.853-22.315l18.432-20.565c10.837-42.24 10.837-45.653 10.709-75.392l-0.043-12.672c0.384-24.576 4.949-56.021 24.533-66.432 4.309-2.261 8.917-3.413 13.568-3.413 6.144 0 12.331 1.92 18.176 5.717 25.387 16.555 96.896 120.747 79.317 170.624-2.773 7.936-6.144 17.493-7.253 22.528 1.365 0.896 3.541 2.176 6.997 4.053 34.517 18.688 51.328 40.789 49.963 65.579-0.64 11.733-10.325 20.949-22.443 20.139-11.733-0.64-20.779-10.667-20.139-22.443 0.213-3.84-5.376-13.611-27.691-25.728-39.637-21.461-32.128-42.837-19.669-78.251 6.272-17.92-28.331-82.133-51.115-109.611-0.896 5.589-1.493 11.989-1.579 17.664l0.043 12.16c0.128 34.475-0.341 40.832-13.312 91.264-0.896 3.328-2.517 6.357-4.779 8.917l-25.259 28.16c-2.176 2.432-4.864 4.309-7.893 5.547-5.376 2.133-52.864 21.205-73.173 23.893-1.451 3.541 1.664 15.915 9.387 19.584 3.2 1.579 4.736 1.408 8.448 0.939 4.651-0.555 15.488-1.792 24.192 6.656 9.856 9.643 9.301 22.827 7.467 43.563-1.579 18.133-7.979 31.915-18.987 40.875-17.024 13.867-38.827 11.264-53.419 9.557-3.371-0.427-6.485-0.853-9.131-0.853-24.021 0-34.176-13.141-41.344-36.267-0.128 1.877-0.256 3.755-0.384 5.589-0.597 9.429-7.253 17.323-16.469 19.456-9.173 2.133-18.688-2.005-23.339-10.197l-20.523-36.523c0-0.043-2.944-4.395-16.256-10.112 1.792 10.027 6.272 24.619 11.776 37.291 4.693 10.795-0.256 23.339-11.051 28.075s-23.381-0.213-28.075-11.051c-13.227-30.336-25.045-70.656-6.443-90.667 5.589-6.144 18.304-14.976 40.875-7.083zM503.539 562.295c1.451-0.555 3.115-1.195 4.864-1.877-14.336-13.611-24.789-30.507-45.397-90.923-3.797-11.179 2.133-23.296 13.312-27.093 2.304-0.811 4.608-1.152 6.912-1.152 8.875 0 17.152 5.589 20.181 14.421 21.504 63.019 28.288 68.779 40.619 79.232l6.869 5.973c11.648 10.496 11.605 21.845 10.539 27.605-3.456 18.688-22.485 25.899-42.624 33.621-6.357 2.432-17.024 6.485-19.541 8.533-9.685 9.685-17.152 14.165-23.765 18.091-3.968 2.389-8.32 4.949-14.037 9.472-7.851 6.229-17.835 7.68-26.624 3.84-7.125-3.072-23.723-10.24-30.208-83.456-1.024-11.733 7.637-22.101 19.371-23.125 11.947-1.408 22.101 7.637 23.125 19.371 1.152 13.099 3.371 27.264 5.675 37.717 0.256-0.128 0.512-0.299 0.768-0.469 5.76-3.456 9.557-5.717 15.488-11.648 8.192-8.107 20.949-12.971 34.475-18.133z" />
<glyph unicode="&#xe908;" glyph-name="database" d="M935.522 830.851c0.045 0.178 0.134 0.356 0.134 0.534 0.445 3.517-0.223 6.901-1.336 10.151-15.36 86.995-173.19 118.472-309.649 118.472-136.37 0-294.2-31.477-309.649-118.428-0.89-2.36-1.514-4.897-1.514-7.524 0-0.846 0.267-1.914 0.401-2.938-0.045-1.202-0.401-2.315-0.401-3.517v-9.261c-124.883-9.261-246.739-46.614-246.739-129.959v-618.362c0-5.654 1.024-11.219 2.271-14.202 20.703-84.057 179.378-113.931 308.936-113.931s288.189 29.919 308.090 111.482c2.003 5.298 3.027 10.908 3.027 16.696v13.401c70.879 5.343 223.455 26.579 243.801 109.301 1.959 5.432 2.938 10.908 2.938 16.429v618.407c0.045 1.113-0.267 2.137-0.312 3.25zM376.507 579.927c122.791 0 217.311 28.761 268.911 61.752l-0.223-152.531c-8.771-16.429-95.588-74.396-268.644-74.396-171.453 0-256.757 56.543-266.062 75.286v150.083c49.864-32.056 141.267-60.193 266.017-60.193zM892.158 782.011l-0.223-155.114c-7.435-13.223-71.591-57.299-202.797-69.498v130.983c0 1.113-0.312 2.093-0.356 3.206 0.045 0.178 0.134 0.401 0.178 0.623 0.445 3.517-0.223 6.945-1.336 10.24-1.336 7.302-3.473 14.336-6.678 20.836 90.379 7.613 166.333 31.076 211.211 58.724zM110.445 431.402c49.909-32.1 141.312-60.238 266.062-60.238 122.524 0 216.91 28.672 268.6 61.574l-0.223-152.754c-9.795-16.874-96.479-73.995-268.377-73.995-171.542 0-256.89 56.676-266.106 75.42l0.045 149.994zM689.139 513.634c88.153 7.747 159.878 30.319 202.707 57.077l-0.267-153.11c-8.326-13.713-72.348-57.077-202.44-69.053v165.087zM624.671 916.378c141.267 0 253.462-34.593 266.195-80.228-12.021-16.384-93.273-66.426-248.877-71.324-59.971 40.114-167.357 55.964-263.969 55.964-6.901 0-13.891-0.178-20.881-0.312v5.209c0.045 0.534 0.045 1.069 0.045 1.603 0 0.49 0 0.89-0.045 1.38 1.736 49.286 118.65 87.708 267.531 87.708zM377.976 777.203c141.446 0 253.863-34.727 266.24-80.451-11.754-17.72-98.126-73.238-267.709-73.238-167.046 0-251.904 53.515-264.726 73.55 12.778 45.546 125.017 80.139 266.195 80.139zM377.976-14.527c-140.644 0-255.243 34.727-267.576 84.547v152.576c49.909-32.056 141.312-60.238 266.106-60.238 122.257 0 216.509 28.494 268.288 61.395l-0.267-157.518c-11.309-46.035-125.907-80.762-266.552-80.762zM689.139 127.408v177.419c87.93 7.702 159.521 30.141 202.351 56.81l-0.267-156.138c-9.617-39.135-89.978-69.498-202.084-78.091z" />
<glyph unicode="&#xe909;" glyph-name="export" d="M1002.101 804.352l-141.312 139.477c-6.912 6.827-16.427 16.171-34.261 16.171h-521.131c-30.293 0-54.912-24.96-54.912-55.68v-327.936c0-11.776 9.557-21.333 21.333-21.333s21.333 9.557 21.333 21.333v327.936c0 7.083 5.589 13.013 12.245 13.013l499.755 0.299v-149.632c0-11.776 9.557-21.333 21.333-21.333h149.333v-755.2c0-6.912-5.717-12.8-12.459-12.8h-657.963c-6.656 0-12.245 5.888-12.245 12.8v284.203c0 11.776-9.557 21.333-21.333 21.333s-21.333-9.557-21.333-21.333v-284.203c0-30.592 24.619-55.467 54.912-55.467h657.963c30.379 0 55.125 24.875 55.125 55.467v776.533c0 17.835-8.789 28.8-16.384 36.352zM847.819 896.597l108.715-107.264h-108.715v107.264zM71.285 404.053l95.616-99.712c8.149-8.491 7.851-22.016-0.64-30.165-4.139-3.968-9.429-5.931-14.763-5.931-5.632 0-11.221 2.176-15.403 6.571l-130.219 135.808c-0.853 0.853-1.237 1.963-1.877 2.901-0.853 1.237-1.835 2.347-2.432 3.797-2.091 5.163-2.091 10.923 0 16.085 0.597 1.408 1.579 2.56 2.432 3.797 0.64 0.981 1.024 2.091 1.877 2.944l130.219 135.808c8.149 8.533 21.632 8.747 30.165 0.64 8.533-8.149 8.789-21.675 0.64-30.165l-95.616-99.712h501.973c11.776 0 21.333-9.557 21.333-21.333s-9.557-21.333-21.333-21.333h-501.973z" />
<glyph unicode="&#xe90a;" glyph-name="files" horiz-adv-x="811" d="M778.935 796.523c0 3.328-0.981 6.315-2.389 9.088-2.133 8.704-5.845 17.024-12.416 23.339l-119.893 116.821c-5.76 5.632-14.507 14.251-30.635 14.251h-442.325c-27.008 0-48.981-22.144-48.981-49.28v-764.885c0-27.093 21.973-49.109 48.981-49.109h558.507c27.093 0 49.152 22.016 49.152 49.109v648.149c0 0.427-0.256 0.853-0.256 1.237 0 0.469 0.256 0.853 0.256 1.28zM717.751 817.003h-83.712v81.536l83.712-81.536zM729.783 137.664h-558.507c-4.309 0-8.021 3.755-8.021 8.149v764.928c0 4.437 3.712 8.32 8.021 8.32l421.845 0.555v-123.093c0-11.307 9.131-20.48 20.48-20.48h124.373v-630.187c0-4.437-3.755-8.192-8.192-8.192zM614.669 304.619h-327.68c-11.264 0-20.48-9.173-20.48-20.437 0-11.349 9.216-20.523 20.48-20.523h327.68c11.349 0 20.48 9.173 20.48 20.523 0 11.264-9.131 20.437-20.48 20.437zM614.669 427.499h-327.68c-11.264 0-20.48-9.173-20.48-20.437 0-11.307 9.216-20.523 20.48-20.523h327.68c11.349 0 20.48 9.216 20.48 20.523 0 11.264-9.131 20.437-20.48 20.437zM614.669 550.379h-327.68c-11.264 0-20.48-9.173-20.48-20.48 0-11.264 9.216-20.48 20.48-20.48h327.68c11.349 0 20.48 9.216 20.48 20.48 0 11.307-9.131 20.48-20.48 20.48zM286.989 632.341h204.843c11.264 0 20.437 9.173 20.437 20.437 0 11.307-9.173 20.523-20.437 20.523h-204.843c-11.264 0-20.48-9.216-20.48-20.523 0-11.264 9.216-20.437 20.48-20.437zM677.773 46.571c11.307 0 20.48-9.131 20.48-20.437 0-27.733-22.528-50.261-50.219-50.261h-597.845c-27.691 0-50.176 22.528-50.176 50.261v761.6c0 27.691 22.485 50.219 50.176 50.219 11.349 0 20.48-9.216 20.48-20.48 0-11.307-9.131-20.48-20.48-20.48-5.077 0-9.216-4.139-9.216-9.259v-761.6c0-5.077 4.139-9.301 9.216-9.301h597.845c5.077 0 9.259 4.224 9.259 9.301 0 11.264 9.173 20.437 20.48 20.437z" />
<glyph unicode="&#xe90b;" glyph-name="help" d="M887.475 101.089c84.426 91.337 136.525 212.989 136.525 346.889s-52.055 255.552-136.525 346.889c-0.831 1.225-1.356 2.625-2.45 3.718-0.656 0.656-1.531 0.962-2.275 1.531-93.349 98.249-224.843 159.884-370.729 159.884-133.812 0-255.42-52.011-346.758-136.393-1.312-0.919-2.712-1.487-3.849-2.625-0.7-0.7-1.006-1.575-1.575-2.362-98.205-93.349-159.84-224.8-159.84-370.685 0-145.842 61.591-277.292 159.753-370.598 0.612-0.787 0.919-1.75 1.619-2.45 1.181-1.181 2.625-1.793 3.981-2.668 91.293-84.251 212.814-136.218 346.583-136.218 145.886 0 277.38 61.635 370.729 159.884 0.744 0.569 1.619 0.831 2.275 1.531 1.137 1.050 1.706 2.406 2.537 3.674zM868.316 144.964l-154.897 154.897c30.621 41.557 48.949 92.649 48.949 148.073s-18.329 106.56-48.949 148.073l154.853 154.897c69.596-81.757 111.897-187.442 111.897-302.97s-42.213-221.213-111.853-302.97zM305.288 447.934c0 113.953 92.737 206.69 206.69 206.69s206.69-92.737 206.69-206.69c0-113.953-92.693-206.69-206.69-206.69-113.953 0-206.69 92.737-206.69 206.69zM838.482 782.925l-153.935-153.935c-44.969 42.869-105.685 69.422-172.57 69.422-55.423 0-106.56-18.329-148.073-48.949l-154.853 154.897c81.757 69.596 187.442 111.853 302.97 111.853 126.901-0.044 242.035-51.005 326.46-133.288zM43.744 447.934c0 126.945 50.962 242.079 133.288 326.504l153.935-153.935c-42.869-44.969-69.378-105.641-69.378-172.57 0-66.884 26.509-127.601 69.422-172.57l-153.935-153.935c-82.37 84.426-133.331 199.559-133.331 326.504zM209.052 91.597l154.853 154.897c41.513-30.621 92.649-48.949 148.073-48.949 66.884 0 127.601 26.509 172.57 69.422l153.935-153.935c-84.426-82.282-199.559-133.244-326.504-133.244-115.528-0.044-221.213 42.213-302.926 111.809z" />
<glyph unicode="&#xe90c;" glyph-name="home" d="M992.166 544.546l-433.963 375.936c-1.451 1.237-3.2 2.304-5.163 3.115-27.776 21.035-66.133 20.053-92.928-3.115l-433.963-375.893c-31.104-26.965-35.029-74.709-8.704-106.539 16.64-20.181 44.245-19.883 65.408-15.616v-404.096c0-30.549 24.491-55.381 54.613-55.381h261.419c11.776 0 21.333 9.6 21.333 21.333v352.469h177.92v-352.469c0-11.733 9.557-21.333 21.333-21.333h261.419c30.123 0 54.613 24.832 54.613 55.381v404.096c21.248-4.181 48.768-4.523 65.408 15.616 26.283 31.829 22.357 79.659-8.747 106.496zM968.017 465.271c-4.395-5.163-27.136-2.347-45.312 5.547-6.613 2.944-14.293 2.219-20.224-1.707-6.016-3.883-9.685-10.667-9.685-17.835v-432.896c0-6.997-5.376-12.672-11.947-12.672h-240.085v352.427c0 11.733-9.557 21.333-21.333 21.333h-220.587c-11.776 0-21.333-9.6-21.333-21.333v-352.427h-240.085c-6.571 0-11.947 5.675-11.947 12.672v432.896c0 7.211-3.627 13.995-9.685 17.877-6.016 3.883-13.653 4.523-20.267 1.664-16.128-7.125-40.661-11.093-45.269-5.504-11.648 14.080-9.984 35.157 3.755 47.061l433.963 375.936c11.861 10.197 29.056 10.197 40.917 0 1.536-1.408 3.285-2.475 5.12-3.328l430.208-372.736c13.781-11.819 15.445-32.896 3.797-46.976z" />
<glyph unicode="&#xe90d;" glyph-name="import" d="M1012.736 804.352l-141.312 139.477c-6.912 6.827-16.427 16.171-34.261 16.171h-521.088c-30.293 0-54.912-24.96-54.912-55.68v-327.936c0-11.776 9.557-21.333 21.333-21.333s21.333 9.557 21.333 21.333v327.936c0 7.083 5.589 13.013 12.245 13.013l499.755 0.299v-149.632c0-11.776 9.557-21.333 21.333-21.333h149.333v-755.2c0-6.912-5.717-12.8-12.459-12.8h-657.963c-6.656 0-12.245 5.888-12.245 12.8v284.203c0 11.776-9.557 21.333-21.333 21.333s-21.333-9.557-21.333-21.333v-284.203c0-30.592 24.619-55.467 54.912-55.467h657.963c30.379 0 55.125 24.875 55.125 55.467v776.533c-0.043 17.835-8.832 28.8-16.427 36.352zM858.453 896.597l108.715-107.264h-108.715v107.264zM433.109 298.88l100.736 105.173h-512.512c-11.776 0-21.333 9.557-21.333 21.333s9.557 21.333 21.333 21.333h512.555l-100.779 105.088c-8.192 8.491-7.893 22.016 0.683 30.208 8.533 8.107 22.016 7.808 30.165-0.64l135.424-141.227c0.896-0.981 1.323-2.176 2.048-3.243 0.768-1.152 1.707-2.176 2.219-3.499 0.939-2.347 1.365-4.779 1.451-7.253 0.043-0.299 0.171-0.512 0.171-0.811s-0.171-0.512-0.171-0.811c-0.085-2.475-0.512-4.949-1.451-7.253-0.555-1.28-1.493-2.347-2.261-3.499-0.683-1.067-1.152-2.261-2.048-3.2l-135.424-141.227c-4.181-4.352-9.813-6.571-15.403-6.571-5.291 0-10.624 1.963-14.763 5.931-8.533 8.149-8.789 21.675-0.64 30.165z" />
<glyph unicode="&#xe90e;" glyph-name="important" d="M512-64c-282.77 0-512 229.23-512 512s229.23 512 512 512c282.77 0 512-229.23 512-512s-229.23-512-512-512zM438.857 740.571h146.286l-12.343-365.714h-122.057l-11.886 365.714zM512 155.429c-45.011 0-73.143 27.884-73.143 72.928 0 45.473 28.132 73.357 73.143 73.357 45.413 0 73.143-27.884 73.143-73.357 0-45.044-27.73-72.928-73.143-72.928zM512-3.765c249.503 0 451.765 202.262 451.765 451.765s-202.262 451.765-451.765 451.765c-249.503 0-451.765-202.262-451.765-451.765s202.262-451.765 451.765-451.765z" />
<glyph unicode="&#xe90f;" glyph-name="information" d="M512-64c-282.77 0-512 229.23-512 512s229.23 512 512 512c282.77 0 512-229.23 512-512s-229.23-512-512-512zM512-3.765c249.503 0 451.765 202.262 451.765 451.765s-202.262 451.765-451.765 451.765c-249.503 0-451.765-202.262-451.765-451.765s202.262-451.765 451.765-451.765zM558.439 294.75c-11.43-20.574-34.29-48.768-47.244-48.768-3.81 0-9.906 3.048-9.906 9.144 0 4.572 6.096 19.812 10.668 32.766l41.91 115.823c7.62 22.098 16.002 41.91 16.002 60.959 0 32.766-21.336 56.387-65.531 56.387-16.002 0-87.629 0-135.635-102.869h35.814c11.43 19.812 30.48 48.006 44.196 48.006 3.048 0 9.144-2.286 9.144-9.144 0-3.81-2.286-9.906-6.096-21.336l-43.434-125.729c-9.906-28.194-15.24-42.672-15.24-58.673 0-57.149 55.625-57.911 70.103-57.911 81.533 0 122.681 77.723 133.349 101.345h-38.1zM620.923 662.031c0 32.004-25.908 57.911-57.911 57.911s-57.911-25.908-57.911-57.911c0-32.004 25.908-57.911 57.911-57.911s57.911 25.908 57.911 57.911z" />
<glyph unicode="&#xe910;" glyph-name="information2" d="M628.209 159.639c-21.515-38.727-64.545-91.798-88.929-91.798-7.172 0-18.646 5.737-18.646 17.212 0 8.606 11.475 37.293 20.081 61.677l78.889 218.019c14.343 41.596 30.121 78.889 30.121 114.747 0 61.677-40.161 106.141-123.353 106.141-30.121 0-164.949 0-255.312-193.636h67.414c21.515 37.293 57.374 90.363 83.192 90.363 5.737 0 17.212-4.303 17.212-17.212 0-7.172-4.303-18.646-11.475-40.161l-81.757-236.666c-18.646-53.071-28.687-80.323-28.687-110.444 0-107.575 104.707-109.010 131.959-109.010 153.474 0 230.929 146.303 251.009 190.767h-71.717zM745.825 850.99c0 60.242-48.768 109.010-109.010 109.010s-109.010-48.768-109.010-109.010c0-60.242 48.768-109.010 109.010-109.010s109.010 48.768 109.010 109.010z" />
<glyph unicode="&#xe911;" glyph-name="interrogation" d="M512-64c-282.77 0-512 229.23-512 512s229.23 512 512 512c282.77 0 512-229.23 512-512s-229.23-512-512-512zM512-3.765c249.503 0 451.765 202.262 451.765 451.765s-202.262 451.765-451.765 451.765c-249.503 0-451.765-202.262-451.765-451.765s202.262-451.765 451.765-451.765zM439.979 342.869c-2.418 25.145-1.209 46.542 3.627 64.192s11.484 32.882 19.947 45.696c8.462 12.814 18.133 23.936 29.013 33.365s21.035 18.496 30.464 27.2c9.429 8.704 17.287 17.771 23.573 27.2s9.429 20.672 9.429 33.728c0 16.925-4.715 30.464-14.144 40.619s-26.233 15.232-50.411 15.232c-7.737 0-15.957-0.846-24.661-2.539s-17.408-4.11-26.112-7.253c-8.704-3.143-17.045-6.77-25.024-10.88s-15.111-8.341-21.397-12.693l-36.267 69.632c18.375 12.573 39.531 22.969 63.467 31.189s52.828 12.331 86.677 12.331c45.454 0 80.995-11.001 106.624-33.003s38.443-51.619 38.443-88.853c0-24.661-3.264-45.091-9.792-61.291s-14.628-29.98-24.299-41.344c-9.671-11.364-20.309-21.397-31.915-30.101s-22.244-18.012-31.915-27.925c-9.671-9.913-17.892-21.397-24.661-34.453s-10.155-29.739-10.155-50.048h-80.512zM425.472 239.872c0 16.925 5.319 30.343 15.957 40.256s24.661 14.869 42.069 14.869c18.375 0 32.882-4.956 43.52-14.869s15.957-23.331 15.957-40.256c0-16.925-5.319-30.464-15.957-40.619s-25.145-15.232-43.52-15.232c-17.408 0-31.431 5.077-42.069 15.232s-15.957 23.694-15.957 40.619z" />
<glyph unicode="&#xe912;" glyph-name="media" d="M1009.062 673.877c-7.168 10.368-17.877 17.365-30.293 19.712l-199.765 37.291-29.312 89.301c-7.765 24.832-34.133 38.741-59.051 31.019l-211.029-64.469-177.92 33.152c-12.459 2.304-25.003-0.384-35.456-7.467-10.368-7.125-17.408-17.92-19.755-30.336l-14.037-75.477-199.296-61.141c-24.917-7.808-38.784-34.389-30.976-59.264l147.157-470.101c6.315-20.181 25.003-33.195 45.184-33.195 4.651 0 9.387 0.725 14.037 2.176l309.248 97.195 353.28-65.877c2.901-0.555 5.888-0.896 8.747-0.896 9.429 0 18.688 2.859 26.624 8.277 10.411 7.168 17.408 17.877 19.755 30.293l90.325 484.352c2.304 12.459-0.341 25.045-7.467 35.456zM703.356 810.027c2.261 0.683 4.48-0.597 5.248-3.029l21.973-67.115-159.445 29.739 132.224 40.405zM195.75 126.208c-2.219-0.725-4.565 0.512-5.291 2.731l-147.157 470.144c-0.683 2.219 0.555 4.565 2.645 5.205l177.579 54.485-67.328-361.003c-4.779-25.6 12.16-50.347 37.803-55.083l233.6-43.563-231.851-72.917zM883.836 162.048c-0.384-1.92-2.859-3.285-4.821-3.328l-510.72 95.232 231.808 217.984 55.211-113.365c3.115-6.357 9.173-10.795 16.171-11.819 7.040-1.024 14.165 1.365 18.944 6.571l129.109 138.368 88.917-197.504-24.619-132.139zM922.364 368.427l-76.757 170.496c-2.987 6.571-9.003 11.264-16.128 12.416-7.083 1.109-14.379-1.28-19.285-6.528l-129.835-139.179-54.315 111.445c-2.944 6.187-8.747 10.539-15.445 11.776-6.571 1.237-13.653-0.811-18.688-5.504l-276.096-259.584-113.877 21.248c-2.261 0.427-3.755 2.603-3.328 4.821l90.325 484.309c0.299 1.792 2.475 3.413 4.309 3.413 0.171 0 0.341 0 0.512-0.043l677.077-126.293c0 0 3.285-4.821 3.328-4.821l-51.797-277.973zM418.257 660.565c-50.005 0-90.624-40.661-90.624-90.624 0-49.92 40.619-90.624 90.624-90.624 49.963 0 90.624 40.704 90.624 90.624 0 49.963-40.661 90.624-90.624 90.624zM418.257 522.496c-26.197 0-47.488 21.291-47.488 47.488s21.291 47.488 47.488 47.488c26.155 0 47.488-21.291 47.488-47.488s-21.291-47.488-47.488-47.488z" />
<glyph unicode="&#xe913;" glyph-name="plus" d="M548.571 137.681v620.638c0 20.198-16.374 36.571-36.571 36.571s-36.571-16.374-36.571-36.571v-620.638c0-20.198 16.374-36.571 36.571-36.571s36.571 16.374 36.571 36.571zM822.319 484.571h-620.638c-20.198 0-36.571-16.374-36.571-36.571s16.374-36.571 36.571-36.571h620.638c20.198 0 36.571 16.374 36.571 36.571s-16.374 36.571-36.571 36.571z" />
<glyph unicode="&#xe914;" glyph-name="refresh" d="M1002.021 751.141c12.009-4.655 17.92-18.153 13.359-30.161l-61.021-157.044c-0.14-0.372-0.512-0.512-0.652-0.838-1.676-3.77-4.143-6.935-7.54-9.449-0.698-0.512-1.443-0.745-2.188-1.164-1.583-0.884-3.025-2.001-4.841-2.513-2.141-0.652-4.375-0.931-6.516-0.931-2.839 0-5.632 0.512-8.425 1.583l-151.599 58.88c-12.009 4.655-17.967 18.153-13.265 30.161 4.608 12.009 18.060 17.873 30.068 13.265l103.657-40.262c-65.164 151.738-217.321 254.231-386.281 254.231-184.599 0-349.603-123.811-401.315-301.009-3.584-12.381-16.337-19.456-28.858-15.825-12.335 3.537-19.409 16.477-15.825 28.812 57.437 196.98 240.873 334.569 445.999 334.569 185.158 0 352.163-110.871 426.17-275.875l39.005 100.305c4.608 12.009 18.060 17.92 30.068 13.265zM940.395 347.266c12.335-3.631 19.456-16.57 15.732-28.951-57.484-196.98-240.873-334.522-446.045-334.522-185.158 0-352.209 110.871-426.17 275.828l-38.959-100.259c-3.584-9.216-12.381-14.848-21.69-14.848-2.793 0-5.632 0.559-8.425 1.583-11.962 4.655-17.92 18.153-13.265 30.068l61.021 157.091c0.186 0.512 0.605 0.838 0.838 1.303 0.652 1.443 1.583 2.7 2.513 3.956 0.931 1.21 1.769 2.42 2.839 3.398 1.024 0.977 2.234 1.629 3.398 2.374 1.396 0.884 2.793 1.722 4.329 2.327 0.465 0.14 0.791 0.512 1.303 0.652 0.931 0.233 1.815 0.047 2.7 0.186 1.676 0.279 3.305 0.465 5.027 0.372 1.536-0.093 2.886-0.372 4.329-0.745 0.977-0.233 1.955-0.14 2.932-0.465l151.599-58.927c11.962-4.608 17.92-18.106 13.265-30.068s-18.199-17.92-30.115-13.265l-103.61 40.262c65.21-151.785 217.367-254.231 386.281-254.231 184.599 0 349.649 123.764 401.315 301.009 3.631 12.335 16.291 19.316 28.858 15.872z" />
<glyph unicode="&#xe915;" glyph-name="rules" d="M299.284 945.375c-0.757 1.87-2.003 3.473-3.206 5.12-0.534 0.712-0.846 1.603-1.469 2.315-0.045 0.045-0.134 0.089-0.178 0.134-1.647 1.692-3.695 2.849-5.743 4.007-0.579 0.312-1.113 0.89-1.736 1.202-0.801 0.312-1.781 0.267-2.627 0.534-2.093 0.623-4.141 1.291-6.278 1.291-0.089 0-0.178 0.045-0.267 0.045h-232.27c-3.027 0-6.055-0.623-8.904-1.781-5.654-2.36-10.195-6.901-12.6-12.6-1.113-2.849-1.736-5.832-1.736-8.86v-232.314c0-12.822 10.418-23.196 23.24-23.196h232.27c3.027 0 6.055 0.579 8.86 1.736 5.699 2.404 10.24 6.901 12.6 12.6 1.158 2.849 1.781 5.832 1.781 8.86v232.314c0 1.202-0.534 2.226-0.712 3.339-0.223 1.781-0.312 3.562-1.024 5.254zM68.706 880.685l56.943-56.899-56.943-54.227v111.126zM101.563 913.542h118.205l-60.505-57.656-57.7 57.656zM158.462 790.973l63.221-63.265h-129.647l66.426 63.265zM192.12 823.029l62.464 59.57v-122.034l-62.464 62.464zM277.78 216.554c12.867 0 23.24-10.329 23.24-23.196v-232.27c0-12.822-10.418-23.24-23.24-23.24h-232.27c-12.822 0-23.24 10.418-23.24 23.24v232.27c0 12.822 10.418 23.196 23.24 23.196h232.27zM68.706-15.672h185.834v185.834h-185.834v-185.834zM277.78 588.266c12.867 0 23.24-10.329 23.24-23.196v-232.27c0-12.822-10.418-23.24-23.24-23.24h-232.27c-12.822 0-23.24 10.418-23.24 23.24v232.27c0 12.822 10.418 23.196 23.24 23.196h232.27zM68.706 355.996h185.834v185.834h-185.834v-185.834zM971.874 123.77c12.867 0 23.24-10.418 23.24-23.24s-10.374-23.24-23.24-23.24h-554.296c-12.822 0-23.24 10.418-23.24 23.24s10.418 23.24 23.24 23.24h554.296zM971.874 495.482c12.867 0 23.24-10.418 23.24-23.24s-10.374-23.24-23.24-23.24h-554.296c-12.822 0-23.24 10.418-23.24 23.24s10.418 23.24 23.24 23.24h554.296zM417.578 820.714c-12.822 0-23.24 10.418-23.24 23.24s10.418 23.24 23.24 23.24h554.296c12.867 0 23.24-10.418 23.24-23.24s-10.374-23.24-23.24-23.24h-554.296z" />
<glyph unicode="&#xe916;" glyph-name="stack" horiz-adv-x="981" d="M480.977 395.085c3.285-1.92 6.997-2.816 10.667-2.816s7.381 0.896 10.667 2.816l470.4 272.469c6.656 3.883 10.752 11.051 10.624 18.773-0.128 7.765-4.437 14.805-11.264 18.475l-470.315 252.672c-6.315 3.371-13.867 3.371-20.224 0l-470.272-252.672c-6.827-3.669-11.093-10.709-11.221-18.475-0.128-7.723 3.925-14.891 10.624-18.773l470.315-272.469zM491.686 914.466l426.581-229.205-426.581-247.125-426.539 247.168 426.539 229.163zM855.334 554.871l117.291-68.011c6.571-3.84 10.624-10.88 10.624-18.475 0-7.637-4.053-14.677-10.624-18.475l-470.315-272.469c-3.285-1.92-6.997-2.816-10.667-2.816s-7.381 0.896-10.667 2.816l-470.315 272.469c-6.613 3.84-10.667 10.837-10.667 18.475 0 7.595 4.096 14.677 10.667 18.475l117.376 68.011c10.197 5.888 23.253 2.432 29.141-7.765 5.931-10.197 2.432-23.211-7.765-29.141l-85.504-49.579 427.776-247.765 427.776 247.765-85.547 49.579c-10.197 5.931-13.696 18.944-7.765 29.141 5.931 10.283 19.072 13.653 29.184 7.765zM855.334 330.317l117.291-67.925c6.571-3.84 10.624-10.837 10.624-18.475s-4.053-14.635-10.624-18.517l-470.315-272.427c-3.285-1.92-6.997-2.859-10.667-2.859s-7.381 0.939-10.667 2.859l-470.315 272.427c-6.613 3.883-10.667 10.88-10.667 18.517s4.096 14.635 10.667 18.475l117.376 67.968c10.197 5.931 23.253 2.475 29.141-7.723 5.931-10.24 2.432-23.253-7.765-29.184l-85.504-49.536 427.776-247.893 427.776 247.851-85.547 49.536c-10.197 5.931-13.696 18.987-7.765 29.184 5.931 10.325 19.072 13.696 29.184 7.723z" />
<glyph unicode="&#xe917;" glyph-name="tools" horiz-adv-x="896" d="M874.044 810.586l-135.68 133.888c-6.613 6.571-15.744 15.531-32.896 15.531h-500.224c-29.056 0-52.736-23.979-52.736-53.461v-110.037c0-11.264 9.216-20.48 20.48-20.48 11.307 0 20.48 9.216 20.48 20.48v110.037c0 6.784 5.376 12.501 11.776 12.501l479.744 0.256v-143.616c0-11.307 9.216-20.48 20.48-20.48h143.403v-724.992c0-6.613-5.504-12.288-11.989-12.288h-631.637c-6.4 0-11.776 5.675-11.776 12.288v109.013c0 11.264-9.173 20.437-20.48 20.437-11.264 0-20.48-9.173-20.48-20.437v-109.013c0-29.397 23.68-53.248 52.736-53.248h631.637c29.184 0 52.949 23.851 52.949 53.248v745.472c0 17.109-8.448 27.648-15.787 34.901zM725.948 899.119l104.405-102.955h-104.405v102.955zM339.046 463.962c0 50.219-40.789 91.008-90.923 91.008-50.176 0-90.965-40.789-90.965-91.008 0-50.176 40.789-90.965 90.965-90.965 50.133-0.043 90.923 40.747 90.923 90.965zM198.118 463.962c0 27.563 22.4 50.048 50.005 50.048 27.563 0 49.963-22.443 49.963-50.048s-22.4-50.005-49.963-50.005c-27.605-0.043-50.005 22.4-50.005 50.005zM190.097 215.855c7.211 0 14.080 3.797 17.749 10.325l25.131 44.032c10.581-0.896 21.248-0.896 32 0.128l25.472-43.776c4.608-7.979 14.037-11.776 22.912-9.472 22.784 5.973 44.672 15.147 65.067 27.264 7.936 4.693 11.733 14.165 9.344 23.083l-13.355 48.811c8.107 6.955 15.573 14.507 22.485 22.699l48.939-12.928c8.875-2.304 18.304 1.536 22.912 9.472 12.075 20.736 20.821 42.069 26.752 65.323 2.304 8.917-1.664 18.304-9.643 22.869l-43.989 25.131c0.853 10.624 0.811 21.333-0.128 31.915l43.819 25.515c7.979 4.651 11.904 13.995 9.515 22.912-6.016 22.827-15.189 44.715-27.264 65.067-4.736 7.936-14.165 11.861-23.040 9.344l-48.853-13.397c-6.955 8.149-14.549 15.701-22.699 22.528l12.928 48.981c2.389 8.917-1.536 18.304-9.472 22.997-20.736 11.947-42.112 20.736-65.28 26.709-8.96 2.304-18.304-1.707-22.869-9.728l-25.131-43.947c-10.709 0.811-21.333 0.811-32.043-0.128l-25.557 43.819c-4.651 7.979-13.952 11.904-22.912 9.515-22.4-5.973-44.885-15.403-65.024-27.264-7.893-4.693-11.691-14.165-9.259-23.040l13.312-48.853c-8.192-6.955-15.701-14.592-22.656-22.741l-48.939 12.885c-8.917 2.389-18.347-1.536-22.955-9.515-11.861-20.437-20.821-42.325-26.709-65.237-2.304-8.917 1.664-18.261 9.643-22.869l43.989-25.131c-0.853-10.709-0.811-21.419 0.128-32.128l-43.691-25.429c-7.979-4.651-11.904-13.995-9.515-22.955 5.973-22.443 15.36-44.928 27.264-65.024 4.736-7.893 14.123-11.733 22.997-9.344l48.896 13.355c6.997-8.149 14.549-15.701 22.784-22.571l-12.928-48.981c-2.389-8.917 1.536-18.304 9.515-22.955 21.077-12.16 41.813-20.651 65.237-26.667 1.707-0.427 3.371-0.597 5.12-0.597zM153.958 271.279l12.245 46.421c2.176 8.192-0.939 16.896-7.808 21.845-12.971 9.387-24.405 20.608-33.835 33.536-5.077 6.827-13.696 9.813-21.931 7.68l-46.293-12.672c-4.224 8.448-7.893 17.323-11.008 26.24l41.472 24.149c7.339 4.224 11.264 12.587 9.899 20.992-2.56 15.829-2.645 31.829-0.213 47.701 1.323 8.363-2.688 16.725-10.069 20.864l-41.685 23.808c3.029 9.003 6.613 17.835 10.795 26.325l46.379-12.245c8.277-2.219 16.896 0.939 21.888 7.808 9.301 12.971 20.608 24.363 33.579 33.835 6.827 5.035 9.899 13.739 7.637 21.931l-12.672 46.293c8.533 4.224 17.365 7.893 26.283 11.008l24.192-41.472c4.224-7.339 12.416-11.264 20.949-9.941 15.744 2.56 31.872 2.645 47.616 0.213 8.533-1.323 16.725 2.731 20.907 10.112l23.808 41.685c9.088-3.029 17.749-6.571 26.368-10.837l-12.288-46.379c-2.176-8.235 0.939-16.939 7.851-21.888 12.843-9.344 24.192-20.608 33.707-33.579 4.992-6.827 13.653-9.899 21.888-7.68l46.336 12.672c4.267-8.533 7.893-17.28 11.008-26.283l-41.557-24.149c-7.339-4.309-11.221-12.629-9.899-21.035 2.56-15.744 2.603-31.744 0.213-47.531-1.28-8.405 2.688-16.683 10.069-20.864l41.728-23.851c-3.029-9.131-6.571-17.792-10.837-26.411l-46.421 12.288c-8.192 2.048-16.896-0.896-21.803-7.765-9.344-12.928-20.608-24.32-33.536-33.749-6.784-4.992-9.813-13.739-7.595-21.845l12.672-46.336c-8.533-4.309-17.323-7.936-26.325-11.093l-24.107 41.515c-4.267 7.381-12.587 11.477-20.992 9.899-15.872-2.517-31.957-2.56-47.573-0.213-8.32 1.237-16.683-2.688-20.907-10.069l-23.851-41.728c-9.003 3.029-17.707 6.613-26.283 10.795z" />
<glyph unicode="&#xe918;" glyph-name="trash" d="M565.895 151.579h107.789v323.368h-107.789v-323.368zM350.316 151.579h107.789v323.368h-107.789v-323.368zM673.684 852.211h323.368v-107.789h-970.105v107.789h323.368v107.789h323.368v-107.789zM242.526 582.737h538.947l0.054-538.947h-539.001v538.947zM134.737 43.789c0-59.446 48.344-107.789 107.789-107.789h538.947c59.446 0 107.789 48.344 107.789 107.789v646.737h-754.526v-646.737z" />
<glyph unicode="&#xe919;" glyph-name="user" d="M512 384c301.504 0 512-157.888 512-384v-64h-1024v64c0 226.112 210.56 384 512 384zM512 448c-141.12 0-256 114.88-256 256s114.816 256 256 256c141.184 0 256-114.88 256-256s-114.816-256-256-256z" />
<glyph unicode="&#xe920;" glyph-name="check" d="M0 409.6l102.4 102.4 256-256 563.2 563.2 102.4-102.4-665.6-665.6z" />
<glyph unicode="&#xe921;" glyph-name="check2" d="M424.653 89.702c-22.272 0-43.366 10.394-56.883 28.314l-182.938 241.715c-9.027 11.815-14.464 26.793-14.464 43.041 0 23.14 11.027 43.704 28.114 56.723l0.174 0.127c11.827 9.057 26.829 14.513 43.106 14.513 23.161 0 43.742-11.048 56.76-28.162l0.128-0.175 120.371-158.925 302.643 485.99c12.843 20.293 35.169 33.571 60.597 33.571 13.987 0 27.035-4.017 38.054-10.961l-0.296 0.174c33.434-20.787 43.725-64.819 22.835-98.304l-357.581-573.952c-12.217-19.466-33.149-32.488-57.189-33.582l-0.155-0.006c-1.126-0.102-2.15-0.102-3.277-0.102z" />
<glyph unicode="&#xe922;" glyph-name="close" d="M626.784 447.968l195.072-195.072c12.672-12.672 12.672-33.248 0-45.92l-68.832-68.832c-12.672-12.672-33.216-12.672-45.92 0l-195.104 195.072-195.104-195.072c-12.672-12.672-33.216-12.672-45.888 0l-68.864 68.832c-12.672 12.672-12.672 33.216 0 45.92l195.104 195.072-195.104 195.104c-12.672 12.672-12.672 33.248 0 45.92l68.896 68.832c12.672 12.672 33.216 12.672 45.888 0l195.072-195.104 195.104 195.104c12.672 12.672 33.216 12.672 45.92 0l68.832-68.864c12.672-12.672 12.672-33.216 0-45.92l-195.072-195.072z" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 37 KiB

@@ -0,0 +1,11 @@
<svg width="42" height="33" viewBox="0 0 42 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="22.1094" height="4" rx="2" transform="matrix(-0.707107 0.707107 0.707107 0.707107 23.2783 13.0117)" fill="#172153"/>
<rect width="10.1496" height="4" rx="2" transform="matrix(-0.707107 0.707107 0.707107 0.707107 27.5952 8.69043)" fill="#F26B32"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.5983 16.3442C26.3011 15.5589 26.2753 14.3519 25.521 13.5975C24.7399 12.8165 23.4736 12.8165 22.6925 13.5975L21.7248 14.5653C21.022 15.3506 21.0477 16.5576 21.8021 17.312C22.5831 18.093 23.8495 18.093 24.6305 17.312L25.5983 16.3442Z" fill="#FFD147"/>
<rect x="21.1978" y="3.41895" width="5.92515" height="2" rx="1" transform="rotate(75 21.1978 3.41895)" fill="#172153"/>
<rect x="17.8779" y="6.34082" width="5.92514" height="2" rx="1" transform="rotate(-15 17.8779 6.34082)" fill="#172153"/>
<rect width="5.92514" height="2" rx="1" transform="matrix(-0.991692 -0.128634 -0.128634 0.991692 37.3389 11.8994)" fill="#172153"/>
<rect width="5.92514" height="2" rx="0.999999" transform="matrix(0.106286 -0.994336 -0.994336 -0.106286 34.9521 15.5615)" fill="#172153"/>
<rect x="36.4912" y="3.05176" width="5.92514" height="2" rx="1" transform="rotate(135 36.4912 3.05176)" fill="#172153"/>
<rect x="35.0771" y="7.24121" width="5.92514" height="2" rx="1" transform="rotate(-135 35.0771 7.24121)" fill="#172153"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -0,0 +1,17 @@
<svg width="42" height="33" viewBox="0 0 42 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="mask0_779_15959" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="5" y="1" width="31" height="31">
<path d="M20.3764 31.2271C12.2864 31.2271 5.72824 24.6616 5.72824 16.5627C5.72824 8.46386 12.2864 1.89844 20.3764 1.89844C28.4663 1.89844 35.0244 8.46386 35.0244 16.5627C35.0244 24.6616 28.4663 31.2271 20.3764 31.2271Z" fill="#FFC401"/>
</mask>
<g mask="url(#mask0_779_15959)">
<path d="M20.4135 31.2271C12.3235 31.2271 5.76535 24.6616 5.76535 16.5627C5.76535 8.46386 12.3235 1.89844 20.4135 1.89844C28.5034 1.89844 35.0615 8.46386 35.0615 16.5627C35.0615 24.6616 28.5034 31.2271 20.4135 31.2271Z" fill="#FFD147"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.65186 26.5117C12.328 29.4113 16.1588 31.2271 20.4132 31.2271C24.6486 31.2271 28.4641 29.4275 31.1385 26.5506C28.4018 23.7602 24.5909 22.0293 20.376 22.0293C16.1808 22.0293 12.3857 23.7441 9.65186 26.5117Z" fill="#F26B32"/>
</g>
<path d="M8.2666 17.8044C8.2666 17.4362 8.56508 17.1377 8.93327 17.1377H10.1361C10.5043 17.1377 10.8028 17.4362 10.8028 17.8044C10.8028 18.1726 10.5043 18.471 10.1361 18.471H8.93327C8.56508 18.471 8.2666 18.1726 8.2666 17.8044Z" fill="white"/>
<path d="M11.596 8.81418C11.8563 8.55383 12.2784 8.55383 12.5388 8.81418L13.3893 9.66472C13.6497 9.92506 13.6497 10.3472 13.3893 10.6075C13.129 10.8679 12.7069 10.8679 12.4465 10.6075L11.596 9.75699C11.3356 9.49664 11.3356 9.07453 11.596 8.81418Z" fill="white"/>
<path d="M29.3894 8.81418C29.129 8.55383 28.7069 8.55383 28.4466 8.81418L27.596 9.66472C27.3357 9.92506 27.3357 10.3472 27.596 10.6075C27.8564 10.8679 28.2785 10.8679 28.5388 10.6075L29.3894 9.75699C29.6497 9.49664 29.6497 9.07453 29.3894 8.81418Z" fill="white"/>
<path d="M32.9199 17.8044C32.9199 17.4362 32.6214 17.1377 32.2533 17.1377H31.0504C30.6822 17.1377 30.3837 17.4362 30.3837 17.8044C30.3837 18.1726 30.6822 18.471 31.0504 18.471H32.2533C32.6214 18.471 32.9199 18.1726 32.9199 17.8044Z" fill="white"/>
<path d="M20.597 5.0918C20.9652 5.0918 21.2637 5.39027 21.2637 5.75846L21.2637 6.9613C21.2637 7.32949 20.9652 7.62797 20.597 7.62797C20.2288 7.62797 19.9303 7.32949 19.9303 6.9613L19.9303 5.75846C19.9303 5.39027 20.2288 5.0918 20.597 5.0918Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M28.2584 9.82966C28.6433 10.2257 28.6342 10.8588 28.2381 11.2437L22.0915 17.2165C21.6954 17.6014 21.0623 17.5923 20.6774 17.1962C20.2925 16.8002 20.3016 16.1671 20.6977 15.7822L26.8443 9.80937C27.2404 9.42449 27.8735 9.43357 28.2584 9.82966Z" fill="#172153"/>
<path d="M23.5208 16.996C23.5208 18.5843 22.2332 19.8719 20.6449 19.8719C19.0566 19.8719 17.769 18.5843 17.769 16.996C17.769 15.4077 19.0566 14.1201 20.6449 14.1201C22.2332 14.1201 23.5208 15.4077 23.5208 16.996Z" fill="#172153"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.6449 19.1529C21.8362 19.1529 22.8019 18.1872 22.8019 16.996C22.8019 15.8048 21.8362 14.8391 20.6449 14.8391C19.4537 14.8391 18.488 15.8048 18.488 16.996C18.488 18.1872 19.4537 19.1529 20.6449 19.1529ZM20.6449 19.8719C22.2332 19.8719 23.5208 18.5843 23.5208 16.996C23.5208 15.4077 22.2332 14.1201 20.6449 14.1201C19.0566 14.1201 17.769 15.4077 17.769 16.996C17.769 18.5843 19.0566 19.8719 20.6449 19.8719Z" fill="#172153"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

@@ -0,0 +1 @@
<svg viewBox="0 0 329 168" xmlns="http://www.w3.org/2000/svg"><g fill="#c6f0de" fill-rule="evenodd"><path d="m164.53 23.294c-77.642 0-140.86 63.227-140.86 140.87 0 6.6555-5.1761 11.832-11.831 11.832-6.655 0-11.831-5.1765-11.831-11.832 0-22.185 4.4367-43.63 12.94-63.966 8.1339-19.597 19.965-37.345 35.124-52.134 15.159-15.16 32.536-26.992 52.131-35.126 20.335-8.5042 41.779-12.941 63.962-12.941s43.627 4.437 63.962 12.941c9.2431 3.6975 17.747 8.5042 25.881 14.05l-25.511 12.571c-18.856-10.723-40.67-16.269-63.962-16.269z" fill-rule="nonzero"/><path d="m126.05 114.71c4.8089-4.8128 10.358-8.5149 16.276-11.106l141.68-69.6-69.544 141.79c-2.5894 5.9234-6.2886 11.477-11.098 16.289-10.728 10.736-24.415 15.919-38.471 15.919-14.057 0-27.744-5.183-38.471-15.919-21.825-21.472-21.825-56.272-.36992-77.374zm19.606 57.383c5.1788 5.183 12.207 7.7745 18.866 7.7745 6.6585 0 13.687-2.5915 18.866-7.7745 10.358-10.366 10.358-27.396 0-38.132-5.1788-5.183-12.207-7.7745-18.866-7.7745-7.0284 0-13.687 2.5915-18.866 7.7745-10.358 10.736-10.358 27.766 0 38.132z"/><path d="m316.01 99.898c-6.3106-14.408-14.477-28.076-24.129-39.898l-11.879 24.013c15.962 22.904 25.242 50.242 25.242 80.166 0 6.6497 5.197 11.822 11.879 11.822s11.879-5.172 11.879-11.822c0-22.166-4.4545-43.962-12.992-64.28z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,12 @@
<svg width="42" height="33" viewBox="0 0 42 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_779_15983)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M29.2144 29.3779C22.1533 29.3779 16.4292 23.6538 16.4292 16.5928C16.4292 9.53173 22.1533 3.80762 29.2144 3.80762C36.2754 3.80762 41.9995 9.53173 41.9995 16.5928C41.9995 23.6538 36.2754 29.3779 29.2144 29.3779Z" fill="#D0D3D8"/>
<rect x="12.7578" y="3.67383" width="18.2672" height="18.2672" rx="2" transform="rotate(45 12.7578 3.67383)" fill="#172153"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.5781 9.49414L24.26 15.1761C25.041 15.9571 25.041 17.2234 24.26 18.0045L18.5776 23.6869C17.2205 21.6567 16.4292 19.2162 16.4292 16.5909C16.4292 13.9653 17.2207 11.5245 18.5781 9.49414Z" fill="#F26B32"/>
</g>
<defs>
<clipPath id="clip0_779_15983">
<rect width="42" height="32" fill="white" transform="translate(0 0.5)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 936 B

@@ -0,0 +1 @@
<svg height="23" viewBox="0 0 512 512" width="23" xmlns="http://www.w3.org/2000/svg"><path d="m320.2 243.8-49.7 99.4c-6 12.1-23.4 11.7-28.9-.6l-56.9-126.3-30 71.7h-94.1l182.5 186.5c7.1 7.3 18.6 7.3 25.7 0l182.6-186.5h-109.1zm153.5-169.9-2.4-2.5c-51.5-52.6-135.8-52.6-187.4 0l-27.9 28.6-27.9-28.5c-51.5-52.7-135.9-52.7-187.4 0l-2.4 2.4c-48.7 49.8-50.8 129.1-7.3 182.1h102.4l35.9-86.2c5.4-12.9 23.6-13.2 29.4-.4l58.2 129.3 49-97.9c5.9-11.8 22.7-11.8 28.6 0l27.6 55.2h118.9c43.5-53 41.4-132.3-7.3-182.1z" fill="#f56640"/></svg>

After

Width:  |  Height:  |  Size: 524 B

@@ -0,0 +1 @@
<svg height="23" viewBox="0 0 512 512" width="23" xmlns="http://www.w3.org/2000/svg"><path d="m320.2 243.8-49.7 99.4c-6 12.1-23.4 11.7-28.9-.6l-56.9-126.3-30 71.7h-94.1l182.5 186.5c7.1 7.3 18.6 7.3 25.7 0l182.6-186.5h-109.1zm153.5-169.9-2.4-2.5c-51.5-52.6-135.8-52.6-187.4 0l-27.9 28.6-27.9-28.5c-51.5-52.7-135.9-52.7-187.4 0l-2.4 2.4c-48.7 49.8-50.8 129.1-7.3 182.1h102.4l35.9-86.2c5.4-12.9 23.6-13.2 29.4-.4l58.2 129.3 49-97.9c5.9-11.8 22.7-11.8 28.6 0l27.6 55.2h118.9c43.5-53 41.4-132.3-7.3-182.1z" fill="#121116"/></svg>

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@@ -0,0 +1,3 @@
<svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 0.46875C3.25391 0.46875 0.21875 3.53125 0.21875 7.25C0.21875 10.9961 3.25391 14.0312 7 14.0312C10.7188 14.0312 13.7812 10.9961 13.7812 7.25C13.7812 3.53125 10.7188 0.46875 7 0.46875ZM7 12.7188C3.96484 12.7188 1.53125 10.2852 1.53125 7.25C1.53125 4.24219 3.96484 1.78125 7 1.78125C10.0078 1.78125 12.4688 4.24219 12.4688 7.25C12.4688 10.2852 10.0078 12.7188 7 12.7188ZM7 3.47656C6.34375 3.47656 5.85156 3.99609 5.85156 4.625C5.85156 5.28125 6.34375 5.77344 7 5.77344C7.62891 5.77344 8.14844 5.28125 8.14844 4.625C8.14844 3.99609 7.62891 3.47656 7 3.47656ZM8.53125 10.4219V9.76562C8.53125 9.60156 8.36719 9.4375 8.20312 9.4375H7.875V6.70312C7.875 6.53906 7.71094 6.375 7.54688 6.375H5.79688C5.60547 6.375 5.46875 6.53906 5.46875 6.70312V7.35938C5.46875 7.55078 5.60547 7.6875 5.79688 7.6875H6.125V9.4375H5.79688C5.60547 9.4375 5.46875 9.60156 5.46875 9.76562V10.4219C5.46875 10.6133 5.60547 10.75 5.79688 10.75H8.20312C8.36719 10.75 8.53125 10.6133 8.53125 10.4219Z" fill="#121116"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1 @@
<svg height="24" viewBox="0 0 30 24" width="30" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><image height="24" width="30" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAYCAMAAADat72NAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACQ1BMVEX1ZkD////1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkD1ZkAAAADWj0A4AAAAv3RSTlMAAAsrXJi5KgZQi8Hj8ub4YSOEs+D06MmUXyexnU+m78+gaDYTRFN/y6n1dz8WFf3rD3HTcAUbBEDpu/zbaymHwyw8Dnk4n7D2Z9ByOSLZVdJe4aOob3MDSRQk51it6tjRQhJ48UWPEQfkOx0fUa83DIpbLQgyxuXVAnsQnrjHq3qbv2rNvjQ6IIlSGiGFzN+hAbp1zvD6lVq9pA3iCvc9MILzSrR9+4N+ZmAlHEvdF6fUXf7aM7WyjcrX3jXcZfT9uZ8AAAABYktHRMATYd/4AAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4goEDxkExbu14wAAAkVJREFUKM9d0Y8301EUAPD7NmbY2sZ8mbWkTWo1SzMzw+bHImx+rcRISmFiNJkViwhJoUil9bsk6ad+rR/3X+v7/c5xzD3nvXfO+7xz7z3vAuwIQjjciEheFGEj3PhR0TGxAuEunki8g/mS6Lh4aQKVmCRLJkS+O4wVe6QJKXtT9ylV9F3afpJ+IIwPqg8d1mzWztCiKu1I5nY+qmP2LDHD/JgkfbZQuY0NOcYM+sg1iSGUVJ+Xv8UFZkshVQRQLEBtCSHWNPo+/tgWl5Yd55RXAFQiHWabvayKkPTqLa6pBahzAJxgGI30Oll/KqVhkxttzibILwdoxlCcbjmjVIlaWT57ru38BR5Yje0dnTSZ8syurosSDinpZrnHVMN3t3X1OislUl7fJU//5b4BLzVY12pgOULYAL7yK6CrgKuZNuBHahGHzHSeYWYq4PNfAxhpgdHBvuvUmGYcUeTPSb5RhuicYFpTmiZhKsXT7bXcnO6IHc6SF+pvzfRzh27fmZ1iOp9LnIe7Q756aId7uFBMpi2L9+0uQpbQwXC2+gFUUdmKh4+WH+N4YISu+8SsIk+1KHrGfMtzLycgeCFYanyJ2D1Bt+Z3E6J59foNrjC83PkWVt+trXatYMLyKGKznu45VWegkMcOTKZ+D+stHz5+yvUYPiMWiL+Q9a/e3sm5DZZ9/uHSxbh2cOjGAguI35oUGgHWBqq+20Pzdml/cOmjBHHmJ+Ivt3UAUc5RY0+I5z2hV8EN2Vq1/XcwKLUHi/78nf33H5FHr0FmeEkkAAAAAElFTkSuQmCC"/></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

@@ -0,0 +1 @@
<svg height="24" viewBox="0 0 30 24" width="30" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><image height="24" width="30" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAYCAYAAADtaU2/AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4goEDwUNWhBQGgAACQJJREFUSMeVlmuMnFUZx59z3vv77lx3Lrs7O53Otrvdbi+0obQUSkWFaACjQY3VAEa8YIxEsBIuEoOiVgH5oBIuogW8BAggiGIgEIRY2C502e2Wvba7Mzs7OzszOzvzzrzvvNdzjh9a7n7QJ/klJ+fLL/+Tf/IcdGRkFD48CAEsFsqAeA54QQRKGVDigiCIUCgUoCcZB9NjYOhrEE8kwPEoyDzWTMterxvWTtcn+xzbyu7Zsfl6VVEnKaMfcfDwPwxCCDDGwHEcYISAMiYSQjZajjdQLK+eb1rebtdx+xhjIZ7DBs+hCcv2PjafX94Tj4UnKfk/xPiMDCEkWraTdmxzm+c3d1Wb7bPWDHub75MYwrwhu05eEfk3MpneP3A8PywJMAOUwGx+5RnLcfYhSg8DYx8VE/reJcdxpxNiBC2z/dlas/Uly/HPcz0SA2AejyEX0JRxnud/oanKaIcqncIEaqIkQbI7CQu53EW1prm1L7v+yZBujjbq+mWIkwGh/5LY8d4Tr5ZWgAGAwPNQaxpf0S3nsv51qZ+A6w7XDHtqfbq7kuwMgGl5UKmtAcIIPMcDj1F4c/x4vFzTn/cJw5l0KhYNdRwprdS+a5mNEIeR/uHM/Ia+7OkTY7BULILW0QGhcAiibWvYrdSHYp2dv2w3GmC4BBijMJdbvk6RRJ1QdliVNEhEVQgFNeB5Tn9l+NjdbautiKLYVHlvCiiVOgKhTZFweIRS8kExpfR9T42BEAK5XJ4XRP4tz3USyPPi0Wi0KqkqEEphpbJ2qW4YH++MhiEZjx12fAJtywVKPDeVjN3QbOqAMYZgQKlIolCut91zAhF+hHwoMj5TIEAIgeeRzaVy5VC51ng51BFcBQCmG8Ymx/dAURVQFDloe94gBcRVVusPlqurN7uOC2bbgpML+XNFXr6opzcNhFFwGfM0TZ5u6voukWMgYPgAuN1ug+97QIkPhu0eWlmtfy/VlfiTpogLgiitNCx7t0N8wAygbVpbbM/vxQgBz/N4+mT+56fyS4cc1+krrzUffm1s+m9Ly+Uv9nQnQZFVkCTpTV1vnm0YJti2DZZtvQuempmFo8dGYX5xEdKprqdkUawObeq7PxKJmOGANmG0WrsZ9UDVJLAsezf1fUAInWk/hmpdv2l0Yur1VtsZoNRTZhaWHx+dmD4oCZiLR0MjjuenLduJ+YTA+8EMAOqNBhSLpY2RYPDfDJCYKxQOWJ4DsiIOW7YzKIsCUASw2mzuf0cKwACdKaXpsgQDAFVRqhzAzPHJk1fV1+pnC4iOeD5VLMfdDgiAMfYuPCE0arv+t4orizeHO9QvdMXCj87nV74W1LRHie8eY4T9yNDtCGVGWzfaexgAEEIBIwYUYSKL/EIqEnpClqW/R4OBxbW1OrZch2ccv2K2PTPZGfwx9ZyQKgaBUgaEEABgwBdL5d83ms5n+nqTV2uK+EosEmqWqmsvUODS0UjoRKFYox4lg2ZzreK5jh8NqC+oqjwOjI3HopHjvCDM8Rw3lC+WDhTLq/sQ4jK+73ONsZlaQJZGFVU4HA4GXlU1DVrNJvRmMsCLMvDdic4na/XGJ9M9qedkRXGJ4byBMF5YqzeuymbSP5tTi6s+ZXu7E7G7hxC/AyPEELDOcFCdF6QOcfTE9K9rdf2bhDJMiA/JWOiwoGnlpcraTS2rPYTW0BXVhvH8QNb7vufak4nMRuCkDsADA31/CYdDb+eWivdGIh0QjwRpbzL2eKG4ciWPACJBbXh2Pvf1mfnFO3KF5b9OzOVmHN//NBblxMjYideL5dVrfEoxxuBEIpFhQRQeScWjDwUV5WUR8xZjDPSm+anxydmXCKG7OIwBAQPu2usOMpHDE+PT83dpivxiNBIpmLZTWCpVDkYC6nOUeLWablzuEdqhatpwKhl9oH995rF/jYw9ixHWM6n4PcCYuyHdfUCVhbs0RbI1TUEih+9Pp+JPUEYVWVH/SRgk6vXGV9Pp3mdkSWqgI8feBkEQ4MjRYw+7rjt48f7zzl0ul9iJ2fkXApq21BMLf4MAQo5tEVkUI1sG++tjk3M3vDk+c0co0PHW4GDfhclosDl7Kn95oVy7nnj+NgpMFTC/kOnpvDqzrvuIbniQL1XuKSwVv9PbFXts+6YNB3DTaENdb8H6delb6k1z64mpmS/3dHVBJtXzu+VK7ZKG0e62LPuyU0vVl+aXyr/JL1cDU6cK12KBB594jEfYP5kr3jKdW3rSdrx9HmUhxhBJJjqfSiYT0+vSveC59gWlUvnboihDeVX/nOPRHTgWUiEakKCvN14c2rjuV7P55TsbTUPjEfwDGHhTudL01MLSb1WJnx7oW3dbrWle0LacNAOAwYHsT33XHZqcy9/OcwIwQkERxOH+3uSFZ23pv1nkcW1lpZpYLldv3LY5extQ6hNKpGq1/nksiAoIogqIl6B/Q/ZOBJRNTM0dTKd62mdtzt4+kI5fO5hNfUISpXEOIadRr+9lDEDksCkg+uJyuXoNYIyJTyCdSj61ddP6/aLEHSWeDSFVhOGxyTtatpeJh0OHNFmqUcqgYZq7se/Z4Hs2uLYJqiy0dm4Z+OFyZfXGVtvqjXfGHgAG1YWlyrN1w7rRsFx3vlDa2JOMvHjOUN9e2/Wtumnv5dDpHd6/Yf2tutm+otY0r6QIwWK5fmm5Wr/Ks61oPBqRN2Z7Lu+ORx/RW0YWS5ICp1GB40Xoy6z7Y6hDOT781okHj45NPj1fKP9ZxviJ7Zuyu0zbKgsch2zL7Zovli/gOEHkEbjvrDq9XlftdtsiDDdN20+cOLl0H8YYIcz5nKTQluWkLNuOcRgx7BEK7+B6BDAv0HN2bP+BabYvppTigWzq/GCHcisCqGd74tCf6R6v6cbW5dXmPcFgIBmPhV72fQqEUpidy90bCYUWkp3h8tjxmacNs90LAMDz/Njs3Em0XK49pLfal6iyPMmHQqGP/ChlSXptz05zB+bwRKupA2MMOFEGLGkQjPivqnJpmhDGVcqV/ZmervtKK6sXE0olh9LY2/P5hxCjwChTFJGbZUDpzi39d+oNfciyrBJGiItHw8/9BzG486F3Mjo3AAAAAElFTkSuQmCC"/></svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

@@ -0,0 +1 @@
<svg fill="none" height="32" viewBox="0 0 49 32" width="49" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m15.6 27.95c-6.82071 0-12.35-5.5293-12.35-12.35 0-6.82071 5.52929-12.35 12.35-12.35 6.8207 0 12.35 5.52929 12.35 12.35 0 6.8207-5.5293 12.35-12.35 12.35z" fill="#ffd147"/><path d="m32.4984 27.95c-6.8207 0-12.35-5.5293-12.35-12.35 0-6.82071 5.5293-12.35 12.35-12.35s12.35 5.52929 12.35 12.35c0 6.8207-5.5293 12.35-12.35 12.35z" fill="#f56f46"/><path d="m24.0484 6.59375c2.4005 2.25302 3.9 5.45475 3.9 9.00675 0 3.5519-1.4995 6.7536-3.9 9.0066-2.4005-2.253-3.9-5.4547-3.9-9.0066 0-3.552 1.4995-6.75373 3.9-9.00675z" fill="#172153"/></g></svg>

After

Width:  |  Height:  |  Size: 687 B

@@ -0,0 +1 @@
<svg viewBox="0 0 246 35" xmlns="http://www.w3.org/2000/svg"><g fill="none"><g fill="#404041" transform="translate(83 21)"><path d="m161.53 3.43c-.76972 0-1.381-.63-1.381-1.4233 0-.77.61125-1.4233 1.381-1.4233.74708 0 1.381.63 1.381 1.4233 0 .79333-.63389 1.4233-1.381 1.4233zm0-2.5667c-.61125 0-1.1093.51333-1.1093 1.1433s.49806 1.1433 1.1093 1.1433 1.1093-.51333 1.1093-1.1433-.49806-1.1433-1.1093-1.1433zm.70181 1.89h-.31694l-.27167-.53667h-.36222v.53667h-.2943v-1.5633h.72444c.31694 0 .5207.21.5207.51333 0 .23333-.13583.39667-.31694.46667l.31694.58333zm-.54333-.81667c.1132 0 .22639-.07.22639-.23333 0-.18667-.090555-.23333-.22639-.23333h-.45278v.46667h.45278z"/><path d="m17.658.44333h3.532v9.91667h6.135v3.173h-9.667z"/><path d="m30.97 7.0233v-.023333c0-3.7567 2.9431-6.8133 6.8596-6.8133s6.8143 3.01 6.8143 6.7667v.046667c0 3.7567-2.9431 6.8133-6.8596 6.8133-3.8939-.023333-6.8143-3.0333-6.8143-6.79m10.097 0v-.023333c0-1.89-1.3131-3.5233-3.26-3.5233-1.9243 0-3.2147 1.61-3.2147 3.5v.046667c0 1.89 1.3131 3.5233 3.2374 3.5233 1.9469-.023333 3.2374-1.6333 3.2374-3.5233"/><path d="m48.968 7.7933v-7.35h3.5769v7.28c0 1.89.92819 2.7767 2.3318 2.7767s2.3318-.86333 2.3318-2.6833v-7.3733h3.5769v7.2567c0 4.2233-2.3318 6.0667-5.954 6.0667-3.5996.023333-5.8635-1.8667-5.8635-5.9733"/><path d="m66.173.44333h4.9126c4.5278 0 7.1765 2.6833 7.1765 6.4633v.046667c0 3.78-2.6714 6.58-7.2444 6.58h-4.8221l-.022639-13.09zm4.9579 9.87c2.1054 0 3.509-1.19 3.509-3.3133v-.046667c0-2.1-1.4036-3.3133-3.509-3.3133h-1.4262v6.65l1.4262.023333z"/><path d="m83.356.44333h10.165v3.19667h-6.656v2.2167h6.022v3.01h-6.022v4.6663h-3.509z"/><path d="m98.411.44333h3.509v9.91667h6.16v3.173h-9.669z"/><path d="m117.27.35h3.3958l5.4107 13.183h-3.7807l-.9282-2.3333h-4.89l-.90556 2.3333h-3.6901l5.3881-13.183zm3.1015 8.0267-1.4036-3.71-1.4262 3.71h2.8299z"/><path d="m130.6.44333h5.9993c1.9469 0 3.2826.51333 4.1429 1.4233.74708.74667 1.1319 1.75 1.1319 3.0567v.046667c0 2.0067-1.0414 3.3367-2.6035 4.0133l3.0336 4.5733h-4.075l-2.5582-3.9667h-1.5394v3.9667h-3.509l-.022639-13.113zm5.8408 6.3c1.1999 0 1.879-.60667 1.879-1.54v-.07c0-1.0267-.72444-1.54-1.9017-1.54h-2.3092v3.15h2.3318z"/><path d="m146.95.44333h10.21v3.10337h-6.72v1.96h6.09v2.87h-6.09v2.0763h6.81v3.08h-10.3z"/><path d="m9.9611 8.5633c-.49806 1.1433-1.5394 1.96-2.8978 1.96-1.9243 0-3.2374-1.6567-3.2374-3.5233v-.046667c0-1.89 1.2904-3.5 3.2147-3.5 1.4489 0 2.5582.91 3.011 2.17h3.7128c-.58861-3.1267-3.26-5.4367-6.7011-5.4367-3.9165 0-6.8596 3.0567-6.8596 6.8133v.046667c0 3.7567 2.8978 6.7667 6.8143 6.7667 3.3506 0 5.9767-2.24 6.6558-5.2267l-3.7128-.023333z"/></g><path d="m70.493 20.684-9.658-5.555-1.667-.723-39.513.294v20.097l50.838.022z" fill="#fff"/><path d="m52.909 32.968c.47281-1.6258.29269-3.1161-.49532-4.2226-.72047-1.0161-1.9363-1.6032-3.3997-1.671l-27.715-.36129c-.18012 0-.33772-.090323-.42778-.22581-.090058-.13548-.11257-.31613-.067544-.49677.090058-.27097.36023-.47419.65292-.49677l27.963-.36129c3.3096-.15806 6.912-2.8452 8.1728-6.1419l1.5985-4.1774c.067544-.18065.090058-.36129.045029-.54194-1.8012-8.1742-9.0734-14.271-17.764-14.271-8.0152 0-14.815 5.1935-17.246 12.397-1.576-1.1742-3.5798-1.8065-5.7412-1.6032-3.85.38387-6.9345 3.4774-7.3173 7.3387-.090058.99355-.022515 1.9645.20263 2.8677-6.2816.18065-11.302 5.329-11.302 11.674 0 .56452.045029 1.129.11257 1.6935.045029.27097.27018.47419.54035.47419h51.153c.29269 0 .56287-.20323.65292-.49677l.38275-1.3774z" fill="#f38020"/><path d="m61.735 15.106c-.24766 0-.51784 0-.7655.022581-.18012 0-.33772.13548-.40526.31613l-1.0807 3.771c-.47281 1.6258-.29269 3.1161.49532 4.2226.72047 1.0161 1.9363 1.6032 3.3997 1.671l5.8988.36129c.18012 0 .33772.090323.42778.22581.090058.13548.11257.33871.067544.49677-.090058.27097-.36023.47419-.65292.49677l-6.1465.36129c-3.3322.15806-6.912 2.8452-8.1728 6.1419l-.45029 1.1516c-.090058.22581.067544.45161.3152.45161h21.119c.24766 0 .47281-.15806.54035-.40645.36023-1.3097.56287-2.6871.56287-4.1097 0-8.3774-6.7769-15.174-15.152-15.174" fill="#faae40"/></g></svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

@@ -0,0 +1 @@
<svg viewBox="0 0 153 51" xmlns="http://www.w3.org/2000/svg"><g fill="none"><g fill="#404041"><path d="m151.5 42c-.83607 0-1.5-.66393-1.5-1.5 0-.81148.66393-1.5 1.5-1.5.81148 0 1.5.66393 1.5 1.5 0 .81148-.68852 1.5-1.5 1.5zm0-2.7049c-.66393 0-1.2049.54098-1.2049 1.2049s.54098 1.2049 1.2049 1.2049 1.2049-.54098 1.2049-1.2049-.54098-1.2049-1.2049-1.2049zm.7623 1.9918h-.34426l-.29508-.56557h-.39344v.56557h-.31967v-1.6475h.78688c.34426 0 .56557.22131.56557.54098 0 .2459-.14754.41803-.34426.4918l.34426.61475zm-.59016-.86066c.12295 0 .2459-.07377.2459-.2459 0-.19672-.098361-.2459-.2459-.2459h-.4918v.4918z"/><path d="m17 39h3.288v9.091h5.712v2.909h-9z"/><path d="m29 45.041v-.041096c0-3.3082 2.798-6 6.5215-6s6.4785 2.6507 6.4785 5.9589v.041096c0 3.3082-2.798 6-6.5215 6s-6.4785-2.6507-6.4785-5.9589m9.5993 0v-.041096c0-1.6644-1.2483-3.1027-3.0993-3.1027-1.8295 0-3.0563 1.4178-3.0563 3.0822v.041096c0 1.6644 1.2483 3.1027 3.0778 3.1027 1.851 0 3.0778-1.4178 3.0778-3.0822"/><path d="m46 45.62v-6.62h3.3295v6.5569c0 1.7023.86398 2.5009 2.1705 2.5009s2.1705-.77758 2.1705-2.4168v-6.641h3.3295v6.5359c0 3.8039-2.1705 5.4641-5.5421 5.4641-3.3506 0-5.4579-1.6813-5.4579-5.38"/><path d="m62 39h4.4578c4.1276 0 6.5422 2.4599 6.5422 5.9251v.042781c0 3.4652-2.4353 6.0321-6.6041 6.0321h-4.3959v-12zm4.5197 9.0481c1.9193 0 3.1989-1.0909 3.1989-3.0374v-.042781c0-1.9251-1.2795-3.0374-3.1989-3.0374h-1.3002v6.0963h1.3002v.02139z"/><path d="m78 39h10v2.909h-6.548v2.054h5.924v2.759h-5.924v4.278h-3.452z"/><path d="m92 39h3.267v9.091h5.733v2.909h-9z"/><path d="m109.93 39h3.11l4.9553 12h-3.4625l-.85008-2.1239h-4.4785l-.82935 2.1239h-3.3796l4.9346-12zm2.8405 7.3062-1.2855-3.377-1.3062 3.377z"/><path d="m122 39h5.6383c1.8298 0 3.0851.46975 3.8936 1.3025.70213.68327 1.0638 1.6014 1.0638 2.7972v.042705c0 1.8363-.97872 3.0534-2.4468 3.6726l2.8511 4.1851h-3.8298l-2.4043-3.6299h-1.4468v3.6299h-3.3191v-12zm5.4894 5.7438c1.1277 0 1.766-.55516 1.766-1.4093v-.042705c0-.9395-.68085-1.4093-1.7872-1.4093h-2.1702v2.8612h2.1915z"/><path d="m138 39h9.91v2.824h-6.53v1.818h5.92v2.631h-5.92v1.903h6.62v2.824h-10z"/><path d="m9.3539 46.377c-.47746 1.0068-1.4758 1.726-2.778 1.726-1.8447 0-3.1035-1.4589-3.1035-3.1027v-.041096c0-1.6644 1.2371-3.0822 3.0818-3.0822 1.389 0 2.4524.80137 2.8865 1.911h3.5593c-.56427-2.7534-3.1252-4.7877-6.424-4.7877-3.7546 0-6.576 2.6918-6.576 6v.041096c0 3.3082 2.778 5.9589 6.5326 5.9589 3.212 0 5.7295-1.9726 6.3806-4.6027l-3.5593-.020548z"/></g><g transform="translate(77)"><path d="m66.789 19.588-9.157-5.203-1.58-.677-37.46.254v18.848h48.197z" fill="#fff"/><path d="m50.118 31.075c.44825-1.5231.27749-2.9192-.46959-3.9558-.68304-.95192-1.8357-1.5019-3.2231-1.5654l-26.276-.33846c-.17076 0-.32018-.084615-.40556-.21154-.08538-.12692-.10673-.29615-.064035-.46538.08538-.25385.34152-.44423.61901-.46538l26.511-.33846c3.1377-.14808 6.5529-2.6654 7.7482-5.7538l1.5155-3.9135c.064035-.16923.08538-.33846.04269-.50769-1.7076-7.6577-8.602-13.369-16.841-13.369-7.5988 0-14.045 4.8654-16.35 11.613-1.4942-1.1-3.3939-1.6923-5.443-1.5019-3.65.35962-6.5743 3.2577-6.9371 6.875-.08538.93077-.021345 1.8404.19211 2.6865-5.9553.16923-10.715 4.9923-10.715 10.937 0 .52885.04269 1.0577.10673 1.5865.04269.25385.25614.44423.51228.44423h48.496c.27749 0 .53363-.19038.61901-.46538l.36287-1.2904z" fill="#f38020"/><path d="m58.485 14.342c-.2348 0-.49094 0-.72573.021154-.17076 0-.32018.12692-.38421.29615l-1.0246 3.5327c-.44825 1.5231-.27749 2.9192.46959 3.9558.68304.95192 1.8357 1.5019 3.2231 1.5654l5.5924.33846c.17076 0 .32018.084615.40556.21154.08538.12692.10673.31731.064035.46538-.08538.25385-.34152.44423-.61901.46538l-5.8272.33846c-3.1591.14808-6.5529 2.6654-7.7482 5.7538l-.4269 1.0788c-.08538.21154.064035.42308.29883.42308h20.022c.2348 0 .44825-.14808.51228-.38077.34152-1.2269.53363-2.5173.53363-3.85 0-7.8269-6.4462-14.215-14.365-14.215" fill="#faae40"/></g></g></svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 20 KiB

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="800" width="1200" viewBox="-23.0778 -47.669 200.0076 286.014"><defs><linearGradient y2="203.072" x2="97.325" y1="197.061" x1="94.473" gradientTransform="translate(-223.343 -63.977) scale(1.75753)" gradientUnits="userSpaceOnUse" id="f" xlink:href="#a"/><linearGradient id="a"><stop offset="0" stop-color="#8ae234"/><stop offset="1" stop-color="#4e9a06"/></linearGradient><linearGradient y2="252.588" x2="116.783" y1="198.703" x1="85.672" gradientTransform="translate(-223.343 -63.977) scale(1.75753)" gradientUnits="userSpaceOnUse" id="g" xlink:href="#a"/><linearGradient y2="370.314" x2="121.945" y1="313.233" x1="93.082" gradientTransform="matrix(1.66726 0 0 1.62815 -218.051 -225.052)" gradientUnits="userSpaceOnUse" id="h" xlink:href="#b"/><linearGradient id="b"><stop offset="0" stop-color="#fff" stop-opacity=".549"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient><linearGradient id="c"><stop offset="0" stop-color="#fff"/><stop offset=".5" stop-color="#fff520" stop-opacity=".891"/><stop offset="1" stop-color="#fff300" stop-opacity="0"/></linearGradient><filter height="1.335" y="-.168" width="1.337" x="-.168" id="d" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation=".63"/></filter><filter id="e" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.275"/></filter><radialGradient xlink:href="#c" id="i" gradientUnits="userSpaceOnUse" cx="55" cy="125" fx="55" fy="125" r="14.375"/></defs><g transform="translate(93.114 -254.984)"><path transform="translate(-239.299 129.854) scale(1.75753)" d="M100.134 82.972h8.98v9.021h-8.98z" fill-rule="evenodd" stroke="#000" stroke-width="1.651" filter="url(#d)"/><path transform="translate(-239.299 129.854) scale(1.75753)" d="M95.888 87.412h62.115a5.405 5.405 0 015.417 5.417v43.72a5.405 5.405 0 01-5.417 5.417H95.888a5.405 5.405 0 01-5.417-5.417V92.83a5.405 5.405 0 015.417-5.417z" fill-rule="evenodd" stroke="#000" stroke-width="2.051" filter="url(#e)"/><path d="M-63.31 275.68h15.782v15.855h-15.781z" fill="url(#f)" fill-rule="evenodd" stroke="#366a04" stroke-width="2.902"/><path d="M-70.772 283.483H38.396a9.5 9.5 0 019.521 9.521v76.84a9.5 9.5 0 01-9.52 9.52h-109.17a9.5 9.5 0 01-9.52-9.52v-76.84a9.5 9.5 0 019.52-9.52z" fill="url(#g)" fill-rule="evenodd" stroke="#366a04" stroke-width="3.605"/><path d="M7.261 331.424c0 12.95-10.498 23.45-23.45 23.45-12.95 0-23.449-10.5-23.449-23.45s10.5-23.45 23.45-23.45 23.45 10.5 23.45 23.45z" fill="#fff" stroke="#366a04" stroke-width="3.605"/><path d="M-68.185 286.857H35.376c6.761 0 9.032 2.836 9.032 8.82v71.183c0 5.985-2.49 8.82-9.032 8.82h-103.56c-6.762 0-9.033-2.616-9.033-8.82v-71.183c0-6.643 2.93-8.82 9.032-8.82z" fill="none" stroke="url(#h)" stroke-width="3.38" stroke-linejoin="round"/><circle transform="translate(-76.383 64.435) scale(1.72247)" style="marker:none" cx="55" cy="125" r="14.375" color="#000" display="block" fill="url(#i)"/></g><path style="line-height:125%;-inkscape-font-specification:'PT Sans Bold';text-align:start" d="M32.617 146.7l5.666 15.941 1.121 5.169h.25l.871-5.231 3.986-15.88h7.41l-9.59 31.448h-5.978l-6.29-17.436-.81-3.923h-.31l-.748 3.985-5.978 17.374h-6.165L6.026 146.7h8.78l4.547 15.63.747 5.542h.311l1.059-5.604 5.169-15.568zm46.808 28.458q-1.869 1.494-5.107 2.553-3.176.996-6.787.996-7.535 0-11.023-4.359-3.487-4.42-3.487-12.08 0-8.22 3.923-12.33 3.923-4.11 11.022-4.11 2.367 0 4.609.623 2.241.622 3.985 2.054 1.744 1.433 2.802 3.861 1.059 2.429 1.059 6.04 0 1.308-.187 2.803-.124 1.495-.436 3.114H61.117q.186 3.923 1.992 5.915 1.868 1.993 5.978 1.993 2.554 0 4.546-.747 2.055-.81 3.114-1.62zm-11.583-22.854q-3.176 0-4.733 1.93-1.494 1.869-1.806 5.045h11.583q.249-3.363-1.059-5.169-1.245-1.806-3.985-1.806zm18.466-18.059h8.096v14.945h.249q1.307-1.494 3.362-2.366 2.055-.872 4.546-.872 5.605 0 8.531 3.861 2.99 3.799 2.99 11.645 0 8.407-4.173 12.766-4.11 4.359-11.333 4.359-3.986 0-7.286-.685-3.3-.623-4.982-1.432zm13.887 18.557q-2.242 0-3.674 1.183-1.37 1.121-2.117 3.3v13.576q.996.498 2.117.685 1.183.187 2.49.187 3.301 0 4.982-2.366 1.744-2.429 1.744-7.66 0-8.905-5.542-8.905zm19.608-6.102h5.916l.934 3.736h.25q1.619-2.366 3.798-3.487 2.242-1.121 5.418-1.121 5.853 0 8.78 3.736 2.927 3.674 2.927 11.894 0 3.986-.934 7.224-.934 3.176-2.802 5.417-1.806 2.242-4.484 3.425-2.615 1.183-6.04 1.183-1.93 0-3.176-.31-1.246-.25-2.491-.873v12.766h-8.096zm13.887 5.978q-2.366 0-3.736 1.183-1.308 1.183-2.055 3.55v12.952q.872.685 1.868 1.12 1.059.375 2.74.375 3.487 0 5.23-2.43 1.744-2.49 1.744-8.157 0-4.11-1.37-6.351-1.37-2.242-4.42-2.242z" font-weight="700" font-size="62.272" font-family="PT Sans" letter-spacing=".17" word-spacing="0" fill="#333" stroke="#292929" stroke-width=".772"/></svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 17 KiB

@@ -0,0 +1,9 @@
<svg width="162" height="20" viewBox="0 0 162 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M77.2324 12.4999C79.313 12.4999 80.9994 14.1789 80.9994 16.25C80.9994 18.3215 79.313 20 77.2324 20C75.1512 20 73.4648 18.3215 73.4648 16.25C73.4648 14.1789 75.1512 12.4999 77.2324 12.4999" fill="#76B82A"/>
<path d="M157.605 19.9997H162V8.74998C162 3.91757 158.065 -0.000366211 153.21 -0.000366211C150.584 -0.000366211 148.227 1.14552 146.616 2.96186C145.005 1.14552 142.649 -0.000366211 140.023 -0.000366211C135.168 -0.000366211 131.233 3.91757 131.233 8.74998V19.9997H135.628V8.74998L135.631 8.5991C135.71 6.253 137.646 4.37456 140.023 4.37456C142.451 4.37456 144.419 6.33402 144.419 8.74998V19.9997H148.814V8.74998L148.817 8.5991C148.896 6.253 150.833 4.37456 153.21 4.37456C155.637 4.37456 157.605 6.33402 157.605 8.74998V19.9997Z" fill="#3C3C3C"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M106.744 9.99988C106.744 4.47712 111.242 -0.000171661 116.791 -0.000171661C122.339 -0.000171661 126.837 4.47712 126.837 9.99988C126.837 15.5226 122.339 19.9999 116.791 19.9999C111.242 19.9999 106.744 15.5226 106.744 9.99988ZM111.139 9.99988C111.139 13.1067 113.669 15.625 116.791 15.625C119.912 15.625 122.442 13.1067 122.442 9.99988C122.442 6.89309 119.912 4.37476 116.791 4.37476C113.669 4.37476 111.139 6.89309 111.139 9.99988Z" fill="#3C3C3C"/>
<path d="M95.4503 15.625C92.329 15.625 89.799 13.1067 89.799 9.99988C89.799 6.89308 92.329 4.37476 95.4503 4.37476C97.0645 4.37476 98.516 5.05152 99.5458 6.13142L102.654 3.03773C100.828 1.16657 98.2776 -0.000171661 95.4503 -0.000171661C89.9019 -0.000171661 85.4037 4.47712 85.4037 9.99988C85.4037 15.5226 89.9019 19.9999 95.4503 19.9999C98.2776 19.9999 100.828 18.8332 102.654 16.962L99.5458 13.8688C98.516 14.9482 97.0645 15.625 95.4503 15.625Z" fill="#3C3C3C"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M69.0698 9.99988C69.0698 4.47712 64.5716 -0.000171661 59.0232 -0.000171661C53.4748 -0.000171661 48.9767 4.47712 48.9767 9.99988C48.9767 15.5226 53.4748 19.9999 59.0232 19.9999C63.1187 19.9999 66.6416 17.5607 68.2061 14.0624L62.9316 14.0629C61.9168 15.0302 60.5395 15.625 59.0232 15.625C56.4469 15.625 54.2736 13.9091 53.5932 11.563H68.9479C69.0278 11.0536 69.0698 10.5316 69.0698 9.99988ZM53.6936 8.12532C54.4691 5.94028 56.5624 4.37476 59.0232 4.37476C61.484 4.37476 63.5774 5.94028 64.3528 8.12532H53.6936Z" fill="#3C3C3C"/>
<path d="M44.5795 9.80291C44.4742 4.37088 40.0175 -0.000171661 34.5349 -0.000171661C28.986 -0.000171661 24.4883 4.47712 24.4883 9.99988V19.9999H28.8836V9.99988L28.886 9.83396C28.9743 6.8043 31.4692 4.37476 34.5349 4.37476C37.6556 4.37476 40.1861 6.89308 40.1861 9.99988V19.9999H44.5814V9.99988L44.5795 9.80291Z" fill="#3C3C3C"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.0931 9.99988C20.0931 4.47712 15.595 -0.000171661 10.0465 -0.000171661C4.49762 -0.000171661 0 4.47712 0 9.99988C0 15.5226 4.49762 19.9999 10.0465 19.9999C15.595 19.9999 20.0931 15.5226 20.0931 9.99988ZM4.39527 9.99988C4.39527 6.89309 6.9253 4.37476 10.0465 4.37476C13.1673 4.37476 15.6973 6.89309 15.6973 9.99988C15.6973 13.1067 13.1673 15.625 10.0465 15.625C6.9253 15.625 4.39527 13.1067 4.39527 9.99988Z" fill="#3C3C3C"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

@@ -0,0 +1 @@
<svg height="45" viewBox="0 0 25 45" width="25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" x1="50.138384%" x2="50.138384%" y1="100%" y2="32.534707%"><stop offset="0" stop-color="#f56640"/><stop offset=".243858064" stop-color="#f57840"/><stop offset="1" stop-color="#ffbe54"/></linearGradient><linearGradient id="b" x1="50.002945%" x2="50.002945%" y1="98.320578%" y2="18.977303%"><stop offset="0" stop-color="#f56640"/><stop offset=".181093204" stop-color="#f57840"/><stop offset="1" stop-color="#ffbe54"/></linearGradient><linearGradient id="c" x1="50.000006%" x2="50%" y1="110.433207%" y2="-25.444358%"><stop offset="0" stop-color="#f56640"/><stop offset=".0837881088" stop-color="#f57840"/><stop offset="1" stop-color="#ffbe54"/></linearGradient><linearGradient id="d" x1="50.000006%" x2="50.000006%" y1="84.377953%" y2="0%"><stop offset="0" stop-color="#f56640"/><stop offset=".391082657" stop-color="#f57840"/><stop offset="1" stop-color="#ffbe54"/></linearGradient><g fill="none" fill-rule="evenodd"><path d="m18.4447368 22.8371579c-.8235789 0-1.5956842-.4804211-1.9731579-1.2353684l-.652-1.4584211h-6.46852627l-.652 1.4584211c-.37747368.7549473-1.14957895 1.2353684-1.97315789 1.2353684h-.3431579l2.76242105 21.0527368c.13726316.3946316.39463158.3946316.54905264 0l2.74526317-6.7258947 2.3849474 6.7087368c.1372631.3946316.3946315.3946316.5490526 0l3.1913684-21.018421z" fill="url(#a)"/><path d="m15.5622105 19.56h-5.93663155l-.90936842 2.0417895c-.30884211.6176842-.90936842 1.0637894-1.56136842 1.1838947l2.09326315 12.9885263c.13726316.2402106.39463158.2402106.54905263 0l2.67663161-4.066421 2.4535789 4.0492631c.1544211.2402106.3946316.2402106.5490527 0l2.3677894-13.0056842c-.5833684-.1715789-1.0981052-.5833684-1.3726316-1.1495789z" fill="url(#b)"/><path d="m16.4715789 21.6017895-3.8948421-8.6990527-3.87768417 8.6990527c-.13726316.2573684-.3088421.480421-.51473684.6691579l1.6128421 8.630421c.08578948.1201053.30884211.1544211.46326321 0l2.1618947-2.8653684 2.1618947 2.8482105c.1372632.171579.3774737.1372632.4632632 0l1.784421-8.7333684c-.1372631-.1715789-.2573684-.3431579-.3603158-.5490526" fill="url(#c)"/><path d="m16.4715789 21.6017895-3.8948421-8.6990527-3.87768417 8.6990527c-.13726316.2573684-.3088421.480421-.51473684.6691579l1.6128421 8.630421c.08578948.1201053.30884211.1544211.46326321 0l2.1618947-2.8653684 2.1618947 2.8482105c.1372632.171579.3774737.1372632.4632632 0l1.784421-8.7333684c-.1372631-.1715789-.2573684-.3431579-.3603158-.5490526" fill="url(#d)" opacity=".5"/><path d="m.15442105 1.06378947c-.12010526-.41178947.12010527-.70347368.53189474-.70347368h3.41442105c.24021053 0 .46326316.20589474.53189474.41178947l2.50505263 9.86578944h.12010526l4.51252633-10.24326312c.0857895-.17157895.2573684-.326.4975789-.326h.5318948c.2573684 0 .4289473.13726316.4975789.326l4.5125263 10.24326312h.1201053l2.5050526-9.86578944c.0514737-.20589473.2916842-.41178947.5318948-.41178947h3.414421c.4117895 0 .6348421.29168421.5318948.70347368l-5.5076843 19.56000003c-.0514736.2402105-.2916842.4117894-.5318947.4117894h-.4632631c-.2058948 0-.4117895-.1372631-.497579-.326l-5.3361053-11.9075789h-.0857894l-5.30178951 11.9075789c-.08578947.171579-.29168421.326-.49757894.326h-.46326316c-.24021053 0-.46326316-.1715789-.53189474-.4117894z" fill="#f56640"/></g></svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

@@ -0,0 +1 @@
<svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><g stroke="#02707f"><path d="m7.5 15c-.076 0-.153-.017-.224-.053-.169-.085-.276-.258-.276-.447v-9c0-.189.107-.363.276-.447s.372-.066.524.047l6 4.5c.126.094.2.243.2.4s-.074.306-.2.4l-6 4.5c-.088.066-.194.1-.3.1zm.5-8.5v7l4.667-3.5z"/><path d="m19.5 2h-19c-.276 0-.5.224-.5.5v15c0 .276.224.5.5.5h19c.276 0 .5-.224.5-.5v-15c0-.276-.224-.5-.5-.5zm-16.5 9h-2v-2h2zm0-3h-2v-2h2zm-2 4h2v2h-2zm3-9h12v14h-12zm13 6h2v2h-2zm0-1v-2h2v2zm0 4h2v2h-2zm2-7h-2v-2h2zm-16-2v2h-2v-2zm-2 12h2v2h-2zm16 2v-2h2v2z"/></g></svg>

After

Width:  |  Height:  |  Size: 588 B

@@ -0,0 +1 @@
<svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><g stroke="#f56640"><path d="m7.5 15c-.076 0-.153-.017-.224-.053-.169-.085-.276-.258-.276-.447v-9c0-.189.107-.363.276-.447s.372-.066.524.047l6 4.5c.126.094.2.243.2.4s-.074.306-.2.4l-6 4.5c-.088.066-.194.1-.3.1zm.5-8.5v7l4.667-3.5z"/><path d="m19.5 2h-19c-.276 0-.5.224-.5.5v15c0 .276.224.5.5.5h19c.276 0 .5-.224.5-.5v-15c0-.276-.224-.5-.5-.5zm-16.5 9h-2v-2h2zm0-3h-2v-2h2zm-2 4h2v2h-2zm3-9h12v14h-12zm13 6h2v2h-2zm0-1v-2h2v2zm0 4h2v2h-2zm2-7h-2v-2h2zm-16-2v2h-2v-2zm-2 12h2v2h-2zm16 2v-2h2v2z"/></g></svg>

After

Width:  |  Height:  |  Size: 588 B

@@ -0,0 +1 @@
<svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><g stroke="#121116"><path d="m7.5 15c-.076 0-.153-.017-.224-.053-.169-.085-.276-.258-.276-.447v-9c0-.189.107-.363.276-.447s.372-.066.524.047l6 4.5c.126.094.2.243.2.4s-.074.306-.2.4l-6 4.5c-.088.066-.194.1-.3.1zm.5-8.5v7l4.667-3.5z"/><path d="m19.5 2h-19c-.276 0-.5.224-.5.5v15c0 .276.224.5.5.5h19c.276 0 .5-.224.5-.5v-15c0-.276-.224-.5-.5-.5zm-16.5 9h-2v-2h2zm0-3h-2v-2h2zm-2 4h2v2h-2zm3-9h12v14h-12zm13 6h2v2h-2zm0-1v-2h2v2zm0 4h2v2h-2zm2-7h-2v-2h2zm-16-2v2h-2v-2zm-2 12h2v2h-2zm16 2v-2h2v2z"/></g></svg>

After

Width:  |  Height:  |  Size: 588 B

@@ -0,0 +1 @@
<svg fill="none" height="32" viewBox="0 0 117 32" width="117" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h117v31.2h-117z"/></clipPath><g clip-path="url(#a)"><path d="m15.6 2.59961 13.7915 23.88749h-27.58291z" fill="#172153"/><path clip-rule="evenodd" d="m58.4984 27.95c-6.8207 0-12.35-5.5293-12.35-12.35 0-6.82071 5.5293-12.35 12.35-12.35s12.35 5.52929 12.35 12.35c0 6.8207-5.5293 12.35-12.35 12.35z" fill="#f56f46" fill-rule="evenodd"/><rect fill="#ffd147" height="20.2233" rx="2.6" transform="matrix(.70710678 .70710678 -.70710678 .70710678 30.619749 -71.321052)" width="20.2233" x="101.402" y="1.30078"/></g></svg>

After

Width:  |  Height:  |  Size: 682 B

@@ -0,0 +1 @@
<svg fill="none" height="48" viewBox="0 0 63 48" width="63" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><clipPath id="a"><path d="m0 0h63v48h-63z"/></clipPath><g clip-path="url(#a)"><path d="m55.3556 46.0004h-33.3508c-3.5892 0-5.8048-3.9169-3.9559-6.9931l16.7826-27.9216c1.7993-2.9935 6.1428-2.98121 7.925.0224l16.5683 27.9216c1.8256 3.0766-.3917 6.9707-3.9692 6.9707z" fill="#fff"/><path d="m46.0883 46h-37.8916c-3.59725 0-5.81172-3.9328-3.94641-7.0086l19.06751-31.44197c1.8028-2.9727 6.1205-2.96044 7.9064.02245l18.824 31.44192c1.8418 3.0764-.3744 6.9862-3.9599 6.9862z" fill="#f56f46"/><path clip-rule="evenodd" d="m22.0053 45.9997h24.0831c3.5855 0 5.8017-3.9099 3.9599-6.9862l-15.9699-26.6746-16.0289 26.6677c-1.849 3.0762.3667 6.9931 3.9558 6.9931z" fill="#172153" fill-rule="evenodd"/><g fill="#fff"><rect height="4.13549" rx="2.06775" transform="matrix(.00000013 -1 -1 -.00000013 28.3662 32.6211)" width="15.4682"/><rect height="4.13549" rx="2.06775" transform="matrix(.00000013 -1 -1 -.00000013 28.3662 38.8672)" width="4.15592"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 662 B

@@ -0,0 +1,109 @@
class RocketBrowserCompatibilityChecker {
constructor( options ) {
this.passiveSupported = false;
this._checkPassiveOption( this );
this.options = this.passiveSupported ? options : false;
}
/**
* Initializes browser check for addEventListener passive option.
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
* @private
*
* @param self Instance of this object.
* @returns {boolean}
*/
_checkPassiveOption( self ) {
try {
const options = {
// This function will be called when the browser attempts to access the passive property.
get passive() {
self.passiveSupported = true;
return false;
}
};
window.addEventListener( 'test', null, options );
window.removeEventListener( 'test', null, options );
} catch ( err ) {
self.passiveSupported = false;
}
}
/**
* Checks if the browser supports requestIdleCallback and cancelIdleCallback. If no, shims its behavior with a polyfills.
*
* @link @link https://developers.google.com/web/updates/2015/08/using-requestidlecallback
*/
initRequestIdleCallback() {
if ( ! 'requestIdleCallback' in window ) {
window.requestIdleCallback = ( cb ) => {
const start = Date.now();
return setTimeout( () => {
cb( {
didTimeout: false,
timeRemaining: function timeRemaining() {
return Math.max( 0, 50 - ( Date.now() - start ) );
}
} );
}, 1 );
};
}
if ( ! 'cancelIdleCallback' in window ) {
window.cancelIdleCallback = ( id ) => clearTimeout( id );
}
}
/**
* Detects if data saver mode is on.
*
* @link https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/save-data/#detecting_the_save-data_setting
*
* @returns {boolean|boolean}
*/
isDataSaverModeOn() {
return (
'connection' in navigator
&&
true === navigator.connection.saveData
);
}
/**
* Checks if the browser supports link prefetch.
*
* @returns {boolean|boolean}
*/
supportsLinkPrefetch() {
const elem = document.createElement( 'link' );
return (
elem.relList
&&
elem.relList.supports
&&
elem.relList.supports( 'prefetch' )
&&
window.IntersectionObserver
&&
'isIntersecting' in IntersectionObserverEntry.prototype
);
}
isSlowConnection() {
return (
'connection' in navigator
&&
'effectiveType' in navigator.connection
&&
(
'2g' === navigator.connection.effectiveType
||
'slow-2g' === navigator.connection.effectiveType
)
)
}
}
@@ -0,0 +1 @@
"use strict";var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var RocketBrowserCompatibilityChecker=function(){function RocketBrowserCompatibilityChecker(options){_classCallCheck(this,RocketBrowserCompatibilityChecker),this.passiveSupported=!1,this._checkPassiveOption(this),this.options=!!this.passiveSupported&&options}return _createClass(RocketBrowserCompatibilityChecker,[{key:"_checkPassiveOption",value:function(self){try{var options={get passive(){return!(self.passiveSupported=!0)}};window.addEventListener("test",null,options),window.removeEventListener("test",null,options)}catch(err){self.passiveSupported=!1}}},{key:"initRequestIdleCallback",value:function(){!1 in window&&(window.requestIdleCallback=function(cb){var start=Date.now();return setTimeout(function(){cb({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-start))}})},1)}),!1 in window&&(window.cancelIdleCallback=function(id){return clearTimeout(id)})}},{key:"isDataSaverModeOn",value:function(){return"connection"in navigator&&!0===navigator.connection.saveData}},{key:"supportsLinkPrefetch",value:function(){var elem=document.createElement("link");return elem.relList&&elem.relList.supports&&elem.relList.supports("prefetch")&&window.IntersectionObserver&&"isIntersecting"in IntersectionObserverEntry.prototype}},{key:"isSlowConnection",value:function(){return"connection"in navigator&&"effectiveType"in navigator.connection&&("2g"===navigator.connection.effectiveType||"slow-2g"===navigator.connection.effectiveType)}}]),RocketBrowserCompatibilityChecker}();
@@ -0,0 +1,23 @@
function wprRemoveCPCSS() {
let preload_stylesheets = document.querySelectorAll( 'link[data-rocket-async="style"][rel="preload"]' );
if ( preload_stylesheets && preload_stylesheets.length > 0 ) {
for ( let stylesheet_index = 0;stylesheet_index < preload_stylesheets.length;stylesheet_index++ ){
let media = preload_stylesheets[stylesheet_index].getAttribute('media') || 'all';
if( window.matchMedia(media).matches ){
setTimeout( wprRemoveCPCSS, 200 );
return;
}
}
}
const elem = document.getElementById( 'rocket-critical-css' );
if ( elem && 'remove' in elem ) {
elem.remove();
}
}
if ( window.addEventListener ) {
window.addEventListener( 'load', wprRemoveCPCSS );
} else if ( window.attachEvent ) {
window.attachEvent( 'onload', wprRemoveCPCSS );
}
@@ -0,0 +1 @@
"use strict";function wprRemoveCPCSS(){var preload_stylesheets=document.querySelectorAll('link[data-rocket-async="style"][rel="preload"]');if(preload_stylesheets&&0<preload_stylesheets.length)for(var stylesheet_index=0;stylesheet_index<preload_stylesheets.length;stylesheet_index++){var media=preload_stylesheets[stylesheet_index].getAttribute("media")||"all";if(window.matchMedia(media).matches)return void setTimeout(wprRemoveCPCSS,200)}var elem=document.getElementById("rocket-critical-css");elem&&"remove"in elem&&elem.remove()}window.addEventListener?window.addEventListener("load",wprRemoveCPCSS):window.attachEvent&&window.attachEvent("onload",wprRemoveCPCSS);
@@ -0,0 +1 @@
class RocketElementorAnimation{constructor(){this.deviceMode=document.createElement("span"),this.deviceMode.id="elementor-device-mode-wpr",this.deviceMode.setAttribute("class","elementor-screen-only"),document.body.appendChild(this.deviceMode)}_detectAnimations(){let t=getComputedStyle(this.deviceMode,":after").content.replace(/"/g,"");this.animationSettingKeys=this._listAnimationSettingsKeys(t),document.querySelectorAll(".elementor-invisible[data-settings]").forEach(t=>{const e=t.getBoundingClientRect();if(e.bottom>=0&&e.top<=window.innerHeight)try{this._animateElement(t)}catch(t){}})}_animateElement(t){const e=JSON.parse(t.dataset.settings),i=e._animation_delay||e.animation_delay||0,n=e[this.animationSettingKeys.find(t=>e[t])];if("none"===n)return void t.classList.remove("elementor-invisible");t.classList.remove(n),this.currentAnimation&&t.classList.remove(this.currentAnimation),this.currentAnimation=n;let s=setTimeout(()=>{t.classList.remove("elementor-invisible"),t.classList.add("animated",n),this._removeAnimationSettings(t,e)},i);window.addEventListener("rocket-startLoading",function(){clearTimeout(s)})}_listAnimationSettingsKeys(t="mobile"){const e=[""];switch(t){case"mobile":e.unshift("_mobile");case"tablet":e.unshift("_tablet");case"desktop":e.unshift("_desktop")}const i=[];return["animation","_animation"].forEach(t=>{e.forEach(e=>{i.push(t+e)})}),i}_removeAnimationSettings(t,e){this._listAnimationSettingsKeys().forEach(t=>delete e[t]),t.dataset.settings=JSON.stringify(e)}static run(){const t=new RocketElementorAnimation;requestAnimationFrame(t._detectAnimations.bind(t))}}document.addEventListener("DOMContentLoaded",RocketElementorAnimation.run);
@@ -0,0 +1,80 @@
function rocket_css_lazyload_launch() {
const usable_pairs = typeof rocket_pairs === 'undefined' ? [] : rocket_pairs;
const styleElement = document.querySelector('#wpr-lazyload-bg');
const threshold = rocket_lazyload_css_data.threshold || 300;
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const pairs = usable_pairs.filter(s => entry.target.matches(s.selector));
pairs.map(pair => {
if (pair) {
styleElement.innerHTML += pair.style;
pair.elements.forEach(el => {
// Stop observing the target element
observer.unobserve(el);
el.setAttribute(`data-rocket-lazy-bg-${pair.hash}`, 'loaded');
});
}
})
}
});
}, {
rootMargin: threshold + 'px'
});
function lazyload(e = []) {
const pass = e.length > 0;
if(! pass ) {
return;
}
usable_pairs.forEach(pair => {
try {
const elements = document.querySelectorAll(pair.selector);
elements.forEach(el => {
if(el.getAttribute(`data-rocket-lazy-bg-${pair.hash}`) === 'loaded') {
return;
}
observer.observe(el);
// Save el in the pair object (create a new empty array if it doesn't exist)
(pair.elements ||= []).push(el);
});
} catch (error) {
console.error(error);
}
});
}
lazyload();
const observe_DOM = (function(){
const MutationObserver = window.MutationObserver;
return function( obj, callback ){
if( !obj || obj.nodeType !== 1 ) return;
// define a new observer
const mutationObserver = new MutationObserver(callback);
// have the observer observe for changes in children
mutationObserver.observe( obj, { attributes: true, childList:true, subtree:true })
return mutationObserver
}
})()
const body = document.querySelector('body');
observe_DOM(body, lazyload)
}
rocket_css_lazyload_launch();
@@ -0,0 +1 @@
{"version":3,"names":[],"mappings":"","sources":["lazyload-css.js"],"sourcesContent":["!function o(n,c,s){function i(r,e){if(!c[r]){if(!n[r]){var t=\"function\"==typeof require&&require;if(!e&&t)return t(r,!0);if(a)return a(r,!0);throw(t=new Error(\"Cannot find module '\"+r+\"'\")).code=\"MODULE_NOT_FOUND\",t}t=c[r]={exports:{}},n[r][0].call(t.exports,function(e){return i(n[r][1][e]||e)},t,t.exports,o,n,c,s)}return c[r].exports}for(var a=\"function\"==typeof require&&require,e=0;e<s.length;e++)i(s[e]);return i}({1:[function(e,r,t){\"use strict\";!function(){const e=rocket_pairs||[],t=document.querySelector(\"#wpr-lazyload-bg\");var r=rocket_lazyload_css_data.threshold||300;const o=new IntersectionObserver(e=>{e.forEach(r=>{if(r.isIntersecting){const e=rocket_pairs.filter(e=>r.target.matches(e.selector));e.map(e=>{e&&(t.innerHTML+=e.style,e.elements.forEach(e=>{e.setAttribute(\"data-rocket-lazy-bg\",\"loaded\"),o.unobserve(e)}))})}})},{rootMargin:r+\"px\"});e.forEach(r=>{try{const e=document.querySelectorAll(r.selector);e.forEach(e=>{o.observe(e),(r.elements||(r.elements=[])).push(e)})}catch(e){console.error(e)}})}()},{}]},{},[1]);"],"file":"lazyload-css.js"}
@@ -0,0 +1 @@
!function o(n,c,a){function s(t,e){if(!c[t]){if(!n[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(u)return u(t,!0);throw(r=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",r}r=c[t]={exports:{}},n[t][0].call(r.exports,function(e){return s(n[t][1][e]||e)},r,r.exports,o,n,c,a)}return c[t].exports}for(var u="function"==typeof require&&require,e=0;e<a.length;e++)s(a[e]);return s}({1:[function(e,t,r){"use strict";!function(){const r="undefined"==typeof rocket_pairs?[]:rocket_pairs,e="undefined"==typeof rocket_excluded_pairs?[]:rocket_excluded_pairs;e.map(t=>{var e=t.selector;const r=document.querySelectorAll(e);r.forEach(e=>{e.setAttribute("data-rocket-lazy-bg-".concat(t.hash),"excluded")})});const o=document.querySelector("#wpr-lazyload-bg");var t=rocket_lazyload_css_data.threshold||300;const n=new IntersectionObserver(e=>{e.forEach(t=>{if(t.isIntersecting){const e=r.filter(e=>t.target.matches(e.selector));e.map(t=>{t&&(o.innerHTML+=t.style,t.elements.forEach(e=>{n.unobserve(e),e.setAttribute("data-rocket-lazy-bg-".concat(t.hash),"loaded")}))})}})},{rootMargin:t+"px"});function c(){0<(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]).length&&r.forEach(t=>{try{const e=document.querySelectorAll(t.selector);e.forEach(e=>{"loaded"!==e.getAttribute("data-rocket-lazy-bg-".concat(t.hash))&&"excluded"!==e.getAttribute("data-rocket-lazy-bg-".concat(t.hash))&&(n.observe(e),(t.elements||(t.elements=[])).push(e))})}catch(e){console.error(e)}})}c();const a=function(){const o=window.MutationObserver;return function(e,t){if(e&&1===e.nodeType){const r=new o(t);return r.observe(e,{attributes:!0,childList:!0,subtree:!0}),r}}}();t=document.querySelector("body"),a(t,c)}()},{}]},{},[1]);
@@ -0,0 +1 @@
{"version":3,"names":[],"mappings":"","sources":["lazyload-css.min.js"],"sourcesContent":["!function o(n,c,a){function s(t,e){if(!c[t]){if(!n[t]){var r=\"function\"==typeof require&&require;if(!e&&r)return r(t,!0);if(u)return u(t,!0);throw(r=new Error(\"Cannot find module '\"+t+\"'\")).code=\"MODULE_NOT_FOUND\",r}r=c[t]={exports:{}},n[t][0].call(r.exports,function(e){return s(n[t][1][e]||e)},r,r.exports,o,n,c,a)}return c[t].exports}for(var u=\"function\"==typeof require&&require,e=0;e<a.length;e++)s(a[e]);return s}({1:[function(e,t,r){\"use strict\";!function(){const r=\"undefined\"==typeof rocket_pairs?[]:rocket_pairs,e=\"undefined\"==typeof rocket_excluded_pairs?[]:rocket_excluded_pairs;e.map(t=>{var e=t.selector;const r=document.querySelectorAll(e);r.forEach(e=>{e.setAttribute(\"data-rocket-lazy-bg-\".concat(t.hash),\"excluded\")})});const o=document.querySelector(\"#wpr-lazyload-bg\");var t=rocket_lazyload_css_data.threshold||300;const n=new IntersectionObserver(e=>{e.forEach(t=>{if(t.isIntersecting){const e=r.filter(e=>t.target.matches(e.selector));e.map(t=>{t&&(o.innerHTML+=t.style,t.elements.forEach(e=>{n.unobserve(e),e.setAttribute(\"data-rocket-lazy-bg-\".concat(t.hash),\"loaded\")}))})}})},{rootMargin:t+\"px\"});function c(){0<(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]).length&&r.forEach(t=>{try{const e=document.querySelectorAll(t.selector);e.forEach(e=>{\"loaded\"!==e.getAttribute(\"data-rocket-lazy-bg-\".concat(t.hash))&&\"excluded\"!==e.getAttribute(\"data-rocket-lazy-bg-\".concat(t.hash))&&(n.observe(e),(t.elements||(t.elements=[])).push(e))})}catch(e){console.error(e)}})}c();const a=function(){const o=window.MutationObserver;return function(e,t){if(e&&1===e.nodeType){const r=new o(t);return r.observe(e,{attributes:!0,childList:!0,subtree:!0}),r}}}();t=document.querySelector(\"body\"),a(t,c)}()},{}]},{},[1]);"],"file":"lazyload-css.min.js"}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,461 @@
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.LazyLoad = factory();
})(this, function () {
'use strict';
var runningOnBrowser = typeof window !== "undefined";
var isBot = runningOnBrowser && !("onscroll" in window) || typeof navigator !== "undefined" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent);
var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window;
var supportsClassList = runningOnBrowser && "classList" in document.createElement("p");
var defaultSettings = {
elements_selector: "img",
container: isBot || runningOnBrowser ? document : null,
threshold: 300,
thresholds: null,
data_src: "src",
data_srcset: "srcset",
data_sizes: "sizes",
data_bg: "bg",
class_loading: "loading",
class_loaded: "loaded",
class_error: "error",
load_delay: 0,
auto_unobserve: true,
callback_enter: null,
callback_exit: null,
callback_reveal: null,
callback_loaded: null,
callback_error: null,
callback_finish: null
};
var getInstanceSettings = function getInstanceSettings(customSettings) {
return _extends({}, defaultSettings, customSettings);
};
var dataPrefix = "data-";
var processedDataName = "was-processed";
var timeoutDataName = "ll-timeout";
var trueString = "true";
var getData = function getData(element, attribute) {
return element.getAttribute(dataPrefix + attribute);
};
var setData = function setData(element, attribute, value) {
var attrName = dataPrefix + attribute;
if (value === null) {
element.removeAttribute(attrName);
return;
}
element.setAttribute(attrName, value);
};
var setWasProcessedData = function setWasProcessedData(element) {
return setData(element, processedDataName, trueString);
};
var getWasProcessedData = function getWasProcessedData(element) {
return getData(element, processedDataName) === trueString;
};
var setTimeoutData = function setTimeoutData(element, value) {
return setData(element, timeoutDataName, value);
};
var getTimeoutData = function getTimeoutData(element) {
return getData(element, timeoutDataName);
};
var purgeProcessedElements = function purgeProcessedElements(elements) {
return elements.filter(function (element) {
return !getWasProcessedData(element);
});
};
var purgeOneElement = function purgeOneElement(elements, elementToPurge) {
return elements.filter(function (element) {
return element !== elementToPurge;
});
};
/* Creates instance and notifies it through the window element */
var createInstance = function createInstance(classObj, options) {
var event;
var eventString = "LazyLoad::Initialized";
var instance = new classObj(options);
try {
// Works in modern browsers
event = new CustomEvent(eventString, {
detail: {
instance: instance
}
});
} catch (err) {
// Works in Internet Explorer (all versions)
event = document.createEvent("CustomEvent");
event.initCustomEvent(eventString, false, false, {
instance: instance
});
}
window.dispatchEvent(event);
};
/* Auto initialization of one or more instances of lazyload, depending on the
options passed in (plain object or an array) */
function autoInitialize(classObj, options) {
if (!options) {
return;
}
if (!options.length) {
// Plain object
createInstance(classObj, options);
} else {
// Array of objects
for (var i = 0, optionsItem; optionsItem = options[i]; i += 1) {
createInstance(classObj, optionsItem);
}
}
}
var callbackIfSet = function callbackIfSet(callback, argument) {
if (callback) {
callback(argument);
}
};
var updateLoadingCount = function updateLoadingCount(instance, plusMinus) {
instance._loadingCount += plusMinus;
if (instance._elements.length === 0 && instance._loadingCount === 0) {
callbackIfSet(instance._settings.callback_finish);
}
};
var getSourceTags = function getSourceTags(parentTag) {
var sourceTags = [];
for (var i = 0, childTag; childTag = parentTag.children[i]; i += 1) {
if (childTag.tagName === "SOURCE") {
sourceTags.push(childTag);
}
}
return sourceTags;
};
var setAttributeIfValue = function setAttributeIfValue(element, attrName, value) {
if (!value) {
return;
}
element.setAttribute(attrName, value);
};
var setImageAttributes = function setImageAttributes(element, settings) {
setAttributeIfValue(element, "sizes", getData(element, settings.data_sizes));
setAttributeIfValue(element, "srcset", getData(element, settings.data_srcset));
setAttributeIfValue(element, "src", getData(element, settings.data_src));
};
var setSourcesImg = function setSourcesImg(element, settings) {
var parent = element.parentNode;
if (parent && parent.tagName === "PICTURE") {
var sourceTags = getSourceTags(parent);
sourceTags.forEach(function (sourceTag) {
setImageAttributes(sourceTag, settings);
});
}
setImageAttributes(element, settings);
};
var setSourcesIframe = function setSourcesIframe(element, settings) {
setAttributeIfValue(element, "src", getData(element, settings.data_src));
};
var setSourcesVideo = function setSourcesVideo(element, settings) {
var sourceTags = getSourceTags(element);
sourceTags.forEach(function (sourceTag) {
setAttributeIfValue(sourceTag, "src", getData(sourceTag, settings.data_src));
});
setAttributeIfValue(element, "src", getData(element, settings.data_src));
element.load();
};
var setSourcesBgImage = function setSourcesBgImage(element, settings) {
var srcDataValue = getData(element, settings.data_src);
var bgDataValue = getData(element, settings.data_bg);
if (srcDataValue) {
element.style.backgroundImage = "url(\"".concat(srcDataValue, "\")");
}
if (bgDataValue) {
element.style.backgroundImage = bgDataValue;
}
};
var setSourcesFunctions = {
IMG: setSourcesImg,
IFRAME: setSourcesIframe,
VIDEO: setSourcesVideo
};
var setSources = function setSources(element, instance) {
var settings = instance._settings;
var tagName = element.tagName;
var setSourcesFunction = setSourcesFunctions[tagName];
if (setSourcesFunction) {
setSourcesFunction(element, settings);
updateLoadingCount(instance, 1);
instance._elements = purgeOneElement(instance._elements, element);
return;
}
setSourcesBgImage(element, settings);
};
var addClass = function addClass(element, className) {
if (supportsClassList) {
element.classList.add(className);
return;
}
element.className += (element.className ? " " : "") + className;
};
var removeClass = function removeClass(element, className) {
if (supportsClassList) {
element.classList.remove(className);
return;
}
element.className = element.className.replace(new RegExp("(^|\\s+)" + className + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
};
var genericLoadEventName = "load";
var mediaLoadEventName = "loadeddata";
var errorEventName = "error";
var addEventListener = function addEventListener(element, eventName, handler) {
element.addEventListener(eventName, handler);
};
var removeEventListener = function removeEventListener(element, eventName, handler) {
element.removeEventListener(eventName, handler);
};
var addEventListeners = function addEventListeners(element, loadHandler, errorHandler) {
addEventListener(element, genericLoadEventName, loadHandler);
addEventListener(element, mediaLoadEventName, loadHandler);
addEventListener(element, errorEventName, errorHandler);
};
var removeEventListeners = function removeEventListeners(element, loadHandler, errorHandler) {
removeEventListener(element, genericLoadEventName, loadHandler);
removeEventListener(element, mediaLoadEventName, loadHandler);
removeEventListener(element, errorEventName, errorHandler);
};
var eventHandler = function eventHandler(event, success, instance) {
var settings = instance._settings;
var className = success ? settings.class_loaded : settings.class_error;
var callback = success ? settings.callback_loaded : settings.callback_error;
var element = event.target;
removeClass(element, settings.class_loading);
addClass(element, className);
callbackIfSet(callback, element);
updateLoadingCount(instance, -1);
};
var addOneShotEventListeners = function addOneShotEventListeners(element, instance) {
var loadHandler = function loadHandler(event) {
eventHandler(event, true, instance);
removeEventListeners(element, loadHandler, errorHandler);
};
var errorHandler = function errorHandler(event) {
eventHandler(event, false, instance);
removeEventListeners(element, loadHandler, errorHandler);
};
addEventListeners(element, loadHandler, errorHandler);
};
var managedTags = ["IMG", "IFRAME", "VIDEO"];
var onEnter = function onEnter(element, instance) {
var settings = instance._settings;
callbackIfSet(settings.callback_enter, element);
if (!settings.load_delay) {
revealAndUnobserve(element, instance);
return;
}
delayLoad(element, instance);
};
var revealAndUnobserve = function revealAndUnobserve(element, instance) {
var observer = instance._observer;
revealElement(element, instance);
if (observer && instance._settings.auto_unobserve) {
observer.unobserve(element);
}
};
var onExit = function onExit(element, instance) {
var settings = instance._settings;
callbackIfSet(settings.callback_exit, element);
if (!settings.load_delay) {
return;
}
cancelDelayLoad(element);
};
var cancelDelayLoad = function cancelDelayLoad(element) {
var timeoutId = getTimeoutData(element);
if (!timeoutId) {
return; // do nothing if timeout doesn't exist
}
clearTimeout(timeoutId);
setTimeoutData(element, null);
};
var delayLoad = function delayLoad(element, instance) {
var loadDelay = instance._settings.load_delay;
var timeoutId = getTimeoutData(element);
if (timeoutId) {
return; // do nothing if timeout already set
}
timeoutId = setTimeout(function () {
revealAndUnobserve(element, instance);
cancelDelayLoad(element);
}, loadDelay);
setTimeoutData(element, timeoutId);
};
var revealElement = function revealElement(element, instance, force) {
var settings = instance._settings;
if (!force && getWasProcessedData(element)) {
return; // element has already been processed and force wasn't true
}
if (managedTags.indexOf(element.tagName) > -1) {
addOneShotEventListeners(element, instance);
addClass(element, settings.class_loading);
}
setSources(element, instance);
setWasProcessedData(element);
callbackIfSet(settings.callback_reveal, element);
callbackIfSet(settings.callback_set, element);
};
var isIntersecting = function isIntersecting(entry) {
return entry.isIntersecting || entry.intersectionRatio > 0;
};
var getObserverSettings = function getObserverSettings(settings) {
return {
root: settings.container === document ? null : settings.container,
rootMargin: settings.thresholds || settings.threshold + "px"
};
};
var setObserver = function setObserver(instance) {
if (!supportsIntersectionObserver) {
return false;
}
instance._observer = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
return isIntersecting(entry) ? onEnter(entry.target, instance) : onExit(entry.target, instance);
});
}, getObserverSettings(instance._settings));
return true;
};
var LazyLoad = function LazyLoad(customSettings, elements) {
this._settings = getInstanceSettings(customSettings);
this._loadingCount = 0;
setObserver(this);
this.update(elements);
};
LazyLoad.prototype = {
update: function update(elements) {
var _this = this;
var settings = this._settings;
var _elements = elements || settings.container.querySelectorAll(settings.elements_selector);
this._elements = purgeProcessedElements(Array.prototype.slice.call(_elements) // NOTE: nodeset to array for IE compatibility
);
if (isBot || !this._observer) {
this.loadAll();
return;
}
this._elements.forEach(function (element) {
_this._observer.observe(element);
});
},
destroy: function destroy() {
var _this2 = this;
if (this._observer) {
this._elements.forEach(function (element) {
_this2._observer.unobserve(element);
});
this._observer = null;
}
this._elements = null;
this._settings = null;
},
load: function load(element, force) {
revealElement(element, this, force);
},
loadAll: function loadAll() {
var _this3 = this;
var elements = this._elements;
elements.forEach(function (element) {
revealAndUnobserve(element, _this3);
});
}
};
/* Automatic instances creation if required (useful for async script loading) */
if (runningOnBrowser) {
autoInitialize(LazyLoad, window.lazyLoadOptions);
}
return LazyLoad;
});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,491 @@
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
(function (global, factory) {
(typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.LazyLoad = factory();
})(this, function () {
'use strict';
var runningOnBrowser = typeof window !== "undefined";
var isBot = runningOnBrowser && !("onscroll" in window) || typeof navigator !== "undefined" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent);
var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window;
var supportsClassList = runningOnBrowser && "classList" in document.createElement("p");
var defaultSettings = {
elements_selector: "img",
container: isBot || runningOnBrowser ? document : null,
threshold: 300,
thresholds: null,
data_src: "src",
data_srcset: "srcset",
data_sizes: "sizes",
data_bg: "bg",
class_loading: "loading",
class_loaded: "loaded",
class_error: "error",
load_delay: 0,
auto_unobserve: true,
callback_enter: null,
callback_exit: null,
callback_reveal: null,
callback_loaded: null,
callback_error: null,
callback_finish: null,
use_native: false
};
var getInstanceSettings = function getInstanceSettings(customSettings) {
return _extends({}, defaultSettings, customSettings);
};
/* Creates instance and notifies it through the window element */
var createInstance = function createInstance(classObj, options) {
var event;
var eventString = "LazyLoad::Initialized";
var instance = new classObj(options);
try {
// Works in modern browsers
event = new CustomEvent(eventString, {
detail: {
instance: instance
}
});
} catch (err) {
// Works in Internet Explorer (all versions)
event = document.createEvent("CustomEvent");
event.initCustomEvent(eventString, false, false, {
instance: instance
});
}
window.dispatchEvent(event);
};
/* Auto initialization of one or more instances of lazyload, depending on the
options passed in (plain object or an array) */
function autoInitialize(classObj, options) {
if (!options) {
return;
}
if (!options.length) {
// Plain object
createInstance(classObj, options);
} else {
// Array of objects
for (var i = 0, optionsItem; optionsItem = options[i]; i += 1) {
createInstance(classObj, optionsItem);
}
}
}
var dataPrefix = "data-";
var processedDataName = "was-processed";
var timeoutDataName = "ll-timeout";
var trueString = "true";
var getData = function getData(element, attribute) {
return element.getAttribute(dataPrefix + attribute);
};
var setData = function setData(element, attribute, value) {
var attrName = dataPrefix + attribute;
if (value === null) {
element.removeAttribute(attrName);
return;
}
element.setAttribute(attrName, value);
};
var setWasProcessedData = function setWasProcessedData(element) {
return setData(element, processedDataName, trueString);
};
var getWasProcessedData = function getWasProcessedData(element) {
return getData(element, processedDataName) === trueString;
};
var setTimeoutData = function setTimeoutData(element, value) {
return setData(element, timeoutDataName, value);
};
var getTimeoutData = function getTimeoutData(element) {
return getData(element, timeoutDataName);
};
var purgeProcessedElements = function purgeProcessedElements(elements) {
return elements.filter(function (element) {
return !getWasProcessedData(element);
});
};
var purgeOneElement = function purgeOneElement(elements, elementToPurge) {
return elements.filter(function (element) {
return element !== elementToPurge;
});
};
var callbackIfSet = function callbackIfSet(callback, argument) {
if (callback) {
callback(argument);
}
};
var updateLoadingCount = function updateLoadingCount(instance, plusMinus) {
instance._loadingCount += plusMinus;
if (instance._elements.length === 0 && instance._loadingCount === 0) {
callbackIfSet(instance._settings.callback_finish);
}
};
var getSourceTags = function getSourceTags(parentTag) {
var sourceTags = [];
for (var i = 0, childTag; childTag = parentTag.children[i]; i += 1) {
if (childTag.tagName === "SOURCE") {
sourceTags.push(childTag);
}
}
return sourceTags;
};
var setAttributeIfValue = function setAttributeIfValue(element, attrName, value) {
if (!value) {
return;
}
element.setAttribute(attrName, value);
};
var setImageAttributes = function setImageAttributes(element, settings) {
setAttributeIfValue(element, "sizes", getData(element, settings.data_sizes));
setAttributeIfValue(element, "srcset", getData(element, settings.data_srcset));
setAttributeIfValue(element, "src", getData(element, settings.data_src));
};
var setSourcesImg = function setSourcesImg(element, settings) {
var parent = element.parentNode;
if (parent && parent.tagName === "PICTURE") {
var sourceTags = getSourceTags(parent);
sourceTags.forEach(function (sourceTag) {
setImageAttributes(sourceTag, settings);
});
}
setImageAttributes(element, settings);
};
var setSourcesIframe = function setSourcesIframe(element, settings) {
setAttributeIfValue(element, "src", getData(element, settings.data_src));
};
var setSourcesVideo = function setSourcesVideo(element, settings) {
var sourceTags = getSourceTags(element);
sourceTags.forEach(function (sourceTag) {
setAttributeIfValue(sourceTag, "src", getData(sourceTag, settings.data_src));
});
setAttributeIfValue(element, "src", getData(element, settings.data_src));
element.load();
};
var setSourcesBgImage = function setSourcesBgImage(element, settings) {
var srcDataValue = getData(element, settings.data_src);
var bgDataValue = getData(element, settings.data_bg);
if (srcDataValue) {
element.style.backgroundImage = "url(\"".concat(srcDataValue, "\")");
}
if (bgDataValue) {
element.style.backgroundImage = bgDataValue;
}
};
var setSourcesFunctions = {
IMG: setSourcesImg,
IFRAME: setSourcesIframe,
VIDEO: setSourcesVideo
};
var setSources = function setSources(element, instance) {
var settings = instance._settings;
var tagName = element.tagName;
var setSourcesFunction = setSourcesFunctions[tagName];
if (setSourcesFunction) {
setSourcesFunction(element, settings);
updateLoadingCount(instance, 1);
instance._elements = purgeOneElement(instance._elements, element);
return;
}
setSourcesBgImage(element, settings);
};
var addClass = function addClass(element, className) {
if (supportsClassList) {
element.classList.add(className);
return;
}
element.className += (element.className ? " " : "") + className;
};
var removeClass = function removeClass(element, className) {
if (supportsClassList) {
element.classList.remove(className);
return;
}
element.className = element.className.replace(new RegExp("(^|\\s+)" + className + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
};
var genericLoadEventName = "load";
var mediaLoadEventName = "loadeddata";
var errorEventName = "error";
var addEventListener = function addEventListener(element, eventName, handler) {
element.addEventListener(eventName, handler);
};
var removeEventListener = function removeEventListener(element, eventName, handler) {
element.removeEventListener(eventName, handler);
};
var addEventListeners = function addEventListeners(element, loadHandler, errorHandler) {
addEventListener(element, genericLoadEventName, loadHandler);
addEventListener(element, mediaLoadEventName, loadHandler);
addEventListener(element, errorEventName, errorHandler);
};
var removeEventListeners = function removeEventListeners(element, loadHandler, errorHandler) {
removeEventListener(element, genericLoadEventName, loadHandler);
removeEventListener(element, mediaLoadEventName, loadHandler);
removeEventListener(element, errorEventName, errorHandler);
};
var eventHandler = function eventHandler(event, success, instance) {
var settings = instance._settings;
var className = success ? settings.class_loaded : settings.class_error;
var callback = success ? settings.callback_loaded : settings.callback_error;
var element = event.target;
removeClass(element, settings.class_loading);
addClass(element, className);
callbackIfSet(callback, element);
updateLoadingCount(instance, -1);
};
var addOneShotEventListeners = function addOneShotEventListeners(element, instance) {
var loadHandler = function loadHandler(event) {
eventHandler(event, true, instance);
removeEventListeners(element, loadHandler, errorHandler);
};
var errorHandler = function errorHandler(event) {
eventHandler(event, false, instance);
removeEventListeners(element, loadHandler, errorHandler);
};
addEventListeners(element, loadHandler, errorHandler);
};
var managedTags = ["IMG", "IFRAME", "VIDEO"];
var onEnter = function onEnter(element, instance) {
var settings = instance._settings;
callbackIfSet(settings.callback_enter, element);
if (!settings.load_delay) {
revealAndUnobserve(element, instance);
return;
}
delayLoad(element, instance);
};
var revealAndUnobserve = function revealAndUnobserve(element, instance) {
var observer = instance._observer;
revealElement(element, instance);
if (observer && instance._settings.auto_unobserve) {
observer.unobserve(element);
}
};
var onExit = function onExit(element, instance) {
var settings = instance._settings;
callbackIfSet(settings.callback_exit, element);
if (!settings.load_delay) {
return;
}
cancelDelayLoad(element);
};
var cancelDelayLoad = function cancelDelayLoad(element) {
var timeoutId = getTimeoutData(element);
if (!timeoutId) {
return; // do nothing if timeout doesn't exist
}
clearTimeout(timeoutId);
setTimeoutData(element, null);
};
var delayLoad = function delayLoad(element, instance) {
var loadDelay = instance._settings.load_delay;
var timeoutId = getTimeoutData(element);
if (timeoutId) {
return; // do nothing if timeout already set
}
timeoutId = setTimeout(function () {
revealAndUnobserve(element, instance);
cancelDelayLoad(element);
}, loadDelay);
setTimeoutData(element, timeoutId);
};
var revealElement = function revealElement(element, instance, force) {
var settings = instance._settings;
if (!force && getWasProcessedData(element)) {
return; // element has already been processed and force wasn't true
}
if (managedTags.indexOf(element.tagName) > -1) {
addOneShotEventListeners(element, instance);
addClass(element, settings.class_loading);
}
setSources(element, instance);
setWasProcessedData(element);
callbackIfSet(settings.callback_reveal, element);
callbackIfSet(settings.callback_set, element);
};
var isIntersecting = function isIntersecting(entry) {
return entry.isIntersecting || entry.intersectionRatio > 0;
};
var getObserverSettings = function getObserverSettings(settings) {
return {
root: settings.container === document ? null : settings.container,
rootMargin: settings.thresholds || settings.threshold + "px"
};
};
var setObserver = function setObserver(instance) {
if (!supportsIntersectionObserver) {
return false;
}
instance._observer = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
return isIntersecting(entry) ? onEnter(entry.target, instance) : onExit(entry.target, instance);
});
}, getObserverSettings(instance._settings));
return true;
};
var nativeLazyTags = ["IMG", "IFRAME"];
var shouldUseNative = function shouldUseNative(settings) {
return settings.use_native && "loading" in HTMLImageElement.prototype;
};
var loadAllNative = function loadAllNative(instance) {
instance._elements.forEach(function (element) {
if (nativeLazyTags.indexOf(element.tagName) === -1) {
return;
}
element.setAttribute("loading", "lazy");
revealElement(element, instance);
});
};
var nodeSetToArray = function nodeSetToArray(nodeSet) {
return Array.prototype.slice.call(nodeSet);
};
var queryElements = function queryElements(settings) {
return settings.container.querySelectorAll(settings.elements_selector);
};
var getElements = function getElements(elements, settings) {
return purgeProcessedElements(nodeSetToArray(elements || queryElements(settings)));
};
var LazyLoad = function LazyLoad(customSettings, elements) {
this._settings = getInstanceSettings(customSettings);
this._loadingCount = 0;
setObserver(this);
this.update(elements);
};
LazyLoad.prototype = {
update: function update(elements) {
var _this = this;
var settings = this._settings;
this._elements = getElements(elements, settings);
if (isBot || !this._observer) {
this.loadAll();
return;
}
if (shouldUseNative(settings)) {
loadAllNative(this);
this._elements = getElements(elements, settings);
}
this._elements.forEach(function (element) {
_this._observer.observe(element);
});
},
destroy: function destroy() {
var _this2 = this;
if (this._observer) {
this._elements.forEach(function (element) {
_this2._observer.unobserve(element);
});
this._observer = null;
}
this._elements = null;
this._settings = null;
},
load: function load(element, force) {
revealElement(element, this, force);
},
loadAll: function loadAll() {
var _this3 = this;
this._elements.forEach(function (element) {
revealAndUnobserve(element, _this3);
});
}
};
/* Automatic instances creation if required (useful for async script loading) */
if (runningOnBrowser) {
autoInitialize(LazyLoad, window.lazyLoadOptions);
}
return LazyLoad;
});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,733 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.LazyLoad = factory());
}(this, (function () { 'use strict';
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
var runningOnBrowser = typeof window !== "undefined";
var isBot = runningOnBrowser && !("onscroll" in window) || typeof navigator !== "undefined" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent);
var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window;
var supportsClassList = runningOnBrowser && "classList" in document.createElement("p");
var isHiDpi = runningOnBrowser && window.devicePixelRatio > 1;
var defaultSettings = {
elements_selector: "IMG",
container: isBot || runningOnBrowser ? document : null,
threshold: 300,
thresholds: null,
data_src: "src",
data_srcset: "srcset",
data_sizes: "sizes",
data_bg: "bg",
data_bg_hidpi: "bg-hidpi",
data_bg_multi: "bg-multi",
data_bg_multi_hidpi: "bg-multi-hidpi",
data_poster: "poster",
class_applied: "applied",
class_loading: "loading",
class_loaded: "loaded",
class_error: "error",
unobserve_completed: true,
unobserve_entered: false,
cancel_on_exit: false,
callback_enter: null,
callback_exit: null,
callback_applied: null,
callback_loading: null,
callback_loaded: null,
callback_error: null,
callback_finish: null,
callback_cancel: null,
use_native: false
};
var getExtendedSettings = function getExtendedSettings(customSettings) {
return _extends({}, defaultSettings, customSettings);
};
/* Creates instance and notifies it through the window element */
var createInstance = function createInstance(classObj, options) {
var event;
var eventString = "LazyLoad::Initialized";
var instance = new classObj(options);
try {
// Works in modern browsers
event = new CustomEvent(eventString, {
detail: {
instance: instance
}
});
} catch (err) {
// Works in Internet Explorer (all versions)
event = document.createEvent("CustomEvent");
event.initCustomEvent(eventString, false, false, {
instance: instance
});
}
window.dispatchEvent(event);
};
/* Auto initialization of one or more instances of lazyload, depending on the
options passed in (plain object or an array) */
var autoInitialize = function autoInitialize(classObj, options) {
if (!options) {
return;
}
if (!options.length) {
// Plain object
createInstance(classObj, options);
} else {
// Array of objects
for (var i = 0, optionsItem; optionsItem = options[i]; i += 1) {
createInstance(classObj, optionsItem);
}
}
};
var statusLoading = "loading";
var statusLoaded = "loaded";
var statusApplied = "applied";
var statusError = "error";
var statusNative = "native";
var dataPrefix = "data-";
var statusDataName = "ll-status";
var getData = function getData(element, attribute) {
return element.getAttribute(dataPrefix + attribute);
};
var setData = function setData(element, attribute, value) {
var attrName = dataPrefix + attribute;
if (value === null) {
element.removeAttribute(attrName);
return;
}
element.setAttribute(attrName, value);
};
var getStatus = function getStatus(element) {
return getData(element, statusDataName);
};
var setStatus = function setStatus(element, status) {
return setData(element, statusDataName, status);
};
var resetStatus = function resetStatus(element) {
return setStatus(element, null);
};
var hasEmptyStatus = function hasEmptyStatus(element) {
return getStatus(element) === null;
};
var hasStatusLoading = function hasStatusLoading(element) {
return getStatus(element) === statusLoading;
};
var hasStatusError = function hasStatusError(element) {
return getStatus(element) === statusError;
};
var hasStatusNative = function hasStatusNative(element) {
return getStatus(element) === statusNative;
};
var hadStartedLoading = function hadStartedLoading(element) {
return !hasEmptyStatus(element);
};
var safeCallback = function safeCallback(callback, arg1, arg2, arg3) {
if (!callback) {
return;
}
if (arg3 !== undefined) {
callback(arg1, arg2, arg3);
return;
}
if (arg2 !== undefined) {
callback(arg1, arg2);
return;
}
callback(arg1);
};
var addClass = function addClass(element, className) {
if (supportsClassList) {
element.classList.add(className);
return;
}
element.className += (element.className ? " " : "") + className;
};
var removeClass = function removeClass(element, className) {
if (supportsClassList) {
element.classList.remove(className);
return;
}
element.className = element.className.replace(new RegExp("(^|\\s+)" + className + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
};
var addTempImage = function addTempImage(element) {
element.llTempImage = document.createElement("IMG");
};
var deleteTempImage = function deleteTempImage(element) {
delete element.llTempImage;
};
var getTempImage = function getTempImage(element) {
return element.llTempImage;
};
var unobserve = function unobserve(element, instance) {
if (!instance) return;
var observer = instance._observer;
if (!observer) return;
observer.unobserve(element);
};
var resetObserver = function resetObserver(observer) {
observer.disconnect();
};
var unobserveIfRequired = function unobserveIfRequired(element, settings, instance) {
if (settings.unobserve_entered) unobserve(element, instance);
};
var updateLoadingCount = function updateLoadingCount(instance, delta) {
if (!instance) return;
instance.loadingCount += delta;
};
var decreaseToLoadCount = function decreaseToLoadCount(instance) {
if (!instance) return;
instance.toLoadCount -= 1;
};
var setToLoadCount = function setToLoadCount(instance, value) {
if (!instance) return;
instance.toLoadCount = value;
};
var isSomethingLoading = function isSomethingLoading(instance) {
return instance.loadingCount > 0;
};
var haveElementsToLoad = function haveElementsToLoad(instance) {
return instance.toLoadCount > 0;
};
var getSourceTags = function getSourceTags(parentTag) {
var sourceTags = [];
for (var i = 0, childTag; childTag = parentTag.children[i]; i += 1) {
if (childTag.tagName === "SOURCE") {
sourceTags.push(childTag);
}
}
return sourceTags;
};
var setAttributeIfValue = function setAttributeIfValue(element, attrName, value) {
if (!value) {
return;
}
element.setAttribute(attrName, value);
};
var resetAttribute = function resetAttribute(element, attrName) {
element.removeAttribute(attrName);
};
var hasOriginalAttributes = function hasOriginalAttributes(element) {
return !!element.llOriginalAttrs;
};
var saveOriginalImageAttributes = function saveOriginalImageAttributes(element) {
if (hasOriginalAttributes(element)) {
return;
}
var originalAttributes = {};
originalAttributes["src"] = element.getAttribute("src");
originalAttributes["srcset"] = element.getAttribute("srcset");
originalAttributes["sizes"] = element.getAttribute("sizes");
element.llOriginalAttrs = originalAttributes;
};
var restoreOriginalImageAttributes = function restoreOriginalImageAttributes(element) {
if (!hasOriginalAttributes(element)) {
return;
}
var originalAttributes = element.llOriginalAttrs;
setAttributeIfValue(element, "src", originalAttributes["src"]);
setAttributeIfValue(element, "srcset", originalAttributes["srcset"]);
setAttributeIfValue(element, "sizes", originalAttributes["sizes"]);
};
var setImageAttributes = function setImageAttributes(element, settings) {
setAttributeIfValue(element, "sizes", getData(element, settings.data_sizes));
setAttributeIfValue(element, "srcset", getData(element, settings.data_srcset));
setAttributeIfValue(element, "src", getData(element, settings.data_src));
};
var resetImageAttributes = function resetImageAttributes(element) {
resetAttribute(element, "src");
resetAttribute(element, "srcset");
resetAttribute(element, "sizes");
};
var forEachPictureSource = function forEachPictureSource(element, fn) {
var parent = element.parentNode;
if (!parent || parent.tagName !== "PICTURE") {
return;
}
var sourceTags = getSourceTags(parent);
sourceTags.forEach(fn);
};
var forEachVideoSource = function forEachVideoSource(element, fn) {
var sourceTags = getSourceTags(element);
sourceTags.forEach(fn);
};
var restoreOriginalAttributesImg = function restoreOriginalAttributesImg(element) {
forEachPictureSource(element, function (sourceTag) {
restoreOriginalImageAttributes(sourceTag);
});
restoreOriginalImageAttributes(element);
};
var setSourcesImg = function setSourcesImg(element, settings) {
forEachPictureSource(element, function (sourceTag) {
saveOriginalImageAttributes(sourceTag);
setImageAttributes(sourceTag, settings);
});
saveOriginalImageAttributes(element);
setImageAttributes(element, settings);
};
var resetSourcesImg = function resetSourcesImg(element) {
forEachPictureSource(element, function (sourceTag) {
resetImageAttributes(sourceTag);
});
resetImageAttributes(element);
};
var setSourcesIframe = function setSourcesIframe(element, settings) {
setAttributeIfValue(element, "src", getData(element, settings.data_src));
};
var setSourcesVideo = function setSourcesVideo(element, settings) {
forEachVideoSource(element, function (sourceTag) {
setAttributeIfValue(sourceTag, "src", getData(sourceTag, settings.data_src));
});
setAttributeIfValue(element, "poster", getData(element, settings.data_poster));
setAttributeIfValue(element, "src", getData(element, settings.data_src));
element.load();
};
var setSourcesFunctions = {
IMG: setSourcesImg,
IFRAME: setSourcesIframe,
VIDEO: setSourcesVideo
};
var setBackground = function setBackground(element, settings, instance) {
var bg1xValue = getData(element, settings.data_bg);
var bgHiDpiValue = getData(element, settings.data_bg_hidpi);
var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue;
if (!bgDataValue) return;
element.style.backgroundImage = "url(\"".concat(bgDataValue, "\")");
getTempImage(element).setAttribute("src", bgDataValue);
manageLoading(element, settings, instance);
}; // NOTE: THE TEMP IMAGE TRICK CANNOT BE DONE WITH data-multi-bg
// BECAUSE INSIDE ITS VALUES MUST BE WRAPPED WITH URL() AND ONE OF THEM
// COULD BE A GRADIENT BACKGROUND IMAGE
var setMultiBackground = function setMultiBackground(element, settings, instance) {
var bg1xValue = getData(element, settings.data_bg_multi);
var bgHiDpiValue = getData(element, settings.data_bg_multi_hidpi);
var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue;
if (!bgDataValue) {
return;
}
element.style.backgroundImage = bgDataValue;
manageApplied(element, settings, instance);
};
var setSources = function setSources(element, settings) {
var setSourcesFunction = setSourcesFunctions[element.tagName];
if (!setSourcesFunction) {
return;
}
setSourcesFunction(element, settings);
};
var manageApplied = function manageApplied(element, settings, instance) {
addClass(element, settings.class_applied);
setStatus(element, statusApplied);
removeDataMultiBackground(element, settings);
if (settings.unobserve_completed) {
// Unobserve now because we can't do it on load
unobserve(element, settings);
}
safeCallback(settings.callback_applied, element, instance);
};
var manageLoading = function manageLoading(element, settings, instance) {
updateLoadingCount(instance, +1);
addClass(element, settings.class_loading);
setStatus(element, statusLoading);
safeCallback(settings.callback_loading, element, instance);
}; // REMOVE DATA ATTRIBUTES --------------
var removeDataImg = function removeDataImg(element, settings) {
setData(element, settings.data_src, null);
setData(element, settings.data_srcset, null);
setData(element, settings.data_sizes, null);
forEachPictureSource(element, function (sourceTag) {
setData(sourceTag, settings.data_srcset, null);
setData(sourceTag, settings.data_sizes, null);
});
};
var removeDataIframe = function removeDataIframe(element, settings) {
setData(element, settings.data_src, null);
};
var removeDataVideo = function removeDataVideo(element, settings) {
setData(element, settings.data_src, null);
setData(element, settings.data_poster, null);
forEachVideoSource(element, function (sourceTag) {
setData(sourceTag, settings.data_src, null);
});
};
var removeDataFunctions = {
IMG: removeDataImg,
IFRAME: removeDataIframe,
VIDEO: removeDataVideo
};
var removeDataBackground = function removeDataBackground(element, settings) {
setData(element, settings.data_bg, null);
setData(element, settings.data_bg_hidpi, null);
};
var removeDataMultiBackground = function removeDataMultiBackground(element, settings) {
setData(element, settings.data_bg_multi, null);
setData(element, settings.data_bg_multi_hidpi, null);
};
var removeDataAttributes = function removeDataAttributes(element, settings) {
var removeDataFunction = removeDataFunctions[element.tagName];
if (removeDataFunction) {
removeDataFunction(element, settings);
return;
}
removeDataBackground(element, settings);
};
var elementsWithLoadEvent = ["IMG", "IFRAME", "VIDEO"];
var hasLoadEvent = function hasLoadEvent(element) {
return elementsWithLoadEvent.indexOf(element.tagName) > -1;
};
var checkFinish = function checkFinish(settings, instance) {
if (instance && !isSomethingLoading(instance) && !haveElementsToLoad(instance)) {
safeCallback(settings.callback_finish, instance);
}
};
var addEventListener = function addEventListener(element, eventName, handler) {
element.addEventListener(eventName, handler);
element.llEvLisnrs[eventName] = handler;
};
var removeEventListener = function removeEventListener(element, eventName, handler) {
element.removeEventListener(eventName, handler);
};
var hasEventListeners = function hasEventListeners(element) {
return !!element.llEvLisnrs;
};
var addEventListeners = function addEventListeners(element, loadHandler, errorHandler) {
if (!hasEventListeners(element)) element.llEvLisnrs = {};
var loadEventName = element.tagName === "VIDEO" ? "loadeddata" : "load";
addEventListener(element, loadEventName, loadHandler);
addEventListener(element, "error", errorHandler);
};
var removeEventListeners = function removeEventListeners(element) {
if (!hasEventListeners(element)) {
return;
}
var eventListeners = element.llEvLisnrs;
for (var eventName in eventListeners) {
var handler = eventListeners[eventName];
removeEventListener(element, eventName, handler);
}
delete element.llEvLisnrs;
};
var doneHandler = function doneHandler(element, settings, instance) {
deleteTempImage(element);
updateLoadingCount(instance, -1);
decreaseToLoadCount(instance);
removeClass(element, settings.class_loading);
if (settings.unobserve_completed) {
unobserve(element, instance);
}
};
var loadHandler = function loadHandler(event, element, settings, instance) {
var goingNative = hasStatusNative(element);
doneHandler(element, settings, instance);
addClass(element, settings.class_loaded);
setStatus(element, statusLoaded);
removeDataAttributes(element, settings);
safeCallback(settings.callback_loaded, element, instance);
if (!goingNative) checkFinish(settings, instance);
};
var errorHandler = function errorHandler(event, element, settings, instance) {
var goingNative = hasStatusNative(element);
doneHandler(element, settings, instance);
addClass(element, settings.class_error);
setStatus(element, statusError);
safeCallback(settings.callback_error, element, instance);
if (!goingNative) checkFinish(settings, instance);
};
var addOneShotEventListeners = function addOneShotEventListeners(element, settings, instance) {
var elementToListenTo = getTempImage(element) || element;
if (hasEventListeners(elementToListenTo)) {
// This happens when loading is retried twice
return;
}
var _loadHandler = function _loadHandler(event) {
loadHandler(event, element, settings, instance);
removeEventListeners(elementToListenTo);
};
var _errorHandler = function _errorHandler(event) {
errorHandler(event, element, settings, instance);
removeEventListeners(elementToListenTo);
};
addEventListeners(elementToListenTo, _loadHandler, _errorHandler);
};
var loadBackground = function loadBackground(element, settings, instance) {
addTempImage(element);
addOneShotEventListeners(element, settings, instance);
setBackground(element, settings, instance);
setMultiBackground(element, settings, instance);
};
var loadRegular = function loadRegular(element, settings, instance) {
addOneShotEventListeners(element, settings, instance);
setSources(element, settings);
manageLoading(element, settings, instance);
};
var load = function load(element, settings, instance) {
if (hasLoadEvent(element)) {
loadRegular(element, settings, instance);
} else {
loadBackground(element, settings, instance);
}
};
var loadNative = function loadNative(element, settings, instance) {
addOneShotEventListeners(element, settings, instance);
setSources(element, settings);
removeDataAttributes(element, settings);
setStatus(element, statusNative);
};
var cancelLoadingIfRequired = function cancelLoadingIfRequired(element, entry, settings, instance) {
if (!settings.cancel_on_exit) return;
if (!hasStatusLoading(element)) return;
if (element.tagName !== "IMG") return; //Works only on images
removeEventListeners(element);
resetSourcesImg(element);
restoreOriginalAttributesImg(element);
removeClass(element, settings.class_loading);
updateLoadingCount(instance, -1);
resetStatus(element);
safeCallback(settings.callback_cancel, element, entry, instance);
};
var onEnter = function onEnter(element, entry, settings, instance) {
safeCallback(settings.callback_enter, element, entry, instance);
unobserveIfRequired(element, settings, instance);
if (hadStartedLoading(element)) return; //Prevent loading it again
load(element, settings, instance);
};
var onExit = function onExit(element, entry, settings, instance) {
if (hasEmptyStatus(element)) return; //Ignore the first pass, at landing
cancelLoadingIfRequired(element, entry, settings, instance);
safeCallback(settings.callback_exit, element, entry, instance);
};
var tagsWithNativeLazy = ["IMG", "IFRAME"];
var shouldUseNative = function shouldUseNative(settings) {
return settings.use_native && "loading" in HTMLImageElement.prototype;
};
var loadAllNative = function loadAllNative(elements, settings, instance) {
elements.forEach(function (element) {
if (tagsWithNativeLazy.indexOf(element.tagName) === -1) {
return;
}
element.setAttribute("loading", "lazy"); //TODO: Move inside the loadNative method
loadNative(element, settings, instance);
});
setToLoadCount(instance, 0);
};
var isIntersecting = function isIntersecting(entry) {
return entry.isIntersecting || entry.intersectionRatio > 0;
};
var getObserverSettings = function getObserverSettings(settings) {
return {
root: settings.container === document ? null : settings.container,
rootMargin: settings.thresholds || settings.threshold + "px"
};
};
var intersectionHandler = function intersectionHandler(entries, settings, instance) {
entries.forEach(function (entry) {
return isIntersecting(entry) ? onEnter(entry.target, entry, settings, instance) : onExit(entry.target, entry, settings, instance);
});
};
var observeElements = function observeElements(observer, elements) {
elements.forEach(function (element) {
observer.observe(element);
});
};
var updateObserver = function updateObserver(observer, elementsToObserve) {
resetObserver(observer);
observeElements(observer, elementsToObserve);
};
var setObserver = function setObserver(settings, instance) {
if (!supportsIntersectionObserver || shouldUseNative(settings)) {
return;
}
instance._observer = new IntersectionObserver(function (entries) {
intersectionHandler(entries, settings, instance);
}, getObserverSettings(settings));
};
var toArray = function toArray(nodeSet) {
return Array.prototype.slice.call(nodeSet);
};
var queryElements = function queryElements(settings) {
return settings.container.querySelectorAll(settings.elements_selector);
};
var excludeManagedElements = function excludeManagedElements(elements) {
return toArray(elements).filter(hasEmptyStatus);
};
var hasError = function hasError(element) {
return hasStatusError(element);
};
var filterErrorElements = function filterErrorElements(elements) {
return toArray(elements).filter(hasError);
};
var getElementsToLoad = function getElementsToLoad(elements, settings) {
return excludeManagedElements(elements || queryElements(settings));
};
var retryLazyLoad = function retryLazyLoad(settings, instance) {
var errorElements = filterErrorElements(queryElements(settings));
errorElements.forEach(function (element) {
removeClass(element, settings.class_error);
resetStatus(element);
});
instance.update();
};
var setOnlineCheck = function setOnlineCheck(settings, instance) {
if (!runningOnBrowser) {
return;
}
window.addEventListener("online", function () {
retryLazyLoad(settings, instance);
});
};
var LazyLoad = function LazyLoad(customSettings, elements) {
var settings = getExtendedSettings(customSettings);
this._settings = settings;
this.loadingCount = 0;
setObserver(settings, this);
setOnlineCheck(settings, this);
this.update(elements);
};
LazyLoad.prototype = {
update: function update(givenNodeset) {
var settings = this._settings;
var elementsToLoad = getElementsToLoad(givenNodeset, settings);
setToLoadCount(this, elementsToLoad.length);
if (isBot || !supportsIntersectionObserver) {
this.loadAll(elementsToLoad);
return;
}
if (shouldUseNative(settings)) {
loadAllNative(elementsToLoad, settings, this);
return;
}
updateObserver(this._observer, elementsToLoad);
},
destroy: function destroy() {
// Observer
if (this._observer) {
this._observer.disconnect();
} // Clean custom attributes on elements
queryElements(this._settings).forEach(function (element) {
delete element.llOriginalAttrs;
}); // Delete all internal props
delete this._observer;
delete this._settings;
delete this.loadingCount;
delete this.toLoadCount;
},
loadAll: function loadAll(elements) {
var _this = this;
var settings = this._settings;
var elementsToLoad = getElementsToLoad(elements, settings);
elementsToLoad.forEach(function (element) {
load(element, settings, _this);
});
}
};
LazyLoad.load = function (element, customSettings) {
var settings = getExtendedSettings(customSettings);
load(element, settings);
};
LazyLoad.resetStatus = function (element) {
resetStatus(element);
}; // Automatic instances creation if required (useful for async script loading)
if (runningOnBrowser) {
autoInitialize(LazyLoad, window.lazyLoadOptions);
}
return LazyLoad;
})));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,813 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.LazyLoad = factory());
}(this, (function () { 'use strict';
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
var runningOnBrowser = typeof window !== "undefined";
var isBot = runningOnBrowser && !("onscroll" in window) || typeof navigator !== "undefined" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent);
var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window;
var supportsClassList = runningOnBrowser && "classList" in document.createElement("p");
var isHiDpi = runningOnBrowser && window.devicePixelRatio > 1;
var defaultSettings = {
elements_selector: ".lazy",
container: isBot || runningOnBrowser ? document : null,
threshold: 300,
thresholds: null,
data_src: "src",
data_srcset: "srcset",
data_sizes: "sizes",
data_bg: "bg",
data_bg_hidpi: "bg-hidpi",
data_bg_multi: "bg-multi",
data_bg_multi_hidpi: "bg-multi-hidpi",
data_poster: "poster",
class_applied: "applied",
class_loading: "loading",
class_loaded: "loaded",
class_error: "error",
class_entered: "entered",
class_exited: "exited",
unobserve_completed: true,
unobserve_entered: false,
cancel_on_exit: true,
callback_enter: null,
callback_exit: null,
callback_applied: null,
callback_loading: null,
callback_loaded: null,
callback_error: null,
callback_finish: null,
callback_cancel: null,
use_native: false
};
var getExtendedSettings = function getExtendedSettings(customSettings) {
return _extends({}, defaultSettings, customSettings);
};
/* Creates instance and notifies it through the window element */
var createInstance = function createInstance(classObj, options) {
var event;
var eventString = "LazyLoad::Initialized";
var instance = new classObj(options);
try {
// Works in modern browsers
event = new CustomEvent(eventString, {
detail: {
instance: instance
}
});
} catch (err) {
// Works in Internet Explorer (all versions)
event = document.createEvent("CustomEvent");
event.initCustomEvent(eventString, false, false, {
instance: instance
});
}
window.dispatchEvent(event);
};
/* Auto initialization of one or more instances of lazyload, depending on the
options passed in (plain object or an array) */
var autoInitialize = function autoInitialize(classObj, options) {
if (!options) {
return;
}
if (!options.length) {
// Plain object
createInstance(classObj, options);
} else {
// Array of objects
for (var i = 0, optionsItem; optionsItem = options[i]; i += 1) {
createInstance(classObj, optionsItem);
}
}
};
var SRC = "src";
var SRCSET = "srcset";
var SIZES = "sizes";
var POSTER = "poster";
var ORIGINALS = "llOriginalAttrs";
var statusLoading = "loading";
var statusLoaded = "loaded";
var statusApplied = "applied";
var statusEntered = "entered";
var statusError = "error";
var statusNative = "native";
var dataPrefix = "data-";
var statusDataName = "ll-status";
var getData = function getData(element, attribute) {
return element.getAttribute(dataPrefix + attribute);
};
var setData = function setData(element, attribute, value) {
var attrName = dataPrefix + attribute;
if (value === null) {
element.removeAttribute(attrName);
return;
}
element.setAttribute(attrName, value);
};
var getStatus = function getStatus(element) {
return getData(element, statusDataName);
};
var setStatus = function setStatus(element, status) {
return setData(element, statusDataName, status);
};
var resetStatus = function resetStatus(element) {
return setStatus(element, null);
};
var hasEmptyStatus = function hasEmptyStatus(element) {
return getStatus(element) === null;
};
var hasStatusLoading = function hasStatusLoading(element) {
return getStatus(element) === statusLoading;
};
var hasStatusError = function hasStatusError(element) {
return getStatus(element) === statusError;
};
var hasStatusNative = function hasStatusNative(element) {
return getStatus(element) === statusNative;
};
var statusesAfterLoading = [statusLoading, statusLoaded, statusApplied, statusError];
var hadStartedLoading = function hadStartedLoading(element) {
return statusesAfterLoading.indexOf(getStatus(element)) >= 0;
};
var safeCallback = function safeCallback(callback, arg1, arg2, arg3) {
if (!callback) {
return;
}
if (arg3 !== undefined) {
callback(arg1, arg2, arg3);
return;
}
if (arg2 !== undefined) {
callback(arg1, arg2);
return;
}
callback(arg1);
};
var addClass = function addClass(element, className) {
if (supportsClassList) {
element.classList.add(className);
return;
}
element.className += (element.className ? " " : "") + className;
};
var removeClass = function removeClass(element, className) {
if (supportsClassList) {
element.classList.remove(className);
return;
}
element.className = element.className.replace(new RegExp("(^|\\s+)" + className + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
};
var addTempImage = function addTempImage(element) {
element.llTempImage = document.createElement("IMG");
};
var deleteTempImage = function deleteTempImage(element) {
delete element.llTempImage;
};
var getTempImage = function getTempImage(element) {
return element.llTempImage;
};
var unobserve = function unobserve(element, instance) {
if (!instance) return;
var observer = instance._observer;
if (!observer) return;
observer.unobserve(element);
};
var resetObserver = function resetObserver(observer) {
observer.disconnect();
};
var unobserveEntered = function unobserveEntered(element, settings, instance) {
if (settings.unobserve_entered) unobserve(element, instance);
};
var updateLoadingCount = function updateLoadingCount(instance, delta) {
if (!instance) return;
instance.loadingCount += delta;
};
var decreaseToLoadCount = function decreaseToLoadCount(instance) {
if (!instance) return;
instance.toLoadCount -= 1;
};
var setToLoadCount = function setToLoadCount(instance, value) {
if (!instance) return;
instance.toLoadCount = value;
};
var isSomethingLoading = function isSomethingLoading(instance) {
return instance.loadingCount > 0;
};
var haveElementsToLoad = function haveElementsToLoad(instance) {
return instance.toLoadCount > 0;
};
var getSourceTags = function getSourceTags(parentTag) {
var sourceTags = [];
for (var i = 0, childTag; childTag = parentTag.children[i]; i += 1) {
if (childTag.tagName === "SOURCE") {
sourceTags.push(childTag);
}
}
return sourceTags;
};
var forEachPictureSource = function forEachPictureSource(element, fn) {
var parent = element.parentNode;
if (!parent || parent.tagName !== "PICTURE") {
return;
}
var sourceTags = getSourceTags(parent);
sourceTags.forEach(fn);
};
var forEachVideoSource = function forEachVideoSource(element, fn) {
var sourceTags = getSourceTags(element);
sourceTags.forEach(fn);
};
var attrsSrc = [SRC];
var attrsSrcPoster = [SRC, POSTER];
var attrsSrcSrcsetSizes = [SRC, SRCSET, SIZES];
var hasOriginalAttrs = function hasOriginalAttrs(element) {
return !!element[ORIGINALS];
};
var getOriginalAttrs = function getOriginalAttrs(element) {
return element[ORIGINALS];
};
var deleteOriginalAttrs = function deleteOriginalAttrs(element) {
return delete element[ORIGINALS];
}; // ## SAVE ##
var setOriginalsObject = function setOriginalsObject(element, attributes) {
if (hasOriginalAttrs(element)) {
return;
}
var originals = {};
attributes.forEach(function (attribute) {
originals[attribute] = element.getAttribute(attribute);
});
element[ORIGINALS] = originals;
};
var saveOriginalBackgroundStyle = function saveOriginalBackgroundStyle(element) {
if (hasOriginalAttrs(element)) {
return;
}
element[ORIGINALS] = {
backgroundImage: element.style.backgroundImage
};
}; // ## RESTORE ##
var setOrResetAttribute = function setOrResetAttribute(element, attrName, value) {
if (!value) {
element.removeAttribute(attrName);
return;
}
element.setAttribute(attrName, value);
};
var restoreOriginalAttrs = function restoreOriginalAttrs(element, attributes) {
if (!hasOriginalAttrs(element)) {
return;
}
var originals = getOriginalAttrs(element);
attributes.forEach(function (attribute) {
setOrResetAttribute(element, attribute, originals[attribute]);
});
};
var restoreOriginalBgImage = function restoreOriginalBgImage(element) {
if (!hasOriginalAttrs(element)) {
return;
}
var originals = getOriginalAttrs(element);
element.style.backgroundImage = originals.backgroundImage;
};
var manageApplied = function manageApplied(element, settings, instance) {
addClass(element, settings.class_applied);
setStatus(element, statusApplied); // Instance is not provided when loading is called from static class
if (!instance) return;
if (settings.unobserve_completed) {
// Unobserve now because we can't do it on load
unobserve(element, settings);
}
safeCallback(settings.callback_applied, element, instance);
};
var manageLoading = function manageLoading(element, settings, instance) {
addClass(element, settings.class_loading);
setStatus(element, statusLoading); // Instance is not provided when loading is called from static class
if (!instance) return;
updateLoadingCount(instance, +1);
safeCallback(settings.callback_loading, element, instance);
};
var setAttributeIfValue = function setAttributeIfValue(element, attrName, value) {
if (!value) {
return;
}
element.setAttribute(attrName, value);
};
var setImageAttributes = function setImageAttributes(element, settings) {
setAttributeIfValue(element, SIZES, getData(element, settings.data_sizes));
setAttributeIfValue(element, SRCSET, getData(element, settings.data_srcset));
setAttributeIfValue(element, SRC, getData(element, settings.data_src));
};
var setSourcesImg = function setSourcesImg(imgEl, settings) {
forEachPictureSource(imgEl, function (sourceTag) {
setOriginalsObject(sourceTag, attrsSrcSrcsetSizes);
setImageAttributes(sourceTag, settings);
});
setOriginalsObject(imgEl, attrsSrcSrcsetSizes);
setImageAttributes(imgEl, settings);
};
var setSourcesIframe = function setSourcesIframe(iframe, settings) {
setOriginalsObject(iframe, attrsSrc);
setAttributeIfValue(iframe, SRC, getData(iframe, settings.data_src));
};
var setSourcesVideo = function setSourcesVideo(videoEl, settings) {
forEachVideoSource(videoEl, function (sourceEl) {
setOriginalsObject(sourceEl, attrsSrc);
setAttributeIfValue(sourceEl, SRC, getData(sourceEl, settings.data_src));
});
setOriginalsObject(videoEl, attrsSrcPoster);
setAttributeIfValue(videoEl, POSTER, getData(videoEl, settings.data_poster));
setAttributeIfValue(videoEl, SRC, getData(videoEl, settings.data_src));
videoEl.load();
};
var setBackground = function setBackground(element, settings, instance) {
var bg1xValue = getData(element, settings.data_bg);
var bgHiDpiValue = getData(element, settings.data_bg_hidpi);
var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue;
if (!bgDataValue) return;
element.style.backgroundImage = "url(\"".concat(bgDataValue, "\")");
getTempImage(element).setAttribute(SRC, bgDataValue);
manageLoading(element, settings, instance);
}; // NOTE: THE TEMP IMAGE TRICK CANNOT BE DONE WITH data-multi-bg
// BECAUSE INSIDE ITS VALUES MUST BE WRAPPED WITH URL() AND ONE OF THEM
// COULD BE A GRADIENT BACKGROUND IMAGE
var setMultiBackground = function setMultiBackground(element, settings, instance) {
var bg1xValue = getData(element, settings.data_bg_multi);
var bgHiDpiValue = getData(element, settings.data_bg_multi_hidpi);
var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue;
if (!bgDataValue) {
return;
}
element.style.backgroundImage = bgDataValue;
manageApplied(element, settings, instance);
};
var setSourcesFunctions = {
IMG: setSourcesImg,
IFRAME: setSourcesIframe,
VIDEO: setSourcesVideo
};
var setSourcesNative = function setSourcesNative(element, settings) {
var setSourcesFunction = setSourcesFunctions[element.tagName];
if (!setSourcesFunction) {
return;
}
setSourcesFunction(element, settings);
};
var setSources = function setSources(element, settings, instance) {
var setSourcesFunction = setSourcesFunctions[element.tagName];
if (!setSourcesFunction) {
return;
}
setSourcesFunction(element, settings);
manageLoading(element, settings, instance);
};
var elementsWithLoadEvent = ["IMG", "IFRAME", "VIDEO"];
var hasLoadEvent = function hasLoadEvent(element) {
return elementsWithLoadEvent.indexOf(element.tagName) > -1;
};
var checkFinish = function checkFinish(settings, instance) {
if (instance && !isSomethingLoading(instance) && !haveElementsToLoad(instance)) {
safeCallback(settings.callback_finish, instance);
}
};
var addEventListener = function addEventListener(element, eventName, handler) {
element.addEventListener(eventName, handler);
element.llEvLisnrs[eventName] = handler;
};
var removeEventListener = function removeEventListener(element, eventName, handler) {
element.removeEventListener(eventName, handler);
};
var hasEventListeners = function hasEventListeners(element) {
return !!element.llEvLisnrs;
};
var addEventListeners = function addEventListeners(element, loadHandler, errorHandler) {
if (!hasEventListeners(element)) element.llEvLisnrs = {};
var loadEventName = element.tagName === "VIDEO" ? "loadeddata" : "load";
addEventListener(element, loadEventName, loadHandler);
addEventListener(element, "error", errorHandler);
};
var removeEventListeners = function removeEventListeners(element) {
if (!hasEventListeners(element)) {
return;
}
var eventListeners = element.llEvLisnrs;
for (var eventName in eventListeners) {
var handler = eventListeners[eventName];
removeEventListener(element, eventName, handler);
}
delete element.llEvLisnrs;
};
var doneHandler = function doneHandler(element, settings, instance) {
deleteTempImage(element);
updateLoadingCount(instance, -1);
decreaseToLoadCount(instance);
removeClass(element, settings.class_loading);
if (settings.unobserve_completed) {
unobserve(element, instance);
}
};
var loadHandler = function loadHandler(event, element, settings, instance) {
var goingNative = hasStatusNative(element);
doneHandler(element, settings, instance);
addClass(element, settings.class_loaded);
setStatus(element, statusLoaded);
safeCallback(settings.callback_loaded, element, instance);
if (!goingNative) checkFinish(settings, instance);
};
var errorHandler = function errorHandler(event, element, settings, instance) {
var goingNative = hasStatusNative(element);
doneHandler(element, settings, instance);
addClass(element, settings.class_error);
setStatus(element, statusError);
safeCallback(settings.callback_error, element, instance);
if (!goingNative) checkFinish(settings, instance);
};
var addOneShotEventListeners = function addOneShotEventListeners(element, settings, instance) {
var elementToListenTo = getTempImage(element) || element;
if (hasEventListeners(elementToListenTo)) {
// This happens when loading is retried twice
return;
}
var _loadHandler = function _loadHandler(event) {
loadHandler(event, element, settings, instance);
removeEventListeners(elementToListenTo);
};
var _errorHandler = function _errorHandler(event) {
errorHandler(event, element, settings, instance);
removeEventListeners(elementToListenTo);
};
addEventListeners(elementToListenTo, _loadHandler, _errorHandler);
};
var loadBackground = function loadBackground(element, settings, instance) {
addTempImage(element);
addOneShotEventListeners(element, settings, instance);
saveOriginalBackgroundStyle(element);
setBackground(element, settings, instance);
setMultiBackground(element, settings, instance);
};
var loadRegular = function loadRegular(element, settings, instance) {
addOneShotEventListeners(element, settings, instance);
setSources(element, settings, instance);
};
var load = function load(element, settings, instance) {
if (hasLoadEvent(element)) {
loadRegular(element, settings, instance);
} else {
loadBackground(element, settings, instance);
}
};
var loadNative = function loadNative(element, settings, instance) {
element.setAttribute("loading", "lazy");
addOneShotEventListeners(element, settings, instance);
setSourcesNative(element, settings);
setStatus(element, statusNative);
};
var removeImageAttributes = function removeImageAttributes(element) {
element.removeAttribute(SRC);
element.removeAttribute(SRCSET);
element.removeAttribute(SIZES);
};
var resetSourcesImg = function resetSourcesImg(element) {
forEachPictureSource(element, function (sourceTag) {
removeImageAttributes(sourceTag);
});
removeImageAttributes(element);
};
var restoreImg = function restoreImg(imgEl) {
forEachPictureSource(imgEl, function (sourceEl) {
restoreOriginalAttrs(sourceEl, attrsSrcSrcsetSizes);
});
restoreOriginalAttrs(imgEl, attrsSrcSrcsetSizes);
};
var restoreVideo = function restoreVideo(videoEl) {
forEachVideoSource(videoEl, function (sourceEl) {
restoreOriginalAttrs(sourceEl, attrsSrc);
});
restoreOriginalAttrs(videoEl, attrsSrcPoster);
videoEl.load();
};
var restoreIframe = function restoreIframe(iframeEl) {
restoreOriginalAttrs(iframeEl, attrsSrc);
};
var restoreFunctions = {
IMG: restoreImg,
IFRAME: restoreIframe,
VIDEO: restoreVideo
};
var restoreAttributes = function restoreAttributes(element) {
var restoreFunction = restoreFunctions[element.tagName];
if (!restoreFunction) {
restoreOriginalBgImage(element);
return;
}
restoreFunction(element);
};
var resetClasses = function resetClasses(element, settings) {
if (hasEmptyStatus(element) || hasStatusNative(element)) {
return;
}
removeClass(element, settings.class_entered);
removeClass(element, settings.class_exited);
removeClass(element, settings.class_applied);
removeClass(element, settings.class_loading);
removeClass(element, settings.class_loaded);
removeClass(element, settings.class_error);
};
var restore = function restore(element, settings) {
restoreAttributes(element);
resetClasses(element, settings);
resetStatus(element);
deleteOriginalAttrs(element);
};
var cancelLoading = function cancelLoading(element, entry, settings, instance) {
if (!settings.cancel_on_exit) return;
if (!hasStatusLoading(element)) return;
if (element.tagName !== "IMG") return; //Works only on images
removeEventListeners(element);
resetSourcesImg(element);
restoreImg(element);
removeClass(element, settings.class_loading);
updateLoadingCount(instance, -1);
resetStatus(element);
safeCallback(settings.callback_cancel, element, entry, instance);
};
var onEnter = function onEnter(element, entry, settings, instance) {
var dontLoad = hadStartedLoading(element);
/* Save status
before setting it, to prevent loading it again. Fixes #526. */
setStatus(element, statusEntered);
addClass(element, settings.class_entered);
removeClass(element, settings.class_exited);
unobserveEntered(element, settings, instance);
safeCallback(settings.callback_enter, element, entry, instance);
if (dontLoad) return;
load(element, settings, instance);
};
var onExit = function onExit(element, entry, settings, instance) {
if (hasEmptyStatus(element)) return; //Ignore the first pass, at landing
addClass(element, settings.class_exited);
cancelLoading(element, entry, settings, instance);
safeCallback(settings.callback_exit, element, entry, instance);
};
var tagsWithNativeLazy = ["IMG", "IFRAME", "VIDEO"];
var shouldUseNative = function shouldUseNative(settings) {
return settings.use_native && "loading" in HTMLImageElement.prototype;
};
var loadAllNative = function loadAllNative(elements, settings, instance) {
elements.forEach(function (element) {
if (tagsWithNativeLazy.indexOf(element.tagName) === -1) {
return;
}
loadNative(element, settings, instance);
});
setToLoadCount(instance, 0);
};
var isIntersecting = function isIntersecting(entry) {
return entry.isIntersecting || entry.intersectionRatio > 0;
};
var getObserverSettings = function getObserverSettings(settings) {
return {
root: settings.container === document ? null : settings.container,
rootMargin: settings.thresholds || settings.threshold + "px"
};
};
var intersectionHandler = function intersectionHandler(entries, settings, instance) {
entries.forEach(function (entry) {
return isIntersecting(entry) ? onEnter(entry.target, entry, settings, instance) : onExit(entry.target, entry, settings, instance);
});
};
var observeElements = function observeElements(observer, elements) {
elements.forEach(function (element) {
observer.observe(element);
});
};
var updateObserver = function updateObserver(observer, elementsToObserve) {
resetObserver(observer);
observeElements(observer, elementsToObserve);
};
var setObserver = function setObserver(settings, instance) {
if (!supportsIntersectionObserver || shouldUseNative(settings)) {
return;
}
instance._observer = new IntersectionObserver(function (entries) {
intersectionHandler(entries, settings, instance);
}, getObserverSettings(settings));
};
var toArray = function toArray(nodeSet) {
return Array.prototype.slice.call(nodeSet);
};
var queryElements = function queryElements(settings) {
return settings.container.querySelectorAll(settings.elements_selector);
};
var excludeManagedElements = function excludeManagedElements(elements) {
return toArray(elements).filter(hasEmptyStatus);
};
var hasError = function hasError(element) {
return hasStatusError(element);
};
var filterErrorElements = function filterErrorElements(elements) {
return toArray(elements).filter(hasError);
};
var getElementsToLoad = function getElementsToLoad(elements, settings) {
return excludeManagedElements(elements || queryElements(settings));
};
var retryLazyLoad = function retryLazyLoad(settings, instance) {
var errorElements = filterErrorElements(queryElements(settings));
errorElements.forEach(function (element) {
removeClass(element, settings.class_error);
resetStatus(element);
});
instance.update();
};
var setOnlineCheck = function setOnlineCheck(settings, instance) {
if (!runningOnBrowser) {
return;
}
window.addEventListener("online", function () {
retryLazyLoad(settings, instance);
});
};
var LazyLoad = function LazyLoad(customSettings, elements) {
var settings = getExtendedSettings(customSettings);
this._settings = settings;
this.loadingCount = 0;
setObserver(settings, this);
setOnlineCheck(settings, this);
this.update(elements);
};
LazyLoad.prototype = {
update: function update(givenNodeset) {
var settings = this._settings;
var elementsToLoad = getElementsToLoad(givenNodeset, settings);
setToLoadCount(this, elementsToLoad.length);
if (isBot || !supportsIntersectionObserver) {
this.loadAll(elementsToLoad);
return;
}
if (shouldUseNative(settings)) {
loadAllNative(elementsToLoad, settings, this);
return;
}
updateObserver(this._observer, elementsToLoad);
},
destroy: function destroy() {
// Observer
if (this._observer) {
this._observer.disconnect();
} // Clean custom attributes on elements
queryElements(this._settings).forEach(function (element) {
deleteOriginalAttrs(element);
}); // Delete all internal props
delete this._observer;
delete this._settings;
delete this.loadingCount;
delete this.toLoadCount;
},
loadAll: function loadAll(elements) {
var _this = this;
var settings = this._settings;
var elementsToLoad = getElementsToLoad(elements, settings);
elementsToLoad.forEach(function (element) {
unobserve(element, _this);
load(element, settings, _this);
});
},
restoreAll: function restoreAll() {
var settings = this._settings;
queryElements(settings).forEach(function (element) {
restore(element, settings);
});
}
};
LazyLoad.load = function (element, customSettings) {
var settings = getExtendedSettings(customSettings);
load(element, settings);
};
LazyLoad.resetStatus = function (element) {
resetStatus(element);
}; // Automatic instances creation if required (useful for async script loading)
if (runningOnBrowser) {
autoInitialize(LazyLoad, window.lazyLoadOptions);
}
return LazyLoad;
})));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,862 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.LazyLoad = factory());
}(this, (function () { 'use strict';
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
var runningOnBrowser = typeof window !== "undefined";
var isBot = runningOnBrowser && !("onscroll" in window) || typeof navigator !== "undefined" && /(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent);
var supportsIntersectionObserver = runningOnBrowser && "IntersectionObserver" in window;
var supportsClassList = runningOnBrowser && "classList" in document.createElement("p");
var isHiDpi = runningOnBrowser && window.devicePixelRatio > 1;
var defaultSettings = {
elements_selector: ".lazy",
container: isBot || runningOnBrowser ? document : null,
threshold: 300,
thresholds: null,
data_src: "src",
data_srcset: "srcset",
data_sizes: "sizes",
data_bg: "bg",
data_bg_hidpi: "bg-hidpi",
data_bg_multi: "bg-multi",
data_bg_multi_hidpi: "bg-multi-hidpi",
data_bg_set: "bg-set",
data_poster: "poster",
class_applied: "applied",
class_loading: "loading",
class_loaded: "loaded",
class_error: "error",
class_entered: "entered",
class_exited: "exited",
unobserve_completed: true,
unobserve_entered: false,
cancel_on_exit: true,
callback_enter: null,
callback_exit: null,
callback_applied: null,
callback_loading: null,
callback_loaded: null,
callback_error: null,
callback_finish: null,
callback_cancel: null,
use_native: false,
restore_on_error: false
};
var getExtendedSettings = function getExtendedSettings(customSettings) {
return _extends({}, defaultSettings, customSettings);
};
/* Creates instance and notifies it through the window element */
var createInstance = function createInstance(classObj, options) {
var event;
var eventString = "LazyLoad::Initialized";
var instance = new classObj(options);
try {
// Works in modern browsers
event = new CustomEvent(eventString, {
detail: {
instance: instance
}
});
} catch (err) {
// Works in Internet Explorer (all versions)
event = document.createEvent("CustomEvent");
event.initCustomEvent(eventString, false, false, {
instance: instance
});
}
window.dispatchEvent(event);
};
/* Auto initialization of one or more instances of lazyload, depending on the
options passed in (plain object or an array) */
var autoInitialize = function autoInitialize(classObj, options) {
if (!options) {
return;
}
if (!options.length) {
// Plain object
createInstance(classObj, options);
} else {
// Array of objects
for (var i = 0, optionsItem; optionsItem = options[i]; i += 1) {
createInstance(classObj, optionsItem);
}
}
};
var SRC = "src";
var SRCSET = "srcset";
var SIZES = "sizes";
var POSTER = "poster";
var ORIGINALS = "llOriginalAttrs";
var DATA = "data";
var statusLoading = "loading";
var statusLoaded = "loaded";
var statusApplied = "applied";
var statusEntered = "entered";
var statusError = "error";
var statusNative = "native";
var dataPrefix = "data-";
var statusDataName = "ll-status";
var getData = function getData(element, attribute) {
return element.getAttribute(dataPrefix + attribute);
};
var setData = function setData(element, attribute, value) {
var attrName = dataPrefix + attribute;
if (value === null) {
element.removeAttribute(attrName);
return;
}
element.setAttribute(attrName, value);
};
var getStatus = function getStatus(element) {
return getData(element, statusDataName);
};
var setStatus = function setStatus(element, status) {
return setData(element, statusDataName, status);
};
var resetStatus = function resetStatus(element) {
return setStatus(element, null);
};
var hasEmptyStatus = function hasEmptyStatus(element) {
return getStatus(element) === null;
};
var hasStatusLoading = function hasStatusLoading(element) {
return getStatus(element) === statusLoading;
};
var hasStatusError = function hasStatusError(element) {
return getStatus(element) === statusError;
};
var hasStatusNative = function hasStatusNative(element) {
return getStatus(element) === statusNative;
};
var statusesAfterLoading = [statusLoading, statusLoaded, statusApplied, statusError];
var hadStartedLoading = function hadStartedLoading(element) {
return statusesAfterLoading.indexOf(getStatus(element)) >= 0;
};
var safeCallback = function safeCallback(callback, arg1, arg2, arg3) {
if (!callback) {
return;
}
if (arg3 !== undefined) {
callback(arg1, arg2, arg3);
return;
}
if (arg2 !== undefined) {
callback(arg1, arg2);
return;
}
callback(arg1);
};
var addClass = function addClass(element, className) {
if (supportsClassList) {
element.classList.add(className);
return;
}
element.className += (element.className ? " " : "") + className;
};
var removeClass = function removeClass(element, className) {
if (supportsClassList) {
element.classList.remove(className);
return;
}
element.className = element.className.replace(new RegExp("(^|\\s+)" + className + "(\\s+|$)"), " ").replace(/^\s+/, "").replace(/\s+$/, "");
};
var addTempImage = function addTempImage(element) {
element.llTempImage = document.createElement("IMG");
};
var deleteTempImage = function deleteTempImage(element) {
delete element.llTempImage;
};
var getTempImage = function getTempImage(element) {
return element.llTempImage;
};
var unobserve = function unobserve(element, instance) {
if (!instance) return;
var observer = instance._observer;
if (!observer) return;
observer.unobserve(element);
};
var resetObserver = function resetObserver(observer) {
observer.disconnect();
};
var unobserveEntered = function unobserveEntered(element, settings, instance) {
if (settings.unobserve_entered) unobserve(element, instance);
};
var updateLoadingCount = function updateLoadingCount(instance, delta) {
if (!instance) return;
instance.loadingCount += delta;
};
var decreaseToLoadCount = function decreaseToLoadCount(instance) {
if (!instance) return;
instance.toLoadCount -= 1;
};
var setToLoadCount = function setToLoadCount(instance, value) {
if (!instance) return;
instance.toLoadCount = value;
};
var isSomethingLoading = function isSomethingLoading(instance) {
return instance.loadingCount > 0;
};
var haveElementsToLoad = function haveElementsToLoad(instance) {
return instance.toLoadCount > 0;
};
var getSourceTags = function getSourceTags(parentTag) {
var sourceTags = [];
for (var i = 0, childTag; childTag = parentTag.children[i]; i += 1) {
if (childTag.tagName === "SOURCE") {
sourceTags.push(childTag);
}
}
return sourceTags;
};
var forEachPictureSource = function forEachPictureSource(element, fn) {
var parent = element.parentNode;
if (!parent || parent.tagName !== "PICTURE") {
return;
}
var sourceTags = getSourceTags(parent);
sourceTags.forEach(fn);
};
var forEachVideoSource = function forEachVideoSource(element, fn) {
var sourceTags = getSourceTags(element);
sourceTags.forEach(fn);
};
var attrsSrc = [SRC];
var attrsSrcPoster = [SRC, POSTER];
var attrsSrcSrcsetSizes = [SRC, SRCSET, SIZES];
var attrsData = [DATA];
var hasOriginalAttrs = function hasOriginalAttrs(element) {
return !!element[ORIGINALS];
};
var getOriginalAttrs = function getOriginalAttrs(element) {
return element[ORIGINALS];
};
var deleteOriginalAttrs = function deleteOriginalAttrs(element) {
return delete element[ORIGINALS];
}; // ## SAVE ##
var setOriginalsObject = function setOriginalsObject(element, attributes) {
if (hasOriginalAttrs(element)) {
return;
}
var originals = {};
attributes.forEach(function (attribute) {
originals[attribute] = element.getAttribute(attribute);
});
element[ORIGINALS] = originals;
};
var saveOriginalBackgroundStyle = function saveOriginalBackgroundStyle(element) {
if (hasOriginalAttrs(element)) {
return;
}
element[ORIGINALS] = {
backgroundImage: element.style.backgroundImage
};
}; // ## RESTORE ##
var setOrResetAttribute = function setOrResetAttribute(element, attrName, value) {
if (!value) {
element.removeAttribute(attrName);
return;
}
element.setAttribute(attrName, value);
};
var restoreOriginalAttrs = function restoreOriginalAttrs(element, attributes) {
if (!hasOriginalAttrs(element)) {
return;
}
var originals = getOriginalAttrs(element);
attributes.forEach(function (attribute) {
setOrResetAttribute(element, attribute, originals[attribute]);
});
};
var restoreOriginalBgImage = function restoreOriginalBgImage(element) {
if (!hasOriginalAttrs(element)) {
return;
}
var originals = getOriginalAttrs(element);
element.style.backgroundImage = originals.backgroundImage;
};
var manageApplied = function manageApplied(element, settings, instance) {
addClass(element, settings.class_applied);
setStatus(element, statusApplied); // Instance is not provided when loading is called from static class
if (!instance) return;
if (settings.unobserve_completed) {
// Unobserve now because we can't do it on load
unobserve(element, settings);
}
safeCallback(settings.callback_applied, element, instance);
};
var manageLoading = function manageLoading(element, settings, instance) {
addClass(element, settings.class_loading);
setStatus(element, statusLoading); // Instance is not provided when loading is called from static class
if (!instance) return;
updateLoadingCount(instance, +1);
safeCallback(settings.callback_loading, element, instance);
};
var setAttributeIfValue = function setAttributeIfValue(element, attrName, value) {
if (!value) {
return;
}
element.setAttribute(attrName, value);
};
var setImageAttributes = function setImageAttributes(element, settings) {
setAttributeIfValue(element, SIZES, getData(element, settings.data_sizes));
setAttributeIfValue(element, SRCSET, getData(element, settings.data_srcset));
setAttributeIfValue(element, SRC, getData(element, settings.data_src));
};
var setSourcesImg = function setSourcesImg(imgEl, settings) {
forEachPictureSource(imgEl, function (sourceTag) {
setOriginalsObject(sourceTag, attrsSrcSrcsetSizes);
setImageAttributes(sourceTag, settings);
});
setOriginalsObject(imgEl, attrsSrcSrcsetSizes);
setImageAttributes(imgEl, settings);
};
var setSourcesIframe = function setSourcesIframe(iframe, settings) {
setOriginalsObject(iframe, attrsSrc);
setAttributeIfValue(iframe, SRC, getData(iframe, settings.data_src));
};
var setSourcesVideo = function setSourcesVideo(videoEl, settings) {
forEachVideoSource(videoEl, function (sourceEl) {
setOriginalsObject(sourceEl, attrsSrc);
setAttributeIfValue(sourceEl, SRC, getData(sourceEl, settings.data_src));
});
setOriginalsObject(videoEl, attrsSrcPoster);
setAttributeIfValue(videoEl, POSTER, getData(videoEl, settings.data_poster));
setAttributeIfValue(videoEl, SRC, getData(videoEl, settings.data_src));
videoEl.load();
};
var setSourcesObject = function setSourcesObject(object, settings) {
setOriginalsObject(object, attrsData);
setAttributeIfValue(object, DATA, getData(object, settings.data_src));
};
var setBackground = function setBackground(element, settings, instance) {
var bg1xValue = getData(element, settings.data_bg);
var bgHiDpiValue = getData(element, settings.data_bg_hidpi);
var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue;
if (!bgDataValue) return;
element.style.backgroundImage = "url(\"".concat(bgDataValue, "\")");
getTempImage(element).setAttribute(SRC, bgDataValue);
manageLoading(element, settings, instance);
}; // NOTE: THE TEMP IMAGE TRICK CANNOT BE DONE WITH data-multi-bg
// BECAUSE INSIDE ITS VALUES MUST BE WRAPPED WITH URL() AND ONE OF THEM
// COULD BE A GRADIENT BACKGROUND IMAGE
var setMultiBackground = function setMultiBackground(element, settings, instance) {
var bg1xValue = getData(element, settings.data_bg_multi);
var bgHiDpiValue = getData(element, settings.data_bg_multi_hidpi);
var bgDataValue = isHiDpi && bgHiDpiValue ? bgHiDpiValue : bg1xValue;
if (!bgDataValue) {
return;
}
element.style.backgroundImage = bgDataValue;
manageApplied(element, settings, instance);
};
var setImgsetBackground = function setImgsetBackground(element, settings, instance) {
var bgImgSetDataValue = getData(element, settings.data_bg_set);
if (!bgImgSetDataValue) {
return;
}
var imgSetValues = bgImgSetDataValue.split("|");
var bgImageValues = imgSetValues.map(function (value) {
return "image-set(".concat(value, ")");
});
element.style.backgroundImage = bgImageValues.join(); // Temporary fix for Chromeium with the -webkit- prefix
if (element.style.backgroundImage === '') {
bgImageValues = imgSetValues.map(function (value) {
return "-webkit-image-set(".concat(value, ")");
});
element.style.backgroundImage = bgImageValues.join();
}
manageApplied(element, settings, instance);
};
var setSourcesFunctions = {
IMG: setSourcesImg,
IFRAME: setSourcesIframe,
VIDEO: setSourcesVideo,
OBJECT: setSourcesObject
};
var setSourcesNative = function setSourcesNative(element, settings) {
var setSourcesFunction = setSourcesFunctions[element.tagName];
if (!setSourcesFunction) {
return;
}
setSourcesFunction(element, settings);
};
var setSources = function setSources(element, settings, instance) {
var setSourcesFunction = setSourcesFunctions[element.tagName];
if (!setSourcesFunction) {
return;
}
setSourcesFunction(element, settings);
manageLoading(element, settings, instance);
};
var elementsWithLoadEvent = ["IMG", "IFRAME", "VIDEO", "OBJECT"];
var hasLoadEvent = function hasLoadEvent(element) {
return elementsWithLoadEvent.indexOf(element.tagName) > -1;
};
var checkFinish = function checkFinish(settings, instance) {
if (instance && !isSomethingLoading(instance) && !haveElementsToLoad(instance)) {
safeCallback(settings.callback_finish, instance);
}
};
var addEventListener = function addEventListener(element, eventName, handler) {
element.addEventListener(eventName, handler);
element.llEvLisnrs[eventName] = handler;
};
var removeEventListener = function removeEventListener(element, eventName, handler) {
element.removeEventListener(eventName, handler);
};
var hasEventListeners = function hasEventListeners(element) {
return !!element.llEvLisnrs;
};
var addEventListeners = function addEventListeners(element, loadHandler, errorHandler) {
if (!hasEventListeners(element)) element.llEvLisnrs = {};
var loadEventName = element.tagName === "VIDEO" ? "loadeddata" : "load";
addEventListener(element, loadEventName, loadHandler);
addEventListener(element, "error", errorHandler);
};
var removeEventListeners = function removeEventListeners(element) {
if (!hasEventListeners(element)) {
return;
}
var eventListeners = element.llEvLisnrs;
for (var eventName in eventListeners) {
var handler = eventListeners[eventName];
removeEventListener(element, eventName, handler);
}
delete element.llEvLisnrs;
};
var doneHandler = function doneHandler(element, settings, instance) {
deleteTempImage(element);
updateLoadingCount(instance, -1);
decreaseToLoadCount(instance);
removeClass(element, settings.class_loading);
if (settings.unobserve_completed) {
unobserve(element, instance);
}
};
var loadHandler = function loadHandler(event, element, settings, instance) {
var goingNative = hasStatusNative(element);
doneHandler(element, settings, instance);
addClass(element, settings.class_loaded);
setStatus(element, statusLoaded);
safeCallback(settings.callback_loaded, element, instance);
if (!goingNative) checkFinish(settings, instance);
};
var errorHandler = function errorHandler(event, element, settings, instance) {
var goingNative = hasStatusNative(element);
doneHandler(element, settings, instance);
addClass(element, settings.class_error);
setStatus(element, statusError);
safeCallback(settings.callback_error, element, instance);
if (settings.restore_on_error) restoreOriginalAttrs(element, attrsSrcSrcsetSizes);
if (!goingNative) checkFinish(settings, instance);
};
var addOneShotEventListeners = function addOneShotEventListeners(element, settings, instance) {
var elementToListenTo = getTempImage(element) || element;
if (hasEventListeners(elementToListenTo)) {
// This happens when loading is retried twice
return;
}
var _loadHandler = function _loadHandler(event) {
loadHandler(event, element, settings, instance);
removeEventListeners(elementToListenTo);
};
var _errorHandler = function _errorHandler(event) {
errorHandler(event, element, settings, instance);
removeEventListeners(elementToListenTo);
};
addEventListeners(elementToListenTo, _loadHandler, _errorHandler);
};
var loadBackground = function loadBackground(element, settings, instance) {
addTempImage(element);
addOneShotEventListeners(element, settings, instance);
saveOriginalBackgroundStyle(element);
setBackground(element, settings, instance);
setMultiBackground(element, settings, instance);
setImgsetBackground(element, settings, instance);
};
var loadRegular = function loadRegular(element, settings, instance) {
addOneShotEventListeners(element, settings, instance);
setSources(element, settings, instance);
};
var load = function load(element, settings, instance) {
if (hasLoadEvent(element)) {
loadRegular(element, settings, instance);
} else {
loadBackground(element, settings, instance);
}
};
var loadNative = function loadNative(element, settings, instance) {
element.setAttribute("loading", "lazy");
addOneShotEventListeners(element, settings, instance);
setSourcesNative(element, settings);
setStatus(element, statusNative);
};
var removeImageAttributes = function removeImageAttributes(element) {
element.removeAttribute(SRC);
element.removeAttribute(SRCSET);
element.removeAttribute(SIZES);
};
var resetSourcesImg = function resetSourcesImg(element) {
forEachPictureSource(element, function (sourceTag) {
removeImageAttributes(sourceTag);
});
removeImageAttributes(element);
};
var restoreImg = function restoreImg(imgEl) {
forEachPictureSource(imgEl, function (sourceEl) {
restoreOriginalAttrs(sourceEl, attrsSrcSrcsetSizes);
});
restoreOriginalAttrs(imgEl, attrsSrcSrcsetSizes);
};
var restoreVideo = function restoreVideo(videoEl) {
forEachVideoSource(videoEl, function (sourceEl) {
restoreOriginalAttrs(sourceEl, attrsSrc);
});
restoreOriginalAttrs(videoEl, attrsSrcPoster);
videoEl.load();
};
var restoreIframe = function restoreIframe(iframeEl) {
restoreOriginalAttrs(iframeEl, attrsSrc);
};
var restoreObject = function restoreObject(objectEl) {
restoreOriginalAttrs(objectEl, attrsData);
};
var restoreFunctions = {
IMG: restoreImg,
IFRAME: restoreIframe,
VIDEO: restoreVideo,
OBJECT: restoreObject
};
var restoreAttributes = function restoreAttributes(element) {
var restoreFunction = restoreFunctions[element.tagName];
if (!restoreFunction) {
restoreOriginalBgImage(element);
return;
}
restoreFunction(element);
};
var resetClasses = function resetClasses(element, settings) {
if (hasEmptyStatus(element) || hasStatusNative(element)) {
return;
}
removeClass(element, settings.class_entered);
removeClass(element, settings.class_exited);
removeClass(element, settings.class_applied);
removeClass(element, settings.class_loading);
removeClass(element, settings.class_loaded);
removeClass(element, settings.class_error);
};
var restore = function restore(element, settings) {
restoreAttributes(element);
resetClasses(element, settings);
resetStatus(element);
deleteOriginalAttrs(element);
};
var cancelLoading = function cancelLoading(element, entry, settings, instance) {
if (!settings.cancel_on_exit) return;
if (!hasStatusLoading(element)) return;
if (element.tagName !== "IMG") return; //Works only on images
removeEventListeners(element);
resetSourcesImg(element);
restoreImg(element);
removeClass(element, settings.class_loading);
updateLoadingCount(instance, -1);
resetStatus(element);
safeCallback(settings.callback_cancel, element, entry, instance);
};
var onEnter = function onEnter(element, entry, settings, instance) {
var dontLoad = hadStartedLoading(element);
/* Save status
before setting it, to prevent loading it again. Fixes #526. */
setStatus(element, statusEntered);
addClass(element, settings.class_entered);
removeClass(element, settings.class_exited);
unobserveEntered(element, settings, instance);
safeCallback(settings.callback_enter, element, entry, instance);
if (dontLoad) return;
load(element, settings, instance);
};
var onExit = function onExit(element, entry, settings, instance) {
if (hasEmptyStatus(element)) return; //Ignore the first pass, at landing
addClass(element, settings.class_exited);
cancelLoading(element, entry, settings, instance);
safeCallback(settings.callback_exit, element, entry, instance);
};
var tagsWithNativeLazy = ["IMG", "IFRAME", "VIDEO"];
var shouldUseNative = function shouldUseNative(settings) {
return settings.use_native && "loading" in HTMLImageElement.prototype;
};
var loadAllNative = function loadAllNative(elements, settings, instance) {
elements.forEach(function (element) {
if (tagsWithNativeLazy.indexOf(element.tagName) === -1) {
return;
}
loadNative(element, settings, instance);
});
setToLoadCount(instance, 0);
};
var isIntersecting = function isIntersecting(entry) {
return entry.isIntersecting || entry.intersectionRatio > 0;
};
var getObserverSettings = function getObserverSettings(settings) {
return {
root: settings.container === document ? null : settings.container,
rootMargin: settings.thresholds || settings.threshold + "px"
};
};
var intersectionHandler = function intersectionHandler(entries, settings, instance) {
entries.forEach(function (entry) {
return isIntersecting(entry) ? onEnter(entry.target, entry, settings, instance) : onExit(entry.target, entry, settings, instance);
});
};
var observeElements = function observeElements(observer, elements) {
elements.forEach(function (element) {
observer.observe(element);
});
};
var updateObserver = function updateObserver(observer, elementsToObserve) {
resetObserver(observer);
observeElements(observer, elementsToObserve);
};
var setObserver = function setObserver(settings, instance) {
if (!supportsIntersectionObserver || shouldUseNative(settings)) {
return;
}
instance._observer = new IntersectionObserver(function (entries) {
intersectionHandler(entries, settings, instance);
}, getObserverSettings(settings));
};
var toArray = function toArray(nodeSet) {
return Array.prototype.slice.call(nodeSet);
};
var queryElements = function queryElements(settings) {
return settings.container.querySelectorAll(settings.elements_selector);
};
var excludeManagedElements = function excludeManagedElements(elements) {
return toArray(elements).filter(hasEmptyStatus);
};
var hasError = function hasError(element) {
return hasStatusError(element);
};
var filterErrorElements = function filterErrorElements(elements) {
return toArray(elements).filter(hasError);
};
var getElementsToLoad = function getElementsToLoad(elements, settings) {
return excludeManagedElements(elements || queryElements(settings));
};
var retryLazyLoad = function retryLazyLoad(settings, instance) {
var errorElements = filterErrorElements(queryElements(settings));
errorElements.forEach(function (element) {
removeClass(element, settings.class_error);
resetStatus(element);
});
instance.update();
};
var setOnlineCheck = function setOnlineCheck(settings, instance) {
if (!runningOnBrowser) {
return;
}
instance._onlineHandler = function () {
retryLazyLoad(settings, instance);
};
window.addEventListener("online", instance._onlineHandler);
};
var resetOnlineCheck = function resetOnlineCheck(instance) {
if (!runningOnBrowser) {
return;
}
window.removeEventListener("online", instance._onlineHandler);
};
var LazyLoad = function LazyLoad(customSettings, elements) {
var settings = getExtendedSettings(customSettings);
this._settings = settings;
this.loadingCount = 0;
setObserver(settings, this);
setOnlineCheck(settings, this);
this.update(elements);
};
LazyLoad.prototype = {
update: function update(givenNodeset) {
var settings = this._settings;
var elementsToLoad = getElementsToLoad(givenNodeset, settings);
setToLoadCount(this, elementsToLoad.length);
if (isBot || !supportsIntersectionObserver) {
this.loadAll(elementsToLoad);
return;
}
if (shouldUseNative(settings)) {
loadAllNative(elementsToLoad, settings, this);
return;
}
updateObserver(this._observer, elementsToLoad);
},
destroy: function destroy() {
// Observer
if (this._observer) {
this._observer.disconnect();
} // Clean handlers
resetOnlineCheck(this); // Clean custom attributes on elements
queryElements(this._settings).forEach(function (element) {
deleteOriginalAttrs(element);
}); // Delete all internal props
delete this._observer;
delete this._settings;
delete this._onlineHandler;
delete this.loadingCount;
delete this.toLoadCount;
},
loadAll: function loadAll(elements) {
var _this = this;
var settings = this._settings;
var elementsToLoad = getElementsToLoad(elements, settings);
elementsToLoad.forEach(function (element) {
unobserve(element, _this);
load(element, settings, _this);
});
},
restoreAll: function restoreAll() {
var settings = this._settings;
queryElements(settings).forEach(function (element) {
restore(element, settings);
});
}
};
LazyLoad.load = function (element, customSettings) {
var settings = getExtendedSettings(customSettings);
load(element, settings);
};
LazyLoad.resetStatus = function (element) {
resetStatus(element);
}; // Automatic instances creation if required (useful for async script loading)
if (runningOnBrowser) {
autoInitialize(LazyLoad, window.lazyLoadOptions);
}
return LazyLoad;
})));
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,255 @@
class RocketPreloadLinks {
constructor( browser, config ) {
this.browser = browser;
this.config = config;
this.options = this.browser.options;
this.prefetched = new Set;
this.eventTime = null;
this.threshold = 1111;
this.numOnHover = 0;
}
/**
* Initializes the handler.
*/
init() {
if (
! this.browser.supportsLinkPrefetch()
||
this.browser.isDataSaverModeOn()
||
this.browser.isSlowConnection()
) {
return;
}
this.regex = {
excludeUris: RegExp( this.config.excludeUris, 'i' ),
images: RegExp( '.(' + this.config.imageExt + ')$', 'i' ),
fileExt: RegExp( '.(' + this.config.fileExt + ')$', 'i' )
};
this._initListeners( this );
}
/**
* Initializes the event listeners.
*
* @private
*
* @param self instance of this object, used for binding "this" to the listeners.
*/
_initListeners( self ) {
// Setting onHoverDelay to -1 disables the "on-hover" feature.
if ( this.config.onHoverDelay > -1 ) {
document.addEventListener( 'mouseover', self.listener.bind( self ), self.listenerOptions );
}
document.addEventListener( 'mousedown', self.listener.bind( self ), self.listenerOptions );
document.addEventListener( 'touchstart', self.listener.bind( self ), self.listenerOptions );
}
/**
* Event listener. Processes when near or on a valid <a> hyperlink.
*
* @param Event event Event instance.
*/
listener( event ) {
const linkElem = event.target.closest( 'a' );
const url = this._prepareUrl( linkElem );
if ( null === url ) {
return;
}
switch ( event.type ) {
case 'mousedown':
case 'touchstart':
this._addPrefetchLink( url );
break;
case 'mouseover':
this._earlyPrefetch( linkElem, url, 'mouseout' );
}
}
/**
*
* @private
*
* @param Element|null linkElem
* @param object url
* @param string resetEvent
*/
_earlyPrefetch( linkElem, url, resetEvent ) {
const doPrefetch = () => {
falseTrigger = null;
// Start the rate throttle: 1 sec timeout.
if ( 0 === this.numOnHover ) {
setTimeout( () => this.numOnHover = 0, 1000 );
}
// Bail out when exceeding the rate throttle.
else if ( this.numOnHover > this.config.rateThrottle ) {
return;
}
this.numOnHover++;
this._addPrefetchLink( url );
};
// Delay to avoid false triggers for hover/touch/tap.
let falseTrigger = setTimeout( doPrefetch, this.config.onHoverDelay );
// On reset event, reset the false trigger timer.
const reset = () => {
linkElem.removeEventListener( resetEvent, reset, { passive: true } );
if ( null === falseTrigger ) {
return;
}
clearTimeout( falseTrigger );
falseTrigger = null;
};
linkElem.addEventListener( resetEvent, reset, { passive: true } );
}
/**
* Adds a <link rel="prefetch" href="<url>"> for the given URL.
*
* @param string url The Given URL to prefetch.
*/
_addPrefetchLink( url ) {
this.prefetched.add( url.href );
return new Promise( ( resolve, reject ) => {
const elem = document.createElement( 'link' );
elem.rel = 'prefetch';
elem.href = url.href;
elem.onload = resolve;
elem.onerror = reject;
document.head.appendChild( elem );
} ).catch(() => {
// ignore and continue.
});
}
/**
* Prepares the target link's URL.
*
* @private
*
* @param Element|null linkElem Instance of the link element.
* @returns {null|*}
*/
_prepareUrl( linkElem ) {
if (
null === linkElem
||
typeof linkElem !== 'object'
||
! 'href' in linkElem
||
// Link prefetching only works on http/https protocol.
[ 'http:', 'https:' ].indexOf( linkElem.protocol ) === -1
) {
return null;
}
const origin = linkElem.href.substring( 0, this.config.siteUrl.length );
const pathname = this._getPathname( linkElem.href, origin );
const url = {
original: linkElem.href,
protocol: linkElem.protocol,
origin: origin,
pathname: pathname,
href: origin + pathname
};
return this._isLinkOk( url ) ? url : null;
}
/**
* Gets the URL's pathname. Note: ensures the pathname matches the permalink structure.
*
* @private
*
* @param object url Instance of the URL.
* @param string origin The target link href's origin.
* @returns {string}
*/
_getPathname( url, origin ) {
let pathname = origin
? url.substring( this.config.siteUrl.length )
: url;
if ( ! pathname.startsWith( '/' ) ) {
pathname = '/' + pathname;
}
if ( this._shouldAddTrailingSlash( pathname ) ) {
return pathname + '/';
}
return pathname;
}
_shouldAddTrailingSlash( pathname ) {
return (
this.config.usesTrailingSlash
&&
! pathname.endsWith( '/' )
&&
! this.regex.fileExt.test( pathname )
);
}
/**
* Checks if the given link element is okay to process.
*
* @private
*
* @param object url URL parts object.
*
* @returns {boolean}
*/
_isLinkOk( url ) {
if ( null === url || typeof url !== 'object' ) {
return false;
}
return (
! this.prefetched.has( url.href )
&&
url.origin === this.config.siteUrl // is an internal document.
&&
url.href.indexOf( '?' ) === -1 // not a query string.
&&
url.href.indexOf( '#' ) === -1 // not an anchor.
&&
! this.regex.excludeUris.test( url.href ) // not excluded.
&&
! this.regex.images.test( url.href ) // not an image.
);
}
/**
* Named static constructor to encapsulate how to create the object.
*/
static run() {
// Bail out if the configuration not passed from the server.
if ( typeof RocketPreloadLinksConfig === 'undefined' ) {
return;
}
const browser = new RocketBrowserCompatibilityChecker( {
capture: true,
passive: true
} );
const instance = new RocketPreloadLinks( browser, RocketPreloadLinksConfig );
instance.init();
}
}
RocketPreloadLinks.run();
@@ -0,0 +1,3 @@
(function() {
"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var t=function(){function n(e,t){i(this,n),this.browser=e,this.config=t,this.options=this.browser.options,this.prefetched=new Set,this.eventTime=null,this.threshold=1111,this.numOnHover=0}return e(n,[{key:"init",value:function(){!this.browser.supportsLinkPrefetch()||this.browser.isDataSaverModeOn()||this.browser.isSlowConnection()||(this.regex={excludeUris:RegExp(this.config.excludeUris,"i"),images:RegExp(".("+this.config.imageExt+")$","i"),fileExt:RegExp(".("+this.config.fileExt+")$","i")},this._initListeners(this))}},{key:"_initListeners",value:function(e){-1<this.config.onHoverDelay&&document.addEventListener("mouseover",e.listener.bind(e),e.listenerOptions),document.addEventListener("mousedown",e.listener.bind(e),e.listenerOptions),document.addEventListener("touchstart",e.listener.bind(e),e.listenerOptions)}},{key:"listener",value:function(e){var t=e.target.closest("a"),n=this._prepareUrl(t);if(null!==n)switch(e.type){case"mousedown":case"touchstart":this._addPrefetchLink(n);break;case"mouseover":this._earlyPrefetch(t,n,"mouseout")}}},{key:"_earlyPrefetch",value:function(t,e,n){var i=this,r=setTimeout(function(){if(r=null,0===i.numOnHover)setTimeout(function(){return i.numOnHover=0},1e3);else if(i.numOnHover>i.config.rateThrottle)return;i.numOnHover++,i._addPrefetchLink(e)},this.config.onHoverDelay);t.addEventListener(n,function e(){t.removeEventListener(n,e,{passive:!0}),null!==r&&(clearTimeout(r),r=null)},{passive:!0})}},{key:"_addPrefetchLink",value:function(i){return this.prefetched.add(i.href),new Promise(function(e,t){var n=document.createElement("link");n.rel="prefetch",n.href=i.href,n.onload=e,n.onerror=t,document.head.appendChild(n)}).catch(function(){})}},{key:"_prepareUrl",value:function(e){if(null===e||"object"!==(void 0===e?"undefined":r(e))||!1 in e||-1===["http:","https:"].indexOf(e.protocol))return null;var t=e.href.substring(0,this.config.siteUrl.length),n=this._getPathname(e.href,t),i={original:e.href,protocol:e.protocol,origin:t,pathname:n,href:t+n};return this._isLinkOk(i)?i:null}},{key:"_getPathname",value:function(e,t){var n=t?e.substring(this.config.siteUrl.length):e;return n.startsWith("/")||(n="/"+n),this._shouldAddTrailingSlash(n)?n+"/":n}},{key:"_shouldAddTrailingSlash",value:function(e){return this.config.usesTrailingSlash&&!e.endsWith("/")&&!this.regex.fileExt.test(e)}},{key:"_isLinkOk",value:function(e){return null!==e&&"object"===(void 0===e?"undefined":r(e))&&(!this.prefetched.has(e.href)&&e.origin===this.config.siteUrl&&-1===e.href.indexOf("?")&&-1===e.href.indexOf("#")&&!this.regex.excludeUris.test(e.href)&&!this.regex.images.test(e.href))}}],[{key:"run",value:function(){"undefined"!=typeof RocketPreloadLinksConfig&&new n(new RocketBrowserCompatibilityChecker({capture:!0,passive:!0}),RocketPreloadLinksConfig).init()}}]),n}();t.run();
}());
@@ -0,0 +1,62 @@
jQuery( document ).ready( function( $ ){
var sent = false;
$( '.rocket-dismiss' ).on( 'click', function( e ) {
e.preventDefault();
var url = $( this ).attr( 'href' ).replace( 'admin-post', 'admin-ajax' );
$.get( url ).done( $( this ).closest( '.notice' ).hide( 'slow' ) );
});
$( '#deactivate' ).click( function() {
$( '#export_settings' ).prop( 'checked', false );
$( '#export_settings' ).hide();
$( 'label[for=export_settings]' ).hide();
});
$( '#safe_mode' ).click( function() {
$( '#export_settings' ).show();
$( 'label[for=export_settings]' ).show();
$( '#export_settings' ).prop( 'checked', true );
});
$( '#wpr-deactivation-intent-form' ).submit(function (e) {
const checked = $( '#export_settings' ).prop('checked');
if(! checked || sent) {
return true;
}
e.preventDefault();
$.ajax( {
url: rocket_option_export.rest_url_option_export,
method: 'GET',
success: function( data, textStatus, xhr ) {
const disposition = xhr.getResponseHeader('content-disposition');
const filenames = disposition.match('filename="([^"]+)"');
if(! filenames.length) {
return;
}
const filename = filenames.pop();
const url = URL.createObjectURL( new Blob( [ JSON.stringify(data, null, 2) ], {
type: "octet/stream"
}));
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
a.href = url;
a.download = filename;
a.click();
window.URL.revokeObjectURL(url);
},
complete: function () {
sent = true;
$( '#wpr-deactivation-intent-form' ).submit();
}
} );
return true;
});
} );
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,36 @@
let cpcssHeartbeatCall;
const cpcssHeartbeat = () => {
const xhttp = new XMLHttpRequest();
xhttp.onload = () => {
if ( 200 !== xhttp.status ) {
return;
}
const cpcs_heartbeat_response = JSON.parse( xhttp.response );
if ( false === cpcs_heartbeat_response.success ) {
stopCPCSSHeartbeat();
return;
}
if ( cpcs_heartbeat_response.success &&
'cpcss_complete' === cpcs_heartbeat_response.data.status ) {
stopCPCSSHeartbeat();
return;
}
cpcssHeartbeatCall = setTimeout( () => {
cpcssHeartbeat();
}, 3000 );
};
xhttp.open( 'POST', ajaxurl, true );
xhttp.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8' );
xhttp.send( "action=rocket_cpcss_heartbeat&_nonce=" + rocket_cpcss_heartbeat.nonce );
}
const stopCPCSSHeartbeat = () => {
clearTimeout( cpcssHeartbeatCall );
}
cpcssHeartbeat();
@@ -0,0 +1,150 @@
let checkCPCSSGenerationCall;
let checkCPCSSMobileGenerationCall;
let cpcsssGenerationPending = 0;
let cpcsssMobileGenerationPending = 0;
const rocketDeleteCPCSSbtn = document.getElementById( 'rocket-delete-post-cpss' );
const rocketGenerateCPCSSbtn = document.getElementById( 'rocket-generate-post-cpss' );
const rocketCPCSSGenerate = document.querySelectorAll( '.cpcss_generate' );
const rocketCPCSSReGenerate = document.querySelectorAll( '.cpcss_regenerate' );
if ( null !== rocketDeleteCPCSSbtn ) {
rocketDeleteCPCSSbtn.addEventListener( 'click', e => {
e.preventDefault();
deleteCPCSS();
} );
}
if ( null !== rocketGenerateCPCSSbtn ) {
rocketGenerateCPCSSbtn.addEventListener( 'click', e => {
e.preventDefault();
rocketGenerateCPCSSbtn.disabled = true;
checkCPCSSGeneration( null, false );
if ( rocket_cpcss.wprMobileCpcssEnabled ) {
checkCPCSSGeneration( null, true );
}
} );
}
const checkCPCSSGeneration = ( timeout = null, is_mobile = false ) => {
const spinner = rocketGenerateCPCSSbtn.querySelector( '.spinner' );
spinner.style.display = 'block';
spinner.style.visibility = 'visible';
const xhttp = new XMLHttpRequest();
xhttp.onload = () => {
if ( 200 !== xhttp.status ) {
return;
}
const cpcss_response = JSON.parse( xhttp.response );
if ( 200 !== cpcss_response.data.status ) {
stopCPCSSGeneration( spinner );
if ( ! is_mobile ) {
cpcssNotice( cpcss_response.message, 'error' );
}
rocketGenerateCPCSSbtn.disabled = false;
return;
}
if ( 200 === cpcss_response.data.status &&
'cpcss_generation_pending' !== cpcss_response.code ) {
stopCPCSSGeneration( spinner, is_mobile );
if ( ! is_mobile ) {
cpcssNotice( cpcss_response.message, 'success' );
}
// Revert view to Regenerate.
rocketGenerateCPCSSbtn.querySelector( '.rocket-generate-post-cpss-btn-txt' ).innerHTML = rocket_cpcss.regenerate_btn;
rocketDeleteCPCSSbtn.style.display = 'block';
rocketGenerateCPCSSbtn.disabled = false;
rocketCPCSSGenerate.forEach( item => item.style.display = 'none' );
rocketCPCSSReGenerate.forEach( item => item.style.display = 'block' );
return;
}
if ( is_mobile ) {
cpcsssMobileGenerationPending++;
if ( cpcsssMobileGenerationPending > 10 ) {
stopCPCSSGeneration( spinner, is_mobile );
cpcsssMobileGenerationPending = 0;
checkCPCSSGeneration( true, true );
return;
}
checkCPCSSMobileGenerationCall = setTimeout( () => {
checkCPCSSGeneration( null, true );
}, 3000 );
} else {
cpcsssGenerationPending++;
if ( cpcsssGenerationPending > 10 ) {
stopCPCSSGeneration( spinner, is_mobile );
cpcsssGenerationPending = 0;
checkCPCSSGeneration( true, false );
return;
}
checkCPCSSGenerationCall = setTimeout( () => {
checkCPCSSGeneration( null, false );
}, 3000 );
}
};
xhttp.open( 'POST', rocket_cpcss.rest_url, true );
xhttp.setRequestHeader( 'Content-Type', 'application/json' );
xhttp.setRequestHeader( 'X-WP-Nonce', rocket_cpcss.rest_nonce );
xhttp.send( JSON.stringify( { timeout: timeout, is_mobile: is_mobile } ) );
}
const stopCPCSSGeneration = ( spinner, is_mobile ) => {
spinner.style.display = 'none';
if ( is_mobile ) {
clearTimeout( checkCPCSSMobileGenerationCall );
} else {
clearTimeout( checkCPCSSGenerationCall );
}
}
const deleteCPCSS = () => {
rocketDeleteCPCSSbtn.disabled = true;
const xhttp = new XMLHttpRequest();
xhttp.onload = () => {
if ( 200 !== xhttp.status ) {
return;
}
rocketDeleteCPCSSbtn.disabled = false;
const cpcss_response = JSON.parse( xhttp.response );
if ( 200 !== cpcss_response.data.status ) {
cpcssNotice( cpcss_response.message, 'error' );
return;
}
cpcssNotice( cpcss_response.message, 'success' );
// Revert view to Generate.
rocketGenerateCPCSSbtn.querySelector( '.rocket-generate-post-cpss-btn-txt' ).innerHTML = rocket_cpcss.generate_btn;
rocketDeleteCPCSSbtn.style.display = 'none';
rocketCPCSSReGenerate.forEach( item => item.style.display = 'none' );
rocketCPCSSGenerate.forEach( item => item.style.display = 'block' );
};
xhttp.open( 'DELETE', rocket_cpcss.rest_url, true );
xhttp.setRequestHeader( 'Content-Type', 'application/json' );
xhttp.setRequestHeader( 'X-WP-Nonce', rocket_cpcss.rest_nonce );
xhttp.send();
}
const cpcssNotice = ( msg, type ) => {
/* Add notice class */
const cpcssNotice = document.getElementById( 'cpcss_response_notice' );
cpcssNotice.innerHTML = '';
cpcssNotice.classList.remove( 'hidden', 'notice', 'is-warning', 'notice-error', 'notice-success', 'is-error', 'is-success' );
cpcssNotice.classList.add( 'notice', 'notice-' + type, 'is-' + type );
/* create paragraph element to hold message */
const p = document.createElement( 'p' );
p.appendChild( document.createTextNode( msg ) );
/* Add the whole message to notice div */
cpcssNotice.appendChild( p );
}
+223
View File
@@ -0,0 +1,223 @@
{
"name": "wp-media/wp-rocket",
"description": "Performance optimization plugin for WordPress",
"keywords": [
"wordpress",
"cache",
"minification",
"lazyload"
],
"homepage": "https://wp-rocket.me",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "WP Media",
"email": "contact@wp-media.me",
"homepage": "https://wp-media.me"
}
],
"type": "wordpress-plugin",
"config": {
"sort-packages": true,
"preferred-install": {
"wp-media/phpunit": "source"
},
"process-timeout": 0,
"allow-plugins": {
"composer/installers": true,
"mnsami/composer-custom-directory-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"support": {
"issues": "https://github.com/wp-media/wp-rocket/issues",
"source": "https://github.com/wp-media/wp-rocket"
},
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
}
],
"require": {
"php": ">=7.3",
"cloudflare/cf-ip-rewrite": "^1.0",
"composer/installers": "^1.0 || ^2.0"
},
"require-dev": {
"php": "^7 || ^8",
"brain/monkey": "^2.0",
"coenjacobs/mozart": "^0.7",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"league/container": "^3.3",
"mikey179/vfsstream": "1.6.11",
"mnsami/composer-custom-directory-installer": "^2.0",
"mobiledetect/mobiledetectlib": "^2.8",
"phpcompatibility/phpcompatibility-wp": "^2.0",
"phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^7.5 || ^8 || ^9",
"psr/container": "1.0.0",
"roave/security-advisories": "dev-master",
"szepeviktor/phpstan-wordpress": "^1.3",
"woocommerce/action-scheduler": "^3.4",
"wp-coding-standards/wpcs": "^3",
"wp-media/background-processing": "^1.3",
"wp-media/phpunit": "^3",
"wp-media/rocket-lazyload-common": "^3.0.11",
"wp-media/wp-imagify-partner": "^1.0",
"wpackagist-plugin/amp": "^1.1.4",
"wpackagist-plugin/hummingbird-performance": "2.0.1",
"wpackagist-plugin/jetpack": "9.3.2",
"wpackagist-plugin/pdf-embedder": "^4.6",
"wpackagist-plugin/simple-custom-css": "^4.0.3",
"wpackagist-plugin/spinupwp": "^1.1",
"wpackagist-plugin/woocommerce": "^7",
"wpackagist-plugin/wp-smushit": "^3",
"wp-media/monolog": "^0.0"
},
"autoload": {
"classmap": [
"inc/classes",
"inc/vendors/classes",
"inc/deprecated"
],
"exclude-from-classmap": [
"inc/vendors/classes/class-rocket-mobile-detect.php",
"inc/classes/class-wp-rocket-requirements-check.php"
],
"psr-4": {
"WP_Rocket\\": "inc/",
"WPMedia\\Cloudflare\\": "inc/Addon/Cloudflare/"
}
},
"autoload-dev": {
"psr-4": {
"WP_Rocket\\Tests\\": "tests/"
}
},
"extra": {
"installer-paths": {
"./inc/Dependencies/ActionScheduler/": ["woocommerce/action-scheduler"],
"vendor/{$vendor}/{$name}/": ["type:wordpress-plugin"]
},
"mozart": {
"dep_namespace": "WP_Rocket\\Dependencies\\",
"dep_directory": "/inc/Dependencies/",
"classmap_directory": "/inc/classes/dependencies/",
"classmap_prefix": "WP_Rocket_",
"packages": [
"mobiledetect/mobiledetectlib",
"wp-media/background-processing",
"wp-media/rocket-lazyload-common",
"wp-media/wp-imagify-partner",
"wp-media/monolog",
"league/container"
]
}
},
"scripts": {
"test-unit": "\"vendor/bin/phpunit\" --testsuite unit --colors=always --configuration tests/Unit/phpunit.xml.dist",
"test-integration": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --exclude-group AdminOnly,BeaverBuilder,Elementor,Hummingbird,WithSmush,WithWoo,WithAmp,WithAmpAndCloudflare,WithSCCSS,Cloudways,Dreampress,Cloudflare,CloudflareAdmin,Multisite,WPEngine,SpinUpWP,WordPressCom,O2Switch,PDFEmbedder,PDFEmbedderPremium,PDFEmbedderSecure,Godaddy,LiteSpeed,RevolutionSlider,WordFence,ConvertPlug,Kinsta,Jetpack,RankMathSEO,AllInOneSeoPack,SEOPress,TheSEOFramework,OneCom,RocketLazyLoad,WPXCloud,TheEventsCalendar,Perfmatters,RapidLoad,ProIsp,TranslatePress,WPGeotargeting,Pressidium",
"test-integration-adminonly": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group AdminOnly",
"test-integration-bb": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group BeaverBuilder",
"test-integration-cloudflare": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group Cloudflare",
"test-integration-cloudflareadmin": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group CloudflareAdmin",
"test-integration-cloudways": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group Cloudways",
"test-integration-elementor": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group Elementor",
"test-integration-hummingbird": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group Hummingbird",
"test-integration-multisite": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group Multisite",
"test-integration-withsmush": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group WithSmush",
"test-integration-withamp": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group WithAmp",
"test-integration-withampcloudflare": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group WithAmpAndCloudflare",
"test-integration-withsccss": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group WithSCCSS",
"test-integration-withwoo": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group WithWoo",
"test-integration-wpengine": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group WPEngine",
"test-integration-spinupwp": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group SpinUpWP",
"test-integration-wpcom": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group WordPressCom",
"test-integration-pdfembedder": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group PDFEmbedder",
"test-integration-pdfembedderpremium": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group PDFEmbedderPremium",
"test-integration-pdfembeddersecure": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group PDFEmbedderSecure",
"test-integration-o2switch": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group O2Switch",
"test-integration-dreampress": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group Dreampress",
"test-integration-godaddy": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group Godaddy",
"test-integration-revolutionslider": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group RevolutionSlider",
"test-integration-litespeed": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group LiteSpeed",
"test-integration-wordfence": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group WordFence",
"test-integration-kinsta": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group Kinsta",
"test-integration-convertplug": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group ConvertPlug",
"test-integration-onecom": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group OneCom",
"test-integration-jetpack": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group Jetpack",
"test-integration-rank-math-seo": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group RankMathSEO",
"test-integration-all-in-seo-pack": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group AllInOneSeoPack",
"test-integration-seopress": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group SEOPress",
"test-integration-the-seo-framework": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group TheSEOFramework",
"test-integration-rocket-lazy-load": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group RocketLazyLoad",
"test-integration-the-events-calendar": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group TheEventsCalendar",
"test-integration-wpxcloud": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group WPXCloud",
"test-integration-perfmatters": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group Perfmatters",
"test-integration-rapidload": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group RapidLoad",
"test-integration-proisp": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group ProIsp",
"test-integration-wp-geotargeting": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group WPGeotargeting",
"test-integration-translatepress": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group TranslatePress",
"test-integration-pressidium": "\"vendor/bin/phpunit\" --testsuite integration --colors=always --configuration tests/Integration/phpunit.xml.dist --group Pressidium",
"run-tests": [
"@test-unit",
"@test-integration",
"@test-integration-adminonly",
"@test-integration-cloudflare",
"@test-integration-cloudflareadmin",
"@test-integration-bb",
"@test-integration-elementor",
"@test-integration-hummingbird",
"@test-integration-withamp",
"@test-integration-withampcloudflare",
"@test-integration-withsccss",
"@test-integration-withsmush",
"@test-integration-withwoo",
"@test-integration-pdfembedder",
"@test-integration-pdfembedderpremium",
"@test-integration-pdfembeddersecure",
"@test-integration-multisite",
"@test-integration-cloudways",
"@test-integration-wpengine",
"@test-integration-spinupwp",
"@test-integration-wpcom",
"@test-integration-o2switch",
"@test-integration-dreampress",
"@test-integration-godaddy",
"@test-integration-revolutionslider",
"@test-integration-litespeed",
"@test-integration-wordfence",
"@test-integration-kinsta",
"@test-integration-convertplug",
"@test-integration-onecom",
"@test-integration-jetpack",
"@test-integration-rank-math-seo",
"@test-integration-all-in-seo-pack",
"@test-integration-seopress",
"@test-integration-the-events-calendar",
"@test-integration-wpxcloud",
"@test-integration-perfmatters",
"@test-integration-rapidload",
"@test-integration-proisp",
"@test-integration-wp-geotargeting",
"@test-integration-translatepress",
"@test-integration-pressidium"
],
"run-stan": "vendor/bin/phpstan analyze --memory-limit=2G --no-progress",
"install-codestandards": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run",
"phpcs": "phpcs --basepath=.",
"phpcs-changed": "./bin/phpcs-changed.sh",
"phpcs:fix": "phpcbf",
"post-install-cmd": [
"\"vendor/bin/mozart\" compose",
"composer dump-autoload"
],
"post-update-cmd": [
"\"vendor/bin/mozart\" compose",
"composer dump-autoload"
],
"code-coverage": "\"vendor/bin/phpunit\" --testsuite unit --colors=always --configuration tests/Unit/phpunit.xml.dist --coverage-clover=tests/report/coverage.clover"
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,27 @@
This file contains a list of people who have made large contributions to WP Rocket.
Developers:
Jonathan Buttigieg <jonathan@wp-media.me>
Remy Perona <remy@wp-media.me>
Ahmed Saeed <ahmed@wp-media.me>
Alfonso Catron <alfonso@wp-media.me>
COQUARD Cyrille <cyrille@wp-media.me>
Mike <michael@wp-media.me>
Mostafa Hisham <mostafa@wp-media.me>
QA:
Piotr Bąk <piotr@wp-media.me>
Mai Saad <mai@wp-media.me>
Vasilis Manthos <vasilis@wp-media.me>
Previous contributors:
Julio Potier
Gregory Viguier
David Acuna
Caspar Hübinger
Thomas Geisen
Tonya Mork
Arun Basil Lal
Cristina Soponar
Caspar Green
Natalia Drause
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
{"":[{"slug":"wp-super-cache","file":"wp-super-cache\/wp-cache.php"},{"slug":"enable-gzip-compression","file":"enable-gzip-compression\/enable-gzip-compression.php"},{"slug":"quick-cache","file":"quick-cache\/quick-cache.php"},{"slug":"leverage-browser-caching-ninjas","file":"leverage-browser-caching-ninjas\/leverage-browser-caching-ninja.php"},{"slug":"wp-performance-score-booster","file":"wp-performance-score-booster\/wp-performance-score-booster.php"},{"slug":"litespeed-cache","file":"litespeed-cache\/litespeed-cache.php"},{"slug":"remove-query-strings-from-static-resources","file":"remove-query-strings-from-static-resources\/remove-query-strings.php"},{"slug":"wp-http-compression","file":"wp-http-compression\/wp-http-compression.php"},{"slug":"query-strings-remover","file":"query-strings-remover\/query-strings-remover.php"},{"slug":"page-optimize","file":"page-optimize\/page-optimize.php"},{"slug":"speed-booster-pack","file":"speed-booster-pack\/speed-booster-pack.php"},{"slug":"swift-performance","file":"swift-performance\/performance.php"},{"slug":"gzip-ninja-speed-compression","file":"gzip-ninja-speed-compression\/gzip-ninja-speed.php"},{"slug":"super-static-cache","file":"super-static-cache\/super-static-cache.php"},{"slug":"lite-cache","file":"lite-cache\/plugin.php"},{"slug":"hyper-cache","file":"hyper-cache\/plugin.php"},{"slug":"wp-ffpc","file":"wp-ffpc\/wp-ffpc.php"},{"slug":"wp-fast-cache","file":"wp-fast-cache\/wp-fast-cache.php"},{"slug":"psn-pagespeed-ninja","file":"psn-pagespeed-ninja\/pagespeedninja.php"},{"slug":"swift-performance-lite","file":"swift-performance-lite\/performance.php"},{"slug":"force-gzip","file":"force-gzip\/force-gzip.php"},{"slug":"add-expires-headers","file":"add-expires-headers\/add-expires-headers.php"},{"slug":"hyper-cache-extended","file":"hyper-cache-extended\/plugin.php"},{"slug":"gator-cache","file":"gator-cache\/gator-cache.php"},{"slug":"flexicache","file":"flexicache\/wp-plugin.php"},{"slug":"wp-fastest-cache","file":"wp-fastest-cache\/wpFastestCache.php"},{"slug":"wordpress-gzip-compression","file":"wordpress-gzip-compression\/ezgz.php"},{"slug":"wp-optimize","file":"wp-optimize\/wp-optimize.php"},{"slug":"check-and-enable-gzip-compression","file":"check-and-enable-gzip-compression\/richards-toolbox.php"},{"slug":"far-future-expiry-header","file":"far-future-expiry-header\/far-future-expiration.php"},{"slug":"leverage-browser-caching","file":"leverage-browser-caching\/leverage-browser-caching.php"},{"slug":"wpcompressor","file":"wpcompressor\/wpcompressor.php"},{"slug":"combine-css","file":"combine-css\/combine-css.php"},{"slug":"w3-total-cache","file":"w3-total-cache\/w3-total-cache.php"},{"slug":"cache-enabler","file":"cache-enabler\/cache-enabler.php"}],"minify_css||minify_js":[{"slug":"merge-minify-refresh","file":"merge-minify-refresh\/merge-minify-refresh.php"},{"slug":"async-js-and-css","file":"async-js-and-css\/asyncJSandCSS.php"},{"slug":"wp-super-minify","file":"wp-super-minify\/wp-super-minify.php"},{"slug":"fast-velocity-minify","file":"fast-velocity-minify\/fvm.php"},{"slug":"dependency-minification","file":"dependency-minification\/dependency-minification.php"},{"slug":"bwp-minify","file":"bwp-minify\/bwp-minify.php"},{"slug":"minqueue","file":"minqueue\/plugin.php"},{"slug":"scripts-gzip","file":"scripts-gzip\/scripts_gzip.php"},{"slug":"wp-minify","file":"wp-minify\/wp-minify.php"}],"lazyload":[{"slug":"lazy-load","file":"lazy-load\/lazy-load.php"},{"slug":"bj-lazy-load","file":"bj-lazy-load\/bj-lazy-load.php"},{"slug":"jquery-image-lazy-loading","file":"jquery-image-lazy-loading\/jq_img_lazy_load.php"},{"slug":"crazy-lazy","file":"crazy-lazy\/crazy-lazy.php"},{"slug":"specify-image-dimensions","file":"specify-image-dimensions\/specify-image-dimensions.php"},{"slug":"advanced-lazy-load","file":"advanced-lazy-load\/advanced_lazyload.php"}],"minify_js":[{"slug":"wp-js","file":"wp-js\/wp-js.php"},{"slug":"scripts-to-footerphp","file":"scripts-to-footerphp\/scripts-to-footer.php"},{"slug":"combine-js","file":"combine-js\/combine-js.php"},{"slug":"footer-javascript","file":"footer-javascript\/footer-javascript.php"}],"control_heartbeat":[{"slug":"heartbeat-control","file":"heartbeat-control\/heartbeat-control.php"}],"lazyload_iframes":[{"slug":"lazy-load-for-videos","file":"lazy-load-for-videos\/codeispoetry.php"}]}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,69 @@
<?php
defined( 'ABSPATH' ) || exit;
if ( class_exists( 'FlywheelNginxCompat' ) ) {
require WP_ROCKET_3RD_PARTY_PATH . 'hosting/flywheel.php';
}
if ( defined( 'DB_HOST' ) && strpos( DB_HOST, '.wpserveur.net' ) !== false ) {
require WP_ROCKET_3RD_PARTY_PATH . 'hosting/wp-serveur.php';
}
if ( rocket_is_plugin_active( 'sg-cachepress/sg-cachepress.php' ) ) {
require WP_ROCKET_3RD_PARTY_PATH . 'hosting/siteground.php';
}
if ( defined( 'PL_INSTANCE_REF' ) && class_exists( '\Presslabs\Cache\CacheHandler' ) && file_exists( WP_CONTENT_DIR . '/advanced-cache.php' ) ) {
require WP_ROCKET_3RD_PARTY_PATH . 'hosting/presslabs.php';
}
require WP_ROCKET_3RD_PARTY_PATH . 'hosting/pagely.php';
require WP_ROCKET_3RD_PARTY_PATH . 'hosting/nginx.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/slider/meta-slider.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/slider/soliloquy.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/i18n/polylang.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/ecommerce/aelia-currencyswitcher.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/ecommerce/aelia-prices-by-country.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/ecommerce/aelia-tax-display-by-country.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/ecommerce/woocommerce-multilingual.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/ecommerce/woocommerce-currency-converter-widget.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/ecommerce/edd-software-licencing.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/ecommerce/easy-digital-downloads.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/ecommerce/ithemes-exchange.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/ecommerce/jigoshop.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/ecommerce/wpshop.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/ecommerce/give.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/autoptimize.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/envira-gallery.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/cookies/cookie-notice.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/cookies/uk-cookie-consent.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/cookies/eu-cookie-law.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/cookies/weepie-cookie-allow.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/cookies/gdpr.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/rating/kk-star-ratings.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/rating/wp-postratings.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/wp-print.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/buddypress.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/disqus.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/custom-login.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/mobile/wp-appkit.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/seo/premium-seo-pack.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/wp-rest-api.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/page-builder/thrive-visual-editor.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/page-builder/visual-composer.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/security/secupress.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/security/sf-move-login.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/security/wps-hide-login.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/varnish-http-purge.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/thrive-leads.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/mailchimp.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/advanced-custom-fields.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/wp-offload-s3.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/wp-offload-s3-assets.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/s2member.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/sumome.php';
require WP_ROCKET_3RD_PARTY_PATH . 'plugins/nginx-helper.php';
require WP_ROCKET_3RD_PARTY_PATH . 'themes/studiopress.php';
@@ -0,0 +1,80 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Changes the text on the Varnish one-click block.
*
* @since 3.0
* @author Remy Perona
*
* @param array $settings Field settings data.
*
* @return array modified field settings data.
*/
function rocket_flywheel_varnish_field( $settings ) {
$settings['varnish_auto_purge']['title'] = sprintf(
// Translators: %s = Hosting name.
__( 'Your site is hosted on %s, we have enabled Varnish auto-purge for compatibility.', 'rocket' ),
'Flywheel'
);
return $settings;
}
add_filter( 'rocket_varnish_field_settings', 'rocket_flywheel_varnish_field' );
add_filter( 'rocket_display_input_varnish_auto_purge', '__return_false' );
/**
* Allow to purge Varnish on Flywheel websites
*
* @since 2.6.8
*/
add_filter( 'do_rocket_varnish_http_purge', '__return_true' );
add_filter( 'do_rocket_generate_caching_files', '__return_false' );
// Prevent mandatory cookies on hosting with server cache.
add_filter( 'rocket_cache_mandatory_cookies', '__return_empty_array', PHP_INT_MAX );
/**
* Set up the right Varnish IP for Flywheel
*
* @since 2.6.8
* @param array $varnish_ip Varnish IP.
*/
function rocket_varnish_ip_on_flywheel( $varnish_ip ) {
$varnish_ip[] = '127.0.0.1';
return $varnish_ip;
}
add_filter( 'rocket_varnish_ip', 'rocket_varnish_ip_on_flywheel' );
/**
* Remove WP Rocket functions on WP core action hooks to prevent triggering a double cache clear.
*
* @since 3.3.1
* @author Remy Perona
*
* @return void
*/
function rocket_flywheel_remove_partial_purge_hooks() {
// WP core action hooks rocket_clean_post() gets hooked into.
$clean_post_hooks = [
// Disables the refreshing of partial cache when content is edited.
'wp_trash_post',
'delete_post',
'clean_post_cache',
'wp_update_comment_count',
];
// Remove rocket_clean_post() from core action hooks.
array_map(
function ( $hook ) {
remove_action( $hook, 'rocket_clean_post' );
},
$clean_post_hooks
);
remove_filter( 'rocket_clean_files', 'rocket_clean_files_users' );
}
add_action( 'wp_rocket_loaded', 'rocket_flywheel_remove_partial_purge_hooks' );
@@ -0,0 +1,24 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Compatibility with an usual NGINX configuration which include:
* try_files $uri $uri/ /index.php?q=$uri&$args
*
* @since 2.3.9
*
* @param array $query_strings Array of query strings to cache.
*
* @return array Updated array of query strings.
*/
function rocket_better_nginx_compatibility( $query_strings ) {
global $is_nginx;
if ( $is_nginx ) {
$query_strings[] = 'q';
}
return $query_strings;
}
add_filter( 'rocket_cache_query_strings', 'rocket_better_nginx_compatibility' );
@@ -0,0 +1,18 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Call the cache server to purge the cache with Pagely hosting.
*
* @since 2.5.7
*
* @return void
*/
function rocket_clean_pagely() {
if ( class_exists( 'PagelyCachePurge' ) ) {
$purger = new PagelyCachePurge();
$purger->purgeAll();
}
}
add_action( 'after_rocket_clean_domain', 'rocket_clean_pagely' );
@@ -0,0 +1,98 @@
<?php
defined( 'ABSPATH' ) || exit;
require_once WP_CONTENT_DIR . '/advanced-cache.php';
add_action( 'pl_pre_cache_refresh', 'rocket_clean_files', 0 );
add_filter( 'rocket_display_varnish_options_tab', '__return_false' );
add_filter( 'do_rocket_generate_caching_files', '__return_false', PHP_INT_MAX );
add_filter( 'rocket_cache_mandatory_cookies', '__return_empty_array', PHP_INT_MAX );
add_action( 'after_rocket_clean_home', 'rocket_pl_clean_home', 10, 2 );
add_action( 'after_rocket_clean_file', 'rocket_pl_clean_post', 2 );
add_action( 'pl_pre_url_button_cache_refresh', 'rocket_clean_files' );
add_action( 'wp_rocket_loaded', 'rocket_pl_remove_partial_purge_hooks' );
/**
* We clear the cache only on the post, homepage and listings when creating/updating/deleting posts.
*
* @since 3.3
*
* @param object $post The Post object itself for which the action occured.
* @param array $permalink A list of permalinks to be flushed from cache.
*
* @return void
*/
function rocket_pl_clean_post( $post = false, $permalink = false ) {
if ( ! $post || ! $permalink ) {
return;
}
$cache_handler = new \Presslabs\Cache\CacheHandler();
$cache_handler->invalidate_url( $permalink[0], true );
$cache_handler->invalidate_url( home_url( '/' ), true );
$cache_handler->purge_cache( 'listing' );
}
/**
* We clear the cache for the homepage URL when using "Purge this URL" from the admin bar on the front end.
*
* @since 3.3
*
* @param string $root WP Rocket root cache path.
* @param string $lang Current language.
*
* @return void
*/
function rocket_pl_clean_home( $root = false, $lang = false ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
if ( ! $post || ! $permalink ) {
return;
}
$cache_handler = new \Presslabs\Cache\CacheHandler();
$cache_handler->invalidate_url( home_url( '/' ), true );
}
/**
* Remove WP Rocket functions on WP core action hooks to prevent triggering a double cache clear.
*
* @since 3.3
*
* @return void
*/
function rocket_pl_remove_partial_purge_hooks() {
// WP core action hooks rocket_clean_post() gets hooked into.
$clean_post_hooks = [
// Disables the refreshing of partial cache when content is edited.
'wp_trash_post',
'delete_post',
'clean_post_cache',
'wp_update_comment_count',
];
// Remove rocket_clean_post() from core action hooks.
array_map(
function ( $hook ) {
remove_action( $hook, 'rocket_clean_post' );
},
$clean_post_hooks
);
remove_filter( 'rocket_clean_files', 'rocket_clean_files_users' );
}
if ( ! defined( 'DISABLE_CDN_OFFLOAD' ) && defined( 'PL_CDN_HOST' ) ) {
/**
* If we have CDN enabled we'll add our HOST to the list.
*
* @since 3.3
*
* @param array $hosts Array of CDN hosts.
*
* @return array Updated array of CDN hosts
*/
function rocket_add_pl_cdn( $hosts ) {
$hosts[] = constant( 'PL_CDN_HOST' );
return $hosts;
}
add_filter( 'rocket_cdn_cnames', 'rocket_add_pl_cdn', 1 );
}
@@ -0,0 +1,108 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Returns the current version of the SG Optimizer plugin.
*
* @since 3.2.3.1
* @author Remy Perona
*
* @return string version number.
*/
function rocket_get_sg_optimizer_version() {
static $version;
if ( isset( $version ) ) {
return $version;
}
$sg_optimizer = get_file_data( WP_PLUGIN_DIR . '/sg-cachepress/sg-cachepress.php', [ 'Version' => 'Version' ] );
$version = $sg_optimizer['Version'];
return $version;
}
/**
* Checks if SG Optimizer Supercache is active.
*
* @since 3.2.3.1
* @author Remy Perona
*
* @return bool
*/
function rocket_is_supercacher_active() {
if ( ! version_compare( rocket_get_sg_optimizer_version(), '5.0' ) < 0 ) {
global $sg_cachepress_environment;
return isset( $sg_cachepress_environment ) && $sg_cachepress_environment instanceof SG_CachePress_Environment && $sg_cachepress_environment->cache_is_enabled();
}
return (bool) get_option( 'siteground_optimizer_enable_cache', 0 );
}
/**
* Call the cache server to purge the cache with SuperCacher (SiteGround).
*
* @since 2.3
*
* @return void
*/
function rocket_clean_supercacher() {
if ( ! rocket_is_supercacher_active() ) {
return;
}
if ( ! version_compare( rocket_get_sg_optimizer_version(), '5.0' ) < 0 ) {
SiteGround_Optimizer\Supercacher\Supercacher::purge_cache();
} elseif ( isset( $sg_cachepress_supercacher ) && $sg_cachepress_supercacher instanceof SG_CachePress_Supercacher ) {
$sg_cachepress_supercacher->purge_cache();
}
}
/**
* Clean WP Rocket cache when cleaning SG cache
*
* @return void
*/
function rocket_sg_clear_cache() {
if ( empty( $_GET['_wpnonce'] ) ) {
return;
}
if ( ! wp_verify_nonce( sanitize_key( $_GET['_wpnonce'] ), 'sg-cachepress-purge' ) ) {
return;
}
if ( ! current_user_can( 'rocket_purge_cache' ) ) {
return;
}
rocket_clean_domain();
}
if ( rocket_is_supercacher_active() ) {
add_action( 'admin_post_sg-cachepress-purge', 'rocket_sg_clear_cache', 0 );
add_action( 'after_rocket_clean_domain', 'rocket_clean_supercacher' );
add_filter( 'rocket_display_varnish_options_tab', '__return_false' );
// Prevent mandatory cookies on hosting with server cache.
add_filter( 'rocket_cache_mandatory_cookies', '__return_empty_array', PHP_INT_MAX );
/**
* Force WP Rocket caching on SG Optimizer versions before 4.0.5.
*
* @since 3.0.4
* @author Arun Basil Lal
*
* @link https://github.com/wp-media/wp-rocket/issues/925
*/
if ( version_compare( rocket_get_sg_optimizer_version(), '4.0.5' ) < 0 ) {
add_filter( 'do_rocket_generate_caching_files', '__return_true', 11 );
}
if ( version_compare( rocket_get_sg_optimizer_version(), '5.0' ) < 0 ) {
add_action( 'wp_ajax_sg-cachepress-purge', 'rocket_sg_clear_cache', 0 );
} else {
add_action( 'wp_ajax_admin_bar_purge_cache', 'rocket_sg_clear_cache', 0 );
}
}
@@ -0,0 +1,35 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Allow to purge Varnish on WP Serveur websites.
*
* @since 2.6.11
*/
add_filter( 'do_rocket_varnish_http_purge', '__return_true' );
// Prevent mandatory cookies on hosting with server cache.
add_filter( 'rocket_cache_mandatory_cookies', '__return_empty_array', PHP_INT_MAX );
/**
* Changes the text on the Varnish one-click block.
*
* @since 3.0
* @author Remy Perona
*
* @param array $settings Field settings data.
*
* @return array modified field settings data.
*/
function rocket_wpserveur_varnish_field( $settings ) {
$settings['varnish_auto_purge']['title'] = sprintf(
// Translators: %s = Hosting name.
__( 'Your site is hosted on %s, we have enabled Varnish auto-purge for compatibility.', 'rocket' ),
'WP Serveur'
);
return $settings;
}
add_filter( 'rocket_varnish_field_settings', 'rocket_wpserveur_varnish_field' );
add_filter( 'rocket_display_input_varnish_auto_purge', '__return_false' );
@@ -0,0 +1,18 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Clear cache when ACF options page is updated.
*
* @since 2.10.7
* @author Remy Perona
*
* @param string $post_id ACF options page ID is 'options'.
*/
function rocket_clear_cache_on_acf_options_save( $post_id ) {
if ( 'options' === $post_id ) {
rocket_clean_domain();
}
}
add_action( 'acf/save_post', 'rocket_clear_cache_on_acf_options_save' );
@@ -0,0 +1,167 @@
<?php
defined( 'ABSPATH' ) || exit;
if ( class_exists( 'autoptimizeCache' ) ) :
/**
* Deactivate WP Rocket lazyload if Autoptimize lazyload is enabled
*
* @since 3.3.4
*
* @param string $old_value Previous autoptimize option value.
* @param string $value New autoptimize option value.
* @return void
*/
function rocket_maybe_deactivate_lazyload( $old_value, $value ) {
if ( empty( $old_value['autoptimize_imgopt_checkbox_field_3'] ) && ! empty( $value['autoptimize_imgopt_checkbox_field_3'] ) ) {
update_rocket_option( 'lazyload', 0 );
}
}
add_action( 'update_option_autoptimize_imgopt_settings', 'rocket_maybe_deactivate_lazyload', 10, 2 );
/**
* Improvement with Autoptimize: clear the cache when Autoptimize's cache is cleared
*
* @since 2.7
*/
add_action( 'autoptimize_action_cachepurged', 'rocket_clean_domain' );
endif;
if ( class_exists( 'autoptimizeConfig' ) ) :
/**
* Deactivate WP Rocket CSS Minification if Autoptimize CSS minification is enabled
*
* @since 2.9.5
* @author Remy Perona
*
* @param string $old_value Previous autoptimize option value.
* @param string $value New autoptimize option value.
*/
function rocket_maybe_deactivate_minify_css( $old_value, $value ) {
if ( $value !== $old_value && 'on' === $value ) {
update_rocket_option( 'minify_css', 0 );
}
}
add_action( 'update_option_autoptimize_css', 'rocket_maybe_deactivate_minify_css', 10, 2 );
/**
* Deactivate WP Rocket JS Minification if Autoptimize JS minification is enabled
*
* @since 2.9.5
* @author Remy Perona
*
* @param string $old_value Previous autoptimize option value.
* @param string $value New autoptimize option value.
*/
function rocket_maybe_deactivate_minify_js( $old_value, $value ) {
if ( $value !== $old_value && 'on' === $value ) {
update_rocket_option( 'minify_js', 0 );
update_rocket_option( 'minify_concatenate_js', 0 );
}
}
add_action( 'update_option_autoptimize_js', 'rocket_maybe_deactivate_minify_js', 10, 2 );
/**
* Deactivate WP Rocket async CSS if Autoptimize async CSS is enabled
*
* @since 2.10
* @author Remy Perona
*
* @param string $old_value Previous autoptimize option value.
* @param string $value New autoptimize option value.
*/
function rocket_maybe_deactivate_css_defer( $old_value, $value ) {
if ( $value !== $old_value && 'on' === $value ) {
update_rocket_option( 'autoptimize_css_defer', 0 );
}
}
add_action( 'update_option_autoptimize_css_defer', 'rocket_maybe_deactivate_css_defer', 10, 2 );
endif;
/**
* Disable WP Rocket minification options when activating Autoptimize and values are already in the database.
*
* @since 2.9.5
* @author Remy Perona
*/
function rocket_activate_autoptimize() {
if ( 'on' === get_option( 'autoptimize_css' ) ) {
update_rocket_option( 'minify_css', 0 );
}
if ( 'on' === get_option( 'autoptimize_js' ) ) {
update_rocket_option( 'minify_js', 0 );
update_rocket_option( 'minify_concatenate_js', 0 );
}
if ( 'on' === get_option( 'autoptimize_css_defer' ) ) {
update_rocket_option( 'async_css', 0 );
}
$lazyload = get_option( 'autoptimize_imgopt_settings' );
if ( ! empty( $lazyload['autoptimize_imgopt_checkbox_field_3'] ) ) {
update_rocket_option( 'lazyload', 0 );
}
}
add_action( 'activate_autoptimize/autoptimize.php', 'rocket_activate_autoptimize', 11 );
/**
* Disable WP Rocket lazyload fields if Autoptimize lazyload is enabled
*
* @since 3.3.4
*
* @return bool
*/
function rocket_maybe_disable_lazyload() {
$lazyload = get_option( 'autoptimize_imgopt_settings' );
if ( is_plugin_active( 'autoptimize/autoptimize.php' ) && ! empty( $lazyload['autoptimize_imgopt_checkbox_field_3'] ) ) {
return true;
}
return false;
}
/**
* Disable WP Rocket CSS minification field if Autoptimize CSS minification is enabled
*
* @since 2.9.5
* @author Remy Perona
*
* @return bool|null True if it is active
*/
function rocket_maybe_disable_minify_css() {
if ( is_plugin_active( 'autoptimize/autoptimize.php' ) && 'on' === get_option( 'autoptimize_css' ) ) {
return true;
}
}
/**
* Disable WP Rocket JS minification field if Autoptimize JS minification is enabled
*
* @since 2.9.5
* @author Remy Perona
*
* @return bool|null True if it is active
*/
function rocket_maybe_disable_minify_js() {
if ( is_plugin_active( 'autoptimize/autoptimize.php' ) && 'on' === get_option( 'autoptimize_js' ) ) {
return true;
}
}
/**
* Disable WP Rocket async CSS field if Autoptimize async CSS is enabled
*
* @since 2.10
* @author Remy Perona
*
* @return bool|null True if it is active
*/
function rocket_maybe_disable_async_css() {
if ( is_plugin_active( 'autoptimize/autoptimize.php' ) && 'on' === get_option( 'autoptimize_css_defer' ) ) {
return true;
}
}
@@ -0,0 +1,47 @@
<?php
defined( 'ABSPATH' ) || exit;
if ( class_exists( 'BuddyPress' ) ) :
/**
* Conflict with BuddyPress: don't apply LazyLoad on BuddyPress profil pages & group creation
*
* @since 2.8.15 Improve checks for user profile & disable for cover images
* @since 2.6.9
*/
if ( function_exists( 'bp_is_user_profile' ) ) :
/**
* Prevent lazyload if on a BuddyPress profil page
*
* @param Bool $run_filter Do lazyload value.
* @return Bool False if on a BuddyPress profil page, initial value otherwise
*/
function rocket_deactivate_lazyload_on_buddypress_profil_pages( $run_filter ) {
if ( bp_is_user_profile() ) {
return false;
}
return $run_filter;
}
add_filter( 'do_rocket_lazyload', 'rocket_deactivate_lazyload_on_buddypress_profil_pages' );
add_filter( 'do_rocket_lazyload_iframes', 'rocket_deactivate_lazyload_on_buddypress_profil_pages' );
endif;
if ( function_exists( 'bp_is_group_creation_step' ) && function_exists( 'bp_is_group_admin_screen' ) ) :
/**
* Prevent lazyload if on a BuddyPress group creation page
*
* @param Bool $run_filter Do lazyload value.
* @return Bool False if on a BuddyPress profil page, initial value otherwise
*/
function rocket_deactivate_lazyload_on_buddypress_group_pages( $run_filter ) {
if ( bp_is_group_creation_step( 'group-avatar' ) || bp_is_group_creation_step( 'group-cover-image' ) || bp_is_group_admin_screen( 'group-avatar' ) || bp_is_group_admin_screen( 'group-cover-image' ) ) {
return false;
}
return $run_filter;
}
add_filter( 'do_rocket_lazyload', 'rocket_deactivate_lazyload_on_buddypress_group_pages' );
add_filter( 'do_rocket_lazyload_iframes', 'rocket_deactivate_lazyload_on_buddypress_group_pages' );
endif;
endif;
@@ -0,0 +1,81 @@
<?php
/**
* Compatibility with Cookie Notice by dFactory.
*
* @since 2.11.6
* @author Arun Basil Lal
* @link https://wordpress.org/plugins/cookie-notice/
*/
defined( 'ABSPATH' ) || exit;
if ( class_exists( 'Cookie_Notice' ) ) {
// Don't add the WP Rocket rewrite rules to avoid issues.
if ( ! class_exists( 'CC4R_options' ) || ! CC4R_options::rewrite_enabled() ) {
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 56 );
}
// Create cache version based on value set in cookie_notice_accepted cookie.
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_get_cookie_notice_cookie' );
}
/**
* Return the cookie name set by Cookie Notice plugin.
*
* @since 2.11.6
* @author Arun Basil Lal
*
* @param array $cookies List of dynamic cookies.
* @return array List of dynamic cookies with the Cookie Notice cookie appended.
*/
function rocket_get_cookie_notice_cookie( $cookies ) {
$cookies[] = 'cookie_notice_accepted';
return $cookies;
}
/**
* Add dynamic cookie and mandatory cookie when Cookie Notice plugin is activated.
*
* @since 2.11.6
* @author Arun Basil Lal
*/
function rocket_add_cookie_notice_dynamic_cookie() {
// Don't add the WP Rocket rewrite rules to avoid issues.
if ( ! class_exists( 'CC4R_options' ) || ! CC4R_options::rewrite_enabled() ) {
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 56 );
}
// Create cache version based on value set in cookie_notice_accepted cookie.
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_get_cookie_notice_cookie' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
// Clear WP Rocket cache.
rocket_clean_domain();
}
add_action( 'activate_cookie-notice/cookie-notice.php', 'rocket_add_cookie_notice_dynamic_cookie', 11 );
/**
* Remove dynamic cookie when Cookie Notice plugin is deactivated.
*
* @since 2.11.6
* @author Arun Basil Lal
*/
function rocket_remove_cookie_notice_dynamic_cookie() {
if ( ! class_exists( 'CC4R_options' ) || ! CC4R_options::rewrite_enabled() ) {
remove_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 56 );
}
remove_filter( 'rocket_cache_dynamic_cookies', 'rocket_get_cookie_notice_cookie' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
// Clear WP Rocket cache.
rocket_clean_domain();
}
add_action( 'deactivate_cookie-notice/cookie-notice.php', 'rocket_remove_cookie_notice_dynamic_cookie', 11 );
@@ -0,0 +1,89 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Compatibility with EU Cookie Law
* https://wordpress.org/plugins/eu-cookie-law/
*
* @since 2.7
*/
if ( function_exists( 'eucookie_start' ) ) :
add_filter( 'rocket_cache_mandatory_cookies', 'rocket_add_eu_cookie_law_mandatory_cookie' );
/**
* Update .htaccess & config files when the "Activate" and "Autoblock" options are turned on
*
* @since 2.7
*
* @param Array $old_value Array of previous values.
* @param Array $value Array of submitted values.
*/
function rocket_after_update_eu_cookie_law_options( $old_value, $value ) {
if ( ( isset( $old_value['enabled'], $value['enabled'] ) && ( $old_value['enabled'] === $value['enabled'] ) ) && isset( $old_value['autoblock'], $value['autoblock'] ) && $old_value['autoblock'] === $value['autoblock'] ) {
return;
}
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Update the config file.
rocket_generate_config_file();
}
add_action( 'update_option_peadig_eucookie', 'rocket_after_update_eu_cookie_law_options', 10, 2 );
// Don't add the WP Rocket rewrite rules to avoid issues.
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 58 );
endif;
/**
* Add mandatory cookie when we activate the plugin
*
* @since 2.7
*/
function rocket_activate_eu_cookie_law() {
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 58 );
add_filter( 'rocket_cache_mandatory_cookies', 'rocket_add_eu_cookie_law_mandatory_cookie' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'activate_eu-cookie-law/eu-cookie-law.php', 'rocket_activate_eu_cookie_law', 11 );
/**
* Remove mandatory cookie when we deactivate the plugin
*
* @since 2.7
*/
function rocket_deactivate_eu_cookie_law() {
remove_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 58 );
remove_filter( 'rocket_cache_mandatory_cookies', 'rocket_add_eu_cookie_law_mandatory_cookie' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'deactivate_eu-cookie-law/eu-cookie-law.php', 'rocket_deactivate_eu_cookie_law', 11 );
/**
* Add the EU Cookie Law to the list of mandatory cookies before generating caching files.
*
* @since 2.7
*
* @param Array $cookies Array of mandatory cookies.
* @return Array Updated array of mandatory cookies
*/
function rocket_add_eu_cookie_law_mandatory_cookie( $cookies ) {
$options = get_option( 'peadig_eucookie' );
if ( ! empty( $options['enabled'] ) && ! empty( $options['autoblock'] ) ) {
$cookies['eu-cookie-law'] = 'euCookie';
}
return $cookies;
}
@@ -0,0 +1,87 @@
<?php
/**
* Compatibility with GDPR by Trew Knowledge
*
* @link https://github.com/trewknowledge/GDPR/
* @link https://wordpress.org/plugins/gdpr/
*/
defined( 'ABSPATH' ) || exit;
if ( class_exists( 'GDPR' ) ) {
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 60 );
// Create cache version based on value set in gdpr[] cookies.
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_get_gdpr_dynamic_cookies' );
}
/**
* Return the cookie names set by GDPR plugin
*
* @since 3.1.4
* @author jorditarrida
*
* @param array $cookies array List of dynamic cookies.
* @return array List of dynamic cookies with the GDPR cookie appended
*/
function rocket_get_gdpr_mandatory_cookies( $cookies ) {
$cookies[] = 'allowed_cookies';
$cookies[] = 'consent_types';
return $cookies;
}
/**
* Return the cookie names set by GDPR plugin
*
* @since 3.1.4
* @author jorditarrida
*
* @param array $cookies array List of dynamic cookies.
* @return array List of dynamic cookies with the GDPR cookie appended
*/
function rocket_get_gdpr_dynamic_cookies( $cookies ) {
$cookies['gdpr'] = [
'allowed_cookies',
'consent_types',
];
return $cookies;
}
/**
* Add dynamic cookie when GDPR plugin is activated
*
* @since 3.1.4
* @author jorditarrida
*/
function rocket_add_gdpr_mandatory_cookies() {
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 60 );
// Create cache version based on value set in GDPR cookies.
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_get_gdpr_dynamic_cookies' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
// Clear WP Rocket cache.
rocket_clean_domain();
}
add_action( 'activate_gdpr/gdpr.php', 'rocket_add_gdpr_mandatory_cookies', 11 );
/**
* Remove dynamic cookie when GDPR plugin is deactivated.
*
* @since 3.1.4
* @author jorditarrida
*/
function rocket_remove_gdpr_mandatory_cookies() {
remove_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 60 );
// Delete the dynamic cookie filter.
remove_filter( 'rocket_cache_dynamic_cookies', 'rocket_get_gdpr_dynamic_cookies' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
// Clear WP Rocket cache.
rocket_clean_domain();
}
add_action( 'deactivate_gdpr/gdpr.php', 'rocket_remove_gdpr_mandatory_cookies', 11 );
@@ -0,0 +1,73 @@
<?php
/**
* Compatibility with UK Cookie Consent.
*
* @since 3.2
* @author TheZoker
* @link https://wordpress.org/plugins/uk-cookie-consent/
*/
defined( 'ABSPATH' ) || exit;
if ( class_exists( 'CTCC_Public' ) ) {
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 62 );
// Create cache version based on value set in cookie_consent_accepted cookie.
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_get_cookie_uk_consent_cookie' );
}
/**
* Return the cookie name set by UK Cookie Consent plugin.
*
* @since 3.2
* @author TheZoker
*
* @param array $cookies List of dynamic cookies.
* @return array List of dynamic cookies with the UK Cookie Consent cookie appended.
*/
function rocket_get_cookie_uk_consent_cookie( $cookies ) {
$cookies[] = 'catAccCookies';
return $cookies;
}
/**
* Add dynamic cookie and mandatory cookie when UK Cookie Consent plugin is activated.
*
* @since 3.2
* @author TheZoker
*/
function rocket_add_uk_cookie_consent_dynamic_cookie() {
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 62 );
// Create cache version based on value set in cookie_consent_accepted cookie.
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_get_cookie_uk_consent_cookie' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
// Clear WP Rocket cache.
rocket_clean_domain();
}
add_action( 'activate_uk-cookie-consent/uk-cookie-consent.php', 'rocket_add_uk_cookie_consent_dynamic_cookie', 11 );
/**
* Remove dynamic cookie when Cookie Consent plugin is deactivated.
*
* @since 3.2
* @author TheZoker
*/
function rocket_remove_uk_cookie_consent_dynamic_cookie() {
remove_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 62 );
remove_filter( 'rocket_cache_dynamic_cookies', 'rocket_get_cookie_uk_consent_cookie' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
// Clear WP Rocket cache.
rocket_clean_domain();
}
add_action( 'deactivate_uk-cookie-consent/uk-cookie-consent.php', 'rocket_remove_uk_cookie_consent_dynamic_cookie', 11 );
@@ -0,0 +1,53 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Compatibility with WeePie Cookie Allow
*
* @since 2.9
*/
if ( class_exists( 'WpieCookieAllow' ) ) :
add_action( 'update_option_wpca_settings_general', 'rocket_after_update_wp_cookie_allow_options', 10, 2 );
add_action( 'update_option_wpca_settings_style', 'rocket_after_update_wp_cookie_allow_options', 10, 2 );
add_action( 'update_option_wpca_settings_content', 'rocket_after_update_wp_cookie_allow_options', 10, 2 );
add_action( 'update_option_wpca_settings_consent_log', 'rocket_after_update_wp_cookie_allow_options', 10, 2 );
endif;
/**
* Update .htaccess & config files when the "Enabled" and "Autoblock" options are turned on.
*
* @since 2.9
* @author Remy Perona
*
* @param array $old_value Previous values for the plugin options.
* @param array $value New values for the plugin options.
*/
function rocket_after_update_wp_cookie_allow_options( $old_value, $value ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
// clear the cache because WeePie Cookie Allow plugin settings might have been changed.
rocket_clean_domain();
}
/**
* Add cookies when we activate the plugin.
*
* @since 2.9
* @author Remy Perona
*/
function rocket_activate_wp_cookie_allow() {
// clear the cache because plugin might be enabled already before.
rocket_clean_domain();
}
add_action( 'activate_wp-cookie-allow/wp-cookie-allow.php', 'rocket_activate_wp_cookie_allow', 11 );
/**
* Remove cookies when we deactivate the plugin
*
* @since 2.9
* @author Remy Perona
*/
function rocket_deactivate_wp_cookie_allow() {
// clear the cache because the bar/box and other WeePie Cookie Allow plugin frontend HTML is not needed anymore.
rocket_clean_domain();
}
add_action( 'deactivate_wp-cookie-allow/wp-cookie-allow.php', 'rocket_deactivate_wp_cookie_allow', 11 );
@@ -0,0 +1,68 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Exclude plugin custom login page template from cache.
*
* @since 2.7
*/
if ( class_exists( 'Custom_Login_Page_Template' ) ) {
add_filter( 'rocket_cache_reject_uri', 'rocket_add_custom_login_exclude_pages', 2, 2 );
add_action( 'update_option_custom_login_page_template', 'rocket_after_update_single_options', 10, 2 );
}
/**
* Add custom login page to excluded urls array
*
* @since 2.7
* @author Remy Perona
*
* @param Array $urls Array of pages to exclude.
* @param bool $show_safe_content show sensitive uris.
* @return Array Updated array of pages to exclude
*/
function rocket_add_custom_login_exclude_pages( $urls, $show_safe_content = true ) {
if ( ! $show_safe_content ) {
return $urls;
}
$clpt_options = get_option( 'custom_login_page_template' );
$urls = array_merge( $urls, get_rocket_i18n_translated_post_urls( $clpt_options['login_page_id'], 'page' ) );
return $urls;
}
/**
* Add custom login page to excluded urls array on plugin activation
*
* @since 2.7
* @author Remy Perona
*/
function rocket_activate_custom_login_page_template() {
add_filter( 'rocket_cache_reject_uri', 'rocket_add_custom_login_exclude_pages', 2, 2 );
// Update the WP Rocket rules on the .htaccess.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'activate_custom-login-page-template/custom-login-page-template.php', 'rocket_activate_custom_login_page_template', 11 );
/**
* Remove custom login page from excluded urls array on plugin activation
*
* @since 2.7
* @author Remy Perona
*/
function rocket_remove_custom_login_exclude_pages() {
remove_filter( 'rocket_cache_reject_uri', 'rocket_add_custom_login_exclude_pages' );
// Update the WP Rocket rules on the .htaccess.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'deactivate_custom-login-page-template/custom-login-page-template.php', 'rocket_remove_custom_login_exclude_pages', 11 );
@@ -0,0 +1,22 @@
<?php
defined( 'ABSPATH' ) || exit;
if ( defined( 'DISQUS_VERSION' ) ) :
/**
* Excludes Disqus scripts from JS minification
*
* @since 2.9
* @author Remy Perona
*
* @param Array $excluded_js An array of JS handles enqueued in WordPress.
* @return Array the updated array of handles
*/
function rocket_exclude_js_disqus( $excluded_js ) {
$excluded_js[] = str_replace( home_url(), '', plugins_url( '/disqus-comment-system/media/js/disqus.js' ) );
$excluded_js[] = str_replace( home_url(), '', plugins_url( '/disqus-comment-system/media/js/count.js' ) );
return $excluded_js;
}
add_filter( 'rocket_exclude_js', 'rocket_exclude_js_disqus' );
endif;
@@ -0,0 +1,106 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Compatibility with Aelia Currency Switcher.
*
* @since 2.7
*/
if ( class_exists( 'WC_Aelia_CurrencySwitcher' ) ) :
/**
* Update .htaccess & config files when the Geolocation option is updated
*
* @since 2.7
*
* @param array $old_value Previous setting values.
* @param array $value Submitted settings values.
*/
function rocket_after_update_aelia_currencyswitcher_options( $old_value, $value ) {
if ( ( ! isset( $old_value['ipgeolocation_enabled'] ) && isset( $value['ipgeolocation_enabled'] ) ) || ( isset( $old_value['ipgeolocation_enabled'], $value['ipgeolocation_enabled'] ) && $old_value['ipgeolocation_enabled'] !== $value['ipgeolocation_enabled'] )
) {
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Update the config file.
rocket_generate_config_file();
}
}
add_action( 'update_option_wc_aelia_currency_switcher', 'rocket_after_update_aelia_currencyswitcher_options', 10, 2 );
/**
* Generate a caching file depending on the currency cookie value
*/
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 64 );
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_add_aelia_currencyswitcher_dynamic_cookies' );
add_filter( 'rocket_cache_mandatory_cookies', 'rocket_add_aelia_currencyswitcher_mandatory_cookie' );
endif;
/**
* Add the Aelia Currency Switcher cookies when activating the plugin
*
* @since 2.7
*/
function rocket_activate_aelia_currencyswitcher() {
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 64 );
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_add_aelia_currencyswitcher_dynamic_cookies' );
add_filter( 'rocket_cache_mandatory_cookies', 'rocket_add_aelia_currencyswitcher_mandatory_cookie' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'activate_woocommerce-aelia-currencyswitcher/woocommerce-aelia-currencyswitcher.php', 'rocket_activate_aelia_currencyswitcher', 11 );
/**
* Remove the Aelia Currency Switcher cookies when deactivating the plugin
*
* @since 2.7
*/
function rocket_deactivate_aelia_currencyswitcher() {
remove_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 64 );
remove_filter( 'rocket_cache_dynamic_cookies', 'rocket_add_aelia_currencyswitcher_dynamic_cookies' );
remove_filter( 'rocket_cache_mandatory_cookies', 'rocket_add_aelia_currencyswitcher_mandatory_cookie' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'deactivate_woocommerce-aelia-currencyswitcher/woocommerce-aelia-currencyswitcher.php', 'rocket_deactivate_aelia_currencyswitcher', 11 );
/**
* Add the Aelia Currency Switcher cookies to the dynamic cookies list
*
* @since 2.7
*
* @param array $cookies Cookies to use for dynamic caching.
* @return array Updated cookies list
*/
function rocket_add_aelia_currencyswitcher_dynamic_cookies( $cookies ) {
$cookies[] = 'aelia_cs_recalculate_cart_totals';
$cookies[] = 'aelia_cs_selected_currency';
$cookies[] = 'aelia_customer_country';
return $cookies;
}
/**
* Add the Aelia Currency Switcher to the list of mandatory cookies before generating caching files
*
* @since 2.7
*
* @param array $cookies Mandatory cookies to serve the cache.
* @return array Updated cookies list
*/
function rocket_add_aelia_currencyswitcher_mandatory_cookie( $cookies ) {
$acs_options = get_option( 'wc_aelia_currency_switcher' );
if ( ! empty( $acs_options['ipgeolocation_enabled'] ) ) {
$cookies[] = 'aelia_cs_selected_currency';
}
return $cookies;
}
@@ -0,0 +1,66 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Compatibility with Aelia Prices by Country.
*
* @since 2.8.15
*/
if ( class_exists( 'Aelia\WC\PricesByCountry\WC_Aelia_Prices_By_Country' ) ) :
/**
* Generate a caching file depending on the country cookie value
*/
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 66 );
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_add_aelia_prices_by_country_dynamic_cookies' );
endif;
/**
* Add cookie when we activate the plugin
*
* @since 2.8.15
* @author Remy Perona
*/
function rocket_activate_aelia_prices_by_country() {
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 66 );
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_add_aelia_prices_by_country_dynamic_cookies' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'activate_woocommerce-prices-by-country/woocommerce-prices-by-country.php', 'rocket_activate_aelia_prices_by_country', 11 );
/**
* Remove cookies when we deactivate the plugin
*
* @since 2.8.15
* @author Remy Perona
*/
function rocket_deactivate_aelia_prices_by_country() {
remove_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 66 );
remove_filter( 'rocket_cache_dynamic_cookies', 'rocket_add_aelia_prices_by_country_dynamic_cookies' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'deactivate_woocommerce-prices-by-country/woocommerce-prices-by-country.php', 'rocket_deactivate_aelia_prices_by_country', 11 );
/**
* Add the Aelia Prices by Country cookie to generate caching files depending on its value
*
* @since 2.8.15
* @author Remy Perona
*
* @param array $cookies Cookies list to use for dynamic caching.
* @return array Updated cookies list
*/
function rocket_add_aelia_prices_by_country_dynamic_cookies( $cookies ) {
$cookies[] = 'aelia_customer_country';
return $cookies;
}
@@ -0,0 +1,69 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Compatibility with Aelia Tax Display by Country.
*
* @since 2.8.15
*/
if ( class_exists( 'Aelia\WC\TaxDisplayByCountry\WC_Aelia_Tax_Display_By_Country' ) ) :
/**
* Generate a caching file depending to the tax display cookie values
*/
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 68 );
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_add_aelia_tax_display_by_country_dynamic_cookies' );
endif;
/**
* Add cookies when we activate the plugin
*
* @since 2.8.15
* @author Remy Perona
*/
function rocket_activate_aelia_tax_display_by_country() {
add_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 68 );
add_filter( 'rocket_cache_dynamic_cookies', 'rocket_add_aelia_tax_display_by_country_dynamic_cookies' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'activate_woocommerce-tax-display-by-country/woocommerce-tax-display-by-country.php', 'rocket_activate_aelia_tax_display_by_country', 11 );
/**
* Remove cookies when we deactivate the plugin
*
* @since 2.8.15
* @author Remy Perona
*/
function rocket_deactivate_aelia_tax_display_by_country() {
remove_filter( 'rocket_htaccess_mod_rewrite', '__return_false', 68 );
remove_filter( 'rocket_cache_dynamic_cookies', 'rocket_add_aelia_tax_display_by_country_dynamic_cookies' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'deactivate_woocommerce-tax-display-by-country/woocommerce-tax-display-by-country.php', 'rocket_deactivate_aelia_tax_display_by_country', 11 );
/**
* Add the Aelia Tax Display by Country cookies to generate caching files depending on their values
*
* @since 2.8.15
* @author Remy Perona
*
* @param array $cookies Cookies list to use for dynamic caching.
* @return array Updated cookies list
*/
function rocket_add_aelia_tax_display_by_country_dynamic_cookies( $cookies ) {
$cookies[] = 'aelia_customer_country';
$cookies[] = 'aelia_customer_state';
$cookies[] = 'aelia_tax_exempt';
return $cookies;
}
@@ -0,0 +1,52 @@
<?php
defined( 'ABSPATH' ) || exit;
if ( function_exists( 'EDD' ) ) :
add_filter( 'rocket_cache_reject_uri', 'rocket_exclude_edd_pages' );
add_action( 'update_option_edd_settings', 'rocket_after_update_array_options', 10, 2 );
endif;
/**
* Exclude EDD pages from cache
*
* @param array $urls Array of URLs to exclude from cache.
* @return array Updated array of URLs
*/
function rocket_exclude_edd_pages( $urls ) {
$edd_settings = get_option( 'edd_settings' );
if ( isset( $edd_settings['purchase_page'] ) ) {
$checkout_urls = get_rocket_i18n_translated_post_urls( $edd_settings['purchase_page'], 'page', '(.*)' );
$urls = array_merge( $urls, $checkout_urls );
}
return $urls;
}
/**
* Exclude EDD pages from cache on EDD activation.
*/
function rocket_activate_edd() {
add_filter( 'rocket_cache_reject_uri', 'rocket_exclude_edd_pages' );
// Update .htaccess file rules.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'activate_easy-digital-downloads/easy-digital-downloads.php', 'rocket_activate_edd', 11 );
/**
* Remove EDD pages from cache exclusion on EDD deactivation.
*/
function rocket_deactivate_edd() {
remove_filter( 'rocket_cache_reject_uri', 'rocket_exclude_edd_pages' );
// Update .htaccess file rules.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'deactivate_easy-digital-downloads/easy-digital-downloads.php', 'rocket_deactivate_edd', 11 );
@@ -0,0 +1,58 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Compatibility with Easy Digital Downloads Software Licensing addon.
*
* @since 2.7
*/
if ( class_exists( 'EDD_Software_Licensing' ) && defined( 'EDD_SL_VERSION' ) ) :
// Exclude EDD SL endpoint from cache on WP Rocket activation.
add_filter( 'rocket_cache_reject_uri', 'rocket_exclude_edd_sl_endpoint' );
endif;
/**
* Exclude EDD SL endpoint from cache when activating the plugin
*
* @since 2.7
*/
function rocket_activate_edd_software_licensing() {
add_filter( 'rocket_cache_reject_uri', 'rocket_exclude_edd_sl_endpoint' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'activate_edd-software-licensing/edd-software-licenses.php', 'rocket_activate_edd_software_licensing', 11 );
/**
* Remove exclusion of EDD SL endpoint from cache when deactivating the plugin
*
* @since 2.7
*/
function rocket_deactivate_edd_software_licensing() {
remove_filter( 'rocket_cache_reject_uri', 'rocket_exclude_edd_sl_endpoint' );
// Update the WP Rocket rules on the .htaccess file.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'deactivate_edd-software-licensing/edd-software-licenses.php', 'rocket_deactivate_edd_software_licensing', 11 );
/**
* Exclude EDD SL endpoint from caching
*
* @since 2.7
*
* @param array $uri URLs to exclude from caching.
* @return array Updated list of URLs to exclude
*/
function rocket_exclude_edd_sl_endpoint( $uri ) {
$uri[] = '/edd-sl/(.*)';
return $uri;
}
@@ -0,0 +1,65 @@
<?php
defined( 'ABSPATH' ) || exit;
/**
* Exclude pages of Give plugin from cache.
*
* @since 2.7
*/
if ( defined( 'GIVE_VERSION' ) && function_exists( 'give_get_settings' ) ) {
add_filter( 'rocket_cache_reject_uri', 'rocket_add_give_exclude_pages' );
if ( is_admin() ) {
add_action( 'update_option_give_settings', 'rocket_after_update_single_options', 10, 2 );
}
}
/**
* Add give pages to the excluded pages
*
* @since 2.7
*
* @param Array $urls Array of excluded pages.
* @return Array Updated array of excluded pages
*/
function rocket_add_give_exclude_pages( $urls ) {
$give_options = give_get_settings();
$urls = array_merge( $urls, get_rocket_i18n_translated_post_urls( $give_options['success_page'], 'page' ) );
$urls = array_merge( $urls, get_rocket_i18n_translated_post_urls( $give_options['history_page'], 'page' ) );
$urls = array_merge( $urls, get_rocket_i18n_translated_post_urls( $give_options['failure_page'], 'page' ) );
return $urls;
}
/**
* Add give pages to the excluded pages when activating the plugin
*
* @since 2.7
*/
function rocket_activate_give() {
add_filter( 'rocket_cache_reject_uri', 'rocket_add_give_exclude_pages' );
// Update the WP Rocket rules on the .htaccess.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'activate_give/give.php', 'rocket_activate_give', 11 );
/**
* Remove give pages from the excluded pages when activating the plugin
*
* @since 2.7
*/
function rocket_remove_give_exclude_pages() {
remove_filter( 'rocket_cache_reject_uri', 'rocket_add_give_exclude_pages' );
// Update the WP Rocket rules on the .htaccess.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'deactivate_give/give.php', 'rocket_remove_give_exclude_pages', 11 );
@@ -0,0 +1,69 @@
<?php
defined( 'ABSPATH' ) || exit;
if ( function_exists( 'it_exchange_get_page_type' ) && function_exists( 'it_exchange_get_page_url' ) ) :
add_filter( 'rocket_cache_reject_uri', 'rocket_exclude_ithemes_exchange_pages' );
add_action( 'update_option_it-storage-exchange_settings_pages', 'rocket_after_update_single_options', 10, 2 );
endif;
/**
* Exclude iThemes Exchange pages from cache.
*
* @param array $urls Array of URLs to exclude from cache.
* @return array Updated array of URLs to exclude from cache
*/
function rocket_exclude_ithemes_exchange_pages( $urls ) {
$pages = [
'purchases',
'confirmation',
'account',
'profile',
'downloads',
'purchases',
'log-in',
'log-out',
];
foreach ( $pages as $page ) {
if ( it_exchange_get_page_type( $page ) === 'WordPress' ) {
$exchange_urls = get_rocket_i18n_translated_post_urls( it_exchange_get_page_wpid( $page ) );
} else {
$exchange_urls = [ rocket_extract_url_component( it_exchange_get_page_url( $page ), PHP_URL_PATH ) ];
}
$urls = array_merge( $urls, $exchange_urls );
}
return $urls;
}
/**
* Exclude iThemes Exchanges pages from cache on plugin activation.
*/
function rocket_activate_ithemes_exchange() {
add_filter( 'rocket_cache_reject_uri', 'rocket_exclude_ithemes_exchange_pages' );
// Update .htaccess file rules.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'activate_ithemes-exchange/ithemes-exchange.php', 'rocket_activate_ithemes_exchange', 11 );
/**
* Remove iThemes Exchanges pages from cache exclusion on plugin deactivation.
*/
function rocket_deactivate_ithemes_exchange() {
remove_filter( 'rocket_cache_reject_uri', 'rocket_exclude_ithemes_exchange_pages' );
// Update .htaccess file rules.
flush_rocket_htaccess();
// Regenerate the config file.
rocket_generate_config_file();
}
add_action( 'deactivate_ithemes-exchange/ithemes-exchange.php', 'rocket_deactivate_ithemes_exchange', 11 );

Some files were not shown because too many files have changed in this diff Show More