@keyframes spinner__animation{0%{animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes loading__animation{to{transform:translateX(-100%)}}.wc-block-components-filter-submit-button{border:none;display:block;margin-right:auto;white-space:nowrap}.wc-block-components-filter-submit-button.is-loading{background-color:currentColor!important;border:0!important;border-radius:.25rem;border-radius:0;box-shadow:none;color:currentColor!important;display:block;line-height:1;line-height:normal;margin-top:16px;max-width:100%!important;opacity:.15;outline:0!important;overflow:hidden!important;pointer-events:none;position:relative!important;width:100%;width:-moz-max-content;width:max-content;z-index:1}.wc-block-components-filter-submit-button.is-loading>*{visibility:hidden}.wc-block-components-filter-submit-button.is-loading:after{animation:loading__animation 1.5s ease-in-out infinite;background-image:linear-gradient(-90deg,currentColor,hsla(0,0%,96%,.302),currentColor);background-repeat:no-repeat;content:" ";display:block;height:100%;right:0;position:absolute;left:0;top:0;transform:translateX(100%)}@media screen and (prefers-reduced-motion:reduce){.wc-block-components-filter-submit-button.is-loading{animation:none}}
@keyframes spinner__animation{0%{animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes loading__animation{to{transform:translateX(-100%)}}.wc-block-components-filter-reset-button{background:transparent;border:0;border-radius:0;box-shadow:none;color:inherit;cursor:pointer;display:inline;font-family:inherit;font-size:inherit;font-size:.875em;font-style:inherit;font-weight:inherit;font-weight:400;letter-spacing:inherit;line-height:inherit;margin:0;padding:0;text-decoration:inherit;text-decoration:underline;text-shadow:none;text-transform:inherit;vertical-align:baseline}.wc-block-components-filter-reset-button:active,.wc-block-components-filter-reset-button:focus,.wc-block-components-filter-reset-button:hover{background:transparent}.wc-block-components-filter-reset-button:hover{color:inherit;cursor:pointer;text-decoration:none}.wc-block-components-filter-reset-button[disabled]{cursor:not-allowed}
@keyframes spinner__animation{0%{animation-timing-function:cubic-bezier(.5856,.0703,.4143,.9297);transform:rotate(0deg)}to{transform:rotate(-1turn)}}@keyframes loading__animation{to{transform:translateX(-100%)}}.wc-blocks-components-form-token-field-wrapper .components-popover{right:0;opacity:0;position:fixed;top:0;z-index:z-index(".components-popover")}.wc-blocks-components-form-token-field-wrapper .components-popover.is-expanded,.wc-blocks-components-form-token-field-wrapper .components-popover[data-x-axis][data-y-axis]{opacity:1}.wc-blocks-components-form-token-field-wrapper .components-popover.is-expanded{bottom:0;right:0;left:0;top:0;z-index:z-index(".components-popover")!important}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow){margin-right:2px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):before{border:8px solid #ccc}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow).is-alternate:before{border-color:#1e1e1e}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):after{border:8px solid #fff}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow):before{content:"";height:0;line-height:0;position:absolute;width:0}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]{margin-top:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{bottom:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after{bottom:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=top]:before{border-bottom:none;border-right-color:transparent;border-left-color:transparent;border-top-style:solid;margin-right:-10px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]{margin-top:8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{top:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after{top:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=bottom]:before{border-bottom-style:solid;border-right-color:transparent;border-left-color:transparent;border-top:none;margin-right:-10px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]{margin-right:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:before{left:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:after{left:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=left]:before{border-bottom-color:transparent;border-right-style:solid;border-left:none;border-top-color:transparent}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]{margin-right:8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:before{right:-8px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:after{right:-6px}.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:after,.wc-blocks-components-form-token-field-wrapper .components-popover:not(.is-without-arrow)[data-y-axis=middle][data-x-axis=right]:before{border-bottom-color:transparent;border-right:none;border-left-style:solid;border-top-color:transparent}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=top]{bottom:100%}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=bottom]{top:100%}.wc-blocks-components-form-token-field-wrapper .components-popover[data-y-axis=middle]{align-items:center;display:flex}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-top{margin-top:12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-bottom{margin-top:-12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-left:not(.is-from-top):not(.is-from-bottom){margin-right:12px}.wc-blocks-components-form-token-field-wrapper .components-popover.is-from-right:not(.is-from-top):not(.is-from-bottom){margin-left:12px}.wc-blocks-components-form-token-field-wrapper .components-popover__content{background:#fff;border:1px solid #ccc;border-radius:2px;box-shadow:0 .7px 1px rgba(0,0,0,.1),0 1.2px 1.7px -.2px rgba(0,0,0,.1),0 2.3px 3.3px -.5px rgba(0,0,0,.1);height:100%}.is-alternate .wc-blocks-components-form-token-field-wrapper .components-popover__content{border:1px solid #1e1e1e;box-shadow:none}.components-popover .wc-blocks-components-form-token-field-wrapper .components-popover__content{height:auto;overflow-y:auto;position:absolute}.components-popover.is-expanded .wc-blocks-components-form-token-field-wrapper .components-popover__content{border:none;border-top:1px solid #1e1e1e;height:calc(100% - 48px);min-width:auto;overflow-y:visible;position:static}.components-popover[data-y-axis=top] .wc-blocks-components-form-token-field-wrapper .components-popover__content{bottom:100%}.components-popover[data-x-axis=center] .wc-blocks-components-form-token-field-wrapper .components-popover__content{right:50%;transform:translateX(50%)}.components-popover[data-x-axis=right] .wc-blocks-components-form-token-field-wrapper .components-popover__content{right:100%;position:absolute}.components-popover:not([data-y-axis=middle])[data-x-axis=right] .wc-blocks-components-form-token-field-wrapper .components-popover__content{margin-right:-25px}.components-popover[data-x-axis=left] .wc-blocks-components-form-token-field-wrapper .components-popover__content{position:absolute;left:100%}.components-popover:not([data-y-axis=middle])[data-x-axis=left] .wc-blocks-components-form-token-field-wrapper .components-popover__content{margin-left:-25px}.wc-blocks-components-form-token-field-wrapper .components-popover__header{align-items:center;background:#fff;display:flex;height:48px;justify-content:space-between;padding:0 16px 0 8px}.wc-blocks-components-form-token-field-wrapper .components-popover__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.wc-blocks-components-form-token-field-wrapper .components-popover__close.components-button{z-index:z-index(".components-popover__close")}.wc-blocks-components-form-token-field-wrapper .components-tooltip.components-popover{z-index:z-index(".components-tooltip")}.wc-blocks-components-form-token-field-wrapper .components-tooltip.components-popover .components-popover__content{min-width:0}.wc-blocks-components-form-token-field-wrapper .components-tooltip .components-popover__content{background:#1e1e1e;border-radius:2px;border-width:0;box-shadow:none;color:#fff;font-size:12px;line-height:1.4;text-align:center;white-space:nowrap}.wc-blocks-components-form-token-field-wrapper .components-tooltip .components-popover__content>div{padding:4px 8px}.wc-blocks-components-form-token-field-wrapper .components-tooltip__shortcut{display:inline-block;margin-right:8px}.wc-blocks-components-form-token-field-wrapper .disabled-element-wrapper{position:relative}.wc-blocks-components-form-token-field-wrapper .disabled-element-wrapper .event-catcher{bottom:0;height:100%;right:0;position:absolute;left:0;top:0;width:100%;z-index:z-index(".components-tooltip .event-catcher")}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container{align-items:center;border:1px solid #949494;border-radius:2px;box-shadow:0 0 0 transparent;cursor:text;display:flex;flex-wrap:wrap;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin:0 0 8px;padding:2px 4px;transition:box-shadow .1s linear;width:100%}@media(prefers-reduced-motion:reduce){.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container{transition-delay:0s;transition-duration:0s}}@media(min-width:600px){.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container{font-size:13px;line-height:normal}}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color);outline:2px solid transparent}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container::-moz-placeholder{color:rgba(30,30,30,.62);opacity:1}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container:-ms-input-placeholder{color:rgba(30,30,30,.62)}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container.is-disabled{background:#ddd;border-color:#ddd}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container.is-active{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color);outline:2px solid transparent}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container input[type=text].components-form-token-field__input{background:inherit;border:0;box-shadow:none;color:#1e1e1e;display:inline-block;flex:1;font-size:16px;margin-right:4px;max-width:100%;min-height:24px;min-width:50px;padding:0;width:100%}@media(min-width:600px){.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container input[type=text].components-form-token-field__input{font-size:13px}}.components-form-token-field.is-active .wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container input[type=text].components-form-token-field__input,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container input[type=text].components-form-token-field__input:focus{box-shadow:none;outline:none}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container .components-form-token-field__token+input[type=text].components-form-token-field__input{width:auto}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__label{display:inline-block;margin-bottom:4px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__help{color:#757575;font-size:12px;font-style:normal}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token{color:#1e1e1e;display:flex;font-size:13px;margin:2px 0 2px 4px;max-width:100%}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-success .components-form-token-field__remove-token,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-success .components-form-token-field__token-text{background:#4ab866}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-error .components-form-token-field__remove-token,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-error .components-form-token-field__token-text{background:#cc1818}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-validating .components-form-token-field__remove-token,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-validating .components-form-token-field__token-text{color:#757575}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-borderless{padding:0 0 0 16px;position:relative}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-borderless .components-form-token-field__token-text{background:transparent;color:var(--wp-admin-theme-color)}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-borderless .components-form-token-field__remove-token{background:transparent;color:#757575;position:absolute;left:0;top:1px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-borderless.is-success .components-form-token-field__token-text{color:#4ab866}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-borderless.is-error .components-form-token-field__token-text{border-radius:0 4px 4px 0;color:#cc1818;padding:0 6px 0 4px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-borderless.is-validating .components-form-token-field__token-text{color:#1e1e1e}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token.is-disabled .components-form-token-field__remove-token{cursor:default}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__remove-token.components-button,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token-text{background:#ddd;display:inline-block;height:auto;line-height:24px;min-width:unset;transition:all .2s cubic-bezier(.4,1,.4,1)}@media(prefers-reduced-motion:reduce){.wc-blocks-components-form-token-field-wrapper .components-form-token-field__remove-token.components-button,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token-text{animation-delay:0s;animation-duration:1ms;transition-delay:0s;transition-duration:0s}}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token-text{border-radius:0 2px 2px 0;overflow:hidden;padding:0 8px 0 0;text-overflow:ellipsis;white-space:nowrap}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__remove-token.components-button{border-radius:2px 0 0 2px;color:#1e1e1e;cursor:pointer;line-height:10px;overflow:initial;padding:0 2px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__remove-token.components-button:hover{color:#1e1e1e}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestions-list{border-top:1px solid #757575;flex:1 0 100%;list-style:none;margin:4px -4px -4px;max-height:9em;min-width:100%;overflow-y:auto;padding:0;transition:all .15s ease-in-out}@media(prefers-reduced-motion:reduce){.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestions-list{transition-delay:0s;transition-duration:0s}}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestion{color:#757575;cursor:pointer;display:block;font-size:13px;margin:0;padding:4px 8px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestion.is-selected{background:var(--wp-admin-theme-color);color:#fff}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestion-match{text-decoration:underline}.wc-blocks-components-form-token-field-wrapper{border-color:#949494}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__label,.wc-blocks-components-form-token-field-wrapper .components-visually-hidden{clip:rect(1px,1px,1px,1px);word-wrap:normal!important;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal!important;padding:0;position:absolute!important;width:1px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container{border-color:inherit;box-sizing:border-box;margin-bottom:0}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container{background-color:#fff;border-radius:0;box-shadow:none;color:#000;position:relative}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__input-container input[type=text].components-form-token-field__input{min-height:30px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__remove-token.components-button,.wc-blocks-components-form-token-field-wrapper .components-form-token-field__token-text{background:#e0e0e0}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__remove-token{border:none}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestions-list{background-color:#fff;border:1px solid #949494;border-top:0 solid #949494;right:-1px;margin:1px 0 0;position:absolute;left:-1px;top:100%;z-index:50}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestions-list:empty{display:none}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestion{padding:8px}.wc-blocks-components-form-token-field-wrapper .components-form-token-field__suggestion.is-selected{background:#f0f0f0;color:#2f2f2f}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token{margin-left:0;position:relative;width:100%;z-index:1}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__remove-token.components-button,.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token-text{background:transparent}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token-text{padding-right:4px;width:100%}.wc-blocks-components-form-token-field-wrapper.single-selection .components-form-token-field__token+input[type=text].components-form-token-field__input{position:absolute}.wc-blocks-components-form-token-field-wrapper.single-selection .is-active .components-form-token-field__token+input[type=text].components-form-token-field__input{border:1px solid #949494;margin:0 2px 4px;padding:0 5px;position:static}
(function ($) {
var PremiumVideoBoxWidgetHandler = function ($scope, $) {
var $videoBoxElement = $scope.find(".premium-video-box-container"),
$videoListElement = $scope.find(".premium-video-box-playlist-container"),
$videoContainer = $videoBoxElement.find(".premium-video-box-video-container"), //should be clicked
$videoInnerContainer = $videoBoxElement.find('.premium-video-box-inner-wrap'),
$videoImageContainer = $videoInnerContainer.find('.premium-video-box-image-container'),
type = $videoBoxElement.data("type"),
thumbnail = $videoBoxElement.data("thumbnail"),
sticky = $videoBoxElement.data('sticky'),
stickyOnPlay = $videoBoxElement.data('sticky-play'),
hoverEffect = $videoBoxElement.data('hover'),
$lighboxContainer = $videoListElement.length ? $videoListElement : $videoBoxElement,
lightBox = $lighboxContainer.data('lightbox') ? $lighboxContainer.data('lightbox') : false,
video, vidSrc;
if (lightBox) {
if ('prettyphoto' === lightBox.type) {
$lighboxContainer.find(".premium-vid-lightbox-container[data-rel^='prettyPhoto']").prettyPhoto(getPrettyPhotoSettings(lightBox.theme));
}
$lighboxContainer.find('.premium-video-box-image-container, .premium-video-box-play-icon-container').on('click', function (e) {
triggerLightbox($(this).closest('.premium-video-box-container'), lightBox.type);
});
} else {
// Youtube playlist option.
if ($videoListElement.length) {
//Make sure that video were pulled from the API.
if (!$videoContainer.length)
return;
$videoContainer.each(function (index, item) {
var vidSrc,
$videoContainer = $(item),
$videoBoxElement = $videoContainer.closest(".premium-video-box-container"),
$trigger = $videoContainer.closest(".premium-video-box-trigger");
vidSrc = $videoContainer.data("src");
vidSrc = vidSrc + "&autoplay=1";
$trigger.on("click", function () {
var $iframe = $("");
$iframe.attr({
"src": vidSrc,
"frameborder": "0",
"allowfullscreen": "1",
"allow": "autoplay;encrypted-media;"
});
$videoContainer.css("background", "#000");
$videoContainer.html($iframe);
$videoBoxElement.find(
".premium-video-box-image-container, .premium-video-box-play-icon-container"
).remove();
});
});
return;
}
if ("self" === type) {
video = $videoContainer.find("video");
vidSrc = video.attr("src");
if ($videoBoxElement.data("play-viewport")) {
var eleObserver = new IntersectionObserver(function(entries) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
if ( $videoBoxElement.data("play-reset") ) {
if ('up' === window.paDirection ) {
restartVideo();
} else {
playVideo();
}
} else {
playVideo();
}
}
});
});
eleObserver.observe($videoBoxElement[0]);
}
} else {
vidSrc = $videoContainer.data("src");
if (!thumbnail || -1 !== vidSrc.indexOf("autoplay=1")) {
//Check if Autoplay on viewport option is enabled
if ($videoBoxElement.data("play-viewport")) {
var eleObserver = new IntersectionObserver(function(entries) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
playVideo();
}
});
}, {
threshold: "0.5"
});
eleObserver.observe($videoBoxElement[0]);
} else {
playVideo();
}
} else {
vidSrc = vidSrc + "&autoplay=1";
}
}
$videoBoxElement.on("click", function () {
playVideo();
});
if ("yes" !== sticky || "yes" === stickyOnPlay)
return;
stickyOption();
}
function playVideo() {
if ($videoBoxElement.hasClass("playing")) return;
$videoBoxElement.addClass("playing");
if (stickyOnPlay === 'yes')
stickyOption();
if ("self" === type) {
$(video).get(0).play();
$videoContainer.css({
opacity: "1",
visibility: "visible"
});
} else {
var $iframe = $("");
$iframe.attr({
"src": vidSrc,
"frameborder": "0",
"allowfullscreen": "1",
"allow": "autoplay;encrypted-media;"
});
$videoContainer.css("background", "#000");
$videoContainer.html($iframe);
}
$videoBoxElement.find(
".premium-video-box-image-container, .premium-video-box-play-icon-container, .premium-video-box-description-container"
).remove();
if ("vimeo" === type)
$videoBoxElement.find(".premium-video-box-vimeo-wrap").remove();
}
function restartVideo() {
$videoBoxElement.removeClass("playing");
// $(video).get(0).pause();
$(video).get(0).currentTime = 0;
}
function triggerLightbox($container, type) {
if ('elementor' === type) {
$container.find('.premium-video-box-video-container').trigger('click');
} else {
$container.find(".premium-vid-lightbox-container[data-rel^='prettyPhoto']").trigger('click');
}
}
function stickyOption() {
var stickyDesktop = $videoBoxElement.data('hide-desktop'),
stickyTablet = $videoBoxElement.data('hide-tablet'),
stickyMobile = $videoBoxElement.data('hide-mobile'),
stickyMargin = $videoBoxElement.data('sticky-margin');
$videoBoxElement.off('click').on('click', function (e) {
// if ('yes' === sticky) {
var stickyTarget = e.target.className;
if ((stickyTarget.toString().indexOf('premium-video-box-sticky-close') >= 0) || (stickyTarget.toString().indexOf('premium-video-box-sticky-close') >= 0)) {
return false;
}
// }
playVideo();
});
var stickyWaypoint = new IntersectionObserver( function(entries) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
if ('down' === window.paDirection ) {
$videoBoxElement.removeClass('premium-video-box-sticky-hide').addClass('premium-video-box-sticky-apply premium-video-box-filter-sticky');
//Fix conflict with Elementor motion effects
if ($scope.hasClass("elementor-motion-effects-parent")) {
$scope.removeClass("elementor-motion-effects-perspective").find(".elementor-widget-container").addClass("premium-video-box-transform");
}
if ($videoBoxElement.data("mask")) {
//Fix Sticky position issue when drop-shadow is applied
$scope.find(".premium-video-box-mask-filter").removeClass("premium-video-box-mask-filter");
$videoBoxElement.find(':first-child').removeClass('premium-video-box-mask-media');
$videoImageContainer.removeClass(hoverEffect).removeClass('premium-video-box-mask-media').css({
'transition': 'width 0.2s, height 0.2s',
'-webkit-transition': 'width 0.2s, height 0.2s'
});
}
$(document).trigger('premium_after_sticky_applied', [$scope]);
// Entrance Animation Option
if ($videoInnerContainer.data("video-animation") && " " != $videoInnerContainer.data("video-animation")) {
$videoInnerContainer.css("opacity", "0");
var animationDelay = $videoInnerContainer.data('delay-animation');
setTimeout(function () {
$videoInnerContainer.css("opacity", "1").addClass("animated " + $videoInnerContainer.data("video-animation"));
}, animationDelay * 1000);
}
} else {
$videoBoxElement.removeClass('premium-video-box-sticky-apply premium-video-box-filter-sticky').addClass('premium-video-box-sticky-hide');
//Fix conflict with Elementor motion effects
if ($scope.hasClass("elementor-motion-effects-parent")) {
$scope.addClass("elementor-motion-effects-perspective").find(".elementor-widget-container").removeClass("premium-video-box-transform");
}
if ($videoBoxElement.data("mask")) {
//Fix Sticky position issue when drop-shadow is applied
$videoBoxElement.parent().addClass("premium-video-box-mask-filter");
$videoBoxElement.find(':first-child').eq(0).addClass('premium-video-box-mask-media');
$videoImageContainer.addClass('premium-video-box-mask-media');
}
$videoImageContainer.addClass(hoverEffect).css({
'transition': 'all 0.2s',
'-webkit-transition': 'all 0.2s'
});
$videoInnerContainer.removeClass("animated " + $videoInnerContainer.data("video-animation"));
}
}
});
}, {
threshold: 1 // this should be modified.
});
stickyWaypoint.observe($videoBoxElement[0]);
var closeBtn = $scope.find('.premium-video-box-sticky-close');
closeBtn.off('click.closetrigger').on('click.closetrigger', function (e) {
e.stopPropagation();
stickyWaypoint.unobserve($videoBoxElement[0]);
$videoBoxElement.removeClass('premium-video-box-sticky-apply premium-video-box-sticky-hide');
//Fix conflict with Elementor motion effects
if ($scope.hasClass("elementor-motion-effects-parent")) {
$scope.addClass("elementor-motion-effects-perspective").find(".elementor-widget-container").removeClass("premium-video-box-transform");
}
if ($videoBoxElement.data("mask")) {
//Fix Sticky position issue when drop-shadow is applied
$videoBoxElement.parent().addClass("premium-video-box-mask-filter");
//Necessary classes for mask shape option
$videoBoxElement.find(':first-child').eq(0).addClass('premium-video-box-mask-media');
$videoImageContainer.addClass('premium-video-box-mask-media');
}
});
checkResize(stickyWaypoint);
checkScroll();
window.addEventListener("scroll", checkScroll);
$(window).resize(function (e) {
checkResize(stickyWaypoint);
});
function checkResize(stickyWaypoint) {
var currentDeviceMode = elementorFrontend.getCurrentDeviceMode();
if ([stickyDesktop, stickyTablet, stickyMobile].includes(currentDeviceMode)) {
disableSticky(stickyWaypoint);
} else {
stickyWaypoint.observe($videoBoxElement[0])
}
// if ('' !== stickyDesktop && currentDeviceMode == stickyDesktop) {
// disableSticky(stickyWaypoint);
// } else if ('' !== stickyTablet && currentDeviceMode == stickyTablet) {
// disableSticky(stickyWaypoint);
// } else if ('' !== stickyMobile && currentDeviceMode == stickyMobile) {
// disableSticky(stickyWaypoint);
// } else {
// stickyWaypoin[0].enable();
// }
}
function disableSticky(stickyWaypoint) {
stickyWaypoint.unobserve($videoBoxElement[0]);
$videoBoxElement.removeClass('premium-video-box-sticky-apply premium-video-box-sticky-hide');
}
function checkScroll() {
if ($videoBoxElement.hasClass('premium-video-box-sticky-apply')) {
$videoInnerContainer.draggable({
start: function () {
$(this).css({
transform: "none",
top: $(this).offset().top + "px",
left: $(this).offset().left + "px"
});
},
containment: 'window'
});
}
}
$(document).on('premium_after_sticky_applied', function (e, $scope) {
var infobar = $scope.find('.premium-video-box-sticky-infobar');
if (0 !== infobar.length) {
var infobarHeight = infobar.outerHeight();
if ($scope.hasClass('premium-video-sticky-center-left') || $scope.hasClass('premium-video-sticky-center-right')) {
infobarHeight = Math.ceil(infobarHeight / 2);
$videoInnerContainer.css('top', 'calc( 50% - ' + infobarHeight + 'px )');
}
if ($scope.hasClass('premium-video-sticky-bottom-left') || $scope.hasClass('premium-video-sticky-bottom-right')) {
if ('' !== stickyMargin) {
infobarHeight = Math.ceil(infobarHeight);
var stickBottom = infobarHeight + stickyMargin;
$videoInnerContainer.css('bottom', stickBottom);
}
}
}
});
}
function getPrettyPhotoSettings(theme) {
return {
theme: theme,
hook: "data-rel",
opacity: 0.7,
show_title: false,
deeplinking: false,
overlay_gallery: true,
custom_markup: "",
default_width: 900,
default_height: 506,
social_tools: ""
};
}
};
$(window).on('elementor/frontend/init', function () {
elementorFrontend.hooks.addAction('frontend/element_ready/premium-addon-video-box.default', PremiumVideoBoxWidgetHandler);
});
})(jQuery);
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */