(()=>{"use strict";var e={34224:function(e,t,r){r.d(t,{P:()=>a,o:()=>o});var i=r(42792);var n={TOP:"top",TOP_START:"top-start",TOP_END:"top-end",BOTTOM:"bottom",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT:"left",LEFT_TOP:"left-top",LEFT_BOTTOM:"left-bottom",RIGHT:"right",RIGHT_TOP:"right-top",RIGHT_BOTTOM:"right-bottom"};var o=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t;return{open:false,placement:e.placement||n.BOTTOM_START,offset:(t=e.offset)!==null&&t!==void 0?t:4,actualPlacement:"",$el:undefined,$refs:{},$nextTick:undefined,scrollHandler:null,resizeHandler:null,escapeHandler:null,init(){this.actualPlacement=this.getActualPlacement();this.setupEventListeners()},destroy(){this.removeEventListeners()},setupEventListeners(){this.scrollHandler=()=>{if(this.open){this.updatePosition()}};this.resizeHandler=()=>{if(this.open){this.updatePosition()}};this.escapeHandler=e=>{this.handleEscapeKeydown(e)};window.addEventListener("scroll",this.scrollHandler,true);window.addEventListener("resize",this.resizeHandler);document.addEventListener("keydown",this.escapeHandler)},removeEventListeners(){if(this.scrollHandler){window.removeEventListener("scroll",this.scrollHandler,true)}if(this.resizeHandler){window.removeEventListener("resize",this.resizeHandler)}if(this.escapeHandler){document.removeEventListener("keydown",this.escapeHandler);this.escapeHandler=null}},getActualPlacement(){if(!i.V)return this.placement;var e={[n.LEFT]:n.RIGHT,[n.LEFT_TOP]:n.RIGHT_TOP,[n.LEFT_BOTTOM]:n.RIGHT_BOTTOM,[n.RIGHT]:n.LEFT,[n.RIGHT_TOP]:n.LEFT_TOP,[n.RIGHT_BOTTOM]:n.LEFT_BOTTOM,[n.TOP_START]:n.TOP_END,[n.TOP_END]:n.TOP_START,[n.BOTTOM_START]:n.BOTTOM_END,[n.BOTTOM_END]:n.BOTTOM_START};return e[this.placement]||this.placement},show(){var t=this.$refs.content;if(t){t.style.visibility="hidden";
t.style.left="-9999px";t.style.top="-9999px"}this.open=true;var r=()=>{if(!this.open)return;var i=this.getContentDimensions(t);
if(i.width===0&&i.height===0){requestAnimationFrame(r);return}this.updatePosition();if(t){t.style.visibility="visible"}if(e.onShow){e.onShow()}};if(this.$nextTick){this.$nextTick(r)}else{requestAnimationFrame(r)}},hide(){this.open=false;var t=this.$refs.content;if(t){t.style.visibility="hidden"}if(e.onHide){e.onHide()}},toggle(){if(this.open){this.hide()}else{this.show()}},handleClickOutside(){if(this.open){this.hide()}},handleEscapeKeydown(e){if(e.key==="Escape"&&this.open){e.preventDefault();e.stopPropagation();this.hide()}},isTriggerVisible(){var e=this.$refs.trigger;if(!e)return false;var t=e.getBoundingClientRect();var r=window.innerHeight;var i=window.innerWidth;
var n=t.bottom>0&&t.top<r&&t.right>0&&t.left<i;if(!n||t.width===0||t.height===0){return false}
var o=t.left+t.width/2;var a=t.top+t.height/2;var s=document.elementFromPoint(o,a);if(s){var l=this.$refs.content;var u=e===s||e.contains(s);var c=l&&(l===s||l.contains(s));if(!u&&!c){return false}}return true},updatePosition(){var e=this.$refs.trigger;var t=this.$refs.content;if(!e||!t)return;if(this.open&&!this.isTriggerVisible()){this.hide();return}var r=e.getBoundingClientRect();var i=this.getContentDimensions(t);
if(this.open&&i.width===0&&i.height===0){requestAnimationFrame(()=>this.updatePosition());return}var n={width:window.innerWidth,height:window.innerHeight};var o=this.resolvePlacement(this.actualPlacement,r,i,n);var a=this.calculatePosition(r,i,o);var{top:s,left:l}=this.convertViewportPositionToContentPosition(t,a);
t.style.position="fixed";t.style.top="".concat(s,"px");t.style.left="".concat(l,"px");t.style.zIndex="1060";
this.updatePlacementClasses(t,o)},resolvePlacement(e,t,r,i){var n={top:t.top,bottom:i.height-t.bottom,left:t.left,right:i.width-t.right};var o={top:n.top<r.height+this.offset&&n.bottom>n.top,bottom:n.bottom<r.height+this.offset&&n.top>n.bottom};var a={left:n.left<r.width+this.offset&&n.right>n.left,right:n.right<r.width+this.offset&&n.left>n.right};if(e.startsWith("top")&&o.top){return e.replace("top","bottom")}if(e.startsWith("bottom")&&o.bottom){return e.replace("bottom","top")}if(e.startsWith("left")&&a.left){return e.replace("left","right")}if(e.startsWith("right")&&a.right){return e.replace("right","left")}return e},calculatePosition(e,t,r){var i=0;var o=0;switch(r){case n.TOP:i=e.top-t.height-this.offset;o=e.left+(e.width-t.width)/2;break;case n.TOP_START:i=e.top-t.height-this.offset;o=e.left;break;case n.TOP_END:i=e.top-t.height-this.offset;o=e.right-t.width;break;case n.BOTTOM:i=e.bottom+this.offset;o=e.left+(e.width-t.width)/2;break;case n.BOTTOM_START:i=e.bottom+this.offset;o=e.left;break;case n.BOTTOM_END:i=e.bottom+this.offset;o=e.right-t.width;break;case n.LEFT:i=e.top+(e.height-t.height)/2;o=e.left-t.width-this.offset;break;case n.LEFT_TOP:i=e.top;o=e.left-t.width-this.offset;break;case n.LEFT_BOTTOM:i=e.bottom-t.height;o=e.left-t.width-this.offset;break;case n.RIGHT:i=e.top+(e.height-t.height)/2;o=e.right+this.offset;break;case n.RIGHT_TOP:i=e.top;o=e.right+this.offset;break;case n.RIGHT_BOTTOM:i=e.bottom-t.height;o=e.right+this.offset;break}return{top:i,left:o}},getContentDimensions(e){
var t=e.style.transform;var r=e.style.transition;e.style.transform="none";e.style.transition="none";var i=e.getBoundingClientRect();var n={width:e.offsetWidth||i.width,height:e.offsetHeight||i.height};e.style.transform=t;e.style.transition=r;return n},convertViewportPositionToContentPosition(e,t){var r=this.getFixedContainingBlock(e);if(!r){return t}var i=r.getBoundingClientRect();var n=r.offsetWidth?i.width/r.offsetWidth||1:1;var o=r.offsetHeight?i.height/r.offsetHeight||1:1;return{top:(t.top-i.top)/o-r.clientTop,left:(t.left-i.left)/n-r.clientLeft}},getFixedContainingBlock(e){var t=e.parentElement;while(t&&t!==document.documentElement){if(this.createsFixedContainingBlock(t)){return t}t=t.parentElement}return null},createsFixedContainingBlock(e){var t=window.getComputedStyle(e);var r=t.willChange.split(",").map(e=>e.trim());var i=t.contain.split(" ");var n=t.getPropertyValue("backdrop-filter")||t.getPropertyValue("-webkit-backdrop-filter");var o=t.getPropertyValue("content-visibility");var a=t.getPropertyValue("container-type");return t.transform!=="none"||t.perspective!=="none"||t.filter!=="none"||n!==""&&n!=="none"||o==="auto"||a!==""&&a!=="normal"||r.some(e=>["transform","perspective","filter"].includes(e))||i.some(e=>["layout","paint","strict","content"].includes(e))},updatePlacementClasses(e,t){
var r=["tutor-popover-top","tutor-popover-bottom","tutor-popover-left","tutor-popover-right"];e.classList.remove(...r);
var i=t.split("-")[0];e.classList.add("tutor-popover-".concat(i))}}};var a={name:"popover",component:o}},9210:function(e,t,r){r.d(t,{T:()=>i});var i={TAB_CHANGE:"tutor-tab-change",MODAL_OPEN:"tutor-modal-open",MODAL_UPDATE:"tutor-modal-update",MODAL_CLOSE:"tutor-modal-close",MODAL_CLOSED:"tutor-modal-closed",TOAST_SHOW:"tutor-toast-show",TOAST_CLEAR:"tutor-toast-clear",FORM_REGISTER:"tutor-form-register",FORM_UNREGISTER:"tutor-form-unregister",FORM_STATE_CHANGE:"tutor-form-state-change",FORM_RESET:"tutor-form-reset",WP_EDITOR_FOCUS:"wp-editor-focus",TUTOR_PLAYER_READY:"tutor-player-ready",COMMENT_REPLIED:"tutor:comment:replied",LESSON_PLAYER_READY:"tutorLessonPlayerReady",QUIZ_TIME_EXPIRED:"tutor-quiz-time-expired",QUIZ_ABANDON_REQUESTED:"tutor-quiz-abandon-requested",QUIZ_ATTEMPT_COMPLETED:"tutor-quiz-attempt-completed"}},16131:function(e,t,r){r.d(t,{z:()=>o});var i=r(12470);var n=r.n(i);var o=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;if(!e||e<=1){return(0,i.__)("0 Bytes","tutor")}var r=1024;var n=Math.max(0,t);var o=[(0,i.__)("Bytes","tutor"),(0,i.__)("KB","tutor"),(0,i.__)("MB","tutor"),(0,i.__)("GB","tutor"),(0,i.__)("TB","tutor"),(0,i.__)("PB","tutor"),(0,i.__)("EB","tutor"),(0,i.__)("ZB","tutor"),(0,i.__)("YB","tutor")];var a=Math.floor(Math.log(e)/Math.log(r));return"".concat(Number.parseFloat((e/r**a).toFixed(n))," ").concat(o[a])}},4041:function(e,t,r){r.d(t,{T:()=>i});var i=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:false,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:false;return e.replace(r?t?/[^0-9-]/g:/[^0-9]/g:t?/[^0-9.-]/g:/[^0-9.]/g,"").replace(/(?!^)-/g,"").replace(r?/\./g:/(\..*)\./g,"$1")}},42792:function(e,t,r){r.d(t,{V:()=>n,X:()=>i});function i(){return/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)}var n=document.dir==="rtl"},74412:function(e,t,r){r.d(t,{A:()=>l,P:()=>a});var i,n;var o={ID:0,ajaxurl:"",site_url:"",home_url:"",site_title:"",base_path:"",tutor_url:"",tutor_pro_url:"",dashboard_url:"",nonce_key:"",_tutor_nonce:"",loading_icon_url:"",placeholder_img_src:"",enable_lesson_classic_editor:"",tutor_frontend_dashboard_url:"",backend_course_list_url:"",backend_bundle_list_url:"",frontend_course_list_url:"",frontend_bundle_list_url:"",wp_date_format:"",wp_rest_nonce:"",is_admin:"",is_admin_bar_showing:"",max_upload_size:"",content_change_event:"",is_tutor_course_edit:"",assignment_max_file_allowed:"",current_page:"",quiz_answer_display_time:"",is_ssl:"",course_list_page_url:"",course_post_type:"",local:"",tutor_pn_vapid_key:"",tutor_pn_client_id:"",tutor_pn_subscription_saved:"",difficulty_levels:[],supported_video_sources:[],edd_products:[],bp_groups:[],timezones:{},addons_data:[],kids_icons_registry:[],is_kids_mode:false,user_preferences:{auto_play_next:false,contrast:"",font_scale:1,learning_mood:"modern",motion_effects:"auto",theme:"light",vision:"normal"},is_legacy_learning_mode:false,current_user:{data:{id:"",user_login:"",user_pass:"",user_nicename:"",user_email:"",user_url:"",user_registered:"",user_activation_key:"",user_status:"",display_name:""},caps:{},cap_key:"",roles:[],allcaps:{},filter:null},settings:{learning_mode:"",monetize_by:"tutor",enable_course_marketplace:"off",course_permalink_base:"",supported_video_sources:"",enrollment_expiry_enabled:"off",enable_q_and_a_on_course:"off",instructor_can_delete_course:"off",instructor_can_change_course_author:"off",instructor_can_manage_co_instructors:"off",chatgpt_enable:"off",course_builder_logo_url:"",chatgpt_key_exist:false,hide_admin_bar_for_users:"off",enable_redirect_on_course_publish_from_frontend:"off",instructor_can_publish_course:"off",youtube_api_key_exist:false,membership_only_mode:false,enable_tax:false,enable_individual_tax_control:false,is_tax_included_in_price:false,pagination_per_page:10,has_active_membership_plans:false},tutor_currency:{symbol:"",currency:"",position:"",thousand_separator:"",decimal_separator:"",no_of_decimal:""},visibility_control:{course_builder:{}}};var a=window._tutorobject||o;window.ajaxurl=a.ajaxurl;var s={TUTOR_SITE_URL:a.site_url,WP_AJAX_BASE_URL:a.ajaxurl,WP_API_BASE_URL:"".concat(((i=window.wpApiSettings)===null||i===void 0?void 0:i.root)||"").concat(((n=window.wpApiSettings)===null||n===void 0?void 0:n.versionString)||""),VIDEO_SOURCES_SETTINGS_URL:"".concat(a.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=course#field_supported_video_sources"),MONETIZATION_SETTINGS_URL:"".concat(a.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=monetization"),TUTOR_PRICING_PAGE:"https://tutorlms.com/pricing/",TUTOR_ADDONS_PAGE:"".concat(a.site_url,"/wp-admin/admin.php?page=tutor-addons"),CHATGPT_PLATFORM_URL:"https://platform.openai.com/account/api-keys",TUTOR_MY_COURSES_PAGE_URL:"".concat(a.tutor_frontend_dashboard_url,"/my-courses"),TUTOR_SUPPORT_PAGE_URL:"https://tutorlms.com/support",TUTOR_SUBSCRIPTIONS_PAGE:"".concat(a.site_url,"/wp-admin/admin.php?page=tutor-subscriptions"),TUTOR_ENROLLMENTS_PAGE:"".concat(a.site_url,"/wp-admin/admin.php?page=enrollments"),TUTOR_COUPONS_PAGE:"".concat(a.site_url,"/wp-admin/admin.php?page=tutor_coupons"),TUTOR_IMPORT_EXPORT_PAGE:"".concat(a.site_url,"/wp-admin/admin.php?page=tutor-tools&sub_page=import_export")};const l=s},12470:function(e){e.exports=wp.i18n},93640:function(e,t,r){r.d(t,{_:()=>n});function i(e,t,r,i,n,o,a){try{var s=e[o](a);var l=s.value}catch(e){r(e);return}if(s.done)t(l);else Promise.resolve(l).then(i,n)}function n(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function s(e){i(a,n,o,s,l,"next",e)}function l(e){i(a,n,o,s,l,"throw",e)}s(undefined)})}}},38125:function(e,t,r){r.d(t,{_:()=>i});function i(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else e[t]=r;return e}},41147:function(e,t,r){r.d(t,{_:()=>n});var i=r(38125);function n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){(0,i._)(e,t,r[t])})}return e}},14206:function(e,t,r){r.d(t,{_:()=>n});function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);if(t){i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,i)}return r}function n(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors)Object.defineProperties(e,Object.getOwnPropertyDescriptors(t));else{i(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}},17900:function(e,t,r){// EXPORTS
r.d(t,{_:()=>n});
function i(e,t){if(e==null)return{};var r={};var i=Object.keys(e);var n,o;for(o=0;o<i.length;o++){n=i[o];if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r};
function n(e,t){if(e==null)return{};var r=i(e,t);var n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++){n=a[o];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}}};
var t={};
function r(i){
var n=t[i];if(n!==undefined){return n.exports}
var o=t[i]={id:i,exports:{}};
e[i].call(o.exports,o,o.exports,r);
return o.exports}
r.m=e;
(()=>{
r.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;r.d(t,{a:t});return t}})();
(()=>{r.d=(e,t)=>{for(var i in t){if(r.o(t,i)&&!r.o(e,i)){Object.defineProperty(e,i,{enumerable:true,get:t[i]})}}}})();
(()=>{r.f={};
r.e=e=>{return Promise.all(Object.keys(r.f).reduce((t,i)=>{r.f[i](e,t);return t},[]))}})();
(()=>{
r.u=e=>{
if(e==="809")return"js/lazy-chunks/tutor-calendar.js?ver=4.0.1";if(e==="353")return"js/lazy-chunks/tutor-form.js?ver=4.0.1";if(e==="756")return"js/lazy-chunks/tutor-file-uploader.js?ver=4.0.1";if(e==="855")return"js/lazy-chunks/tutor-select.js?ver=4.0.1";if(e==="691")return"js/lazy-chunks/tutor-time-input.js?ver=4.0.1";
return""+e+".javascript"}})();
(()=>{
r.miniCssF=e=>{
return""+e+".css"}})();
(()=>{r.h=()=>"0a55a67ec75adc3e"})();
(()=>{r.g=(()=>{if(typeof globalThis==="object")return globalThis;try{return this||new Function("return this")()}catch(e){if(typeof window==="object")return window}})()})();
(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();
(()=>{var e={};var t="tutor:";
r.l=function(i,n,o,a){if(e[i]){e[i].push(n);return}var s,l;if(o!==undefined){var u=document.getElementsByTagName("script");for(var c=0;c<u.length;c++){var d=u[c];if(d.getAttribute("src")==i||d.getAttribute("data-webpack")==t+o){s=d;break}}}if(!s){l=true;s=document.createElement("script");s.timeout=120;if(r.nc){s.setAttribute("nonce",r.nc)}s.setAttribute("data-webpack",t+o);s.src=i}e[i]=[n];var f=function(t,r){s.onerror=s.onload=null;clearTimeout(h);var n=e[i];delete e[i];s.parentNode&&s.parentNode.removeChild(s);n&&n.forEach(function(e){return e(r)});if(t)return t(r)};var h=setTimeout(f.bind(null,undefined,{type:"timeout",target:s}),12e4);s.onerror=f.bind(null,s.onerror);s.onload=f.bind(null,s.onload);l&&document.head.appendChild(s)}})();
(()=>{r.nc=undefined})();
(()=>{r.rv=()=>"1.6.5"})();
(()=>{var e;if(r.g.importScripts)e=r.g.location+"";var t=r.g.document;if(!e&&t){
if(t.currentScript&&t.currentScript.tagName.toUpperCase()==="SCRIPT")e=t.currentScript.src;if(!e){var i=t.getElementsByTagName("script");if(i.length){var n=i.length-1;while(n>-1&&(!e||!/^http(s?):/.test(e)))e=i[n--].src}}}
if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");r.p=e+"../"})();
(()=>{r.b=document.baseURI||self.location.href;
var e={"800":0};r.f.j=function(t,i){
var n=r.o(e,t)?e[t]:undefined;if(n!==0){
if(n){i.push(n[2])}else{if(true){
var o=new Promise((r,i)=>n=e[t]=[r,i]);i.push(n[2]=o);
var a=r.p+r.u(t);
var s=new Error;var l=function(i){if(r.o(e,t)){n=e[t];if(n!==0)e[t]=undefined;if(n){var o=i&&(i.type==="load"?"missing":i.type);var a=i&&i.target&&i.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")";s.name="ChunkLoadError";s.type=o;s.request=a;n[1](s)}}};r.l(a,l,"chunk-"+t,t)}}}};
var t=(t,i)=>{var[n,o,a]=i;
var s,l,u=0;if(n.some(t=>e[t]!==0)){for(s in o){if(r.o(o,s)){r.m[s]=o[s]}}if(a)var c=a(r)}if(t)t(i);for(;u<n.length;u++){l=n[u];if(r.o(e,l)&&e[l]){e[l][0]()}e[l]=0}};var i=self["webpackChunktutor"]=self["webpackChunktutor"]||[];i.forEach(t.bind(null,0));i.push=t.bind(null,i.push.bind(i))})();
(()=>{r.ruid="bundler=rspack@1.6.5"})();var i={};
(()=>{
var e=r(93640);
function t(e){e.directive("collapse",t);t.inline=(e,{modifiers:t})=>{if(!t.includes("min"))return;e._x_doShow=()=>{};e._x_doHide=()=>{}};function t(t,{modifiers:r}){let n=i(r,"duration",250)/1e3;let o=i(r,"min",0);let a=!r.includes("min");if(!t._x_isShown)t.style.height=`${o}px`;if(!t._x_isShown&&a)t.hidden=true;if(!t._x_isShown)t.style.overflow="hidden";let s=(t,r)=>{let i=e.setStyles(t,r);return r.height?()=>{}:i};let l={transitionProperty:"height",transitionDuration:`${n}s`,transitionTimingFunction:"cubic-bezier(0.4, 0.0, 0.2, 1)"};t._x_transition={in(r=()=>{},i=()=>{}){if(a)t.hidden=false;if(a)t.style.display=null;let n=t.getBoundingClientRect().height;t.style.height="auto";let s=t.getBoundingClientRect().height;if(n===s){n=o}e.transition(t,e.setStyles,{during:l,start:{height:n+"px"},end:{height:s+"px"}},()=>t._x_isShown=true,()=>{if(Math.abs(t.getBoundingClientRect().height-s)<1){t.style.overflow=null}})},out(r=()=>{},i=()=>{}){let n=t.getBoundingClientRect().height;e.transition(t,s,{during:l,start:{height:n+"px"},end:{height:o+"px"}},()=>t.style.overflow="hidden",()=>{t._x_isShown=false;if(t.style.height==`${o}px`&&a){t.style.display="none";t.hidden=true}})}}}}function i(e,t,r){if(e.indexOf(t)===-1)return r;const i=e[e.indexOf(t)+1];if(!i)return r;if(t==="duration"){let e=i.match(/([0-9]+)ms/);if(e)return e[1]}if(t==="min"){let e=i.match(/([0-9]+)px/);if(e)return e[1]}return i}
var n=t;
var o=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"];var a=o.join(",");var s=typeof Element==="undefined";var l=s?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;var u=!s&&Element.prototype.getRootNode?function(e){return e.getRootNode()}:function(e){return e.ownerDocument};var c=function e(e,t,r){var i=Array.prototype.slice.apply(e.querySelectorAll(a));if(t&&l.call(e,a)){i.unshift(e)}i=i.filter(r);return i};var d=function e(t,r,i){var n=[];var o=Array.from(t);while(o.length){var s=o.shift();if(s.tagName==="SLOT"){var u=s.assignedElements();var c=u.length?u:s.children;var d=e(c,true,i);if(i.flatten){n.push.apply(n,d)}else{n.push({scope:s,candidates:d})}}else{var f=l.call(s,a);if(f&&i.filter(s)&&(r||!t.includes(s))){n.push(s)}var h=s.shadowRoot||
typeof i.getShadowRoot==="function"&&i.getShadowRoot(s);var _=!i.shadowRootFilter||i.shadowRootFilter(s);if(h&&_){var p=e(h===true?s.children:h.children,true,i);if(i.flatten){n.push.apply(n,p)}else{n.push({scope:s,candidates:p})}}else{o.unshift.apply(o,s.children)}}}return n};var f=function e(e,t){if(e.tabIndex<0){if((t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))){return 0}}return e.tabIndex};var h=function e(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex};var _=function e(e){return e.tagName==="INPUT"};var p=function e(e){return _(e)&&e.type==="hidden"};var v=function e(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName==="SUMMARY"});return t};var m=function e(e,t){for(var r=0;r<e.length;r++){if(e[r].checked&&e[r].form===t){return e[r]}}};var g=function e(e){if(!e.name){return true}var t=e.form||u(e);var r=function e(e){return t.querySelectorAll('input[type="radio"][name="'+e+'"]')};var i;if(typeof window!=="undefined"&&typeof window.CSS!=="undefined"&&typeof window.CSS.escape==="function"){i=r(window.CSS.escape(e.name))}else{try{i=r(e.name)}catch(e){console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message);return false}}var n=m(i,e.form);return!n||n===e};var y=function e(e){return _(e)&&e.type==="radio"};var E=function e(e){return y(e)&&!g(e)};var b=function e(e){var t=e.getBoundingClientRect(),r=t.width,i=t.height;return r===0&&i===0};var T=function e(e,t){var r=t.displayCheck,i=t.getShadowRoot;if(getComputedStyle(e).visibility==="hidden"){return true}var n=l.call(e,"details>summary:first-of-type");var o=n?e.parentElement:e;if(l.call(o,"details:not([open]) *")){return true}var a=u(e).host;var s=(a===null||a===void 0?void 0:a.ownerDocument.contains(a))||e.ownerDocument.contains(e);if(!r||r==="full"){if(typeof i==="function"){var c=e;while(e){var d=e.parentElement;var f=u(e);if(d&&!d.shadowRoot&&i(d)===true){return b(e)}else if(e.assignedSlot){e=e.assignedSlot}else if(!d&&f!==e.ownerDocument){e=f.host}else{e=d}}e=c}if(s){return!e.getClientRects().length}}else if(r==="non-zero-area"){return b(e)}return false};var w=function e(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName)){var t=e.parentElement;while(t){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r<t.children.length;r++){var i=t.children.item(r);if(i.tagName==="LEGEND"){return l.call(t,"fieldset[disabled] *")?true:!i.contains(e)}}return true}t=t.parentElement}}return false};var A=function e(e,t){if(t.disabled||p(t)||T(t,e)||
v(t)||w(t)){return false}return true};var O=function e(e,t){if(E(t)||f(t)<0||!A(e,t)){return false}return true};var x=function e(e){var t=parseInt(e.getAttribute("tabindex"),10);if(isNaN(t)||t>=0){return true}return false};var S=function e(t){var r=[];var i=[];t.forEach(function(t,n){var o=!!t.scope;var a=o?t.scope:t;var s=f(a,o);var l=o?e(t.candidates):a;if(s===0){o?r.push.apply(r,l):r.push(a)}else{i.push({documentOrder:n,tabIndex:s,item:t,isScope:o,content:l})}});return i.sort(h).reduce(function(e,t){t.isScope?e.push.apply(e,t.content):e.push(t.content);return e},[]).concat(r)};var C=function e(e,t){t=t||{};var r;if(t.getShadowRoot){r=d([e],t.includeContainer,{filter:O.bind(null,t),flatten:false,getShadowRoot:t.getShadowRoot,shadowRootFilter:x})}else{r=c(e,t.includeContainer,O.bind(null,t))}return S(r)};var N=function e(e,t){t=t||{};var r;if(t.getShadowRoot){r=d([e],t.includeContainer,{filter:A.bind(null,t),flatten:true,getShadowRoot:t.getShadowRoot})}else{r=c(e,t.includeContainer,A.bind(null,t))}return r};var L=function e(e,t){t=t||{};if(!e){throw new Error("No node provided")}if(l.call(e,a)===false){return false}return O(t,e)};var P=o.concat("iframe").join(",");var k=function e(e,t){t=t||{};if(!e){throw new Error("No node provided")}if(l.call(e,P)===false){return false}return A(t,e)};
function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function I(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),true).forEach(function(t){M(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function M(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}var D=function(){var e=[];return{activateTrap:function t(t){if(e.length>0){var r=e[e.length-1];if(r!==t){r.pause()}}var i=e.indexOf(t);if(i===-1){e.push(t)}else{e.splice(i,1);e.push(t)}},deactivateTrap:function t(t){var r=e.indexOf(t);if(r!==-1){e.splice(r,1)}if(e.length>0){e[e.length-1].unpause()}}}}();var B=function e(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select==="function"};var F=function e(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27};var U=function e(e){return e.key==="Tab"||e.keyCode===9};var G=function e(e){return setTimeout(e,0)};var $=function e(e,t){var r=-1;e.every(function(e,i){if(t(e)){r=i;return false}return true});return r};var H=function e(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++){r[i-1]=arguments[i]}return typeof e==="function"?e.apply(void 0,r):e};var j=function e(e){return e.target.shadowRoot&&typeof e.composedPath==="function"?e.composedPath()[0]:e.target};var z=function e(e,t){var r=(t===null||t===void 0?void 0:t.document)||document;var i=I({returnFocusOnDeactivate:true,escapeDeactivates:true,delayInitialFocus:true},t);var n={
containers:[],
containerGroups:[],
tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:false,paused:false,
delayInitialFocusTimer:void 0};var o;var a=function e(e,t,r){return e&&e[t]!==void 0?e[t]:i[r||t]};var s=function e(e){return n.containerGroups.findIndex(function(t){var r=t.container,i=t.tabbableNodes;return r.contains(e)||
i.find(function(t){return t===e})})};var l=function e(e){var t=i[e];if(typeof t==="function"){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++){o[a-1]=arguments[a]}t=t.apply(void 0,o)}if(t===true){t=void 0}if(!t){if(t===void 0||t===false){return t}throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=t;if(typeof t==="string"){s=r.querySelector(t);if(!s){throw new Error("`".concat(e,"` as selector refers to no known node"))}}return s};var u=function e(){var e=l("initialFocus");if(e===false){return false}if(e===void 0){if(s(r.activeElement)>=0){e=r.activeElement}else{var t=n.tabbableGroups[0];var i=t&&t.firstTabbableNode;e=i||l("fallbackFocus")}}if(!e){throw new Error("Your focus-trap needs to have at least one focusable element")}return e};var c=function e(){n.containerGroups=n.containers.map(function(e){var t=C(e,i.tabbableOptions);var r=N(e,i.tabbableOptions);return{container:e,tabbableNodes:t,focusableNodes:r,firstTabbableNode:t.length>0?t[0]:null,lastTabbableNode:t.length>0?t[t.length-1]:null,nextTabbableNode:function e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:true;var n=r.findIndex(function(t){return t===e});if(n<0){return void 0}if(t){return r.slice(n+1).find(function(e){return L(e,i.tabbableOptions)})}return r.slice(0,n).reverse().find(function(e){return L(e,i.tabbableOptions)})}}});n.tabbableGroups=n.containerGroups.filter(function(e){return e.tabbableNodes.length>0});if(n.tabbableGroups.length<=0&&!l("fallbackFocus")){throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")}};var d=function e(t){if(t===false){return}if(t===r.activeElement){return}if(!t||!t.focus){e(u());return}t.focus({preventScroll:!!i.preventScroll});n.mostRecentlyFocusedNode=t;if(B(t)){t.select()}};var f=function e(e){var t=l("setReturnFocus",e);return t?t:t===false?false:e};var h=function e(e){var t=j(e);if(s(t)>=0){return}if(H(i.clickOutsideDeactivates,e)){o.deactivate({
returnFocus:i.returnFocusOnDeactivate&&!k(t,i.tabbableOptions)});return}if(H(i.allowOutsideClick,e)){return}e.preventDefault()};var _=function e(e){var t=j(e);var r=s(t)>=0;if(r||t instanceof Document){if(r){n.mostRecentlyFocusedNode=t}}else{e.stopImmediatePropagation();d(n.mostRecentlyFocusedNode||u())}};var p=function e(e){var t=j(e);c();var r=null;if(n.tabbableGroups.length>0){var o=s(t);var a=o>=0?n.containerGroups[o]:void 0;if(o<0){if(e.shiftKey){r=n.tabbableGroups[n.tabbableGroups.length-1].lastTabbableNode}else{r=n.tabbableGroups[0].firstTabbableNode}}else if(e.shiftKey){var u=$(n.tabbableGroups,function(e){var r=e.firstTabbableNode;return t===r});if(u<0&&(a.container===t||k(t,i.tabbableOptions)&&!L(t,i.tabbableOptions)&&!a.nextTabbableNode(t,false))){u=o}if(u>=0){var f=u===0?n.tabbableGroups.length-1:u-1;var h=n.tabbableGroups[f];r=h.lastTabbableNode}}else{var _=$(n.tabbableGroups,function(e){var r=e.lastTabbableNode;return t===r});if(_<0&&(a.container===t||k(t,i.tabbableOptions)&&!L(t,i.tabbableOptions)&&!a.nextTabbableNode(t))){_=o}if(_>=0){var p=_===n.tabbableGroups.length-1?0:_+1;var v=n.tabbableGroups[p];r=v.firstTabbableNode}}}else{r=l("fallbackFocus")}if(r){e.preventDefault();d(r)}};var v=function e(e){if(F(e)&&H(i.escapeDeactivates,e)!==false){e.preventDefault();o.deactivate();return}if(U(e)){p(e);return}};var m=function e(e){var t=j(e);if(s(t)>=0){return}if(H(i.clickOutsideDeactivates,e)){return}if(H(i.allowOutsideClick,e)){return}e.preventDefault();e.stopImmediatePropagation()};var g=function e(){if(!n.active){return}D.activateTrap(o);n.delayInitialFocusTimer=i.delayInitialFocus?G(function(){d(u())}):d(u());r.addEventListener("focusin",_,true);r.addEventListener("mousedown",h,{capture:true,passive:false});r.addEventListener("touchstart",h,{capture:true,passive:false});r.addEventListener("click",m,{capture:true,passive:false});r.addEventListener("keydown",v,{capture:true,passive:false});return o};var y=function e(){if(!n.active){return}r.removeEventListener("focusin",_,true);r.removeEventListener("mousedown",h,true);r.removeEventListener("touchstart",h,true);r.removeEventListener("click",m,true);r.removeEventListener("keydown",v,true);return o};o={get active(){return n.active},get paused(){return n.paused},activate:function e(e){if(n.active){return this}var t=a(e,"onActivate");var i=a(e,"onPostActivate");var o=a(e,"checkCanFocusTrap");if(!o){c()}n.active=true;n.paused=false;n.nodeFocusedBeforeActivation=r.activeElement;if(t){t()}var s=function e(){if(o){c()}g();if(i){i()}};if(o){o(n.containers.concat()).then(s,s);return this}s();return this},deactivate:function e(e){if(!n.active){return this}var t=I({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(n.delayInitialFocusTimer);n.delayInitialFocusTimer=void 0;y();n.active=false;n.paused=false;D.deactivateTrap(o);var r=a(t,"onDeactivate");var s=a(t,"onPostDeactivate");var l=a(t,"checkCanReturnFocus");var u=a(t,"returnFocus","returnFocusOnDeactivate");if(r){r()}var c=function e(){G(function(){if(u){d(f(n.nodeFocusedBeforeActivation))}if(s){s()}})};if(u&&l){l(f(n.nodeFocusedBeforeActivation)).then(c,c);return this}c();return this},pause:function e(){if(n.paused||!n.active){return this}n.paused=true;y();return this},unpause:function e(){if(!n.paused||!n.active){return this}n.paused=false;c();g();return this},updateContainerElements:function e(e){var t=[].concat(e).filter(Boolean);n.containers=t.map(function(e){return typeof e==="string"?r.querySelector(e):e});if(n.active){c()}return this}};o.updateContainerElements(e);return o};
function V(e){let t;let r;window.addEventListener("focusin",()=>{t=r;r=document.activeElement});e.magic("focus",e=>{let i=e;return{__noscroll:false,__wrapAround:false,within(e){i=e;return this},withoutScrolling(){this.__noscroll=true;return this},noscroll(){this.__noscroll=true;return this},withWrapAround(){this.__wrapAround=true;return this},wrap(){return this.withWrapAround()},focusable(e){return k(e)},previouslyFocused(){return t},lastFocused(){return t},focused(){return r},focusables(){if(Array.isArray(i))return i;return N(i,{displayCheck:"none"})},all(){return this.focusables()},isFirst(e){let t=this.all();return t[0]&&t[0].isSameNode(e)},isLast(e){let t=this.all();return t.length&&t.slice(-1)[0].isSameNode(e)},getFirst(){return this.all()[0]},getLast(){return this.all().slice(-1)[0]},getNext(){let e=this.all();let t=document.activeElement;if(e.indexOf(t)===-1)return;if(this.__wrapAround&&e.indexOf(t)===e.length-1){return e[0]}return e[e.indexOf(t)+1]},getPrevious(){let e=this.all();let t=document.activeElement;if(e.indexOf(t)===-1)return;if(this.__wrapAround&&e.indexOf(t)===0){return e.slice(-1)[0]}return e[e.indexOf(t)-1]},first(){this.focus(this.getFirst())},last(){this.focus(this.getLast())},next(){this.focus(this.getNext())},previous(){this.focus(this.getPrevious())},prev(){return this.previous()},focus(e){if(!e)return;setTimeout(()=>{if(!e.hasAttribute("tabindex"))e.setAttribute("tabindex","0");e.focus({preventScroll:this.__noscroll})})}}});e.directive("trap",e.skipDuringClone((t,{expression:r,modifiers:i},{effect:n,evaluateLater:o,cleanup:a})=>{let s=o(r);let l=false;let u={escapeDeactivates:false,allowOutsideClick:true,fallbackFocus:()=>t};let c=()=>{};if(i.includes("noautofocus")){u.initialFocus=false}else{let e=t.querySelector("[autofocus]");if(e)u.initialFocus=e}if(i.includes("inert")){u.onPostActivate=()=>{e.nextTick(()=>{c=q(t)})}}let d=z(t,u);let f=()=>{};const h=()=>{c();c=()=>{};f();f=()=>{};d.deactivate({returnFocus:!i.includes("noreturn")})};n(()=>s(e=>{if(l===e)return;if(e&&!l){if(i.includes("noscroll"))f=K();setTimeout(()=>{d.activate()},15)}if(!e&&l){h()}l=!!e}));a(h)},
(e,{expression:t,modifiers:r},{evaluate:i})=>{if(r.includes("inert")&&i(t))q(e)}))}function q(e){let t=[];W(e,e=>{let r=e.hasAttribute("aria-hidden");e.setAttribute("aria-hidden","true");t.push(()=>r||e.removeAttribute("aria-hidden"))});return()=>{while(t.length)t.pop()()}}function W(e,t){if(e.isSameNode(document.body)||!e.parentNode)return;Array.from(e.parentNode.children).forEach(r=>{if(r.isSameNode(e)){W(e.parentNode,t)}else{t(r)}})}function K(){let e=document.documentElement.style.overflow;let t=document.documentElement.style.paddingRight;let r=window.innerWidth-document.documentElement.clientWidth;document.documentElement.style.overflow="hidden";document.documentElement.style.paddingRight=`${r}px`;return()=>{document.documentElement.style.overflow=e;document.documentElement.style.paddingRight=t}}
var Y=V;;
var Q=false;var Z=false;var X=[];var J=-1;function ee(e){et(e)}function et(e){if(!X.includes(e))X.push(e);ei()}function er(e){let t=X.indexOf(e);if(t!==-1&&t>J)X.splice(t,1)}function ei(){if(!Z&&!Q){Q=true;queueMicrotask(en)}}function en(){Q=false;Z=true;for(let e=0;e<X.length;e++){X[e]();J=e}X.length=0;J=-1;Z=false}
var eo;var ea;var es;var el;var eu=true;function ec(e){eu=false;e();eu=true}function ed(e){eo=e.reactive;es=e.release;ea=t=>e.effect(t,{scheduler:e=>{if(eu){ee(e)}else{e()}}});el=e.raw}function ef(e){ea=e}function eh(e){let t=()=>{};let r=r=>{let i=ea(r);if(!e._x_effects){e._x_effects=new Set;e._x_runEffects=()=>{e._x_effects.forEach(e=>e())}}e._x_effects.add(i);t=()=>{if(i===void 0)return;e._x_effects.delete(i);es(i)};return i};return[r,()=>{t()}]}function e_(e,t){let r=true;let i;let n=ea(()=>{let n=e();JSON.stringify(n);if(!r){queueMicrotask(()=>{t(n,i);i=n})}else{i=n}r=false});return()=>es(n)}
var ep=[];var ev=[];var em=[];function eg(e){em.push(e)}function ey(e,t){if(typeof t==="function"){if(!e._x_cleanups)e._x_cleanups=[];e._x_cleanups.push(t)}else{t=e;ev.push(t)}}function eE(e){ep.push(e)}function eb(e,t,r){if(!e._x_attributeCleanups)e._x_attributeCleanups={};if(!e._x_attributeCleanups[t])e._x_attributeCleanups[t]=[];e._x_attributeCleanups[t].push(r)}function eT(e,t){if(!e._x_attributeCleanups)return;Object.entries(e._x_attributeCleanups).forEach(([r,i])=>{if(t===void 0||t.includes(r)){i.forEach(e=>e());delete e._x_attributeCleanups[r]}})}function ew(e){e._x_effects?.forEach(er);while(e._x_cleanups?.length)e._x_cleanups.pop()()}var eA=new MutationObserver(eM);var eO=false;function ex(){eA.observe(document,{subtree:true,childList:true,attributes:true,attributeOldValue:true});eO=true}function eS(){eN();eA.disconnect();eO=false}var eC=[];function eN(){let e=eA.takeRecords();eC.push(()=>e.length>0&&eM(e));let t=eC.length;queueMicrotask(()=>{if(eC.length===t){while(eC.length>0)eC.shift()()}})}function eL(e){if(!eO)return e();eS();let t=e();ex();return t}var eP=false;var ek=[];function eR(){eP=true}function eI(){eP=false;eM(ek);ek=[]}function eM(e){if(eP){ek=ek.concat(e);return}let t=[];let r=new Set;let i=new Map;let n=new Map;for(let o=0;o<e.length;o++){if(e[o].target._x_ignoreMutationObserver)continue;if(e[o].type==="childList"){e[o].removedNodes.forEach(e=>{if(e.nodeType!==1)return;if(!e._x_marker)return;r.add(e)});e[o].addedNodes.forEach(e=>{if(e.nodeType!==1)return;if(r.has(e)){r.delete(e);return}if(e._x_marker)return;t.push(e)})}if(e[o].type==="attributes"){let t=e[o].target;let r=e[o].attributeName;let a=e[o].oldValue;let s=()=>{if(!i.has(t))i.set(t,[]);i.get(t).push({name:r,value:t.getAttribute(r)})};let l=()=>{if(!n.has(t))n.set(t,[]);n.get(t).push(r)};if(t.hasAttribute(r)&&a===null){s()}else if(t.hasAttribute(r)){l();s()}else{l()}}}n.forEach((e,t)=>{eT(t,e)});i.forEach((e,t)=>{ep.forEach(r=>r(t,e))});for(let e of r){if(t.some(t=>t.contains(e)))continue;ev.forEach(t=>t(e))}for(let e of t){if(!e.isConnected)continue;em.forEach(t=>t(e))}t=null;r=null;i=null;n=null}
function eD(e){return eU(eF(e))}function eB(e,t,r){e._x_dataStack=[t,...eF(r||e)];return()=>{e._x_dataStack=e._x_dataStack.filter(e=>e!==t)}}function eF(e){if(e._x_dataStack)return e._x_dataStack;if(typeof ShadowRoot==="function"&&e instanceof ShadowRoot){return eF(e.host)}if(!e.parentNode){return[]}return eF(e.parentNode)}function eU(e){return new Proxy({objects:e},eG)}var eG={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(e=>Object.keys(e))))},has({objects:e},t){if(t==Symbol.unscopables)return false;return e.some(e=>Object.prototype.hasOwnProperty.call(e,t)||Reflect.has(e,t))},get({objects:e},t,r){if(t=="toJSON")return e$;return Reflect.get(e.find(e=>Reflect.has(e,t))||{},t,r)},set({objects:e},t,r,i){const n=e.find(e=>Object.prototype.hasOwnProperty.call(e,t))||e[e.length-1];const o=Object.getOwnPropertyDescriptor(n,t);if(o?.set&&o?.get)return o.set.call(i,r)||true;return Reflect.set(n,t,r)}};function e$(){let e=Reflect.ownKeys(this);return e.reduce((e,t)=>{e[t]=Reflect.get(this,t);return e},{})}
function eH(e){let t=e=>typeof e==="object"&&!Array.isArray(e)&&e!==null;let r=(i,n="")=>{Object.entries(Object.getOwnPropertyDescriptors(i)).forEach(([o,{value:a,enumerable:s}])=>{if(s===false||a===void 0)return;if(typeof a==="object"&&a!==null&&a.__v_skip)return;let l=n===""?o:`${n}.${o}`;if(typeof a==="object"&&a!==null&&a._x_interceptor){i[o]=a.initialize(e,l,o)}else{if(t(a)&&a!==i&&!(a instanceof Element)){r(a,l)}}})};return r(e)}function ej(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:true,initialize(t,r,i){return e(this.initialValue,()=>ez(t,r),e=>eV(t,r,e),r,i)}};t(r);return e=>{if(typeof e==="object"&&e!==null&&e._x_interceptor){let t=r.initialize.bind(r);r.initialize=(i,n,o)=>{let a=e.initialize(i,n,o);r.initialValue=a;return t(i,n,o)}}else{r.initialValue=e}return r}}function ez(e,t){return t.split(".").reduce((e,t)=>e[t],e)}function eV(e,t,r){if(typeof t==="string")t=t.split(".");if(t.length===1)e[t[0]]=r;else if(t.length===0)throw error;else{if(e[t[0]])return eV(e[t[0]],t.slice(1),r);else{e[t[0]]={};return eV(e[t[0]],t.slice(1),r)}}}
var eq={};function eW(e,t){eq[e]=t}function eK(e,t){let r=eY(t);Object.entries(eq).forEach(([i,n])=>{Object.defineProperty(e,`$${i}`,{get(){return n(t,r)},enumerable:false})});return e}function eY(e){let[t,r]=tp(e);let i={interceptor:ej,...t};ey(e,r);return i}
function eQ(e,t,r,...i){try{return r(...i)}catch(r){eZ(r,e,t)}}function eZ(...e){return eX(...e)}var eX=e0;function eJ(e){eX=e}function e0(e,t,r=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:r});console.warn(`Alpine Expression Error: ${e.message}
${r?'Expression: "'+r+'"\n\n':""}`,t);setTimeout(()=>{throw e},0)}
var e1=true;function e2(e){let t=e1;e1=false;let r=e();e1=t;return r}function e4(e,t,r={}){let i;e3(e,t)(e=>i=e,r);return i}function e3(...e){return e8(...e)}var e8=e9;function e5(e){e8=e}function e9(e,t){let r={};eK(r,e);let i=[r,...eF(e)];let n=typeof t==="function"?e6(i,t):tt(i,t,e);return eQ.bind(null,e,t,n)}function e6(e,t){return(r=()=>{},{scope:i={},params:n=[],context:o}={})=>{let a=t.apply(eU([i,...e]),n);tr(r,a)}}var e7={};function te(e,t){if(e7[e]){return e7[e]}let r=Object.getPrototypeOf(async function(){}).constructor;let i=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e}})()`:e;const n=()=>{try{let t=new r(["__self","scope"],`with (scope){ __self.result=${i}}; __self.finished=true; return __self.result;`);Object.defineProperty(t,"name",{value:`[Alpine] ${e}`});return t}catch(r){eZ(r,t,e);return Promise.resolve()}};let o=n();e7[e]=o;return o}function tt(e,t,r){let i=te(t,r);return(n=()=>{},{scope:o={},params:a=[],context:s}={})=>{i.result=void 0;i.finished=false;let l=eU([o,...e]);if(typeof i==="function"){let e=i.call(s,i,l).catch(e=>eZ(e,r,t));if(i.finished){tr(n,i.result,l,a,r);i.result=void 0}else{e.then(e=>{tr(n,e,l,a,r)}).catch(e=>eZ(e,r,t)).finally(()=>i.result=void 0)}}}}function tr(e,t,r,i,n){if(e1&&typeof t==="function"){let o=t.apply(r,i);if(o instanceof Promise){o.then(t=>tr(e,t,r,i)).catch(e=>eZ(e,n,t))}else{e(o)}}else if(typeof t==="object"&&t instanceof Promise){t.then(t=>e(t))}else{e(t)}}
var ti="x-";function tn(e=""){return ti+e}function to(e){ti=e}var ta={};function ts(e,t){ta[e]=t;return{before(t){if(!ta[t]){console.warn(String.raw`Cannot find directive \`${t}\`. \`${e}\` will use the default order of execution`);return}const r=tx.indexOf(t);tx.splice(r>=0?r:tx.indexOf("DEFAULT"),0,e)}}}function tl(e){return Object.keys(ta).includes(e)}function tu(e,t,r){t=Array.from(t);if(e._x_virtualDirectives){let r=Object.entries(e._x_virtualDirectives).map(([e,t])=>({name:e,value:t}));let i=tc(r);r=r.map(e=>{if(i.find(t=>t.name===e.name)){return{name:`x-bind:${e.name}`,value:`"${e.value}"`}}return e});t=t.concat(r)}let i={};let n=t.map(ty((e,t)=>i[e]=t)).filter(tT).map(tA(i,r)).sort(tS);return n.map(t=>{return tv(e,t)})}function tc(e){return Array.from(e).map(ty()).filter(e=>!tT(e))}var td=false;var tf=new Map;var th=Symbol();function t_(e){td=true;let t=Symbol();th=t;tf.set(t,[]);let r=()=>{while(tf.get(t).length)tf.get(t).shift()();tf.delete(t)};let i=()=>{td=false;r()};e(r);i()}function tp(e){let t=[];let r=e=>t.push(e);let[i,n]=eh(e);t.push(n);let o={Alpine:rZ,effect:i,cleanup:r,evaluateLater:e3.bind(e3,e),evaluate:e4.bind(e4,e)};let a=()=>t.forEach(e=>e());return[o,a]}function tv(e,t){let r=()=>{};let i=ta[t.type]||r;let[n,o]=tp(e);eb(e,t.original,o);let a=()=>{if(e._x_ignore||e._x_ignoreSelf)return;i.inline&&i.inline(e,t,n);i=i.bind(i,e,t,n);td?tf.get(th).push(i):i()};a.runCleanups=o;return a}var tm=(e,t)=>({name:r,value:i})=>{if(r.startsWith(e))r=r.replace(e,t);return{name:r,value:i}};var tg=e=>e;function ty(e=()=>{}){return({name:t,value:r})=>{let{name:i,value:n}=tE.reduce((e,t)=>{return t(e)},{name:t,value:r});if(i!==t)e(i,t);return{name:i,value:n}}}var tE=[];function tb(e){tE.push(e)}function tT({name:e}){return tw().test(e)}var tw=()=>new RegExp(`^${ti}([^:^.]+)\\b`);function tA(e,t){return({name:r,value:i})=>{let n=r.match(tw());let o=r.match(/:([a-zA-Z0-9\-_:]+)/);let a=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[];let s=t||e[r]||r;return{type:n?n[1]:null,value:o?o[1]:null,modifiers:a.map(e=>e.replace(".","")),expression:i,original:s}}}var tO="DEFAULT";var tx=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",tO,"teleport"];function tS(e,t){let r=tx.indexOf(e.type)===-1?tO:e.type;let i=tx.indexOf(t.type)===-1?tO:t.type;return tx.indexOf(r)-tx.indexOf(i)}
function tC(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:true,
composed:true,cancelable:true}))}
function tN(e,t){if(typeof ShadowRoot==="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(e=>tN(e,t));return}let r=false;t(e,()=>r=true);if(r)return;let i=e.firstElementChild;while(i){tN(i,t,false);i=i.nextElementSibling}}
function tL(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}
var tP=false;function tk(){if(tP)tL("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.");tP=true;if(!document.body)tL("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");tC(document,"alpine:init");tC(document,"alpine:initializing");ex();eg(e=>tV(e,tN));ey(e=>tq(e));eE((e,t)=>{tu(e,t).forEach(e=>e())});let e=e=>!tU(e.parentElement,true);Array.from(document.querySelectorAll(tD().join(","))).filter(e).forEach(e=>{tV(e)});tC(document,"alpine:initialized");setTimeout(()=>{tW()})}var tR=[];var tI=[];function tM(){return tR.map(e=>e())}function tD(){return tR.concat(tI).map(e=>e())}function tB(e){tR.push(e)}function tF(e){tI.push(e)}function tU(e,t=false){return tG(e,e=>{const r=t?tD():tM();if(r.some(t=>e.matches(t)))return true})}function tG(e,t){if(!e)return;if(t(e))return e;if(e._x_teleportBack)e=e._x_teleportBack;if(!e.parentElement)return;return tG(e.parentElement,t)}function t$(e){return tM().some(t=>e.matches(t))}var tH=[];function tj(e){tH.push(e)}var tz=1;function tV(e,t=tN,r=()=>{}){if(tG(e,e=>e._x_ignore))return;t_(()=>{t(e,(e,t)=>{if(e._x_marker)return;r(e,t);tH.forEach(r=>r(e,t));tu(e,e.attributes).forEach(e=>e());if(!e._x_ignore)e._x_marker=tz++;e._x_ignore&&t()})})}function tq(e,t=tN){t(e,e=>{ew(e);eT(e);delete e._x_marker})}function tW(){let e=[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]];e.forEach(([e,t,r])=>{if(tl(t))return;r.some(t=>{if(document.querySelector(t)){tL(`found "${t}", but missing ${e} plugin`);return true}})})}
var tK=[];var tY=false;function tQ(e=()=>{}){queueMicrotask(()=>{tY||setTimeout(()=>{tZ()})});return new Promise(t=>{tK.push(()=>{e();t()})})}function tZ(){tY=false;while(tK.length)tK.shift()()}function tX(){tY=true}
function tJ(e,t){if(Array.isArray(t)){return t0(e,t.join(" "))}else if(typeof t==="object"&&t!==null){return t1(e,t)}else if(typeof t==="function"){return tJ(e,t())}return t0(e,t)}function t0(e,t){let r=e=>e.split(" ").filter(Boolean);let i=t=>t.split(" ").filter(t=>!e.classList.contains(t)).filter(Boolean);let n=t=>{e.classList.add(...t);return()=>{e.classList.remove(...t)}};t=t===true?t="":t||"";return n(i(t))}function t1(e,t){let r=e=>e.split(" ").filter(Boolean);let i=Object.entries(t).flatMap(([e,t])=>t?r(e):false).filter(Boolean);let n=Object.entries(t).flatMap(([e,t])=>!t?r(e):false).filter(Boolean);let o=[];let a=[];n.forEach(t=>{if(e.classList.contains(t)){e.classList.remove(t);a.push(t)}});i.forEach(t=>{if(!e.classList.contains(t)){e.classList.add(t);o.push(t)}});return()=>{a.forEach(t=>e.classList.add(t));o.forEach(t=>e.classList.remove(t))}}
function t2(e,t){if(typeof t==="object"&&t!==null){return t4(e,t)}return t3(e,t)}function t4(e,t){let r={};Object.entries(t).forEach(([t,i])=>{r[t]=e.style[t];if(!t.startsWith("--")){t=t8(t)}e.style.setProperty(t,i)});setTimeout(()=>{if(e.style.length===0){e.removeAttribute("style")}});return()=>{t2(e,r)}}function t3(e,t){let r=e.getAttribute("style",t);e.setAttribute("style",t);return()=>{e.setAttribute("style",r||"")}}function t8(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}
function t5(e,t=()=>{}){let r=false;return function(){if(!r){r=true;e.apply(this,arguments)}else{t.apply(this,arguments)}}}
ts("transition",(e,{value:t,modifiers:r,expression:i},{evaluate:n})=>{if(typeof i==="function")i=n(i);if(i===false)return;if(!i||typeof i==="boolean"){t6(e,r,t)}else{t9(e,i,t)}});function t9(e,t,r){t7(e,tJ,"");let i={"enter":t=>{e._x_transition.enter.during=t},"enter-start":t=>{e._x_transition.enter.start=t},"enter-end":t=>{e._x_transition.enter.end=t},"leave":t=>{e._x_transition.leave.during=t},"leave-start":t=>{e._x_transition.leave.start=t},"leave-end":t=>{e._x_transition.leave.end=t}};i[r](t)}function t6(e,t,r){t7(e,t2);let i=!t.includes("in")&&!t.includes("out")&&!r;let n=i||t.includes("in")||["enter"].includes(r);let o=i||t.includes("out")||["leave"].includes(r);if(t.includes("in")&&!i){t=t.filter((e,r)=>r<t.indexOf("out"))}if(t.includes("out")&&!i){t=t.filter((e,r)=>r>t.indexOf("out"))}let a=!t.includes("opacity")&&!t.includes("scale");let s=a||t.includes("opacity");let l=a||t.includes("scale");let u=s?0:1;let c=l?ri(t,"scale",95)/100:1;let d=ri(t,"delay",0)/1e3;let f=ri(t,"origin","center");let h="opacity, transform";let _=ri(t,"duration",150)/1e3;let p=ri(t,"duration",75)/1e3;let v=`cubic-bezier(0.4, 0.0, 0.2, 1)`;if(n){e._x_transition.enter.during={transformOrigin:f,transitionDelay:`${d}s`,transitionProperty:h,transitionDuration:`${_}s`,transitionTimingFunction:v};e._x_transition.enter.start={opacity:u,transform:`scale(${c})`};e._x_transition.enter.end={opacity:1,transform:`scale(1)`}}if(o){e._x_transition.leave.during={transformOrigin:f,transitionDelay:`${d}s`,transitionProperty:h,transitionDuration:`${p}s`,transitionTimingFunction:v};e._x_transition.leave.start={opacity:1,transform:`scale(1)`};e._x_transition.leave.end={opacity:u,transform:`scale(${c})`}}}function t7(e,t,r={}){if(!e._x_transition)e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(r=()=>{},i=()=>{}){rt(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},r,i)},out(r=()=>{},i=()=>{}){rt(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},r,i)}}}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,i){const n=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let o=()=>n(r);if(t){if(e._x_transition&&(e._x_transition.enter||e._x_transition.leave)){e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(r):o()}else{e._x_transition?e._x_transition.in(r):o()}return}e._x_hidePromise=e._x_transition?new Promise((t,r)=>{e._x_transition.out(()=>{},()=>t(i));e._x_transitioning&&e._x_transitioning.beforeCancel(()=>r({isFromCancelledTransition:true}))}):Promise.resolve(i);queueMicrotask(()=>{let t=re(e);if(t){if(!t._x_hideChildren)t._x_hideChildren=[];t._x_hideChildren.push(e)}else{n(()=>{let t=e=>{let r=Promise.all([e._x_hidePromise,...(e._x_hideChildren||[]).map(t)]).then(([e])=>e?.());delete e._x_hidePromise;delete e._x_hideChildren;return r};t(e).catch(e=>{if(!e.isFromCancelledTransition)throw e})})}})};function re(e){let t=e.parentNode;if(!t)return;return t._x_hidePromise?t:re(t)}function rt(e,t,{during:r,start:i,end:n}={},o=()=>{},a=()=>{}){if(e._x_transitioning)e._x_transitioning.cancel();if(Object.keys(r).length===0&&Object.keys(i).length===0&&Object.keys(n).length===0){o();a();return}let s,l,u;rr(e,{start(){s=t(e,i)},during(){l=t(e,r)},before:o,end(){s();u=t(e,n)},after:a,cleanup(){l();u()}})}function rr(e,t){let r,i,n;let o=t5(()=>{eL(()=>{r=true;if(!i)t.before();if(!n){t.end();tZ()}t.after();if(e.isConnected)t.cleanup();delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(e){this.beforeCancels.push(e)},cancel:t5(function(){while(this.beforeCancels.length){this.beforeCancels.shift()()};o()}),finish:o};eL(()=>{t.start();t.during()});tX();requestAnimationFrame(()=>{if(r)return;let o=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3;let a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;if(o===0)o=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3;eL(()=>{t.before()});i=true;requestAnimationFrame(()=>{if(r)return;eL(()=>{t.end()});tZ();setTimeout(e._x_transitioning.finish,o+a);n=true})})}function ri(e,t,r){if(e.indexOf(t)===-1)return r;const i=e[e.indexOf(t)+1];if(!i)return r;if(t==="scale"){if(isNaN(i))return r}if(t==="duration"||t==="delay"){let e=i.match(/([0-9]+)ms/);if(e)return e[1]}if(t==="origin"){if(["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])){return[i,e[e.indexOf(t)+2]].join(" ")}}return i}
var rn=false;function ro(e,t=()=>{}){return(...r)=>rn?t(...r):e(...r)}function ra(e){return(...t)=>rn&&e(...t)}var rs=[];function rl(e){rs.push(e)}function ru(e,t){rs.forEach(r=>r(e,t));rn=true;rh(()=>{tV(t,(e,t)=>{t(e,()=>{})})});rn=false}var rc=false;function rd(e,t){if(!t._x_dataStack)t._x_dataStack=e._x_dataStack;rn=true;rc=true;rh(()=>{rf(t)});rn=false;rc=false}function rf(e){let t=false;let r=(e,r)=>{tN(e,(e,i)=>{if(t&&t$(e))return i();t=true;r(e,i)})};tV(e,r)}function rh(e){let t=ea;ef((e,r)=>{let i=t(e);es(i);return()=>{}});e();ef(t)}
function r_(e,t,r,i=[]){if(!e._x_bindings)e._x_bindings=eo({});e._x_bindings[t]=r;t=i.includes("camel")?rw(t):t;switch(t){case"value":rp(e,r);break;case"style":rm(e,r);break;case"class":rv(e,r);break;case"selected":case"checked":rg(e,t,r);break;default:ry(e,t,r);break}}function rp(e,t){if(rR(e)){if(e.attributes.value===void 0){e.value=t}if(window.fromModel){if(typeof t==="boolean"){e.checked=rO(e.value)===t}else{e.checked=rA(e.value,t)}}}else if(rk(e)){if(Number.isInteger(t)){e.value=t}else if(!Array.isArray(t)&&typeof t!=="boolean"&&![null,void 0].includes(t)){e.value=String(t)}else{if(Array.isArray(t)){e.checked=t.some(t=>rA(t,e.value))}else{e.checked=!!t}}}else if(e.tagName==="SELECT"){rT(e,t)}else{if(e.value===t)return;e.value=t===void 0?"":t}}function rv(e,t){if(e._x_undoAddedClasses)e._x_undoAddedClasses();e._x_undoAddedClasses=tJ(e,t)}function rm(e,t){if(e._x_undoAddedStyles)e._x_undoAddedStyles();e._x_undoAddedStyles=t2(e,t)}function rg(e,t,r){ry(e,t,r);rb(e,t,r)}function ry(e,t,r){if([null,void 0,false].includes(r)&&rC(t)){e.removeAttribute(t)}else{if(rS(t))r=t;rE(e,t,r)}}function rE(e,t,r){if(e.getAttribute(t)!=r){e.setAttribute(t,r)}}function rb(e,t,r){if(e[t]!==r){e[t]=r}}function rT(e,t){const r=[].concat(t).map(e=>{return e+""});Array.from(e.options).forEach(e=>{e.selected=r.includes(e.value)})}function rw(e){return e.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function rA(e,t){return e==t}function rO(e){if([1,"1","true","on","yes",true].includes(e)){return true}if([0,"0","false","off","no",false].includes(e)){return false}return e?Boolean(e):null}var rx=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function rS(e){return rx.has(e)}function rC(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function rN(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];return rP(e,t,r)}function rL(e,t,r,i=true){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let r=e._x_inlineBindings[t];r.extract=i;return e2(()=>{return e4(e,r.expression)})}return rP(e,t,r)}function rP(e,t,r){let i=e.getAttribute(t);if(i===null)return typeof r==="function"?r():r;if(i==="")return true;if(rS(t)){return!![t,"true"].includes(i)}return i}function rk(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function rR(e){return e.type==="radio"||e.localName==="ui-radio"}
function rI(e,t){let r;return function(){const i=this,n=arguments;const o=function(){r=null;e.apply(i,n)};clearTimeout(r);r=setTimeout(o,t)}}
function rM(e,t){let r;return function(){let i=this,n=arguments;if(!r){e.apply(i,n);r=true;setTimeout(()=>r=false,t)}}}
function rD({get:e,set:t},{get:r,set:i}){let n=true;let o;let a;let s=ea(()=>{let s=e();let l=r();if(n){i(rB(s));n=false}else{let e=JSON.stringify(s);let r=JSON.stringify(l);if(e!==o){i(rB(s))}else if(e!==r){t(rB(l))}else{}}o=JSON.stringify(e());a=JSON.stringify(r())});return()=>{es(s)}}function rB(e){return typeof e==="object"?JSON.parse(JSON.stringify(e)):e}
function rF(e){let t=Array.isArray(e)?e:[e];t.forEach(e=>e(rZ))}
var rU={};var rG=false;function r$(e,t){if(!rG){rU=eo(rU);rG=true}if(t===void 0){return rU[e]}rU[e]=t;eH(rU[e]);if(typeof t==="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init==="function"){rU[e].init()}}function rH(){return rU}
var rj={};function rz(e,t){let r=typeof t!=="function"?()=>t:t;if(e instanceof Element){return rq(e,r())}else{rj[e]=r}return()=>{}}function rV(e){Object.entries(rj).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...e)=>{return r(...e)}}})});return e}function rq(e,t,r){let i=[];while(i.length)i.pop()();let n=Object.entries(t).map(([e,t])=>({name:e,value:t}));let o=tc(n);n=n.map(e=>{if(o.find(t=>t.name===e.name)){return{name:`x-bind:${e.name}`,value:`"${e.value}"`}}return e});tu(e,n,r).map(e=>{i.push(e.runCleanups);e()});return()=>{while(i.length)i.pop()()}}
var rW={};function rK(e,t){rW[e]=t}function rY(e,t){Object.entries(rW).forEach(([r,i])=>{Object.defineProperty(e,r,{get(){return(...e)=>{return i.bind(t)(...e)}},enumerable:false})});return e}
var rQ={get reactive(){return eo},get release(){return es},get effect(){return ea},get raw(){return el},version:"3.15.2",flushAndStopDeferringMutations:eI,dontAutoEvaluateFunctions:e2,disableEffectScheduling:ec,startObservingMutations:ex,stopObservingMutations:eS,setReactivityEngine:ed,onAttributeRemoved:eb,onAttributesAdded:eE,closestDataStack:eF,skipDuringClone:ro,onlyDuringClone:ra,addRootSelector:tB,addInitSelector:tF,setErrorHandler:eJ,interceptClone:rl,addScopeToNode:eB,deferMutations:eR,mapAttributes:tb,evaluateLater:e3,interceptInit:tj,setEvaluator:e5,mergeProxies:eU,extractProp:rL,findClosest:tG,onElRemoved:ey,closestRoot:tU,destroyTree:tq,interceptor:ej,
transition:rt,
setStyles:t2,
mutateDom:eL,directive:ts,entangle:rD,throttle:rM,debounce:rI,evaluate:e4,initTree:tV,nextTick:tQ,prefixed:tn,prefix:to,plugin:rF,magic:eW,store:r$,start:tk,clone:rd,
cloneNode:ru,
bound:rN,$data:eD,watch:e_,walk:tN,data:rK,bind:rz};var rZ=rQ;
function rX(e,t){const r=Object.create(null);const i=e.split(",");for(let e=0;e<i.length;e++){r[i[e]]=true}return t?e=>!!r[e.toLowerCase()]:e=>!!r[e]}var rJ=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;var r0=rX(rJ+`,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);var r1=true?Object.freeze({}):0;var r2=true?Object.freeze([]):0;var r4=Object.prototype.hasOwnProperty;var r3=(e,t)=>r4.call(e,t);var r8=Array.isArray;var r5=e=>it(e)==="[object Map]";var r9=e=>typeof e==="string";var r6=e=>typeof e==="symbol";var r7=e=>e!==null&&typeof e==="object";var ie=Object.prototype.toString;var it=e=>ie.call(e);var ir=e=>{return it(e).slice(8,-1)};var ii=e=>r9(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var io=e=>{const t=Object.create(null);return r=>{const i=t[r];return i||(t[r]=e(r))}};var ia=/-(\w)/g;var is=io(e=>{return e.replace(ia,(e,t)=>t?t.toUpperCase():"")});var il=/\B([A-Z])/g;var iu=io(e=>e.replace(il,"-$1").toLowerCase());var ic=io(e=>e.charAt(0).toUpperCase()+e.slice(1));var id=io(e=>e?`on${ic(e)}`:``);var ih=(e,t)=>e!==t&&(e===e||t===t);
var i_=new WeakMap;var ip=[];var iv;var im=Symbol(true?"iterate":0);var ig=Symbol(true?"Map key iterate":0);function iy(e){return e&&e._isEffect===true}function iE(e,t=r1){if(iy(e)){e=e.raw}const r=iw(e,t);if(!t.lazy){r()}return r}function ib(e){if(e.active){iA(e);if(e.options.onStop){e.options.onStop()}e.active=false}}var iT=0;function iw(e,t){const r=function t(){if(!r.active){return e()}if(!ip.includes(r)){iA(r);try{iC();ip.push(r);iv=r;return e()}finally{ip.pop();iN();iv=ip[ip.length-1]}}};r.id=iT++;r.allowRecurse=!!t.allowRecurse;r._isEffect=true;r.active=true;r.raw=e;r.deps=[];r.options=t;return r}function iA(e){const{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++){t[r].delete(e)}t.length=0}}var iO=true;var ix=[];function iS(){ix.push(iO);iO=false}function iC(){ix.push(iO);iO=true}function iN(){const e=ix.pop();iO=e===void 0?true:e}function iL(e,t,r){if(!iO||iv===void 0){return}let i=i_.get(e);if(!i){i_.set(e,i=new Map)}let n=i.get(r);if(!n){i.set(r,n=new Set)}if(!n.has(iv)){n.add(iv);iv.deps.push(n);if(iv.options.onTrack){iv.options.onTrack({effect:iv,target:e,type:t,key:r})}}}function iP(e,t,r,i,n,o){const a=i_.get(e);if(!a){return}const s=new Set;const l=e=>{if(e){e.forEach(e=>{if(e!==iv||e.allowRecurse){s.add(e)}})}};if(t==="clear"){a.forEach(l)}else if(r==="length"&&r8(e)){a.forEach((e,t)=>{if(t==="length"||t>=i){l(e)}})}else{if(r!==void 0){l(a.get(r))}switch(t){case"add":if(!r8(e)){l(a.get(im));if(r5(e)){l(a.get(ig))}}else if(ii(r)){l(a.get("length"))}break;case"delete":if(!r8(e)){l(a.get(im));if(r5(e)){l(a.get(ig))}}break;case"set":if(r5(e)){l(a.get(im))}break}}const u=a=>{if(a.options.onTrigger){a.options.onTrigger({effect:a,target:e,key:r,type:t,newValue:i,oldValue:n,oldTarget:o})}if(a.options.scheduler){a.options.scheduler(a)}else{a()}};s.forEach(u)}var ik=rX(`__proto__,__v_isRef,__isVue`);var iR=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(r6));var iI=iF();var iM=iF(true);var iD=iB();function iB(){const e={};["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...e){const r=n_(this);for(let e=0,t=this.length;e<t;e++){iL(r,"get",e+"")}const i=r[t](...e);if(i===-1||i===false){return r[t](...e.map(n_))}else{return i}}});["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...e){iS();const r=n_(this)[t].apply(this,e);iN();return r}});return e}function iF(e=false,t=false){return function r(r,i,n){if(i==="__v_isReactive"){return!e}else if(i==="__v_isReadonly"){return e}else if(i==="__v_raw"&&n===(e?t?nl:ns:t?na:no).get(r)){return r}const o=r8(r);if(!e&&o&&r3(iD,i)){return Reflect.get(iD,i,n)}const a=Reflect.get(r,i,n);if(r6(i)?iR.has(i):ik(i)){return a}if(!e){iL(r,"get",i)}if(t){return a}if(np(a)){const e=!o||!ii(i);return e?a.value:a}if(r7(a)){return e?nf(a):nd(a)}return a}}var iU=iG();function iG(e=false){return function t(t,r,i,n){let o=t[r];if(!e){i=n_(i);o=n_(o);if(!r8(t)&&np(o)&&!np(i)){o.value=i;return true}}const a=r8(t)&&ii(r)?Number(r)<t.length:r3(t,r);const s=Reflect.set(t,r,i,n);if(t===n_(n)){if(!a){iP(t,"add",r,i)}else if(ih(i,o)){iP(t,"set",r,i,o)}}return s}}function i$(e,t){const r=r3(e,t);const i=e[t];const n=Reflect.deleteProperty(e,t);if(n&&r){iP(e,"delete",t,void 0,i)}return n}function iH(e,t){const r=Reflect.has(e,t);if(!r6(t)||!iR.has(t)){iL(e,"has",t)}return r}function ij(e){iL(e,"iterate",r8(e)?"length":im);return Reflect.ownKeys(e)}var iz={get:iI,set:iU,deleteProperty:i$,has:iH,ownKeys:ij};var iV={get:iM,set(e,t){if(true){console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e)}return true},deleteProperty(e,t){if(true){console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e)}return true}};var iq=e=>r7(e)?nd(e):e;var iW=e=>r7(e)?nf(e):e;var iK=e=>e;var iY=e=>Reflect.getPrototypeOf(e);function iQ(e,t,r=false,i=false){e=e["__v_raw"];const n=n_(e);const o=n_(t);if(t!==o){!r&&iL(n,"get",t)}!r&&iL(n,"get",o);const{has:a}=iY(n);const s=i?iK:r?iW:iq;if(a.call(n,t)){return s(e.get(t))}else if(a.call(n,o)){return s(e.get(o))}else if(e!==n){e.get(t)}}function iZ(e,t=false){const r=this["__v_raw"];const i=n_(r);const n=n_(e);if(e!==n){!t&&iL(i,"has",e)}!t&&iL(i,"has",n);return e===n?r.has(e):r.has(e)||r.has(n)}function iX(e,t=false){e=e["__v_raw"];!t&&iL(n_(e),"iterate",im);return Reflect.get(e,"size",e)}function iJ(e){e=n_(e);const t=n_(this);const r=iY(t);const i=r.has.call(t,e);if(!i){t.add(e);iP(t,"add",e,e)}return this}function i0(e,t){t=n_(t);const r=n_(this);const{has:i,get:n}=iY(r);let o=i.call(r,e);if(!o){e=n_(e);o=i.call(r,e)}else if(true){nn(r,i,e)}const a=n.call(r,e);r.set(e,t);if(!o){iP(r,"add",e,t)}else if(ih(t,a)){iP(r,"set",e,t,a)}return this}function i1(e){const t=n_(this);const{has:r,get:i}=iY(t);let n=r.call(t,e);if(!n){e=n_(e);n=r.call(t,e)}else if(true){nn(t,r,e)}const o=i?i.call(t,e):void 0;const a=t.delete(e);if(n){iP(t,"delete",e,void 0,o)}return a}function i2(){const e=n_(this);const t=e.size!==0;const r=true?r5(e)?new Map(e):new Set(e):0;const i=e.clear();if(t){iP(e,"clear",void 0,void 0,r)}return i}function i4(e,t){return function r(r,i){const n=this;const o=n["__v_raw"];const a=n_(o);const s=t?iK:e?iW:iq;!e&&iL(a,"iterate",im);return o.forEach((e,t)=>{return r.call(i,s(e),s(t),n)})}}function i3(e,t,r){return function(...i){const n=this["__v_raw"];const o=n_(n);const a=r5(o);const s=e==="entries"||e===Symbol.iterator&&a;const l=e==="keys"&&a;const u=n[e](...i);const c=r?iK:t?iW:iq;!t&&iL(o,"iterate",l?ig:im);return{
next(){const{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:s?[c(e[0]),c(e[1])]:c(e),done:t}},
[Symbol.iterator](){return this}}}}function i8(e){return function(...t){if(true){const r=t[0]?`on key "${t[0]}" `:``;console.warn(`${ic(e)} operation ${r}failed: target is readonly.`,n_(this))}return e==="delete"?false:this}}function i5(){const e={get(e){return iQ(this,e)},get size(){return iX(this)},has:iZ,add:iJ,set:i0,delete:i1,clear:i2,forEach:i4(false,false)};const t={get(e){return iQ(this,e,false,true)},get size(){return iX(this)},has:iZ,add:iJ,set:i0,delete:i1,clear:i2,forEach:i4(false,true)};const r={get(e){return iQ(this,e,true)},get size(){return iX(this,true)},has(e){return iZ.call(this,e,true)},add:i8("add"),set:i8("set"),delete:i8("delete"),clear:i8("clear"),forEach:i4(true,false)};const i={get(e){return iQ(this,e,true,true)},get size(){return iX(this,true)},has(e){return iZ.call(this,e,true)},add:i8("add"),set:i8("set"),delete:i8("delete"),clear:i8("clear"),forEach:i4(true,true)};const n=["keys","values","entries",Symbol.iterator];n.forEach(n=>{e[n]=i3(n,false,false);r[n]=i3(n,true,false);t[n]=i3(n,false,true);i[n]=i3(n,true,true)});return[e,r,t,i]}var[i9,i6,i7,ne]=i5();function nt(e,t){const r=t?e?ne:i7:e?i6:i9;return(t,i,n)=>{if(i==="__v_isReactive"){return!e}else if(i==="__v_isReadonly"){return e}else if(i==="__v_raw"){return t}return Reflect.get(r3(r,i)&&i in t?r:t,i,n)}}var nr={get:nt(false,false)};var ni={get:nt(true,false)};function nn(e,t,r){const i=n_(r);if(i!==r&&t.call(e,i)){const t=ir(e);console.warn(`Reactive ${t} contains both the raw and reactive versions of the same object${t===`Map`?` as keys`:``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var no=new WeakMap;var na=new WeakMap;var ns=new WeakMap;var nl=new WeakMap;function nu(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function nc(e){return e["__v_skip"]||!Object.isExtensible(e)?0:nu(ir(e))}function nd(e){if(e&&e["__v_isReadonly"]){return e}return nh(e,false,iz,nr,no)}function nf(e){return nh(e,true,iV,ni,ns)}function nh(e,t,r,i,n){if(!r7(e)){if(true){console.warn(`value cannot be made reactive: ${String(e)}`)}return e}if(e["__v_raw"]&&!(t&&e["__v_isReactive"])){return e}const o=n.get(e);if(o){return o}const a=nc(e);if(a===0){return e}const s=new Proxy(e,a===2?i:r);n.set(e,s);return s}function n_(e){return e&&n_(e["__v_raw"])||e}function np(e){return Boolean(e&&e.__v_isRef===true)}
eW("nextTick",()=>tQ);
eW("dispatch",e=>tC.bind(tC,e));
eW("watch",(e,{evaluateLater:t,cleanup:r})=>(e,i)=>{let n=t(e);let o=()=>{let e;n(t=>e=t);return e};let a=e_(o,i);r(a)});
eW("store",rH);
eW("data",e=>eD(e));
eW("root",e=>tU(e));
eW("refs",e=>{if(e._x_refs_proxy)return e._x_refs_proxy;e._x_refs_proxy=eU(nv(e));return e._x_refs_proxy});function nv(e){let t=[];tG(e,e=>{if(e._x_refs)t.push(e._x_refs)});return t}
var nm={};function ng(e){if(!nm[e])nm[e]=0;return++nm[e]}function ny(e,t){return tG(e,e=>{if(e._x_ids&&e._x_ids[t])return true})}function nE(e,t){if(!e._x_ids)e._x_ids={};if(!e._x_ids[t])e._x_ids[t]=ng(t)}
eW("id",(e,{cleanup:t})=>(r,i=null)=>{let n=`${r}${i?`-${i}`:""}`;return nb(e,n,t,()=>{let t=ny(e,r);let n=t?t._x_ids[r]:ng(r);return i?`${r}-${n}-${i}`:`${r}-${n}`})});rl((e,t)=>{if(e._x_id){t._x_id=e._x_id}});function nb(e,t,r,i){if(!e._x_id)e._x_id={};if(e._x_id[t])return e._x_id[t];let n=i();e._x_id[t]=n;r(()=>{delete e._x_id[t]});return n}
eW("el",e=>e);
nT("Focus","focus","focus");nT("Persist","persist","persist");function nT(e,t,r){eW(t,i=>tL(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,i))}// packages/alpinejs/src/directives/x-modelable.js
ts("modelable",(e,{expression:t},{effect:r,evaluateLater:i,cleanup:n})=>{let o=i(t);let a=()=>{let e;o(t=>e=t);return e};let s=i(`${t}=__placeholder`);let l=e=>s(()=>{},{scope:{"__placeholder":e}});let u=a();l(u);queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners["default"]();let t=e._x_model.get;let r=e._x_model.set;let i=rD({get(){return t()},set(e){r(e)}},{get(){return a()},set(e){l(e)}});n(i)})});
ts("teleport",(e,{modifiers:t,expression:r},{cleanup:i})=>{if(e.tagName.toLowerCase()!=="template")tL("x-teleport can only be used on a <template> tag",e);let n=nA(r);let o=e.content.cloneNode(true).firstElementChild;e._x_teleport=o;o._x_teleportBack=e;e.setAttribute("data-teleport-template",true);o.setAttribute("data-teleport-target",true);if(e._x_forwardEvents){e._x_forwardEvents.forEach(t=>{o.addEventListener(t,t=>{t.stopPropagation();e.dispatchEvent(new t.constructor(t.type,t))})})}eB(o,{},e);let a=(e,t,r)=>{if(r.includes("prepend")){t.parentNode.insertBefore(e,t)}else if(r.includes("append")){t.parentNode.insertBefore(e,t.nextSibling)}else{t.appendChild(e)}};eL(()=>{a(o,n,t);ro(()=>{tV(o)})()});e._x_teleportPutBack=()=>{let i=nA(r);eL(()=>{a(e._x_teleport,i,t)})};i(()=>eL(()=>{o.remove();tq(o)}))});var nw=document.createElement("div");function nA(e){let t=ro(()=>{return document.querySelector(e)},()=>{return nw})();if(!t)tL(`Cannot find x-teleport element for selector: "${e}"`);return t}
var nO=()=>{};nO.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=true:e._x_ignore=true;r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};ts("ignore",nO);
ts("effect",ro((e,{expression:t},{effect:r})=>{r(e3(e,t))}));
function nx(e,t,r,i){let n=e;let o=e=>i(e);let a={};let s=(e,t)=>r=>t(e,r);if(r.includes("dot"))t=nS(t);if(r.includes("camel"))t=nC(t);if(r.includes("passive"))a.passive=true;if(r.includes("capture"))a.capture=true;if(r.includes("window"))n=window;if(r.includes("document"))n=document;if(r.includes("debounce")){let e=r[r.indexOf("debounce")+1]||"invalid-wait";let t=nN(e.split("ms")[0])?Number(e.split("ms")[0]):250;o=rI(o,t)}if(r.includes("throttle")){let e=r[r.indexOf("throttle")+1]||"invalid-wait";let t=nN(e.split("ms")[0])?Number(e.split("ms")[0]):250;o=rM(o,t)}if(r.includes("prevent"))o=s(o,(e,t)=>{t.preventDefault();e(t)});if(r.includes("stop"))o=s(o,(e,t)=>{t.stopPropagation();e(t)});if(r.includes("once")){o=s(o,(e,r)=>{e(r);n.removeEventListener(t,o,a)})}if(r.includes("away")||r.includes("outside")){n=document;o=s(o,(t,r)=>{if(e.contains(r.target))return;if(r.target.isConnected===false)return;if(e.offsetWidth<1&&e.offsetHeight<1)return;if(e._x_isShown===false)return;t(r)})}if(r.includes("self"))o=s(o,(t,r)=>{r.target===e&&t(r)});if(nP(t)||nk(t)){o=s(o,(e,t)=>{if(nR(t,r)){return}e(t)})}n.addEventListener(t,o,a);return()=>{n.removeEventListener(t,o,a)}}function nS(e){return e.replace(/-/g,".")}function nC(e){return e.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function nN(e){return!Array.isArray(e)&&!isNaN(e)}function nL(e){if([" ","_"].includes(e))return e;return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function nP(e){return["keydown","keyup"].includes(e)}function nk(e){return["contextmenu","click","mouse"].some(t=>e.includes(t))}function nR(e,t){let r=t.filter(e=>{return!["window","document","prevent","stop","once","capture","self","away","outside","passive","preserve-scroll"].includes(e)});if(r.includes("debounce")){let e=r.indexOf("debounce");r.splice(e,nN((r[e+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.includes("throttle")){let e=r.indexOf("throttle");r.splice(e,nN((r[e+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0)return false;if(r.length===1&&nI(e.key).includes(r[0]))return false;const i=["ctrl","shift","alt","meta","cmd","super"];const n=i.filter(e=>r.includes(e));r=r.filter(e=>!n.includes(e));if(n.length>0){const t=n.filter(t=>{if(t==="cmd"||t==="super")t="meta";return e[`${t}Key`]});if(t.length===n.length){if(nk(e.type))return false;if(nI(e.key).includes(r[0]))return false}}return true}function nI(e){if(!e)return[];e=nL(e);let t={"ctrl":"control","slash":"/","space":" ","spacebar":" ","cmd":"meta","esc":"escape","up":"arrow-up","down":"arrow-down","left":"arrow-left","right":"arrow-right","period":".","comma":",","equal":"=","minus":"-","underscore":"_"};t[e]=e;return Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(e=>e)}
ts("model",(e,{modifiers:t,expression:r},{effect:i,cleanup:n})=>{let o=e;if(t.includes("parent")){o=e.parentNode}let a=e3(o,r);let s;if(typeof r==="string"){s=e3(o,`${r}=__placeholder`)}else if(typeof r==="function"&&typeof r()==="string"){s=e3(o,`${r()}=__placeholder`)}else{s=()=>{}}let l=()=>{let e;a(t=>e=t);return nU(e)?e.get():e};let u=e=>{let t;a(e=>t=e);if(nU(t)){t.set(e)}else{s(()=>{},{scope:{"__placeholder":e}})}};if(typeof r==="string"&&e.type==="radio"){eL(()=>{if(!e.hasAttribute("name"))e.setAttribute("name",r)})}let c=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let d=rn?()=>{}:nx(e,c,t,r=>{u(nM(e,t,r,l()))});if(t.includes("fill")){if([void 0,null,""].includes(l())||rk(e)&&Array.isArray(l())||e.tagName.toLowerCase()==="select"&&e.multiple){u(nM(e,t,{target:e},l()))}}if(!e._x_removeModelListeners)e._x_removeModelListeners={};e._x_removeModelListeners["default"]=d;n(()=>e._x_removeModelListeners["default"]());if(e.form){let r=nx(e.form,"reset",[],r=>{tQ(()=>e._x_model&&e._x_model.set(nM(e,t,{target:e},l())))});n(()=>r())}e._x_model={get(){return l()},set(e){u(e)}};e._x_forceModelUpdate=t=>{if(t===void 0&&typeof r==="string"&&r.match(/\./))t="";window.fromModel=true;eL(()=>r_(e,"value",t));delete window.fromModel};i(()=>{let r=l();if(t.includes("unintrusive")&&document.activeElement.isSameNode(e))return;e._x_forceModelUpdate(r)})});function nM(e,t,r,i){return eL(()=>{if(r instanceof CustomEvent&&r.detail!==void 0)return r.detail!==null&&r.detail!==void 0?r.detail:r.target.value;else if(rk(e)){if(Array.isArray(i)){let e=null;if(t.includes("number")){e=nD(r.target.value)}else if(t.includes("boolean")){e=rO(r.target.value)}else{e=r.target.value}return r.target.checked?i.includes(e)?i:i.concat([e]):i.filter(t=>!nB(t,e))}else{return r.target.checked}}else if(e.tagName.toLowerCase()==="select"&&e.multiple){if(t.includes("number")){return Array.from(r.target.selectedOptions).map(e=>{let t=e.value||e.text;return nD(t)})}else if(t.includes("boolean")){return Array.from(r.target.selectedOptions).map(e=>{let t=e.value||e.text;return rO(t)})}return Array.from(r.target.selectedOptions).map(e=>{return e.value||e.text})}else{let n;if(rR(e)){if(r.target.checked){n=r.target.value}else{n=i}}else{n=r.target.value}if(t.includes("number")){return nD(n)}else if(t.includes("boolean")){return rO(n)}else if(t.includes("trim")){return n.trim()}else{return n}}})}function nD(e){let t=e?parseFloat(e):null;return nF(t)?t:e}function nB(e,t){return e==t}function nF(e){return!Array.isArray(e)&&!isNaN(e)}function nU(e){return e!==null&&typeof e==="object"&&typeof e.get==="function"&&typeof e.set==="function"}
ts("cloak",e=>queueMicrotask(()=>eL(()=>e.removeAttribute(tn("cloak")))));
tF(()=>`[${tn("init")}]`);ts("init",ro((e,{expression:t},{evaluate:r})=>{if(typeof t==="string"){return!!t.trim()&&r(t,{},false)}return r(t,{},false)}));
ts("text",(e,{expression:t},{effect:r,evaluateLater:i})=>{let n=i(t);r(()=>{n(t=>{eL(()=>{e.textContent=t})})})});
ts("html",(e,{expression:t},{effect:r,evaluateLater:i})=>{let n=i(t);r(()=>{n(t=>{eL(()=>{e.innerHTML=t;e._x_ignoreSelf=true;tV(e);delete e._x_ignoreSelf})})})});
tb(tm(":",tg(tn("bind:"))));var nG=(e,{value:t,modifiers:r,expression:i,original:n},{effect:o,cleanup:a})=>{if(!t){let t={};rV(t);let r=e3(e,i);r(t=>{rq(e,t,n)},{scope:t});return}if(t==="key")return n$(e,i);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract){return}let s=e3(e,i);o(()=>s(n=>{if(n===void 0&&typeof i==="string"&&i.match(/\./)){n=""}eL(()=>r_(e,t,n,r))}));a(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses();e._x_undoAddedStyles&&e._x_undoAddedStyles()})};nG.inline=(e,{value:t,modifiers:r,expression:i})=>{if(!t)return;if(!e._x_inlineBindings)e._x_inlineBindings={};e._x_inlineBindings[t]={expression:i,extract:false}};ts("bind",nG);function n$(e,t){e._x_keyExpression=t}
tB(()=>`[${tn("data")}]`);ts("data",(e,{expression:t},{cleanup:r})=>{if(nH(e))return;t=t===""?"{}":t;let i={};eK(i,e);let n={};rY(n,i);let o=e4(e,t,{scope:n});if(o===void 0||o===true)o={};eK(o,e);let a=eo(o);eH(a);let s=eB(e,a);a["init"]&&e4(e,a["init"]);r(()=>{a["destroy"]&&e4(e,a["destroy"]);s()})});rl((e,t)=>{if(e._x_dataStack){t._x_dataStack=e._x_dataStack;t.setAttribute("data-has-alpine-state",true)}});function nH(e){if(!rn)return false;if(rc)return true;return e.hasAttribute("data-has-alpine-state")}
ts("show",(e,{modifiers:t,expression:r},{effect:i})=>{let n=e3(e,r);if(!e._x_doHide)e._x_doHide=()=>{eL(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})};if(!e._x_doShow)e._x_doShow=()=>{eL(()=>{if(e.style.length===1&&e.style.display==="none"){e.removeAttribute("style")}else{e.style.removeProperty("display")}})};let o=()=>{e._x_doHide();e._x_isShown=false};let a=()=>{e._x_doShow();e._x_isShown=true};let s=()=>setTimeout(a);let l=t5(e=>e?a():o(),t=>{if(typeof e._x_toggleAndCascadeWithTransitions==="function"){e._x_toggleAndCascadeWithTransitions(e,t,a,o)}else{t?s():o()}});let u;let c=true;i(()=>n(e=>{if(!c&&e===u)return;if(t.includes("immediate"))e?s():o();l(e);u=e;c=false}))});
ts("for",(e,{expression:t},{effect:r,cleanup:i})=>{let n=nz(t);let o=e3(e,n.items);let a=e3(e,
e._x_keyExpression||"index");e._x_prevKeys=[];e._x_lookup={};r(()=>nj(e,n,o,a));i(()=>{Object.values(e._x_lookup).forEach(e=>eL(()=>{tq(e);e.remove()}));delete e._x_prevKeys;delete e._x_lookup})});function nj(e,t,r,i){let n=e=>typeof e==="object"&&!Array.isArray(e);let o=e;r(r=>{if(nq(r)&&r>=0){r=Array.from(Array(r).keys(),e=>e+1)}if(r===void 0)r=[];let a=e._x_lookup;let s=e._x_prevKeys;let l=[];let u=[];if(n(r)){r=Object.entries(r).map(([n,o])=>{let a=nV(t,o,n,r);i(t=>{if(u.includes(t))tL("Duplicate key on x-for",e);u.push(t)},{scope:{index:n,...a}});l.push(a)})}else{for(let n=0;n<r.length;n++){let o=nV(t,r[n],n,r);i(t=>{if(u.includes(t))tL("Duplicate key on x-for",e);u.push(t)},{scope:{index:n,...o}});l.push(o)}}let c=[];let d=[];let f=[];let h=[];for(let e=0;e<s.length;e++){let t=s[e];if(u.indexOf(t)===-1)f.push(t)}s=s.filter(e=>!f.includes(e));let _="template";for(let e=0;e<u.length;e++){let t=u[e];let r=s.indexOf(t);if(r===-1){s.splice(e,0,t);c.push([_,e])}else if(r!==e){let t=s.splice(e,1)[0];let i=s.splice(r-1,1)[0];s.splice(e,0,i);s.splice(r,0,t);d.push([t,i])}else{h.push(t)}_=t}for(let e=0;e<f.length;e++){let t=f[e];if(!(t in a))continue;eL(()=>{tq(a[t]);a[t].remove()});delete a[t]}for(let e=0;e<d.length;e++){let[t,r]=d[e];let i=a[t];let n=a[r];let s=document.createElement("div");eL(()=>{if(!n)tL(`x-for ":key" is undefined or invalid`,o,r,a);n.after(s);i.after(n);n._x_currentIfEl&&n.after(n._x_currentIfEl);s.before(i);i._x_currentIfEl&&i.after(i._x_currentIfEl);s.remove()});n._x_refreshXForScope(l[u.indexOf(r)])}for(let e=0;e<c.length;e++){let[t,r]=c[e];let i=t==="template"?o:a[t];if(i._x_currentIfEl)i=i._x_currentIfEl;let n=l[r];let s=u[r];let d=document.importNode(o.content,true).firstElementChild;let f=eo(n);eB(d,f,o);d._x_refreshXForScope=e=>{Object.entries(e).forEach(([e,t])=>{f[e]=t})};eL(()=>{i.after(d);ro(()=>tV(d))()});if(typeof s==="object"){tL("x-for key cannot be an object, it must be a string or an integer",o)}a[s]=d}for(let e=0;e<h.length;e++){a[h[e]]._x_refreshXForScope(l[u.indexOf(h[e])])}o._x_prevKeys=u})}function nz(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/;let r=/^\s*\(|\)\s*$/g;let i=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;let n=e.match(i);if(!n)return;let o={};o.items=n[2].trim();let a=n[1].replace(r,"").trim();let s=a.match(t);if(s){o.item=a.replace(t,"").trim();o.index=s[1].trim();if(s[2]){o.collection=s[2].trim()}}else{o.item=a}return o}function nV(e,t,r,i){let n={};if(/^\[.*\]$/.test(e.item)&&Array.isArray(t)){let r=e.item.replace("[","").replace("]","").split(",").map(e=>e.trim());r.forEach((e,r)=>{n[e]=t[r]})}else if(/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t==="object"){let r=e.item.replace("{","").replace("}","").split(",").map(e=>e.trim());r.forEach(e=>{n[e]=t[e]})}else{n[e.item]=t}if(e.index)n[e.index]=r;if(e.collection)n[e.collection]=i;return n}function nq(e){return!Array.isArray(e)&&!isNaN(e)}
function nW(){}nW.inline=(e,{expression:t},{cleanup:r})=>{let i=tU(e);if(!i._x_refs)i._x_refs={};i._x_refs[t]=e;r(()=>delete i._x_refs[t])};ts("ref",nW);
ts("if",(e,{expression:t},{effect:r,cleanup:i})=>{if(e.tagName.toLowerCase()!=="template")tL("x-if can only be used on a <template> tag",e);let n=e3(e,t);let o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let t=e.content.cloneNode(true).firstElementChild;eB(t,{},e);eL(()=>{e.after(t);ro(()=>tV(t))()});e._x_currentIfEl=t;e._x_undoIf=()=>{eL(()=>{tq(t);t.remove()});delete e._x_currentIfEl};return t};let a=()=>{if(!e._x_undoIf)return;e._x_undoIf();delete e._x_undoIf};r(()=>n(e=>{e?o():a()}));i(()=>e._x_undoIf&&e._x_undoIf())});
ts("id",(e,{expression:t},{evaluate:r})=>{let i=r(t);i.forEach(t=>nE(e,t))});rl((e,t)=>{if(e._x_ids){t._x_ids=e._x_ids}});
tb(tm("@",tg(tn("on:"))));ts("on",ro((e,{value:t,modifiers:r,expression:i},{cleanup:n})=>{let o=i?e3(e,i):()=>{};if(e.tagName.toLowerCase()==="template"){if(!e._x_forwardEvents)e._x_forwardEvents=[];if(!e._x_forwardEvents.includes(t))e._x_forwardEvents.push(t)}let a=nx(e,t,r,e=>{o(()=>{},{scope:{"$event":e},params:[e]})});n(()=>a())}));
nK("Collapse","collapse","collapse");nK("Intersect","intersect","intersect");nK("Focus","trap","focus");nK("Mask","mask","mask");function nK(e,t,r){ts(t,i=>tL(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,i))}// packages/alpinejs/src/index.js
rZ.setEvaluator(e9);rZ.setReactivityEngine({reactive:nd,effect:iE,release:ib,raw:n_});var nY=rZ;
var nQ=nY;
var nZ=r(38125);
var nX=e=>{if(!e)return e;var t=e.charAt(0).toUpperCase();var r=e.slice(1);return"".concat(t).concat(r)};
class nJ{register(e){var{type:t,meta:r}=e;if(t==="component"){var i=r;if(!this.components.has(i.name)){this.components.set(i.name,i)}}else{var n=r;if(!this.services.has(n.name)){this.services.set(n.name,n);this.exposeToWindow({type:"service",items:[n]})}}}registerLazy(e){Object.entries(e).forEach(e=>{var[t,r]=e;this.lazyComponents.set(t,r)})}registerAll(e){var{components:t=[],services:r=[]}=e;for(var i of t){this.register({type:"component",meta:i})}for(var n of r){this.register({type:"service",meta:n})}}get(e){var{name:t,type:r}=e;var i=r==="component"?this.components:this.services;var n=i.get(t);return r==="service"?n===null||n===void 0?void 0:n.instance:n}has(e){var{name:t,type:r}=e;return r==="component"?this.components.has(t):this.services.has(t)}loadComponent(t){return(0,e._)(function*(){
if(this.components.has(t)){return}
var r=this.loadingComponents.get(t);if(r){return r}var i=this.lazyComponents.get(t);if(!i){return}var n=(()=>(0,e._)(function*(){try{var e=yield i();this.register({type:"component",meta:e})}finally{this.loadingComponents.delete(t)}}).call(this))();this.loadingComponents.set(t,n);return n}).call(this)}loadComponents(t){return(0,e._)(function*(){yield Promise.all(t.map(e=>this.loadComponent(e)))}).call(this)}exposeToWindow(e){var{type:t,items:r}=e;if(typeof window==="undefined")return;var i=window.TutorCore||{};for(var n of r){if(t==="service"){i[n.name]=n.instance;continue}if(n.global){i[n.name]=n.component}}window.TutorCore=i}exposeComponents(e){var t=e?Array.from(this.components.values()).filter(t=>e.includes(t.name)):Array.from(this.components.values());this.exposeToWindow({type:"component",items:t})}initWithAlpine(e){for(var t of Array.from(this.components.values())){e.data("tutor".concat(nX(t.name)),t.component)}this.exposeToWindow({type:"component",items:Array.from(this.components.values())})}constructor(){(0,nZ._)(this,"components",new Map);(0,nZ._)(this,"lazyComponents",new Map);(0,nZ._)(this,"loadingComponents",new Map);(0,nZ._)(this,"services",new Map)}}var n0=new nJ;
function n1(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{openItems:e.defaultOpen||[],multiple:e.multiple!==false,$el:undefined,toggle(e){if(this.openItems.includes(e)){this.openItems=this.openItems.filter(t=>t!==e)}else{if(!this.multiple){this.openItems=[e]}else{this.openItems.push(e)}}},isOpen(e){return this.openItems.includes(e)},handleKeydown(e,t){switch(e.key){case"Enter":case" ":e.preventDefault();this.toggle(t);break;case"ArrowDown":e.preventDefault();this.focusNext(t);break;case"ArrowUp":e.preventDefault();this.focusPrevious(t);break;case"Home":e.preventDefault();this.focusFirst();break;case"End":e.preventDefault();this.focusLast();break}},focusNext(e){var t;var r=(t=this.$el)===null||t===void 0?void 0:t.querySelectorAll(".tutor-accordion-trigger");if(r){var i=e<r.length-1?e+1:0;r[i].focus()}},focusPrevious(e){var t;var r=(t=this.$el)===null||t===void 0?void 0:t.querySelectorAll(".tutor-accordion-trigger");if(r){var i=e>0?e-1:r.length-1;r[i].focus()}},focusFirst(){var e;var t=(e=this.$el)===null||e===void 0?void 0:e.querySelectorAll(".tutor-accordion-trigger");if(t&&t.length>0){t[0].focus()}},focusLast(){var e;var t=(e=this.$el)===null||e===void 0?void 0:e.querySelectorAll(".tutor-accordion-trigger");if(t&&t.length>0){t[t.length-1].focus()}}}}var n2={name:"accordion",component:n1};
var n4=r(12470);
var n3=()=>{return{toast:window.TutorCore.toast,copied:false,timer:null,$el:null,copy(t){return(0,e._)(function*(){if(!t||!this.$el){return}try{if(window.isSecureContext&&navigator.clipboard){yield navigator.clipboard.writeText(t)}else{throw new Error((0,n4.__)("Clipboard API is not available","tutor"))}}catch(r){var e=document.createElement("textarea");e.value=t;e.style.position="fixed";e.style.left="-9999px";document.body.appendChild(e);e.focus();e.select();try{document.execCommand ("copy")}catch(e){this.toast.error((0,n4.sprintf)((0,n4.__)("Failed to copy to clipboard: %s","tutor"),e));return}document.body.removeChild(e)}this.toast.success((0,n4.__)("Copied to clipboard","tutor"));this.copied=true;if(this.timer){clearTimeout(this.timer)}this.timer=window.setTimeout(()=>{this.copied=false},2e3)}).call(this)}}};var n8={name:"copyToClipboard",component:n3};
var n5=r(74412);
var n9={};var n6=e=>{var{width:t,height:r,viewBox:i,fill:n,content:o=""}=e;return'<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(t,'" height="').concat(r,'" viewBox="').concat(i||"0 0 "+t+" "+r,'" fill="').concat(n,'">').concat(o,"</svg>")};function n7(e,t,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"ts",n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:false;var o,a,s;var l=i==="php"?e:e.trim().replace(/[A-Z]/g,e=>"-"+e.toLowerCase());var u=!n&&n5.P.is_kids_mode&&((o=n5.P.kids_icons_registry)===null||o===void 0?void 0:o.includes(l));var c=u?"assets/icons/kids/":"assets/icons/";var d="".concat(n5.P.tutor_url).concat(c).concat(l,".svg");var f="0 0 ".concat(t," ").concat(r);if((a=n9[d])===null||a===void 0?void 0:a.svg){return Promise.resolve(n9[d].svg)}if((s=n9[d])===null||s===void 0?void 0:s.promise){return n9[d].promise}var h=fetch(d).then(e=>{if(!e.ok){throw new Error("HTTP error! status: ".concat(e.status))}return e.text()}).then(e=>{var i=new DOMParser;var n=i.parseFromString(e,"image/svg+xml");var o=n.querySelector("svg");var a=(o===null||o===void 0?void 0:o.getAttribute("viewBox"))||f;var s=(o===null||o===void 0?void 0:o.getAttribute("fill"))||"none";var l=(o===null||o===void 0?void 0:o.innerHTML)||"";var u=n6({width:t,height:r,viewBox:a,fill:s,content:l});n9[d]={svg:u};return u}).catch(e=>{n9[d]={error:e};// eslint-disable-next-line no-console
console.error("Failed to load icon: ".concat(l),e);return n6({width:t,height:r})});n9[d]={loading:true,promise:h};return h}var oe=t=>({name:t.name,width:t.width||16,height:t.height||16,from:t.from||"php",ignoreKids:t.ignoreKids||false,init(){return(0,e._)(function*(){
var e=this.$el;e.innerHTML=n6({width:this.width,height:this.height});e.classList.add("tutor-icon");if(!this.name){return}var t=yield n7(this.name,this.width,this.height,this.from,this.ignoreKids);e.innerHTML=t}).call(this)},updateIcon(t){return(0,e._)(function*(){
var e=this.$el;this.name=t;e.innerHTML=n6({width:this.width,height:this.height});var r=yield n7(this.name,this.width,this.height,this.from,this.ignoreKids);e.innerHTML=r}).call(this)}});var ot={name:"icon",component:oe,global:true};
var or=r(41147);
var oi=r(9210);
var on={id:"tutor-modal",isCloseable:true};var oo=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:(0,or._)({},on);var t,r;return{open:(t=e.initialOpen)!==null&&t!==void 0?t:false,payload:null,isCloseable:(r=e.isCloseable)!==null&&r!==void 0?r:on.isCloseable,id:e.id,cleanup:undefined,$el:undefined,init(){var e=e=>{var t;var r=e===null||e===void 0?void 0:(t=e.detail)===null||t===void 0?void 0:t.id;if(!r||r===this.id){var i;var n;this.payload=(n=e===null||e===void 0?void 0:(i=e.detail)===null||i===void 0?void 0:i.data)!==null&&n!==void 0?n:null;this.show()}};var t=e=>{var t;var r=e===null||e===void 0?void 0:(t=e.detail)===null||t===void 0?void 0:t.id;if(!r||r===this.id){this.close()}};document.addEventListener(oi.T.MODAL_OPEN,e);document.addEventListener(oi.T.MODAL_CLOSE,t);this.cleanup=()=>{document.removeEventListener(oi.T.MODAL_OPEN,e);document.removeEventListener(oi.T.MODAL_CLOSE,t)}},destroy(){var e,t;(e=(t=this).cleanup)===null||e===void 0?void 0:e.call(t)},show(){this.open=true},close(){this.open=false;this.payload=null;document.dispatchEvent(new CustomEvent(oi.T.MODAL_CLOSED,{detail:{id:this.id}}))},getBackdropBindings(){var e=this.$el;e.classList.add("tutor-modal-backdrop");return{"x-show":"open","x-transition:enter":"tutor-modal-backdrop-enter","x-transition:enter-start":"tutor-modal-backdrop-transition","x-transition:enter-end":"tutor-modal-backdrop-transition-reset","x-transition:leave":"tutor-modal-backdrop-leave","x-transition:leave-start":"tutor-modal-backdrop-transition-reset","x-transition:leave-end":"tutor-modal-backdrop-transition"}},getModalBindings(){var e=this.$el;e.classList.add("tutor-modal");return{"x-show":"open","@keydown.escape.window":this.isCloseable?"close()":"",role:"dialog","aria-modal":"true"}},getModalContentBindings(){var e=this.$el;e.classList.add("tutor-modal-content");return{"x-trap.noscroll.inert":"open","@click.outside":this.isCloseable?"close()":"","x-show":"open","x-transition:enter":"tutor-modal-content-enter","x-transition:enter-start":"tutor-modal-content-transition","x-transition:enter-end":"tutor-modal-content-transition-reset","x-transition:leave":"tutor-modal-content-leave","x-transition:leave-start":"tutor-modal-content-transition-reset","x-transition:leave-end":"tutor-modal-content-transition"}},getCloseButtonBindings(){var e=this.$el;e.classList.add("tutor-modal-close");return{"x-show":"open","@click":"close()"}}}};var oa={name:"modal",component:oo};
var os={showStrength:false,minStrength:3};var ol={0:(0,n4.__)("Very weak","tutor"),1:(0,n4.__)("Very weak","tutor"),2:(0,n4.__)("Weak","tutor"),3:(0,n4.__)("Medium","tutor"),4:(0,n4.__)("Strong","tutor"),5:(0,n4.__)("Very strong","tutor")};var ou={0:"var(--tutor-text-critical)",1:"var(--tutor-text-critical)",2:"var(--tutor-text-critical)",3:"var(--tutor-text-warning)",4:"var(--tutor-text-success)",5:"var(--tutor-text-success)"};var oc=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:os;var t,r;return{showPassword:false,strength:0,strengthLabel:"",strengthColor:"",showStrength:(t=e.showStrength)!==null&&t!==void 0?t:false,minStrength:(r=e.minStrength)!==null&&r!==void 0?r:3,password:"",init(){var e=this.$el.querySelector("input");if(e){e.addEventListener("input",e=>{this.password=e.target.value;if(this.showStrength){this.checkStrength()}})}},destroy(){var e=this.$el.querySelector("input");if(e){e.removeEventListener("input",e=>{this.password=e.target.value;if(this.showStrength){this.checkStrength()}})}},toggleVisibility(){this.showPassword=!this.showPassword;var e=this.$root;var t=e.querySelector("input");if(t){t.type=this.showPassword?"text":"password"}},checkStrength(){this.strength=this.calculateBasicStrength();this.strengthLabel=ol[this.strength]||"";this.strengthColor=ou[this.strength]||""},calculateBasicStrength(){var e=this.password;if(!e){return 0}var t=0;if(e.length>=8)t++;if(e.length>=12)t++;if(/[a-z]/.test(e)&&/[A-Z]/.test(e))t++;if(/\d/.test(e))t++;if(/[^a-zA-Z0-9]/.test(e))t++;return Math.min(t,5)},getToggleBindings(){return{"@click":"toggleVisibility()",class:"tutor-password-toggle",type:"button","aria-label":this.showPassword?(0,n4.__)("Hide password","tutor"):(0,n4.__)("Show password","tutor")}},getStrengthTextBindings(){return{"x-text":"strengthLabel",":style":"{color: strengthColor}"}}}};var od={name:"passwordInput",component:oc};
var of=r(42792);
function oh(e){return e.provider==="youtube"}function o_(e){return e.provider==="vimeo"};
var op=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{plyr:null,$el:undefined,init(){if(typeof window.Plyr==="undefined"){
console.warn("Plyr is not defined. Ensure Plyr library is loaded.");return}if(!this.$el){return}this.plyr=new window.Plyr(this.$el,e.config);if(this.plyr){this.plyr.on("ready",()=>{var e,t,r;(r=this.$el)===null||r===void 0?void 0:(t=r.closest(".tutor-video-player"))===null||t===void 0?void 0:(e=t.querySelector(".loading-spinner"))===null||e===void 0?void 0:e.remove();if(this.plyr&&o_(this.plyr)&&(0,of.X)()){try{this.plyr.muted=true;if(typeof this.plyr.mute==="function"){this.plyr.mute()}}catch(e){
console.warn("Vimeo mute init failed:",e)}}});this.plyr.on("play",()=>{if(this.plyr&&o_(this.plyr)&&(0,of.X)()){try{this.plyr.muted=false;if(typeof this.plyr.unmute==="function"){this.plyr.unmute()}}catch(e){
console.warn("Vimeo unmute on play failed:",e)}}})}
this.$el.dispatchEvent(new CustomEvent(oi.T.TUTOR_PLAYER_READY,{detail:{plyr:this.plyr,component:this},bubbles:true}))}}};var ov={name:"player",component:op,global:true};
var om=r(34224);
var og=r(14206);
var oy=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t;var r=(0,om.o)({placement:e.placement||"bottom-start",offset:(t=e.offset)!==null&&t!==void 0?t:4,onShow:e.onShow,onHide:e.onHide});return(0,og._)((0,or._)({},r),{previewData:e.data||null,isTouchDevice:false,hoverTimeout:null,hoverDelay:e.delay||300,$nextTick:undefined,init(){r.init.call(this);this.isTouchDevice="ontouchstart"in window||navigator.maxTouchPoints>0;this.setupPreviewTriggers()},setupPreviewTriggers(){var e=this.$refs.trigger;if(!e)return;
if(e.hasAttribute("data-tutor-preview-delay")){this.hoverDelay=parseInt(e.getAttribute("data-tutor-preview-delay")||"300",10)}if(this.isTouchDevice){
e.addEventListener("click",e=>this.handleTap(e));
var t=this.$refs.content;if(t){t.addEventListener("click",e=>{e.stopPropagation()})}}else{
e.addEventListener("mouseenter",()=>this.handleMouseEnter());e.addEventListener("mouseleave",()=>this.handleMouseLeave());e.addEventListener("keydown",e=>this.handleKeyDown(e));
var r=this.$refs.content;if(r){r.addEventListener("mouseenter",()=>{if(this.hoverTimeout){clearTimeout(this.hoverTimeout);this.hoverTimeout=null}});r.addEventListener("mouseleave",()=>this.handleMouseLeave())}}},handleTap(e){var t=e.target;var r=this.$refs.content;
if(r&&r.contains(t)){return}e.preventDefault();if(this.open){this.hide();return}this.showPreview()},handleMouseEnter(){
if(this.hoverTimeout){clearTimeout(this.hoverTimeout)}
this.hoverTimeout=window.setTimeout(()=>{this.showPreview()},this.hoverDelay)},handleMouseLeave(){
if(this.hoverTimeout){clearTimeout(this.hoverTimeout);this.hoverTimeout=null}
setTimeout(()=>{var e;var t=this.$refs.content;if(!(t===null||t===void 0?void 0:t.matches(":hover"))&&!((e=this.$refs.trigger)===null||e===void 0?void 0:e.matches(":hover"))){this.hide()}},100)},handleKeyDown(e){if(e.key==="Escape"){this.hide()}if(e.key==="Enter"||e.key===" "){var t=this.$refs.content;if(t&&t.contains(e.target)){return}e.preventDefault();if(this.open){this.hide()}else{this.showPreview()}}},showPreview(){if(!this.previewData)return;
this.show();
this.renderPreview();
if(this.$nextTick){this.updatePosition()}else{this.updatePosition()}},renderPreview(){var e=this.$refs.content;if(!e||!this.previewData)return;this.renderCoursePreview(e)},renderCoursePreview(e){if(!this.previewData)return;var t=this.previewData;var r=t.thumbnail?'<img src="'.concat(t.thumbnail,'" alt="').concat(this.escapeHtml(t.title),'" class="tutor-preview-card-thumbnail" />'):"";e.innerHTML='\n        <div class="tutor-preview-card-content">\n          '.concat(t.thumbnail?t.url?'<a tabindex="-1" href="'.concat(t.url,'">').concat(r,"</a>"):r:"",'\n          <div class="tutor-preview-card-body">\n            <h4 class="tutor-preview-card-title">').concat(t.url?'<a href="'.concat(t.url,'">').concat(this.escapeHtml(t.title),"</a>"):this.escapeHtml(t.title),"</h4>\n            ").concat(t.instructor?'<div class="tutor-preview-card-instructor">'.concat((0,n4.sprintf)((0,n4.__)('by <a href="'.concat(t.instructor_url,'">%s</a>'),"tutor"),this.escapeHtml(t.instructor)),"</div>"):"","\n          </div>\n        </div>\n      ")},escapeHtml(e){var t=document.createElement("div");t.textContent=e;return t.innerHTML},destroy(){if(this.hoverTimeout){clearTimeout(this.hoverTimeout)}r.destroy.call(this)}})};var oE={name:"previewTrigger",component:oy};
var ob=4;var oT=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t,r;return{expanded:(t=e.expanded)!==null&&t!==void 0?t:false,hasOverflow:false,lines:(r=e.lines)!==null&&r!==void 0?r:ob,collapsedHeightPx:0,$el:null,$refs:{},$watch:null,$nextTick:null,init(){var e,t,r,i;var n=this.$refs.content;if(!n){return}
n.style.display="";n.style.webkitLineClamp="";n.style.setProperty("-webkit-box-orient","");n.style.removeProperty("-webkit-line-clamp");n.style.removeProperty("-webkit-box-orient");n.style.removeProperty("display");this.computeCollapsedHeight(n);this.applyCollapsedStyles(n);(e=(t=this).$watch)===null||e===void 0?void 0:e.call(t,"expanded",()=>this.applyState());(r=(i=this).$nextTick)===null||r===void 0?void 0:r.call(i,()=>{this.sync()})},computeCollapsedHeight(e){var t=getComputedStyle(e);var r=parseFloat(t.lineHeight);
if(Number.isNaN(r)){r=parseFloat(t.fontSize)*1.2}this.collapsedHeightPx=Math.ceil(this.lines*r)},sync(){var e=this.$refs.content;if(!e){return}this.computeCollapsedHeight(e);var t=e.style.maxHeight;var r=e.style.overflow;e.style.maxHeight="".concat(this.collapsedHeightPx,"px");e.style.overflow="hidden";this.hasOverflow=e.scrollHeight>e.clientHeight+1;e.style.maxHeight=t;e.style.overflow=r;this.applyState()},applyCollapsedStyles(e){e.style.maxHeight="".concat(this.collapsedHeightPx,"px");e.style.overflow="hidden"},applyState(){var e=this.$el;var t=this.$refs.content;var r=this.$refs.readMore;if(!t||!e){return}
e.style.position="relative";if(this.expanded||!this.hasOverflow){t.style.maxHeight="none";t.style.overflow="visible";this.styleReadMoreButton(r,false);return}t.style.maxHeight="".concat(this.collapsedHeightPx,"px");t.style.overflow="hidden";this.styleReadMoreButton(r,true)},styleReadMoreButton(e,t){if(!e){return}if(!t){e.style.position="";e.style.bottom="";e.style.right="";e.style.paddingLeft="";return}e.style.position="absolute";e.style.bottom="0";e.style.right="0";e.style.paddingLeft="4px"},toggle(){if(!this.hasOverflow&&!this.expanded){return}this.expanded=!this.expanded}}};var ow={name:"readMore",component:oT};
var oA=e=>({rating:e.initialRating||1,hoverRating:0,fieldName:e.fieldName,get effectiveRating(){return this.hoverRating>0?this.hoverRating:this.rating},get feedback(){var t=this.effectiveRating;if(t===0){return""}var r={1:(0,n4.__)("Poor","tutor"),2:(0,n4.__)("Fair","tutor"),3:(0,n4.__)("Okay","tutor"),4:(0,n4.__)("Good","tutor"),5:(0,n4.__)("Amazing","tutor")};if(Number.isInteger(t)){return r[t]||""}
var i=Math.floor(t);var n=Math.ceil(t);var o=r[i];var a=r[n];if(o&&a){return"".concat(o," / ").concat(a)}return o||a||""},setRating(e,t){this.rating=e;t(this.rating)}});var oO={name:"starRatingInput",component:oA};
var ox={large:{dimension:144,strokeWidth:10.8,iconSizes:{check:80,lock:104}},medium:{dimension:56,strokeWidth:4.3,iconSizes:{check:24,lock:32}},small:{dimension:44,strokeWidth:3.3,iconSizes:{check:24,lock:32}},"x-small":{dimension:16,strokeWidth:2,iconSizes:{check:8,lock:12}}};var oS={value:0,type:"progress",size:"small",background:"none",strokeColor:"var(--tutor-actions-brand-secondary)",progressStrokeColor:"var(--tutor-actions-brand-primary)",showLabel:true,label:"",animated:false,duration:1e3};var oC=3;var oN=100;var oL=0;var oP=e=>{var t,r,i,n,o,a,s,l,u,c;return{value:0,targetValue:(t=e.value)!==null&&t!==void 0?t:oS.value,type:(r=e.type)!==null&&r!==void 0?r:oS.type,size:(i=e.size)!==null&&i!==void 0?i:oS.size,background:(n=e.background)!==null&&n!==void 0?n:oS.background,strokeColor:(o=e.strokeColor)!==null&&o!==void 0?o:oS.strokeColor,progressStrokeColor:(a=e.progressStrokeColor)!==null&&a!==void 0?a:oS.progressStrokeColor,showLabel:(s=e.showLabel)!==null&&s!==void 0?s:oS.showLabel,label:(l=e.label)!==null&&l!==void 0?l:oS.label,animated:(u=e.animated)!==null&&u!==void 0?u:oS.animated,duration:(c=e.duration)!==null&&c!==void 0?c:oS.duration,init(){this.initializeValue()},initializeValue(){if(this.animated&&this.type==="progress"){this.animateProgress()}else{this.value=this.targetValue}},animateProgress(){var e=Date.now();var t=this.value;var r=this.targetValue;var i=()=>{var n=Date.now()-e;var o=Math.min(n/this.duration,1);var a=this.easeOut(o);this.value=t+(r-t)*a;if(o<1){requestAnimationFrame(i)}else{this.value=r}};requestAnimationFrame(i)},easeOut(e){return 1-Math.pow(1-e,oC)},sizeConfig(){var e;var t=(e=this.size)!==null&&e!==void 0?e:oS.size;var r;return(r=ox[t])!==null&&r!==void 0?r:ox[oS.size]},sizeValue(){return this.sizeConfig().dimension},strokeWidth(){return this.sizeConfig().strokeWidth},radius(){return(this.sizeValue()-this.strokeWidth())/2},center(){return this.sizeValue()/2},viewBox(){return"0 0 ".concat(this.sizeValue()," ").concat(this.sizeValue())},circumference(){return 2*Math.PI*this.radius()},strokeDashoffset(){var e=Math.min(Math.max(this.value,oL),oN);return this.circumference()-e/oN*this.circumference()},displayValue(){return Math.round(this.value)},displayLabel(){return this.label||"".concat(this.displayValue(),"%")},get labelText(){if(!this.showLabel)return"";return this.displayValue()===0?"0":"".concat(this.displayValue(),"%")},get labelClass(){var d="tutor-statics-progress-label";var f=this.size==="large"?"tutor-statics-progress-label-large":"";return"".concat(d," ").concat(f).trim()},renderProgressCircle(){return'\n      <svg class="tutor-statics-progress" viewBox="'.concat(this.viewBox(),'" width="').concat(this.sizeValue(),'" height="').concat(this.sizeValue(),'">\n        ').concat(this.renderBackgroundCircle(),"\n        ").concat(this.renderProgressArc(),"\n      </svg>\n      ").concat(this.renderLabel(),"\n    ")},renderBackgroundCircle(){return'\n      <circle \n        cx="'.concat(this.center(),'" \n        cy="').concat(this.center(),'" \n        r="').concat(this.radius(),'"\n        fill="').concat(this.background,'"\n        stroke="').concat(this.strokeColor,'"\n        stroke-width="').concat(this.strokeWidth(),'"\n      ></circle>\n    ')},renderProgressArc(){return'\n      <circle \n        cx="'.concat(this.center(),'" \n        cy="').concat(this.center(),'" \n        r="').concat(this.radius(),'"\n        fill="none"\n        stroke="').concat(this.progressStrokeColor,'"\n        stroke-width="').concat(this.strokeWidth(),'"\n        stroke-linecap="round"\n        stroke-dasharray="').concat(this.circumference(),'"\n        stroke-dashoffset="').concat(this.strokeDashoffset(),'"\n        style="transition: stroke-dashoffset 0.6s ease;"\n      ></circle>\n    ')},renderLabel(){if(!this.showLabel)return"";return'<div class="'.concat(this.labelClass,'">').concat(this.labelText,"</div>")},renderCompleteCircle(){var e=this.sizeConfig().iconSizes.check;return this.renderIconContainer("tutor-statics-complete","checkStroke",e)},renderLockIcon(){var e=this.sizeConfig().iconSizes.lock;return this.renderIconContainer("tutor-statics-locked","circumLock",e)},renderIconContainer(e,t,r){return'\n      <div class="'.concat(e,'" style="width: ').concat(this.sizeValue(),"px; height: ").concat(this.sizeValue(),'px;">\n        <div x-data="tutorIcon({ name: \'').concat(t,"', width: ").concat(r,", height: ").concat(r,' })"></div>\n      </div>\n    ')},render(){
var e=this.$el;e.classList.add("tutor-statics");switch(this.type){case"progress":return this.renderProgressCircle();case"complete":return this.renderCompleteCircle();case"locked":return this.renderLockIcon();default:return""}}}};var ok={name:"statics",component:oP};
var oR=e=>{if(e instanceof Error){return e.message||(0,n4.__)("Something went wrong","tutor")}return(0,n4.__)("Something went wrong","tutor")};
var oI=t=>{return{selectedValue:t.selected,prevValue:t.selected,isLoading:false,variants:t.variants,get currentVariant(){return this.variants[this.selectedValue]||"default"},get variantClasses(){var r={};Object.values(this.variants).forEach(e=>{r["tutor-status-select-".concat(e)]=e===this.currentVariant});
if(!Object.values(this.variants).includes("default")){r["tutor-status-select-default"]=this.currentVariant==="default"}return r},updateStatus(){return(0,e._)(function*(){if(this.selectedValue===this.prevValue||!t.action){return}this.isLoading=true;try{var e=new FormData;
e.append(n5.P.nonce_key,n5.P._tutor_nonce);e.append("action",t.action);e.append("status",this.selectedValue);
for(var[r,i]of Object.entries(t.data)){e.append(r,i)}var n=yield fetch(n5.P.ajaxurl,{method:"POST",body:e});var o=yield n.json();if(o.success){var a;this.prevValue=this.selectedValue;window.TutorCore.toast.success(((a=o.data)===null||a===void 0?void 0:a.message)||(0,n4.__)("Status updated successfully","tutor"))}else{this.selectedValue=this.prevValue;window.TutorCore.toast.error(oR(o))}}catch(e){this.selectedValue=this.prevValue;
console.error("Status update error:",e)}finally{this.isLoading=false}}).call(this)}}};var oM={name:"statusSelect",component:oI};
var oD=t=>{var r,i,n;var o;return{tabs:t.tabs,activeTab:t.defaultTab||((r=t.tabs[0])===null||r===void 0?void 0:r.id)||"",orientation:t.orientation||"horizontal",size:t.size||"lg",urlParamsConfig:{enabled:(o=(i=t.urlParams)===null||i===void 0?void 0:i.enabled)!==null&&o!==void 0?o:true,paramName:((n=t.urlParams)===null||n===void 0?void 0:n.paramName)||"page_tab"},init(){return(0,e._)(function*(){
var e=this.$el;var t=this.activeTab;
if(this.urlParamsConfig.enabled){var r=new URL(window.location.href);var i=r.searchParams.get(this.urlParamsConfig.paramName);if(i){t=i}}this.selectTab(t);e.classList.add("tutor-tabs-"+this.orientation)}).call(this)},selectTab(e){
var r=this.$dispatch;var i=this.tabs.find(t=>t.id===e);if(!i||i.disabled){return}if(i.href){window.location.href=i.href;return}this.activeTab=e;if(this.urlParamsConfig.enabled){var n=new URL(window.location.href);n.searchParams.set(this.urlParamsConfig.paramName,e);window.history.replaceState({},"",n.toString())}if(t.onChange){t.onChange(e)}
r(oi.T.TAB_CHANGE,{tabId:e,tab:i})},isActive(e){return this.activeTab===e},getTabClass(e){var t=["tutor-tabs-tab"];if(this.size==="sm"){t.push("tutor-tabs-tab-sm")}if(this.size==="md"){t.push("tutor-tabs-tab-md")}if(this.isActive(e.id)){t.push("tutor-tabs-tab-active")}return t.join(" ")}}};var oB={name:"tabs",component:oD};
var oF=r(17900);
var oU={position:"bottom-right",duration:5e3,closeButton:true,maxVisible:5,dir:"auto",offset:{x:20,y:20,mobile:{y:12},lg:{}},expandMode:"hover",richColors:false,theme:"auto"};var oG={gap:10,peek:10,scaleStep:.034,scaleFloor:.883,opacity1:.78,opacity2:.52,opacity3:0};var o$={liveRegion:"tutor-toast-aria-live"};var oH={srOnly:"tutor-toast-sr-only",container:"tutor-toast-container",stack:"tutor-toast-stack",card:"tutor-toast-card",icon:"tutor-toast-icon",content:"tutor-toast-content",title:"tutor-toast-title",description:"tutor-toast-description",closeButton:"tutor-toast-close",item:"tutor-toast-item"};var oj={card:".".concat(oH.card),icon:".".concat(oH.icon),content:".".concat(oH.content),title:".".concat(oH.title),description:".".concat(oH.description)};var oz={ariaLive:"aria-live",ariaAtomic:"aria-atomic",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",dataPositionX:"data-position-x",dataPositionY:"data-position-y",dataTutorTheme:"data-tutor-theme",dataRichColors:"data-rich-colors",dataType:"data-type",dataFront:"data-front",dataExpanded:"data-expanded",dataEntering:"data-entering",dataExiting:"data-exiting",dataSwiping:"data-swiping",dataSwipeOut:"data-swipe-out",dir:"dir",role:"role",tabIndex:"tabindex"};var oV={polite:"polite",assertive:"assertive",region:"region",list:"list",listItem:"listitem",alert:"alert",status:"status",true:"true",frontZIndex:"10"};var oq={left:"left",right:"right",center:"center",top:"top",bottom:"bottom"};var oW={offsetX:"--tutor-toast-offset-x",offsetY:"--tutor-toast-offset-y",y:"--tutor-toast-y",scale:"--tutor-toast-scale",opacity:"--tutor-toast-opacity",frontHeight:"--tutor-toast-front-height"};var oK="tutor-toast-title-";var oY={success:(0,n4.__)("Success","tutor"),error:(0,n4.__)("Error","tutor"),warning:(0,n4.__)("Warning","tutor"),info:(0,n4.__)("Info","tutor")};var oQ={success:'<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6L9 17l-5-5"/></svg>',error:'<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>',warning:'<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>',info:'<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="8"/><path d="M12 11v6"/></svg>',default:'<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="8"/><path d="M12 11v6"/></svg>'};var oZ=()=>(0,og._)((0,or._)({},oU),{offset:(0,og._)((0,or._)({},oU.offset),{mobile:(0,or._)({},oU.offset.mobile),lg:(0,or._)({},oU.offset.lg)})});class oX{initFullscreenListener(){document.addEventListener("fullscreenchange",()=>{if(!this.container){return}var e=document.fullscreenElement||document.body;if(this.container.parentElement!==e){e.appendChild(this.container)}})}isBottom(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.position;return e.startsWith("bottom")}xPosition(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.position;if(e.endsWith("left")){return oq.left}if(e.endsWith("right")){return oq.right}return oq.center}yPosition(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.position;return this.isBottom(e)?oq.bottom:oq.top}ensureLiveRegion(){if(document.getElementById(o$.liveRegion)){return}var e=document.createElement("div");e.id=o$.liveRegion;e.className=oH.srOnly;e.setAttribute(oz.ariaLive,oV.polite);e.setAttribute(oz.ariaAtomic,"false");document.body.appendChild(e)}announce(e,t,r){this.ensureLiveRegion();var i=document.getElementById(o$.liveRegion);if(!i){return}i.setAttribute(oz.ariaLive,r==="error"?oV.assertive:oV.polite);i.textContent="";requestAnimationFrame(()=>{var r=t?"".concat(e,". ").concat(t):e;var n=document.createElement("div");n.innerHTML=r;i.textContent=n.textContent||""})}applyOffset(){if(!this.container){return}var e=this.config.offset;var t=window.matchMedia("(max-width: 639px)").matches;var r=window.matchMedia("(min-width: 1280px)").matches;var i;var n=(i=e.x)!==null&&i!==void 0?i:16;var o;var a=(o=e.y)!==null&&o!==void 0?o:16;if(t&&e.mobile){if(e.mobile.x!=null){n=e.mobile.x}if(e.mobile.y!=null){a=e.mobile.y}}if(r&&e.lg){if(e.lg.x!=null){n=e.lg.x}if(e.lg.y!=null){a=e.lg.y}}this.container.setAttribute(oz.dataPositionX,t?oq.center:this.xPosition());this.container.style.setProperty(oW.offsetX,"".concat(n,"px"));this.container.style.setProperty(oW.offsetY,"".concat(a,"px"))}syncContainerAttributes(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.position;if(!this.container){return}this.container.setAttribute(oz.dataPositionX,this.xPosition(e));this.container.setAttribute(oz.dataPositionY,this.yPosition(e));var t=this.config.theme;if(t==="auto"){this.container.removeAttribute(oz.dataTutorTheme)}else{this.container.setAttribute(oz.dataTutorTheme,t)}if(this.config.dir==="auto"){this.container.removeAttribute(oz.dir);return}this.container.setAttribute(oz.dir,this.config.dir)}boot(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.config.position;if(this.container&&this.stack){this.syncContainerAttributes(e);this.applyOffset();return}this.container=document.createElement("ol");this.container.className=oH.container;if(this.config.theme!=="auto"){this.container.setAttribute(oz.dataTutorTheme,this.config.theme)}this.container.setAttribute(oz.role,oV.region);this.container.setAttribute(oz.ariaLabel,(0,n4.__)("Notifications","tutor"));this.container.setAttribute(oz.tabIndex,"-1");this.stack=document.createElement("li");this.stack.className=oH.stack;this.stack.setAttribute(oz.role,oV.list);this.stack.addEventListener("mouseenter",()=>{this.hovered=true;if(this.config.expandMode==="hover"){this.setExpanded(true)}this.pauseAll()});this.stack.addEventListener("mouseleave",e=>{if(!this.stack){return}var t=this.stack.getBoundingClientRect();var r=e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom;if(r){return}this.hovered=false;if(this.config.expandMode==="hover"){this.setExpanded(false)}this.resumeAll()});this.stack.addEventListener("focusin",()=>{this.hovered=true;this.pauseAll();this.setExpanded(true)});this.stack.addEventListener("focusout",e=>{var t;if((t=this.stack)===null||t===void 0?void 0:t.contains(e.relatedTarget)){return}this.hovered=false;this.resumeAll();this.setExpanded(false)});this.container.appendChild(this.stack);var t=document.fullscreenElement||document.body;t.appendChild(this.container);this.syncContainerAttributes(e);this.applyOffset();if(this.config.expandMode==="always"){this.expanded=true}window.addEventListener("resize",()=>this.applyOffset())}setExpanded(e){if(this.config.expandMode==="always"){this.expanded=true}else if(this.config.expandMode==="never"){this.expanded=false}else{this.expanded=e}this.restack()}renderIcon(e,t,r){e.innerHTML="";var i;var n=(i=r!==null&&r!==void 0?r:oQ[t])!==null&&i!==void 0?i:oQ.default;if(n===null||n===void 0?void 0:n.trimStart().startsWith("<")){e.innerHTML=n;return}e.textContent=String(n)}buildCard(e,t,r){var i=document.createElement("div");i.className=oH.card;i.setAttribute(oz.dataType,r.type);i.setAttribute(oz.role,r.type==="error"?oV.alert:oV.status);i.setAttribute(oz.ariaAtomic,"false");if(r.dir){i.setAttribute(oz.dir,r.dir)}if(r.richColors){i.setAttribute(oz.dataRichColors,oV.true)}var n=document.createElement("div");n.className=oH.icon;this.renderIcon(n,r.type,r.icon);i.appendChild(n);var o=document.createElement("div");o.className=oH.content;var a=document.createElement("p");a.className=oH.title;a.id="".concat(oK).concat(e);a.textContent=t;o.appendChild(a);if(r.description){var s=document.createElement("p");s.className=oH.description;s.innerHTML=r.description;o.appendChild(s)}i.appendChild(o);if(r.closeButton){var l=document.createElement("button");l.className=oH.closeButton;l.type="button";l.setAttribute(oz.ariaLabel,(0,n4.__)("Close notification","tutor"));l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12.402 3.6-8.8 8.8m0-8.8 8.8 8.8"/></svg>';l.addEventListener("click",t=>{t.stopPropagation();this.dismiss(e)});i.appendChild(l)}return i}restack(){var e;if(!this.stack){return}var t=Array.from(this.entries.values()).filter(e=>!e.exiting&&!e.swiping).reverse();var r=oG.gap;var i=oG.peek;var n=oG.scaleStep;var o=this.isBottom()?-1:1;t.forEach(e=>{var t=e.element.offsetHeight;if(t>0){e.height=t}});t.forEach((e,a)=>{var s=a===0;e.element.setAttribute(oz.dataFront,String(s));if(this.expanded){e.element.setAttribute(oz.dataExpanded,oV.true)}else{e.element.removeAttribute(oz.dataExpanded)}e.element.style.pointerEvents=s||this.expanded?"all":"none";if(!this.expanded){if(s){e.element.style.setProperty(oW.y,"0px");e.element.style.setProperty(oW.scale,"1");e.element.style.setProperty(oW.opacity,"1")}else{var l=a*i;var u=Math.max(oG.scaleFloor,1-a*n);var c=a===1?oG.opacity1:a===2?oG.opacity2:oG.opacity3;e.element.style.setProperty(oW.y,"".concat(o*l,"px"));e.element.style.setProperty(oW.scale,String(u));e.element.style.setProperty(oW.opacity,String(c))}}else{var d=0;for(var f=0;f<a;f+=1){d+=(t[f].height||72)+r}e.element.style.setProperty(oW.y,"".concat(o*d,"px"));e.element.style.setProperty(oW.scale,"1");e.element.style.setProperty(oW.opacity,"1")}e.element.style.zIndex=String(Number(oV.frontZIndex)-a);if(!e.element.hasAttribute(oz.dataEntering)){e.element.style.transform="translateY(var(".concat(oW.y,", 0px)) scale(var(").concat(oW.scale,", 1))");e.element.style.opacity="var(".concat(oW.opacity,", 1)")}});var a=((e=t[0])===null||e===void 0?void 0:e.height)||0;this.stack.style.setProperty(oW.frontHeight,"".concat(a,"px"));if(this.expanded&&t.length>0){var s=t.reduce((e,t)=>e+(t.height||72),0)+Math.max(0,t.length-1)*r;this.stack.style.height="".concat(s,"px")}else{this.stack.style.height="".concat(a,"px")}}clearTimer(e){var t=this.entries.get(e);if(t===null||t===void 0?void 0:t.timerId){clearTimeout(t.timerId);t.timerId=null}}pauseEntry(e){if(e.paused||e.exiting){return}this.clearTimer(e.id);e.remainingMs=Math.max(0,e.endsAt-Date.now());e.paused=true}resumeEntry(e){if(!e.paused||e.exiting){return}e.paused=false;if(e.remainingMs>0){e.endsAt=Date.now()+e.remainingMs;e.timerId=setTimeout(()=>this.dismiss(e.id),e.remainingMs)}else{this.dismiss(e.id)}}pauseAll(){this.entries.forEach(e=>this.pauseEntry(e))}resumeAll(){this.entries.forEach(e=>this.resumeEntry(e))}collapseAndRemove(e,t){this.entries.delete(t);var r=e.offsetHeight;e.style.pointerEvents="none";e.style.overflow="hidden";e.style.height="".concat(r,"px");void e.offsetHeight;e.style.transition="height 200ms ease";e.style.height="0px";setTimeout(()=>{e.remove();if(this.hovered){this.setExpanded(true)}else{this.restack()}},210)}evict(e){var t=this.entries.get(e);if(!t){return}this.clearTimer(e);this.entries.delete(e);t.element.remove()}enforceLimits(){var e=Array.from(this.entries.keys());if(e.length<=this.config.maxVisible){return}e.slice(0,e.length-this.config.maxVisible).forEach(e=>this.evict(e));this.restack()}attachSwipe(e,t){var r=e.querySelector(oj.card);if(!r){return}var i=0;var n=0;var o=false;e.addEventListener("mouseenter",()=>{var e=this.entries.get(t);if(e){this.pauseEntry(e)}});e.addEventListener("mouseleave",()=>{if(this.expanded){return}var e=this.entries.get(t);if(e){this.resumeEntry(e)}});var a=n=>{i="touches"in n?n.touches[0].clientX:n.clientX;o=true;r.style.transition="none";var a=this.entries.get(t);if(a){a.swiping=true;e.setAttribute(oz.dataSwiping,oV.true)}};var s=e=>{if(!o){return}n=("touches"in e?e.touches[0].clientX:e.clientX)-i;r.style.transform="translateX(".concat(n,"px)");r.style.opacity=String(Math.max(0,1-Math.abs(n)/180))};var l=()=>{if(!o){return}o=false;r.style.transition="";r.style.transform="";r.style.opacity="";var i=this.entries.get(t);if(i){i.swiping=false;e.removeAttribute(oz.dataSwiping)}if(Math.abs(n)>=60){var a=n>0?"right":"left";this.clearTimer(t);if(i){i.exiting=true}e.setAttribute(oz.dataSwipeOut,a);setTimeout(()=>this.collapseAndRemove(e,t),230)}n=0};e.addEventListener("touchstart",a,{passive:true});e.addEventListener("touchmove",s,{passive:true});e.addEventListener("touchend",l);e.addEventListener("mousedown",a);window.addEventListener("mousemove",s);window.addEventListener("mouseup",l)}dismissOne(e){var t=this.entries.get(e);if(!t||t.exiting){return}t.exiting=true;this.clearTimer(e);t.element.removeAttribute(oz.dataEntering);t.element.setAttribute(oz.dataExiting,oV.true);t.element.setAttribute(oz.dataPositionY,this.yPosition());setTimeout(()=>this.collapseAndRemove(t.element,e),280)}dismiss(e){if(e){this.dismissOne(e);return}Array.from(this.entries.keys()).forEach(e=>this.dismissOne(e))}show(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var r;var i;var n=(i=t.position)!==null&&i!==void 0?i:this.config.position;var o;var a=(o=t.theme)!==null&&o!==void 0?o:this.config.theme;if(a!==this.config.theme){this.config=(0,og._)((0,or._)({},this.config),{theme:a})}this.boot(n);var s=String(++this.idCounter);var l;var u=(l=t.type)!==null&&l!==void 0?l:"info";var c;var d=(c=t.duration)!==null&&c!==void 0?c:this.config.duration;var f;var h=(f=t.title)!==null&&f!==void 0?f:u==="default"?e:oY[u];var _;var p=(_=t.description)!==null&&_!==void 0?_:t.title?e:u==="default"?undefined:e;var v,m,g,y;var E={type:u,title:h,description:p,icon:(v=t.icon)!==null&&v!==void 0?v:null,duration:d,closeButton:(m=t.closeButton)!==null&&m!==void 0?m:this.config.closeButton,dir:(g=t.dir)!==null&&g!==void 0?g:this.config.dir!=="auto"?this.config.dir:"ltr",richColors:(y=t.richColors)!==null&&y!==void 0?y:this.config.richColors,position:n};var b=document.createElement("li");b.className=oH.item;b.setAttribute(oz.role,oV.listItem);b.setAttribute(oz.ariaLabelledBy,"".concat(oK).concat(s));b.setAttribute(oz.tabIndex,"0");b.setAttribute(oz.dataEntering,oV.true);b.setAttribute(oz.dataPositionY,this.yPosition(n));var T=this.buildCard(s,h,E);b.appendChild(T);this.attachSwipe(b,s);b.addEventListener("keydown",e=>{if(e.key==="Escape"){this.dismiss(s)}});if((r=this.stack)===null||r===void 0?void 0:r.firstChild){this.stack.insertBefore(b,this.stack.firstChild)}else{var w;(w=this.stack)===null||w===void 0?void 0:w.appendChild(b)}setTimeout(()=>{b.removeAttribute(oz.dataEntering);this.restack()},420);this.announce(h,p,u);var A=null;var O=0;if(d>0&&!this.hovered){O=Date.now()+d;A=setTimeout(()=>this.dismiss(s),d)}else if(d>0){O=Date.now()+d}this.entries.set(s,{id:s,element:b,card:T,timerId:A,type:u,endsAt:O,remainingMs:d,paused:this.hovered,exiting:false,swiping:false,height:0});this.restack();this.enforceLimits();return s}configure(e){var{offset:t}=e,r=(0,oF._)(e,["offset"]);if(t){this.config.offset=(0,og._)((0,or._)({},this.config.offset,t),{mobile:(0,or._)({},this.config.offset.mobile,t.mobile),lg:(0,or._)({},this.config.offset.lg,t.lg)})}this.config=(0,og._)((0,or._)({},this.config,r),{offset:this.config.offset});if(this.config.expandMode==="always"){this.expanded=true}else if(this.config.expandMode!=="hover"){this.expanded=false}if(this.container){this.syncContainerAttributes();this.applyOffset();this.restack()}}clear(){this.dismiss()}success(e,t){return this.show(e,(0,or._)({type:"success"},t!==undefined?{duration:t}:{}))}error(e,t){return this.show(e,(0,or._)({type:"error"},t!==undefined?{duration:t}:{}))}warning(e,t){return this.show(e,(0,or._)({type:"warning"},t!==undefined?{duration:t}:{}))}info(e,t){return this.show(e,(0,or._)({type:"info"},t!==undefined?{duration:t}:{}))}createContextBound(e){var t=(0,or._)({},e.dir!=null&&{dir:e.dir},e.theme!=null&&{theme:e.theme});var r=(e,r)=>this.show(e,(0,or._)({},t,r));return oJ(r,this,t)}constructor(){(0,nZ._)(this,"config",oZ());(0,nZ._)(this,"entries",new Map);(0,nZ._)(this,"idCounter",0);(0,nZ._)(this,"container",null);(0,nZ._)(this,"stack",null);(0,nZ._)(this,"expanded",false);(0,nZ._)(this,"hovered",false);this.initFullscreenListener()}}function oJ(e,t,r){var i=e=>(0,or._)({},r,e);var n=(t,r)=>e(t,r);n.success=(t,r)=>e(t,i((0,og._)((0,or._)({},r),{type:"success"})));n.error=(t,r)=>e(t,i((0,og._)((0,or._)({},r),{type:"error"})));n.warning=(t,r)=>e(t,i((0,og._)((0,or._)({},r),{type:"warning"})));n.info=(t,r)=>e(t,i((0,og._)((0,or._)({},r),{type:"info"})));n.dismiss=e=>t.dismiss(e);n.configure=e=>t.configure(e);return n}var o0=new oX;var o1=o0;var o2=null&&oU;var o4=oJ((e,t)=>o0.show(e,t),o0);// CONCATENATED MODULE: ./assets/core/ts/services/toast/Toast.ts
class o3{show(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o1.show(e,t)}success(e,t){return o1.success(e,t)}error(e,t){return o1.error(e,t)}warning(e,t){return o1.warning(e,t)}info(e,t){return o1.info(e,t)}dismiss(e){o1.dismiss(e)}clear(){o1.clear()}configure(e){o1.configure(e)}}var o8={name:"toast",instance:new o3};
var o5=()=>{return{show(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o8.instance.show(e,t)},remove(e){o8.instance.dismiss(e)},clear(){o8.instance.clear()},dismiss(e){o8.instance.dismiss(e)},success(e,t){return o8.instance.success(e,t)},error(e,t){return o8.instance.error(e,t)},warning(e,t){return o8.instance.warning(e,t)},info(e,t){return o8.instance.info(e,t)}}};var o9={name:"toast",component:o5};
var o6={TOP:"top",BOTTOM:"bottom",START:"start",END:"end"};var o7={HOVER:"hover",FOCUS:"focus",CLICK:"click"};var ae={SMALL:"small",MEDIUM:"medium",LARGE:"large"};var at={START:"start",CENTER:"center",END:"end"};var ar=8;var ai={placement:o6.TOP,trigger:o7.HOVER,size:ae.SMALL,arrow:at.START,offset:ar,delay:{show:0,hide:0}};var an=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t=(0,or._)({},ai,e);return{open:false,placement:t.placement,trigger:t.trigger,size:t.size,arrow:t.arrow,offset:t.offset,delay:t.delay,actualPlacement:"",$nextTick:undefined,$el:undefined,$refs:{},scrollHandler:null,resizeHandler:null,init(){this.actualPlacement=this.getActualPlacement();this.setupAccessibility();this.setupTriggers();this.setupEventListeners()},destroy(){this.removeEventListeners()},setupEventListeners(){this.scrollHandler=()=>{if(this.open){this.updatePosition()}};this.resizeHandler=()=>{if(this.open){this.updatePosition()}};window.addEventListener("scroll",this.scrollHandler,true);window.addEventListener("resize",this.resizeHandler)},removeEventListeners(){if(this.scrollHandler){window.removeEventListener("scroll",this.scrollHandler,true)}if(this.resizeHandler){window.removeEventListener("resize",this.resizeHandler)}},getActualPlacement(){return this.placement},setupTriggers(){
var e=this.$refs.trigger||this.$el;if(!e)return;if(this.trigger===o7.HOVER){e.addEventListener("mouseenter",()=>this.showWithDelay());e.addEventListener("mouseleave",()=>this.hideWithDelay())}else if(this.trigger===o7.FOCUS){e.addEventListener("focus",()=>this.show());e.addEventListener("blur",()=>this.hide())}else if(this.trigger===o7.CLICK){e.addEventListener("click",()=>this.toggle())}e.addEventListener("keydown",e=>{if(e.key==="Escape"&&this.open){this.hide()}})},showWithDelay(){var e=this.delay.show||0;if(e){setTimeout(()=>{if(!this.open)this.show()},e)}else{this.show()}},hideWithDelay(){var e=this.delay.hide||0;if(e){setTimeout(()=>{if(this.open)this.hide()},e)}else{this.hide()}},show(){var e=this.$refs.content;if(e){e.style.visibility="hidden"}this.open=true;var t=()=>{this.updatePosition();if(e){e.style.visibility="visible"}requestAnimationFrame(()=>this.updatePosition())};if(this.$nextTick){this.$nextTick(()=>{this.updatePosition();t()})}else{requestAnimationFrame(t)}},hide(){this.open=false;var e=this.$refs.content;if(e){e.style.visibility="hidden"}},toggle(){if(this.open){this.hide()}else{this.show()}},setupAccessibility(){var e=this.$refs.trigger||this.$el;var t=this.$refs.content;if(e&&t){var r="tooltip-".concat(Date.now());t.setAttribute("id",r);t.setAttribute("role","tooltip");e.setAttribute("aria-describedby",r)}},updatePosition(){var e=this.$refs.trigger||this.$el;var t=this.$refs.content;if(!e||!t)return;
t.style.position="fixed";
var r=t.style.transform;var i=t.style.transition;t.style.transform="none";t.style.transition="none";
var n=t.style.display;if(window.getComputedStyle(t).display==="none"){t.style.display="block"}var o=e.getBoundingClientRect();var a=t.offsetWidth;var s=t.offsetHeight;
t.style.display=n;t.style.transform=r;t.style.transition=i;
if(a===0&&s===0&&this.open){requestAnimationFrame(()=>this.updatePosition());return}var l={width:window.innerWidth,height:window.innerHeight};var u=0;var c=0;var d=this.placement;
if(this.placement===o6.TOP){var f=o.top;var h=l.height-o.bottom;if(f<s+this.offset&&h>f){d=o6.BOTTOM}}else if(this.placement===o6.BOTTOM){var _=l.height-o.bottom;var p=o.top;if(_<s+this.offset&&p>_){d=o6.TOP}}else if(this.placement===o6.START){var v=of.V?l.width-o.right:o.left;var m=of.V?o.left:l.width-o.right;if(v<a+this.offset&&m>v){d=o6.END}}else if(this.placement===o6.END){var g=of.V?o.left:l.width-o.right;var y=of.V?l.width-o.right:o.left;if(g<a+this.offset&&y>g){d=o6.START}}this.actualPlacement=d;switch(d){case o6.TOP:u=o.top-s-this.offset;c=o.left+(o.width-a)/2;break;case o6.BOTTOM:u=o.bottom+this.offset;c=o.left+(o.width-a)/2;break;case o6.START:u=o.top+(o.height-s)/2;if(!of.V){c=o.left-a-this.offset}else{c=o.right+this.offset}break;case o6.END:u=o.top+(o.height-s)/2;if(!of.V){c=o.right+this.offset}else{c=o.left-a-this.offset}break}
u=Math.max(8,Math.min(u,l.height-s-8));c=Math.max(8,Math.min(c,l.width-a-8));t.style.position="fixed";t.style.top="".concat(u,"px");t.style.left="".concat(c,"px");t.style.zIndex="1070";this.updatePlacementClasses(t,d)},updatePlacementClasses(e,t){var r=["tutor-tooltip-top","tutor-tooltip-bottom","tutor-tooltip-start","tutor-tooltip-end"];var i=["tutor-tooltip-medium","tutor-tooltip-large"];var n=["tutor-tooltip-arrow-start","tutor-tooltip-arrow-center","tutor-tooltip-arrow-end"];e.classList.remove(...r,...i,...n);e.classList.add("tutor-tooltip-".concat(t));if(this.size===ae.MEDIUM){e.classList.add("tutor-tooltip-medium")}else if(this.size===ae.LARGE){e.classList.add("tutor-tooltip-large")}e.classList.add("tutor-tooltip-arrow-".concat(this.arrow))}}};var ao={name:"tooltip",component:an};
var aa=e=>{var{name:t,editorId:r,placeholder:i=""}=e;return{name:t,editorId:r,placeholder:i,editorInstance:null,isVisualMode:true,initialized:false,init(){if(this.initialized){return}
if(typeof window.tinymce!=="undefined"){this.setupTinyMCE()}else{
this.setupTextarea()}
if(typeof window.quicktags!=="undefined"){this.setupQuickTags()}
this.setupFormResetListener();this.initialized=true},setupTinyMCE(){
var e=()=>{var t;
var r=(t=window.tinymce)===null||t===void 0?void 0:t.get(this.editorId);if(r){this.editorInstance=r;this.isVisualMode=!r.isHidden();
if(this.placeholder){r.settings.placeholder=this.placeholder}
r.on("change keyup",()=>{this.syncEditorToForm()});
r.on("blur",()=>{this.syncEditorToForm();this.triggerBlur()});
r.on("hide",()=>{this.isVisualMode=false});r.on("show",()=>{this.isVisualMode=true;this.syncEditorToForm()});
r.on("focus",()=>{this.$el.dispatchEvent(new CustomEvent(oi.T.WP_EDITOR_FOCUS,{bubbles:true}))});
r.on("keydown",e=>{if((e.metaKey||e.ctrlKey)&&e.keyCode===13){e.preventDefault();this.syncEditorToForm();var t=this.$el.closest("form");if(t){t.requestSubmit()}}});
var i=()=>{var e=()=>{var e=r.getDoc&&r.getDoc();if(!e||!e.body)return;var t=document.documentElement.getAttribute("data-tutor-theme")||"light";e.documentElement.setAttribute("data-tutor-theme",t);var i=e.body;var n=window.getComputedStyle(document.body);var o=n.getPropertyValue("--tutor-text-primary").trim();i.style.backgroundColor="transparent";i.style.color=o};e();var t=new MutationObserver(t=>{t.forEach(t=>{if(t.attributeName==="data-tutor-theme"){e()}})});t.observe(document.documentElement,{attributes:true,attributeFilter:["data-tutor-theme"]})};if(r.initialized){i()}else{r.on("init",i)}}else{
setTimeout(e,100)}};
e()},setupTextarea(){var e=document.getElementById(this.editorId);if(e){
if(this.placeholder){e.placeholder=this.placeholder}
e.addEventListener("input",()=>{this.syncTextareaToForm()});e.addEventListener("blur",()=>{this.syncTextareaToForm();this.triggerBlur()});
e.addEventListener("focus",()=>{this.$el.dispatchEvent(new CustomEvent(oi.T.WP_EDITOR_FOCUS,{bubbles:true}))})}},setupQuickTags(){
var e=document.getElementById(this.editorId);if(e){
var t="qt_".concat(this.editorId,"_toolbar");var r=document.getElementById(t);if(r){r.addEventListener("click",()=>{
setTimeout(()=>{if(!this.isVisualMode){this.syncTextareaToForm()}},50)})}}},setupFormResetListener(){
window.addEventListener(oi.T.FORM_RESET,e=>{var t;var r=e;var{formId:i,defaultValues:n}=r.detail||{};
var o=this.$el.closest("form");if(o&&((t=o.getAttribute("x-data"))===null||t===void 0?void 0:t.includes("id: '".concat(i,"'")))){
var a=(n===null||n===void 0?void 0:n[this.name])||"";this.setContent(a)}})},syncEditorToForm(){if(this.editorInstance){var e=this.editorInstance.getContent();this.updateFormValue(e)}},syncTextareaToForm(){var e=document.getElementById(this.name);if(e){this.updateFormValue(e.value)}},updateFormValue(e){
var t=this.$el.querySelector('input[name="'.concat(this.name,'"]'));if(t){
t.value=e;
t.dispatchEvent(new Event("input",{bubbles:true}))}},triggerBlur(){var e=this.$el.querySelector('input[name="'.concat(this.name,'"]'));if(e){e.dispatchEvent(new Event("blur",{bubbles:true}))}},getContent(){if(this.isVisualMode&&this.editorInstance){return this.editorInstance.getContent()}var e=document.getElementById(this.name);return e?e.value:""},setContent(e){if(this.isVisualMode&&this.editorInstance){this.editorInstance.setContent(e)}var t=document.getElementById(this.name);if(t){t.value=e}this.updateFormValue(e)}}};var as={name:"WPEditor",component:aa};
var al,au;var ac={ID:0,ajaxurl:"",site_url:"",home_url:"",site_title:"",base_path:"",tutor_url:"",tutor_pro_url:"",dashboard_url:"",nonce_key:"",_tutor_nonce:"",loading_icon_url:"",placeholder_img_src:"",enable_lesson_classic_editor:"",tutor_frontend_dashboard_url:"",backend_course_list_url:"",backend_bundle_list_url:"",frontend_course_list_url:"",frontend_bundle_list_url:"",wp_date_format:"",wp_rest_nonce:"",is_admin:"",is_admin_bar_showing:"",is_tour_completed:"",max_upload_size:"",content_change_event:"",is_tutor_course_edit:"",assignment_max_file_allowed:"",current_page:"",quiz_answer_display_time:"",is_ssl:"",course_list_page_url:"",course_post_type:"",local:"",tutor_pn_vapid_key:"",tutor_pn_client_id:"",tutor_pn_subscription_saved:"",difficulty_levels:[],supported_video_sources:[],edd_products:[],bp_groups:[],timezones:{},addons_data:[],kids_icons_registry:[],is_kids_mode:false,user_preferences:{auto_play_next:false,contrast:"",font_scale:1,learning_mood:"modern",motion_effects:"auto",theme:"light",vision:"normal"},is_legacy_learning_mode:false,current_user:{data:{id:"",user_login:"",user_pass:"",user_nicename:"",user_email:"",user_url:"",user_registered:"",user_activation_key:"",user_status:"",display_name:""},caps:{},cap_key:"",roles:[],allcaps:{},filter:null},settings:{learning_mode:"",monetize_by:"tutor",enable_course_marketplace:"off",course_permalink_base:"",supported_video_sources:"",enrollment_expiry_enabled:"off",enable_q_and_a_on_course:"off",instructor_can_delete_course:"off",instructor_can_change_course_author:"off",instructor_can_manage_co_instructors:"off",chatgpt_enable:"off",course_builder_logo_url:"",chatgpt_key_exist:false,hide_admin_bar_for_users:"off",enable_redirect_on_course_publish_from_frontend:"off",instructor_can_publish_course:"off",youtube_api_key_exist:false,membership_only_mode:false,enable_tax:false,enable_individual_tax_control:false,is_tax_included_in_price:false},tutor_currency:{symbol:"",currency:"",position:"",thousand_separator:"",decimal_separator:"",no_of_decimal:""},visibility_control:{course_builder:{}}};var ad=window._tutorobject||ac;window.ajaxurl=ad.ajaxurl;var af={TUTOR_SITE_URL:ad.site_url,WP_AJAX_BASE_URL:ad.ajaxurl,WP_API_BASE_URL:"".concat(((al=window.wpApiSettings)===null||al===void 0?void 0:al.root)||"").concat(((au=window.wpApiSettings)===null||au===void 0?void 0:au.versionString)||""),VIDEO_SOURCES_SETTINGS_URL:"".concat(ad.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=course#field_supported_video_sources"),MONETIZATION_SETTINGS_URL:"".concat(ad.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=monetization"),TUTOR_PRICING_PAGE:"https://tutorlms.com/pricing/",TUTOR_ADDONS_PAGE:"".concat(ad.site_url,"/wp-admin/admin.php?page=tutor-addons"),CHATGPT_PLATFORM_URL:"https://platform.openai.com/account/api-keys",TUTOR_MY_COURSES_PAGE_URL:"".concat(ad.tutor_frontend_dashboard_url,"/my-courses"),TUTOR_SUPPORT_PAGE_URL:"https://tutorlms.com/support",TUTOR_SUBSCRIPTIONS_PAGE:"".concat(ad.site_url,"/wp-admin/admin.php?page=tutor-subscriptions"),TUTOR_ENROLLMENTS_PAGE:"".concat(ad.site_url,"/wp-admin/admin.php?page=enrollments"),TUTOR_COUPONS_PAGE:"".concat(ad.site_url,"/wp-admin/admin.php?page=tutor_coupons"),TUTOR_IMPORT_EXPORT_PAGE:"".concat(ad.site_url,"/wp-admin/admin.php?page=tutor-tools&sub_page=import_export")};const ah=null&&af;// CONCATENATED MODULE: ./assets/core/ts/utils/nonce.ts
function a_(e){var t=window._tutorobject||{};var r=t.nonce_key||"";var i=t[r]||"";if(e){return{key:r,value:i}}return{[r]:i}};
function ap(e){return a_(e)};
function av(e){var t=document.createElement("div");t.innerText=e;var r=t.innerHTML;t.remove();return r}function am(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")};
function ag(e){return av(e)}function ay(e){return am(e)};
function aE(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"info",i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:true;var n;
var o=t||e;var a=t?e:undefined;var s=i?5e3:0;
if((n=window.TutorCore)===null||n===void 0?void 0:n.toast){window.TutorCore.toast.show(o,(0,og._)((0,or._)({type:r},a&&{title:a}),{duration:s}))}else{
console.warn("[Tutor Toast] Core toast service not available:",o)}};
function ab(){
window.tutor_get_nonce_data=ap;
window.tutor_toast=aE;
window.tutor_esc_html=ag;window.tutor_esc_attr=ay;
if(typeof wp!=="undefined"&&wp.i18n){window.defaultErrorMessage=wp.i18n.__("Something went wrong","tutor")}}
;
class aT{setupEventListeners(){document.addEventListener(oi.T.FORM_REGISTER,e=>{var{id:t,instance:r}=e.detail;this.register(t,r)});document.addEventListener(oi.T.FORM_UNREGISTER,e=>{var{id:t}=e.detail;this.unregister(t)})}register(e,t){this.forms.set(e,t)}unregister(e){this.forms.delete(e)}getForm(e){var t=this.forms.get(e);if(!t){throw new Error('Form with id "'.concat(e,'" not found. Make sure the form is initialized with the correct id.'))}return t}getValues(e){return this.getForm(e).watch()}getValue(e,t){return this.getForm(e).getValue(t)}setValue(e,t,r,i){this.getForm(e).setValue(t,r,i)}setValues(e,t,r){var i=this.getForm(e);for(var[n,o]of Object.entries(t)){i.setValue(n,o,r)}}reset(e,t){this.getForm(e).reset(t)}trigger(t,r){return(0,e._)(function*(){return this.getForm(t).trigger(r)}).call(this)}clearErrors(e,t){this.getForm(e).clearErrors(t)}setError(e,t,r){this.getForm(e).setError(t,r)}setFocus(e,t,r){this.getForm(e).setFocus(t,r)}getFormState(e){return this.getForm(e).getFormState()}watch(e,t){return this.getForm(e).watch(t)}hasForm(e){return this.forms.has(e)}constructor(){(0,nZ._)(this,"forms",new Map);this.setupEventListeners()}}var aw={name:"form",instance:new aT};
class aA{showModal(e,t){document.dispatchEvent(new CustomEvent(oi.T.MODAL_OPEN,{detail:{id:e,data:t}}))}updateModal(e,t){document.dispatchEvent(new CustomEvent(oi.T.MODAL_UPDATE,{detail:{id:e,data:t}}))}closeModal(e){document.dispatchEvent(new CustomEvent(oi.T.MODAL_CLOSE,{detail:{id:e}}))}}var aO={name:"modal",instance:new aA};
class ax{getWrapper(){return document.querySelector("[".concat(this.DATA_THEME_ATTR,"]"))||document.documentElement}inferBase(e){return(e===null||e===void 0?void 0:e.startsWith("dark"))?"dark":"light"}initialize(){var e=this.getWrapper();var t=e.getAttribute(this.DATA_THEME_ATTR);
if(t===this.THEME.SYSTEM)this.applyTheme(this.THEME.SYSTEM,false);var r;var i=(r=e.getAttribute(this.DATA_CONTRAST_ATTR))!==null&&r!==void 0?r:"";if(i){this.applyContrast(i)}var n;var o=(n=e.getAttribute(this.DATA_MOTION_ATTR))!==null&&n!==void 0?n:"";this.applyMotionEffects(o)}applyTheme(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:true;if(!e)return;var r=this.getWrapper();
var i=e===this.THEME.SYSTEM?this.mediaQuery.matches?this.THEME.DARK:this.THEME.LIGHT:e;
var n=r.getAttribute(this.DATA_THEME_ATTR);var o=this.inferBase(n);if(i===o&&e!==this.THEME.SYSTEM){return}if(this.systemThemeListener){this.mediaQuery.removeEventListener("change",this.systemThemeListener);this.systemThemeListener=undefined}var a=()=>{if(e===this.THEME.SYSTEM){var t=this.mediaQuery.matches?this.THEME.DARK:this.THEME.LIGHT;r.setAttribute(this.DATA_THEME_ATTR,t)}else{r.setAttribute(this.DATA_THEME_ATTR,e)}};var s=()=>{a();if(e===this.THEME.SYSTEM){this.systemThemeListener=()=>a();this.mediaQuery.addEventListener("change",this.systemThemeListener)}var t=r.getAttribute(this.DATA_THEME_ATTR);this.activeTheme=this.inferBase(t)};if(t&&document.startViewTransition){document.startViewTransition(()=>{s()})}else{s()}}applyContrast(e){var t=this.getWrapper();if(e==="high"){t.setAttribute(this.DATA_CONTRAST_ATTR,"high")}else{t.removeAttribute(this.DATA_CONTRAST_ATTR)}}applyVision(e){var t=this.getWrapper();var r=e==="protanopia"||e==="deuteranopia"||e==="deuteranomaly"?e:"normal";if(r==="normal"){t.removeAttribute(this.DATA_VISION_ATTR)}else{t.setAttribute(this.DATA_VISION_ATTR,r)}}applyMotionEffects(e){var t=this.getWrapper();if(e==="reduce"){t.setAttribute(this.DATA_MOTION_ATTR,"reduce")}else if(e==="auto"){t.setAttribute(this.DATA_MOTION_ATTR,"auto")}else{t.removeAttribute(this.DATA_MOTION_ATTR)}}applyFontScale(e){if(!e)return;var t=document.head;var r=document.getElementById(this.STYLE_ID);var i=typeof e==="string"?parseInt(e,10):Number(e);if(Number.isNaN(i)||i<=0)return;var n=this.BASE_FONT_SIZE*i/this.SCALE_PERCENTAGE_BASE;if(!r){r=document.createElement("style");r.id=this.STYLE_ID;t.appendChild(r)}r.textContent=":root { font-size: ".concat(n,"px; }")}constructor(){(0,nZ._)(this,"THEME",{DARK:"dark",LIGHT:"light",SYSTEM:"system"});(0,nZ._)(this,"activeTheme",void 0);(0,nZ._)(this,"mediaQuery",void 0);(0,nZ._)(this,"systemThemeListener",void 0);(0,nZ._)(this,"BASE_FONT_SIZE",16);(0,nZ._)(this,"SCALE_PERCENTAGE_BASE",100);(0,nZ._)(this,"STYLE_ID","tutor-font-scale");(0,nZ._)(this,"DATA_THEME_ATTR","data-tutor-theme");(0,nZ._)(this,"DATA_VISION_ATTR","data-tutor-vision");(0,nZ._)(this,"DATA_CONTRAST_ATTR","data-tutor-contrast");(0,nZ._)(this,"DATA_MOTION_ATTR","data-tutor-motion");this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)");this.activeTheme=this.mediaQuery.matches?this.THEME.DARK:this.THEME.LIGHT;this.initialize()}}var aS={name:"preference",instance:new ax};
class aC{generateKey(e){if(typeof e==="string")return e;return JSON.stringify(e)}get(e){return this.cache.get(this.generateKey(e))}set(e,t){this.cache.set(this.generateKey(e),{data:t,timestamp:Date.now()})}invalidate(e){this.cache.delete(this.generateKey(e))}invalidatePattern(e){var t=Array.from(this.cache.keys());t.forEach(t=>{if(t.includes(e)){this.cache.delete(t)}})}clear(){this.cache.clear()}getInfo(e){var t=this.cache.get(this.generateKey(e));if(!t)return"No cache";var r=Math.round((Date.now()-t.timestamp)/1e3);return"Cached ".concat(r,"s ago")}constructor(){(0,nZ._)(this,"cache",new Map)}}class aN{generateKey(e){if(typeof e==="string")return e;return JSON.stringify(e)}registerQueryInstance(e,t){var r;var i=this.generateKey(e);if(!this.queryInstances.has(i)){this.queryInstances.set(i,new Set)}(r=this.queryInstances.get(i))===null||r===void 0?void 0:r.add(t)}refetchQueryInstances(t){return(0,e._)(function*(){var e=this.generateKey(t);var r=this.queryInstances.get(e);if(!(r===null||r===void 0?void 0:r.size)){return}yield Promise.all(Array.from(r).map(e=>{if(!e||e.isFetching){return Promise.resolve()}return e.refetch()}))}).call(this)}refetchQueryInstancesByPattern(t){return(0,e._)(function*(){var e=Array.from(this.queryInstances.entries()).filter(e=>{var[r]=e;return r.includes(t)});if(!e.length){return}yield Promise.all(e.flatMap(e=>{var[,t]=e;return Array.from(t).map(e=>{if(!e||e.isFetching){return Promise.resolve()}return e.refetch()})}))}).call(this)}useQuery(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=i.staleTime||0;var o=i.enabled!==undefined?i.enabled:true;var a=this.queryCache;
var s=nQ.reactive({data:null,error:null,isLoading:o,isFetching:false,isStale:false,fetchData(){return(0,e._)(function*(){this.isFetching=true;try{var e=yield r();this.data=e;this.error=null;this.isStale=false;a.set(t,e)}catch(e){this.error={message:e.message||"Failed to fetch data",code:e.code}}finally{this.isLoading=false;this.isFetching=false}}).call(this)},refetch(){return(0,e._)(function*(){this.isLoading=false;this.isFetching=true;yield this.fetchData()}).call(this)},init(){return(0,e._)(function*(){if(!o){this.isLoading=false;return}var e=a.get(t);if(e&&Date.now()-e.timestamp<n){this.data=e.data;this.isLoading=false;this.isStale=false;return}if(e){this.isStale=true}yield this.fetchData()}).call(this)}});
s.init();this.registerQueryInstance(t,s);return s}useMutation(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var i=nQ.reactive({data:null,error:null,isPending:false,isError:false,isSuccess:false,mutate(i){return(0,e._)(function*(){this.isPending=true;this.isError=false;this.isSuccess=false;this.error=null;try{
if(r.onMutate){yield r.onMutate(i)}var e=yield t(i);this.data=e;this.isSuccess=true;if(r.onSuccess){yield r.onSuccess(e,i)}
if(r.onSettled){r.onSettled(e,null,i)}return e}catch(e){this.error=e;this.isError=true;if(r.onError){r.onError(e,i)}
if(r.onSettled){r.onSettled(null,e,i)}throw e}finally{this.isPending=false}}).call(this)},mutateAsync(t){return(0,e._)(function*(){return yield this.mutate(t)}).call(this)},reset(){this.data=null;this.error=null;this.isPending=false;this.isError=false;this.isSuccess=false}});return i}invalidateQuery(e){this.queryCache.invalidate(e);void this.refetchQueryInstances(e)}invalidateQueries(e){this.queryCache.invalidatePattern(e);void this.refetchQueryInstancesByPattern(e)}getCacheInfo(e){return this.queryCache.getInfo(e)}clearCache(){this.queryCache.clear()}constructor(){(0,nZ._)(this,"queryCache",new aC);(0,nZ._)(this,"queryInstances",new Map)}}var aL={name:"query",instance:new aN};
class aP{isAvailable(){var e;return typeof((e=window.wp)===null||e===void 0?void 0:e.media)==="function"}open(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];var i;if(!this.isAvailable()){
console.error((0,n4.__)("WordPress media library is not available","tutor"));return null}var n,o,a;var s={title:(n=e.title)!==null&&n!==void 0?n:(0,n4.__)("Select File","tutor"),button:{text:(o=(i=e.button)===null||i===void 0?void 0:i.text)!==null&&o!==void 0?o:(0,n4.__)("Use this file","tutor")},multiple:e.multiple?"add":false,library:(a=e.library)!==null&&a!==void 0?a:{}};var l=window.wp.media(s);var u=()=>{var e;var t=l.state().get("selection");(e=l.$el)===null||e===void 0?void 0:e.attr("data-focus-trap","true");t.reset();
r.forEach(e=>{var r=window.wp.media.attachment(e);if(r){r.fetch();t.add(r)}})};var c=()=>{var r=l.state().get("selection").toJSON();var i=r.reduce((t,r)=>{
if(e.maxFileSize&&r.filesizeInBytes>e.maxFileSize){var i;(i=this.toastService)===null||i===void 0?void 0:i.error((0,n4.sprintf)((0,n4.__)("%s exceeds the maximum allowed file size","tutor"),r.title));return t}var n={id:r.id,title:r.title,url:r.url,name:r.filename,size:r.filesizeHumanReadable,size_bytes:r.filesizeInBytes,ext:r.filename.split(".").pop()||"",mime:r.mime};t.push(n);return t},[]);
if(e.maxFiles&&i.length>e.maxFiles){var n;(n=this.toastService)===null||n===void 0?void 0:n.warning((0,n4.sprintf)((0,n4.__)("Cannot select more than %d files","tutor"),e.maxFiles));return}t(i);l.close()};var d=()=>{if(l.$el){l.$el.parent().parent().remove()}};l.on("open",u);l.on("select",c);l.on("close",d);l.open();
return()=>{l.off("open",u);l.off("select",c);l.off("close",d)}}constructor(){var e;(0,nZ._)(this,"toastService",(e=window.TutorCore)===null||e===void 0?void 0:e.toast)}}var ak={name:"wpMedia",instance:new aP};
var aR=(e,t)=>{return t in e};var aI=e=>{return e.isAxiosError};var aM=e=>{return e!==undefined&&e!==null};function aD(e){return typeof e==="string"||e instanceof String}function aB(e){return!!e&&Array.isArray(e)&&(!e.length||typeof e[0]!=="object")}function aF(e){return aB(e)&&(!e.length||typeof e[0]==="string"||e[0]instanceof String)}function aU(e){return typeof e==="number"||e instanceof Number}function aG(e){return typeof e==="boolean"||e instanceof Boolean}function a$(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var aH=e=>{return e instanceof Blob||e instanceof File};var aj=null&&{NEW:"new",UPDATE:"update",NO_CHANGE:"no_change"};
var az=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return Object.keys(e).reduce((r,i)=>{var n=e[i];if(typeof n==="object"&&!isPrimitivesArray(n)&&!isFileOrBlob(n)){return _object_spread({},r,az(_object_spread({},n),"".concat(t).concat(i,".")))}return _object_spread_props(_object_spread({},r),{["".concat(t).concat(i)]:n})},{})};var aV=(e,t)=>{var r=e;if(r.status===404||r.status===403||r.status===500){return{nonFieldErrors:["Unexpected error!"]}}var i=az(t);var n=az(r.data);var{non_field_errors:o}=n,a=_object_without_properties(n,["non_field_errors"]);var s=isStringArray(o)?o:[];for(var l of Object.keys(a)){if(!(l in i)){var u=n[l];if(isStringArray(u)){s.push(...u)}}}return{nonFieldErrors:s.map(translateBeErrorMessage),fieldErrors:Object.keys(n).filter(e=>e in i).reduce((e,t)=>{var r=n[t];if(isStringArray(r)){return _object_spread_props(_object_spread({},e),{[t]:r.map(translateBeErrorMessage)})}return e},{})}};var aq=(e,t,r)=>{if(!isAxiosError(e)||!e.response){throw e}var{fieldErrors:i,nonFieldErrors:n}=aV(e.response,r);if(n===null||n===void 0?void 0:n.length){t.setSubmitError(n[0])}if(i){for(var o of Object.keys(i)){var a=i[o];if(a.length>0){t.setError(o,{message:a[0]})}}}};var aW=(e,t)=>{return r=>_async_to_generator(function*(){e.setSubmitError(undefined);try{yield t(r)}catch(t){aq(t,e,r)}})()};var aK=(e,t)=>{var r=function(t){var r=e[t];if(Array.isArray(r)){r.forEach((e,r)=>{if(aH(e)||aD(e)){i.append("".concat(t,"[").concat(r,"]"),e)}else if(aG(e)||aU(e)){i.append("".concat(t,"[").concat(r,"]"),e.toString())}else if(typeof e==="object"&&e!==null){i.append("".concat(t,"[").concat(r,"]"),JSON.stringify(e))}else{i.append("".concat(t,"[").concat(r,"]"),e)}})}else{if(aH(r)||aD(r)){i.append(t,r)}else if(aG(r)){i.append(t,r.toString())}else if(aU(r)){i.append(t,"".concat(r))}else if(typeof r==="object"&&r!==null){i.append(t,JSON.stringify(r))}else{i.append(t,r)}}};var i=new FormData;for(var n of Object.keys(e))r(n);i.append("_method",t.toUpperCase());return i};var aY=e=>{var t={};for(var r in e){var i=e[r];if(!isDefined(i)){t[r]="null"}else if(isBoolean(i)){t[r]=i===true?"true":"false"}else{t[r]=i}}return t};
function aQ(t,r,i){return(0,e._)(function*(){var e=yield fetch(t,{method:r,body:i,credentials:"same-origin"});var n=yield e.text();var o;try{o=JSON.parse(n)}catch(t){if(!e.ok){throw new Error("HTTP ".concat(e.status))}return n}var a=o;
if(!e.ok){var s=typeof(a===null||a===void 0?void 0:a.message)==="string"?a.message:"HTTP ".concat(e.status);throw new Error(s)}
if((a===null||a===void 0?void 0:a.success)===false){var l;var u=typeof(a===null||a===void 0?void 0:a.data)==="string"?a.data:typeof(a===null||a===void 0?void 0:(l=a.data)===null||l===void 0?void 0:l.message)==="string"?a.data.message:(0,n4.__)("Something went wrong","tutor");throw new Error(u)}return o})()}function aZ(e){return aQ(e,"GET")}function aX(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return aQ(n5.A.WP_AJAX_BASE_URL,"POST",aK((0,og._)((0,or._)({},t),{action:e,[n5.P.nonce_key]:n5.P._tutor_nonce}),"POST"))}function aJ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return aQ(e,"POST",aK((0,og._)((0,or._)({},t),{_tutor_nonce:n5.P._tutor_nonce}),"POST"))};
function a0(){var e=new Set;var t=t=>{var r;var i=(r=t.getAttribute("x-data"))!==null&&r!==void 0?r:"";var n=/\btutor([A-Z][A-Za-z0-9]*)\b/g;var o;while((o=n.exec(i))!==null){var a=o[1].charAt(0).toLowerCase()+o[1].slice(1);e.add(a)}};document.querySelectorAll("[x-data]").forEach(t);document.querySelectorAll("template").forEach(e=>{e.content.querySelectorAll("[x-data]").forEach(t)});return[...e]};
var a1,a2,a4,a3,a8;var a5=e=>{var{symbol:t="$",position:r="left",thousandSeparator:i=",",decimalSeparator:n=".",fraction_digits:o=2}=e;return e=>{var a=e=>{var t=e.toFixed(o);var[r,a]=t.split(".");var s=r.replace(/\B(?=(\d{3})+(?!\d))/g,i);return a?"".concat(s).concat(n).concat(a):s};var s=a(Number(e));if(r==="left"){return"".concat(t).concat(s)}return"".concat(s).concat(t)}};var a9,a6,a7,se,st;var sr=a5({symbol:(a9=(a1=ad.tutor_currency)===null||a1===void 0?void 0:a1.symbol)!==null&&a9!==void 0?a9:"$",position:(a6=(a2=ad.tutor_currency)===null||a2===void 0?void 0:a2.position)!==null&&a6!==void 0?a6:"left",thousandSeparator:(a7=(a4=ad.tutor_currency)===null||a4===void 0?void 0:a4.thousand_separator)!==null&&a7!==void 0?a7:",",decimalSeparator:(se=(a3=ad.tutor_currency)===null||a3===void 0?void 0:a3.decimal_separator)!==null&&se!==void 0?se:".",fraction_digits:Number((st=(a8=ad.tutor_currency)===null||a8===void 0?void 0:a8.no_of_decimal)!==null&&st!==void 0?st:2)});var si=e=>{var t,r,i;var n;var o=(n=(t=tutorConfig.tutor_currency)===null||t===void 0?void 0:t.currency)!==null&&n!==void 0?n:"USD";var a;var s=(a=(r=tutorConfig.local)===null||r===void 0?void 0:r.replace("_","-"))!==null&&a!==void 0?a:"en-US";var l;var u=Number((l=(i=tutorConfig.tutor_currency)===null||i===void 0?void 0:i.no_of_decimal)!==null&&l!==void 0?l:2);var c=new Intl.NumberFormat(s,{style:"currency",currency:o,minimumFractionDigits:u});return c.format(e)};var sn=e=>{var{discount_type:t,discount_amount:r,total:i}=e;var n=so({discount_amount:r,discount_type:t,total:i});return i-n};var so=e=>{var{discount_type:t,discount_amount:r,total:i}=e;if(t==="flat"){return r}return i*(r/100)};
var sa=e=>{var t=new DOMParser;var r=t.parseFromString(e,"text/html");return r.body.textContent||""};
var ss={ADMIN_AJAX:"wp-admin/admin-ajax.php",TAGS:"course-tag",CATEGORIES:"course-category",USERS:"users",USERS_LIST:"tutor_user_list",ORDER_DETAILS:"tutor_order_details",ADMIN_COMMENT:"tutor_order_comment",ORDER_MARK_AS_PAID:"tutor_order_paid",ORDER_REFUND:"tutor_order_refund",ORDER_CANCEL:"tutor_order_cancel",ADD_ORDER_DISCOUNT:"tutor_order_discount",COURSE_LIST:"course_list",BUNDLE_LIST:"tutor_get_bundle_list",CATEGORY_LIST:"category_list",CREATED_COURSE:"tutor_create_course",TUTOR_INSTRUCTOR_SEARCH:"tutor_course_instructor_search",CREATE_DRAFT_COURSE:"tutor_create_new_draft_course",TUTOR_YOUTUBE_VIDEO_DURATION:"tutor_youtube_video_duration",TUTOR_UNLINK_PAGE_BUILDER:"tutor_unlink_page_builder",
GENERATE_AI_IMAGE:"tutor_pro_generate_image",MAGIC_FILL_AI_IMAGE:"tutor_pro_magic_fill_image",MAGIC_TEXT_GENERATION:"tutor_pro_generate_text_content",MAGIC_AI_MODIFY_CONTENT:"tutor_pro_modify_text_content",USE_AI_GENERATED_IMAGE:"tutor_pro_use_magic_image",OPEN_AI_SAVE_SETTINGS:"tutor_pro_chatgpt_save_settings",GENERATE_COURSE_CONTENT:"tutor_pro_generate_course_content",GENERATE_COURSE_TOPIC_CONTENT:"tutor_pro_generate_course_topic_content",SAVE_AI_GENERATED_COURSE_CONTENT:"tutor_pro_ai_course_create",GENERATE_QUIZ_QUESTIONS:"tutor_pro_generate_quiz_questions",GENERATE_AI_QUIZ_QUESTIONS:"tutor_pro_ai_generate_questions",
GET_SUBSCRIPTIONS_LIST:"tutor_subscription_plans",SAVE_SUBSCRIPTION:"tutor_subscription_plan_save",DELETE_SUBSCRIPTION:"tutor_subscription_plan_delete",DUPLICATE_SUBSCRIPTION:"tutor_subscription_plan_duplicate",SORT_SUBSCRIPTION:"tutor_subscription_plan_sort",UPDATE_SUBSCRIPTION_STATUS:"tutor_subscription_status_update",RESUME_SUBSCRIPTION:"tutor_subscription_resume",EARLY_RENEW_SUBSCRIPTION:"tutor_subscription_early_renew",
GET_COURSE_DETAILS:"tutor_course_details",UPDATE_COURSE:"tutor_update_course",GET_COURSE_LIST:"tutor_course_list",RESET_COURSE_PROGRESS:"tutor_reset_course_progress",TUTOR_COMPLETE_COURSE:"tutor_complete_course",
GET_WC_PRODUCTS:"tutor_get_wc_products",GET_WC_PRODUCT_DETAILS:"tutor_get_wc_product",
GET_QUIZ_DETAILS:"tutor_quiz_details",SAVE_QUIZ:"tutor_quiz_builder_save",QUIZ_IMPORT_DATA:"quiz_import_data",QUIZ_EXPORT_DATA:"quiz_export_data",DELETE_QUIZ:"tutor_quiz_delete",START_QUIZ:"tutor_start_quiz",QUIZ_ABANDON:"tutor_quiz_abandon",QUIZ_TIMEOUT:"tutor_quiz_timeout",QUIZ_ATTEMPT_SUBMIT:"tutor_answering_quiz_question",REVIEW_QUIZ_ANSWERS:"tutor_review_quiz_answers",INSTRUCTOR_FEEDBACK:"tutor_instructor_feedback",
GET_ZOOM_MEETING_DETAILS:"tutor_zoom_meeting_details",SAVE_ZOOM_MEETING:"tutor_zoom_save_meeting",DELETE_ZOOM_MEETING:"tutor_zoom_delete_meeting",ZOOM_SAVE_API:"tutor_save_zoom_api",ZOOM_SAVE_SETTINGS:"tutor_save_zoom_settings",
GET_GOOGLE_MEET_DETAILS:"tutor_google_meet_meeting_details",SAVE_GOOGLE_MEET:"tutor_google_meet_new_meeting",DELETE_GOOGLE_MEET:"tutor_google_meet_delete",UPLOAD_GOOGLE_MEET_CREDENTIALS:"tutor_pro_google_meet_credential_upload",RESET_GOOGLE_MEET_CREDENTIALS:"tutor_google_meet_reset_cred",UPDATE_GOOGLE_MEET_SETTINGS:"tutor_update_google_meet_settings",
GET_COURSE_CONTENTS:"tutor_course_contents",SAVE_TOPIC:"tutor_save_topic",DELETE_TOPIC:"tutor_delete_topic",DELETE_TOPIC_CONTENT:"tutor_delete_lesson",UPDATE_COURSE_CONTENT_ORDER:"tutor_update_course_content_order",DUPLICATE_CONTENT:"tutor_duplicate_content",ADD_CONTENT_BANK_CONTENT_TO_COURSE:"tutor_content_bank_add_content_to_course",DELETE_CONTENT_BANK_CONTENT_FROM_COURSE:"tutor_content_bank_remove_content_from_course",
GET_LESSON_DETAILS:"tutor_lesson_details",SAVE_LESSON:"tutor_save_lesson",LOAD_LESSON_COMMENTS:"tutor_load_lesson_comments",CREATE_LESSON_COMMENT:"tutor_create_lesson_comment",UPDATE_LESSON_COMMENT:"tutor_update_lesson_comment",DELETE_LESSON_COMMENT:"tutor_delete_lesson_comment",REPLY_LESSON_COMMENT:"tutor_reply_lesson_comment",LOAD_COMMENT_REPLIES:"tutor_load_comment_replies",
QNA_SINGLE_ACTION:"tutor_qna_single_action",DELETE_DASHBOARD_QNA:"tutor_delete_dashboard_question",CREATE_UPDATE_QNA:"tutor_qna_create_update",UPDATE_QNA:"tutor_qna_update",LOAD_QNA_REPLIES:"tutor_qna_load_replies",
GET_ASSIGNMENT_DETAILS:"tutor_assignment_details",SAVE_ASSIGNMENT:"tutor_assignment_save",ASSIGNMENT_SUBMIT:"tutor_assignment_submit",REMOVE_ATTACHMENT:"tutor_remove_assignment_attachment",REMOVE_ASSIGNMENT_ATTEMPT:"tutor_remove_assignment_attempt",
GET_TAX_SETTINGS:"tutor_get_tax_settings",GET_H5P_QUIZ_CONTENT:"tutor_h5p_list_quiz_contents",GET_H5P_LESSON_CONTENT:"tutor_h5p_list_lesson_contents",GET_H5P_QUIZ_CONTENT_BY_ID:"tutor_h5p_quiz_content_by_id",
GET_PAYMENT_SETTINGS:"tutor_payment_settings",GET_PAYMENT_GATEWAYS:"tutor_payment_gateways",INSTALL_PAYMENT_GATEWAY:"tutor_install_payment_gateway",REMOVE_PAYMENT_GATEWAY:"tutor_remove_payment_gateway",
GET_ADDON_LIST:"tutor_get_all_addons",ADDON_ENABLE_DISABLE:"addon_enable_disable",
TUTOR_INSTALL_PLUGIN:"tutor_install_plugin",
GET_COUPON_DETAILS:"tutor_coupon_details",CREATE_COUPON:"tutor_coupon_create",UPDATE_COUPON:"tutor_coupon_update",COUPON_APPLIES_TO:"tutor_coupon_applies_to_list",
CREATE_ENROLLMENT:"tutor_enroll_bulk_student",GET_COURSE_BUNDLE_LIST:"tutor_course_bundle_list",GET_UNENROLLED_USERS:"tutor_unenrolled_users",
GET_MEMBERSHIP_PLANS:"tutor_membership_plans",SAVE_MEMBERSHIP_PLAN:"tutor_membership_plan_save",DUPLICATE_MEMBERSHIP_PLAN:"tutor_membership_plan_duplicate",DELETE_MEMBERSHIP_PLAN:"tutor_membership_plan_delete",
GET_BUNDLE_DETAILS:"tutor_get_course_bundle_data",UPDATE_BUNDLE:"tutor_create_course_bundle",ADD_REMOVE_COURSE_TO_BUNDLE:"tutor_add_remove_course_to_bundle",
GET_EXPORTABLE_CONTENT:"tutor_pro_exportable_contents",EXPORT_CONTENTS:"tutor_pro_export",EXPORT_SETTINGS_FREE:"tutor_export_settings",IMPORT_CONTENTS:"tutor_pro_import",IMPORT_SETTINGS_FREE:"tutor_import_settings",GET_IMPORT_EXPORT_HISTORY:"tutor_pro_export_import_history",DELETE_IMPORT_EXPORT_HISTORY:"tutor_pro_delete_export_import_history",
GET_CONTENT_BANK_COLLECTIONS:"tutor_content_bank_collections",SAVE_CONTENT_BANK_COLLECTION:"tutor_content_bank_collection_save",DELETE_CONTENT_BANK_COLLECTION:"tutor_content_bank_collection_delete",GET_CONTENT_BANK_CONTENTS:"tutor_content_bank_contents",DELETE_CONTENT_BANK_CONTENTS:"tutor_content_bank_content_delete",GET_CONTENT_DETAILS:"tutor_pro_get_content_details",GET_CONTENT_BANK_LESSON_DETAILS:"tutor_content_bank_lesson_details",GET_CONTENT_BANK_ASSIGNMENT_DETAILS:"tutor_content_bank_assignment_details",SAVE_CONTENT_BANK_LESSON_CONTENT:"tutor_content_bank_lesson_save",SAVE_CONTENT_BANK_ASSIGNMENT_CONTENT:"tutor_content_bank_assignment_save",SAVE_QUESTION_CONTENT:"tutor_content_bank_question_save",GET_CONTENT_BANK_QUESTION_DETAILS:"tutor_content_bank_question_details",DUPLICATE_CONTENT_BANK_CONTENT:"tutor_content_bank_content_duplicate",MOVE_CONTENT_BANK_CONTENT:"tutor_content_bank_content_move",DUPLICATE_CONTENT_BANK_COLLECTION:"tutor_content_bank_collection_duplicate",IMPORT_FROM_COURSES:"tutor_content_bank_content_synchronize",
GET_CALENDAR_EVENTS:"get_calendar_materials",
CREATE_ANNOUNCEMENT:"tutor_announcement_create",DELETE_ANNOUNCEMENT:"tutor_announcement_delete",
PUSH_NOTIFICATION_SAVE_SUBSCRIPTION:"tutor_pn_save_subscription",GET_ALL_NOTIFICATIONS:"tutor_get_all_notifications",MARK_ALL_NOTIFICATIONS_AS_READ:"toggle_all_notifications_status_as_read",MARK_SINGLE_NOTIFICATION_AS_READ:"toggle_single_notification_status_as_read",MARK_ALL_NOTIFICATIONS_AS_UNREAD:"tutor_mark_all_notifications_as_unread",
PLACE_RATING:"tutor_place_rating",DELETE_REVIEW:"delete_tutor_review",CLEAR_REVIEW_POPUP_DATA:"tutor_clear_review_popup_data",
FETCH_COUNTRIES:"/assets/json/countries.json",UPLOAD_PROFILE_PHOTO:"tutor_user_photo_upload",REMOVE_PROFILE_PHOTO:"tutor_user_photo_remove",UPDATE_PROFILE:"tutor_update_profile",SAVE_SOCIAL_PROFILE:"tutor_social_profile",SAVE_BILLING_INFO:"tutor_save_billing_info",SAVE_WITHDRAW_METHOD:"tutor_save_withdraw_account",RESET_PASSWORD:"tutor_profile_password_reset",UPDATE_PROFILE_NOTIFICATION:"tutor_save_notification_preference",UPDATE_USER_PREFERENCES:"tutor_save_user_preferences",RESET_USER_PREFERENCES:"tutor_reset_user_preferences",REMOVE_DEVICE_MANUALLY:"tutor_remove_device_manually",REMOVE_ALL_ACTIVE_LOGINS:"tutor_remove_all_active_logins",
MAKE_AN_WITHDRAW:"tutor_make_an_withdraw",
VERIFY_CERTIFICATE:"tutor_verify_certificate",
SAVE_INSTRUCTOR_HOME_SECTIONS_ORDER:"tutor_save_instructor_home_sections_order",SAVE_INSTRUCTOR_HOME_SECTIONS_VISIBILITY:"tutor_save_instructor_home_sections_visibility",
COMPLETE_TOUR:"tutor_complete_tour"};const sl=ss;
var su=r(16131);
var sc=r(4041);
nQ.plugin(Y);nQ.plugin(n);var sd=()=>(0,e._)(function*(){n0.registerAll({components:[oB,ot,oa,om.P,ok,n2,ao,oE,ow,oO,o9,ov,od,n8,as,oM],services:[aw,aO,aL,o8,ak,aS]});n0.registerLazy({calendar:()=>r.e("809").then(r.bind(r,73241)).then(e=>{var{calendarMeta:t}=e;return t}),form:()=>r.e("353").then(r.bind(r,26779)).then(e=>{var{formMeta:t}=e;return t}),fileUploader:()=>r.e("756").then(r.bind(r,43786)).then(e=>{var{fileUploaderMeta:t}=e;return t}),select:()=>r.e("855").then(r.bind(r,35293)).then(e=>{var{selectMeta:t}=e;return t}),timeInput:()=>r.e("691").then(r.bind(r,25069)).then(e=>{var{timeInputMeta:t}=e;return t})});yield n0.loadComponents(a0());n0.initWithAlpine(nQ);window.TutorComponentRegistry=n0;window.Alpine=nQ;
window.TutorCore=Object.assign(window.TutorCore||{},{toast:o8.instance,security:{escapeHtml:av,escapeAttr:am},nonce:{getNonceData:a_},api:{wpPost:aX,wpPostForm:aJ,wpGet:aZ},error:{convertToErrorMessage:oR},string:{decodeHtmlEntities:sa,makeFirstCharacterUpperCase:nX},device:{isMobileDevice:of.X,isRTL:of.V},number:{parseNumberOnly:sc.T},format:{formatBytes:su.z},currency:{createPriceFormatter:a5,formatPrice:sr},constants:{TUTOR_CUSTOM_EVENTS:oi.T},config:{tutorConfig:ad},endpoints:sl});
ab();nQ.start()})();if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>{sd()})}else{sd()}})()})();
(()=>{"use strict";var e={};
var t={};
function r(i){
var n=t[i];if(n!==undefined){return n.exports}
var o=t[i]={exports:{}};
e[i](o,o.exports,r);
return o.exports}
r.m=e;
(()=>{r.d=(e,t)=>{for(var i in t){if(r.o(t,i)&&!r.o(e,i)){Object.defineProperty(e,i,{enumerable:true,get:t[i]})}}}})();
(()=>{r.f={};
r.e=e=>{return Promise.all(Object.keys(r.f).reduce((t,i)=>{r.f[i](e,t);return t},[]))}})();
(()=>{
r.u=e=>{
if(e==="4")return"js/lazy-chunks/tutor-dnd-kit.js?ver=4.0.1";
return""+e+".javascript"}})();
(()=>{
r.miniCssF=e=>{
return""+e+".css"}})();
(()=>{r.h=()=>"0a55a67ec75adc3e"})();
(()=>{r.g=(()=>{if(typeof globalThis==="object")return globalThis;try{return this||new Function("return this")()}catch(e){if(typeof window==="object")return window}})()})();
(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();
(()=>{var e={};var t="tutor:";
r.l=function(i,n,o,a){if(e[i]){e[i].push(n);return}var s,l;if(o!==undefined){var u=document.getElementsByTagName("script");for(var d=0;d<u.length;d++){var c=u[d];if(c.getAttribute("src")==i||c.getAttribute("data-webpack")==t+o){s=c;break}}}if(!s){l=true;s=document.createElement("script");s.timeout=120;if(r.nc){s.setAttribute("nonce",r.nc)}s.setAttribute("data-webpack",t+o);s.src=i}e[i]=[n];var v=function(t,r){s.onerror=s.onload=null;clearTimeout(h);var n=e[i];delete e[i];s.parentNode&&s.parentNode.removeChild(s);n&&n.forEach(function(e){return e(r)});if(t)return t(r)};var h=setTimeout(v.bind(null,undefined,{type:"timeout",target:s}),12e4);s.onerror=v.bind(null,s.onerror);s.onload=v.bind(null,s.onload);l&&document.head.appendChild(s)}})();
(()=>{
r.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();
(()=>{r.rv=()=>"1.6.5"})();
(()=>{var e;if(r.g.importScripts)e=r.g.location+"";var t=r.g.document;if(!e&&t){
if(t.currentScript&&t.currentScript.tagName.toUpperCase()==="SCRIPT")e=t.currentScript.src;if(!e){var i=t.getElementsByTagName("script");if(i.length){var n=i.length-1;while(n>-1&&(!e||!/^http(s?):/.test(e)))e=i[n--].src}}}
if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");r.p=e+"../"})();
(()=>{
var e={"675":0};r.f.j=function(t,i){
var n=r.o(e,t)?e[t]:undefined;if(n!==0){
if(n){i.push(n[2])}else{if(true){
var o=new Promise((r,i)=>n=e[t]=[r,i]);i.push(n[2]=o);
var a=r.p+r.u(t);
var s=new Error;var l=function(i){if(r.o(e,t)){n=e[t];if(n!==0)e[t]=undefined;if(n){var o=i&&(i.type==="load"?"missing":i.type);var a=i&&i.target&&i.target.src;s.message="Loading chunk "+t+" failed.\n("+o+": "+a+")";s.name="ChunkLoadError";s.type=o;s.request=a;n[1](s)}}};r.l(a,l,"chunk-"+t,t)}}}};
var t=(t,i)=>{var[n,o,a]=i;
var s,l,u=0;if(n.some(t=>e[t]!==0)){for(s in o){if(r.o(o,s)){r.m[s]=o[s]}}if(a)var d=a(r)}if(t)t(i);for(;u<n.length;u++){l=n[u];if(r.o(e,l)&&e[l]){e[l][0]()}e[l]=0}};var i=self["webpackChunktutor"]=self["webpackChunktutor"]||[];i.forEach(t.bind(null,0));i.push=t.bind(null,i.push.bind(i))})();
(()=>{r.ruid="bundler=rspack@1.6.5"})();var i={};
;
function n(e,t,r,i,n,o,a){try{var s=e[o](a);var l=s.value}catch(e){r(e);return}if(s.done)t(l);else Promise.resolve(l).then(i,n)}function o(e){return function(){var t=this,r=arguments;return new Promise(function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,l,"next",e)}function l(e){n(a,i,o,s,l,"throw",e)}s(undefined)})}};
function a(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else e[t]=r;return e};
function s(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var i=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){i=i.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}i.forEach(function(t){a(e,t,r[t])})}return e};
function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);if(t){i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,i)}return r}function u(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors)Object.defineProperties(e,Object.getOwnPropertyDescriptors(t));else{l(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e};
const d=wp.i18n;
var c=()=>{var{query:e,endpoints:t,toast:r}=window.TutorCore;var{wpPost:i}=window.TutorCore.api;return{query:e,$el:null,deleteReviewMutation:null,init(){if(!this.$el){return}this.deleteReviewMutation=this.query.useMutation(this.deleteReview,{onSuccess:e=>{window.location.reload();var t;r.success((t=e===null||e===void 0?void 0:e.message)!==null&&t!==void 0?t:(0,d.__)("Review deleted successfully","tutor"))},onError:e=>{r.error(e.message||(0,d.__)("Failed to delete review","tutor"))}})},handleDeleteReview(e){return o(function*(){var t;yield(t=this.deleteReviewMutation)===null||t===void 0?void 0:t.mutate(e)}).call(this)},deleteReview(e){return o(function*(){return i(t.DELETE_REVIEW,{review_id:e})})()}}};var v=()=>{var{query:e,modal:t,toast:r,endpoints:i}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;var{convertToErrorMessage:a}=window.TutorCore.error;return{query:e,saveRatingMutation:null,clear_review_popup_data:false,init(){this.saveRatingMutation=this.query.useMutation(this.saveRating,{onSuccess:(e,i)=>o(function*(){if(this.clear_review_popup_data){yield this.clearReviewPopupData(i.course_id)}t.closeModal("create-review-modal");r.success(e.message);window.location.reload()}).call(this),onError:e=>{r.error(a(e))}})},handleReviewSubmit(e){return o(function*(){var t;this.clear_review_popup_data=!!e.clear_review_popup_data;var r=this.convertFormDataToPayload(e);yield(t=this.saveRatingMutation)===null||t===void 0?void 0:t.mutate(r)}).call(this)},saveRating(e){return o(function*(){return n(i.PLACE_RATING,e)})()},clearReviewPopupData(e){return o(function*(){return n(i.CLEAR_REVIEW_POPUP_DATA,{course_id:e})})()},convertFormDataToPayload(e){return u(s({},e.comment_ID&&{comment_id:e.comment_ID}),{course_id:e.comment_post_ID,tutor_rating_gen_input:e.rating,review:e.comment_content})}}};var h=e=>{var{query:t,endpoints:r,toast:i}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;var{convertToErrorMessage:a}=window.TutorCore.error;return{query:t,id:e,isEditMode:false,$el:null,$refs:{},saveRatingMutation:null,handlers:{},init(){var e,t,r;if(!this.$el){return}
this.handlers.toggleEditMode=()=>this.toggleEditMode();(e=this.$refs.edit)===null||e===void 0?void 0:e.addEventListener("click",this.handlers.toggleEditMode);(t=this.$refs.cancel)===null||t===void 0?void 0:t.addEventListener("click",this.handlers.toggleEditMode);(r=this.$refs.delete)===null||r===void 0?void 0:r.addEventListener("click",this.handlers.onDeleteButtonClick);this.saveRatingMutation=this.query.useMutation(this.saveRating,{onSuccess:e=>{this.isEditMode=false;i.success(e.message);window.location.reload()},onError:e=>{i.error(a(e))}})},destroy(){var e,t,r;(e=this.$refs.edit)===null||e===void 0?void 0:e.removeEventListener("click",this.handlers.toggleEditMode);(t=this.$refs.cancel)===null||t===void 0?void 0:t.removeEventListener("click",this.handlers.toggleEditMode);(r=this.$refs.delete)===null||r===void 0?void 0:r.removeEventListener("click",this.handlers.onDeleteButtonClick)},handleReviewSubmit(e){return o(function*(){var t;var r=this.convertFormDataToPayload(e);yield(t=this.saveRatingMutation)===null||t===void 0?void 0:t.mutate(r)}).call(this)},saveRating(e){return o(function*(){return n(r.PLACE_RATING,e)})()},convertFormDataToPayload(e){return u(s({},e.comment_ID&&{comment_id:e.comment_ID}),{course_id:e.comment_post_ID,tutor_rating_gen_input:e.rating,review:e.comment_content})},toggleEditMode(){this.isEditMode=!this.isEditMode}}};var m={name:"reviewDeleteModal",component:c};var f={name:"reviewModal",component:v};var p={name:"reviewCard",component:h};var _=()=>{window.TutorComponentRegistry.registerAll({components:[p,m,f]});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};
var T,E;var g={ID:0,ajaxurl:"",site_url:"",home_url:"",site_title:"",base_path:"",tutor_url:"",tutor_pro_url:"",dashboard_url:"",nonce_key:"",_tutor_nonce:"",loading_icon_url:"",placeholder_img_src:"",enable_lesson_classic_editor:"",tutor_frontend_dashboard_url:"",backend_course_list_url:"",backend_bundle_list_url:"",frontend_course_list_url:"",frontend_bundle_list_url:"",wp_date_format:"",wp_rest_nonce:"",is_admin:"",is_admin_bar_showing:"",is_tour_completed:"",max_upload_size:"",content_change_event:"",is_tutor_course_edit:"",assignment_max_file_allowed:"",current_page:"",quiz_answer_display_time:"",is_ssl:"",course_list_page_url:"",course_post_type:"",local:"",tutor_pn_vapid_key:"",tutor_pn_client_id:"",tutor_pn_subscription_saved:"",difficulty_levels:[],supported_video_sources:[],edd_products:[],bp_groups:[],timezones:{},addons_data:[],kids_icons_registry:[],is_kids_mode:false,user_preferences:{auto_play_next:false,contrast:"",font_scale:1,learning_mood:"modern",motion_effects:"auto",theme:"light",vision:"normal"},is_legacy_learning_mode:false,current_user:{data:{id:"",user_login:"",user_pass:"",user_nicename:"",user_email:"",user_url:"",user_registered:"",user_activation_key:"",user_status:"",display_name:""},caps:{},cap_key:"",roles:[],allcaps:{},filter:null},settings:{learning_mode:"",monetize_by:"tutor",enable_course_marketplace:"off",course_permalink_base:"",supported_video_sources:"",enrollment_expiry_enabled:"off",enable_q_and_a_on_course:"off",instructor_can_delete_course:"off",instructor_can_change_course_author:"off",instructor_can_manage_co_instructors:"off",chatgpt_enable:"off",course_builder_logo_url:"",chatgpt_key_exist:false,hide_admin_bar_for_users:"off",enable_redirect_on_course_publish_from_frontend:"off",instructor_can_publish_course:"off",youtube_api_key_exist:false,membership_only_mode:false,enable_tax:false,enable_individual_tax_control:false,is_tax_included_in_price:false},tutor_currency:{symbol:"",currency:"",position:"",thousand_separator:"",decimal_separator:"",no_of_decimal:""},visibility_control:{course_builder:{}}};var A=window._tutorobject||g;window.ajaxurl=A.ajaxurl;var w={TUTOR_SITE_URL:A.site_url,WP_AJAX_BASE_URL:A.ajaxurl,WP_API_BASE_URL:"".concat(((T=window.wpApiSettings)===null||T===void 0?void 0:T.root)||"").concat(((E=window.wpApiSettings)===null||E===void 0?void 0:E.versionString)||""),VIDEO_SOURCES_SETTINGS_URL:"".concat(A.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=course#field_supported_video_sources"),MONETIZATION_SETTINGS_URL:"".concat(A.site_url,"/wp-admin/admin.php?page=tutor_settings&tab_page=monetization"),TUTOR_PRICING_PAGE:"https://tutorlms.com/pricing/",TUTOR_ADDONS_PAGE:"".concat(A.site_url,"/wp-admin/admin.php?page=tutor-addons"),CHATGPT_PLATFORM_URL:"https://platform.openai.com/account/api-keys",TUTOR_MY_COURSES_PAGE_URL:"".concat(A.tutor_frontend_dashboard_url,"/my-courses"),TUTOR_SUPPORT_PAGE_URL:"https://tutorlms.com/support",TUTOR_SUBSCRIPTIONS_PAGE:"".concat(A.site_url,"/wp-admin/admin.php?page=tutor-subscriptions"),TUTOR_ENROLLMENTS_PAGE:"".concat(A.site_url,"/wp-admin/admin.php?page=enrollments"),TUTOR_COUPONS_PAGE:"".concat(A.site_url,"/wp-admin/admin.php?page=tutor_coupons"),TUTOR_IMPORT_EXPORT_PAGE:"".concat(A.site_url,"/wp-admin/admin.php?page=tutor-tools&sub_page=import_export")};const S=null&&w;// CONCATENATED MODULE: ./assets/core/ts/constant.ts
var y={TAB_CHANGE:"tutor-tab-change",MODAL_OPEN:"tutor-modal-open",MODAL_UPDATE:"tutor-modal-update",MODAL_CLOSE:"tutor-modal-close",MODAL_CLOSED:"tutor-modal-closed",TOAST_SHOW:"tutor-toast-show",TOAST_CLEAR:"tutor-toast-clear",FORM_REGISTER:"tutor-form-register",FORM_UNREGISTER:"tutor-form-unregister",FORM_STATE_CHANGE:"tutor-form-state-change",FORM_RESET:"tutor-form-reset",WP_EDITOR_FOCUS:"wp-editor-focus",TUTOR_PLAYER_READY:"tutor-player-ready",COMMENT_REPLIED:"tutor:comment:replied",LESSON_PLAYER_READY:"tutorLessonPlayerReady",QUIZ_TIME_EXPIRED:"tutor-quiz-time-expired",QUIZ_ABANDON_REQUESTED:"tutor-quiz-abandon-requested",QUIZ_ATTEMPT_COMPLETED:"tutor-quiz-attempt-completed"};
var I={NEXT:"next",BACK:"back"};var R=e=>{var{slidesData:t,modalId:r}=e;var{modal:i,api:n,endpoints:o}=window.TutorCore;var a=Number(A.is_tour_completed);return{currentSlide:0,slides:t||[],isOpen:false,slideDirection:I.NEXT,$nextTick:undefined,_onModalClose:undefined,init(){this._onModalClose=e=>{var t;if(((t=e.detail)===null||t===void 0?void 0:t.id)===r){this.isOpen=false}};document.addEventListener(y.MODAL_CLOSE,this._onModalClose);if(!a){var e,t;this.isOpen=true;(e=(t=this).$nextTick)===null||e===void 0?void 0:e.call(t,()=>{i.showModal(r)})}},destroy(){document.removeEventListener(y.MODAL_CLOSE,this._onModalClose)},next(){this.slideDirection=I.NEXT;if(this.currentSlide<this.slides.length-1){this.currentSlide++}else{this.skip()}},back(){this.slideDirection=I.BACK;if(this.currentSlide>0){this.currentSlide--}},skip(){
n.wpPost(o.COMPLETE_TOUR);this.isOpen=false;i.closeModal(r)}}};var O=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"tour",component:R}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};
var b=()=>{var{query:e,toast:t,endpoints:r}=window.TutorCore;var{wpPost:i}=window.TutorCore.api;var{convertToErrorMessage:n}=window.TutorCore.error;return{createCourseMutation:null,init(){if(this.createCourseMutation){return}this.createCourseMutation=e.useMutation(this.createCourseRequest,{onSuccess:e=>{var t;window.location.href=(t=e.data)!==null&&t!==void 0?t:""},onError:e=>{t.error(n(e))}})},createCourseRequest(){return o(function*(){return i(r.CREATE_DRAFT_COURSE,{from_dashboard:true})})()},handleCreateCourse(){return o(function*(){var e;yield(e=this.createCourseMutation)===null||e===void 0?void 0:e.mutate({})}).call(this)}}};var C=()=>{var e=b();e.init();var t=document.querySelectorAll(".tutor-create-new-course");t.forEach(t=>{t.addEventListener("click",r=>o(function*(){r.preventDefault();t.classList.add(...["tutor-loading","tutor-btn-loading"]);t.setAttribute("disabled","true");var i=r.target;i.innerHTML="Creating...";try{yield e.handleCreateCourse()}finally{t.classList.remove(...["tutor-loading","tutor-btn-loading"]);t.removeAttribute("disabled")}})())})};
var N=()=>{var{query:e,toast:t,modal:r,endpoints:i}=window.TutorCore;var{wpPost:n}=window.TutorCore.api;var{convertToErrorMessage:a}=window.TutorCore.error;return{courseCompleteMutation:null,courseRetakeMutation:null,init(){if(this.courseCompleteMutation){return}this.courseCompleteMutation=e.useMutation(this.completeCourseRequest,{onSuccess:()=>{r.closeModal("tutor-course-complete-modal");window.location.reload()},onError:e=>{var r;t.error(a(e));if((r=e.message)===null||r===void 0?void 0:r.includes("HTTP")){window.location.reload()}}});this.courseRetakeMutation=e.useMutation(this.retakeCourseRequest,{onSuccess:e=>{var r;if((r=e.data)===null||r===void 0?void 0:r.redirect_to){window.location.href=e.data.redirect_to}else{t.error((0,d.__)("Something went wrong","tutor"))}},onError:e=>{t.error(a(e))}})},
completeCourseRequest(e){return o(function*(){return n(i.TUTOR_COMPLETE_COURSE,e)})()},handleCourseComplete(e){return o(function*(){var t;yield(t=this.courseCompleteMutation)===null||t===void 0?void 0:t.mutate({course_id:e})}).call(this)},
retakeCourseRequest(e){return o(function*(){return n(i.RESET_COURSE_PROGRESS,e)})()},handleCourseRetake(e){return o(function*(){var t;yield(t=this.courseRetakeMutation)===null||t===void 0?void 0:t.mutate({course_id:e,context:"learning-area"})}).call(this)}}};var M=()=>{if(window.TutorComponentRegistry){window.TutorComponentRegistry.register({type:"component",meta:{name:"courseCompleteHandler",component:N}})}};
var P="tutor-comment-";var L="tutor-comment-reply-";var D="tutor-comment-replies-";var Q="lesson-comment-reply-form-";var q="lesson-comment-form";var U={COMMENT_ITEM:"tutor-comment-item",REPLY_ITEM:"tutor-comment-reply-item",REPLIES_WRAPPER:"tutor-comment-replies",COMMENT_CONTENT:"tutor-comment-content"};var x="delete-comment-modal";var k=(e,t)=>{return t?"".concat(L).concat(e):"".concat(P).concat(e)};var z=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;var{query:r,toast:i,form:n,modal:o,endpoints:a}=window.TutorCore;var{convertToErrorMessage:s}=window.TutorCore.error;var{wpPost:l}=window.TutorCore.api;var{TUTOR_CUSTOM_EVENTS:u}=window.TutorCore.constants;return{query:r,lessonId:e,totalComments:t,currentPage:1,loading:false,hasMore:true,currentOrder:"DESC",isReloading:false,isEmpty:false,$el:null,$refs:{},editingId:null,replyingId:null,createCommentMutation:null,editCommentMutation:null,deleteCommentMutation:null,replyCommentMutation:null,init(){
var e=new URL(window.location.href);var t=e.searchParams.get("order");this.currentOrder=t==="ASC"?"ASC":"DESC";var r=this.$refs.commentList.querySelectorAll(":scope > .".concat(U.COMMENT_ITEM)).length;this.hasMore=this.totalComments>r;this.isEmpty=r===0;this.initInfiniteScroll();
this.createCommentMutation=this.query.useMutation(this.createComment,{onSuccess:e=>{i.success((0,d.__)("Comment added successfully.","tutor"));var t=e.data;if(t.html){if(this.currentOrder==="DESC"){this.$refs.commentList.insertAdjacentHTML("afterbegin",t.html)}else if(!this.hasMore){this.$refs.commentList.insertAdjacentHTML("beforeend",t.html)}}if(t.count!==undefined){this.totalComments=t.count;this.isEmpty=false}if(n.hasForm(q)){n.reset(q)}},onError:e=>{i.error(s(e))}});
this.editCommentMutation=this.query.useMutation(this.updateComment,{onSuccess:e=>{i.success((0,d.__)("Comment updated successfully.","tutor"));var t=e.data;var r=k(t.comment_id,t.is_reply);var n=document.getElementById(r);if(n&&t.html){n.outerHTML=t.html}else{this.reloadComments()}this.editingId=null},onError:e=>{i.error(s(e))}});
this.deleteCommentMutation=this.query.useMutation(this.deleteComment,{onSuccess:e=>{i.success((0,d.__)("Comment deleted successfully.","tutor"));o.closeModal(x);var t=e.data;var r=k(t.comment_id,t.is_reply);var n=document.getElementById(r);if(n){n.remove()}if(t.is_reply){
var a=document.getElementById("".concat(D).concat(t.parent_id));if(a&&a.querySelectorAll(".".concat(U.REPLY_ITEM)).length===0){a.remove()}}if(t.count!==undefined){this.totalComments=t.count;var s=this.$refs.commentList.querySelectorAll(":scope > .".concat(U.COMMENT_ITEM)).length;this.hasMore=this.totalComments>s;
if(!t.is_reply&&this.hasMore){this.loadNextPage()}this.isEmpty=this.$refs.commentList.querySelectorAll(":scope > .".concat(U.COMMENT_ITEM)).length===0}},onError:e=>{i.error(s(e))}});
this.replyCommentMutation=this.query.useMutation(this.replyComment,{onSuccess:(e,t)=>{i.success((0,d.__)("Reply saved successfully","tutor"));var r=e.data;var o=t.comment_parent;var a=document.getElementById("".concat(D).concat(o));var s=a===null||a===void 0?void 0:a.querySelector(".".concat(U.REPLIES_WRAPPER));if(r.html){if(r.is_first_reply||!s){
var l=document.getElementById("".concat(P).concat(o));var c=l===null||l===void 0?void 0:l.querySelector(".".concat(U.COMMENT_CONTENT));c===null||c===void 0?void 0:c.insertAdjacentHTML("beforeend",r.html)}else{
s.insertAdjacentHTML("beforeend",r.html)}
window.dispatchEvent(new CustomEvent(u.COMMENT_REPLIED,{detail:{parentId:o}}));
var v="".concat(Q).concat(o);if(n.hasForm(v)){n.reset(v)}}else{
this.reloadComments()}if(r.count!==undefined){this.totalComments=r.count}this.replyingId=null},onError:e=>{i.error(s(e))}})},createComment(e){return l(a.CREATE_LESSON_COMMENT,e)},updateComment(e){return l(a.UPDATE_LESSON_COMMENT,e)},deleteComment(e){return l(a.DELETE_LESSON_COMMENT,e)},replyComment(e){return l(a.REPLY_LESSON_COMMENT,e)},handleReplyComment(e,t){var r;(r=this.replyCommentMutation)===null||r===void 0?void 0:r.mutate({comment_post_ID:this.lessonId,comment_parent:t,comment:e.comment,order:this.currentOrder})},handleEditComment(e,t){var r;(r=this.editCommentMutation)===null||r===void 0?void 0:r.mutate({comment_id:t,comment:e.comment})},handleChangeOrder(e){if(this.currentOrder===e)return;this.currentOrder=e;this.updateURL(e);this.reloadComments()},handleDeleteComment(e){o.showModal(x,{commentId:e.commentId})},updateURL(e){var t=new URL(window.location.href);t.searchParams.set("order",e);window.history.pushState({},"",t)},reloadComments(){this.isReloading=true;this.currentPage=1;this.hasMore=true;l(a.LOAD_LESSON_COMMENTS,{lesson_id:this.lessonId,current_page:1,order:this.currentOrder}).then(e=>{var t;
this.$refs.commentList.innerHTML=e.data.html;this.hasMore=e.data.has_more;if(e.data.count!==undefined){this.totalComments=e.data.count}this.isEmpty=!((t=e.data.html)===null||t===void 0?void 0:t.trim())}).catch(e=>{i.error(s(e))}).finally(()=>{this.isReloading=false})},loadNextPage(){if(!this.lessonId||this.loading||!this.hasMore){return}this.loading=true;
var e=this.$refs.commentList.querySelectorAll(":scope > .".concat(U.COMMENT_ITEM)).length;l(a.LOAD_LESSON_COMMENTS,{lesson_id:this.lessonId,offset:e,order:this.currentOrder}).then(e=>{var t;if(e.data.has_more!==undefined){this.hasMore=e.data.has_more}if((t=e.data.html)===null||t===void 0?void 0:t.trim()){this.currentPage++;this.$refs.commentList.insertAdjacentHTML("beforeend",e.data.html)}this.isEmpty=this.$refs.commentList.querySelectorAll(":scope > .".concat(U.COMMENT_ITEM)).length===0}).catch(e=>{i.error(s(e))}).finally(()=>{this.loading=false})},handleKeydown(e){if((e.metaKey||e.ctrlKey)&&e.key==="Enter"){var t;(t=e.target.closest("form"))===null||t===void 0?void 0:t.requestSubmit()}},initInfiniteScroll(){var e=new IntersectionObserver(e=>{var[t]=e;if(t.isIntersecting&&this.hasMore&&!this.loading){this.loadNextPage()}},{rootMargin:"200px"});e.observe(this.$refs.loadMoreTrigger)}}};var F=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"lessonComments",component:z}})};
function B(e){return e.provider==="youtube"}function H(e){return e.provider==="vimeo"};
class ${getPlayerData(){var e=document.getElementById("tutor_video_tracking_information");if(!(e instanceof HTMLInputElement)||!e.value){return{}}try{return JSON.parse(e.value)}catch(e){return{}}}isRequiredPercentage(){var{strict_mode:e,control_video_lesson_completion:t,lesson_completed:r,is_enrolled:i}=this.playerData;var{tutorConfig:n}=window.TutorCore.config;return Boolean(n.tutor_pro_url&&i&&!r&&e&&t)}getPercentage(e,t){if(e>0&&t>0){return Math.round(e/t*100)}return 0}enableCompleteLessonBtn(){var e=document.querySelector('button[name="complete_lesson_btn"]');if(!e||!this.player)return;var t=this.getPercentage(Number(this.player.currentTime),Number(this.player.duration));var r=this.playerData.required_percentage||0;if(t>=r){var i,n;e.disabled=false;if((i=e.nextElementSibling)===null||i===void 0?void 0:i.classList.contains("tutor-tooltip")){e.nextElementSibling.remove()}if((n=e.parentElement)===null||n===void 0?void 0:n.classList.contains("tutor-tooltip-wrap")){e.parentElement.replaceWith(e)}}}disableCompleteLessonBtn(){var{best_watch_time:e=0,video_duration:t=0,required_percentage:r=0}=this.playerData;var i=this.getPercentage(Number(e),Number(t));if(i<r){var n=document.querySelector('button[name="complete_lesson_btn"]');if(n&&!n.disabled){var o,a;n.disabled=true;if(!((o=n.parentElement)===null||o===void 0?void 0:o.classList.contains("tutor-tooltip-wrap"))){var s;var l=document.createElement("div");l.className="tutor-tooltip-wrap";l.setAttribute("x-data",'tutorTooltip({ placement: "top" })');(s=n.parentNode)===null||s===void 0?void 0:s.insertBefore(l,n);l.appendChild(n);n.setAttribute("x-ref","trigger")}if(!((a=n.nextElementSibling)===null||a===void 0?void 0:a.classList.contains("tutor-tooltip"))){n.insertAdjacentHTML("afterend",'<div x-ref="content" class="tutor-tooltip" x-show="open" x-cloak x-transition>'.concat((0,d.sprintf)((0,d.__)("Watch at least %s%% to complete the lesson.","tutor"),r),"</div>"));if(window.Alpine){window.Alpine.initTree(n.parentElement)}}}}}syncTime(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.player||!this.playerData.post_id)return;if(this.isRequiredPercentage()){this.enableCompleteLessonBtn()}var t=s({currentTime:this.player.currentTime,duration:this.player.duration,post_id:this.playerData.post_id},e);var{wpPost:r}=window.TutorCore.api;r("sync_video_playback",t);var i=this.player.currentTime;var n=this.playerData.best_watch_time||0;var o=n>i?n:i;if(o>this.maxSeekTime){this.maxSeekTime=o}}autoloadContent(){if(!this.playerData.post_id)return;var{wpPost:e}=window.TutorCore.api;e("autoload_next_course_content",{post_id:this.playerData.post_id}).then(e=>{var t;if(e.success&&((t=e.data)===null||t===void 0?void 0:t.next_url)){window.location.href=e.data.next_url}})}getTargetTime(e,t){var r=t.target;if(r instanceof HTMLInputElement){var i=Number(r.value);var n=Number(r.max)||1;return i/n*e.duration}return Number(t)}initPlyr(){if(typeof window.Plyr==="undefined")return;var e=this.isRequiredPercentage();var t={keyboard:{focused:!e,global:false},listeners:s({},e&&{seek:e=>{if(!this.player)return true;var t=this.getTargetTime(this.player,e);var r=this.player.currentTime;var i=r>this.maxSeekTime?r:this.maxSeekTime;if(t>i){e.preventDefault();window.TutorCore.toast.warning((0,d.__)("Forward seeking is disabled","tutor"));return false}return true}})};this.player=new window.Plyr(this.element,t);this.setupEvents();if(e){this.disableCompleteLessonBtn()}}setupEvents(){if(!this.player)return;this.player.on("ready",e=>{var t;(t=document.querySelector(".tutor-video-player .loading-spinner"))===null||t===void 0?void 0:t.remove();this.syncTime();var r=e.detail.plyr;var{best_watch_time:i=0}=this.playerData;var{tutorConfig:n}=window.TutorCore.config;if(n.tutor_pro_url&&i>0){var o=Math.floor(i);setTimeout(()=>{if(r.playing!==true&&r.currentTime!==o){if(B(r)){r.embed.seekTo(i)}else{r.currentTime=o}}},0)}var{isMobileDevice:a}=window.TutorCore.device;if(H(r)&&a()){try{r.muted=true;if(typeof r.mute==="function"){r.mute()}}catch(e){
console.warn("Vimeo mute init failed:",e)}}
var s=new CustomEvent("tutorLessonPlayerReady",{detail:{player:r}});window.dispatchEvent(s);window.TutorLessonPlayer=r});this.player.on("play",e=>{if(this.syncInterval)clearInterval(this.syncInterval);this.playedOnce=true;var t=10;var{tutorConfig:r}=window.TutorCore.config;if(r.tutor_pro_url){this.syncInterval=setInterval(()=>{this.syncTime()},t*1e3)}var i=e.detail.plyr;var{isMobileDevice:n}=window.TutorCore.device;if(H(i)&&n()){try{i.muted=false;if(typeof i.unmute==="function"){i.unmute()}}catch(e){
console.warn("Vimeo unmute on play failed:",e)}}if(r.tutor_pro_url&&i.provider==="youtube"){var o;var a=(o=i.elements.container)===null||o===void 0?void 0:o.querySelector(".plyr__poster");if(a){a.style.opacity="0"}}});this.player.on("pause",()=>{if(this.syncInterval)clearInterval(this.syncInterval);var{tutorConfig:e}=window.TutorCore.config;if(e.tutor_pro_url){this.syncTime()}});this.player.on("ended",e=>{if(this.syncInterval)clearInterval(this.syncInterval);var t=e.detail.plyr;this.syncTime({is_ended:true});var{tutorConfig:r}=window.TutorCore.config;if(r.user_preferences.auto_play_next&&this.playedOnce){this.autoloadContent()}if(r.tutor_pro_url&&t.provider==="youtube"){var i;var n=(i=t.elements.container)===null||i===void 0?void 0:i.querySelector(".plyr__poster");if(n){n.style.opacity="1"}}})}static init(){var e=document.querySelector(".tutor-lesson-video-wrapper .tutorPlayer");if(e){new $(e)}else{var t;(t=document.querySelector(".tutor-video-player .loading-spinner"))===null||t===void 0?void 0:t.remove()}}constructor(e){a(this,"element",void 0);a(this,"player",null);a(this,"playerData",void 0);a(this,"syncInterval",null);a(this,"maxSeekTime",0);a(this,"playedOnce",false);this.element=e;this.playerData=this.getPlayerData();this.maxSeekTime=this.playerData.best_watch_time||0;this.initPlyr()}}var W=()=>{$.init()};
var G=()=>{W();F()};
var V=()=>{
};
var j={QNA_FORM:"learning-area-qna-form",QNA_EDIT:"qna-edit-",QNA_REPLY:"qna-reply-form-"};var Z={QNA_TEXT_PREFIX:"tutor-qna-text-",REPLIES_LIST_CONTAINER:"tutor-discussion-replies-list"};var X={QNA_DELETE:"tutor-qna-delete-modal"};var Y={QUESTION_ID:"question_id",ORDER:"order"};var K=()=>{var{query:e,form:t,modal:r,toast:i,endpoints:n}=window.TutorCore;var{convertToErrorMessage:a}=window.TutorCore.error;var{wpPost:s}=window.TutorCore.api;return{query:e,createQnAMutation:null,updateQnAMutation:null,replyQnAMutation:null,deleteQnAMutation:null,editingId:null,editingFormId:null,replyingId:null,loadingReplies:false,repliesOrder:"DESC",$nextTick:undefined,init(){this.createQnAMutation=this.query.useMutation(this.createQnA,{onSuccess:()=>{i.success((0,d.__)("Question saved successfully","tutor"));var e=j.QNA_FORM;if(t.hasForm(e)){t.reset(e)}window.location.reload()},onError:e=>{i.error(a(e))}});this.updateQnAMutation=this.query.useMutation(this.updateQnA,{onSuccess:(e,t)=>{i.success((0,d.__)("Updated successfully","tutor"));
var r=document.getElementById("".concat(Z.QNA_TEXT_PREFIX).concat(t.question_id));if(r){r.innerHTML=t.answer;
var n=window.Prism;if(n===null||n===void 0?void 0:n.highlightAllUnder){n.highlightAllUnder(r)}}if(this.editingId===t.question_id){this.setEditing(null)}},onError:e=>{i.error(a(e))}});this.replyQnAMutation=this.query.useMutation(this.replyQnA,{onSuccess:(e,r)=>{i.success((0,d.__)("Reply saved successfully","tutor"));var n="".concat(j.QNA_REPLY).concat(r.question_id);if(t.hasForm(n)){t.reset(n)}if(r.reply_context==="single"){
window.location.reload()}else{this.setReplying(null);this.updateReplyCount(r.question_id);this.highlightCard(r.question_id)}},onError:e=>{i.error(a(e))}});this.deleteQnAMutation=this.query.useMutation(this.deleteQnA,{onSuccess:(e,t)=>{if(t.context==="reply"){i.success((0,d.__)("Reply deleted successfully","tutor"));r.closeModal(X.QNA_DELETE);
window.location.reload()}else{i.success((0,d.__)("Question deleted successfully","tutor"));r.closeModal(X.QNA_DELETE);
var n=new URL(window.location.href);n.searchParams.delete(Y.QUESTION_ID);window.location.href=n.toString()}},onError:e=>{i.error(a(e))}})},createQnA(e){return s(n.CREATE_UPDATE_QNA,e)},updateQnA(e){return s(n.UPDATE_QNA,e)},replyQnA(e){return s(n.CREATE_UPDATE_QNA,e)},deleteQnA(e){return s(n.DELETE_DASHBOARD_QNA,e)},reloadReplies(e){return o(function*(){if(e){this.repliesOrder=e}var t=new URL(window.location.href);var r=parseInt(t.searchParams.get(Y.QUESTION_ID)||"0");if(!r)return;this.loadingReplies=true;try{var i;var o=yield s(n.LOAD_QNA_REPLIES,{comment_id:r,order:this.repliesOrder,context:"learning-area"});var a=document.getElementById(Z.REPLIES_LIST_CONTAINER);if(a&&typeof((i=o.data)===null||i===void 0?void 0:i.html)==="string"){a.innerHTML=o.data.html;
var l=window.Prism;if(l===null||l===void 0?void 0:l.highlightAllUnder){l.highlightAllUnder(a)}
var u=new URL(window.location.href);u.searchParams.set(Y.ORDER,this.repliesOrder);window.history.pushState({},"",u.toString())}}catch(e){
console.error("Failed to reload replies:",e)}finally{this.loadingReplies=false}}).call(this)},setEditing(e){this.editingId=e;var r=e?"".concat(j.QNA_EDIT).concat(e):null;this.editingFormId=r;if(e&&r){var i,n;(i=(n=this).$nextTick)===null||i===void 0?void 0:i.call(n,()=>{if(t.hasForm(r)){t.setFocus(r,"answer")}})}},setReplying(e){this.replyingId=e;if(e){var r,i;var n="".concat(j.QNA_REPLY).concat(e);(r=(i=this).$nextTick)===null||r===void 0?void 0:r.call(i,()=>{if(t.hasForm(n)){t.setFocus(n,"answer")}})}},toggleReply(e){if(this.replyingId===e){this.setReplying(null)}else{this.setReplying(e)}},updateReplyCount(e){var t=document.querySelector('[data-question-id="'.concat(e,'"]'));if(t){var r=t.querySelector(".tutor-discussion-card-reply-count");if(r){var i=parseInt(r.textContent||"0",10);r.textContent=String(i+1)}}},highlightCard(e){var t=document.querySelector('[data-question-id="'.concat(e,'"]'));var r;var i=(r=t===null||t===void 0?void 0:t.closest(".tutor-discussion-card"))!==null&&r!==void 0?r:t;if(!i)return;if(window.innerWidth>576){i.style.boxShadow="0 0 0 2px var(--tutor-text-brand-secondary)";setTimeout(()=>{i.style.boxShadow=""},300)}},handleKeydown(e){if((e.metaKey||e.ctrlKey)&&e.key==="Enter"){var t;(t=e.target.closest("form"))===null||t===void 0?void 0:t.requestSubmit()}}}};var J=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"QnA",component:K}})};
var ee=()=>{var{query:e,toast:t,endpoints:r}=window.TutorCore;var{wpPostForm:i}=window.TutorCore.api;var{convertToErrorMessage:n}=window.TutorCore.error;return{retryMutation:null,init(){this.retryMutation=e.useMutation(this.retryAttempt,{onSuccess:(e,t)=>{window.location.href=t.redirectURL},onError:e=>{t.error(n(e))}})},retryAttempt(e){return i(e.redirectURL,{tutor_action:r.START_QUIZ,quiz_id:e.quizID})}}};var et={name:"quizRetryAttempt",component:ee};
var er="question-";var ei=".tutor-quiz-summary-header";var en='[data-question-id="%s"]';var eo='[data-question-id="'.concat(er,'%s"]');var ea='[data-question-id="%s"]';var es=new RegExp("^#".concat(er,"(\\d+)$"));var el=16;var eu=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var t;return{activeQuestionId:String((t=e.firstQuestionId)!==null&&t!==void 0?t:""),$el:null,init(){var e=this.getQuestionIdFromHash(window.location.hash);if(e&&this.hasQuestionItem(e)){this.activeQuestionId=e}},getQuestionIdFromHash(e){var t=e.match(es);return t?t[1]:null},hasQuestionItem(e){if(!e||!this.$el){return false}return!!this.$el.querySelector(ea.replace("%s",e))},setActiveQuestion(e){var t=String(e||"");if(!t){return}this.activeQuestionId=t;history.replaceState(null,"","#".concat(er).concat(t));this.scrollToQuestionAnswer(t)},scrollToQuestionAnswer(e){var t=String(e||"");if(!t){return}var r=document.getElementById("".concat(er).concat(t))||document.querySelector(eo.replace("%s",t))||document.querySelector(en.replace("%s",t));if(r instanceof HTMLElement){var i=document.querySelector(ei);var n=i instanceof HTMLElement?i.getBoundingClientRect().top+i.offsetHeight:0;var o=r.getBoundingClientRect().top+window.scrollY-n-el;window.scrollTo({top:Math.max(0,o),behavior:"smooth"})}}}};var ed={name:"quizSummarySidebar",component:eu};
var ec={ANSWER_CONTEXT_ID:"tutor-quiz-context",DEFAULT_WAIT_MS:2e3,SUPPORTED_TYPES:["true_false","single_choice","multiple_choice"],OPTION_SELECTOR:".tutor-quiz-question-option",QUESTION_SELECTOR:".tutor-quiz-question",EXPLANATION_SELECTOR:"[data-quiz-explanation]",EXPLANATION_TRIGGER_SELECTOR:"[data-quiz-explanation-toggle]",EXPLANATION_BODY_SELECTOR:".tutor-quiz-explanation-body",EXPLANATION_CONTENT_DATASET:"quizExplanationContent",DATA_OPTION_ATTR:"data-option",DATA_REVEALED_ATTR:"data-revealed",DATA_RESULT_ATTR:"data-reveal-result",DATA_OPTION_CORRECT:"correct",DATA_OPTION_INCORRECT:"incorrect"};var ev={NAVIGATION_EVENT:"click",IGNORE_ANCHOR_PREFIXES:["#","javascript:"]};var eh={AUTO_ABANDON:"auto_abandon",AUTO_SUBMIT:"auto_submit"};var em={QUESTION_BELOW_EACH_OTHER:"question_below_each_other",QUESTION_PAGINATION:"question_pagination",SINGLE_QUESTION:"single_question"};var ef={SUBMIT_FAILED:"Failed to submit quiz",ABANDON_FAILED:"Failed to abandon quiz",REQUIRED_QUESTIONS:"Please answer all required questions before submitting."};var ep={QUESTION_WRAPPER_ATTR:"data-quiz-question-index",QUESTION_WRAPPER:".tutor-quiz-question-wrapper"};var e_={QUESTION_VALUE_PREFIX:"[quiz_question]"};var eT={AUTO_START_COMPLETE:"tutor-quiz-autostart-complete"};
var eE=e=>{var t;var{query:r,toast:i,modal:n,endpoints:o}=window.TutorCore;var{convertToErrorMessage:a}=window.TutorCore.error;var{wpPostForm:s}=window.TutorCore.api;var{tutorConfig:l}=window.TutorCore.config;var u=eT.AUTO_START_COMPLETE;var d;return{quizID:e.quizID,autoStart:typeof e.autoStart==="boolean"?e.autoStart:Number((t=l.quiz_options)===null||t===void 0?void 0:t.quiz_auto_start)>0,autoStartModalId:(d=e.autoStartModalId)!==null&&d!==void 0?d:"",countdownSeconds:Number(e.countdownSeconds)||5,isCountdownActive:false,autoStartListener:null,startQuizMutation:null,init(){this.autoStartListener=()=>{var e;if(!this.isCountdownActive){return}this.isCountdownActive=false;(e=this.startQuizMutation)===null||e===void 0?void 0:e.mutate({quizID:this.quizID})};document.addEventListener(u,this.autoStartListener);this.startQuizMutation=r.useMutation(this.startQuiz,{onSuccess:()=>{window.location.reload()},onError:e=>{if(this.autoStartModalId){var t;n===null||n===void 0?void 0:(t=n.closeModal)===null||t===void 0?void 0:t.call(n,this.autoStartModalId)}i.error(a(e))}});if(!this.autoStart){return}this.startAutoStartCountdown()},handleStartQuiz(){var e;(e=this.startQuizMutation)===null||e===void 0?void 0:e.mutate({quizID:this.quizID})},startAutoStartCountdown(){if(!this.autoStartModalId){var e;(e=this.startQuizMutation)===null||e===void 0?void 0:e.mutate({quizID:this.quizID});return}if(this.isCountdownActive){return}this.isCountdownActive=true;window.setTimeout(()=>{var e;n===null||n===void 0?void 0:(e=n.showModal)===null||e===void 0?void 0:e.call(n,this.autoStartModalId)},0)},startQuiz(e){return s(window.location.href,{tutor_action:o.START_QUIZ,quiz_id:e.quizID})},destroy(){if(this.autoStartListener){document.removeEventListener(u,this.autoStartListener)}}}};var eg={name:"quizAutoStart",component:eE};
var eA=e=>{var t=e.match(/.{1,2}/g);if(!t){return null}return t.map(e=>String.fromCharCode(parseInt(e,16))).join("")};var ew=e=>{if(!e){return""}try{var t=eA(e);if(t){return decodeURIComponent(t)}}catch(e){
}try{return decodeURIComponent(e.split("").reverse().join(""))}catch(e){return""}};var eS=(e,t)=>{var r;var i=e.querySelector(ec.QUESTION_SELECTOR);if(!i){return}if(i.getAttribute(ec.DATA_REVEALED_ATTR)==="1"){return}var n=e.querySelector(ec.EXPLANATION_TRIGGER_SELECTOR);var o=e.querySelector(ec.EXPLANATION_SELECTOR);var a;var s=(a=o===null||o===void 0?void 0:o.querySelector(ec.EXPLANATION_BODY_SELECTOR))!==null&&a!==void 0?a:null;var l;var u=(l=o===null||o===void 0?void 0:(r=o.dataset)===null||r===void 0?void 0:r[ec.EXPLANATION_CONTENT_DATASET])!==null&&l!==void 0?l:"";if(s&&u&&!s.innerHTML.trim()){var d=ew(u);if(d){s.innerHTML=d}}if(n&&n.getAttribute("aria-expanded")!=="true"){n.click()}var c=Array.from(i.querySelectorAll('input[type="radio"], input[type="checkbox"]'));var v=new Set;var h=new Set;c.forEach(e=>{var r=e.closest(ec.OPTION_SELECTOR);if(!r){return}var i=Number(e.value);if(Number.isNaN(i)){return}if(e.checked){v.add(i)}var n=t.includes(i);if(n){h.add(i)}if(n){r.setAttribute(ec.DATA_OPTION_ATTR,ec.DATA_OPTION_CORRECT)}else if(e.checked){r.setAttribute(ec.DATA_OPTION_ATTR,ec.DATA_OPTION_INCORRECT)}e.disabled=true});var m=v.size>0&&v.size===h.size&&Array.from(v).every(e=>h.has(e));i.setAttribute(ec.DATA_RESULT_ATTR,m?ec.DATA_OPTION_CORRECT:ec.DATA_OPTION_INCORRECT);i.setAttribute(ec.DATA_REVEALED_ATTR,"1")};var ey=e=>{var t=function(t){var r="".concat(e_.QUESTION_VALUE_PREFIX,"[").concat(t,"]");var i=Object.entries(e).some(e=>{var[t,i]=e;if(!t.includes(r)){return false}if(i===""||i===null||i===undefined){return false}if(Array.isArray(i)&&i.length===0){return false}return true});if(i){n++}};var r=Object.entries(e).find(e=>{var[t]=e;return t.includes("[quiz_question_ids]")});if(!r){return 0}var i=Array.isArray(r[1])?r[1]:[];var n=0;for(var o of i)t(o);return n};var eI=e=>{var t;var r=(t=window.TutorCore)===null||t===void 0?void 0:t.form;if(!r||!e||!r.hasForm(e)){return 0}var i;var n=(i=r.getFormState(e).values)!==null&&i!==void 0?i:{};return ey(n)};
var eR=e=>{var{form:t,tutorConfig:r}=window.TutorCore;var i=null;var n=null;var a=null;var s,l,u,d;return{layout:(s=e.layout)!==null&&s!==void 0?s:em.QUESTION_BELOW_EACH_OTHER,formId:(l=e.formId)!==null&&l!==void 0?l:"",totalQuestions:Number(e.totalQuestions)||0,currentIndex:1,enableAnswerReveal:(u=e.enableAnswerReveal)!==null&&u!==void 0?u:false,revealWaitMs:(d=e.revealWaitMs)!==null&&d!==void 0?d:null,revealAnswerIds:[],answerRequiredByIndex:{},revealStateByIndex:{},skippedByIndex:{},revealFooterState:"",isRevealing:false,revealTimeoutId:null,$el:null,$root:null,init(){var e;var t;i=(e=(t=this.$root)!==null&&t!==void 0?t:this.$el)===null||e===void 0?void 0:e.querySelector(".tutor-quiz-questions");
n=e=>{if(e.key==="Tab"){i===null||i===void 0?void 0:i.classList.add("tutor-keyboard-nav");if(n)window.removeEventListener("keydown",n);if(a){window.addEventListener("mousedown",a);window.addEventListener("touchstart",a)}}};a=()=>{i===null||i===void 0?void 0:i.classList.remove("tutor-keyboard-nav");if(a){window.removeEventListener("mousedown",a);window.removeEventListener("touchstart",a)}if(n)window.addEventListener("keydown",n)};if(n)window.addEventListener("keydown",n);this.revealAnswerIds=this.getRevealAnswerIds();this.answerRequiredByIndex=this.getAnswerRequiredMap();this.revealStateByIndex=this.getRevealStateMap();this.skippedByIndex=this.getSkippedStateMap();if(this.layout===em.QUESTION_BELOW_EACH_OTHER){return}this.currentIndex=1;this.syncCurrentRevealFooterState()},destroy(){if(n){window.removeEventListener("keydown",n)}if(a){window.removeEventListener("mousedown",a);window.removeEventListener("touchstart",a)}},isQuestionActive(e){if(this.layout===em.QUESTION_BELOW_EACH_OTHER){return true}return e===this.currentIndex},canSkip(e){if(this.layout===em.QUESTION_BELOW_EACH_OTHER){return false}if(e>=this.totalQuestions){return false}if(Object.prototype.hasOwnProperty.call(this.answerRequiredByIndex,e)){return!this.answerRequiredByIndex[e]}var t=this.getQuestionWrapper(e);if(!t){return false}return t.dataset.answerRequired!=="1"},hasAttemptedValue(e){if(e===null||e===undefined){return false}if(typeof e==="string"){return e.trim().length>0}if(Array.isArray(e)){return e.some(e=>this.hasAttemptedValue(e))}if(typeof e==="object"){return Object.values(e).some(e=>this.hasAttemptedValue(e))}return true},isQuestionAttempted(e){if(!t||!this.formId||!t.hasForm(this.formId)){return false}var r;var i=(r=t.getFormState(this.formId).values)!==null&&r!==void 0?r:{};var n=this.getQuestionFieldNames(i,e);if(!n.length){return false}return n.some(e=>this.hasAttemptedValue(i[e]))},shouldDisableNextButton(){if(this.layout!==em.SINGLE_QUESTION){return false}return this.answerRequiredByIndex[this.currentIndex]&&!this.isQuestionAttempted(this.currentIndex)},getPaginationState(e){if(this.revealStateByIndex[e]){return this.revealStateByIndex[e]}if(this.isQuestionAttempted(e)){return"answered"}if(this.skippedByIndex[e]){return"skipped"}return null},getPaginationItemClass(e){var t=this.getPaginationState(e);return{active:this.currentIndex===e,answered:t==="answered",correct:t==="correct",incorrect:t==="incorrect",skipped:t==="skipped",upcoming:e>this.currentIndex&&t===null}},syncRevealFooterState(e){if(!this.isRevealMode()){this.revealFooterState="";return}var t=this.getQuestionElement(e);if(!t||t.getAttribute(ec.DATA_REVEALED_ATTR)!=="1"){this.revealFooterState="";return}var r=t.getAttribute(ec.DATA_RESULT_ATTR);if(r===ec.DATA_OPTION_CORRECT){this.revealStateByIndex[this.currentIndex]="correct";this.revealFooterState="correct";return}if(r===ec.DATA_OPTION_INCORRECT){this.revealStateByIndex[this.currentIndex]="incorrect";this.revealFooterState="incorrect";return}this.revealFooterState=""},syncCurrentRevealFooterState(){if(!this.isRevealMode()){this.revealFooterState="";return}var e=this.getQuestionWrapper(this.currentIndex);if(!e){this.revealFooterState="";return}this.syncRevealFooterState(e)},goPrev(){if(this.layout===em.QUESTION_BELOW_EACH_OTHER){return}if(this.currentIndex>1){this.clearRevealTimeout();this.markCurrentAsSkipped();this.runWithViewTransition(()=>{this.currentIndex-=1;this.syncCurrentRevealFooterState()},"back");this.scrollToQuestion()}},goNext(){return o(function*(){var{skipValidation:e=false}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.layout===em.QUESTION_BELOW_EACH_OTHER){return}if(!e&&this.shouldDisableNextButton()){return}var t=this.getQuestionWrapper(this.currentIndex);if(!t){return}if(!e){var r=yield this.triggerQuestionValidation(this.currentIndex);if(!r){return}}if(!e&&this.isRevealMode()&&this.shouldReveal(t)){if(this.isQuestionRevealed(t)){this.clearRevealTimeout();this.moveToNextQuestion();return}if(!this.isQuestionAttempted(this.currentIndex)){this.moveToNextQuestion();return}this.isRevealing=true;this.revealQuestion(t);this.syncRevealFooterState(t);var i=this.getRevealWaitTime();this.revealTimeoutId=window.setTimeout(()=>{this.isRevealing=false;this.revealTimeoutId=null;this.moveToNextQuestion()},i);return}this.moveToNextQuestion()}).apply(this,arguments)},goTo(e){if(this.layout===em.QUESTION_BELOW_EACH_OTHER){return}if(!e||e<1||e>this.totalQuestions){return}this.clearRevealTimeout();this.markCurrentAsSkipped();this.runWithViewTransition(()=>{this.currentIndex=e;this.syncCurrentRevealFooterState()},e<this.currentIndex?"back":"forward");this.scrollToQuestion()},runWithViewTransition(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"forward";void t;e()},clearRevealTimeout(){if(this.revealTimeoutId!==null){window.clearTimeout(this.revealTimeoutId);this.revealTimeoutId=null}this.isRevealing=false},moveToNextQuestion(){if(this.currentIndex<this.totalQuestions){this.markCurrentAsSkipped();this.runWithViewTransition(()=>{this.currentIndex+=1;this.syncCurrentRevealFooterState()});this.scrollToQuestion()}},getRevealWaitTime(){var e;var t=Number((e=this.revealWaitMs)!==null&&e!==void 0?e:"");if(!Number.isNaN(t)&&t>0){return t}var i;var n=Number((i=r.quiz_answer_display_time)!==null&&i!==void 0?i:"");if(!Number.isNaN(n)&&n>0){return n}return ec.DEFAULT_WAIT_MS},isRevealMode(){return this.enableAnswerReveal},getRevealAnswerIds(){var e=document.getElementById(ec.ANSWER_CONTEXT_ID);if(!(e===null||e===void 0?void 0:e.textContent)){return[]}try{var t;var r=e.textContent.trim();var i=(t=r.match(/.{1,2}/g))===null||t===void 0?void 0:t.map(e=>String.fromCharCode(parseInt(e,16))).join("");if(!i){return[]}var n=JSON.parse(i);if(!Array.isArray(n)){return[]}return n.map(e=>Number(e)).filter(e=>!Number.isNaN(e))}catch(e){return[]}},getQuestionElement(e){return e.querySelector(ec.QUESTION_SELECTOR)},isQuestionRevealed(e){var t=this.getQuestionElement(e);return(t===null||t===void 0?void 0:t.getAttribute(ec.DATA_REVEALED_ATTR))==="1"},getQuestionType(e){var t,r;var i;return(i=(r=this.getQuestionElement(e))===null||r===void 0?void 0:(t=r.dataset)===null||t===void 0?void 0:t.question)!==null&&i!==void 0?i:""},shouldReveal(e){if(!this.isRevealMode()){return false}if(!this.revealAnswerIds.length){return false}var t=this.getQuestionType(e);return ec.SUPPORTED_TYPES.includes(t)},revealQuestion(e){eS(e,this.revealAnswerIds)},revealOnSubmit(){if(!this.isRevealMode()){return false}if(this.layout===em.QUESTION_BELOW_EACH_OTHER){var e;var t,r;var i=Array.from((r=(e=(t=this.$root)!==null&&t!==void 0?t:this.$el)===null||e===void 0?void 0:e.querySelectorAll("".concat(ep.QUESTION_WRAPPER)))!==null&&r!==void 0?r:[]);var n=false;i.forEach(e=>{if(this.shouldReveal(e)){this.revealQuestion(e);n=true}});return n}var o=this.getQuestionWrapper(this.currentIndex);if(!o||!this.shouldReveal(o)){return false}this.revealQuestion(o);return true},getQuestionWrapper(e){var t;var r=(t=this.$root)!==null&&t!==void 0?t:this.$el;return r===null||r===void 0?void 0:r.querySelector("".concat(ep.QUESTION_WRAPPER,"[").concat(ep.QUESTION_WRAPPER_ATTR,'="').concat(e,'"]'))},getAnswerRequiredMap(){var e;var t=(e=this.$root)!==null&&e!==void 0?e:this.$el;if(!t){return{}}var r=Array.from(t.querySelectorAll(ep.QUESTION_WRAPPER));var i={};r.forEach(e=>{var t=Number(e.getAttribute(ep.QUESTION_WRAPPER_ATTR));if(Number.isNaN(t)||t<1){return}i[t]=e.dataset.answerRequired==="1"});return i},getRevealStateMap(){var e;var t=(e=this.$root)!==null&&e!==void 0?e:this.$el;if(!t||!this.isRevealMode()){return{}}var r=Array.from(t.querySelectorAll(ep.QUESTION_WRAPPER));var i={};r.forEach(e=>{var t=Number(e.getAttribute(ep.QUESTION_WRAPPER_ATTR));if(Number.isNaN(t)||t<1){return}var r=this.getQuestionElement(e);if(!r||r.getAttribute(ec.DATA_REVEALED_ATTR)!=="1"){return}var n=r.getAttribute(ec.DATA_RESULT_ATTR);if(n===ec.DATA_OPTION_CORRECT){i[t]="correct";return}if(n===ec.DATA_OPTION_INCORRECT){i[t]="incorrect"}});return i},getSkippedStateMap(){var e;var t=(e=this.$root)!==null&&e!==void 0?e:this.$el;if(!t){return{}}var r=Array.from(t.querySelectorAll(ep.QUESTION_WRAPPER));var i={};r.forEach(e=>{var t=Number(e.getAttribute(ep.QUESTION_WRAPPER_ATTR));if(Number.isNaN(t)||t<1){return}i[t]=false});return i},markCurrentAsSkipped(){var e=this.currentIndex;if(!e||e<1||e>this.totalQuestions){return}if(this.revealStateByIndex[e]){this.skippedByIndex[e]=false;return}var t=this.isQuestionAttempted(e);this.skippedByIndex[e]=!t},scrollToQuestion(){var e=this.getQuestionWrapper(this.currentIndex);if(!e){return}e.scrollIntoView({behavior:"smooth",block:"start"})},getQuestionIdByIndex(e,t){var r=Object.entries(e).find(e=>{var[t]=e;return t.includes("[quiz_question_ids]")});if(!r){return null}var[,i]=r;var n=Array.isArray(i)?i:[];if(!n.length){return null}var o;return(o=n[t-1])!==null&&o!==void 0?o:null},getQuestionFieldNames(e,t){var r=this.getQuestionIdByIndex(e,t);if(!r){return[]}var i="".concat(e_.QUESTION_VALUE_PREFIX,"[").concat(r,"]");return Object.keys(e).filter(e=>e.includes(i))},triggerQuestionValidation(e){return o(function*(){if(!t||!this.formId||!t.hasForm(this.formId)){return true}var r;var i=(r=t.getFormState(this.formId).values)!==null&&r!==void 0?r:{};var n=this.getQuestionFieldNames(i,e);if(!n.length){return true}return yield t.trigger(this.formId,n)}).call(this)}}};var eO={name:"quizLayout",component:eR};
var eb=()=>o(function*(){var e=yield r.e("4").then(r.bind(r,8679));return{DragDropManager:e.DragDropManager,Draggable:e.Draggable,Droppable:e.Droppable,KeyboardSensor:e.KeyboardSensor,PointerSensor:e.PointerSensor}})();var eC={CLASSES:{QUESTION_OPTION:"tutor-quiz-question-option",DROP_ZONE:"tutor-quiz-question-option-drop-zone",TEXT_SUBDUED:"tutor-text-subdued",DROPPED:"dropped"},ATTRS:{OPTION:"data-option",ID:"data-id",GRAB_HANDLE:"data-grab-handle",DROP_ZONE_ID:"data-drop-zone-id",DROP_PLACEHOLDER:"data-drop-placeholder",DROP_PLACEHOLDER_TEXT:"data-drop-placeholder-text"},VALUES:{DRAGGABLE:"draggable",DRAGGING:"dragging",DROPPED:"dropped"},DATASET:{ID:"id",DROP_ZONE_ID:"dropZoneId",DROP_PLACEHOLDER_TEXT:"dropPlaceholderText"}};var eN=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{_draggables:[],_dropZones:[],_matches:{},_dropZoneOrder:[],_questionId:e.questionId,_callbacks:{onDrop:e.onDrop,onClear:e.onClear},$el:null,$event:null,initialized:false,_getValuesFromMatches(){return this._dropZoneOrder.map(e=>{var t;return(t=this._matches[e])!==null&&t!==void 0?t:""})},clearDropZone(){var e,t,r;var i=(e=this.$event)===null||e===void 0?void 0:e.target;var n=i===null||i===void 0?void 0:i.closest(".".concat(eC.CLASSES.DROP_ZONE));if(!n){return}var o=n.querySelector("[".concat(eC.ATTRS.OPTION,'="').concat(eC.VALUES.DROPPED,'"]'));if(o){o.remove()}this._restoreDropPlaceholder(n);var a=n.dataset[eC.DATASET.DROP_ZONE_ID];if(a&&this._matches[a]){delete this._matches[a]}var s=this._getValuesFromMatches();(t=(r=this._callbacks).onClear)===null||t===void 0?void 0:t.call(r,s)},_restoreDropPlaceholder(e){var t=e.querySelector("[".concat(eC.ATTRS.DROP_PLACEHOLDER,"]"));if(t){return}var r=document.createElement("span");r.setAttribute(eC.ATTRS.DROP_PLACEHOLDER,"");r.className=eC.CLASSES.TEXT_SUBDUED;r.textContent=e.dataset[eC.DATASET.DROP_PLACEHOLDER_TEXT]||(0,d.__)("Drop here","tutor");e.prepend(r)},_animateDropSnap(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){return}e.animate([{transform:"scale(0.985)"},{transform:"scale(1.02)"},{transform:"scale(1)"}],{duration:220,easing:"cubic-bezier(0.2, 0.9, 0.2, 1)"});t.animate([{transform:"scale(0.94)",opacity:.86},{transform:"scale(1.015)",opacity:1},{transform:"scale(1)",opacity:1}],{duration:180,easing:"cubic-bezier(0.22, 1, 0.36, 1)"})},init(){if(!this.initialized){this.setupDrag();this.initialized=true}},setupDrag(){return o(function*(){var e=this.$el;if(!e){return}var{DragDropManager:t,Draggable:r,Droppable:i,KeyboardSensor:n,PointerSensor:o}=yield eb();if(!this.initialized){return}var a=new t({sensors:[o,n]});var s=Array.from(e.querySelectorAll(".".concat(eC.CLASSES.QUESTION_OPTION,"[").concat(eC.ATTRS.OPTION,'="').concat(eC.VALUES.DRAGGABLE,'"]')));s.forEach((e,t)=>{var i=e.querySelector("[".concat(eC.ATTRS.GRAB_HANDLE,"]"));var n;var o=(n=e.dataset[eC.DATASET.ID])!==null&&n!==void 0?n:String(t);var s=new r({id:o,element:e,handle:i!==null&&i!==void 0?i:undefined,feedback:"clone"},a);this._draggables.push(s)});var l=Array.from(e.querySelectorAll(".".concat(eC.CLASSES.DROP_ZONE)));l.forEach((e,t)=>{var r;var n=(r=e.dataset[eC.DATASET.ID])!==null&&r!==void 0?r:String(t);e.dataset[eC.DATASET.DROP_ZONE_ID]=n;this._dropZoneOrder.push(n);var o=new i({id:n,element:e},a);this._dropZones.push(o)});a.monitor.addEventListener("dragstart",e=>{var t=e.operation;if(!t.source){return}var r=t.source.element;if(r){r.setAttribute(eC.ATTRS.OPTION,eC.VALUES.DRAGGING)}});a.monitor.addEventListener("dragend",e=>{var t=e.operation;if(!t.source){return}var r=t.source.element;var i=t.target;if(r){r.setAttribute(eC.ATTRS.OPTION,eC.VALUES.DRAGGABLE)}if(i){var n,o;var a=i.element;var s=t.source.id;if(!a){return}var l=document.createElement("div");l.setAttribute(eC.ATTRS.OPTION,eC.VALUES.DROPPED);l.setAttribute(eC.ATTRS.ID,String(s));var u;l.textContent=(u=r===null||r===void 0?void 0:r.textContent)!==null&&u!==void 0?u:"";var d=a===null||a===void 0?void 0:a.querySelector("[".concat(eC.ATTRS.DROP_PLACEHOLDER,"]"));var c=a===null||a===void 0?void 0:a.querySelector("[".concat(eC.ATTRS.OPTION,'="').concat(eC.VALUES.DROPPED,'"]'));if(d){d.replaceWith(l)}else if(c){c.replaceWith(l)}this._animateDropSnap(a,l);this._matches[i.id]=String(s);var v=this._getValuesFromMatches();(n=(o=this._callbacks).onDrop)===null||n===void 0?void 0:n.call(o,v)}})}).call(this)},
reset(){this._dropZones.forEach(e=>{var t=e.element;while(t===null||t===void 0?void 0:t.firstChild){t.removeChild(t.firstChild)}});this._draggables.forEach(e=>{var t,r;(t=e.element)===null||t===void 0?void 0:t.setAttribute(eC.ATTRS.OPTION,eC.VALUES.DRAGGABLE);(r=e.element)===null||r===void 0?void 0:r.classList.remove(eC.CLASSES.DROPPED)});this._matches={};this._dropZoneOrder=[]},destroy(){this._draggables.forEach(e=>e.destroy());this._draggables=[];this._dropZones.forEach(e=>e.destroy());this._dropZones=[];this._matches={};this._dropZoneOrder=[];this.initialized=false}}};var eM={name:"questionMatching",component:eN};
var eP=()=>o(function*(){var[e,t]=yield Promise.all([r.e("4").then(r.bind(r,8679)),r.e("4").then(r.bind(r,99375))]);return{DragDropManager:e.DragDropManager,KeyboardSensor:e.KeyboardSensor,PointerSensor:e.PointerSensor,Sortable:t.Sortable}})();var eL={CLASSES:{QUESTION_OPTION:"tutor-quiz-question-option"},ATTRS:{OPTION:"data-option",ID:"data-id",GRAB_HANDLE:"data-grab-handle"},VALUES:{DRAGGABLE:"draggable",DRAGGING:"dragging"},DATASET:{ID:"id"}};var eD=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return{_sortables:[],_questionId:e.questionId,_callbacks:{onOrder:e.onOrder},initialized:false,$el:null,init(){if(!this.initialized){this.setupDrag();this.initialized=true}},setupDrag(){return o(function*(){var e=this.$el;if(!e){return}var{DragDropManager:t,KeyboardSensor:r,PointerSensor:i,Sortable:n}=yield eP();if(!this.initialized){return}var o=new t({sensors:[i,r]});var a=Array.from(e.querySelectorAll(".".concat(eL.CLASSES.QUESTION_OPTION,"[").concat(eL.ATTRS.OPTION,'="').concat(eL.VALUES.DRAGGABLE,'"]')));this._sortables=[];a.forEach((e,t)=>{var r=e.querySelector("[".concat(eL.ATTRS.GRAB_HANDLE,"]"));var i;var a=(i=e.dataset[eL.DATASET.ID])!==null&&i!==void 0?i:String(t);var s=new n({id:a,index:t,element:e,handle:r!==null&&r!==void 0?r:undefined},o);this._sortables.push(s)});o.monitor.addEventListener("dragstart",e=>{var t=e.operation;if(!t.source){return}var r=t.source.element;if(!r){return}r.setAttribute(eL.ATTRS.OPTION,eL.VALUES.DRAGGING)});o.monitor.addEventListener("dragend",e=>{var t=e.operation;if(!t.source){return}var r=t.source.element;if(!r){return}r.setAttribute(eL.ATTRS.OPTION,eL.VALUES.DRAGGABLE);if(this.$el){this.$el.dataset.hasInteraction="1"}requestAnimationFrame(()=>{var e,t;(e=(t=this._callbacks).onOrder)===null||e===void 0?void 0:e.call(t,this.getOrder())})})}).call(this)},getOrder(){var e=this.$el;if(!e){return[]}var t=Array.from(e.querySelectorAll(".".concat(eL.CLASSES.QUESTION_OPTION)));return[...new Set(t.map(e=>e.dataset[eL.DATASET.ID]).filter(e=>typeof e==="string"))]},destroy(){this._sortables.forEach(e=>e.destroy());this._sortables=[];this.initialized=false}}};var eQ={name:"questionOrdering",component:eD};
var eq=5;var eU={BG_CANVAS:'[data-quiz-autostart-canvas="bg"]',SWEEP_CANVAS:'[data-quiz-autostart-canvas="sweep"]',DIGIT:"[data-quiz-autostart-digit]"};var ex=e=>({seconds:Number(e.seconds)||eq,eventName:e.eventName||eT.AUTO_START_COMPLETE,remaining:0,angle:-90,lastTick:null,animationFrame:null,countdownTimer:null,card:null,bgCanvas:null,sweepCanvas:null,resizeHandler:null,$el:null,init(){this.remaining=this.seconds;this.cacheElements();this.waitForLayout()},destroy(){if(this.animationFrame){window.cancelAnimationFrame(this.animationFrame);this.animationFrame=null}if(this.countdownTimer){window.clearInterval(this.countdownTimer);this.countdownTimer=null}if(this.resizeHandler){window.removeEventListener("resize",this.resizeHandler);this.resizeHandler=null}},cacheElements(){this.card=this.$el;this.bgCanvas=this.card.querySelector(eU.BG_CANVAS);this.sweepCanvas=this.card.querySelector(eU.SWEEP_CANVAS);if(!this.resizeHandler){this.resizeHandler=()=>this.resize();window.addEventListener("resize",this.resizeHandler)}},resize(){if(!this.card||!this.bgCanvas||!this.sweepCanvas){return}var e=this.card.getBoundingClientRect();var t=Math.max(0,Math.floor(e.width));var r=Math.max(0,Math.floor(e.height));this.bgCanvas.width=t;this.bgCanvas.height=r;this.sweepCanvas.width=t;this.sweepCanvas.height=r;this.drawBackground()},waitForLayout(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:30;if(!this.card){return}var t=this.card.getBoundingClientRect();if(t.width>0&&t.height>0){this.resize();this.startRadarAnimation();this.startCountdownTimer();return}if(e<=0){return}window.requestAnimationFrame(()=>this.waitForLayout(e-1))},drawBackground(){if(!this.bgCanvas||!this.card){return}var e=this.bgCanvas.getContext("2d");if(!e){return}var t=this.card.clientWidth;var r=this.card.clientHeight;var i=t/2;var n=r/2;var o=Math.sqrt(i*i+n*n);var a=o*.3;var s=o*.52;var l=document.documentElement.getAttribute("data-tutor-theme")==="dark";e.clearRect(0,0,t,r);e.beginPath();e.arc(i,n,a,0,Math.PI*2);e.fillStyle=l?"#2c3342":"#E7EDFC";e.fill();e.beginPath();e.arc(i,n,s,0,Math.PI*2);e.strokeStyle=l?"#3F63DF":"#E7EDFC";e.lineWidth=1.5;e.stroke()},drawSweep(){if(!this.sweepCanvas||!this.card){return}var e=this.sweepCanvas.getContext("2d");if(!e){return}var t=this.card.clientWidth;var r=this.card.clientHeight;var i=t/2;var n=r/2;var o=Math.sqrt(i*i+n*n);
var a=-90;var s=a*Math.PI/180;
var l=this.angle/360;
var u=s+l*Math.PI*2;var d=340;var c=document.documentElement.getAttribute("data-tutor-theme")==="dark";var v=c?[112,133,222]:[197,208,245];var h=c?[44,51,66]:[241,245,254];e.clearRect(0,0,t,r);
for(var m=d;m>=0;m--){var f=m/d;
var p=u-(u-s)*f;var _=f<.3?0:(f-.3)/.7;var T=[Math.round(v[0]+(h[0]-v[0])*_),Math.round(v[1]+(h[1]-v[1])*_),Math.round(v[2]+(h[2]-v[2])*_)];var E=.3+(1-.3)*_;e.beginPath();e.moveTo(i,n);e.arc(i,n,o,p,p+.025);e.closePath();e.fillStyle="rgba(".concat(T[0],",").concat(T[1],",").concat(T[2],",").concat((E*(1-f*.5)).toFixed(3),")");e.fill()}
e.beginPath();e.moveTo(i,n);e.lineTo(i+Math.cos(u)*o,n+Math.sin(u)*o);e.strokeStyle=c?"rgba(63, 99, 223, 1)":"rgba(62,100,222,0.30)";e.lineWidth=1.5;e.stroke()},startRadarAnimation(){
this.angle=0;var e=t=>{if(this.lastTick!==null){var r=t-this.lastTick;
this.angle+=360/1e3*r;
if(this.angle>=360){this.angle-=360}}this.drawSweep();this.lastTick=t;this.animationFrame=window.requestAnimationFrame(e)};this.animationFrame=window.requestAnimationFrame(e)},startCountdownTimer(){var e;var t=(e=this.card)===null||e===void 0?void 0:e.querySelector(eU.DIGIT);if(t){t.textContent=String(this.remaining)}this.countdownTimer=window.setInterval(()=>{this.remaining=Math.max(0,this.remaining-1);if(t){t.textContent=String(this.remaining)}if(this.remaining===0){this.finishCountdown()}},1e3)},finishCountdown(){if(this.countdownTimer){window.clearInterval(this.countdownTimer);this.countdownTimer=null}document.dispatchEvent(new CustomEvent(this.eventName))}});var ek={name:"radar",component:ex};
var ez=e=>{var{query:t,toast:r,form:i,modal:n,constants:o,endpoints:a}=window.TutorCore;var{convertToErrorMessage:l}=window.TutorCore.error;var{wpPostForm:u,wpPost:d}=window.TutorCore.api;var{tutorConfig:c}=window.TutorCore.config;var{TUTOR_CUSTOM_EVENTS:v}=o;var h,m,f,p;return{formId:e.formId,attemptId:e.attemptId,quizId:e.quizId,abandonModalId:e.abandonModalId,totalQuestions:Number(e.totalQuestions)||0,enableAnswerReveal:(h=e.enableAnswerReveal)!==null&&h!==void 0?h:false,revealWaitMs:(m=e.revealWaitMs)!==null&&m!==void 0?m:null,submittedModalId:(f=e.submittedModalId)!==null&&f!==void 0?f:"",timeoutModalId:(p=e.timeoutModalId)!==null&&p!==void 0?p:"",submitQuizMutation:null,abandonQuizMutation:null,timeoutQuizMutation:null,hasTimedOut:false,isRevealSubmitting:false,beforeUnloadTriggered:false,isAbandoningNavigation:false,skipBeforeUnload:false,pendingNavigationAction:"",pendingNavigationUrl:"",pendingTimeoutSubmission:false,resultModalOpenId:"",modalCloseHandler:null,beforeUnloadHandler:null,navigationHandler:null,$el:null,$root:null,init(){this.handleQuizSubmit=this.handleQuizSubmit.bind(this);this.handleQuizError=this.handleQuizError.bind(this);this.handleQuizTimeout=this.handleQuizTimeout.bind(this);document.addEventListener(v.QUIZ_TIME_EXPIRED,e=>{var t;var r=(t=e===null||e===void 0?void 0:e.detail)!==null&&t!==void 0?t:{};if((r===null||r===void 0?void 0:r.formId)&&r.formId!==this.formId){return}this.handleQuizTimeout(r)});document.addEventListener(v.QUIZ_ABANDON_REQUESTED,e=>{var t;var r=(t=e===null||e===void 0?void 0:e.detail)!==null&&t!==void 0?t:{};if((r===null||r===void 0?void 0:r.formId)&&r.formId!==this.formId){return}this.handleAbandonQuiz()});this.beforeUnloadHandler=this.handleBeforeUnload.bind(this);this.navigationHandler=this.handleNavigationAttempt.bind(this);this.modalCloseHandler=this.handleModalClose.bind(this);window.addEventListener("beforeunload",this.beforeUnloadHandler);document.addEventListener(ev.NAVIGATION_EVENT,this.navigationHandler,true);document.addEventListener(v.MODAL_CLOSED,this.modalCloseHandler);this.submitQuizMutation=t.useMutation(this.submitQuizAttempt,{onSuccess:()=>{var e=this.pendingTimeoutSubmission;this.pendingTimeoutSubmission=false;this.handleSubmissionSuccess(e)},onError:e=>{this.pendingTimeoutSubmission=false;r.error(l(e))}});this.abandonQuizMutation=t.useMutation(this.abandonQuizAttempt,{onSuccess:()=>{this.isAbandoningNavigation=false;if(this.pendingNavigationAction==="navigate"&&this.pendingNavigationUrl){var e=this.pendingNavigationUrl;this.pendingNavigationAction="";this.pendingNavigationUrl="";this.performSafeNavigate(e);return}this.pendingNavigationAction="";this.pendingNavigationUrl="";this.performSafeReload()},onError:e=>{this.isAbandoningNavigation=false;this.skipBeforeUnload=false;r.error(l(e))}});this.timeoutQuizMutation=t.useMutation(this.timeoutQuizAttempt,{onSuccess:()=>{this.handleTimeoutSuccess()},onError:e=>{r.error(l(e))}})},handleQuizSubmit(e){var t;if(this.isRevealSubmitting){return}if(this.isRevealMode()){var r=this.getRevealWaitTime();var i=this.revealOnSubmit();if(i){this.isRevealSubmitting=true;var n=this.buildSubmitPayload(e);window.setTimeout(()=>{var e;(e=this.submitQuizMutation)===null||e===void 0?void 0:e.mutate(n);this.isRevealSubmitting=false},r);return}}var o=this.buildSubmitPayload(e);(t=this.submitQuizMutation)===null||t===void 0?void 0:t.mutate(o)},getRevealWaitTime(){var e;var t=Number((e=this.revealWaitMs)!==null&&e!==void 0?e:"");if(!Number.isNaN(t)&&t>0){return t}var r;var i=Number((r=c.quiz_answer_display_time)!==null&&r!==void 0?r:"");if(!Number.isNaN(i)&&i>0){return i}return ec.DEFAULT_WAIT_MS},isRevealMode(){return this.enableAnswerReveal},getRevealAnswerIds(){var e=document.getElementById(ec.ANSWER_CONTEXT_ID);if(!(e===null||e===void 0?void 0:e.textContent)){return[]}try{var t;var r=e.textContent.trim();var i=(t=r.match(/.{1,2}/g))===null||t===void 0?void 0:t.map(e=>String.fromCharCode(parseInt(e,16))).join("");if(!i){return[]}var n=JSON.parse(i);if(!Array.isArray(n)){return[]}return n.map(e=>Number(e)).filter(e=>!Number.isNaN(e))}catch(e){return[]}},revealQuestion(e,t){eS(e,t)},revealOnSubmit(){var e=this.getRevealAnswerIds();if(!e.length){return false}var t;var r=(t=this.$root)!==null&&t!==void 0?t:this.$el;if(!r){return false}var i=Array.from(r.querySelectorAll(ep.QUESTION_WRAPPER));var n=false;i.forEach(t=>{var r;var i=t.querySelector(ec.QUESTION_SELECTOR);if(!i){return}var o;var a=(o=(r=i.dataset)===null||r===void 0?void 0:r.question)!==null&&o!==void 0?o:"";if(!ec.SUPPORTED_TYPES.includes(a)){return}this.revealQuestion(t,e);n=true});return n},handleQuizError(){r.error(ef.REQUIRED_QUESTIONS)},handleAbandonQuiz(){var e,t,r;if(!this.formId||!i.hasForm(this.formId)){return}var n;var o=(n=(t=i.getFormState)===null||t===void 0?void 0:(e=t.call(i,this.formId))===null||e===void 0?void 0:e.values)!==null&&n!==void 0?n:{};var a=this.buildSubmitPayload(o);(r=this.abandonQuizMutation)===null||r===void 0?void 0:r.mutate(a)},handleAbandonConfirm(){this.isAbandoningNavigation=true;this.prepareForNavigation();if(!this.pendingNavigationAction){this.pendingNavigationAction="reload"}this.handleAbandonQuiz()},handleAbandonCancel(){this.pendingNavigationAction="";this.pendingNavigationUrl="";this.isAbandoningNavigation=false;this.skipBeforeUnload=false;this.beforeUnloadTriggered=false},handleNavigationAttempt(e){var t;var r=e.target;if(!r){return}var i=r.closest("a");if(!i){return}if(i.hasAttribute("download")){return}var o=i.getAttribute("href")||"";if(!o||ev.IGNORE_ANCHOR_PREFIXES.some(e=>o.startsWith(e))){return}var a=(i.getAttribute("target")||"").toLowerCase();if(a&&a!=="_self"){return}if(!this.shouldWarnOnUnload()){return}e.preventDefault();this.pendingNavigationAction="navigate";this.pendingNavigationUrl=i.href;n===null||n===void 0?void 0:(t=n.showModal)===null||t===void 0?void 0:t.call(n,this.abandonModalId)},handleBeforeUnload(e){if(!this.shouldWarnOnUnload()){this.beforeUnloadTriggered=false;return}this.beforeUnloadTriggered=true;e.preventDefault();e.returnValue="";return""},shouldWarnOnUnload(){var e,t,r;if(!this.formId||!(i===null||i===void 0?void 0:(e=i.hasForm)===null||e===void 0?void 0:e.call(i,this.formId))){return false}if(this.skipBeforeUnload){return false}if(this.isAbandoningNavigation){return false}if(this.hasTimedOut||this.isRevealSubmitting){return false}if(((t=this.submitQuizMutation)===null||t===void 0?void 0:t.isPending)||((r=this.abandonQuizMutation)===null||r===void 0?void 0:r.isPending)){return false}return true},prepareForNavigation(){this.skipBeforeUnload=true;this.beforeUnloadTriggered=false;if(this.beforeUnloadHandler){window.removeEventListener("beforeunload",this.beforeUnloadHandler)}if(this.navigationHandler){document.removeEventListener(ev.NAVIGATION_EVENT,this.navigationHandler,true)}},performSafeReload(){this.prepareForNavigation();window.location.reload()},performSafeNavigate(e){this.prepareForNavigation();window.location.assign(e)},getAttemptedCount(){return eI(this.formId)},openResultModal(e,t){var r;if(!e){this.performSafeReload();return}this.prepareForNavigation();this.resultModalOpenId=e;n===null||n===void 0?void 0:(r=n.showModal)===null||r===void 0?void 0:r.call(n,e,t!==null&&t!==void 0?t:null)},notifyAttemptCompleted(){document.dispatchEvent(new CustomEvent(v.QUIZ_ATTEMPT_COMPLETED,{detail:{formId:this.formId,attemptId:this.attemptId,quizId:this.quizId}}))},handleSubmissionSuccess(e){this.notifyAttemptCompleted();if(e){this.openResultModal(this.timeoutModalId,{attempted:this.getAttemptedCount(),total:this.totalQuestions});return}this.openResultModal(this.submittedModalId)},handleTimeoutSuccess(){this.notifyAttemptCompleted();this.openResultModal(this.timeoutModalId,{attempted:this.getAttemptedCount(),total:this.totalQuestions})},handleModalClose(e){var t;var r=(t=e===null||e===void 0?void 0:e.detail)!==null&&t!==void 0?t:{};var i=r===null||r===void 0?void 0:r.id;if(!this.resultModalOpenId){return}if(i&&i!==this.resultModalOpenId){return}var n=this.resultModalOpenId===this.submittedModalId||this.resultModalOpenId===this.timeoutModalId;this.resultModalOpenId="";if(n){this.performSafeReload()}},handleQuizTimeoutAbandon(){var e;if(!this.quizId){return}(e=this.timeoutQuizMutation)===null||e===void 0?void 0:e.mutate({quiz_id:this.quizId})},handleQuizTimeout(e){var t,r,n,o,a;var s=e===null||e===void 0?void 0:e.action;if(!s||!this.formId||!i.hasForm(this.formId)){return}if(this.hasTimedOut){return}if(((t=this.submitQuizMutation)===null||t===void 0?void 0:t.isPending)||((r=this.abandonQuizMutation)===null||r===void 0?void 0:r.isPending)||((n=this.timeoutQuizMutation)===null||n===void 0?void 0:n.isPending)){return}var l;var u=(l=(a=i.getFormState)===null||a===void 0?void 0:(o=a.call(i,this.formId))===null||o===void 0?void 0:o.values)!==null&&l!==void 0?l:{};if(s===eh.AUTO_SUBMIT){this.hasTimedOut=true;this.pendingTimeoutSubmission=true;this.handleQuizSubmit(u);return}if(s===eh.AUTO_ABANDON){this.hasTimedOut=true;this.handleQuizTimeoutAbandon()}},buildSubmitPayload(e){var t=this.normalizePayload(e);t.attempt_id=this.attemptId;return t},normalizePayload(e){var t=new Map;return Object.entries(e).reduce((e,r)=>{var[i,n]=r;var o=i.replace(/\[\].*$/,"");var a;var s=(a=t.get(o))!==null&&a!==void 0?a:0;var l=s+1;t.set(o,l);var u=(e,t)=>{if(Array.isArray(t)){t.forEach(t=>e.push(t));return}e.push(t)};if(l===1){e[o]=n;return e}var d=e[o];var c=[];if(l===2){u(c,d)}else if(Array.isArray(d)){d.forEach(e=>c.push(e))}u(c,n);e[o]=c;return e},{})},submitQuizAttempt(e){return u(window.location.href,s({tutor_action:a.QUIZ_ATTEMPT_SUBMIT},e))},abandonQuizAttempt(e){return d(a.QUIZ_ABANDON,s({tutor_action:a.QUIZ_ATTEMPT_SUBMIT},e))},timeoutQuizAttempt(e){return d(a.QUIZ_TIMEOUT,s({},e))},destroy(){if(this.beforeUnloadHandler){window.removeEventListener("beforeunload",this.beforeUnloadHandler)}if(this.navigationHandler){document.removeEventListener(ev.NAVIGATION_EVENT,this.navigationHandler,true)}if(this.modalCloseHandler){document.removeEventListener(v.MODAL_CLOSED,this.modalCloseHandler)}}}};var eF={name:"quizSubmission",component:ez};
var eB={PROGRESS_ANIMATE:"tutor-quiz-progress-animate"};var eH=e=>{var t=Math.max(0,e.duration);var r=typeof e.hasLimit==="boolean"?e.hasLimit:t>0;var i;var n=(i=e.expiresAction)!==null&&i!==void 0?i:"auto_submit";var o;return{total:t,remaining:t,hasLimit:r,expired:false,isReady:false,expiresAction:n,formId:(o=e.formId)!==null&&o!==void 0?o:"",timer:null,shakeTimer:null,shaking:false,totalQuestions:Number(e.totalQuestions)||0,$el:null,init(){if(!this.hasLimit){this.isReady=true;return}document.addEventListener(y.QUIZ_ATTEMPT_COMPLETED,e=>{var t;var r=(t=e===null||e===void 0?void 0:e.detail)!==null&&t!==void 0?t:{};if((r===null||r===void 0?void 0:r.formId)&&r.formId!==this.formId){return}this.stop()});if(this.remaining<=0){this.isReady=true;this.handleExpire();return}this.isReady=true;this.start()},start(){var e;this.stop();this.timer=window.setInterval(()=>{if(this.remaining>0){this.remaining--}else{this.handleExpire()}},1e3);this.startShakeInterval();(e=this.$el)===null||e===void 0?void 0:e.classList.add(eB.PROGRESS_ANIMATE)},stop(){if(this.timer){var e;clearInterval(this.timer);this.timer=null;(e=this.$el)===null||e===void 0?void 0:e.classList.remove(eB.PROGRESS_ANIMATE)}this.stopShakeInterval()},startShakeInterval(){this.stopShakeInterval();this.shakeTimer=window.setInterval(()=>{if(this.timerState==="critical"){this.shaking=true;window.setTimeout(()=>{this.shaking=false},500)}},2e3)},stopShakeInterval(){if(this.shakeTimer){clearInterval(this.shakeTimer);this.shakeTimer=null}this.shaking=false},normalizeExpireAction(e){if(e==="autosubmit"){return"auto_submit"}return e},dispatchQuizEvent(e){document.dispatchEvent(new CustomEvent(y.QUIZ_TIME_EXPIRED,{detail:{action:this.normalizeExpireAction(e),formId:this.formId}}))},requestAbandon(){document.dispatchEvent(new CustomEvent(y.QUIZ_ABANDON_REQUESTED,{detail:{formId:this.formId}}))},handleExpire(){if(this.expired){return}this.expired=true;this.remaining=0;this.stop();this.dispatchQuizEvent(this.expiresAction)},get minutes(){if(this.days>0||this.hours>0){return Math.floor(this.remaining%3600/60)}return Math.floor(this.remaining/60)},get hours(){if(this.days>0){return Math.floor(this.remaining%86400/3600)}return Math.floor(this.remaining/3600)},get days(){return Math.floor(this.remaining/86400)},get seconds(){return this.remaining%60},get timerFormat(){if(this.days>0){return"days"}if(this.hours>0){return"hours"}return"compact"},get displayTokens(){var a=[];var s=(e,t)=>{t.split("").forEach((t,r)=>{a.push({key:"".concat(e,"-").concat(r),type:"digit",value:t})})};if(this.timerFormat==="days"){s("days",String(this.days));a.push({key:"days-suffix",type:"suffix",value:"d"});a.push({key:"days-spacer",type:"spacer",value:" "})}if(this.timerFormat==="days"||this.timerFormat==="hours"){s("hours",String(this.hours).padStart(2,"0"));a.push({key:"hours-separator",type:"separator",value:":"})}s("minutes",String(this.minutes).padStart(2,"0"));a.push({key:"minutes-separator",type:"separator",value:":"});s("seconds",String(this.seconds).padStart(2,"0"));return a},get progress(){if(!this.total){return 0}return(this.total-this.remaining)/this.total*100},get timerState(){if(!this.total||!this.hasLimit){return"initial"}var l=this.remaining/this.total*100;if(l<=25){return"critical"}if(l<=50){return"warning"}return"initial"},get attemptedCount(){return eI(this.formId)},get attemptedProgress(){if(!this.totalQuestions){return 0}return this.attemptedCount/this.totalQuestions*100}}};var e$={name:"quizTimer",component:eH};
var eW=()=>{window.TutorComponentRegistry.registerAll({components:[e$,eQ,eM,eF,eg,ek,eO,et,ed]});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};
var eG=e=>{var{courseId:t,resetModalId:r}=e;var{query:i,modal:n,toast:o}=window.TutorCore;var{wpPost:a}=window.TutorCore.api;var{convertToErrorMessage:s}=window.TutorCore.error;var{endpoints:l}=window.TutorCore;return{pagesHeight:null,resizing:false,sidebarOpen:false,courseId:t,resetModalId:r,resetProgressMutation:null,$refs:{},$nextTick:{},init(){this.$nextTick(()=>{if(this.$refs.pagesList){this.pagesHeight=this.$refs.pagesList.scrollHeight}});this.resetProgressMutation=i.useMutation(e=>a(l.RESET_COURSE_PROGRESS,e),{onSuccess:e=>{var t;if(e.status_code===200&&((t=e.data)===null||t===void 0?void 0:t.redirect_to)){n.closeModal(this.resetModalId);window.location.href=e.data.redirect_to}},onError:e=>{var t;o.error(s(e));if((t=e.message)===null||t===void 0?void 0:t.includes("HTTP")){window.location.reload()}}})},toggleSidebar(){this.sidebarOpen=!this.sidebarOpen},closeSidebar(){this.sidebarOpen=false},startResizing(e){var t;this.resizing=true;var r=e.clientY;var i=((t=this.$refs.pagesList)===null||t===void 0?void 0:t.offsetHeight)||0;var n=e=>{var t=r-e.clientY;
this.pagesHeight=Math.max(36,Math.min(400,i+t))};var o=()=>{this.resizing=false;window.removeEventListener("mousemove",n);window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",n);window.addEventListener("mouseup",o)},togglePagesHeight(){if((this.pagesHeight||0)>36){this.pagesHeight=36}else if(this.$refs.pagesList){this.pagesHeight=this.$refs.pagesList.scrollHeight}},confirmReset(){n.showModal(this.resetModalId)},resetProgress(){var e;(e=this.resetProgressMutation)===null||e===void 0?void 0:e.mutate({course_id:this.courseId,context:"learning-area-sidebar"})}}};var eV=()=>{if(window.TutorComponentRegistry){window.TutorComponentRegistry.register({type:"component",meta:{name:"learningSidebar",component:eG}})}};
var ej=e=>{try{return decodeURIComponent(e)}catch(t){return e}};var eZ=()=>{M();C();eV();O();_();var{pathname:e,search:t}=window.location;
var r=e.split("/").filter(Boolean).map(ej);var{tutorConfig:i}=window.TutorCore.config;var{lesson_slug:n="lessons",quiz_slug:o="quizzes"}=i||{};var a=null;if(r.includes(n)){a="lesson"}else if(r.includes(o)){a="quiz"}else{
var s=new URLSearchParams(t);a=s.get("subpage")}switch(a){case"quiz":eW();break;case"lesson":G();break;case"qna":J();break;case"course-info":V();break;de
console.warn("Unknown learning area page:",a)}
if(window.TutorComponentRegistry){window.TutorComponentRegistry.initWithAlpine(window.Alpine)}};if(document.readyState==="loading"){document.addEventListener("alpine:init",eZ)}else{eZ()}})();
"object"==typeof navigator&&function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):(e="undefined"!=typeof globalThis?globalThis:e||self).Plyr=t()}(this,function(){"use strict";function e(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t);if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function t(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function i(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,s)}return i}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var a={addCSS:!0,thumbWidth:15,watch:!0};var r=function(e){return null!=e?e.constructor:null},o=function(e,t){return!!(e&&t&&e instanceof t)},l=function(e){return null==e},c=function(e){return r(e)===Object},u=function(e){return r(e)===String},h=function(e){return Array.isArray(e)},d=function(e){return o(e,NodeList)},m=u,p=h,g=d,f=function(e){return o(e,Element)},y=function(e){return o(e,Event)},b=function(e){return l(e)||(u(e)||h(e)||d(e))&&!e.length||c(e)&&!Object.keys(e).length};function v(e,t){if(1>t){var i=function(e){var t="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}(t);return parseFloat(e.toFixed(i))}return Math.round(e/t)*t}var w=function(){function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),f(t)?this.element=t:m(t)&&(this.element=document.querySelector(t)),f(this.element)&&b(this.element.rangeTouch)&&(this.config=n({},a,{},i),this.init())}return function(e,i,s){i&&t(e.prototype,i),s&&t(e,s)}(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var t=this,i=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(e){t.element[i](e,function(e){return t.set(e)},!1)})}},{key:"get",value:function(t){if(!e.enabled||!y(t))return null;var i,s=t.target,n=t.changedTouches[0],a=parseFloat(s.getAttribute("min"))||0,r=parseFloat(s.getAttribute("max"))||100,o=parseFloat(s.getAttribute("step"))||1,l=s.getBoundingClientRect(),c=100/l.width*(this.config.thumbWidth/2)/100;return 0>(i=100/l.width*(n.clientX-l.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*c:50<i&&(i+=2*(i-50)*c),a+v(i/100*(r-a),o)}},{key:"set",value:function(t){e.enabled&&y(t)&&!t.target.disabled&&(t.preventDefault(),t.target.value=this.get(t),function(e,t){if(e&&t){var i=new Event(t,{bubbles:!0});e.dispatchEvent(i)}}(t.target,"touchend"===t.type?"change":"input"))}}],[{key:"setup",value:function(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},s=null;if(b(t)||m(t)?s=Array.from(document.querySelectorAll(m(t)?t:'input[type="range"]')):f(t)?s=[t]:g(t)?s=Array.from(t):p(t)&&(s=t.filter(f)),b(s))return null;var r=n({},a,{},i);if(m(t)&&r.watch){var o=new MutationObserver(function(i){Array.from(i).forEach(function(i){Array.from(i.addedNodes).forEach(function(i){f(i)&&function(e,t){return function(){return Array.from(document.querySelectorAll(t)).includes(this)}.call(e,t)}(i,t)&&new e(i,r)})})});o.observe(document.body,{childList:!0,subtree:!0})}return s.map(function(t){return new e(t,i)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const k=e=>null!=e?e.constructor:null,T=(e,t)=>Boolean(e&&t&&e instanceof t),C=e=>null==e,E=e=>k(e)===Object,S=e=>k(e)===String,A=e=>"function"==typeof e,P=e=>Array.isArray(e),M=e=>T(e,NodeList);function N(e){return C(e)||(S(e)||P(e)||M(e))&&!e.length||E(e)&&!Object.keys(e).length}var x={nullOrUndefined:C,object:E,number:e=>k(e)===Number&&!Number.isNaN(e),string:S,boolean:e=>k(e)===Boolean,function:A,array:P,weakMap:e=>T(e,WeakMap),nodeList:M,element:function(e){return null!==e&&"object"==typeof e&&1===e.nodeType&&"object"==typeof e.style&&"object"==typeof e.ownerDocument},textNode:e=>k(e)===Text,event:e=>T(e,Event),keyboardEvent:e=>T(e,KeyboardEvent),cue:e=>T(e,window.TextTrackCue)||T(e,window.VTTCue),track:e=>T(e,TextTrack)||!C(e)&&S(e.kind),promise:e=>T(e,Promise)&&A(e.then),url:function(e){if(T(e,window.URL))return!0;if(!S(e))return!1;let t=e;e.startsWith("http://")&&e.startsWith("https://")||(t=`http://${e}`);try{return!N(new URL(t).hostname)}catch{return!1}},empty:N};const L=(()=>{const e=document.createElement("span"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(t).find(t=>void 0!==e.style[t]);return!!x.string(i)&&t[i]})();function _(e,t){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}},t)}function I(e,t){return t.split(".").reduce((e,t)=>e&&e[t],e)}function O(e={},...t){if(!t.length)return e;const i=t.shift();return x.object(i)?(Object.keys(i).forEach(t=>{x.object(i[t])?(Object.keys(e).includes(t)||Object.assign(e,{[t]:{}}),O(e[t],i[t])):Object.assign(e,{[t]:i[t]})}),O(e,...t)):e}function $(e,t){const i=e.length?e:[e];Array.from(i).reverse().forEach((e,i)=>{const s=i>0?t.cloneNode(!0):t,n=e.parentNode,a=e.nextSibling;s.appendChild(e),a?n.insertBefore(s,a):n.appendChild(s)})}function j(e,t){x.element(e)&&!x.empty(t)&&Object.entries(t).filter(([,e])=>!x.nullOrUndefined(e)).forEach(([t,i])=>e.setAttribute(t,i))}function R(e,t,i){const s=document.createElement(e);return x.object(t)&&j(s,t),x.string(i)&&(s.textContent=i),s}function D(e,t,i,s){x.element(t)&&t.appendChild(R(e,i,s))}function q(e){x.nodeList(e)||x.array(e)?Array.from(e).forEach(q):x.element(e)&&x.element(e.parentNode)&&e.parentNode.removeChild(e)}function H(e){if(!x.element(e))return;let{length:t}=e.childNodes;for(;t>0;)e.removeChild(e.lastChild),t-=1}function F(e,t){return x.element(t)&&x.element(t.parentNode)&&x.element(e)?(t.parentNode.replaceChild(e,t),e):null}function V(e,t){if(!x.string(e)||x.empty(e))return{};const i={},s=O({},t);return e.split(",").forEach(e=>{const t=e.trim(),n=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),[r]=a,o=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":x.string(s.class)?i.class=`${s.class} ${n}`:i.class=n;break;case"#":i.id=t.replace("#","");break;case"[":i[r]=o}}),O(s,i)}function U(e,t){if(!x.element(e))return;let i=t;x.boolean(i)||(i=!e.hidden),e.hidden=i}function B(e,t,i){if(x.nodeList(e))return Array.from(e).map(e=>B(e,t,i));if(x.element(e)){let s="toggle";return void 0!==i&&(s=i?"add":"remove"),e.classList[s](t),e.classList.contains(t)}return!1}function W(e,t){return x.element(e)&&e.classList.contains(t)}function z(e,t){const{prototype:i}=Element;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)}).call(e,t)}function K(e){return this.elements.container.querySelectorAll(e)}function Y(e){return this.elements.container.querySelector(e)}function X(e=null,t=!1){x.element(e)&&e.focus({preventScroll:!0,focusVisible:t})}const Q={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},J={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,t){const i=J[e]||"html5"!==t;return{api:i,ui:i&&J.rangeInput}},pip:document.pictureInPictureEnabled&&!R("video").disablePictureInPicture,airplay:x.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(x.empty(e))return!1;const[t]=e.split("/");let i=e;if(!this.isHTML5||t!==this.type)return!1;Object.keys(Q).includes(i)&&(i+=`; codecs="${Q[e]}"`);try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range","range"===e.type})(),touch:"ontouchstart"in document.documentElement,transitions:!1!==L,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},G=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return e})();function Z(e,t,i,s=!1,n=!0,a=!1){if(!e||!("addEventListener"in e)||x.empty(t)||!x.function(i))return;const r=t.split(" ");let o=a;G&&(o={passive:n,capture:a}),r.forEach(t=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:e,type:t,callback:i,options:o}),e[s?"addEventListener":"removeEventListener"](t,i,o)})}function ee(e,t="",i,s=!0,n=!1){Z.call(this,e,t,i,!0,s,n)}function te(e,t="",i,s=!0,n=!1){Z.call(this,e,t,i,!1,s,n)}function ie(e,t="",i,s=!0,n=!1){const a=(...r)=>{te(e,t,a,s,n),i.apply(this,r)};Z.call(this,e,t,a,!0,s,n)}function se(e,t="",i=!1,s={}){if(!x.element(e)||x.empty(t))return;const n=new CustomEvent(t,{bubbles:i,detail:{...s,plyr:this}});e.dispatchEvent(n)}function ne(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:t,type:i,callback:s,options:n}=e;t.removeEventListener(i,s,n)}),this.eventListeners=[])}function ae(){return new Promise(e=>this.ready?setTimeout(e,0):ee.call(this,this.elements.container,"ready",e)).then(()=>{})}function re(e){x.promise(e)&&e.then(null,()=>{})}function oe(e){return x.array(e)?e.filter((t,i)=>e.indexOf(t)===i):e}function le(e,t){return x.array(e)&&e.length?e.reduce((e,i)=>Math.abs(i-t)<Math.abs(e-t)?i:e):null}function ce(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const ue=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((e,[t,i])=>({...e,[t/i]:[t,i]}),{});function he(e){if(!(x.array(e)||x.string(e)&&e.includes(":")))return!1;return(x.array(e)?e:e.split(":")).map(Number).every(x.number)}function de(e){if(!x.array(e)||!e.every(x.number))return null;const[t,i]=e,s=(e,t)=>0===t?e:s(t,e%t),n=s(t,i);return[t/n,i/n]}function me(e){const t=e=>he(e)?e.split(":").map(Number):null;let i=t(e);if(null===i&&(i=t(this.config.ratio)),null===i&&!x.empty(this.embed)&&x.array(this.embed.ratio)&&({ratio:i}=this.embed),null===i&&this.isHTML5){const{videoWidth:e,videoHeight:t}=this.media;i=[e,t]}return de(i)}function pe(e){if(!this.isVideo)return{};const{wrapper:t}=this.elements,i=me.call(this,e);if(!x.array(i))return{};const[s,n]=de(i),a=100/s*n;if(ce(`aspect-ratio: ${s}/${n}`)?t.style.aspectRatio=`${s}/${n}`:t.style.paddingBottom=`${a}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const e=100/this.media.offsetWidth*Number.parseInt(window.getComputedStyle(this.media).paddingBottom,10),i=(e-a)/(e/50);this.fullscreen.active?t.style.paddingBottom=null:this.media.style.transform=`translateY(-${i}%)`}else this.isHTML5&&t.classList.add(this.config.classNames.videoFixedRatio);return{padding:a,ratio:i}}function ge(e,t,i=.05){const s=e/t,n=le(Object.keys(ue),s);return Math.abs(n-s)<=i?ue[n]:[e,t]}const fe={getSources(){if(!this.isHTML5)return[];return Array.from(this.media.querySelectorAll("source")).filter(e=>{const t=e.getAttribute("type");return!!x.empty(t)||J.mime.call(this,t)})},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:fe.getSources.call(this).map(e=>Number(e.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,x.empty(this.config.ratio)||pe.call(e),Object.defineProperty(e.media,"quality",{get(){const t=fe.getSources.call(e).find(t=>t.getAttribute("src")===e.source);return t&&Number(t.getAttribute("size"))},set(t){if(e.quality!==t){if(e.config.quality.forced&&x.function(e.config.quality.onChange))e.config.quality.onChange(t);else{const i=fe.getSources.call(e).find(e=>Number(e.getAttribute("size"))===t);if(!i)return;const{currentTime:s,paused:n,preload:a,readyState:r,playbackRate:o}=e.media;e.media.src=i.getAttribute("src"),("none"!==a||r)&&(e.once("loadedmetadata",()=>{e.speed=o,e.currentTime=s,n||re(e.play())}),e.media.load())}se.call(e,e.media,"qualitychange",!1,{quality:t})}}})},cancelRequests(){this.isHTML5&&(q(fe.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};var ye={isIE:Boolean(window.document.documentMode),isEdge:/Edge/.test(navigator.userAgent),isWebKit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPadOS:"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,isIos:/iPad|iPhone|iPod/i.test(navigator.userAgent)&&navigator.maxTouchPoints>1};function be(e,...t){return x.empty(e)?e:e.toString().replace(/\{(\d+)\}/g,(e,i)=>t[i].toString())}function ve(e="",t="",i=""){return e.replace(new RegExp(t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString())}function we(e=""){return e.toString().replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())}function ke(e=""){let t=e.toString();return t=function(e=""){let t=e.toString();return t=ve(t,"-"," "),t=ve(t,"_"," "),t=we(t),ve(t," ","")}(t),t.charAt(0).toLowerCase()+t.slice(1)}function Te(e){const t=document.createElement("div");return t.appendChild(e),t.innerHTML}const Ce={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},Ee={get(e="",t={}){if(x.empty(e)||x.empty(t))return"";let i=I(t.i18n,e);if(x.empty(i))return Object.keys(Ce).includes(e)?Ce[e]:"";const s={"{seektime}":t.seekTime,"{title}":t.title};return Object.entries(s).forEach(([e,t])=>{i=ve(i,e,t)}),i}};class Se{constructor(t){e(this,"get",e=>{if(!Se.supported||!this.enabled)return null;const t=window.localStorage.getItem(this.key);if(x.empty(t))return null;const i=JSON.parse(t);return x.string(e)&&e.length?i[e]:i}),e(this,"set",e=>{if(!Se.supported||!this.enabled)return;if(!x.object(e))return;let t=this.get();x.empty(t)&&(t={}),O(t,e);try{window.localStorage.setItem(this.key,JSON.stringify(t))}catch{}}),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}}function Ae(e,t="text",i=!1){return new Promise((s,n)=>{try{const n=new XMLHttpRequest;if(!("withCredentials"in n))return;i&&(n.withCredentials=!0),n.addEventListener("load",()=>{if("text"===t)try{s(JSON.parse(n.responseText))}catch{s(n.responseText)}else s(n.response)}),n.addEventListener("error",()=>{throw new Error(n.status)}),n.open("GET",e,!0),n.responseType=t,n.send()}catch(e){n(e)}})}function Pe(e,t){if(!x.string(e))return;const i="cache",s=x.string(t);let n=!1;const a=()=>null!==document.getElementById(t),r=(e,t)=>{e.innerHTML=t,s&&a()||document.body.insertAdjacentElement("afterbegin",e)};if(!s||!a()){const a=Se.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),s&&o.setAttribute("id",t),a){const e=window.localStorage.getItem(`${i}-${t}`);if(n=null!==e,n){const t=JSON.parse(e);r(o,t.content)}}Ae(e).then(e=>{if(!x.empty(e)){if(a)try{window.localStorage.setItem(`${i}-${t}`,JSON.stringify({content:e}))}catch{}r(o,e)}}).catch(()=>{})}}const Me=e=>Math.trunc(e/60/60%60,10);function Ne(e=0,t=!1,i=!1){if(!x.number(e))return Ne(void 0,t,i);const s=e=>`0${e}`.slice(-2);let n=Me(e);const a=(r=e,Math.trunc(r/60%60,10));var r;const o=(e=>Math.trunc(e%60,10))(e);return n=t||n>0?`${n}:`:"",`${i&&e>0?"-":""}${n}${s(a)}:${s(o)}`}const xe={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),t=window.location.host?window.location.host:window.top.location.host,i=e.host!==t||ye.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=Y.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:K.call(this,this.config.selectors.buttons.play),pause:Y.call(this,this.config.selectors.buttons.pause),restart:Y.call(this,this.config.selectors.buttons.restart),rewind:Y.call(this,this.config.selectors.buttons.rewind),fastForward:Y.call(this,this.config.selectors.buttons.fastForward),mute:Y.call(this,this.config.selectors.buttons.mute),pip:Y.call(this,this.config.selectors.buttons.pip),airplay:Y.call(this,this.config.selectors.buttons.airplay),settings:Y.call(this,this.config.selectors.buttons.settings),captions:Y.call(this,this.config.selectors.buttons.captions),fullscreen:Y.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=Y.call(this,this.config.selectors.progress),this.elements.inputs={seek:Y.call(this,this.config.selectors.inputs.seek),volume:Y.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:Y.call(this,this.config.selectors.display.buffer),currentTime:Y.call(this,this.config.selectors.display.currentTime),duration:Y.call(this,this.config.selectors.display.duration)},x.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,t){const i="http://www.w3.org/2000/svg",s=xe.getIconUrl.call(this),n=`${s.cors?"":s.url}#${this.config.iconPrefix}`,a=document.createElementNS(i,"svg");j(a,O(t,{"aria-hidden":"true",focusable:"false"}));const r=document.createElementNS(i,"use"),o=`${n}-${e}`;return"href"in r&&r.setAttributeNS("http://www.w3.org/1999/xlink","href",o),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),a.appendChild(r),a},createLabel(e,t={}){const i=Ee.get(e,this.config);return R("span",{...t,class:[t.class,this.config.classNames.hidden].filter(Boolean).join(" ")},i)},createBadge(e){if(x.empty(e))return null;const t=R("span",{class:this.config.classNames.menu.value});return t.appendChild(R("span",{class:this.config.classNames.menu.badge},e)),t},createButton(e,t){const i=O({},t);let s=ke(e);const n={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(e=>{Object.keys(i).includes(e)&&(n[e]=i[e],delete i[e])}),"button"!==n.element||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").includes(this.config.classNames.control)||O(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,e){case"play":n.toggle=!0,n.label="play",n.labelPressed="pause",n.icon="play",n.iconPressed="pause";break;case"mute":n.toggle=!0,n.label="mute",n.labelPressed="unmute",n.icon="volume",n.iconPressed="muted";break;case"captions":n.toggle=!0,n.label="enableCaptions",n.labelPressed="disableCaptions",n.icon="captions-off",n.iconPressed="captions-on";break;case"fullscreen":n.toggle=!0,n.label="enterFullscreen",n.labelPressed="exitFullscreen",n.icon="enter-fullscreen",n.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,s="play",n.label="play",n.icon="play";break;default:x.empty(n.label)&&(n.label=s),x.empty(n.icon)&&(n.icon=e)}const a=R(n.element);return n.toggle?(a.appendChild(xe.createIcon.call(this,n.iconPressed,{class:"icon--pressed"})),a.appendChild(xe.createIcon.call(this,n.icon,{class:"icon--not-pressed"})),a.appendChild(xe.createLabel.call(this,n.labelPressed,{class:"label--pressed"})),a.appendChild(xe.createLabel.call(this,n.label,{class:"label--not-pressed"}))):(a.appendChild(xe.createIcon.call(this,n.icon)),a.appendChild(xe.createLabel.call(this,n.label))),O(i,V(this.config.selectors.buttons[s],i)),j(a,i),"play"===s?(x.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(a)):this.elements.buttons[s]=a,a},createRange(e,t){const i=R("input",O(V(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":Ee.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},t));return this.elements.inputs[e]=i,xe.updateRangeFill.call(this,i),w.setup(i),i},createProgress(e,t){const i=R("progress",O(V(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},t));if("volume"!==e){i.appendChild(R("span",null,"0"));const t={played:"played",buffer:"buffered"}[e],s=t?Ee.get(t,this.config):"";i.textContent=`% ${s.toLowerCase()}`}return this.elements.display[e]=i,i},createTime(e,t){const i=V(this.config.selectors.display[e],t),s=R("div",O(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":Ee.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=s,s},bindMenuItemShortcuts(e,t){ee.call(this,e,"keydown keyup",i=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(i.key))return;if(i.preventDefault(),i.stopPropagation(),"keydown"===i.type)return;const s=z(e,'[role="menuitemradio"]');if(!s&&[" ","ArrowRight"].includes(i.key))xe.showMenuPanel.call(this,t,!0);else{let t;" "!==i.key&&("ArrowDown"===i.key||s&&"ArrowRight"===i.key?(t=e.nextElementSibling,x.element(t)||(t=e.parentNode.firstElementChild)):(t=e.previousElementSibling,x.element(t)||(t=e.parentNode.lastElementChild)),X.call(this,t,!0))}},!1),ee.call(this,e,"keyup",e=>{"Return"===e.key&&xe.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:t,type:i,title:s,badge:n=null,checked:a=!1}){const r=V(this.config.selectors.inputs[i]),o=R("button",O(r,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${r.class?r.class:""}`.trim(),"aria-checked":a,value:e})),l=R("span");l.innerHTML=s,x.element(n)&&l.appendChild(n),o.appendChild(l),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>"true"===o.getAttribute("aria-checked"),set(e){e&&Array.from(o.parentNode.children).filter(e=>z(e,'[role="menuitemradio"]')).forEach(e=>e.setAttribute("aria-checked","false")),o.setAttribute("aria-checked",e?"true":"false")}}),this.listeners.bind(o,"click keyup",t=>{if(!x.keyboardEvent(t)||" "===t.key){switch(t.preventDefault(),t.stopPropagation(),o.checked=!0,i){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=Number.parseFloat(e)}xe.showMenuPanel.call(this,"home",x.keyboardEvent(t))}},i,!1),xe.bindMenuItemShortcuts.call(this,o,i),t.appendChild(o)},formatTime(e=0,t=!1){if(!x.number(e))return e;return Ne(e,Me(this.duration)>0,t)},updateTimeDisplay(e=null,t=0,i=!1){x.element(e)&&x.number(t)&&(e.textContent=xe.formatTime(t,i))},updateVolume(){this.supported.ui&&(x.element(this.elements.inputs.volume)&&xe.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),x.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||0===this.volume))},setRange(e,t=0){x.element(e)&&(e.value=t,xe.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!x.event(e))return;let t=0;const i=(e,t)=>{const i=x.number(t)?t:0,s=x.element(e)?e:this.elements.display.buffer;if(x.element(s)){s.value=i;const e=s.getElementsByTagName("span")[0];x.element(e)&&(e.childNodes[0].nodeValue=i)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":s=this.currentTime,n=this.duration,t=0===s||0===n||Number.isNaN(s)||Number.isNaN(n)?0:(s/n*100).toFixed(2),"timeupdate"===e.type&&xe.setRange.call(this,this.elements.inputs.seek,t);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}var s,n},updateRangeFill(e){const t=x.event(e)?e.target:e;if(x.element(t)&&"range"===t.getAttribute("type")){if(z(t,this.config.selectors.inputs.seek)){t.setAttribute("aria-valuenow",this.currentTime);const e=xe.formatTime(this.currentTime),i=xe.formatTime(this.duration),s=Ee.get("seekLabel",this.config);t.setAttribute("aria-valuetext",s.replace("{currentTime}",e).replace("{duration}",i))}else if(z(t,this.config.selectors.inputs.volume)){const e=100*t.value;t.setAttribute("aria-valuenow",e),t.setAttribute("aria-valuetext",`${e.toFixed(1)}%`)}else t.setAttribute("aria-valuenow",t.value);(ye.isWebKit||ye.isIPadOS)&&t.style.setProperty("--value",t.value/t.max*100+"%")}},updateSeekTooltip(e){var t,i;if(!this.config.tooltips.seek||!x.element(this.elements.inputs.seek)||!x.element(this.elements.display.seekTooltip)||0===this.duration)return;const s=this.elements.display.seekTooltip,n=`${this.config.classNames.tooltip}--visible`,a=e=>B(s,n,e);if(this.touch)return void a(!1);let r=0;const o=this.elements.progress.getBoundingClientRect();if(x.event(e)){const t=e.pageX-e.clientX;r=100/o.width*(e.pageX-o.left-t)}else{if(!W(s,n))return;r=Number.parseFloat(s.style.left,10)}r<0?r=0:r>100&&(r=100);const l=this.duration/100*r;s.textContent=xe.formatTime(l);const c=null===(t=this.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find(({time:e})=>e===Math.round(l));c&&s.insertAdjacentHTML("afterbegin",`${c.label}<br>`),s.style.left=`${r}%`,x.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&a("mouseenter"===e.type)},timeUpdate(e){const t=!x.element(this.elements.display.duration)&&this.config.invertTime;xe.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||xe.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return U(this.elements.display.currentTime,!0),void U(this.elements.progress,!0);x.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=x.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&xe.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&xe.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&xe.setMarkers.call(this),xe.updateSeekTooltip.call(this)},toggleMenuButton(e,t){U(this.elements.settings.buttons[e],!t)},updateSetting(e,t,i){const s=this.elements.settings.panels[e];let n=null,a=t;if("captions"===e)n=this.currentTrack;else{if(n=x.empty(i)?this[e]:i,x.empty(n)&&(n=this.config[e].default),!x.empty(this.options[e])&&!this.options[e].includes(n))return void this.debug.warn(`Unsupported value of '${n}' for ${e}`);if(!this.config[e].options.includes(n))return void this.debug.warn(`Disabled value of '${n}' for ${e}`)}if(x.element(a)||(a=s&&s.querySelector('[role="menu"]')),!x.element(a))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=xe.getLabel.call(this,e,n);const r=a&&a.querySelector(`[value="${n}"]`);x.element(r)&&(r.checked=!0)},getLabel(e,t){switch(e){case"speed":return 1===t?Ee.get("normal",this.config):`${t}&times;`;case"quality":if(x.number(t)){const e=Ee.get(`qualityLabel.${t}`,this.config);return e.length?e:`${t}p`}return we(t);case"captions":return Ie.getLabel.call(this);default:return null}},setQualityMenu(e){if(!x.element(this.elements.settings.panels.quality))return;const t="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');x.array(e)&&(this.options.quality=oe(e).filter(e=>this.config.quality.options.includes(e)));const s=!x.empty(this.options.quality)&&this.options.quality.length>1;if(xe.toggleMenuButton.call(this,t,s),H(i),xe.checkMenu.call(this),!s)return;const n=e=>{const t=Ee.get(`qualityBadge.${e}`,this.config);return t.length?xe.createBadge.call(this,t):null};this.options.quality.sort((e,t)=>{const i=this.config.quality.options;return i.indexOf(e)>i.indexOf(t)?1:-1}).forEach(e=>{xe.createMenuItem.call(this,{value:e,list:i,type:t,title:xe.getLabel.call(this,"quality",e),badge:n(e)})}),xe.updateSetting.call(this,t,i)},setCaptionsMenu(){if(!x.element(this.elements.settings.panels.captions))return;const e="captions",t=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=Ie.getTracks.call(this),s=Boolean(i.length);if(xe.toggleMenuButton.call(this,e,s),H(t),xe.checkMenu.call(this),!s)return;const n=i.map((e,i)=>({value:i,checked:this.captions.toggled&&this.currentTrack===i,title:Ie.getLabel.call(this,e),badge:e.language&&xe.createBadge.call(this,e.language.toUpperCase()),list:t,type:"language"}));n.unshift({value:-1,checked:!this.captions.toggled,title:Ee.get("disabled",this.config),list:t,type:"language"}),n.forEach(xe.createMenuItem.bind(this)),xe.updateSetting.call(this,e,t)},setSpeedMenu(){if(!x.element(this.elements.settings.panels.speed))return;const e="speed",t=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(e=>e>=this.minimumSpeed&&e<=this.maximumSpeed);const i=!x.empty(this.options.speed)&&this.options.speed.length>1;xe.toggleMenuButton.call(this,e,i),H(t),xe.checkMenu.call(this),i&&(this.options.speed.forEach(i=>{xe.createMenuItem.call(this,{value:i,list:t,type:e,title:xe.getLabel.call(this,"speed",i)})}),xe.updateSetting.call(this,e,t))},checkMenu(){const{buttons:e}=this.elements.settings,t=!x.empty(e)&&Object.values(e).some(e=>!e.hidden);U(this.elements.settings.menu,!t)},focusFirstMenuItem(e,t=!1){if(this.elements.settings.popup.hidden)return;let i=e;x.element(i)||(i=Object.values(this.elements.settings.panels).find(e=>!e.hidden));const s=i.querySelector('[role^="menuitem"]');X.call(this,s,t)},toggleMenu(e){const{popup:t}=this.elements.settings,i=this.elements.buttons.settings;if(!x.element(t)||!x.element(i))return;const{hidden:s}=t;let n=s;if(x.boolean(e))n=e;else if(x.keyboardEvent(e)&&"Escape"===e.key)n=!1;else if(x.event(e)){const s=x.function(e.composedPath)?e.composedPath()[0]:e.target,a=t.contains(s);if(a||!a&&e.target!==i&&n)return}i.setAttribute("aria-expanded",n),U(t,!n),B(this.elements.container,this.config.classNames.menu.open,n),n&&x.keyboardEvent(e)?xe.focusFirstMenuItem.call(this,null,!0):n||s||X.call(this,i,x.keyboardEvent(e))},getMenuSize(e){const t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.removeAttribute("hidden"),e.parentNode.appendChild(t);const i=t.scrollWidth,s=t.scrollHeight;return q(t),{width:i,height:s}},showMenuPanel(e="",t=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!x.element(i))return;const s=i.parentNode,n=Array.from(s.children).find(e=>!e.hidden);if(J.transitions&&!J.reducedMotion){s.style.width=`${n.scrollWidth}px`,s.style.height=`${n.scrollHeight}px`;const e=xe.getMenuSize.call(this,i),t=e=>{e.target===s&&["width","height"].includes(e.propertyName)&&(s.style.width="",s.style.height="",te.call(this,s,L,t))};ee.call(this,s,L,t),s.style.width=`${e.width}px`,s.style.height=`${e.height}px`}U(n,!0),U(i,!1),xe.focusFirstMenuItem.call(this,i,t)},setDownloadUrl(){const e=this.elements.buttons.download;x.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:t,createButton:i,createProgress:s,createRange:n,createTime:a,setQualityMenu:r,setSpeedMenu:o,showMenuPanel:l}=xe;this.elements.controls=null,x.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const c=R("div",V(this.config.selectors.controls.wrapper));this.elements.controls=c;const u={class:"plyr__controls__item"};return oe(x.array(this.config.controls)?this.config.controls:[]).forEach(r=>{if("restart"===r&&c.appendChild(i.call(this,"restart",u)),"rewind"===r&&c.appendChild(i.call(this,"rewind",u)),"play"===r&&c.appendChild(i.call(this,"play",u)),"fast-forward"===r&&c.appendChild(i.call(this,"fast-forward",u)),"progress"===r){const t=R("div",{class:`${u.class} plyr__progress__container`}),i=R("div",V(this.config.selectors.progress));if(i.appendChild(n.call(this,"seek",{id:`plyr-seek-${e.id}`})),i.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const e=R("span",{class:this.config.classNames.tooltip},"00:00");i.appendChild(e),this.elements.display.seekTooltip=e}this.elements.progress=i,t.appendChild(this.elements.progress),c.appendChild(t)}if("current-time"===r&&c.appendChild(a.call(this,"currentTime",u)),"duration"===r&&c.appendChild(a.call(this,"duration",u)),"mute"===r||"volume"===r){let{volume:t}=this.elements;if(x.element(t)&&c.contains(t)||(t=R("div",O({},u,{class:`${u.class} plyr__volume`.trim()})),this.elements.volume=t,c.appendChild(t)),"mute"===r&&t.appendChild(i.call(this,"mute")),"volume"===r&&!ye.isIos&&!ye.isIPadOS){const i={max:1,step:.05,value:this.config.volume};t.appendChild(n.call(this,"volume",O(i,{id:`plyr-volume-${e.id}`})))}}if("captions"===r&&c.appendChild(i.call(this,"captions",u)),"settings"===r&&!x.empty(this.config.settings)){const s=R("div",O({},u,{class:`${u.class} plyr__menu`.trim(),hidden:""}));s.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const n=R("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),a=R("div"),r=R("div",{id:`plyr-settings-${e.id}-home`}),o=R("div",{role:"menu"});r.appendChild(o),a.appendChild(r),this.elements.settings.panels.home=r,this.config.settings.forEach(i=>{const s=R("button",O(V(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));t.call(this,s,i),ee.call(this,s,"click",()=>{l.call(this,i,!1)});const n=R("span",null,Ee.get(i,this.config)),r=R("span",{class:this.config.classNames.menu.value});r.innerHTML=e[i],n.appendChild(r),s.appendChild(n),o.appendChild(s);const c=R("div",{id:`plyr-settings-${e.id}-${i}`,hidden:""}),u=R("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});u.appendChild(R("span",{"aria-hidden":!0},Ee.get(i,this.config))),u.appendChild(R("span",{class:this.config.classNames.hidden},Ee.get("menuBack",this.config))),ee.call(this,c,"keydown",e=>{"ArrowLeft"===e.key&&(e.preventDefault(),e.stopPropagation(),l.call(this,"home",!0))},!1),ee.call(this,u,"click",()=>{l.call(this,"home",!1)}),c.appendChild(u),c.appendChild(R("div",{role:"menu"})),a.appendChild(c),this.elements.settings.buttons[i]=s,this.elements.settings.panels[i]=c}),n.appendChild(a),s.appendChild(n),c.appendChild(s),this.elements.settings.popup=n,this.elements.settings.menu=s}if("pip"===r&&J.pip&&c.appendChild(i.call(this,"pip",u)),"airplay"===r&&J.airplay&&c.appendChild(i.call(this,"airplay",u)),"download"===r){const e=O({},u,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(e.download="");const{download:t}=this.config.urls;!x.url(t)&&this.isEmbed&&O(e,{icon:`logo-${this.provider}`,label:this.provider}),c.appendChild(i.call(this,"download",e))}"fullscreen"===r&&c.appendChild(i.call(this,"fullscreen",u))}),this.isHTML5&&r.call(this,fe.getQualityOptions.call(this)),o.call(this),c},inject(){if(this.config.loadSprite){const e=xe.getIconUrl.call(this);e.cors&&Pe(e.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const t={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i=!0;x.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,t)),this.config.controls||(this.config.controls=[]),x.element(this.config.controls)||x.string(this.config.controls)?e=this.config.controls:(e=xe.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:Ie.getLabel.call(this)}),i=!1);let s;i&&x.string(this.config.controls)&&(e=(e=>{let i=e;return Object.entries(t).forEach(([e,t])=>{i=ve(i,`{${e}}`,t)}),i})(e)),x.string(this.config.selectors.controls.container)&&(s=document.querySelector(this.config.selectors.controls.container)),x.element(s)||(s=this.elements.container);if(s[x.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),x.element(this.elements.controls)||xe.findElements.call(this),!x.empty(this.elements.buttons)){const e=e=>{const t=this.config.classNames.controlPressed;e.setAttribute("aria-pressed","false"),Object.defineProperty(e,"pressed",{configurable:!0,enumerable:!0,get:()=>W(e,t),set(i=!1){B(e,t,i),e.setAttribute("aria-pressed",i?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(t=>{x.array(t)||x.nodeList(t)?Array.from(t).filter(Boolean).forEach(e):e(t)})}if(ye.isEdge&&_(s),this.config.tooltips.controls){const{classNames:e,selectors:t}=this.config,i=`${t.controls.wrapper} ${t.labels} .${e.hidden}`,s=K.call(this,i);Array.from(s).forEach(e=>{B(e,this.config.classNames.hidden,!1),B(e,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var e,t;if(!this.duration||this.elements.markers)return;const i=null===(e=this.config.markers)||void 0===e||null===(t=e.points)||void 0===t?void 0:t.filter(({time:e})=>e>0&&e<this.duration);if(null==i||!i.length)return;const s=document.createDocumentFragment(),n=document.createDocumentFragment();let a=null;const r=`${this.config.classNames.tooltip}--visible`,o=e=>B(a,r,e);i.forEach(e=>{const t=R("span",{class:this.config.classNames.marker},""),i=e.time/this.duration*100+"%";a&&(t.addEventListener("mouseenter",()=>{e.label||(a.style.left=i,a.innerHTML=e.label,o(!0))}),t.addEventListener("mouseleave",()=>{o(!1)})),t.addEventListener("click",()=>{this.currentTime=e.time}),t.style.left=i,n.appendChild(t)}),s.appendChild(n),this.config.tooltips.seek||(a=R("span",{class:this.config.classNames.tooltip},""),s.appendChild(a)),this.elements.markers={points:n,tip:a},this.elements.progress.appendChild(s)}};function Le(e,t=!0){let i=e;if(t){const e=document.createElement("a");e.href=i,i=e.href}try{return new URL(i)}catch{return null}}function _e(e){const t=new URLSearchParams;return x.object(e)&&Object.entries(e).forEach(([e,i])=>{t.set(e,i)}),t}const Ie={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!J.textTracks)return void(x.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&xe.setCaptionsMenu.call(this));var e,t;if(x.element(this.elements.captions)||(this.elements.captions=R("div",V(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),e=this.elements.captions,t=this.elements.wrapper,x.element(e)&&x.element(t)&&t.parentNode.insertBefore(e,t.nextSibling)),ye.isIE&&window.URL){const e=this.media.querySelectorAll("track");Array.from(e).forEach(e=>{const t=e.getAttribute("src"),i=Le(t);null!==i&&i.hostname!==window.location.href.hostname&&["http:","https:"].includes(i.protocol)&&Ae(t,"blob").then(t=>{e.setAttribute("src",window.URL.createObjectURL(t))}).catch(()=>{q(e)})})}const i=oe((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(e=>e.split("-")[0]));let s=(this.storage.get("language")||this.captions.language||this.config.captions.language||"auto").toLowerCase();"auto"===s&&([s]=i);let n=this.storage.get("captions")||this.captions.active;if(x.boolean(n)||({active:n}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:n,language:s,languages:i}),this.isHTML5){const e=this.config.captions.update?"addtrack removetrack":"removetrack";ee.call(this,this.media.textTracks,e,Ie.update.bind(this))}setTimeout(Ie.update.bind(this),0)},update(){const e=Ie.getTracks.call(this,!0),{active:t,language:i,meta:s,currentTrackNode:n}=this.captions,a=Boolean(e.find(e=>e.language===i));this.isHTML5&&this.isVideo&&e.filter(e=>!s.get(e)).forEach(e=>{this.debug.log("Track added",e),s.set(e,{default:"showing"===e.mode}),"showing"===e.mode&&(e.mode="hidden"),ee.call(this,e,"cuechange",()=>Ie.updateCues.call(this))}),(a&&this.language!==i||!e.includes(n))&&(Ie.setLanguage.call(this,i),Ie.toggle.call(this,t&&a)),this.elements&&B(this.elements.container,this.config.classNames.captions.enabled,!x.empty(e)),x.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&xe.setCaptionsMenu.call(this)},toggle(e,t=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,s=this.config.classNames.captions.active,n=x.nullOrUndefined(e)?!i:e;if(n!==i){if(t||(this.captions.active=n,this.storage.set({captions:n})),!this.language&&n&&!t){const e=Ie.getTracks.call(this),t=Ie.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=t.language,void Ie.set.call(this,e.indexOf(t))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=n),B(this.elements.container,s,n),this.captions.toggled=n,xe.updateSetting.call(this,"captions"),se.call(this,this.media,n?"captionsenabled":"captionsdisabled")}setTimeout(()=>{n&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(e,t=!0){const i=Ie.getTracks.call(this);if(-1!==e)if(x.number(e))if(e in i){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const s=i[e],{language:n}=s||{};this.captions.currentTrackNode=s,xe.updateSetting.call(this,"captions"),t||(this.captions.language=n,this.storage.set({language:n})),this.isVimeo&&this.embed.enableTextTrack(n,null,!1),se.call(this,this.media,"languagechange")}Ie.toggle.call(this,!0,t),this.isHTML5&&this.isVideo&&Ie.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else Ie.toggle.call(this,!1,t)},setLanguage(e,t=!0){if(!x.string(e))return void this.debug.warn("Invalid language argument",e);const i=e.toLowerCase();this.captions.language=i;const s=Ie.getTracks.call(this),n=Ie.findTrack.call(this,[i]);Ie.set.call(this,s.indexOf(n),t)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter(t=>!this.isHTML5||e||this.captions.meta.has(t)).filter(e=>["captions","subtitles"].includes(e.kind))},findTrack(e,t=!1){const i=Ie.getTracks.call(this),s=e=>Number((this.captions.meta.get(e)||{}).default),n=Array.from(i).sort((e,t)=>s(t)-s(e));let a;return e.every(e=>(a=n.find(t=>t.language===e),!a)),a||(t?n[0]:void 0)},getCurrentTrack(){return Ie.getTracks.call(this)[this.currentTrack]},getLabel(e){let t=e;return!x.track(t)&&J.textTracks&&this.captions.toggled&&(t=Ie.getCurrentTrack.call(this)),x.track(t)?x.empty(t.label)?x.empty(t.language)?Ee.get("enabled",this.config):e.language.toUpperCase():t.label:Ee.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!x.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!x.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let t=e;if(!t){const e=Ie.getCurrentTrack.call(this);t=Array.from((e||{}).activeCues||[]).map(e=>e.getCueAsHTML()).map(Te)}const i=t.map(e=>e.trim()).join("\n");if(i!==this.elements.captions.innerHTML){H(this.elements.captions);const e=R("span",V(this.config.selectors.caption));e.innerHTML=i,this.elements.captions.appendChild(e),se.call(this,this.media,"cuechange")}}},Oe={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.8.4/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:"",withCredentials:!1},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},$e="picture-in-picture",je="inline",Re={html5:"html5",youtube:"youtube",vimeo:"vimeo"},De="audio",qe="video";function He(){}class Fe{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):He}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):He}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):He}}class Ve{constructor(t){e(this,"onChange",()=>{if(!this.supported)return;const e=this.player.elements.buttons.fullscreen;x.element(e)&&(e.pressed=this.active);const t=this.target===this.player.media?this.target:this.player.elements.container;se.call(this.player,t,this.active?"enterfullscreen":"exitfullscreen",!0)}),e(this,"toggleFallback",(e=!1)=>{var t,i;e?this.scrollPosition={x:null!==(t=window.scrollX)&&void 0!==t?t:0,y:null!==(i=window.scrollY)&&void 0!==i?i:0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y);if(document.body.style.overflow=e?"hidden":"",B(this.target,this.player.config.classNames.fullscreen.fallback,e),ye.isIos){let t=document.head.querySelector('meta[name="viewport"]');const i="viewport-fit=cover";t||(t=document.createElement("meta"),t.setAttribute("name","viewport"));const s=x.string(t.content)&&t.content.includes(i);e?(this.cleanupViewport=!s,s||(t.content+=`,${i}`)):this.cleanupViewport&&(t.content=t.content.split(",").filter(e=>e.trim()!==i).join(","))}this.onChange()}),e(this,"trapFocus",e=>{if(ye.isIos||ye.isIPadOS||!this.active||"Tab"!==e.key)return;const t=document.activeElement,i=K.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[s]=i,n=i[i.length-1];t!==n||e.shiftKey?t===s&&e.shiftKey&&(n.focus(),e.preventDefault()):(s.focus(),e.preventDefault())}),e(this,"update",()=>{if(this.supported){let e;e=this.forceFallback?"Fallback (forced)":Ve.nativeSupported?"Native":"Fallback",this.player.debug.log(`${e} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");B(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),e(this,"enter",()=>{this.supported&&(ye.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!Ve.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?x.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),e(this,"exit",()=>{if(this.supported)if(ye.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),re(this.player.play());else if(!Ve.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!x.empty(this.prefix)){const e="moz"===this.prefix?"Cancel":"Exit";document[`${this.prefix}${e}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),e(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=t,this.prefix=Ve.prefix,this.property=Ve.property,this.scrollPosition={x:0,y:0},this.forceFallback="force"===t.config.fullscreen.fallback,this.player.elements.fullscreen=t.config.fullscreen.container&&function(e,t){const{prototype:i}=Element;return(i.closest||function(){let e=this;do{if(z.matches(e,t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}).call(e,t)}(this.player.elements.container,t.config.fullscreen.container),ee.call(this.player,document,"ms"===this.prefix?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),ee.call(this.player,this.player.elements.container,"dblclick",e=>{x.element(this.player.elements.controls)&&this.player.elements.controls.contains(e.target)||this.player.listeners.proxy(e,this.toggle,"fullscreen")}),ee.call(this,this.player.elements.container,"keydown",e=>this.trapFocus(e)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return Ve.nativeSupported&&!this.forceFallback}static get prefix(){if(x.function(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some(t=>!(!x.function(document[`${t}ExitFullscreen`])&&!x.function(document[`${t}CancelFullScreen`]))&&(e=t,!0)),e}static get property(){return"moz"===this.prefix?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,Ve.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||Ve.nativeSupported||!ye.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!Ve.nativeSupported||this.forceFallback)return W(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){var e;return ye.isIos&&this.player.config.fullscreen.iosNative?this.player.media:null!==(e=this.player.elements.fullscreen)&&void 0!==e?e:this.player.elements.container}}function Ue(e,t=1){return new Promise((i,s)=>{const n=new Image,a=()=>{delete n.onload,delete n.onerror,(n.naturalWidth>=t?i:s)(n)};Object.assign(n,{onload:a,onerror:a,src:e})})}const Be={addStyleHook(){B(this.elements.container,this.config.selectors.container.replace(".",""),!0),B(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void Be.toggleNativeControls.call(this,!0);x.element(this.elements.controls)||(xe.inject.call(this),this.listeners.controls()),Be.toggleNativeControls.call(this),this.isHTML5&&Ie.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,xe.updateVolume.call(this),xe.timeUpdate.call(this),xe.durationUpdate.call(this),Be.checkPlaying.call(this),B(this.elements.container,this.config.classNames.pip.supported,J.pip&&this.isHTML5&&this.isVideo),B(this.elements.container,this.config.classNames.airplay.supported,J.airplay&&this.isHTML5),B(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{se.call(this,this.media,"ready")},0),Be.setTitle.call(this),this.poster&&Be.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&xe.durationUpdate.call(this),this.config.mediaMetadata&&xe.setMediaMetadata.call(this)},setTitle(){let e=Ee.get("play",this.config);if(x.string(this.config.title)&&!x.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(t=>{t.setAttribute("aria-label",e)}),this.isEmbed){const e=Y.call(this,"iframe");if(!x.element(e))return;const t=x.empty(this.config.title)?"video":this.config.title,i=Ee.get("frameTitle",this.config);e.setAttribute("title",i.replace("{title}",t))}},togglePoster(e){B(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,t=!0){return t&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),ae.call(this).then(()=>Ue(e)).catch(t=>{throw e===this.poster&&Be.togglePoster.call(this,!1),t}).then(()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),Be.togglePoster.call(this,!0),e)))},checkPlaying(e){B(this.elements.container,this.config.classNames.playing,this.playing),B(this.elements.container,this.config.classNames.paused,this.paused),B(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",Ee.get(this.playing?"pause":"play",this.config))}),x.event(e)&&"timeupdate"===e.type||Be.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{B(this.elements.container,this.config.classNames.loading,this.loading),Be.toggleControls.call(this)},this.loading?250:0)},toggleControls(e){const{controls:t}=this.elements;if(t&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(e||this.loading||this.paused||t.pressed||t.hover||i))}},migrateStyles(){Object.values({...this.media.style}).filter(e=>!x.empty(e)&&x.string(e)&&e.startsWith("--plyr")).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),x.empty(this.media.style)&&this.media.removeAttribute("style")}};class We{constructor(t){e(this,"firstTouch",()=>{const{player:e}=this,{elements:t}=e;e.touch=!0,B(t.container,e.config.classNames.isTouch,!0)}),e(this,"global",(e=!0)=>{const{player:t}=this;t.config.keyboard.global&&Z.call(t,window,"keydown keyup",this.handleKey,e,!1),Z.call(t,document.body,"click",this.toggleMenu,e),ie.call(t,document.body,"touchstart",this.firstTouch)}),e(this,"container",()=>{const{player:e}=this,{config:t,elements:i,timers:s}=e;!t.keyboard.global&&t.keyboard.focused&&ee.call(e,i.container,"keydown keyup",this.handleKey,!1),ee.call(e,i.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",t=>{const{controls:n}=i;n&&"enterfullscreen"===t.type&&(n.pressed=!1,n.hover=!1);let a=0;["touchstart","touchmove","mousemove"].includes(t.type)&&(Be.toggleControls.call(e,!0),a=e.touch?3e3:2e3),clearTimeout(s.controls),s.controls=setTimeout(()=>Be.toggleControls.call(e,!1),a)});const n=()=>{if(!e.isVimeo||e.config.vimeo.premium)return;const t=i.wrapper,{active:s}=e.fullscreen,[n,a]=me.call(e),r=ce(`aspect-ratio: ${n} / ${a}`);if(!s)return void(r?(t.style.width=null,t.style.height=null):(t.style.maxWidth=null,t.style.margin=null));const[o,l]=[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)],c=o/l>n/a;r?(t.style.width=c?"auto":"100%",t.style.height=c?"100%":"auto"):(t.style.maxWidth=c?l/a*n+"px":null,t.style.margin=c?"0 auto":null)},a=()=>{clearTimeout(s.resized),s.resized=setTimeout(n,50)};ee.call(e,i.container,"enterfullscreen exitfullscreen",t=>{const{target:s}=e.fullscreen;if(s!==i.container)return;if(!e.isEmbed&&x.empty(e.config.ratio))return;n();("enterfullscreen"===t.type?ee:te).call(e,window,"resize",a)})}),e(this,"media",()=>{const{player:e}=this,{elements:t}=e;if(ee.call(e,e.media,"timeupdate seeking seeked",t=>xe.timeUpdate.call(e,t)),ee.call(e,e.media,"durationchange loadeddata loadedmetadata",t=>xe.durationUpdate.call(e,t)),ee.call(e,e.media,"ended",()=>{e.isHTML5&&e.isVideo&&e.config.resetOnEnd&&(e.restart(),e.pause())}),ee.call(e,e.media,"progress playing seeking seeked",t=>xe.updateProgress.call(e,t)),ee.call(e,e.media,"volumechange",t=>xe.updateVolume.call(e,t)),ee.call(e,e.media,"playing play pause ended emptied timeupdate",t=>Be.checkPlaying.call(e,t)),ee.call(e,e.media,"waiting canplay seeked playing",t=>Be.checkLoading.call(e,t)),e.supported.ui&&e.config.clickToPlay&&!e.isAudio){const i=Y.call(e,`.${e.config.classNames.video}`);if(!x.element(i))return;ee.call(e,t.container,"click",s=>{([t.container,i].includes(s.target)||i.contains(s.target))&&(e.touch&&e.config.hideControls||(e.ended?(this.proxy(s,e.restart,"restart"),this.proxy(s,()=>{re(e.play())},"play")):this.proxy(s,()=>{re(e.togglePlay())},"play")))})}e.supported.ui&&e.config.disableContextMenu&&ee.call(e,t.wrapper,"contextmenu",e=>{e.preventDefault()},!1),ee.call(e,e.media,"volumechange",()=>{e.storage.set({volume:e.volume,muted:e.muted})}),ee.call(e,e.media,"ratechange",()=>{xe.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})}),ee.call(e,e.media,"qualitychange",t=>{xe.updateSetting.call(e,"quality",null,t.detail.quality)}),ee.call(e,e.media,"ready qualitychange",()=>{xe.setDownloadUrl.call(e)});const i=e.config.events.concat(["keyup","keydown"]).join(" ");ee.call(e,e.media,i,i=>{let{detail:s={}}=i;"error"===i.type&&(s=e.media.error),se.call(e,t.container,i.type,!0,s)})}),e(this,"proxy",(e,t,i)=>{const{player:s}=this,n=s.config.listeners[i];let a=!0;x.function(n)&&(a=n.call(s,e)),!1!==a&&x.function(t)&&t.call(s,e)}),e(this,"bind",(e,t,i,s,n=!0)=>{const{player:a}=this,r=a.config.listeners[s],o=x.function(r);ee.call(a,e,t,e=>this.proxy(e,i,s),n&&!o)}),e(this,"controls",()=>{const{player:e}=this,{elements:t}=e,i=ye.isIE?"change":"input";if(t.buttons.play&&Array.from(t.buttons.play).forEach(t=>{this.bind(t,"click",()=>{re(e.togglePlay())},"play")}),this.bind(t.buttons.restart,"click",e.restart,"restart"),this.bind(t.buttons.rewind,"click",()=>{e.lastSeekTime=Date.now(),e.rewind()},"rewind"),this.bind(t.buttons.fastForward,"click",()=>{e.lastSeekTime=Date.now(),e.forward()},"fastForward"),this.bind(t.buttons.mute,"click",()=>{e.muted=!e.muted},"mute"),this.bind(t.buttons.captions,"click",()=>e.toggleCaptions()),this.bind(t.buttons.download,"click",()=>{se.call(e,e.media,"download")},"download"),this.bind(t.buttons.fullscreen,"click",()=>{e.fullscreen.toggle()},"fullscreen"),this.bind(t.buttons.pip,"click",()=>{e.pip="toggle"},"pip"),this.bind(t.buttons.airplay,"click",e.airplay,"airplay"),this.bind(t.buttons.settings,"click",t=>{t.stopPropagation(),t.preventDefault(),xe.toggleMenu.call(e,t)},null,!1),this.bind(t.buttons.settings,"keyup",t=>{[" ","Enter"].includes(t.key)&&("Enter"!==t.key?(t.preventDefault(),t.stopPropagation(),xe.toggleMenu.call(e,t)):xe.focusFirstMenuItem.call(e,null,!0))},null,!1),this.bind(t.settings.menu,"keydown",t=>{"Escape"===t.key&&xe.toggleMenu.call(e,t)}),this.bind(t.inputs.seek,"mousedown mousemove",e=>{const i=t.progress.getBoundingClientRect(),s=e.pageX-e.clientX,n=100/i.width*(e.pageX-i.left-s);e.currentTarget.setAttribute("seek-value",n)}),this.bind(t.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",t=>{const i=t.currentTarget,s="play-on-seeked";if(x.keyboardEvent(t)&&!["ArrowLeft","ArrowRight"].includes(t.key))return;e.lastSeekTime=Date.now();const n=i.hasAttribute(s),a=["mouseup","touchend","keyup"].includes(t.type);n&&a?(i.removeAttribute(s),re(e.play())):!a&&e.playing&&(i.setAttribute(s,""),e.pause())}),ye.isIos){const t=K.call(e,'input[type="range"]');Array.from(t).forEach(e=>this.bind(e,i,e=>_(e.target)))}this.bind(t.inputs.seek,i,t=>{const i=t.currentTarget;let s=i.getAttribute("seek-value");x.empty(s)&&(s=i.value),i.removeAttribute("seek-value"),e.currentTime=s/i.max*e.duration},"seek"),this.bind(t.progress,"mouseenter mouseleave mousemove",t=>xe.updateSeekTooltip.call(e,t)),this.bind(t.progress,"mousemove touchmove",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startMove(t)}),this.bind(t.progress,"mouseleave touchend click",()=>{const{previewThumbnails:t}=e;t&&t.loaded&&t.endMove(!1,!0)}),this.bind(t.progress,"mousedown touchstart",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.startScrubbing(t)}),this.bind(t.progress,"mouseup touchend",t=>{const{previewThumbnails:i}=e;i&&i.loaded&&i.endScrubbing(t)}),ye.isWebKit&&Array.from(K.call(e,'input[type="range"]')).forEach(t=>{this.bind(t,"input",t=>xe.updateRangeFill.call(e,t.target))}),e.config.toggleInvert&&!x.element(t.display.duration)&&this.bind(t.display.currentTime,"click",()=>{0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,xe.timeUpdate.call(e))}),this.bind(t.inputs.volume,i,t=>{e.volume=t.target.value},"volume"),this.bind(t.controls,"mouseenter mouseleave",i=>{t.controls.hover=!e.touch&&"mouseenter"===i.type}),t.fullscreen&&Array.from(t.fullscreen.children).filter(e=>!e.contains(t.container)).forEach(i=>{this.bind(i,"mouseenter mouseleave",i=>{t.controls&&(t.controls.hover=!e.touch&&"mouseenter"===i.type)})}),this.bind(t.controls,"mousedown mouseup touchstart touchend touchcancel",e=>{t.controls.pressed=["mousedown","touchstart"].includes(e.type)}),this.bind(t.controls,"focusin",()=>{const{config:i,timers:s}=e;B(t.controls,i.classNames.noTransition,!0),Be.toggleControls.call(e,!0),setTimeout(()=>{B(t.controls,i.classNames.noTransition,!1)},0);const n=this.touch?3e3:4e3;clearTimeout(s.controls),s.controls=setTimeout(()=>Be.toggleControls.call(e,!1),n)}),this.bind(t.inputs.volume,"wheel",t=>{const i=t.webkitDirectionInvertedFromDevice,[s,n]=[t.deltaX,-t.deltaY].map(e=>i?-e:e),a=Math.sign(Math.abs(s)>Math.abs(n)?s:n);e.increaseVolume(a/50);const{volume:r}=e.media;(1===a&&r<1||-1===a&&r>0)&&t.preventDefault()},"volume",!1)}),this.player=t,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:t}=this,{elements:i}=t,{key:s,type:n,altKey:a,ctrlKey:r,metaKey:o,shiftKey:l}=e,c="keydown"===n,u=c&&s===this.lastKey;if(a||r||o||l)return;if(!s)return;if(c){const n=document.activeElement;if(x.element(n)){const{editable:s}=t.config.selectors,{seek:a}=i.inputs;if(n!==a&&z(n,s))return;if(" "===e.key&&z(n,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(s)&&(e.preventDefault(),e.stopPropagation()),s){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u||(h=Number.parseInt(s,10),t.currentTime=t.duration/10*h);break;case" ":case"k":u||re(t.togglePlay());break;case"ArrowUp":t.increaseVolume(.1);break;case"ArrowDown":t.decreaseVolume(.1);break;case"m":u||(t.muted=!t.muted);break;case"ArrowRight":t.forward();break;case"ArrowLeft":t.rewind();break;case"f":t.fullscreen.toggle();break;case"c":u||t.toggleCaptions();break;case"l":t.loop=!t.loop}"Escape"===s&&!t.fullscreen.usingNative&&t.fullscreen.active&&t.fullscreen.toggle(),this.lastKey=s}else this.lastKey=null;var h}toggleMenu(e){xe.toggleMenu.call(this.player,e)}}var ze="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ye,Xe={exports:{}};var Qe=(Ye||(Ye=1,function(e){e.exports=function(){var e=function(){},t={},i={},s={};function n(e,t){e=e.push?e:[e];var n,a,r,o=[],l=e.length,c=l;for(n=function(e,i){i.length&&o.push(e),--c||t(o)};l--;)a=e[l],(r=i[a])?n(a,r):(s[a]=s[a]||[]).push(n)}function a(e,t){if(e){var n=s[e];if(i[e]=t,n)for(;n.length;)n[0](e,t),n.splice(0,1)}}function r(t,i){t.call&&(t={success:t}),i.length?(t.error||e)(i):(t.success||e)(t)}function o(t,i,s,n){var a,r,l,c=document,u=s.async,h=(s.numRetries||0)+1,d=s.before||e,m=t.replace(/[\?|#].*$/,""),p=t.replace(/^(css|img|module|nomodule)!/,"");if(n=n||0,/(^css!|\.css$)/.test(m))(l=c.createElement("link")).rel="stylesheet",l.href=p,(a="hideFocus"in l)&&l.relList&&(a=0,l.rel="preload",l.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(m))(l=c.createElement("img")).src=p;else if((l=c.createElement("script")).src=p,l.async=void 0===u||u,r="noModule"in l,/^module!/.test(m)){if(!r)return i(t,"l");l.type="module"}else if(/^nomodule!/.test(m)&&r)return i(t,"l");l.onload=l.onerror=l.onbeforeload=function(e){var r=e.type[0];if(a)try{l.sheet.cssText.length||(r="e")}catch(e){18!=e.code&&(r="e")}if("e"==r){if((n+=1)<h)return o(t,i,s,n)}else if("preload"==l.rel&&"style"==l.as)return l.rel="stylesheet";i(t,r,e.defaultPrevented)},!1!==d(t,l)&&c.head.appendChild(l)}function l(e,t,i){var s,n,a=(e=e.push?e:[e]).length,r=a,l=[];for(s=function(e,i,s){if("e"==i&&l.push(e),"b"==i){if(!s)return;l.push(e)}--a||t(l)},n=0;n<r;n++)o(e[n],s,i)}function c(e,i,s){var n,o;if(i&&i.trim&&(n=i),o=(n?s:i)||{},n){if(n in t)throw"LoadJS";t[n]=!0}function c(t,i){l(e,function(e){r(o,e),t&&r({success:t,error:i},e),a(n,e)},o)}if(o.returnPromise)return new Promise(c);c()}return c.ready=function(e,t){return n(e,function(e){r(t,e)}),c},c.done=function(e){a(e,[])},c.reset=function(){t={},i={},s={}},c.isDefined=function(e){return e in t},c}()}(Xe)),Xe.exports),Je=Ke(Qe);function Ge(e){return new Promise((t,i)=>{Je(e,{success:t,error:i})})}function Ze(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,se.call(this,this.media,e?"play":"pause"))}const et={setup(){const e=this;B(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,pe.call(e),x.object(window.Vimeo)?et.ready.call(e):Ge(e.config.urls.vimeo.sdk).then(()=>{et.ready.call(e)}).catch(t=>{e.debug.warn("Vimeo SDK (player.js) failed to load",t)})},ready(){const e=this,t=e.config.vimeo,{premium:i,referrerPolicy:s,...n}=t;let a=e.media.getAttribute("src"),r="";x.empty(a)?(a=e.media.getAttribute(e.config.attributes.embed.id),r=e.media.getAttribute(e.config.attributes.embed.hash)):r=function(e){const t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}(a);const o=r?{h:r}:{};i&&Object.assign(n,{controls:!1,sidedock:!1});const l=_e({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...o,...n}),c=function(e){if(x.empty(e))return null;if(x.number(Number(e)))return e;const t=e.match(/^.*(vimeo.com\/|video\/)(\d+).*/);return t?t[2]:e}(a),u=R("iframe"),h=be(e.config.urls.vimeo.iframe,c,l);if(u.setAttribute("src",h),u.setAttribute("allowfullscreen",""),u.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),x.empty(s)||u.setAttribute("referrerPolicy",s),i||!t.customControls)u.setAttribute("data-poster",e.poster),e.media=F(u,e.media);else{const t=R("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});t.appendChild(u),e.media=F(t,e.media)}t.customControls||Ae(be(e.config.urls.vimeo.api,h)).then(t=>{!x.empty(t)&&t.thumbnail_url&&Be.setPoster.call(e,t.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(u,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(Ze.call(e,!0),e.embed.play()),e.media.pause=()=>(Ze.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:d}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>d,set(t){const{embed:i,media:s,paused:n,volume:a}=e,r=n&&!i.hasPlayed;s.seeking=!0,se.call(e,s,"seeking"),Promise.resolve(r&&i.setVolume(0)).then(()=>i.setCurrentTime(t)).then(()=>r&&i.pause()).then(()=>r&&i.setVolume(a)).catch(()=>{})}});let m=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>m,set(t){e.embed.setPlaybackRate(t).then(()=>{m=t,se.call(e,e.media,"ratechange")}).catch(()=>{e.options.speed=[1]})}});let{volume:p}=e.config;Object.defineProperty(e.media,"volume",{get:()=>p,set(t){e.embed.setVolume(t).then(()=>{p=t,se.call(e,e.media,"volumechange")})}});let{muted:g}=e.config;Object.defineProperty(e.media,"muted",{get:()=>g,set(t){const i=!!x.boolean(t)&&t;e.embed.setMuted(!!i||e.config.muted).then(()=>{g=i,se.call(e,e.media,"volumechange")})}});let f,{loop:y}=e.config;Object.defineProperty(e.media,"loop",{get:()=>y,set(t){const i=x.boolean(t)?t:e.config.loop.active;e.embed.setLoop(i).then(()=>{y=i})}}),e.embed.getVideoUrl().then(t=>{f=t,xe.setDownloadUrl.call(e)}).catch(e=>{this.debug.warn(e)}),Object.defineProperty(e.media,"currentSrc",{get:()=>f}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(t=>{const[i,s]=t;e.embed.ratio=ge(i,s),pe.call(this)}),e.embed.setAutopause(e.config.autopause).then(t=>{e.config.autopause=t}),e.embed.getVideoTitle().then(t=>{e.config.title=t,Be.setTitle.call(this)}),e.embed.getCurrentTime().then(t=>{d=t,se.call(e,e.media,"timeupdate")}),e.embed.getDuration().then(t=>{e.media.duration=t,se.call(e,e.media,"durationchange")}),e.embed.getTextTracks().then(t=>{e.media.textTracks=t,Ie.setup.call(e)}),e.embed.on("cuechange",({cues:t=[]})=>{const i=t.map(e=>function(e){const t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.textContent}(e.text));Ie.updateCues.call(e,i)}),e.embed.on("loaded",()=>{if(e.embed.getPaused().then(t=>{Ze.call(e,!t),t||se.call(e,e.media,"playing")}),x.element(e.embed.element)&&e.supported.ui){e.embed.element.setAttribute("tabindex",-1)}}),e.embed.on("bufferstart",()=>{se.call(e,e.media,"waiting")}),e.embed.on("bufferend",()=>{se.call(e,e.media,"playing")}),e.embed.on("play",()=>{Ze.call(e,!0),se.call(e,e.media,"playing")}),e.embed.on("pause",()=>{Ze.call(e,!1)}),e.embed.on("timeupdate",t=>{e.media.seeking=!1,d=t.seconds,se.call(e,e.media,"timeupdate")}),e.embed.on("progress",t=>{e.media.buffered=t.percent,se.call(e,e.media,"progress"),1===Number.parseInt(t.percent,10)&&se.call(e,e.media,"canplaythrough"),e.embed.getDuration().then(t=>{t!==e.media.duration&&(e.media.duration=t,se.call(e,e.media,"durationchange"))})}),e.embed.on("seeked",()=>{e.media.seeking=!1,se.call(e,e.media,"seeked")}),e.embed.on("ended",()=>{e.media.paused=!0,se.call(e,e.media,"ended")}),e.embed.on("error",t=>{e.media.error=t,se.call(e,e.media,"error")}),t.customControls&&setTimeout(()=>Be.build.call(e),0)}};function tt(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,se.call(this,this.media,e?"play":"pause"))}function it(e){return e.noCookie?"https://www.youtube-nocookie.com":"http:"===window.location.protocol?"http://www.youtube.com":void 0}const st={setup(){if(B(this.elements.wrapper,this.config.classNames.embed,!0),x.object(window.YT)&&x.function(window.YT.Player))st.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{x.function(e)&&e(),st.ready.call(this)},Ge(this.config.urls.youtube.sdk).catch(e=>{this.debug.warn("YouTube API failed to load",e)})}},getTitle(e){Ae(be(this.config.urls.youtube.api,e)).then(e=>{if(x.object(e)){const{title:t,height:i,width:s}=e;this.config.title=t,Be.setTitle.call(this),this.embed.ratio=ge(s,i)}pe.call(this)}).catch(()=>{pe.call(this)})},ready(){const e=this,t=e.config.youtube,i=e.media&&e.media.getAttribute("id");if(!x.empty(i)&&i.startsWith("youtube-"))return;let s=e.media.getAttribute("src");x.empty(s)&&(s=e.media.getAttribute(this.config.attributes.embed.id));const n=function(e){if(x.empty(e))return null;const t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/);return t&&t[2]?t[2]:e}(s);const a=R("div",{id:`${e.provider}-${Math.floor(1e4*Math.random())}`,"data-poster":t.customControls?e.poster:void 0});if(e.media=F(a,e.media),t.customControls){const t=e=>`https://i.ytimg.com/vi/${n}/${e}default.jpg`;Ue(t("maxres"),121).catch(()=>Ue(t("sd"),121)).catch(()=>Ue(t("hq"))).then(t=>Be.setPoster.call(e,t.src)).then(t=>{t.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:n,host:it(t),playerVars:O({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&t.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},t),events:{onError(t){if(!e.media.error){const i=t.data,s={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[i]||"An unknown error occurred";e.media.error={code:i,message:s},se.call(e,e.media,"error")}},onPlaybackRateChange(t){const i=t.target;e.media.playbackRate=i.getPlaybackRate(),se.call(e,e.media,"ratechange")},onReady(i){if(x.function(e.media.play))return;const s=i.target;st.getTitle.call(e,n),e.media.play=()=>{tt.call(e,!0),s.playVideo()},e.media.pause=()=>{tt.call(e,!1),s.pauseVideo()},e.media.stop=()=>{s.stopVideo()},e.media.duration=s.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(s.getCurrentTime()),set(t){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,se.call(e,e.media,"seeking"),s.seekTo(t)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>s.getPlaybackRate(),set(e){s.setPlaybackRate(e)}});let{volume:a}=e.config;Object.defineProperty(e.media,"volume",{get:()=>a,set(t){a=t,s.setVolume(100*a),se.call(e,e.media,"volumechange")}});let{muted:r}=e.config;Object.defineProperty(e.media,"muted",{get:()=>r,set(t){const i=x.boolean(t)?t:r;r=i,s[i?"mute":"unMute"](),s.setVolume(100*a),se.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>s.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const o=s.getAvailablePlaybackRates();e.options.speed=o.filter(t=>e.config.speed.options.includes(t)),e.supported.ui&&t.customControls&&e.media.setAttribute("tabindex",-1),se.call(e,e.media,"timeupdate"),se.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(()=>{e.media.buffered=s.getVideoLoadedFraction(),(null===e.media.lastBuffered||e.media.lastBuffered<e.media.buffered)&&se.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,1===e.media.buffered&&(clearInterval(e.timers.buffering),se.call(e,e.media,"canplaythrough"))},200),t.customControls&&setTimeout(()=>Be.build.call(e),50)},onStateChange(i){const s=i.target;clearInterval(e.timers.playing);switch(e.media.seeking&&[1,2].includes(i.data)&&(e.media.seeking=!1,se.call(e,e.media,"seeked")),i.data){case-1:se.call(e,e.media,"timeupdate"),e.media.buffered=s.getVideoLoadedFraction(),se.call(e,e.media,"progress");break;case 0:tt.call(e,!1),e.media.loop?(s.stopVideo(),s.playVideo()):se.call(e,e.media,"ended");break;case 1:t.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(tt.call(e,!0),se.call(e,e.media,"playing"),e.timers.playing=setInterval(()=>{se.call(e,e.media,"timeupdate")},50),e.media.duration!==s.getDuration()&&(e.media.duration=s.getDuration(),se.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),tt.call(e,!1);break;case 3:se.call(e,e.media,"waiting")}se.call(e,e.elements.container,"statechange",!1,{code:i.data})}}})}},nt={setup(){this.media?(B(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),B(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&B(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=R("div",{class:this.config.classNames.video}),$(this.media,this.elements.wrapper),this.elements.poster=R("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?fe.setup.call(this):this.isYouTube?st.setup.call(this):this.isVimeo&&et.setup.call(this)):this.debug.warn("No media element found!")}};class at{constructor(t){e(this,"load",()=>{this.enabled&&(x.object(window.google)&&x.object(window.google.ima)?this.ready():Ge(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),e(this,"ready",()=>{var e;this.enabled||((e=this).manager&&e.manager.destroy(),e.elements.displayContainer&&e.elements.displayContainer.destroy(),e.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),e(this,"setupIMA",()=>{this.elements.container=R("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,e=>this.onAdsManagerLoaded(e),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,e=>this.onAdError(e),!1),this.requestAds()}),e(this,"requestAds",()=>{const{container:e}=this.player.elements;try{const t=new google.ima.AdsRequest;t.adTagUrl=this.tagUrl,t.linearAdSlotWidth=e.offsetWidth,t.linearAdSlotHeight=e.offsetHeight,t.nonLinearAdSlotWidth=e.offsetWidth,t.nonLinearAdSlotHeight=e.offsetHeight,t.forceNonLinearFullSlot=!1,t.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(t)}catch(e){this.onAdError(e)}}),e(this,"pollCountdown",(e=!1)=>{if(!e)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(()=>{const e=Ne(Math.max(this.manager.getRemainingTime(),0)),t=`${Ee.get("advertisement",this.player.config)} - ${e}`;this.elements.container.setAttribute("data-badge-text",t)},100)}),e(this,"onAdsManagerLoaded",e=>{if(!this.enabled)return;const t=new google.ima.AdsRenderingSettings;t.restoreCustomPlaybackStateOnAdBreakComplete=!0,t.enablePreloading=!0,this.manager=e.getAdsManager(this.player,t),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,e=>this.onAdError(e)),Object.keys(google.ima.AdEvent.Type).forEach(e=>{this.manager.addEventListener(google.ima.AdEvent.Type[e],e=>this.onAdEvent(e))}),this.trigger("loaded")}),e(this,"addCuePoints",()=>{x.empty(this.cuePoints)||this.cuePoints.forEach(e=>{if(0!==e&&-1!==e&&e<this.player.duration){const t=this.player.elements.progress;if(x.element(t)){const i=100/this.player.duration*e,s=R("span",{class:this.player.config.classNames.cues});s.style.left=`${i.toString()}%`,t.appendChild(s)}}})}),e(this,"onAdEvent",e=>{const{container:t}=this.player.elements,i=e.getAd(),s=e.getAdData();switch((e=>{se.call(this.player,this.player.media,`ads${e.replace(/_/g,"").toLowerCase()}`)})(e.type),e.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),i.isLinear()||(i.width=t.offsetWidth,i.height=t.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:s.adError&&this.player.debug.warn(`Non-fatal ad error: ${s.adError.getMessage()}`)}}),e(this,"onAdError",e=>{this.cancel(),this.player.debug.warn("Ads error",e)}),e(this,"listeners",()=>{const{container:e}=this.player.elements;let t;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{t=this.player.currentTime}),this.player.on("seeked",()=>{const e=this.player.currentTime;x.empty(this.cuePoints)||this.cuePoints.forEach((i,s)=>{t<i&&i<e&&(this.manager.discardAdBreak(),this.cuePoints.splice(s,1))})}),window.addEventListener("resize",()=>{this.manager&&this.manager.resize(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL)})}),e(this,"play",()=>{const{container:e}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(e.offsetWidth,e.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(e){this.onAdError(e)}}).catch(()=>{})}),e(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,re(this.player.media.play())}),e(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),e(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),e(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(e=>{this.on("loaded",e),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),e(this,"trigger",(e,...t)=>{const i=this.events[e];x.array(i)&&i.forEach(e=>{x.function(e)&&e.apply(this,t)})}),e(this,"on",(e,t)=>(x.array(this.events[e])||(this.events[e]=[]),this.events[e].push(t),this)),e(this,"startSafetyTimer",(e,t)=>{this.player.debug.log(`Safety timer invoked from: ${t}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},e)}),e(this,"clearSafetyTimer",e=>{x.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${e}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=t,this.config=t.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((e,t)=>{this.on("loaded",e),this.on("error",t)}),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!x.empty(e.publisherId)||x.url(e.tagUrl))}get tagUrl(){const{config:e}=this;if(x.url(e.tagUrl))return e.tagUrl;return`https://go.aniview.com/api/adserver6/vast/?${_e({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function rt(e=0,t=0,i=255){return Math.min(Math.max(e,t),i)}function ot(e){const t=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach(e=>{const i={};e.split(/\r\n|\n|\r/).forEach(e=>{if(x.number(i.startTime)){if(!x.empty(e.trim())&&x.empty(i.text)){const t=e.trim().split("#xywh=");[i.text]=t,t[1]&&([i.x,i.y,i.w,i.h]=t[1].split(","))}}else{const t=e.match(/(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})( ?--> ?)(\d{2})?:?(\d{2}):(\d{2}).(\d{2,3})/);t&&(i.startTime=60*Number(t[1]||0)*60+60*Number(t[2])+Number(t[3])+Number(`0.${t[4]}`),i.endTime=60*Number(t[6]||0)*60+60*Number(t[7])+Number(t[8])+Number(`0.${t[9]}`))}}),i.text&&t.push(i)}),t}function lt(e,t){const i={};return e>t.width/t.height?(i.width=t.width,i.height=1/e*t.width):(i.height=t.height,i.width=e*t.height),i}class ct{constructor(t){e(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),e(this,"getThumbnails",()=>new Promise(e=>{const{src:t}=this.player.config.previewThumbnails;if(x.empty(t))throw new Error("Missing previewThumbnails.src config attribute");const i=()=>{this.thumbnails.sort((e,t)=>e.height-t.height),this.player.debug.log("Preview thumbnails",this.thumbnails),e()};if(x.function(t))t(e=>{this.thumbnails=e,i()});else{const e=(x.string(t)?[t]:t).map(e=>this.getThumbnail(e));Promise.all(e).then(i)}})),e(this,"getThumbnail",e=>new Promise(t=>{Ae(e,void 0,this.player.config.previewThumbnails.withCredentials).then(i=>{const s={frames:ot(i),height:null,urlPrefix:""};s.frames[0].text.startsWith("/")||s.frames[0].text.startsWith("http://")||s.frames[0].text.startsWith("https://")||(s.urlPrefix=e.substring(0,e.lastIndexOf("/")+1));const n=new Image;n.onload=()=>{s.height=n.naturalHeight,s.width=n.naturalWidth,this.thumbnails.push(s),t()},n.src=s.urlPrefix+s.frames[0].text})})),e(this,"startMove",e=>{if(this.loaded&&x.event(e)&&["touchmove","mousemove"].includes(e.type)&&this.player.media.duration){if("touchmove"===e.type)this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var t,i;const s=this.player.elements.progress.getBoundingClientRect(),n=100/s.width*(e.pageX-s.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=e.pageX,this.elements.thumb.time.textContent=Ne(this.seekTime);const a=null===(t=this.player.config.markers)||void 0===t||null===(i=t.points)||void 0===i?void 0:i.find(({time:e})=>e===Math.round(this.seekTime));a&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${a.label}<br>`)}this.showImageAtCurrentTime()}}),e(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),e(this,"startScrubbing",e=>{(x.nullOrUndefined(e.button)||!1===e.button||0===e.button)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),e(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):ie.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),e(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),e(this,"render",()=>{this.elements.thumb.container=R("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=R("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const e=R("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=R("span",{},"00:00"),e.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(e),x.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=R("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),e(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),e(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const e=this.thumbnails[0].frames.findIndex(e=>this.seekTime>=e.startTime&&this.seekTime<=e.endTime),t=e>=0;let i=0;this.mouseDown||this.toggleThumbContainer(t),t&&(this.thumbnails.forEach((t,s)=>{this.loadedImages.includes(t.frames[e].text)&&(i=s)}),e!==this.showingThumb&&(this.showingThumb=e,this.loadImage(i)))}),e(this,"loadImage",(e=0)=>{const t=this.showingThumb,i=this.thumbnails[e],{urlPrefix:s}=i,n=i.frames[t],a=i.frames[t].text,r=s+a;if(this.currentImageElement&&this.currentImageElement.dataset.filename===a)this.showImage(this.currentImageElement,n,e,t,a,!1),this.currentImageElement.dataset.index=t,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const i=new Image;i.src=r,i.dataset.index=t,i.dataset.filename=a,this.showingThumbFilename=a,this.player.debug.log(`Loading image: ${r}`),i.onload=()=>this.showImage(i,n,e,t,a,!0),this.loadingImage=i,this.removeOldImages(i)}}),e(this,"showImage",(e,t,i,s,n,a=!0)=>{this.player.debug.log(`Showing thumb: ${n}. num: ${s}. qual: ${i}. newimg: ${a}`),this.setImageSizeAndOffset(e,t),a&&(this.currentImageContainer.appendChild(e),this.currentImageElement=e,this.loadedImages.includes(n)||this.loadedImages.push(n)),this.preloadNearby(s,!0).then(this.preloadNearby(s,!1)).then(this.getHigherQuality(i,e,t,n))}),e(this,"removeOldImages",e=>{Array.from(this.currentImageContainer.children).forEach(t=>{if("img"!==t.tagName.toLowerCase())return;const i=this.usingSprites?500:1e3;if(t.dataset.index!==e.dataset.index&&!t.dataset.deleting){t.dataset.deleting=!0;const{currentImageContainer:e}=this;setTimeout(()=>{e.removeChild(t),this.player.debug.log(`Removing thumb: ${t.dataset.filename}`)},i)}})}),e(this,"preloadNearby",(e,t=!0)=>new Promise(i=>{setTimeout(()=>{const s=this.thumbnails[0].frames[e].text;if(this.showingThumbFilename===s){let n;n=t?this.thumbnails[0].frames.slice(e):this.thumbnails[0].frames.slice(0,e).reverse();let a=!1;n.forEach(e=>{const t=e.text;if(t!==s&&!this.loadedImages.includes(t)){a=!0,this.player.debug.log(`Preloading thumb filename: ${t}`);const{urlPrefix:e}=this.thumbnails[0],s=e+t,n=new Image;n.src=s,n.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${t}`),this.loadedImages.includes(t)||this.loadedImages.push(t),i()}}}),a||i()}},300)})),e(this,"getHigherQuality",(e,t,i,s)=>{if(e<this.thumbnails.length-1){let n=t.naturalHeight;this.usingSprites&&(n=i.h),n<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===s&&(this.player.debug.log(`Showing higher quality thumb for: ${s}`),this.loadImage(e+1))},300)}}),e(this,"toggleThumbContainer",(e=!1,t=!1)=>{const i=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(i,e),!e&&t&&(this.showingThumb=null,this.showingThumbFilename=null)}),e(this,"toggleScrubbingContainer",(e=!1)=>{const t=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(t,e),e||(this.showingThumb=null,this.showingThumbFilename=null)}),e(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),e(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:e}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(e.clientHeight>20&&e.clientWidth<20){const t=Math.floor(e.clientHeight*this.thumbAspectRatio);e.style.width=`${t}px`}else if(e.clientHeight<20&&e.clientWidth>20){const t=Math.floor(e.clientWidth/this.thumbAspectRatio);e.style.height=`${t}px`}}else{const t=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);e.style.height=`${this.thumbContainerHeight}px`,e.style.width=`${t}px`}this.setThumbContainerPos()}),e(this,"setThumbContainerPos",()=>{const e=this.player.elements.progress.getBoundingClientRect(),t=this.player.elements.container.getBoundingClientRect(),{container:i}=this.elements.thumb,s=t.left-e.left+10,n=t.right-e.left-i.clientWidth-10,a=this.mousePosX-e.left-i.clientWidth/2,r=rt(a,s,n);i.style.left=`${r}px`,i.style.setProperty("--preview-arrow-offset",a-r+"px")}),e(this,"setScrubbingContainerSize",()=>{const{width:e,height:t}=lt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${e}px`,this.elements.scrubbing.container.style.height=`${t}px`}),e(this,"setImageSizeAndOffset",(e,t)=>{if(!this.usingSprites)return;const i=this.thumbContainerHeight/t.h;e.style.height=e.naturalHeight*i+"px",e.style.width=e.naturalWidth*i+"px",e.style.left=`-${t.x*i}px`,e.style.top=`-${t.y*i}px`}),this.player=t,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=lt(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const ut={insertElements(e,t){x.string(t)?D(e,this.media,{src:t}):x.array(t)&&t.forEach(t=>{D(e,this.media,t)})},change(e){I(e,"sources.length")?(fe.cancelRequests.call(this),this.destroy(()=>{this.options.quality=[],q(this.media),this.media=null,x.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:t,type:i}=e,[{provider:s=Re.html5,src:n}]=t,a="html5"===s?i:"div",r="html5"===s?{}:{src:n};Object.assign(this,{provider:s,type:i,supported:J.check(i,s,this.config.playsinline),media:R(a,r)}),this.elements.container.appendChild(this.media),x.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),x.empty(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Be.addStyleHook.call(this),this.isHTML5&&ut.insertElements.call(this,"source",t),this.config.title=e.title,nt.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&ut.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Be.build.call(this),this.isHTML5&&this.media.load(),x.empty(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ct(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};class ht{constructor(t,i){if(e(this,"play",()=>x.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>re(this.media.play())),this.media.play()):null),e(this,"pause",()=>this.playing&&x.function(this.media.pause)?this.media.pause():null),e(this,"togglePlay",e=>(x.boolean(e)?e:!this.playing)?this.play():this.pause()),e(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):x.function(this.media.stop)&&this.media.stop()}),e(this,"restart",()=>{this.currentTime=0}),e(this,"rewind",e=>{this.currentTime-=x.number(e)?e:this.config.seekTime}),e(this,"forward",e=>{this.currentTime+=x.number(e)?e:this.config.seekTime}),e(this,"increaseVolume",e=>{const t=this.media.muted?0:this.volume;this.volume=t+(x.number(e)?e:0)}),e(this,"decreaseVolume",e=>{this.increaseVolume(-e)}),e(this,"airplay",()=>{J.airplay&&this.media.webkitShowPlaybackTargetPicker()}),e(this,"toggleControls",e=>{if(this.supported.ui&&!this.isAudio){const t=W(this.elements.container,this.config.classNames.hideControls),i=void 0===e?void 0:!e,s=B(this.elements.container,this.config.classNames.hideControls,i);if(s&&x.array(this.config.controls)&&this.config.controls.includes("settings")&&!x.empty(this.config.settings)&&xe.toggleMenu.call(this,!1),s!==t){const e=s?"controlshidden":"controlsshown";se.call(this,this.media,e)}return!s}return!1}),e(this,"on",(e,t)=>{ee.call(this,this.elements.container,e,t)}),e(this,"once",(e,t)=>{ie.call(this,this.elements.container,e,t)}),e(this,"off",(e,t)=>{te(this.elements.container,e,t)}),e(this,"destroy",(e,t=!1)=>{if(!this.ready)return;const i=()=>{document.body.style.overflow="",this.embed=null,t?(Object.keys(this.elements).length&&(q(this.elements.buttons.play),q(this.elements.captions),q(this.elements.controls),q(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),x.function(e)&&e()):(ne.call(this),fe.cancelRequests.call(this),F(this.elements.original,this.elements.container),se.call(this,this.elements.original,"destroyed",!0),x.function(e)&&e.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Be.toggleNativeControls.call(this,!0),i()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),null!==this.embed&&x.function(this.embed.destroy)&&this.embed.destroy(),i()):this.isVimeo&&(null!==this.embed&&this.embed.unload().then(i),setTimeout(i,200))}),e(this,"supports",e=>J.mime.call(this,e)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=J.touch,this.media=t,x.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||x.nodeList(this.media)||x.array(this.media))&&(this.media=this.media[0]),this.config=O({},Oe,ht.defaults,i||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new Fe(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",J),x.nullOrUndefined(this.media)||!x.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!J.check().api)return void this.debug.error("Setup failed: no support");const s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;const n=this.media.tagName.toLowerCase();let a=null,r=null;switch(n){case"div":if(a=this.media.querySelector("iframe"),x.element(a)){if(r=Le(a.getAttribute("src")),this.provider=function(e){return/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?Re.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?Re.vimeo:null}(r.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",r.search.length){const e=["1","true"];e.includes(r.searchParams.get("autoplay"))&&(this.config.autoplay=!0),e.includes(r.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=e.includes(r.searchParams.get("playsinline")),this.config.youtube.hl=r.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(x.empty(this.provider)||!Object.values(Re).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=qe;break;case"video":case"audio":this.type=n,this.provider=Re.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=J.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new We(this),this.storage=new Se(this),this.media.plyr=this,x.element(this.elements.container)||(this.elements.container=R("div"),$(this.media,this.elements.container)),Be.migrateStyles.call(this),Be.addStyleHook.call(this),nt.setup.call(this),this.config.debug&&ee.call(this,this.elements.container,this.config.events.join(" "),e=>{this.debug.log(`event: ${e.type}`)}),this.fullscreen=new Ve(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Be.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new at(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>re(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ct(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===Re.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===Re.youtube}get isVimeo(){return this.provider===Re.vimeo}get isVideo(){return this.type===qe}get isAudio(){return this.type===De}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&0===this.currentTime)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const t=x.number(e)&&e>0;this.media.currentTime=t?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return x.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=Number.parseFloat(this.config.duration),t=(this.media||{}).duration,i=x.number(t)&&t!==1/0?t:0;return e||i}set volume(e){let t=e;x.string(t)&&(t=Number(t)),x.number(t)||(t=this.storage.get("volume")),x.number(t)||({volume:t}=this.config),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,!x.empty(e)&&this.muted&&t>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let t=e;x.boolean(t)||(t=this.storage.get("muted")),x.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||(!!this.isAudio||(Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)))}set speed(e){let t=null;x.number(e)&&(t=e),x.number(t)||(t=this.storage.get("speed")),x.number(t)||(t=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:s}=this;t=rt(t,i,s),this.config.speed.selected=t,setTimeout(()=>{this.media&&(this.media.playbackRate=t)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const t=this.config.quality,i=this.options.quality;if(!i.length)return;let s=[!x.empty(e)&&Number(e),this.storage.get("quality"),t.selected,t.default].find(x.number),n=!0;if(!i.includes(s)){const e=le(i,s);this.debug.warn(`Unsupported quality option: ${s}, using ${e} instead`),s=e,n=!1}t.selected=s,this.media.quality=s,n&&this.storage.set({quality:s})}get quality(){return this.media.quality}set loop(e){const t=x.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t}get loop(){return Boolean(this.media.loop)}set source(e){ut.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return x.url(e)?e:this.source}set download(e){x.url(e)&&(this.config.urls.download=e,xe.setDownloadUrl.call(this))}set poster(e){this.isVideo?Be.setPoster.call(this,e,!1).catch(()=>{}):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=de(me.call(this));return x.array(e)?e.join(":"):e}set ratio(e){this.isVideo?x.string(e)&&he(e)?(this.config.ratio=de(e),pe.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=x.boolean(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){Ie.toggle.call(this,e,!1)}set currentTrack(e){Ie.set.call(this,e,!1),Ie.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:t}=this.captions;return e?t:-1}set language(e){Ie.setLanguage.call(this,e,!1)}get language(){return(Ie.getCurrentTrack.call(this)||{}).language}set pip(e){if(!J.pip)return;const t=x.boolean(e)?e:!this.pip;x.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(t?$e:je),x.function(this.media.requestPictureInPicture)&&(!this.pip&&t?this.media.requestPictureInPicture():this.pip&&!t&&document.exitPictureInPicture())}get pip(){return J.pip?x.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===$e:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new ct(this))}static supported(e,t){return J.check(e,t)}static loadSprite(e,t){return Pe(e,t)}static setup(e,t={}){let i=null;return x.string(e)?i=Array.from(document.querySelectorAll(e)):x.nodeList(e)?i=Array.from(e):x.array(e)&&(i=e.filter(x.element)),x.empty(i)?null:i.map(e=>new ht(e,t))}}var dt;ht.defaults=(dt=Oe,JSON.parse(JSON.stringify(dt))),function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var i,s;return(t=t||{}).bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,(i=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),s=i.preventDefault,i.preventDefault=function(){s.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},i};t.prototype=window.Event.prototype,window.CustomEvent=t}}();var mt,pt={};return mt||(mt=1,function(e){var t=function(){try{return!!Symbol.iterator}catch(e){return!1}}(),i=function(e){var i={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t&&(i[Symbol.iterator]=function(){return i}),i},s=function(e){return encodeURIComponent(e).replace(/%20/g,"+")},n=function(e){return decodeURIComponent(String(e).replace(/\+/g," "))};(function(){try{var t=e.URLSearchParams;return"a=1"===new t("?a=1").toString()&&"function"==typeof t.prototype.set&&"function"==typeof t.prototype.entries}catch(e){return!1}})()||function(){var n=function(e){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var t=typeof e;if("undefined"===t);else if("string"===t)""!==e&&this._fromString(e);else if(e instanceof n){var i=this;e.forEach(function(e,t){i.append(t,e)})}else{if(null===e||"object"!==t)throw new TypeError("Unsupported input's type for URLSearchParams");if("[object Array]"===Object.prototype.toString.call(e))for(var s=0;s<e.length;s++){var a=e[s];if("[object Array]"!==Object.prototype.toString.call(a)&&2===a.length)throw new TypeError("Expected [string, any] as entry at index "+s+" of URLSearchParams's input");this.append(a[0],a[1])}else for(var r in e)e.hasOwnProperty(r)&&this.append(r,e[r])}},a=n.prototype;a.append=function(e,t){e in this._entries?this._entries[e].push(String(t)):this._entries[e]=[String(t)]},a.delete=function(e){delete this._entries[e]},a.get=function(e){return e in this._entries?this._entries[e][0]:null},a.getAll=function(e){return e in this._entries?this._entries[e].slice(0):[]},a.has=function(e){return e in this._entries},a.set=function(e,t){this._entries[e]=[String(t)]},a.forEach=function(e,t){var i;for(var s in this._entries)if(this._entries.hasOwnProperty(s)){i=this._entries[s];for(var n=0;n<i.length;n++)e.call(t,i[n],s,this)}},a.keys=function(){var e=[];return this.forEach(function(t,i){e.push(i)}),i(e)},a.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),i(e)},a.entries=function(){var e=[];return this.forEach(function(t,i){e.push([i,t])}),i(e)},t&&(a[Symbol.iterator]=a.entries),a.toString=function(){var e=[];return this.forEach(function(t,i){e.push(s(i)+"="+s(t))}),e.join("&")},Object.defineProperty(a,"size",{get:function(){return this._entries?Object.keys(this._entries).length:0}}),e.URLSearchParams=n}();var a=e.URLSearchParams.prototype;"function"!=typeof a.sort&&(a.sort=function(){var e=this,t=[];this.forEach(function(i,s){t.push([s,i]),e._entries||e.delete(s)}),t.sort(function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}),e._entries&&(e._entries={});for(var i=0;i<t.length;i++)this.append(t[i][0],t[i][1])}),"function"!=typeof a._fromString&&Object.defineProperty(a,"_fromString",{enumerable:!1,configurable:!1,writable:!1,value:function(e){if(this._entries)this._entries={};else{var t=[];this.forEach(function(e,i){t.push(i)});for(var i=0;i<t.length;i++)this.delete(t[i])}var s,a=(e=e.replace(/^\?/,"")).split("&");for(i=0;i<a.length;i++)s=a[i].split("="),this.append(n(s[0]),s.length>1?n(s.slice(1).join("=")):"")}})}(void 0!==ze?ze:"undefined"!=typeof window?window:"undefined"!=typeof self?self:pt),function(e){if(function(){try{var t=new e.URL("b","http://a");return t.pathname="c d","http://a/c%20d"===t.href&&t.searchParams}catch(e){return!1}}()||function(){var t=e.URL,i=function(t,i){"string"!=typeof t&&(t=String(t)),i&&"string"!=typeof i&&(i=String(i));var s,n=document;if(i&&(void 0===e.location||i!==e.location.href)){i=i.toLowerCase(),(s=(n=document.implementation.createHTMLDocument("")).createElement("base")).href=i,n.head.appendChild(s);try{if(0!==s.href.indexOf(i))throw new Error(s.href)}catch(e){throw new Error("URL unable to set base "+i+" due to "+e)}}var a=n.createElement("a");a.href=t,s&&(n.body.appendChild(a),a.href=a.href);var r=n.createElement("input");if(r.type="url",r.value=t,":"===a.protocol||!/:/.test(a.href)||!r.checkValidity()&&!i)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:a});var o=new e.URLSearchParams(this.search),l=!0,c=!0,u=this;["append","delete","set"].forEach(function(e){var t=o[e];o[e]=function(){t.apply(o,arguments),l&&(c=!1,u.search=o.toString(),c=!0)}}),Object.defineProperty(this,"searchParams",{value:o,enumerable:!0});var h=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==h&&(h=this.search,c&&(l=!1,this.searchParams._fromString(this.search),l=!0))}})},s=i.prototype;["hash","host","hostname","port","protocol"].forEach(function(e){!function(e){Object.defineProperty(s,e,{get:function(){return this._anchorElement[e]},set:function(t){this._anchorElement[e]=t},enumerable:!0})}(e)}),Object.defineProperty(s,"search",{get:function(){return this._anchorElement.search},set:function(e){this._anchorElement.search=e,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(s,{toString:{get:function(){var e=this;return function(){return e.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(e){this._anchorElement.href=e,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(e){this._anchorElement.pathname=e},enumerable:!0},origin:{get:function(){var e={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],t=this._anchorElement.port!=e&&""!==this._anchorElement.port;return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(t?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(e){},enumerable:!0},username:{get:function(){return""},set:function(e){},enumerable:!0}}),i.createObjectURL=function(e){return t.createObjectURL.apply(t,arguments)},i.revokeObjectURL=function(e){return t.revokeObjectURL.apply(t,arguments)},e.URL=i}(),void 0!==e.location&&!("origin"in e.location)){var t=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:t,enumerable:!0})}catch(i){setInterval(function(){e.location.origin=t()},100)}}}(void 0!==ze?ze:"undefined"!=typeof window?window:"undefined"!=typeof self?self:pt)),ht});
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(e){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof i?new i(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function e(n,t){var r,i;switch(t=t||{},a.util.type(n)){case"Object":if(i=a.util.objId(n),t[i])return t[i];for(var l in r={},t[i]=r,n)n.hasOwnProperty(l)&&(r[l]=e(n[l],t));return r;case"Array":return i=a.util.objId(n),t[i]?t[i]:(r=[],t[i]=r,n.forEach((function(n,a){r[a]=e(n,t)})),r);default:return n}},getLanguage:function(e){for(;e;){var t=n.exec(e.className);if(t)return t[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,t){e.className=e.className.replace(RegExp(n,"gi"),""),e.classList.add("language-"+t)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var n=document.getElementsByTagName("script");for(var t in n)if(n[t].src==e)return n[t]}return null}},isActive:function(e,n,t){for(var r="no-"+n;e;){var a=e.classList;if(a.contains(n))return!0;if(a.contains(r))return!1;e=e.parentElement}return!!t}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,n){var t=a.util.clone(a.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(e,n,t,r){var i=(r=r||a.languages)[e],l={};for(var o in i)if(i.hasOwnProperty(o)){if(o==n)for(var s in t)t.hasOwnProperty(s)&&(l[s]=t[s]);t.hasOwnProperty(o)||(l[o]=i[o])}var u=r[e];return r[e]=l,a.languages.DFS(a.languages,(function(n,t){t===u&&n!=e&&(this[n]=l)})),l},DFS:function e(n,t,r,i){i=i||{};var l=a.util.objId;for(var o in n)if(n.hasOwnProperty(o)){t.call(n,o,n[o],r||o);var s=n[o],u=a.util.type(s);"Object"!==u||i[l(s)]?"Array"!==u||i[l(s)]||(i[l(s)]=!0,e(s,t,o,i)):(i[l(s)]=!0,e(s,t,null,i))}}},plugins:{},highlightAll:function(e,n){a.highlightAllUnder(document,e,n)},highlightAllUnder:function(e,n,t){var r={callback:t,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),a.hooks.run("before-all-elements-highlight",r);for(var i,l=0;i=r.elements[l++];)a.highlightElement(i,!0===n,r.callback)},highlightElement:function(n,t,r){var i=a.util.getLanguage(n),l=a.languages[i];a.util.setLanguage(n,i);var o=n.parentElement;o&&"pre"===o.nodeName.toLowerCase()&&a.util.setLanguage(o,i);var s={element:n,language:i,grammar:l,code:n.textContent};function u(e){s.highlightedCode=e,a.hooks.run("before-insert",s),s.element.innerHTML=s.highlightedCode,a.hooks.run("after-highlight",s),a.hooks.run("complete",s),r&&r.call(s.element)}if(a.hooks.run("before-sanity-check",s),(o=s.element.parentElement)&&"pre"===o.nodeName.toLowerCase()&&!o.hasAttribute("tabindex")&&o.setAttribute("tabindex","0"),!s.code)return a.hooks.run("complete",s),void(r&&r.call(s.element));if(a.hooks.run("before-highlight",s),s.grammar)if(t&&e.Worker){var c=new Worker(a.filename);c.onmessage=function(e){u(e.data)},c.postMessage(JSON.stringify({language:s.language,code:s.code,immediateClose:!0}))}else u(a.highlight(s.code,s.grammar,s.language));else u(a.util.encode(s.code))},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};if(a.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=a.tokenize(r.code,r.grammar),a.hooks.run("after-tokenize",r),i.stringify(a.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var a=new s;return u(a,a.head,e),o(e,a,n,a.head,0),function(e){for(var n=[],t=e.head.next;t!==e.tail;)n.push(t.value),t=t.next;return n}(a)},hooks:{all:{},add:function(e,n){var t=a.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=a.hooks.all[e];if(t&&t.length)for(var r,i=0;r=t[i++];)r(n)}},Token:i};function i(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=0|(r||"").length}function l(e,n,t,r){e.lastIndex=n;var a=e.exec(t);if(a&&r&&a[1]){var i=a[1].length;a.index+=i,a[0]=a[0].slice(i)}return a}function o(e,n,t,r,s,g){for(var f in t)if(t.hasOwnProperty(f)&&t[f]){var h=t[f];h=Array.isArray(h)?h:[h];for(var d=0;d<h.length;++d){if(g&&g.cause==f+","+d)return;var v=h[d],p=v.inside,m=!!v.lookbehind,y=!!v.greedy,k=v.alias;if(y&&!v.pattern.global){var x=v.pattern.toString().match(/[imsuy]*$/)[0];v.pattern=RegExp(v.pattern.source,x+"g")}for(var b=v.pattern||v,w=r.next,A=s;w!==n.tail&&!(g&&A>=g.reach);A+=w.value.length,w=w.next){var E=w.value;if(n.length>e.length)return;if(!(E instanceof i)){var P,L=1;if(y){if(!(P=l(b,A,e,m))||P.index>=e.length)break;var S=P.index,O=P.index+P[0].length,j=A;for(j+=w.value.length;S>=j;)j+=(w=w.next).value.length;if(A=j-=w.value.length,w.value instanceof i)continue;for(var C=w;C!==n.tail&&(j<O||"string"==typeof C.value);C=C.next)L++,j+=C.value.length;L--,E=e.slice(A,j),P.index-=A}else if(!(P=l(b,0,E,m)))continue;S=P.index;var N=P[0],_=E.slice(0,S),M=E.slice(S+N.length),W=A+E.length;g&&W>g.reach&&(g.reach=W);var z=w.prev;if(_&&(z=u(n,z,_),A+=_.length),c(n,z,L),w=u(n,z,new i(f,p?a.tokenize(N,p):N,k,N)),M&&u(n,w,M),L>1){var I={cause:f+","+d,reach:W};o(e,n,t,w.prev,A,I),g&&I.reach>g.reach&&(g.reach=I.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function u(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function c(e,n,t){for(var r=n.next,a=0;a<t&&r!==e.tail;a++)r=r.next;n.next=r,r.prev=n,e.length-=a}if(e.Prism=a,i.stringify=function e(n,t){if("string"==typeof n)return n;if(Array.isArray(n)){var r="";return n.forEach((function(n){r+=e(n,t)})),r}var i={type:n.type,content:e(n.content,t),tag:"span",classes:["token",n.type],attributes:{},language:t},l=n.alias;l&&(Array.isArray(l)?Array.prototype.push.apply(i.classes,l):i.classes.push(l)),a.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=" "+s+'="'+(i.attributes[s]||"").replace(/"/g,"&quot;")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+o+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(n){var t=JSON.parse(n.data),r=t.language,i=t.code,l=t.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),l&&e.close()}),!1),a):a;var g=a.util.currentScript();function f(){a.manual||a.highlightAll()}if(g&&(a.filename=g.src,g.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var h=document.readyState;"loading"===h||"interactive"===h&&g&&g.defer?document.addEventListener("DOMContentLoaded",f):window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,16)}return a}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&amp;/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var t={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};t["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[a]={pattern:RegExp("(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[^])*?(?=</__>)".replace(/__/g,(function(){return a})),"i"),lookbehind:!0,greedy:!0,inside:t},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(a,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp("(^|[\"'\\s])(?:"+a+")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))","i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml;
!function(s){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:[^;{\\s\"']|\\s+(?!\\s)|"+e.source+")*?(?:;|(?=\\s*\\{))"),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var t=s.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(Prism);
Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};
Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp("((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.|\\[(?:[^[\\]\\\\\r\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\r\n])+/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|/\\*(?:[^*]|\\*(?!/))*\\*/)*(?:$|[\r\n,.;:})\\]]|//))"),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),Prism.languages.js=Prism.languages.javascript;
!function(e){function n(e,n){return e.replace(/<<(\d+)>>/g,(function(e,s){return"(?:"+n[+s]+")"}))}function s(e,s,a){return RegExp(n(e,s),a||"")}function a(e,n){for(var s=0;s<n;s++)e=e.replace(/<<self>>/g,(function(){return"(?:"+e+")"}));return e.replace(/<<self>>/g,"[^\\s\\S]")}var t="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",r="class enum interface record struct",i="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",o="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var d=l(r),p=RegExp(l(t+" "+r+" "+i+" "+o)),c=l(r+" "+i+" "+o),u=l(t+" "+r+" "+o),g=a("<(?:[^<>;=+\\-*/%&|^]|<<self>>)*>",2),b=a("\\((?:[^()]|<<self>>)*\\)",2),h="@?\\b[A-Za-z_]\\w*\\b",f=n("<<0>>(?:\\s*<<1>>)?",[h,g]),m=n("(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*",[c,f]),k="\\[\\s*(?:,\\s*)*\\]",y=n("<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?",[m,k]),w=n("[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>",[g,b,k]),v=n("\\(<<0>>+(?:,<<0>>+)+\\)",[w]),x=n("(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?",[v,m,k]),$={keyword:p,punctuation:/[<>()?,.:[\]]/},_="'(?:[^\r\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'",B='"(?:\\\\.|[^\\\\"\r\n])*"';e.languages.csharp=e.languages.extend("clike",{string:[{pattern:s("(^|[^$\\\\])<<0>>",['@"(?:""|\\\\[^]|[^\\\\"])*"(?!")']),lookbehind:!0,greedy:!0},{pattern:s("(^|[^@$\\\\])<<0>>",[B]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:s("(\\busing\\s+static\\s+)<<0>>(?=\\s*;)",[m]),lookbehind:!0,inside:$},{pattern:s("(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)",[h,x]),lookbehind:!0,inside:$},{pattern:s("(\\busing\\s+)<<0>>(?=\\s*=)",[h]),lookbehind:!0},{pattern:s("(\\b<<0>>\\s+)<<1>>",[d,f]),lookbehind:!0,inside:$},{pattern:s("(\\bcatch\\s*\\(\\s*)<<0>>",[m]),lookbehind:!0,inside:$},{pattern:s("(\\bwhere\\s+)<<0>>",[h]),lookbehind:!0},{pattern:s("(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>",[y]),lookbehind:!0,inside:$},{pattern:s("\\b<<0>>(?=\\s+(?!<<1>>|with\\s*\\{)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))",[x,u,h]),inside:$}],keyword:p,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),e.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),e.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:s("([(,]\\s*)<<0>>(?=\\s*:)",[h]),lookbehind:!0,alias:"punctuation"}}),e.languages.insertBefore("csharp","class-name",{namespace:{pattern:s("(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])",[h]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:s("(\\b(?:default|sizeof|typeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<<0>>)*(?=\\s*\\))",[b]),lookbehind:!0,alias:"class-name",inside:$},"return-type":{pattern:s("<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))",[x,m]),inside:$,alias:"class-name"},"constructor-invocation":{pattern:s("(\\bnew\\s+)<<0>>(?=\\s*[[({])",[x]),lookbehind:!0,inside:$,alias:"class-name"},"generic-method":{pattern:s("<<0>>\\s*<<1>>(?=\\s*\\()",[h,g]),inside:{function:s("^<<0>>",[h]),generic:{pattern:RegExp(g),alias:"class-name",inside:$}}},"type-list":{pattern:s("\\b((?:<<0>>\\s+<<1>>|record\\s+<<1>>\\s*<<5>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>|<<1>>\\s*<<5>>|<<6>>)(?:\\s*,\\s*(?:<<3>>|<<4>>|<<6>>))*(?=\\s*(?:where|[{;]|=>|$))",[d,f,h,x,p.source,b,"\\bnew\\s*\\(\\s*\\)"]),lookbehind:!0,inside:{"record-arguments":{pattern:s("(^(?!new\\s*\\()<<0>>\\s*)<<1>>",[f,b]),lookbehind:!0,greedy:!0,inside:e.languages.csharp},keyword:p,"class-name":{pattern:RegExp(x),greedy:!0,inside:$},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var E=B+"|"+_,R=n("/(?![*/])|//[^\r\n]*[\r\n]|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>",[E]),z=a(n("[^\"'/()]|<<0>>|\\(<<self>>*\\)",[R]),2),S="\\b(?:assembly|event|field|method|module|param|property|return|type)\\b",j=n("<<0>>(?:\\s*\\(<<1>>*\\))?",[m,z]);e.languages.insertBefore("csharp","class-name",{attribute:{pattern:s("((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])",[S,j]),lookbehind:!0,greedy:!0,inside:{target:{pattern:s("^<<0>>(?=\\s*:)",[S]),alias:"keyword"},"attribute-arguments":{pattern:s("\\(<<0>>*\\)",[z]),inside:e.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var A=":[^}\r\n]+",F=a(n("[^\"'/()]|<<0>>|\\(<<self>>*\\)",[R]),2),P=n("\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}",[F,A]),U=a(n("[^\"'/()]|/(?!\\*)|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>|\\(<<self>>*\\)",[E]),2),Z=n("\\{(?!\\{)(?:(?![}:])<<0>>)*<<1>>?\\}",[U,A]);function q(n,a){return{interpolation:{pattern:s("((?:^|[^{])(?:\\{\\{)*)<<0>>",[n]),lookbehind:!0,inside:{"format-string":{pattern:s("(^\\{(?:(?![}:])<<0>>)*)<<1>>(?=\\}$)",[a,A]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:e.languages.csharp}}},string:/[\s\S]+/}}e.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:s('(^|[^\\\\])(?:\\$@|@\\$)"(?:""|\\\\[^]|\\{\\{|<<0>>|[^\\\\{"])*"',[P]),lookbehind:!0,greedy:!0,inside:q(P,F)},{pattern:s('(^|[^@\\\\])\\$"(?:\\\\.|\\{\\{|<<0>>|[^\\\\"{])*"',[Z]),lookbehind:!0,greedy:!0,inside:q(Z,U)}],char:{pattern:RegExp(_),greedy:!0}}),e.languages.dotnet=e.languages.cs=e.languages.csharp}(Prism);
Prism.languages.aspnet=Prism.languages.extend("markup",{"page-directive":{pattern:/<%\s*@.*%>/,alias:"tag",inside:{"page-directive":{pattern:/<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,alias:"tag"},rest:Prism.languages.markup.tag.inside}},directive:{pattern:/<%.*%>/,alias:"tag",inside:{directive:{pattern:/<%\s*?[$=%#:]{0,2}|%>/,alias:"tag"},rest:Prism.languages.csharp}}}),Prism.languages.aspnet.tag.pattern=/<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/,Prism.languages.insertBefore("inside","punctuation",{directive:Prism.languages.aspnet.directive},Prism.languages.aspnet.tag.inside["attr-value"]),Prism.languages.insertBefore("aspnet","comment",{"asp-comment":{pattern:/<%--[\s\S]*?--%>/,alias:["asp","comment"]}}),Prism.languages.insertBefore("aspnet",Prism.languages.javascript?"script":"tag",{"asp-script":{pattern:/(<script(?=.*runat=['"]?server\b)[^>]*>)[\s\S]*?(?=<\/script>)/i,lookbehind:!0,alias:["asp","script"],inside:Prism.languages.csharp||{}}});
!function(e){var a=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],n="(^|[^\\w.])(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*",s={pattern:RegExp(n+"[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b"),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};e.languages.dart=e.languages.extend("clike",{"class-name":[s,{pattern:RegExp(n+"[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()])"),lookbehind:!0,inside:s.inside}],keyword:a,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),e.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:e.languages.dart}}},string:/[\s\S]+/}},string:void 0}),e.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),e.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":s,keyword:a,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})}(Prism);
Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Prism.languages.go["class-name"];
!function(e){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t="(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*",s={pattern:RegExp("(^|[^\\w.])"+t+"[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b"),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp("(^|[^\\w.])"+t+"[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)"),lookbehind:!0,inside:s.inside},{pattern:RegExp("(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)"+t+"[A-Z]\\w*\\b"),lookbehind:!0,inside:s.inside}],keyword:n,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp("(\\bimport\\s+)"+t+"(?:[A-Z]\\w*|\\*)(?=\\s*;)"),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp("(\\bimport\\s+static\\s+)"+t+"(?:\\w+|\\*)(?=\\s*;)"),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp("(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?".replace(/<keyword>/g,(function(){return n.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism);
Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json;
!function(e){function n(e,n){return"___"+e.toUpperCase()+n+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(t,a,r,o){if(t.language===a){var c=t.tokenStack=[];t.code=t.code.replace(r,(function(e){if("function"==typeof o&&!o(e))return e;for(var r,i=c.length;-1!==t.code.indexOf(r=n(a,i));)++i;return c[i]=e,r})),t.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(t,a){if(t.language===a&&t.tokenStack){t.grammar=e.languages[a];var r=0,o=Object.keys(t.tokenStack);!function c(i){for(var u=0;u<i.length&&!(r>=o.length);u++){var g=i[u];if("string"==typeof g||g.content&&"string"==typeof g.content){var l=o[r],s=t.tokenStack[l],f="string"==typeof g?g:g.content,p=n(a,l),k=f.indexOf(p);if(k>-1){++r;var m=f.substring(0,k),d=new e.Token(a,e.tokenize(s,t.grammar),"language-"+a,s),h=f.substring(k+p.length),v=[];m&&v.push.apply(v,c([m])),v.push(d),h&&v.push.apply(v,c([h])),"string"==typeof g?i.splice.apply(i,[u,1].concat(v)):g.content=v}}else g.content&&c(g.content)}return i}(t.tokens)}}}})}(Prism);
!function(e){var a=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],i=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,n=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:a,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:i,operator:n,punctuation:s};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},r=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];e.languages.insertBefore("php","variable",{string:r,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:a,string:r,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,number:i,operator:n,punctuation:s}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(a){/<\?/.test(a.code)&&e.languages["markup-templating"].buildPlaceholders(a,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)})),e.hooks.add("after-tokenize",(function(a){e.languages["markup-templating"].tokenizePlaceholders(a,"php")}))}(Prism);
Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python;
!function(e){e.languages.ruby=e.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete e.languages.ruby.function;var t="(?:"+["([^a-zA-Z0-9\\s{(\\[<=])(?:(?!\\1)[^\\\\]|\\\\[^])*\\1","\\((?:[^()\\\\]|\\\\[^]|\\((?:[^()\\\\]|\\\\[^])*\\))*\\)","\\{(?:[^{}\\\\]|\\\\[^]|\\{(?:[^{}\\\\]|\\\\[^])*\\})*\\}","\\[(?:[^\\[\\]\\\\]|\\\\[^]|\\[(?:[^\\[\\]\\\\]|\\\\[^])*\\])*\\]","<(?:[^<>\\\\]|\\\\[^]|<(?:[^<>\\\\]|\\\\[^])*>)*>"].join("|")+")",i='(?:"(?:\\\\.|[^"\\\\\r\n])*"|(?:\\b[a-zA-Z_]\\w*|[^\\s\0-\\x7F]+)[?!]?|\\$.)';e.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp("%r"+t+"[egimnosux]{0,6}"),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp("(^|[^:]):"+i),lookbehind:!0,greedy:!0},{pattern:RegExp("([\r\n{(,][ \t]*)"+i+"(?=:(?!:))"),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp("%[qQiIwWs]?"+t),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp("%x"+t),greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete e.languages.ruby.string,e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby}(Prism);
!function(e){for(var a="/\\*(?:[^*/]|\\*(?!/)|/(?!\\*)|<self>)*\\*/",t=0;t<2;t++)a=a.replace(/<self>/g,(function(){return a}));a=a.replace(/<self>/g,(function(){return"[^\\s\\S]"})),e.languages.rust={comment:[{pattern:RegExp("(^|[^\\\\])"+a),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism);
Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};
document.addEventListener('DOMContentLoaded', ()=> {
if(!window.Prism){
return;
}
document.querySelectorAll('.tutor-container pre').forEach((el)=> {
const fallback='javascript';
const lang =
el.className
?.trim()
.replace('language-', '')||fallback;
const grammar=Prism.languages[lang]||Prism.languages[fallback];
el.innerHTML=Prism.highlight(el.textContent,
grammar,
Prism.languages[lang] ? lang:fallback
);
});
});
(()=>{var t={34:function(){window.addEventListener("DOMContentLoaded",()=>{var n=document.getElementById("tutor-download-invoice");if(n){n.addEventListener("click",r=>{var o=n.dataset.orderId;n.classList.add("tutor-btn-loading");var a=document.getElementById("tutor-invoice-content");
var i=t(a);setTimeout(()=>{html2canvas(a,{scale:2,backgroundColor:"#ffffff",logging:false,windowWidth:a.scrollWidth,windowHeight:a.scrollHeight}).then(t=>{
e(i);var r=t.toDataURL("image/jpeg",1);var a=new jspdf.jsPDF({orientation:"p",unit:"mm",format:"a4"});var s=a.internal.pageSize.getWidth();var c=a.internal.pageSize.getHeight();var u=t.width;var d=t.height;var l=u/d;var f=10;var h=s-2*f;var m=c-2*f;var g=h;var w=g/l;if(w>m){w=m;g=w*l}a.addImage(r,"PNG",f,f,g,w);a.save("invoice-".concat(o,".pdf"));n.classList.remove("tutor-btn-loading")}).catch(t=>{e(i);n.classList.remove("tutor-btn-loading")})},0)})}});function t(t){var e=[];t.querySelectorAll("*").forEach(t=>{var n=window.getComputedStyle(t);var r=n.textDecorationLine||n.textDecoration;if(r.includes("line-through")){
var o=window.getComputedStyle(t).position;if(o==="static"){t.style.position="relative";e.push({el:t,resetPosition:true})}else{e.push({el:t,resetPosition:false})}
t.style.textDecoration="none";
var a=document.createElement("span");a.className="__strikethrough-overlay";a.style.cssText="\n                position: absolute;\n                left: 0;\n                right: 0;\n                top: 50%;\n                height: 1.5px;\n                background-color: ".concat(n.color,";\n                pointer-events: none;\n                transform: translateY(-50%);\n            ");t.appendChild(a)}});return e}function e(t){t.forEach(t=>{var{el:e,resetPosition:n}=t;e.style.textDecoration="";if(n)e.style.position="";e.querySelectorAll(".__strikethrough-overlay").forEach(t=>t.remove())})}}};
var e={};
function n(r){
var o=e[r];if(o!==undefined){return o.exports}
var a=e[r]={exports:{}};
t[r](a,a.exports,n);
return a.exports}
(()=>{n.rv=()=>"1.6.5"})();
(()=>{n.ruid="bundler=rspack@1.6.5"})();
(()=>{"use strict";
function t(t,e,n,r,o,a,i){try{var s=t[a](i);var c=s.value}catch(t){n(t);return}if(s.done)e(c);else Promise.resolve(c).then(r,o)}function e(e){return function(){var n=this,r=arguments;return new Promise(function(o,a){var i=e.apply(n,r);function s(e){t(i,o,a,s,c,"next",e)}function c(e){t(i,o,a,s,c,"throw",e)}s(undefined)})}};
const r=7;const o=365.2425;const a=Math.pow(10,8)*24*60*60*1e3;const i=null&&-a;const s=6048e5;const c=864e5;const u=6e4;const d=36e5;const l=1e3;const f=525600;const h=43200;const m=1440;const g=60;const w=3;const v=12;const y=4;const b=3600;const p=60;const M=null&&b*24;const _=null&&M*7;const x=null&&M*o;const k=null&&x/12;const P=null&&k*3;const S=Symbol.for("constructDateFrom");
function D(t,e){if(typeof t==="function")return t(e);if(t&&typeof t==="object"&&S in t)return t[S](e);if(t instanceof Date)return new t.constructor(e);return new Date(e)}
const L=null&&D;
function W(t,e){
return D(e||t,t)}
const T=null&&W;
function E(t,e,n){const r=W(t,n?.in);r.setTime(r.getTime()+e*u);return r}
const q=null&&E;
const C={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};const O=(t,e,n)=>{let r;const o=C[t];if(typeof o==="string"){r=o}else if(e===1){r=o.one}else{r=o.other.replace("{{count}}",e.toString())}if(n?.addSuffix){if(n.comparison&&n.comparison>0){return"in "+r}else{return r+" ago"}}return r};
function Y(t){return (e={})=>{
const n=e.width?String(e.width):t.defaultWidth;const r=t.formats[n]||t.formats[t.defaultWidth];return r}};
const j={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"};const F={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"};const H={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"};const A={date:Y({formats:j,defaultWidth:"full"}),time:Y({formats:F,defaultWidth:"full"}),dateTime:Y({formats:H,defaultWidth:"full"})};
const z={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};const N=(t,e,n,r)=>z[t];
function Q(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let o;if(r==="formatting"&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth;const r=n?.width?String(n.width):e;o=t.formattingValues[r]||t.formattingValues[e]}else{const e=t.defaultWidth;const r=n?.width?String(n.width):t.defaultWidth;o=t.values[r]||t.values[e]}const a=t.argumentCallback?t.argumentCallback(e):e;
return o[a]}};
const B={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]};const X={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]};
const G={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]};const I={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]};const $={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}};const J={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}};const R=(t,e)=>{const n=Number(t);
const r=n%100;if(r>20||r<10){switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}}return n+"th"};const U={ordinalNumber:R,era:Q({values:B,defaultWidth:"wide"}),quarter:Q({values:X,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Q({values:G,defaultWidth:"wide"}),day:Q({values:I,defaultWidth:"wide"}),dayPeriod:Q({values:$,defaultWidth:"wide",formattingValues:J,defaultFormattingWidth:"wide"})};
function Z(t){return(e,n={})=>{const r=n.width;const o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth];const a=e.match(o);if(!a){return null}const i=a[0];const s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth];const c=Array.isArray(s)?K(s,t=>t.test(i)):V(s,t=>t.test(i));let u;u=t.valueCallback?t.valueCallback(c):c;u=n.valueCallback?n.valueCallback(u):u;const d=e.slice(i.length);return{value:u,rest:d}}}function V(t,e){for(const n in t){if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n])){return n}}return undefined}function K(t,e){for(let n=0;n<t.length;n++){if(e(t[n])){return n}}return undefined};
function tt(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const o=r[0];const a=e.match(t.parsePattern);if(!a)return null;let i=t.valueCallback?t.valueCallback(a[0]):a[0];
i=n.valueCallback?n.valueCallback(i):i;const s=e.slice(o.length);return{value:i,rest:s}}};
const te=/^(\d+)(th|st|nd|rd)?/i;const tn=/\d+/i;const tr={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i};const to={any:[/^b/i,/^(a|c)/i]};const ta={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i};const ti={any:[/1/i,/2/i,/3/i,/4/i]};const ts={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i};const tc={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]};const tu={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i};const td={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]};const tl={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i};const tf={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}};const th={ordinalNumber:tt({matchPattern:te,parsePattern:tn,valueCallback:t=>parseInt(t,10)}),era:Z({matchPatterns:tr,defaultMatchWidth:"wide",parsePatterns:to,defaultParseWidth:"any"}),quarter:Z({matchPatterns:ta,defaultMatchWidth:"wide",parsePatterns:ti,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Z({matchPatterns:ts,defaultMatchWidth:"wide",parsePatterns:tc,defaultParseWidth:"any"}),day:Z({matchPatterns:tu,defaultMatchWidth:"wide",parsePatterns:td,defaultParseWidth:"any"}),dayPeriod:Z({matchPatterns:tl,defaultMatchWidth:"any",parsePatterns:tf,defaultParseWidth:"any"})};
const tm={code:"en-US",formatDistance:O,formatLong:A,formatRelative:N,localize:U,match:th,options:{weekStartsOn:0,firstWeekContainsDate:1}};
const tg=null&&tm;
let tw={};function tv(){return tw}function ty(t){tw=t};
function tb(t){const e=W(t);const n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));n.setUTCFullYear(e.getFullYear());return+t-+n};
function tp(t,...e){const n=D.bind(null,t||e.find(t=>typeof t==="object"));return e.map(n)};
function tM(t,e){const n=W(t,e?.in);n.setHours(0,0,0,0);return n}
const t_=null&&tM;
function tx(t,e,n){const[r,o]=tp(n?.in,t,e);const a=tM(r);const i=tM(o);const s=+a-tb(a);const u=+i-tb(i);
return Math.round((s-u)/c)}
const tk=null&&tx;
function tP(t,e){const n=W(t,e?.in);n.setFullYear(n.getFullYear(),0,1);n.setHours(0,0,0,0);return n}
const tS=null&&tP;
function tD(t,e){const n=W(t,e?.in);const r=tx(n,tP(n));const o=r+1;return o}
const tL=null&&tD;
function tW(t,e){const n=tv();const r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0;const o=W(t,e?.in);const a=o.getDay();const i=(a<r?7:0)+a-r;o.setDate(o.getDate()-i);o.setHours(0,0,0,0);return o}
const tT=null&&tW;
function tE(t,e){return tW(t,{...e,weekStartsOn:1})}
const tq=null&&tE;
function tC(t,e){const n=W(t,e?.in);const r=n.getFullYear();const o=D(n,0);o.setFullYear(r+1,0,4);o.setHours(0,0,0,0);const a=tE(o);const i=D(n,0);i.setFullYear(r,0,4);i.setHours(0,0,0,0);const s=tE(i);if(n.getTime()>=a.getTime()){return r+1}else if(n.getTime()>=s.getTime()){return r}else{return r-1}}
const tO=null&&tC;
function tY(t,e){const n=tC(t,e);const r=D(e?.in||t,0);r.setFullYear(n,0,4);r.setHours(0,0,0,0);return tE(r)}
const tj=null&&tY;
function tF(t,e){const n=W(t,e?.in);const r=+tE(n)-+tY(n);
return Math.round(r/s)+1}
const tH=null&&tF;
function tA(t,e){const n=W(t,e?.in);const r=n.getFullYear();const o=tv();const a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1;const i=D(e?.in||t,0);i.setFullYear(r+1,0,a);i.setHours(0,0,0,0);const s=tW(i,e);const c=D(e?.in||t,0);c.setFullYear(r,0,a);c.setHours(0,0,0,0);const u=tW(c,e);if(+n>=+s){return r+1}else if(+n>=+u){return r}else{return r-1}}
const tz=null&&tA;
function tN(t,e){const n=tv();const r=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1;const o=tA(t,e);const a=D(e?.in||t,0);a.setFullYear(o,0,r);a.setHours(0,0,0,0);const i=tW(a,e);return i}
const tQ=null&&tN;
function tB(t,e){const n=W(t,e?.in);const r=+tW(n,e)-+tN(n,e);
return Math.round(r/s)+1}
const tX=null&&tB;
function tG(t,e){const n=t<0?"-":"";const r=Math.abs(t).toString().padStart(e,"0");return n+r};
const tI={
y(t,e){// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
const n=t.getFullYear();
const r=n>0?n:1-n;return tG(e==="yy"?r%100:r,e.length)},
M(t,e){const n=t.getMonth();return e==="M"?String(n+1):tG(n+1,2)},
d(t,e){return tG(t.getDate(),e.length)},
a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},
h(t,e){return tG(t.getHours()%12||12,e.length)},
H(t,e){return tG(t.getHours(),e.length)},
m(t,e){return tG(t.getMinutes(),e.length)},
s(t,e){return tG(t.getSeconds(),e.length)},
S(t,e){const n=e.length;const r=t.getMilliseconds();const o=Math.trunc(r*Math.pow(10,n-3));return tG(o,e.length)}};
const t$={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};const tJ={
G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){
case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});
case"GGGGG":return n.era(r,{width:"narrow"});
case"GGGG":default:return n.era(r,{width:"wide"})}},
y:function(t,e,n){
if(e==="yo"){const e=t.getFullYear();
const r=e>0?e:1-e;return n.ordinalNumber(r,{unit:"year"})}return tI.y(t,e)},
Y:function(t,e,n,r){const o=tA(t,r);
const a=o>0?o:1-o;
if(e==="YY"){const t=a%100;return tG(t,2)}
if(e==="Yo"){return n.ordinalNumber(a,{unit:"year"})}
return tG(a,e.length)},
R:function(t,e){const n=tC(t);
return tG(n,e.length)},
u:function(t,e){const n=t.getFullYear();return tG(n,e.length)},
Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){
case"Q":return String(r);
case"QQ":return tG(r,2);
case"Qo":return n.ordinalNumber(r,{unit:"quarter"});
case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});
case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});
case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},
q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){
case"q":return String(r);
case"qq":return tG(r,2);
case"qo":return n.ordinalNumber(r,{unit:"quarter"});
case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});
case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});
case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},
M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return tI.M(t,e);
case"Mo":return n.ordinalNumber(r+1,{unit:"month"});
case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});
case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});
case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},
L:function(t,e,n){const r=t.getMonth();switch(e){
case"L":return String(r+1);
case"LL":return tG(r+1,2);
case"Lo":return n.ordinalNumber(r+1,{unit:"month"});
case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});
case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});
case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},
w:function(t,e,n,r){const o=tB(t,r);if(e==="wo"){return n.ordinalNumber(o,{unit:"week"})}return tG(o,e.length)},
I:function(t,e,n){const r=tF(t);if(e==="Io"){return n.ordinalNumber(r,{unit:"week"})}return tG(r,e.length)},
d:function(t,e,n){if(e==="do"){return n.ordinalNumber(t.getDate(),{unit:"date"})}return tI.d(t,e)},
D:function(t,e,n){const r=tD(t);if(e==="Do"){return n.ordinalNumber(r,{unit:"dayOfYear"})}return tG(r,e.length)},
E:function(t,e,n){const r=t.getDay();switch(e){
case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});
case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});
case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});
case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},
e:function(t,e,n,r){const o=t.getDay();const a=(o-r.weekStartsOn+8)%7||7;switch(e){
case"e":return String(a);
case"ee":return tG(a,2);
case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});
case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});
case"eeeeee":return n.day(o,{width:"short",context:"formatting"});
case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},
c:function(t,e,n,r){const o=t.getDay();const a=(o-r.weekStartsOn+8)%7||7;switch(e){
case"c":return String(a);
case"cc":return tG(a,e.length);
case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});
case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});
case"cccccc":return n.day(o,{width:"short",context:"standalone"});
case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},
i:function(t,e,n){const r=t.getDay();const o=r===0?7:r;switch(e){
case"i":return String(o);
case"ii":return tG(o,e.length);
case"io":return n.ordinalNumber(o,{unit:"day"});
case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});
case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});
case"iiiiii":return n.day(r,{width:"short",context:"formatting"});
case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},
a:function(t,e,n){const r=t.getHours();const o=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},
b:function(t,e,n){const r=t.getHours();let o;if(r===12){o=t$.noon}else if(r===0){o=t$.midnight}else{o=r/12>=1?"pm":"am"}switch(e){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},
B:function(t,e,n){const r=t.getHours();let o;if(r>=17){o=t$.evening}else if(r>=12){o=t$.afternoon}else if(r>=4){o=t$.morning}else{o=t$.night}switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},
h:function(t,e,n){if(e==="ho"){let e=t.getHours()%12;if(e===0)e=12;return n.ordinalNumber(e,{unit:"hour"})}return tI.h(t,e)},
H:function(t,e,n){if(e==="Ho"){return n.ordinalNumber(t.getHours(),{unit:"hour"})}return tI.H(t,e)},
K:function(t,e,n){const r=t.getHours()%12;if(e==="Ko"){return n.ordinalNumber(r,{unit:"hour"})}return tG(r,e.length)},
k:function(t,e,n){let r=t.getHours();if(r===0)r=24;if(e==="ko"){return n.ordinalNumber(r,{unit:"hour"})}return tG(r,e.length)},
m:function(t,e,n){if(e==="mo"){return n.ordinalNumber(t.getMinutes(),{unit:"minute"})}return tI.m(t,e)},
s:function(t,e,n){if(e==="so"){return n.ordinalNumber(t.getSeconds(),{unit:"second"})}return tI.s(t,e)},
S:function(t,e){return tI.S(t,e)},
X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0){return"Z"}switch(e){
case"X":return tU(r);
case"XXXX":case"XX":return tZ(r);
case"XXXXX":case"XXX":default:return tZ(r,":")}},
x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){
case"x":return tU(r);
case"xxxx":case"xx":return tZ(r);
case"xxxxx":case"xxx":default:return tZ(r,":")}},
O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){
case"O":case"OO":case"OOO":return"GMT"+tR(r,":");
case"OOOO":default:return"GMT"+tZ(r,":")}},
z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){
case"z":case"zz":case"zzz":return"GMT"+tR(r,":");
case"zzzz":default:return"GMT"+tZ(r,":")}},
t:function(t,e,n){const r=Math.trunc(+t/1e3);return tG(r,e.length)},
T:function(t,e,n){return tG(+t,e.length)}};function tR(t,e=""){const n=t>0?"-":"+";const r=Math.abs(t);const o=Math.trunc(r/60);const a=r%60;if(a===0){return n+String(o)}return n+String(o)+e+tG(a,2)}function tU(t,e){if(t%60===0){const e=t>0?"-":"+";return e+tG(Math.abs(t)/60,2)}return tZ(t,e)}function tZ(t,e=""){const n=t>0?"-":"+";const r=Math.abs(t);const o=tG(Math.trunc(r/60),2);const a=tG(r%60,2);return n+o+e+a};
const tV=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}};const tK=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}};const t0=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[];const r=n[1];const o=n[2];if(!o){return tV(t,e)}let a;switch(r){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;case"PPPP":default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",tV(r,e)).replace("{{time}}",tK(o,e))};const t1={p:tK,P:t0};
const t2=/^D+$/;const t3=/^Y+$/;const t6=["D","DD","YY","YYYY"];function t4(t){return t2.test(t)}function t5(t){return t3.test(t)}function t8(t,e,n){const r=t9(t,e,n);console.warn(r);if(t6.includes(t))throw new RangeError(r)}function t9(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`};// CONCATENATED MODULE: ./node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js
function t7(t){return t instanceof Date||typeof t==="object"&&Object.prototype.toString.call(t)==="[object Date]"}
const et=null&&t7;
function ee(t){return!(!t7(t)&&typeof t!=="number"||isNaN(+W(t)))}
const en=null&&ee;
const er=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
const eo=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;const ea=/^'([^]*?)'?$/;const ei=/''/g;const es=/[a-zA-Z]/;function ec(t,e,n){const r=tv();const o=n?.locale??r.locale??tm;const a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1;const i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0;const s=W(t,n?.in);if(!ee(s)){throw new RangeError("Invalid time value")}let c=e.match(eo).map(t=>{const e=t[0];if(e==="p"||e==="P"){const n=t1[e];return n(t,o.formatLong)}return t}).join("").match(er).map(t=>{
if(t==="''"){return{isToken:false,value:"'"}}const e=t[0];if(e==="'"){return{isToken:false,value:eu(t)}}if(tJ[e]){return{isToken:true,value:t}}if(e.match(es)){throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`")}return{isToken:false,value:t}});
if(o.localize.preprocessor){c=o.localize.preprocessor(s,c)}const u={firstWeekContainsDate:a,weekStartsOn:i,locale:o};return c.map(r=>{if(!r.isToken)return r.value;const a=r.value;if(!n?.useAdditionalWeekYearTokens&&t5(a)||!n?.useAdditionalDayOfYearTokens&&t4(a)){t8(a,e,String(t))}const i=tJ[a[0]];return i(s,a,o.localize,u)}).join("")}function eu(t){const e=t.match(ea);if(!e){return t}return e[1].replace(ei,"'")}
const ed=null&&ec;
var el=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"yyyy-MM-dd HH:mm:ss";var n=t.getTimezoneOffset();var r=E(t,n);return ec(r,e)};var ef=t=>{var e=new Date(t);var n=e.getTimezoneOffset();return addMinutes(e,-n)};var eh=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t);function em(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var e=new FormData;Object.keys(t).forEach(n=>e.set(n,t[n]));e.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);return e}function eg(t){return e(function*(){try{var e=yield fetch(window._tutorobject.ajaxurl,{method:"POST",body:t});return e}catch(t){tutor_toast(__("Operation failed","tutor-pro"),t,"error")}})()}var ew=(t,e)=>{var{__:n}=wp.i18n;var{data:r={}}=t||{};var{message:o=e||n("Something Went Wrong!","tutor-pro")}=r;return o};
if(!window.tutor_toast){window.tutor_toast=function(t,e,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:true;if(!jQuery(".tutor-toast-parent").length){jQuery("body").append('<div class="tutor-toast-parent tutor-toast-right"></div>')}var o=n=="success"?"success":n=="error"?"danger":n=="warning"?"warning":"primary";var a=n=="success"?"tutor-icon-mark":n=="error"?"tutor-icon-times":"tutor-icon-circle-info-o";var i=e!==undefined&&e!==null&&e.trim()!=="";var s=jQuery('\n            <div class="tutor-notification tutor-is-'.concat(o,' tutor-mb-16">\n                <div class="tutor-notification-icon">\n                    <i class="').concat(a,'"></i>\n                </div>\n                <div class="tutor-notification-content">\n                <h5>').concat(t,'</h5>\n                <p class="').concat(!i?"tutor-d-none":"",'">').concat(e,'</p>\n                </div>\n                <button class="tutor-notification-close">\n                    <i class="fas fa-times"></i>\n                </button>\n            </div>\n        '));s.find(".tutor-noti-close").click(function(){s.remove()});jQuery(".tutor-toast-parent").append(s);if(r){setTimeout(function(){if(s){s.fadeOut("fast",function(){jQuery(this).remove()})}},5e3)}}}document.addEventListener("DOMContentLoaded",function(){var{__}=wp.i18n;var t=document.querySelector(".tutor-login-form-wrapper, .tutor-login-modal, #login_error, .woocommerce-error");if(t){t.onclick=n=>e(function*(){var e=n.target;var r=e;
if(e.hasAttribute("id")&&e.getAttribute("id")==="tutor-remove-active-logins"){n.preventDefault();var o=document.getElementById("tutor-remove-logins-wrapper");var a=o.closest(".tutor-alert");if(!a){a=document.getElementById("login_error")}
if(!a){a=document.querySelector("ul.woocommerce-error")}
var i=em({action:"tutor_remove_all_active_logins"});try{
o.innerHTML='<span class="tutor-color-subdued">'.concat(__("Please wait...","tutor-pro"),"</span>");var s=yield eg(i);var c=yield s.json();var{success:u,data:d}=c;if(u){
if(a.classList.contains("tutor-warning")){a.classList.remove("tutor-warning");a.classList.add("tutor-success")}if(a.hasAttribute("id")){a.style.borderLeftColor="#6eea98"}
if(a.classList.contains("woocommerce-error")){a.classList.add("woocommerce-message")}a.innerHTML='<div class="tutor-alert-content tutor-d-flex tutor-align-start tutor-gap-1">\n                            <div class="tutor-alert-icon">\n                                <svg width="20" height="20" viewBox="0 0 24 24" fill="none" role="presentation" aria-hidden="true"><path d="M19.678 15.534c.226.36.337.774.32 1.194-.01.394-.119.78-.32 1.125-.204.34-.49.627-.835.837-.374.211-.802.318-1.235.31H6.41a2.419 2.419 0 0 1-1.232-.31 2.539 2.539 0 0 1-.858-.837 2.265 2.265 0 0 1 0-2.319L9.94 6.162c.203-.368.512-.672.89-.875a2.523 2.523 0 0 1 2.341 0c.385.2.701.504.91.875l5.598 9.372Zm-6.866-4.179c0-.213.023-.426.039-.643.015-.216.028-.436.041-.655 0-.077-.005-.153-.016-.229a.93.93 0 0 0-.064-.21.89.89 0 0 0-.429-.423.906.906 0 0 0-1.117.287.981.981 0 0 0-.188.59c0 .14.022.279.032.415.01.136.02.275.032.414.029.522.06 1.042.093 1.545.032.504.06 1.033.093 1.546a.615.615 0 0 0 .203.443.66.66 0 0 0 .468.175.66.66 0 0 0 .47-.18.657.657 0 0 0 .202-.454v-.618c.023-.33.042-.667.064-1.004.023-.337.058-.668.077-.999ZM12 16.922a.896.896 0 0 0 .618-.247.712.712 0 0 0 .26-.581.828.828 0 0 0-.248-.608.885.885 0 0 0-.62-.26.91.91 0 0 0-.63.238.854.854 0 0 0-.27.599c0 .228.095.446.261.608a.905.905 0 0 0 .63.251Z" fill="currentColor"></path></svg>\n                            </div>\n                            <div class="tutor-alert-text">'.concat(__("All of your active login sessions have been removed. You can login now.","tutor-pro"),"</div>\n                        </div>")}else{
if(Array.isArray(d)){var l=d[0];if(l&&l.code==="tutor_login_limit"){t.insertAdjacentHTML("afterbegin",l.message);return}}tutor_toast(__("Failed","tutor-pro"),d,"error");o.innerHTML=r}}catch(t){console.log(t);tutor_toast(__("Something went wrong","tutor-pro"),__("Please try again after reloading page!","tutor-pro"),"error")}}})()}});
var ev=n(34);
var ey=false;window.addEventListener("DOMContentLoaded",()=>{var{__}=wp.i18n;var t=document.querySelector(".tutor-course-details-page");if(t){var n=document.querySelector(".tutor-single-course-sidebar");var r=n.hasAttribute("data-tutor-sticky-sidebar");if(r){var o=document.getElementsByTagName("header")[0];var a="".concat(o.offsetHeight,"px");var i=o.classList.value.includes("sticky");function s(){var t=window.scrollY;var e=200;var r=t>=e;var o=window.innerWidth>=1200;if(o){if(r){if(!ey){n.classList.add("tutor-sidebar-sticky");var s="max-height: 80vh; overflow-y: scroll; top: ".concat(i?a:"");n.setAttribute("style",s);n.scrollTop=0;ey=true}}else{n.classList.remove("tutor-sidebar-sticky");n.removeAttribute("style");ey=false}}}window.addEventListener("scroll",s)}}var c=document.querySelector("#tutor-gift-this-course-form");var u=document.querySelectorAll(".tutor-gift-card-button");if(c){c.addEventListener("submit",function(t){return e(function*(){t.preventDefault();var e=__("Something went wrong, please try again","tutor-pro");var n=new FormData(t.target);n.set("action","tutor_pro_gift_proceed_to_checkout");n.set("datetime",el(new Date("".concat(n.get("gift_date")," ").concat(n.get("gift_time")))));n.set("notify_me",n.get("notify_me")==="on"?1:0);var r=c.querySelector("button[type=submit]");try{r.setAttribute("disabled",true);r.classList.add("is-loading");var o=yield eg(n);var{status_code:a,message:i,data:s}=yield o.json();if(a===200){if(s===null||s===void 0?void 0:s.url){window.location.href=s.url}else{tutor_toast(__("Failed","tutor-pro"),i||e,"error")}}else{tutor_toast(__("Failed","tutor-pro"),i||e,"error")}}catch(t){tutor_toast(__("Failed","tutor-pro"),e,"error")}finally{r.removeAttribute("disabled");r.classList.remove("is-loading")}})()})}u.forEach(t=>{t.addEventListener("click",t=>e(function*(){var e=t.target;var n=e.dataset.courseId;var r=e.dataset.referenceId;if(!n||!r){tutor_toast(__("Failed","tutor-pro"),__("Invalid gift, please try again","tutor-pro"),"error");return}try{e.classList.add("tutor-btn-loading");e.setAttribute("disabled",true);var o=new FormData;o.set("action","tutor_pro_gift_enrollment");o.set("course_id",n);o.set("reference_id",r);o.set(_tutorobject.nonce_key,_tutorobject._tutor_nonce);var a=yield eg(o);var i=yield a.json();var{status_code:s,message:c,data:u}=i;if(s===200){TutorCore.modal.showModal("tutor-greetings-popup-".concat(n));e.closest(".tutor-gift-course-card").remove()}else{tutor_toast(__("Failed","tutor-pro"),c||defaultErrorMessage,"error")}}catch(t){tutor_toast(__("Error","tutor-pro"),t,"error")}finally{e.classList.remove("tutor-btn-loading");e.removeAttribute("disabled")}})())});document.addEventListener("tutorPlayerReady",t=>{var{plyr:e}=t.detail;var n=t.target;if((e===null||e===void 0?void 0:e.provider)==="youtube"){var r;var o=n===null||n===void 0?void 0:(r=n.closest(".plyr--youtube.plyr__poster-enabled"))===null||r===void 0?void 0:r.querySelector(".plyr__poster");if(o){e.on("play",()=>o.style.opacity="0");e.on("ended",()=>o.style.opacity="1")}}})})})()})();
(()=>{"use strict";var t={};
var e={};
function o(r){
var n=e[r];if(n!==undefined){return n.exports}
var i=e[r]={exports:{}};
t[r](i,i.exports,o);
return i.exports}
(()=>{o.rv=()=>"1.6.5"})();
(()=>{o.ruid="bundler=rspack@1.6.5"})();
function r(t,e,o,r,n,i,a){try{var s=t[i](a);var l=s.value}catch(t){o(t);return}if(s.done)e(l);else Promise.resolve(l).then(r,n)}function n(t){return function(){var e=this,o=arguments;return new Promise(function(n,i){var a=t.apply(e,o);function s(t){r(a,n,i,s,l,"next",t)}function l(t){r(a,n,i,s,l,"throw",t)}s(undefined)})}};
var i=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"yyyy-MM-dd HH:mm:ss";var o=t.getTimezoneOffset();var r=addMinutes(t,o);return format(r,e)};var a=t=>{var e=new Date(t);var o=e.getTimezoneOffset();return addMinutes(e,-o)};var s=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t);function l(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var e=new FormData;Object.keys(t).forEach(o=>e.set(o,t[o]));e.set(window.tutor_get_nonce_data(true).key,window.tutor_get_nonce_data(true).value);return e}function d(t){return n(function*(){try{var e=yield fetch(window._tutorobject.ajaxurl,{method:"POST",body:t});return e}catch(t){tutor_toast(__("Operation failed","tutor-pro"),t,"error")}})()}var u=(t,e)=>{var{__:o}=wp.i18n;var{data:r={}}=t||{};var{message:n=e||o("Something Went Wrong!","tutor-pro")}=r;return n};
class c{highlightSelection(){var t=window.getSelection();if(!t.rangeCount||t.isCollapsed)return;var e=t.getRangeAt(0);if(!this.content.contains(e.commonAncestorContainer))return;var o=e.toString();var r=this.getAbsolutePosition(e.startContainer,e.startOffset);var n=this.getAbsolutePosition(e.endContainer,e.endOffset);
var i={id:this.getRandomInt(1,500),text:o===null||o===void 0?void 0:o.trim(),// text: selectedText?.trim().replace(/\u00A0/g, ' '),
startPos:r,endPos:n,color:this.currentColor,fingerprint:this.createFingerprint(o,r),timestamp:Date.now()};
this.extractedHighlight(e);return i}extractedHighlight(t){
if(this.rangeSpansBlockElements(t)){this.applyInlineHighlight(t)}else{
var e=document.createElement("mark");e.className="tutor-highlighted";try{t.surroundContents(e)}catch(r){var o=t.extractContents();e.appendChild(o);t.insertNode(e)}}}rangeSpansBlockElements(t){var e=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];var o=t.startContainer;while(o&&o!==t.endContainer){if(o.nodeType===Node.ELEMENT_NODE&&e.includes(o.tagName)){return true}o=this.getNextNode(o,t.commonAncestorContainer)}return false}getNextNode(t,e){if(t.firstChild)return t.firstChild;while(t){if(t===e)return null;if(t.nextSibling)return t.nextSibling;t=t.parentNode}return null}applyInlineHighlight(t){var e=this.getTextNodesInRange(t);e.forEach(t=>{var{node:e,startOffset:o,endOffset:r}=t;if(o>=r)return;
var n=document.createRange();n.setStart(e,o);n.setEnd(e,r);
var i=document.createElement("mark");i.className="tutor-highlighted";try{n.surroundContents(i)}catch(t){var a=n.extractContents();i.appendChild(a);n.insertNode(i)}});
window.getSelection().removeAllRanges()}applyInlineHighlightWithNote(t,e){var o=this.getTextNodesInRange(t);o.forEach((t,o)=>{var{node:r,startOffset:n,endOffset:i}=t;if(n>=i)return;
var a=document.createRange();a.setStart(r,n);a.setEnd(r,i);
this.insertMarker(a,e)})}removeHighlight(t){var e=t.startContainer.parentNode;if(e&&e.classList.contains("tutor-highlighted")){var o=document.createTextNode(t.toString());e.parentNode.replaceChild(o,e)}}createFingerprint(t,e){var o=this.content.textContent;var r=50;
var n=o.substring(Math.max(0,e-r),e);var i=o.substring(e+t.length,Math.min(o.length,e+t.length+r));
var a={full:this.hash(n+t+i),beforeText:this.hash(n+t),textAfter:this.hash(t+i),textOnly:this.hash(t),
wordContext:this.getWordContext(t,e)};return a}hash(t){var e=0;for(var o=0;o<t.length;o++){var r=t.charCodeAt(o);e=(e<<5)-e+r;e=e&e}return e.toString(36)}getWordContext(t,e){var o=this.content.textContent;var r=o.split(/\s+/);var n=t.split(/\s+/);
for(var i=0;i<=r.length-n.length;i++){var a=r.slice(i,i+n.length);if(a.join(" ").includes(t.trim())){var s=r.slice(Math.max(0,i-3),i);var l=r.slice(i+n.length,i+n.length+3);return{before:s.join(" "),after:l.join(" "),position:i}}}return null}getAbsolutePosition(t,e){var o=0;var r=document.createTreeWalker(this.content,NodeFilter.SHOW_TEXT,null);var n;while(n=r.nextNode()){if(n===t){return o+e}o+=n.textContent.length}return o}getNodeFromPosition(t){var e=0;var o=document.createTreeWalker(this.content,NodeFilter.SHOW_TEXT,null);var r;while(r=o.nextNode()){var n=r.textContent.length;if(e+n>=t){return{node:r,offset:t-e}}e+=n}return null}restoreHighlight(t){var e=this.content.textContent;var o=t.highlight_serialized;
if(o.startPos<e.length&&o.endPos<=e.length&&e.substring(o.startPos,o.endPos)===o.text){if(this.applyHighlightAtPosition(o.startPos,t)){return true}}
var r=e.length-o.startPos;var n=e.length-r;if(n>=0&&n+o.text.length<=e.length&&e.substring(n,n+o.text.length)===o.text){if(this.applyHighlightAtPosition(n,t)){return true}}
return this.restoreByFingerprint(o,t)}applyHighlightAtPosition(t,e){var o=e.highlight_text;var r=this.getNodeFromPosition(t);var n=this.getNodeFromPosition(t+(o===null||o===void 0?void 0:o.length));if(r&&n){try{var i=document.createRange();i.setStart(r.node,r.offset);i.setEnd(n.node,n.offset);
if(this.rangeSpansBlockElements(i)){this.applyInlineHighlightWithNote(i,e);return true}else{
this.insertMarker(i,e);return true}}catch(e){console.warn("Could not apply highlight at position:",t,e);return false}}return false}restoreByFingerprint(t,e){var o=this.content.textContent;var r=t.text;
var n=[];var i=o.indexOf(r);while(i!==-1){n.push(i);i=o.indexOf(r,i+1)}
for(var a of n){var s=this.createFingerprint(r,a);
var l=[s.full===t.fingerprint.full,s.beforeText===t.fingerprint.beforeText,s.textAfter===t.fingerprint.textAfter,this.matchWordContext(s.wordContext,t.fingerprint.wordContext)];
if(l[0]||l[1]||l[2]||l[3]){if(this.applyHighlightAtPosition(a,e)){return true}}}
if(n.length>0){
return this.applyHighlightAtPosition(n[0],e)}return false}matchWordContext(t,e){if(!t||!e)return false;return t.before===e.before&&t.after===e.after}applyComplexHighlight(t,e){var o=e.highlight_serialized.id;
var r=this.getTextNodesInRange(t);if(r.length===0)return;
r.forEach((o,n)=>{try{if(n==r.length-1){this.insertMarker(t,e)}}catch(t){}});
this.content.normalize()}insertMarker(t,e,o){var r=document.createElement("mark");r.className="".concat(o!==null&&o!==void 0?o:"tutor-highlighted has-note");r.dataset.noteId=e.comment_ID;r.dataset.lessonId=e.comment_post_ID;r.dataset.noteContent=e.comment_content;r.dataset.highlightText=e.highlight_text;r.dataset.highlightId=e.highlight_serialized.id;try{t.surroundContents(r)}catch(e){var n=t.extractContents();r.appendChild(n);t.insertNode(r)}}getTextNodesInRange(t){var e=[];var o=document.createTreeWalker(t.commonAncestorContainer,NodeFilter.SHOW_TEXT,null);var r;while(r=o.nextNode()){
if(!r.textContent||!r.textContent.trim())continue;
var n=document.createRange();n.selectNodeContents(r);
if(t.compareBoundaryPoints(Range.END_TO_START,n)>0||t.compareBoundaryPoints(Range.START_TO_END,n)<0){continue}
var i=0;var a=r.textContent.length;
if(r===t.startContainer){i=t.startOffset}else{
try{if(t.comparePoint(r,0)>0){continue;
}}catch(e){
var s=document.createRange();s.setStart(r,0);if(t.compareBoundaryPoints(Range.START_TO_START,s)>0){continue}}}
if(r===t.endContainer){a=t.endOffset}else{
try{if(t.comparePoint(r,r.textContent.length)<0){continue;
}}catch(e){
var l=document.createRange();l.setEnd(r,r.textContent.length);if(t.compareBoundaryPoints(Range.END_TO_END,l)<0){continue}}}
if(i<a){e.push({node:r,startOffset:i,endOffset:a})}}return e}getRandomInt(t,e){t=Math.ceil(t);
e=Math.floor(e);
return Math.floor(Math.random()*(e-t+1))+t}constructor(t){this.content=t}}const h=c;
class v{init(){var t;var{__}=wp.i18n;this.defaultErrorMessage=__("Something went wrong, please try again","tutor-pro");
this.lessonWrapper=document.querySelector(".tutor-lesson-wrapper");
this.highlighter=new h(this.lessonWrapper);(t=lesson_notes)===null||t===void 0?void 0:t.forEach(t=>{if(t.type==="highlight"){var e=this.decodeUnicodeEscapes(t.highlight_text);if(!t.highlight_text){t.highlight_text=e}if(!t.highlight_serialized){t.highlight_serialized.text=e}this.highlighter.restoreHighlight(t)}});this.setupEventListeners()}decodeUnicodeEscapes(t){if(!t)return"";
t=t.replace(/u([0-9a-fA-F]{4})/g,(t,e)=>String.fromCharCode(parseInt(e,16)));
var e=document.createElement("textarea");e.innerHTML=t;return e.value;return t}getBlockAncestor(t){if(!t)return null;if(t.nodeType===3)t=t.parentNode;while(t&&t!==document.body){var e=window.getComputedStyle(t).display;if(e==="block"||e==="list-item"||e==="table"){return t}t=t.parentNode}return null}isInsideHighlight(t){while(t&&t!==document.body){if(t.classList&&t.classList.contains("tutor-highlighted"))return true;t=t.parentNode}return false}containsHighlight(t){var e=document.createTreeWalker(t.commonAncestorContainer,NodeFilter.SHOW_ELEMENT,{acceptNode:function e(e){
if(!t.intersectsNode(e))return NodeFilter.FILTER_REJECT;return e.classList&&e.classList.contains("tutor-highlighted")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}},false);return e.nextNode()!==null}getSelectionEndPosition(){if(!this.lessonWrapper)return null;var t=window.getSelection();if(!t.rangeCount||t.isCollapsed)return null;var e=t.getRangeAt(0).cloneRange();
if(!this.lessonWrapper.contains(e.startContainer))return null;
if(this.isNoteFormOpen()){t.removeAllRanges();return null}
if(this.isInsideHighlight(e.startContainer)||this.isInsideHighlight(e.endContainer)){return null}
if(this.containsHighlight(e)){return null}
var o=this.getBlockAncestor(e.startContainer);var r=this.getBlockAncestor(e.endContainer);if(!o||!r||o!==r){this.closeNoteForm(false);return null}
e.collapse(false);var n=e.getBoundingClientRect();if(n){return{x:n.left,y:n.bottom}}return null}getFormPosition(t,e){var o=t.getBoundingClientRect();var r=e.getBoundingClientRect();var n=window.innerWidth;var i=window.innerHeight;var a=t.closest(".tutor-video-player")!==null;var s=getComputedStyle(document.documentElement).direction==="rtl";var l=e.classList.contains("tutor-player-fullscreen");if(l){return{top:o.top-(r.height-o.height)+2,left:s&&!a?o.left-2:o.left-(r.width-o.width)+2}}var d=o.bottom+2;var u=s&&!a?o.right-r.width-o.width/2:o.left+o.width/2;if(t.id==="tutor-lesson-nav-take-note-btn"&&t.closest(".tutor-learning-area")){d=o.top-16;u=s&&!a?o.left-12:o.left-(r.width-o.width)+12}
if(d+r.height>i){d=o.top-2-r.height}
if(u+r.width>n){u=n-r.width}
if(u<0){u=0}return{top:d,left:u}}getPopoverPosition(t,e){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:5;var r=t.getBoundingClientRect();var n=e.getBoundingClientRect();var i=r.bottom+o;var a=r.left;
if(a+n.width>window.innerWidth){a=window.innerWidth-n.width-o}
if(i+n.height>window.innerHeight){i=r.top-n.height-o}
a=Math.max(a,o);i=Math.max(i,o);return{top:i,left:a}}closeNoteForm(t){var{__}=wp.i18n;var e=document.querySelector(".tutor-lesson-note-form-wrapper:not(.tutor-d-none)");if(e){e.classList.add("tutor-d-none");var o=e.querySelector('textarea[name="note_text"]');if(o){o.value=""};var r=e.querySelector('input[name="action"]');if(r){r.value="tutor_pro_save_lesson_note"};var n=e.querySelector('input[name="note_id"]');if(n){n.value=""};var i=e.querySelector('input[name="highlight_text"]');if(i){i.value=""};var a=e.querySelector('input[name="highlight_serialized"]');if(a){a.value=""};var s=e.querySelector('input[name="video_start_time"]');if(s){s.value=""};var l=e.querySelector(".tutor-lesson-note-start-time");if(l){l.classList.add("tutor-d-none");l.textContent="00:00 -"}var d=document.querySelector(".tutor-lesson-note-form-title");if(d){d.textContent=__("Take Note","tutor-pro")}var u=e.querySelector(".tutor-lesson-notes-form-key-hint");if(u){u.parentElement.classList.add("tutor-justify-end");u.parentElement.classList.remove("tutor-justify-between");u.classList.add("tutor-d-none")}
var c=document.querySelectorAll(".tutor-highlighted.has-popover");c.forEach(t=>t.classList.remove("has-popover"));
document.body.classList.remove("tutor-overflow-hidden")}var h=document.getElementById("tutor-take-lesson-note-btn");if(h){h.classList.add("tutor-d-none")}if(t){var v=document.querySelector(".tutor-highlighted:not(.has-note)");if(v&&v.tagName.toLowerCase()==="mark"){var f=v.parentNode;while(v.firstChild){f.insertBefore(v.firstChild,v)}f.removeChild(v);f.normalize()}}}isNoteFormOpen(){var t=document.querySelector(".tutor-lesson-note-form-wrapper");return t&&!t.classList.contains("tutor-d-none")}highlightLessonContent(t){var e=JSON.parse(t.highlight_serialized);this.highlighter.applyHighlightAtPosition(e.startPos,t)}setupEventListeners(){document.addEventListener("submit",t=>{if(t.target&&t.target.classList.contains("tutor-lesson-notes-form")){this.handleFormSubmission(t)}});document.addEventListener("click",t=>{var e=t.target;if(e.classList.contains("tutor-read-more-less")){this.handleReadMoreLess(e)}if(e.classList.contains("tutor-edit-note-button")||e.closest(".tutor-edit-note-button")){this.handleNoteEdit(t,e)}if(e.classList.contains("tutor-cancel-edit-note-button")||e.closest(".tutor-cancel-edit-note-button")){this.handleCancelNoteEdit(t,e)}if(e.classList.contains("tutor-cancel-note-button")||e.closest(".tutor-cancel-note-button")){this.handleCancelNote(t,e)}if(e.classList.contains("tutor-delete-note-button")||e.closest(".tutor-delete-note-button")){this.handleDeleteNotePopover(t,e)}if(e.classList.contains("tutor-confirm-delete-note-button")||e.closest(".tutor-confirm-delete-note-button")){this.handleConfirmDeleteNote(t,e)}if(e.id==="tutor-take-lesson-note-btn"||e.closest("#tutor-take-lesson-note-btn")){this.handleTakeNoteButton(e)}if(e.id==="tutor-lesson-nav-take-note-btn"||e.closest("#tutor-lesson-nav-take-note-btn")){this.handleLessonNavTakeNoteButton(e)}if(e.matches(".tutor-lesson-note-list-item-video-action")||e.closest(".tutor-lesson-note-list-item-video-action")){this.handleVideoAction(e)}if(e.matches("[data-action-close]")||e.closest("[data-action-close]")){this.closeNoteForm(true)}if(e.id==="tutor-load-more-notes-button"||e.closest("#tutor-load-more-notes-button")){this.handleLoadMoreNotes(t,e)}if(e.closest(".tutor-highlighted.has-note")){this.handleHighlightedTextClick(t,e.closest(".tutor-highlighted.has-note"))}if(e.matches(".tutor-note-popover-edit-button")||e.closest(".tutor-note-popover-edit-button")){this.handleNotePopoverEdit(t,e)}});document.addEventListener("click",t=>{this.handleOutsideClick(t)});document.addEventListener("keydown",t=>{this.handleKeydown(t)});document.addEventListener("mouseup",()=>{this.handleMouseup()});["scroll","resize"].forEach(t=>{window.addEventListener(t,()=>{this.handleScrollResize()})});document.addEventListener("focusin",t=>{this.handleFocusin(t)});document.addEventListener("tutor_tab_changed",t=>{this.handleTutorTabChanged(t)});document.addEventListener("tutor-tab-change",t=>{this.handleTutorTabChanged(t)});document.addEventListener("mouseover",t=>{this.handleNoteHover(t)});document.addEventListener("mouseout",t=>{this.handleNoteHoverOut(t)});window.addEventListener("tutorLessonPlayerReady",t=>{this.handleTutorLessonPlayerReady(t)});document.addEventListener("input",t=>{this.handleTextareaInput(t)})}handleFormSubmission(t){return n(function*(){var{__}=wp.i18n;if(t.target&&t.target.classList.contains("tutor-lesson-notes-form")){t.preventDefault();var e=t.target;
var o=new FormData(e);var r=o.get("note_text");var n=o.get("lesson_id");var i=o.get("note_id");var a=o.get("highlight_text");var s=o.get("video_start_time");var u=window.TutorLessonPlayer;if(u&&typeof u.currentTime==="number"){if(e.hasAttribute("is-main-form")&&!s){o.set("video_start_time",Math.floor(u.currentTime))}o.append("video_end_time",Math.floor(u.currentTime))}if(!r){tutor_toast(__("Failed","tutor-pro"),__("Note text cannot be empty","tutor-pro"),"error");return}if(!n){tutor_toast(__("Failed","tutor-pro"),__("Invalid lesson, please try again","tutor-pro"),"error");return}var c=e.querySelector("button[type=submit]");try{c.setAttribute("disabled",true);c.classList.add("is-loading","tutor-btn-loading");var h=yield d(o);var{status_code:v,message:f,data:p}=yield h.json();if(v===200){tutor_toast(__("Success","tutor-pro"),f||__("Note saved successfully","tutor-pro"),"success");document.dispatchEvent(new CustomEvent("tutor-note-saved",{detail:p}));
this.closeNoteForm(true);if(!i){e.reset();
if(a&&p&&p.highlight_serialized){this.highlightLessonContent(p)}
var m=document.querySelector(".tutor-lesson-note-list-wrapper");if(m){try{var g;var y=yield d(l({action:"tutor_pro_get_lesson_notes_html",lesson_id:n}));var _=yield y.json();if(_.status_code===200&&((g=_.data)===null||g===void 0?void 0:g.html)){var C;m.innerHTML=(C=_.data)===null||C===void 0?void 0:C.html}}catch(t){console.error("Failed to fetch updated notes:",t)}}}else{
var b=document.getElementById("tutor-lesson-note-list-item-".concat(i));var L=b===null||b===void 0?void 0:b.parentElement;if(L){try{var w;var x=yield d(l({action:"tutor_pro_get_single_lesson_note_html",lesson_id:n,note_id:i}));var S=yield x.json();if(S.status_code===200&&((w=S.data)===null||w===void 0?void 0:w.html)){var E;L.outerHTML=(E=S.data)===null||E===void 0?void 0:E.html}}catch(t){console.error("Failed to fetch updated note:",t)}}
var N=document.querySelectorAll('mark[data-note-id="'.concat(i,'"]'));N.forEach(t=>{t.dataset.noteContent=r})}}else{tutor_toast(__("Failed","tutor-pro"),f||this.defaultErrorMessage,"error")}}catch(t){tutor_toast(__("Failed","tutor-pro"),this.defaultErrorMessage,"error")}finally{c.removeAttribute("disabled");c.classList.remove("is-loading","tutor-btn-loading")}}}).call(this)}handleReadMoreLess(t){var e=t.closest(".tutor-lesson-note-list-item");if(e){var o=e.querySelector(".tutor-lesson-note-content-short");var r=e.querySelector(".tutor-lesson-note-content-long");if(o&&r){var n=!o.classList.contains("tutor-d-none");if(n){o.classList.add("tutor-d-none");r.classList.remove("tutor-d-none")}else{o.classList.remove("tutor-d-none");r.classList.add("tutor-d-none")}}}}handleNoteEdit(t,e){t.preventDefault();var o=e.closest(".tutor-lesson-note-list-item");var r=o.nextElementSibling;if(r&&r.classList.contains("tutor-lesson-notes-form")){o.classList.add("tutor-d-none");r.classList.remove("tutor-d-none");
var n=r.querySelector('textarea[name="note_text"]');if(n){var i=n.value.length;n.focus();n.setSelectionRange(i,i)}}}handleCancelNoteEdit(t,e){t.preventDefault();var o=e.closest(".tutor-lesson-notes-form");var r=o===null||o===void 0?void 0:o.previousElementSibling;if(r&&o){var n;o.classList.add("tutor-d-none");r.classList.remove("tutor-d-none");
var i=((n=o.querySelector('input[name="note_content"]'))===null||n===void 0?void 0:n.value)||"";var a=o.querySelector('textarea[name="note_text"]');if(a){a.value=i}}}handleCancelNote(t,e){t.preventDefault();var o=e.closest(".tutor-lesson-notes-form");var r=o===null||o===void 0?void 0:o.querySelector(".tutor-lesson-notes-form-buttons");if(r){o.querySelector('textarea[name="note_text"]').value="";r.classList.add("tutor-d-none");var n=o.querySelector(".tutor-lesson-notes-form-key-hint");if(n){n.parentElement.classList.add("tutor-justify-end");n.parentElement.classList.remove("tutor-justify-between");n.classList.add("tutor-d-none")}}}handleDeleteNotePopover(t,e){var{__}=wp.i18n;t.preventDefault();
var o=e.closest(".tutor-delete-note-button")||e;var r=o===null||o===void 0?void 0:o.getAttribute("data-note-id");var n=o===null||o===void 0?void 0:o.getAttribute("data-lesson-id");if(!r){tutor_toast(__("Failed","tutor-pro"),__("Invalid note, please try again","tutor-pro"),"error");return}
var i=document.querySelector(".tutor-delete-note-popover");if(i){i.remove()}
var a=document.createElement("div");a.className="tutor-delete-note-popover";a.innerHTML='\n            <div class="tutor-delete-note-popover-container">\n                <div class="tutor-delete-note-popover-top">\n                    <div class="tutor-delete-note-popover-content">\n                        <h3>'.concat(__("Delete This Note?","tutor-pro"),"</h3>\n                        <p>").concat(__("Are you sure you want to delete this note permanently?","tutor-pro"),'</p>\n                    </div>\n                    <button class="tutor-delete-note-popover-close"><i class="tutor-icon-times-o"></i></button>\n                </div>\n                <div class="tutor-delete-note-popover-buttons">\n                    <button class="tutor-btn tutor-color-subdued tutor-btn-sm tutor-cancel-delete-popover">').concat(__("Cancel","tutor-pro"),'</button>\n                    <button class="tutor-btn tutor-btn-danger tutor-btn-sm tutor-confirm-delete-note-button" data-note-id="').concat(r,'" data-lesson-id="').concat(n,'">').concat(__("Delete","tutor-pro"),"</button>\n                </div>\n            </div>\n        ");document.body.appendChild(a);var s=o.closest(".tutor-lesson-note-list-item");s===null||s===void 0?void 0:s.classList.add("is-focused");
var l=document.documentElement.dir==="rtl";var d=s.getBoundingClientRect();var u=a.getBoundingClientRect();a.style.position="absolute";a.style.top="".concat(d.top+window.scrollY+5,"px");if(l){a.style.left="".concat(d.left+window.scrollX+5,"px")}else{a.style.left="".concat(d.right+window.scrollX-u.width-5,"px")}a.style.zIndex="9999";
var c=a.querySelector(".tutor-cancel-delete-popover");if(c){c.addEventListener("click",()=>{var t;a.remove();(t=o.closest(".tutor-lesson-note-list-item"))===null||t===void 0?void 0:t.classList.remove("is-focused")})}
var h=a.querySelector(".tutor-delete-note-popover-close");if(h){h.addEventListener("click",()=>{var t;a.remove();(t=o.closest(".tutor-lesson-note-list-item"))===null||t===void 0?void 0:t.classList.remove("is-focused")})}
var v=t=>{if(!a.contains(t.target)&&t.target!==o){var e;a.remove();(e=o.closest(".tutor-lesson-note-list-item"))===null||e===void 0?void 0:e.classList.remove("is-focused");document.removeEventListener("click",v)}};setTimeout(()=>document.addEventListener("click",v),0)}handleConfirmDeleteNote(t,e){return n(function*(){var{__}=wp.i18n;t.preventDefault();var o=e.closest(".tutor-confirm-delete-note-button");var r=o===null||o===void 0?void 0:o.getAttribute("data-note-id");if(!r){tutor_toast(__("Failed","tutor-pro"),__("Invalid note, please try again","tutor-pro"),"error");return}try{o.setAttribute("disabled",true);o.classList.add("is-loading","tutor-btn-loading");var n=yield d(l({action:"tutor_pro_delete_lesson_note",note_id:r}));var{status_code:i,message:a,data:s}=yield n.json();if(i===200){tutor_toast(__("Success","tutor-pro"),a||__("Note deleted successfully","tutor-pro"),"success");document.dispatchEvent(new CustomEvent("tutor-note-deleted",{detail:s}));
var u=document.querySelector(".tutor-delete-note-popover");if(u){u.remove()}
var c=document.querySelector(".tutor-note-popover");if(c){c.remove();document.body.classList.remove("tutor-overflow-hidden")}
var h=document.querySelectorAll('[data-note-id="'.concat(r,'"]'));h.forEach(t=>{if(t.tagName.toLowerCase()==="mark"){var e=t.parentNode;while(t.firstChild){e.insertBefore(t.firstChild,t)}e.removeChild(t);e.normalize()}});
var v=document.querySelector("#tutor-lesson-note-list-item-".concat(r));if(v){v.parentElement.remove()}
var f=document.querySelector(".tutor-lesson-note-list-wrapper");if(f){try{var p=yield d(l({action:"tutor_pro_get_lesson_notes_html",lesson_id:o.getAttribute("data-lesson-id")}));var m=yield p.json();if(m.status_code===200){var g;f.innerHTML=((g=m.data)===null||g===void 0?void 0:g.html)||null}}catch(t){console.error("Failed to fetch updated notes:",t)}}}else{tutor_toast(__("Failed","tutor-pro"),a||this.defaultErrorMessage,"error")}}catch(t){tutor_toast(__("Failed","tutor-pro"),this.defaultErrorMessage,"error")}finally{o.removeAttribute("disabled");o.classList.remove("is-loading","tutor-btn-loading")}}).call(this)}handleTakeNoteButton(t){var e=t.closest("#tutor-take-lesson-note-btn");var o=document.querySelector(".tutor-lesson-note-form-wrapper");
var r=this.highlighter.highlightSelection();if(e&&o){o.classList.remove("tutor-d-none");
var{top:n,left:i}=this.getFormPosition(e,o);o.style.top="".concat(n,"px");o.style.left="".concat(i,"px");
var a=o.querySelector('textarea[name="note_text"]');if(a){a.focus()}
var s=o.querySelector('input[name="highlight_text"]');if(s){s.value=r===null||r===void 0?void 0:r.text}
var l=o.querySelector('input[name="highlight_serialized"]');if(l){l.value=JSON.stringify(r)}
document.body.classList.add("tutor-overflow-hidden")}}handleLessonNavTakeNoteButton(t){var e=t.closest("#tutor-lesson-nav-take-note-btn");var o=document.querySelector(".tutor-lesson-note-form-wrapper");if(e&&o){o.classList.remove("tutor-d-none");
var{top:r,left:n}=this.getFormPosition(e,o);o.style.top="".concat(r,"px");o.style.left="".concat(n,"px");
var i=o.querySelector('textarea[name="note_text"]');if(i){i.focus()}
document.body.classList.add("tutor-overflow-hidden");
var a=window.TutorLessonPlayer;if(a&&typeof a.currentTime==="number"){var s=Math.floor(a.currentTime);var l=o.querySelector('input[name="video_start_time"]');if(l){l.value=s}var d=o.querySelector(".tutor-lesson-note-start-time");if(d){var u=Math.floor(s/60);var c=s%60;d.textContent="".concat(u.toString().padStart(2,"0"),":").concat(c.toString().padStart(2,"0")," -");d.classList.remove("tutor-d-none")}}}}handleVideoAction(t){var e=t.closest(".tutor-lesson-note-list-item-video-action");if(!e)return;var o=e.getAttribute("data-start-time");var r=window.TutorLessonPlayer;if(r&&o){var n=document.querySelector(".tutor-video-player-wrapper");if(n){n.scrollIntoView({behavior:"smooth",block:"center"})}
r.currentTime=Number(o);r.play()}}handleLoadMoreNotes(t,e){return n(function*(){var{__}=wp.i18n;t.preventDefault();var o=e;var r=o.getAttribute("data-lesson-id");var n=o.getAttribute("data-items-per-page")||20;var i=document.querySelectorAll(".tutor-lesson-note-list-item").length||0;if(!r){tutor_toast(__("Failed","tutor-pro"),__("Invalid lesson, please try again","tutor-pro"),"error");return}try{o.setAttribute("disabled",true);o.classList.add("is-loading");var a=yield d(l({action:"tutor_pro_lesson_notes_load_more",lesson_id:r,offset:i}));var{status_code:s,data:u,message:c}=yield a.json();if(s===200&&(u===null||u===void 0?void 0:u.html)){var h=document.querySelector(".tutor-lesson-note-list");if(h){h.insertAdjacentHTML("beforeend",u.html)}
if(u.notes_count<n){o.classList.add("tutor-d-none")}else{o.classList.remove("tutor-d-none")}}else{tutor_toast(__("Failed","tutor-pro"),c||this.defaultErrorMessage,"error")}}catch(t){tutor_toast(__("Failed","tutor-pro"),this.defaultErrorMessage,"error")}finally{o.removeAttribute("disabled");o.classList.remove("is-loading")}}).call(this)}handleHighlightedTextClick(t,e){e.classList.add("has-popover");var o=e.getAttribute("data-note-id");var r=e.getAttribute("data-lesson-id");var n=e.getAttribute("data-note-content");var i=e.getAttribute("data-highlight-text");if(o){
var a=document.querySelector(".tutor-note-popover");if(a){a.remove()}var s=document.createElement("div");s.className="tutor-note-popover";s.innerHTML='\n                <div class="tutor-note-popover-content">\n                    <div class="tutor-note-popover-top">\n                        <div class="tutor-note-popover-highlight">'.concat(i,'</div>\n                        <button class="tutor-note-popover-close">\n                            <svg width="16" height="16" viewBox="0 0 20 20" fill="none" role="presentation" aria-hidden="true">\n                                <path d="M4.99957 4.32574C5.13387 4.32574 5.26447 4.36558 5.37457 4.43903L5.47711 4.52301L15.4761 14.522L15.565 14.6236C15.5912 14.6603 15.614 14.6994 15.6324 14.7408C15.6692 14.8235 15.6884 14.9129 15.69 15.0035C15.6916 15.0941 15.6751 15.1841 15.6412 15.2681C15.6072 15.3522 15.5568 15.4286 15.4927 15.4927C15.4286 15.5568 15.3522 15.6072 15.2681 15.6412C15.1841 15.6751 15.0941 15.6916 15.0035 15.69C14.9129 15.6884 14.8235 15.6692 14.7408 15.6324C14.6585 15.5957 14.5846 15.5428 14.523 15.4771L4.52301 5.47711C4.3966 5.35055 4.32574 5.17845 4.32574 4.99957C4.32586 4.82085 4.39671 4.64947 4.52301 4.52301C4.64947 4.39671 4.82085 4.32586 4.99957 4.32574Z" fill="currentColor" stroke="currentColor" stroke-width="0.1"></path>\n                                <path d="M15 4.32574C15.1787 4.32574 15.35 4.39674 15.4765 4.52301H15.4775C15.6037 4.64945 15.6747 4.82096 15.6748 4.99957C15.6748 5.17837 15.6038 5.35057 15.4775 5.47711L5.47751 15.4771L5.47556 15.4781C5.34765 15.5973 5.17866 15.6628 5.00388 15.6597C4.829 15.6566 4.66173 15.5852 4.53806 15.4615C4.4146 15.3379 4.34396 15.1713 4.34079 14.9966C4.3377 14.8218 4.40223 14.6519 4.52145 14.524L4.52341 14.523L14.5234 4.52301C14.6499 4.39672 14.8212 4.32575 15 4.32574Z" fill="currentColor" stroke="currentColor" stroke-width="0.1"></path>\n                            </svg>\n                        </button>\n                    </div>\n                    <div class="tutor-note-popover-note">').concat(n,'</div>\n                    <div class="tutor-note-popover-buttons">\n                        <button class="tutor-btn tutor-note-popover-edit-button">\n                            <svg width="16" height="16" viewBox="0 0 20 20" fill="none" role="presentation" aria-hidden="true">\n                                <path d="M11.659 3.50836C12.2551 2.86246 12.5532 2.53952 12.8699 2.35114C13.6342 1.89661 14.5753 1.88247 15.3523 2.31386C15.6743 2.49264 15.9815 2.8065 16.596 3.43421C17.2105 4.06192 17.5178 4.37577 17.6927 4.70474C18.115 5.49849 18.1012 6.45983 17.6562 7.24056C17.4718 7.56413 17.1557 7.86862 16.5234 8.4776L9.00048 15.7234C7.8023 16.8775 7.2032 17.4546 6.45445 17.747C5.7057 18.0394 4.88256 18.0179 3.23629 17.9749L3.0123 17.969C2.51113 17.9559 2.26054 17.9494 2.11487 17.784C1.9692 17.6187 1.98909 17.3634 2.02886 16.853L2.05047 16.5758C2.16241 15.1388 2.21838 14.4204 2.49897 13.7746C2.77955 13.1287 3.26355 12.6044 4.23154 11.5556L11.659 3.50836Z" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round"></path>\n                                <path d="M10.7998 3.59961L16.3998 9.19961" stroke="currentColor" stroke-width="1.3" stroke-linejoin="round"></path>\n                                <path d="M11.5996 17.999H17.9996" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"></path>\n                            </svg>\n                        </button>\n                        <button class="tutor-btn tutor-confirm-delete-note-button" data-note-id="').concat(o,'" data-lesson-id="').concat(r,'">\n                            <svg width="16" height="16" viewBox="0 0 20 20" fill="none" role="presentation" aria-hidden="true">\n                                <path d="M16.25 4.58301L15.7336 12.9373C15.6016 15.0717 15.5357 16.1389 15.0007 16.9063C14.7361 17.2856 14.3956 17.6058 14.0006 17.8463C13.2017 18.333 12.1325 18.333 9.99392 18.333C7.8526 18.333 6.78192 18.333 5.98254 17.8454C5.58733 17.6044 5.24667 17.2837 4.98223 16.9037C4.4474 16.1352 4.38287 15.0664 4.25384 12.929L3.75 4.58301" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n                                <path d="M2.5 4.58268H17.5M13.3797 4.58268L12.8109 3.40912C12.433 2.62957 12.244 2.23978 11.9181 1.99669C11.8458 1.94277 11.7693 1.8948 11.6892 1.85327C11.3283 1.66602 10.8951 1.66602 10.0287 1.66602C9.14067 1.66602 8.69667 1.66602 8.32973 1.86112C8.24842 1.90436 8.17082 1.95427 8.09774 2.01032C7.76803 2.26327 7.58386 2.66731 7.21551 3.4754L6.71077 4.58268" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n                                <path d="M7.91797 13.75V8.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n                                <path d="M12.082 13.75V8.75" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path>\n                            </svg>\n                        </button>\n                    </div>\n                </div>\n            ');
var l=s.querySelector(".tutor-note-popover-highlight");l.textContent=i;document.body.appendChild(s);document.body.classList.add("tutor-overflow-hidden");var{top:d,left:u}=this.getPopoverPosition(t.target,s);s.style.position="fixed";s.style.top="".concat(d,"px");s.style.left="".concat(u,"px");s.style.zIndex="9999";
var c=s.querySelector(".tutor-note-popover-close");if(c){c.addEventListener("click",()=>{e.classList.remove("has-popover");s.remove();document.body.classList.remove("tutor-overflow-hidden")})}
var h=o=>{if(!s.contains(o.target)&&o.target!==t.target){e.classList.remove("has-popover");s.remove();document.removeEventListener("click",h)}
var r=document.querySelector(".tutor-note-popover");var n=document.querySelector(".tutor-lesson-note-form-wrapper:not(.tutor-d-none)");if(!r&&!n){document.body.classList.remove("tutor-overflow-hidden")}};setTimeout(()=>document.addEventListener("click",h),0)}}handleNotePopoverEdit(t,e){t.preventDefault();var{__}=wp.i18n;var o=e.closest(".tutor-note-popover");var r=o.querySelector(".tutor-confirm-delete-note-button").getAttribute("data-note-id");if(r){
o.remove();
var n=document.querySelector(".tutor-lesson-note-form-wrapper");var i=document.querySelector('mark[data-note-id="'.concat(r,'"]'));if(n&&i){
n.classList.remove("tutor-d-none");var{top:a,left:s}=this.getPopoverPosition(i,n);n.style.top="".concat(a,"px");n.style.left="".concat(s,"px");
var l=n.querySelector('textarea[name="note_text"]');if(l){var d=o.querySelector(".tutor-note-popover-note").textContent;l.value=d;l.focus()}
var u=n.querySelector('input[name="note_id"]');if(u){u.value=r}
var c=n.querySelector('input[name="action"]');if(c){c.value="tutor_pro_update_lesson_note"}
var h=document.querySelector(".tutor-lesson-note-form-title");if(h){h.textContent=__("Edit Note","tutor-pro")}
document.body.classList.add("tutor-overflow-hidden")}}}handleOutsideClick(t){var e=window.getSelection();if(e&&!e.isCollapsed){return}var o=[".tutor-lesson-note-form-wrapper","#tutor-take-lesson-note-btn","#tutor-lesson-nav-take-note-btn",".tutor-note-popover-edit-button"];if(!t.target.closest(o.join(","))){this.closeNoteForm(true)}}handleKeydown(t){if(t.key==="Escape"){var e=document.querySelector(".tutor-lesson-note-form-wrapper");if(e&&!e.classList.contains("tutor-d-none")){this.closeNoteForm(true)}
var o=document.querySelector(".tutor-note-popover");if(o){o.remove();document.body.classList.remove("tutor-overflow-hidden")}
var r=document.querySelectorAll(".tutor-highlighted.has-popover");r.forEach(t=>t.classList.remove("has-popover"))}if(t.target&&t.target.matches(".tutor-lesson-notes-form textarea")){if((t.ctrlKey||t.metaKey)&&t.key==="Enter"){t.preventDefault();var n=t.target.closest("form");if(n){n.dispatchEvent(new Event("submit",{cancelable:true,bubbles:true}))}}}}handleMouseup(){var t=document.getElementById("tutor-take-lesson-note-btn");var e=this.getSelectionEndPosition();if(e&&t){t.classList.remove("tutor-d-none");t.style.top="".concat(e.y-54,"px");t.style.left="".concat(e.x-t.clientWidth/2,"px")}}handleScrollResize(){var t=document.getElementById("tutor-take-lesson-note-btn");if(t&&!t.classList.contains("tutor-d-none")){var e=this.getSelectionEndPosition();if(e){t.style.top="".concat(e.y-54,"px");t.style.left="".concat(e.x-t.clientWidth/2,"px")}}}handleFocusin(t){if(t.target&&t.target.matches(".tutor-notes-tab-content-form textarea")){var e=t.target.closest(".tutor-notes-tab-content-form").querySelector(".tutor-lesson-notes-form-buttons");if(e){e.classList.remove("tutor-d-none")}}}handleNoteHover(t){var e=t.target.dataset.noteId;if(!e)return;var o=document.querySelectorAll('.tutor-highlighted[data-note-id="'.concat(e,'"]'));o.forEach(t=>t.classList.add("note-hover"))}handleNoteHoverOut(t){var e=t.target.dataset.noteId;if(!e)return;var o=document.querySelectorAll('.tutor-highlighted[data-note-id="'.concat(e,'"]'));o.forEach(t=>t.classList.remove("note-hover"))}handleTutorTabChanged(t){this.closeNoteForm();var e=document.getElementById("tutor-lesson-nav-take-note-btn");if(e){if(t.detail&&["tutor-course-spotlight-notes","notes"].includes(t.detail.tabId)){e.classList.add("tutor-d-none")}else{e.classList.remove("tutor-d-none")}}}handleTutorLessonPlayerReady(t){var e=t.detail.player;if(e){var o=false;
e.on("enterfullscreen",t=>{var e=t.srcElement;var r=document.querySelector("#tutor-lesson-nav-take-note-btn");var n=document.querySelector(".tutor-lesson-note-form-wrapper");if(e&&r&&n){r.classList.add("tutor-video-lesson-take-note-button");if(r.classList.contains("tutor-d-none")){r.classList.remove("tutor-d-none");o=true}e.appendChild(r);n.classList.add("tutor-player-fullscreen");e.appendChild(n);
var i=document.createElement("div");i.classList.add("tutor-toast-parent","tutor-toast-left");e.appendChild(i)}});
e.on("exitfullscreen",t=>{var e=t.srcElement;var r=document.querySelector(".tutor-course-spotlight-nav")||document.querySelector(".tutor-tabs-nav");var n=document.querySelector(".tutor-course-spotlight-tab")||document.querySelector(".tutor-tabs-content");var i=document.querySelector("#tutor-lesson-nav-take-note-btn");var a=document.querySelector(".tutor-lesson-note-form-wrapper");if(r&&n&&i&&a){i.classList.remove("tutor-video-lesson-take-note-button");if(o){i.classList.add("tutor-d-none");o=false}r.appendChild(i);a.classList.remove("tutor-player-fullscreen");n.appendChild(a)}
var s=document.querySelector(".tutor-toast-parent");if(s&&e){e.removeChild(s)}
if(this.isNoteFormOpen()){this.closeNoteForm(false)}})}}handleTextareaInput(t){if(t.target&&t.target.matches('.tutor-lesson-notes-form textarea[name="note_text"]')){var e=t.target.closest(".tutor-lesson-notes-form");if(e){var o=e.querySelector(".tutor-lesson-notes-form-key-hint");if(o){if(t.target.value.trim().length>0){o.parentElement.classList.remove("tutor-justify-end");o.parentElement.classList.add("tutor-justify-between");o.classList.remove("tutor-d-none")}else{o.parentElement.classList.add("tutor-justify-end");o.parentElement.classList.remove("tutor-justify-between");o.classList.add("tutor-d-none")}}}}}constructor(){this.highlighter=null;this.defaultErrorMessage="";this.lessonWrapper=null;this.init()}}
window.addEventListener("DOMContentLoaded",()=>{new v})})();
(()=>{"use strict";var e={};
var t={};
function r(o){
var s=t[o];if(s!==undefined){return s.exports}
var a=t[o]={exports:{}};
e[o](a,a.exports,r);
return a.exports}
(()=>{r.rv=()=>"1.6.5"})();
(()=>{r.ruid="bundler=rspack@1.6.5"})();
const o=wp.i18n;
var s={TAB_CHANGE:"tutor-tab-change",MODAL_OPEN:"tutor-modal-open",MODAL_UPDATE:"tutor-modal-update",MODAL_CLOSE:"tutor-modal-close",MODAL_CLOSED:"tutor-modal-closed",TOAST_SHOW:"tutor-toast-show",TOAST_CLEAR:"tutor-toast-clear",FORM_REGISTER:"tutor-form-register",FORM_UNREGISTER:"tutor-form-unregister",FORM_STATE_CHANGE:"tutor-form-state-change",FORM_RESET:"tutor-form-reset",WP_EDITOR_FOCUS:"wp-editor-focus",TUTOR_PLAYER_READY:"tutor-player-ready",COMMENT_REPLIED:"tutor:comment:replied",LESSON_PLAYER_READY:"tutorLessonPlayerReady",QUIZ_TIME_EXPIRED:"tutor-quiz-time-expired",QUIZ_ABANDON_REQUESTED:"tutor-quiz-abandon-requested",QUIZ_ATTEMPT_COMPLETED:"tutor-quiz-attempt-completed"};
var a="tutor-lesson-note-";var i="tutor-note-content-";var n="tutor-create-lesson-note-form";var l="tutor-edit-lesson-note-form-";var d="delete-note-modal";var u={NOTE_ITEM:"tutor-lesson-note"};var h={NOTE_SAVED:"tutor-note-saved",NOTE_DELETED:"tutor-note-deleted"};var c=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;var{query:r,form:c,modal:m,toast:_}=window.TutorCore;var{wpPost:f}=window.TutorCore.api;var{convertToErrorMessage:E}=window.TutorCore.error;return{query:r,lessonId:e||null,editingId:null,totalNotes:t,currentPage:1,loading:false,hasMore:true,currentOrder:"DESC",currentType:"",isReloading:false,isEmpty:false,$el:null,$refs:{},createMutation:null,deleteMutation:null,updateMutation:null,init(){
var e=new URL(window.location.href);var t=e.searchParams.get("order");this.currentOrder=t==="ASC"?"ASC":"DESC";var r=e.searchParams.get("type");this.currentType=r||"";this.currentPage=1;var s=this.$refs.noteList.querySelectorAll(":scope > .".concat(u.NOTE_ITEM)).length;this.hasMore=this.totalNotes>s;this.isEmpty=s===0;this.initInfiniteScroll();
document.addEventListener(h.NOTE_SAVED,()=>{this.reloadNotes()});
document.addEventListener(h.NOTE_DELETED,()=>{this.reloadNotes()});this.handleInitialPlayTime();
this.createMutation=this.query.useMutation(this.createNote,{onSuccess:e=>{_.success(e.message||(0,o.__)("Note created successfully","tutor-pro"));var t=e.data;if(t===null||t===void 0?void 0:t.html){if(this.currentOrder==="DESC"){this.$refs.noteList.insertAdjacentHTML("afterbegin",t.html)}else if(!this.hasMore){this.$refs.noteList.insertAdjacentHTML("beforeend",t.html)}}this.totalNotes++;this.isEmpty=false;var r=n;if(c.hasForm(r)){c.reset(r)}},onError:e=>{_.error(E(e))}});
this.deleteMutation=this.query.useMutation(this.deleteNote,{onSuccess:(e,t)=>{m.closeModal(d);_.success(e.message||(0,o.__)("Note deleted successfully","tutor-pro"));var r=document.getElementById("".concat(a).concat(t.note_id));if(r){r.remove()}this.totalNotes--;if(this.hasMore){this.loadNextPage()}this.isEmpty=this.$refs.noteList.querySelectorAll(":scope > .".concat(u.NOTE_ITEM)).length===0;
var s=document.querySelectorAll('[data-note-id="'.concat(t.note_id,'"]'));s.forEach(e=>{if(e.tagName.toLowerCase()==="mark"){var t=e.parentNode;while(e.firstChild){t===null||t===void 0?void 0:t.insertBefore(e.firstChild,e)}t===null||t===void 0?void 0:t.removeChild(e);t===null||t===void 0?void 0:t.normalize()}})},onError:e=>{m.closeModal(d);_.error(E(e))}});
this.updateMutation=this.query.useMutation(this.updateNote,{onSuccess:(e,t)=>{_.success(e.message||(0,o.__)("Note updated successfully","tutor-pro"));this.editingId=null;
var r=document.getElementById(i+t.note_id);if(r){r.innerHTML=t.note_text}
var s=document.querySelectorAll('mark[data-note-id="'.concat(t.note_id,'"]'));s.forEach(e=>{e.dataset.noteContent=t.note_text})},onError:e=>{_.error(e.message||(0,o.__)("Failed to update note","tutor-pro"))}})},createNote(e){var t=window.TutorLessonPlayer;if(t&&typeof t.currentTime==="number"){e["video_start_time"]=Math.floor(t.currentTime)}return f("tutor_pro_save_lesson_note",e)},deleteNote(e){return f("tutor_pro_delete_lesson_note",e)},updateNote(e){return f("tutor_pro_update_lesson_note",e)},handleDeleteNote(e,t){m.showModal(d,{note_id:e,lesson_id:t})},handleEditNote(e){this.editingId=e;this.$nextTick(()=>{var t="".concat(l).concat(e);if(c.hasForm(t)){c.setFocus(t,"note_text")}})},handleChangeOrder(e){if(this.currentOrder===e)return;this.currentOrder=e;this.updateURLParam("order",e);this.reloadNotes()},handleChangeType(e){if(this.currentType===e)return;this.currentType=e;this.updateURLParam("type",e);this.reloadNotes()},updateURLParam(e,t){var r=new URL(window.location.href);if(t){r.searchParams.set(e,t)}else{r.searchParams.delete(e)}window.history.pushState({},"",r)},reloadNotes(){this.isReloading=true;this.currentPage=1;this.hasMore=false;f("tutor_pro_lesson_notes_load_more",{lesson_id:this.lessonId,offset:0,order:this.currentOrder,type:this.currentType}).then(e=>{var t;this.$refs.noteList.innerHTML=e.data.html;this.hasMore=e.data.has_more;if(e.data.total_notes!==undefined){this.totalNotes=e.data.total_notes}this.isEmpty=!((t=e.data.html)===null||t===void 0?void 0:t.trim())}).catch(e=>{_.error(E(e))}).finally(()=>{this.isReloading=false})},loadNextPage(){if(!this.lessonId||this.loading||!this.hasMore){return}this.loading=true;
var e=this.$refs.noteList.querySelectorAll(":scope > .".concat(u.NOTE_ITEM)).length;f("tutor_pro_lesson_notes_load_more",{lesson_id:this.lessonId,offset:e,order:this.currentOrder,type:this.currentType}).then(e=>{var t;if(e.data.has_more!==undefined){this.hasMore=e.data.has_more}if((t=e.data.html)===null||t===void 0?void 0:t.trim()){this.currentPage++;this.$refs.noteList.insertAdjacentHTML("beforeend",e.data.html)}this.isEmpty=this.$refs.noteList.querySelectorAll(":scope > .".concat(u.NOTE_ITEM)).length===0}).catch(e=>{_.error(E(e))}).finally(()=>{this.loading=false})},handlePlayVideoClip(e){var t=e.currentTarget;var r=Number(t.getAttribute("data-start-time"));var o=window.TutorLessonPlayer;if(o){if(typeof o.currentTime!=="undefined"){o.currentTime=r}if(typeof o.play==="function"){o.play()}window.scrollTo({top:0,behavior:"smooth"})}},handleInitialPlayTime(){var e=new URL(window.location.href);var t=e.searchParams.get("tutor_play_time");if(!t)return;var r=parseInt(t);var o=t=>{setTimeout(()=>{t.currentTime=r;
e.searchParams.delete("tutor_play_time");window.history.replaceState({},"",e.toString())},100)};if(window.TutorLessonPlayer){o(window.TutorLessonPlayer)}else{window.addEventListener(s.LESSON_PLAYER_READY,e=>{o(e.detail.player)})}},handleKeydown(e){if((e.metaKey||e.ctrlKey)&&e.key==="Enter"){var t;(t=e.target.closest("form"))===null||t===void 0?void 0:t.requestSubmit()}},initInfiniteScroll(){var e=new IntersectionObserver(e=>{var[t]=e;if(t.isIntersecting&&this.hasMore&&!this.loading){this.loadNextPage()}},{rootMargin:"200px"});e.observe(this.$refs.loadMoreTrigger)}}};var m=()=>{window.TutorComponentRegistry.register({type:"component",meta:{name:"learningAreaNotes",component:c}});window.TutorComponentRegistry.initWithAlpine(window.Alpine)};document.addEventListener("alpine:init",m)})();
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=0)}({0:function(t,e,r){r("qGtB"),r("jxXz"),r("cWzd"),r("RkYc"),t.exports=r("1P/x")},"1P/x":function(t,e){},Mugk:function(t,e){!function(){var t=document.querySelector(".tutor-signup-form");if(null!==t){t.addEventListener("submit",(function(t){t.preventDefault();var e=new XMLHttpRequest,r=tutorstarter_vars.ajaxurl,n=tutorstarter_vars.authRedirectUrl,o=document.querySelector(".signup-status"),i=new FormData,a=document.querySelector("#fullname").value,u=document.querySelector("#email").value,c=document.querySelector("#password").value,s=document.querySelector("#confirm-password").value,l=document.querySelector("#signup-nonce").value;i.append("username",a),i.append("email",u),i.append("password",c),i.append("confirm_password",s),i.append("action","ajaxregister"),i.append("signupNonce",l),e.open("POST",r),e.onreadystatechange=function(){if(4===this.readyState&&200===this.status){var t=JSON.parse(this.responseText);o.style.visibility="visible",1==t.loggedin?(o.style.color="#4285F4",o.innerText=t.message,window.location.replace(n)):(o.style.color="#dc3545",o.innerText=t.message)}},e.send(i)}))}}()},RkYc:function(t,e){},TOF7:function(t,e){var r=document.querySelector(".cart-contents .tutor_native_cart_count");document.addEventListener("tutorAddToCartEvent",(function(t){r.textContent="(".concat(t.detail.cart_count,")")})),document.addEventListener("tutorRemoveCartEvent",(function(t){r.textContent=t.detail.cart_count?"(".concat(t.detail.cart_count,")"):""}))},cWzd:function(t,e){},jxXz:function(t,e){},qGtB:function(t,e,r){"use strict";r.r(e);r("wcBj"),r("Mugk"),r("z3Z2"),r("vr5C"),r("TOF7")},vr5C:function(t,e){function r(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}!function(){var t=document.querySelector(".navbar-toggler"),e=document.querySelector(".navbar-nav"),n=document.querySelector(".btn-nav-close"),o=document.querySelector(".search-field-popup .close-btn"),i=window.matchMedia("(max-width: 991px)"),a=r(document.querySelectorAll("#menu-primary li"));a=a[a.length-1],null!==t&&t.addEventListener("click",(function(){e.classList.add("active")})),null!==n&&n.addEventListener("click",(function(){e.classList.remove("active")}));var u=document.querySelectorAll(".menu-item");null!==u&&u.forEach((function(t){null!==t.querySelector(".sub-menu")&&t.classList.add("icon")})),window.addEventListener("scroll",(function(){var t=document.querySelector(".header-sticky");null!==t&&t.classList.toggle("sticky-on",window.scrollY>200)}));var c=document.querySelector(".navbar-utils .btn-search"),s=document.querySelector(".search-field-popup");null!==c&&c.addEventListener("click",(function(){null!==s&&s.classList.toggle("show")})),null!==o&&o.addEventListener("click",(function(t){t.preventDefault(),s.classList.remove("show")}));var l=document.querySelector(".navbar-toggler");function f(t){t.preventDefault(),n.focus()}null===l&&void 0===l&&"undefined"===l||window.addEventListener("resize",(function(){i.matches?null==l||l.addEventListener("click",(function(t){a&&a.addEventListener("keydown",f,!1),n.addEventListener("click",(function(){document.querySelector("header + div a").focus()}))})):a&&a.removeEventListener("keydown",f,!1)}));var d=document.querySelector(".tutor-header-profile-menu-items");null!==d&&d.addEventListener("click",(function(){d.classList.toggle("active")}))}()},wcBj:function(t,e){!function(){var t=document.querySelector(".tutor-signin-form");if(null!==t){t.addEventListener("submit",(function(t){t.preventDefault();var e=new XMLHttpRequest,r=tutorstarter_vars.ajaxurl,n=tutorstarter_vars.authRedirectUrl,o=document.querySelector(".signup-status"),i=new FormData,a=document.querySelector("#login_email").value,u=document.querySelector("#login_password").value,c=document.querySelector("#signin-nonce").value;i.append("email",a),i.append("password",u),i.append("action","ajaxlogin"),i.append("signinNonce",c),e.open("POST",r),e.onreadystatechange=function(){if(4===this.readyState&&200===this.status){var t=JSON.parse(this.responseText);o.style.visibility="visible",1==t.loggedin?(o.style.color="#4285F4",o.innerText=t.message,window.location.replace(n)):(o.style.color="#dc3545",o.innerText=t.message)}},e.send(i)}))}}()},z3Z2:function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(){"use strict";n=function(){return e};var t,e={},o=Object.prototype,i=o.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(e,r,n,o){var i=r&&r.prototype instanceof h?r:h,a=Object.create(i.prototype);return l(a,"_invoke",function(e,r,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=S(u,n);if(c){if(c===p)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var s=d(e,r,n);if("normal"===s.type){if(o=n.done?4:2,s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=4,n.method="throw",n.arg=s.arg)}}}(e,n,new k(o||[])),!0),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var p={};function h(){}function v(){}function y(){}var m={};l(m,u,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(q([])));w&&w!==o&&i.call(w,u)&&(m=w);var b=y.prototype=h.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function n(o,a,u,c){var s=d(t[o],t,a);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==r(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,u,c)}),(function(t){n("throw",t,u,c)})):e.resolve(f).then((function(t){l.value=t,u(l)}),(function(t){return n("throw",t,u,c)}))}c(s.arg)}var o;l(this,"_invoke",(function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}),!0)}function S(e,r){var n=r.method,o=e.i[n];if(o===t)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var i=d(o,e.i,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,p;var a=i.arg;return a?a.done?(r[e.r]=a.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,p):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function E(t){this.tryEntries.push(t)}function j(e){var r=e[4]||{};r.type="normal",r.arg=t,e[4]=r}function k(t){this.tryEntries=[[-1]],t.forEach(E,this),this.reset(!0)}function q(e){if(null!=e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return v.prototype=y,l(b,"constructor",y),l(y,"constructor",v),v.displayName=l(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},e.awrap=function(t){return{__await:t}},x(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(b),l(b,s,"Generator"),l(b,u,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function t(){for(;r.length;)if((n=r.pop())in e)return t.value=n,t.done=!1,t;return t.done=!0,t}},e.values=q,k.prototype={constructor:k,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(j),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t){a.type="throw",a.arg=e,r.next=t}for(var o=r.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],u=this.prev,c=i[1],s=i[2];if(-1===i[0])return n("end"),!1;if(!c&&!s)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=u){if(u<c)return this.method="next",this.arg=t,n(c),!0;if(u<s)return n(s),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],p):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),j(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[0]===t){var n=r[4];if("throw"===n.type){var o=n.arg;j(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={i:q(e),r:r,n:n},"next"===this.method&&(this.arg=t),p}},e}function o(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function u(t){o(a,n,i,u,c,"next",t)}function c(t){o(a,n,i,u,c,"throw",t)}u(void 0)}))}}var a=wp.i18n,u=a.__,c=(a._x,a._n,a._nx,document.getElementById("tutor-starter-create-course"));function s(t){return l.apply(this,arguments)}function l(){return(l=i(n().mark((function t(e){var r;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch(tutorstarter_vars.ajaxurl,{method:"POST",body:e});case 3:return r=t.sent,t.abrupt("return",r);case 7:t.prev=7,t.t0=t.catch(0),tutor_toast(u("Operation failed","tutor"),t.t0,"error");case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))).apply(this,arguments)}c&&c.addEventListener("click",function(){var t=i(n().mark((function t(e){var r,o,i,a;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.preventDefault(),c.setAttribute("disabled","disabled"),c.classList.add("is-loading"),r=u("Something went wrong, please try again","tutor"),(o=new FormData).set("action","tutor_create_new_draft_course"),o.set(window.tutor_get_nonce_data(!0).key,window.tutor_get_nonce_data(!0).value),t.next=9,s(o);case 9:if(!(i=t.sent).ok){t.next=18;break}return c.classList.remove("is-loading"),t.next=14,i.json();case 14:(a=t.sent).success?window.location=a.data.url:a.data.error_message?tutor_toast(u("Failed","tutor"),a.data.error_message,"error"):tutor_toast(u("Failed","tutor"),r,"error"),t.next=19;break;case 18:tutor_toast(u("Failed","tutor"),r,"error");case 19:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}});
window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);
(()=>{var n={243(n,t,r){n=r.nmd(n),function(){var r,e="Expected a function",u="__lodash_hash_undefined__",i="__lodash_placeholder__",o=32,f=128,a=1/0,c=9007199254740991,l=NaN,s=4294967295,h=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",o],["partialRight",64],["rearg",256]],p="[object Arguments]",v="[object Array]",_="[object Boolean]",g="[object Date]",y="[object Error]",d="[object Function]",b="[object GeneratorFunction]",w="[object Map]",m="[object Number]",x="[object Object]",j="[object Promise]",A="[object RegExp]",k="[object Set]",O="[object String]",E="[object Symbol]",I="[object WeakMap]",R="[object ArrayBuffer]",S="[object DataView]",z="[object Float32Array]",T="[object Float64Array]",C="[object Int8Array]",L="[object Int16Array]",W="[object Int32Array]",U="[object Uint8Array]",B="[object Uint8ClampedArray]",$="[object Uint16Array]",D="[object Uint32Array]",M=/\b__p \+='';/g,F=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,Z=RegExp(P.source),K=RegExp(q.source),V=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y=/^\w*$/,Q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,X=/[\\^$.*+?()[\]{}|]/g,nn=RegExp(X.source),tn=/^\s+/,rn=/\s/,en=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,un=/\{\n\/\* \[wrapped with (.+)\] \*/,on=/,? & /,fn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,an=/[()=,{}\[\]\/\s]/,cn=/\\(\\)?/g,ln=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,sn=/\w*$/,hn=/^[-+]0x[0-9a-f]+$/i,pn=/^0b[01]+$/i,vn=/^\[object .+?Constructor\]$/,_n=/^0o[0-7]+$/i,gn=/^(?:0|[1-9]\d*)$/,yn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dn=/($^)/,bn=/['\n\r\u2028\u2029\\]/g,wn="\\ud800-\\udfff",mn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xn="\\u2700-\\u27bf",jn="a-z\\xdf-\\xf6\\xf8-\\xff",An="A-Z\\xc0-\\xd6\\xd8-\\xde",kn="\\ufe0e\\ufe0f",On="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",En="["+wn+"]",In="["+On+"]",Rn="["+mn+"]",Sn="\\d+",zn="["+xn+"]",Tn="["+jn+"]",Cn="[^"+wn+On+Sn+xn+jn+An+"]",Ln="\\ud83c[\\udffb-\\udfff]",Wn="[^"+wn+"]",Un="(?:\\ud83c[\\udde6-\\uddff]){2}",Bn="[\\ud800-\\udbff][\\udc00-\\udfff]",$n="["+An+"]",Dn="\\u200d",Mn="(?:"+Tn+"|"+Cn+")",Fn="(?:"+$n+"|"+Cn+")",Nn="(?:['’](?:d|ll|m|re|s|t|ve))?",Pn="(?:['’](?:D|LL|M|RE|S|T|VE))?",qn="(?:"+Rn+"|"+Ln+")?",Zn="["+kn+"]?",Kn=Zn+qn+"(?:"+Dn+"(?:"+[Wn,Un,Bn].join("|")+")"+Zn+qn+")*",Vn="(?:"+[zn,Un,Bn].join("|")+")"+Kn,Gn="(?:"+[Wn+Rn+"?",Rn,Un,Bn,En].join("|")+")",Hn=RegExp("['’]","g"),Jn=RegExp(Rn,"g"),Yn=RegExp(Ln+"(?="+Ln+")|"+Gn+Kn,"g"),Qn=RegExp([$n+"?"+Tn+"+"+Nn+"(?="+[In,$n,"$"].join("|")+")",Fn+"+"+Pn+"(?="+[In,$n+Mn,"$"].join("|")+")",$n+"?"+Mn+"+"+Nn,$n+"+"+Pn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sn,Vn].join("|"),"g"),Xn=RegExp("["+Dn+wn+mn+kn+"]"),nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,et={};et[z]=et[T]=et[C]=et[L]=et[W]=et[U]=et[B]=et[$]=et[D]=!0,et[p]=et[v]=et[R]=et[_]=et[S]=et[g]=et[y]=et[d]=et[w]=et[m]=et[x]=et[A]=et[k]=et[O]=et[I]=!1;var ut={};ut[p]=ut[v]=ut[R]=ut[S]=ut[_]=ut[g]=ut[z]=ut[T]=ut[C]=ut[L]=ut[W]=ut[w]=ut[m]=ut[x]=ut[A]=ut[k]=ut[O]=ut[E]=ut[U]=ut[B]=ut[$]=ut[D]=!0,ut[y]=ut[d]=ut[I]=!1;var it={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,ft=parseInt,at="object"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis,ct="object"==typeof self&&self&&self.Object===Object&&self,lt=at||ct||Function("return this")(),st=t&&!t.nodeType&&t,ht=st&&n&&!n.nodeType&&n,pt=ht&&ht.exports===st,vt=pt&&at.process,_t=function(){try{return ht&&ht.require&&ht.require("util").types||vt&&vt.binding&&vt.binding("util")}catch(n){}}(),gt=_t&&_t.isArrayBuffer,yt=_t&&_t.isDate,dt=_t&&_t.isMap,bt=_t&&_t.isRegExp,wt=_t&&_t.isSet,mt=_t&&_t.isTypedArray;function xt(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function jt(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function At(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&!1!==t(n[r],r,n););return n}function kt(n,t){for(var r=null==n?0:n.length;r--&&!1!==t(n[r],r,n););return n}function Ot(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;return!0}function Et(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function It(n,t){return!(null==n||!n.length)&&$t(n,t,0)>-1}function Rt(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function St(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function zt(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function Tt(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function Ct(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function Lt(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}var Wt=Nt("length");function Ut(n,t,r){var e;return r(n,function(n,r,u){if(t(n,r,u))return e=r,!1}),e}function Bt(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function $t(n,t,r){return t==t?function(n,t,r){for(var e=r-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1}(n,t,r):Bt(n,Mt,r)}function Dt(n,t,r,e){for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function Mt(n){return n!=n}function Ft(n,t){var r=null==n?0:n.length;return r?Zt(n,t)/r:l}function Nt(n){return function(t){return null==t?r:t[n]}}function Pt(n){return function(t){return null==n?r:n[t]}}function qt(n,t,r,e,u){return u(n,function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)}),r}function Zt(n,t){for(var e,u=-1,i=n.length;++u<i;){var o=t(n[u]);o!==r&&(e=e===r?o:e+o)}return e}function Kt(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function Vt(n){return n?n.slice(0,lr(n)+1).replace(tn,""):n}function Gt(n){return function(t){return n(t)}}function Ht(n,t){return St(t,function(t){return n[t]})}function Jt(n,t){return n.has(t)}function Yt(n,t){for(var r=-1,e=n.length;++r<e&&$t(t,n[r],0)>-1;);return r}function Qt(n,t){for(var r=n.length;r--&&$t(t,n[r],0)>-1;);return r}var Xt=Pt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"}),nr=Pt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function tr(n){return"\\"+it[n]}function rr(n){return Xn.test(n)}function er(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function ur(n,t){return function(r){return n(t(r))}}function ir(n,t){for(var r=-1,e=n.length,u=0,o=[];++r<e;){var f=n[r];f!==t&&f!==i||(n[r]=i,o[u++]=r)}return o}function or(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=n}),r}function fr(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=[n,n]}),r}function ar(n){return rr(n)?function(n){for(var t=Yn.lastIndex=0;Yn.test(n);)++t;return t}(n):Wt(n)}function cr(n){return rr(n)?function(n){return n.match(Yn)||[]}(n):function(n){return n.split("")}(n)}function lr(n){for(var t=n.length;t--&&rn.test(n.charAt(t)););return t}var sr=Pt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),hr=function n(t){var rn,wn=(t=null==t?lt:hr.defaults(lt.Object(),t,hr.pick(lt,tt))).Array,mn=t.Date,xn=t.Error,jn=t.Function,An=t.Math,kn=t.Object,On=t.RegExp,En=t.String,In=t.TypeError,Rn=wn.prototype,Sn=jn.prototype,zn=kn.prototype,Tn=t["__core-js_shared__"],Cn=Sn.toString,Ln=zn.hasOwnProperty,Wn=0,Un=(rn=/[^.]+$/.exec(Tn&&Tn.keys&&Tn.keys.IE_PROTO||""))?"Symbol(src)_1."+rn:"",Bn=zn.toString,$n=Cn.call(kn),Dn=lt._,Mn=On("^"+Cn.call(Ln).replace(X,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fn=pt?t.Buffer:r,Nn=t.Symbol,Pn=t.Uint8Array,qn=Fn?Fn.allocUnsafe:r,Zn=ur(kn.getPrototypeOf,kn),Kn=kn.create,Vn=zn.propertyIsEnumerable,Gn=Rn.splice,Yn=Nn?Nn.isConcatSpreadable:r,Xn=Nn?Nn.iterator:r,it=Nn?Nn.toStringTag:r,at=function(){try{var n=ai(kn,"defineProperty");return n({},"",{}),n}catch(n){}}(),ct=t.clearTimeout!==lt.clearTimeout&&t.clearTimeout,st=mn&&mn.now!==lt.Date.now&&mn.now,ht=t.setTimeout!==lt.setTimeout&&t.setTimeout,vt=An.ceil,_t=An.floor,Wt=kn.getOwnPropertySymbols,Pt=Fn?Fn.isBuffer:r,pr=t.isFinite,vr=Rn.join,_r=ur(kn.keys,kn),gr=An.max,yr=An.min,dr=mn.now,br=t.parseInt,wr=An.random,mr=Rn.reverse,xr=ai(t,"DataView"),jr=ai(t,"Map"),Ar=ai(t,"Promise"),kr=ai(t,"Set"),Or=ai(t,"WeakMap"),Er=ai(kn,"create"),Ir=Or&&new Or,Rr={},Sr=Ui(xr),zr=Ui(jr),Tr=Ui(Ar),Cr=Ui(kr),Lr=Ui(Or),Wr=Nn?Nn.prototype:r,Ur=Wr?Wr.valueOf:r,Br=Wr?Wr.toString:r;function $r(n){if(nf(n)&&!Po(n)&&!(n instanceof Nr)){if(n instanceof Fr)return n;if(Ln.call(n,"__wrapped__"))return Bi(n)}return new Fr(n)}var Dr=function(){function n(){}return function(t){if(!Xo(t))return{};if(Kn)return Kn(t);n.prototype=t;var e=new n;return n.prototype=r,e}}();function Mr(){}function Fr(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Nr(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=s,this.__views__=[]}function Pr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function qr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Zr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Kr(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new Zr;++t<r;)this.add(n[t])}function Vr(n){var t=this.__data__=new qr(n);this.size=t.size}function Gr(n,t){var r=Po(n),e=!r&&No(n),u=!r&&!e&&Vo(n),i=!r&&!e&&!u&&cf(n),o=r||e||u||i,f=o?Kt(n.length,En):[],a=f.length;for(var c in n)!t&&!Ln.call(n,c)||o&&("length"==c||u&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||_i(c,a))||f.push(c);return f}function Hr(n){var t=n.length;return t?n[Ze(0,t-1)]:r}function Jr(n,t){return zi(Ou(n),ie(t,0,n.length))}function Yr(n){return zi(Ou(n))}function Qr(n,t,e){(e!==r&&!Do(n[t],e)||e===r&&!(t in n))&&ee(n,t,e)}function Xr(n,t,e){var u=n[t];Ln.call(n,t)&&Do(u,e)&&(e!==r||t in n)||ee(n,t,e)}function ne(n,t){for(var r=n.length;r--;)if(Do(n[r][0],t))return r;return-1}function te(n,t,r,e){return le(n,function(n,u,i){t(e,n,r(n),i)}),e}function re(n,t){return n&&Eu(t,zf(t),n)}function ee(n,t,r){"__proto__"==t&&at?at(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}function ue(n,t){for(var e=-1,u=t.length,i=wn(u),o=null==n;++e<u;)i[e]=o?r:Of(n,t[e]);return i}function ie(n,t,e){return n==n&&(e!==r&&(n=n<=e?n:e),t!==r&&(n=n>=t?n:t)),n}function oe(n,t,e,u,i,o){var f,a=1&t,c=2&t,l=4&t;if(e&&(f=i?e(n,u,i,o):e(n)),f!==r)return f;if(!Xo(n))return n;var s=Po(n);if(s){if(f=function(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&Ln.call(n,"index")&&(r.index=n.index,r.input=n.input),r}(n),!a)return Ou(n,f)}else{var h=si(n),v=h==d||h==b;if(Vo(n))return wu(n,a);if(h==x||h==p||v&&!i){if(f=c||v?{}:pi(n),!a)return c?function(n,t){return Eu(n,li(n),t)}(n,function(n,t){return n&&Eu(t,Tf(t),n)}(f,n)):function(n,t){return Eu(n,ci(n),t)}(n,re(f,n))}else{if(!ut[h])return i?n:{};f=function(n,t,r){var e,u=n.constructor;switch(t){case R:return mu(n);case _:case g:return new u(+n);case S:return function(n,t){var r=t?mu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}(n,r);case z:case T:case C:case L:case W:case U:case B:case $:case D:return xu(n,r);case w:return new u;case m:case O:return new u(n);case A:return function(n){var t=new n.constructor(n.source,sn.exec(n));return t.lastIndex=n.lastIndex,t}(n);case k:return new u;case E:return e=n,Ur?kn(Ur.call(e)):{}}}(n,h,a)}}o||(o=new Vr);var y=o.get(n);if(y)return y;o.set(n,f),of(n)?n.forEach(function(r){f.add(oe(r,t,e,r,n,o))}):tf(n)&&n.forEach(function(r,u){f.set(u,oe(r,t,e,u,n,o))});var j=s?r:(l?c?ti:ni:c?Tf:zf)(n);return At(j||n,function(r,u){j&&(r=n[u=r]),Xr(f,u,oe(r,t,e,u,n,o))}),f}function fe(n,t,e){var u=e.length;if(null==n)return!u;for(n=kn(n);u--;){var i=e[u],o=t[i],f=n[i];if(f===r&&!(i in n)||!o(f))return!1}return!0}function ae(n,t,u){if("function"!=typeof n)throw new In(e);return Ei(function(){n.apply(r,u)},t)}function ce(n,t,r,e){var u=-1,i=It,o=!0,f=n.length,a=[],c=t.length;if(!f)return a;r&&(t=St(t,Gt(r))),e?(i=Rt,o=!1):t.length>=200&&(i=Jt,o=!1,t=new Kr(t));n:for(;++u<f;){var l=n[u],s=null==r?l:r(l);if(l=e||0!==l?l:0,o&&s==s){for(var h=c;h--;)if(t[h]===s)continue n;a.push(l)}else i(t,s,e)||a.push(l)}return a}$r.templateSettings={escape:V,evaluate:G,interpolate:H,variable:"",imports:{_:$r}},$r.prototype=Mr.prototype,$r.prototype.constructor=$r,Fr.prototype=Dr(Mr.prototype),Fr.prototype.constructor=Fr,Nr.prototype=Dr(Mr.prototype),Nr.prototype.constructor=Nr,Pr.prototype.clear=function(){this.__data__=Er?Er(null):{},this.size=0},Pr.prototype.delete=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t},Pr.prototype.get=function(n){var t=this.__data__;if(Er){var e=t[n];return e===u?r:e}return Ln.call(t,n)?t[n]:r},Pr.prototype.has=function(n){var t=this.__data__;return Er?t[n]!==r:Ln.call(t,n)},Pr.prototype.set=function(n,t){var e=this.__data__;return this.size+=this.has(n)?0:1,e[n]=Er&&t===r?u:t,this},qr.prototype.clear=function(){this.__data__=[],this.size=0},qr.prototype.delete=function(n){var t=this.__data__,r=ne(t,n);return!(r<0||(r==t.length-1?t.pop():Gn.call(t,r,1),--this.size,0))},qr.prototype.get=function(n){var t=this.__data__,e=ne(t,n);return e<0?r:t[e][1]},qr.prototype.has=function(n){return ne(this.__data__,n)>-1},qr.prototype.set=function(n,t){var r=this.__data__,e=ne(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this},Zr.prototype.clear=function(){this.size=0,this.__data__={hash:new Pr,map:new(jr||qr),string:new Pr}},Zr.prototype.delete=function(n){var t=oi(this,n).delete(n);return this.size-=t?1:0,t},Zr.prototype.get=function(n){return oi(this,n).get(n)},Zr.prototype.has=function(n){return oi(this,n).has(n)},Zr.prototype.set=function(n,t){var r=oi(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},Kr.prototype.add=Kr.prototype.push=function(n){return this.__data__.set(n,u),this},Kr.prototype.has=function(n){return this.__data__.has(n)},Vr.prototype.clear=function(){this.__data__=new qr,this.size=0},Vr.prototype.delete=function(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r},Vr.prototype.get=function(n){return this.__data__.get(n)},Vr.prototype.has=function(n){return this.__data__.has(n)},Vr.prototype.set=function(n,t){var r=this.__data__;if(r instanceof qr){var e=r.__data__;if(!jr||e.length<199)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Zr(e)}return r.set(n,t),this.size=r.size,this};var le=Su(de),se=Su(be,!0);function he(n,t){var r=!0;return le(n,function(n,e,u){return r=!!t(n,e,u)}),r}function pe(n,t,e){for(var u=-1,i=n.length;++u<i;){var o=n[u],f=t(o);if(null!=f&&(a===r?f==f&&!af(f):e(f,a)))var a=f,c=o}return c}function ve(n,t){var r=[];return le(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function _e(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=vi),u||(u=[]);++i<o;){var f=n[i];t>0&&r(f)?t>1?_e(f,t-1,r,e,u):zt(u,f):e||(u[u.length]=f)}return u}var ge=zu(),ye=zu(!0);function de(n,t){return n&&ge(n,t,zf)}function be(n,t){return n&&ye(n,t,zf)}function we(n,t){return Et(t,function(t){return Jo(n[t])})}function me(n,t){for(var e=0,u=(t=gu(t,n)).length;null!=n&&e<u;)n=n[Wi(t[e++])];return e&&e==u?n:r}function xe(n,t,r){var e=t(n);return Po(n)?e:zt(e,r(n))}function je(n){return null==n?n===r?"[object Undefined]":"[object Null]":it&&it in kn(n)?function(n){var t=Ln.call(n,it),e=n[it];try{n[it]=r;var u=!0}catch(n){}var i=Bn.call(n);return u&&(t?n[it]=e:delete n[it]),i}(n):function(n){return Bn.call(n)}(n)}function Ae(n,t){return n>t}function ke(n,t){return null!=n&&Ln.call(n,t)}function Oe(n,t){return null!=n&&t in kn(n)}function Ee(n,t,e){for(var u=e?Rt:It,i=n[0].length,o=n.length,f=o,a=wn(o),c=1/0,l=[];f--;){var s=n[f];f&&t&&(s=St(s,Gt(t))),c=yr(s.length,c),a[f]=!e&&(t||i>=120&&s.length>=120)?new Kr(f&&s):r}s=n[0];var h=-1,p=a[0];n:for(;++h<i&&l.length<c;){var v=s[h],_=t?t(v):v;if(v=e||0!==v?v:0,!(p?Jt(p,_):u(l,_,e))){for(f=o;--f;){var g=a[f];if(!(g?Jt(g,_):u(n[f],_,e)))continue n}p&&p.push(_),l.push(v)}}return l}function Ie(n,t,e){var u=null==(n=Ai(n,t=gu(t,n)))?n:n[Wi(Gi(t))];return null==u?r:xt(u,n,e)}function Re(n){return nf(n)&&je(n)==p}function Se(n,t,e,u,i){return n===t||(null==n||null==t||!nf(n)&&!nf(t)?n!=n&&t!=t:function(n,t,e,u,i,o){var f=Po(n),a=Po(t),c=f?v:si(n),l=a?v:si(t),s=(c=c==p?x:c)==x,h=(l=l==p?x:l)==x,d=c==l;if(d&&Vo(n)){if(!Vo(t))return!1;f=!0,s=!1}if(d&&!s)return o||(o=new Vr),f||cf(n)?Qu(n,t,e,u,i,o):function(n,t,r,e,u,i,o){switch(r){case S:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case R:return!(n.byteLength!=t.byteLength||!i(new Pn(n),new Pn(t)));case _:case g:case m:return Do(+n,+t);case y:return n.name==t.name&&n.message==t.message;case A:case O:return n==t+"";case w:var f=er;case k:var a=1&e;if(f||(f=or),n.size!=t.size&&!a)return!1;var c=o.get(n);if(c)return c==t;e|=2,o.set(n,t);var l=Qu(f(n),f(t),e,u,i,o);return o.delete(n),l;case E:if(Ur)return Ur.call(n)==Ur.call(t)}return!1}(n,t,c,e,u,i,o);if(!(1&e)){var b=s&&Ln.call(n,"__wrapped__"),j=h&&Ln.call(t,"__wrapped__");if(b||j){var I=b?n.value():n,z=j?t.value():t;return o||(o=new Vr),i(I,z,e,u,o)}}return!!d&&(o||(o=new Vr),function(n,t,e,u,i,o){var f=1&e,a=ni(n),c=a.length;if(c!=ni(t).length&&!f)return!1;for(var l=c;l--;){var s=a[l];if(!(f?s in t:Ln.call(t,s)))return!1}var h=o.get(n),p=o.get(t);if(h&&p)return h==t&&p==n;var v=!0;o.set(n,t),o.set(t,n);for(var _=f;++l<c;){var g=n[s=a[l]],y=t[s];if(u)var d=f?u(y,g,s,t,n,o):u(g,y,s,n,t,o);if(!(d===r?g===y||i(g,y,e,u,o):d)){v=!1;break}_||(_="constructor"==s)}if(v&&!_){var b=n.constructor,w=t.constructor;b==w||!("constructor"in n)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(v=!1)}return o.delete(n),o.delete(t),v}(n,t,e,u,i,o))}(n,t,e,u,Se,i))}function ze(n,t,e,u){var i=e.length,o=i,f=!u;if(null==n)return!o;for(n=kn(n);i--;){var a=e[i];if(f&&a[2]?a[1]!==n[a[0]]:!(a[0]in n))return!1}for(;++i<o;){var c=(a=e[i])[0],l=n[c],s=a[1];if(f&&a[2]){if(l===r&&!(c in n))return!1}else{var h=new Vr;if(u)var p=u(l,s,c,n,t,h);if(!(p===r?Se(s,l,3,u,h):p))return!1}}return!0}function Te(n){return!(!Xo(n)||(t=n,Un&&Un in t))&&(Jo(n)?Mn:vn).test(Ui(n));var t}function Ce(n){return"function"==typeof n?n:null==n?ea:"object"==typeof n?Po(n)?$e(n[0],n[1]):Be(n):ha(n)}function Le(n){if(!wi(n))return _r(n);var t=[];for(var r in kn(n))Ln.call(n,r)&&"constructor"!=r&&t.push(r);return t}function We(n,t){return n<t}function Ue(n,t){var r=-1,e=Zo(n)?wn(n.length):[];return le(n,function(n,u,i){e[++r]=t(n,u,i)}),e}function Be(n){var t=fi(n);return 1==t.length&&t[0][2]?xi(t[0][0],t[0][1]):function(r){return r===n||ze(r,n,t)}}function $e(n,t){return yi(n)&&mi(t)?xi(Wi(n),t):function(e){var u=Of(e,n);return u===r&&u===t?Ef(e,n):Se(t,u,3)}}function De(n,t,e,u,i){n!==t&&ge(t,function(o,f){if(i||(i=new Vr),Xo(o))!function(n,t,e,u,i,o,f){var a=ki(n,e),c=ki(t,e),l=f.get(c);if(l)Qr(n,e,l);else{var s=o?o(a,c,e+"",n,t,f):r,h=s===r;if(h){var p=Po(c),v=!p&&Vo(c),_=!p&&!v&&cf(c);s=c,p||v||_?Po(a)?s=a:Ko(a)?s=Ou(a):v?(h=!1,s=wu(c,!0)):_?(h=!1,s=xu(c,!0)):s=[]:ef(c)||No(c)?(s=a,No(a)?s=yf(a):Xo(a)&&!Jo(a)||(s=pi(c))):h=!1}h&&(f.set(c,s),i(s,c,u,o,f),f.delete(c)),Qr(n,e,s)}}(n,t,f,e,De,u,i);else{var a=u?u(ki(n,f),o,f+"",n,t,i):r;a===r&&(a=o),Qr(n,f,a)}},Tf)}function Me(n,t){var e=n.length;if(e)return _i(t+=t<0?e:0,e)?n[t]:r}function Fe(n,t,r){t=t.length?St(t,function(n){return Po(n)?function(t){return me(t,1===n.length?n[0]:n)}:n}):[ea];var e=-1;t=St(t,Gt(ii()));var u=Ue(n,function(n,r,u){var i=St(t,function(t){return t(n)});return{criteria:i,index:++e,value:n}});return function(n){var t=n.length;for(n.sort(function(n,t){return function(n,t,r){for(var e=-1,u=n.criteria,i=t.criteria,o=u.length,f=r.length;++e<o;){var a=ju(u[e],i[e]);if(a)return e>=f?a:a*("desc"==r[e]?-1:1)}return n.index-t.index}(n,t,r)});t--;)n[t]=n[t].value;return n}(u)}function Ne(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=me(n,o);r(f,o)&&Je(i,gu(o,n),f)}return i}function Pe(n,t,r,e){var u=e?Dt:$t,i=-1,o=t.length,f=n;for(n===t&&(t=Ou(t)),r&&(f=St(n,Gt(r)));++i<o;)for(var a=0,c=t[i],l=r?r(c):c;(a=u(f,l,a,e))>-1;)f!==n&&Gn.call(f,a,1),Gn.call(n,a,1);return n}function qe(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;_i(u)?Gn.call(n,u,1):au(n,u)}}return n}function Ze(n,t){return n+_t(wr()*(t-n+1))}function Ke(n,t){var r="";if(!n||t<1||t>c)return r;do{t%2&&(r+=n),(t=_t(t/2))&&(n+=n)}while(t);return r}function Ve(n,t){return Ii(ji(n,t,ea),n+"")}function Ge(n){return Hr(Mf(n))}function He(n,t){var r=Mf(n);return zi(r,ie(t,0,r.length))}function Je(n,t,e,u){if(!Xo(n))return n;for(var i=-1,o=(t=gu(t,n)).length,f=o-1,a=n;null!=a&&++i<o;){var c=Wi(t[i]),l=e;if("__proto__"===c||"constructor"===c||"prototype"===c)return n;if(i!=f){var s=a[c];(l=u?u(s,c,a):r)===r&&(l=Xo(s)?s:_i(t[i+1])?[]:{})}Xr(a,c,l),a=a[c]}return n}var Ye=Ir?function(n,t){return Ir.set(n,t),n}:ea,Qe=at?function(n,t){return at(n,"toString",{configurable:!0,enumerable:!1,value:na(t),writable:!0})}:ea;function Xe(n){return zi(Mf(n))}function nu(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),(r=r>u?u:r)<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=wn(u);++e<u;)i[e]=n[e+t];return i}function tu(n,t){var r;return le(n,function(n,e,u){return!(r=t(n,e,u))}),!!r}function ru(n,t,r){var e=0,u=null==n?e:n.length;if("number"==typeof t&&t==t&&u<=2147483647){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!af(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return eu(n,t,ea,r)}function eu(n,t,e,u){var i=0,o=null==n?0:n.length;if(0===o)return 0;for(var f=(t=e(t))!=t,a=null===t,c=af(t),l=t===r;i<o;){var s=_t((i+o)/2),h=e(n[s]),p=h!==r,v=null===h,_=h==h,g=af(h);if(f)var y=u||_;else y=l?_&&(u||p):a?_&&p&&(u||!v):c?_&&p&&!v&&(u||!g):!v&&!g&&(u?h<=t:h<t);y?i=s+1:o=s}return yr(o,4294967294)}function uu(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],f=t?t(o):o;if(!r||!Do(f,a)){var a=f;i[u++]=0===o?0:o}}return i}function iu(n){return"number"==typeof n?n:af(n)?l:+n}function ou(n){if("string"==typeof n)return n;if(Po(n))return St(n,ou)+"";if(af(n))return Br?Br.call(n):"";var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function fu(n,t,r){var e=-1,u=It,i=n.length,o=!0,f=[],a=f;if(r)o=!1,u=Rt;else if(i>=200){var c=t?null:Ku(n);if(c)return or(c);o=!1,u=Jt,a=new Kr}else a=t?[]:f;n:for(;++e<i;){var l=n[e],s=t?t(l):l;if(l=r||0!==l?l:0,o&&s==s){for(var h=a.length;h--;)if(a[h]===s)continue n;t&&a.push(s),f.push(l)}else u(a,s,r)||(a!==f&&a.push(s),f.push(l))}return f}function au(n,t){var r=-1,e=(t=gu(t,n)).length;if(!e)return!0;for(;++r<e;){var u=Wi(t[r]);if("__proto__"===u&&!Ln.call(n,"__proto__"))return!1;if(("constructor"===u||"prototype"===u)&&r<e-1)return!1}var i=Ai(n,t);return null==i||delete i[Wi(Gi(t))]}function cu(n,t,r,e){return Je(n,t,r(me(n,t)),e)}function lu(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?nu(n,e?0:i,e?i+1:u):nu(n,e?i+1:0,e?u:i)}function su(n,t){var r=n;return r instanceof Nr&&(r=r.value()),Tt(t,function(n,t){return t.func.apply(t.thisArg,zt([n],t.args))},r)}function hu(n,t,r){var e=n.length;if(e<2)return e?fu(n[0]):[];for(var u=-1,i=wn(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=ce(i[u]||o,n[f],t,r));return fu(_e(i,1),t,r)}function pu(n,t,e){for(var u=-1,i=n.length,o=t.length,f={};++u<i;){var a=u<o?t[u]:r;e(f,n[u],a)}return f}function vu(n){return Ko(n)?n:[]}function _u(n){return"function"==typeof n?n:ea}function gu(n,t){return Po(n)?n:yi(n,t)?[n]:Li(df(n))}var yu=Ve;function du(n,t,e){var u=n.length;return e=e===r?u:e,!t&&e>=u?n:nu(n,t,e)}var bu=ct||function(n){return lt.clearTimeout(n)};function wu(n,t){if(t)return n.slice();var r=n.length,e=qn?qn(r):new n.constructor(r);return n.copy(e),e}function mu(n){var t=new n.constructor(n.byteLength);return new Pn(t).set(new Pn(n)),t}function xu(n,t){var r=t?mu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function ju(n,t){if(n!==t){var e=n!==r,u=null===n,i=n==n,o=af(n),f=t!==r,a=null===t,c=t==t,l=af(t);if(!a&&!l&&!o&&n>t||o&&f&&c&&!a&&!l||u&&f&&c||!e&&c||!i)return 1;if(!u&&!o&&!l&&n<t||l&&e&&i&&!u&&!o||a&&e&&i||!f&&i||!c)return-1}return 0}function Au(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,a=t.length,c=gr(i-o,0),l=wn(a+c),s=!e;++f<a;)l[f]=t[f];for(;++u<o;)(s||u<i)&&(l[r[u]]=n[u]);for(;c--;)l[f++]=n[u++];return l}function ku(n,t,r,e){for(var u=-1,i=n.length,o=-1,f=r.length,a=-1,c=t.length,l=gr(i-f,0),s=wn(l+c),h=!e;++u<l;)s[u]=n[u];for(var p=u;++a<c;)s[p+a]=t[a];for(;++o<f;)(h||u<i)&&(s[p+r[o]]=n[u++]);return s}function Ou(n,t){var r=-1,e=n.length;for(t||(t=wn(e));++r<e;)t[r]=n[r];return t}function Eu(n,t,e,u){var i=!e;e||(e={});for(var o=-1,f=t.length;++o<f;){var a=t[o],c=u?u(e[a],n[a],a,e,n):r;c===r&&(c=n[a]),i?ee(e,a,c):Xr(e,a,c)}return e}function Iu(n,t){return function(r,e){var u=Po(r)?jt:te,i=t?t():{};return u(r,n,ii(e,2),i)}}function Ru(n){return Ve(function(t,e){var u=-1,i=e.length,o=i>1?e[i-1]:r,f=i>2?e[2]:r;for(o=n.length>3&&"function"==typeof o?(i--,o):r,f&&gi(e[0],e[1],f)&&(o=i<3?r:o,i=1),t=kn(t);++u<i;){var a=e[u];a&&n(t,a,u,o)}return t})}function Su(n,t){return function(r,e){if(null==r)return r;if(!Zo(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=kn(r);(t?i--:++i<u)&&!1!==e(o[i],i,o););return r}}function zu(n){return function(t,r,e){for(var u=-1,i=kn(t),o=e(t),f=o.length;f--;){var a=o[n?f:++u];if(!1===r(i[a],a,i))break}return t}}function Tu(n){return function(t){var e=rr(t=df(t))?cr(t):r,u=e?e[0]:t.charAt(0),i=e?du(e,1).join(""):t.slice(1);return u[n]()+i}}function Cu(n){return function(t){return Tt(Yf(Pf(t).replace(Hn,"")),n,"")}}function Lu(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Dr(n.prototype),e=n.apply(r,t);return Xo(e)?e:r}}function Wu(n){return function(t,e,u){var i=kn(t);if(!Zo(t)){var o=ii(e,3);t=zf(t),e=function(n){return o(i[n],n,i)}}var f=n(t,e,u);return f>-1?i[o?t[f]:f]:r}}function Uu(n){return Xu(function(t){var u=t.length,i=u,o=Fr.prototype.thru;for(n&&t.reverse();i--;){var f=t[i];if("function"!=typeof f)throw new In(e);if(o&&!a&&"wrapper"==ei(f))var a=new Fr([],!0)}for(i=a?i:u;++i<u;){var c=ei(f=t[i]),l="wrapper"==c?ri(f):r;a=l&&di(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[ei(l[0])].apply(a,l[3]):1==f.length&&di(f)?a[c]():a.thru(f)}return function(){var n=arguments,r=n[0];if(a&&1==n.length&&Po(r))return a.plant(r).value();for(var e=0,i=u?t[e].apply(this,n):r;++e<u;)i=t[e].call(this,i);return i}})}function Bu(n,t,e,u,i,o,a,c,l,s){var h=t&f,p=1&t,v=2&t,_=24&t,g=512&t,y=v?r:Lu(n);return function f(){for(var d=arguments.length,b=wn(d),w=d;w--;)b[w]=arguments[w];if(_)var m=ui(f),x=function(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;return e}(b,m);if(u&&(b=Au(b,u,i,_)),o&&(b=ku(b,o,a,_)),d-=x,_&&d<s){var j=ir(b,m);return qu(n,t,Bu,f.placeholder,e,b,j,c,l,s-d)}var A=p?e:this,k=v?A[n]:n;return d=b.length,c?b=function(n,t){for(var e=n.length,u=yr(t.length,e),i=Ou(n);u--;){var o=t[u];n[u]=_i(o,e)?i[o]:r}return n}(b,c):g&&d>1&&b.reverse(),h&&l<d&&(b.length=l),this&&this!==lt&&this instanceof f&&(k=y||Lu(k)),k.apply(A,b)}}function $u(n,t){return function(r,e){return function(n,t,r,e){return de(n,function(n,u,i){t(e,r(n),u,i)}),e}(r,n,t(e),{})}}function Du(n,t){return function(e,u){var i;if(e===r&&u===r)return t;if(e!==r&&(i=e),u!==r){if(i===r)return u;"string"==typeof e||"string"==typeof u?(e=ou(e),u=ou(u)):(e=iu(e),u=iu(u)),i=n(e,u)}return i}}function Mu(n){return Xu(function(t){return t=St(t,Gt(ii())),Ve(function(r){var e=this;return n(t,function(n){return xt(n,e,r)})})})}function Fu(n,t){var e=(t=t===r?" ":ou(t)).length;if(e<2)return e?Ke(t,n):t;var u=Ke(t,vt(n/ar(t)));return rr(t)?du(cr(u),0,n).join(""):u.slice(0,n)}function Nu(n){return function(t,e,u){return u&&"number"!=typeof u&&gi(t,e,u)&&(e=u=r),t=pf(t),e===r?(e=t,t=0):e=pf(e),function(n,t,r,e){for(var u=-1,i=gr(vt((t-n)/(r||1)),0),o=wn(i);i--;)o[e?i:++u]=n,n+=r;return o}(t,e,u=u===r?t<e?1:-1:pf(u),n)}}function Pu(n){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=gf(t),r=gf(r)),n(t,r)}}function qu(n,t,e,u,i,f,a,c,l,s){var h=8&t;t|=h?o:64,4&(t&=~(h?64:o))||(t&=-4);var p=[n,t,i,h?f:r,h?a:r,h?r:f,h?r:a,c,l,s],v=e.apply(r,p);return di(n)&&Oi(v,p),v.placeholder=u,Ri(v,n,t)}function Zu(n){var t=An[n];return function(n,r){if(n=gf(n),(r=null==r?0:yr(vf(r),292))&&pr(n)){var e=(df(n)+"e").split("e");return+((e=(df(t(e[0]+"e"+(+e[1]+r)))+"e").split("e"))[0]+"e"+(+e[1]-r))}return t(n)}}var Ku=kr&&1/or(new kr([,-0]))[1]==a?function(n){return new kr(n)}:aa;function Vu(n){return function(t){var r=si(t);return r==w?er(t):r==k?fr(t):function(n,t){return St(t,function(t){return[t,n[t]]})}(t,n(t))}}function Gu(n,t,u,a,c,l,s,h){var p=2&t;if(!p&&"function"!=typeof n)throw new In(e);var v=a?a.length:0;if(v||(t&=-97,a=c=r),s=s===r?s:gr(vf(s),0),h=h===r?h:vf(h),v-=c?c.length:0,64&t){var _=a,g=c;a=c=r}var y=p?r:ri(n),d=[n,t,u,a,c,_,g,l,s,h];if(y&&function(n,t){var r=n[1],e=t[1],u=r|e,o=u<131,a=e==f&&8==r||e==f&&256==r&&n[7].length<=t[8]||384==e&&t[7].length<=t[8]&&8==r;if(!o&&!a)return n;1&e&&(n[2]=t[2],u|=1&r?0:4);var c=t[3];if(c){var l=n[3];n[3]=l?Au(l,c,t[4]):c,n[4]=l?ir(n[3],i):t[4]}(c=t[5])&&(l=n[5],n[5]=l?ku(l,c,t[6]):c,n[6]=l?ir(n[5],i):t[6]),(c=t[7])&&(n[7]=c),e&f&&(n[8]=null==n[8]?t[8]:yr(n[8],t[8])),null==n[9]&&(n[9]=t[9]),n[0]=t[0],n[1]=u}(d,y),n=d[0],t=d[1],u=d[2],a=d[3],c=d[4],!(h=d[9]=d[9]===r?p?0:n.length:gr(d[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||16==t?function(n,t,e){var u=Lu(n);return function i(){for(var o=arguments.length,f=wn(o),a=o,c=ui(i);a--;)f[a]=arguments[a];var l=o<3&&f[0]!==c&&f[o-1]!==c?[]:ir(f,c);return(o-=l.length)<e?qu(n,t,Bu,i.placeholder,r,f,l,r,r,e-o):xt(this&&this!==lt&&this instanceof i?u:n,this,f)}}(n,t,h):t!=o&&33!=t||c.length?Bu.apply(r,d):function(n,t,r,e){var u=1&t,i=Lu(n);return function t(){for(var o=-1,f=arguments.length,a=-1,c=e.length,l=wn(c+f),s=this&&this!==lt&&this instanceof t?i:n;++a<c;)l[a]=e[a];for(;f--;)l[a++]=arguments[++o];return xt(s,u?r:this,l)}}(n,t,u,a);else var b=function(n,t,r){var e=1&t,u=Lu(n);return function t(){return(this&&this!==lt&&this instanceof t?u:n).apply(e?r:this,arguments)}}(n,t,u);return Ri((y?Ye:Oi)(b,d),n,t)}function Hu(n,t,e,u){return n===r||Do(n,zn[e])&&!Ln.call(u,e)?t:n}function Ju(n,t,e,u,i,o){return Xo(n)&&Xo(t)&&(o.set(t,n),De(n,t,r,Ju,o),o.delete(t)),n}function Yu(n){return ef(n)?r:n}function Qu(n,t,e,u,i,o){var f=1&e,a=n.length,c=t.length;if(a!=c&&!(f&&c>a))return!1;var l=o.get(n),s=o.get(t);if(l&&s)return l==t&&s==n;var h=-1,p=!0,v=2&e?new Kr:r;for(o.set(n,t),o.set(t,n);++h<a;){var _=n[h],g=t[h];if(u)var y=f?u(g,_,h,t,n,o):u(_,g,h,n,t,o);if(y!==r){if(y)continue;p=!1;break}if(v){if(!Lt(t,function(n,t){if(!Jt(v,t)&&(_===n||i(_,n,e,u,o)))return v.push(t)})){p=!1;break}}else if(_!==g&&!i(_,g,e,u,o)){p=!1;break}}return o.delete(n),o.delete(t),p}function Xu(n){return Ii(ji(n,r,Pi),n+"")}function ni(n){return xe(n,zf,ci)}function ti(n){return xe(n,Tf,li)}var ri=Ir?function(n){return Ir.get(n)}:aa;function ei(n){for(var t=n.name+"",r=Rr[t],e=Ln.call(Rr,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function ui(n){return(Ln.call($r,"placeholder")?$r:n).placeholder}function ii(){var n=$r.iteratee||ua;return n=n===ua?Ce:n,arguments.length?n(arguments[0],arguments[1]):n}function oi(n,t){var r,e,u=n.__data__;return("string"==(e=typeof(r=t))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==r:null===r)?u["string"==typeof t?"string":"hash"]:u.map}function fi(n){for(var t=zf(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,mi(u)]}return t}function ai(n,t){var e=function(n,t){return null==n?r:n[t]}(n,t);return Te(e)?e:r}var ci=Wt?function(n){return null==n?[]:(n=kn(n),Et(Wt(n),function(t){return Vn.call(n,t)}))}:_a,li=Wt?function(n){for(var t=[];n;)zt(t,ci(n)),n=Zn(n);return t}:_a,si=je;function hi(n,t,r){for(var e=-1,u=(t=gu(t,n)).length,i=!1;++e<u;){var o=Wi(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:!!(u=null==n?0:n.length)&&Qo(u)&&_i(o,u)&&(Po(n)||No(n))}function pi(n){return"function"!=typeof n.constructor||wi(n)?{}:Dr(Zn(n))}function vi(n){return Po(n)||No(n)||!!(Yn&&n&&n[Yn])}function _i(n,t){var r=typeof n;return!!(t=t??c)&&("number"==r||"symbol"!=r&&gn.test(n))&&n>-1&&n%1==0&&n<t}function gi(n,t,r){if(!Xo(r))return!1;var e=typeof t;return!!("number"==e?Zo(r)&&_i(t,r.length):"string"==e&&t in r)&&Do(r[t],n)}function yi(n,t){if(Po(n))return!1;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!af(n))||Y.test(n)||!J.test(n)||null!=t&&n in kn(t)}function di(n){var t=ei(n),r=$r[t];if("function"!=typeof r||!(t in Nr.prototype))return!1;if(n===r)return!0;var e=ri(r);return!!e&&n===e[0]}(xr&&si(new xr(new ArrayBuffer(1)))!=S||jr&&si(new jr)!=w||Ar&&si(Ar.resolve())!=j||kr&&si(new kr)!=k||Or&&si(new Or)!=I)&&(si=function(n){var t=je(n),e=t==x?n.constructor:r,u=e?Ui(e):"";if(u)switch(u){case Sr:return S;case zr:return w;case Tr:return j;case Cr:return k;case Lr:return I}return t});var bi=Tn?Jo:ga;function wi(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||zn)}function mi(n){return n==n&&!Xo(n)}function xi(n,t){return function(e){return null!=e&&e[n]===t&&(t!==r||n in kn(e))}}function ji(n,t,e){return t=gr(t===r?n.length-1:t,0),function(){for(var r=arguments,u=-1,i=gr(r.length-t,0),o=wn(i);++u<i;)o[u]=r[t+u];u=-1;for(var f=wn(t+1);++u<t;)f[u]=r[u];return f[t]=e(o),xt(n,this,f)}}function Ai(n,t){return t.length<2?n:me(n,nu(t,0,-1))}function ki(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}var Oi=Si(Ye),Ei=ht||function(n,t){return lt.setTimeout(n,t)},Ii=Si(Qe);function Ri(n,t,r){var e=t+"";return Ii(n,function(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(en,"{\n/* [wrapped with "+t+"] */\n")}(e,function(n,t){return At(h,function(r){var e="_."+r[0];t&r[1]&&!It(n,e)&&n.push(e)}),n.sort()}(function(n){var t=n.match(un);return t?t[1].split(on):[]}(e),r)))}function Si(n){var t=0,e=0;return function(){var u=dr(),i=16-(u-e);if(e=u,i>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(r,arguments)}}function zi(n,t){var e=-1,u=n.length,i=u-1;for(t=t===r?u:t;++e<t;){var o=Ze(e,i),f=n[o];n[o]=n[e],n[e]=f}return n.length=t,n}var Ti,Ci,Li=(Ti=Co(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(Q,function(n,r,e,u){t.push(e?u.replace(cn,"$1"):r||n)}),t},function(n){return 500===Ci.size&&Ci.clear(),n}),Ci=Ti.cache,Ti);function Wi(n){if("string"==typeof n||af(n))return n;var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function Ui(n){if(null!=n){try{return Cn.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Bi(n){if(n instanceof Nr)return n.clone();var t=new Fr(n.__wrapped__,n.__chain__);return t.__actions__=Ou(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}var $i=Ve(function(n,t){return Ko(n)?ce(n,_e(t,1,Ko,!0)):[]}),Di=Ve(function(n,t){var e=Gi(t);return Ko(e)&&(e=r),Ko(n)?ce(n,_e(t,1,Ko,!0),ii(e,2)):[]}),Mi=Ve(function(n,t){var e=Gi(t);return Ko(e)&&(e=r),Ko(n)?ce(n,_e(t,1,Ko,!0),r,e):[]});function Fi(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:vf(r);return u<0&&(u=gr(e+u,0)),Bt(n,ii(t,3),u)}function Ni(n,t,e){var u=null==n?0:n.length;if(!u)return-1;var i=u-1;return e!==r&&(i=vf(e),i=e<0?gr(u+i,0):yr(i,u-1)),Bt(n,ii(t,3),i,!0)}function Pi(n){return null!=n&&n.length?_e(n,1):[]}function qi(n){return n&&n.length?n[0]:r}var Zi=Ve(function(n){var t=St(n,vu);return t.length&&t[0]===n[0]?Ee(t):[]}),Ki=Ve(function(n){var t=Gi(n),e=St(n,vu);return t===Gi(e)?t=r:e.pop(),e.length&&e[0]===n[0]?Ee(e,ii(t,2)):[]}),Vi=Ve(function(n){var t=Gi(n),e=St(n,vu);return(t="function"==typeof t?t:r)&&e.pop(),e.length&&e[0]===n[0]?Ee(e,r,t):[]});function Gi(n){var t=null==n?0:n.length;return t?n[t-1]:r}var Hi=Ve(Ji);function Ji(n,t){return n&&n.length&&t&&t.length?Pe(n,t):n}var Yi=Xu(function(n,t){var r=null==n?0:n.length,e=ue(n,t);return qe(n,St(t,function(n){return _i(n,r)?+n:n}).sort(ju)),e});function Qi(n){return null==n?n:mr.call(n)}var Xi=Ve(function(n){return fu(_e(n,1,Ko,!0))}),no=Ve(function(n){var t=Gi(n);return Ko(t)&&(t=r),fu(_e(n,1,Ko,!0),ii(t,2))}),to=Ve(function(n){var t=Gi(n);return t="function"==typeof t?t:r,fu(_e(n,1,Ko,!0),r,t)});function ro(n){if(!n||!n.length)return[];var t=0;return n=Et(n,function(n){if(Ko(n))return t=gr(n.length,t),!0}),Kt(t,function(t){return St(n,Nt(t))})}function eo(n,t){if(!n||!n.length)return[];var e=ro(n);return null==t?e:St(e,function(n){return xt(t,r,n)})}var uo=Ve(function(n,t){return Ko(n)?ce(n,t):[]}),io=Ve(function(n){return hu(Et(n,Ko))}),oo=Ve(function(n){var t=Gi(n);return Ko(t)&&(t=r),hu(Et(n,Ko),ii(t,2))}),fo=Ve(function(n){var t=Gi(n);return t="function"==typeof t?t:r,hu(Et(n,Ko),r,t)}),ao=Ve(ro),co=Ve(function(n){var t=n.length,e=t>1?n[t-1]:r;return e="function"==typeof e?(n.pop(),e):r,eo(n,e)});function lo(n){var t=$r(n);return t.__chain__=!0,t}function so(n,t){return t(n)}var ho=Xu(function(n){var t=n.length,e=t?n[0]:0,u=this.__wrapped__,i=function(t){return ue(t,n)};return!(t>1||this.__actions__.length)&&u instanceof Nr&&_i(e)?((u=u.slice(e,+e+(t?1:0))).__actions__.push({func:so,args:[i],thisArg:r}),new Fr(u,this.__chain__).thru(function(n){return t&&!n.length&&n.push(r),n})):this.thru(i)}),po=Iu(function(n,t,r){Ln.call(n,r)?++n[r]:ee(n,r,1)}),vo=Wu(Fi),_o=Wu(Ni);function go(n,t){return(Po(n)?At:le)(n,ii(t,3))}function yo(n,t){return(Po(n)?kt:se)(n,ii(t,3))}var bo=Iu(function(n,t,r){Ln.call(n,r)?n[r].push(t):ee(n,r,[t])}),wo=Ve(function(n,t,r){var e=-1,u="function"==typeof t,i=Zo(n)?wn(n.length):[];return le(n,function(n){i[++e]=u?xt(t,n,r):Ie(n,t,r)}),i}),mo=Iu(function(n,t,r){ee(n,r,t)});function xo(n,t){return(Po(n)?St:Ue)(n,ii(t,3))}var jo=Iu(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Ao=Ve(function(n,t){if(null==n)return[];var r=t.length;return r>1&&gi(n,t[0],t[1])?t=[]:r>2&&gi(t[0],t[1],t[2])&&(t=[t[0]]),Fe(n,_e(t,1),[])}),ko=st||function(){return lt.Date.now()};function Oo(n,t,e){return t=e?r:t,t=n&&null==t?n.length:t,Gu(n,f,r,r,r,r,t)}function Eo(n,t){var u;if("function"!=typeof t)throw new In(e);return n=vf(n),function(){return--n>0&&(u=t.apply(this,arguments)),n<=1&&(t=r),u}}var Io=Ve(function(n,t,r){var e=1;if(r.length){var u=ir(r,ui(Io));e|=o}return Gu(n,e,t,r,u)}),Ro=Ve(function(n,t,r){var e=3;if(r.length){var u=ir(r,ui(Ro));e|=o}return Gu(t,e,n,r,u)});function So(n,t,u){var i,o,f,a,c,l,s=0,h=!1,p=!1,v=!0;if("function"!=typeof n)throw new In(e);function _(t){var e=i,u=o;return i=o=r,s=t,a=n.apply(u,e)}function g(n){var e=n-l;return l===r||e>=t||e<0||p&&n-s>=f}function y(){var n=ko();if(g(n))return d(n);c=Ei(y,function(n){var r=t-(n-l);return p?yr(r,f-(n-s)):r}(n))}function d(n){return c=r,v&&i?_(n):(i=o=r,a)}function b(){var n=ko(),e=g(n);if(i=arguments,o=this,l=n,e){if(c===r)return function(n){return s=n,c=Ei(y,t),h?_(n):a}(l);if(p)return bu(c),c=Ei(y,t),_(l)}return c===r&&(c=Ei(y,t)),a}return t=gf(t)||0,Xo(u)&&(h=!!u.leading,f=(p="maxWait"in u)?gr(gf(u.maxWait)||0,t):f,v="trailing"in u?!!u.trailing:v),b.cancel=function(){c!==r&&bu(c),s=0,i=l=o=c=r},b.flush=function(){return c===r?a:d(ko())},b}var zo=Ve(function(n,t){return ae(n,1,t)}),To=Ve(function(n,t,r){return ae(n,gf(t)||0,r)});function Co(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new In(e);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Co.Cache||Zr),r}function Lo(n){if("function"!=typeof n)throw new In(e);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}Co.Cache=Zr;var Wo=yu(function(n,t){var r=(t=1==t.length&&Po(t[0])?St(t[0],Gt(ii())):St(_e(t,1),Gt(ii()))).length;return Ve(function(e){for(var u=-1,i=yr(e.length,r);++u<i;)e[u]=t[u].call(this,e[u]);return xt(n,this,e)})}),Uo=Ve(function(n,t){var e=ir(t,ui(Uo));return Gu(n,o,r,t,e)}),Bo=Ve(function(n,t){var e=ir(t,ui(Bo));return Gu(n,64,r,t,e)}),$o=Xu(function(n,t){return Gu(n,256,r,r,r,t)});function Do(n,t){return n===t||n!=n&&t!=t}var Mo=Pu(Ae),Fo=Pu(function(n,t){return n>=t}),No=Re(function(){return arguments}())?Re:function(n){return nf(n)&&Ln.call(n,"callee")&&!Vn.call(n,"callee")},Po=wn.isArray,qo=gt?Gt(gt):function(n){return nf(n)&&je(n)==R};function Zo(n){return null!=n&&Qo(n.length)&&!Jo(n)}function Ko(n){return nf(n)&&Zo(n)}var Vo=Pt||ga,Go=yt?Gt(yt):function(n){return nf(n)&&je(n)==g};function Ho(n){if(!nf(n))return!1;var t=je(n);return t==y||"[object DOMException]"==t||"string"==typeof n.message&&"string"==typeof n.name&&!ef(n)}function Jo(n){if(!Xo(n))return!1;var t=je(n);return t==d||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Yo(n){return"number"==typeof n&&n==vf(n)}function Qo(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=c}function Xo(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function nf(n){return null!=n&&"object"==typeof n}var tf=dt?Gt(dt):function(n){return nf(n)&&si(n)==w};function rf(n){return"number"==typeof n||nf(n)&&je(n)==m}function ef(n){if(!nf(n)||je(n)!=x)return!1;var t=Zn(n);if(null===t)return!0;var r=Ln.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Cn.call(r)==$n}var uf=bt?Gt(bt):function(n){return nf(n)&&je(n)==A},of=wt?Gt(wt):function(n){return nf(n)&&si(n)==k};function ff(n){return"string"==typeof n||!Po(n)&&nf(n)&&je(n)==O}function af(n){return"symbol"==typeof n||nf(n)&&je(n)==E}var cf=mt?Gt(mt):function(n){return nf(n)&&Qo(n.length)&&!!et[je(n)]},lf=Pu(We),sf=Pu(function(n,t){return n<=t});function hf(n){if(!n)return[];if(Zo(n))return ff(n)?cr(n):Ou(n);if(Xn&&n[Xn])return function(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}(n[Xn]());var t=si(n);return(t==w?er:t==k?or:Mf)(n)}function pf(n){return n?(n=gf(n))===a||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function vf(n){var t=pf(n),r=t%1;return t==t?r?t-r:t:0}function _f(n){return n?ie(vf(n),0,s):0}function gf(n){if("number"==typeof n)return n;if(af(n))return l;if(Xo(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=Xo(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=Vt(n);var r=pn.test(n);return r||_n.test(n)?ft(n.slice(2),r?2:8):hn.test(n)?l:+n}function yf(n){return Eu(n,Tf(n))}function df(n){return null==n?"":ou(n)}var bf=Ru(function(n,t){if(wi(t)||Zo(t))Eu(t,zf(t),n);else for(var r in t)Ln.call(t,r)&&Xr(n,r,t[r])}),wf=Ru(function(n,t){Eu(t,Tf(t),n)}),mf=Ru(function(n,t,r,e){Eu(t,Tf(t),n,e)}),xf=Ru(function(n,t,r,e){Eu(t,zf(t),n,e)}),jf=Xu(ue),Af=Ve(function(n,t){n=kn(n);var e=-1,u=t.length,i=u>2?t[2]:r;for(i&&gi(t[0],t[1],i)&&(u=1);++e<u;)for(var o=t[e],f=Tf(o),a=-1,c=f.length;++a<c;){var l=f[a],s=n[l];(s===r||Do(s,zn[l])&&!Ln.call(n,l))&&(n[l]=o[l])}return n}),kf=Ve(function(n){return n.push(r,Ju),xt(Lf,r,n)});function Of(n,t,e){var u=null==n?r:me(n,t);return u===r?e:u}function Ef(n,t){return null!=n&&hi(n,t,Oe)}var If=$u(function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=Bn.call(t)),n[t]=r},na(ea)),Rf=$u(function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=Bn.call(t)),Ln.call(n,t)?n[t].push(r):n[t]=[r]},ii),Sf=Ve(Ie);function zf(n){return Zo(n)?Gr(n):Le(n)}function Tf(n){return Zo(n)?Gr(n,!0):function(n){if(!Xo(n))return function(n){var t=[];if(null!=n)for(var r in kn(n))t.push(r);return t}(n);var t=wi(n),r=[];for(var e in n)("constructor"!=e||!t&&Ln.call(n,e))&&r.push(e);return r}(n)}var Cf=Ru(function(n,t,r){De(n,t,r)}),Lf=Ru(function(n,t,r,e){De(n,t,r,e)}),Wf=Xu(function(n,t){var r={};if(null==n)return r;var e=!1;t=St(t,function(t){return t=gu(t,n),e||(e=t.length>1),t}),Eu(n,ti(n),r),e&&(r=oe(r,7,Yu));for(var u=t.length;u--;)au(r,t[u]);return r}),Uf=Xu(function(n,t){return null==n?{}:function(n,t){return Ne(n,t,function(t,r){return Ef(n,r)})}(n,t)});function Bf(n,t){if(null==n)return{};var r=St(ti(n),function(n){return[n]});return t=ii(t),Ne(n,r,function(n,r){return t(n,r[0])})}var $f=Vu(zf),Df=Vu(Tf);function Mf(n){return null==n?[]:Ht(n,zf(n))}var Ff=Cu(function(n,t,r){return t=t.toLowerCase(),n+(r?Nf(t):t)});function Nf(n){return Jf(df(n).toLowerCase())}function Pf(n){return(n=df(n))&&n.replace(yn,Xt).replace(Jn,"")}var qf=Cu(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Zf=Cu(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Kf=Tu("toLowerCase"),Vf=Cu(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),Gf=Cu(function(n,t,r){return n+(r?" ":"")+Jf(t)}),Hf=Cu(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Jf=Tu("toUpperCase");function Yf(n,t,e){return n=df(n),(t=e?r:t)===r?function(n){return nt.test(n)}(n)?function(n){return n.match(Qn)||[]}(n):function(n){return n.match(fn)||[]}(n):n.match(t)||[]}var Qf=Ve(function(n,t){try{return xt(n,r,t)}catch(n){return Ho(n)?n:new xn(n)}}),Xf=Xu(function(n,t){return At(t,function(t){t=Wi(t),ee(n,t,Io(n[t],n))}),n});function na(n){return function(){return n}}var ta=Uu(),ra=Uu(!0);function ea(n){return n}function ua(n){return Ce("function"==typeof n?n:oe(n,1))}var ia=Ve(function(n,t){return function(r){return Ie(r,n,t)}}),oa=Ve(function(n,t){return function(r){return Ie(n,r,t)}});function fa(n,t,r){var e=zf(t),u=we(t,e);null!=r||Xo(t)&&(u.length||!e.length)||(r=t,t=n,n=this,u=we(t,zf(t)));var i=!(Xo(r)&&"chain"in r&&!r.chain),o=Jo(n);return At(u,function(r){var e=t[r];n[r]=e,o&&(n.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=n(this.__wrapped__);return(r.__actions__=Ou(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,zt([this.value()],arguments))})}),n}function aa(){}var ca=Mu(St),la=Mu(Ot),sa=Mu(Lt);function ha(n){return yi(n)?Nt(Wi(n)):function(n){return function(t){return me(t,n)}}(n)}var pa=Nu(),va=Nu(!0);function _a(){return[]}function ga(){return!1}var ya,da=Du(function(n,t){return n+t},0),ba=Zu("ceil"),wa=Du(function(n,t){return n/t},1),ma=Zu("floor"),xa=Du(function(n,t){return n*t},1),ja=Zu("round"),Aa=Du(function(n,t){return n-t},0);return $r.after=function(n,t){if("function"!=typeof t)throw new In(e);return n=vf(n),function(){if(--n<1)return t.apply(this,arguments)}},$r.ary=Oo,$r.assign=bf,$r.assignIn=wf,$r.assignInWith=mf,$r.assignWith=xf,$r.at=jf,$r.before=Eo,$r.bind=Io,$r.bindAll=Xf,$r.bindKey=Ro,$r.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Po(n)?n:[n]},$r.chain=lo,$r.chunk=function(n,t,e){t=(e?gi(n,t,e):t===r)?1:gr(vf(t),0);var u=null==n?0:n.length;if(!u||t<1)return[];for(var i=0,o=0,f=wn(vt(u/t));i<u;)f[o++]=nu(n,i,i+=t);return f},$r.compact=function(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u},$r.concat=function(){var n=arguments.length;if(!n)return[];for(var t=wn(n-1),r=arguments[0],e=n;e--;)t[e-1]=arguments[e];return zt(Po(r)?Ou(r):[r],_e(t,1))},$r.cond=function(n){var t=null==n?0:n.length,r=ii();return n=t?St(n,function(n){if("function"!=typeof n[1])throw new In(e);return[r(n[0]),n[1]]}):[],Ve(function(r){for(var e=-1;++e<t;){var u=n[e];if(xt(u[0],this,r))return xt(u[1],this,r)}})},$r.conforms=function(n){return function(n){var t=zf(n);return function(r){return fe(r,n,t)}}(oe(n,1))},$r.constant=na,$r.countBy=po,$r.create=function(n,t){var r=Dr(n);return null==t?r:re(r,t)},$r.curry=function n(t,e,u){var i=Gu(t,8,r,r,r,r,r,e=u?r:e);return i.placeholder=n.placeholder,i},$r.curryRight=function n(t,e,u){var i=Gu(t,16,r,r,r,r,r,e=u?r:e);return i.placeholder=n.placeholder,i},$r.debounce=So,$r.defaults=Af,$r.defaultsDeep=kf,$r.defer=zo,$r.delay=To,$r.difference=$i,$r.differenceBy=Di,$r.differenceWith=Mi,$r.drop=function(n,t,e){var u=null==n?0:n.length;return u?nu(n,(t=e||t===r?1:vf(t))<0?0:t,u):[]},$r.dropRight=function(n,t,e){var u=null==n?0:n.length;return u?nu(n,0,(t=u-(t=e||t===r?1:vf(t)))<0?0:t):[]},$r.dropRightWhile=function(n,t){return n&&n.length?lu(n,ii(t,3),!0,!0):[]},$r.dropWhile=function(n,t){return n&&n.length?lu(n,ii(t,3),!0):[]},$r.fill=function(n,t,e,u){var i=null==n?0:n.length;return i?(e&&"number"!=typeof e&&gi(n,t,e)&&(e=0,u=i),function(n,t,e,u){var i=n.length;for((e=vf(e))<0&&(e=-e>i?0:i+e),(u=u===r||u>i?i:vf(u))<0&&(u+=i),u=e>u?0:_f(u);e<u;)n[e++]=t;return n}(n,t,e,u)):[]},$r.filter=function(n,t){return(Po(n)?Et:ve)(n,ii(t,3))},$r.flatMap=function(n,t){return _e(xo(n,t),1)},$r.flatMapDeep=function(n,t){return _e(xo(n,t),a)},$r.flatMapDepth=function(n,t,e){return e=e===r?1:vf(e),_e(xo(n,t),e)},$r.flatten=Pi,$r.flattenDeep=function(n){return null!=n&&n.length?_e(n,a):[]},$r.flattenDepth=function(n,t){return null!=n&&n.length?_e(n,t=t===r?1:vf(t)):[]},$r.flip=function(n){return Gu(n,512)},$r.flow=ta,$r.flowRight=ra,$r.fromPairs=function(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];ee(e,u[0],u[1])}return e},$r.functions=function(n){return null==n?[]:we(n,zf(n))},$r.functionsIn=function(n){return null==n?[]:we(n,Tf(n))},$r.groupBy=bo,$r.initial=function(n){return null!=n&&n.length?nu(n,0,-1):[]},$r.intersection=Zi,$r.intersectionBy=Ki,$r.intersectionWith=Vi,$r.invert=If,$r.invertBy=Rf,$r.invokeMap=wo,$r.iteratee=ua,$r.keyBy=mo,$r.keys=zf,$r.keysIn=Tf,$r.map=xo,$r.mapKeys=function(n,t){var r={};return t=ii(t,3),de(n,function(n,e,u){ee(r,t(n,e,u),n)}),r},$r.mapValues=function(n,t){var r={};return t=ii(t,3),de(n,function(n,e,u){ee(r,e,t(n,e,u))}),r},$r.matches=function(n){return Be(oe(n,1))},$r.matchesProperty=function(n,t){return $e(n,oe(t,1))},$r.memoize=Co,$r.merge=Cf,$r.mergeWith=Lf,$r.method=ia,$r.methodOf=oa,$r.mixin=fa,$r.negate=Lo,$r.nthArg=function(n){return n=vf(n),Ve(function(t){return Me(t,n)})},$r.omit=Wf,$r.omitBy=function(n,t){return Bf(n,Lo(ii(t)))},$r.once=function(n){return Eo(2,n)},$r.orderBy=function(n,t,e,u){return null==n?[]:(Po(t)||(t=null==t?[]:[t]),Po(e=u?r:e)||(e=null==e?[]:[e]),Fe(n,t,e))},$r.over=ca,$r.overArgs=Wo,$r.overEvery=la,$r.overSome=sa,$r.partial=Uo,$r.partialRight=Bo,$r.partition=jo,$r.pick=Uf,$r.pickBy=Bf,$r.property=ha,$r.propertyOf=function(n){return function(t){return null==n?r:me(n,t)}},$r.pull=Hi,$r.pullAll=Ji,$r.pullAllBy=function(n,t,r){return n&&n.length&&t&&t.length?Pe(n,t,ii(r,2)):n},$r.pullAllWith=function(n,t,e){return n&&n.length&&t&&t.length?Pe(n,t,r,e):n},$r.pullAt=Yi,$r.range=pa,$r.rangeRight=va,$r.rearg=$o,$r.reject=function(n,t){return(Po(n)?Et:ve)(n,Lo(ii(t,3)))},$r.remove=function(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=ii(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return qe(n,u),r},$r.rest=function(n,t){if("function"!=typeof n)throw new In(e);return Ve(n,t=t===r?t:vf(t))},$r.reverse=Qi,$r.sampleSize=function(n,t,e){return t=(e?gi(n,t,e):t===r)?1:vf(t),(Po(n)?Jr:He)(n,t)},$r.set=function(n,t,r){return null==n?n:Je(n,t,r)},$r.setWith=function(n,t,e,u){return u="function"==typeof u?u:r,null==n?n:Je(n,t,e,u)},$r.shuffle=function(n){return(Po(n)?Yr:Xe)(n)},$r.slice=function(n,t,e){var u=null==n?0:n.length;return u?(e&&"number"!=typeof e&&gi(n,t,e)?(t=0,e=u):(t=null==t?0:vf(t),e=e===r?u:vf(e)),nu(n,t,e)):[]},$r.sortBy=Ao,$r.sortedUniq=function(n){return n&&n.length?uu(n):[]},$r.sortedUniqBy=function(n,t){return n&&n.length?uu(n,ii(t,2)):[]},$r.split=function(n,t,e){return e&&"number"!=typeof e&&gi(n,t,e)&&(t=e=r),(e=e===r?s:e>>>0)?(n=df(n))&&("string"==typeof t||null!=t&&!uf(t))&&!(t=ou(t))&&rr(n)?du(cr(n),0,e):n.split(t,e):[]},$r.spread=function(n,t){if("function"!=typeof n)throw new In(e);return t=null==t?0:gr(vf(t),0),Ve(function(r){var e=r[t],u=du(r,0,t);return e&&zt(u,e),xt(n,this,u)})},$r.tail=function(n){var t=null==n?0:n.length;return t?nu(n,1,t):[]},$r.take=function(n,t,e){return n&&n.length?nu(n,0,(t=e||t===r?1:vf(t))<0?0:t):[]},$r.takeRight=function(n,t,e){var u=null==n?0:n.length;return u?nu(n,(t=u-(t=e||t===r?1:vf(t)))<0?0:t,u):[]},$r.takeRightWhile=function(n,t){return n&&n.length?lu(n,ii(t,3),!1,!0):[]},$r.takeWhile=function(n,t){return n&&n.length?lu(n,ii(t,3)):[]},$r.tap=function(n,t){return t(n),n},$r.throttle=function(n,t,r){var u=!0,i=!0;if("function"!=typeof n)throw new In(e);return Xo(r)&&(u="leading"in r?!!r.leading:u,i="trailing"in r?!!r.trailing:i),So(n,t,{leading:u,maxWait:t,trailing:i})},$r.thru=so,$r.toArray=hf,$r.toPairs=$f,$r.toPairsIn=Df,$r.toPath=function(n){return Po(n)?St(n,Wi):af(n)?[n]:Ou(Li(df(n)))},$r.toPlainObject=yf,$r.transform=function(n,t,r){var e=Po(n),u=e||Vo(n)||cf(n);if(t=ii(t,4),null==r){var i=n&&n.constructor;r=u?e?new i:[]:Xo(n)&&Jo(i)?Dr(Zn(n)):{}}return(u?At:de)(n,function(n,e,u){return t(r,n,e,u)}),r},$r.unary=function(n){return Oo(n,1)},$r.union=Xi,$r.unionBy=no,$r.unionWith=to,$r.uniq=function(n){return n&&n.length?fu(n):[]},$r.uniqBy=function(n,t){return n&&n.length?fu(n,ii(t,2)):[]},$r.uniqWith=function(n,t){return t="function"==typeof t?t:r,n&&n.length?fu(n,r,t):[]},$r.unset=function(n,t){return null==n||au(n,t)},$r.unzip=ro,$r.unzipWith=eo,$r.update=function(n,t,r){return null==n?n:cu(n,t,_u(r))},$r.updateWith=function(n,t,e,u){return u="function"==typeof u?u:r,null==n?n:cu(n,t,_u(e),u)},$r.values=Mf,$r.valuesIn=function(n){return null==n?[]:Ht(n,Tf(n))},$r.without=uo,$r.words=Yf,$r.wrap=function(n,t){return Uo(_u(t),n)},$r.xor=io,$r.xorBy=oo,$r.xorWith=fo,$r.zip=ao,$r.zipObject=function(n,t){return pu(n||[],t||[],Xr)},$r.zipObjectDeep=function(n,t){return pu(n||[],t||[],Je)},$r.zipWith=co,$r.entries=$f,$r.entriesIn=Df,$r.extend=wf,$r.extendWith=mf,fa($r,$r),$r.add=da,$r.attempt=Qf,$r.camelCase=Ff,$r.capitalize=Nf,$r.ceil=ba,$r.clamp=function(n,t,e){return e===r&&(e=t,t=r),e!==r&&(e=(e=gf(e))==e?e:0),t!==r&&(t=(t=gf(t))==t?t:0),ie(gf(n),t,e)},$r.clone=function(n){return oe(n,4)},$r.cloneDeep=function(n){return oe(n,5)},$r.cloneDeepWith=function(n,t){return oe(n,5,t="function"==typeof t?t:r)},$r.cloneWith=function(n,t){return oe(n,4,t="function"==typeof t?t:r)},$r.conformsTo=function(n,t){return null==t||fe(n,t,zf(t))},$r.deburr=Pf,$r.defaultTo=function(n,t){return null==n||n!=n?t:n},$r.divide=wa,$r.endsWith=function(n,t,e){n=df(n),t=ou(t);var u=n.length,i=e=e===r?u:ie(vf(e),0,u);return(e-=t.length)>=0&&n.slice(e,i)==t},$r.eq=Do,$r.escape=function(n){return(n=df(n))&&K.test(n)?n.replace(q,nr):n},$r.escapeRegExp=function(n){return(n=df(n))&&nn.test(n)?n.replace(X,"\\$&"):n},$r.every=function(n,t,e){var u=Po(n)?Ot:he;return e&&gi(n,t,e)&&(t=r),u(n,ii(t,3))},$r.find=vo,$r.findIndex=Fi,$r.findKey=function(n,t){return Ut(n,ii(t,3),de)},$r.findLast=_o,$r.findLastIndex=Ni,$r.findLastKey=function(n,t){return Ut(n,ii(t,3),be)},$r.floor=ma,$r.forEach=go,$r.forEachRight=yo,$r.forIn=function(n,t){return null==n?n:ge(n,ii(t,3),Tf)},$r.forInRight=function(n,t){return null==n?n:ye(n,ii(t,3),Tf)},$r.forOwn=function(n,t){return n&&de(n,ii(t,3))},$r.forOwnRight=function(n,t){return n&&be(n,ii(t,3))},$r.get=Of,$r.gt=Mo,$r.gte=Fo,$r.has=function(n,t){return null!=n&&hi(n,t,ke)},$r.hasIn=Ef,$r.head=qi,$r.identity=ea,$r.includes=function(n,t,r,e){n=Zo(n)?n:Mf(n),r=r&&!e?vf(r):0;var u=n.length;return r<0&&(r=gr(u+r,0)),ff(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&$t(n,t,r)>-1},$r.indexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:vf(r);return u<0&&(u=gr(e+u,0)),$t(n,t,u)},$r.inRange=function(n,t,e){return t=pf(t),e===r?(e=t,t=0):e=pf(e),function(n,t,r){return n>=yr(t,r)&&n<gr(t,r)}(n=gf(n),t,e)},$r.invoke=Sf,$r.isArguments=No,$r.isArray=Po,$r.isArrayBuffer=qo,$r.isArrayLike=Zo,$r.isArrayLikeObject=Ko,$r.isBoolean=function(n){return!0===n||!1===n||nf(n)&&je(n)==_},$r.isBuffer=Vo,$r.isDate=Go,$r.isElement=function(n){return nf(n)&&1===n.nodeType&&!ef(n)},$r.isEmpty=function(n){if(null==n)return!0;if(Zo(n)&&(Po(n)||"string"==typeof n||"function"==typeof n.splice||Vo(n)||cf(n)||No(n)))return!n.length;var t=si(n);if(t==w||t==k)return!n.size;if(wi(n))return!Le(n).length;for(var r in n)if(Ln.call(n,r))return!1;return!0},$r.isEqual=function(n,t){return Se(n,t)},$r.isEqualWith=function(n,t,e){var u=(e="function"==typeof e?e:r)?e(n,t):r;return u===r?Se(n,t,r,e):!!u},$r.isError=Ho,$r.isFinite=function(n){return"number"==typeof n&&pr(n)},$r.isFunction=Jo,$r.isInteger=Yo,$r.isLength=Qo,$r.isMap=tf,$r.isMatch=function(n,t){return n===t||ze(n,t,fi(t))},$r.isMatchWith=function(n,t,e){return e="function"==typeof e?e:r,ze(n,t,fi(t),e)},$r.isNaN=function(n){return rf(n)&&n!=+n},$r.isNative=function(n){if(bi(n))throw new xn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Te(n)},$r.isNil=function(n){return null==n},$r.isNull=function(n){return null===n},$r.isNumber=rf,$r.isObject=Xo,$r.isObjectLike=nf,$r.isPlainObject=ef,$r.isRegExp=uf,$r.isSafeInteger=function(n){return Yo(n)&&n>=-9007199254740991&&n<=c},$r.isSet=of,$r.isString=ff,$r.isSymbol=af,$r.isTypedArray=cf,$r.isUndefined=function(n){return n===r},$r.isWeakMap=function(n){return nf(n)&&si(n)==I},$r.isWeakSet=function(n){return nf(n)&&"[object WeakSet]"==je(n)},$r.join=function(n,t){return null==n?"":vr.call(n,t)},$r.kebabCase=qf,$r.last=Gi,$r.lastIndexOf=function(n,t,e){var u=null==n?0:n.length;if(!u)return-1;var i=u;return e!==r&&(i=(i=vf(e))<0?gr(u+i,0):yr(i,u-1)),t==t?function(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}(n,t,i):Bt(n,Mt,i,!0)},$r.lowerCase=Zf,$r.lowerFirst=Kf,$r.lt=lf,$r.lte=sf,$r.max=function(n){return n&&n.length?pe(n,ea,Ae):r},$r.maxBy=function(n,t){return n&&n.length?pe(n,ii(t,2),Ae):r},$r.mean=function(n){return Ft(n,ea)},$r.meanBy=function(n,t){return Ft(n,ii(t,2))},$r.min=function(n){return n&&n.length?pe(n,ea,We):r},$r.minBy=function(n,t){return n&&n.length?pe(n,ii(t,2),We):r},$r.stubArray=_a,$r.stubFalse=ga,$r.stubObject=function(){return{}},$r.stubString=function(){return""},$r.stubTrue=function(){return!0},$r.multiply=xa,$r.nth=function(n,t){return n&&n.length?Me(n,vf(t)):r},$r.noConflict=function(){return lt._===this&&(lt._=Dn),this},$r.noop=aa,$r.now=ko,$r.pad=function(n,t,r){n=df(n);var e=(t=vf(t))?ar(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return Fu(_t(u),r)+n+Fu(vt(u),r)},$r.padEnd=function(n,t,r){n=df(n);var e=(t=vf(t))?ar(n):0;return t&&e<t?n+Fu(t-e,r):n},$r.padStart=function(n,t,r){n=df(n);var e=(t=vf(t))?ar(n):0;return t&&e<t?Fu(t-e,r)+n:n},$r.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),br(df(n).replace(tn,""),t||0)},$r.random=function(n,t,e){if(e&&"boolean"!=typeof e&&gi(n,t,e)&&(t=e=r),e===r&&("boolean"==typeof t?(e=t,t=r):"boolean"==typeof n&&(e=n,n=r)),n===r&&t===r?(n=0,t=1):(n=pf(n),t===r?(t=n,n=0):t=pf(t)),n>t){var u=n;n=t,t=u}if(e||n%1||t%1){var i=wr();return yr(n+i*(t-n+ot("1e-"+((i+"").length-1))),t)}return Ze(n,t)},$r.reduce=function(n,t,r){var e=Po(n)?Tt:qt,u=arguments.length<3;return e(n,ii(t,4),r,u,le)},$r.reduceRight=function(n,t,r){var e=Po(n)?Ct:qt,u=arguments.length<3;return e(n,ii(t,4),r,u,se)},$r.repeat=function(n,t,e){return t=(e?gi(n,t,e):t===r)?1:vf(t),Ke(df(n),t)},$r.replace=function(){var n=arguments,t=df(n[0]);return n.length<3?t:t.replace(n[1],n[2])},$r.result=function(n,t,e){var u=-1,i=(t=gu(t,n)).length;for(i||(i=1,n=r);++u<i;){var o=null==n?r:n[Wi(t[u])];o===r&&(u=i,o=e),n=Jo(o)?o.call(n):o}return n},$r.round=ja,$r.runInContext=n,$r.sample=function(n){return(Po(n)?Hr:Ge)(n)},$r.size=function(n){if(null==n)return 0;if(Zo(n))return ff(n)?ar(n):n.length;var t=si(n);return t==w||t==k?n.size:Le(n).length},$r.snakeCase=Vf,$r.some=function(n,t,e){var u=Po(n)?Lt:tu;return e&&gi(n,t,e)&&(t=r),u(n,ii(t,3))},$r.sortedIndex=function(n,t){return ru(n,t)},$r.sortedIndexBy=function(n,t,r){return eu(n,t,ii(r,2))},$r.sortedIndexOf=function(n,t){var r=null==n?0:n.length;if(r){var e=ru(n,t);if(e<r&&Do(n[e],t))return e}return-1},$r.sortedLastIndex=function(n,t){return ru(n,t,!0)},$r.sortedLastIndexBy=function(n,t,r){return eu(n,t,ii(r,2),!0)},$r.sortedLastIndexOf=function(n,t){if(null!=n&&n.length){var r=ru(n,t,!0)-1;if(Do(n[r],t))return r}return-1},$r.startCase=Gf,$r.startsWith=function(n,t,r){return n=df(n),r=null==r?0:ie(vf(r),0,n.length),t=ou(t),n.slice(r,r+t.length)==t},$r.subtract=Aa,$r.sum=function(n){return n&&n.length?Zt(n,ea):0},$r.sumBy=function(n,t){return n&&n.length?Zt(n,ii(t,2)):0},$r.template=function(n,t,e){var u=$r.templateSettings;e&&gi(n,t,e)&&(t=r),n=df(n),t=xf({},t,u,Hu);var i=xf({},t.imports,u.imports,Hu),o=zf(i),f=Ht(i,o);At(o,function(n){if(an.test(n))throw new xn("Invalid `imports` option passed into `_.template`")});var a,c,l=0,s=t.interpolate||dn,h="__p +='",p=On((t.escape||dn).source+"|"+s.source+"|"+(s===H?ln:dn).source+"|"+(t.evaluate||dn).source+"|$","g"),v="//# sourceURL="+(Ln.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";n.replace(p,function(t,r,e,u,i,o){return e||(e=u),h+=n.slice(l,o).replace(bn,tr),r&&(a=!0,h+="' +\n__e("+r+") +\n'"),i&&(c=!0,h+="';\n"+i+";\n__p +='"),e&&(h+="' +\n((__t=("+e+"))==null ? '':__t) +\n'"),l=o+t.length,t}),h+="';\n";var _=Ln.call(t,"variable")&&t.variable;if(_){if(an.test(_))throw new xn("Invalid `variable` option passed into `_.template`")}else h="with (obj){\n"+h+"\n}\n";h=(c?h.replace(M,""):h).replace(F,"$1").replace(N,"$1;"),h="function("+(_||"obj")+"){\n"+(_?"":"obj||(obj={});\n")+"var __t, __p=''"+(a?", __e=_.escape":"")+(c?", __j=Array.prototype.join;\nfunction print(){ __p +=__j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Qf(function(){return jn(o,v+"return "+h).apply(r,f)});if(g.source=h,Ho(g))throw g;return g},$r.times=function(n,t){if((n=vf(n))<1||n>c)return[];var r=s,e=yr(n,s);t=ii(t),n-=s;for(var u=Kt(e,t);++r<n;)t(r);return u},$r.toFinite=pf,$r.toInteger=vf,$r.toLength=_f,$r.toLower=function(n){return df(n).toLowerCase()},$r.toNumber=gf,$r.toSafeInteger=function(n){return n?ie(vf(n),-9007199254740991,c):0===n?n:0},$r.toString=df,$r.toUpper=function(n){return df(n).toUpperCase()},$r.trim=function(n,t,e){if((n=df(n))&&(e||t===r))return Vt(n);if(!n||!(t=ou(t)))return n;var u=cr(n),i=cr(t);return du(u,Yt(u,i),Qt(u,i)+1).join("")},$r.trimEnd=function(n,t,e){if((n=df(n))&&(e||t===r))return n.slice(0,lr(n)+1);if(!n||!(t=ou(t)))return n;var u=cr(n);return du(u,0,Qt(u,cr(t))+1).join("")},$r.trimStart=function(n,t,e){if((n=df(n))&&(e||t===r))return n.replace(tn,"");if(!n||!(t=ou(t)))return n;var u=cr(n);return du(u,Yt(u,cr(t))).join("")},$r.truncate=function(n,t){var e=30,u="...";if(Xo(t)){var i="separator"in t?t.separator:i;e="length"in t?vf(t.length):e,u="omission"in t?ou(t.omission):u}var o=(n=df(n)).length;if(rr(n)){var f=cr(n);o=f.length}if(e>=o)return n;var a=e-ar(u);if(a<1)return u;var c=f?du(f,0,a).join(""):n.slice(0,a);if(i===r)return c+u;if(f&&(a+=c.length-a),uf(i)){if(n.slice(a).search(i)){var l,s=c;for(i.global||(i=On(i.source,df(sn.exec(i))+"g")),i.lastIndex=0;l=i.exec(s);)var h=l.index;c=c.slice(0,h===r?a:h)}}else if(n.indexOf(ou(i),a)!=a){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+u},$r.unescape=function(n){return(n=df(n))&&Z.test(n)?n.replace(P,sr):n},$r.uniqueId=function(n){var t=++Wn;return df(n)+t},$r.upperCase=Hf,$r.upperFirst=Jf,$r.each=go,$r.eachRight=yo,$r.first=qi,fa($r,(ya={},de($r,function(n,t){Ln.call($r.prototype,t)||(ya[t]=n)}),ya),{chain:!1}),$r.VERSION="4.18.1",At(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){$r[n].placeholder=$r}),At(["drop","take"],function(n,t){Nr.prototype[n]=function(e){e=e===r?1:gr(vf(e),0);var u=this.__filtered__&&!t?new Nr(this):this.clone();return u.__filtered__?u.__takeCount__=yr(e,u.__takeCount__):u.__views__.push({size:yr(e,s),type:n+(u.__dir__<0?"Right":"")}),u},Nr.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),At(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;Nr.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:ii(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),At(["head","last"],function(n,t){var r="take"+(t?"Right":"");Nr.prototype[n]=function(){return this[r](1).value()[0]}}),At(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Nr.prototype[n]=function(){return this.__filtered__?new Nr(this):this[r](1)}}),Nr.prototype.compact=function(){return this.filter(ea)},Nr.prototype.find=function(n){return this.filter(n).head()},Nr.prototype.findLast=function(n){return this.reverse().find(n)},Nr.prototype.invokeMap=Ve(function(n,t){return"function"==typeof n?new Nr(this):this.map(function(r){return Ie(r,n,t)})}),Nr.prototype.reject=function(n){return this.filter(Lo(ii(n)))},Nr.prototype.slice=function(n,t){n=vf(n);var e=this;return e.__filtered__&&(n>0||t<0)?new Nr(e):(n<0?e=e.takeRight(-n):n&&(e=e.drop(n)),t!==r&&(e=(t=vf(t))<0?e.dropRight(-t):e.take(t-n)),e)},Nr.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Nr.prototype.toArray=function(){return this.take(s)},de(Nr.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),u=/^(?:head|last)$/.test(t),i=$r[u?"take"+("last"==t?"Right":""):t],o=u||/^find/.test(t);i&&($r.prototype[t]=function(){var t=this.__wrapped__,f=u?[1]:arguments,a=t instanceof Nr,c=f[0],l=a||Po(t),s=function(n){var t=i.apply($r,zt([n],f));return u&&h?t[0]:t};l&&e&&"function"==typeof c&&1!=c.length&&(a=l=!1);var h=this.__chain__,p=!!this.__actions__.length,v=o&&!h,_=a&&!p;if(!o&&l){t=_?t:new Nr(this);var g=n.apply(t,f);return g.__actions__.push({func:so,args:[s],thisArg:r}),new Fr(g,h)}return v&&_?n.apply(this,f):(g=this.thru(s),v?u?g.value()[0]:g.value():g)})}),At(["pop","push","shift","sort","splice","unshift"],function(n){var t=Rn[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);$r.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Po(u)?u:[],n)}return this[r](function(r){return t.apply(Po(r)?r:[],n)})}}),de(Nr.prototype,function(n,t){var r=$r[t];if(r){var e=r.name+"";Ln.call(Rr,e)||(Rr[e]=[]),Rr[e].push({name:t,func:r})}}),Rr[Bu(r,2).name]=[{name:"wrapper",func:r}],Nr.prototype.clone=function(){var n=new Nr(this.__wrapped__);return n.__actions__=Ou(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Ou(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Ou(this.__views__),n},Nr.prototype.reverse=function(){if(this.__filtered__){var n=new Nr(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Nr.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,r=Po(n),e=t<0,u=r?n.length:0,i=function(n,t,r){for(var e=-1,u=r.length;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=yr(t,n+o);break;case"takeRight":n=gr(n,t-o)}}return{start:n,end:t}}(0,u,this.__views__),o=i.start,f=i.end,a=f-o,c=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=yr(a,this.__takeCount__);if(!r||!e&&u==a&&p==a)return su(n,this.__actions__);var v=[];n:for(;a--&&h<p;){for(var _=-1,g=n[c+=t];++_<s;){var y=l[_],d=y.iteratee,b=y.type,w=d(g);if(2==b)g=w;else if(!w){if(1==b)continue n;break n}}v[h++]=g}return v},$r.prototype.at=ho,$r.prototype.chain=function(){return lo(this)},$r.prototype.commit=function(){return new Fr(this.value(),this.__chain__)},$r.prototype.next=function(){this.__values__===r&&(this.__values__=hf(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?r:this.__values__[this.__index__++]}},$r.prototype.plant=function(n){for(var t,e=this;e instanceof Mr;){var u=Bi(e);u.__index__=0,u.__values__=r,t?i.__wrapped__=u:t=u;var i=u;e=e.__wrapped__}return i.__wrapped__=n,t},$r.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Nr){var t=n;return this.__actions__.length&&(t=new Nr(this)),(t=t.reverse()).__actions__.push({func:so,args:[Qi],thisArg:r}),new Fr(t,this.__chain__)}return this.thru(Qi)},$r.prototype.toJSON=$r.prototype.valueOf=$r.prototype.value=function(){return su(this.__wrapped__,this.__actions__)},$r.prototype.first=$r.prototype.head,Xn&&($r.prototype[Xn]=function(){return this}),$r}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(lt._=hr,define(function(){return hr})):ht?((ht.exports=hr)._=hr,st._=hr):lt._=hr}.call(this)}},t={};function r(e){var u=t[e];if(void 0!==u)return u.exports;var i=t[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.n=n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return r.d(t,{a:t}),t},r.d=(n,t)=>{for(var e in t)r.o(t,e)&&!r.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})},r.o=(n,t)=>Object.prototype.hasOwnProperty.call(n,t),r.nmd=n=>(n.paths=[],n.children||(n.children=[]),n),(()=>{"use strict";var n=r(243);function t(n,t){(null==t||t>n.length)&&(t=n.length);for(var r=0,e=Array(t);r<t;r++)e[r]=n[r];return e}!function(){function r(){if(!globalThis.wp_consent_type&&!globalThis.wp_fallback_consent_type)return;const r={};let e=!1;Object.entries(globalThis._googlesitekitConsentCategoryMap).forEach(n=>{let u=(a=2,function(n){if(Array.isArray(n))return n}(f=n)||function(n,t){var r=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=r){var e,u,i,o,f=[],a=!0,c=!1;try{if(i=(r=r.call(n)).next,0===t){if(Object(r)!==r)return;a=!1}else for(;!(a=(e=i.call(r)).done)&&(f.push(e.value),f.length!==t);a=!0);}catch(n){c=!0,u=n}finally{try{if(!a&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw u}}return f}}(f,a)||function(n,r){if(n){if("string"==typeof n)return t(n,r);var e={}.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?t(n,r):void 0}}(f,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=u[0],o=u[1];var f,a;globalThis.wp_has_consent&&globalThis.wp_has_consent(i)&&(o.forEach(n=>{r[n]="granted"}),e=e||!!o.length)}),e&&!(0,n.isEqual)(r,globalThis._googlesitekitConsents)&&(globalThis.gtag("consent","update",r),globalThis._googlesitekitConsents=r)}globalThis.document.addEventListener("wp_listen_for_consent_change",function(n){if(n.detail){const t={};let r=!1;Object.keys(n.detail).forEach(e=>{if(globalThis._googlesitekitConsentCategoryMap[e]){const u="allow"===n.detail[e]?"granted":"denied",i=globalThis._googlesitekitConsentCategoryMap[e];i.forEach(n=>{t[n]=u}),r=!!i.length}}),r&&globalThis.gtag("consent","update",t)}}),globalThis.document.addEventListener("wp_consent_type_defined",r),globalThis.document.addEventListener("DOMContentLoaded",()=>{globalThis.waitfor_consent_hook||r()})}()})()})();
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.sbjs=e()}}(function(){return function e(t,r,n){function a(s,o){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!o&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var p=r[s]={exports:{}};t[s][0].call(p.exports,function(e){var r=t[s][1][e];return a(r||e)},p,p.exports,e,t,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,r){"use strict";var n=e("./init"),a={init:function(e){this.get=n(e),e&&e.callback&&"function"==typeof e.callback&&e.callback(this.get)}};t.exports=a},{"./init":6}],2:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/utils"),i={containers:{current:"sbjs_current",current_extra:"sbjs_current_add",first:"sbjs_first",first_extra:"sbjs_first_add",session:"sbjs_session",udata:"sbjs_udata",promocode:"sbjs_promo"},service:{migrations:"sbjs_migrations"},delimiter:"|||",aliases:{main:{type:"typ",source:"src",medium:"mdm",campaign:"cmp",content:"cnt",term:"trm",id:"id",platform:"plt",format:"fmt",tactic:"tct"},extra:{fire_date:"fd",entrance_point:"ep",referer:"rf"},session:{pages_seen:"pgs",current_page:"cpg"},udata:{visits:"vst",ip:"uip",agent:"uag"},promo:"code"},pack:{main:function(e){return i.aliases.main.type+"="+e.type+i.delimiter+i.aliases.main.source+"="+e.source+i.delimiter+i.aliases.main.medium+"="+e.medium+i.delimiter+i.aliases.main.campaign+"="+e.campaign+i.delimiter+i.aliases.main.content+"="+e.content+i.delimiter+i.aliases.main.term+"="+e.term+i.delimiter+i.aliases.main.id+"="+e.id+i.delimiter+i.aliases.main.platform+"="+e.platform+i.delimiter+i.aliases.main.format+"="+e.format+i.delimiter+i.aliases.main.tactic+"="+e.tactic},extra:function(e){return i.aliases.extra.fire_date+"="+a.setDate(new Date,e)+i.delimiter+i.aliases.extra.entrance_point+"="+document.location.href+i.delimiter+i.aliases.extra.referer+"="+(document.referrer||n.none)},user:function(e,t){return i.aliases.udata.visits+"="+e+i.delimiter+i.aliases.udata.ip+"="+t+i.delimiter+i.aliases.udata.agent+"="+navigator.userAgent},session:function(e){return i.aliases.session.pages_seen+"="+e+i.delimiter+i.aliases.session.current_page+"="+document.location.href},promo:function(e){return i.aliases.promo+"="+a.setLeadingZeroToInt(a.randomInt(e.min,e.max),e.max.toString().length)}}};t.exports=i},{"./helpers/utils":5,"./terms":9}],3:[function(e,t,r){"use strict";var n=e("../data").delimiter;t.exports={useBase64:!1,setBase64Flag:function(e){this.useBase64=e},encodeData:function(e){return encodeURIComponent(e).replace(/\!/g,"%21").replace(/\~/g,"%7E").replace(/\*/g,"%2A").replace(/\'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29")},decodeData:function(e){try{return decodeURIComponent(e).replace(/\%21/g,"!").replace(/\%7E/g,"~").replace(/\%2A/g,"*").replace(/\%27/g,"'").replace(/\%28/g,"(").replace(/\%29/g,")")}catch(t){try{return unescape(e)}catch(r){return""}}},set:function(e,t,r,n,a){var i,s;if(r){var o=new Date;o.setTime(o.getTime()+60*r*1e3),i="; expires="+o.toGMTString()}else i="";s=n&&!a?";domain=."+n:"";var c=this.encodeData(t);this.useBase64&&(c=btoa(c).replace(/=+$/,"")),document.cookie=this.encodeData(e)+"="+c+i+s+"; path=/"},get:function(e){for(var t=this.encodeData(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var a=r[n];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(t)){var i=a.substring(t.length,a.length);if(/^[A-Za-z0-9+/]+$/.test(i))try{i=atob(i.padEnd(4*Math.ceil(i.length/4),"="))}catch(s){}return this.decodeData(i)}}return null},destroy:function(e,t,r){this.set(e,"",-1,t,r)},parse:function(e){var t=[],r={};if("string"==typeof e)t.push(e);else for(var a in e)e.hasOwnProperty(a)&&t.push(e[a]);for(var i=0;i<t.length;i++){var s;r[this.unsbjs(t[i])]={},s=this.get(t[i])?this.get(t[i]).split(n):[];for(var o=0;o<s.length;o++){var c=s[o].split("="),u=c.splice(0,1);u.push(c.join("=")),r[this.unsbjs(t[i])][u[0]]=this.decodeData(u[1])}}return r},unsbjs:function(e){return e.replace("sbjs_","")}}},{"../data":2}],4:[function(e,t,r){"use strict";t.exports={parse:function(e){for(var t=this.parseOptions,r=t.parser[t.strictMode?"strict":"loose"].exec(e),n={},a=14;a--;)n[t.key[a]]=r[a]||"";return n[t.q.name]={},n[t.key[12]].replace(t.q.parser,function(e,r,a){r&&(n[t.q.name][r]=a)}),n},parseOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},getParam:function(e){for(var t={},r=(e||window.location.search.substring(1)).split("&"),n=0;n<r.length;n++){var a=r[n].split("=");if("undefined"==typeof t[a[0]])t[a[0]]=a[1];else if("string"==typeof t[a[0]]){var i=[t[a[0]],a[1]];t[a[0]]=i}else t[a[0]].push(a[1])}return t},getHost:function(e){return this.parse(e).host.replace("www.","")}}},{}],5:[function(e,t,r){"use strict";t.exports={escapeRegexp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},setDate:function(e,t){var r=e.getTimezoneOffset()/60,n=e.getHours(),a=t||0===t?t:-r;return e.setHours(n+r+a),e.getFullYear()+"-"+this.setLeadingZeroToInt(e.getMonth()+1,2)+"-"+this.setLeadingZeroToInt(e.getDate(),2)+" "+this.setLeadingZeroToInt(e.getHours(),2)+":"+this.setLeadingZeroToInt(e.getMinutes(),2)+":"+this.setLeadingZeroToInt(e.getSeconds(),2)},setLeadingZeroToInt:function(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r},randomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}}},{}],6:[function(e,t,r){"use strict";var n=e("./data"),a=e("./terms"),i=e("./helpers/cookies"),s=e("./helpers/uri"),o=e("./helpers/utils"),c=e("./params"),u=e("./migrations");t.exports=function(e){var t,r,p,f,m,d,l,g,h,y,_,v,b,x=c.fetch(e),k=s.getParam(),w=x.domain.host,q=x.domain.isolate,I=x.lifetime;function j(e){switch(e){case a.traffic.utm:t=a.traffic.utm,r="undefined"!=typeof k.utm_source?k.utm_source:"undefined"!=typeof k.gclid?"google":"undefined"!=typeof k.yclid?"yandex":a.none,p="undefined"!=typeof k.utm_medium?k.utm_medium:"undefined"!=typeof k.gclid?"cpc":"undefined"!=typeof k.yclid?"cpc":a.none,f="undefined"!=typeof k.utm_campaign?k.utm_campaign:"undefined"!=typeof k[x.campaign_param]?k[x.campaign_param]:"undefined"!=typeof k.gclid?"google_cpc":"undefined"!=typeof k.yclid?"yandex_cpc":a.none,m="undefined"!=typeof k.utm_content?k.utm_content:"undefined"!=typeof k[x.content_param]?k[x.content_param]:a.none,l=k.utm_id||a.none,g=k.utm_source_platform||a.none,h=k.utm_creative_format||a.none,y=k.utm_marketing_tactic||a.none,d="undefined"!=typeof k.utm_term?k.utm_term:"undefined"!=typeof k[x.term_param]?k[x.term_param]:function(){var e=document.referrer;if(k.utm_term)return k.utm_term;if(!(e&&s.parse(e).host&&s.parse(e).host.match(/^(?:.*\.)?yandex\..{2,9}$/i)))return!1;try{return s.getParam(s.parse(document.referrer).query).text}catch(t){return!1}}()||a.none;break;case a.traffic.organic:t=a.traffic.organic,r=r||s.getHost(document.referrer),p=a.referer.organic,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.referral:t=a.traffic.referral,r=r||s.getHost(document.referrer),p=p||a.referer.referral,f=a.none,m=s.parse(document.referrer).path,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;case a.traffic.typein:t=a.traffic.typein,r=x.typein_attributes.source,p=x.typein_attributes.medium,f=a.none,m=a.none,d=a.none,l=a.none,g=a.none,h=a.none,y=a.none;break;default:t=a.oops,r=a.oops,p=a.oops,f=a.oops,m=a.oops,d=a.oops,l=a.oops,g=a.oops,h=a.oops,y=a.oops}var i={type:t,source:r,medium:p,campaign:f,content:m,term:d,id:l,platform:g,format:h,tactic:y};return n.pack.main(i)}function R(e){var t=document.referrer;switch(e){case a.traffic.organic:return!!t&&H(t)&&function(e){var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp("yandex")+"\\..{2,9}$"),n=new RegExp(".*"+o.escapeRegexp("text")+"=.*"),a=new RegExp("^(?:www\\.)?"+o.escapeRegexp("google")+"\\..{2,9}$");if(s.parse(e).query&&s.parse(e).host.match(t)&&s.parse(e).query.match(n))return r="yandex",!0;if(s.parse(e).host.match(a))return r="google",!0;if(!s.parse(e).query)return!1;for(var i=0;i<x.organics.length;i++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.organics[i].host)+"$","i"))&&s.parse(e).query.match(new RegExp(".*"+o.escapeRegexp(x.organics[i].param)+"=.*","i")))return r=x.organics[i].display||x.organics[i].host,!0;if(i+1===x.organics.length)return!1}}(t);case a.traffic.referral:return!!t&&H(t)&&function(e){if(!(x.referrals.length>0))return r=s.getHost(e),!0;for(var t=0;t<x.referrals.length;t++){if(s.parse(e).host.match(new RegExp("^(?:.*\\.)?"+o.escapeRegexp(x.referrals[t].host)+"$","i")))return r=x.referrals[t].display||x.referrals[t].host,p=x.referrals[t].medium||a.referer.referral,!0;if(t+1===x.referrals.length)return r=s.getHost(e),!0}}(t);default:return!1}}function H(e){if(x.domain){if(q)return s.getHost(e)!==s.getHost(w);var t=new RegExp("^(?:.*\\.)?"+o.escapeRegexp(w)+"$","i");return!s.getHost(e).match(t)}return s.getHost(e)!==s.getHost(document.location.href)}function D(){i.set(n.containers.current_extra,n.pack.extra(x.timezone_offset),I,w,q),i.get(n.containers.first_extra)||i.set(n.containers.first_extra,n.pack.extra(x.timezone_offset),I,w,q)}return i.setBase64Flag(x.base64),u.go(I,w,q),i.set(n.containers.current,function(){var e;if("undefined"!=typeof k.utm_source||"undefined"!=typeof k.utm_medium||"undefined"!=typeof k.utm_campaign||"undefined"!=typeof k.utm_content||"undefined"!=typeof k.utm_term||"undefined"!=typeof k.utm_id||"undefined"!=typeof k.utm_source_platform||"undefined"!=typeof k.utm_creative_format||"undefined"!=typeof k.utm_marketing_tactic||"undefined"!=typeof k.gclid||"undefined"!=typeof k.yclid||"undefined"!=typeof k[x.campaign_param]||"undefined"!=typeof k[x.term_param]||"undefined"!=typeof k[x.content_param])D(),e=j(a.traffic.utm);else if(R(a.traffic.organic))D(),e=j(a.traffic.organic);else if(!i.get(n.containers.session)&&R(a.traffic.referral))D(),e=j(a.traffic.referral);else{if(i.get(n.containers.first)||i.get(n.containers.current))return i.get(n.containers.current);D(),e=j(a.traffic.typein)}return e}(),I,w,q),i.get(n.containers.first)||i.set(n.containers.first,i.get(n.containers.current),I,w,q),i.get(n.containers.udata)?(_=parseInt(i.parse(n.containers.udata)[i.unsbjs(n.containers.udata)][n.aliases.udata.visits])||1,_=i.get(n.containers.session)?_:_+1,v=n.pack.user(_,x.user_ip)):(_=1,v=n.pack.user(_,x.user_ip)),i.set(n.containers.udata,v,I,w,q),i.get(n.containers.session)?(b=parseInt(i.parse(n.containers.session)[i.unsbjs(n.containers.session)][n.aliases.session.pages_seen])||1,b+=1):b=1,i.set(n.containers.session,n.pack.session(b),x.session_length,w,q),x.promocode&&!i.get(n.containers.promocode)&&i.set(n.containers.promocode,n.pack.promo(x.promocode),I,w,q),i.parse(n.containers)}},{"./data":2,"./helpers/cookies":3,"./helpers/uri":4,"./helpers/utils":5,"./migrations":7,"./params":8,"./terms":9}],7:[function(e,t,r){"use strict";var n=e("./data"),a=e("./helpers/cookies");t.exports={go:function(e,t,r){var i,s=this.migrations,o={l:e,d:t,i:r};if(a.get(n.containers.first)||a.get(n.service.migrations)){if(!a.get(n.service.migrations))for(i=0;i<s.length;i++)s[i].go(s[i].id,o)}else{var c=[];for(i=0;i<s.length;i++)c.push(s[i].id);var u="";for(i=0;i<c.length;i++)u+=c[i]+"=1",i<c.length-1&&(u+=n.delimiter);a.set(n.service.migrations,u,o.l,o.d,o.i)}},migrations:[{id:"1418474375998",version:"1.0.0-beta",go:function(e,t){var r=e+"=1",i=e+"=0",s=function(e,t,r){return t||r?e:n.delimiter};try{var o=[];for(var c in n.containers)n.containers.hasOwnProperty(c)&&o.push(n.containers[c]);for(var u=0;u<o.length;u++)if(a.get(o[u])){var p=a.get(o[u]).replace(/(\|)?\|(\|)?/g,s);a.destroy(o[u],t.d,t.i),a.destroy(o[u],t.d,!t.i),a.set(o[u],p,t.l,t.d,t.i)}a.get(n.containers.session)&&a.set(n.containers.session,n.pack.session(0),t.l,t.d,t.i),a.set(n.service.migrations,r,t.l,t.d,t.i)}catch(f){a.set(n.service.migrations,i,t.l,t.d,t.i)}}}]}},{"./data":2,"./helpers/cookies":3}],8:[function(e,t,r){"use strict";var n=e("./terms"),a=e("./helpers/uri");t.exports={fetch:function(e){var t=e||{},r={};if(r.lifetime=this.validate.checkFloat(t.lifetime)||6,r.lifetime=parseInt(30*r.lifetime*24*60),r.session_length=this.validate.checkInt(t.session_length)||30,r.timezone_offset=this.validate.checkInt(t.timezone_offset),r.base64=t.base64||!1,r.campaign_param=t.campaign_param||!1,r.term_param=t.term_param||!1,r.content_param=t.content_param||!1,r.user_ip=t.user_ip||n.none,t.promocode?(r.promocode={},r.promocode.min=parseInt(t.promocode.min)||1e5,r.promocode.max=parseInt(t.promocode.max)||999999):r.promocode=!1,t.typein_attributes&&t.typein_attributes.source&&t.typein_attributes.medium?(r.typein_attributes={},r.typein_attributes.source=t.typein_attributes.source,r.typein_attributes.medium=t.typein_attributes.medium):r.typein_attributes={source:"(direct)",medium:"(none)"},t.domain&&this.validate.isString(t.domain)?r.domain={host:t.domain,isolate:!1}:t.domain&&t.domain.host?r.domain=t.domain:r.domain={host:a.getHost(document.location.hostname),isolate:!1},r.referrals=[],t.referrals&&t.referrals.length>0)for(var i=0;i<t.referrals.length;i++)t.referrals[i].host&&r.referrals.push(t.referrals[i]);if(r.organics=[],t.organics&&t.organics.length>0)for(var s=0;s<t.organics.length;s++)t.organics[s].host&&t.organics[s].param&&r.organics.push(t.organics[s]);return r.organics.push({host:"bing.com",param:"q",display:"bing"}),r.organics.push({host:"yahoo.com",param:"p",display:"yahoo"}),r.organics.push({host:"about.com",param:"q",display:"about"}),r.organics.push({host:"aol.com",param:"q",display:"aol"}),r.organics.push({host:"ask.com",param:"q",display:"ask"}),r.organics.push({host:"globososo.com",param:"q",display:"globo"}),r.organics.push({host:"go.mail.ru",param:"q",display:"go.mail.ru"}),r.organics.push({host:"rambler.ru",param:"query",display:"rambler"}),r.organics.push({host:"tut.by",param:"query",display:"tut.by"}),r.referrals.push({host:"t.co",display:"twitter.com"}),r.referrals.push({host:"plus.url.google.com",display:"plus.google.com"}),r},validate:{checkFloat:function(e){return!(!e||!this.isNumeric(parseFloat(e)))&&parseFloat(e)},checkInt:function(e){return!(!e||!this.isNumeric(parseInt(e)))&&parseInt(e)},isNumeric:function(e){return!isNaN(e)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)}}}},{"./helpers/uri":4,"./terms":9}],9:[function(e,t,r){"use strict";t.exports={traffic:{utm:"utm",organic:"organic",referral:"referral",typein:"typein"},referer:{referral:"referral",organic:"organic",social:"social"},none:"(none)",oops:"(Houston, we have a problem)"}},{}]},{},[1])(1)});
!function(t){"use strict";const e=t.params,n=(document.querySelector.bind(document),(t,e)=>e.split(".").reduce((t,e)=>t&&t[e],t)),i=()=>null,s=t=>null===t||t===undefined?"":t,o="wc/store/checkout";function a(t){document.querySelectorAll("wc-order-attribution-inputs").forEach((t,e)=>{e>0&&t.remove()});for(const e of document.querySelectorAll("wc-order-attribution-inputs"))e.values=t}function r(t){window.wp&&window.wp.data&&window.wp.data.dispatch&&window.wc&&window.wc.wcBlocksData&&window.wp.data.dispatch(window.wc.wcBlocksData.CHECKOUT_STORE_KEY).setExtensionData("woocommerce/order-attribution",t,!0)}function c(){return"undefined"!=typeof sbjs}function d(){if(window.wp&&window.wp.data&&"function"==typeof window.wp.data.subscribe){const e=window.wp.data.subscribe(function(){e(),r(t.getAttributionData())},o)}}t.getAttributionData=function(){const s=e.allowTracking&&c()?n:i,o=c()?sbjs.get:{},a=Object.entries(t.fields).map(([t,e])=>[t,s(o,e)]);return Object.fromEntries(a)},t.setOrderTracking=function(n){if(e.allowTracking=n,n){if(!c())return;sbjs.init({lifetime:Number(e.lifetime),session_length:Number(e.session),base64:Boolean(e.base64),timezone_offset:"0"})}else!function(){const t=window.location.hostname;["sbjs_current","sbjs_current_add","sbjs_first","sbjs_first_add","sbjs_session","sbjs_udata","sbjs_migrations","sbjs_promo"].forEach(e=>{document.cookie=`${e}=; path=/; max-age=-999; domain=.${t};`})}();const i=t.getAttributionData();a(i),r(i)},t.setOrderTracking(e.allowTracking),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",d):d(),window.customElements.define("wc-order-attribution-inputs",class extends HTMLElement{constructor(){if(super(),this._fieldNames=Object.keys(t.fields),this.hasOwnProperty("_values")){let t=this.values;delete this.values,this.values=t||{}}}connectedCallback(){this.innerHTML="";const t=new DocumentFragment;for(const n of this._fieldNames){const i=document.createElement("input");i.type="hidden",i.name=`${e.prefix}${n}`,i.value=s(this.values&&this.values[n]||""),t.appendChild(i)}this.appendChild(t)}set values(t){if(this._values=t,this.isConnected)for(const t of this._fieldNames){const n=this.querySelector(`input[name="${e.prefix}${t}"]`);n?n.value=s(this.values[t]):console.warn(`Field "${t}" not found. `+"Most likely, the '<wc-order-attribution-inputs>' element was manipulated.")}}get values(){return this._values}})}(window.wc_order_attribution);