";$("#uucss-rule-history_wrapper .dataTables_info").append(element);$("#uucss_auto_refresh_frontend_rule").change(function(){$("#uucss_auto_refresh_frontend-hidden_rule").val($(this).is(":checked")?1:0);auto_refresh_rule=$(this).is(":checked")});$("#uucss_auto_refresh_frontend_rule").prop("checked",auto_refresh_rule);var lengthChange='
Show '+''+'15 '+'25 '+'50 '+'100 '+"
";$(lengthChange).prependTo($("#uucss-rule-history_info"));var select=$('
'+'All "+'Queued "+'Waiting "+'Processing "+'Success "+'Warning "+'Failed "+" ");var input='
';$(input).prependTo($("#uucss-rule-history_info"));$(select).prependTo($("#uucss-rule-history_info"));$("#uucss-rule-history_info select.status").on("change",function(){status_filter_rule=$(this).val();rule_table.column(4).search(status_filter_rule?"^"+status_filter_rule+"$":"",true,false).draw()});var $input=$('#uucss-rule-history_info .uucss-url-search-wrap.rule-history input[type="search"]');var $exact_search=$("#uucss-rule-history_info .uucss-url-search-wrap.rule-history input.uucss_search_exact");$input.on("input",function(){url_filter_rule=$(this).val();var regex=url_filter_rule;if(exact_search_val_rule){regex="^"+url_filter_rule+"$"}rule_table.column(1).search(url_filter_rule?regex:"",true,false).draw()});$exact_search.on("change",function(){exact_search_val_rule=$(this).prop("checked")});if(url_filter_rule!==""){$input.focus().val("").val(url_filter_rule)}$exact_search.prop("checked",exact_search_val_rule);$("#uucss-rule-history tbody tr").off();$("#uucss-rule-history tbody tr").click(function(){$(this).toggleClass("selected");var $table_row=$("#uucss-rule-history tbody tr.selected");var $container=$("#uucss-wrapper li.uucss-history.uucss-rule-history");$("#uucss-wrapper li.uucss-history.uucss-rule-history .multiple-selected-text .multiple-selected-value").text("("+$table_row.length+") Rules");if($table_row.length>1){!$container.hasClass("multi-select")&&$container.addClass("multi-select")}else{$container.hasClass("multi-select")&&$container.removeClass("multi-select")}});$("#uucss-rule-history_length select").change(function(){page_length_rule=$(this).val();if(!page_length_rule){return}$uucss_rule_spinner.addClass("loading");rule_table.page.len(page_length_rule);rule_table.ajax.reload(null,false)});if(Number(page_length_rule)!==10){$("#uucss-rule-history_length select").val(page_length_rule)}$("#uucss-rule-history thead tr th.applied-links").click(function(){rule_table.columns([3]).visible(true)});$("#uucss-rule-history thead tr th.hits-count").click(function(){rule_table.columns([3]).visible(false)})});var auto_refresh=$("#uucss_auto_refresh_frontend-hidden").val()=="0";var auto_refresh_rule=$("#uucss_auto_refresh_frontend-hidden_rule").val()=="0";var firstReload=true;var firstRuleReload=true;var status_filter="";var status_filter_rule="";var url_filter="";var url_filter_rule="";var page_length="10";var page_length_rule="10";var exact_search_val=false;var exact_search_val_rule=false;$uucss_spinner.addClass("loading");table=table.DataTable({serverSide:true,processing:false,language:{processing:'
'},ajax:{beforeSend(){!$uucss_spinner.hasClass("loading")&&$uucss_spinner.addClass("loading")},url:wp.ajax.settings.url+"?action=uucss_data",type:"POST",data:function(d){if(status_filter!==""&&status_filter!==undefined){if(d.columns[0]&&d.columns[0].search){d.columns[0].search.value=status_filter}}if(url_filter!==""&&url_filter!==undefined){if(d.columns[1]&&d.columns[1].search){d.columns[1].search.value=url_filter;d.columns[1].search.regex=exact_search_val}}d.nonce=uucss.nonce;return d},dataSrc:function(d){$uucss_spinner.removeClass("loading");if(!d.success){$.uucssAlert("Failed to fetch optimizations","error");return[]}var results=d.data;firstReload=false;return results}},searching:true,pagingType:"simple",tfoot:false,lengthChange:false,bSort:false,columns:[{data:"status",title:"Status",width:"50px",className:"dt-body-center dt-head-center",render:function(data,type,row,meta){if(!data&&row.cpcss){data=row.cpcss.status}var classNames="status ";if(data==="queued"||data==="processing"){classNames+="refresh "}classNames+=data+" ";return'
'+data+" "}},{data:"url",title:"URL",className:"url",render(data){if(!data){return""}return'
'+decodeURI(data)+" "}},{data:"rule",title:"Rule",width:"100px",visible:window.uucss.rules_enabled==="1",className:"dt-body-center dt-head-center",render:function(data,type,row,meta){return'
'+(data?data.replace("is_",""):"")+" "}},{data:"url",className:"dt-body-center dt-head-center stats th-reduction",title:"File Size Reduction",width:"145px",render:function(data,type,row,meta){if(row.meta&&row.meta.stats&&(row.status==="success"||row.rule_status==="success")){return row.meta.stats.reduction+"%"}else if(row.status==="queued"||row.status==="processing"||row.status==="waiting"||row.status==="rule-based"){return'
- '}return"-"},createdCell:function(td,cellData,rowData){var innerTippy;var innerTippy2;var stat=$(td).wrapInner($("
"));var $warnings_html=$('
');var $cpcss_html=$('
');if(rowData.cpcss){if(rowData.cpcss.status==="success"){$cpcss_html.append('
');$cpcss_html.append('
Critical css generated ('+rowData.cpcss.hits+"/"+rowData.cpcss.attempts+") ")}}if(!window.uucss||!window.uucss.uucss_enable_debug){if(rowData.meta?.warnings?.length){rowData.meta.warnings=rowData.meta.warnings.filter(function(w){return!w.message.toString().includes("optimized version for the file missing")})}}var warnings=[];if(rowData.meta&&rowData.meta.warnings&&rowData.meta.warnings.length){if(rowData.status==="rule-based"){warnings=rowData.meta.warnings.filter(war=>{return war.id==rowData.job_id})}else{warnings=rowData.meta.warnings}}if(warnings.length){var scrollable=warnings.length>2?"scrollable":"";$warnings_html.append('
Warnings ('+warnings.length+") ");$warnings_html.append('
');$.each(warnings,function(index,value){var $warning_html=$('
');$warning_html.append('
');$warning_html.find(".warning-info").append('");if(value.file){$warning_html.find(".warning-info").append('
'+value.file+"
")}$warnings_html.find(".warning-list").append($warning_html.wrap("
").parent().html())})}else{$warnings_html.removeClass("uucss-warnings")}var attemptsString="";if(rowData.status==="success"&&rowData.success_count>0||rowData.rule_status==="success"&&rowData.success_count>0&&rowData.rule_hits>0){attemptsString="Hits : "+rowData.success_count+"/"+rowData.attempts}else if(rowData.meta&&rowData.meta.stats&&rowData.meta.stats.success_count>0){attemptsString="Hits : "+rowData.meta.stats.success_count+"/"+rowData.attempts}else if(rowData.cpcss){if(rowData.cpcss.status==="success"&&rowData.cpcss.hits>0){attemptsString="Hits : "+rowData.cpcss.hits+"/"+rowData.cpcss.attempts}else if(Number(rowData.attempts)!==0){attemptsString="Attempts : "+rowData.attempts}}else if(Number(rowData.attempts)!==0){attemptsString="Attempts : "+rowData.attempts}var tippyOptions;tippyOptions={theme:"light",triggerTarget:stat.find("span")[0],content:function(){var c=$('
");innerTippy=tippy(c.find(".progress-bar-wrapper")[0],{content:'Without RapidLoad
'+(rowData.meta&&rowData.meta.stats?rowData.meta.stats.before:0)+" ",allowHTML:true,placement:"bottom-end",trigger:"manual",hideOnClick:false,animation:null,theme:"tomato",interactive:true,delay:0,offset:[0,7],inlinePositioning:true});innerTippy2=tippy(c.find(".progress-bar")[0],{content:'RapidLoad
'+(rowData.meta&&rowData.meta.stats?rowData.meta.stats.after:0)+" ",allowHTML:true,placement:"top-start",trigger:"manual",hideOnClick:false,animation:null,theme:"ketchup",interactive:true,delay:0,inlinePositioning:true});return c[0]},placement:"left",interactive:true,allowHTML:true,animation:"shift-toward-extreme",appendTo:"parent",onShow:function(){innerTippy.show();innerTippy2.show()},onShown:function(instance){$(instance.popper).find(".progress-bar.w-100").removeClass("w-100");$(".uucss-show-job-details").featherlight('
'+JSON.stringify(rowData,undefined,2)+"
",{variant:"uucss-job-details"})},onHide:function(instance){innerTippy.hide();innerTippy2.hide();$(instance.popper).find(".progress-bar").addClass("w-100")}};if(rowData.status==="failed"){stat.find("span").append('
');tippyOptions.onShow=function(){};tippyOptions.onHide=function(){};var code=rowData.meta.error&&rowData.meta.error.code?rowData.meta.error.code:500;var message=rowData.meta.error&&rowData.meta.error.message?rowData.meta.error.message:"Unknown Error Occurred";tippyOptions.content='
Error CODE : '+code+" "+message+" ";tippy(stat.find("span")[0],tippyOptions);return}if(rowData.meta&&rowData.meta.stats&&(rowData.status==="success"||rowData.rule_status==="success")&&(!warnings||!warnings.length)){var hits=rowData.meta&&rowData.meta.stats&&rowData.meta.stats.success_count>0||(rowData.status==="success"&&rowData.success_count>0||rowData.status==="rule-based"&&rowData.success_count>0&&rowData.success_count>0)?"hits-success":"";stat.find("span").append('
');tippy(stat.find("span")[0],tippyOptions)}else if((rowData.status==="success"||rowData.rule_status==="success")&&warnings.length){stat.find("span").append('
');tippy(stat.find("span")[0],tippyOptions)}else if(rowData.status==="failed"){stat.find("span").append('
');tippy(stat.find("span")[0],tippyOptions)}else if(rowData.cpcss){if(rowData.cpcss.status==="success"){stat.find("span").append('
');tippy(stat.find("span")[0],tippyOptions)}else if(rowData.cpcss.status==="failed"){stat.find("span").append('
');tippy(stat.find("span")[0],tippyOptions)}}}},{data:"url",className:"dt-body-right dt-head-right action th-actions",targets:0,title:"Actions",width:"60px",render:function(data,type,row,meta){var _render="";_render+='
';_render+='
';return _render}},{data:"meta",visible:false,render:function(data,type,row,meta){if(data&&data.warnings&&data.warnings.length>0)return"warning";if(data)return data.status;if(row.cpcss)return row.cpcss.status}}],rowCallback:function(row,data,displayNum,displayIndex,dataIndex){tippy($(row).find("button[data-uucss-options]")[0],{allowHTML:true,trigger:"click",arrow:true,appendTo:$(row).find("button[data-uucss-options]")[0],interactive:true,animation:"shift-toward",hideOnClick:true,theme:"light",content:()=>{var $content=$('
');if((data.status==="success"||data.status==="rule-based")&&data.meta&&data.meta.stats){$content.find("ul").append('
GPSI Status ')}if(data.status!=="queued"&&data.status!=="rule-based"){$content.find("ul").append('
Requeue ');if(window.uucss&&window.uucss.cpcss_enabled==="1"){$content.find("ul").append('
Regenerate Critical CSS ')}}if($("#thirtd_part_cache_plugins").val()==="1"){$content.find("ul").append('
Clear Page Cache ')}if(data.rule_id){$content.find("ul").append('
Detach from Rule ')}if(!data.rule_id&&window.uucss.rules_enabled==="1"&&rule_table&&rule_table.rows().data().length){$content.find("ul").append('
Attach Rule ')}$content.find("ul").append('
Remove ');$content.find("ul").append('
Preview ');return $content.wrap("
").parent().html()},onClickOutside(instance,event){instance.hide()},onCreate(){tippy($('.uucss-option-list ul.option-list li[data-action_name="remove"]')[0],{content:"Remove RapidLoad cache files",allowHTML:true,placement:"left",hideOnClick:false,animation:null,interactive:true,delay:0,inlinePositioning:true,maxWidth:500,appendTo:"parent"});tippy($('.uucss-option-list ul.option-list li[data-action_name="test"]')[0],{content:"Test Url",allowHTML:true,placement:"left",hideOnClick:false,animation:null,interactive:true,delay:0,inlinePositioning:true,maxWidth:500,appendTo:"parent"})},onMount(instance){$(".uucss-option-list ul.option-list li a").off().click(function(e){var $this=$(this);var action=$this.data("action_name");switch(action){case"preview":{let dynamicUrl=$(this).attr("href").toString();let additionalParam="rapidload_preview";window.open(dynamicUrl+(dynamicUrl.includes("?")?"&":"?")+additionalParam,"_blank");break}case"requeue_url":{requeue("current",{url:data.url},null,"url");break}case"regenerate_cpcss":{wp.ajax.post("cpcss_purge_url",{url:data.url,nonce:window.uucss.nonce}).then(function(i){$.uucssAlert(i,"success")}).fail(function(i){$.uucssAlert(i,"error")});break}case"attach_to_rule":{var $attach_rule_content=$('
');var rule_data=rule_table.rows().data();rule_data.each(function(value,index){var $rule_item=$('
Rule : [ '+value.rule+" ] Pattern : [ "+value.regex+" ] ");$rule_item.attr("value",value.id);$attach_rule_content.find("select.rule-items").append($rule_item)});$attach_rule_content.find(".add-action-wrap").append('
');$attach_rule_content.find("#update-attach-rule").data("url",data.url);$.featherlight($attach_rule_content,{variant:"attach-rule-content-model uucss-update-form-fetherlight",afterOpen:function(){$("#attach-rule-item").change(function(){var baseUrl=$attach_rule_content.find('option[value="'+$(this).val()+'"]').data("url");$(".attach-rule-content-model a.base-url").text(baseUrl);$(".attach-rule-content-model a.base-url").attr("href",baseUrl)});$("#attach-rule-item").trigger("change");$("#update-attach-rule").click(function(){wp.ajax.post("attach_rule",{nonce:window.uucss.nonce,url:data.url,type:"attach",rule_id:$("#attach-rule-item").val()}).then(function(i){$.uucssAlert(i,"success");var currentFeather=$.featherlight.current();if(currentFeather)currentFeather.close()}).fail(function(i){$.uucssAlert(i,"error")})})}});break}case"detach_from_rule":{wp.ajax.post("attach_rule",{url:data.url,type:"detach",nonce:window.uucss.nonce}).then(function(i){$.uucssAlert(i,"success")}).fail(function(i){$.uucssAlert(i,"error")});break}case"remove":{uucss_purge_url(data.url,true,row,dataIndex,data);break}case"purge-url":{wp.ajax.post("clear_page_cache",{url:data.url,nonce:window.uucss.nonce}).then(function(i){$.uucssAlert(i,"Successfully cleared your page cache")}).fail(function(i){$.uucssAlert(i,"Unknown error occurred when clearing the page cache")});break}case"test":{if($this.data("fetching")){return}$.ajax({method:"POST",url:wp.ajax.settings.url+"?action=uucss_test_url",data:{url:data.url,nonce:window.uucss.nonce},beforeSend(){$this.data("fetching",true)},error:function(XMLHttpRequest,textStatus,errorThrown){var $feather_content=$(".featherlight.uucss-gpsi-test .featherlight-content");var $content=$('
');$content.append('');$content.append('
');$content.append('
');$content.find(".header").append('
Pending');$content.find(".description").append("
Your optimization is yet to be reflected on Google Page Insight, GT Metrix and all other page speed testing tools.
");$feather_content.find(".spinner").remove();$feather_content.append($content.wrap("
").parent().html())},success:function(response){var $feather_content=$(".featherlight.uucss-gpsi-test .featherlight-content");var $content=$('
');$content.append('');$content.append('
');$content.append('
');if(response.success&&response.data&&(response.data.injected||response.data.success)&&response.data.injectedCSS>0){$content.find(".header").append('
Success');$content.find(".description").append("
Optimization is now reflected in Google Page Speed Insight, GT Metrix and all other page speed testing tools.
")}else{$content.find(".header").append('
Pending');$content.find(".description").append("
Your optimization is yet to be reflected on Google Page Insight, GT Metrix and all other page speed testing tools.
")}if(response.success&&response.data&&response.data.success){const with_uucss=new URL(response.data.url);const without_uucss=new URL(response.data.url);without_uucss.searchParams.append("no_uucss","");$content.find(".description").html("
"+$content.find(".description").text()+" Compare your page speed scores:"+"
");$content.find(".description").append('
Without RapidLoad
');$content.find(".description").append('
');$content.find(".test-site-links-without").append('
GT Metrix ');$content.find(".test-site-links-without").append('
Google Insights ');$content.find(".description").append('
RapidLoad
');$content.find(".description").append('
');$content.find(".test-site-links-with").append('
GT Metrix ');$content.find(".test-site-links-with").append('
Google Insights ')}$feather_content.find(".spinner").remove();$feather_content.append($content.wrap("
").parent().html());if(response.success&&response.data){$(".js-gpsi-reult").featherlight('
'+JSON.stringify(response.data,undefined,2)+"
",{variant:"uucss-gpsi-result-details"})}},complete:function(){$this.data("fetching",false)}});break}default:{break}}});$('.uucss-option-list ul.option-list li a[data-action_name="test"]').featherlight('
',{variant:"uucss-gpsi-test"})},placement:"bottom-end"});tippy($(row).find("span.job-status.status.waiting")[0],{content:"Waiting to be processed",placement:"top",appendTo:"parent"});tippy($(row).find("button[data-uucss-optimize]")[0],{content:"Refresh files Immediately",placement:"top",appendTo:"parent"});$(row).find("button").data("index",dataIndex);$(row).find("button[data-uucss-options]").off("click").click(function(e){e.preventDefault()});$(row).find("button[data-uucss-optimize]").off("click").click(function(e){e.preventDefault();var is_clear=typeof $(this).data().uucssClear==="string";var rule=$(this).data("rule");var regex=$(this).data("regex");var rule_id=$(this).data("rule_id");uucss_purge_url(data.url,is_clear,row,dataIndex,data,{rule:rule,rule_id:rule_id,regex:regex})});$(row).find("button[data-uucss-optimize]").off("click").click(function(e){e.preventDefault();var is_clear=typeof $(this).data().uucssClear==="string";uucss_purge_url(data.url,is_clear,row,dataIndex,data,{immediate:true})})}});$uucss_rule_spinner.addClass("loading");rule_table=rule_table.DataTable({serverSide:true,processing:false,language:{processing:'
'},ajax:{beforeSend(){!$uucss_rule_spinner.hasClass("loading")&&$uucss_rule_spinner.addClass("loading")},url:wp.ajax.settings.url+"?action=uucss_data",type:"POST",data:function(d){if(status_filter_rule!==""&&status_filter_rule!==undefined){if(d.columns[0]&&d.columns[0].search){d.columns[0].search.value=status_filter_rule}}if(url_filter_rule!==""&&url_filter_rule!==undefined){if(d.columns[1]&&d.columns[1].search){d.columns[1].search.value=url_filter_rule;d.columns[1].search.regex=exact_search_val_rule}}d.nonce=uucss.nonce;d.type="rule";return d},dataSrc:function(d){$uucss_rule_spinner.removeClass("loading");if(!d.success){$.uucssAlert("Failed to fetch optimizations","error");return[]}var results=d.data;firstRuleReload=false;return results}},searching:true,pagingType:"simple",tfoot:false,lengthChange:false,bSort:false,columns:[{data:"status",title:"Status",width:"50px",className:"dt-body-center dt-head-center",render:function(data,type,row,meta){if(!data&&row.cpcss){data=row.cpcss.status}var classNames="status ";if(data==="queued"||data==="processing"){classNames+="refresh "}classNames+=data+" ";return'
'+data+" "}},{data:"url",title:"Base",className:"url",render(data){if(!data){return""}return'
'+decodeURI(data)+" "}},{data:"applied_links",title:"Jobs",width:"25px",className:"dt-body-center dt-head-center applied-links hits-hidden",render:function(data,type,row,meta){var font_style=row.applied_links===row.applied_successful_links?'style="font-weight:500"':"";return'
"+data+" "}},{data:"applied_successful_links",title:"Hits",width:"25px",visible:false,className:"dt-body-center dt-head-center hits-count",render:function(data,type,row,meta){return'
'+data+" "}},{data:"regex",title:"pattern",width:"200px",className:"dt-body-center dt-head-center pattern",render:function(data,type,row,meta){return'
'+(data?data:"")+" "}},{data:"rule",title:"Rule",width:"100px",className:"dt-body-center dt-head-center",render:function(data,type,row,meta){return'
'+(data?data.replace("is_",""):"")+" "}},{data:"url",className:"dt-body-center dt-head-center stats th-reduction",title:"File Size Reduction",width:"145px",render:function(data,type,row,meta){if(row.meta&&row.meta.stats&&row.meta.stats.reduction&&row.status==="success"){return row.meta.stats.reduction+"%"}else if(row.status==="queued"||row.status==="processing"||row.status==="waiting"){return'
- '}return"-"},createdCell:function(td,cellData,rowData){var innerTippy;var innerTippy2;var stat=$(td).wrapInner($("
"));var $warnings_html=$('
');var $cpcss_html=$('
');if(rowData.cpcss){if(rowData.cpcss.status==="success"){$cpcss_html.append('
');$cpcss_html.append('
Critical css generated ('+rowData.cpcss.hits+"/"+rowData.cpcss.attempts+") ")}}if(!window.uucss||!window.uucss.uucss_enable_debug){if(rowData.meta?.warnings?.length){rowData.meta.warnings=rowData.meta.warnings.filter(function(w){return!w.message.toString().includes("optimized version for the file missing")})}}$warnings_html.removeClass("uucss-warnings");var attemptsString="";if(rowData.success_count>0){attemptsString="Hits : "+rowData.success_count+"/"+rowData.attempts}else if(rowData.meta&&rowData.meta.stats&&rowData.meta.stats.success_count){attemptsString="Hits : "+rowData.meta.stats.success_count+"/"+rowData.attempts}else if(rowData.cpcss){if(rowData.cpcss.status==="success"&&rowData.cpcss.hits>0){attemptsString="Hits : "+rowData.cpcss.hits+"/"+rowData.cpcss.attempts}else if(Number(rowData.attempts)!==0){attemptsString="Attempts : "+rowData.attempts}}else if(Number(rowData.attempts)!==0){attemptsString="Attempts : "+rowData.attempts}var tippyOptions;tippyOptions={theme:"light",triggerTarget:stat.find("span")[0],content:function(){var c=$('
");innerTippy=tippy(c.find(".progress-bar-wrapper")[0],{content:'Without RapidLoad
'+(rowData.meta&&rowData.meta.stats?rowData.meta.stats.before:0)+" ",allowHTML:true,placement:"bottom-end",trigger:"manual",hideOnClick:false,animation:null,theme:"tomato",interactive:true,delay:0,offset:[0,7],inlinePositioning:true});innerTippy2=tippy(c.find(".progress-bar")[0],{content:'RapidLoad
'+(rowData.meta&&rowData.meta.stats?rowData.meta.stats.after:0)+" ",allowHTML:true,placement:"top-start",trigger:"manual",hideOnClick:false,animation:null,theme:"ketchup",interactive:true,delay:0,inlinePositioning:true});return c[0]},placement:"left",interactive:true,allowHTML:true,animation:"shift-toward-extreme",appendTo:"parent",onShow:function(){innerTippy.show();innerTippy2.show()},onShown:function(instance){$(instance.popper).find(".progress-bar.w-100").removeClass("w-100");$(".uucss-show-job-details").featherlight('
'+JSON.stringify(rowData,undefined,2)+"
",{variant:"uucss-job-details"})},onHide:function(instance){innerTippy.hide();innerTippy2.hide();$(instance.popper).find(".progress-bar").addClass("w-100")}};if(rowData.status==="failed"){stat.find("span").append('
');tippyOptions.onShow=function(){};tippyOptions.onHide=function(){};var code=rowData.meta.error.code?rowData.meta.error.code:500;tippyOptions.content='
Error CODE : '+code+" "+rowData.meta.error.message+" ";tippy(stat.find("span")[0],tippyOptions);return}if(rowData.status==="success"&&(!rowData.meta.warnings||!rowData.meta.warnings.length)){var hits=rowData.meta&&rowData.meta.stats&&rowData.meta.stats.success_count>0||Number(rowData.success_count)>0?"hits-success":"";stat.find("span").append('
');tippy(stat.find("span")[0],tippyOptions)}else if(rowData.status==="success"&&rowData.meta.warnings.length){stat.find("span").append('
');tippy(stat.find("span")[0],tippyOptions)}else if(rowData.status==="failed"){stat.find("span").append('
');tippy(stat.find("span")[0],tippyOptions)}else if(rowData.cpcss){if(rowData.cpcss.status==="success"){stat.find("span").append('
');tippy(stat.find("span")[0],tippyOptions)}else if(rowData.cpcss.status==="failed"){stat.find("span").append('
');tippy(stat.find("span")[0],tippyOptions)}}}},{data:"status",visible:false,render:function(data,type,row,meta){if(!data&&row.cpcss){data=row.cpcss.status}if(data&&data.warnings&&data.warnings.length>0)return"warning";return data.status}},{data:"url",className:"dt-body-right dt-head-right action th-actions",targets:0,title:"Actions",width:"60px",render:function(data,type,row,meta){var _render="";_render+='
';_render+='
';return _render}}],rowCallback:function(row,data,displayNum,displayIndex,dataIndex){tippy($(row).find("button[data-uucss-options]")[0],{allowHTML:true,trigger:"click",arrow:true,appendTo:$(row).find("button[data-uucss-options]")[0],interactive:true,animation:"shift-toward",hideOnClick:true,theme:"light",content:()=>{var $content=$('
');$content.find("ul").append('
Edit ');$content.find("ul").append('
Duplicate ');if(data.status!=="queued"){$content.find("ul").append('
Requeue ');if(window.uucss&&window.uucss.cpcss_enabled==="1"){$content.find("ul").append('
Regenerate Critical CSS ')}}if(data.status==="success"){$content.find("ul").append('
GPSI Status ')}if($("#thirtd_part_cache_plugins").val()==="1"){$content.find("ul").append('
Clear Page Cache ')}$content.find("ul").append('
Remove ');$content.find("ul").append('
Preview ');return $content.wrap("
").parent().html()},onClickOutside(instance,event){instance.hide()},onCreate(){tippy($('.uucss-option-list ul.option-list li[data-action_name="remove"]')[0],{content:"Remove RapidLoad cache files",allowHTML:true,placement:"left",hideOnClick:false,animation:null,interactive:true,delay:0,inlinePositioning:true,maxWidth:500,appendTo:"parent"});tippy($('.uucss-option-list ul.option-list li[data-action_name="test"]')[0],{content:"Test Url",allowHTML:true,placement:"left",hideOnClick:false,animation:null,interactive:true,delay:0,inlinePositioning:true,maxWidth:500,appendTo:"parent"})},onMount(instance){$(".uucss-option-list ul.option-list li a").off().click(function(e){var $this=$(this);var action=$this.data("action_name");var rule=$this.data("rule");var regex=$this.data("regex");var url=$this.data("url");switch(action){case"preview":{let dynamicUrl=$(this).attr("href").toString();let additionalParam="rapidload_preview";window.open(dynamicUrl+(dynamicUrl.includes("?")?"&":"?")+additionalParam,"_blank");break}case"requeue_rule":{requeue("current",{url:url,rule:rule,regex:regex},null,"rule");break}case"regenerate_cpcss":{wp.ajax.post("cpcss_purge_url",{url:url,nonce:window.uucss.nonce}).then(function(i){$.uucssAlert(i,"success")}).fail(function(i){$.uucssAlert(i,"error")});break}case"duplicate_rule":{$.featherlight($("#add_rule_featherlight_content"),{variant:"add-site-rule-model",afterOpen:function(){this.$content.find("#model-uucss-rules").val(rule);this.$content.find("input.rule-base-url").val(url);this.$content.find("input.rule-url-regex").val(regex)}});break}case"edit_rule":{$.featherlight($("#add_rule_featherlight_content"),{variant:"add-site-rule-model",afterOpen:function(){this.$content.find("#model-uucss-rules").val(rule);this.$content.data("old_rule",rule);this.$content.find("input.rule-base-url").val(url);this.$content.data("old_base_url",url);this.$content.find("input.rule-url-regex").val(regex);this.$content.data("old_rule_regex",regex)}});break}case"remove":{uucss_purge_url(data.url,true,row,dataIndex,data,{rule:rule,regex:regex});break}case"purge-url":{wp.ajax.post("clear_page_cache",{url:data.url,rule:rule,regex:regex,nonce:window.uucss.nonce}).then(function(i){$.uucssAlert(i,"Successfully cleared your page cache")}).fail(function(i){$.uucssAlert(i,"Unknown error occurred when clearing the page cache")});break}case"test":{if($this.data("fetching")){return}$.ajax({method:"POST",url:wp.ajax.settings.url+"?action=uucss_test_url",data:{url:data.url,type:"rule",rule:rule,regex:regex,nonce:window.uucss.nonce},beforeSend(){$this.data("fetching",true)},error:function(XMLHttpRequest,textStatus,errorThrown){var $feather_content=$(".featherlight.uucss-gpsi-test .featherlight-content");var $content=$('
');$content.append('');$content.append('
');$content.append('
');$content.find(".header").append('
Pending');$content.find(".description").append("
Your optimization is yet to be reflected on Google Page Insight, GT Metrix and all other page speed testing tools.
");$feather_content.find(".spinner").remove();$feather_content.append($content.wrap("
").parent().html())},success:function(response){var $feather_content=$(".featherlight.uucss-gpsi-test .featherlight-content");var $content=$('
');$content.append('');$content.append('
');$content.append('
');if(response.success&&response.data&&(response.data.injected||response.data.success)&&response.data.injectedCSS>0){$content.find(".header").append('
Success');$content.find(".description").append("
Optimization is now reflected in Google Page Speed Insight, GT Metrix and all other page speed testing tools.
")}else{$content.find(".header").append('
Pending');$content.find(".description").append("
Your optimization is yet to be reflected on Google Page Insight, GT Metrix and all other page speed testing tools.
")}if(response.success&&response.data&&response.data.success){const with_uucss=new URL(response.data.url);const without_uucss=new URL(response.data.url);without_uucss.searchParams.append("no_uucss","");$content.find(".description").html("
"+$content.find(".description").text()+" Compare your page speed scores:"+"
");$content.find(".description").append('
Without RapidLoad
');$content.find(".description").append('
');$content.find(".test-site-links-without").append('
GT Metrix ');$content.find(".test-site-links-without").append('
Google Insights ');$content.find(".description").append('
RapidLoad
');$content.find(".description").append('
');$content.find(".test-site-links-with").append('
GT Metrix ');$content.find(".test-site-links-with").append('
Google Insights ')}$feather_content.find(".spinner").remove();$feather_content.append($content.wrap("
").parent().html());if(response.success&&response.data){$(".js-gpsi-reult").featherlight('
'+JSON.stringify(response.data,undefined,2)+"
",{variant:"uucss-gpsi-result-details"})}},complete:function(){$this.data("fetching",false)}});break}default:{break}}});$('.uucss-option-list ul.option-list li a[data-action_name="test"]').featherlight('
',{variant:"uucss-gpsi-test"})},placement:"bottom-end"});tippy($(row).find("span.job-status.status.waiting")[0],{content:"Waiting to be processed",placement:"top",appendTo:"parent"});tippy($(row).find("button[data-uucss-optimize]")[0],{content:"Refresh files Immediately",placement:"top",appendTo:"parent"});$(row).find("button").data("index",dataIndex);$(row).find("button[data-uucss-options]").off("click").click(function(e){e.preventDefault()});$(row).find("button[data-uucss-optimize]").off("click").click(function(e){e.preventDefault();var is_clear=typeof $(this).data().uucssClear==="string";var rule=$(this).data("rule");var regex=$(this).data("regex");var rule_id=$(this).data("rule_id");uucss_purge_url(data.url,is_clear,row,dataIndex,data,{rule:rule,rule_id:rule_id,regex:regex})});$(row).find("button[data-uucss-optimize]").off("click").click(function(e){e.preventDefault();var is_clear=typeof $(this).data().uucssClear==="string";uucss_purge_url(data.url,is_clear,row,dataIndex,data,{immediate:true})})}});$("button.uucss-add-site-urls-submenu").off("click").click(function(e){e.preventDefault()});$("button.uucss-add-site-rule-submenu").off("click").click(function(e){e.preventDefault()});function requeue(post_type,data={},list=[],type="requeue_all_url"){var data_={url_list:list,url:data.url,rule:data.rule,regex:data.regex,post_type:post_type,type:type,job_type:type,nonce:window.uucss.nonce};wp.ajax.post("rapidload_purge_all",data_).then(function(i){}).done(function(){$("#uucss-wrapper li.uucss-history").hasClass("multi-select")&&$("#uucss-wrapper li.uucss-history").removeClass("multi-select")})}tippy($("button.uucss-add-site-urls-submenu")[0],{allowHTML:true,trigger:"click",arrow:true,appendTo:$("button.uucss-add-site-urls-submenu")[0],interactive:true,animation:"shift-toward",hideOnClick:true,theme:"light",content:()=>{var $content=$('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('
Select All ');if(window.uucss&&window.uucss.dev_mode==="1"){$content.find("ul").append('
Run GPSI Test ')}if($("#thirtd_part_cache_plugins").val()==="1"){$content.find("ul").append('
Clear Page Cache ')}return $content.wrap("
").parent().html()},onClickOutside(instance,event){instance.hide()},onCreate(){},onMount(instance){$(".uucss-submenu-option-list ul.option-list li a").off().click(function(e){var $this=$(this);var action=$this.data("action_name");switch(action){case"rule-stats":{wp.ajax.post("uucss_rule_stats").then(function(i){if(i){var $ruleStatsContent=$('
');if(i.duplicateFiles&&i.duplicateFiles.length){$.each(i.duplicateFiles,function(index,value){var $duplicateFile=$('
');$duplicateFile.data("otherURLs",value.otherUrls);$duplicateFile.append("
Count : "+value.count+' Link : '+value.url+"
");$ruleStatsContent.find("ol.duplicates").append($duplicateFile)})}$.featherlight($ruleStatsContent,{variant:"uucss-rule-stats",afterOpen:function(){$.each($("a.duplicate-file-item-base"),function(index,value){var $otherUrls=$('
');var list=$(value).parent().parent().data("otherURLs");if(list&&list.length){$.each(list,function(index,url){$otherUrls.find("ol").append('
'+url+" ")})}tippy($(value)[0],{content:$otherUrls.html(),theme:"light",allowHTML:true,interactive:true,hideOnClick:true,placement:"right"})})}})}});break}case"requeue_selected":case"requeue_all":{var requeue_url_list=[];if(table.rows(".selected").data().length){$.each(table.rows(".selected").data(),function(table_row_index,table_row_value){requeue_url_list.push(table_row_value.id)})}requeue("current",{},requeue_url_list,"requeue_all_url");$.uucssAlert("Successfully added links added to the queue");break}case"requeue_warnings":{requeue("warnings",{},requeue_url_list,"requeue_all_url_warnings");$.uucssAlert("Successfully added links added to the queue");break}case"requeue_failed":{requeue("failed",{},requeue_url_list,"requeue_all_url_failed");$.uucssAlert("Successfully added links added to the queue");break}case"requeue_processing":{requeue("processing",{},requeue_url_list,"requeue_all_url_processing");$.uucssAlert("Successfully added links added to the queue");break}case"remove_selected":case"remove_all":{var data={url:"",clear:true,job_type:"url",nonce:window.uucss.nonce};if(action==="remove_selected"){var url_list=[];if(table.rows(".selected").data().length){$.each(table.rows(".selected").data(),function(table_row_index,table_row_value){url_list.push(table_row_value.id)})}if(url_list.length){data.url_list=url_list}}wp.ajax.post("rapidload_purge_all",data).then(function(i){}).done(function(){$("#uucss-wrapper li.uucss-history").hasClass("multi-select")&&$("#uucss-wrapper li.uucss-history").removeClass("multi-select")});break}case"clear_warnings_cache":{wp.ajax.post("clear_page_cache",{status:"warnings",nonce:window.uucss.nonce}).then(function(i){$.uucssAlert(i,"Successfully cleared your page cache")}).fail(function(i){$.uucssAlert(i,"Unknown error occurred when clearing the page cache")});break}case"run_gpsi_test":{wp.ajax.post("uucss_run_gpsi_status_check_for_all",{nonce:window.uucss.nonce}).then(function(i){$.uucssAlert("GPSI test run started")}).fail(function(i){});break}case"select_all":{var $container=$("#uucss-wrapper li.uucss-job-history");if($container.hasClass("multi-select")){$container.removeClass("multi-select")}if($container.find("table tbody tr").hasClass("selected")){$container.find("table tbody tr").removeClass("selected")}$container.find("table tbody tr").addClass("selected");$container.addClass("multi-select");$container.find(".multiple-selected-text .multiple-selected-value").text("("+$container.find("table tbody tr.selected").length+") URLs");break}default:{break}}})},placement:"bottom-end"});tippy($("button.uucss-add-site-rule-submenu")[0],{allowHTML:true,trigger:"click",arrow:true,appendTo:$("button.uucss-add-site-rule-submenu")[0],interactive:true,animation:"shift-toward",hideOnClick:true,theme:"light",content:()=>{var $content=$('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('');$content.find("ul").append('
Select All ');$content.find("ul").append('
Export ');$content.find("ul").append('
Import ');return $content.wrap("
").parent().html()},onClickOutside(instance,event){instance.hide()},onCreate(){},onMount(instance){$(".uucss-submenu-option-list ul.option-list li a").off().click(function(e){var $this=$(this);var action=$this.data("action_name");switch(action){case"requeue_selected":case"requeue_all":{var requeue_url_list=[];if(rule_table.rows(".selected").data().length){$.each(table.rows(".selected").data(),function(table_row_index,table_row_value){requeue_url_list.push(table_row_value.id)})}requeue("current",{},requeue_url_list,"requeue_all_rule");$.uucssAlert("Successfully added links added to the queue");break}case"requeue_warnings":{requeue("warnings",{},null,"requeue_all_rule_warnings");$.uucssAlert("Successfully added links added to the queue");break}case"requeue_failed":{requeue("failed",{},null,"requeue_all_rule_failed");$.uucssAlert("Successfully added links added to the queue");break}case"requeue_processing":{requeue("processing",{},null,"requeue_all_rule_processing");$.uucssAlert("Successfully added links added to the queue");break}case"remove_selected":case"remove_all":{var data={url:"",clear:true,nonce:window.uucss.nonce,job_type:"rule",args:{type:"rule"}};if(action==="remove_selected"){var url_list=[];if(rule_table.rows(".selected").data().length){$.each(rule_table.rows(".selected").data(),function(table_row_index,table_row_value){url_list.push({url:table_row_value.url,rule:table_row_value.rule,regex:table_row_value.regex})})}if(url_list.length){data.url_list=url_list}}wp.ajax.post("rapidload_purge_all",data).then(function(i){}).done(function(){$("#uucss-wrapper li.uucss-history").hasClass("multi-select")&&$("#uucss-wrapper li.uucss-history").removeClass("multi-select")});break}case"clear_warnings_cache":{wp.ajax.post("clear_page_cache",{status:"warnings",type:"rule",nonce:window.uucss.nonce}).then(function(i){$.uucssAlert(i,"Successfully cleared your page cache")}).fail(function(i){$.uucssAlert(i,"Unknown error occurred when clearing the page cache")});break}case"run_gpsi_test":{wp.ajax.post("uucss_run_gpsi_status_check_for_all",{nonce:window.uucss.nonce}).then(function(i){$.uucssAlert("GPSI test run started")}).fail(function(i){});break}case"select_all":{var $container=$("#uucss-wrapper li.uucss-rule-history");if($container.hasClass("multi-select")){$container.removeClass("multi-select")}if($container.find("table tbody tr").hasClass("selected")){$container.find("table tbody tr").removeClass("selected")}$container.find("table tbody tr").addClass("selected");$container.addClass("multi-select");$container.find(".multiple-selected-text .multiple-selected-value").text("("+$container.find("table tbody tr.selected").length+") URLs");break}case"export_all":{wp.ajax.post("get_all_rules",{nonce:window.uucss.nonce}).then(function(i){if(i){var exportLink=document.createElement("a");exportLink.download="rapidload-rules-"+Date.now();exportLink.href="data:text/plain;charset=utf-8,"+JSON.stringify(i);exportLink.style.display="none";exportLink.click()}}).fail(function(i){});break}case"import_all":{var importInput=document.createElement("input");importInput.type="file";importInput.addEventListener("change",function(e){var fileReader=new FileReader;fileReader.onload=function(){wp.ajax.post("upload_rules",{nonce:window.uucss.nonce,rules:fileReader.result}).then(function(i){$.uucssAlert(i)}).fail(function(i){$.uucssAlert(i,"Error")})};fileReader.readAsText(this.files[0])});importInput.click();break}default:{break}}})},placement:"bottom-end"});function uucss_purge_url(url,isClear,row,index,data,args={}){var _row=!args.rule?table.row(index):rule_table.row(index);var $row=$(row);$row.addClass("loading");if(!args.rule){$uucss_spinner.addClass("loading")}else{$uucss_rule_spinner.addClass("loading")}if(!isClear){$(this).hide()}var _data={url:data.url,clear:isClear,nonce:window.uucss.nonce};if(args.rule&&args.regex){_data.rule=args.rule;_data.regex=args.regex}if(args.immediate){_data.immediate=true}if(_data.clear||_data.immediate){if(_data.rule&&_data.regex){_data.job_type="rule"}else if(_data.url){_data.job_type="url"}}$.ajax({method:"POST",url:wp.ajax.settings.url+"?action=rapidload_purge_all",data:_data,success:function(response){if(!args.rule){$uucss_spinner.removeClass("loading")}else{$uucss_rule_spinner.removeClass("loading")}if(response.success){if(isClear){_row.length>0&&_row.remove().draw()}else{data.status="queued";_row.data(data).draw(false)}}},complete:function(){$row.removeClass("loading")}})}function refreshTable(){if(!auto_refresh||$(".tippy-content").length||$("#uucss-wrapper .uucss-job-history select:focus").length||$("html.with-featherlight").length||$("#uucss-wrapper li.uucss-job-history").hasClass("multi-select")){return}$uucss_spinner.addClass("loading");table.ajax.reload(null,false)}function refreshRulesTable(){if(!auto_refresh_rule||$(".tippy-content").length||$("#uucss-wrapper .uucss-rule-history select:focus").length||$("html.with-featherlight").length||$("#uucss-wrapper li.uucss-rule-history").hasClass("multi-select")){return}$uucss_rule_spinner.addClass("loading");rule_table.ajax.reload(null,false)}function validateJobPerQue(value,reset){var max=$('#uucss_queue_interval option[value="'+value+'"]').data("max");var options=$("#uucss_jobs_per_queue option");$.each(options,function(element){$(options[element]).attr("disabled",$(options[element]).val()>max)});if(reset){$("#uucss_jobs_per_queue").val($(options[0]).val())}}$("#uucss_queue_interval").change(function(){validateJobPerQue($(this).val(),true)});validateJobPerQue($("#uucss_queue_interval").val(),false);$("#uucss-deactivate").click(function(e){e.preventDefault();let $this=$(this);$this.text("deactivating...");wp.ajax.post("uucss_deactivate",{nonce:window.uucss.nonce}).done(function(r){$this.text("deactivated");window.location.reload()})});$("a.connect-with-license").click(function(e){e.preventDefault()});tippy("a.connect-with-license",{allowHTML:true,arrow:false,appendTo:$("a.connect-with-license")[0],interactive:true,animation:"shift-toward",placement:"top-start",trigger:"click",hideOnClick:false,theme:"light",maxWidth:500,onClickOutside(instance,event){instance.hide()},content:function(){var content;content='
";return content},onMount(instance){$("a.connect-with-license .tippy-connect-with-license-content input.uucss-key").focus();$("a.connect-with-license .tippy-connect-with-license-content .input-wrap .connect").click(function(e){e.preventDefault();var license_key=$("a.connect-with-license .tippy-connect-with-license-content .input-wrap input").val();if(license_key===""){$.uucssAlert("Please enter a license key","error");return}var $target=$(this);$target.text("Connecting...");$target.removeAttr("href");wp.ajax.post("uucss_connect",{license_key:license_key,nonce:window.uucss.nonce}).then(function(i){if(i.success){window.location.href=window.location.href+"&token="+license_key+"&nonce="+i.activation_nonce}}).fail(function(i){$target.text("Connect");$target.attr("href","#");$("a.connect-with-license p.uucss-key-error").text(i)})})}});function isUrl(s){var regexp=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;return regexp.test(s)}$("#model-requeue-post-type").change(function(){$model_content=$(".featherlight.add-site-url-model");if($(this).val()==="site_map"||$(this).val()==="url"){if($(this).val()==="site_map"){$model_content.find("input.site-map-url").attr("placeholder",$model_content.find("input.site-map-url").data("sitemap_url"));$model_content.find("input.site-map-url").val($model_content.find("input.site-map-url").data("sitemap_url"))}else if($(this).val()==="url"){$model_content.find("input.site-map-url").attr("placeholder",$model_content.find("input.site-map-url").data("site_url"))}!$model_content.find("input.site-map-url").hasClass("show")&&$model_content.find("input.site-map-url").addClass("show");!$model_content.hasClass("show-url")&&$model_content.addClass("show-url")}else{$model_content.find("input.site-map-url").hasClass("show")&&$model_content.find("input.site-map-url").removeClass("show");$model_content.hasClass("show-url")&&$model_content.removeClass("show-url")}});$("#model-update-rule").click(function(){$model_content=$(".featherlight #add_rule_featherlight_content");var $rule=$model_content.find("#model-uucss-rules");var $url=$model_content.find(".rule-base-url");var $regex=$model_content.find(".rule-url-regex");var $regenerate=$model_content.find("#force-requeue-rule");if($rule.val()===""||$url.val()===""||$regex.val()===""){$.uucssAlert("Required fields missing","error");return}if(!isUrl($url.val())){$.uucssAlert("Invalid Url","error");return}var $target=$(this);$target.attr("disabled",true);$target.val("Please wait....");wp.ajax.post("uucss_update_rule",{rule:$rule.val(),url:$url.val(),regex:$regex.val(),old_rule:$model_content.data("old_rule"),old_url:$model_content.data("old_base_url"),old_regex:$model_content.data("old_rule_regex"),requeue:$regenerate.is(":checked")?"1":"0",nonce:window.uucss.nonce}).then(function(i){$.uucssAlert(i);var currentFeather=$.featherlight.current();if(currentFeather)currentFeather.close();$target.attr("disabled",false);$target.val("Update Rule")}).fail(function(i){$.uucssAlert(i,"error");$target.attr("disabled",false);$target.val("Update Rule")}).done(function(){rule_table.ajax.reload(null,false)})});$("#model-queue-posts-type").click(function(){$model_content=$(".featherlight #add_url_featherlight_content");if(($model_content.find("#model-requeue-post-type").val()==="site_map"||$model_content.find("#model-requeue-post-type").val()==="url")&&($model_content.find("input.site-map-url").val()===""||$model_content.find("input.site-map-url").val()===undefined)){$.uucssAlert("Add a valid URL","error");return}if(($model_content.find("#model-requeue-post-type").val()==="site_map"||$model_content.find("#model-requeue-post-type").val()==="url")&&!isUrl($model_content.find("input.site-map-url").val())){$.uucssAlert("Add a valid URL","error");return}var $target=$(this);$target.attr("disabled",true);$target.val("Please wait....");var data_={post_type:$model_content.find("#model-requeue-post-type").val(),job_type:$model_content.find("#model-requeue-post-type").val(),url:$model_content.find("input.site-map-url").val(),nonce:window.uucss.nonce};wp.ajax.post("rapidload_purge_all",data_).then(function(i){$.uucssAlert("Sitemap links scheduled to be added to the queue.");var currentFeather=$.featherlight.current();if(currentFeather)currentFeather.close();$target.attr("disabled",false);$target.val("Add")}).fail(function(i){$.uucssAlert(i,"error");$target.attr("disabled",false);$target.val("Add")}).done(function(){table.ajax.reload(null,false)})});$("p.more-info-uucss-status").click(function(e){e.preventDefault();var $info=$(".rapidload-status .uucss-status-more-info");if($info.css("display")==="block"){$info.slideUp()}else{$info.slideDown()}});$("#js-uucss-clear-selection").click(function(e){e.preventDefault();$("#uucss-history tbody tr").removeClass("selected");$("#uucss-wrapper li.uucss-history.uucss-job-history").removeClass("multi-select")});$("#js-uucss-clear-selection-rule").click(function(e){e.preventDefault();$("#uucss-rule-history tbody tr").removeClass("selected");$("#uucss-wrapper li.uucss-history.uucss-rule-history").removeClass("multi-select")});updateNotices();var $updateRuleForm=$("#add_rule_featherlight_content");function updateRapidLoadStatus(){wp.ajax.post("uucss_status",{nonce:window.uucss.nonce}).then(function(res){if(res){var $status=$("li.rapidload-status");var total=res.total;$status.find("p.style-sheet-count").html("
CSS Stylesheets : "+res.cssStyleSheetsCount+" files, totalling "+res.cssStyleSheetsSize);$status.find("p.status-hits-count span.number").text(res.hits);$status.find("p.status-hits-count span.percentage").text(total?Number(res.hits/total*100).toFixed(0):0);$status.find("p.status-success-count span.number").text(res.success);$status.find("p.status-success-count span.percentage").text(total?Number(res.success/total*100).toFixed(0):0);$status.find("p.status-rule-based-count span.number").text(res.ruleBased);$status.find("p.status-rule-based-count span.percentage").text(total?Number(res.ruleBased/total*100).toFixed(0):0);$status.find("p.status-queued-count span.number").text(res.queued);$status.find("p.status-queued-count span.percentage").text(total?Number(res.queued/total*100).toFixed(0):0);$status.find("p.status-waiting-count span.number").text(res.waiting);$status.find("p.status-waiting-count span.percentage").text(total?Number(res.waiting/total*100).toFixed(0):0);$status.find("p.status-processing-count span.number").text(res.processing);$status.find("p.status-processing-count span.percentage").text(total?Number(res.processing/total*100).toFixed(0):0);$status.find("p.status-warnings-count span.number").text(res.warnings);$status.find("p.status-warnings-count span.percentage").text(total?Number(res.warnings/total*100).toFixed(0):0);$status.find("p.status-failed-count span.number").text(res.failed);$status.find("p.status-failed-count span.percentage").text(total?Number(res.failed/total*100).toFixed(0):0);$status.find("p.more-info-uucss-status span.total-jobs").text(res.total)}})}updateSitemapUrl()});function updateNotices(){wp.ajax.post("rapidload_notifications",{nonce:window.uucss.nonce}).then(function(response){if(response){window.uucss.faqs=response.faqs;window.uucss.public_notices=response.notifications}showFaqs();showPublicNotices()})}})(jQuery);
\ No newline at end of file
diff --git a/includes/RapidLoad_Base.php b/includes/RapidLoad_Base.php
index e32c829e0..b1aaab2e7 100644
--- a/includes/RapidLoad_Base.php
+++ b/includes/RapidLoad_Base.php
@@ -375,7 +375,7 @@ public static function enqueueGlobalScript() {
'on_board_complete' => apply_filters('uucss/on-board/complete', false),
'home_url' => home_url(),
'api_url' => RapidLoad_Api::get_key(),
- 'nonce' => wp_create_nonce( 'uucss_nonce' ),
+ 'nonce' => self::create_nonce( 'uucss_nonce' ),
'active_modules' => (array)self::get()->modules()->active_modules(),
'notifications' => apply_filters('uucss/notifications', []),
'activation_url' => self::activation_url('authorize' ),
@@ -598,10 +598,10 @@ public static function get_default_options(){
'uucss_keyframes' => "1",
'uucss_variables' => "1",
'uucss_enable_uucss' => "1",
- 'uucss_enable_cpcss' => "1",
+ 'uucss_enable_cpcss' => "0",
'uucss_enable_cpcss_mobile' => "1",
'uucss_minify' => "1",
- 'uucss_support_next_gen_formats' => "1",
+ 'uucss_support_next_gen_formats' => "0",
'uucss_set_width_and_height' => "1",
'uucss_self_host_google_fonts' => "1",
'uucss_image_optimize_level' => "lossless",
@@ -610,6 +610,14 @@ public static function get_default_options(){
'rapidload_test_mode' => "1",
'rapidload_cpcss_file_character_length' => 0,
'uucss_adaptive_image_delivery' => "1",
+ 'uucss_load_js_method' => "1",
+ 'uucss_lazy_load_images' => "1",
+ 'minify_js' => "1",
+ 'uucss_enable_cache' => "1",
+ 'uucss_enable_cdn' => "1",
+ 'update_htaccess_file' => "0",
+ 'uucss_lazy_load_iframes' => "1"
+
];
}
diff --git a/includes/RapidLoad_DB.php b/includes/RapidLoad_DB.php
index 3c48c2c04..b7c4033e7 100644
--- a/includes/RapidLoad_DB.php
+++ b/includes/RapidLoad_DB.php
@@ -189,7 +189,7 @@ static function rules_migration_two_point_zero(){
try {
global $wpdb;
- $rules = $wpdb->get_results("SELECT url, rule, regex FROM {$wpdb->prefix}rapidload_job WHERE rule != 'is_url' ORDER BY id", OBJECT);
+ $rules = $wpdb->get_results($wpdb->prepare("SELECT url, rule, regex FROM {$wpdb->prefix}rapidload_job WHERE rule != %s ORDER BY id", 'is_url'), OBJECT);
foreach ($rules as $rule){
@@ -201,7 +201,7 @@ static function rules_migration_two_point_zero(){
$job_data = new RapidLoad_Job_Data($job, 'uucss');
- $data = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}rapidload_uucss_rule WHERE rule = '" . $job->rule ."' and url = '" . $job->url ."' and regex = '" . $job->regex ."' ", OBJECT);
+ $data = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}rapidload_uucss_rule WHERE rule = %s AND url = %s AND regex = %s", $job->rule, $job->url, $job->regex), OBJECT);
if(isset($data) && $data[0]){
$job_data->data = $data[0]->files;
@@ -217,16 +217,13 @@ static function rules_migration_two_point_zero(){
}
- //RapidLoad_Base::update_option( self::$db_option, self::$db_version );
- //self::$current_version = self::$db_version;
-
}catch (Exception $ex){
}
}
- static function update_db(){
+ static function update_db(){error_log("dsadad");
if(!self::is_wp_cli()){
self::verify_nonce();
@@ -265,14 +262,14 @@ static function seed(){
global $wpdb;
- $wpdb->query("INSERT INTO {$wpdb->prefix}rapidload_job (url, rule, regex, created_at, status)
- SELECT url, rule, regex, created_at, 'processing' AS status FROM {$wpdb->prefix}rapidload_uucss_rule");
+ $wpdb->query($wpdb->prepare("INSERT INTO {$wpdb->prefix}rapidload_job (url, rule, regex, created_at, status)
+ SELECT url, rule, regex, created_at, %s AS status FROM {$wpdb->prefix}rapidload_uucss_rule", 'processing'));
- $wpdb->query("INSERT INTO {$wpdb->prefix}rapidload_job (url, rule, regex, rule_id, created_at, status)
- SELECT url, 'is_url' as rule, '/' as regex, rule_id, created_at, 'processing' AS status FROM {$wpdb->prefix}rapidload_uucss_job WHERE status != 'rule-based'");
+ $wpdb->query($wpdb->prepare("INSERT INTO {$wpdb->prefix}rapidload_job (url, rule, regex, rule_id, created_at, status)
+ SELECT url, %s as rule, %s as regex, rule_id, created_at, %s AS status FROM {$wpdb->prefix}rapidload_uucss_job WHERE status != %s", 'is_url', '/', 'processing', 'rule-based'));
- $wpdb->query("INSERT INTO {$wpdb->prefix}rapidload_job_data (job_id, job_type, attempts, hits, status, created_at)
- SELECT id, 'cpcss' as job_type, 1 as attempts, 0 as hits, 'queued' AS status, created_at FROM {$wpdb->prefix}rapidload_job");
+ $wpdb->query($wpdb->prepare("INSERT INTO {$wpdb->prefix}rapidload_job_data (job_id, job_type, attempts, hits, status, created_at)
+ SELECT id, %s as job_type, 1 as attempts, 0 as hits, %s AS status, created_at FROM {$wpdb->prefix}rapidload_job", 'cpcss', 'queued'));
}
static function migrated(){
@@ -303,7 +300,7 @@ static function get_rule_names(){
global $wpdb;
- $names = $wpdb->get_results("SELECT rule FROM {$wpdb->prefix}rapidload_job WHERE rule != 'is_url' ORDER BY id", ARRAY_A);
+ $names = $wpdb->get_results($wpdb->prepare("SELECT rule FROM {$wpdb->prefix}rapidload_job WHERE rule != %s ORDER BY id", 'is_url'), ARRAY_A);
$error = $wpdb->last_error;
@@ -334,12 +331,13 @@ static function get_rules_where($where = ''){
global $wpdb;
if(!empty($where)){
- $where .= " AND rule != 'is_url' ";
- }else{
- $where = " WHERE rule != 'is_url' ";
+ $where .= " AND rule != %s ";
+ } else {
+ $where = " WHERE rule != %s ";
}
- $rules = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}rapidload_job {$where} ORDER BY id DESC ", OBJECT);
+ $sql = $wpdb->prepare("SELECT * FROM {$wpdb->prefix}rapidload_job {$where} ORDER BY id DESC", 'is_url');
+ $rules = $wpdb->get_results($sql, OBJECT);
$error = $wpdb->last_error;
@@ -353,7 +351,8 @@ static function get_rules_where($where = ''){
static function rule_exists_with_error($rule, $regex = '/'){
global $wpdb;
- $result = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}rapidload_job WHERE rule = '" . $rule . "' AND regex = '" . $regex . "'", OBJECT);
+ $sql = $wpdb->prepare("SELECT * FROM {$wpdb->prefix}rapidload_job WHERE rule = %s AND regex = %s", $rule, $regex);
+ $result = $wpdb->get_results($sql, OBJECT);
$error = $wpdb->last_error;
@@ -370,34 +369,41 @@ static function clear_jobs( $type = 'all', $args = [], $ids = []){
if(!empty($ids)){
- $ids = implode(",", $ids);
- $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job WHERE id IN (". $ids .")");
+ // Sanitize and prepare the query for IDs
+ $ids = implode(",", array_map('intval', $ids));
+ $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->prefix}rapidload_job WHERE id IN (%s)", $ids));
}else{
switch ($type){
case 'all':{
- $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job ");
+ $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job");
break;
}
case 'url':{
if(isset($args['url'])){
- $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job WHERE url ='" . $args['url'] . "' and rule = 'is_url'");
+ $url = sanitize_text_field($args['url']); // Sanitize URL input
+ $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->prefix}rapidload_job WHERE url = %s AND rule = 'is_url'", $url));
}else{
- $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job WHERE rule ='is_url'");
+ $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job WHERE rule = 'is_url'");
}
break;
}
case 'rule':{
if(isset($args['rule']) && isset($args['regex'])){
- $id = $wpdb->get_var("SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule ='" . $args['rule'] . "' AND regex ='" . $args['regex'] . "' LIMIT 1");
+ $rule = sanitize_text_field($args['rule']); // Sanitize rule input
+ $regex = sanitize_text_field($args['regex']); // Sanitize regex input
+
+ // Get the rule ID
+ $id = $wpdb->get_var( $wpdb->prepare("SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule = %s AND regex = %s LIMIT 1", $rule, $regex));
+
if(!empty($id)){
- $wpdb->query( "UPDATE {$wpdb->prefix}rapidload_job SET regex = '/', rule_id = NULL, status = 'processing' WHERE rule='is_url' AND rule_id = " . $id );
+ $wpdb->query( $wpdb->prepare("UPDATE {$wpdb->prefix}rapidload_job SET regex = '/', rule_id = NULL, status = 'processing' WHERE rule = 'is_url' AND rule_id = %d", $id));
}
- $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job WHERE rule ='" . $args['rule'] . "' AND regex ='" . $args['regex'] . "'");
+ $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->prefix}rapidload_job WHERE rule = %s AND regex = %s", $rule, $regex));
}else{
$wpdb->query( "UPDATE {$wpdb->prefix}rapidload_job SET regex = '/', rule_id = NULL, status = 'processing' WHERE status = 'rule-based'");
$wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job WHERE rule != 'is_url'");
@@ -410,6 +416,7 @@ static function clear_jobs( $type = 'all', $args = [], $ids = []){
}
+ // Check for errors and handle them
$error = $wpdb->last_error;
if(!empty($error)){
@@ -424,32 +431,37 @@ static function clear_job_data( $type = 'all', $args = [], $ids = []){
if(!empty($ids)){
- $ids = implode(",", $ids);
- $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id IN (". $ids .")");
+ // Sanitize and prepare the query for IDs
+ $ids = implode(",", array_map('intval', $ids));
+ $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id IN (%s)", $ids));
}else{
switch ($type){
case 'all':{
- $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job_data ");
+ $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job_data");
break;
}
case 'url':{
if(isset($args['url'])){
- $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id IN(SELECT id FROM {$wpdb->prefix}rapidload_job WHERE url = '" . $args['url'] . "')");
+ $url = sanitize_text_field($args['url']); // Sanitize URL input
+ $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id IN (SELECT id FROM {$wpdb->prefix}rapidload_job WHERE url = %s)", $url));
}else{
- $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id IN(SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule = 'is_url')");
+ $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id IN (SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule = 'is_url')");
}
break;
}
case 'rule':{
if(isset($args['rule']) && isset($args['regex'])){
- $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id IN(SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule = '" . $args['rule'] . "' AND regex ='" . $args['regex'] . "')");
+ $rule = sanitize_text_field($args['rule']); // Sanitize rule input
+ $regex = sanitize_text_field($args['regex']); // Sanitize regex input
+
+ $wpdb->query( $wpdb->prepare("DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id IN (SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule = %s AND regex = %s)", $rule, $regex));
}else{
- $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id IN(SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule != 'is_url')");
+ $wpdb->query( "DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id IN (SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule != 'is_url')");
}
break;
}
@@ -467,6 +479,7 @@ static function clear_job_data( $type = 'all', $args = [], $ids = []){
}
+ // Check for errors and handle them
$error = $wpdb->last_error;
if(!empty($error)){
@@ -479,7 +492,13 @@ static function get_jobs_where($where = ''){
global $wpdb;
- $jobs = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}rapidload_job {$where} ORDER BY id DESC ", OBJECT);
+ if (!empty($where)) {
+ $sql = $wpdb->prepare("SELECT * FROM {$wpdb->prefix}rapidload_job {$where} ORDER BY id DESC");
+ } else {
+ $sql = "SELECT * FROM {$wpdb->prefix}rapidload_job ORDER BY id DESC";
+ }
+
+ $jobs = $wpdb->get_results($sql, OBJECT);
$error = $wpdb->last_error;
@@ -494,16 +513,21 @@ static function get_total_job_count($where = ''){
global $wpdb;
- $where = str_replace("[job_table_name]","{$wpdb->prefix}rapidload_job", $where);
+ $where = str_replace("[job_table_name]", "{$wpdb->prefix}rapidload_job", $where);
- $count = $wpdb->get_var("SELECT COUNT(*) FROM (select * from (select
- job.id, job.url, job.rule, job.regex, job.rule_id, job.rule_note, job.status as job_status, job.created_at as job_created_at,
- uucss.data as files, uucss.stats, uucss.warnings, uucss.attempts, uucss.hits, CASE WHEN job.rule = 'is_url' AND job.rule_id IS NOT NULL THEN 'rule-based' ELSE uucss.status END AS status,
- cpcss.data as cpcss, cpcss.stats as cpcss_stats, cpcss.warnings as cpcss_warnings, cpcss.attempts as cpcss_attempts, cpcss.hits as cpcss_hits, cpcss.status as cpcss_status
+ $sql = $wpdb->prepare("SELECT COUNT(*) FROM (SELECT * FROM (SELECT
+ job.id, job.url, job.rule, job.regex, job.rule_id, job.rule_note, job.status AS job_status, job.created_at AS job_created_at,
+ uucss.data AS files, uucss.stats, uucss.warnings, uucss.attempts, uucss.hits,
+ CASE WHEN job.rule = 'is_url' AND job.rule_id IS NOT NULL THEN 'rule-based' ELSE uucss.status END AS status,
+ cpcss.data AS cpcss, cpcss.stats AS cpcss_stats, cpcss.warnings AS cpcss_warnings,
+ cpcss.attempts AS cpcss_attempts, cpcss.hits AS cpcss_hits, cpcss.status AS cpcss_status
- from (select (case when rule_id is not null then rule_id else id end) as id, url, rule, regex, rule_id, rule_note, status, created_at from {$wpdb->prefix}rapidload_job) as job
- left join (select * from {$wpdb->prefix}rapidload_job_data where job_type = 'uucss') as uucss on job.id = uucss.job_id
- left join (select * from {$wpdb->prefix}rapidload_job_data where job_type = 'cpcss') as cpcss on job.id = cpcss.job_id) as dervied_table) as derived_tbale_2 {$where}");
+ FROM (SELECT (CASE WHEN rule_id IS NOT NULL THEN rule_id ELSE id END) AS id, url, rule, regex, rule_id, rule_note, status, created_at
+ FROM {$wpdb->prefix}rapidload_job) AS job
+ LEFT JOIN (SELECT * FROM {$wpdb->prefix}rapidload_job_data WHERE job_type = 'uucss') AS uucss ON job.id = uucss.job_id
+ LEFT JOIN (SELECT * FROM {$wpdb->prefix}rapidload_job_data WHERE job_type = 'cpcss') AS cpcss ON job.id = cpcss.job_id) AS derived_table) AS derived_table_2 {$where}", '');
+
+ $count = $wpdb->get_var($sql);
$error = $wpdb->last_error;
@@ -519,16 +543,19 @@ static function get_job_counts(){
global $wpdb;
$counts = $wpdb->get_results(
- "SELECT
- (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE hits > 0 and job_type = 'uucss') as hits,
- (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE status = 'success' AND warnings IS NULL) as success,
- (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job WHERE status = 'rule-based') as rule_based,
- (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE status = 'waiting') as waiting,
- (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE status = 'queued') as queued,
- (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE status = 'processing') as processing,
+ $wpdb->prepare(
+ "SELECT
+ (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE hits > 0 AND job_type = %s) as hits,
+ (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE status = %s AND warnings IS NULL) as success,
+ (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job WHERE status = %s) as rule_based,
+ (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE status = %s) as waiting,
+ (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE status = %s) as queued,
+ (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE status = %s) as processing,
(SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE warnings IS NOT NULL) as warnings,
- (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE status = 'failed') as failed,
- (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE job_type = 'uucss') as total", OBJECT);
+ (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE status = %s) as failed,
+ (SELECT COUNT(id) FROM {$wpdb->prefix}rapidload_job_data WHERE job_type = %s) as total",
+ 'uucss', 'success', 'rule-based', 'waiting', 'queued', 'processing', 'failed', 'uucss'
+ ), OBJECT);
if(!empty($counts)){
return $counts[0];
@@ -547,29 +574,47 @@ static function get_job_counts(){
];
}
- static function get_merged_data($start_from = 0, $limit = 10, $where = '', $order_by = 'id DESC'){
+ static function get_merged_data($start_from = 0, $limit = 10, $where = '', $order_by = 'id DESC') {
$status_column = "CASE WHEN job.rule = 'is_url' AND job.rule_id IS NOT NULL THEN 'rule-based' ELSE uucss.status END AS status,";
- if(defined('RAPIDLOAD_CPCSS_ENABLED') && RAPIDLOAD_CPCSS_ENABLED){
+ if (defined('RAPIDLOAD_CPCSS_ENABLED') && RAPIDLOAD_CPCSS_ENABLED) {
$status_column = "CASE WHEN job.rule = 'is_url' AND job.rule_id IS NOT NULL THEN 'rule-based' ELSE cpcss.status END AS status,";
}
global $wpdb;
- $query = "select * from (select
- job.id, job.job_id, job.url, job.rule, job.regex, job.rule_id, job.rule_note, job.status as job_status, job.created_at as job_created_at,
- (case when job.rule = 'is_url' then 0 else (select count(id) from {$wpdb->prefix}rapidload_job where rule_id = job.id and rule = 'is_url') end) as applied_successful_links,
- uucss.data as files, uucss.stats, uucss.warnings, uucss.attempts, uucss.hits,
- " . $status_column ."
- cpcss.data as cpcss, cpcss.stats as cpcss_stats, cpcss.warnings as cpcss_warnings, cpcss.attempts as cpcss_attempts, cpcss.hits as cpcss_hits, cpcss.status as cpcss_status
-
- from (select (case when rule_id is not null then rule_id else id end) as id , id as job_id, url, rule, regex, rule_id, rule_note, status, created_at from {$wpdb->prefix}rapidload_job) as job
- left join (select * from {$wpdb->prefix}rapidload_job_data where job_type = 'uucss') as uucss on job.id = uucss.job_id
- left join (select * from {$wpdb->prefix}rapidload_job_data where job_type = 'cpcss') as cpcss on job.id = cpcss.job_id) as dervied_table {$where} ORDER BY {$order_by} LIMIT {$start_from},{$limit}";
+ $query = $wpdb->prepare(
+ "SELECT * FROM (
+ SELECT
+ job.id, job.job_id, job.url, job.rule, job.regex, job.rule_id, job.rule_note, job.status AS job_status, job.created_at AS job_created_at,
+ (CASE WHEN job.rule = 'is_url' THEN 0 ELSE (
+ SELECT COUNT(id)
+ FROM {$wpdb->prefix}rapidload_job
+ WHERE rule_id = job.id AND rule = 'is_url'
+ ) END) AS applied_successful_links,
+ uucss.data AS files, uucss.stats, uucss.warnings, uucss.attempts, uucss.hits,
+ {$status_column}
+ cpcss.data AS cpcss, cpcss.stats AS cpcss_stats, cpcss.warnings AS cpcss_warnings, cpcss.attempts AS cpcss_attempts, cpcss.hits AS cpcss_hits, cpcss.status AS cpcss_status
+ FROM (
+ SELECT
+ (CASE WHEN rule_id IS NOT NULL THEN rule_id ELSE id END) AS id,
+ id AS job_id, url, rule, regex, rule_id, rule_note, status, created_at
+ FROM {$wpdb->prefix}rapidload_job
+ ) AS job
+ LEFT JOIN (
+ SELECT * FROM {$wpdb->prefix}rapidload_job_data WHERE job_type = 'uucss'
+ ) AS uucss ON job.id = uucss.job_id
+ LEFT JOIN (
+ SELECT * FROM {$wpdb->prefix}rapidload_job_data WHERE job_type = 'cpcss'
+ ) AS cpcss ON job.id = cpcss.job_id
+ ) AS derived_table {$where}
+ ORDER BY {$order_by}
+ LIMIT %d, %d", $start_from, $limit
+ );
$data = $wpdb->get_results($query, OBJECT);
- $data = array_map(function ($job){
+ $data = array_map(function ($job) {
return self::transform_link($job);
}, $data);
@@ -614,7 +659,10 @@ static function detach_all_rules(){
global $wpdb;
- $wpdb->query( "UPDATE {$wpdb->prefix}rapidload_job SET rule = 'is_url' , regex = null , status = 'processing'");
+ $query = "UPDATE {$wpdb->prefix}rapidload_job SET rule = %s, regex = %s, status = %s";
+ $wpdb->query( $wpdb->prepare( $query, 'is_url', null, 'processing' ) );
+
+ $error = $wpdb->last_error;
if(!empty($error)){
self::show_db_error($error);
@@ -627,95 +675,108 @@ static function requeueJob($id){
global $wpdb;
- $wpdb->query( "UPDATE {$wpdb->prefix}rapidload_job_data SET status = 'queued' WHERE job_id = " . $id);
+ $query = "UPDATE {$wpdb->prefix}rapidload_job_data SET status = %s WHERE job_id = %d";
+ $wpdb->query( $wpdb->prepare( $query, 'queued', $id ) );
+
+ $error = $wpdb->last_error;
if(!empty($error)){
self::show_db_error($error);
}
return true;
-
}
static function updateUrlJobDataStatusWhere($status = 'queued', $where = "", $ids = []){
global $wpdb;
- $ids = !empty($ids) ? implode(",", $ids) : "SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule = 'is_url'";
+ $ids = !empty($ids) ? implode(",", array_map('intval', $ids)) : "SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule = 'is_url'";
- $wpdb->query( "UPDATE {$wpdb->prefix}rapidload_job_data SET status = '". $status ."' WHERE job_id IN (". $ids .") " . $where);
+ $query = "UPDATE {$wpdb->prefix}rapidload_job_data SET status = %s WHERE job_id IN (" . $ids . ") " . $where;
+ $wpdb->query( $wpdb->prepare( $query, $status ) );
+
+ $error = $wpdb->last_error;
if(!empty($error)){
self::show_db_error($error);
}
return true;
-
}
static function updateRuleJobDataStatusWhere($status = 'queued', $where = "", $ids = []){
global $wpdb;
- $ids = !empty($ids) ? implode(",", $ids) : "SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule != 'is_url'";
+ $ids = !empty($ids) ? implode(",", array_map('intval', $ids)) : "SELECT id FROM {$wpdb->prefix}rapidload_job WHERE rule != 'is_url'";
- $wpdb->query( "UPDATE {$wpdb->prefix}rapidload_job_data SET status = '". $status ."' WHERE job_id IN (" . $ids . ") " . $where);
+ $query = "UPDATE {$wpdb->prefix}rapidload_job_data SET status = %s WHERE job_id IN (" . $ids . ") " . $where;
+ $wpdb->query( $wpdb->prepare( $query, $status ) );
+
+ $error = $wpdb->last_error;
if(!empty($error)){
self::show_db_error($error);
}
return true;
-
}
static function resetHits($url){
global $wpdb;
- $wpdb->query( "UPDATE {$wpdb->prefix}rapidload_job_data SET hits = 0 WHERE job_id IN (SELECT id FROM {$wpdb->prefix}rapidload_job WHERE url = '". $url ."') ");
+ $query = "UPDATE {$wpdb->prefix}rapidload_job_data SET hits = 0 WHERE job_id IN (SELECT id FROM {$wpdb->prefix}rapidload_job WHERE url = %s)";
+ $wpdb->query( $wpdb->prepare( $query, $url ) );
+
+ $error = $wpdb->last_error;
if(!empty($error)){
self::show_db_error($error);
}
return true;
-
}
static function resetRuleHits($id){
global $wpdb;
- $wpdb->query( "UPDATE {$wpdb->prefix}rapidload_job_data SET hits = 0 WHERE job_id = ". $id);
+ $query = "UPDATE {$wpdb->prefix}rapidload_job_data SET hits = 0 WHERE job_id = %d";
+ $wpdb->query( $wpdb->prepare( $query, $id ) );
+
+ $error = $wpdb->last_error;
if(!empty($error)){
self::show_db_error($error);
}
return true;
-
}
static function resetWarningHits(){
global $wpdb;
- $wpdb->query( "UPDATE {$wpdb->prefix}rapidload_job_data SET hits = 0 WHERE status = 'success' AND warnings IS NOT NULL");
+ $query = "UPDATE {$wpdb->prefix}rapidload_job_data SET hits = 0 WHERE status = %s AND warnings IS NOT NULL";
+ $wpdb->query( $wpdb->prepare( $query, 'success' ) );
+
+ $error = $wpdb->last_error;
if(!empty($error)){
self::show_db_error($error);
}
return true;
-
}
static function getUrlsWithWarnings(){
global $wpdb;
- $data = $wpdb->get_results("SELECT url FROM {$wpdb->prefix}rapidload_job WHERE id IN (SELECT job_id FROM {$wpdb->prefix}rapidload_job_data WHERE status = 'success' AND warnings IS NOT NULL)" , ARRAY_A);
+ $query = "SELECT url FROM {$wpdb->prefix}rapidload_job WHERE id IN (SELECT job_id FROM {$wpdb->prefix}rapidload_job_data WHERE status = %s AND warnings IS NOT NULL)";
+ $data = $wpdb->get_results( $wpdb->prepare( $query, 'success' ), ARRAY_A );
if(!empty($data))
{
@@ -723,7 +784,6 @@ static function getUrlsWithWarnings(){
}
return [];
-
}
static function get_first_link(){
@@ -732,14 +792,20 @@ static function get_first_link(){
$first_link = false;
- $link = $wpdb->get_results( "select * from (select
- job.id, job.url, job.rule, job.regex, job.rule_id, job.rule_note, job.status as job_status, job.created_at as job_created_at,
- uucss.data as files, uucss.stats, uucss.warnings, uucss.attempts, uucss.hits, CASE WHEN job.rule = 'is_url' AND job.rule_id IS NOT NULL THEN 'rule-based' ELSE uucss.status END AS status,
- cpcss.data as cpcss, cpcss.stats as cpcss_stats, cpcss.warnings as cpcss_warnings, cpcss.attempts as cpcss_attempts, cpcss.hits as cpcss_hits, cpcss.status as cpcss_status
-
- from {$wpdb->prefix}rapidload_job as job
- left join (select * from {$wpdb->prefix}rapidload_job_data where job_type = 'uucss') as uucss on job.id = uucss.job_id
- left join (select * from {$wpdb->prefix}rapidload_job_data where job_type = 'cpcss') as cpcss on job.id = cpcss.job_id) as dervied_table WHERE rule = 'is_url' LIMIT 1", OBJECT );
+ $query = "SELECT * FROM (
+ SELECT
+ job.id, job.url, job.rule, job.regex, job.rule_id, job.rule_note, job.status as job_status, job.created_at as job_created_at,
+ uucss.data as files, uucss.stats, uucss.warnings, uucss.attempts, uucss.hits,
+ CASE WHEN job.rule = 'is_url' AND job.rule_id IS NOT NULL THEN 'rule-based' ELSE uucss.status END AS status,
+ cpcss.data as cpcss, cpcss.stats as cpcss_stats, cpcss.warnings as cpcss_warnings, cpcss.attempts as cpcss_attempts,
+ cpcss.hits as cpcss_hits, cpcss.status as cpcss_status
+ FROM {$wpdb->prefix}rapidload_job as job
+ LEFT JOIN (SELECT * FROM {$wpdb->prefix}rapidload_job_data WHERE job_type = 'uucss') as uucss ON job.id = uucss.job_id
+ LEFT JOIN (SELECT * FROM {$wpdb->prefix}rapidload_job_data WHERE job_type = 'cpcss') as cpcss ON job.id = cpcss.job_id
+ ) as derived_table
+ WHERE rule = 'is_url' LIMIT 1";
+
+ $link = $wpdb->get_results( $query, OBJECT );
$error = $wpdb->last_error;
@@ -763,33 +829,39 @@ static function flush_all_rapidload($blog_id = ''){
global $wpdb;
+ $table_prefix = $wpdb->prefix . ($blog_id != '' && is_multisite() ? $blog_id . '_' : '');
+
$tableArray = [
- $wpdb->prefix . ($blog_id != '' && is_multisite() ? $blog_id . '_' : '') . "rapidload_uucss_job",
- $wpdb->prefix . ($blog_id != '' && is_multisite() ? $blog_id . '_' : '') . "rapidload_uucss_rule",
- $wpdb->prefix . ($blog_id != '' && is_multisite() ? $blog_id . '_' : '') . "rapidload_job_optimizations",
- $wpdb->prefix . ($blog_id != '' && is_multisite() ? $blog_id . '_' : '') . "rapidload_job_data",
- $wpdb->prefix . ($blog_id != '' && is_multisite() ? $blog_id . '_' : '') . "rapidload_job",
+ $table_prefix . "rapidload_uucss_job",
+ $table_prefix . "rapidload_uucss_rule",
+ $table_prefix . "rapidload_job_optimizations",
+ $table_prefix . "rapidload_job_data",
+ $table_prefix . "rapidload_job",
];
foreach ($tableArray as $tablename) {
- $wpdb->query("DELETE FROM $tablename");
- }
-
- $option_table = $wpdb->prefix . ($blog_id != '' && is_multisite() ? $blog_id . '_' : '') . "options";
-
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'autoptimize_uucss_settings'");
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'rapidload_migration'");
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'rapidload_cache'");
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'rapidload_module_cache'");
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'rapidload_module_cdn'");
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'rapidload_module_css'");
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'rapidload_module_font'");
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'rapidload_module_js'");
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'rapidload_module_image'");
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'rapidload_module_titan'");
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'rapidload_titan_gear'");
- $wpdb->query("DELETE FROM $option_table WHERE option_name = 'rapidload_cache'");
+ $wpdb->query($wpdb->prepare("DELETE FROM $tablename"));
+ }
+
+ $option_table = $table_prefix . "options";
+
+ $options_to_delete = [
+ 'autoptimize_uucss_settings',
+ 'rapidload_migration',
+ 'rapidload_cache',
+ 'rapidload_module_cache',
+ 'rapidload_module_cdn',
+ 'rapidload_module_css',
+ 'rapidload_module_font',
+ 'rapidload_module_js',
+ 'rapidload_module_image',
+ 'rapidload_module_titan',
+ 'rapidload_titan_gear',
+ ];
+ foreach ($options_to_delete as $option_name) {
+ $wpdb->query($wpdb->prepare("DELETE FROM $option_table WHERE option_name = %s", $option_name));
+ }
}
@@ -797,7 +869,7 @@ static function get_optimization_count(){
global $wpdb;
- $count = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}rapidload_job");
+ $count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->prefix}rapidload_job"));
$error = $wpdb->last_error;
diff --git a/includes/RapidLoad_Job.php b/includes/RapidLoad_Job.php
index 63afdb9c3..b8b0dc616 100644
--- a/includes/RapidLoad_Job.php
+++ b/includes/RapidLoad_Job.php
@@ -187,27 +187,28 @@ static function all(){
}
- function delete(){
-
+ function delete() {
global $wpdb;
- $query = $wpdb->query("DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id = " . $this->id);
- $query = $wpdb->query("DELETE FROM {$wpdb->prefix}rapidload_job WHERE id = " . $this->id);
+ $wpdb->query(
+ $wpdb->prepare("DELETE FROM {$wpdb->prefix}rapidload_job_data WHERE job_id = %d", $this->id)
+ );
+ $wpdb->query(
+ $wpdb->prepare("DELETE FROM {$wpdb->prefix}rapidload_job WHERE id = %d", $this->id)
+ );
}
- function get_urls(){
-
- if($this->rule == "is_url"){
+ function get_urls() {
+ if ($this->rule == "is_url") {
return [];
}
global $wpdb;
- $data = $wpdb->get_results("SELECT url FROM {$wpdb->prefix}rapidload_job WHERE rule_id = " . $this->id . " AND rule = 'is_url'" , ARRAY_A);
+ $data = $wpdb->get_results($wpdb->prepare("SELECT url FROM {$wpdb->prefix}rapidload_job WHERE rule_id = %d AND rule = 'is_url'",$this->id),ARRAY_A);
- if(!empty($data))
- {
+ if (!empty($data)) {
return array_column($data, 'url');
}
@@ -269,26 +270,23 @@ function set_mobile_options($options){
}
}
- function get_optimization_revisions($strategy, $limit = 10){
-
+ function get_optimization_revisions($strategy, $limit = 10) {
global $wpdb;
- if(!isset($this->id)){
+ if (!isset($this->id)) {
return [];
}
- $data = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}rapidload_job_optimizations WHERE strategy = '" . $strategy . "' AND job_id = " . $this->id . " ORDER BY id DESC LIMIT " . $limit . " OFFSET 1", OBJECT);
+ $data = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}rapidload_job_optimizations WHERE strategy = %s AND job_id = %d ORDER BY id DESC LIMIT %d OFFSET 1",$strategy,$this->id,$limit), OBJECT);
$transformed_data = [];
foreach ($data as $d) {
-
$d->data = json_decode($d->data);
$transformed_object = new stdClass();
$transformed_object->id = $d->id;
$transformed_object->created_at = $d->created_at;
-
$transformed_object->data = new stdClass();
if (isset($d->data) && isset($d->data->performance)) {
$transformed_object->data->performance = $d->data->performance;
@@ -308,66 +306,64 @@ function get_optimization_revisions($strategy, $limit = 10){
return $transformed_data;
}
- function get_last_optimization_revision_hash($strategy){
+ function get_last_optimization_revision_hash($strategy) {
global $wpdb;
- if(!isset($this->id)){
+ if (!isset($this->id)) {
return (object)[];
}
- $data = $wpdb->get_var("SELECT data FROM {$wpdb->prefix}rapidload_job_optimizations WHERE strategy = '" . $strategy . "' AND job_id = " . $this->id . " ORDER BY id DESC LIMIT 1 ");
+ $data = $wpdb->get_var(
+ $wpdb->prepare("SELECT data FROM {$wpdb->prefix}rapidload_job_optimizations WHERE strategy = %s AND job_id = %d ORDER BY id DESC LIMIT 1",$strategy,$this->id)
+ );
- if(!$data){
- return false;
- }else{
- return hash('md5',$data);
- }
+ return $data ? hash('md5', $data) : false;
}
- function get_last_optimization_revision($strategy){
+ function get_last_optimization_revision($strategy) {
global $wpdb;
- if(!isset($this->id)){
+ if (!isset($this->id)) {
return (object)[];
}
- $data = $wpdb->get_var("SELECT data FROM {$wpdb->prefix}rapidload_job_optimizations WHERE strategy = '" . $strategy . "' AND job_id = " . $this->id . " ORDER BY id DESC LIMIT 1 ");
+ $data = $wpdb->get_var(
+ $wpdb->prepare("SELECT data FROM {$wpdb->prefix}rapidload_job_optimizations WHERE strategy = %s AND job_id = %d ORDER BY id DESC LIMIT 1",$strategy, $this->id )
+ );
- if(!$data){
- return false;
- }else{
- return json_decode($data);
- }
+ return $data ? json_decode($data) : false;
}
- function get_revision_count($strategy){
-
+ function get_revision_count($strategy) {
global $wpdb;
- return $wpdb->get_var("SELECT count(id) FROM {$wpdb->prefix}rapidload_job_optimizations WHERE strategy = '" . $strategy . "' AND job_id = " . $this->id );
-
+ return $wpdb->get_var(
+ $wpdb->prepare("SELECT count(id) FROM {$wpdb->prefix}rapidload_job_optimizations WHERE strategy = %s AND job_id = %d",$strategy,$this->id)
+ );
}
- function delete_old_revision($strategy, $revision_count){
+ function delete_old_revision($strategy, $revision_count) {
$revsions = $this->get_revision_ids($strategy);
- if(!empty($revsions) && count($revsions) > ($revision_count -1 )){
- $revsions = array_slice($revsions, (-1 * ($revision_count -1 )));
- $revsions = array_map(function ($r){
+ if (!empty($revsions) && count($revsions) > ($revision_count - 1)) {
+ $revsions = array_slice($revsions, -($revision_count - 1));
+ $revsions = array_map(function ($r) {
return (double)$r[0];
- },$revsions);
- $revsions = implode(",",$revsions);
+ }, $revsions);
+ $revsions = implode(",", $revsions);
+
global $wpdb;
- $wpdb->query("DELETE FROM {$wpdb->prefix}rapidload_job_optimizations WHERE id NOT IN( $revsions ) AND strategy = '$strategy'");
+ $wpdb->query(
+ $wpdb->prepare("DELETE FROM {$wpdb->prefix}rapidload_job_optimizations WHERE id NOT IN( %s ) AND strategy = %s",$revsions,$strategy)
+ );
}
-
}
- function get_revision_ids($strategy){
-
+ function get_revision_ids($strategy) {
global $wpdb;
- return $wpdb->get_results("SELECT id FROM {$wpdb->prefix}rapidload_job_optimizations WHERE strategy = '" . $strategy . "' AND job_id = " . $this->id , ARRAY_N);
+ $query = $wpdb->prepare("SELECT id FROM {$wpdb->prefix}rapidload_job_optimizations WHERE strategy = %s AND job_id = %d",$strategy,$this->id);
+ return $wpdb->get_results($query, ARRAY_N);
}
function transform_individual_file_actions($options){
diff --git a/includes/RapidLoad_Utils.php b/includes/RapidLoad_Utils.php
index 327392e57..4c8a43995 100644
--- a/includes/RapidLoad_Utils.php
+++ b/includes/RapidLoad_Utils.php
@@ -677,7 +677,7 @@ public static function verify_nonce($nonce = 'uucss_nonce' ){
return true;
}
- if ( ! isset( $_REQUEST['nonce'] ) || ! wp_verify_nonce( $_REQUEST['nonce'], $nonce ) ) {
+ if ( ! isset( $_REQUEST['nonce'] ) || ! wp_verify_nonce( $_REQUEST['nonce'], $nonce ) || !current_user_can('manage_options')) {
wp_send_json_error( 'RapidLoad - Malformed Request Detected, Contact Support.' );
}
}
@@ -797,5 +797,13 @@ public static function log_user_agent() {
self::debug_log("User Agent: Not available or not an HTML request");
}
}
+
+ public static function create_nonce($nonce_name)
+ {
+ if(current_user_can('manage_options')){
+ return wp_create_nonce( $nonce_name );
+ }
+ return '';
+ }
}
\ No newline at end of file
diff --git a/includes/admin/RapidLoad_Admin_Bar.php b/includes/admin/RapidLoad_Admin_Bar.php
index c72f516c2..2a1eb73ec 100644
--- a/includes/admin/RapidLoad_Admin_Bar.php
+++ b/includes/admin/RapidLoad_Admin_Bar.php
@@ -97,7 +97,7 @@ public function load_optimizer_scripts()
'admin_url' => admin_url(),
'dashboard_url' => admin_url( 'admin.php?page=rapidload' ),
'optimizer_url' => defined('RAPIDLOAD_OPTIMIZER_TEST_URL') ? RAPIDLOAD_OPTIMIZER_TEST_URL : $this->transform_url($current_url),
- 'nonce' => wp_create_nonce( 'uucss_nonce' ),
+ 'nonce' => self::create_nonce( 'uucss_nonce' ),
'timezone' => get_option('timezone_string', 'UTC'),
'rapidload_version' => UUCSS_VERSION,
'actions' => [
diff --git a/includes/admin/RapidLoad_Admin_Frontend.php b/includes/admin/RapidLoad_Admin_Frontend.php
index 668a44297..7cfb1d920 100644
--- a/includes/admin/RapidLoad_Admin_Frontend.php
+++ b/includes/admin/RapidLoad_Admin_Frontend.php
@@ -418,7 +418,7 @@ public function uucss_data(){
if($url_regex == 'false' && $url_filter){
- $filters[] = " url LIKE '%". $url_filter . "%' ";
+ $filters[] = " url LIKE '%%". $url_filter . "%%' ";
}
@@ -952,7 +952,7 @@ public function load_optimizer_scripts()
'plugin_url' => UUCSS_PLUGIN_URL,
'ajax_url' => admin_url( 'admin-ajax.php' ),
'optimizer_url' => $this->transform_url($this->get_current_url()),
- 'nonce' => wp_create_nonce( 'uucss_nonce' ),
+ 'nonce' => self::create_nonce( 'uucss_nonce' ),
);
wp_localize_script( 'rapidload_page_optimizer', 'rapidload_admin', $data );
@@ -973,7 +973,7 @@ public function load_preview_scripts()
'page_preview_base' => UUCSS_PLUGIN_URL . 'includes/admin/rapidload-preview/dist',
'plugin_url' => UUCSS_PLUGIN_URL,
'ajax_url' => admin_url( 'admin-ajax.php' ),
- 'nonce' => wp_create_nonce( 'uucss_nonce' ),
+ 'nonce' => self::create_nonce( 'uucss_nonce' ),
);
wp_localize_script( 'rapidload_page_preview', 'rapidload_page_preview', $data );
@@ -1045,7 +1045,7 @@ public function load_legacy_scripts(){
$data = array(
'api' => RapidLoad_Api::get_key(),
- 'nonce' => wp_create_nonce( 'uucss_nonce' ),
+ 'nonce' => self::create_nonce( 'uucss_nonce' ),
'url' => site_url(),
'ajax_url' => admin_url( 'admin-ajax.php' ),
'setting_url' => admin_url( 'options-general.php?page=uucss_legacy' ),
diff --git a/includes/admin/page-optimizer/dist-debug/asset-map.php b/includes/admin/page-optimizer/dist-debug/asset-map.php
index eecf60844..2e20fdf5e 100644
--- a/includes/admin/page-optimizer/dist-debug/asset-map.php
+++ b/includes/admin/page-optimizer/dist-debug/asset-map.php
@@ -1,23 +1,23 @@
'assets/inter-cyrillic-wght-normal.woff2',
'assets/inter-cyrillic-ext-wght-normal.woff2' => 'assets/inter-cyrillic-ext-wght-normal.woff2',
+ 'assets/inter-cyrillic-wght-normal.woff2' => 'assets/inter-cyrillic-wght-normal.woff2',
'assets/inter-greek-ext-wght-normal.woff2' => 'assets/inter-greek-ext-wght-normal.woff2',
- 'assets/inter-greek-wght-normal.woff2' => 'assets/inter-greek-wght-normal.woff2',
'assets/inter-vietnamese-wght-normal.woff2' => 'assets/inter-vietnamese-wght-normal.woff2',
- 'assets/inter-latin-ext-wght-normal.woff2' => 'assets/inter-latin-ext-wght-normal.woff2',
+ 'assets/inter-greek-wght-normal.woff2' => 'assets/inter-greek-wght-normal.woff2',
'assets/inter-latin-wght-normal.woff2' => 'assets/inter-latin-wght-normal.woff2',
- 'assets/index.css' => 'assets/index.ChlP1lpW.css',
- 'assets/index.js' => 'assets/index.vzULuBtB.js',
- 'assets/InitTour.js' => 'assets/InitTour.DaMiyxQJ.js',
+ 'assets/inter-latin-ext-wght-normal.woff2' => 'assets/inter-latin-ext-wght-normal.woff2',
+ 'assets/index.css' => 'assets/index.DYNztJWS.css',
'assets/core-vendor.js' => 'assets/core-vendor.a21Wwx5s.js',
- 'assets/animations.js' => 'assets/animations.CWk52Myu.js',
'assets/vendor.js' => 'assets/vendor.C2Ge5RaU.js',
- 'assets/index.Uyygx8b3.map' => 'assets/index.Uyygx8b3.js.map',
- 'assets/InitTour.DaMiyxQJ.map' => 'assets/InitTour.DaMiyxQJ.js.map',
+ 'assets/animations.js' => 'assets/animations.CWk52Myu.js',
+ 'assets/index.js' => 'assets/index.DQKRoxVT.js',
+ 'assets/InitTour.js' => 'assets/InitTour.B1DnpL1R.js',
'assets/core-vendor.a21Wwx5s.map' => 'assets/core-vendor.a21Wwx5s.js.map',
- 'assets/index.JHaeFuYk.map' => 'assets/index.JHaeFuYk.js.map',
- 'assets/animations.CWk52Myu.map' => 'assets/animations.CWk52Myu.js.map',
'assets/vendor.C2Ge5RaU.map' => 'assets/vendor.C2Ge5RaU.js.map',
- 'assets/index.vzULuBtB.map' => 'assets/index.vzULuBtB.js.map'
+ 'assets/animations.CWk52Myu.map' => 'assets/animations.CWk52Myu.js.map',
+ 'assets/index.j2mLwiGu.map' => 'assets/index.j2mLwiGu.js.map',
+ 'assets/index.JHaeFuYk.map' => 'assets/index.JHaeFuYk.js.map',
+ 'assets/InitTour.B1DnpL1R.map' => 'assets/InitTour.B1DnpL1R.js.map',
+ 'assets/index.DQKRoxVT.map' => 'assets/index.DQKRoxVT.js.map'
]);
diff --git a/includes/admin/page-optimizer/dist-debug/assets/InitTour.DaMiyxQJ.js b/includes/admin/page-optimizer/dist-debug/assets/InitTour.B1DnpL1R.js
similarity index 98%
rename from includes/admin/page-optimizer/dist-debug/assets/InitTour.DaMiyxQJ.js
rename to includes/admin/page-optimizer/dist-debug/assets/InitTour.B1DnpL1R.js
index 3445b6112..d7e850bfc 100644
--- a/includes/admin/page-optimizer/dist-debug/assets/InitTour.DaMiyxQJ.js
+++ b/includes/admin/page-optimizer/dist-debug/assets/InitTour.B1DnpL1R.js
@@ -1,7 +1,7 @@
-import{j as e}from"./vendor.C2Ge5RaU.js";import{c as L,t as $,u as I,s as h,a as M,o as D,b as Y}from"./index.vzULuBtB.js";import{r as m}from"./core-vendor.a21Wwx5s.js";import{u as B}from"./index.JHaeFuYk.js";import"./animations.CWk52Myu.js";/**
+import{j as e}from"./vendor.C2Ge5RaU.js";import{c as L,t as $,u as I,s as h,a as M,o as D,b as Y}from"./index.DQKRoxVT.js";import{r as m}from"./core-vendor.a21Wwx5s.js";import{u as B}from"./index.JHaeFuYk.js";import"./animations.CWk52Myu.js";/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const a=L("MousePointerClick",[["path",{d:"m9 9 5 12 1.8-5.2L21 14Z",key:"1b76lo"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}]]),q=({audit:o})=>{const{dispatch:t,openAudits:c,activeTab:l}=I();return m.useEffect(()=>{c.includes(o.id)||t(h("openAudits",[...c,o.id])),(o.type==="opportunity"?"opportunities":o.type)!==l&&t(h("activeTab",o.type==="opportunity"?"opportunities":o.type))},[]),e.jsxs(e.Fragment,{children:[e.jsx(a,{onClick:()=>{},className:"mb-2"}),"Click the ",e.jsx("span",{className:"text-purple-750",children:'"Show Actions"'})," button to view detailed information on each performance audit and dive deeper."]})},G=o=>{var c,l;let t=o.id;return(l=(c=o.files)==null?void 0:c.headings)!=null&&l.find(s=>s.valueType==="controls"),o.settings.filter(s=>{var d,u;return!((u=(d=o.files)==null?void 0:d.grouped_items)!=null&&u.map(b=>$(o,b.type)).includes(s.category))}),[{selector:`[data-tour="audit-${t}"]`,content:{header:"Explore Individual Audits",body:e.jsx(q,{audit:o})},position:"left",resizeObservables:[`[data-tour="audit-${t}"]`,`[data-tour="audit-${t}-group-0"]`,`[data-tour="audit-${t}"] .audit-content`]},...o.files.items.length>0?[{selector:`[data-tour="${t}-group-0"]`,content:{header:"Streamlined Audit Insights",body:e.jsx(e.Fragment,{children:"Within every audit, discover thoughtfully arranged details and actions. Clarity, made simple."})},position:"left",resizeObservables:[`[data-tour="${t}-group-0"]`]}]:[],{selector:`[data-tour="${t}-group-0-table"]`,content:{header:"Organizing Your Assets",body:e.jsx(e.Fragment,{children:"Explore the table to find resources and their associated actions. Properly organized to help improve your page performance."})},position:"top"}]},U=[{selector:'[data-tour="switch-report-strategy"]',content:{header:"Select Mobile or Desktop",body:"Pick a device to analyze and optimize the page."}},{selector:'[data-tour="current-url"]',content:{header:"Current URL",body:e.jsxs(e.Fragment,{children:[" ",e.jsx(a,{className:"mb-2"})," This is the URL currently selected to configure, optimize, and analyze your site's performance."]})}},{selector:'[data-tour="analyze"]',content:{header:"Refresh Speed Again",body:e.jsxs(e.Fragment,{children:[" ",e.jsx(a,{className:"mb-2"})," Click to re-analyze the page speed using Google PageSpeed Insights."]})}},{selector:'[data-tour="test-mode"]',content:{header:"Test-Mode",body:e.jsxs(e.Fragment,{children:[" ",e.jsx(a,{className:"mb-2"})," Enable this to keep RapidLoad changes from going live."]})}},{selector:'[data-tour="preview-button"]',content:{header:"Preview",body:e.jsxs(e.Fragment,{children:[" ",e.jsx(a,{className:"mb-2"})," Click to see how the page looks after applying RapidLoad optimization before going live."]})}},{selector:'[data-tour="speed-settings"]',content:{header:"Speed Settings",body:e.jsxs(e.Fragment,{children:[" ",e.jsx(a,{className:"mb-2"})," Configure the RapidLoad plugin with one-click gears."]})}},{selector:'[data-tour="settings-gear"]',content:{header:"Performance gears",body:e.jsxs(e.Fragment,{children:[" ",e.jsx(a,{className:"mb-2"})," Select your Performance Mode: Starter, Accelerate, TurboMax, or Customize, to fine-tune your site's speed."]})},position:"right"},{selector:'[data-tour="customize-settings"]',content:{header:"Customize Settings",body:e.jsxs(e.Fragment,{children:[" ",e.jsx(a,{className:"mb-2"})," Tailor your site's performance settings to your specific requirements."]})},position:"right"},{selector:'[data-tour="speed-insights"]',content:{header:"Your Speed Insights",body:"See your overall website's speed rating, along with a breakdown of key metrics and performance scores."},position:"right"},{selector:'[data-tour="expand-metrics"]',content:{header:"Metrics",body:e.jsxs(e.Fragment,{children:[" ",e.jsx(a,{className:"mb-2"}),"Click on ”Expand Metrics” to identify individual metrics to uncover insights and get recommendations for enhancement."]})},position:"right"},{selector:'[data-tour="audit-groups"]',content:{header:"Dive into Audit Groups",body:e.jsxs("div",{className:"flex flex-col gap-2 ",children:[e.jsx(a,{}),e.jsx("div",{className:"text-md border-b pb-4",children:"Click on each audit group to explore detailed insights and actions."}),e.jsx("div",{className:"text-sm text-brand-600",children:e.jsxs("ul",{className:"dark:text-brand-200 text-brand-800 flex flex-col gap-2 [&>*]:flex [&>*]:flex-col [&>*]:gap-1",children:[e.jsxs("li",{children:[e.jsx("span",{className:"font-bold ",children:"Opportunities"})," Recommendations from Google to enhance your page's speed and efficiency."]}),e.jsxs("li",{children:[e.jsx("span",{className:"font-bold d",children:"Diagnostics"})," In-depth feedback about your site's performance and potential issues."]}),e.jsxs("li",{children:[e.jsx("span",{className:"font-bold ",children:"Passed Audits"})," Areas where your website meets or exceeds performance standards."]})]})})]})},position:"left"}],W=[{selector:'[data-tour="save-changes"]',content:{header:"Saving Your Optimizations",body:e.jsxs(e.Fragment,{children:[e.jsx(a,{className:"mb-2"}),"After making changes, remember to save. Tap the ",e.jsx("span",{className:"text-purple-750",children:'"Save Changes"'})," button to ensure all your tweaks are updated."]})},position:(o,t)=>{var s;let c=document.getElementById("rapidload-optimizer-shadow-dom"),l=(s=c==null?void 0:c.shadowRoot)==null?void 0:s.querySelector('[data-tour="save-changes"]');if(l){let d=l.getBoundingClientRect();return[Number(d.x+d.width)-o.width,d.y-o.height-25]}return"top"},padding:{popover:[100,25]}}],V=({mode:o})=>{const{data:t,loading:c}=M(D),{setIsOpen:l,isOpen:s,setSteps:d,currentStep:u,setCurrentStep:b}=B(),{activeTab:Z,isTourOpen:f,activeMetric:P,dispatch:y}=I(),{activeReport:x}=M(r=>r.app);m.useEffect(()=>{var j,S,k,w,C,N,z,A,T,E,F,O;let r=(S=(j=t==null?void 0:t.grouped)==null?void 0:j.opportunities)==null?void 0:S.find(n=>{var p,g,i;return((p=n==null?void 0:n.settings)==null?void 0:p.length)>0&&((i=(g=n==null?void 0:n.files)==null?void 0:g.items)==null?void 0:i.length)>0});r||(r=(w=(k=t==null?void 0:t.grouped)==null?void 0:k.diagnostics)==null?void 0:w.find(n=>{var p,g,i;return((p=n==null?void 0:n.settings)==null?void 0:p.length)>0&&((i=(g=n==null?void 0:n.files)==null?void 0:g.items)==null?void 0:i.length)>0})),!r&&((N=(C=t==null?void 0:t.grouped)==null?void 0:C.opportunities)!=null&&N.length)&&((A=(z=t==null?void 0:t.grouped)==null?void 0:z.opportunities)==null?void 0:A.length)>0&&(r=t.grouped.opportunities[0]),!r&&((E=(T=t==null?void 0:t.grouped)==null?void 0:T.diagnostics)!=null&&E.length)&&((O=(F=t==null?void 0:t.grouped)==null?void 0:F.diagnostics)==null?void 0:O.length)>0&&(r=t.grouped.diagnostics[0]),d&&d(n=>{let p=document.getElementById("rapidload-optimizer-shadow-dom");return[...U,...r?G(r):[],...o==="normal"?W:[]].map(i=>{var R;return p&&(i.shadowSelector=typeof i.selector=="string"?i.selector:i.shadowSelector,i.selector=(R=p.shadowRoot)==null?void 0:R.querySelector(i.shadowSelector)),i})})},[x,u]),m.useEffect(()=>{s||b(0)},[x]),m.useEffect(()=>{P&&y(h("activeMetric",null)),u===6&&y(h("activeTab","configurations")),u===10&&y(h("activeTab","opportunities"))},[u]),m.useEffect(()=>{},[s]);const v=()=>{const r=document.getElementById("rapidload-page-optimizer-content");s&&r?r.style.overflowY="hidden":r&&(r.style.overflowY="auto")};return m.useEffect(()=>{f!==s&&(v(),l(f))},[f]),m.useEffect(()=>{f!==s&&(v(),y(Y("isTourOpen",s)))},[s]),e.jsx(e.Fragment,{})};export{V as default};
-//# sourceMappingURL=InitTour.DaMiyxQJ.js.map
+//# sourceMappingURL=InitTour.B1DnpL1R.js.map
diff --git a/includes/admin/page-optimizer/dist-debug/assets/InitTour.B1DnpL1R.js.map b/includes/admin/page-optimizer/dist-debug/assets/InitTour.B1DnpL1R.js.map
new file mode 100644
index 000000000..dceb872da
--- /dev/null
+++ b/includes/admin/page-optimizer/dist-debug/assets/InitTour.B1DnpL1R.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"InitTour.B1DnpL1R.js","sources":["../../node_modules/lucide-react/dist/esm/icons/mouse-pointer-click.js","../../src/components/tour/steps.tsx","../../src/components/tour/InitTour.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst MousePointerClick = createLucideIcon(\"MousePointerClick\", [\n [\"path\", { d: \"m9 9 5 12 1.8-5.2L21 14Z\", key: \"1b76lo\" }],\n [\"path\", { d: \"M7.2 2.2 8 5.1\", key: \"1cfko1\" }],\n [\"path\", { d: \"m5.1 8-2.9-.8\", key: \"1go3kf\" }],\n [\"path\", { d: \"M14 4.1 12 6\", key: \"ita8i4\" }],\n [\"path\", { d: \"m6 12-1.9 2\", key: \"mnht97\" }]\n]);\n\nexport { MousePointerClick as default };\n//# sourceMappingURL=mouse-pointer-click.js.map\n","import {StepType, useTour} from \"@reactour/tour\";\r\nimport React, {useEffect, useMemo, useState} from \"react\";\r\nimport {MousePointerClick} from \"lucide-react\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\nimport {setCommonState} from \"../../store/common/commonActions\";\r\nimport {useSelector} from \"react-redux\";\r\nimport {optimizerData} from \"../../store/app/appSelector\";\r\nimport {transformFileType} from \"lib/utils\";\r\nimport {position} from \"html2canvas/dist/types/css/property-descriptors/position\";\r\n\r\n\r\nconst TourAuditOpen = ({audit}: { audit: Audit }) => {\r\n\r\n const {dispatch, openAudits, activeTab} = useCommonDispatch()\r\n\r\n useEffect(() => {\r\n const isAuditOpen = openAudits.includes(audit.id);\r\n\r\n if (!isAuditOpen) {\r\n dispatch(setCommonState('openAudits', [...openAudits, audit.id]));\r\n }\r\n\r\n let activeAuditTab = audit.type === 'opportunity' ? 'opportunities' : audit.type\r\n\r\n if (activeAuditTab !== activeTab) {\r\n dispatch(setCommonState('activeTab',\r\n audit.type === 'opportunity' ? 'opportunities' : audit.type\r\n ));\r\n }\r\n\r\n }, [])\r\n\r\n\r\n\r\n return <>\r\n
{\r\n }}\r\n className='mb-2'/>\r\n Click the \"Show Actions\" button to view detailed information on each\r\n performance audit and dive deeper.\r\n >\r\n}\r\n\r\nexport const AuditSteps = (audit: Audit): StepType[] => {\r\n\r\n let key = audit.id\r\n\r\n const hasControls = !!audit.files?.headings?.find(h => h.valueType === 'controls')\r\n\r\n let remainingSettings = audit\r\n .settings\r\n // @ts-ignore\r\n .filter(s => !audit.files?.grouped_items?.map(group => transformFileType(audit, group.type))\r\n .includes(s.category))\r\n\r\n\r\n return [\r\n {\r\n selector: `[data-tour=\"audit-${key}\"]`,\r\n content: {\r\n // @ts-ignore\r\n header: `Explore Individual Audits`,\r\n body: \r\n },\r\n position: \"left\",\r\n resizeObservables:\r\n [\r\n `[data-tour=\"audit-${key}\"]`,\r\n `[data-tour=\"audit-${key}-group-0\"]`,\r\n `[data-tour=\"audit-${key}\"] .audit-content`,\r\n ],\r\n },\r\n\r\n ...(audit.files.items.length > 0 ? [\r\n {\r\n selector: `[data-tour=\"${key}-group-0\"]`,\r\n content: {\r\n // @ts-ignore\r\n header: `Streamlined Audit Insights`,\r\n body: <>\r\n Within every audit, discover thoughtfully arranged details and actions. Clarity, made\r\n simple.\r\n >\r\n },\r\n position: \"left\",\r\n resizeObservables: [`[data-tour=\"${key}-group-0\"]`]\r\n },\r\n\r\n ] : []),\r\n\r\n ...[\r\n {\r\n selector: `[data-tour=\"${key}-group-0-table\"]`,\r\n content: {\r\n // @ts-ignore\r\n header: `Organizing Your Assets`,\r\n body: <>\r\n Explore the table to find resources and their associated actions.\r\n Properly organized to help improve your page performance.\r\n >\r\n },\r\n position: \"top\",\r\n }\r\n ],\r\n\r\n ];\r\n\r\n}\r\n\r\n\r\nlet getElement = (selector: string) => {\r\n\r\n return document.querySelector('[data-tour=\"switch-report-strategy\"]')\r\n}\r\n\r\nconst Steps: StepType[] = [\r\n\r\n {\r\n selector: '[data-tour=\"switch-report-strategy\"]',\r\n content: {\r\n // @ts-ignore\r\n header: 'Select Mobile or Desktop',\r\n body: 'Pick a device to analyze and optimize the page.'\r\n },\r\n },\r\n {\r\n selector: '[data-tour=\"current-url\"]',\r\n content: {\r\n // @ts-ignore\r\n header: `Current URL`,\r\n body: <> This is the URL currently selected to configure, optimize, and analyze your site's performance.>\r\n },\r\n },\r\n {\r\n selector: '[data-tour=\"analyze\"]',\r\n content: {\r\n // @ts-ignore\r\n header: `Refresh Speed Again`,\r\n body: <> Click to re-analyze the page speed using Google PageSpeed\r\n Insights.>\r\n },\r\n },\r\n {\r\n selector: '[data-tour=\"test-mode\"]',\r\n content: {\r\n // @ts-ignore\r\n header: `Test-Mode`,\r\n body: <> Enable this to keep RapidLoad changes from going live.>\r\n },\r\n },\r\n {\r\n selector: '[data-tour=\"preview-button\"]',\r\n content: {\r\n // @ts-ignore\r\n header: `Preview`,\r\n body: <> Click to see how the page looks after applying RapidLoad optimization before going live.>\r\n },\r\n },\r\n {\r\n selector: '[data-tour=\"speed-settings\"]',\r\n content: {\r\n // @ts-ignore\r\n header: `Speed Settings`,\r\n body: <> Configure the RapidLoad plugin with one-click gears.>\r\n },\r\n },\r\n {\r\n selector: '[data-tour=\"settings-gear\"]',\r\n content: {\r\n // @ts-ignore\r\n header: `Performance gears`,\r\n body: <> Select your Performance Mode: Starter, Accelerate, TurboMax, or Customize, to fine-tune your site's speed.\r\n >\r\n },\r\n position: \"right\"\r\n },\r\n {\r\n selector: '[data-tour=\"customize-settings\"]',\r\n content: {\r\n // @ts-ignore\r\n header: `Customize Settings`,\r\n body: <> Tailor your site's performance settings to your specific requirements.\r\n >\r\n },\r\n position: \"right\"\r\n },\r\n {\r\n selector: '[data-tour=\"speed-insights\"]',\r\n content: {\r\n // @ts-ignore\r\n header: `Your Speed Insights`,\r\n body: 'See your overall website\\'s speed rating, along with a breakdown of key metrics and performance scores.'\r\n },\r\n position: \"right\"\r\n },\r\n {\r\n selector: '[data-tour=\"expand-metrics\"]',\r\n content: {\r\n // @ts-ignore\r\n header: `Metrics`,\r\n body: <> \r\n Click on ”Expand Metrics” to identify individual metrics to uncover insights and get recommendations for enhancement.\r\n >\r\n },\r\n position: \"right\"\r\n },\r\n\r\n {\r\n selector: '[data-tour=\"audit-groups\"]',\r\n content: {\r\n // @ts-ignore\r\n header: `Dive into Audit Groups`,\r\n body:\r\n \r\n
\r\n
\r\n Click on each audit group to explore detailed insights and actions.\r\n
\r\n
\r\n
\r\n Opportunities Recommendations from\r\n Google to enhance your page's speed and efficiency.\r\n \r\n Diagnostics In-depth feedback about\r\n your site's performance and potential issues.\r\n \r\n Passed Audits Areas where your website\r\n meets or exceeds performance standards.\r\n \r\n \r\n
\r\n
\r\n },\r\n position: \"left\",\r\n\r\n }\r\n]\r\n\r\n\r\nexport const FinalSteps: StepType[] = [\r\n {\r\n selector: '[data-tour=\"save-changes\"]',\r\n content: {\r\n // @ts-ignore\r\n header: `Saving Your Optimizations`,\r\n body: <>\r\n \r\n After making changes, remember to save. Tap the \"Save Changes\" button to\r\n ensure all your tweaks are updated.\r\n >\r\n },\r\n position: (postionsProps, prevRect) => {\r\n let shadowRoot =\r\n document.getElementById('rapidload-optimizer-shadow-dom')\r\n let el = shadowRoot?.shadowRoot?.querySelector('[data-tour=\"save-changes\"]')\r\n\r\n\r\n if (el) {\r\n let rect = el.getBoundingClientRect()\r\n\r\n return [Number(rect.x + rect.width) - postionsProps.width , rect.y - postionsProps.height - 25 ];\r\n }\r\n\r\n return \"top\"\r\n },\r\n padding: {\r\n popover: [100, 25]\r\n },\r\n },\r\n]\r\n\r\n\r\n\r\nexport default Steps","import {AppAction, RootState} from \"../../store/app/appTypes\";\r\nimport {useDispatch, useSelector} from \"react-redux\";\r\nimport {useEffect, useState} from \"react\";\r\nimport Steps, {AuditSteps, FinalSteps} from \"components/tour/steps\";\r\nimport {setCommonRootState, setCommonState} from \"../../store/common/commonActions\";\r\nimport {optimizerData} from \"../../store/app/appSelector\";\r\nimport {useTour} from \"@reactour/tour\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\nimport {useAppContext} from \"../../context/app\";\r\n\r\nconst InitTour = ({ mode }: {\r\n mode: RapidLoadOptimizerModes\r\n}) => {\r\n\r\n const {data, loading} = useSelector(optimizerData);\r\n const { setIsOpen, isOpen, setSteps, currentStep, setCurrentStep } = useTour()\r\n const { activeTab, isTourOpen, activeMetric, dispatch: commonDispatch } = useCommonDispatch()\r\n const {activeReport} = useSelector((state: RootState) => state.app);\r\n\r\n useEffect(() => {\r\n\r\n let hasActions = true;\r\n\r\n let tourAudit = data?.grouped?.opportunities?.find(audit => {\r\n return audit?.settings?.length > 0 && audit?.files?.items?.length > 0;\r\n });\r\n\r\n if (!tourAudit) {\r\n tourAudit = data?.grouped?.diagnostics?.find(audit => {\r\n return audit?.settings?.length > 0 && audit?.files?.items?.length > 0;\r\n });\r\n }\r\n\r\n if (!tourAudit && data?.grouped?.opportunities?.length && data?.grouped?.opportunities?.length > 0) {\r\n tourAudit = data.grouped.opportunities[0];\r\n hasActions = false;\r\n }\r\n\r\n if (!tourAudit && data?.grouped?.diagnostics?.length && data?.grouped?.diagnostics?.length > 0) {\r\n tourAudit = data.grouped.diagnostics[0];\r\n hasActions = false;\r\n }\r\n\r\n setSteps && setSteps(p => {\r\n\r\n let selector =\r\n document.getElementById('rapidload-optimizer-shadow-dom');\r\n\r\n let steps = [\r\n ...Steps,\r\n ...(tourAudit ? AuditSteps(tourAudit) : []),\r\n ...(mode === 'normal' ? FinalSteps : [])\r\n ].map(step => {\r\n\r\n if (selector) {\r\n // @ts-ignore\r\n step.shadowSelector = typeof step.selector === 'string' ? step.selector : step.shadowSelector;\r\n // @ts-ignore\r\n step.selector = selector.shadowRoot?.querySelector(step.shadowSelector);\r\n }\r\n return step;\r\n });\r\n\r\n return steps;\r\n });\r\n\r\n }, [activeReport, currentStep]);\r\n\r\n\r\n\r\n\r\n useEffect(() => {\r\n\r\n if (!isOpen) {\r\n setCurrentStep(0);\r\n }\r\n\r\n }, [activeReport])\r\n\r\n useEffect(() => {\r\n\r\n if (activeMetric) {\r\n commonDispatch(setCommonState('activeMetric', null))\r\n }\r\n if(currentStep === 6){\r\n commonDispatch(setCommonState('activeTab', 'configurations'))\r\n }\r\n if(currentStep === 10){\r\n commonDispatch(setCommonState('activeTab', 'opportunities'))\r\n }\r\n }, [currentStep])\r\n\r\n\r\n useEffect(() => {\r\n\r\n\r\n\r\n }, [isOpen])\r\n\r\n\r\n const onOpenChange = () => {\r\n const content = document.getElementById('rapidload-page-optimizer-content')\r\n\r\n if (isOpen && content) {\r\n content.style.overflowY = 'hidden'\r\n } else {\r\n if(content) content.style.overflowY = 'auto'\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n\r\n if (isTourOpen !== isOpen) {\r\n\r\n onOpenChange()\r\n setIsOpen(isTourOpen);\r\n }\r\n\r\n }, [isTourOpen])\r\n\r\n useEffect(() => {\r\n\r\n if (isTourOpen !== isOpen) {\r\n\r\n onOpenChange()\r\n commonDispatch(setCommonRootState('isTourOpen', isOpen))\r\n }\r\n\r\n }, [isOpen])\r\n\r\n return <>>\r\n}\r\n\r\nexport default InitTour"],"names":["MousePointerClick","createLucideIcon","TourAuditOpen","audit","dispatch","openAudits","activeTab","useCommonDispatch","useEffect","setCommonState","jsxs","Fragment","jsx","AuditSteps","key","_b","_a","h","transformFileType","group","Steps","FinalSteps","postionsProps","prevRect","shadowRoot","el","rect","InitTour","mode","data","loading","useSelector","optimizerData","setIsOpen","isOpen","setSteps","currentStep","setCurrentStep","useTour","isTourOpen","activeMetric","commonDispatch","activeReport","state","tourAudit","_c","_d","_f","_e","_h","_g","_j","_i","_l","_k","p","selector","step","onOpenChange","content","setCommonRootState"],"mappings":"kPAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAMA,EAAoBC,EAAiB,oBAAqB,CAC9D,CAAC,OAAQ,CAAE,EAAG,2BAA4B,IAAK,QAAQ,CAAE,EACzD,CAAC,OAAQ,CAAE,EAAG,iBAAkB,IAAK,QAAQ,CAAE,EAC/C,CAAC,OAAQ,CAAE,EAAG,gBAAiB,IAAK,QAAQ,CAAE,EAC9C,CAAC,OAAQ,CAAE,EAAG,eAAgB,IAAK,QAAQ,CAAE,EAC7C,CAAC,OAAQ,CAAE,EAAG,cAAe,IAAK,QAAQ,CAAE,CAC9C,CAAC,ECJKC,EAAgB,CAAC,CAAC,MAAAC,KAA6B,CAEjD,KAAM,CAAC,SAAAC,EAAU,WAAAC,EAAY,UAAAC,GAAaC,EAAkB,EAE5DC,OAAAA,EAAAA,UAAU,IAAM,CACQH,EAAW,SAASF,EAAM,EAAE,GAGnCC,EAAAK,EAAe,aAAc,CAAC,GAAGJ,EAAYF,EAAM,EAAE,CAAC,CAAC,GAG/CA,EAAM,OAAS,cAAgB,gBAAkBA,EAAM,QAErDG,GACVF,EAAAK,EAAe,YACpBN,EAAM,OAAS,cAAgB,gBAAkBA,EAAM,IAAA,CAC1D,CAGT,EAAG,CAAE,CAAA,EAKDO,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAAC,EAAA,IAACZ,EAAA,CACG,QAAS,IAAM,CACf,EACA,UAAU,MAAA,CAAM,EAAE,aACXY,EAAA,IAAA,OAAA,CAAK,UAAU,kBAAkB,SAAc,iBAAA,EAAO,iFAErE,CAAA,CAAA,CACJ,EAEaC,EAAcV,GAA6B,SAEpD,IAAIW,EAAMX,EAAM,GAEI,OAAEY,GAAAC,EAAAb,EAAM,QAAN,YAAAa,EAAa,WAAb,MAAAD,EAAuB,KAAKE,GAAKA,EAAE,YAAc,YAE/Cd,EACnB,SAEA,UAAY,SAAA,SAACY,GAAAC,EAAAb,EAAM,QAAN,YAAAa,EAAa,gBAAb,MAAAD,EAA4B,OAAaG,EAAkBf,EAAOgB,EAAM,IAAI,GACrF,SAAS,EAAE,WAAS,EAGtB,CACH,CACI,SAAU,qBAAqBL,CAAG,KAClC,QAAS,CAEL,OAAQ,4BACR,KAAOF,EAAA,IAAAV,EAAA,CAAc,MAAAC,CAAa,CAAA,CACtC,EACA,SAAU,OACV,kBACI,CACI,qBAAqBW,CAAG,KACxB,qBAAqBA,CAAG,aACxB,qBAAqBA,CAAG,mBAC5B,CACR,EAEA,GAAIX,EAAM,MAAM,MAAM,OAAS,EAAI,CAC/B,CACI,SAAU,eAAeW,CAAG,aAC5B,QAAS,CAEL,OAAQ,6BACR,uBAAQ,SAGR,+FAAA,CAAA,CACJ,EACA,SAAU,OACV,kBAAmB,CAAC,eAAeA,CAAG,YAAY,CACtD,CAAA,EAEA,CAAC,EAGD,CACI,SAAU,eAAeA,CAAG,mBAC5B,QAAS,CAEL,OAAQ,yBACR,uBAAQ,SAGR,6HAAA,CAAA,CACJ,EACA,SAAU,KACd,CACJ,CAIR,EAQMM,EAAoB,CAEtB,CACI,SAAU,uCACV,QAAS,CAEL,OAAQ,2BACR,KAAM,iDACV,CACJ,EACA,CACI,SAAU,4BACV,QAAS,CAEL,OAAQ,cACR,KAAQV,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,kGAAA,EAAgG,CAClJ,CACJ,EACA,CACI,SAAU,wBACV,QAAS,CAEL,OAAQ,sBACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,sEAAA,EACjC,CACjB,CACJ,EACA,CACI,SAAU,0BACV,QAAS,CAEL,OAAQ,YACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,yDAAA,EAAuD,CACzG,CACJ,EACA,CACI,SAAU,+BACV,QAAS,CAEL,OAAQ,UACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,2FAAA,EAAyF,CAC3I,CACJ,EACA,CACI,SAAU,+BACV,QAAS,CAEL,OAAQ,iBACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,uDAAA,EAAqD,CACvG,CACJ,EACA,CACI,SAAU,8BACV,QAAS,CAEL,OAAQ,oBACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,6GAAA,EAC9C,CACJ,EACA,SAAU,OACd,EACA,CACI,SAAU,mCACV,QAAS,CAEL,OAAQ,qBACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,yEAAA,EAC9C,CACJ,EACA,SAAU,OACd,EACA,CACI,SAAU,+BACV,QAAS,CAEL,OAAQ,sBACR,KAAM,wGACV,EACA,SAAU,OACd,EACA,CACI,SAAU,+BACV,QAAS,CAEL,OAAQ,UACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,uHAAA,EAE9C,CACJ,EACA,SAAU,OACd,EAEA,CACI,SAAU,6BACV,QAAS,CAEL,OAAQ,yBACR,KACIU,EAAA,KAAC,MAAI,CAAA,UAAU,uBACX,SAAA,CAAAE,EAAA,IAACZ,EAAiB,EAAA,EACjBY,EAAA,IAAA,MAAA,CAAI,UAAU,wBAAwB,SAEvC,sEAAA,QACC,MAAI,CAAA,UAAU,yBACX,SAACF,EAAA,KAAA,KAAA,CAAG,UAAU,+FACV,SAAA,CAAAA,OAAC,KAAG,CAAA,SAAA,CAACE,EAAA,IAAA,OAAA,CAAK,UAAU,aAAa,SAAa,gBAAA,EAAO,2EAAA,EAErD,SACC,KAAG,CAAA,SAAA,CAACA,EAAA,IAAA,OAAA,CAAK,UAAU,cAAc,SAAW,cAAA,EAAO,wEAAA,EAEpD,SACC,KAAG,CAAA,SAAA,CAACA,EAAA,IAAA,OAAA,CAAK,UAAU,aAAa,SAAa,gBAAA,EAAO,mEAAA,EAErD,CAAA,CAAA,CACJ,CACJ,CAAA,CAAA,EACJ,CACR,EACA,SAAU,MAEd,CACJ,EAGaS,EAAyB,CAClC,CACI,SAAU,6BACV,QAAS,CAEL,OAAQ,4BACR,KACIX,EAAA,KAAAC,WAAA,CAAA,SAAA,CAACC,EAAAA,IAAAZ,EAAA,CAAkB,UAAU,MAAM,CAAA,EAAE,mDACWY,EAAA,IAAC,OAAA,CACjD,UAAU,kBAAkB,SAAA,gBAAA,CAAc,EAAO,gDAAA,EAErD,CACJ,EACA,SAAU,CAACU,EAAeC,IAAa,OAC/B,IAAAC,EACA,SAAS,eAAe,gCAAgC,EACxDC,GAAKT,EAAAQ,GAAA,YAAAA,EAAY,aAAZ,YAAAR,EAAwB,cAAc,8BAG/C,GAAIS,EAAI,CACA,IAAAC,EAAOD,EAAG,wBAEd,MAAO,CAAC,OAAOC,EAAK,EAAIA,EAAK,KAAK,EAAIJ,EAAc,MAAQI,EAAK,EAAIJ,EAAc,OAAS,EAAG,CACnG,CAEO,MAAA,KACX,EACA,QAAS,CACL,QAAS,CAAC,IAAK,EAAE,CACrB,CACJ,CACJ,ECrQMK,EAAW,CAAC,CAAE,KAAAC,KAEd,CAEF,KAAM,CAAC,KAAAC,EAAM,QAAAC,CAAO,EAAIC,EAAYC,CAAa,EAC3C,CAAE,UAAAC,EAAW,OAAAC,EAAQ,SAAAC,EAAU,YAAAC,EAAa,eAAAC,CAAA,EAAmBC,IAC/D,CAAE,UAAAhC,EAAW,WAAAiC,EAAY,aAAAC,EAAc,SAAUC,CAAA,EAAmBlC,IACpE,CAAC,aAAAmC,CAAY,EAAIX,EAAaY,GAAqBA,EAAM,GAAG,EAElEnC,EAAAA,UAAU,IAAM,6BAIZ,IAAIoC,GAAY7B,GAAAC,EAAAa,GAAA,YAAAA,EAAM,UAAN,YAAAb,EAAe,gBAAf,YAAAD,EAA8B,KAAcZ,GAAA,WACxD,QAAOa,EAAAb,GAAA,YAAAA,EAAO,WAAP,YAAAa,EAAiB,QAAS,KAAK6B,GAAA9B,EAAAZ,GAAA,YAAAA,EAAO,QAAP,YAAAY,EAAc,QAAd,YAAA8B,EAAqB,QAAS,CAAA,GAGnED,IACDA,GAAYE,GAAAD,EAAAhB,GAAA,YAAAA,EAAM,UAAN,YAAAgB,EAAe,cAAf,YAAAC,EAA4B,KAAc3C,GAAA,WAClD,QAAOa,EAAAb,GAAA,YAAAA,EAAO,WAAP,YAAAa,EAAiB,QAAS,KAAK6B,GAAA9B,EAAAZ,GAAA,YAAAA,EAAO,QAAP,YAAAY,EAAc,QAAd,YAAA8B,EAAqB,QAAS,CAAA,IAIxE,CAACD,KAAaG,GAAAC,EAAAnB,GAAA,YAAAA,EAAM,UAAN,YAAAmB,EAAe,gBAAf,MAAAD,EAA8B,WAAUE,GAAAC,EAAArB,GAAA,YAAAA,EAAM,UAAN,YAAAqB,EAAe,gBAAf,YAAAD,EAA8B,QAAS,IACjFL,EAAAf,EAAK,QAAQ,cAAc,CAAC,GAIxC,CAACe,KAAaO,GAAAC,EAAAvB,GAAA,YAAAA,EAAM,UAAN,YAAAuB,EAAe,cAAf,MAAAD,EAA4B,WAAUE,GAAAC,EAAAzB,GAAA,YAAAA,EAAM,UAAN,YAAAyB,EAAe,cAAf,YAAAD,EAA4B,QAAS,IAC7ET,EAAAf,EAAK,QAAQ,YAAY,CAAC,GAI1CM,GAAYA,EAAcoB,GAAA,CAElB,IAAAC,EACA,SAAS,eAAe,gCAAgC,EAiBrD,MAfK,CACR,GAAGpC,EACH,GAAIwB,EAAY/B,EAAW+B,CAAS,EAAI,CAAC,EACzC,GAAIhB,IAAS,SAAWP,EAAa,CAAC,CAAA,EACxC,IAAYoC,GAAA,OAEV,OAAID,IAEAC,EAAK,eAAiB,OAAOA,EAAK,UAAa,SAAWA,EAAK,SAAWA,EAAK,eAE/EA,EAAK,UAAWzC,EAAAwC,EAAS,aAAT,YAAAxC,EAAqB,cAAcyC,EAAK,iBAErDA,CAAA,CACV,CAEM,CACV,CAAA,EAEF,CAACf,EAAcN,CAAW,CAAC,EAK9B5B,EAAAA,UAAU,IAAM,CAEP0B,GACDG,EAAe,CAAC,CACpB,EAED,CAACK,CAAY,CAAC,EAEjBlC,EAAAA,UAAU,IAAM,CAERgC,GACeC,EAAAhC,EAAe,eAAgB,IAAI,CAAC,EAEpD2B,IAAgB,GACAK,EAAAhC,EAAe,YAAa,gBAAgB,CAAC,EAE7D2B,IAAgB,IACAK,EAAAhC,EAAe,YAAa,eAAe,CAAC,CAC/D,EACD,CAAC2B,CAAW,CAAC,EAGhB5B,EAAAA,UAAU,IAAM,CAAA,EAIb,CAAC0B,CAAM,CAAC,EAGX,MAAMwB,EAAe,IAAM,CACjB,MAAAC,EAAW,SAAS,eAAe,kCAAkC,EAEvEzB,GAAUyB,EACVA,EAAQ,MAAM,UAAY,SAEvBA,IAAiBA,EAAA,MAAM,UAAY,OAC1C,EAGJnD,OAAAA,EAAAA,UAAU,IAAM,CAER+B,IAAeL,IAEFwB,IACbzB,EAAUM,CAAU,EACxB,EAED,CAACA,CAAU,CAAC,EAEf/B,EAAAA,UAAU,IAAM,CAER+B,IAAeL,IAEFwB,IACEjB,EAAAmB,EAAmB,aAAc1B,CAAM,CAAC,EAC3D,EAED,CAACA,CAAM,CAAC,EAEFtB,EAAA,IAAAD,WAAA,CAAA,CAAA,CACb","x_google_ignoreList":[0]}
\ No newline at end of file
diff --git a/includes/admin/page-optimizer/dist-debug/assets/InitTour.DaMiyxQJ.js.map b/includes/admin/page-optimizer/dist-debug/assets/InitTour.DaMiyxQJ.js.map
deleted file mode 100644
index 847745485..000000000
--- a/includes/admin/page-optimizer/dist-debug/assets/InitTour.DaMiyxQJ.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"InitTour.DaMiyxQJ.js","sources":["../../node_modules/lucide-react/dist/esm/icons/mouse-pointer-click.js","../../src/components/tour/steps.tsx","../../src/components/tour/InitTour.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst MousePointerClick = createLucideIcon(\"MousePointerClick\", [\n [\"path\", { d: \"m9 9 5 12 1.8-5.2L21 14Z\", key: \"1b76lo\" }],\n [\"path\", { d: \"M7.2 2.2 8 5.1\", key: \"1cfko1\" }],\n [\"path\", { d: \"m5.1 8-2.9-.8\", key: \"1go3kf\" }],\n [\"path\", { d: \"M14 4.1 12 6\", key: \"ita8i4\" }],\n [\"path\", { d: \"m6 12-1.9 2\", key: \"mnht97\" }]\n]);\n\nexport { MousePointerClick as default };\n//# sourceMappingURL=mouse-pointer-click.js.map\n","import {StepType, useTour} from \"@reactour/tour\";\nimport React, {useEffect, useMemo, useState} from \"react\";\nimport {MousePointerClick} from \"lucide-react\";\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\nimport {setCommonState} from \"../../store/common/commonActions\";\nimport {useSelector} from \"react-redux\";\nimport {optimizerData} from \"../../store/app/appSelector\";\nimport {transformFileType} from \"lib/utils\";\nimport {position} from \"html2canvas/dist/types/css/property-descriptors/position\";\n\n\nconst TourAuditOpen = ({audit}: { audit: Audit }) => {\n\n const {dispatch, openAudits, activeTab} = useCommonDispatch()\n\n useEffect(() => {\n const isAuditOpen = openAudits.includes(audit.id);\n\n if (!isAuditOpen) {\n dispatch(setCommonState('openAudits', [...openAudits, audit.id]));\n }\n\n let activeAuditTab = audit.type === 'opportunity' ? 'opportunities' : audit.type\n\n if (activeAuditTab !== activeTab) {\n dispatch(setCommonState('activeTab',\n audit.type === 'opportunity' ? 'opportunities' : audit.type\n ));\n }\n\n }, [])\n\n\n\n return <>\n {\n }}\n className='mb-2'/>\n Click the \"Show Actions\" button to view detailed information on each\n performance audit and dive deeper.\n >\n}\n\nexport const AuditSteps = (audit: Audit): StepType[] => {\n\n let key = audit.id\n\n const hasControls = !!audit.files?.headings?.find(h => h.valueType === 'controls')\n\n let remainingSettings = audit\n .settings\n // @ts-ignore\n .filter(s => !audit.files?.grouped_items?.map(group => transformFileType(audit, group.type))\n .includes(s.category))\n\n\n return [\n {\n selector: `[data-tour=\"audit-${key}\"]`,\n content: {\n // @ts-ignore\n header: `Explore Individual Audits`,\n body: \n },\n position: \"left\",\n resizeObservables:\n [\n `[data-tour=\"audit-${key}\"]`,\n `[data-tour=\"audit-${key}-group-0\"]`,\n `[data-tour=\"audit-${key}\"] .audit-content`,\n ],\n },\n\n ...(audit.files.items.length > 0 ? [\n {\n selector: `[data-tour=\"${key}-group-0\"]`,\n content: {\n // @ts-ignore\n header: `Streamlined Audit Insights`,\n body: <>\n Within every audit, discover thoughtfully arranged details and actions. Clarity, made\n simple.\n >\n },\n position: \"left\",\n resizeObservables: [`[data-tour=\"${key}-group-0\"]`]\n },\n\n ] : []),\n\n ...[\n {\n selector: `[data-tour=\"${key}-group-0-table\"]`,\n content: {\n // @ts-ignore\n header: `Organizing Your Assets`,\n body: <>\n Explore the table to find resources and their associated actions.\n Properly organized to help improve your page performance.\n >\n },\n position: \"top\",\n }\n ],\n\n ];\n\n}\n\n\nlet getElement = (selector: string) => {\n\n return document.querySelector('[data-tour=\"switch-report-strategy\"]')\n}\n\nconst Steps: StepType[] = [\n\n {\n selector: '[data-tour=\"switch-report-strategy\"]',\n content: {\n // @ts-ignore\n header: 'Select Mobile or Desktop',\n body: 'Pick a device to analyze and optimize the page.'\n },\n },\n {\n selector: '[data-tour=\"current-url\"]',\n content: {\n // @ts-ignore\n header: `Current URL`,\n body: <> This is the URL currently selected to configure, optimize, and analyze your site's performance.>\n },\n },\n {\n selector: '[data-tour=\"analyze\"]',\n content: {\n // @ts-ignore\n header: `Refresh Speed Again`,\n body: <> Click to re-analyze the page speed using Google PageSpeed\n Insights.>\n },\n },\n {\n selector: '[data-tour=\"test-mode\"]',\n content: {\n // @ts-ignore\n header: `Test-Mode`,\n body: <> Enable this to keep RapidLoad changes from going live.>\n },\n },\n {\n selector: '[data-tour=\"preview-button\"]',\n content: {\n // @ts-ignore\n header: `Preview`,\n body: <> Click to see how the page looks after applying RapidLoad optimization before going live.>\n },\n },\n {\n selector: '[data-tour=\"speed-settings\"]',\n content: {\n // @ts-ignore\n header: `Speed Settings`,\n body: <> Configure the RapidLoad plugin with one-click gears.>\n },\n },\n {\n selector: '[data-tour=\"settings-gear\"]',\n content: {\n // @ts-ignore\n header: `Performance gears`,\n body: <> Select your Performance Mode: Starter, Accelerate, TurboMax, or Customize, to fine-tune your site's speed.\n >\n },\n position: \"right\"\n },\n {\n selector: '[data-tour=\"customize-settings\"]',\n content: {\n // @ts-ignore\n header: `Customize Settings`,\n body: <> Tailor your site's performance settings to your specific requirements.\n >\n },\n position: \"right\"\n },\n {\n selector: '[data-tour=\"speed-insights\"]',\n content: {\n // @ts-ignore\n header: `Your Speed Insights`,\n body: 'See your overall website\\'s speed rating, along with a breakdown of key metrics and performance scores.'\n },\n position: \"right\"\n },\n {\n selector: '[data-tour=\"expand-metrics\"]',\n content: {\n // @ts-ignore\n header: `Metrics`,\n body: <> \n Click on ”Expand Metrics” to identify individual metrics to uncover insights and get recommendations for enhancement.\n >\n },\n position: \"right\"\n },\n\n {\n selector: '[data-tour=\"audit-groups\"]',\n content: {\n // @ts-ignore\n header: `Dive into Audit Groups`,\n body:\n \n
\n
\n Click on each audit group to explore detailed insights and actions.\n
\n
\n
\n Opportunities Recommendations from\n Google to enhance your page's speed and efficiency.\n \n Diagnostics In-depth feedback about\n your site's performance and potential issues.\n \n Passed Audits Areas where your website\n meets or exceeds performance standards.\n \n \n
\n
\n },\n position: \"left\",\n\n }\n]\n\n\nexport const FinalSteps: StepType[] = [\n {\n selector: '[data-tour=\"save-changes\"]',\n content: {\n // @ts-ignore\n header: `Saving Your Optimizations`,\n body: <>\n \n After making changes, remember to save. Tap the \"Save Changes\" button to\n ensure all your tweaks are updated.\n >\n },\n position: (postionsProps, prevRect) => {\n let shadowRoot =\n document.getElementById('rapidload-optimizer-shadow-dom')\n let el = shadowRoot?.shadowRoot?.querySelector('[data-tour=\"save-changes\"]')\n\n\n if (el) {\n let rect = el.getBoundingClientRect()\n\n return [Number(rect.x + rect.width) - postionsProps.width , rect.y - postionsProps.height - 25 ];\n }\n\n return \"top\"\n },\n padding: {\n popover: [100, 25]\n },\n },\n]\n\n\n\nexport default Steps","import {AppAction, RootState} from \"../../store/app/appTypes\";\nimport {useDispatch, useSelector} from \"react-redux\";\nimport {useEffect, useState} from \"react\";\nimport Steps, {AuditSteps, FinalSteps} from \"components/tour/steps\";\nimport {setCommonRootState, setCommonState} from \"../../store/common/commonActions\";\nimport {optimizerData} from \"../../store/app/appSelector\";\nimport {useTour} from \"@reactour/tour\";\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\nimport {useAppContext} from \"../../context/app\";\n\nconst InitTour = ({ mode }: {\n mode: RapidLoadOptimizerModes\n}) => {\n\n const {data, loading} = useSelector(optimizerData);\n const { setIsOpen, isOpen, setSteps, currentStep, setCurrentStep } = useTour()\n const { activeTab, isTourOpen, activeMetric, dispatch: commonDispatch } = useCommonDispatch()\n const {activeReport} = useSelector((state: RootState) => state.app);\n\n useEffect(() => {\n\n let hasActions = true;\n\n let tourAudit = data?.grouped?.opportunities?.find(audit => {\n return audit?.settings?.length > 0 && audit?.files?.items?.length > 0;\n });\n\n if (!tourAudit) {\n tourAudit = data?.grouped?.diagnostics?.find(audit => {\n return audit?.settings?.length > 0 && audit?.files?.items?.length > 0;\n });\n }\n\n if (!tourAudit && data?.grouped?.opportunities?.length && data?.grouped?.opportunities?.length > 0) {\n tourAudit = data.grouped.opportunities[0];\n hasActions = false;\n }\n\n if (!tourAudit && data?.grouped?.diagnostics?.length && data?.grouped?.diagnostics?.length > 0) {\n tourAudit = data.grouped.diagnostics[0];\n hasActions = false;\n }\n\n setSteps && setSteps(p => {\n\n let selector =\n document.getElementById('rapidload-optimizer-shadow-dom');\n\n let steps = [\n ...Steps,\n ...(tourAudit ? AuditSteps(tourAudit) : []),\n ...(mode === 'normal' ? FinalSteps : [])\n ].map(step => {\n\n if (selector) {\n // @ts-ignore\n step.shadowSelector = typeof step.selector === 'string' ? step.selector : step.shadowSelector;\n // @ts-ignore\n step.selector = selector.shadowRoot?.querySelector(step.shadowSelector);\n }\n return step;\n });\n\n return steps;\n });\n\n }, [activeReport, currentStep]);\n\n\n\n\n useEffect(() => {\n\n if (!isOpen) {\n setCurrentStep(0);\n }\n\n }, [activeReport])\n\n useEffect(() => {\n\n if (activeMetric) {\n commonDispatch(setCommonState('activeMetric', null))\n }\n if(currentStep === 6){\n commonDispatch(setCommonState('activeTab', 'configurations'))\n }\n if(currentStep === 10){\n commonDispatch(setCommonState('activeTab', 'opportunities'))\n }\n }, [currentStep])\n\n\n useEffect(() => {\n\n\n\n }, [isOpen])\n\n\n const onOpenChange = () => {\n const content = document.getElementById('rapidload-page-optimizer-content')\n\n if (isOpen && content) {\n content.style.overflowY = 'hidden'\n } else {\n if(content) content.style.overflowY = 'auto'\n }\n }\n\n useEffect(() => {\n\n if (isTourOpen !== isOpen) {\n\n onOpenChange()\n setIsOpen(isTourOpen);\n }\n\n }, [isTourOpen])\n\n useEffect(() => {\n\n if (isTourOpen !== isOpen) {\n\n onOpenChange()\n commonDispatch(setCommonRootState('isTourOpen', isOpen))\n }\n\n }, [isOpen])\n\n return <>>\n}\n\nexport default InitTour"],"names":["MousePointerClick","createLucideIcon","TourAuditOpen","audit","dispatch","openAudits","activeTab","useCommonDispatch","useEffect","setCommonState","jsxs","Fragment","jsx","AuditSteps","key","_b","_a","h","transformFileType","group","Steps","FinalSteps","postionsProps","prevRect","shadowRoot","el","rect","InitTour","mode","data","loading","useSelector","optimizerData","setIsOpen","isOpen","setSteps","currentStep","setCurrentStep","useTour","isTourOpen","activeMetric","commonDispatch","activeReport","state","tourAudit","_c","_d","_f","_e","_h","_g","_j","_i","_l","_k","p","selector","step","onOpenChange","content","setCommonRootState"],"mappings":"kPAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASA,MAAMA,EAAoBC,EAAiB,oBAAqB,CAC9D,CAAC,OAAQ,CAAE,EAAG,2BAA4B,IAAK,QAAQ,CAAE,EACzD,CAAC,OAAQ,CAAE,EAAG,iBAAkB,IAAK,QAAQ,CAAE,EAC/C,CAAC,OAAQ,CAAE,EAAG,gBAAiB,IAAK,QAAQ,CAAE,EAC9C,CAAC,OAAQ,CAAE,EAAG,eAAgB,IAAK,QAAQ,CAAE,EAC7C,CAAC,OAAQ,CAAE,EAAG,cAAe,IAAK,QAAQ,CAAE,CAC9C,CAAC,ECJKC,EAAgB,CAAC,CAAC,MAAAC,KAA6B,CAEjD,KAAM,CAAC,SAAAC,EAAU,WAAAC,EAAY,UAAAC,GAAaC,EAAkB,EAE5DC,OAAAA,EAAAA,UAAU,IAAM,CACQH,EAAW,SAASF,EAAM,EAAE,GAGnCC,EAAAK,EAAe,aAAc,CAAC,GAAGJ,EAAYF,EAAM,EAAE,CAAC,CAAC,GAG/CA,EAAM,OAAS,cAAgB,gBAAkBA,EAAM,QAErDG,GACVF,EAAAK,EAAe,YACpBN,EAAM,OAAS,cAAgB,gBAAkBA,EAAM,IAAA,CAC1D,CAGT,EAAG,CAAE,CAAA,EAKDO,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAAC,EAAA,IAACZ,EAAA,CACG,QAAS,IAAM,CACf,EACA,UAAU,MAAA,CAAM,EAAE,aACXY,EAAA,IAAA,OAAA,CAAK,UAAU,kBAAkB,SAAc,iBAAA,EAAO,iFAErE,CAAA,CAAA,CACJ,EAEaC,EAAcV,GAA6B,SAEpD,IAAIW,EAAMX,EAAM,GAEI,OAAEY,GAAAC,EAAAb,EAAM,QAAN,YAAAa,EAAa,WAAb,MAAAD,EAAuB,KAAKE,GAAKA,EAAE,YAAc,YAE/Cd,EACnB,SAEA,UAAY,SAAA,SAACY,GAAAC,EAAAb,EAAM,QAAN,YAAAa,EAAa,gBAAb,MAAAD,EAA4B,OAAaG,EAAkBf,EAAOgB,EAAM,IAAI,GACrF,SAAS,EAAE,WAAS,EAGtB,CACH,CACI,SAAU,qBAAqBL,CAAG,KAClC,QAAS,CAEL,OAAQ,4BACR,KAAOF,EAAA,IAAAV,EAAA,CAAc,MAAAC,CAAa,CAAA,CACtC,EACA,SAAU,OACV,kBACI,CACI,qBAAqBW,CAAG,KACxB,qBAAqBA,CAAG,aACxB,qBAAqBA,CAAG,mBAC5B,CACR,EAEA,GAAIX,EAAM,MAAM,MAAM,OAAS,EAAI,CAC/B,CACI,SAAU,eAAeW,CAAG,aAC5B,QAAS,CAEL,OAAQ,6BACR,uBAAQ,SAGR,+FAAA,CAAA,CACJ,EACA,SAAU,OACV,kBAAmB,CAAC,eAAeA,CAAG,YAAY,CACtD,CAAA,EAEA,CAAC,EAGD,CACI,SAAU,eAAeA,CAAG,mBAC5B,QAAS,CAEL,OAAQ,yBACR,uBAAQ,SAGR,6HAAA,CAAA,CACJ,EACA,SAAU,KACd,CACJ,CAIR,EAQMM,EAAoB,CAEtB,CACI,SAAU,uCACV,QAAS,CAEL,OAAQ,2BACR,KAAM,iDACV,CACJ,EACA,CACI,SAAU,4BACV,QAAS,CAEL,OAAQ,cACR,KAAQV,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,kGAAA,EAAgG,CAClJ,CACJ,EACA,CACI,SAAU,wBACV,QAAS,CAEL,OAAQ,sBACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,sEAAA,EACjC,CACjB,CACJ,EACA,CACI,SAAU,0BACV,QAAS,CAEL,OAAQ,YACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,yDAAA,EAAuD,CACzG,CACJ,EACA,CACI,SAAU,+BACV,QAAS,CAEL,OAAQ,UACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,2FAAA,EAAyF,CAC3I,CACJ,EACA,CACI,SAAU,+BACV,QAAS,CAEL,OAAQ,iBACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,uDAAA,EAAqD,CACvG,CACJ,EACA,CACI,SAAU,8BACV,QAAS,CAEL,OAAQ,oBACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,6GAAA,EAC9C,CACJ,EACA,SAAU,OACd,EACA,CACI,SAAU,mCACV,QAAS,CAEL,OAAQ,qBACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,yEAAA,EAC9C,CACJ,EACA,SAAU,OACd,EACA,CACI,SAAU,+BACV,QAAS,CAEL,OAAQ,sBACR,KAAM,wGACV,EACA,SAAU,OACd,EACA,CACI,SAAU,+BACV,QAAS,CAEL,OAAQ,UACR,KAAQU,EAAA,KAAAC,WAAA,CAAA,SAAA,CAAA,IAACC,EAAAA,IAACZ,EAAkB,CAAA,UAAU,MAAM,CAAA,EAAE,uHAAA,EAE9C,CACJ,EACA,SAAU,OACd,EAEA,CACI,SAAU,6BACV,QAAS,CAEL,OAAQ,yBACR,KACIU,EAAA,KAAC,MAAI,CAAA,UAAU,uBACX,SAAA,CAAAE,EAAA,IAACZ,EAAiB,EAAA,EACjBY,EAAA,IAAA,MAAA,CAAI,UAAU,wBAAwB,SAEvC,sEAAA,QACC,MAAI,CAAA,UAAU,yBACX,SAACF,EAAA,KAAA,KAAA,CAAG,UAAU,+FACV,SAAA,CAAAA,OAAC,KAAG,CAAA,SAAA,CAACE,EAAA,IAAA,OAAA,CAAK,UAAU,aAAa,SAAa,gBAAA,EAAO,2EAAA,EAErD,SACC,KAAG,CAAA,SAAA,CAACA,EAAA,IAAA,OAAA,CAAK,UAAU,cAAc,SAAW,cAAA,EAAO,wEAAA,EAEpD,SACC,KAAG,CAAA,SAAA,CAACA,EAAA,IAAA,OAAA,CAAK,UAAU,aAAa,SAAa,gBAAA,EAAO,mEAAA,EAErD,CAAA,CAAA,CACJ,CACJ,CAAA,CAAA,EACJ,CACR,EACA,SAAU,MAEd,CACJ,EAGaS,EAAyB,CAClC,CACI,SAAU,6BACV,QAAS,CAEL,OAAQ,4BACR,KACIX,EAAA,KAAAC,WAAA,CAAA,SAAA,CAACC,EAAAA,IAAAZ,EAAA,CAAkB,UAAU,MAAM,CAAA,EAAE,mDACWY,EAAA,IAAC,OAAA,CACjD,UAAU,kBAAkB,SAAA,gBAAA,CAAc,EAAO,gDAAA,EAErD,CACJ,EACA,SAAU,CAACU,EAAeC,IAAa,OAC/B,IAAAC,EACA,SAAS,eAAe,gCAAgC,EACxDC,GAAKT,EAAAQ,GAAA,YAAAA,EAAY,aAAZ,YAAAR,EAAwB,cAAc,8BAG/C,GAAIS,EAAI,CACA,IAAAC,EAAOD,EAAG,wBAEd,MAAO,CAAC,OAAOC,EAAK,EAAIA,EAAK,KAAK,EAAIJ,EAAc,MAAQI,EAAK,EAAIJ,EAAc,OAAS,EAAG,CACnG,CAEO,MAAA,KACX,EACA,QAAS,CACL,QAAS,CAAC,IAAK,EAAE,CACrB,CACJ,CACJ,ECrQMK,EAAW,CAAC,CAAE,KAAAC,KAEd,CAEF,KAAM,CAAC,KAAAC,EAAM,QAAAC,CAAO,EAAIC,EAAYC,CAAa,EAC3C,CAAE,UAAAC,EAAW,OAAAC,EAAQ,SAAAC,EAAU,YAAAC,EAAa,eAAAC,CAAA,EAAmBC,IAC/D,CAAE,UAAAhC,EAAW,WAAAiC,EAAY,aAAAC,EAAc,SAAUC,CAAA,EAAmBlC,IACpE,CAAC,aAAAmC,CAAY,EAAIX,EAAaY,GAAqBA,EAAM,GAAG,EAElEnC,EAAAA,UAAU,IAAM,6BAIZ,IAAIoC,GAAY7B,GAAAC,EAAAa,GAAA,YAAAA,EAAM,UAAN,YAAAb,EAAe,gBAAf,YAAAD,EAA8B,KAAcZ,GAAA,WACxD,QAAOa,EAAAb,GAAA,YAAAA,EAAO,WAAP,YAAAa,EAAiB,QAAS,KAAK6B,GAAA9B,EAAAZ,GAAA,YAAAA,EAAO,QAAP,YAAAY,EAAc,QAAd,YAAA8B,EAAqB,QAAS,CAAA,GAGnED,IACDA,GAAYE,GAAAD,EAAAhB,GAAA,YAAAA,EAAM,UAAN,YAAAgB,EAAe,cAAf,YAAAC,EAA4B,KAAc3C,GAAA,WAClD,QAAOa,EAAAb,GAAA,YAAAA,EAAO,WAAP,YAAAa,EAAiB,QAAS,KAAK6B,GAAA9B,EAAAZ,GAAA,YAAAA,EAAO,QAAP,YAAAY,EAAc,QAAd,YAAA8B,EAAqB,QAAS,CAAA,IAIxE,CAACD,KAAaG,GAAAC,EAAAnB,GAAA,YAAAA,EAAM,UAAN,YAAAmB,EAAe,gBAAf,MAAAD,EAA8B,WAAUE,GAAAC,EAAArB,GAAA,YAAAA,EAAM,UAAN,YAAAqB,EAAe,gBAAf,YAAAD,EAA8B,QAAS,IACjFL,EAAAf,EAAK,QAAQ,cAAc,CAAC,GAIxC,CAACe,KAAaO,GAAAC,EAAAvB,GAAA,YAAAA,EAAM,UAAN,YAAAuB,EAAe,cAAf,MAAAD,EAA4B,WAAUE,GAAAC,EAAAzB,GAAA,YAAAA,EAAM,UAAN,YAAAyB,EAAe,cAAf,YAAAD,EAA4B,QAAS,IAC7ET,EAAAf,EAAK,QAAQ,YAAY,CAAC,GAI1CM,GAAYA,EAAcoB,GAAA,CAElB,IAAAC,EACA,SAAS,eAAe,gCAAgC,EAiBrD,MAfK,CACR,GAAGpC,EACH,GAAIwB,EAAY/B,EAAW+B,CAAS,EAAI,CAAC,EACzC,GAAIhB,IAAS,SAAWP,EAAa,CAAC,CAAA,EACxC,IAAYoC,GAAA,OAEV,OAAID,IAEAC,EAAK,eAAiB,OAAOA,EAAK,UAAa,SAAWA,EAAK,SAAWA,EAAK,eAE/EA,EAAK,UAAWzC,EAAAwC,EAAS,aAAT,YAAAxC,EAAqB,cAAcyC,EAAK,iBAErDA,CAAA,CACV,CAEM,CACV,CAAA,EAEF,CAACf,EAAcN,CAAW,CAAC,EAK9B5B,EAAAA,UAAU,IAAM,CAEP0B,GACDG,EAAe,CAAC,CACpB,EAED,CAACK,CAAY,CAAC,EAEjBlC,EAAAA,UAAU,IAAM,CAERgC,GACeC,EAAAhC,EAAe,eAAgB,IAAI,CAAC,EAEpD2B,IAAgB,GACAK,EAAAhC,EAAe,YAAa,gBAAgB,CAAC,EAE7D2B,IAAgB,IACAK,EAAAhC,EAAe,YAAa,eAAe,CAAC,CAC/D,EACD,CAAC2B,CAAW,CAAC,EAGhB5B,EAAAA,UAAU,IAAM,CAAA,EAIb,CAAC0B,CAAM,CAAC,EAGX,MAAMwB,EAAe,IAAM,CACjB,MAAAC,EAAW,SAAS,eAAe,kCAAkC,EAEvEzB,GAAUyB,EACVA,EAAQ,MAAM,UAAY,SAEvBA,IAAiBA,EAAA,MAAM,UAAY,OAC1C,EAGJnD,OAAAA,EAAAA,UAAU,IAAM,CAER+B,IAAeL,IAEFwB,IACbzB,EAAUM,CAAU,EACxB,EAED,CAACA,CAAU,CAAC,EAEf/B,EAAAA,UAAU,IAAM,CAER+B,IAAeL,IAEFwB,IACEjB,EAAAmB,EAAmB,aAAc1B,CAAM,CAAC,EAC3D,EAED,CAACA,CAAM,CAAC,EAEFtB,EAAA,IAAAD,WAAA,CAAA,CAAA,CACb","x_google_ignoreList":[0]}
\ No newline at end of file
diff --git a/includes/admin/page-optimizer/dist/assets/index.UfvjoQdb.css b/includes/admin/page-optimizer/dist-debug/assets/index.CaxZkPzF.css
similarity index 55%
rename from includes/admin/page-optimizer/dist/assets/index.UfvjoQdb.css
rename to includes/admin/page-optimizer/dist-debug/assets/index.CaxZkPzF.css
index fcbe718d1..5b5ee9248 100644
--- a/includes/admin/page-optimizer/dist/assets/index.UfvjoQdb.css
+++ b/includes/admin/page-optimizer/dist-debug/assets/index.CaxZkPzF.css
@@ -1 +1 @@
-*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:Inter Variable,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:host,:root{--reactour-accent: #0e172a;--background: 0 0% 100%;--foreground: 240 10% 3.92%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.92%;--card: 0 0% 100%;--card-foreground: 240 10% 3.92%;--border: 0 0% 88%;--input: 214.3 31.8% 91.4%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--accent: 0 0% 93%;--accent-foreground: 0 0% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--ring: 215 20.2% 65.1%;--radius: .5rem}.rapidload-dark{--reactour-accent: #fafafa;--background: 240 10% 3.92%;--foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--popover: 240 10% 3.92%;--popover-foreground: 210 40% 98%;--card: 240 10% 3.92%;--card-foreground: 210 40% 98%;--border: 0 0% 12%;--input:0 0% 12%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--accent-foreground: 0 0% 93%;--accent: 0 0% 11.2%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 85.7% 97.3%;--ring: 217.2 32.6% 17.5%}*{border-color:hsl(var(--border))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-inset-\[3px\]{top:-3px;right:-3px;bottom:-3px;left:-3px}.inset-0{top:0;right:0;bottom:0;left:0}.-bottom-1{bottom:-4px}.-left-0\.5{left:-2px}.-left-4{left:-16px}.-left-7{left:-28px}.-right-1{right:-4px}.-top-0\.5{top:-2px}.-top-1{top:-4px}.-top-3{top:-12px}.bottom-0{bottom:0}.left-0{left:0}.left-0\.5{left:2px}.left-1\/2{left:50%}.left-2{left:8px}.left-7{left:28px}.left-\[110px\]{left:110px}.left-\[50\%\]{left:50%}.left-\[72px\]{left:72px}.right-0\.5{right:2px}.right-2{right:8px}.right-4{right:16px}.top-0{top:0}.top-0\.5{top:2px}.top-1\/2{top:50%}.top-2{top:8px}.top-2\.5{top:10px}.top-3{top:12px}.top-4{top:16px}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[69px\]{top:69px}.z-10{z-index:10}.z-50{z-index:50}.z-\[-1\]{z-index:-1}.z-\[100000\]{z-index:100000}.z-\[100001\]{z-index:100001}.z-\[110000\]{z-index:110000}.z-\[110001\]{z-index:110001}.z-\[110002\]{z-index:110002}.z-\[120000\]{z-index:120000}.z-\[150000\]{z-index:150000}.z-\[1\]{z-index:1}.z-\[99999\]{z-index:99999}.col-span-12{grid-column:span 12 / span 12}.-mx-1{margin-left:-4px;margin-right:-4px}.-mx-4{margin-left:-16px;margin-right:-16px}.-mx-\[22px\]{margin-left:-22px;margin-right:-22px}.mx-1\.5{margin-left:6px;margin-right:6px}.mx-16{margin-left:64px;margin-right:64px}.mx-5{margin-left:20px;margin-right:20px}.mx-6{margin-left:24px;margin-right:24px}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:4px;margin-bottom:4px}.my-2{margin-top:8px;margin-bottom:8px}.my-3{margin-top:12px;margin-bottom:12px}.-mb-2{margin-bottom:-8px}.-mb-2\.5{margin-bottom:-10px}.-ml-1{margin-left:-4px}.-ml-6{margin-left:-24px}.-mr-0\.5{margin-right:-2px}.-mt-0\.5{margin-top:-2px}.-mt-1{margin-top:-4px}.-mt-2{margin-top:-8px}.-mt-4{margin-top:-16px}.-mt-\[1px\]{margin-top:-1px}.-mt-\[70px\]{margin-top:-70px}.mb-0{margin-bottom:0}.mb-1{margin-bottom:4px}.mb-1\.5{margin-bottom:6px}.mb-2{margin-bottom:8px}.mb-24{margin-bottom:96px}.mb-3{margin-bottom:12px}.mb-3\.5{margin-bottom:14px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:20px}.mb-6{margin-bottom:24px}.mb-8{margin-bottom:32px}.ml-1\.5{margin-left:6px}.ml-10{margin-left:40px}.ml-12{margin-left:48px}.ml-14{margin-left:56px}.ml-2{margin-left:8px}.ml-28{margin-left:112px}.ml-3{margin-left:12px}.ml-4{margin-left:16px}.ml-5{margin-left:20px}.ml-6{margin-left:24px}.ml-7{margin-left:28px}.ml-8{margin-left:32px}.ml-9{margin-left:36px}.ml-auto{margin-left:auto}.mr-0\.5{margin-right:2px}.mr-1{margin-right:4px}.mr-1\.5{margin-right:6px}.mr-2{margin-right:8px}.mt-0\.5{margin-top:2px}.mt-1{margin-top:4px}.mt-12{margin-top:48px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}.mt-\[1px\]{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:6px}.h-10{height:40px}.h-11{height:44px}.h-12{height:48px}.h-14{height:56px}.h-2{height:8px}.h-2\.5{height:10px}.h-3{height:12px}.h-3\.5{height:14px}.h-4{height:16px}.h-44{height:176px}.h-5{height:20px}.h-6{height:24px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\[176px\]{height:176px}.h-\[18px\]{height:18px}.h-\[20px\]{height:20px}.h-\[35px\]{height:35px}.h-\[36px\]{height:36px}.h-\[44px\]{height:44px}.h-\[48px\]{height:48px}.h-\[50px\]{height:50px}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-fit{height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[176px\]{max-height:176px}.max-h-\[300px\]{max-height:300px}.max-h-screen{max-height:100vh}.min-h-\[166px\]{min-height:166px}.min-h-\[280px\]{min-height:280px}.min-h-\[295px\]{min-height:295px}.min-h-\[32px\]{min-height:32px}.min-h-\[380px\]{min-height:380px}.min-h-\[56px\]{min-height:56px}.min-h-screen{min-height:100vh}.w-1\.5{width:6px}.w-10{width:40px}.w-12{width:48px}.w-16{width:64px}.w-2{width:8px}.w-2\.5{width:10px}.w-24{width:96px}.w-3{width:12px}.w-3\.5{width:14px}.w-36{width:144px}.w-4{width:16px}.w-44{width:176px}.w-48{width:192px}.w-5{width:20px}.w-52{width:208px}.w-56{width:224px}.w-6{width:24px}.w-60{width:240px}.w-64{width:256px}.w-7{width:28px}.w-72{width:288px}.w-8{width:32px}.w-9{width:36px}.w-\[110px\]{width:110px}.w-\[118px\]{width:118px}.w-\[130px\]{width:130px}.w-\[180px\]{width:180px}.w-\[18px\]{width:18px}.w-\[200px\]{width:200px}.w-\[20px\]{width:20px}.w-\[35px\]{width:35px}.w-\[36px\]{width:36px}.w-\[55px\]{width:55px}.w-\[70px\]{width:70px}.w-\[78px\]{width:78px}.w-fit{width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.min-w-\[125px\]{min-width:125px}.min-w-\[166px\]{min-width:166px}.min-w-\[200px\]{min-width:200px}.min-w-\[310px\]{min-width:310px}.min-w-\[32px\]{min-width:32px}.min-w-\[350px\]{min-width:350px}.min-w-\[565px\]{min-width:565px}.min-w-\[580px\]{min-width:580px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-max{min-width:max-content}.max-w-\[160px\]{max-width:160px}.max-w-\[200px\]{max-width:200px}.max-w-\[350px\]{max-width:350px}.max-w-\[520px\]{max-width:520px}.max-w-\[768px\]{max-width:768px}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.-translate-x-1{--tw-translate-x: -4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\/2{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-180{--tw-rotate: -180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90,.rotate-\[90deg\]{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce-horizontal{0%,20%,50%,80%,to{transform:translate(0)}40%{transform:translate(-5px)}60%{transform:translate(3px)}}.animate-bounce-horizontal{animation:bounce-horizontal 1.5s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rl-loading-loop{0%,to{transform:translate(-50%)}50%{transform:translate(250%)}}.animate-rl-loading-loop{animation:rl-loading-loop 1.8s ease-out infinite}@keyframes rl-scale-in{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.animate-rl-scale-in{animation:rl-scale-in .1s ease-out}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-auto{cursor:auto}.cursor-default{cursor:default}.cursor-no-drop{cursor:no-drop}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;user-select:none}.scroll-m-28{scroll-margin:112px}.list-disc{list-style-type:disc}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-none{grid-template-columns:none}.grid-rows-3{grid-template-rows:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-0\.5{gap:2px}.gap-1{gap:4px}.gap-1\.5{gap:6px}.gap-12{gap:48px}.gap-2{gap:8px}.gap-2\.5{gap:10px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-6{gap:24px}.gap-8{gap:32px}.gap-\[1px\]{gap:1px}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}.space-x-px>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1px * var(--tw-space-x-reverse));margin-left:calc(1px * calc(1 - var(--tw-space-x-reverse)))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(6px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(6px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(20px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(20px * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:4px}.rounded-2xl{border-radius:16px}.rounded-3xl{border-radius:24px}.rounded-\[14px\]{border-radius:14px}.rounded-\[15px\]{border-radius:15px}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-\[40px\]{border-radius:40px}.rounded-\[50px\]{border-radius:50px}.rounded-\[8px\]{border-radius:8px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:6px}.rounded-none{border-radius:0}.rounded-sm{border-radius:2px}.rounded-xl{border-radius:12px}.rounded-b-xl{border-bottom-right-radius:12px;border-bottom-left-radius:12px}.rounded-t-lg{border-top-left-radius:8px;border-top-right-radius:8px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-tl-lg{border-top-left-radius:8px}.rounded-tl-none{border-top-left-radius:0}.rounded-tr-lg{border-top-right-radius:8px}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-\[3px\]{border-width:3px}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-r-0{border-right-width:0px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[\#f7b250\]{--tw-border-opacity: 1;border-color:rgb(247 178 80 / var(--tw-border-opacity))}.border-amber-500\/80{border-color:#f59e0bcc}.border-amber-600{--tw-border-opacity: 1;border-color:rgb(217 119 6 / var(--tw-border-opacity))}.border-brand-200{--tw-border-opacity: 1;border-color:rgb(228 228 231 / var(--tw-border-opacity))}.border-brand-200\/50{border-color:#e4e4e780}.border-brand-200\/60{border-color:#e4e4e799}.border-brand-200\/80{border-color:#e4e4e7cc}.border-brand-400\/60{border-color:#a1a1aa99}.border-brand-500\/20{border-color:#71717a33}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity))}.border-input{border-color:hsl(var(--input))}.border-orange-400{--tw-border-opacity: 1;border-color:rgb(251 146 60 / var(--tw-border-opacity))}.border-purple-300{--tw-border-opacity: 1;border-color:rgb(216 180 254 / var(--tw-border-opacity))}.border-purple-700{--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.border-rose-600{--tw-border-opacity: 1;border-color:rgb(225 29 72 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(250 204 21 / var(--tw-border-opacity))}.border-zinc-300\/30{border-color:#d4d4d84d}.border-zinc-600{--tw-border-opacity: 1;border-color:rgb(82 82 91 / var(--tw-border-opacity))}.border-b-white{--tw-border-opacity: 1;border-bottom-color:rgb(255 255 255 / var(--tw-border-opacity))}.bg-\[\#7F54B3\]{--tw-bg-opacity: 1;background-color:rgb(127 84 179 / var(--tw-bg-opacity))}.bg-\[\#f7b250\]{--tw-bg-opacity: 1;background-color:rgb(247 178 80 / var(--tw-bg-opacity))}.bg-amber-300\/30{background-color:#fcd34d4d}.bg-amber-500\/80{background-color:#f59e0bcc}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-brand-0{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-brand-0\/70{background-color:#ffffffb3}.bg-brand-100{--tw-bg-opacity: 1;background-color:rgb(244 244 245 / var(--tw-bg-opacity))}.bg-brand-100\/20{background-color:#f4f4f533}.bg-brand-100\/30{background-color:#f4f4f54d}.bg-brand-100\/50{background-color:#f4f4f580}.bg-brand-100\/60{background-color:#f4f4f599}.bg-brand-100\/80{background-color:#f4f4f5cc}.bg-brand-100\/90{background-color:#f4f4f5e6}.bg-brand-200{--tw-bg-opacity: 1;background-color:rgb(228 228 231 / var(--tw-bg-opacity))}.bg-brand-200\/50{background-color:#e4e4e780}.bg-brand-200\/60{background-color:#e4e4e799}.bg-brand-200\/80{background-color:#e4e4e7cc}.bg-brand-300{--tw-bg-opacity: 1;background-color:rgb(212 212 216 / var(--tw-bg-opacity))}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity))}.bg-brand-50\/50{background-color:#fafafa80}.bg-brand-50\/75{background-color:#fafafabf}.bg-brand-50\/80{background-color:#fafafacc}.bg-brand-700{--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.bg-green-200{--tw-bg-opacity: 1;background-color:rgb(187 247 208 / var(--tw-bg-opacity))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity))}.bg-purple-50\/60{background-color:#faf5ff99}.bg-purple-700\/30{background-color:#7e22ce4d}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-violet-100{--tw-bg-opacity: 1;background-color:rgb(237 233 254 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity))}.bg-zinc-200{--tw-bg-opacity: 1;background-color:rgb(228 228 231 / var(--tw-bg-opacity))}.bg-cover{background-size:cover}.bg-center{background-position:center}.fill-amber-500{fill:#f59e0b}.fill-blue-500{fill:#3b82f6}.fill-brand-300{fill:#d4d4d8}.fill-brand-600{fill:#52525b}.fill-current{fill:currentColor}.fill-green-600{fill:#16a34a}.fill-orange-500{fill:#f97316}.fill-orange-600{fill:#ea580c}.fill-red-500{fill:#ef4444}.fill-red-600{fill:#dc2626}.fill-rose-500{fill:#f43f5e}.fill-rose-600{fill:#e11d48}.fill-yellow-400{fill:#facc15}.stroke-brand-300{stroke:#d4d4d8}.stroke-brand-300\/50{stroke:#d4d4d880}.stroke-brand-300\/90{stroke:#d4d4d8e6}.stroke-none{stroke:none}.stroke-purple-600\/10{stroke:#9333ea1a}.stroke-purple-800\/10{stroke:#6b21a81a}.stroke-0{stroke-width:0}.stroke-1{stroke-width:1}.p-0{padding:0}.p-0\.5{padding:2px}.p-1{padding:4px}.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.p-6{padding:24px}.px-0\.5{padding-left:2px;padding-right:2px}.px-1{padding-left:4px;padding-right:4px}.px-1\.5{padding-left:6px;padding-right:6px}.px-10{padding-left:40px;padding-right:40px}.px-14{padding-left:56px;padding-right:56px}.px-2{padding-left:8px;padding-right:8px}.px-2\.5{padding-left:10px;padding-right:10px}.px-24{padding-left:96px;padding-right:96px}.px-3{padding-left:12px;padding-right:12px}.px-32{padding-left:128px;padding-right:128px}.px-4{padding-left:16px;padding-right:16px}.px-5{padding-left:20px;padding-right:20px}.px-6{padding-left:24px;padding-right:24px}.px-8{padding-left:32px;padding-right:32px}.px-9{padding-left:36px;padding-right:36px}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:2px;padding-bottom:2px}.py-1{padding-top:4px;padding-bottom:4px}.py-1\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-2\.5{padding-top:10px;padding-bottom:10px}.py-20{padding-top:80px;padding-bottom:80px}.py-3{padding-top:12px;padding-bottom:12px}.py-4{padding-top:16px;padding-bottom:16px}.py-5{padding-top:20px;padding-bottom:20px}.py-6{padding-top:24px;padding-bottom:24px}.py-7{padding-top:28px;padding-bottom:28px}.py-8{padding-top:32px;padding-bottom:32px}.py-\[2px\]{padding-top:2px;padding-bottom:2px}.py-\[6px\]{padding-top:6px;padding-bottom:6px}.pb-0{padding-bottom:0}.pb-0\.5{padding-bottom:2px}.pb-1{padding-bottom:4px}.pb-2{padding-bottom:8px}.pb-20{padding-bottom:80px}.pb-4{padding-bottom:16px}.pb-6{padding-bottom:24px}.pb-8{padding-bottom:32px}.pl-0{padding-left:0}.pl-1{padding-left:4px}.pl-11{padding-left:44px}.pl-14{padding-left:56px}.pl-2{padding-left:8px}.pl-3{padding-left:12px}.pl-4{padding-left:16px}.pl-6{padding-left:24px}.pl-8{padding-left:32px}.pl-\[2px\]{padding-left:2px}.pl-\[7px\]{padding-left:7px}.pr-2{padding-right:8px}.pr-3{padding-right:12px}.pr-3\.5{padding-right:14px}.pr-5{padding-right:20px}.pr-6{padding-right:24px}.pr-8{padding-right:32px}.pr-\[4px\]{padding-right:4px}.pt-1\.5{padding-top:6px}.pt-2{padding-top:8px}.pt-3{padding-top:12px}.pt-32{padding-top:128px}.pt-4{padding-top:16px}.pt-40{padding-top:160px}.pt-5{padding-top:20px}.pt-6{padding-top:24px}.pt-\[72px\]{padding-top:72px}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-sans{font-family:Inter Variable,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-4xl{font-size:36px;line-height:40px}.text-\[10px\]{font-size:10px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[15px\]{font-size:15px}.text-base{font-size:16px;line-height:24px}.text-lg{font-size:18px;line-height:28px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.text-xs{font-size:12px;line-height:16px}.text-xxs{font-size:10px;line-height:1}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.leading-3{line-height:12px}.leading-4{line-height:16px}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity))}.text-brand-400{--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.text-brand-500{--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity))}.text-brand-600{--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity))}.text-brand-700{--tw-text-opacity: 1;color:rgb(63 63 70 / var(--tw-text-opacity))}.text-brand-700\/80{color:#3f3f46cc}.text-brand-800{--tw-text-opacity: 1;color:rgb(39 39 42 / var(--tw-text-opacity))}.text-brand-900{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity))}.text-brand-950{--tw-text-opacity: 1;color:rgb(9 9 11 / var(--tw-text-opacity))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-750{--tw-text-opacity: 1;color:rgb(127 84 179 / var(--tw-text-opacity))}.text-purple-750\/80{color:#7f54b3cc}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity))}.text-purple-900{--tw-text-opacity: 1;color:rgb(88 28 135 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-zinc-300\/30{color:#d4d4d84d}.text-zinc-400{--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.text-zinc-600{--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity))}.text-zinc-700{--tw-text-opacity: 1;color:rgb(63 63 70 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-0{outline-width:0px}.outline-1{outline-width:1px}.outline-black\/50{outline-color:#00000080}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-none{transition-property:none}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-500{transition-delay:.5s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.delay-150{animation-delay:.15s}.delay-500{animation-delay:.5s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.running{animation-play-state:running}.scrollbar-stable{scrollbar-gutter:stable}.rapidload-dark{color-scheme:dark}.rpo-titan-tour,.reactour__popover{z-index:150000!important}.reactour__popover:after{content:"";width:0;height:0;position:absolute;top:var(--rtp-arrow-top, auto);right:var(--rtp-arrow-right, auto);bottom:var(--rtp-arrow-bottom, auto);left:var(--rtp-arrow-left, auto);border-top:var(--rtp-arrow-border-top);border-right:var(--rtp-arrow-border-right);border-bottom:var(--rtp-arrow-border-bottom);border-left:var(--rtp-arrow-border-left)}.gradient-border{position:relative;border:solid 2px transparent;background-clip:padding-box,border-box;background-origin:border-box;background-image:linear-gradient(#fff,#fff),linear-gradient(25deg,#b3bdcb,#4b5563)}.selectionBar{stroke-dasharray:1000;stroke-dashoffset:1000;animation:draw 2s ease-in-out alternate forwards}@keyframes draw{0%{stroke-dashoffset:1000}to{stroke-dashoffset:0}}.optimizer-show-button-fade-in{animation:fadeIn .5s ease-in-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeInFromTop{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.fadeInFromTopAnimation{opacity:0;position:relative;top:-10px;animation:fadeInFromTop 3s ease forwards}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:14px;line-height:20px}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:block:after{content:var(--tw-content);display:block}.after\:h-\[11px\]:after{content:var(--tw-content);height:11px}.after\:w-\[11px\]:after{content:var(--tw-content);width:11px}.after\:rounded-full:after{content:var(--tw-content);border-radius:9999px}.after\:bg-black:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.first\:pl-4:first-child{padding-left:16px}.first\:pl-6:first-child{padding-left:24px}.last\:border-b-0:last-child{border-bottom-width:0px}.last\:pb-3:last-child{padding-bottom:12px}.even\:border-l:nth-child(2n){border-left-width:1px}.hover\:border-brand-400\/60:hover{border-color:#a1a1aa99}.hover\:border-purple-700:hover{--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-brand-100:hover{--tw-bg-opacity: 1;background-color:rgb(244 244 245 / var(--tw-bg-opacity))}.hover\:bg-brand-100\/50:hover{background-color:#f4f4f580}.hover\:bg-brand-50:hover{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-green-50\/50:hover{background-color:#f0fdf480}.hover\:bg-inherit:hover{background-color:inherit}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-purple-750\/20:hover{background-color:#7f54b333}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-purple-750:hover{--tw-text-opacity: 1;color:rgb(127 84 179 / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:z-10:focus{z-index:10}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:shadow-\[0_0_0_2px\]:focus{--tw-shadow: 0 0 0 2px;--tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:shadow-black:focus{--tw-shadow-color: #000;--tw-shadow: var(--tw-shadow-colored)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width: 0px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.group:last-child .group-last\:fill-brand-300{fill:#d4d4d8}.group:hover .group-hover\:text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: 4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: 4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 16px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:bg-purple-750[data-state=checked],.data-\[state\=on\]\:bg-purple-750[data-state=on]{--tw-bg-opacity: 1;background-color:rgb(127 84 179 / var(--tw-bg-opacity))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=unchecked\]\:bg-brand-300[data-state=unchecked]{--tw-bg-opacity: 1;background-color:rgb(212 212 216 / var(--tw-bg-opacity))}.data-\[state\=on\]\:text-brand-100[data-state=on]{--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -8px}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: 8px}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -8px}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: 8px}.data-\[state\=closed\]\:slide-out-to-bottom-full[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.kids\:mb-1>*{margin-bottom:4px}.kids\:flex>*{display:flex}.kids\:flex-col>*{flex-direction:column}@media (prefers-reduced-motion: no-preference){@keyframes spin{to{transform:rotate(360deg)}}.motion-safe\:animate-spin{animation:spin 1s linear infinite}}.dark\:border-brand-700:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(63 63 70 / var(--tw-border-opacity))}.dark\:border-brand-700\/70:is(.rapidload-dark *){border-color:#3f3f46b3}.dark\:border-brand-800:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity))}.dark\:border-brand-900:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(24 24 27 / var(--tw-border-opacity))}.dark\:border-brand-950:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(9 9 11 / var(--tw-border-opacity))}.dark\:border-destructive:is(.rapidload-dark *){border-color:hsl(var(--destructive))}.dark\:border-purple-700:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity))}.dark\:border-zinc-600:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(82 82 91 / var(--tw-border-opacity))}.dark\:border-b-brand-700\/40:is(.rapidload-dark *){border-bottom-color:#3f3f4666}.dark\:bg-accent:is(.rapidload-dark *){background-color:hsl(var(--accent))}.dark\:bg-brand-600:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(82 82 91 / var(--tw-bg-opacity))}.dark\:bg-brand-700:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}.dark\:bg-brand-800:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity))}.dark\:bg-brand-800\/40:is(.rapidload-dark *){background-color:#27272a66}.dark\:bg-brand-900:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity))}.dark\:bg-brand-900\/80:is(.rapidload-dark *){background-color:#18181bcc}.dark\:bg-brand-900\/95:is(.rapidload-dark *){background-color:#18181bf2}.dark\:bg-brand-930\/80:is(.rapidload-dark *){background-color:#101012cc}.dark\:bg-brand-930\/90:is(.rapidload-dark *){background-color:#101012e6}.dark\:bg-brand-950:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 11 / var(--tw-bg-opacity))}.dark\:bg-brand-950\/10:is(.rapidload-dark *){background-color:#09090b1a}.dark\:bg-brand-950\/50:is(.rapidload-dark *){background-color:#09090b80}.dark\:bg-brand-950\/60:is(.rapidload-dark *){background-color:#09090b99}.dark\:bg-brand-950\/80:is(.rapidload-dark *){background-color:#09090bcc}.dark\:bg-primary:is(.rapidload-dark *){background-color:hsl(var(--primary))}.dark\:bg-zinc-400:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(161 161 170 / var(--tw-bg-opacity))}.dark\:fill-brand-700:is(.rapidload-dark *){fill:#3f3f46}.dark\:fill-green-700:is(.rapidload-dark *){fill:#15803d}.dark\:stroke-brand-500:is(.rapidload-dark *){stroke:#71717a}.dark\:stroke-brand-600:is(.rapidload-dark *){stroke:#52525b}.dark\:text-accent-foreground:is(.rapidload-dark *){color:hsl(var(--accent-foreground))}.dark\:text-black:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.dark\:text-brand-200:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(228 228 231 / var(--tw-text-opacity))}.dark\:text-brand-300:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.dark\:text-brand-400:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.dark\:text-brand-50:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(250 250 250 / var(--tw-text-opacity))}.dark\:text-brand-500:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity))}.dark\:text-brand-600:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity))}.dark\:text-brand-800:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(39 39 42 / var(--tw-text-opacity))}.dark\:text-brand-900:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity))}.dark\:text-green-600:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.dark\:shadow-brand-800\/30:is(.rapidload-dark *){--tw-shadow-color: rgb(39 39 42 / .3);--tw-shadow: var(--tw-shadow-colored)}.dark\:hover\:border-brand-700\/70:hover:is(.rapidload-dark *){border-color:#3f3f46b3}.dark\:hover\:border-purple-700:hover:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity))}.dark\:hover\:bg-brand-700:hover:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}.dark\:hover\:bg-brand-800:hover:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity))}.dark\:hover\:bg-brand-900\/50:hover:is(.rapidload-dark *){background-color:#18181b80}.dark\:hover\:bg-brand-900\/70:hover:is(.rapidload-dark *){background-color:#18181bb3}.dark\:hover\:bg-brand-950:hover:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 11 / var(--tw-bg-opacity))}.dark\:hover\:bg-primary\/90:hover:is(.rapidload-dark *){background-color:hsl(var(--primary) / .9)}.dark\:hover\:text-brand-300:hover:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.hover\:dark\:text-brand-100:is(.rapidload-dark *):hover{--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\:bottom-0{bottom:0}.sm\:left-1\/2{left:50%}.sm\:top-auto{top:auto}.sm\:mt-0{margin-top:0}.sm\:w-1\/2{width:50%}.sm\:max-w-\[335px\]{max-width:335px}.sm\:max-w-\[425px\]{max-width:425px}.sm\:max-w-\[450px\]{max-width:450px}.sm\:max-w-\[600px\]{max-width:600px}.sm\:max-w-\[650px\]{max-width:650px}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:8px}.sm\:text-left{text-align:left}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media (min-width: 768px){.md\:w-full{width:100%}.md\:min-w-\[400px\]{min-width:400px}.md\:max-w-sm{max-width:24rem}}@media (min-width: 1024px){.lg\:col-span-3{grid-column:span 3 / span 3}.lg\:col-span-9{grid-column:span 9 / span 9}.lg\:mt-16{margin-top:64px}.lg\:flex{display:flex}.lg\:w-full{width:100%}.lg\:max-w-xl{max-width:36rem}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:grid-cols-none{grid-template-columns:none}.lg\:flex-col{flex-direction:column}.lg\:border-b-0{border-bottom-width:0px}.lg\:border-l-0{border-left-width:0px}.lg\:border-t{border-top-width:1px}.lg\:px-4{padding-left:16px;padding-right:16px}.lg\:px-6{padding-left:24px;padding-right:24px}.lg\:pb-0{padding-bottom:0}.lg\:last\:rounded-b-3xl:last-child{border-bottom-right-radius:24px;border-bottom-left-radius:24px}.lg\:even\:border-l-0:nth-child(2n){border-left-width:0px}}@media (min-width: 1280px){.xl\:block{display:block}.xl\:rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.xl\:flex-row{flex-direction:row}.xl\:items-center{align-items:center}.xl\:gap-2{gap:8px}.xl\:px-4{padding-left:16px;padding-right:16px}.xl\:px-8{padding-left:32px;padding-right:32px}}.\[\&\>\*\]\:flex>*{display:flex}.\[\&\>\*\]\:flex-col>*{flex-direction:column}.\[\&\>\*\]\:gap-1>*{gap:4px}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:16px}.\[\&\>svg\]\:top-4>svg{top:16px}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:28px}.\[\&_p\]\:leading-relaxed p{line-height:1.625}
+*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:Inter Variable,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:host,:root{--reactour-accent: #0e172a;--background: 0 0% 100%;--foreground: 240 10% 3.92%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--popover: 0 0% 100%;--popover-foreground: 240 10% 3.92%;--card: 0 0% 100%;--card-foreground: 240 10% 3.92%;--border: 0 0% 88%;--input: 214.3 31.8% 91.4%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--accent: 0 0% 93%;--accent-foreground: 0 0% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--ring: 215 20.2% 65.1%;--radius: .5rem}.rapidload-dark{--reactour-accent: #fafafa;--background: 240 10% 3.92%;--foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--popover: 240 10% 3.92%;--popover-foreground: 210 40% 98%;--card: 240 10% 3.92%;--card-foreground: 210 40% 98%;--border: 0 0% 12%;--input:0 0% 12%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--accent-foreground: 0 0% 93%;--accent: 0 0% 11.2%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 0 85.7% 97.3%;--ring: 217.2 32.6% 17.5%}*{border-color:hsl(var(--border))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.\!visible{visibility:visible!important}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-inset-\[3px\]{top:-3px;right:-3px;bottom:-3px;left:-3px}.inset-0{top:0;right:0;bottom:0;left:0}.-bottom-1{bottom:-4px}.-left-0\.5{left:-2px}.-left-4{left:-16px}.-left-7{left:-28px}.-right-1{right:-4px}.-top-0\.5{top:-2px}.-top-1{top:-4px}.-top-3{top:-12px}.bottom-0{bottom:0}.left-0{left:0}.left-0\.5{left:2px}.left-1\/2{left:50%}.left-2{left:8px}.left-7{left:28px}.left-\[110px\]{left:110px}.left-\[50\%\]{left:50%}.left-\[72px\]{left:72px}.right-0\.5{right:2px}.right-2{right:8px}.right-4{right:16px}.top-0{top:0}.top-0\.5{top:2px}.top-1\/2{top:50%}.top-2{top:8px}.top-2\.5{top:10px}.top-3{top:12px}.top-4{top:16px}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[69px\]{top:69px}.z-10{z-index:10}.z-50{z-index:50}.z-\[-1\]{z-index:-1}.z-\[100000\]{z-index:100000}.z-\[100001\]{z-index:100001}.z-\[110000\]{z-index:110000}.z-\[110001\]{z-index:110001}.z-\[110002\]{z-index:110002}.z-\[120000\]{z-index:120000}.z-\[150000\]{z-index:150000}.z-\[1\]{z-index:1}.z-\[99999\]{z-index:99999}.col-span-12{grid-column:span 12 / span 12}.-mx-1{margin-left:-4px;margin-right:-4px}.-mx-4{margin-left:-16px;margin-right:-16px}.-mx-\[22px\]{margin-left:-22px;margin-right:-22px}.mx-1\.5{margin-left:6px;margin-right:6px}.mx-16{margin-left:64px;margin-right:64px}.mx-5{margin-left:20px;margin-right:20px}.mx-6{margin-left:24px;margin-right:24px}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:4px;margin-bottom:4px}.my-2{margin-top:8px;margin-bottom:8px}.my-3{margin-top:12px;margin-bottom:12px}.-mb-2{margin-bottom:-8px}.-mb-2\.5{margin-bottom:-10px}.-ml-1{margin-left:-4px}.-ml-6{margin-left:-24px}.-mr-0\.5{margin-right:-2px}.-mt-0\.5{margin-top:-2px}.-mt-1{margin-top:-4px}.-mt-2{margin-top:-8px}.-mt-4{margin-top:-16px}.-mt-\[1px\]{margin-top:-1px}.-mt-\[70px\]{margin-top:-70px}.mb-0{margin-bottom:0}.mb-1{margin-bottom:4px}.mb-1\.5{margin-bottom:6px}.mb-2{margin-bottom:8px}.mb-24{margin-bottom:96px}.mb-3{margin-bottom:12px}.mb-3\.5{margin-bottom:14px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:20px}.mb-6{margin-bottom:24px}.mb-8{margin-bottom:32px}.ml-1\.5{margin-left:6px}.ml-10{margin-left:40px}.ml-12{margin-left:48px}.ml-14{margin-left:56px}.ml-2{margin-left:8px}.ml-28{margin-left:112px}.ml-3{margin-left:12px}.ml-4{margin-left:16px}.ml-5{margin-left:20px}.ml-6{margin-left:24px}.ml-7{margin-left:28px}.ml-8{margin-left:32px}.ml-9{margin-left:36px}.ml-auto{margin-left:auto}.mr-0\.5{margin-right:2px}.mr-1{margin-right:4px}.mr-1\.5{margin-right:6px}.mr-2{margin-right:8px}.mt-0\.5{margin-top:2px}.mt-1{margin-top:4px}.mt-12{margin-top:48px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}.mt-\[1px\]{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:6px}.h-10{height:40px}.h-11{height:44px}.h-12{height:48px}.h-14{height:56px}.h-2{height:8px}.h-2\.5{height:10px}.h-3{height:12px}.h-3\.5{height:14px}.h-4{height:16px}.h-44{height:176px}.h-5{height:20px}.h-6{height:24px}.h-7{height:28px}.h-8{height:32px}.h-9{height:36px}.h-\[176px\]{height:176px}.h-\[18px\]{height:18px}.h-\[20px\]{height:20px}.h-\[35px\]{height:35px}.h-\[36px\]{height:36px}.h-\[44px\]{height:44px}.h-\[48px\]{height:48px}.h-\[50px\]{height:50px}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-fit{height:fit-content}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\[176px\]{max-height:176px}.max-h-\[300px\]{max-height:300px}.max-h-screen{max-height:100vh}.min-h-\[166px\]{min-height:166px}.min-h-\[280px\]{min-height:280px}.min-h-\[295px\]{min-height:295px}.min-h-\[32px\]{min-height:32px}.min-h-\[380px\]{min-height:380px}.min-h-\[56px\]{min-height:56px}.min-h-screen{min-height:100vh}.w-1\.5{width:6px}.w-10{width:40px}.w-12{width:48px}.w-16{width:64px}.w-2{width:8px}.w-2\.5{width:10px}.w-24{width:96px}.w-3{width:12px}.w-3\.5{width:14px}.w-36{width:144px}.w-4{width:16px}.w-44{width:176px}.w-48{width:192px}.w-5{width:20px}.w-52{width:208px}.w-56{width:224px}.w-6{width:24px}.w-60{width:240px}.w-64{width:256px}.w-7{width:28px}.w-72{width:288px}.w-8{width:32px}.w-9{width:36px}.w-\[110px\]{width:110px}.w-\[118px\]{width:118px}.w-\[130px\]{width:130px}.w-\[180px\]{width:180px}.w-\[18px\]{width:18px}.w-\[200px\]{width:200px}.w-\[20px\]{width:20px}.w-\[35px\]{width:35px}.w-\[36px\]{width:36px}.w-\[55px\]{width:55px}.w-\[70px\]{width:70px}.w-\[78px\]{width:78px}.w-fit{width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.min-w-\[125px\]{min-width:125px}.min-w-\[166px\]{min-width:166px}.min-w-\[200px\]{min-width:200px}.min-w-\[310px\]{min-width:310px}.min-w-\[32px\]{min-width:32px}.min-w-\[350px\]{min-width:350px}.min-w-\[565px\]{min-width:565px}.min-w-\[580px\]{min-width:580px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.min-w-max{min-width:max-content}.max-w-\[160px\]{max-width:160px}.max-w-\[200px\]{max-width:200px}.max-w-\[350px\]{max-width:350px}.max-w-\[520px\]{max-width:520px}.max-w-\[768px\]{max-width:768px}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.-translate-x-1{--tw-translate-x: -4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\/2{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-180{--tw-rotate: -180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-90,.rotate-\[90deg\]{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce-horizontal{0%,20%,50%,80%,to{transform:translate(0)}40%{transform:translate(-5px)}60%{transform:translate(3px)}}.animate-bounce-horizontal{animation:bounce-horizontal 1.5s infinite}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rl-loading-loop{0%,to{transform:translate(-50%)}50%{transform:translate(250%)}}.animate-rl-loading-loop{animation:rl-loading-loop 1.8s ease-out infinite}@keyframes rl-scale-in{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}.animate-rl-scale-in{animation:rl-scale-in .1s ease-out}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-auto{cursor:auto}.cursor-default{cursor:default}.cursor-no-drop{cursor:no-drop}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;user-select:none}.scroll-m-28{scroll-margin:112px}.list-disc{list-style-type:disc}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-none{grid-template-columns:none}.grid-rows-3{grid-template-rows:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-0\.5{gap:2px}.gap-1{gap:4px}.gap-1\.5{gap:6px}.gap-12{gap:48px}.gap-2{gap:8px}.gap-2\.5{gap:10px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-6{gap:24px}.gap-8{gap:32px}.gap-\[1px\]{gap:1px}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(16px * var(--tw-space-x-reverse));margin-left:calc(16px * calc(1 - var(--tw-space-x-reverse)))}.space-x-px>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1px * var(--tw-space-x-reverse));margin-left:calc(1px * calc(1 - var(--tw-space-x-reverse)))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(6px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(6px * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(8px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(8px * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(20px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(20px * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.self-center{align-self:center}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:4px}.rounded-2xl{border-radius:16px}.rounded-3xl{border-radius:24px}.rounded-\[14px\]{border-radius:14px}.rounded-\[15px\]{border-radius:15px}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-\[40px\]{border-radius:40px}.rounded-\[50px\]{border-radius:50px}.rounded-\[8px\]{border-radius:8px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:6px}.rounded-none{border-radius:0}.rounded-sm{border-radius:2px}.rounded-xl{border-radius:12px}.rounded-b-xl{border-bottom-right-radius:12px;border-bottom-left-radius:12px}.rounded-t-lg{border-top-left-radius:8px;border-top-right-radius:8px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-tl-lg{border-top-left-radius:8px}.rounded-tl-none{border-top-left-radius:0}.rounded-tr-lg{border-top-right-radius:8px}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-\[3px\]{border-width:3px}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-r-0{border-right-width:0px}.border-t{border-top-width:1px}.border-t-0{border-top-width:0px}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-\[\#f7b250\]{--tw-border-opacity: 1;border-color:rgb(247 178 80 / var(--tw-border-opacity))}.border-amber-500\/80{border-color:#f59e0bcc}.border-amber-600{--tw-border-opacity: 1;border-color:rgb(217 119 6 / var(--tw-border-opacity))}.border-brand-200{--tw-border-opacity: 1;border-color:rgb(228 228 231 / var(--tw-border-opacity))}.border-brand-200\/50{border-color:#e4e4e780}.border-brand-200\/60{border-color:#e4e4e799}.border-brand-200\/80{border-color:#e4e4e7cc}.border-brand-400\/60{border-color:#a1a1aa99}.border-brand-500\/20{border-color:#71717a33}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity))}.border-green-600{--tw-border-opacity: 1;border-color:rgb(22 163 74 / var(--tw-border-opacity))}.border-input{border-color:hsl(var(--input))}.border-orange-400{--tw-border-opacity: 1;border-color:rgb(251 146 60 / var(--tw-border-opacity))}.border-purple-300{--tw-border-opacity: 1;border-color:rgb(216 180 254 / var(--tw-border-opacity))}.border-purple-700{--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}.border-rose-600{--tw-border-opacity: 1;border-color:rgb(225 29 72 / var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-yellow-400{--tw-border-opacity: 1;border-color:rgb(250 204 21 / var(--tw-border-opacity))}.border-zinc-300\/30{border-color:#d4d4d84d}.border-zinc-600{--tw-border-opacity: 1;border-color:rgb(82 82 91 / var(--tw-border-opacity))}.border-b-white{--tw-border-opacity: 1;border-bottom-color:rgb(255 255 255 / var(--tw-border-opacity))}.bg-\[\#7F54B3\]{--tw-bg-opacity: 1;background-color:rgb(127 84 179 / var(--tw-bg-opacity))}.bg-\[\#f7b250\]{--tw-bg-opacity: 1;background-color:rgb(247 178 80 / var(--tw-bg-opacity))}.bg-amber-300\/30{background-color:#fcd34d4d}.bg-amber-500\/80{background-color:#f59e0bcc}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-brand-0{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-brand-0\/70{background-color:#ffffffb3}.bg-brand-100{--tw-bg-opacity: 1;background-color:rgb(244 244 245 / var(--tw-bg-opacity))}.bg-brand-100\/20{background-color:#f4f4f533}.bg-brand-100\/30{background-color:#f4f4f54d}.bg-brand-100\/50{background-color:#f4f4f580}.bg-brand-100\/60{background-color:#f4f4f599}.bg-brand-100\/80{background-color:#f4f4f5cc}.bg-brand-100\/90{background-color:#f4f4f5e6}.bg-brand-200{--tw-bg-opacity: 1;background-color:rgb(228 228 231 / var(--tw-bg-opacity))}.bg-brand-200\/50{background-color:#e4e4e780}.bg-brand-200\/60{background-color:#e4e4e799}.bg-brand-200\/80{background-color:#e4e4e7cc}.bg-brand-300{--tw-bg-opacity: 1;background-color:rgb(212 212 216 / var(--tw-bg-opacity))}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity))}.bg-brand-50\/50{background-color:#fafafa80}.bg-brand-50\/75{background-color:#fafafabf}.bg-brand-50\/80{background-color:#fafafacc}.bg-brand-700{--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}.bg-green-200{--tw-bg-opacity: 1;background-color:rgb(187 247 208 / var(--tw-bg-opacity))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity))}.bg-green-600{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-400{--tw-bg-opacity: 1;background-color:rgb(251 146 60 / var(--tw-bg-opacity))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-purple-100{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity))}.bg-purple-50\/60{background-color:#faf5ff99}.bg-purple-700\/30{background-color:#7e22ce4d}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.bg-violet-100{--tw-bg-opacity: 1;background-color:rgb(237 233 254 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-400{--tw-bg-opacity: 1;background-color:rgb(250 204 21 / var(--tw-bg-opacity))}.bg-zinc-200{--tw-bg-opacity: 1;background-color:rgb(228 228 231 / var(--tw-bg-opacity))}.bg-cover{background-size:cover}.bg-center{background-position:center}.fill-amber-500{fill:#f59e0b}.fill-blue-500{fill:#3b82f6}.fill-brand-300{fill:#d4d4d8}.fill-brand-600{fill:#52525b}.fill-current{fill:currentColor}.fill-green-600{fill:#16a34a}.fill-orange-500{fill:#f97316}.fill-orange-600{fill:#ea580c}.fill-red-500{fill:#ef4444}.fill-red-600{fill:#dc2626}.fill-rose-500{fill:#f43f5e}.fill-rose-600{fill:#e11d48}.fill-yellow-400{fill:#facc15}.stroke-brand-300{stroke:#d4d4d8}.stroke-brand-300\/50{stroke:#d4d4d880}.stroke-brand-300\/90{stroke:#d4d4d8e6}.stroke-none{stroke:none}.stroke-purple-600\/10{stroke:#9333ea1a}.stroke-purple-800\/10{stroke:#6b21a81a}.stroke-0{stroke-width:0}.stroke-1{stroke-width:1}.p-0{padding:0}.p-0\.5{padding:2px}.p-1{padding:4px}.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.p-6{padding:24px}.px-0\.5{padding-left:2px;padding-right:2px}.px-1{padding-left:4px;padding-right:4px}.px-1\.5{padding-left:6px;padding-right:6px}.px-10{padding-left:40px;padding-right:40px}.px-14{padding-left:56px;padding-right:56px}.px-2{padding-left:8px;padding-right:8px}.px-2\.5{padding-left:10px;padding-right:10px}.px-24{padding-left:96px;padding-right:96px}.px-3{padding-left:12px;padding-right:12px}.px-32{padding-left:128px;padding-right:128px}.px-4{padding-left:16px;padding-right:16px}.px-5{padding-left:20px;padding-right:20px}.px-6{padding-left:24px;padding-right:24px}.px-8{padding-left:32px;padding-right:32px}.px-9{padding-left:36px;padding-right:36px}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:2px;padding-bottom:2px}.py-1{padding-top:4px;padding-bottom:4px}.py-1\.5{padding-top:6px;padding-bottom:6px}.py-2{padding-top:8px;padding-bottom:8px}.py-2\.5{padding-top:10px;padding-bottom:10px}.py-20{padding-top:80px;padding-bottom:80px}.py-3{padding-top:12px;padding-bottom:12px}.py-4{padding-top:16px;padding-bottom:16px}.py-5{padding-top:20px;padding-bottom:20px}.py-6{padding-top:24px;padding-bottom:24px}.py-7{padding-top:28px;padding-bottom:28px}.py-8{padding-top:32px;padding-bottom:32px}.py-\[2px\]{padding-top:2px;padding-bottom:2px}.py-\[6px\]{padding-top:6px;padding-bottom:6px}.pb-0{padding-bottom:0}.pb-0\.5{padding-bottom:2px}.pb-1{padding-bottom:4px}.pb-2{padding-bottom:8px}.pb-20{padding-bottom:80px}.pb-4{padding-bottom:16px}.pb-6{padding-bottom:24px}.pb-8{padding-bottom:32px}.pl-0{padding-left:0}.pl-1{padding-left:4px}.pl-11{padding-left:44px}.pl-14{padding-left:56px}.pl-2{padding-left:8px}.pl-3{padding-left:12px}.pl-4{padding-left:16px}.pl-6{padding-left:24px}.pl-8{padding-left:32px}.pl-\[2px\]{padding-left:2px}.pl-\[7px\]{padding-left:7px}.pr-2{padding-right:8px}.pr-3{padding-right:12px}.pr-3\.5{padding-right:14px}.pr-5{padding-right:20px}.pr-6{padding-right:24px}.pr-8{padding-right:32px}.pr-\[4px\]{padding-right:4px}.pt-1\.5{padding-top:6px}.pt-2{padding-top:8px}.pt-3{padding-top:12px}.pt-32{padding-top:128px}.pt-4{padding-top:16px}.pt-40{padding-top:160px}.pt-5{padding-top:20px}.pt-6{padding-top:24px}.pt-\[72px\]{padding-top:72px}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-sans{font-family:Inter Variable,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-4xl{font-size:36px;line-height:40px}.text-\[10px\]{font-size:10px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[15px\]{font-size:15px}.text-base{font-size:16px;line-height:24px}.text-lg{font-size:18px;line-height:28px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.text-xs{font-size:12px;line-height:16px}.text-xxs{font-size:10px;line-height:1}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.normal-case{text-transform:none}.leading-3{line-height:12px}.leading-4{line-height:16px}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.text-blue-400{--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity))}.text-brand-400{--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.text-brand-500{--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity))}.text-brand-600{--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity))}.text-brand-700{--tw-text-opacity: 1;color:rgb(63 63 70 / var(--tw-text-opacity))}.text-brand-700\/80{color:#3f3f46cc}.text-brand-800{--tw-text-opacity: 1;color:rgb(39 39 42 / var(--tw-text-opacity))}.text-brand-900{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity))}.text-brand-950{--tw-text-opacity: 1;color:rgb(9 9 11 / var(--tw-text-opacity))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-purple-750{--tw-text-opacity: 1;color:rgb(127 84 179 / var(--tw-text-opacity))}.text-purple-750\/80{color:#7f54b3cc}.text-purple-800{--tw-text-opacity: 1;color:rgb(107 33 168 / var(--tw-text-opacity))}.text-purple-900{--tw-text-opacity: 1;color:rgb(88 28 135 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-zinc-300\/30{color:#d4d4d84d}.text-zinc-400{--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.text-zinc-600{--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity))}.text-zinc-700{--tw-text-opacity: 1;color:rgb(63 63 70 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.outline-0{outline-width:0px}.outline-1{outline-width:1px}.outline-black\/50{outline-color:#00000080}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-none{transition-property:none}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-150{transition-delay:.15s}.delay-500{transition-delay:.5s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.delay-150{animation-delay:.15s}.delay-500{animation-delay:.5s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.running{animation-play-state:running}.scrollbar-stable{scrollbar-gutter:stable}.rapidload-dark{color-scheme:dark}.rpo-titan-tour,.reactour__popover{z-index:150000!important}.reactour__popover:after{content:"";width:0;height:0;position:absolute;top:var(--rtp-arrow-top, auto);right:var(--rtp-arrow-right, auto);bottom:var(--rtp-arrow-bottom, auto);left:var(--rtp-arrow-left, auto);border-top:var(--rtp-arrow-border-top);border-right:var(--rtp-arrow-border-right);border-bottom:var(--rtp-arrow-border-bottom);border-left:var(--rtp-arrow-border-left)}.gradient-border{position:relative;border:solid 2px transparent;background-clip:padding-box,border-box;background-origin:border-box;background-image:linear-gradient(#fff,#fff),linear-gradient(25deg,#b3bdcb,#4b5563)}.selectionBar{stroke-dasharray:1000;stroke-dashoffset:1000;animation:draw 2s ease-in-out alternate forwards}@keyframes draw{0%{stroke-dashoffset:1000}to{stroke-dashoffset:0}}.optimizer-show-button-fade-in{animation:fadeIn .5s ease-in-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes fadeInFromTop{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.fadeInFromTopAnimation{opacity:0;position:relative;top:-10px;animation:fadeInFromTop 3s ease forwards}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:14px;line-height:20px}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:block:after{content:var(--tw-content);display:block}.after\:h-\[11px\]:after{content:var(--tw-content);height:11px}.after\:w-\[11px\]:after{content:var(--tw-content);width:11px}.after\:rounded-full:after{content:var(--tw-content);border-radius:9999px}.after\:bg-black:after{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.first\:pl-4:first-child{padding-left:16px}.first\:pl-6:first-child{padding-left:24px}.last\:border-b-0:last-child{border-bottom-width:0px}.last\:pb-3:last-child{padding-bottom:12px}.even\:border-l:nth-child(2n){border-left-width:1px}.hover\:border-brand-400\/60:hover{border-color:#a1a1aa99}.hover\:border-purple-700:hover{--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-brand-100:hover{--tw-bg-opacity: 1;background-color:rgb(244 244 245 / var(--tw-bg-opacity))}.hover\:bg-brand-100\/50:hover{background-color:#f4f4f580}.hover\:bg-brand-50:hover{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-green-50\/50:hover{background-color:#f0fdf480}.hover\:bg-inherit:hover{background-color:inherit}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-purple-750\/20:hover{background-color:#7f54b333}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-purple-750:hover{--tw-text-opacity: 1;color:rgb(127 84 179 / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:z-10:focus{z-index:10}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:shadow-\[0_0_0_2px\]:focus{--tw-shadow: 0 0 0 2px;--tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:shadow-black:focus{--tw-shadow-color: #000;--tw-shadow: var(--tw-shadow-colored)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-0:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width: 0px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}.group:last-child .group-last\:fill-brand-300{fill:#d4d4d8}.group:hover .group-hover\:text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: 4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: 4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -4px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 16px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:bg-purple-750[data-state=checked],.data-\[state\=on\]\:bg-purple-750[data-state=on]{--tw-bg-opacity: 1;background-color:rgb(127 84 179 / var(--tw-bg-opacity))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=unchecked\]\:bg-brand-300[data-state=unchecked]{--tw-bg-opacity: 1;background-color:rgb(212 212 216 / var(--tw-bg-opacity))}.data-\[state\=on\]\:text-brand-100[data-state=on]{--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -8px}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: 8px}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -8px}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: 8px}.data-\[state\=closed\]\:slide-out-to-bottom-full[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.kids\:mb-1>*{margin-bottom:4px}.kids\:flex>*{display:flex}.kids\:flex-col>*{flex-direction:column}@media (prefers-reduced-motion: no-preference){@keyframes spin{to{transform:rotate(360deg)}}.motion-safe\:animate-spin{animation:spin 1s linear infinite}}.dark\:border-brand-700:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(63 63 70 / var(--tw-border-opacity))}.dark\:border-brand-700\/70:is(.rapidload-dark *){border-color:#3f3f46b3}.dark\:border-brand-800:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(39 39 42 / var(--tw-border-opacity))}.dark\:border-brand-900:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(24 24 27 / var(--tw-border-opacity))}.dark\:border-brand-950:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(9 9 11 / var(--tw-border-opacity))}.dark\:border-destructive:is(.rapidload-dark *){border-color:hsl(var(--destructive))}.dark\:border-purple-700:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity))}.dark\:border-zinc-600:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(82 82 91 / var(--tw-border-opacity))}.dark\:border-b-brand-700\/40:is(.rapidload-dark *){border-bottom-color:#3f3f4666}.dark\:bg-accent:is(.rapidload-dark *){background-color:hsl(var(--accent))}.dark\:bg-brand-600:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(82 82 91 / var(--tw-bg-opacity))}.dark\:bg-brand-700:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}.dark\:bg-brand-800:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity))}.dark\:bg-brand-800\/40:is(.rapidload-dark *){background-color:#27272a66}.dark\:bg-brand-900:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity))}.dark\:bg-brand-900\/80:is(.rapidload-dark *){background-color:#18181bcc}.dark\:bg-brand-900\/95:is(.rapidload-dark *){background-color:#18181bf2}.dark\:bg-brand-930\/80:is(.rapidload-dark *){background-color:#101012cc}.dark\:bg-brand-930\/90:is(.rapidload-dark *){background-color:#101012e6}.dark\:bg-brand-950:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 11 / var(--tw-bg-opacity))}.dark\:bg-brand-950\/10:is(.rapidload-dark *){background-color:#09090b1a}.dark\:bg-brand-950\/50:is(.rapidload-dark *){background-color:#09090b80}.dark\:bg-brand-950\/60:is(.rapidload-dark *){background-color:#09090b99}.dark\:bg-brand-950\/80:is(.rapidload-dark *){background-color:#09090bcc}.dark\:bg-primary:is(.rapidload-dark *){background-color:hsl(var(--primary))}.dark\:bg-zinc-400:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(161 161 170 / var(--tw-bg-opacity))}.dark\:fill-brand-700:is(.rapidload-dark *){fill:#3f3f46}.dark\:fill-green-700:is(.rapidload-dark *){fill:#15803d}.dark\:stroke-brand-500:is(.rapidload-dark *){stroke:#71717a}.dark\:stroke-brand-600:is(.rapidload-dark *){stroke:#52525b}.dark\:text-accent-foreground:is(.rapidload-dark *){color:hsl(var(--accent-foreground))}.dark\:text-black:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}.dark\:text-brand-200:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(228 228 231 / var(--tw-text-opacity))}.dark\:text-brand-300:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.dark\:text-brand-400:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(161 161 170 / var(--tw-text-opacity))}.dark\:text-brand-50:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(250 250 250 / var(--tw-text-opacity))}.dark\:text-brand-500:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(113 113 122 / var(--tw-text-opacity))}.dark\:text-brand-600:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(82 82 91 / var(--tw-text-opacity))}.dark\:text-brand-800:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(39 39 42 / var(--tw-text-opacity))}.dark\:text-brand-900:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity))}.dark\:text-green-600:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.dark\:shadow-brand-800\/30:is(.rapidload-dark *){--tw-shadow-color: rgb(39 39 42 / .3);--tw-shadow: var(--tw-shadow-colored)}.dark\:hover\:border-brand-700\/70:hover:is(.rapidload-dark *){border-color:#3f3f46b3}.dark\:hover\:border-purple-700:hover:is(.rapidload-dark *){--tw-border-opacity: 1;border-color:rgb(126 34 206 / var(--tw-border-opacity))}.dark\:hover\:bg-brand-700:hover:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(63 63 70 / var(--tw-bg-opacity))}.dark\:hover\:bg-brand-800:hover:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(39 39 42 / var(--tw-bg-opacity))}.dark\:hover\:bg-brand-900\/50:hover:is(.rapidload-dark *){background-color:#18181b80}.dark\:hover\:bg-brand-900\/70:hover:is(.rapidload-dark *){background-color:#18181bb3}.dark\:hover\:bg-brand-950:hover:is(.rapidload-dark *){--tw-bg-opacity: 1;background-color:rgb(9 9 11 / var(--tw-bg-opacity))}.dark\:hover\:bg-primary\/90:hover:is(.rapidload-dark *){background-color:hsl(var(--primary) / .9)}.dark\:hover\:text-brand-300:hover:is(.rapidload-dark *){--tw-text-opacity: 1;color:rgb(212 212 216 / var(--tw-text-opacity))}.hover\:dark\:text-brand-100:is(.rapidload-dark *):hover{--tw-text-opacity: 1;color:rgb(244 244 245 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\:bottom-0{bottom:0}.sm\:left-1\/2{left:50%}.sm\:top-auto{top:auto}.sm\:mt-0{margin-top:0}.sm\:w-1\/2{width:50%}.sm\:max-w-\[335px\]{max-width:335px}.sm\:max-w-\[425px\]{max-width:425px}.sm\:max-w-\[450px\]{max-width:450px}.sm\:max-w-\[600px\]{max-width:600px}.sm\:max-w-\[650px\]{max-width:650px}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(8px * var(--tw-space-x-reverse));margin-left:calc(8px * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:8px}.sm\:text-left{text-align:left}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media (min-width: 768px){.md\:w-full{width:100%}.md\:min-w-\[400px\]{min-width:400px}.md\:max-w-sm{max-width:24rem}}@media (min-width: 1024px){.lg\:col-span-3{grid-column:span 3 / span 3}.lg\:col-span-9{grid-column:span 9 / span 9}.lg\:mt-16{margin-top:64px}.lg\:flex{display:flex}.lg\:w-full{width:100%}.lg\:max-w-xl{max-width:36rem}.lg\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.lg\:grid-cols-none{grid-template-columns:none}.lg\:flex-col{flex-direction:column}.lg\:border-b-0{border-bottom-width:0px}.lg\:border-l-0{border-left-width:0px}.lg\:border-t{border-top-width:1px}.lg\:px-4{padding-left:16px;padding-right:16px}.lg\:px-6{padding-left:24px;padding-right:24px}.lg\:pb-0{padding-bottom:0}.lg\:last\:rounded-b-3xl:last-child{border-bottom-right-radius:24px;border-bottom-left-radius:24px}.lg\:even\:border-l-0:nth-child(2n){border-left-width:0px}}@media (min-width: 1280px){.xl\:block{display:block}.xl\:rotate-0{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.xl\:flex-row{flex-direction:row}.xl\:items-center{align-items:center}.xl\:gap-2{gap:8px}.xl\:px-4{padding-left:16px;padding-right:16px}.xl\:px-8{padding-left:32px;padding-right:32px}}.\[\&\>\*\]\:flex>*{display:flex}.\[\&\>\*\]\:flex-col>*{flex-direction:column}.\[\&\>\*\]\:gap-1>*{gap:4px}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:16px}.\[\&\>svg\]\:top-4>svg{top:16px}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:28px}.\[\&_p\]\:leading-relaxed p{line-height:1.625}
diff --git a/includes/admin/page-optimizer/dist/assets/index.vzULuBtB.js b/includes/admin/page-optimizer/dist-debug/assets/index.DQKRoxVT.js
similarity index 55%
rename from includes/admin/page-optimizer/dist/assets/index.vzULuBtB.js
rename to includes/admin/page-optimizer/dist-debug/assets/index.DQKRoxVT.js
index 38d536db8..ea91c10a7 100644
--- a/includes/admin/page-optimizer/dist/assets/index.vzULuBtB.js
+++ b/includes/admin/page-optimizer/dist-debug/assets/index.DQKRoxVT.js
@@ -1,5 +1,5 @@
-const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.Uyygx8b3.js","assets/vendor.C2Ge5RaU.js","assets/core-vendor.a21Wwx5s.js","assets/index.JHaeFuYk.js","assets/animations.CWk52Myu.js","assets/InitTour.DaMiyxQJ.js"])))=>i.map(i=>d[i]);
-var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var _n=(e,r,n)=>Lu(e,typeof r!="symbol"?r+"":r,n);import{j as t,c as Ze,a as Pt,u as Re,A as Zn,P as ue,b as K,d as tt,D as Sr,C as Xn,S as oo,R as Du,e as Yn,f as ut,g as Xe,h as Jn,H as Iu,t as _a,i as $u,k as io,l as lo,m as co,n as uo,F as fo,o as Fu,p as Bu,q as po,r as Qn,s as es,v as mo,w as zu,V as ho,x as go,y as xo,z as vo,T as bo,B as yo,E as Vu,G as wo,I as Hu,J as jo,K as Uu,L as _o,M as Co,N as Gu,O as Ku,Q as No,U as qu,W as Wu,X as Zu,Y as Xu,Z as Yu,_ as Ju,$ as Qu,a0 as Ca,a1 as So,a2 as ko}from"./vendor.C2Ge5RaU.js";import{r as l,a as Eo,t as ef,g as kr,c as de,b as tf}from"./core-vendor.a21Wwx5s.js";import{m as Se,A as Ve,a as rf,u as nf,L as sf,d as af}from"./animations.CWk52Myu.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();const Na= window.rapidload_optimizer.page_optimizer_package_base+"/assets/index.UfvjoQdb.css",of="modulepreload",lf=function(e){return window.rapidload_optimizer.page_optimizer_package_base+"/"+e},Sa={},Ro=function(r,n,s){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),i=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.all(n.map(d=>{if(d=lf(d),d in Sa)return;Sa[d]=!0;const u=d.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${f}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":of,u||(m.as="script",m.crossOrigin=""),m.href=d,i&&m.setAttribute("nonce",i),document.head.appendChild(m),u)return new Promise((x,v)=>{m.addEventListener("load",x),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${d}`)))})}))}return a.then(()=>r()).catch(o=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o})};function cf({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const ur=l.forwardRef(cf);function df({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 1.5H8.25A2.25 2.25 0 0 0 6 3.75v16.5a2.25 2.25 0 0 0 2.25 2.25h7.5A2.25 2.25 0 0 0 18 20.25V3.75a2.25 2.25 0 0 0-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"}))}const Mo=l.forwardRef(df);function uf({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const To=l.forwardRef(uf);var Po={exports:{}},Ao={};/**
+const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.j2mLwiGu.js","assets/vendor.C2Ge5RaU.js","assets/core-vendor.a21Wwx5s.js","assets/index.JHaeFuYk.js","assets/animations.CWk52Myu.js","assets/InitTour.B1DnpL1R.js"])))=>i.map(i=>d[i]);
+var Lu=Object.defineProperty;var Du=(e,r,n)=>r in e?Lu(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var _n=(e,r,n)=>Du(e,typeof r!="symbol"?r+"":r,n);import{j as t,c as Ze,a as Pt,u as Re,A as Xn,P as fe,b as K,d as tt,D as Sr,C as Yn,S as io,R as Iu,e as Jn,f as ut,g as Xe,h as Qn,H as $u,t as Ca,i as Fu,k as lo,l as co,m as uo,n as fo,F as po,o as Bu,p as zu,q as mo,r as es,s as ts,v as ho,w as Vu,V as go,x as xo,y as vo,z as bo,T as yo,B as wo,E as Hu,G as jo,I as Uu,J as _o,K as Gu,L as Co,M as No,N as Ku,O as qu,Q as So,U as Wu,W as Zu,X as Xu,Y as Yu,Z as Ju,_ as Qu,$ as ef,a0 as Na,a1 as ko,a2 as Eo}from"./vendor.C2Ge5RaU.js";import{r as l,a as Ro,t as tf,g as kr,c as de,b as rf}from"./core-vendor.a21Wwx5s.js";import{m as ke,A as Ve,a as nf,u as sf,L as af,d as of}from"./animations.CWk52Myu.js";(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();const Sa= window.rapidload_optimizer.page_optimizer_package_base+"/assets/index.CaxZkPzF.css",lf="modulepreload",cf=function(e){return window.rapidload_optimizer.page_optimizer_package_base+"/"+e},ka={},Mo=function(r,n,s){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),i=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.all(n.map(d=>{if(d=cf(d),d in ka)return;ka[d]=!0;const u=d.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${f}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":lf,u||(m.as="script",m.crossOrigin=""),m.href=d,i&&m.setAttribute("nonce",i),document.head.appendChild(m),u)return new Promise((x,v)=>{m.addEventListener("load",x),m.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${d}`)))})}))}return a.then(()=>r()).catch(o=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o})};function df({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const fr=l.forwardRef(df);function uf({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 1.5H8.25A2.25 2.25 0 0 0 6 3.75v16.5a2.25 2.25 0 0 0 2.25 2.25h7.5A2.25 2.25 0 0 0 18 20.25V3.75a2.25 2.25 0 0 0-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"}))}const To=l.forwardRef(uf);function ff({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const Po=l.forwardRef(ff);var Ao={exports:{}},Oo={};/**
* @license React
* use-sync-external-store-shim.production.min.js
*
@@ -7,7 +7,7 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var Rt=l;function ff(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var pf=typeof Object.is=="function"?Object.is:ff,mf=Rt.useState,hf=Rt.useEffect,gf=Rt.useLayoutEffect,xf=Rt.useDebugValue;function vf(e,r){var n=r(),s=mf({inst:{value:n,getSnapshot:r}}),a=s[0].inst,o=s[1];return gf(function(){a.value=n,a.getSnapshot=r,Cn(a)&&o({inst:a})},[e,n,r]),hf(function(){return Cn(a)&&o({inst:a}),e(function(){Cn(a)&&o({inst:a})})},[e]),xf(n),n}function Cn(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!pf(e,n)}catch{return!0}}function bf(e,r){return r()}var yf=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?bf:vf;Ao.useSyncExternalStore=Rt.useSyncExternalStore!==void 0?Rt.useSyncExternalStore:yf;Po.exports=Ao;var wf=Po.exports,Oo={exports:{}},Lo={};/**
+ */var Rt=l;function pf(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var mf=typeof Object.is=="function"?Object.is:pf,hf=Rt.useState,gf=Rt.useEffect,xf=Rt.useLayoutEffect,vf=Rt.useDebugValue;function bf(e,r){var n=r(),s=hf({inst:{value:n,getSnapshot:r}}),a=s[0].inst,o=s[1];return xf(function(){a.value=n,a.getSnapshot=r,Cn(a)&&o({inst:a})},[e,n,r]),gf(function(){return Cn(a)&&o({inst:a}),e(function(){Cn(a)&&o({inst:a})})},[e]),vf(n),n}function Cn(e){var r=e.getSnapshot;e=e.value;try{var n=r();return!mf(e,n)}catch{return!0}}function yf(e,r){return r()}var wf=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?yf:bf;Oo.useSyncExternalStore=Rt.useSyncExternalStore!==void 0?Rt.useSyncExternalStore:wf;Ao.exports=Oo;var jf=Ao.exports,Lo={exports:{}},Do={};/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
@@ -15,14 +15,14 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var Er=l,jf=wf;function _f(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var Cf=typeof Object.is=="function"?Object.is:_f,Nf=jf.useSyncExternalStore,Sf=Er.useRef,kf=Er.useEffect,Ef=Er.useMemo,Rf=Er.useDebugValue;Lo.useSyncExternalStoreWithSelector=function(e,r,n,s,a){var o=Sf(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=Ef(function(){function u(j){if(!f){if(f=!0,m=j,j=s(j),a!==void 0&&i.hasValue){var y=i.value;if(a(y,j))return x=y}return x=j}if(y=x,Cf(m,j))return y;var w=s(j);return a!==void 0&&a(y,w)?y:(m=j,x=w)}var f=!1,m,x,v=n===void 0?null:n;return[function(){return u(r())},v===null?void 0:function(){return u(v())}]},[r,n,s,a]);var d=Nf(e,o[0],o[1]);return kf(function(){i.hasValue=!0,i.value=d},[d]),Rf(d),d};Oo.exports=Lo;var Mf=Oo.exports;function Tf(e){e()}let Do=Tf;const Pf=e=>Do=e,Af=()=>Do,ka=Symbol.for("react-redux-context"),Ea=typeof globalThis<"u"?globalThis:{};function Of(){var e;if(!l.createContext)return{};const r=(e=Ea[ka])!=null?e:Ea[ka]=new Map;let n=r.get(l.createContext);return n||(n=l.createContext(null),r.set(l.createContext,n)),n}const at=Of();function ts(e=at){return function(){return l.useContext(e)}}const Io=ts(),Lf=()=>{throw new Error("uSES not initialized!")};let $o=Lf;const Df=e=>{$o=e},If=(e,r)=>e===r;function $f(e=at){const r=e===at?Io:ts(e);return function(s,a={}){const{equalityFn:o=If,stabilityCheck:i=void 0,noopCheck:d=void 0}=typeof a=="function"?{equalityFn:a}:a,{store:u,subscription:f,getServerState:m,stabilityCheck:x,noopCheck:v}=r();l.useRef(!0);const j=l.useCallback({[s.name](w){return s(w)}}[s.name],[s,x,i]),y=$o(f.addNestedSub,u.getState,m||u.getState,j,o);return l.useDebugValue(y),y}}const ce=$f();var Fo={exports:{}},ie={};/** @license React v16.13.1
+ */var Er=l,_f=jf;function Cf(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var Nf=typeof Object.is=="function"?Object.is:Cf,Sf=_f.useSyncExternalStore,kf=Er.useRef,Ef=Er.useEffect,Rf=Er.useMemo,Mf=Er.useDebugValue;Do.useSyncExternalStoreWithSelector=function(e,r,n,s,a){var o=kf(null);if(o.current===null){var i={hasValue:!1,value:null};o.current=i}else i=o.current;o=Rf(function(){function u(j){if(!f){if(f=!0,m=j,j=s(j),a!==void 0&&i.hasValue){var b=i.value;if(a(b,j))return x=b}return x=j}if(b=x,Nf(m,j))return b;var w=s(j);return a!==void 0&&a(b,w)?b:(m=j,x=w)}var f=!1,m,x,v=n===void 0?null:n;return[function(){return u(r())},v===null?void 0:function(){return u(v())}]},[r,n,s,a]);var d=Sf(e,o[0],o[1]);return Ef(function(){i.hasValue=!0,i.value=d},[d]),Mf(d),d};Lo.exports=Do;var Tf=Lo.exports;function Pf(e){e()}let Io=Pf;const Af=e=>Io=e,Of=()=>Io,Ea=Symbol.for("react-redux-context"),Ra=typeof globalThis<"u"?globalThis:{};function Lf(){var e;if(!l.createContext)return{};const r=(e=Ra[Ea])!=null?e:Ra[Ea]=new Map;let n=r.get(l.createContext);return n||(n=l.createContext(null),r.set(l.createContext,n)),n}const at=Lf();function rs(e=at){return function(){return l.useContext(e)}}const $o=rs(),Df=()=>{throw new Error("uSES not initialized!")};let Fo=Df;const If=e=>{Fo=e},$f=(e,r)=>e===r;function Ff(e=at){const r=e===at?$o:rs(e);return function(s,a={}){const{equalityFn:o=$f,stabilityCheck:i=void 0,noopCheck:d=void 0}=typeof a=="function"?{equalityFn:a}:a,{store:u,subscription:f,getServerState:m,stabilityCheck:x,noopCheck:v}=r();l.useRef(!0);const j=l.useCallback({[s.name](w){return s(w)}}[s.name],[s,x,i]),b=Fo(f.addNestedSub,u.getState,m||u.getState,j,o);return l.useDebugValue(b),b}}const ce=Ff();var Bo={exports:{}},ie={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var je=typeof Symbol=="function"&&Symbol.for,rs=je?Symbol.for("react.element"):60103,ns=je?Symbol.for("react.portal"):60106,Rr=je?Symbol.for("react.fragment"):60107,Mr=je?Symbol.for("react.strict_mode"):60108,Tr=je?Symbol.for("react.profiler"):60114,Pr=je?Symbol.for("react.provider"):60109,Ar=je?Symbol.for("react.context"):60110,ss=je?Symbol.for("react.async_mode"):60111,Or=je?Symbol.for("react.concurrent_mode"):60111,Lr=je?Symbol.for("react.forward_ref"):60112,Dr=je?Symbol.for("react.suspense"):60113,Ff=je?Symbol.for("react.suspense_list"):60120,Ir=je?Symbol.for("react.memo"):60115,$r=je?Symbol.for("react.lazy"):60116,Bf=je?Symbol.for("react.block"):60121,zf=je?Symbol.for("react.fundamental"):60117,Vf=je?Symbol.for("react.responder"):60118,Hf=je?Symbol.for("react.scope"):60119;function Ie(e){if(typeof e=="object"&&e!==null){var r=e.$$typeof;switch(r){case rs:switch(e=e.type,e){case ss:case Or:case Rr:case Tr:case Mr:case Dr:return e;default:switch(e=e&&e.$$typeof,e){case Ar:case Lr:case $r:case Ir:case Pr:return e;default:return r}}case ns:return r}}}function Bo(e){return Ie(e)===Or}ie.AsyncMode=ss;ie.ConcurrentMode=Or;ie.ContextConsumer=Ar;ie.ContextProvider=Pr;ie.Element=rs;ie.ForwardRef=Lr;ie.Fragment=Rr;ie.Lazy=$r;ie.Memo=Ir;ie.Portal=ns;ie.Profiler=Tr;ie.StrictMode=Mr;ie.Suspense=Dr;ie.isAsyncMode=function(e){return Bo(e)||Ie(e)===ss};ie.isConcurrentMode=Bo;ie.isContextConsumer=function(e){return Ie(e)===Ar};ie.isContextProvider=function(e){return Ie(e)===Pr};ie.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===rs};ie.isForwardRef=function(e){return Ie(e)===Lr};ie.isFragment=function(e){return Ie(e)===Rr};ie.isLazy=function(e){return Ie(e)===$r};ie.isMemo=function(e){return Ie(e)===Ir};ie.isPortal=function(e){return Ie(e)===ns};ie.isProfiler=function(e){return Ie(e)===Tr};ie.isStrictMode=function(e){return Ie(e)===Mr};ie.isSuspense=function(e){return Ie(e)===Dr};ie.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Rr||e===Or||e===Tr||e===Mr||e===Dr||e===Ff||typeof e=="object"&&e!==null&&(e.$$typeof===$r||e.$$typeof===Ir||e.$$typeof===Pr||e.$$typeof===Ar||e.$$typeof===Lr||e.$$typeof===zf||e.$$typeof===Vf||e.$$typeof===Hf||e.$$typeof===Bf)};ie.typeOf=Ie;Fo.exports=ie;var Uf=Fo.exports,zo=Uf,Gf={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Kf={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Vo={};Vo[zo.ForwardRef]=Gf;Vo[zo.Memo]=Kf;var le={};/**
+ */var je=typeof Symbol=="function"&&Symbol.for,ns=je?Symbol.for("react.element"):60103,ss=je?Symbol.for("react.portal"):60106,Rr=je?Symbol.for("react.fragment"):60107,Mr=je?Symbol.for("react.strict_mode"):60108,Tr=je?Symbol.for("react.profiler"):60114,Pr=je?Symbol.for("react.provider"):60109,Ar=je?Symbol.for("react.context"):60110,as=je?Symbol.for("react.async_mode"):60111,Or=je?Symbol.for("react.concurrent_mode"):60111,Lr=je?Symbol.for("react.forward_ref"):60112,Dr=je?Symbol.for("react.suspense"):60113,Bf=je?Symbol.for("react.suspense_list"):60120,Ir=je?Symbol.for("react.memo"):60115,$r=je?Symbol.for("react.lazy"):60116,zf=je?Symbol.for("react.block"):60121,Vf=je?Symbol.for("react.fundamental"):60117,Hf=je?Symbol.for("react.responder"):60118,Uf=je?Symbol.for("react.scope"):60119;function Ie(e){if(typeof e=="object"&&e!==null){var r=e.$$typeof;switch(r){case ns:switch(e=e.type,e){case as:case Or:case Rr:case Tr:case Mr:case Dr:return e;default:switch(e=e&&e.$$typeof,e){case Ar:case Lr:case $r:case Ir:case Pr:return e;default:return r}}case ss:return r}}}function zo(e){return Ie(e)===Or}ie.AsyncMode=as;ie.ConcurrentMode=Or;ie.ContextConsumer=Ar;ie.ContextProvider=Pr;ie.Element=ns;ie.ForwardRef=Lr;ie.Fragment=Rr;ie.Lazy=$r;ie.Memo=Ir;ie.Portal=ss;ie.Profiler=Tr;ie.StrictMode=Mr;ie.Suspense=Dr;ie.isAsyncMode=function(e){return zo(e)||Ie(e)===as};ie.isConcurrentMode=zo;ie.isContextConsumer=function(e){return Ie(e)===Ar};ie.isContextProvider=function(e){return Ie(e)===Pr};ie.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ns};ie.isForwardRef=function(e){return Ie(e)===Lr};ie.isFragment=function(e){return Ie(e)===Rr};ie.isLazy=function(e){return Ie(e)===$r};ie.isMemo=function(e){return Ie(e)===Ir};ie.isPortal=function(e){return Ie(e)===ss};ie.isProfiler=function(e){return Ie(e)===Tr};ie.isStrictMode=function(e){return Ie(e)===Mr};ie.isSuspense=function(e){return Ie(e)===Dr};ie.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Rr||e===Or||e===Tr||e===Mr||e===Dr||e===Bf||typeof e=="object"&&e!==null&&(e.$$typeof===$r||e.$$typeof===Ir||e.$$typeof===Pr||e.$$typeof===Ar||e.$$typeof===Lr||e.$$typeof===Vf||e.$$typeof===Hf||e.$$typeof===Uf||e.$$typeof===zf)};ie.typeOf=Ie;Bo.exports=ie;var Gf=Bo.exports,Vo=Gf,Kf={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},qf={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ho={};Ho[Vo.ForwardRef]=Kf;Ho[Vo.Memo]=qf;var le={};/**
* @license React
* react-is.production.min.js
*
@@ -30,12 +30,12 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
- */var as=Symbol.for("react.element"),os=Symbol.for("react.portal"),Fr=Symbol.for("react.fragment"),Br=Symbol.for("react.strict_mode"),zr=Symbol.for("react.profiler"),Vr=Symbol.for("react.provider"),Hr=Symbol.for("react.context"),qf=Symbol.for("react.server_context"),Ur=Symbol.for("react.forward_ref"),Gr=Symbol.for("react.suspense"),Kr=Symbol.for("react.suspense_list"),qr=Symbol.for("react.memo"),Wr=Symbol.for("react.lazy"),Wf=Symbol.for("react.offscreen"),Ho;Ho=Symbol.for("react.module.reference");function He(e){if(typeof e=="object"&&e!==null){var r=e.$$typeof;switch(r){case as:switch(e=e.type,e){case Fr:case zr:case Br:case Gr:case Kr:return e;default:switch(e=e&&e.$$typeof,e){case qf:case Hr:case Ur:case Wr:case qr:case Vr:return e;default:return r}}case os:return r}}}le.ContextConsumer=Hr;le.ContextProvider=Vr;le.Element=as;le.ForwardRef=Ur;le.Fragment=Fr;le.Lazy=Wr;le.Memo=qr;le.Portal=os;le.Profiler=zr;le.StrictMode=Br;le.Suspense=Gr;le.SuspenseList=Kr;le.isAsyncMode=function(){return!1};le.isConcurrentMode=function(){return!1};le.isContextConsumer=function(e){return He(e)===Hr};le.isContextProvider=function(e){return He(e)===Vr};le.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===as};le.isForwardRef=function(e){return He(e)===Ur};le.isFragment=function(e){return He(e)===Fr};le.isLazy=function(e){return He(e)===Wr};le.isMemo=function(e){return He(e)===qr};le.isPortal=function(e){return He(e)===os};le.isProfiler=function(e){return He(e)===zr};le.isStrictMode=function(e){return He(e)===Br};le.isSuspense=function(e){return He(e)===Gr};le.isSuspenseList=function(e){return He(e)===Kr};le.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Fr||e===zr||e===Br||e===Gr||e===Kr||e===Wf||typeof e=="object"&&e!==null&&(e.$$typeof===Wr||e.$$typeof===qr||e.$$typeof===Vr||e.$$typeof===Hr||e.$$typeof===Ur||e.$$typeof===Ho||e.getModuleId!==void 0)};le.typeOf=He;function Zf(){const e=Af();let r=null,n=null;return{clear(){r=null,n=null},notify(){e(()=>{let s=r;for(;s;)s.callback(),s=s.next})},get(){let s=[],a=r;for(;a;)s.push(a),a=a.next;return s},subscribe(s){let a=!0,o=n={callback:s,next:null,prev:n};return o.prev?o.prev.next=o:r=o,function(){!a||r===null||(a=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:r=o.next)}}}}const Ra={notify(){},get:()=>[]};function Xf(e,r){let n,s=Ra,a=0,o=!1;function i(w){m();const _=s.subscribe(w);let M=!1;return()=>{M||(M=!0,_(),x())}}function d(){s.notify()}function u(){y.onStateChange&&y.onStateChange()}function f(){return o}function m(){a++,n||(n=e.subscribe(u),s=Zf())}function x(){a--,n&&a===0&&(n(),n=void 0,s.clear(),s=Ra)}function v(){o||(o=!0,m())}function j(){o&&(o=!1,x())}const y={addNestedSub:i,notifyNestedSubs:d,handleChangeWrapper:u,isSubscribed:f,trySubscribe:v,tryUnsubscribe:j,getListeners:()=>s};return y}const Yf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Jf=Yf?l.useLayoutEffect:l.useEffect;function Qf({store:e,context:r,children:n,serverState:s,stabilityCheck:a="once",noopCheck:o="once"}){const i=l.useMemo(()=>{const f=Xf(e);return{store:e,subscription:f,getServerState:s?()=>s:void 0,stabilityCheck:a,noopCheck:o}},[e,s,a,o]),d=l.useMemo(()=>e.getState(),[e]);Jf(()=>{const{subscription:f}=i;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),d!==e.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[i,d]);const u=r||at;return l.createElement(u.Provider,{value:i},n)}function Uo(e=at){const r=e===at?Io:ts(e);return function(){const{store:s}=r();return s}}const ep=Uo();function tp(e=at){const r=e===at?ep:Uo(e);return function(){return r().dispatch}}const ot=tp();Df(Mf.useSyncExternalStoreWithSelector);Pf(Eo.unstable_batchedUpdates);const xe=()=>{const e=ot(),r=ce(s=>s.common[s.app.activeReport]),n=ce(s=>s.common);return{dispatch:e,common:r,...r,...n}},Go="SET_STATE",Ko="SET_ROOT_STATE",ae=(e,r)=>async(n,s)=>{const a=s().app.activeReport;n({type:Go,payload:{activeReport:a,key:e,value:r}})},An=(e,r)=>async(n,s)=>{n({type:Ko,payload:{key:e,value:r}})},qo=l.createContext(null),rp=({children:e,initShowOptimizerValue:r,global:n,mode:s,modeData:a})=>{document.getElementById("wpadminbar");const[o,i]=l.useState(!1),[d,u]=l.useState(!1),[f,m]=l.useState(!1);l.useState(!1);const[x,v]=l.useState([]),[j,y]=l.useState({optimizer_url:"https://rapidload.io/",ajax_url:"http://rapidload.local/wp-admin/admin-ajax.php",page_optimizer_base:"",page_optimizer_package_base:"",plugin_url:"",nonce:"",timezone:"UTC",actions:[],load_optimizer:!1,rapidload_version:"2.2.0",rest_url:"https://rapidload.local/wp-json/rapidload/v1",...window.rapidload_optimizer?window.rapidload_optimizer:{}});l.useState("desktop");const[w,_]=l.useState(!1),[M,T]=l.useState(!0),L=l.useRef(null),[$,X]=l.useState(!1),{dispatch:z}=xe();l.useEffect(()=>{const D=Q=>{const{detail:Y}=Q;typeof(Y==null?void 0:Y.status)!==void 0&&i((Y==null?void 0:Y.status)||!1)};window.addEventListener("rapidLoad:set-optimizer",D),m(!0),s&&z(An("mode",s)),a&&z(An("modeData",a));const U=new CustomEvent("rapidLoad:optimizer-mounted");return window.dispatchEvent(U),()=>{window.removeEventListener("rapidLoad:set-optimizer",D)}},[]),l.useEffect(()=>{o?document.documentElement.classList.add("rapidload-optimizer-open"):document.documentElement.classList.remove("rapidload-optimizer-open")},[o]);const A=D=>{D?i(D):requestAnimationFrame(()=>{i(D)})};return t.jsx(qo.Provider,{value:{showOptimizer:o,setShowOptimizer:A,options:j,openAudits:x,setOpenAudits:v,version:"1.3.3",mode:s,modeData:a,manipulatingStyles:d,global:n,togglePerformance:M,setTogglePerformance:T,savingData:w,setSavingData:_,optimizerContainer:L,invalidatingCache:$,setInvalidatingCache:X},children:e})},he=()=>{const e=l.useContext(qo);if(e===null)throw new Error("useAppContext must be used within an AppProvider");return e};var[Zr,Hx]=Ze("Tooltip",[Pt]),Xr=Pt(),Wo="TooltipProvider",np=700,On="tooltip.open",[sp,is]=Zr(Wo),Zo=e=>{const{__scopeTooltip:r,delayDuration:n=np,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:o}=e,[i,d]=l.useState(!0),u=l.useRef(!1),f=l.useRef(0);return l.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),t.jsx(sp,{scope:r,isOpenDelayed:i,delayDuration:n,onOpen:l.useCallback(()=>{window.clearTimeout(f.current),d(!1)},[]),onClose:l.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>d(!0),s)},[s]),isPointerInTransitRef:u,onPointerInTransitChange:l.useCallback(m=>{u.current=m},[]),disableHoverableContent:a,children:o})};Zo.displayName=Wo;var Yr="Tooltip",[ap,Jr]=Zr(Yr),Xo=e=>{const{__scopeTooltip:r,children:n,open:s,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:d}=e,u=is(Yr,e.__scopeTooltip),f=Xr(r),[m,x]=l.useState(null),v=ut(),j=l.useRef(0),y=i??u.disableHoverableContent,w=d??u.delayDuration,_=l.useRef(!1),[M=!1,T]=Xe({prop:s,defaultProp:a,onChange:A=>{A?(u.onOpen(),document.dispatchEvent(new CustomEvent(On))):u.onClose(),o==null||o(A)}}),L=l.useMemo(()=>M?_.current?"delayed-open":"instant-open":"closed",[M]),$=l.useCallback(()=>{window.clearTimeout(j.current),_.current=!1,T(!0)},[T]),X=l.useCallback(()=>{window.clearTimeout(j.current),T(!1)},[T]),z=l.useCallback(()=>{window.clearTimeout(j.current),j.current=window.setTimeout(()=>{_.current=!0,T(!0)},w)},[w,T]);return l.useEffect(()=>()=>window.clearTimeout(j.current),[]),t.jsx(Jn,{...f,children:t.jsx(ap,{scope:r,contentId:v,open:M,stateAttribute:L,trigger:m,onTriggerChange:x,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayed?z():$()},[u.isOpenDelayed,z,$]),onTriggerLeave:l.useCallback(()=>{y?X():window.clearTimeout(j.current)},[X,y]),onOpen:$,onClose:X,disableHoverableContent:y,children:n})})};Xo.displayName=Yr;var Ln="TooltipTrigger",Yo=l.forwardRef((e,r)=>{const{__scopeTooltip:n,...s}=e,a=Jr(Ln,n),o=is(Ln,n),i=Xr(n),d=l.useRef(null),u=Re(r,d,a.onTriggerChange),f=l.useRef(!1),m=l.useRef(!1),x=l.useCallback(()=>f.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),t.jsx(Zn,{asChild:!0,...i,children:t.jsx(ue.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:u,onPointerMove:K(e.onPointerMove,v=>{v.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),m.current=!0)}),onPointerLeave:K(e.onPointerLeave,()=>{a.onTriggerLeave(),m.current=!1}),onPointerDown:K(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:K(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:K(e.onBlur,a.onClose),onClick:K(e.onClick,a.onClose)})})});Yo.displayName=Ln;var op="TooltipPortal",[Ux,ip]=Zr(op,{forceMount:void 0}),Mt="TooltipContent",Jo=l.forwardRef((e,r)=>{const n=ip(Mt,e.__scopeTooltip),{forceMount:s=n.forceMount,side:a="top",...o}=e,i=Jr(Mt,e.__scopeTooltip);return t.jsx(tt,{present:s||i.open,children:i.disableHoverableContent?t.jsx(Qo,{side:a,...o,ref:r}):t.jsx(lp,{side:a,...o,ref:r})})}),lp=l.forwardRef((e,r)=>{const n=Jr(Mt,e.__scopeTooltip),s=is(Mt,e.__scopeTooltip),a=l.useRef(null),o=Re(r,a),[i,d]=l.useState(null),{trigger:u,onClose:f}=n,m=a.current,{onPointerInTransitChange:x}=s,v=l.useCallback(()=>{d(null),x(!1)},[x]),j=l.useCallback((y,w)=>{const _=y.currentTarget,M={x:y.clientX,y:y.clientY},T=fp(M,_.getBoundingClientRect()),L=pp(M,T),$=mp(w.getBoundingClientRect()),X=gp([...L,...$]);d(X),x(!0)},[x]);return l.useEffect(()=>()=>v(),[v]),l.useEffect(()=>{if(u&&m){const y=_=>j(_,m),w=_=>j(_,u);return u.addEventListener("pointerleave",y),m.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",y),m.removeEventListener("pointerleave",w)}}},[u,m,j,v]),l.useEffect(()=>{if(i){const y=w=>{const _=w.target,M={x:w.clientX,y:w.clientY},T=(u==null?void 0:u.contains(_))||(m==null?void 0:m.contains(_)),L=!hp(M,i);T?v():L&&(v(),f())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[u,m,i,f,v]),t.jsx(Qo,{...e,ref:o})}),[cp,dp]=Zr(Yr,{isInside:!1}),Qo=l.forwardRef((e,r)=>{const{__scopeTooltip:n,children:s,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:i,...d}=e,u=Jr(Mt,n),f=Xr(n),{onClose:m}=u;return l.useEffect(()=>(document.addEventListener(On,m),()=>document.removeEventListener(On,m)),[m]),l.useEffect(()=>{if(u.trigger){const x=v=>{const j=v.target;j!=null&&j.contains(u.trigger)&&m()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[u.trigger,m]),t.jsx(Sr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:t.jsxs(Xn,{"data-state":u.stateAttribute,...f,...d,ref:r,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(oo,{children:s}),t.jsx(cp,{scope:n,isInside:!0,children:t.jsx(Du,{id:u.contentId,role:"tooltip",children:a||s})})]})})});Jo.displayName=Mt;var ei="TooltipArrow",up=l.forwardRef((e,r)=>{const{__scopeTooltip:n,...s}=e,a=Xr(n);return dp(ei,n).isInside?null:t.jsx(Yn,{...a,...s,ref:r})});up.displayName=ei;function fp(e,r){const n=Math.abs(r.top-e.y),s=Math.abs(r.bottom-e.y),a=Math.abs(r.right-e.x),o=Math.abs(r.left-e.x);switch(Math.min(n,s,a,o)){case o:return"left";case a:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function pp(e,r,n=5){const s=[];switch(r){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function mp(e){const{top:r,right:n,bottom:s,left:a}=e;return[{x:a,y:r},{x:n,y:r},{x:n,y:s},{x:a,y:s}]}function hp(e,r){const{x:n,y:s}=e;let a=!1;for(let o=0,i=r.length-1;os!=m>s&&n<(f-d)*(s-u)/(m-u)+d&&(a=!a)}return a}function gp(e){const r=e.slice();return r.sort((n,s)=>n.xs.x?1:n.ys.y?1:0),xp(r)}function xp(e){if(e.length<=1)return e.slice();const r=[];for(let s=0;s=2;){const o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(a.y-i.y)>=(o.y-i.y)*(a.x-i.x))r.pop();else break}r.push(a)}r.pop();const n=[];for(let s=e.length-1;s>=0;s--){const a=e[s];for(;n.length>=2;){const o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(a.y-i.y)>=(o.y-i.y)*(a.x-i.x))n.pop();else break}n.push(a)}return n.pop(),r.length===1&&n.length===1&&r[0].x===n[0].x&&r[0].y===n[0].y?r:r.concat(n)}var vp=Zo,bp=Xo,yp=Yo,ti=Jo;const ri=l.createContext(null),wp=({children:e})=>{const[r,n]=l.useState("light"),[s,a]=l.useState(!1);l.useEffect(()=>{const i=typeof window<"u"&&window.localStorage.getItem("rapidload-theme");i&&n(i)},[]),l.useEffect(()=>{typeof window<"u"&&window.localStorage.setItem("rapidload-theme",r)},[r]);const o=()=>{n(r==="dark"?"light":"dark")};return t.jsx(ri.Provider,{value:{theme:r,setTheme:n,isDark:s,setIsDark:a,changeTheme:o},children:e})},At=()=>{const e=l.useContext(ri);if(e===null)throw new Error("useRootContext must be used within an useRootContext");return e},Zt=({code:e,lang:r="html",className:n})=>{const{theme:s,isDark:a}=At();return t.jsx(Iu,{theme:a?_a.vsDark:_a.github,language:r,code:e,children:({className:o,style:i,tokens:d,getLineProps:u,getTokenProps:f})=>t.jsx("pre",{className:S(o,n,"w-fit"),children:d.map((m,x)=>t.jsx("div",{...u({line:m}),className:"text-xs w-full flex flex-row p-2 bg-brand-200/80 dark:bg-brand-800 overflow-hidden rounded-lg flex-wrap",children:m.map((v,j)=>t.jsx("span",{...f({token:v})},j))},x))})})};function S(...e){return ef($u(e))}function ni(e){return["offscreen-images","modern-image-formats","unsized-images","uses-responsive-images","uses-optimized-images"].includes(e)}function si(e,r){return e.id==="lcp-lazy-loaded"&&r==="unknown"&&(r="image"),r==="google_font"&&(r="font"),r==="data_image"&&(r="image"),r==="js"&&(r="javascript"),r}const Dn=!1;function jp(e){try{return new URL(e),!0}catch{return!1}}function fr(e,r,n=!0){try{if(e==="Unattributable")return e;const s=new URL(e),a=e.endsWith("/");if(s.pathname.split("/").pop()==="")return`${s.protocol}//${s.host}`;const i=s.pathname.split("/"),d=i[i.length-2],u=i[i.length-1];let f=n?`${s.protocol}//${s.host}/.../${d}/`:`.../${d}/`,m=u;if(f.length+u.length>r){const v=f.length+u.length-r;m=`...${u.slice(v+3)}`}return f+m+(a?"/":"")}catch{if(e)return t.jsx(Zt,{code:e})}}function _p(e,r=1){return(Math.round(e/r)*r).toFixed(Math.max(0,Math.ceil(-Math.log10(r))))}function Nn(e){const r=new Date(e),s=Math.round((new Date-r)/1e3),a=Math.round(s/60),o=Math.round(a/60),i=Math.round(o/24),d=Math.round(i/30.44),u=Math.round(i/365.24);return s<60?"just now":s<60?`${s} seconds ago`:a<60?`${a} minutes ago`:o<24?`${o} hours ago`:i<30?`${i} days ago`:d<12?`${d} months ago`:`${u} years ago`}function Cp(e){return e===!0||e===1||e==="1"||e==="true"}const ls=vp,Qr=bp,en=yp,Jt=l.forwardRef(({className:e,sideOffset:r=4,...n},s)=>t.jsx(ti,{ref:s,sideOffset:r,className:S("z-[110001] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Jt.displayName=ti.displayName;const me=({text:e,children:r,onClick:n,className:s,asChild:a=!1,delay:o=500})=>t.jsx(ls,{disableHoverableContent:!1,delayDuration:o,children:t.jsxs(Qr,{children:[t.jsx(en,{asChild:a,onClick:i=>n&&n(),className:S("flex items-center"),children:r}),t.jsx(Jt,{className:s,children:e})]})}),ai="FETCH_REPORT_REQUEST",oi="FETCH_REPORT_SUCCESS",In="FETCH_REPORT_FAILURE",ii="FETCH_SETTING_REQUEST",li="FETCH_SETTING_SUCCESS",$n="FETCH_SETTING_FAILURE",ci="UPDATE_SETTINGS",di="CHANGE_GEAR",ui="CHANGE_REPORT_TYPE",fi="UPDATE_FILE_ACTION",pi="GET_CSS_STATUS_SUCCESS",mi="UPDATE_TEST_MODE";function Fn(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Sn=function(){return Math.random().toString(36).substring(7).split("").join(".")},Ma={INIT:"@@redux/INIT"+Sn(),REPLACE:"@@redux/REPLACE"+Sn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Sn()}};function Np(e){Object.keys(e).forEach(function(r){var n=e[r],s=n(void 0,{type:Ma.INIT});if(typeof s>"u")throw new Error(Fn(12));if(typeof n(void 0,{type:Ma.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Fn(13))})}function Sp(e){for(var r=Object.keys(e),n={},s=0;s"u")throw f&&f.type,new Error(Fn(14));x[j]=_,m=m||_!==w}return m=m||o.length!==Object.keys(u).length,m?x:u}}const Ta={original:null,changes:{files:[]},data:null,error:null,loading:!1,settings:[],originalSettings:[],revisions:[],state:{}},kp={activeReport:"desktop",cssStatus:null,testMode:null,report:{mobile:Ta,desktop:Ta},settings:{performance:{mobile:{original:[],state:[],error:null,loading:!1},desktop:{original:[],state:[],error:null,loading:!1}},general:{test_mode:!0,performance_gear:"accelerate"},actions:[]}},Ep=(e=kp,r)=>{switch(r.type){case pi:return{...e,cssStatus:r.payload};case mi:return{...e,testMode:r.payload,settings:{...e.settings,general:{...e.settings.general,test_mode:r.payload.status}}};case ai:return{...e,report:{...e.report,[e.activeReport]:{...e.report[e.activeReport],loading:!0,error:null}}};case oi:return{...e,report:{...e.report,[r.payload.activeReport]:{...e.report[r.payload.activeReport],data:r.payload.data.data,error:null,loading:!1,revisions:r.payload.data.revisions}}};case In:return{...e,report:{...e.report,[e.activeReport]:{error:r.error,loading:!1}}};case ii:return{...e,settings:{...e.settings,performance:{...e.settings.performance,[e.activeReport]:{...e.settings.performance[e.activeReport],loading:!0,error:null}}}};case li:return{...e,settings:{...e.settings,general:r.payload.data.general,actions:r.payload.data.actions,performance:{...e.settings.performance,[r.payload.activeReport]:{...e.settings.performance[r.payload.activeReport],original:JSON.parse(JSON.stringify(r.payload.data.data)),state:r.payload.data.data,error:null,loading:!1}}}};case $n:return{...e,settings:{...e.settings,performance:{...e.settings.performance,[e.activeReport]:{error:r.error,loading:!1}}}};case ci:return{...e,settings:{...e.settings,performance:{...e.settings.performance,[e.activeReport]:{...e.settings.performance[e.activeReport],state:r.payload.settings}}}};case di:return{...e,settings:{...e.settings,general:{...e.settings.general,performance_gear:r.payload.mode},performance:{...e.settings.performance,[e.activeReport]:{...e.settings.performance[e.activeReport],state:r.payload.settings}}}};case ui:return{...e,activeReport:r.reportType};case fi:const{payload:n}=r,s=e.report[e.activeReport];return s.changes.files.filter(o=>o.file===n.file).length==0&&s.changes.files.push({...n,value:n.prev}),s.changes.files.push(n),s.data&&(s.data.audits=s.data.audits.map(o=>{if(o.files&&o.files.items&&(o.files.type==="table"||o.files.type==="opportunity")){const i=d=>d.url&&typeof d.url=="object"&&d.action&&d.url.url===n.file?{...d,action:{...d.action,value:n.value}}:d;o.files.items=o.files.items.map(i),o.files.grouped_items&&(o.files.grouped_items=o.files.grouped_items.map(d=>({...d,items:d.items.map(i)})))}return o})),{...e,[e.activeReport]:{...s}};default:return e}},Rp={optimizerRoot:null,mode:"normal",isTourOpen:!1,mobile:{activeTab:"configurations",openAudits:[],hoveredMetric:null,activeMetric:null,settingsMode:null},desktop:{activeTab:"configurations",openAudits:[],hoveredMetric:null,activeMetric:null,settingsMode:null}},Mp=(e=Rp,r)=>{switch(r.type){case Go:return{...e,[r.payload.activeReport]:{...e[r.payload.activeReport],[r.payload.key]:r.payload.value}};case Ko:return{...e,[r.payload.key]:r.payload.value};default:return e}},Tp=Sp({app:Ep,common:Mp});function Ne(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Pp=typeof Symbol=="function"&&Symbol.observable||"@@observable",Pa=Pp,kn=()=>Math.random().toString(36).substring(7).split("").join("."),Ap={INIT:`@@redux/INIT${kn()}`,REPLACE:`@@redux/REPLACE${kn()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${kn()}`},pr=Ap;function hi(e){if(typeof e!="object"||e===null)return!1;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r||Object.getPrototypeOf(e)===null}function gi(e,r,n){if(typeof e!="function")throw new Error(Ne(2));if(typeof r=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ne(0));if(typeof r=="function"&&typeof n>"u"&&(n=r,r=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ne(1));return n(gi)(e,r)}let s=e,a=r,o=new Map,i=o,d=0,u=!1;function f(){i===o&&(i=new Map,o.forEach((_,M)=>{i.set(M,_)}))}function m(){if(u)throw new Error(Ne(3));return a}function x(_){if(typeof _!="function")throw new Error(Ne(4));if(u)throw new Error(Ne(5));let M=!0;f();const T=d++;return i.set(T,_),function(){if(M){if(u)throw new Error(Ne(6));M=!1,f(),i.delete(T),o=null}}}function v(_){if(!hi(_))throw new Error(Ne(7));if(typeof _.type>"u")throw new Error(Ne(8));if(typeof _.type!="string")throw new Error(Ne(17));if(u)throw new Error(Ne(9));try{u=!0,a=s(a,_)}finally{u=!1}return(o=i).forEach(T=>{T()}),_}function j(_){if(typeof _!="function")throw new Error(Ne(10));s=_,v({type:pr.REPLACE})}function y(){const _=x;return{subscribe(M){if(typeof M!="object"||M===null)throw new Error(Ne(11));function T(){const $=M;$.next&&$.next(m())}return T(),{unsubscribe:_(T)}},[Pa](){return this}}}return v({type:pr.INIT}),{dispatch:v,subscribe:x,getState:m,replaceReducer:j,[Pa]:y}}function Op(e){Object.keys(e).forEach(r=>{const n=e[r];if(typeof n(void 0,{type:pr.INIT})>"u")throw new Error(Ne(12));if(typeof n(void 0,{type:pr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ne(13))})}function Lp(e){const r=Object.keys(e),n={};for(let o=0;o"u")throw d&&d.type,new Error(Ne(14));f[x]=y,u=u||y!==j}return u=u||s.length!==Object.keys(i).length,u?f:i}}function mr(...e){return e.length===0?r=>r:e.length===1?e[0]:e.reduce((r,n)=>(...s)=>r(n(...s)))}function Dp(...e){return r=>(n,s)=>{const a=r(n,s);let o=()=>{throw new Error(Ne(15))};const i={getState:a.getState,dispatch:(u,...f)=>o(u,...f)},d=e.map(u=>u(i));return o=mr(...d)(a.dispatch),{...a,dispatch:o}}}function Ip(e,r=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(r)}function $p(e,r=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(r)}function Fp(e,r="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${r}[${n}]`)}}var Aa=e=>Array.isArray(e)?e:[e];function Bp(e){const r=Array.isArray(e[0])?e[0]:e;return Fp(r,"createSelector expects all input-selectors to be functions, but received the following types: "),r}function zp(e,r){const n=[],{length:s}=e;for(let a=0;a{n=ir(),i.resetResultsCount()},i.resultsCount=()=>o,i.resetResultsCount=()=>{o=0},i}function Gp(e,...r){const n=typeof e=="function"?{memoize:e,memoizeOptions:r}:e,s=(...a)=>{let o=0,i=0,d,u={},f=a.pop();typeof f=="object"&&(u=f,f=a.pop()),Ip(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const m={...n,...u},{memoize:x,memoizeOptions:v=[],argsMemoize:j=xi,argsMemoizeOptions:y=[],devModeChecks:w={}}=m,_=Aa(v),M=Aa(y),T=Bp(a),L=x(function(){return o++,f.apply(null,arguments)},..._),$=j(function(){i++;const z=zp(T,arguments);return d=L.apply(null,z),d},...M);return Object.assign($,{resultFunc:f,memoizedResultFunc:L,dependencies:T,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>d,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:x,argsMemoize:j})};return Object.assign(s,{withTypes:()=>s}),s}var vi=Gp(xi),Kp=Object.assign((e,r=vi)=>{$p(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),s=n.map(o=>e[o]);return r(s,(...o)=>o.reduce((i,d,u)=>(i[n[u]]=d,i),{}))},{withTypes:()=>Kp});function bi(e){return({dispatch:n,getState:s})=>a=>o=>typeof o=="function"?o(n,s,e):a(o)}var qp=bi(),Wp=bi,Zp=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?mr:mr.apply(null,arguments)},yi=class Ht extends Array{constructor(...r){super(...r),Object.setPrototypeOf(this,Ht.prototype)}static get[Symbol.species](){return Ht}concat(...r){return super.concat.apply(this,r)}prepend(...r){return r.length===1&&Array.isArray(r[0])?new Ht(...r[0].concat(this)):new Ht(...r.concat(this))}};function Xp(e){return typeof e=="boolean"}var Yp=()=>function(r){const{thunk:n=!0,immutableCheck:s=!0,serializableCheck:a=!0,actionCreatorCheck:o=!0}=r??{};let i=new yi;return n&&(Xp(n)?i.push(qp):i.push(Wp(n.extraArgument))),i},Jp="RTK_autoBatch",wi=e=>r=>{setTimeout(r,e)},Qp=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:wi(10),em=(e={type:"raf"})=>r=>(...n)=>{const s=r(...n);let a=!0,o=!1,i=!1;const d=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?Qp:e.type==="callback"?e.queueNotification:wi(e.timeout),f=()=>{i=!1,o&&(o=!1,d.forEach(m=>m()))};return Object.assign({},s,{subscribe(m){const x=()=>a&&m(),v=s.subscribe(x);return d.add(m),()=>{v(),d.delete(m)}},dispatch(m){var x;try{return a=!((x=m==null?void 0:m.meta)!=null&&x[Jp]),o=!a,o&&(i||(i=!0,u(f))),s.dispatch(m)}finally{a=!0}}})},tm=e=>function(n){const{autoBatch:s=!0}=n??{};let a=new yi(e);return s&&a.push(em(typeof s=="object"?s:void 0)),a};function rm(e){const r=Yp(),{reducer:n=void 0,middleware:s,devTools:a=!0,preloadedState:o=void 0,enhancers:i=void 0}=e||{};let d;if(typeof n=="function")d=n;else if(hi(n))d=Lp(n);else throw new Error(nm(1));let u;typeof s=="function"?u=s(r):u=r();let f=mr;a&&(f=Zp({trace:!1,...typeof a=="object"&&a}));const m=Dp(...u),x=tm(m);let v=typeof i=="function"?i(x):x();const j=f(...v);return gi(d,o,j)}function nm(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const ji=rm({reducer:Tp}),sm=1,am=1e6;let En=0;function om(){return En=(En+1)%Number.MAX_VALUE,En.toString()}const Rn=new Map,La=e=>{if(Rn.has(e))return;const r=setTimeout(()=>{Rn.delete(e),qt({type:"REMOVE_TOAST",toastId:e})},am);Rn.set(e,r)},im=(e,r)=>{switch(r.type){case"ADD_TOAST":return{...e,toasts:[r.toast,...e.toasts].slice(0,sm)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===r.toast.id?{...n,...r.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=r;return n?La(n):e.toasts.forEach(s=>{La(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===n||n===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return r.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==r.toastId)}}},cr=[];let dr={toasts:[]};function qt(e){dr=im(dr,e),cr.forEach(r=>{r(dr)})}function Ue({...e},r=3e3){const n=om(),s=o=>qt({type:"UPDATE_TOAST",toast:{...o,id:n}}),a=()=>qt({type:"DISMISS_TOAST",toastId:n});return qt({type:"ADD_TOAST",toast:{...e,id:n,open:!0,duration:r,onOpenChange:o=>{o||a()}}}),{id:n,dismiss:a,update:s}}function gt(){const[e,r]=l.useState(dr);return l.useEffect(()=>(cr.push(r),()=>{const n=cr.indexOf(r);n>-1&&cr.splice(n,1)}),[e]),{...e,toast:Ue,dismiss:n=>qt({type:"DISMISS_TOAST",toastId:n})}}class et{constructor(r,n,s){_n(this,"baseURL");_n(this,"options");r||(r=window.rapidload_optimizer),this.options=r;let a=r!=null&&r.ajax_url?r.ajax_url:"http://rapidload.local/wp-admin/admin-ajax.php";const o=new URLSearchParams(n);s&&o.append("action",s),r!=null&&r.nonce&&!o.has("nonce")&&o.append("nonce",r.nonce),this.baseURL=new URL(a+"?"+o.toString())}async throwIfError(r,n=null){if(!r.ok)throw new Error("Oops! The request failed");let s=await r.json();if(!s.success){if(s.data.reload)return s.data;throw Array.isArray(s==null?void 0:s.data)?new Error(`[Code:${s.data[0].code}] ${s.data[0].detail?s.data[0].detail:"Internal error occurred on our end :("}`):new Error("Problem Retrieving Data: Our Apologies. For Assistance, Please Reach Out to Customer Support.")}return{...s,state:n}}async fetchPageSpeed(r,n,s){try{let a=s,o=null;if(s&&(o=await this.analyzeViaAPI(r,n),o!=null&&o.errors))throw Array.isArray(o==null?void 0:o.errors)?new Error(`[Code:${o.errors[0].code}] ${o.errors[0].detail}`):new Error("Oops! Something went wrong :(");const i=new URLSearchParams;this.baseURL.searchParams.append("action","fetch_page_speed"),this.baseURL.searchParams.append("url",r),this.baseURL.searchParams.append("strategy",n),this.baseURL.searchParams.append("new",s),this.baseURL.searchParams.append("is_dev",Dn);const d=await fetch(this.baseURL,{method:o?"POST":"GET",headers:{"Content-Type":"application/json"},...o?{body:JSON.stringify({page_speed:o})}:{}});let u=await this.throwIfError(d,{fresh:s});return u!=null&&u.reload?await this.fetchPageSpeed(r,n,!0):u}catch(a){throw console.error(a),a}}async fetchSettings(r,n,s){try{let a=s,o=null;const i=new URLSearchParams;this.baseURL.searchParams.append("action","fetch_titan_settings"),this.baseURL.searchParams.append("url",r),this.baseURL.searchParams.append("strategy",n),this.baseURL.searchParams.append("new",s),this.baseURL.searchParams.append("is_dev",Dn);const d=await fetch(this.baseURL,{method:o?"POST":"GET",headers:{"Content-Type":"application/json"}});let u=await this.throwIfError(d,{fresh:s});return u!=null&&u.reload?await this.fetchPageSpeed(r,n,!0):u}catch(a){throw console.error(a),Ue({description:"Failed to fetch RapidLoad settings!",variant:"destructive"}),a}}async analyzeViaAPI(r,n){var s,a,o;try{const i=ji.getState(),d=i.app.report[i.app.activeReport],u=i.app.settings.performance[i.app.activeReport],m=((s=i.app.testMode)==null?void 0:s.status)??i.app.settings.general.test_mode??!1?"?rapidload_preview":"",x=((a=this.options)==null?void 0:a.api_root)||"https://api.rapidload.io/api/v1",v=new URL(`${x}/page-speed`);return v.searchParams.append("url",r+m),v.searchParams.append("strategy",i.app.activeReport),v.searchParams.append("plugin_version",this.options.rapidload_version),v.searchParams.append("titan_version","1.3.3"),this.options.license_key&&v.searchParams.append("api_key",this.options.license_key),await(await fetch(v,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:((o=u.state)==null?void 0:o.flatMap(y=>y.inputs.filter(({value:w})=>w!=null).map(({key:w,value:_})=>({key:w,value:_,status:y.status}))))||[]})})).json()}catch(i){throw console.error(i),i}}async getCSSJobStatus(r,n){try{this.baseURL.searchParams.append("action","rapidload_css_job_status"),this.baseURL.searchParams.append("url",r),this.baseURL.searchParams.append("types",n.join(","));const s=await fetch(this.baseURL,{method:"GET",headers:{"Content-Type":"application/json"}});return this.throwIfError(s)}catch(s){throw console.error(s),s}}async getTestMode(r,n){try{this.baseURL.searchParams.append("action","rapidload_switch_test_mode"),this.baseURL.searchParams.append("url",r),this.baseURL.searchParams.append("test_mode",n);const s=await fetch(this.baseURL,{method:"POST",headers:{"Content-Type":"application/json"}});return this.throwIfError(s)}catch(s){throw console.error(s),s}}async updateSettings(r,n,s,a,o){try{const i=new URLSearchParams;this.baseURL.searchParams.get("action")&&this.baseURL.searchParams.delete("action"),this.baseURL.searchParams.append("action","update_titan_settings"),a&&this.baseURL.searchParams.append("global","true"),o&&this.baseURL.searchParams.append("analyze","true"),this.baseURL.searchParams.append("url",r),this.baseURL.searchParams.append("strategy",n);const d=await fetch(this.baseURL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:{general:{performance_gear:s.activeGear},performance:s.settings}})});return this.throwIfError(d)}catch(i){throw console.error(i),i}}async post(r=null,n={}){try{r&&(this.baseURL.searchParams.get("action")&&this.baseURL.searchParams.delete("action"),this.baseURL.searchParams.append("action",r));for(let a of Object.keys(n))this.baseURL.searchParams.has(a)||this.baseURL.searchParams.append(a,n[a]);const s=await fetch(this.baseURL,{method:"GET",headers:{"Content-Type":"application/json"}});return this.throwIfError(s)}catch(s){throw console.error(s),s}}async request(r,n={},s="GET"){let a=new URL(this.options.rest_url);try{for(let i of Object.keys(n))a.searchParams.has(i)||a.searchParams.append(i,n[i]);a.pathname+=r;const o=await fetch(a,{method:s,headers:{"Content-Type":"application/json"}});return this.throwIfError(o)}catch(o){throw console.error(o),o}}rest(){return this}}const lm=(e,r)=>{var n,s;return e.metrics=r.filter(a=>{var o,i;return(i=(o=a==null?void 0:a.refs)==null?void 0:o.relevantAudits)==null?void 0:i.includes(e.id)}),e.files&&(e.files.type==="opportunity"||e.files.type==="table")&&((s=(n=e==null?void 0:e.files)==null?void 0:n.items)==null?void 0:s.length)>0&&(e.files.grouped_items=e.files.items.reduce((a,o)=>{let i="unknown";if(o.url&&typeof o.url!="string"){const{url:u,file_type:f}=o.url;f.value&&(i=f.value)}const d=a.find(u=>u.type===i);return d?d.items.push(o):a.push({type:i,items:[o]}),a},[])),e},cm=e=>{var o,i,d,u;const r=(i=(o=e.data)==null?void 0:o.page_speed)==null?void 0:i.metrics.map(f=>{var m,x;return{...f,potentialGain:f.refs?((m=f.refs)==null?void 0:m.weight)-((x=f.refs)==null?void 0:x.weight)/100*f.score:0}}),n=e.data.page_speed.audits.sort((f,m)=>f.score-m.score).map(f=>lm(f,r)),s=(f,m)=>{var M,T,L,$;const x=f.settings.filter(X=>X.inputs[0].value).length>0,v=m.settings.filter(X=>X.inputs[0].value).length>0;if(x&&!v)return-1;if(!x&&v)return 1;const j=f.settings.length>0,y=m.settings.length>0;if(j&&!y)return-1;if(!j&&y)return 1;const w=(((T=(M=f.files)==null?void 0:M.items)==null?void 0:T.length)||0)>0,_=((($=(L=m.files)==null?void 0:L.items)==null?void 0:$.length)||0)>0;return w&&!_?-1:!w&&_?1:0},a={data:{performance:e.data.page_speed.performance?parseFloat((u=(d=e.data)==null?void 0:d.page_speed)==null?void 0:u.performance.toFixed(0)):0,...e.data.page_speed,grouped:{passed_audits:n.filter(f=>f.type==="passed_audit").sort(s),opportunities:n.filter(f=>f.type==="opportunity"),diagnostics:n.filter(f=>f.type==="diagnostics").sort((f,m)=>f.scoreDisplayMode==="informative"?1:-1)},metrics:r},success:e.success,revisions:e.data.revisions.map(({created_at:f,timestamp:m,data:x,id:v})=>({id:v,created_at:f,timestamp:m,data:{performance:x.performance}})),individual_file_actions:e.data["individual-file-actions"],state:e.state};return delete a.data.audits,a},dm=e=>{var n,s,a,o,i,d;if(!e.success)return e;const r=((n=e==null?void 0:e.data)==null?void 0:n.performance)||[];return{general:{performance_gear:(a=(s=e==null?void 0:e.data)==null?void 0:s.general)==null?void 0:a.performance_gear,test_mode:((i=(o=e==null?void 0:e.data)==null?void 0:o.general)==null?void 0:i.test_mode)==="1"},actions:(d=e==null?void 0:e.data)==null?void 0:d.actions,data:r.map(u=>({...u,inputs:u.inputs.map(f=>({...f,...f.control_type==="checkbox"&&{value:f.value==="1"||f.value===!0},...f.inputs&&{inputs:f.inputs.map(m=>({...m,value:m.control_type==="checkbox"?m.value==="1"||m.value===!0:m.value}))}}))}))}},um=(e,r,n)=>{const s=new et(e);return async(a,o)=>{try{const i=await s.getCSSJobStatus(r,n);return a({type:pi,payload:i.data}),i==null?void 0:i.data}catch(i){console.error("Error fetching CSS job status:",i)}}},fm=(e,r,n)=>{const s=new et(e);return async(a,o)=>{try{const i=await s.getTestMode(r,n||"");return a({type:mi,payload:i==null?void 0:i.data}),{success:!0}}catch(i){console.error("Error on Test Mode:",i);let d;return i instanceof Error?d=i.message:typeof i=="string"?d=i:d="An unknown error occurred",{success:!1,error:d}}}},hr=(e,r,n=!1,s=!1)=>{const a=new et(e);return async(o,i)=>{try{const d=i(),u=d.app.activeReport,f=d.app.report[u];if(f.loading||f.data&&!n&&!s)return;o({type:ai,activeReport:u});const m=await a.fetchPageSpeed(r,u,n);o({type:oi,payload:{activeReport:u,data:cm(m)}})}catch(d){d instanceof Error?o({type:In,error:d.message}):o({type:In,error:"Unknown error occurred"})}}},pm=(e,r,n=!1,s=!1)=>{const a=new et(e);return async(o,i)=>{var d;try{const u=i(),f=u.app.activeReport,m=u.app.settings.performance[f];if(m.loading||((d=m==null?void 0:m.state)==null?void 0:d.length)>0&&!n)return;o({type:ii,activeReport:f});const x=await a.fetchSettings(r,f,n);o({type:li,payload:{activeReport:f,data:dm(x)}})}catch(u){u instanceof Error?o({type:$n,error:u.message}):o({type:$n,error:"Unknown error occurred"})}}},_i=(e,r,n,s)=>async(a,o)=>{var f,m,x,v;const i=o(),d=(f=i==null?void 0:i.app)==null?void 0:f.activeReport,u=((v=(x=(m=i==null?void 0:i.app)==null?void 0:m.settings.performance[d])==null?void 0:x.state)==null?void 0:v.map(j=>{if(j.name!==r.name)return j;const y=n.split(".");return{...j,inputs:j.inputs.map(w=>y.length>1?w!=null&&w.inputs&&w.key===y[0]?{...w,inputs:w==null?void 0:w.inputs.map(_=>_.key===y[1]?{..._,value:s}:_)}:w:w.key===n?{...w,value:s}:w)}}))||[];a({type:ci,payload:{settings:u}})},gr=e=>{const r=["Remove Unused CSS","Minify CSS","Minify Javascript","Page Cache","Self Host Google Fonts"],n=[...r,"RapidLoad CDN","Serve next-gen Images","Lazy Load Iframes","Lazy Load Images","Exclude LCP image from Lazy Load","Add Width and Height Attributes","Defer Javascript"],s=[...n,"Delay Javascript","Critical CSS","Serve next-gen Images (AVIF, WEBP)"];return async(a,o)=>{var v,j,y,w;const i=o(),d=(v=i==null?void 0:i.app)==null?void 0:v.activeReport,u=(y=(j=i==null?void 0:i.app)==null?void 0:j.settings.performance[d])==null?void 0:y.state;if(((w=u==null?void 0:u.find(_=>_.category==="gear"))==null?void 0:w.inputs[0].value)===e)return;const m={starter:r,accelerate:n,turboMax:s},x=(u==null?void 0:u.map(_=>({..._,inputs:_.inputs.map((M,T)=>{var L;return{...M,value:T===0?_.category==="gear"?e:e==="custom"?M.value:(L=m[e])==null?void 0:L.includes(_.name):M.value}})})))||[];a({type:di,payload:{settings:x,mode:e}})}},Bn=e=>async(r,n)=>{r({type:ui,reportType:e})},mm=(e,r,n,s)=>async(a,o)=>{a({type:fi,payload:{audit:e,file:r,value:n,prev:s}})};var hm=function e(r,n){if(r===n)return!0;if(r&&n&&typeof r=="object"&&typeof n=="object"){if(r.constructor!==n.constructor)return!1;var s,a,o;if(Array.isArray(r)){if(s=r.length,s!=n.length)return!1;for(a=s;a--!==0;)if(!e(r[a],n[a]))return!1;return!0}if(r instanceof Map&&n instanceof Map){if(r.size!==n.size)return!1;for(a of r.entries())if(!n.has(a[0]))return!1;for(a of r.entries())if(!e(a[1],n.get(a[0])))return!1;return!0}if(r instanceof Set&&n instanceof Set){if(r.size!==n.size)return!1;for(a of r.entries())if(!n.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(r)&&ArrayBuffer.isView(n)){if(s=r.length,s!=n.length)return!1;for(a=s;a--!==0;)if(r[a]!==n[a])return!1;return!0}if(r.constructor===RegExp)return r.source===n.source&&r.flags===n.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===n.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===n.toString();if(o=Object.keys(r),s=o.length,s!==Object.keys(n).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[a]))return!1;for(a=s;a--!==0;){var i=o[a];if(!(i==="_owner"&&r.$$typeof)&&!e(r[i],n[i]))return!1}return!0}return r!==r&&n!==n};const gm=kr(hm),xm=e=>e.app;function vm(e){const r=[];if(!(e!=null&&e.files))return[];for(const n of e==null?void 0:e.files){let s=!1;for(let a=0;a{var i;const r=e.report[e.activeReport],n=e.settings.performance[e.activeReport],s=e.settings.general.performance_gear,a=e.settings.actions,o=e.settings.general.test_mode;return{...r,activeReport:e.activeReport,settings:n.state,settingsLoading:n.loading,actions:a,activeGear:s,testMode:o,touched:!gm(n.original,n.state)||!!vm(r.changes).find(d=>d==null?void 0:d.changed),fresh:(i=r==null?void 0:r.state)==null?void 0:i.fresh,reanalyze:r.data!==null&&r.loading}});function Ci(e){var r,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e))for(r=0;rtypeof e=="boolean"?"".concat(e):e===0?"0":e,Ia=bm,tn=(e,r)=>n=>{var s;if((r==null?void 0:r.variants)==null)return Ia(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:o}=r,i=Object.keys(a).map(f=>{const m=n==null?void 0:n[f],x=o==null?void 0:o[f];if(m===null)return null;const v=Da(m)||Da(x);return a[f][v]}),d=n&&Object.entries(n).reduce((f,m)=>{let[x,v]=m;return v===void 0||(f[x]=v),f},{}),u=r==null||(s=r.compoundVariants)===null||s===void 0?void 0:s.reduce((f,m)=>{let{class:x,className:v,...j}=m;return Object.entries(j).every(y=>{let[w,_]=y;return Array.isArray(_)?_.includes({...o,...d}[w]):{...o,...d}[w]===_})?[...f,x,v]:f},[]);return Ia(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},ym=({children:e,uuid:r})=>t.jsx(Se.div,{className:"overflow-hidden",initial:{opacity:0,x:-10,width:0},animate:{opacity:1,x:0,width:"fit-content"},exit:{opacity:0,x:-10,width:0},transition:{duration:.05},children:e},r);/**
+ */var os=Symbol.for("react.element"),is=Symbol.for("react.portal"),Fr=Symbol.for("react.fragment"),Br=Symbol.for("react.strict_mode"),zr=Symbol.for("react.profiler"),Vr=Symbol.for("react.provider"),Hr=Symbol.for("react.context"),Wf=Symbol.for("react.server_context"),Ur=Symbol.for("react.forward_ref"),Gr=Symbol.for("react.suspense"),Kr=Symbol.for("react.suspense_list"),qr=Symbol.for("react.memo"),Wr=Symbol.for("react.lazy"),Zf=Symbol.for("react.offscreen"),Uo;Uo=Symbol.for("react.module.reference");function He(e){if(typeof e=="object"&&e!==null){var r=e.$$typeof;switch(r){case os:switch(e=e.type,e){case Fr:case zr:case Br:case Gr:case Kr:return e;default:switch(e=e&&e.$$typeof,e){case Wf:case Hr:case Ur:case Wr:case qr:case Vr:return e;default:return r}}case is:return r}}}le.ContextConsumer=Hr;le.ContextProvider=Vr;le.Element=os;le.ForwardRef=Ur;le.Fragment=Fr;le.Lazy=Wr;le.Memo=qr;le.Portal=is;le.Profiler=zr;le.StrictMode=Br;le.Suspense=Gr;le.SuspenseList=Kr;le.isAsyncMode=function(){return!1};le.isConcurrentMode=function(){return!1};le.isContextConsumer=function(e){return He(e)===Hr};le.isContextProvider=function(e){return He(e)===Vr};le.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===os};le.isForwardRef=function(e){return He(e)===Ur};le.isFragment=function(e){return He(e)===Fr};le.isLazy=function(e){return He(e)===Wr};le.isMemo=function(e){return He(e)===qr};le.isPortal=function(e){return He(e)===is};le.isProfiler=function(e){return He(e)===zr};le.isStrictMode=function(e){return He(e)===Br};le.isSuspense=function(e){return He(e)===Gr};le.isSuspenseList=function(e){return He(e)===Kr};le.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Fr||e===zr||e===Br||e===Gr||e===Kr||e===Zf||typeof e=="object"&&e!==null&&(e.$$typeof===Wr||e.$$typeof===qr||e.$$typeof===Vr||e.$$typeof===Hr||e.$$typeof===Ur||e.$$typeof===Uo||e.getModuleId!==void 0)};le.typeOf=He;function Xf(){const e=Of();let r=null,n=null;return{clear(){r=null,n=null},notify(){e(()=>{let s=r;for(;s;)s.callback(),s=s.next})},get(){let s=[],a=r;for(;a;)s.push(a),a=a.next;return s},subscribe(s){let a=!0,o=n={callback:s,next:null,prev:n};return o.prev?o.prev.next=o:r=o,function(){!a||r===null||(a=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:r=o.next)}}}}const Ma={notify(){},get:()=>[]};function Yf(e,r){let n,s=Ma,a=0,o=!1;function i(w){m();const _=s.subscribe(w);let R=!1;return()=>{R||(R=!0,_(),x())}}function d(){s.notify()}function u(){b.onStateChange&&b.onStateChange()}function f(){return o}function m(){a++,n||(n=e.subscribe(u),s=Xf())}function x(){a--,n&&a===0&&(n(),n=void 0,s.clear(),s=Ma)}function v(){o||(o=!0,m())}function j(){o&&(o=!1,x())}const b={addNestedSub:i,notifyNestedSubs:d,handleChangeWrapper:u,isSubscribed:f,trySubscribe:v,tryUnsubscribe:j,getListeners:()=>s};return b}const Jf=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Qf=Jf?l.useLayoutEffect:l.useEffect;function ep({store:e,context:r,children:n,serverState:s,stabilityCheck:a="once",noopCheck:o="once"}){const i=l.useMemo(()=>{const f=Yf(e);return{store:e,subscription:f,getServerState:s?()=>s:void 0,stabilityCheck:a,noopCheck:o}},[e,s,a,o]),d=l.useMemo(()=>e.getState(),[e]);Qf(()=>{const{subscription:f}=i;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),d!==e.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[i,d]);const u=r||at;return l.createElement(u.Provider,{value:i},n)}function Go(e=at){const r=e===at?$o:rs(e);return function(){const{store:s}=r();return s}}const tp=Go();function rp(e=at){const r=e===at?tp:Go(e);return function(){return r().dispatch}}const ot=rp();If(Tf.useSyncExternalStoreWithSelector);Af(Ro.unstable_batchedUpdates);const ge=()=>{const e=ot(),r=ce(s=>s.common[s.app.activeReport]),n=ce(s=>s.common);return{dispatch:e,common:r,...r,...n}},Ko="SET_STATE",qo="SET_ROOT_STATE",ae=(e,r)=>async(n,s)=>{const a=s().app.activeReport;n({type:Ko,payload:{activeReport:a,key:e,value:r}})},An=(e,r)=>async(n,s)=>{n({type:qo,payload:{key:e,value:r}})},Wo=l.createContext(null),np=({children:e,initShowOptimizerValue:r,global:n,mode:s,modeData:a})=>{document.getElementById("wpadminbar");const[o,i]=l.useState(!1),[d,u]=l.useState(!1),[f,m]=l.useState(!1);l.useState(!1);const[x,v]=l.useState([]),[j,b]=l.useState({optimizer_url:"https://rapidload.io/",ajax_url:"http://rapidload.local/wp-admin/admin-ajax.php",page_optimizer_base:"",page_optimizer_package_base:"",plugin_url:"",nonce:"",timezone:"UTC",actions:[],load_optimizer:!1,rapidload_version:"2.2.0",rest_url:"https://rapidload.local/wp-json/rapidload/v1",...window.rapidload_optimizer?window.rapidload_optimizer:{}});l.useState("desktop");const[w,_]=l.useState(!1),[R,T]=l.useState(!0),L=l.useRef(null),[$,X]=l.useState(!1),{dispatch:V}=ge();l.useEffect(()=>{const D=Q=>{const{detail:Y}=Q;typeof(Y==null?void 0:Y.status)!==void 0&&i((Y==null?void 0:Y.status)||!1)};window.addEventListener("rapidLoad:set-optimizer",D),m(!0),s&&V(An("mode",s)),a&&V(An("modeData",a));const z=new CustomEvent("rapidLoad:optimizer-mounted");return window.dispatchEvent(z),()=>{window.removeEventListener("rapidLoad:set-optimizer",D)}},[]),l.useEffect(()=>{o?document.documentElement.classList.add("rapidload-optimizer-open"):document.documentElement.classList.remove("rapidload-optimizer-open")},[o]);const A=D=>{D?i(D):requestAnimationFrame(()=>{i(D)})};return t.jsx(Wo.Provider,{value:{showOptimizer:o,setShowOptimizer:A,options:j,openAudits:x,setOpenAudits:v,version:"1.3.3",mode:s,modeData:a,manipulatingStyles:d,global:n,togglePerformance:R,setTogglePerformance:T,savingData:w,setSavingData:_,optimizerContainer:L,invalidatingCache:$,setInvalidatingCache:X},children:e})},ve=()=>{const e=l.useContext(Wo);if(e===null)throw new Error("useAppContext must be used within an AppProvider");return e};var[Zr,Hx]=Ze("Tooltip",[Pt]),Xr=Pt(),Zo="TooltipProvider",sp=700,On="tooltip.open",[ap,ls]=Zr(Zo),Xo=e=>{const{__scopeTooltip:r,delayDuration:n=sp,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:o}=e,[i,d]=l.useState(!0),u=l.useRef(!1),f=l.useRef(0);return l.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),t.jsx(ap,{scope:r,isOpenDelayed:i,delayDuration:n,onOpen:l.useCallback(()=>{window.clearTimeout(f.current),d(!1)},[]),onClose:l.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>d(!0),s)},[s]),isPointerInTransitRef:u,onPointerInTransitChange:l.useCallback(m=>{u.current=m},[]),disableHoverableContent:a,children:o})};Xo.displayName=Zo;var Yr="Tooltip",[op,Jr]=Zr(Yr),Yo=e=>{const{__scopeTooltip:r,children:n,open:s,defaultOpen:a=!1,onOpenChange:o,disableHoverableContent:i,delayDuration:d}=e,u=ls(Yr,e.__scopeTooltip),f=Xr(r),[m,x]=l.useState(null),v=ut(),j=l.useRef(0),b=i??u.disableHoverableContent,w=d??u.delayDuration,_=l.useRef(!1),[R=!1,T]=Xe({prop:s,defaultProp:a,onChange:A=>{A?(u.onOpen(),document.dispatchEvent(new CustomEvent(On))):u.onClose(),o==null||o(A)}}),L=l.useMemo(()=>R?_.current?"delayed-open":"instant-open":"closed",[R]),$=l.useCallback(()=>{window.clearTimeout(j.current),_.current=!1,T(!0)},[T]),X=l.useCallback(()=>{window.clearTimeout(j.current),T(!1)},[T]),V=l.useCallback(()=>{window.clearTimeout(j.current),j.current=window.setTimeout(()=>{_.current=!0,T(!0)},w)},[w,T]);return l.useEffect(()=>()=>window.clearTimeout(j.current),[]),t.jsx(Qn,{...f,children:t.jsx(op,{scope:r,contentId:v,open:R,stateAttribute:L,trigger:m,onTriggerChange:x,onTriggerEnter:l.useCallback(()=>{u.isOpenDelayed?V():$()},[u.isOpenDelayed,V,$]),onTriggerLeave:l.useCallback(()=>{b?X():window.clearTimeout(j.current)},[X,b]),onOpen:$,onClose:X,disableHoverableContent:b,children:n})})};Yo.displayName=Yr;var Ln="TooltipTrigger",Jo=l.forwardRef((e,r)=>{const{__scopeTooltip:n,...s}=e,a=Jr(Ln,n),o=ls(Ln,n),i=Xr(n),d=l.useRef(null),u=Re(r,d,a.onTriggerChange),f=l.useRef(!1),m=l.useRef(!1),x=l.useCallback(()=>f.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),t.jsx(Xn,{asChild:!0,...i,children:t.jsx(fe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:u,onPointerMove:K(e.onPointerMove,v=>{v.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),m.current=!0)}),onPointerLeave:K(e.onPointerLeave,()=>{a.onTriggerLeave(),m.current=!1}),onPointerDown:K(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:K(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:K(e.onBlur,a.onClose),onClick:K(e.onClick,a.onClose)})})});Jo.displayName=Ln;var ip="TooltipPortal",[Ux,lp]=Zr(ip,{forceMount:void 0}),Mt="TooltipContent",Qo=l.forwardRef((e,r)=>{const n=lp(Mt,e.__scopeTooltip),{forceMount:s=n.forceMount,side:a="top",...o}=e,i=Jr(Mt,e.__scopeTooltip);return t.jsx(tt,{present:s||i.open,children:i.disableHoverableContent?t.jsx(ei,{side:a,...o,ref:r}):t.jsx(cp,{side:a,...o,ref:r})})}),cp=l.forwardRef((e,r)=>{const n=Jr(Mt,e.__scopeTooltip),s=ls(Mt,e.__scopeTooltip),a=l.useRef(null),o=Re(r,a),[i,d]=l.useState(null),{trigger:u,onClose:f}=n,m=a.current,{onPointerInTransitChange:x}=s,v=l.useCallback(()=>{d(null),x(!1)},[x]),j=l.useCallback((b,w)=>{const _=b.currentTarget,R={x:b.clientX,y:b.clientY},T=pp(R,_.getBoundingClientRect()),L=mp(R,T),$=hp(w.getBoundingClientRect()),X=xp([...L,...$]);d(X),x(!0)},[x]);return l.useEffect(()=>()=>v(),[v]),l.useEffect(()=>{if(u&&m){const b=_=>j(_,m),w=_=>j(_,u);return u.addEventListener("pointerleave",b),m.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",b),m.removeEventListener("pointerleave",w)}}},[u,m,j,v]),l.useEffect(()=>{if(i){const b=w=>{const _=w.target,R={x:w.clientX,y:w.clientY},T=(u==null?void 0:u.contains(_))||(m==null?void 0:m.contains(_)),L=!gp(R,i);T?v():L&&(v(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,m,i,f,v]),t.jsx(ei,{...e,ref:o})}),[dp,up]=Zr(Yr,{isInside:!1}),ei=l.forwardRef((e,r)=>{const{__scopeTooltip:n,children:s,"aria-label":a,onEscapeKeyDown:o,onPointerDownOutside:i,...d}=e,u=Jr(Mt,n),f=Xr(n),{onClose:m}=u;return l.useEffect(()=>(document.addEventListener(On,m),()=>document.removeEventListener(On,m)),[m]),l.useEffect(()=>{if(u.trigger){const x=v=>{const j=v.target;j!=null&&j.contains(u.trigger)&&m()};return window.addEventListener("scroll",x,{capture:!0}),()=>window.removeEventListener("scroll",x,{capture:!0})}},[u.trigger,m]),t.jsx(Sr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:x=>x.preventDefault(),onDismiss:m,children:t.jsxs(Yn,{"data-state":u.stateAttribute,...f,...d,ref:r,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(io,{children:s}),t.jsx(dp,{scope:n,isInside:!0,children:t.jsx(Iu,{id:u.contentId,role:"tooltip",children:a||s})})]})})});Qo.displayName=Mt;var ti="TooltipArrow",fp=l.forwardRef((e,r)=>{const{__scopeTooltip:n,...s}=e,a=Xr(n);return up(ti,n).isInside?null:t.jsx(Jn,{...a,...s,ref:r})});fp.displayName=ti;function pp(e,r){const n=Math.abs(r.top-e.y),s=Math.abs(r.bottom-e.y),a=Math.abs(r.right-e.x),o=Math.abs(r.left-e.x);switch(Math.min(n,s,a,o)){case o:return"left";case a:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function mp(e,r,n=5){const s=[];switch(r){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function hp(e){const{top:r,right:n,bottom:s,left:a}=e;return[{x:a,y:r},{x:n,y:r},{x:n,y:s},{x:a,y:s}]}function gp(e,r){const{x:n,y:s}=e;let a=!1;for(let o=0,i=r.length-1;os!=m>s&&n<(f-d)*(s-u)/(m-u)+d&&(a=!a)}return a}function xp(e){const r=e.slice();return r.sort((n,s)=>n.xs.x?1:n.ys.y?1:0),vp(r)}function vp(e){if(e.length<=1)return e.slice();const r=[];for(let s=0;s=2;){const o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(a.y-i.y)>=(o.y-i.y)*(a.x-i.x))r.pop();else break}r.push(a)}r.pop();const n=[];for(let s=e.length-1;s>=0;s--){const a=e[s];for(;n.length>=2;){const o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(a.y-i.y)>=(o.y-i.y)*(a.x-i.x))n.pop();else break}n.push(a)}return n.pop(),r.length===1&&n.length===1&&r[0].x===n[0].x&&r[0].y===n[0].y?r:r.concat(n)}var bp=Xo,yp=Yo,wp=Jo,ri=Qo;const ni=l.createContext(null),jp=({children:e})=>{const[r,n]=l.useState("light"),[s,a]=l.useState(!1);l.useEffect(()=>{const i=typeof window<"u"&&window.localStorage.getItem("rapidload-theme");i&&n(i)},[]),l.useEffect(()=>{typeof window<"u"&&window.localStorage.setItem("rapidload-theme",r)},[r]);const o=()=>{n(r==="dark"?"light":"dark")};return t.jsx(ni.Provider,{value:{theme:r,setTheme:n,isDark:s,setIsDark:a,changeTheme:o},children:e})},At=()=>{const e=l.useContext(ni);if(e===null)throw new Error("useRootContext must be used within an useRootContext");return e},Xt=({code:e,lang:r="html",className:n})=>{const{theme:s,isDark:a}=At();return t.jsx($u,{theme:a?Ca.vsDark:Ca.github,language:r,code:e,children:({className:o,style:i,tokens:d,getLineProps:u,getTokenProps:f})=>t.jsx("pre",{className:S(o,n,"w-fit"),children:d.map((m,x)=>t.jsx("div",{...u({line:m}),className:"text-xs w-full flex flex-row p-2 bg-brand-200/80 dark:bg-brand-800 overflow-hidden rounded-lg flex-wrap",children:m.map((v,j)=>t.jsx("span",{...f({token:v})},j))},x))})})};function S(...e){return tf(Fu(e))}function si(e){return["offscreen-images","modern-image-formats","unsized-images","uses-responsive-images","uses-optimized-images"].includes(e)}function ai(e,r){return e.id==="lcp-lazy-loaded"&&r==="unknown"&&(r="image"),r==="google_font"&&(r="font"),r==="data_image"&&(r="image"),r==="js"&&(r="javascript"),r}const Dn=!1;function _p(e){try{return new URL(e),!0}catch{return!1}}function pr(e,r,n=!0){try{if(e==="Unattributable")return e;const s=new URL(e),a=e.endsWith("/");if(s.pathname.split("/").pop()==="")return`${s.protocol}//${s.host}`;const i=s.pathname.split("/"),d=i[i.length-2],u=i[i.length-1];let f=n?`${s.protocol}//${s.host}/.../${d}/`:`.../${d}/`,m=u;if(f.length+u.length>r){const v=f.length+u.length-r;m=`...${u.slice(v+3)}`}return f+m+(a?"/":"")}catch{if(e)return t.jsx(Xt,{code:e})}}function Cp(e,r=1){return(Math.round(e/r)*r).toFixed(Math.max(0,Math.ceil(-Math.log10(r))))}function Nn(e){const r=new Date(e),s=Math.round((new Date-r)/1e3),a=Math.round(s/60),o=Math.round(a/60),i=Math.round(o/24),d=Math.round(i/30.44),u=Math.round(i/365.24);return s<60?"just now":s<60?`${s} seconds ago`:a<60?`${a} minutes ago`:o<24?`${o} hours ago`:i<30?`${i} days ago`:d<12?`${d} months ago`:`${u} years ago`}function Np(e){return e===!0||e===1||e==="1"||e==="true"}const cs=bp,Qr=yp,en=wp,Qt=l.forwardRef(({className:e,sideOffset:r=4,...n},s)=>t.jsx(ri,{ref:s,sideOffset:r,className:S("z-[110001] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Qt.displayName=ri.displayName;const ue=({text:e,children:r,onClick:n,className:s,asChild:a=!1,delay:o=500})=>t.jsx(cs,{disableHoverableContent:!1,delayDuration:o,children:t.jsxs(Qr,{children:[t.jsx(en,{asChild:a,onClick:i=>n&&n(),className:S("flex items-center"),children:r}),t.jsx(Qt,{className:s,children:e})]})}),oi="FETCH_REPORT_REQUEST",ii="FETCH_REPORT_SUCCESS",In="FETCH_REPORT_FAILURE",li="FETCH_SETTING_REQUEST",ci="FETCH_SETTING_SUCCESS",$n="FETCH_SETTING_FAILURE",di="UPDATE_SETTINGS",ui="CHANGE_GEAR",fi="CHANGE_REPORT_TYPE",pi="UPDATE_FILE_ACTION",mi="GET_CSS_STATUS_SUCCESS",hi="UPDATE_TEST_MODE";function Fn(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Sn=function(){return Math.random().toString(36).substring(7).split("").join(".")},Ta={INIT:"@@redux/INIT"+Sn(),REPLACE:"@@redux/REPLACE"+Sn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Sn()}};function Sp(e){Object.keys(e).forEach(function(r){var n=e[r],s=n(void 0,{type:Ta.INIT});if(typeof s>"u")throw new Error(Fn(12));if(typeof n(void 0,{type:Ta.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Fn(13))})}function kp(e){for(var r=Object.keys(e),n={},s=0;s"u")throw f&&f.type,new Error(Fn(14));x[j]=_,m=m||_!==w}return m=m||o.length!==Object.keys(u).length,m?x:u}}const Pa={original:null,changes:{files:[]},data:null,error:null,loading:!1,settings:[],originalSettings:[],revisions:[],state:{}},Ep={activeReport:"desktop",cssStatus:null,testMode:null,report:{mobile:Pa,desktop:Pa},settings:{performance:{mobile:{original:[],state:[],error:null,loading:!1},desktop:{original:[],state:[],error:null,loading:!1}},general:{test_mode:!0,performance_gear:"accelerate"},actions:[]}},Rp=(e=Ep,r)=>{switch(r.type){case mi:return{...e,cssStatus:r.payload};case hi:return{...e,testMode:r.payload,settings:{...e.settings,general:{...e.settings.general,test_mode:r.payload.status}}};case oi:return{...e,report:{...e.report,[e.activeReport]:{...e.report[e.activeReport],loading:!0,error:null}}};case ii:return{...e,report:{...e.report,[r.payload.activeReport]:{...e.report[r.payload.activeReport],data:r.payload.data.data,error:null,loading:!1,revisions:r.payload.data.revisions}}};case In:return{...e,report:{...e.report,[e.activeReport]:{error:r.error,loading:!1}}};case li:return{...e,settings:{...e.settings,performance:{...e.settings.performance,[e.activeReport]:{...e.settings.performance[e.activeReport],loading:!0,error:null}}}};case ci:return{...e,settings:{...e.settings,general:r.payload.data.general,actions:r.payload.data.actions,performance:{...e.settings.performance,[r.payload.activeReport]:{...e.settings.performance[r.payload.activeReport],original:JSON.parse(JSON.stringify(r.payload.data.data)),state:r.payload.data.data,error:null,loading:!1}}}};case $n:return{...e,settings:{...e.settings,performance:{...e.settings.performance,[e.activeReport]:{error:r.error,loading:!1}}}};case di:return{...e,settings:{...e.settings,performance:{...e.settings.performance,[e.activeReport]:{...e.settings.performance[e.activeReport],state:r.payload.settings}}}};case ui:return{...e,settings:{...e.settings,general:{...e.settings.general,performance_gear:r.payload.mode},performance:{...e.settings.performance,[e.activeReport]:{...e.settings.performance[e.activeReport],state:r.payload.settings}}}};case fi:return{...e,activeReport:r.reportType};case pi:const{payload:n}=r,s=e.report[e.activeReport];return s.changes.files.filter(o=>o.file===n.file).length==0&&s.changes.files.push({...n,value:n.prev}),s.changes.files.push(n),s.data&&(s.data.audits=s.data.audits.map(o=>{if(o.files&&o.files.items&&(o.files.type==="table"||o.files.type==="opportunity")){const i=d=>d.url&&typeof d.url=="object"&&d.action&&d.url.url===n.file?{...d,action:{...d.action,value:n.value}}:d;o.files.items=o.files.items.map(i),o.files.grouped_items&&(o.files.grouped_items=o.files.grouped_items.map(d=>({...d,items:d.items.map(i)})))}return o})),{...e,[e.activeReport]:{...s}};default:return e}},Mp={optimizerRoot:null,mode:"normal",isTourOpen:!1,mobile:{activeTab:"configurations",openAudits:[],hoveredMetric:null,activeMetric:null,settingsMode:null},desktop:{activeTab:"configurations",openAudits:[],hoveredMetric:null,activeMetric:null,settingsMode:null}},Tp=(e=Mp,r)=>{switch(r.type){case Ko:return{...e,[r.payload.activeReport]:{...e[r.payload.activeReport],[r.payload.key]:r.payload.value}};case qo:return{...e,[r.payload.key]:r.payload.value};default:return e}},Pp=kp({app:Rp,common:Tp});function Ne(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ap=typeof Symbol=="function"&&Symbol.observable||"@@observable",Aa=Ap,kn=()=>Math.random().toString(36).substring(7).split("").join("."),Op={INIT:`@@redux/INIT${kn()}`,REPLACE:`@@redux/REPLACE${kn()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${kn()}`},mr=Op;function gi(e){if(typeof e!="object"||e===null)return!1;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r||Object.getPrototypeOf(e)===null}function xi(e,r,n){if(typeof e!="function")throw new Error(Ne(2));if(typeof r=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ne(0));if(typeof r=="function"&&typeof n>"u"&&(n=r,r=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ne(1));return n(xi)(e,r)}let s=e,a=r,o=new Map,i=o,d=0,u=!1;function f(){i===o&&(i=new Map,o.forEach((_,R)=>{i.set(R,_)}))}function m(){if(u)throw new Error(Ne(3));return a}function x(_){if(typeof _!="function")throw new Error(Ne(4));if(u)throw new Error(Ne(5));let R=!0;f();const T=d++;return i.set(T,_),function(){if(R){if(u)throw new Error(Ne(6));R=!1,f(),i.delete(T),o=null}}}function v(_){if(!gi(_))throw new Error(Ne(7));if(typeof _.type>"u")throw new Error(Ne(8));if(typeof _.type!="string")throw new Error(Ne(17));if(u)throw new Error(Ne(9));try{u=!0,a=s(a,_)}finally{u=!1}return(o=i).forEach(T=>{T()}),_}function j(_){if(typeof _!="function")throw new Error(Ne(10));s=_,v({type:mr.REPLACE})}function b(){const _=x;return{subscribe(R){if(typeof R!="object"||R===null)throw new Error(Ne(11));function T(){const $=R;$.next&&$.next(m())}return T(),{unsubscribe:_(T)}},[Aa](){return this}}}return v({type:mr.INIT}),{dispatch:v,subscribe:x,getState:m,replaceReducer:j,[Aa]:b}}function Lp(e){Object.keys(e).forEach(r=>{const n=e[r];if(typeof n(void 0,{type:mr.INIT})>"u")throw new Error(Ne(12));if(typeof n(void 0,{type:mr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ne(13))})}function Dp(e){const r=Object.keys(e),n={};for(let o=0;o"u")throw d&&d.type,new Error(Ne(14));f[x]=b,u=u||b!==j}return u=u||s.length!==Object.keys(i).length,u?f:i}}function hr(...e){return e.length===0?r=>r:e.length===1?e[0]:e.reduce((r,n)=>(...s)=>r(n(...s)))}function Ip(...e){return r=>(n,s)=>{const a=r(n,s);let o=()=>{throw new Error(Ne(15))};const i={getState:a.getState,dispatch:(u,...f)=>o(u,...f)},d=e.map(u=>u(i));return o=hr(...d)(a.dispatch),{...a,dispatch:o}}}function $p(e,r=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(r)}function Fp(e,r=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(r)}function Bp(e,r="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${r}[${n}]`)}}var Oa=e=>Array.isArray(e)?e:[e];function zp(e){const r=Array.isArray(e[0])?e[0]:e;return Bp(r,"createSelector expects all input-selectors to be functions, but received the following types: "),r}function Vp(e,r){const n=[],{length:s}=e;for(let a=0;a{n=lr(),i.resetResultsCount()},i.resultsCount=()=>o,i.resetResultsCount=()=>{o=0},i}function Kp(e,...r){const n=typeof e=="function"?{memoize:e,memoizeOptions:r}:e,s=(...a)=>{let o=0,i=0,d,u={},f=a.pop();typeof f=="object"&&(u=f,f=a.pop()),$p(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const m={...n,...u},{memoize:x,memoizeOptions:v=[],argsMemoize:j=vi,argsMemoizeOptions:b=[],devModeChecks:w={}}=m,_=Oa(v),R=Oa(b),T=zp(a),L=x(function(){return o++,f.apply(null,arguments)},..._),$=j(function(){i++;const V=Vp(T,arguments);return d=L.apply(null,V),d},...R);return Object.assign($,{resultFunc:f,memoizedResultFunc:L,dependencies:T,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>d,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:x,argsMemoize:j})};return Object.assign(s,{withTypes:()=>s}),s}var bi=Kp(vi),qp=Object.assign((e,r=bi)=>{Fp(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),s=n.map(o=>e[o]);return r(s,(...o)=>o.reduce((i,d,u)=>(i[n[u]]=d,i),{}))},{withTypes:()=>qp});function yi(e){return({dispatch:n,getState:s})=>a=>o=>typeof o=="function"?o(n,s,e):a(o)}var Wp=yi(),Zp=yi,Xp=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?hr:hr.apply(null,arguments)},wi=class Ht extends Array{constructor(...r){super(...r),Object.setPrototypeOf(this,Ht.prototype)}static get[Symbol.species](){return Ht}concat(...r){return super.concat.apply(this,r)}prepend(...r){return r.length===1&&Array.isArray(r[0])?new Ht(...r[0].concat(this)):new Ht(...r.concat(this))}};function Yp(e){return typeof e=="boolean"}var Jp=()=>function(r){const{thunk:n=!0,immutableCheck:s=!0,serializableCheck:a=!0,actionCreatorCheck:o=!0}=r??{};let i=new wi;return n&&(Yp(n)?i.push(Wp):i.push(Zp(n.extraArgument))),i},Qp="RTK_autoBatch",ji=e=>r=>{setTimeout(r,e)},em=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ji(10),tm=(e={type:"raf"})=>r=>(...n)=>{const s=r(...n);let a=!0,o=!1,i=!1;const d=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?em:e.type==="callback"?e.queueNotification:ji(e.timeout),f=()=>{i=!1,o&&(o=!1,d.forEach(m=>m()))};return Object.assign({},s,{subscribe(m){const x=()=>a&&m(),v=s.subscribe(x);return d.add(m),()=>{v(),d.delete(m)}},dispatch(m){var x;try{return a=!((x=m==null?void 0:m.meta)!=null&&x[Qp]),o=!a,o&&(i||(i=!0,u(f))),s.dispatch(m)}finally{a=!0}}})},rm=e=>function(n){const{autoBatch:s=!0}=n??{};let a=new wi(e);return s&&a.push(tm(typeof s=="object"?s:void 0)),a};function nm(e){const r=Jp(),{reducer:n=void 0,middleware:s,devTools:a=!0,preloadedState:o=void 0,enhancers:i=void 0}=e||{};let d;if(typeof n=="function")d=n;else if(gi(n))d=Dp(n);else throw new Error(sm(1));let u;typeof s=="function"?u=s(r):u=r();let f=hr;a&&(f=Xp({trace:!1,...typeof a=="object"&&a}));const m=Ip(...u),x=rm(m);let v=typeof i=="function"?i(x):x();const j=f(...v);return xi(d,o,j)}function sm(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const _i=nm({reducer:Pp}),am=1,om=1e6;let En=0;function im(){return En=(En+1)%Number.MAX_VALUE,En.toString()}const Rn=new Map,Da=e=>{if(Rn.has(e))return;const r=setTimeout(()=>{Rn.delete(e),qt({type:"REMOVE_TOAST",toastId:e})},om);Rn.set(e,r)},lm=(e,r)=>{switch(r.type){case"ADD_TOAST":return{...e,toasts:[r.toast,...e.toasts].slice(0,am)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===r.toast.id?{...n,...r.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=r;return n?Da(n):e.toasts.forEach(s=>{Da(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===n||n===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return r.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==r.toastId)}}},dr=[];let ur={toasts:[]};function qt(e){ur=lm(ur,e),dr.forEach(r=>{r(ur)})}function Ue({...e},r=3e3){const n=im(),s=o=>qt({type:"UPDATE_TOAST",toast:{...o,id:n}}),a=()=>qt({type:"DISMISS_TOAST",toastId:n});return qt({type:"ADD_TOAST",toast:{...e,id:n,open:!0,duration:r,onOpenChange:o=>{o||a()}}}),{id:n,dismiss:a,update:s}}function gt(){const[e,r]=l.useState(ur);return l.useEffect(()=>(dr.push(r),()=>{const n=dr.indexOf(r);n>-1&&dr.splice(n,1)}),[e]),{...e,toast:Ue,dismiss:n=>qt({type:"DISMISS_TOAST",toastId:n})}}class et{constructor(r,n,s){_n(this,"baseURL");_n(this,"options");r||(r=window.rapidload_optimizer),this.options=r;let a=r!=null&&r.ajax_url?r.ajax_url:"http://rapidload.local/wp-admin/admin-ajax.php";const o=new URLSearchParams(n);s&&o.append("action",s),r!=null&&r.nonce&&!o.has("nonce")&&o.append("nonce",r.nonce),this.baseURL=new URL(a+"?"+o.toString())}async throwIfError(r,n=null){if(!r.ok)throw new Error("Oops! The request failed");let s=await r.json();if(!s.success){if(s.data.reload)return s.data;throw Array.isArray(s==null?void 0:s.data)?new Error(`[Code:${s.data[0].code}] ${s.data[0].detail?s.data[0].detail:"Internal error occurred on our end :("}`):new Error("Problem Retrieving Data: Our Apologies. For Assistance, Please Reach Out to Customer Support.")}return{...s,state:n}}async fetchPageSpeed(r,n,s){try{let a=s,o=null;if(s&&(o=await this.analyzeViaAPI(r,n),o!=null&&o.errors))throw Array.isArray(o==null?void 0:o.errors)?new Error(`[Code:${o.errors[0].code}] ${o.errors[0].detail}`):new Error("Oops! Something went wrong :(");const i=new URLSearchParams;this.baseURL.searchParams.append("action","fetch_page_speed"),this.baseURL.searchParams.append("url",r),this.baseURL.searchParams.append("strategy",n),this.baseURL.searchParams.append("new",s),this.baseURL.searchParams.append("is_dev",Dn);const d=await fetch(this.baseURL,{method:o?"POST":"GET",headers:{"Content-Type":"application/json"},...o?{body:JSON.stringify({page_speed:o})}:{}});let u=await this.throwIfError(d,{fresh:s});return u!=null&&u.reload?await this.fetchPageSpeed(r,n,!0):u}catch(a){throw console.error(a),a}}async fetchSettings(r,n,s){try{let a=s,o=null;const i=new URLSearchParams;this.baseURL.searchParams.append("action","fetch_titan_settings"),this.baseURL.searchParams.append("url",r),this.baseURL.searchParams.append("strategy",n),this.baseURL.searchParams.append("new",s),this.baseURL.searchParams.append("is_dev",Dn);const d=await fetch(this.baseURL,{method:o?"POST":"GET",headers:{"Content-Type":"application/json"}});let u=await this.throwIfError(d,{fresh:s});return u!=null&&u.reload?await this.fetchPageSpeed(r,n,!0):u}catch(a){throw console.error(a),Ue({description:"Failed to fetch RapidLoad settings!",variant:"destructive"}),a}}async analyzeViaAPI(r,n){var s,a,o;try{const i=_i.getState(),d=i.app.report[i.app.activeReport],u=i.app.settings.performance[i.app.activeReport],m=((s=i.app.testMode)==null?void 0:s.status)??i.app.settings.general.test_mode??!1?"?rapidload_preview":"",x=((a=this.options)==null?void 0:a.api_root)||"https://api.rapidload.io/api/v1",v=new URL(`${x}/page-speed`);return v.searchParams.append("url",r+m),v.searchParams.append("strategy",i.app.activeReport),v.searchParams.append("plugin_version",this.options.rapidload_version),v.searchParams.append("titan_version","1.3.3"),this.options.license_key&&v.searchParams.append("api_key",this.options.license_key),await(await fetch(v,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:((o=u.state)==null?void 0:o.flatMap(b=>b.inputs.filter(({value:w})=>w!=null).map(({key:w,value:_})=>({key:w,value:_,status:b.status}))))||[]})})).json()}catch(i){throw console.error(i),i}}async getCSSJobStatus(r,n){try{this.baseURL.searchParams.append("action","rapidload_css_job_status"),this.baseURL.searchParams.append("url",r),this.baseURL.searchParams.append("types",n.join(","));const s=await fetch(this.baseURL,{method:"GET",headers:{"Content-Type":"application/json"}});return this.throwIfError(s)}catch(s){throw console.error(s),s}}async getTestMode(r,n){try{this.baseURL.searchParams.append("action","rapidload_switch_test_mode"),this.baseURL.searchParams.append("url",r),this.baseURL.searchParams.append("test_mode",n);const s=await fetch(this.baseURL,{method:"POST",headers:{"Content-Type":"application/json"}});return this.throwIfError(s)}catch(s){throw console.error(s),s}}async updateSettings(r,n,s,a,o){try{const i=new URLSearchParams;this.baseURL.searchParams.get("action")&&this.baseURL.searchParams.delete("action"),this.baseURL.searchParams.append("action","update_titan_settings"),a&&this.baseURL.searchParams.append("global","true"),o&&this.baseURL.searchParams.append("analyze","true"),this.baseURL.searchParams.append("url",r),this.baseURL.searchParams.append("strategy",n);const d=await fetch(this.baseURL,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:{general:{performance_gear:s.activeGear},performance:s.settings}})});return this.throwIfError(d)}catch(i){throw console.error(i),i}}async post(r=null,n={}){try{r&&(this.baseURL.searchParams.get("action")&&this.baseURL.searchParams.delete("action"),this.baseURL.searchParams.append("action",r));for(let a of Object.keys(n))this.baseURL.searchParams.has(a)||this.baseURL.searchParams.append(a,n[a]);const s=await fetch(this.baseURL,{method:"GET",headers:{"Content-Type":"application/json"}});return this.throwIfError(s)}catch(s){throw console.error(s),s}}async request(r,n={},s="GET"){let a=new URL(this.options.rest_url);try{for(let i of Object.keys(n))a.searchParams.has(i)||a.searchParams.append(i,n[i]);a.pathname+=r;const o=await fetch(a,{method:s,headers:{"Content-Type":"application/json"}});return this.throwIfError(o)}catch(o){throw console.error(o),o}}rest(){return this}}const cm=(e,r)=>{var n,s;return e.metrics=r.filter(a=>{var o,i;return(i=(o=a==null?void 0:a.refs)==null?void 0:o.relevantAudits)==null?void 0:i.includes(e.id)}),e.files&&(e.files.type==="opportunity"||e.files.type==="table")&&((s=(n=e==null?void 0:e.files)==null?void 0:n.items)==null?void 0:s.length)>0&&(e.files.grouped_items=e.files.items.reduce((a,o)=>{let i="unknown";if(o.url&&typeof o.url!="string"){const{url:u,file_type:f}=o.url;f.value&&(i=f.value)}const d=a.find(u=>u.type===i);return d?d.items.push(o):a.push({type:i,items:[o]}),a},[])),e},dm=e=>{var o,i,d,u;const r=(i=(o=e.data)==null?void 0:o.page_speed)==null?void 0:i.metrics.map(f=>{var m,x;return{...f,potentialGain:f.refs?((m=f.refs)==null?void 0:m.weight)-((x=f.refs)==null?void 0:x.weight)/100*f.score:0}}),n=e.data.page_speed.audits.sort((f,m)=>f.score-m.score).map(f=>cm(f,r)),s=(f,m)=>{var R,T,L,$;const x=f.settings.filter(X=>X.inputs[0].value).length>0,v=m.settings.filter(X=>X.inputs[0].value).length>0;if(x&&!v)return-1;if(!x&&v)return 1;const j=f.settings.length>0,b=m.settings.length>0;if(j&&!b)return-1;if(!j&&b)return 1;const w=(((T=(R=f.files)==null?void 0:R.items)==null?void 0:T.length)||0)>0,_=((($=(L=m.files)==null?void 0:L.items)==null?void 0:$.length)||0)>0;return w&&!_?-1:!w&&_?1:0},a={data:{performance:e.data.page_speed.performance?parseFloat((u=(d=e.data)==null?void 0:d.page_speed)==null?void 0:u.performance.toFixed(0)):0,...e.data.page_speed,grouped:{passed_audits:n.filter(f=>f.type==="passed_audit").sort(s),opportunities:n.filter(f=>f.type==="opportunity"),diagnostics:n.filter(f=>f.type==="diagnostics").sort((f,m)=>f.scoreDisplayMode==="informative"?1:-1)},metrics:r},success:e.success,revisions:e.data.revisions.map(({created_at:f,timestamp:m,data:x,id:v})=>({id:v,created_at:f,timestamp:m,data:{performance:x.performance}})),individual_file_actions:e.data["individual-file-actions"],state:e.state};return delete a.data.audits,a},um=e=>{var n,s,a,o,i,d;if(!e.success)return e;const r=((n=e==null?void 0:e.data)==null?void 0:n.performance)||[];return{general:{performance_gear:(a=(s=e==null?void 0:e.data)==null?void 0:s.general)==null?void 0:a.performance_gear,test_mode:((i=(o=e==null?void 0:e.data)==null?void 0:o.general)==null?void 0:i.test_mode)==="1"},actions:(d=e==null?void 0:e.data)==null?void 0:d.actions,data:r.map(u=>({...u,inputs:u.inputs.map(f=>({...f,...f.control_type==="checkbox"&&{value:f.value==="1"||f.value===!0},...f.inputs&&{inputs:f.inputs.map(m=>({...m,value:m.control_type==="checkbox"?m.value==="1"||m.value===!0:m.value}))}}))}))}},fm=(e,r,n)=>{const s=new et(e);return async(a,o)=>{try{const i=await s.getCSSJobStatus(r,n);return a({type:mi,payload:i.data}),i==null?void 0:i.data}catch(i){console.error("Error fetching CSS job status:",i)}}},pm=(e,r,n)=>{const s=new et(e);return async(a,o)=>{try{const i=await s.getTestMode(r,n||"");return a({type:hi,payload:i==null?void 0:i.data}),{success:!0}}catch(i){console.error("Error on Test Mode:",i);let d;return i instanceof Error?d=i.message:typeof i=="string"?d=i:d="An unknown error occurred",{success:!1,error:d}}}},Wt=(e,r,n=!1,s=!1)=>{const a=new et(e);return async(o,i)=>{try{const d=i(),u=d.app.activeReport,f=d.app.report[u];if(f.loading||f.data&&!n&&!s)return;o({type:oi,activeReport:u});const m=await a.fetchPageSpeed(r,u,n);o({type:ii,payload:{activeReport:u,data:dm(m)}})}catch(d){d instanceof Error?o({type:In,error:d.message}):o({type:In,error:"Unknown error occurred"})}}},Ci=(e,r,n=!1,s=!1)=>{const a=new et(e);return async(o,i)=>{var d;try{const u=i(),f=u.app.activeReport,m=u.app.settings.performance[f];if(m.loading||((d=m==null?void 0:m.state)==null?void 0:d.length)>0&&!n)return;o({type:li,activeReport:f});const x=await a.fetchSettings(r,f,n);o({type:ci,payload:{activeReport:f,data:um(x)}})}catch(u){u instanceof Error?o({type:$n,error:u.message}):o({type:$n,error:"Unknown error occurred"})}}},Ni=(e,r,n,s)=>async(a,o)=>{var f,m,x,v;const i=o(),d=(f=i==null?void 0:i.app)==null?void 0:f.activeReport,u=((v=(x=(m=i==null?void 0:i.app)==null?void 0:m.settings.performance[d])==null?void 0:x.state)==null?void 0:v.map(j=>{if(j.name!==r.name)return j;const b=n.split(".");return{...j,inputs:j.inputs.map(w=>b.length>1?w!=null&&w.inputs&&w.key===b[0]?{...w,inputs:w==null?void 0:w.inputs.map(_=>_.key===b[1]?{..._,value:s}:_)}:w:w.key===n?{...w,value:s}:w)}}))||[];a({type:di,payload:{settings:u}})},gr=e=>{const r=["Remove Unused CSS","Minify CSS","Minify Javascript","Page Cache","Self Host Google Fonts"],n=[...r,"RapidLoad CDN","Serve next-gen Images","Lazy Load Iframes","Lazy Load Images","Exclude LCP image from Lazy Load","Add Width and Height Attributes","Defer Javascript"],s=[...n,"Delay Javascript","Critical CSS","Serve next-gen Images (AVIF, WEBP)"];return async(a,o)=>{var v,j,b,w;const i=o(),d=(v=i==null?void 0:i.app)==null?void 0:v.activeReport,u=(b=(j=i==null?void 0:i.app)==null?void 0:j.settings.performance[d])==null?void 0:b.state;if(((w=u==null?void 0:u.find(_=>_.category==="gear"))==null?void 0:w.inputs[0].value)===e)return;const m={starter:r,accelerate:n,turboMax:s},x=(u==null?void 0:u.map(_=>({..._,inputs:_.inputs.map((R,T)=>{var L;return{...R,value:T===0?_.category==="gear"?e:e==="custom"?R.value:(L=m[e])==null?void 0:L.includes(_.name):R.value}})})))||[];a({type:ui,payload:{settings:x,mode:e}})}},Bn=e=>async(r,n)=>{r({type:fi,reportType:e})},mm=(e,r,n,s)=>async(a,o)=>{a({type:pi,payload:{audit:e,file:r,value:n,prev:s}})};var hm=function e(r,n){if(r===n)return!0;if(r&&n&&typeof r=="object"&&typeof n=="object"){if(r.constructor!==n.constructor)return!1;var s,a,o;if(Array.isArray(r)){if(s=r.length,s!=n.length)return!1;for(a=s;a--!==0;)if(!e(r[a],n[a]))return!1;return!0}if(r instanceof Map&&n instanceof Map){if(r.size!==n.size)return!1;for(a of r.entries())if(!n.has(a[0]))return!1;for(a of r.entries())if(!e(a[1],n.get(a[0])))return!1;return!0}if(r instanceof Set&&n instanceof Set){if(r.size!==n.size)return!1;for(a of r.entries())if(!n.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(r)&&ArrayBuffer.isView(n)){if(s=r.length,s!=n.length)return!1;for(a=s;a--!==0;)if(r[a]!==n[a])return!1;return!0}if(r.constructor===RegExp)return r.source===n.source&&r.flags===n.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===n.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===n.toString();if(o=Object.keys(r),s=o.length,s!==Object.keys(n).length)return!1;for(a=s;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[a]))return!1;for(a=s;a--!==0;){var i=o[a];if(!(i==="_owner"&&r.$$typeof)&&!e(r[i],n[i]))return!1}return!0}return r!==r&&n!==n};const gm=kr(hm),xm=e=>e.app;function vm(e){const r=[];if(!(e!=null&&e.files))return[];for(const n of e==null?void 0:e.files){let s=!1;for(let a=0;a{var i;const r=e.report[e.activeReport],n=e.settings.performance[e.activeReport],s=e.settings.general.performance_gear,a=e.settings.actions,o=e.settings.general.test_mode;return{...r,activeReport:e.activeReport,settings:n.state,settingsOriginal:n.original,settingsLoading:n.loading,actions:a,activeGear:s,testMode:o,touched:!gm(n.original,n.state)||!!vm(r.changes).find(d=>d==null?void 0:d.changed),fresh:(i=r==null?void 0:r.state)==null?void 0:i.fresh,reanalyze:r.data!==null&&r.loading}});function Si(e){var r,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e))for(r=0;rtypeof e=="boolean"?"".concat(e):e===0?"0":e,$a=bm,tn=(e,r)=>n=>{var s;if((r==null?void 0:r.variants)==null)return $a(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:o}=r,i=Object.keys(a).map(f=>{const m=n==null?void 0:n[f],x=o==null?void 0:o[f];if(m===null)return null;const v=Ia(m)||Ia(x);return a[f][v]}),d=n&&Object.entries(n).reduce((f,m)=>{let[x,v]=m;return v===void 0||(f[x]=v),f},{}),u=r==null||(s=r.compoundVariants)===null||s===void 0?void 0:s.reduce((f,m)=>{let{class:x,className:v,...j}=m;return Object.entries(j).every(b=>{let[w,_]=b;return Array.isArray(_)?_.includes({...o,...d}[w]):{...o,...d}[w]===_})?[...f,x,v]:f},[]);return $a(e,i,u,n==null?void 0:n.class,n==null?void 0:n.className)},ym=({children:e,uuid:r})=>t.jsx(ke.div,{className:"overflow-hidden",initial:{opacity:0,x:-10,width:0},animate:{opacity:1,x:0,width:"fit-content"},exit:{opacity:0,x:-10,width:0},transition:{duration:.05},children:e},r);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const wm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ni=(...e)=>e.filter((r,n,s)=>!!r&&s.indexOf(r)===n).join(" ");/**
+ */const wm=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ki=(...e)=>e.filter((r,n,s)=>!!r&&s.indexOf(r)===n).join(" ");/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -45,12 +45,12 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const _m=l.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:a="",children:o,iconNode:i,...d},u)=>l.createElement("svg",{ref:u,...jm,width:r,height:r,stroke:e,strokeWidth:s?Number(n)*24/Number(r):n,className:Ni("lucide",a),...d},[...i.map(([f,m])=>l.createElement(f,m)),...Array.isArray(o)?o:[o]]));/**
+ */const _m=l.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:a="",children:o,iconNode:i,...d},u)=>l.createElement("svg",{ref:u,...jm,width:r,height:r,stroke:e,strokeWidth:s?Number(n)*24/Number(r):n,className:ki("lucide",a),...d},[...i.map(([f,m])=>l.createElement(f,m)),...Array.isArray(o)?o:[o]]));/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const J=(e,r)=>{const n=l.forwardRef(({className:s,...a},o)=>l.createElement(_m,{ref:o,iconNode:r,className:Ni(`lucide-${wm(e)}`,s),...a}));return n.displayName=`${e}`,n};/**
+ */const J=(e,r)=>{const n=l.forwardRef(({className:s,...a},o)=>l.createElement(_m,{ref:o,iconNode:r,className:ki(`lucide-${wm(e)}`,s),...a}));return n.displayName=`${e}`,n};/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -60,7 +60,7 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Si=J("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
+ */const Ei=J("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -75,17 +75,17 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const ki=J("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
+ */const Ri=J("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Ei=J("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
+ */const Mi=J("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Ri=J("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
+ */const Ti=J("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -95,12 +95,12 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Mi=J("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
+ */const Pi=J("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Ti=J("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
+ */const Ai=J("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -115,7 +115,7 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const $a=J("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
+ */const Fa=J("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -125,7 +125,7 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Ee=J("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
+ */const Se=J("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -140,7 +140,7 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Fa=J("Dot",[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]]);/**
+ */const Ba=J("Dot",[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -150,12 +150,12 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Pi=J("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
+ */const Oi=J("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Ai=J("FileMinus2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}]]);/**
+ */const Li=J("FileMinus2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 15h6",key:"4e2qda"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -210,12 +210,12 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Oi=J("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
+ */const Di=J("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Ba=J("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
+ */const za=J("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -225,7 +225,7 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const Li=J("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
+ */const zn=J("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
* @license lucide-react v0.417.0 - ISC
*
* This source code is licensed under the ISC license.
@@ -275,17 +275,17 @@ var Ou=Object.defineProperty;var Lu=(e,r,n)=>r in e?Ou(e,r,{enumerable:!0,config
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
- */const rn=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),cs=tn("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground dark:bg-accent dark:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),pt=l.forwardRef(({loading:e,children:r,className:n,variant:s,size:a,asChild:o=!1,...i},d)=>{const u=o?"div":"button";return t.jsxs(u,{className:S(cs({variant:s,size:a,className:n})),ref:d,...i,children:[t.jsx(Ve,{children:e&&t.jsx(ym,{uuid:JSON.stringify(i),children:t.jsx(Ge,{className:"w-4 animate-spin "})})}),r]})});pt.displayName="Button";const Le=({children:e,className:r,...n})=>t.jsx(pt,{className:S(r,"flex gap-2 cursor-pointer"),asChild:!0,...n,children:e});var ds="Dialog",[Di,Ii]=Ze(ds),[Qm,Ke]=Di(ds),$i=e=>{const{__scopeDialog:r,children:n,open:s,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,d=l.useRef(null),u=l.useRef(null),[f=!1,m]=Xe({prop:s,defaultProp:a,onChange:o});return t.jsx(Qm,{scope:r,triggerRef:d,contentRef:u,contentId:ut(),titleId:ut(),descriptionId:ut(),open:f,onOpenChange:m,onOpenToggle:l.useCallback(()=>m(x=>!x),[m]),modal:i,children:n})};$i.displayName=ds;var Fi="DialogTrigger",Bi=l.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,a=Ke(Fi,n),o=Re(r,a.triggerRef);return t.jsx(ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":ps(a.open),...s,ref:o,onClick:K(e.onClick,a.onOpenToggle)})});Bi.displayName=Fi;var us="DialogPortal",[e0,zi]=Di(us,{forceMount:void 0}),Vi=e=>{const{__scopeDialog:r,forceMount:n,children:s,container:a}=e,o=Ke(us,r);return t.jsx(e0,{scope:r,forceMount:n,children:l.Children.map(s,i=>t.jsx(tt,{present:n||o.open,children:t.jsx(Bu,{asChild:!0,container:a,children:i})}))})};Vi.displayName=us;var xr="DialogOverlay",Hi=l.forwardRef((e,r)=>{const n=zi(xr,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,o=Ke(xr,e.__scopeDialog);return o.modal?t.jsx(tt,{present:s||o.open,children:t.jsx(t0,{...a,ref:r})}):null});Hi.displayName=xr;var t0=l.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,a=Ke(xr,n);return t.jsx(io,{as:lo,allowPinchZoom:!0,shards:[a.contentRef],children:t.jsx(ue.div,{"data-state":ps(a.open),...s,ref:r,style:{pointerEvents:"auto",...s.style}})})}),mt="DialogContent",Ui=l.forwardRef((e,r)=>{const n=zi(mt,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,o=Ke(mt,e.__scopeDialog);return t.jsx(tt,{present:s||o.open,children:o.modal?t.jsx(r0,{...a,ref:r}):t.jsx(n0,{...a,ref:r})})});Ui.displayName=mt;var r0=l.forwardRef((e,r)=>{const n=Ke(mt,e.__scopeDialog),s=l.useRef(null),a=Re(r,n.contentRef,s);return l.useEffect(()=>{const o=s.current;if(o)return co(o)},[]),t.jsx(Gi,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:K(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,d=i.button===0&&i.ctrlKey===!0;(i.button===2||d)&&o.preventDefault()}),onFocusOutside:K(e.onFocusOutside,o=>o.preventDefault())})}),n0=l.forwardRef((e,r)=>{const n=Ke(mt,e.__scopeDialog),s=l.useRef(!1),a=l.useRef(!1);return t.jsx(Gi,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,d;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(s.current||(d=n.triggerRef.current)==null||d.focus(),o.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:o=>{var u,f;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=o.target;((f=n.triggerRef.current)==null?void 0:f.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),Gi=l.forwardRef((e,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,d=Ke(mt,n),u=l.useRef(null),f=Re(r,u);return uo(),t.jsxs(t.Fragment,{children:[t.jsx(fo,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:o,children:t.jsx(Sr,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":ps(d.open),...i,ref:f,onDismiss:()=>d.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(a0,{titleId:d.titleId}),t.jsx(i0,{contentRef:u,descriptionId:d.descriptionId})]})]})}),fs="DialogTitle",Ki=l.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,a=Ke(fs,n);return t.jsx(ue.h2,{id:a.titleId,...s,ref:r})});Ki.displayName=fs;var qi="DialogDescription",Wi=l.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,a=Ke(qi,n);return t.jsx(ue.p,{id:a.descriptionId,...s,ref:r})});Wi.displayName=qi;var Zi="DialogClose",Xi=l.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,a=Ke(Zi,n);return t.jsx(ue.button,{type:"button",...s,ref:r,onClick:K(e.onClick,()=>a.onOpenChange(!1))})});Xi.displayName=Zi;function ps(e){return e?"open":"closed"}var Yi="DialogTitleWarning",[s0,Ji]=Fu(Yi,{contentName:mt,titleName:fs,docsSlug:"dialog"}),a0=({titleId:e})=>{const r=Ji(Yi),n=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
+ */const rn=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ds=tn("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground dark:bg-accent dark:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),pt=l.forwardRef(({loading:e,children:r,className:n,variant:s,size:a,asChild:o=!1,...i},d)=>{const u=o?"div":"button";return t.jsxs(u,{className:S(ds({variant:s,size:a,className:n})),ref:d,...i,children:[t.jsx(Ve,{children:e&&t.jsx(ym,{uuid:JSON.stringify(i),children:t.jsx(Ge,{className:"w-4 animate-spin "})})}),r]})});pt.displayName="Button";const Oe=({children:e,className:r,...n})=>t.jsx(pt,{className:S(r,"flex gap-2 cursor-pointer"),asChild:!0,...n,children:e});var us="Dialog",[Ii,$i]=Ze(us),[Qm,Ke]=Ii(us),Fi=e=>{const{__scopeDialog:r,children:n,open:s,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,d=l.useRef(null),u=l.useRef(null),[f=!1,m]=Xe({prop:s,defaultProp:a,onChange:o});return t.jsx(Qm,{scope:r,triggerRef:d,contentRef:u,contentId:ut(),titleId:ut(),descriptionId:ut(),open:f,onOpenChange:m,onOpenToggle:l.useCallback(()=>m(x=>!x),[m]),modal:i,children:n})};Fi.displayName=us;var Bi="DialogTrigger",zi=l.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,a=Ke(Bi,n),o=Re(r,a.triggerRef);return t.jsx(fe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":ms(a.open),...s,ref:o,onClick:K(e.onClick,a.onOpenToggle)})});zi.displayName=Bi;var fs="DialogPortal",[e0,Vi]=Ii(fs,{forceMount:void 0}),Hi=e=>{const{__scopeDialog:r,forceMount:n,children:s,container:a}=e,o=Ke(fs,r);return t.jsx(e0,{scope:r,forceMount:n,children:l.Children.map(s,i=>t.jsx(tt,{present:n||o.open,children:t.jsx(zu,{asChild:!0,container:a,children:i})}))})};Hi.displayName=fs;var xr="DialogOverlay",Ui=l.forwardRef((e,r)=>{const n=Vi(xr,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,o=Ke(xr,e.__scopeDialog);return o.modal?t.jsx(tt,{present:s||o.open,children:t.jsx(t0,{...a,ref:r})}):null});Ui.displayName=xr;var t0=l.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,a=Ke(xr,n);return t.jsx(lo,{as:co,allowPinchZoom:!0,shards:[a.contentRef],children:t.jsx(fe.div,{"data-state":ms(a.open),...s,ref:r,style:{pointerEvents:"auto",...s.style}})})}),mt="DialogContent",Gi=l.forwardRef((e,r)=>{const n=Vi(mt,e.__scopeDialog),{forceMount:s=n.forceMount,...a}=e,o=Ke(mt,e.__scopeDialog);return t.jsx(tt,{present:s||o.open,children:o.modal?t.jsx(r0,{...a,ref:r}):t.jsx(n0,{...a,ref:r})})});Gi.displayName=mt;var r0=l.forwardRef((e,r)=>{const n=Ke(mt,e.__scopeDialog),s=l.useRef(null),a=Re(r,n.contentRef,s);return l.useEffect(()=>{const o=s.current;if(o)return uo(o)},[]),t.jsx(Ki,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:K(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,d=i.button===0&&i.ctrlKey===!0;(i.button===2||d)&&o.preventDefault()}),onFocusOutside:K(e.onFocusOutside,o=>o.preventDefault())})}),n0=l.forwardRef((e,r)=>{const n=Ke(mt,e.__scopeDialog),s=l.useRef(!1),a=l.useRef(!1);return t.jsx(Ki,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,d;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(s.current||(d=n.triggerRef.current)==null||d.focus(),o.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:o=>{var u,f;(u=e.onInteractOutside)==null||u.call(e,o),o.defaultPrevented||(s.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=o.target;((f=n.triggerRef.current)==null?void 0:f.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),Ki=l.forwardRef((e,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,d=Ke(mt,n),u=l.useRef(null),f=Re(r,u);return fo(),t.jsxs(t.Fragment,{children:[t.jsx(po,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:o,children:t.jsx(Sr,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":ms(d.open),...i,ref:f,onDismiss:()=>d.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(a0,{titleId:d.titleId}),t.jsx(i0,{contentRef:u,descriptionId:d.descriptionId})]})]})}),ps="DialogTitle",qi=l.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,a=Ke(ps,n);return t.jsx(fe.h2,{id:a.titleId,...s,ref:r})});qi.displayName=ps;var Wi="DialogDescription",Zi=l.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,a=Ke(Wi,n);return t.jsx(fe.p,{id:a.descriptionId,...s,ref:r})});Zi.displayName=Wi;var Xi="DialogClose",Yi=l.forwardRef((e,r)=>{const{__scopeDialog:n,...s}=e,a=Ke(Xi,n);return t.jsx(fe.button,{type:"button",...s,ref:r,onClick:K(e.onClick,()=>a.onOpenChange(!1))})});Yi.displayName=Xi;function ms(e){return e?"open":"closed"}var Ji="DialogTitleWarning",[s0,Qi]=Bu(Ji,{contentName:mt,titleName:ps,docsSlug:"dialog"}),a0=({titleId:e})=>{const r=Qi(Ji),n=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
-For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},o0="DialogDescriptionWarning",i0=({contentRef:e,descriptionId:r})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ji(o0).contentName}}.`;return l.useEffect(()=>{var o;const a=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");r&&a&&(document.getElementById(r)||console.warn(s))},[s,e,r]),null},Qi=$i,el=Bi,ms=Vi,tl=Hi,hs=Ui,gs=Ki,xs=Wi,vs=Xi,rl="AlertDialog",[l0,Gx]=Ze(rl,[Ii]),rt=Ii(),nl=e=>{const{__scopeAlertDialog:r,...n}=e,s=rt(r);return t.jsx(Qi,{...s,...n,modal:!0})};nl.displayName=rl;var c0="AlertDialogTrigger",sl=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,a=rt(n);return t.jsx(el,{...a,...s,ref:r})});sl.displayName=c0;var d0="AlertDialogPortal",al=e=>{const{__scopeAlertDialog:r,...n}=e,s=rt(r);return t.jsx(ms,{...s,...n})};al.displayName=d0;var u0="AlertDialogOverlay",ol=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,a=rt(n);return t.jsx(tl,{...a,...s,ref:r})});ol.displayName=u0;var kt="AlertDialogContent",[f0,p0]=l0(kt),il=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,children:s,...a}=e,o=rt(n),i=l.useRef(null),d=Re(r,i),u=l.useRef(null);return t.jsx(s0,{contentName:kt,titleName:ll,docsSlug:"alert-dialog",children:t.jsx(f0,{scope:n,cancelRef:u,children:t.jsxs(hs,{role:"alertdialog",...o,...a,ref:d,onOpenAutoFocus:K(a.onOpenAutoFocus,f=>{var m;f.preventDefault(),(m=u.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[t.jsx(oo,{children:s}),t.jsx(h0,{contentRef:i})]})})})});il.displayName=kt;var ll="AlertDialogTitle",cl=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,a=rt(n);return t.jsx(gs,{...a,...s,ref:r})});cl.displayName=ll;var dl="AlertDialogDescription",ul=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,a=rt(n);return t.jsx(xs,{...a,...s,ref:r})});ul.displayName=dl;var m0="AlertDialogAction",fl=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,a=rt(n);return t.jsx(vs,{...a,...s,ref:r})});fl.displayName=m0;var pl="AlertDialogCancel",ml=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:a}=p0(pl,n),o=rt(n),i=Re(r,a);return t.jsx(vs,{...o,...s,ref:i})});ml.displayName=pl;var h0=({contentRef:e})=>{const r=`\`${kt}\` requires a description for the component to be accessible for screen reader users.
+For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},o0="DialogDescriptionWarning",i0=({contentRef:e,descriptionId:r})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Qi(o0).contentName}}.`;return l.useEffect(()=>{var o;const a=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");r&&a&&(document.getElementById(r)||console.warn(s))},[s,e,r]),null},el=Fi,tl=zi,hs=Hi,rl=Ui,gs=Gi,xs=qi,vs=Zi,bs=Yi,nl="AlertDialog",[l0,Gx]=Ze(nl,[$i]),rt=$i(),sl=e=>{const{__scopeAlertDialog:r,...n}=e,s=rt(r);return t.jsx(el,{...s,...n,modal:!0})};sl.displayName=nl;var c0="AlertDialogTrigger",al=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,a=rt(n);return t.jsx(tl,{...a,...s,ref:r})});al.displayName=c0;var d0="AlertDialogPortal",ol=e=>{const{__scopeAlertDialog:r,...n}=e,s=rt(r);return t.jsx(hs,{...s,...n})};ol.displayName=d0;var u0="AlertDialogOverlay",il=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,a=rt(n);return t.jsx(rl,{...a,...s,ref:r})});il.displayName=u0;var kt="AlertDialogContent",[f0,p0]=l0(kt),ll=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,children:s,...a}=e,o=rt(n),i=l.useRef(null),d=Re(r,i),u=l.useRef(null);return t.jsx(s0,{contentName:kt,titleName:cl,docsSlug:"alert-dialog",children:t.jsx(f0,{scope:n,cancelRef:u,children:t.jsxs(gs,{role:"alertdialog",...o,...a,ref:d,onOpenAutoFocus:K(a.onOpenAutoFocus,f=>{var m;f.preventDefault(),(m=u.current)==null||m.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[t.jsx(io,{children:s}),t.jsx(h0,{contentRef:i})]})})})});ll.displayName=kt;var cl="AlertDialogTitle",dl=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,a=rt(n);return t.jsx(xs,{...a,...s,ref:r})});dl.displayName=cl;var ul="AlertDialogDescription",fl=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,a=rt(n);return t.jsx(vs,{...a,...s,ref:r})});fl.displayName=ul;var m0="AlertDialogAction",pl=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,a=rt(n);return t.jsx(bs,{...a,...s,ref:r})});pl.displayName=m0;var ml="AlertDialogCancel",hl=l.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...s}=e,{cancelRef:a}=p0(ml,n),o=rt(n),i=Re(r,a);return t.jsx(bs,{...o,...s,ref:i})});hl.displayName=ml;var h0=({contentRef:e})=>{const r=`\`${kt}\` requires a description for the component to be accessible for screen reader users.
-You can add a description to the \`${kt}\` by passing a \`${dl}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
+You can add a description to the \`${kt}\` by passing a \`${ul}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${kt}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
-For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return l.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(r)},[r,e]),null},g0=nl,x0=sl,hl=al,gl=ol,xl=il,vl=fl,bs=ml,bl=cl,yl=ul;const wl=g0,jl=x0,_l=({className:e,...r})=>t.jsx(hl,{...r});_l.displayName=hl.displayName;const Cl=l.forwardRef(({className:e,children:r,...n},s)=>t.jsx(gl,{className:S("fixed inset-0 z-[120000] bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n,ref:s}));Cl.displayName=gl.displayName;const ys=l.forwardRef(({className:e,...r},n)=>{var s,a;return t.jsxs(_l,{container:((a=(s=document.getElementById("rapidload-optimizer-shadow-dom"))==null?void 0:s.shadowRoot)==null?void 0:a.getElementById("rapidload-page-optimizer-wrapper"))||document.body,children:[t.jsx(Cl,{}),t.jsx(xl,{asChild:!0,ref:n,className:S("fixed left-[50%] top-[50%] z-[120000] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...r})]})});ys.displayName=xl.displayName;const ws=({className:e,...r})=>t.jsx("div",{className:S("flex flex-col space-y-2 text-center sm:text-left",e),...r});ws.displayName="AlertDialogHeader";const js=({className:e,...r})=>t.jsx("div",{className:S("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});js.displayName="AlertDialogFooter";const _s=l.forwardRef(({className:e,...r},n)=>t.jsx(bl,{ref:n,className:S("text-lg font-semibold",e),...r}));_s.displayName=bl.displayName;const Cs=l.forwardRef(({className:e,...r},n)=>t.jsx(yl,{asChild:!0,ref:n,className:S("text-sm text-muted-foreground",e),...r}));Cs.displayName=yl.displayName;const Ns=l.forwardRef(({className:e,...r},n)=>t.jsx(vl,{ref:n,className:S(cs(),e),...r}));Ns.displayName=vl.displayName;const Ss=l.forwardRef(({className:e,...r},n)=>t.jsx(bs,{ref:n,className:S(cs({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));Ss.displayName=bs.displayName;function v0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-4.28 9.22a.75.75 0 0 0 0 1.06l3 3a.75.75 0 1 0 1.06-1.06l-1.72-1.72h5.69a.75.75 0 0 0 0-1.5h-5.69l1.72-1.72a.75.75 0 0 0-1.06-1.06l-3 3Z",clipRule:"evenodd"}))}const b0=l.forwardRef(v0);function y0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",clipRule:"evenodd"}))}const w0=l.forwardRef(y0);function j0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M14.615 1.595a.75.75 0 0 1 .359.852L12.982 9.75h7.268a.75.75 0 0 1 .548 1.262l-10.5 11.25a.75.75 0 0 1-1.272-.71l1.992-7.302H3.75a.75.75 0 0 1-.548-1.262l10.5-11.25a.75.75 0 0 1 .913-.143Z",clipRule:"evenodd"}))}const Nl=l.forwardRef(j0);function _0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const Be=l.forwardRef(_0);function C0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))}const Sl=l.forwardRef(C0);function N0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",clipRule:"evenodd"}))}const S0=l.forwardRef(N0);function k0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))}const kl=l.forwardRef(k0);function E0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z",clipRule:"evenodd"}))}const zn=l.forwardRef(E0);function R0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 9a.75.75 0 0 0-1.5 0v2.25H9a.75.75 0 0 0 0 1.5h2.25V15a.75.75 0 0 0 1.5 0v-2.25H15a.75.75 0 0 0 0-1.5h-2.25V9Z",clipRule:"evenodd"}))}const El=l.forwardRef(R0);function M0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))}const ht=l.forwardRef(M0);function T0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Rl=l.forwardRef(T0),P0=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,za=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(P0);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},Va=e=>e==="*"||e==="x"||e==="X",Ha=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},A0=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],O0=(e,r)=>{if(Va(e)||Va(r))return 0;const[n,s]=A0(Ha(e),Ha(r));return n>s?1:n{for(let n=0;n{const n=za(e),s=za(r),a=n.pop(),o=s.pop(),i=Ua(n,s);return i!==0?i:a&&o?Ua(a.split("."),o.split(".")):a||o?a?-1:1:0},Ml=()=>{const{setShowOptimizer:e,options:r,modeData:n,savingData:s,setSavingData:a,invalidatingCache:o,setInvalidatingCache:i,global:d}=he(),u=ot(),{settingsMode:f}=xe(),{fresh:m,touched:x,activeReport:v,data:j,settings:y,activeGear:w}=ce(ve),{grouped:_,...M}=j||{};({...M});const T=r==null?void 0:r.optimizer_url,{toast:L}=gt();return{submitSettings:l.useCallback(async(X=!1,z=!1)=>{if(s)return;const A=new et(r);try{a(!0);const D=await A.updateSettings(T,v,{settings:y,activeGear:w},z,X);if(L({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["Your settings have been saved successfully ",t.jsx(Be,{className:"w-5 text-green-600"})]})}),X){a(!1);const U={mobile:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.133 Mobile Safari/537.36",desktop:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"};try{i(!0),await A.post("clear_page_cache",{url:T});const Q=A.rest();L0(r==null?void 0:r.rapidload_version,"2.2.11")>0?await A.post("preload_page",{url:r.optimizer_url,user_agent:v==="mobile"?U.mobile:U.desktop,nonce:r.nonce,job_id:j==null?void 0:j.job_id}):await Q.request("/ping",{url:r.optimizer_url,user_agent:v==="mobile"?U.mobile:U.desktop,nonce:r==null?void 0:r.nonce,job_id:j==null?void 0:j.job_id}),i(!1)}catch(Q){i(!1),L({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[Q.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]})})}u(hr(r,T,!0))}}catch(D){L({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[D.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]})})}a(!1),i(!1)},[j,v,s,o,y,w])}},vr=({children:e,onClick:r,title:n,description:s,action:a="Save & Exit",onCancel:o,cancel:i,performanceGear:d})=>{const{touched:u,fresh:f}=ce(ve),{submitSettings:m}=Ml(),{showInprogress:x}=he();if(!d&&(!(f||u)||x))return t.jsx("div",{onClick:j=>r(),children:e});const v=async()=>{d||await m(!1),r()};return t.jsxs(wl,{children:[t.jsx(jl,{asChild:!0,children:t.jsx("div",{children:e})}),t.jsx(ys,{children:t.jsxs("div",{children:[t.jsxs(ws,{children:[t.jsxs(_s,{className:"flex justify-between items-center",children:[n||"Continue without Saving?",t.jsx(me,{text:"Close the Alert",children:t.jsx(bs,{asChild:!0,children:t.jsx(rn,{className:"stroke-1"})})})]}),t.jsx(Cs,{children:t.jsx("div",{children:s||"You have changes that haven't been saved. If you are leave now, your edits will be lost."})})]}),t.jsxs(js,{children:[t.jsx(Ns,{onClick:async j=>v(),children:a}),t.jsx(Ss,{onClick:j=>o&&o(),children:i||"Discard"})]})]})})]})},D0=({timestamp:e})=>{const r=Nn(e),[n,s]=l.useState(r);return l.useEffect(()=>{const a=setInterval(()=>{s(Nn(e))},6e4);return()=>clearInterval(a)},[]),t.jsx(t.Fragment,{children:Nn(e)})},I0=()=>{var m,x,v,j,y,w;l.useState(!1);const{data:e,loading:r,error:n,activeReport:s}=ce(ve),{report:a}=ce(_=>_.app),{mobile:o,desktop:i}=a,{togglePerformance:d,options:u}=he(),f=u.optimizer_url;return t.jsx("div",{className:"flex flex-row flex-1 gap-3 px-5 min-w-[350px] items-center bg-white dark:bg-brand-800",children:t.jsxs("div",{children:[t.jsx("div",{className:"text-sm items-center cursor-default text-ellipsis truncate md:max-w-sm lg:max-w-xl",children:(m=e==null?void 0:e.loadingExperience)!=null&&m.initial_url?decodeURIComponent(e.loadingExperience.initial_url.replace("?rapidload_preview","")):f}),!n&&t.jsx("div",{className:"flex h-4 items-center text-xxs leading-relaxed text-brand-500 cursor-default",children:e?t.jsxs(t.Fragment,{children:[((x=e==null?void 0:e.loadingExperience)==null?void 0:x.timestamp)&&t.jsxs(t.Fragment,{children:["Last analyzed ",t.jsx(D0,{timestamp:e.loadingExperience.timestamp})]}),s==="mobile"&&((v=i==null?void 0:i.data)==null?void 0:v.performance)&&t.jsxs(t.Fragment,{children:[t.jsx(Fa,{className:"w-6 text-brand-400"}),t.jsxs("div",{className:"flex gap-1 items-center",children:[Number((j=i==null?void 0:i.data)==null?void 0:j.performance).toFixed(0)," Desktop"]})]}),s==="desktop"&&((y=o==null?void 0:o.data)==null?void 0:y.performance)&&t.jsxs(t.Fragment,{children:[t.jsx(Fa,{className:"w-6 text-brand-400"}),t.jsxs("div",{className:"flex gap-1 items-center",children:[Number((w=o==null?void 0:o.data)==null?void 0:w.performance).toFixed(0)," Mobile"]})]})]}):t.jsx("div",{className:"w-64 bg-brand-300 dark:bg-brand-600 animate-pulse h-2.5 rounded-sm mt-1"})})]})})},br=({children:e,mode:r="normal"})=>{const{mode:n}=xe();return r===n?t.jsx(t.Fragment,{children:e}):t.jsx(t.Fragment,{})};var Mn="rovingFocusGroup.onEntryFocus",$0={bubbles:!1,cancelable:!0},nn="RovingFocusGroup",[Vn,Tl,F0]=po(nn),[B0,sn]=Ze(nn,[F0]),[z0,V0]=B0(nn),Pl=l.forwardRef((e,r)=>t.jsx(Vn.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Vn.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(H0,{...e,ref:r})})}));Pl.displayName=nn;var H0=l.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:a=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...x}=e,v=l.useRef(null),j=Re(r,v),y=Qn(o),[w=null,_]=Xe({prop:i,defaultProp:d,onChange:u}),[M,T]=l.useState(!1),L=es(f),$=Tl(n),X=l.useRef(!1),[z,A]=l.useState(0);return l.useEffect(()=>{const D=v.current;if(D)return D.addEventListener(Mn,L),()=>D.removeEventListener(Mn,L)},[L]),t.jsx(z0,{scope:n,orientation:s,dir:y,loop:a,currentTabStopId:w,onItemFocus:l.useCallback(D=>_(D),[_]),onItemShiftTab:l.useCallback(()=>T(!0),[]),onFocusableItemAdd:l.useCallback(()=>A(D=>D+1),[]),onFocusableItemRemove:l.useCallback(()=>A(D=>D-1),[]),children:t.jsx(ue.div,{tabIndex:M||z===0?-1:0,"data-orientation":s,...x,ref:j,style:{outline:"none",...e.style},onMouseDown:K(e.onMouseDown,()=>{X.current=!0}),onFocus:K(e.onFocus,D=>{const U=!X.current;if(D.target===D.currentTarget&&U&&!M){const Q=new CustomEvent(Mn,$0);if(D.currentTarget.dispatchEvent(Q),!Q.defaultPrevented){const Y=$().filter(O=>O.focusable),Z=Y.find(O=>O.active),G=Y.find(O=>O.id===w),k=[Z,G,...Y].filter(Boolean).map(O=>O.ref.current);Ll(k,m)}}X.current=!1}),onBlur:K(e.onBlur,()=>T(!1))})})}),Al="RovingFocusGroupItem",Ol=l.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:a=!1,tabStopId:o,...i}=e,d=ut(),u=o||d,f=V0(Al,n),m=f.currentTabStopId===u,x=Tl(n),{onFocusableItemAdd:v,onFocusableItemRemove:j}=f;return l.useEffect(()=>{if(s)return v(),()=>j()},[s,v,j]),t.jsx(Vn.ItemSlot,{scope:n,id:u,focusable:s,active:a,children:t.jsx(ue.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...i,ref:r,onMouseDown:K(e.onMouseDown,y=>{s?f.onItemFocus(u):y.preventDefault()}),onFocus:K(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:K(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const w=K0(y,f.orientation,f.dir);if(w!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let M=x().filter(T=>T.focusable).map(T=>T.ref.current);if(w==="last")M.reverse();else if(w==="prev"||w==="next"){w==="prev"&&M.reverse();const T=M.indexOf(y.currentTarget);M=f.loop?q0(M,T+1):M.slice(T+1)}setTimeout(()=>Ll(M))}})})})});Ol.displayName=Al;var U0={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function G0(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function K0(e,r,n){const s=G0(e.key,n);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return U0[s]}function Ll(e,r=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:r}),document.activeElement!==n))return}function q0(e,r){return e.map((n,s)=>e[(r+s)%e.length])}var Dl=Pl,Il=Ol,Hn=["Enter"," "],W0=["ArrowDown","PageUp","Home"],$l=["ArrowUp","PageDown","End"],Z0=[...W0,...$l],X0={ltr:[...Hn,"ArrowRight"],rtl:[...Hn,"ArrowLeft"]},Y0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Qt="Menu",[Xt,J0,Q0]=po(Qt),[xt,Fl]=Ze(Qt,[Q0,Pt,sn]),an=Pt(),Bl=sn(),[eh,Ot]=xt(Qt),[th,er]=xt(Qt),zl=e=>{const{__scopeMenu:r,open:n=!1,children:s,dir:a,onOpenChange:o,modal:i=!0}=e,d=an(r),[u,f]=l.useState(null),m=l.useRef(!1),x=es(o),v=Qn(a);return l.useEffect(()=>{const j=()=>{m.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>m.current=!1;return document.addEventListener("keydown",j,{capture:!0}),()=>{document.removeEventListener("keydown",j,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),t.jsx(Jn,{...d,children:t.jsx(eh,{scope:r,open:n,onOpenChange:x,content:u,onContentChange:f,children:t.jsx(th,{scope:r,onClose:l.useCallback(()=>x(!1),[x]),isUsingKeyboardRef:m,dir:v,modal:i,children:s})})})};zl.displayName=Qt;var rh="MenuAnchor",ks=l.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e,a=an(n);return t.jsx(Zn,{...a,...s,ref:r})});ks.displayName=rh;var nh="MenuPortal",[Kx,Vl]=xt(nh,{forceMount:void 0}),ze="MenuContent",[sh,Es]=xt(ze),Hl=l.forwardRef((e,r)=>{const n=Vl(ze,e.__scopeMenu),{forceMount:s=n.forceMount,...a}=e,o=Ot(ze,e.__scopeMenu),i=er(ze,e.__scopeMenu);return t.jsx(Xt.Provider,{scope:e.__scopeMenu,children:t.jsx(tt,{present:s||o.open,children:t.jsx(Xt.Slot,{scope:e.__scopeMenu,children:i.modal?t.jsx(ah,{...a,ref:r}):t.jsx(oh,{...a,ref:r})})})})}),ah=l.forwardRef((e,r)=>{const n=Ot(ze,e.__scopeMenu),s=l.useRef(null),a=Re(r,s);return l.useEffect(()=>{const o=s.current;if(o)return co(o)},[]),t.jsx(Rs,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:K(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),oh=l.forwardRef((e,r)=>{const n=Ot(ze,e.__scopeMenu);return t.jsx(Rs,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Rs=l.forwardRef((e,r)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:d,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:x,onInteractOutside:v,onDismiss:j,disableOutsideScroll:y,...w}=e,_=Ot(ze,n),M=er(ze,n),T=an(n),L=Bl(n),$=J0(n),[X,z]=l.useState(null),A=l.useRef(null),D=Re(r,A,_.onContentChange),U=l.useRef(0),Q=l.useRef(""),Y=l.useRef(0),Z=l.useRef(null),G=l.useRef("right"),te=l.useRef(0),k=y?io:l.Fragment,O=y?{as:lo,allowPinchZoom:!0}:void 0,V=q=>{var ke,qe;const be=Q.current+q,Me=$().filter(Fe=>!Fe.disabled),$e=document.activeElement,Ye=(ke=Me.find(Fe=>Fe.ref.current===$e))==null?void 0:ke.textValue,nt=Me.map(Fe=>Fe.textValue),vt=vh(nt,be,Ye),Je=(qe=Me.find(Fe=>Fe.textValue===vt))==null?void 0:qe.ref.current;(function Fe(bt){Q.current=bt,window.clearTimeout(U.current),bt!==""&&(U.current=window.setTimeout(()=>Fe(""),1e3))})(be),Je&&setTimeout(()=>Je.focus())};l.useEffect(()=>()=>window.clearTimeout(U.current),[]),uo();const oe=l.useCallback(q=>{var Me,$e;return G.current===((Me=Z.current)==null?void 0:Me.side)&&yh(q,($e=Z.current)==null?void 0:$e.area)},[]);return t.jsx(sh,{scope:n,searchRef:Q,onItemEnter:l.useCallback(q=>{oe(q)&&q.preventDefault()},[oe]),onItemLeave:l.useCallback(q=>{var be;oe(q)||((be=A.current)==null||be.focus(),z(null))},[oe]),onTriggerLeave:l.useCallback(q=>{oe(q)&&q.preventDefault()},[oe]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:l.useCallback(q=>{Z.current=q},[]),children:t.jsx(k,{...O,children:t.jsx(fo,{asChild:!0,trapped:a,onMountAutoFocus:K(o,q=>{var be;q.preventDefault(),(be=A.current)==null||be.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:t.jsx(Sr,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:x,onInteractOutside:v,onDismiss:j,children:t.jsx(Dl,{asChild:!0,...L,dir:M.dir,orientation:"vertical",loop:s,currentTabStopId:X,onCurrentTabStopIdChange:z,onEntryFocus:K(u,q=>{M.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(Xn,{role:"menu","aria-orientation":"vertical","data-state":ac(_.open),"data-radix-menu-content":"",dir:M.dir,...T,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:K(w.onKeyDown,q=>{const Me=q.target.closest("[data-radix-menu-content]")===q.currentTarget,$e=q.ctrlKey||q.altKey||q.metaKey,Ye=q.key.length===1;Me&&(q.key==="Tab"&&q.preventDefault(),!$e&&Ye&&V(q.key));const nt=A.current;if(q.target!==nt||!Z0.includes(q.key))return;q.preventDefault();const Je=$().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);$l.includes(q.key)&&Je.reverse(),gh(Je)}),onBlur:K(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(U.current),Q.current="")}),onPointerMove:K(e.onPointerMove,Yt(q=>{const be=q.target,Me=te.current!==q.clientX;if(q.currentTarget.contains(be)&&Me){const $e=q.clientX>te.current?"right":"left";G.current=$e,te.current=q.clientX}}))})})})})})})});Hl.displayName=ze;var ih="MenuGroup",Ms=l.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return t.jsx(ue.div,{role:"group",...s,ref:r})});Ms.displayName=ih;var lh="MenuLabel",Ul=l.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return t.jsx(ue.div,{...s,ref:r})});Ul.displayName=lh;var yr="MenuItem",Ga="menu.itemSelect",on=l.forwardRef((e,r)=>{const{disabled:n=!1,onSelect:s,...a}=e,o=l.useRef(null),i=er(yr,e.__scopeMenu),d=Es(yr,e.__scopeMenu),u=Re(r,o),f=l.useRef(!1),m=()=>{const x=o.current;if(!n&&x){const v=new CustomEvent(Ga,{bubbles:!0,cancelable:!0});x.addEventListener(Ga,j=>s==null?void 0:s(j),{once:!0}),zu(x,v),v.defaultPrevented?f.current=!1:i.onClose()}};return t.jsx(Gl,{...a,ref:u,disabled:n,onClick:K(e.onClick,m),onPointerDown:x=>{var v;(v=e.onPointerDown)==null||v.call(e,x),f.current=!0},onPointerUp:K(e.onPointerUp,x=>{var v;f.current||(v=x.currentTarget)==null||v.click()}),onKeyDown:K(e.onKeyDown,x=>{const v=d.searchRef.current!=="";n||v&&x.key===" "||Hn.includes(x.key)&&(x.currentTarget.click(),x.preventDefault())})})});on.displayName=yr;var Gl=l.forwardRef((e,r)=>{const{__scopeMenu:n,disabled:s=!1,textValue:a,...o}=e,i=Es(yr,n),d=Bl(n),u=l.useRef(null),f=Re(r,u),[m,x]=l.useState(!1),[v,j]=l.useState("");return l.useEffect(()=>{const y=u.current;y&&j((y.textContent??"").trim())},[o.children]),t.jsx(Xt.ItemSlot,{scope:n,disabled:s,textValue:a??v,children:t.jsx(Il,{asChild:!0,...d,focusable:!s,children:t.jsx(ue.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...o,ref:f,onPointerMove:K(e.onPointerMove,Yt(y=>{s?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:K(e.onPointerLeave,Yt(y=>i.onItemLeave(y))),onFocus:K(e.onFocus,()=>x(!0)),onBlur:K(e.onBlur,()=>x(!1))})})})}),ch="MenuCheckboxItem",Kl=l.forwardRef((e,r)=>{const{checked:n=!1,onCheckedChange:s,...a}=e;return t.jsx(Yl,{scope:e.__scopeMenu,checked:n,children:t.jsx(on,{role:"menuitemcheckbox","aria-checked":wr(n)?"mixed":n,...a,ref:r,"data-state":Ps(n),onSelect:K(a.onSelect,()=>s==null?void 0:s(wr(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Kl.displayName=ch;var ql="MenuRadioGroup",[dh,uh]=xt(ql,{value:void 0,onValueChange:()=>{}}),Wl=l.forwardRef((e,r)=>{const{value:n,onValueChange:s,...a}=e,o=es(s);return t.jsx(dh,{scope:e.__scopeMenu,value:n,onValueChange:o,children:t.jsx(Ms,{...a,ref:r})})});Wl.displayName=ql;var Zl="MenuRadioItem",Xl=l.forwardRef((e,r)=>{const{value:n,...s}=e,a=uh(Zl,e.__scopeMenu),o=n===a.value;return t.jsx(Yl,{scope:e.__scopeMenu,checked:o,children:t.jsx(on,{role:"menuitemradio","aria-checked":o,...s,ref:r,"data-state":Ps(o),onSelect:K(s.onSelect,()=>{var i;return(i=a.onValueChange)==null?void 0:i.call(a,n)},{checkForDefaultPrevented:!1})})})});Xl.displayName=Zl;var Ts="MenuItemIndicator",[Yl,fh]=xt(Ts,{checked:!1}),Jl=l.forwardRef((e,r)=>{const{__scopeMenu:n,forceMount:s,...a}=e,o=fh(Ts,n);return t.jsx(tt,{present:s||wr(o.checked)||o.checked===!0,children:t.jsx(ue.span,{...a,ref:r,"data-state":Ps(o.checked)})})});Jl.displayName=Ts;var ph="MenuSeparator",Ql=l.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return t.jsx(ue.div,{role:"separator","aria-orientation":"horizontal",...s,ref:r})});Ql.displayName=ph;var mh="MenuArrow",ec=l.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e,a=an(n);return t.jsx(Yn,{...a,...s,ref:r})});ec.displayName=mh;var hh="MenuSub",[qx,tc]=xt(hh),Ut="MenuSubTrigger",rc=l.forwardRef((e,r)=>{const n=Ot(Ut,e.__scopeMenu),s=er(Ut,e.__scopeMenu),a=tc(Ut,e.__scopeMenu),o=Es(Ut,e.__scopeMenu),i=l.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:u}=o,f={__scopeMenu:e.__scopeMenu},m=l.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return l.useEffect(()=>m,[m]),l.useEffect(()=>{const x=d.current;return()=>{window.clearTimeout(x),u(null)}},[d,u]),t.jsx(ks,{asChild:!0,...f,children:t.jsx(Gl,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":ac(n.open),...e,ref:mo(r,a.onTriggerChange),onClick:x=>{var v;(v=e.onClick)==null||v.call(e,x),!(e.disabled||x.defaultPrevented)&&(x.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:K(e.onPointerMove,Yt(x=>{o.onItemEnter(x),!x.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:K(e.onPointerLeave,Yt(x=>{var j,y;m();const v=(j=n.content)==null?void 0:j.getBoundingClientRect();if(v){const w=(y=n.content)==null?void 0:y.dataset.side,_=w==="right",M=_?-5:5,T=v[_?"left":"right"],L=v[_?"right":"left"];o.onPointerGraceIntentChange({area:[{x:x.clientX+M,y:x.clientY},{x:T,y:v.top},{x:L,y:v.top},{x:L,y:v.bottom},{x:T,y:v.bottom}],side:w}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(x),x.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:K(e.onKeyDown,x=>{var j;const v=o.searchRef.current!=="";e.disabled||v&&x.key===" "||X0[s.dir].includes(x.key)&&(n.onOpenChange(!0),(j=n.content)==null||j.focus(),x.preventDefault())})})})});rc.displayName=Ut;var nc="MenuSubContent",sc=l.forwardRef((e,r)=>{const n=Vl(ze,e.__scopeMenu),{forceMount:s=n.forceMount,...a}=e,o=Ot(ze,e.__scopeMenu),i=er(ze,e.__scopeMenu),d=tc(nc,e.__scopeMenu),u=l.useRef(null),f=Re(r,u);return t.jsx(Xt.Provider,{scope:e.__scopeMenu,children:t.jsx(tt,{present:s||o.open,children:t.jsx(Xt.Slot,{scope:e.__scopeMenu,children:t.jsx(Rs,{id:d.contentId,"aria-labelledby":d.triggerId,...a,ref:f,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var x;i.isUsingKeyboardRef.current&&((x=u.current)==null||x.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:K(e.onFocusOutside,m=>{m.target!==d.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:K(e.onEscapeKeyDown,m=>{i.onClose(),m.preventDefault()}),onKeyDown:K(e.onKeyDown,m=>{var j;const x=m.currentTarget.contains(m.target),v=Y0[i.dir].includes(m.key);x&&v&&(o.onOpenChange(!1),(j=d.trigger)==null||j.focus(),m.preventDefault())})})})})})});sc.displayName=nc;function ac(e){return e?"open":"closed"}function wr(e){return e==="indeterminate"}function Ps(e){return wr(e)?"indeterminate":e?"checked":"unchecked"}function gh(e){const r=document.activeElement;for(const n of e)if(n===r||(n.focus(),document.activeElement!==r))return}function xh(e,r){return e.map((n,s)=>e[(r+s)%e.length])}function vh(e,r,n){const a=r.length>1&&Array.from(r).every(f=>f===r[0])?r[0]:r,o=n?e.indexOf(n):-1;let i=xh(e,Math.max(o,0));a.length===1&&(i=i.filter(f=>f!==n));const u=i.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return u!==n?u:void 0}function bh(e,r){const{x:n,y:s}=e;let a=!1;for(let o=0,i=r.length-1;os!=m>s&&n<(f-d)*(s-u)/(m-u)+d&&(a=!a)}return a}function yh(e,r){if(!r)return!1;const n={x:e.clientX,y:e.clientY};return bh(n,r)}function Yt(e){return r=>r.pointerType==="mouse"?e(r):void 0}var wh=zl,jh=ks,_h=Hl,Ch=Ms,Nh=Ul,Sh=on,kh=Kl,Eh=Wl,Rh=Xl,Mh=Jl,Th=Ql,Ph=ec,Ah=rc,Oh=sc,As="DropdownMenu",[Lh,Wx]=Ze(As,[Fl]),De=Fl(),[Dh,oc]=Lh(As),ic=e=>{const{__scopeDropdownMenu:r,children:n,dir:s,open:a,defaultOpen:o,onOpenChange:i,modal:d=!0}=e,u=De(r),f=l.useRef(null),[m=!1,x]=Xe({prop:a,defaultProp:o,onChange:i});return t.jsx(Dh,{scope:r,triggerId:ut(),triggerRef:f,contentId:ut(),open:m,onOpenChange:x,onOpenToggle:l.useCallback(()=>x(v=>!v),[x]),modal:d,children:t.jsx(wh,{...u,open:m,onOpenChange:x,dir:s,modal:d,children:n})})};ic.displayName=As;var lc="DropdownMenuTrigger",cc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,disabled:s=!1,...a}=e,o=oc(lc,n),i=De(n);return t.jsx(jh,{asChild:!0,...i,children:t.jsx(ue.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...a,ref:mo(r,o.triggerRef),onPointerDown:K(e.onPointerDown,d=>{!s&&d.button===0&&d.ctrlKey===!1&&(o.onOpenToggle(),o.open||d.preventDefault())}),onKeyDown:K(e.onKeyDown,d=>{s||(["Enter"," "].includes(d.key)&&o.onOpenToggle(),d.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});cc.displayName=lc;var dc="DropdownMenuContent",uc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=oc(dc,n),o=De(n),i=l.useRef(!1);return t.jsx(_h,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...s,ref:r,onCloseAutoFocus:K(e.onCloseAutoFocus,d=>{var u;i.current||(u=a.triggerRef.current)==null||u.focus(),i.current=!1,d.preventDefault()}),onInteractOutside:K(e.onInteractOutside,d=>{const u=d.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,m=u.button===2||f;(!a.modal||m)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uc.displayName=dc;var Ih="DropdownMenuGroup",$h=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Ch,{...a,...s,ref:r})});$h.displayName=Ih;var Fh="DropdownMenuLabel",fc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Nh,{...a,...s,ref:r})});fc.displayName=Fh;var Bh="DropdownMenuItem",pc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Sh,{...a,...s,ref:r})});pc.displayName=Bh;var zh="DropdownMenuCheckboxItem",mc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(kh,{...a,...s,ref:r})});mc.displayName=zh;var Vh="DropdownMenuRadioGroup",Hh=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Eh,{...a,...s,ref:r})});Hh.displayName=Vh;var Uh="DropdownMenuRadioItem",hc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Rh,{...a,...s,ref:r})});hc.displayName=Uh;var Gh="DropdownMenuItemIndicator",gc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Mh,{...a,...s,ref:r})});gc.displayName=Gh;var Kh="DropdownMenuSeparator",xc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Th,{...a,...s,ref:r})});xc.displayName=Kh;var qh="DropdownMenuArrow",Wh=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Ph,{...a,...s,ref:r})});Wh.displayName=qh;var Zh="DropdownMenuSubTrigger",vc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Ah,{...a,...s,ref:r})});vc.displayName=Zh;var Xh="DropdownMenuSubContent",bc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Oh,{...a,...s,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bc.displayName=Xh;var Yh=ic,Jh=cc,yc=uc,wc=fc,jc=pc,_c=mc,Cc=hc,Nc=gc,Sc=xc,kc=vc,Ec=bc;const Qh=Yh,e1=Jh,t1=l.forwardRef(({className:e,inset:r,children:n,...s},a)=>t.jsxs(kc,{ref:a,className:S("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",r&&"pl-8",e),...s,children:[n,t.jsx(Mi,{className:"ml-auto h-4 w-4"})]}));t1.displayName=kc.displayName;const r1=l.forwardRef(({className:e,...r},n)=>t.jsx(Ec,{ref:n,className:S("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));r1.displayName=Ec.displayName;const Rc=l.forwardRef(({className:e,sideOffset:r=4,...n},s)=>t.jsx(yc,{ref:s,sideOffset:r,className:S("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Rc.displayName=yc.displayName;const Mc=l.forwardRef(({className:e,inset:r,...n},s)=>t.jsx(jc,{ref:s,className:S("relative cursor-pointer flex select-none items-center rounded-sm px-3 py-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r&&"pl-8",e),...n}));Mc.displayName=jc.displayName;const n1=l.forwardRef(({className:e,children:r,checked:n,...s},a)=>t.jsxs(_c,{ref:a,className:S("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...s,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Nc,{children:t.jsx(Ei,{className:"h-4 w-4"})})}),r]}));n1.displayName=_c.displayName;const s1=l.forwardRef(({className:e,children:r,...n},s)=>t.jsxs(Cc,{ref:s,className:S("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Nc,{children:t.jsx(Ee,{className:"h-2 w-2 fill-current"})})}),r]}));s1.displayName=Cc.displayName;const Tc=l.forwardRef(({className:e,inset:r,...n},s)=>t.jsx(wc,{ref:s,className:S("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",e),...n}));Tc.displayName=wc.displayName;const Pc=l.forwardRef(({className:e,...r},n)=>t.jsx(Sc,{ref:n,className:S("-mx-1 my-1 h-px bg-muted",e),...r}));Pc.displayName=Sc.displayName;const Ac=Qi,Oc=el,Lc=ms;Lc.displayName=ms.displayName;const Dc=l.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:S("fixed inset-0 z-[120000] bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));Dc.displayName=tl.displayName;const Os=l.forwardRef(({className:e,children:r,...n},s)=>{var a,o;return t.jsx(Lc,{container:((o=(a=document.getElementById("rapidload-optimizer-shadow-dom"))==null?void 0:a.shadowRoot)==null?void 0:o.getElementById("rapidload-page-optimizer-wrapper"))||document.body,children:t.jsx(Dc,{className:"cursor-auto",children:t.jsx(hs,{asChild:!0,ref:s,...n,children:t.jsxs("div",{className:S("overflow-y-auto max-h-screen outline-0 fixed left-[50%] top-[50%] z-[120000] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),children:[r,t.jsxs(vs,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(rn,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})})})})});Os.displayName=hs.displayName;const Ls=({className:e,...r})=>t.jsx("div",{className:S("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});Ls.displayName="DialogHeader";const Ic=({className:e,...r})=>t.jsx("div",{className:S("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});Ic.displayName="DialogFooter";const Ds=l.forwardRef(({className:e,...r},n)=>t.jsx(gs,{ref:n,className:S("text-lg font-semibold leading-none tracking-tight dark:text-brand-300",e),...r}));Ds.displayName=gs.displayName;const $c=l.forwardRef(({className:e,...r},n)=>t.jsx(xs,{ref:n,className:S("text-sm text-muted-foreground",e),...r}));$c.displayName=xs.displayName;const it=l.forwardRef(({children:e,className:r,spreader:n=!1,...s},a)=>t.jsxs("div",{...s,ref:a,className:"w-full",children:[t.jsx("div",{className:S("w-full dark:bg-brand-950 bg-brand-0 rounded-3xl",n?"relative mb-0 z-10":"",r),children:e}),n&&t.jsxs("div",{className:S("absolute w-full -bottom-1 z-[1] transition-opacity duration-500 delay-500"),children:[t.jsx("div",{className:"rounded-3xl h-10 dark:border-brand-700 mx-1.5 bg-brand-300 dark:bg-brand-900 opacity-50"}),t.jsx("div",{className:"absolute w-full -bottom-1 z-[-1]",children:t.jsx("div",{className:"rounded-3xl h-5 dark:border-brand-700 mx-5 bg-brand-300 dark:bg-brand-900 opacity-20"})})]})]})),a1=({cls:e})=>t.jsx("svg",{className:`${e}`,width:"9",height:"9",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("circle",{cx:"4.5",cy:"4.5",r:"4.5",fill:"#0c6"})}),o1=({cls:e})=>t.jsx("svg",{className:`${e}`,width:"9",height:"9",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M9 9H0L4.5 0L9 9Z",fill:"#FF3333"})}),i1=({cls:e})=>t.jsx("svg",{className:`${e}`,width:"9",height:"9",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("rect",{width:"9",height:"9",fill:"#FFAA33"})}),Wt=({icon:e,className:r})=>{let[n,s]=l.useState(t.jsx(t.Fragment,{}));return l.useEffect(()=>{e==="pass"||e==="FAST"||e==="passed_audit"?s(t.jsx(a1,{})):e==="average"||e==="AVERAGE"?s(t.jsx(i1,{})):(e==="fail"||e==="SLOW")&&s(t.jsx(o1,{}))},[]),t.jsx("span",{className:S(r),children:n})},l1=()=>{var Y,Z;const{setShowOptimizer:e,options:r,modeData:n,savingData:s,setSavingData:a,invalidatingCache:o,setInvalidatingCache:i,global:d}=he();r==null||r.optimizer_url,gt();const{submitSettings:u}=Ml(),f=d?2:0,[m,x]=l.useState(!1);l.useState(!1);const v=l.useRef(null),[j,y]=l.useState(f),[w,_]=l.useState(f);ot();const{fresh:M,touched:T,activeReport:L,data:$,settings:X}=ce(ve);l.useEffect(()=>{y(T&&!d?1:d?2:0)},[T]);const z=l.useMemo(()=>(X==null?void 0:X.filter(G=>{var te;return["Critical CSS","Remove Unused CSS"].includes(G.name)&&((te=G.status)==null?void 0:te.status)!=="success"}))||[],[X]),A=[{text:"Apply Optimization",title:"Save Changes?",description:"You have made changes to your settings. Click 'Save Changes' to apply your modifications or 'Discard' to revert to the previous state.",onClick:()=>u(!0)},{text:t.jsx("div",{className:"flex w-full items-center justify-between",children:" Apply Optimization"}),title:"Do you want to Apply Optimization?",description:t.jsx("div",{className:"",children:z.length>0?t.jsx("div",{className:"flex flex-col gap-6",children:t.jsx("div",{children:"You've made changes to your settings. For accurate results, wait for all tasks to complete before saving and re-analyzing."})}):t.jsx("div",{children:"You have made changes to your settings. Click 'Apply Optimization' to apply your modifications and re-analyze the page or 'Discard' to revert to the previous state."})}),onClick:()=>{u(!0)},action_text:"Apply Optimization"},{text:"Apply for Entire Site",title:"Apply these settings as entire site?",description:"You have made changes to your settings. Click 'Save Changes' to override entire site settings or 'Discard' to revert to the previous state.",onClick:()=>{u(!1,!0)}}],D=l.useCallback(G=>{if(!G)return null;const te=5,k=[...G.grouped.opportunities,...G.grouped.diagnostics].filter(oe=>{var q,be;return((be=(q=oe.files)==null?void 0:q.items)==null?void 0:be.length)>0||oe.settings.length>0}),O=k.length,V=O-te;return{show:te,balance:V,count:O,audits:k}},[$==null?void 0:$.audits]),U=l.useMemo(()=>D($),[$]),Q=l.useMemo(()=>M?!0:T,[M,T]);return t.jsxs(t.Fragment,{children:[t.jsx(br,{children:t.jsx("div",{className:"flex gap-2 items-center flex-none",children:t.jsxs(wl,{open:m,onOpenChange:x,children:[t.jsxs(Qh,{children:[t.jsx(pt,{"data-tour":"save-changes",ref:v,asChild:!0,className:S("flex overflow-hidden justify-between select-none relative text-sm gap-2 pl-1 pr-2 h-12 rounded-[14px]",!Q&&"bg-brand-700 dark:bg-primary dark:hover:bg-primary/90"),children:t.jsxs(jl,{onClick:G=>_(j),className:S("flex gap-2 items-center pl-3 pr-2 h-full"),children:[s||o?t.jsx(Ge,{className:"w-5 mr-0.5 animate-spin"}):t.jsx(Km,{className:"w-5 mr-0.5"}),A[j].text]})}),t.jsx(vr,{onCancel:()=>{e(!1)},cancel:"Discard & Leave",onClick:()=>{e(!1)},children:t.jsx(e1,{className:"w-8 h-12 flex items-center justify-center",children:t.jsx(me,{className:"flex items-center justify-center",asChild:!0,text:"Additional Settings",children:t.jsx(Am,{className:S("h-5 w-5 dark:text-brand-300 text-brand-600 transition-opacity")})})})}),t.jsxs(Rc,{style:{width:((Y=v.current)==null?void 0:Y.clientWidth)||200},align:"end",sideOffset:6,className:"z-[110000] relative min-w-[200px]",children:[t.jsx(Tc,{children:"Additional Options"}),A.filter((G,te)=>j!==te).map((G,te)=>t.jsxs("span",{children:[t.jsx(Pc,{}),t.jsx(Mc,{onClick:k=>{setTimeout(()=>{x(!0),_(A.indexOf(G))},100)},children:G.text})]},te))]})]}),t.jsx(ys,{asChild:!0,className:"w-full max-w-[520px]",children:t.jsxs("div",{children:[t.jsxs(ws,{children:[t.jsx(_s,{children:A[w].title}),t.jsx(Cs,{children:t.jsx("div",{children:A[w].description})})]}),t.jsxs(js,{children:[t.jsx(Ns,{onClick:G=>A[w].onClick(),children:(Z=A[w])!=null&&Z.action_text?A[w].action_text:"Save Changes"}),t.jsx(Ss,{onClick:G=>x(!1),children:"Discard"})]})]})})]})})}),t.jsx(br,{mode:"onboard",children:t.jsx(Ac,{children:t.jsxs("div",{children:[t.jsx(Oc,{children:t.jsxs(Le,{className:"text-sm",children:[s?t.jsx(w0,{className:"w-5 mr-0.5 animate-spin"}):t.jsx($a,{className:"w-5 mr-0.5"}),"Connect your Account"]})}),t.jsx(Os,{className:"px-6 py-6",children:t.jsx(Ls,{children:U&&t.jsxs(t.Fragment,{children:[t.jsxs(Ds,{children:["RapidLoad can improve ",U.count," Audits"]}),t.jsx("div",{className:"py-4 text-sm",children:t.jsxs("ul",{children:[$&&U.audits.slice(0,U.show).map(G=>t.jsx("li",{children:t.jsx(it,{className:"px-3 py-2 mb-1.5",children:t.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-7 h-7 rounded-full dark:bg-brand-700 bg-brand-100",children:G.scoreDisplayMode==="informative"?t.jsx("span",{className:"w-3 h-3 border-2 rounded-full"}):t.jsx(Wt,{icon:G.icon})}),t.jsxs("div",{className:"flex flex-col",children:[G.name,G.displayValue&&t.jsx("span",{className:"text-xxs leading-tight text-muted-foreground",children:G.displayValue})]})]})})},G.id)),$&&!!U.balance&&t.jsxs("li",{className:"text-center text-muted-foreground mt-3",children:["and ",U.balance," more audit",U.balance>1&&"s","..."]})]})}),t.jsx("div",{className:"flex justify-center",children:(n==null?void 0:n.connect_url)&&t.jsx("a",{href:n==null?void 0:n.connect_url,target:n==null?void 0:n.target,children:t.jsx(pt,{className:"gap-2",children:t.jsxs(t.Fragment,{children:[t.jsx($a,{className:"w-5 mr-0.5"}),"Connect RapidLoad Account"]})})})})]})})})]})})})]})},c1=({url:e})=>{const{setShowOptimizer:r,options:n,version:s}=he(),{activeReport:a,loading:o,testMode:i,reanalyze:d}=ce(ve),{inProgress:u}=xe(),{dispatch:f}=xe(),m=ot(),{isDark:x}=At();return t.jsxs(t.Fragment,{children:[t.jsxs("header",{className:"z-[110000] w-full px-6 py-3 flex gap-3 justify-between border-b backdrop-blur-sm dark:bg-brand-930/80 bg-brand-50/75 ",children:[t.jsxs("div",{className:"flex gap-12 items-center",children:[t.jsxs("div",{className:"relative",children:[t.jsx("img",{className:"w-36",src:x?n!=null&&n.page_optimizer_base?`${n==null?void 0:n.page_optimizer_base}/dark-logo.svg`:"/dark-logo.svg":n!=null&&n.page_optimizer_base?`${n==null?void 0:n.page_optimizer_base}/logo.svg`:"/logo.svg",alt:"RapidLoad - #1 to unlock breakneck page speed"}),s&&t.jsxs("span",{className:"absolute text-xxs w-[200px] left-[72px] top-[1px] dark:text-brand-500 text-brand-400",children:["TITAN v",s]})]}),t.jsxs("div",{className:"flex flex-column items-center gap-3",children:[t.jsxs("div",{"data-tour":"switch-report-strategy",className:"select-none relative flex dark:bg-brand-800 py-0.5 bg-brand-200/80 rounded-2xl cursor-pointer",children:[t.jsx("div",{className:S("absolute shadow-md translate-x-0 left-0.5 w-[55px] rounded-[14px] -z-1 duration-300 h-11 text-sm flex flex-column gap-2 px-4 py-3 font-medium dark:bg-brand-950 bg-brand-0",a==="desktop"&&"w-[55px] -translate-x-1 left-1/2")}),t.jsx(me,{text:"Mobile",children:t.jsx("div",{onClick:()=>m(Bn("mobile")),className:"relative z-1 text-sm flex flex-column gap-2 px-5 py-3 font-medium rounded-2xl",children:t.jsx(Mo,{className:"h-5 w-5 font-medium dark:text-brand-500"})})}),t.jsx(me,{text:"Desktop",children:t.jsx("div",{onClick:()=>m(Bn("desktop")),className:"relative z-1 text-sm flex flex-column gap-2 pl-2 px-5 py-3 font-medium rounded-2xl",children:t.jsx(Oi,{className:"h-5 w-5 font-medium dark:text-brand-500 "})})})]}),t.jsxs("div",{className:"flex overflow-hidden border rounded-2xl shadow","data-tour":"current-url",children:[t.jsx(I0,{}),t.jsx(vr,{title:"Analyze without applying optimization?",description:"Your changes are not saved yet. If you analyze now, your recent edits won't be included.",action:"Apply Optimization",cancel:"Discard & Analyze",onCancel:()=>{m(hr(n,e,!0)),f(ae("openAudits",[]))},onClick:()=>{(!u||!o)&&m(hr(n,e,!0)),f(ae("openAudits",[]))},children:t.jsx(me,{text:"Analyze the page",children:t.jsx(Le,{asChild:!0,"data-tour":"analyze",className:S("transition-none rounded-none h-12 px-3 pr-3.5 border-r-0 border-l border-t-0 border-b-0 bg-transparent "),variant:"outline",children:t.jsxs("div",{className:"flex flex-col gap-[1px] items-center",children:[t.jsx(Li,{className:S("w-4 -mt-0.5",o&&"animate-spin")}),t.jsx("span",{className:"text-xxs font-normal text-brand-500",children:"Analyze "})]})})})})]})]})]}),t.jsx("div",{className:"flex relative gap-4 items-center",children:t.jsxs(t.Fragment,{children:[t.jsx(l1,{}),t.jsx(vr,{onCancel:()=>{r(!1)},cancel:"Discard & Leave",onClick:()=>{r(!1)},children:t.jsx(me,{text:"Close Optimizer",children:t.jsx(zm,{className:S("h-5 w-5 dark:text-brand-300 text-brand-600 transition-opacity")})})})]})})]}),t.jsx(Ve,{children:i&&t.jsxs(rf.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{ease:"easeInOut",duration:.5},className:"z-[110000] w-full text-[13px] bg-[#f7b250] items-center text-center py-0.5 top-[69px] absolute dark:bg-brand-950",children:[t.jsx("span",{className:"font-semibold text-black dark:text-brand-300",children:"Test Mode turned on,"}),"optimizations are safely previewed without affecting your live website. Perfect for experimentation and fine-tuning."]})})]})};function Gt({className:e,...r}){return t.jsx("div",{className:S("animate-pulse rounded-md bg-primary/10",e),...r})}/*! *****************************************************************************
+For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return l.useEffect(()=>{var s;document.getElementById((s=e.current)==null?void 0:s.getAttribute("aria-describedby"))||console.warn(r)},[r,e]),null},g0=sl,x0=al,gl=ol,xl=il,vl=ll,bl=pl,ys=hl,yl=dl,wl=fl;const jl=g0,_l=x0,Cl=({className:e,...r})=>t.jsx(gl,{...r});Cl.displayName=gl.displayName;const Nl=l.forwardRef(({className:e,children:r,...n},s)=>t.jsx(xl,{className:S("fixed inset-0 z-[120000] bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n,ref:s}));Nl.displayName=xl.displayName;const ws=l.forwardRef(({className:e,...r},n)=>{var s,a;return t.jsxs(Cl,{container:((a=(s=document.getElementById("rapidload-optimizer-shadow-dom"))==null?void 0:s.shadowRoot)==null?void 0:a.getElementById("rapidload-page-optimizer-wrapper"))||document.body,children:[t.jsx(Nl,{}),t.jsx(vl,{asChild:!0,ref:n,className:S("fixed left-[50%] top-[50%] z-[120000] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...r})]})});ws.displayName=vl.displayName;const js=({className:e,...r})=>t.jsx("div",{className:S("flex flex-col space-y-2 text-center sm:text-left",e),...r});js.displayName="AlertDialogHeader";const _s=({className:e,...r})=>t.jsx("div",{className:S("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});_s.displayName="AlertDialogFooter";const Cs=l.forwardRef(({className:e,...r},n)=>t.jsx(yl,{ref:n,className:S("text-lg font-semibold",e),...r}));Cs.displayName=yl.displayName;const Ns=l.forwardRef(({className:e,...r},n)=>t.jsx(wl,{asChild:!0,ref:n,className:S("text-sm text-muted-foreground",e),...r}));Ns.displayName=wl.displayName;const Ss=l.forwardRef(({className:e,...r},n)=>t.jsx(bl,{ref:n,className:S(ds(),e),...r}));Ss.displayName=bl.displayName;const ks=l.forwardRef(({className:e,...r},n)=>t.jsx(ys,{ref:n,className:S(ds({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));ks.displayName=ys.displayName;function v0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-4.28 9.22a.75.75 0 0 0 0 1.06l3 3a.75.75 0 1 0 1.06-1.06l-1.72-1.72h5.69a.75.75 0 0 0 0-1.5h-5.69l1.72-1.72a.75.75 0 0 0-1.06-1.06l-3 3Z",clipRule:"evenodd"}))}const b0=l.forwardRef(v0);function y0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",clipRule:"evenodd"}))}const w0=l.forwardRef(y0);function j0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M14.615 1.595a.75.75 0 0 1 .359.852L12.982 9.75h7.268a.75.75 0 0 1 .548 1.262l-10.5 11.25a.75.75 0 0 1-1.272-.71l1.992-7.302H3.75a.75.75 0 0 1-.548-1.262l10.5-11.25a.75.75 0 0 1 .913-.143Z",clipRule:"evenodd"}))}const Sl=l.forwardRef(j0);function _0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const Be=l.forwardRef(_0);function C0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",clipRule:"evenodd"}))}const kl=l.forwardRef(C0);function N0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",clipRule:"evenodd"}))}const S0=l.forwardRef(N0);function k0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))}const El=l.forwardRef(k0);function E0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z",clipRule:"evenodd"}))}const Vn=l.forwardRef(E0);function R0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 9a.75.75 0 0 0-1.5 0v2.25H9a.75.75 0 0 0 0 1.5h2.25V15a.75.75 0 0 0 1.5 0v-2.25H15a.75.75 0 0 0 0-1.5h-2.25V9Z",clipRule:"evenodd"}))}const Rl=l.forwardRef(R0);function M0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))}const ht=l.forwardRef(M0);function T0({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Ml=l.forwardRef(T0),P0=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Va=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const r=e.match(P0);if(!r)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return r.shift(),r},Ha=e=>e==="*"||e==="x"||e==="X",Ua=e=>{const r=parseInt(e,10);return isNaN(r)?e:r},A0=(e,r)=>typeof e!=typeof r?[String(e),String(r)]:[e,r],O0=(e,r)=>{if(Ha(e)||Ha(r))return 0;const[n,s]=A0(Ua(e),Ua(r));return n>s?1:n{for(let n=0;n{const n=Va(e),s=Va(r),a=n.pop(),o=s.pop(),i=Ga(n,s);return i!==0?i:a&&o?Ga(a.split("."),o.split(".")):a||o?a?-1:1:0},Tl=()=>{const{setShowOptimizer:e,options:r,modeData:n,savingData:s,setSavingData:a,invalidatingCache:o,setInvalidatingCache:i,global:d}=ve(),u=ot(),{settingsMode:f}=ge(),{fresh:m,touched:x,activeReport:v,data:j,settings:b,activeGear:w}=ce(xe),{grouped:_,...R}=j||{};({...R});const T=r==null?void 0:r.optimizer_url,{toast:L}=gt();return{submitSettings:l.useCallback(async(X=!1,V=!1)=>{if(s)return;const A=new et(r);try{a(!0);const D=await A.updateSettings(T,v,{settings:b,activeGear:w},V,X);if(L({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["Your settings have been saved successfully ",t.jsx(Be,{className:"w-5 text-green-600"})]})}),X){a(!1);const z={mobile:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.133 Mobile Safari/537.36",desktop:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"};try{i(!0),await A.post("clear_page_cache",{url:T});const Q=A.rest();L0(r==null?void 0:r.rapidload_version,"2.2.11")>0?await A.post("preload_page",{url:r.optimizer_url,user_agent:v==="mobile"?z.mobile:z.desktop,nonce:r.nonce,job_id:j==null?void 0:j.job_id}):await Q.request("/ping",{url:r.optimizer_url,user_agent:v==="mobile"?z.mobile:z.desktop,nonce:r==null?void 0:r.nonce,job_id:j==null?void 0:j.job_id}),i(!1)}catch(Q){i(!1),L({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[Q.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]})})}u(Wt(r,T,!0))}}catch(D){L({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[D.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]})})}a(!1),i(!1)},[j,v,s,o,b,w])}},vr=({children:e,onClick:r,title:n,description:s,action:a="Save & Exit",onCancel:o,cancel:i,performanceGear:d})=>{const{touched:u,fresh:f,settings:m,settingsOriginal:x}=ce(xe),{submitSettings:v}=Tl();if(!d&&!(f||u))return t.jsx("div",{onClick:b=>r(),children:e});const j=async()=>{d||await v(!1),r()};return t.jsxs(jl,{children:[t.jsx(_l,{asChild:!0,children:t.jsx("div",{children:e})}),t.jsx(ws,{children:t.jsxs("div",{children:[t.jsxs(js,{children:[t.jsxs(Cs,{className:"flex justify-between items-center",children:[n||"Continue without Saving?",t.jsx(ue,{text:"Close the Alert",children:t.jsx(ys,{asChild:!0,children:t.jsx(rn,{className:"stroke-1"})})})]}),t.jsx(Ns,{children:t.jsx("div",{children:s||"You have changes that haven't been saved. If you are leave now, your edits will be lost."})})]}),t.jsxs(_s,{children:[t.jsx(Ss,{onClick:async b=>j(),children:a}),t.jsx(ks,{onClick:b=>o&&o(),children:i||"Discard"})]})]})})]})},D0=({timestamp:e})=>{const r=Nn(e),[n,s]=l.useState(r);return l.useEffect(()=>{const a=setInterval(()=>{s(Nn(e))},6e4);return()=>clearInterval(a)},[]),t.jsx(t.Fragment,{children:Nn(e)})},I0=()=>{var m,x,v,j,b,w;l.useState(!1);const{data:e,loading:r,error:n,activeReport:s}=ce(xe),{report:a}=ce(_=>_.app),{mobile:o,desktop:i}=a,{togglePerformance:d,options:u}=ve(),f=u.optimizer_url;return t.jsx("div",{className:"flex flex-row flex-1 gap-3 px-5 min-w-[350px] items-center bg-white dark:bg-brand-800",children:t.jsxs("div",{children:[t.jsx("div",{className:"text-sm items-center cursor-default text-ellipsis truncate md:max-w-sm lg:max-w-xl",children:(m=e==null?void 0:e.loadingExperience)!=null&&m.initial_url?decodeURIComponent(e.loadingExperience.initial_url.replace("?rapidload_preview","")):f}),!n&&t.jsx("div",{className:"flex h-4 items-center text-xxs leading-relaxed text-brand-500 cursor-default",children:e?t.jsxs(t.Fragment,{children:[((x=e==null?void 0:e.loadingExperience)==null?void 0:x.timestamp)&&t.jsxs(t.Fragment,{children:["Last analyzed ",t.jsx(D0,{timestamp:e.loadingExperience.timestamp})]}),s==="mobile"&&((v=i==null?void 0:i.data)==null?void 0:v.performance)&&t.jsxs(t.Fragment,{children:[t.jsx(Ba,{className:"w-6 text-brand-400"}),t.jsxs("div",{className:"flex gap-1 items-center",children:[Number((j=i==null?void 0:i.data)==null?void 0:j.performance).toFixed(0)," Desktop"]})]}),s==="desktop"&&((b=o==null?void 0:o.data)==null?void 0:b.performance)&&t.jsxs(t.Fragment,{children:[t.jsx(Ba,{className:"w-6 text-brand-400"}),t.jsxs("div",{className:"flex gap-1 items-center",children:[Number((w=o==null?void 0:o.data)==null?void 0:w.performance).toFixed(0)," Mobile"]})]})]}):t.jsx("div",{className:"w-64 bg-brand-300 dark:bg-brand-600 animate-pulse h-2.5 rounded-sm mt-1"})})]})})},br=({children:e,mode:r="normal"})=>{const{mode:n}=ge();return r===n?t.jsx(t.Fragment,{children:e}):t.jsx(t.Fragment,{})};var Mn="rovingFocusGroup.onEntryFocus",$0={bubbles:!1,cancelable:!0},nn="RovingFocusGroup",[Hn,Pl,F0]=mo(nn),[B0,sn]=Ze(nn,[F0]),[z0,V0]=B0(nn),Al=l.forwardRef((e,r)=>t.jsx(Hn.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Hn.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(H0,{...e,ref:r})})}));Al.displayName=nn;var H0=l.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:a=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...x}=e,v=l.useRef(null),j=Re(r,v),b=es(o),[w=null,_]=Xe({prop:i,defaultProp:d,onChange:u}),[R,T]=l.useState(!1),L=ts(f),$=Pl(n),X=l.useRef(!1),[V,A]=l.useState(0);return l.useEffect(()=>{const D=v.current;if(D)return D.addEventListener(Mn,L),()=>D.removeEventListener(Mn,L)},[L]),t.jsx(z0,{scope:n,orientation:s,dir:b,loop:a,currentTabStopId:w,onItemFocus:l.useCallback(D=>_(D),[_]),onItemShiftTab:l.useCallback(()=>T(!0),[]),onFocusableItemAdd:l.useCallback(()=>A(D=>D+1),[]),onFocusableItemRemove:l.useCallback(()=>A(D=>D-1),[]),children:t.jsx(fe.div,{tabIndex:R||V===0?-1:0,"data-orientation":s,...x,ref:j,style:{outline:"none",...e.style},onMouseDown:K(e.onMouseDown,()=>{X.current=!0}),onFocus:K(e.onFocus,D=>{const z=!X.current;if(D.target===D.currentTarget&&z&&!R){const Q=new CustomEvent(Mn,$0);if(D.currentTarget.dispatchEvent(Q),!Q.defaultPrevented){const Y=$().filter(O=>O.focusable),Z=Y.find(O=>O.active),G=Y.find(O=>O.id===w),k=[Z,G,...Y].filter(Boolean).map(O=>O.ref.current);Dl(k,m)}}X.current=!1}),onBlur:K(e.onBlur,()=>T(!1))})})}),Ol="RovingFocusGroupItem",Ll=l.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:a=!1,tabStopId:o,...i}=e,d=ut(),u=o||d,f=V0(Ol,n),m=f.currentTabStopId===u,x=Pl(n),{onFocusableItemAdd:v,onFocusableItemRemove:j}=f;return l.useEffect(()=>{if(s)return v(),()=>j()},[s,v,j]),t.jsx(Hn.ItemSlot,{scope:n,id:u,focusable:s,active:a,children:t.jsx(fe.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...i,ref:r,onMouseDown:K(e.onMouseDown,b=>{s?f.onItemFocus(u):b.preventDefault()}),onFocus:K(e.onFocus,()=>f.onItemFocus(u)),onKeyDown:K(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){f.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const w=K0(b,f.orientation,f.dir);if(w!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let R=x().filter(T=>T.focusable).map(T=>T.ref.current);if(w==="last")R.reverse();else if(w==="prev"||w==="next"){w==="prev"&&R.reverse();const T=R.indexOf(b.currentTarget);R=f.loop?q0(R,T+1):R.slice(T+1)}setTimeout(()=>Dl(R))}})})})});Ll.displayName=Ol;var U0={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function G0(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function K0(e,r,n){const s=G0(e.key,n);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return U0[s]}function Dl(e,r=!1){const n=document.activeElement;for(const s of e)if(s===n||(s.focus({preventScroll:r}),document.activeElement!==n))return}function q0(e,r){return e.map((n,s)=>e[(r+s)%e.length])}var Il=Al,$l=Ll,Un=["Enter"," "],W0=["ArrowDown","PageUp","Home"],Fl=["ArrowUp","PageDown","End"],Z0=[...W0,...Fl],X0={ltr:[...Un,"ArrowRight"],rtl:[...Un,"ArrowLeft"]},Y0={ltr:["ArrowLeft"],rtl:["ArrowRight"]},er="Menu",[Yt,J0,Q0]=mo(er),[xt,Bl]=Ze(er,[Q0,Pt,sn]),an=Pt(),zl=sn(),[eh,Ot]=xt(er),[th,tr]=xt(er),Vl=e=>{const{__scopeMenu:r,open:n=!1,children:s,dir:a,onOpenChange:o,modal:i=!0}=e,d=an(r),[u,f]=l.useState(null),m=l.useRef(!1),x=ts(o),v=es(a);return l.useEffect(()=>{const j=()=>{m.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>m.current=!1;return document.addEventListener("keydown",j,{capture:!0}),()=>{document.removeEventListener("keydown",j,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),t.jsx(Qn,{...d,children:t.jsx(eh,{scope:r,open:n,onOpenChange:x,content:u,onContentChange:f,children:t.jsx(th,{scope:r,onClose:l.useCallback(()=>x(!1),[x]),isUsingKeyboardRef:m,dir:v,modal:i,children:s})})})};Vl.displayName=er;var rh="MenuAnchor",Es=l.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e,a=an(n);return t.jsx(Xn,{...a,...s,ref:r})});Es.displayName=rh;var nh="MenuPortal",[Kx,Hl]=xt(nh,{forceMount:void 0}),ze="MenuContent",[sh,Rs]=xt(ze),Ul=l.forwardRef((e,r)=>{const n=Hl(ze,e.__scopeMenu),{forceMount:s=n.forceMount,...a}=e,o=Ot(ze,e.__scopeMenu),i=tr(ze,e.__scopeMenu);return t.jsx(Yt.Provider,{scope:e.__scopeMenu,children:t.jsx(tt,{present:s||o.open,children:t.jsx(Yt.Slot,{scope:e.__scopeMenu,children:i.modal?t.jsx(ah,{...a,ref:r}):t.jsx(oh,{...a,ref:r})})})})}),ah=l.forwardRef((e,r)=>{const n=Ot(ze,e.__scopeMenu),s=l.useRef(null),a=Re(r,s);return l.useEffect(()=>{const o=s.current;if(o)return uo(o)},[]),t.jsx(Ms,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:K(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),oh=l.forwardRef((e,r)=>{const n=Ot(ze,e.__scopeMenu);return t.jsx(Ms,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Ms=l.forwardRef((e,r)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:d,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:x,onInteractOutside:v,onDismiss:j,disableOutsideScroll:b,...w}=e,_=Ot(ze,n),R=tr(ze,n),T=an(n),L=zl(n),$=J0(n),[X,V]=l.useState(null),A=l.useRef(null),D=Re(r,A,_.onContentChange),z=l.useRef(0),Q=l.useRef(""),Y=l.useRef(0),Z=l.useRef(null),G=l.useRef("right"),te=l.useRef(0),k=b?lo:l.Fragment,O=b?{as:co,allowPinchZoom:!0}:void 0,H=q=>{var Ee,qe;const be=Q.current+q,Me=$().filter(Fe=>!Fe.disabled),$e=document.activeElement,Ye=(Ee=Me.find(Fe=>Fe.ref.current===$e))==null?void 0:Ee.textValue,nt=Me.map(Fe=>Fe.textValue),vt=vh(nt,be,Ye),Je=(qe=Me.find(Fe=>Fe.textValue===vt))==null?void 0:qe.ref.current;(function Fe(bt){Q.current=bt,window.clearTimeout(z.current),bt!==""&&(z.current=window.setTimeout(()=>Fe(""),1e3))})(be),Je&&setTimeout(()=>Je.focus())};l.useEffect(()=>()=>window.clearTimeout(z.current),[]),fo();const oe=l.useCallback(q=>{var Me,$e;return G.current===((Me=Z.current)==null?void 0:Me.side)&&yh(q,($e=Z.current)==null?void 0:$e.area)},[]);return t.jsx(sh,{scope:n,searchRef:Q,onItemEnter:l.useCallback(q=>{oe(q)&&q.preventDefault()},[oe]),onItemLeave:l.useCallback(q=>{var be;oe(q)||((be=A.current)==null||be.focus(),V(null))},[oe]),onTriggerLeave:l.useCallback(q=>{oe(q)&&q.preventDefault()},[oe]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:l.useCallback(q=>{Z.current=q},[]),children:t.jsx(k,{...O,children:t.jsx(po,{asChild:!0,trapped:a,onMountAutoFocus:K(o,q=>{var be;q.preventDefault(),(be=A.current)==null||be.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:t.jsx(Sr,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:f,onPointerDownOutside:m,onFocusOutside:x,onInteractOutside:v,onDismiss:j,children:t.jsx(Il,{asChild:!0,...L,dir:R.dir,orientation:"vertical",loop:s,currentTabStopId:X,onCurrentTabStopIdChange:V,onEntryFocus:K(u,q=>{R.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(Yn,{role:"menu","aria-orientation":"vertical","data-state":oc(_.open),"data-radix-menu-content":"",dir:R.dir,...T,...w,ref:D,style:{outline:"none",...w.style},onKeyDown:K(w.onKeyDown,q=>{const Me=q.target.closest("[data-radix-menu-content]")===q.currentTarget,$e=q.ctrlKey||q.altKey||q.metaKey,Ye=q.key.length===1;Me&&(q.key==="Tab"&&q.preventDefault(),!$e&&Ye&&H(q.key));const nt=A.current;if(q.target!==nt||!Z0.includes(q.key))return;q.preventDefault();const Je=$().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);Fl.includes(q.key)&&Je.reverse(),gh(Je)}),onBlur:K(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(z.current),Q.current="")}),onPointerMove:K(e.onPointerMove,Jt(q=>{const be=q.target,Me=te.current!==q.clientX;if(q.currentTarget.contains(be)&&Me){const $e=q.clientX>te.current?"right":"left";G.current=$e,te.current=q.clientX}}))})})})})})})});Ul.displayName=ze;var ih="MenuGroup",Ts=l.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return t.jsx(fe.div,{role:"group",...s,ref:r})});Ts.displayName=ih;var lh="MenuLabel",Gl=l.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return t.jsx(fe.div,{...s,ref:r})});Gl.displayName=lh;var yr="MenuItem",Ka="menu.itemSelect",on=l.forwardRef((e,r)=>{const{disabled:n=!1,onSelect:s,...a}=e,o=l.useRef(null),i=tr(yr,e.__scopeMenu),d=Rs(yr,e.__scopeMenu),u=Re(r,o),f=l.useRef(!1),m=()=>{const x=o.current;if(!n&&x){const v=new CustomEvent(Ka,{bubbles:!0,cancelable:!0});x.addEventListener(Ka,j=>s==null?void 0:s(j),{once:!0}),Vu(x,v),v.defaultPrevented?f.current=!1:i.onClose()}};return t.jsx(Kl,{...a,ref:u,disabled:n,onClick:K(e.onClick,m),onPointerDown:x=>{var v;(v=e.onPointerDown)==null||v.call(e,x),f.current=!0},onPointerUp:K(e.onPointerUp,x=>{var v;f.current||(v=x.currentTarget)==null||v.click()}),onKeyDown:K(e.onKeyDown,x=>{const v=d.searchRef.current!=="";n||v&&x.key===" "||Un.includes(x.key)&&(x.currentTarget.click(),x.preventDefault())})})});on.displayName=yr;var Kl=l.forwardRef((e,r)=>{const{__scopeMenu:n,disabled:s=!1,textValue:a,...o}=e,i=Rs(yr,n),d=zl(n),u=l.useRef(null),f=Re(r,u),[m,x]=l.useState(!1),[v,j]=l.useState("");return l.useEffect(()=>{const b=u.current;b&&j((b.textContent??"").trim())},[o.children]),t.jsx(Yt.ItemSlot,{scope:n,disabled:s,textValue:a??v,children:t.jsx($l,{asChild:!0,...d,focusable:!s,children:t.jsx(fe.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...o,ref:f,onPointerMove:K(e.onPointerMove,Jt(b=>{s?i.onItemLeave(b):(i.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:K(e.onPointerLeave,Jt(b=>i.onItemLeave(b))),onFocus:K(e.onFocus,()=>x(!0)),onBlur:K(e.onBlur,()=>x(!1))})})})}),ch="MenuCheckboxItem",ql=l.forwardRef((e,r)=>{const{checked:n=!1,onCheckedChange:s,...a}=e;return t.jsx(Jl,{scope:e.__scopeMenu,checked:n,children:t.jsx(on,{role:"menuitemcheckbox","aria-checked":wr(n)?"mixed":n,...a,ref:r,"data-state":As(n),onSelect:K(a.onSelect,()=>s==null?void 0:s(wr(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ql.displayName=ch;var Wl="MenuRadioGroup",[dh,uh]=xt(Wl,{value:void 0,onValueChange:()=>{}}),Zl=l.forwardRef((e,r)=>{const{value:n,onValueChange:s,...a}=e,o=ts(s);return t.jsx(dh,{scope:e.__scopeMenu,value:n,onValueChange:o,children:t.jsx(Ts,{...a,ref:r})})});Zl.displayName=Wl;var Xl="MenuRadioItem",Yl=l.forwardRef((e,r)=>{const{value:n,...s}=e,a=uh(Xl,e.__scopeMenu),o=n===a.value;return t.jsx(Jl,{scope:e.__scopeMenu,checked:o,children:t.jsx(on,{role:"menuitemradio","aria-checked":o,...s,ref:r,"data-state":As(o),onSelect:K(s.onSelect,()=>{var i;return(i=a.onValueChange)==null?void 0:i.call(a,n)},{checkForDefaultPrevented:!1})})})});Yl.displayName=Xl;var Ps="MenuItemIndicator",[Jl,fh]=xt(Ps,{checked:!1}),Ql=l.forwardRef((e,r)=>{const{__scopeMenu:n,forceMount:s,...a}=e,o=fh(Ps,n);return t.jsx(tt,{present:s||wr(o.checked)||o.checked===!0,children:t.jsx(fe.span,{...a,ref:r,"data-state":As(o.checked)})})});Ql.displayName=Ps;var ph="MenuSeparator",ec=l.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e;return t.jsx(fe.div,{role:"separator","aria-orientation":"horizontal",...s,ref:r})});ec.displayName=ph;var mh="MenuArrow",tc=l.forwardRef((e,r)=>{const{__scopeMenu:n,...s}=e,a=an(n);return t.jsx(Jn,{...a,...s,ref:r})});tc.displayName=mh;var hh="MenuSub",[qx,rc]=xt(hh),Ut="MenuSubTrigger",nc=l.forwardRef((e,r)=>{const n=Ot(Ut,e.__scopeMenu),s=tr(Ut,e.__scopeMenu),a=rc(Ut,e.__scopeMenu),o=Rs(Ut,e.__scopeMenu),i=l.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:u}=o,f={__scopeMenu:e.__scopeMenu},m=l.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return l.useEffect(()=>m,[m]),l.useEffect(()=>{const x=d.current;return()=>{window.clearTimeout(x),u(null)}},[d,u]),t.jsx(Es,{asChild:!0,...f,children:t.jsx(Kl,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":oc(n.open),...e,ref:ho(r,a.onTriggerChange),onClick:x=>{var v;(v=e.onClick)==null||v.call(e,x),!(e.disabled||x.defaultPrevented)&&(x.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:K(e.onPointerMove,Jt(x=>{o.onItemEnter(x),!x.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:K(e.onPointerLeave,Jt(x=>{var j,b;m();const v=(j=n.content)==null?void 0:j.getBoundingClientRect();if(v){const w=(b=n.content)==null?void 0:b.dataset.side,_=w==="right",R=_?-5:5,T=v[_?"left":"right"],L=v[_?"right":"left"];o.onPointerGraceIntentChange({area:[{x:x.clientX+R,y:x.clientY},{x:T,y:v.top},{x:L,y:v.top},{x:L,y:v.bottom},{x:T,y:v.bottom}],side:w}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(x),x.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:K(e.onKeyDown,x=>{var j;const v=o.searchRef.current!=="";e.disabled||v&&x.key===" "||X0[s.dir].includes(x.key)&&(n.onOpenChange(!0),(j=n.content)==null||j.focus(),x.preventDefault())})})})});nc.displayName=Ut;var sc="MenuSubContent",ac=l.forwardRef((e,r)=>{const n=Hl(ze,e.__scopeMenu),{forceMount:s=n.forceMount,...a}=e,o=Ot(ze,e.__scopeMenu),i=tr(ze,e.__scopeMenu),d=rc(sc,e.__scopeMenu),u=l.useRef(null),f=Re(r,u);return t.jsx(Yt.Provider,{scope:e.__scopeMenu,children:t.jsx(tt,{present:s||o.open,children:t.jsx(Yt.Slot,{scope:e.__scopeMenu,children:t.jsx(Ms,{id:d.contentId,"aria-labelledby":d.triggerId,...a,ref:f,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var x;i.isUsingKeyboardRef.current&&((x=u.current)==null||x.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:K(e.onFocusOutside,m=>{m.target!==d.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:K(e.onEscapeKeyDown,m=>{i.onClose(),m.preventDefault()}),onKeyDown:K(e.onKeyDown,m=>{var j;const x=m.currentTarget.contains(m.target),v=Y0[i.dir].includes(m.key);x&&v&&(o.onOpenChange(!1),(j=d.trigger)==null||j.focus(),m.preventDefault())})})})})})});ac.displayName=sc;function oc(e){return e?"open":"closed"}function wr(e){return e==="indeterminate"}function As(e){return wr(e)?"indeterminate":e?"checked":"unchecked"}function gh(e){const r=document.activeElement;for(const n of e)if(n===r||(n.focus(),document.activeElement!==r))return}function xh(e,r){return e.map((n,s)=>e[(r+s)%e.length])}function vh(e,r,n){const a=r.length>1&&Array.from(r).every(f=>f===r[0])?r[0]:r,o=n?e.indexOf(n):-1;let i=xh(e,Math.max(o,0));a.length===1&&(i=i.filter(f=>f!==n));const u=i.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return u!==n?u:void 0}function bh(e,r){const{x:n,y:s}=e;let a=!1;for(let o=0,i=r.length-1;os!=m>s&&n<(f-d)*(s-u)/(m-u)+d&&(a=!a)}return a}function yh(e,r){if(!r)return!1;const n={x:e.clientX,y:e.clientY};return bh(n,r)}function Jt(e){return r=>r.pointerType==="mouse"?e(r):void 0}var wh=Vl,jh=Es,_h=Ul,Ch=Ts,Nh=Gl,Sh=on,kh=ql,Eh=Zl,Rh=Yl,Mh=Ql,Th=ec,Ph=tc,Ah=nc,Oh=ac,Os="DropdownMenu",[Lh,Wx]=Ze(Os,[Bl]),De=Bl(),[Dh,ic]=Lh(Os),lc=e=>{const{__scopeDropdownMenu:r,children:n,dir:s,open:a,defaultOpen:o,onOpenChange:i,modal:d=!0}=e,u=De(r),f=l.useRef(null),[m=!1,x]=Xe({prop:a,defaultProp:o,onChange:i});return t.jsx(Dh,{scope:r,triggerId:ut(),triggerRef:f,contentId:ut(),open:m,onOpenChange:x,onOpenToggle:l.useCallback(()=>x(v=>!v),[x]),modal:d,children:t.jsx(wh,{...u,open:m,onOpenChange:x,dir:s,modal:d,children:n})})};lc.displayName=Os;var cc="DropdownMenuTrigger",dc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,disabled:s=!1,...a}=e,o=ic(cc,n),i=De(n);return t.jsx(jh,{asChild:!0,...i,children:t.jsx(fe.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...a,ref:ho(r,o.triggerRef),onPointerDown:K(e.onPointerDown,d=>{!s&&d.button===0&&d.ctrlKey===!1&&(o.onOpenToggle(),o.open||d.preventDefault())}),onKeyDown:K(e.onKeyDown,d=>{s||(["Enter"," "].includes(d.key)&&o.onOpenToggle(),d.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});dc.displayName=cc;var uc="DropdownMenuContent",fc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=ic(uc,n),o=De(n),i=l.useRef(!1);return t.jsx(_h,{id:a.contentId,"aria-labelledby":a.triggerId,...o,...s,ref:r,onCloseAutoFocus:K(e.onCloseAutoFocus,d=>{var u;i.current||(u=a.triggerRef.current)==null||u.focus(),i.current=!1,d.preventDefault()}),onInteractOutside:K(e.onInteractOutside,d=>{const u=d.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,m=u.button===2||f;(!a.modal||m)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fc.displayName=uc;var Ih="DropdownMenuGroup",$h=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Ch,{...a,...s,ref:r})});$h.displayName=Ih;var Fh="DropdownMenuLabel",pc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Nh,{...a,...s,ref:r})});pc.displayName=Fh;var Bh="DropdownMenuItem",mc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Sh,{...a,...s,ref:r})});mc.displayName=Bh;var zh="DropdownMenuCheckboxItem",hc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(kh,{...a,...s,ref:r})});hc.displayName=zh;var Vh="DropdownMenuRadioGroup",Hh=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Eh,{...a,...s,ref:r})});Hh.displayName=Vh;var Uh="DropdownMenuRadioItem",gc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Rh,{...a,...s,ref:r})});gc.displayName=Uh;var Gh="DropdownMenuItemIndicator",xc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Mh,{...a,...s,ref:r})});xc.displayName=Gh;var Kh="DropdownMenuSeparator",vc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Th,{...a,...s,ref:r})});vc.displayName=Kh;var qh="DropdownMenuArrow",Wh=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Ph,{...a,...s,ref:r})});Wh.displayName=qh;var Zh="DropdownMenuSubTrigger",bc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Ah,{...a,...s,ref:r})});bc.displayName=Zh;var Xh="DropdownMenuSubContent",yc=l.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...s}=e,a=De(n);return t.jsx(Oh,{...a,...s,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});yc.displayName=Xh;var Yh=lc,Jh=dc,wc=fc,jc=pc,_c=mc,Cc=hc,Nc=gc,Sc=xc,kc=vc,Ec=bc,Rc=yc;const Qh=Yh,e1=Jh,t1=l.forwardRef(({className:e,inset:r,children:n,...s},a)=>t.jsxs(Ec,{ref:a,className:S("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",r&&"pl-8",e),...s,children:[n,t.jsx(Pi,{className:"ml-auto h-4 w-4"})]}));t1.displayName=Ec.displayName;const r1=l.forwardRef(({className:e,...r},n)=>t.jsx(Rc,{ref:n,className:S("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));r1.displayName=Rc.displayName;const Mc=l.forwardRef(({className:e,sideOffset:r=4,...n},s)=>t.jsx(wc,{ref:s,sideOffset:r,className:S("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Mc.displayName=wc.displayName;const Tc=l.forwardRef(({className:e,inset:r,...n},s)=>t.jsx(_c,{ref:s,className:S("relative cursor-pointer flex select-none items-center rounded-sm px-3 py-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r&&"pl-8",e),...n}));Tc.displayName=_c.displayName;const n1=l.forwardRef(({className:e,children:r,checked:n,...s},a)=>t.jsxs(Cc,{ref:a,className:S("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...s,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Sc,{children:t.jsx(Mi,{className:"h-4 w-4"})})}),r]}));n1.displayName=Cc.displayName;const s1=l.forwardRef(({className:e,children:r,...n},s)=>t.jsxs(Nc,{ref:s,className:S("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Sc,{children:t.jsx(Se,{className:"h-2 w-2 fill-current"})})}),r]}));s1.displayName=Nc.displayName;const Pc=l.forwardRef(({className:e,inset:r,...n},s)=>t.jsx(jc,{ref:s,className:S("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",e),...n}));Pc.displayName=jc.displayName;const Ac=l.forwardRef(({className:e,...r},n)=>t.jsx(kc,{ref:n,className:S("-mx-1 my-1 h-px bg-muted",e),...r}));Ac.displayName=kc.displayName;const Oc=el,Lc=tl,Dc=hs;Dc.displayName=hs.displayName;const Ic=l.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:S("fixed inset-0 z-[120000] bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));Ic.displayName=rl.displayName;const Ls=l.forwardRef(({className:e,children:r,...n},s)=>{var a,o;return t.jsx(Dc,{container:((o=(a=document.getElementById("rapidload-optimizer-shadow-dom"))==null?void 0:a.shadowRoot)==null?void 0:o.getElementById("rapidload-page-optimizer-wrapper"))||document.body,children:t.jsx(Ic,{className:"cursor-auto",children:t.jsx(gs,{asChild:!0,ref:s,...n,children:t.jsxs("div",{className:S("overflow-y-auto max-h-screen outline-0 fixed left-[50%] top-[50%] z-[120000] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),children:[r,t.jsxs(bs,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(rn,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})})})})});Ls.displayName=gs.displayName;const Ds=({className:e,...r})=>t.jsx("div",{className:S("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});Ds.displayName="DialogHeader";const $c=({className:e,...r})=>t.jsx("div",{className:S("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});$c.displayName="DialogFooter";const Is=l.forwardRef(({className:e,...r},n)=>t.jsx(xs,{ref:n,className:S("text-lg font-semibold leading-none tracking-tight dark:text-brand-300",e),...r}));Is.displayName=xs.displayName;const Fc=l.forwardRef(({className:e,...r},n)=>t.jsx(vs,{ref:n,className:S("text-sm text-muted-foreground",e),...r}));Fc.displayName=vs.displayName;const it=l.forwardRef(({children:e,className:r,spreader:n=!1,...s},a)=>t.jsxs("div",{...s,ref:a,className:"w-full",children:[t.jsx("div",{className:S("w-full dark:bg-brand-950 bg-brand-0 rounded-3xl",n?"relative mb-0 z-10":"",r),children:e}),n&&t.jsxs("div",{className:S("absolute w-full -bottom-1 z-[1] transition-opacity duration-500 delay-500"),children:[t.jsx("div",{className:"rounded-3xl h-10 dark:border-brand-700 mx-1.5 bg-brand-300 dark:bg-brand-900 opacity-50"}),t.jsx("div",{className:"absolute w-full -bottom-1 z-[-1]",children:t.jsx("div",{className:"rounded-3xl h-5 dark:border-brand-700 mx-5 bg-brand-300 dark:bg-brand-900 opacity-20"})})]})]})),a1=({cls:e})=>t.jsx("svg",{className:`${e}`,width:"9",height:"9",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("circle",{cx:"4.5",cy:"4.5",r:"4.5",fill:"#0c6"})}),o1=({cls:e})=>t.jsx("svg",{className:`${e}`,width:"9",height:"9",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M9 9H0L4.5 0L9 9Z",fill:"#FF3333"})}),i1=({cls:e})=>t.jsx("svg",{className:`${e}`,width:"9",height:"9",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("rect",{width:"9",height:"9",fill:"#FFAA33"})}),Zt=({icon:e,className:r})=>{let[n,s]=l.useState(t.jsx(t.Fragment,{}));return l.useEffect(()=>{e==="pass"||e==="FAST"||e==="passed_audit"?s(t.jsx(a1,{})):e==="average"||e==="AVERAGE"?s(t.jsx(i1,{})):(e==="fail"||e==="SLOW")&&s(t.jsx(o1,{}))},[]),t.jsx("span",{className:S(r),children:n})},l1=()=>{var Y,Z;const{setShowOptimizer:e,options:r,modeData:n,savingData:s,setSavingData:a,invalidatingCache:o,setInvalidatingCache:i,global:d}=ve();r==null||r.optimizer_url,gt();const{submitSettings:u}=Tl(),f=d?2:0,[m,x]=l.useState(!1);l.useState(!1);const v=l.useRef(null),[j,b]=l.useState(f),[w,_]=l.useState(f);ot();const{fresh:R,touched:T,activeReport:L,data:$,settings:X}=ce(xe);l.useEffect(()=>{b(T&&!d?1:d?2:0)},[T]);const V=l.useMemo(()=>(X==null?void 0:X.filter(G=>{var te;return["Critical CSS","Remove Unused CSS"].includes(G.name)&&((te=G.status)==null?void 0:te.status)!=="success"}))||[],[X]),A=[{text:"Apply Optimization",title:"Save Changes?",description:"You have made changes to your settings. Click 'Save Changes' to apply your modifications or 'Discard' to revert to the previous state.",onClick:()=>u(!0)},{text:t.jsx("div",{className:"flex w-full items-center justify-between",children:" Apply Optimization"}),title:"Do you want to Apply Optimization?",description:t.jsx("div",{className:"",children:V.length>0?t.jsx("div",{className:"flex flex-col gap-6",children:t.jsx("div",{children:"You've made changes to your settings. For accurate results, wait for all tasks to complete before saving and re-analyzing."})}):t.jsx("div",{children:"You have made changes to your settings. Click 'Apply Optimization' to apply your modifications and re-analyze the page or 'Discard' to revert to the previous state."})}),onClick:()=>{u(!0)},action_text:"Apply Optimization"},{text:"Apply for Entire Site",title:"Apply these settings as entire site?",description:"You have made changes to your settings. Click 'Save Changes' to override entire site settings or 'Discard' to revert to the previous state.",onClick:()=>{u(!1,!0)}}],D=l.useCallback(G=>{if(!G)return null;const te=5,k=[...G.grouped.opportunities,...G.grouped.diagnostics].filter(oe=>{var q,be;return((be=(q=oe.files)==null?void 0:q.items)==null?void 0:be.length)>0||oe.settings.length>0}),O=k.length,H=O-te;return{show:te,balance:H,count:O,audits:k}},[$==null?void 0:$.audits]),z=l.useMemo(()=>D($),[$]),Q=l.useMemo(()=>R?!0:T,[R,T]);return t.jsxs(t.Fragment,{children:[t.jsx(br,{children:t.jsx("div",{className:"flex gap-2 items-center flex-none",children:t.jsxs(jl,{open:m,onOpenChange:x,children:[t.jsxs(Qh,{children:[t.jsx(pt,{"data-tour":"save-changes",ref:v,asChild:!0,className:S("flex overflow-hidden justify-between select-none relative text-sm gap-2 pl-1 pr-2 h-12 rounded-[14px]",!Q&&"bg-brand-700 dark:bg-primary dark:hover:bg-primary/90"),children:t.jsxs(_l,{onClick:G=>_(j),className:S("flex gap-2 items-center pl-3 pr-2 h-full"),children:[s||o?t.jsx(Ge,{className:"w-5 mr-0.5 animate-spin"}):t.jsx(Km,{className:"w-5 mr-0.5"}),A[j].text]})}),t.jsx(vr,{onCancel:()=>{e(!1)},cancel:"Discard & Leave",onClick:()=>{e(!1)},children:t.jsx(e1,{className:"w-8 h-12 flex items-center justify-center",children:t.jsx(ue,{className:"flex items-center justify-center",asChild:!0,text:"Additional Settings",children:t.jsx(Am,{className:S("h-5 w-5 dark:text-brand-300 text-brand-600 transition-opacity")})})})}),t.jsxs(Mc,{style:{width:((Y=v.current)==null?void 0:Y.clientWidth)||200},align:"end",sideOffset:6,className:"z-[110000] relative min-w-[200px]",children:[t.jsx(Pc,{children:"Additional Options"}),A.filter((G,te)=>j!==te).map((G,te)=>t.jsxs("span",{children:[t.jsx(Ac,{}),t.jsx(Tc,{onClick:k=>{setTimeout(()=>{x(!0),_(A.indexOf(G))},100)},children:G.text})]},te))]})]}),t.jsx(ws,{asChild:!0,className:"w-full max-w-[520px]",children:t.jsxs("div",{children:[t.jsxs(js,{children:[t.jsx(Cs,{children:A[w].title}),t.jsx(Ns,{children:t.jsx("div",{children:A[w].description})})]}),t.jsxs(_s,{children:[t.jsx(Ss,{onClick:G=>A[w].onClick(),children:(Z=A[w])!=null&&Z.action_text?A[w].action_text:"Save Changes"}),t.jsx(ks,{onClick:G=>x(!1),children:"Discard"})]})]})})]})})}),t.jsx(br,{mode:"onboard",children:t.jsx(Oc,{children:t.jsxs("div",{children:[t.jsx(Lc,{className:S("pointer-events-none opacity-50 cursor-not-allowed ",z&&z.count>0&&"pointer-events-auto opacity-100 cursor-pointer"),children:t.jsxs(Oe,{className:"text-sm",children:[s?t.jsx(w0,{className:"w-5 mr-0.5 animate-spin"}):t.jsx(Fa,{className:"w-5 mr-0.5"}),"Connect your Account"]})}),t.jsx(Ls,{className:"px-6 py-6",children:t.jsx(Ds,{children:z&&t.jsxs(t.Fragment,{children:[t.jsxs(Is,{children:["RapidLoad can improve ",z.count," Audits"]}),t.jsx("div",{className:"py-4 text-sm",children:t.jsxs("ul",{children:[$&&z.audits.slice(0,z.show).map(G=>t.jsx("li",{children:t.jsx(it,{className:"px-3 py-2 mb-1.5",children:t.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-7 h-7 rounded-full dark:bg-brand-700 bg-brand-100",children:G.scoreDisplayMode==="informative"?t.jsx("span",{className:"w-3 h-3 border-2 rounded-full"}):t.jsx(Zt,{icon:G.icon})}),t.jsxs("div",{className:"flex flex-col",children:[G.name,G.displayValue&&t.jsx("span",{className:"text-xxs leading-tight text-muted-foreground",children:G.displayValue})]})]})})},G.id)),$&&!!z.balance&&z.balance>0&&t.jsxs("li",{className:"text-center text-muted-foreground mt-3",children:["and ",z.balance," more audit",z.balance>1&&"s","..."]})]})}),t.jsx("div",{className:"flex justify-center",children:(n==null?void 0:n.connect_url)&&t.jsx("a",{href:n==null?void 0:n.connect_url,target:n==null?void 0:n.target,children:t.jsx(pt,{className:"gap-2",children:t.jsxs(t.Fragment,{children:[t.jsx(Fa,{className:"w-5 mr-0.5"}),"Connect RapidLoad Account"]})})})})]})})})]})})})]})},c1=({url:e})=>{const{setShowOptimizer:r,options:n,version:s,savingData:a,invalidatingCache:o,mode:i}=ve(),{activeReport:d,loading:u,testMode:f,reanalyze:m,settings:x,settingsOriginal:v}=ce(xe),{inProgress:j,testModeStatus:b}=ge(),{dispatch:w}=ge(),_=ot(),{isDark:R}=At();return l.useEffect(()=>{!a&&!o&&_(Ci(n,n.optimizer_url,!0))},[a,o]),t.jsxs(t.Fragment,{children:[t.jsxs("header",{className:"z-[110000] w-full px-6 py-3 flex gap-3 justify-between border-b backdrop-blur-sm dark:bg-brand-930/80 bg-brand-50/75 ",children:[t.jsxs("div",{className:"flex gap-12 items-center",children:[t.jsxs("div",{className:"relative",children:[t.jsx("img",{className:"w-36",src:R?n!=null&&n.page_optimizer_base?`${n==null?void 0:n.page_optimizer_base}/dark-logo.svg`:"/dark-logo.svg":n!=null&&n.page_optimizer_base?`${n==null?void 0:n.page_optimizer_base}/logo.svg`:"/logo.svg",alt:"RapidLoad - #1 to unlock breakneck page speed"}),s&&t.jsxs("span",{className:"absolute text-xxs w-[200px] left-[72px] top-[1px] dark:text-brand-500 text-brand-400",children:["TITAN v",s]})]}),t.jsxs("div",{className:"flex flex-column items-center gap-3",children:[t.jsxs("div",{"data-tour":"switch-report-strategy",className:"select-none relative flex dark:bg-brand-800 py-0.5 bg-brand-200/80 rounded-2xl cursor-pointer",children:[t.jsx("div",{className:S("absolute shadow-md translate-x-0 left-0.5 w-[55px] rounded-[14px] -z-1 duration-300 h-11 text-sm flex flex-column gap-2 px-4 py-3 font-medium dark:bg-brand-950 bg-brand-0",d==="desktop"&&"w-[55px] -translate-x-1 left-1/2")}),t.jsx(ue,{text:"Mobile",children:t.jsx("div",{onClick:()=>_(Bn("mobile")),className:"relative z-1 text-sm flex flex-column gap-2 px-5 py-3 font-medium rounded-2xl",children:t.jsx(To,{className:"h-5 w-5 font-medium dark:text-brand-500"})})}),t.jsx(ue,{text:"Desktop",children:t.jsx("div",{onClick:()=>_(Bn("desktop")),className:"relative z-1 text-sm flex flex-column gap-2 pl-2 px-5 py-3 font-medium rounded-2xl",children:t.jsx(Di,{className:"h-5 w-5 font-medium dark:text-brand-500 "})})})]}),t.jsxs("div",{className:"flex overflow-hidden border rounded-2xl shadow","data-tour":"current-url",children:[t.jsx(I0,{}),i==="onboard"?t.jsx(ue,{text:"Analyze the page",children:t.jsx(Oe,{asChild:!0,"data-tour":"analyze",className:S("transition-none rounded-none h-12 px-3 pr-3.5 border-r-0 border-l border-t-0 border-b-0 bg-transparent "),variant:"outline",onClick:()=>{(!j||!u)&&(_(Wt(n,e,!0)),w(ae("openAudits",[])))},children:t.jsxs("div",{className:"flex flex-col gap-[1px] items-center",children:[t.jsx(zn,{className:S("w-4 -mt-0.5",u&&"animate-spin")}),t.jsx("span",{className:"text-xxs font-normal text-brand-500",children:"Analyze "})]})})}):t.jsx(vr,{title:"Analyze without applying optimization?",description:"Your changes are not saved yet. If you analyze now, your recent edits won't be included.",action:"Apply Optimization",cancel:"Discard & Analyze",onCancel:()=>{_(Wt(n,e,!0)),w(ae("openAudits",[]))},onClick:()=>{(!j||!u)&&_(Wt(n,e,!0)),w(ae("openAudits",[]))},children:t.jsx(ue,{text:"Analyze the page",children:t.jsx(Oe,{asChild:!0,"data-tour":"analyze",className:S("transition-none rounded-none h-12 px-3 pr-3.5 border-r-0 border-l border-t-0 border-b-0 bg-transparent "),variant:"outline",children:t.jsxs("div",{className:"flex flex-col gap-[1px] items-center",children:[t.jsx(zn,{className:S("w-4 -mt-0.5",u&&"animate-spin")}),t.jsx("span",{className:"text-xxs font-normal text-brand-500",children:"Analyze "})]})})})})]})]})]}),t.jsx("div",{className:"flex relative gap-4 items-center",children:t.jsxs(t.Fragment,{children:[t.jsx(l1,{}),t.jsx(vr,{onCancel:()=>{r(!1)},cancel:"Discard & Leave",onClick:()=>{r(!1)},children:t.jsx(ue,{text:"Close Optimizer",children:t.jsx(zm,{className:S("h-5 w-5 dark:text-brand-300 text-brand-600 transition-opacity")})})})]})})]}),t.jsx(Ve,{children:b&&t.jsxs(nf.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{ease:"easeInOut",duration:.5},className:"z-[110000] w-full text-[13px] bg-[#f7b250] items-center text-center py-0.5 top-[69px] absolute dark:bg-brand-950",children:[t.jsx("span",{className:"font-semibold text-black dark:text-brand-300",children:"Test Mode turned on,"}),"optimizations are safely previewed without affecting your live website. Perfect for experimentation and fine-tuning."]})})]})};function Gt({className:e,...r}){return t.jsx("div",{className:S("animate-pulse rounded-md bg-primary/10",e),...r})}/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
@@ -298,30 +298,30 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
-***************************************************************************** */var Un=function(e,r){return Un=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var a in s)s.hasOwnProperty(a)&&(n[a]=s[a])},Un(e,r)};function d1(e,r){Un(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var Gn=function(){return Gn=Object.assign||function(r){for(var n,s=1,a=arguments.length;s{const[r,n]=l.useState("fail"),[s,a]=l.useState("transparent"),[o,i]=l.useState("transparent"),d=l.useCallback((u=null)=>{const m=u||e;return!m||m<50?(a("#ff4e43"),i(`rgb(255, 51, 51, ${.08} )`),n("fail")):m<90?(a("#FFAA33"),i(`rgb(255, 170, 51, ${.08})`),n("average")):m<101&&(a("#09B42F"),i(`rgb(9, 180, 4, ${.08})`),n("pass")),[r,s,o]},[e]);return l.useEffect(()=>{d()},[]),l.useEffect(()=>{d()},[e]),[r,s,o,d]},Wa=["Initiating analysis","Fetching assets","Running PageSpeed Insights","Analyzing performance","Evaluating metrics","Compiling results","Almost done"],b1=({performance:e,className:r,scoreClassName:n,background:s=!0,stroke:a=4,children:o,animate:i=!0,loading:d=!1})=>{const[u,f]=l.useState(i?0:e||0),[m,x]=l.useState(-1),[v,j,y]=Tt(e),w=l.useCallback(()=>{if(e&&i){let T=0;const L=setInterval(()=>{T+=1,T<=e?f(T):clearInterval(L)},10);return()=>clearInterval(L)}},[e,i]),_=l.useCallback(()=>{if(d){x(0);const T=setInterval(()=>{x(L=>L>=Wa.length-1?0:L+1)},7e3);return()=>clearInterval(T)}else x(-1)},[d]);l.useEffect(w,[w]),l.useEffect(_,[_]);const M=l.useMemo(()=>v1({pathColor:j,trailColor:s?"transparent":y,pathTransitionDuration:.5,strokeLinecap:"round",backgroundColor:y}),[j,s,y]);return t.jsx(x1,{strokeWidth:a,background:s,className:S("max-h-[176px] relative w-full align-middle",r,d&&"animate-spin"),styles:M,value:d?85:u,children:t.jsx(Ve,{initial:!1,children:t.jsxs("div",{style:{color:j},className:S("w-full flex flex-col items-center text-center text-4xl transition-all ease-out duration-300 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 font-bold",n,o&&"gap-1",d&&"gap-2"),children:[!d&&t.jsx("span",{children:u.toFixed(0)}),t.jsx(Ve,{mode:"wait",children:d&&m!==-1&&t.jsx(Se.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:[.4,0,.2,1]},className:S("text-xs font-normal px-6"),children:d&&Wa[m]},m)}),o&&t.jsx(Se.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},children:o},"children")]})})})},Is=de.memo(b1),y1=({metrics:e=[],performance:r})=>{const n=["First Contentful Paint","Largest Contentful Paint","Total Blocking Time","Cumulative Layout Shift","Speed Index"],s=e.sort((u,f)=>n.indexOf(u.title)-n.indexOf(f.title)),{dispatch:a,activeMetric:o,hoveredMetric:i}=xe(),{optimizerContainer:d}=he();return l.useEffect(()=>{var u;o&&((u=d.current)==null||u.scrollIntoView({behavior:"smooth"}))},[o]),t.jsx("div",{className:"w-full lg:flex flex-col lg:grid-cols-none grid grid-cols-2 grid-rows-3",children:s.sort((u,f)=>f.potentialGain-u.potentialGain).map((u,f)=>t.jsxs("div",{onClick:m=>{a(ae("activeMetric",u))},onMouseEnter:()=>{const m=setTimeout(()=>{a(ae("hoveredMetric",u))},100);return()=>clearTimeout(m)},onMouseLeave:()=>{const m=setTimeout(()=>{a(ae("hoveredMetric",null))},100);return()=>clearTimeout(m)},className:S("lg:last:rounded-b-3xl select-none cursor-pointer dark:hover:bg-brand-900/50 hover:bg-brand-100/50 group flex flex-row justify-between items-center last:border-b-0 border-b lg:border-b-0 lg:border-t lg:even:border-l-0 even:border-l px-3 lg:px-6 py-2.5",u.id===(o==null?void 0:o.id)&&"bg-brand-100/80 dark:bg-brand-900/80 "),children:[t.jsxs("div",{className:"flex flex-col justify-between",children:[t.jsx("div",{className:"flex items-center gap-1.5 flex-row text-sm font-medium",children:t.jsxs("div",{className:"inline-flex flex-col",children:[t.jsx("span",{children:u.title}),t.jsx("span",{className:"text-xs text-brand-500 font-normal",children:u.potentialGain>1?t.jsxs(t.Fragment,{children:["Enhance this for ",t.jsxs("span",{className:"group-hover:text-green-600",children:[u.potentialGain.toFixed(0)," point boost."]})," "]}):"Looks great, well done!"})]})}),t.jsx("div",{style:{color:Tt(u.score)[1]},className:"text-lg font-medium text-brand-500",children:u.displayValue})]}),t.jsx("div",{className:"hidden xl:block",children:(i==null?void 0:i.id)===u.id?t.jsx("div",{className:S("flex items-center justify-center w-[36px] h-[36px] rounded-full bg-brand-200 dark:bg-brand-800"),children:t.jsx(ki,{className:"w-4"})}):t.jsx("div",{className:S(""),children:t.jsx(Is,{background:!1,stroke:10,scoreClassName:"text-[12px]",className:"h-9",performance:u.score})})})]},f))})},Fc=({action:e=!0})=>{const{theme:r,setTheme:n,changeTheme:s}=At();return t.jsx("div",{className:"cursor-pointer select-none",onClick:a=>e&&s(),children:r==="dark"?t.jsx(Ba,{className:"w-5"}):r==="light"?t.jsx(Zm,{className:"w-5"}):t.jsx(Ba,{className:"w-5"})})};let Za={clear_cache:t.jsx(Si,{className:"w-3.5"}),clear_page_cache:t.jsx(Ai,{className:"w-5"}),clear_all_optimizations:t.jsx(Pi,{className:"w-3.5"}),clear_css_optimizations:t.jsx(Om,{className:"w-3.5"}),clear_js_optimizations:t.jsx(Pm,{className:"w-3.5"}),clear_font_optimizations:t.jsx(Um,{className:"w-3.5"}),default:t.jsx(Li,{className:"w-3.5"})};const w1=()=>{const{actions:e,settings:r}=ce(ve);he();let[n,s]=l.useState(e.map(o=>({...o,loading:!1})));l.useEffect(()=>{s(e.map(o=>({...o,loading:!1})))},[e]);const a=async o=>{try{s(d=>d.map(u=>u.control_icon===o.control_icon?{...u,loading:!0}:u));let i=await fetch(o.action.replace(/&/g,"&"));Ue({duration:10,description:t.jsxs("div",{className:"flex w-full gap-2 text-center items-center",children:["Successfully completed ",t.jsx(Ti,{className:"w-5 text-green-600"})," "]})})}catch(i){Ue({duration:10,description:t.jsxs("div",{className:"flex w-full gap-2 text-center items-center",children:["An error occurred - ",i==null?void 0:i.message," ",t.jsx(Mm,{className:"w-5 text-red-600"})," "]})}),console.error(i)}s(i=>i.map(d=>d.control_icon===o.control_icon?{...d,loading:!1}:d))};return e?t.jsx("div",{className:"items-center justify-center flex py-1",children:n.filter(o=>o.category==="general").map(o=>t.jsx(Le,{disabled:o.loading,onClick:i=>a(o),className:"rounded-[15px] ",variant:"ghost",children:t.jsxs("div",{className:"flex flex-col gap-1 items-center ",children:[o.loading?t.jsx("span",{children:t.jsx(Ge,{className:"motion-safe:animate-spin w-4"})}):Za[o.control_icon]||Za.default,t.jsx("span",{className:"text-xxs font-normal text-brand-500",children:o.control_label})]})},o.control_icon))}):t.jsx(t.Fragment,{})},Xa="titan-tour-prompt",j1=()=>{const{changeTheme:e}=At(),[r,n]=l.useState(()=>{const m=localStorage.getItem(Xa);return m?JSON.parse(m):!0}),{data:s,error:a,loading:o,revisions:i}=ce(ve),{dispatch:d,hoveredMetric:u,activeMetric:f}=xe();return l.useEffect(()=>{localStorage.setItem(Xa,JSON.stringify(r))},[r]),t.jsxs(it,{className:"flex items-center justify-center py-2 rounded-xl",children:[(s==null?void 0:s.loadingExperience)&&!f&&t.jsx(t.Fragment,{children:t.jsx(Le,{"data-tour":"analyze",onClick:()=>{d(An("isTourOpen",!0)),n(!1)},className:"transition-none h-12 px-3 rounded-2xl border-none bg-transparent",variant:"outline",children:t.jsxs("div",{className:"flex flex-col gap-1 items-center",children:[t.jsx(Im,{className:S("w-5")}),t.jsx("span",{className:"text-xxs font-normal text-brand-500",children:"Get Started"})]})})}),t.jsx(Le,{onClick:m=>e(),className:"transition-none h-12 px-3 rounded-2xl border-none bg-transparent",variant:"outline",children:t.jsxs("div",{className:"flex flex-col gap-1 items-center",children:[t.jsx(Fc,{}),t.jsx("span",{className:"text-xxs font-normal text-brand-500",children:"Theme"})]})}),t.jsx(w1,{})]})},_1=()=>{const[e,r]=l.useState(null),[n,s]=l.useState(""),[a,o]=l.useState(!1),[i,d]=l.useState(!1),{toast:u}=gt();l.useMemo(()=>[{Component:Cm,value:"annoyed"},{Component:Dm,value:"frown"},{Component:Vm,value:"meh"},{Component:Wm,value:"smile"},{Component:qm,value:"smilePlus"}],[]);const f=async()=>{if(!e)return;const m=new et;try{o(!0),await m.post("rapidload_titan_feedback",{smiley:e,detail:n}),u({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["Thank you! Your feedback is sent. ",t.jsx(Be,{className:"w-5 text-green-600"})]})}),o(!1),r(""),s(""),d(!1)}catch(x){u({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[x.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]})}),o(!1)}};return l.useEffect(()=>{e&&f()},[e]),l.useEffect(()=>{setTimeout(()=>{d(!0)},30*1)},[]),i?t.jsxs(it,{className:S("flex flex-col gap-4 px-6 py-5 bg-brand-0/70 rounded-xl"),children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("div",{className:"text-sm font-medium",children:"How was the experience?"}),t.jsx("div",{className:"text-xs text-brand-500",children:"Feedback helps us improve the product work better for you."})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(Le,{onClick:m=>{r("good")},className:S(e==="good"&&"bg-brand-300"),variant:"outline",children:[a&&e==="good"?t.jsx(Ge,{className:"w-4 animate-spin"}):t.jsx(Ym,{className:"w-4"}),"Good"]}),t.jsxs(Le,{onClick:m=>{r("bad")},className:S(e==="bad"&&"bg-brand-300"),variant:"outline",children:[a&&e==="bad"?t.jsx(Ge,{className:"w-4 animate-spin"}):t.jsx(Xm,{className:"w-4"}),"Bad"]})]})]}):t.jsx(t.Fragment,{})},$s=()=>{const{options:e}=he(),{dispatch:r}=xe(),{toast:n}=gt(),[s,a]=l.useState(null);let o=e==null?void 0:e.optimizer_url;return{handleTestModeSwitchChange:d=>new Promise(async(u,f)=>{try{r(ae("testModeStatus",d)),r(ae("testModeLoading",!0)),s&&clearTimeout(s);const m=setTimeout(async()=>{const x=await r(fm(e,o,String(d)));x.success?(r(ae("testModeLoading",!1)),n({description:t.jsxs("div",{className:"flex gap-2 text-left items-center",children:[t.jsx("div",{className:"h-12 w-12 flex bg-green-200 justify-center items-center rounded-lg",children:t.jsx(Sl,{className:"h-6 w-6 text-green-600"})}),t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("span",{className:"font-semibold dark:text-brand-300",children:["Test Mode turned ",d?"on":"off"," successfully"]}),t.jsx("span",{className:"font-normal text-xs text-zinc-600 dark:text-brand-400",children:d?"Changes will not affect the live site.":"All changes will be applied to the live site."})]})]}),className:"p-3"})):(n({description:t.jsxs("div",{className:"flex gap-2 text-left items-center",children:[t.jsx("div",{className:"h-12 w-12 flex bg-red-200 justify-center items-center rounded-lg",children:t.jsx(Rl,{className:"h-6 w-6 text-red-600"})}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"font-semibold dark:text-brand-300",children:"Failed to turn on Test Mode"}),t.jsx("span",{className:"font-normal text-xs text-zinc-600 dark:text-brand-400",children:x.error})]})]}),className:"p-3"},5e5),r(ae("testModeStatus",!1)),r(ae("testModeLoading",!1))),u(x)},1e3);a(m)}catch(m){f(m)}})}};function C1({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M7.84 1.804A1 1 0 0 1 8.82 1h2.36a1 1 0 0 1 .98.804l.331 1.652a6.993 6.993 0 0 1 1.929 1.115l1.598-.54a1 1 0 0 1 1.186.447l1.18 2.044a1 1 0 0 1-.205 1.251l-1.267 1.113a7.047 7.047 0 0 1 0 2.228l1.267 1.113a1 1 0 0 1 .206 1.25l-1.18 2.045a1 1 0 0 1-1.187.447l-1.598-.54a6.993 6.993 0 0 1-1.929 1.115l-.33 1.652a1 1 0 0 1-.98.804H8.82a1 1 0 0 1-.98-.804l-.331-1.652a6.993 6.993 0 0 1-1.929-1.115l-1.598.54a1 1 0 0 1-1.186-.447l-1.18-2.044a1 1 0 0 1 .205-1.251l1.267-1.114a7.05 7.05 0 0 1 0-2.227L1.821 7.773a1 1 0 0 1-.206-1.25l1.18-2.045a1 1 0 0 1 1.187-.447l1.598.54A6.992 6.992 0 0 1 7.51 3.456l.33-1.652ZM10 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",clipRule:"evenodd"}))}const N1=l.forwardRef(C1);function S1({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const k1=l.forwardRef(S1);function E1({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",clipRule:"evenodd"}))}const R1=l.forwardRef(E1),Bc=({error:e,className:r})=>t.jsxs("div",{className:S("flex flex-col pt-3 gap-2",r),children:[t.jsx("div",{className:"w-fit",children:t.jsx(k1,{className:"w-8 fill-red-500"})}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"font-medium text-md ",children:"Oops! Something went wrong"}),t.jsxs("span",{className:"text-sm text-brand-700 dark:text-brand-300",children:["Refresh the page, If the error persists",t.jsx("br",{}),"please ",t.jsx("a",{target:"_blank",className:"text-purple-750",href:"https://rapidload.zendesk.com/hc/en-us",children:"contact support"})]}),t.jsxs("span",{className:"text-sm text-brand-500 dark:text-brand-200 border-t mt-2 pt-2 mb-6 max-w-[350px]",children:[t.jsx("span",{className:"font-medium text-brand-800 dark:text-brand-400",children:"Details:"})," ",e]})]})]}),M1=34,T1=({width:e=400,category:r})=>{const[n,s]=l.useState(!0);l.useEffect(()=>{s(!0);const i=setTimeout(()=>{s(!1)},80);return()=>clearTimeout(i)},[r,e]);const a=`M${Math.min(e-(e-66),e-9.5)} 1C${Math.min(e-(e-66),e-9.5)} 8.5 ${Math.min(e-(e-72),e-9.5)} 8 ${Math.min(e-(e-75.5),e-9.5)} 8C${Math.min(e-(e-89.7),e-9.5)} 8 ${Math.min(e-(e-130.5),e-9.5)} 8 ${e-9.5} 8C${e-5.5} 8 ${e-.5} 9.5 ${e-.5} 15.5`,o=2;return t.jsxs("div",{className:"absolute -left-7 top-0.5",children:[!n&&t.jsx("svg",{className:"absolute selectionBar",width:e,height:"16",viewBox:`0 0 ${e} 16`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-600 stroke-purple-800/10",d:a,strokeWidth:o})}),t.jsx("svg",{width:e,height:"16",viewBox:`0 0 ${e} 16`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-500 stroke-purple-600/10",d:a,strokeWidth:o})})]})},P1=({width:e=400,category:r})=>{const[n,s]=l.useState(!0);l.useEffect(()=>{s(!0);const i=setTimeout(()=>{s(!1)},80);return()=>clearTimeout(i)},[r,e]);const a=`M${Math.min(e-(e-66),e-9.5)} 1C${Math.min(e-(e-66),e-9.5)} 8.5 ${Math.min(e-(e-72),e-9.5)} 8 ${Math.min(e-(e-75.5),e-9.5)} 8C${Math.min(e-(e-89.7),e-9.5)} 8 ${Math.min(e-(e-130.5),e-9.5)} 8 ${e-9.5} 8C${e-5.5} 8 ${e-.5} 9.5 ${e-.5} 15.5`,o=2;return t.jsxs("div",{className:"absolute pl-11 -top-0.5",children:[!n&&t.jsx("svg",{className:"absolute selectionBar",width:e,height:"16",viewBox:`0 0 ${e} 16`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-600 stroke-brand-300/90",d:a,strokeWidth:o})}),t.jsx("svg",{width:e,height:"16",viewBox:`0 0 ${e} 16`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-500 stroke-brand-300/50",d:a,strokeWidth:o})})]})},A1=({cls:e})=>t.jsx("div",{className:"absolute -top-3 left-7",children:t.jsx("svg",{className:`${e}`,width:"62",height:"15",viewBox:"0 0 62 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-600 stroke-brand-300",d:"M1 0.5V1C1 4.86599 4.13401 8 8 8H54C57.866 8 61 11.134 61 15V15",stroke:"#D4D4D8",strokeWidth:"2"})})}),O1=({cls:e})=>t.jsx("svg",{className:`${e}`,width:M1,height:"40",viewBox:"0 0 8 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-600 stroke-brand-300",d:"M0.5 0.5V12.5C0.5 17.5 4.3 17.5 7.5 17.5",strokeLinecap:"round",strokeLinejoin:"round"})}),L1=()=>{const{testMode:e}=ce(ve),[r,n]=l.useState(!1),{testModeStatus:s,testModeLoading:a,dispatch:o}=xe(),{handleTestModeSwitchChange:i}=$s(),{options:d}=he(),{revisions:u}=ce(ve);l.useEffect(()=>{e&&o(ae("testModeStatus",e))},[e,o]);const f=async m=>{await i(m)};return l.useEffect(()=>{n(a)},[s,a,e]),t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-2 justify-center",children:[t.jsx("div",{className:"w-fit",children:t.jsxs("div",{"data-tour":"test-mode",className:"select-none relative flex dark:bg-brand-800 py-0.5 pl-[2px] pr-[4px] rounded-2xl cursor-pointer bg-brand-0",children:[t.jsx(Se.span,{layoutId:"bubble",className:S("absolute w-[78px] rounded-[14px] border-2 border-brand-200/80 text-black -z-1 h-[44px] text-sm flex flex-col gap-2 px-3 py-2.5 font-medium dark:bg-brand-950",e&&"w-[110px] right-0.5 border-amber-500/80"),style:{borderRadius:14},transition:{type:"spring",bounce:0,duration:.6}}),t.jsxs("div",{onClick:async()=>{e&&await f(!1)},className:`relative z-1 items-center text-sm flex gap-2 px-3 py-2.5 font-medium rounded-2xl ${e?"text-brand-500":""}`,children:[t.jsx(Ee,{className:S(`w-1.5 stroke-0 ${e?"fill-brand-300":"fill-green-600"} animate-ping absolute inline-flex opacity-75`)}),t.jsx(Ee,{className:S(`w-1.5 stroke-0 ${e?"fill-brand-300":"fill-green-600"} relative inline-flex`)}),"Live"]}),t.jsx("div",{onClick:async()=>{e||await f(!0)},className:"relative justify-center items-center z-1 text-sm flex pl-6 pr-5 py-2.5 whitespace-nowrap font-medium rounded-2xl text-brand-500",children:"Test Mode"})]})}),t.jsx(me,{text:r?"loading":"Preview",className:"dark:bg-brand-930/90",children:t.jsx("div",{onClick:()=>{!r&&window.open(d.optimizer_url+"?rapidload_preview","_blank")},className:`flex gap-2 items-center text-sm h-12 rounded-[14px] bg-brand-0 dark:bg-brand-930/90 px-4 py-2 ${(u==null?void 0:u.length)>0,""}`,"data-tour":"preview-button",children:r?t.jsx(Ge,{className:"w-5 animate-spin"}):t.jsx(ur,{className:"w-5 text-gray-500"})})})]}),t.jsx("div",{className:"relative mt-4 -mb-2 rotate-180 ",children:t.jsx(P1,{width:e?110:200})})]})},D1=({metric:e})=>{const[r,n,s,a]=Tt(e.score);return t.jsx("div",{style:{color:n||"#515151"},className:"text-md font-medium text-brand-500",children:e.displayValue})},I1=({pagespeed:e,priority:r=!0})=>{var O;const[n,s]=l.useState(!1),[a,o]=l.useState(!1),{data:i,error:d,reanalyze:u,revisions:f,loading:m}=ce(ve);l.useState(0);const[x,v]=l.useState(!1),{dispatch:j,hoveredMetric:y,activeMetric:w}=xe(),{options:_}=he(),{settingsMode:M,testModeStatus:T,testModeLoading:L}=xe(),{testMode:$}=ce(V=>V.app);l.useState(null);const[X,z]=l.useState(($==null?void 0:$.status)||!1),[A,D]=l.useState(!1);$s(),_==null||_.optimizer_url,l.useEffect(()=>{$&&j(ae("testModeStatus",$.status||!1))},[$]),l.useEffect(()=>{z(T),D(L)},[T,L]),l.useCallback(()=>{s(!n)},[n]);const U={LARGEST_CONTENTFUL_PAINT_MS:"LCP",FIRST_INPUT_DELAY_MS:"FID",CUMULATIVE_LAYOUT_SHIFT_SCORE:"CLS",FIRST_CONTENTFUL_PAINT_MS:"FCP",INTERACTION_TO_NEXT_PAINT:"INP",EXPERIMENTAL_TIME_TO_FIRST_BYTE:"TTFB"},Q=["LARGEST_CONTENTFUL_PAINT_MS","FIRST_INPUT_DELAY_MS","CUMULATIVE_LAYOUT_SHIFT_SCORE","FIRST_CONTENTFUL_PAINT_MS","INTERACTION_TO_NEXT_PAINT","EXPERIMENTAL_TIME_TO_FIRST_BYTE"],Y=V=>U[V]||V;Q.map(V=>{var oe,q;return{metricName:Y(V),metric:(oe=i==null?void 0:i.loadingExperience)!=null&&oe.metrics?(q=i==null?void 0:i.loadingExperience)==null?void 0:q.metrics[V]:null}});let Z=y,G=Number((O=Z!=null&&Z.potentialGain?Z==null?void 0:Z.potentialGain:0)==null?void 0:O.toFixed(0));const[te,k]=l.useState(1);return l.useEffect(()=>{k(V=>V+1)},[]),l.useEffect(()=>{a||j(ae("activeMetric",null))},[a]),t.jsx(t.Fragment,{children:t.jsxs("div",{className:"w-full flex flex-col gap-4",children:[t.jsx(L1,{}),t.jsxs(it,{"data-tour":"speed-insights",className:S("overflow-hidden border border-transparent flex flex-col sm:flex-row lg:flex-col justify-around",a&&"border-brand-200 dark:border-brand-800"),children:[t.jsx("div",{className:S("content px-4 relative flex w-full sm:w-1/2 lg:w-full flex-col justify-center items-center gap-3 py-2.5",!d&&"px-4 lg:px-4 lg:pb-0 xl:px-8"),children:d?t.jsx(Bc,{error:d}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex gap-6",children:t.jsx("div",{className:"relative flex flex-col gap-3 px-4 items-center",children:t.jsx("div",{className:"mt-6",children:!i||x?t.jsx(Gt,{className:"w-44 h-44 rounded-full"}):t.jsx(Is,{loading:u,performance:i!=null&&i.performance&&G&&Z?i.performance+G>=99?99:i.performance+G:i==null?void 0:i.performance,children:!!(Z&&G)&&t.jsxs("div",{className:"flex gap-1 flex-col text-xxs font-normal",children:[t.jsx("span",{children:Z==null?void 0:Z.title}),t.jsxs("span",{className:"text-sm text-green-600 -ml-1",children:["+",G]})]})})})})}),t.jsxs("div",{className:"flex flex-col text-center gap-1",children:[t.jsxs("div",{children:[Z?"Forecasted Score":"Performance"," "]}),t.jsx("div",{className:"text-xs text-brand-500 dark:text-brand-300 font-light",children:"Values are estimated and may vary with Google Page Speed Insights."})]}),t.jsxs("div",{className:"flex justify-around text-sm gap-4 font-normal w-full mb-5 text-brand-700 dark:text-brand-300",children:[t.jsxs("div",{className:"flex lg:flex-col xl:flex-row items-center gap-1",children:[t.jsx(Wt,{icon:"fail"}),"0-49"]}),t.jsxs("div",{className:"flex lg:flex-col xl:flex-row items-center gap-1",children:[t.jsx(Wt,{icon:"average"}),"50-89"]}),t.jsxs("div",{className:"flex lg:flex-col xl:flex-row items-center gap-1",children:[t.jsx(Wt,{icon:"pass"}),"89-100"]})]})]})}),t.jsxs("div",{className:"border-t",children:[t.jsxs(Le,{onClick:V=>!m&&o(oe=>!oe),variant:"outline",className:S("select-none border-b border-l-0 border-t-0 border-r-0 rounded-none bg-transparent hover:bg-transparent text-center text-xs text-brand-600 py-2",a&&"border-b-0"),"data-tour":"expand-metrics",children:[a?"Collapse":"Expand"," Metrics"]}),(i==null?void 0:i.metrics)&&!a&&t.jsx(t.Fragment,{children:t.jsx("div",{className:"flex justify-around my-2 px-2",onMouseLeave:()=>j(ae("hoveredMetric",null)),children:i.metrics.map(V=>t.jsxs("div",{onMouseEnter:()=>j(ae("hoveredMetric",V)),className:`text-xs text-center flex flex-col
- gap-0.5 px-2 py-2 bg-brand-100/20 hover:bg-brand-100 cursor-default rounded-[14px]`,children:[t.jsx("div",{className:"font-medium tracking-wider ",children:V.refs.acronym}),t.jsx(D1,{metric:V})]},V.id))})})]}),(i==null?void 0:i.metrics)&&a&&t.jsxs("div",{className:S("sticky top-0 w-full sm:w-1/2 lg:w-full border-l lg:border-l-0"),"data-tour":"metrics",children:[t.jsxs("div",{onClick:V=>j(ae("activeMetric",null)),className:S("flex gap-3 items-center font-medium dark:hover:bg-brand-900/70 px-6 py-3 border-b lg:border-b-0 lg:border-t cursor-pointer text-sm",!w&&"bg-brand-100/80 dark:bg-brand-900/80 "),children:[t.jsx("span",{children:t.jsx($m,{className:"w-4 text-brand-400"})})," All Audits"]}),t.jsx(y1,{performance:i==null?void 0:i.performance,metrics:i.metrics})]})]}),t.jsx(j1,{}),t.jsx(l.Suspense,{children:t.jsx(_1,{},te)})]})})},$1=de.memo(I1),F1=Vu,zc=l.forwardRef(({className:e,...r},n)=>t.jsx(ho,{ref:n,className:S("fixed top-0 z-[150000] flex max-h-screen w-fitt flex-col-reverse p-4 sm:bottom-0 sm:left-1/2 -translate-x-1/2 sm:top-auto sm:flex-col md:min-w-[400px]",e),...r}));zc.displayName=ho.displayName;const B1=tn("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-bottom-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background",destructive:"destructive group border-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Vc=l.forwardRef(({className:e,variant:r,...n},s)=>t.jsx(t.Fragment,{children:t.jsx(go,{ref:s,className:S(B1({variant:r}),e),...n})}));Vc.displayName=go.displayName;const z1=l.forwardRef(({className:e,...r},n)=>t.jsx(xo,{ref:n,className:S("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...r}));z1.displayName=xo.displayName;const Hc=l.forwardRef(({className:e,...r},n)=>t.jsx(vo,{ref:n,className:S("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...r,children:t.jsx(rn,{className:"h-4 w-4"})}));Hc.displayName=vo.displayName;const Uc=l.forwardRef(({className:e,...r},n)=>t.jsx(bo,{ref:n,className:S("text-sm font-semibold",e),...r}));Uc.displayName=bo.displayName;const Gc=l.forwardRef(({className:e,...r},n)=>t.jsx(yo,{ref:n,className:S("text-sm opacity-90",e),...r}));Gc.displayName=yo.displayName;function Kc(){const{toasts:e}=gt();return t.jsxs(F1,{duration:3500,children:[e.map(function({id:r,title:n,description:s,action:a,...o}){return t.jsxs(Vc,{className:"flex justify-center text-brand-800 dark:text-brand-200",...o,children:[t.jsxs("div",{className:"grid gap-1",children:[n&&t.jsx(Uc,{children:n}),s&&t.jsx(Gc,{children:s})]}),a,t.jsx(Hc,{})]},r)}),t.jsx(zc,{})]})}const Fs=()=>{const{togglePerformance:e,setTogglePerformance:r}=he();return t.jsx(me,{text:"Toggle Sidebar",children:t.jsx("span",{className:"cursor-pointer",onClick:()=>{r(n=>!n)},children:e?t.jsx(Nm,{className:"rotate-90 xl:rotate-0 h-4 w-4 text-gray-500"}):t.jsx(Sm,{className:"rotate-90 xl:rotate-0 h-4 w-4 text-gray-500"})})})},V1=({children:e,uuid:r="random",className:n})=>{const s={hidden:{opacity:0,scale:.9},visible:{opacity:1,scale:1}};return t.jsx(Se.div,{initial:"hidden",animate:"visible",exit:"hidden",variants:s,className:n,children:e},r)},H1=({content:e,className:r})=>{const n=e==null?void 0:e.split(/\[(.*?)\]\((.*?)\)/);return t.jsx("div",{className:S("text-sm py-0 px-2",r),children:n==null?void 0:n.map((s,a)=>{if(a%3===1){const o=n[a+1];return t.jsx("a",{className:"text-purple-750/80 dark:text-brand-500",href:o,target:"_blank",rel:"noopener noreferrer",children:s},a)}else return a%3===0?t.jsx("span",{children:s},a):null})})},U1=e=>e==="css"||e==="cdn"?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1),qc=({audit:e,max:r=2,type:n,auditSettings:s,className:a,hideActions:o,children:i})=>{const{settings:d}=ce(ve),u=ot(),{activeTab:f,openCategory:m,openAudits:x}=xe();return n=si(e,n),s||(s=e.settings),l.useCallback((v,j,y)=>{u(_i(e,v,y,j))},[d]),t.jsx(t.Fragment,{children:s&&s.length>0&&t.jsxs("div",{className:S("flex flex-wrap gap-2 items-center",a),children:[i||"",s.filter(v=>n?v.category===n:!0).map((v,j)=>t.jsxs("div",{className:S("relative flex cursor-pointer gap-2 px-2 font-medium text-sm hover:bg-brand-100 dark:bg-brand-900 bg-brand-50 border w-fit rounded-xl items-center pr-2 py-1"),onClick:y=>{u(ae("openCategory",v.category)),u(ae("activeTab","configurations")),u(ae("activeMetric",null)),u(ae("auditsReturn",!0))},children:[t.jsx(b0,{className:S("h-6 w-6 text-gray-500")}),t.jsxs("span",{className:"normal-case",children:["Go ",m===v.category?"Back":""," to ",U1(v.category)," Settings"]})]}))]},s.join(","))})};var G1=function(r,n){for(var s=r.split("."),a=n.split("."),o=0;o<3;o++){var i=Number(s[o]),d=Number(a[o]);if(i>d)return 1;if(d>i)return-1;if(!isNaN(i)&&isNaN(d))return 1;if(isNaN(i)&&!isNaN(d))return-1}return 0};const K1=kr(G1),q1=tn("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Wc=l.forwardRef(({className:e,variant:r,...n},s)=>t.jsx("div",{ref:s,role:"alert",className:S(q1({variant:r}),e),...n}));Wc.displayName="Alert";const W1=l.forwardRef(({className:e,...r},n)=>t.jsx("h5",{ref:n,className:S("mb-1 font-medium leading-none tracking-tight",e),...r}));W1.displayName="AlertTitle";const Zc=l.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:S("text-sm [&_p]:leading-relaxed",e),...r}));Zc.displayName="AlertDescription";const Z1=({audit:e,group:r,open:n,setOpen:s,index:a})=>{var m,x;const o=typeof r.items[0].url!="string"&&((x=(m=r.items[0].url)==null?void 0:m.file_type)==null?void 0:x.label)||r.type;let i=l.useMemo(()=>{let v=o.toLowerCase();return v==="table"?"Additional Information":v==="unknown"?"Unattributable items":`${o} Files`},[r]);"grouped_items"in e.files&&e.files.grouped_items.length===1&&o.toLowerCase()==="unknown"&&(i="");let d=r.items;const u=d.filter(v=>!(v!=null&&v.passed))||[],f=d.filter(v=>v==null?void 0:v.passed)||[];return t.jsx(t.Fragment,{children:t.jsxs("div",{"data-tour":`${e.id}-file-group-${a}-header`,className:S("flex flex-col xl:flex-row justify-between xl:items-center gap-3 xl:gap-2 font-medium text-sm capitalize px-4 py-3",n&&"border-b"),children:[t.jsxs("div",{className:"flex gap-2 items-center px-2",children:[t.jsx("div",{className:"flex gap-2",children:t.jsx(me,{asChild:!0,text:`${n?"Hide":"Show"} ${i??i}`,children:t.jsxs("button",{className:"flex gap-2",onClick:v=>s(j=>!j),children:[n?t.jsx(zn,{className:"w-5 h-5 dark:text-brand-500 text-brand-900"}):t.jsx(El,{className:"w-5 h-5 dark:text-brand-500 text-brand-900"}),t.jsx("span",{children:i||"Related Resources"})]})})}),t.jsxs("div",{className:"opacity-50 text-xs",children:[u.length>0&&t.jsxs("span",{children:[u.length," Resource",u.length>1?"s":""]}),u.length>0&&f.length>0&&", ",f.length>0&&t.jsxs("span",{children:[f.length," Optimized Resource",f.length>1?"s":""]})]})]}),e.settings.length>0&&t.jsx("div",{"data-tour":`${e.id}-group-${a}-settings`,className:"flex flex-col gap-3 xl:px-4",children:t.jsx(qc,{type:r.type,audit:e})})]})})},X1=({id:e="auditContent",isOpen:r,initialRender:n=!1,children:s,onAnimationComplete:a,onHeightChange:o,className:i,...d})=>{const[u,f]=l.useState(!n),m=l.useRef(null),x={open:{height:"auto",opacity:1,overflow:"visible"},closed:{height:0,opacity:0,overflow:"hidden"}};return l.useEffect(()=>{f(!1)},[]),t.jsx(Ve,{mode:"wait",children:r&&t.jsx(Se.div,{ref:m,className:S("w-full",i),variants:x,transition:{duration:.1},initial:u?"open":"closed",animate:"open",exit:"closed",...d,children:s},e)})},ln=de.memo(X1),Y1=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],J1=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Q1=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],eg=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Ya=(e,r,n)=>{let s=e;return typeof r=="string"||Array.isArray(r)?s=e.toLocaleString(r,n):(r===!0||n!==void 0)&&(s=e.toLocaleString(void 0,n)),s};function Xc(e,r){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);r={bits:!1,binary:!1,space:!0,...r};const n=r.bits?r.binary?eg:Q1:r.binary?J1:Y1,s=r.space?" ":"";if(r.signed&&e===0)return` 0${s}${n[0]}`;const a=e<0,o=a?"-":r.signed?"+":"";a&&(e=-e);let i;if(r.minimumFractionDigits!==void 0&&(i={minimumFractionDigits:r.minimumFractionDigits}),r.maximumFractionDigits!==void 0&&(i={maximumFractionDigits:r.maximumFractionDigits,...i}),e<1){const m=Ya(e,r.locale,i);return o+m+s+n[0]}const d=Math.min(Math.floor(r.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(r.binary?1024:1e3)**d,i||(e=e.toPrecision(3));const u=Ya(Number(e),r.locale,i),f=n[d];return o+u+s+f}function tg(e){if(typeof e!="number")throw new TypeError("Expected a number");const r=e>0?Math.floor:Math.ceil;return{days:r(e/864e5),hours:r(e/36e5)%24,minutes:r(e/6e4)%60,seconds:r(e/1e3)%60,milliseconds:r(e)%1e3,microseconds:r(e*1e3)%1e3,nanoseconds:r(e*1e6)%1e3}}const rg=(e,r)=>r===1?e:`${e}s`,ng=1e-7;function sg(e,r={}){if(!Number.isFinite(e))throw new TypeError("Expected a finite number");r.colonNotation&&(r.compact=!1,r.formatSubMilliseconds=!1,r.separateMilliseconds=!1,r.verbose=!1),r.compact&&(r.secondsDecimalDigits=0,r.millisecondsDecimalDigits=0);const n=[],s=(i,d)=>{const u=Math.floor(i*10**d+ng);return(Math.round(u)/10**d).toFixed(d)},a=(i,d,u,f)=>{if((n.length===0||!r.colonNotation)&&i===0&&!(r.colonNotation&&u==="m"))return;f=(f||i||"0").toString();let m,x;if(r.colonNotation){m=n.length>0?":":"",x="";const v=f.includes(".")?f.split(".")[0].length:f.length,j=n.length>0?2:1;f="0".repeat(Math.max(0,j-v))+f}else m="",x=r.verbose?" "+rg(d,i):u;n.push(m+f+x)},o=tg(e);if(a(Math.trunc(o.days/365),"year","y"),a(o.days%365,"day","d"),a(o.hours,"hour","h"),a(o.minutes,"minute","m"),r.separateMilliseconds||r.formatSubMilliseconds||!r.colonNotation&&e<1e3)if(a(o.seconds,"second","s"),r.formatSubMilliseconds)a(o.milliseconds,"millisecond","ms"),a(o.microseconds,"microsecond","µs"),a(o.nanoseconds,"nanosecond","ns");else{const i=o.milliseconds+o.microseconds/1e3+o.nanoseconds/1e6,d=typeof r.millisecondsDecimalDigits=="number"?r.millisecondsDecimalDigits:0,u=i>=1?Math.round(i):Math.ceil(i),f=d?i.toFixed(d):u;a(Number.parseFloat(f),"millisecond","ms",f)}else{const i=e/1e3%60,d=typeof r.secondsDecimalDigits=="number"?r.secondsDecimalDigits:1,u=s(i,d),f=r.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");a(Number.parseFloat(f),"second","s",f)}if(n.length===0)return"0"+(r.verbose?" milliseconds":"ms");if(r.compact)return n[0];if(typeof r.unitCount=="number"){const i=r.colonNotation?"":" ";return n.slice(0,Math.max(r.unitCount,1)).join(i)}return r.colonNotation?n.join(""):n.join(" ")}const Yc=({className:e,children:r})=>t.jsx(me,{delay:0,text:t.jsx(t.Fragment,{children:r}),children:t.jsx(Ee,{className:S("w-2.5 fill-blue-500 stroke-0",e)})}),ag=()=>t.jsx(Yc,{className:"animate-pulse fill-orange-500",children:t.jsxs("span",{className:"flex gap-2 items-center",children:[" ",t.jsx(Hm,{className:"w-4 animate-spin text-orange-500"}),"Optimization in progress"]})}),og=({cell:e})=>{var m;let[r,n]=l.useState(!1);const[s,a]=l.useState(null),[o,i]=l.useState(null);let d=e.getValue().url?e.getValue().url:e.getValue();if(!d)return t.jsx(t.Fragment,{});const u=d.includes("images.rapidload-cdn.io");let f="";return((m=e.table.options.meta)==null?void 0:m.type)==="image"&&e.table.options.columns.find(x=>x.id==="node")&&(f=e.row.getValue("node")),l.useEffect(()=>(d&&u&&(async()=>{try{const v=await fetch(d);if(!v.ok)throw new Error("Failed to fetch image");const j=await v.blob(),y=URL.createObjectURL(j);i({redirected:v.redirected,status:v.status,statusText:v.statusText}),a(y),n(!0)}catch{a(d),n(!0)}})(),()=>{s&&URL.revokeObjectURL(s)}),[d]),t.jsxs("div",{className:"flex items-center gap-3",children:[(o==null?void 0:o.redirected)&&((o==null?void 0:o.status)===302||(o==null?void 0:o.status)===307)&&u&&t.jsx(ag,{}),t.jsxs(Qr,{children:[t.jsx(en,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-6 h-6",children:t.jsx("div",{style:{backgroundImage:`url(${s||d})`},className:"w-6 h-6 bg-cover bg-center border rounded-md overflow-hidden"})}),d&&t.jsxs("a",{className:"text-left",target:"_blank",href:d,children:[t.jsx("span",{children:fr(d,40)}),t.jsx("span",{children:t.jsx(ur,{className:"ml-1.5 inline-block w-3.5"})})]})]})}),t.jsx(Jt,{className:"max-w-[768px] min-w-[32px] min-h-[32px]",children:t.jsxs("div",{className:"flex flex-row items-center gap-3 py-1",children:[t.jsxs("div",{className:"relative",children:[t.jsx("img",{alt:d,onError:()=>n(!0),onLoadCapture:()=>n(!0),className:"max-w-[160px]",src:s||d}),!r&&t.jsx("div",{className:"absolute left-1/2 -translate-y-1/2 top-1/2 -translate-x-1/2",children:t.jsx(Em,{className:"animate-spin text-purple-750 w-6"})})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{children:[(f==null?void 0:f.nodeLabel)!==(f==null?void 0:f.selector)&&t.jsx("span",{className:"ml-2 mb-2",children:d==null?void 0:d.nodeLabel}),t.jsx(Zt,{lang:"jsx",code:f==null?void 0:f.selector})]}),t.jsx(Zt,{code:f==null?void 0:f.snippet})]})]})})]})]})},ig=({audit:e,cell:r,heading:n})=>{var o;let s=r.getValue(),a=!1;return r.table.options.columns.find(i=>i.id==="passed")&&(a=r.row.getValue("passed")),!s.toString().startsWith("data:image")&&(ni(e.id)||((o=s==null?void 0:s.file_type)==null?void 0:o.value)==="image")?t.jsx(og,{cell:r}):jp(s)?t.jsxs("a",{className:"text-left",target:"_blank",href:s,children:[t.jsx("span",{children:fr(s,60)}),t.jsx(ur,{className:"w-4 inline-block ml-2"})]}):typeof s=="object"&&typeof(s==null?void 0:s.url)=="string"?t.jsxs("a",{className:"text-left inline-flex items-center align-middle",target:"_blank",href:s.url,children:[a&&t.jsx("span",{className:"inline-flex gap-1 mr-1",children:t.jsx(me,{text:"Successfully Optimized file",children:t.jsx(Be,{className:"w-5 inline-block text-green-600"})})}),t.jsxs("span",{className:"items-center gap-2",children:[fr(s.url,60)," ",t.jsx(ur,{className:"w-4 inline-block -mt-0.5"})]})]}):t.jsx("span",{children:s})},Jc=qu,Qc=Wu,ed=Zu,Bs=l.forwardRef(({className:e,children:r,...n},s)=>t.jsxs(wo,{ref:s,className:S("flex h-10 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[r,t.jsx(Hu,{asChild:!0,children:t.jsx(Ri,{className:"h-4 w-4 opacity-50"})})]}));Bs.displayName=wo.displayName;const zs=l.forwardRef(({className:e,children:r,position:n="popper",...s},a)=>t.jsx(jo,{ref:a,className:S("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:t.jsx(Uu,{className:S("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})}));zs.displayName=jo.displayName;const Vs=l.forwardRef(({className:e,...r},n)=>t.jsx(_o,{ref:n,className:S("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...r}));Vs.displayName=_o.displayName;const Hs=l.forwardRef(({className:e,children:r,...n},s)=>t.jsxs(Co,{ref:s,className:S("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Gu,{children:t.jsx(Ei,{className:"h-4 w-4"})})}),t.jsx(Ku,{children:r})]}));Hs.displayName=Co.displayName;const lg=l.forwardRef(({className:e,...r},n)=>t.jsx(No,{ref:n,className:S("-mx-1 my-1 h-px bg-muted",e),...r}));lg.displayName=No.displayName;const cg=({audit:e,heading:r,cell:n})=>{var X;const{getValue:s,row:a}=n;let o=a.getValue("url"),i=s();const{data:d,settings:u,changes:f}=ce(ve);let m=f?f.files.filter(z=>z.file===o.url).map(z=>z.value):[];const x=(X=o==null?void 0:o.file_type)==null?void 0:X.value,v=l.useMemo(()=>{var z,A;return(A=(z=d==null?void 0:d.meta)==null?void 0:z.controls.dropdown_options.filter(D=>D.type==x)[0])==null?void 0:A.options},[d,x]);if((i==null?void 0:i.control_type)!=="dropdown"||!i)return t.jsx("span",{});const j=ot(),[y,w]=l.useState(i.value||"none"),_=l.useCallback(z=>{let A=y;w(z),j(mm(e,o.url?o.url:o,z,A))},[y,e,o,j]),M=z=>{switch(z){case"none":return"No Action";default:return z}},T=l.useCallback((z,A)=>{if(["javascript","js"].includes(A)){let D=u==null?void 0:u.find(U=>U.name==="Defer Javascript");if(D!=null&&D.inputs[0].value)return y==="defer"&&_("none"),z.filter(U=>U!=="defer")}return z},[u,y,_]),L=l.useMemo(()=>{const z=T(v,x);return z==null?void 0:z.map(A=>t.jsx(Hs,{className:"capitalize cursor-pointer",value:A,children:M(A)},A))},[v,x,y,u]),$=l.useCallback(()=>{m!=null&&m.length&&_(m[0])},[m,_]);return v?t.jsxs("div",{"data-tour":`${e.id}-file-action-${a.index}`,className:"relative",children:[m&&m.length>0&&m[0]!==m[m.length-1]&&t.jsx("span",{className:"absolute -left-4 top-2",children:t.jsx(me,{delay:0,text:t.jsxs("span",{className:"flex gap-2 items-center",children:["This action has been changed",t.jsxs("button",{onClick:$,className:"flex gap-2 border px-2 hover:bg-brand-100 dark:hover:bg-brand-800 rounded-xl text-xs items-center",children:[t.jsx(Jm,{className:"w-4 text-blue-500"})," Reset"]})]}),children:t.jsx(Ee,{className:"w-2 fill-blue-500 stroke-0"})})}),t.jsxs(Jc,{value:y,onValueChange:_,children:[t.jsx(Bs,{className:"w-[180px] capitalize",children:t.jsx(ed,{placeholder:"Select action"})}),t.jsx(zs,{"data-tour":`${e.id}-file-action-${a.index}-content`,className:"z-[100001]",children:t.jsxs(Qc,{children:[t.jsx(Vs,{children:"Actions"}),L]})})]})]}):t.jsx(t.Fragment,{})},dg=({cell:e,heading:r})=>{var o,i,d,u;let n=e.getValue(),s=((i=(o=e.row.original)==null?void 0:o.subItems)==null?void 0:i.items[0])||{};if(!n)return t.jsx(t.Fragment,{});let a=n.snippet;return t.jsxs("div",{className:"text-xs p-3",children:[t.jsxs(Qr,{children:[t.jsx(en,{className:"w-full",children:t.jsx(Zt,{code:a})}),t.jsxs(Jt,{className:"flex flex-col",children:[(n==null?void 0:n.nodeLabel)!==(n==null?void 0:n.selector)&&t.jsx("span",{className:"ml-2 mb-2",children:n==null?void 0:n.nodeLabel}),t.jsx(Zt,{lang:"css",code:n==null?void 0:n.selector})]})]}),((d=r==null?void 0:r.subItemsHeading)==null?void 0:d.key)&&((u=r==null?void 0:r.subItemsHeading)==null?void 0:u.key)in s&&t.jsx("div",{className:"px-2 pt-2 min-w-max",children:s[r.subItemsHeading.key]})]})},ug=({cell:e})=>{let r=e.getValue();return t.jsx("div",{children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("a",{target:"_blank",className:"hover:text-purple-750",href:r.url,children:r.url}),t.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsx("span",{className:"opacity-90 text-blue-800 dark:text-brand-400 text-xs capitalize",children:r.urlProvider}),t.jsx(Ee,{className:"w-1.5 fill-brand-600 stroke-none"}),t.jsxs("span",{className:"opacity-90 text-xs",children:[t.jsx("span",{className:"text-blue-800 dark:text-brand-400",children:"Code Location :"})," Line ",r.line,", Column ",r.column]})]})]})})},fg=({audit:e,heading:r,cell:n})=>{var o,i,d,u;let s=n.getValue(),a=((i=(o=n.row.original)==null?void 0:o.subItems)==null?void 0:i.items[0])||{};return!s&&a?t.jsx(t.Fragment,{children:((d=r==null?void 0:r.subItemsHeading)==null?void 0:d.key)&&((u=r==null?void 0:r.subItemsHeading)==null?void 0:u.key)in a&&t.jsx("div",{className:"px-2 pt-2 text-brand-500 dark:text-brand-300 min-w-max",children:a[r.subItemsHeading.key]})}):s?r.valueType==="url"?t.jsx(ig,{heading:r,audit:e,cell:n}):r.valueType==="controls"?t.jsx(cg,{cell:n,audit:e,heading:r}):r.valueType==="bytes"?t.jsx("span",{children:Xc(s)}):["ms","timespanMs"].includes(r.valueType)?t.jsx("span",{children:sg(n.getValue())}):r.valueType==="node"?t.jsx(dg,{heading:r,cell:n}):r.valueType==="numeric"&&typeof s=="number"?t.jsx("span",{children:_p(s,r.granularity)}):r.valueType==="numeric"&&typeof s=="object"?t.jsx("span",{children:s.value}):r.valueType==="source-location"?t.jsx(ug,{cell:n}):typeof s=="object"?t.jsx("span",{children:JSON.stringify(s)}):r.valueType==="text"?t.jsx("span",{children:s}):t.jsx("span",{children:JSON.stringify(s)}):t.jsx(t.Fragment,{})},pg=(e,r,n,s)=>{const a=Yu(),o=`table_${e.id}`,i=l.useMemo(()=>r.map(f=>(f.key=f.key?f.key:f.label?f.label.toLowerCase():"no-key",a.accessor(m=>m[f.key],{id:f.key,meta:f,cell:m=>t.jsx(fg,{audit:e,heading:f,cell:m}),header:()=>t.jsx("span",{children:f.label}),enableHiding:!0}))),[r,e,a]),d=l.useMemo(()=>{let f={pattern:!1,file_type:!1,passed:!1};ni(e.id)&&(f.node=!1);const m=n.flatMap(v=>Object.entries(v).filter(([j,y])=>y===""||typeof y=="object"&&Object.keys(y).length===0).map(([j])=>j));let x=Object.keys(n[0]);return x.includes("subItems")||(i.filter(v=>!x.includes(v.id?v.id:"")).forEach(v=>{v.id&&(f[v.id]=!1)}),m.forEach(v=>f[v]=!1)),f},[e.id,i,n]);return[Xu({data:n,columns:i,getCoreRowModel:Ju(),getPaginationRowModel:Qu(),meta:{tableId:o,type:s},initialState:{pagination:{pageSize:5},columnVisibility:d},autoResetPageIndex:!1})]},mg=({audit:e,group:r,index:n})=>{var o,i;if(!((o=r==null?void 0:r.items)!=null&&o.length))return t.jsx(t.Fragment,{});const s=d=>{switch(d){case"timespanMs":case"ms":return"160px";case"bytes":return"140px";case"controls":return"200px";default:return"auto"}},[a]=pg(e,(r.headings?r.headings:(i=e==null?void 0:e.files)==null?void 0:i.headings)||[],r.items,r.type);return t.jsxs("div",{"data-tour":`${e.id}-group-${n}-table`,className:"px-4 py-3",children:[t.jsx("div",{className:"w-full border rounded-[20px] overflow-hidden",children:t.jsxs("table",{className:"w-full dark:text-brand-300 text-brand-800",children:[t.jsx("thead",{children:a==null?void 0:a.getHeaderGroups().map(d=>t.jsx("tr",{children:d.headers.map(u=>t.jsx("th",{className:"first:pl-6 px-2 py-3 dark:bg-brand-900 bg-brand-100 font-medium text-xs text-left",children:u.isPlaceholder?null:Ca(u.column.columnDef.header,u.getContext())},u.id))},d.id))}),t.jsx("tbody",{children:a==null?void 0:a.getRowModel().rows.map(d=>t.jsx("tr",{className:S(),children:d.getVisibleCells().map(u=>{var f;return t.jsx("td",{style:{width:s((f=u.column.columnDef.meta)==null?void 0:f.valueType)},className:S("first:pl-4 py-2 border-t px-2 text-sm h-[50px] items-center"),children:Ca(u.column.columnDef.cell,u.getContext())},u.id)})},d.id))})]})}),a.getPageCount()>1&&t.jsx("div",{className:"w-full flex justify-end pb-0 py-2",children:t.jsxs("ul",{className:"flex gap-1 items-center",children:[t.jsx("li",{onClick:d=>{a.previousPage()},className:S("disabled:opacity-30 hover:bg-brand-100 px-3 py-1 cursor-pointer rounded text-xs",!a.getCanPreviousPage()&&"opacity-30 cursor-no-drop"),children:t.jsx(km,{className:"w-4"})}),[...Array(a.getPageCount())].map((d,u)=>t.jsx("li",{className:S("dark:hover:bg-brand-700 hover:bg-brand-100 border px-3 py-1.5 cursor-pointer rounded text-xs",a.getState().pagination.pageIndex===u?"dark:bg-brand-600 bg-brand-200":""),onClick:()=>{a.setPageIndex(f=>u)},children:u+1},u)),t.jsx("li",{onClick:d=>{a.getCanNextPage()&&a.nextPage()},className:S("disabled:opacity-30 hover:bg-brand-100 px-3 py-1 cursor-pointer rounded text-xs",!a.getCanNextPage()&&"opacity-30 cursor-no-drop"),children:t.jsx(Mi,{className:"w-4"})})]})})]})},hg=de.memo(mg),Ja=({audit:e,index:r,group:n,type:s="table"})=>{const[a,o]=l.useState(s==="table"&&r===0||s==="list");return t.jsxs("div",{"data-tour":`${e.id}-group-${r}`,className:S("flex flex-col",s=="table"&&"border-t"),children:[s=="table"&&t.jsx("div",{className:S("flex flex-col gap-3 justify-center "),children:t.jsx(Z1,{index:r,audit:e,open:a,setOpen:o,group:n})}),t.jsx(ln,{isOpen:a,children:t.jsx(hg,{index:r,group:n,audit:e})})]})},td=({node:e,isLastChild:r=!1,isRoot:n=!1})=>t.jsxs("div",{className:"relative pl-6",children:[!n&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"absolute top-0 left-2 h-3 border-l border-gray-300"}),t.jsx("div",{className:"absolute top-3 left-2 w-3 border-t border-gray-300"})]}),e.children&&!n&&t.jsx("div",{className:"absolute top-2.5 left-2 h-full border-l border-gray-300"}),!r&&!n&&t.jsx("div",{className:"absolute top-2.5 left-2 h-full border-l border-gray-300"}),t.jsx("div",{className:" mb-1",children:t.jsxs("a",{href:e.request.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex gap-1 text-xs text-brand-700 hover:text-purple-750",children:[t.jsxs("span",{children:[" ",fr(e.request.url,50,!1)]}),t.jsx("span",{className:"text-brand-400",children:Xc(e.request.transferSize)})]})}),e.children&&t.jsx("div",{children:Object.entries(e.children).map(([s,a],o,i)=>t.jsx(td,{node:a,isLastChild:o===i.length-1},a.request.url))})]}),gg=({data:e})=>t.jsx("div",{className:"p-4",children:t.jsx(td,{node:e,isRoot:!0})}),xg={"server-response-time":[t.jsxs(t.Fragment,{children:["Time spent should be less than ",t.jsx("span",{className:"text-brand-700 dark:text-brand-200",children:"600ms"}),"."]})],"dom-size":[t.jsxs(t.Fragment,{children:["Keep the number of DOM elements in the body section under ",t.jsx("span",{className:"text-brand-700 dark:text-brand-200",children:"800"}),"."]})]},vg=({audit:e,setHelpOpen:r})=>t.jsx(t.Fragment,{children:t.jsxs("div",{className:"absolute flex flex-col gap-3 bottom-0 w-full h-fit px-6 py-4 bg-brand-50 border z-50 rounded-3xl",children:[t.jsxs("div",{className:"flex items-center justify-between border-b pb-2",children:[t.jsx("h2",{className:"font-normal",children:"Why this audit is still not being resolved?"}),t.jsx("button",{onClick:n=>r(!1),children:t.jsx(rn,{className:"text-brand-500 w-5 h-5"})})]}),t.jsxs("div",{className:"py-2 px-2 text-sm",children:["This could be due to one or more of the following reasons",t.jsx("ul",{className:"list-disc pl-6 mt-1 text-brand-700/80",children:t.jsx("li",{children:"You have server-side caching on your website. Clear the server-side cache."})})]})]})}),rd=({audit:e,helpOpen:r,setHelpOpen:n})=>{var i,d,u,f,m,x,v,j;const{options:s}=he();let a=l.useMemo(()=>e.settings.filter(y=>{var w,_;return!((_=(w=e.files)==null?void 0:w.grouped_items)!=null&&_.map(M=>si(e,M.type)).includes(y.category))}),[]),o=l.useMemo(()=>xg[e.id]||[],[]);return t.jsxs("div",{className:"relative border-t w-full pt-4",children:[r&&t.jsx(vg,{setHelpOpen:n,audit:e}),t.jsx("div",{className:"pb-4 text-brand-700 dark:text-brand-300",children:t.jsxs("div",{className:"px-4 ml-2",children:[t.jsx(H1,{content:e.description}),K1(s.rapidload_version,"2.1.14")===1&&["bootup-time","unused-javascript"].includes(e.id)&&e.type==="passed_audit"&&t.jsxs(Wc,{className:"mt-4 flex items-center gap-2",children:[t.jsx("div",{children:t.jsx(Fm,{className:"h-5 w-5 text-blue-500"})}),t.jsxs(Zc,{className:"flex items-center gap-1",children:["You can exclude delayed javascript files using ",t.jsxs("span",{className:"flex items-center text-brand-900 font-medium",children:["RapidLoad dashboard ",t.jsx(ki,{className:"w-4"})," Javascript"]})]})]}),o.length>0&&t.jsx("ul",{className:"px-3 mt-2 flex text-sm gap-3 text-brand-500 dark:text-brand-400",children:o.map((y,w)=>y&&t.jsxs("li",{className:"flex gap-1.5 items-center",children:[t.jsx(Ee,{className:"w-2 stroke-none mt-[1px] fill-brand-300 dark:fill-brand-700"})," ",t.jsx("span",{children:y})]},w))})]})}),e.settings.length>0&&a.length>0&&t.jsx("div",{className:"border-t py-4 px-4",children:t.jsxs("div",{"data-tour":`${e.id}-recommended-settings`,className:"w-fit flex flex-col gap-3",children:[t.jsx("div",{className:"font-medium text-sm ml-2",children:e.settings.length!==a.length?"Additional Settings":"Recommended Settings"}),t.jsx(qc,{audit:e,auditSettings:a})]})}),((i=e.files)==null?void 0:i.type)==="criticalrequestchain"&&t.jsx("div",{className:"border-t",children:t.jsx(gg,{data:(d=e.files)==null?void 0:d.chains[Object.keys(e.files.chains)[0]]})}),(((u=e.files)==null?void 0:u.type)==="opportunity"||((f=e.files)==null?void 0:f.type)==="table")&&((x=(m=e.files)==null?void 0:m.grouped_items)==null?void 0:x.map((y,w)=>t.jsx(Ja,{index:w,audit:e,group:y},w))),((v=e.files)==null?void 0:v.type)==="list"&&t.jsx(t.Fragment,{children:(j=e.files)==null?void 0:j.items.map((y,w)=>{var _;return(y==null?void 0:y.type)==="table"&&((_=y.items)==null?void 0:_.length)>0&&t.jsx(Ja,{index:w,audit:e,group:y,type:"list"},w)})})]})};rd.displayName="AuditContent";const bg=l.forwardRef(({audit:e,index:r,actions:n=!0,metrics:s=!0},a)=>{var M,T,L,$,X,z;ce(ve);const{dispatch:o,openAudits:i}=xe();l.useState(!1),l.useState(!1);const[d,u]=l.useState(!1),f=((T=(M=e.files)==null?void 0:M.items)==null?void 0:T.length)>0||e.settings.length>0,m=l.useRef(null),x=nf(m,{once:!0});if(!(e!=null&&e.id))return t.jsx(t.Fragment,{});const v=l.useMemo(()=>i.includes(e.id),[i]),j=l.useCallback(()=>{const D=i.includes(e.id)?i.filter(U=>U!==e.id):[...i,e.id];o(ae("openAudits",D))},[i]);let y=e.icon;e.type==="passed_audit"&&(y="pass");const w=()=>{var Q,Y;const A=((Y=(Q=e.files)==null?void 0:Q.items)==null?void 0:Y.length)||0,D=e.settings.length||0;if(A===0&&D===0)return"";let U="";return D>0&&(U+=` ${D} ${D===1?"Action":"Actions"}`),A>0&&(D>0&&(U+=", "),U+=` ${A} ${A===1?"Resource":"Resources"}`),`${U}`},_=l.useMemo(()=>e.settings.filter(A=>A.inputs[0].value),[e.settings]);return l.useMemo(()=>e.metrics.reduce((A,D)=>D.potentialGain+A,0),[e.metrics]),t.jsx("div",{id:`audit-${e.id}`,className:"w-full scroll-m-28",ref:m,children:t.jsx(Ve,{children:x&&t.jsx(Se.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:(r||1)*.005},className:"relative w-full",children:t.jsxs(it,{"data-tour":`audit-${e.id}`,spreader:!!(($=(L=e==null?void 0:e.files)==null?void 0:L.items)!=null&&$.length)&&!v,className:S("overflow-hidden w-full flex justify-center flex-col items-center p-0",v?"shadow-lg dark:shadow-brand-800/30":"dark:hover:border-brand-700/70 hover:border-brand-400/60"),children:[t.jsxs("div",{className:S("min-h-[56px] relative flex justify-between w-full py-2 px-4"),children:[t.jsxs("div",{className:"flex gap-3 font-normal items-center text-base",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-7 h-7 rounded-full dark:bg-brand-700 bg-brand-200/50",children:e.scoreDisplayMode==="informative"?t.jsx("span",{className:"w-3 h-3 border-2 border-brand-400/60 rounded-full"}):t.jsx(Wt,{icon:y})}),t.jsxs("div",{className:"flex flex-col justify-around",children:[t.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.name,s&&e.metrics&&t.jsx("div",{className:"flex gap-1.5 text-xxs",children:e.metrics.map((A,D)=>t.jsx("div",{children:(e.type!=="passed_audit"||e.scoreDisplayMode!=="informative")&&A.potentialGain>0?t.jsx(me,{asChild:!0,text:e.type!=="passed_audit"&&e.scoreDisplayMode!=="informative"&&A.potentialGain>0&&`Potential +${A.potentialGain.toFixed(0)} Score Boost`,children:t.jsxs("div",{className:S("transition-colors flex gap-1 cursor-default hover:bg-brand-100 dark:hover:bg-brand-800 border py-1 px-1.5 rounded-md"),children:[A.refs.acronym,e.type!=="passed_audit"&&e.scoreDisplayMode!=="informative"&&A.potentialGain>0&&t.jsx(t.Fragment,{children:A.potentialGain>=.5&&t.jsxs("span",{className:S("text-green-800"),children:[" +",A.potentialGain.toFixed(0)]})})]},A.id)}):t.jsxs("div",{className:S("transition-colors flex gap-1 cursor-default hover:bg-brand-100 dark:hover:bg-brand-800 border py-1 px-1.5 rounded-md"),children:[A.refs.acronym,t.jsx(t.Fragment,{children:A.potentialGain>=.5&&t.jsxs("span",{className:S("text-green-800"),children:[" +",A.potentialGain.toFixed(0)]})})]},A.id)},D))}),_.length>0&&!v&&t.jsx(me,{delay:0,text:t.jsxs("span",{className:"text-sm text-center",children:[_.length," Active Action",_.length>1?"s":""]}),className:"flex flex-col border gap-2 bg-white dark:bg-brand-950 rounded-lg py-2 px-2",children:t.jsxs("div",{onClick:()=>j(),className:S("cursor-pointer select-none text-xs text-brand-700 dark:text-brand-500 hover:bg-brand-100 dark:hover:bg-brand-800 transition-colors items-center flex gap-1.5 rounded-2xl",_.length>1&&"border py-0.5 px-2"),children:[_.length>1?_.length:"",t.jsx("div",{className:"bg-blue-500 w-1.5 h-1.5 shadow-lg rounded-full -right-1 -top-1"})]})})]}),t.jsxs("span",{className:"flex text-xxs leading-tight opacity-70",children:[e.displayValue&&t.jsx("span",{children:e.displayValue}),Dn]})]})]}),t.jsxs("div",{className:"flex gap-3 items-center",children:[!v&&(((z=(X=e.files)==null?void 0:X.items)==null?void 0:z.length)>0||e.settings.length>0)&&t.jsx("div",{className:"text-xs opacity-50",children:w()}),n&&t.jsx(me,{text:f?"Show resources and actions":"Learn more about this audit",children:t.jsxs("div",{"data-tour":r===0?"audits-show-actions":void 0,onClick:()=>j(),className:`min-w-[125px] cursor-pointer flex items-center gap-2 pl-4 pr-2 py-1.5 text-sm rounded-2xl dark:hover:bg-brand-800 hover:bg-brand-100 transition-colors ${v?" dark:bg-brand-900 border ":"border "}`,children:[f?v?"Hide Actions":"Show Actions":"Learn More",f?v?t.jsx(zn,{className:"w-6 h-6 dark:text-brand-500 text-brand-900"}):t.jsx(El,{className:"w-6 h-6 dark:text-brand-500 text-brand-900"}):v?t.jsx(zn,{className:"w-6 h-6 dark:text-brand-500 text-brand-900"}):t.jsx(R1,{className:"w-6 h-6 dark:text-brand-500 text-brand-900"})]})})]})]}),t.jsx(ln,{id:e.id,className:"audit-content",initialRender:!0,isOpen:v,children:t.jsx(rd,{helpOpen:d,setHelpOpen:u,audit:e})})]})},e.id)})})}),nd=de.memo(bg),yg=()=>t.jsx(it,{spreader:!1,children:t.jsxs("div",{className:"w-full flex justify-between px-4 py-3 rounded-3xl text-center bg-white h-14",children:[t.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsx("div",{className:"bg-brand-100 w-7 h-7 rounded-full animate-pulse"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:"flex gap-1",children:[t.jsx("div",{className:"bg-brand-100 w-64 h-6 rounded-lg animate-pulse"}),t.jsx("div",{className:"bg-brand-100 w-12 h-6 rounded-2xl border border-brand-200/50 animate-pulse"})]}),t.jsx("div",{className:"bg-brand-100 w-52 h-2 rounded-lg"})]})]}),t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx("div",{className:"bg-brand-100 w-16 h-3 rounded-2xl"}),t.jsx("div",{className:"bg-brand-100 w-16 h-3 rounded-2xl"})]}),t.jsx("div",{className:"bg-brand-100 w-36 h-full rounded-2xl animate-pulse border"})]})]})}),wg=({activeTab:e})=>{const{data:r,loading:n,reanalyze:s,error:a}=ce(ve),o=l.useMemo(()=>r?(r==null?void 0:r.grouped)[e]||[]:[],[e,r]);return t.jsx(Ve,{initial:!1,children:n&&!s?new Array(5).fill(null).map((i,d)=>t.jsx(Se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:d*.05},className:"relative",children:t.jsx(yg,{},d)},`${d}-${e}`)):o.map((i,d)=>t.jsx("div",{children:t.jsx(Se.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{delay:d*.005},className:"relative",children:t.jsx(nd,{index:d,audit:i})},d)},i.id))})},jg=de.memo(wg),_g=({cls:e})=>t.jsxs("svg",{className:`${e}`,width:"84",height:"75",viewBox:"0 0 74 65",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.7568 64.6651C49.946 63.7025 63.2062 49.2644 62.224 32.4198C62.0603 29.6926 61.5691 27.1258 60.7506 24.559L60.2595 24.8799C61.078 27.4467 61.5691 30.1739 61.5691 32.9011C61.5691 47.6601 49.2912 59.5315 34.2302 59.5315C33.7391 59.5315 33.248 59.5315 32.7568 59.5315V64.6651Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.41602 51.3504C10.982 59.3716 20.1496 64.3448 29.972 64.6656V59.2112C22.2778 57.9278 15.7295 54.5589 11.4731 47.9815L5.41602 51.3504Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.63385 20.3886C-1.2951 29.6932 -0.803979 40.1208 3.9435 48.9441L10.1643 45.4148C7.05392 38.8374 7.21763 31.2974 10.6555 24.8805L2.63385 20.3886Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.9723 0.335922C18.8403 1.61932 9.0179 8.19671 3.7793 17.8222L11.9646 22.4745C16.0573 16.5388 22.6055 12.849 29.8086 12.3677V0.335922H29.9723Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.9117 13.1694C54.1998 4.66694 43.7226 -0.306215 32.918 0.0146335V12.2069C38.8114 12.5277 44.2137 14.7737 48.4701 18.7843L60.9117 13.1694Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.4475 29.3722C34.5579 29.3722 37.1772 31.7785 37.1772 34.987C37.1772 38.0351 34.7216 40.6019 31.4475 40.6019C28.3371 40.6019 25.7178 38.1955 25.7178 34.987C25.7178 31.9389 28.3371 29.3722 31.4475 29.3722Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.4615 14.7733L50.436 26.1635L33.4106 37.3931L31.9372 34.8264L30.4639 32.2596L48.9627 23.5967L67.4615 14.7733Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M73.1907 11.7255L68.4433 16.5382H68.2795L68.1158 16.3778C67.9521 15.7361 67.7884 15.0944 67.461 14.6131C67.1336 14.1319 66.8062 13.6506 66.3151 13.1693C66.1514 13.1693 66.1514 13.0089 66.1514 12.8485C66.1514 12.8485 66.1514 12.8485 66.3151 12.688L73.027 11.0838C73.1907 11.0838 73.1907 11.0838 73.1907 11.2442C73.3544 11.5651 73.3544 11.7255 73.1907 11.7255Z",fill:"#673B9B"})]}),Cg=({cls:e})=>t.jsxs("svg",{className:`${e}`,width:"84",height:"75",viewBox:"0 0 74 65",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.7568 64.6651C49.946 63.7025 63.2062 49.2644 62.224 32.4198C62.0603 29.6926 61.5691 27.1258 60.7506 24.559L60.2595 24.8799C61.078 27.4467 61.5691 30.1739 61.5691 32.9011C61.5691 47.6601 49.2912 59.5315 34.2302 59.5315C33.7391 59.5315 33.248 59.5315 32.7568 59.5315V64.6651Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.41602 51.3504C10.982 59.3716 20.1496 64.3448 29.972 64.6656V59.2112C22.2778 57.9278 15.7295 54.5589 11.4731 47.9815L5.41602 51.3504Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.63385 20.3886C-1.2951 29.6932 -0.803979 40.1208 3.9435 48.9441L10.1643 45.4148C7.05392 38.8374 7.21763 31.2974 10.6555 24.8805L2.63385 20.3886Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.9723 0.335922C18.8403 1.61932 9.0179 8.19671 3.7793 17.8222L11.9646 22.4745C16.0573 16.5388 22.6055 12.849 29.8086 12.3677V0.335922H29.9723Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.9117 13.1694C54.1998 4.66694 43.7226 -0.306215 32.918 0.0146335V12.2069C38.8114 12.5277 44.2137 14.7737 48.4701 18.7843L60.9117 13.1694Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.4475 29.3722C34.5579 29.3722 37.1772 31.7785 37.1772 34.987C37.1772 38.0351 34.7216 40.6019 31.4475 40.6019C28.3371 40.6019 25.7178 38.1955 25.7178 34.987C25.7178 31.9389 28.3371 29.3722 31.4475 29.3722Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.4615 14.7733L50.436 26.1635L33.4106 37.3931L31.9372 34.8264L30.4639 32.2596L48.9627 23.5967L67.4615 14.7733Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M73.1907 11.7255L68.4433 16.5382H68.2795L68.1158 16.3778C67.9521 15.7361 67.7884 15.0944 67.461 14.6131C67.1336 14.1319 66.8062 13.6506 66.3151 13.1693C66.1514 13.1693 66.1514 13.0089 66.1514 12.8485C66.1514 12.8485 66.1514 12.8485 66.3151 12.688L73.027 11.0838C73.1907 11.0838 73.1907 11.0838 73.1907 11.2442C73.3544 11.5651 73.3544 11.7255 73.1907 11.7255Z",fill:"#673B9B"})]}),Ng=({cls:e})=>t.jsxs("svg",{className:`${e}`,width:"84",height:"75",viewBox:"0 0 74 65",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.7568 64.6651C49.946 63.7025 63.2062 49.2644 62.224 32.4198C62.0603 29.6926 61.5691 27.1258 60.7506 24.559L60.2595 24.8799C61.078 27.4467 61.5691 30.1739 61.5691 32.9011C61.5691 47.6601 49.2912 59.5315 34.2302 59.5315C33.7391 59.5315 33.248 59.5315 32.7568 59.5315V64.6651Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.41602 51.3504C10.982 59.3716 20.1496 64.3448 29.972 64.6656V59.2112C22.2778 57.9278 15.7295 54.5589 11.4731 47.9815L5.41602 51.3504Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.63385 20.3886C-1.2951 29.6932 -0.803979 40.1208 3.9435 48.9441L10.1643 45.4148C7.05392 38.8374 7.21763 31.2974 10.6555 24.8805L2.63385 20.3886Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.9723 0.335922C18.8403 1.61932 9.0179 8.19671 3.7793 17.8222L11.9646 22.4745C16.0573 16.5388 22.6055 12.849 29.8086 12.3677V0.335922H29.9723Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.9117 13.1694C54.1998 4.66694 43.7226 -0.306215 32.918 0.0146335V12.2069C38.8114 12.5277 44.2137 14.7737 48.4701 18.7843L60.9117 13.1694Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.4475 29.3722C34.5579 29.3722 37.1772 31.7785 37.1772 34.987C37.1772 38.0351 34.7216 40.6019 31.4475 40.6019C28.3371 40.6019 25.7178 38.1955 25.7178 34.987C25.7178 31.9389 28.3371 29.3722 31.4475 29.3722Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.4615 14.7733L50.436 26.1635L33.4106 37.3931L31.9372 34.8264L30.4639 32.2596L48.9627 23.5967L67.4615 14.7733Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M73.1907 11.7255L68.4433 16.5382H68.2795L68.1158 16.3778C67.9521 15.7361 67.7884 15.0944 67.461 14.6131C67.1336 14.1319 66.8062 13.6506 66.3151 13.1693C66.1514 13.1693 66.1514 13.0089 66.1514 12.8485C66.1514 12.8485 66.1514 12.8485 66.3151 12.688L73.027 11.0838C73.1907 11.0838 73.1907 11.0838 73.1907 11.2442C73.3544 11.5651 73.3544 11.7255 73.1907 11.7255Z",fill:"#5B3786"})]}),Sg=34,kg=34,Lt=({children:e,bg:r="transparent"})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Sg,height:kg,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:r}),e]}),Eg=()=>t.jsx(Lt,{children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 7.00689H8.07C7.53 7.00689 7.25 7.00689 7.16 7.16689C7.02665 7.35185 6.96938 7.58094 7 7.80689C7.00646 8.36465 6.97975 8.9223 6.92 9.47689C6.88923 9.73554 6.81127 9.98636 6.69 10.2169C6.52022 10.4949 6.28285 10.7254 6 10.8869C6.28821 11.0502 6.52669 11.2887 6.69 11.5769C6.85676 11.9408 6.94208 12.3366 6.94 12.7369L7 14.2969C7.00825 14.3648 7.03221 14.4299 7.07 14.4869C7.10698 14.5458 7.15868 14.5941 7.22 14.6269C7.48081 14.7409 7.76757 14.7824 8.05 14.7469H9.5V7.00689ZM11.9 14.7469H13.31C13.89 14.7469 14.11 14.7469 14.22 14.5969C14.3518 14.4297 14.416 14.2192 14.4 14.0069C14.3984 13.4154 14.4318 12.8244 14.5 12.2369C14.5414 11.9829 14.6295 11.7387 14.76 11.5169C14.9196 11.2689 15.1399 11.0658 15.4 10.9269C15.1402 10.7799 14.9151 10.5786 14.74 10.3369C14.6214 10.1426 14.5369 9.92958 14.49 9.70689C14.4433 9.24022 14.4133 8.80689 14.4 8.40689C14.3969 8.05251 14.3736 7.6986 14.33 7.34689C14.2882 7.24858 14.2141 7.16746 14.12 7.11689C13.858 7.02075 13.5781 6.98321 13.3 7.00689H11.9V14.7469Z",fill:"#BBBBBB",stroke:"#333333"})}),Qa=()=>t.jsx(Lt,{children:t.jsx("path",{d:"M13.0614 8.4258L15.315 10.6924C15.4283 10.8063 15.4283 10.9909 15.315 11.1048L13.0614 13.3714M7.93851 13.3714L5.68491 11.1048C5.57166 10.9909 5.57166 10.8063 5.68491 10.6924L7.93851 8.4258M11.1662 6.70001L9.92659 15",stroke:"#333333",strokeLinecap:"round"})}),Rg=()=>t.jsxs(Lt,{children:[t.jsx("circle",{cx:"8.40002",cy:"12.6",r:"3",fill:"#BBBBBB",stroke:"#333333"}),t.jsx("circle",{cx:"13.6501",cy:"7.35004",r:"1.95",fill:"#BBBBBB",stroke:"#333333"})]}),Mg=()=>t.jsxs(Lt,{children:[t.jsx("path",{d:"M11.1095 12.9899C11.053 13.2628 10.9683 13.4416 10.8366 13.5357C10.7049 13.6298 10.4696 13.6674 10.1309 13.6674L10.0933 14.8153C10.7895 14.8153 11.3165 14.693 11.674 14.4296C12.0222 14.1661 12.2574 13.7239 12.3891 13.084L13.1042 9.405H13.904L14.1675 8.44526H13.2924L13.4053 7.89952C13.4618 7.5796 13.6688 7.41023 14.0263 7.41023C14.2522 7.41023 14.4498 7.44787 14.6003 7.50433L14.9955 6.48812C14.6944 6.3658 14.3463 6.29994 13.9511 6.29994C13.49 6.29994 13.0948 6.45049 12.7561 6.73277C12.4174 7.01504 12.2009 7.38201 12.1163 7.83365L11.9939 8.44526H11.2506L11.0624 9.405H11.8058L11.1095 12.9899Z",fill:"#333333"}),t.jsx("path",{d:"M6.30005 12.9617H7.67381L8.16309 10.4494H10.2049L10.4213 9.31085H8.38891L8.64296 8.00296H10.9388L11.1647 6.84562H7.49503L6.30005 12.9617Z",fill:"#333333"})]}),Tg=()=>t.jsxs(Lt,{children:[t.jsx("path",{d:"M7.70002 14.7C6.9279 14.7 6.26812 14.4244 5.72068 13.8731C5.17324 13.3219 4.89969 12.6481 4.90002 11.8519C4.90002 11.1694 5.09942 10.5612 5.49821 10.0275C5.89699 9.49374 6.41881 9.15249 7.06366 9.00374C7.27578 8.19874 7.70002 7.54686 8.33639 7.04811C8.97275 6.54936 9.69396 6.29999 10.5 6.29999C11.4928 6.29999 12.335 6.65664 13.0266 7.36994C13.7183 8.08324 14.064 8.95159 14.0637 9.97499C14.6491 10.045 15.135 10.3054 15.5212 10.7562C15.9074 11.207 16.1004 11.7341 16.1 12.3375C16.1 12.9937 15.8772 13.5516 15.4316 14.0112C14.986 14.4707 14.4451 14.7003 13.8091 14.7H7.70002Z",fill:"#BBBBBB",stroke:"#333333"}),t.jsx("path",{d:"M10.08 9.72018V13.3H9.36371V11.2299L9.38174 10.5172C9.26837 10.6369 9.18591 10.7194 9.13438 10.7647L8.7453 11.0939L8.40002 10.6396L10.08 9.09996V9.72018Z",fill:"#333333"}),t.jsx("path",{d:"M10.92 12.6798L10.92 9.09999L11.6363 9.09999L11.6363 11.1701L11.6183 11.8828C11.7316 11.7631 11.8141 11.6806 11.8656 11.6352L12.2547 11.3061L12.6 11.7604L10.92 13.3L10.92 12.6798Z",fill:"#333333"})]}),Pg=()=>t.jsxs(Lt,{children:[t.jsx("path",{d:"M16.1 8.89999H16.6V8.39999V8.29999C16.6 6.91928 15.4807 5.79999 14.1 5.79999H6.90002C5.51931 5.79999 4.40002 6.91928 4.40002 8.29999V8.39999V8.89999H4.90002H16.1Z",fill:"#BBBBBB",stroke:"#333333"}),t.jsx("path",{d:"M4.90002 8.59991H4.40002V9.09991V12.6999C4.40002 14.0806 5.51931 15.1999 6.90002 15.1999H14.1C15.4807 15.1999 16.6 14.0806 16.6 12.6999V9.09991V8.59991H16.1H4.90002Z",fill:"#BBBBBB",stroke:"#333333"}),t.jsx("path",{d:"M11.5 10L9.54585 11.3052L10.3377 11.7893L9.5 13L11.4542 11.7134L10.6633 11.2309L11.5 10Z",fill:"#333333"})]}),Dt=34,It=34,sd=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#7F54B3"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 7.00689H8.07C7.53 7.00689 7.25 7.00689 7.16 7.16689C7.02665 7.35185 6.96938 7.58094 7 7.80689C7.00646 8.36465 6.97975 8.9223 6.92 9.47689C6.88923 9.73554 6.81127 9.98636 6.69 10.2169C6.52022 10.4949 6.28285 10.7254 6 10.8869C6.28821 11.0502 6.52669 11.2887 6.69 11.5769C6.85676 11.9408 6.94208 12.3366 6.94 12.7369L7 14.2969C7.00825 14.3648 7.03221 14.4299 7.07 14.4869C7.10698 14.5458 7.15868 14.5941 7.22 14.6269C7.48081 14.7409 7.76757 14.7824 8.05 14.7469H9.5V7.00689ZM11.9 14.7469H13.31C13.89 14.7469 14.11 14.7469 14.22 14.5969C14.3518 14.4297 14.416 14.2192 14.4 14.0069C14.3984 13.4154 14.4318 12.8244 14.5 12.2369C14.5414 11.9829 14.6295 11.7387 14.76 11.5169C14.9196 11.2689 15.1399 11.0658 15.4 10.9269C15.1402 10.7799 14.9151 10.5786 14.74 10.3369C14.6214 10.1426 14.5369 9.92958 14.49 9.70689C14.4433 9.24022 14.4133 8.80689 14.4 8.40689C14.3969 8.05251 14.3736 7.6986 14.33 7.34689C14.2882 7.24858 14.2141 7.16746 14.12 7.11689C13.858 7.02075 13.5781 6.98321 13.3 7.00689H11.9V14.7469Z",fill:"#7148A2",stroke:"#E7E7E7"})]}),jr=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#FDC20A"}),t.jsx("path",{d:"M13.0614 8.4258L15.315 10.6924C15.4283 10.8063 15.4283 10.9909 15.315 11.1048L13.0614 13.3714M7.93851 13.3714L5.68491 11.1048C5.57166 10.9909 5.57166 10.8063 5.68491 10.6924L7.93851 8.4258M11.1662 6.70001L9.92659 15",stroke:"white",strokeLinecap:"round"})]}),ad=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#11BFE6"}),t.jsx("circle",{cx:"8.40002",cy:"12.6",r:"3",fill:"#0E9AB9",stroke:"white"}),t.jsx("circle",{cx:"13.6501",cy:"7.35003",r:"1.95",fill:"#0E9AB9",stroke:"white"})]}),od=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#295ECF"}),t.jsx("path",{d:"M11.1095 12.9899C11.053 13.2628 10.9683 13.4416 10.8366 13.5357C10.7049 13.6298 10.4696 13.6674 10.1309 13.6674L10.0933 14.8153C10.7895 14.8153 11.3165 14.693 11.674 14.4296C12.0222 14.1661 12.2574 13.7239 12.3891 13.084L13.1042 9.40501H13.904L14.1675 8.44526H13.2924L13.4053 7.89952C13.4618 7.57961 13.6688 7.41024 14.0263 7.41024C14.2522 7.41024 14.4498 7.44788 14.6003 7.50433L14.9955 6.48813C14.6944 6.36581 14.3463 6.29994 13.9511 6.29994C13.49 6.29994 13.0948 6.45049 12.7561 6.73277C12.4174 7.01505 12.2009 7.38201 12.1163 7.83366L11.9939 8.44526H11.2506L11.0624 9.40501H11.8058L11.1095 12.9899Z",fill:"white"}),t.jsx("path",{d:"M6.30005 12.9617H7.67381L8.16309 10.4494H10.2049L10.4213 9.31085H8.38891L8.64296 8.00296H10.9388L11.1647 6.84562H7.49503L6.30005 12.9617Z",fill:"white"})]}),id=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#1EB47D"}),t.jsx("path",{d:"M7.70002 14.7C6.9279 14.7 6.26812 14.4244 5.72068 13.8731C5.17324 13.3219 4.89969 12.6481 4.90002 11.8519C4.90002 11.1694 5.09942 10.5612 5.49821 10.0275C5.89699 9.49374 6.41881 9.15249 7.06366 9.00374C7.27578 8.19874 7.70002 7.54686 8.33639 7.04811C8.97275 6.54936 9.69396 6.29999 10.5 6.29999C11.4928 6.29999 12.335 6.65664 13.0266 7.36994C13.7183 8.08324 14.064 8.95159 14.0637 9.97499C14.6491 10.045 15.135 10.3054 15.5212 10.7562C15.9074 11.207 16.1004 11.7341 16.1 12.3375C16.1 12.9937 15.8772 13.5516 15.4316 14.0112C14.986 14.4707 14.4451 14.7003 13.8091 14.7H7.70002Z",fill:"#157F58",stroke:"white"}),t.jsx("path",{d:"M10.08 9.72018V13.3H9.36371V11.2299L9.38174 10.5172C9.26837 10.6369 9.18591 10.7194 9.13438 10.7647L8.7453 11.0939L8.40002 10.6396L10.08 9.09996V9.72018Z",fill:"white"}),t.jsx("path",{d:"M10.92 12.6798L10.92 9.09999L11.6363 9.09999L11.6363 11.1701L11.6183 11.8828C11.7316 11.7631 11.8141 11.6806 11.8656 11.6352L12.2547 11.3061L12.6 11.7604L10.92 13.3L10.92 12.6798Z",fill:"white"})]}),ld=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#FF7D00"}),t.jsx("path",{d:"M16.1 8.89999H16.6V8.39999V8.29999C16.6 6.91928 15.4807 5.79999 14.1 5.79999H6.90002C5.51931 5.79999 4.40002 6.91928 4.40002 8.29999V8.39999V8.89999H4.90002H16.1Z",fill:"#C76200",stroke:"white"}),t.jsx("path",{d:"M4.90002 8.59991H4.40002V9.09991V12.6999C4.40002 14.0806 5.51931 15.1999 6.90002 15.1999H14.1C15.4807 15.1999 16.6 14.0806 16.6 12.6999V9.09991V8.59991H16.1H4.90002Z",fill:"#C76200",stroke:"white"}),t.jsx("path",{d:"M11.5 10L9.54585 11.3052L10.3377 11.7893L9.5 13L11.4542 11.7134L10.6633 11.2309L11.5 10Z",fill:"white"})]});var Us="Checkbox",[Ag,Zx]=Ze(Us),[Og,Lg]=Ag(Us),cd=l.forwardRef((e,r)=>{const{__scopeCheckbox:n,name:s,checked:a,defaultChecked:o,required:i,disabled:d,value:u="on",onCheckedChange:f,...m}=e,[x,v]=l.useState(null),j=Re(r,L=>v(L)),y=l.useRef(!1),w=x?!!x.closest("form"):!0,[_=!1,M]=Xe({prop:a,defaultProp:o,onChange:f}),T=l.useRef(_);return l.useEffect(()=>{const L=x==null?void 0:x.form;if(L){const $=()=>M(T.current);return L.addEventListener("reset",$),()=>L.removeEventListener("reset",$)}},[x,M]),t.jsxs(Og,{scope:n,state:_,disabled:d,children:[t.jsx(ue.button,{type:"button",role:"checkbox","aria-checked":ft(_)?"mixed":_,"aria-required":i,"data-state":fd(_),"data-disabled":d?"":void 0,disabled:d,value:u,...m,ref:j,onKeyDown:K(e.onKeyDown,L=>{L.key==="Enter"&&L.preventDefault()}),onClick:K(e.onClick,L=>{M($=>ft($)?!0:!$),w&&(y.current=L.isPropagationStopped(),y.current||L.stopPropagation())})}),w&&t.jsx(Dg,{control:x,bubbles:!y.current,name:s,value:u,checked:_,required:i,disabled:d,style:{transform:"translateX(-100%)"}})]})});cd.displayName=Us;var dd="CheckboxIndicator",ud=l.forwardRef((e,r)=>{const{__scopeCheckbox:n,forceMount:s,...a}=e,o=Lg(dd,n);return t.jsx(tt,{present:s||ft(o.state)||o.state===!0,children:t.jsx(ue.span,{"data-state":fd(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:r,style:{pointerEvents:"none",...e.style}})})});ud.displayName=dd;var Dg=e=>{const{control:r,checked:n,bubbles:s=!0,...a}=e,o=l.useRef(null),i=So(n),d=ko(r);return l.useEffect(()=>{const u=o.current,f=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(f,"checked").set;if(i!==n&&x){const v=new Event("click",{bubbles:s});u.indeterminate=ft(n),x.call(u,ft(n)?!1:n),u.dispatchEvent(v)}},[i,n,s]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:ft(n)?!1:n,...a,tabIndex:-1,ref:o,style:{...e.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ft(e){return e==="indeterminate"}function fd(e){return ft(e)?"indeterminate":e?"checked":"unchecked"}var pd=cd,Ig=ud;function $g(e,r){if(e==null)return{};var n={},s=Object.keys(e),a,o;for(o=0;o=0)&&(n[a]=e[a]);return n}var Fg=["color"],Bg=l.forwardRef(function(e,r){var n=e.color,s=n===void 0?"currentColor":n,a=$g(e,Fg);return l.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),l.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:s,fillRule:"evenodd",clipRule:"evenodd"}))});const Gs=l.forwardRef(({className:e,...r},n)=>t.jsx(pd,{className:S("peer inline-flex h-[20px] w-[20px] cursor-pointer items-center rounded-md border-2 border-gray-400 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 relative mr-1.5",e),...r,ref:n,children:t.jsx(Ig,{className:"absolute -left-0.5 transition ease-in-out delay-150",children:t.jsx(Bg,{className:"h-[20px] w-[20px] text-white bg-black rounded-md dark:bg-zinc-400 dark:text-black"})})}));Gs.displayName=pd.displayName;var zg="Label",md=l.forwardRef((e,r)=>t.jsx(ue.label,{...e,ref:r,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));md.displayName=zg;var hd=md;const Vg=tn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),We=l.forwardRef(({className:e,...r},n)=>t.jsx(hd,{ref:n,className:S(Vg(),e),...r}));We.displayName=hd.displayName;var Ks="Switch",[Hg,Xx]=Ze(Ks),[Ug,Gg]=Hg(Ks),gd=l.forwardRef((e,r)=>{const{__scopeSwitch:n,name:s,checked:a,defaultChecked:o,required:i,disabled:d,value:u="on",onCheckedChange:f,...m}=e,[x,v]=l.useState(null),j=Re(r,T=>v(T)),y=l.useRef(!1),w=x?!!x.closest("form"):!0,[_=!1,M]=Xe({prop:a,defaultProp:o,onChange:f});return t.jsxs(Ug,{scope:n,checked:_,disabled:d,children:[t.jsx(ue.button,{type:"button",role:"switch","aria-checked":_,"aria-required":i,"data-state":bd(_),"data-disabled":d?"":void 0,disabled:d,value:u,...m,ref:j,onClick:K(e.onClick,T=>{M(L=>!L),w&&(y.current=T.isPropagationStopped(),y.current||T.stopPropagation())})}),w&&t.jsx(Kg,{control:x,bubbles:!y.current,name:s,value:u,checked:_,required:i,disabled:d,style:{transform:"translateX(-100%)"}})]})});gd.displayName=Ks;var xd="SwitchThumb",vd=l.forwardRef((e,r)=>{const{__scopeSwitch:n,...s}=e,a=Gg(xd,n);return t.jsx(ue.span,{"data-state":bd(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:r})});vd.displayName=xd;var Kg=e=>{const{control:r,checked:n,bubbles:s=!0,...a}=e,o=l.useRef(null),i=So(n),d=ko(r);return l.useEffect(()=>{const u=o.current,f=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(f,"checked").set;if(i!==n&&x){const v=new Event("click",{bubbles:s});x.call(u,n),u.dispatchEvent(v)}},[i,n,s]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:o,style:{...e.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function bd(e){return e?"checked":"unchecked"}var yd=gd,qg=vd;const Kt=l.forwardRef(({className:e,...r},n)=>t.jsx(yd,{className:S("peer inline-flex h-[18px] w-[35px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-purple-750 data-[state=unchecked]:bg-brand-300",e),...r,ref:n,children:t.jsx(qg,{className:S("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Kt.displayName=yd.displayName;const wd=l.forwardRef(({className:e,...r},n)=>t.jsx("textarea",{cols:500,rows:4,className:S("flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));wd.displayName="Textarea";var Wg="Toggle",jd=l.forwardRef((e,r)=>{const{pressed:n,defaultPressed:s=!1,onPressedChange:a,...o}=e,[i=!1,d]=Xe({prop:n,onChange:a,defaultProp:s});return t.jsx(ue.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:r,onClick:K(e.onClick,()=>{e.disabled||d(!i)})})});jd.displayName=Wg;var $t="ToggleGroup",[_d,Yx]=Ze($t,[sn]),Cd=sn(),qs=de.forwardRef((e,r)=>{const{type:n,...s}=e;if(n==="single"){const a=s;return t.jsx(Zg,{...a,ref:r})}if(n==="multiple"){const a=s;return t.jsx(Xg,{...a,ref:r})}throw new Error(`Missing prop \`type\` expected on \`${$t}\``)});qs.displayName=$t;var[Nd,Sd]=_d($t),Zg=de.forwardRef((e,r)=>{const{value:n,defaultValue:s,onValueChange:a=()=>{},...o}=e,[i,d]=Xe({prop:n,defaultProp:s,onChange:a});return t.jsx(Nd,{scope:e.__scopeToggleGroup,type:"single",value:i?[i]:[],onItemActivate:d,onItemDeactivate:de.useCallback(()=>d(""),[d]),children:t.jsx(kd,{...o,ref:r})})}),Xg=de.forwardRef((e,r)=>{const{value:n,defaultValue:s,onValueChange:a=()=>{},...o}=e,[i=[],d]=Xe({prop:n,defaultProp:s,onChange:a}),u=de.useCallback(m=>d((x=[])=>[...x,m]),[d]),f=de.useCallback(m=>d((x=[])=>x.filter(v=>v!==m)),[d]);return t.jsx(Nd,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:u,onItemDeactivate:f,children:t.jsx(kd,{...o,ref:r})})});qs.displayName=$t;var[Yg,Jg]=_d($t),kd=de.forwardRef((e,r)=>{const{__scopeToggleGroup:n,disabled:s=!1,rovingFocus:a=!0,orientation:o,dir:i,loop:d=!0,...u}=e,f=Cd(n),m=Qn(i),x={role:"group",dir:m,...u};return t.jsx(Yg,{scope:n,rovingFocus:a,disabled:s,children:a?t.jsx(Dl,{asChild:!0,...f,orientation:o,dir:m,loop:d,children:t.jsx(ue.div,{...x,ref:r})}):t.jsx(ue.div,{...x,ref:r})})}),_r="ToggleGroupItem",Ed=de.forwardRef((e,r)=>{const n=Sd(_r,e.__scopeToggleGroup),s=Jg(_r,e.__scopeToggleGroup),a=Cd(e.__scopeToggleGroup),o=n.value.includes(e.value),i=s.disabled||e.disabled,d={...e,pressed:o,disabled:i},u=de.useRef(null);return s.rovingFocus?t.jsx(Il,{asChild:!0,...a,focusable:!i,active:o,ref:u,children:t.jsx(eo,{...d,ref:r})}):t.jsx(eo,{...d,ref:r})});Ed.displayName=_r;var eo=de.forwardRef((e,r)=>{const{__scopeToggleGroup:n,value:s,...a}=e,o=Sd(_r,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},d=o.type==="single"?i:void 0;return t.jsx(jd,{...d,...a,ref:r,onPressedChange:u=>{u?o.onItemActivate(s):o.onItemDeactivate(s)}})}),Qg=qs,Rd=Ed;const to=Qg,Wn=l.forwardRef(({className:e,children:r,...n},s)=>t.jsx(Rd,{ref:s,className:S("relative flex h-[35px] px-2 items-center justify-center bg-white text-base leading-4 rounded focus:z-10 focus:outline-none hover:bg-purple-750/20 data-[state=on]:bg-purple-750 data-[state=on]:text-brand-100",e),...n,children:r}));Wn.displayName=Rd.displayName;const Md=l.forwardRef(({className:e,type:r,...n},s)=>t.jsx("input",{type:r,className:S("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...n}));Md.displayName="Input";const ex={"rotate-cw":Gm,"check-circle":Ti,clipboard:Tm},tx=({input:e,updates:r,update:n})=>{var z,A,D,U,Q,Y,Z,G,te;const[s,a]=l.useState(!1),{options:o}=he();ce(ve);const[i,d]=l.useState("third_party"),[u,f]=l.useState({}),m=["third_party","plugins","theme"],x=l.useMemo(()=>{var k;return e?(k=r.find(O=>O.key===e.key))==null?void 0:k.value:""},[e,r]),v=l.useCallback(k=>{var O;return e?(O=r.find(V=>V.key===`${e.key}.${k}`))==null?void 0:O.value:""},[e,r]);if(!e)return t.jsx(t.Fragment,{});const j=async()=>{if(e.action){a(!0);try{await new et(o,e.action).post(),Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["Your action is successful ",t.jsx(Be,{className:"w-5 text-green-600"})]}),duration:0})}catch(k){Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[k.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]}),duration:0})}a(!1)}},y=async k=>{f(O=>({...O,[k.key]:!0}));try{if(k.action==="clipboard")await navigator.clipboard.writeText(x),Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["CDN URL copied to clipboard ",t.jsx(Be,{className:"w-5 text-green-600"})]}),duration:0});else{const V=await new et(o,k.action).post();V!=null&&V.data&&k.action_response_mutates&&k.action_response_mutates.forEach(oe=>{console.log(oe,V.data[oe]),n(V.data[oe],oe,!0)}),Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[k.control_label," action successful ",t.jsx(Be,{className:"w-5 text-green-600"})]}),duration:0})}}catch(O){Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[O.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]}),duration:0})}f(O=>({...O,[k.key]:!1}))},w=l.useMemo(()=>{var k;return(k=e==null?void 0:e.control_values)==null?void 0:k.reduce((O,V)=>{O[V.type]||(O[V.type]=[]);const oe=Array.isArray(x)?x.includes(V.id):x===V.id;return O[V.type].push({...V,isSelected:oe}),O},{})},[e,r]),_=(k,O)=>{const V=k?[...x||[],O]:(x||[]).filter(oe=>oe!==O);n(V,e.key)},M=k=>{k.preventDefault(),n(k.target.value,e.key)},[T,L]=l.useState(!1),$=()=>{L(k=>!k)};return l.useMemo(()=>{if(!(e!=null&&e.control_visibility))return!0;const k=new Map(r.map(({key:O,value:V})=>[O,V]));return e.control_visibility.some(O=>k.get(O.key)===O.value)},[e==null?void 0:e.control_visibility,r])?t.jsxs("div",{className:"flex flex-col justify-start items-center gap-3 normal-case",children:[(e==null?void 0:e.control_type)==="checkbox"&&t.jsx(We,{htmlFor:"name",className:"flex flex-col text-left w-full dark:text-brand-300 bg-brand-100/30 rounded-xl py-4 px-4 border border-brand-200/60",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:e.control_label}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[335px]",children:e.control_description})]}),t.jsx(Kt,{checked:x,onCheckedChange:k=>n(k,e.key),className:"self-center"})]})}),e.control_type==="textarea"&&t.jsxs(We,{htmlFor:"name",className:"flex flex-col text-left w-full bg-brand-100/30 dark:text-brand-300 rounded-xl py-4 px-4 border border-brand-200/60",children:[t.jsx("span",{children:e.control_label}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600",children:e.control_description}),t.jsx(wd,{id:e.key,className:"focus:outline-none focus-visible:ring-0 dark:text-brand-300 focus-visible:ring-offset-0 mt-2",value:x,onChange:k=>n(k.target.value,e.key)})]}),e.control_type==="input"&&t.jsxs(We,{htmlFor:"name",className:"flex flex-col text-left w-full bg-brand-100/30 dark:text-brand-300 rounded-xl py-4 px-4 border border-brand-200/60",children:[t.jsx("span",{children:e.control_label}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600",children:e.control_description}),t.jsxs("div",{className:"flex w-full items-center gap-2 mt-2",children:[t.jsx(Md,{id:e.key,type:((z=e.control_props)==null?void 0:z.type)||"text",readOnly:((A=e.control_props)==null?void 0:A.readonly)||(e==null?void 0:e.readonly)||!1,placeholder:(e==null?void 0:e.placeholder)||"",className:"flex-grow focus:outline-none focus-visible:ring-0 dark:text-brand-300 focus-visible:ring-offset-0",value:x,onChange:(D=e.control_props)!=null&&D.readonly||e!=null&&e.readonly?void 0:M,...e.control_props}),t.jsx("div",{className:"flex-shrink-0 flex gap-2",children:(U=e.actions)==null?void 0:U.map(k=>{const O=k.control_icon?ex[k.control_icon]:null;return t.jsx(ls,{delayDuration:0,children:t.jsxs(Qr,{children:[t.jsx(en,{asChild:!0,children:t.jsxs(pt,{disabled:u[k.key],className:"flex-shrink-0 flex gap-2 whitespace-nowrap",onClick:()=>y(k),variant:"outline",children:[u[k.key]&&t.jsx(Ge,{className:"w-4 animate-spin -ml-1"}),O&&t.jsx(O,{className:"w-4 h-4"}),!O&&k.control_label]})}),t.jsx(Jt,{className:"max-w-[200px] p-2 text-sm break-words",sideOffset:5,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"font-semibold text-sm mb-1",children:k.control_label}),t.jsx("span",{className:"text-xs font-normal truncate",children:k.control_description})]})})]})},k.key)})})]})]}),e.control_type==="button"&&t.jsx(We,{htmlFor:"name",className:"flex ml-4 text-left w-full",children:t.jsxs(pt,{disabled:s,className:"flex gap-2",onClick:k=>j(),variant:"outline",children:[s&&t.jsx(Ge,{className:"w-4 animate-spin -ml-1"}),e.control_label]})}),e.control_type==="options"&&t.jsx(We,{htmlFor:"name",className:"flex flex-col text-left w-full dark:text-brand-300 bg-brand-100/30 rounded-xl py-4 px-4 border border-brand-200/60",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:e.control_label}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[335px]",children:e.control_description})]}),t.jsxs(Jc,{value:x,onValueChange:k=>n(k,e.key),children:[t.jsx(Bs,{className:"w-[130px] capitalize bg-brand-0",children:t.jsx(ed,{placeholder:"Select action"})}),t.jsx(zs,{className:"z-[100001]",children:t.jsxs(Qc,{children:[t.jsx(Vs,{children:"Actions"}),(Q=e==null?void 0:e.control_values)==null?void 0:Q.map((k,O)=>t.jsx(Hs,{className:"capitalize cursor-pointer",value:k,children:k},O))]})})]})]})}),e.control_type==="number-range"&&t.jsx(We,{htmlFor:"name",className:"flex flex-col gap-4 text-left w-full dark:text-brand-300 bg-brand-100/30 rounded-xl py-4 px-4 border border-brand-200/60",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:e.control_label}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[335px]",children:e.control_description})]}),t.jsx(to,{className:"inline-flex bg-mauve6 rounded border border-1 space-x-px ",type:"single",value:String(x),onValueChange:k=>n(k,e.key),"aria-label":"Select action",children:(Y=e==null?void 0:e.control_values)==null?void 0:Y.map((k,O)=>t.jsxs(Wn,{value:String(k),"aria-label":k,children:[k,e==null?void 0:e.control_values_suffix]},O))})]})}),e.control_type==="accordion"&&t.jsxs(We,{htmlFor:"name",className:"flex flex-col text-left w-full dark:text-brand-300 bg-brand-100/30 rounded-xl py-4 px-4 border border-brand-200/60",children:[t.jsxs("div",{className:"flex items-center justify-between cursor-pointer ",onClick:$,children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:"Misc Options"}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[425px]",children:"This base page optimization will be used on all the other pages in the selected group."})]}),t.jsx(kl,{className:`h-5 transition-all ${T&&"rotate-[90deg]"}`})]}),t.jsx(ln,{id:e.key,className:"flex flex-col text-left w-full gap-4 mt-6 ml-3",initialRender:!0,isOpen:T,children:(Z=e==null?void 0:e.inputs)==null?void 0:Z.map(k=>t.jsxs(We,{className:"flex gap-1",children:[t.jsx(Gs,{checked:v(k.key),onCheckedChange:O=>n(O,`${e.key}.${k.key}`)}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"cursor-pointer",children:k.control_label}),t.jsx("span",{className:"text-sm font-normal text-gray-600 sm:max-w-[425px]",children:k.control_description})]})]},k.key))})]}),(e==null?void 0:e.control_type)==="radio"&&t.jsx(We,{htmlFor:"name",className:"flex flex-col text-left w-full dark:text-brand-300 bg-brand-100/30 rounded-xl py-4 px-4 border border-brand-200/60",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:e.control_label}),(G=e==null?void 0:e.control_values_description)!=null&&G.length?e.control_values_description.map(k=>k.value===x&&t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[335px]",children:k.description},k.value)):t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[335px]",children:e.control_description})]}),t.jsx(to,{className:"inline-flex bg-mauve6 rounded border border-1 space-x-px ",type:"single",value:String(x),onValueChange:k=>n(k,e.key),"aria-label":"Select action",children:(te=e==null?void 0:e.control_values)==null?void 0:te.map((k,O)=>t.jsx(Wn,{className:"w-fit px-4",value:String(k),"aria-label":k,children:k},O))})]})}),e.control_type==="tab"&&t.jsxs("div",{className:"w-full",children:[t.jsx("div",{className:"flex bg-brand-100/60 w-fit rounded-t-lg",children:m.map((k,O)=>t.jsx("button",{onClick:V=>d(k),className:`flex items-center border-b-white py-2 px-4 w-fit dark:text-brand-300 ${k==="third_party"?"rounded-tl-lg":k==="theme"?"rounded-tr-lg ":""} ${i===k?"bg-white dark:bg-brand-900 rounded-t-lg":"dark:bg-brand-950 bg-brand-200/60 text-slate-500"} dark:hover:border-brand-700/70 `,children:k.replace(/_/g," ").replace(/\b\w/g,V=>V.toUpperCase())},O))}),t.jsxs("div",{className:"flex flex-wrap gap-2 overflow-y-auto scrollbar-stable max-h-[300px] w-full bg-white dark:border-brand-900 rounded-md rounded-tl-none px-4 py-4 dark:bg-brand-900 ",children:[Array.isArray(w[i])&&w[i]&&i=="third_party"&&t.jsx(t.Fragment,{children:w[i].map((k,O)=>t.jsxs("div",{className:"flex gap-2 cursor-pointer font-medium text-sm bg-purple-50/60 dark:text-brand-300 dark:bg-brand-950 border border-brand-200/60 dark:border-brand-950 w-fit rounded-xl items-center py-1.5 px-2",children:[k==null?void 0:k.name,t.jsx(Kt,{checked:k==null?void 0:k.isSelected,onCheckedChange:V=>_(V,k.id)})]},O))}),Array.isArray(w[i])&&w[i]&&i=="plugins"&&t.jsx(t.Fragment,{children:w[i].map((k,O)=>t.jsxs("div",{className:"flex gap-2 cursor-pointer font-medium text-sm bg-purple-50/60 dark:text-brand-300 dark:bg-brand-950 border border-brand-200/60 dark:border-brand-950 w-fit rounded-xl items-center py-1.5 px-2",children:[k==null?void 0:k.name,t.jsx(Kt,{checked:k==null?void 0:k.isSelected,onCheckedChange:V=>_(V,k.id)})]},O))}),Array.isArray(w[i])&&w[i]&&i=="theme"&&t.jsx(t.Fragment,{children:w[i].map((k,O)=>t.jsxs("div",{className:" flex gap-2 cursor-pointer font-medium text-sm bg-purple-50/60 dark:text-brand-300 dark:bg-brand-950 border border-brand-200/60 dark:border-brand-950 w-fit rounded-xl items-center py-1.5 px-2",children:[k==null?void 0:k.name,t.jsx(Kt,{checked:k==null?void 0:k.isSelected,onCheckedChange:V=>_(V,k.id)})]},O))})]})]})]}):t.jsx(t.Fragment,{})},rx=de.memo(tx),nx=de.memo(({status:e})=>{var r,n,s,a;return e?e.status==="failed"||e.status==="Miss"?t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex gap-1 items-center text-xs border border-rose-600 w-fit rounded-lg px-1 py-py",children:[t.jsx(Yc,{className:"fill-rose-600",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsxs("span",{className:"flex gap-2 items-center",children:[t.jsx(Ee,{className:"w-2 fill-rose-500 stroke-0"}),"Error while optimizing ",((r=e.error)==null?void 0:r.code)&&`(Code: ${(n=e.error)==null?void 0:n.code})`]}),t.jsx("span",{className:"text-brand-500 ml-4",children:(s=e.error)!=null&&s.message?(a=e.error)==null?void 0:a.message:"Failed to Optimize"})]})}),t.jsx("span",{className:"capitalize",children:e.status})]})}):e.status==="queued"?t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex gap-2 items-center text-xs w-fit rounded-lg",children:[t.jsx(Ee,{className:S("animate-pulse w-2.5 fill-amber-500 stroke-0")}),"Waiting in the queue"]})}):e.status==="processing"?t.jsx(t.Fragment,{children:t.jsxs("div",{className:" flex gap-2 items-center text-xs w-fit rounded-lg",children:[t.jsx(Ge,{className:"w-4 animate-spin "}),"Optimization in progress"]})}):e.status==="success"||e.status==="Hit"?t.jsx(t.Fragment,{children:t.jsxs("div",{className:" flex gap-1.5 items-center text-xs w-fit rounded-lg",children:[t.jsx(Ee,{className:S("animate-pulse w-2.5 fill-green-600 stroke-0 -mt-[1px]")}),e!=null&&e.message||e.status==="Hit"?"Hit":"Optimized"]})}):t.jsx(t.Fragment,{}):t.jsx(t.Fragment,{})}),sx=({updateValue:e,settings:r,index:n,hideActions:s,showIcons:a=!0,actionRequired:o})=>{if(!r)return t.jsx(t.Fragment,{});const{dispatch:i,uucssError:d}=xe(),{mode:u,options:f}=he(),[m,x]=de.useState(!1),[v,j]=l.useState(!1),[y,...w]=l.useMemo(()=>r.inputs,[r]),[_,M]=l.useState(w.reduce((Z,G,te,k)=>{const{key:O,value:V,inputs:oe}=G;return oe&&oe.forEach((q,be,Me)=>{Z.push({key:`${O}.${q.key}`,value:q.value})}),Z.push({key:O,value:V}),Z},[])),T=l.useCallback((Z,G,te=!1)=>{_.find(O=>O.key===G)?(te&&e(r,Z,G),M(_.map(O=>(O.key===G&&(O.value=Z),O)))):M([..._,{key:G,value:Z}])},[_,r,w]);let L=l.useMemo(()=>({cache:t.jsx(ld,{}),cdn:t.jsx(id,{}),image:t.jsx(ad,{}),javascript:t.jsx(jr,{}),js:t.jsx(jr,{}),font:t.jsx(od,{}),css:t.jsx(sd,{})}),[]);const $=l.useMemo(()=>w.length>0,[w]),X=l.useCallback(()=>{_.forEach(({key:Z,value:G})=>{e(r,G,Z)}),x(!1)},[_,m]),z=async Z=>{j(!0);try{await new et(f,void 0,Z.action||Z.value||void 0).post(),Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["Your action is successful ",t.jsx(Be,{className:"w-5 text-green-600"})]})})}catch(G){j(!1),Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[G.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]})})}j(!1)};xe();const A=()=>{!o||["onboard","preview"].includes(u)||(e(r,!y.value,y.key),i(gr("custom")))},[D,U]=l.useState(!1);l.useEffect(()=>{r.status&&y.value||r!=null&&r.status&&y.control_type==="button"?U(!0):U(!1)},[r]);const[Q,Y]=l.useState(r.status);return l.useEffect(()=>{if(!r.status||!y.value)return;const Z=["processing","queued","success"].includes(r.status.status),G={"Critical CSS":"cpcss","Remove Unused CSS":"uucss","Page Cache":"cache","Cache Policy":"cache_policy"}[r.name];if(!Z||!G)return;const te=async()=>{try{const V=(await i(um(f,f==null?void 0:f.optimizer_url,[G])))[G];Y(V),["success","failed","Miss"].includes(V.status)&&clearInterval(k)}catch(O){console.error("Error fetching CSS status:",O),clearInterval(k)}};te();const k=setInterval(te,5e3);return()=>clearInterval(k)},[r,f,i,m]),t.jsx(t.Fragment,{children:t.jsxs("div",{className:S("relative flex gap-2 font-medium text-base w-fit items-center pr-2 py-1",a?"px-0.5":"px-2"),children:[a&&L[r.category],!s&&t.jsx(t.Fragment,{children:y&&t.jsx(t.Fragment,{children:y.control_type==="checkbox"&&t.jsx(t.Fragment,{children:t.jsx(Gs,{disabled:["onboard","preview"].includes(u),className:o?"":"border-dashed",checked:y.value,onCheckedChange:Z=>{e(r,Z,y.key),i(gr("custom"))}})})})}),t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"relative flex gap-2 font-medium text-base w-fit items-center pr-2 py-0.5",children:[t.jsx("div",{className:"select-none cursor-pointer",onClick:A,children:r.name}),!s&&t.jsxs(t.Fragment,{children:[y&&t.jsx(t.Fragment,{children:y.control_type==="button"&&t.jsx(pt,{loading:v,disabled:v,onClick:Z=>z(y),className:"flex -mr-0.5 gap-1 py-1 px-2.5 h-auto rounded-[8px]",children:t.jsx("span",{className:"text-xs py-1 px-0.5",children:y.control_label})})}),t.jsx(br,{children:$&&t.jsxs(Ac,{open:m,onOpenChange:x,children:[t.jsx(Oc,{disabled:!0,asChild:!0,className:`${y.value?"":"cursor-not-allowed opacity-50 pointer-events-none"}`,children:t.jsx("div",{children:t.jsx(me,{text:`${r.name} Settings`,children:t.jsx(N1,{className:"w-5 text-brand-400"})})})}),t.jsxs(Os,{asChild:!0,className:`${r.name==="Delay Javascript"?"sm:max-w-[650px] bg-brand-100":"sm:max-w-[600px]"} cursor-auto`,children:[t.jsxs(Ls,{className:"border-b px-6 py-8 mt-1",children:[t.jsxs(Ds,{children:[r.name," Settings"]}),t.jsxs($c,{children:["Make changes to your ",t.jsx("span",{className:"lowercase",children:r.name})," settings here. Click save when you're done."]})]}),t.jsx("div",{className:"grid gap-4 px-6 py-4",children:w.map((Z,G)=>t.jsx(rx,{input:Z,updates:_,update:T},G))}),t.jsxs(Ic,{className:"px-6 py-3 border-t",children:[t.jsx(Le,{onClick:Z=>X(),className:"text-sm",children:"Save changes"}),t.jsx(Le,{onClick:Z=>x(!1),variant:"outline",className:"text-sm",children:"Close"})]})]})]})}),d&&y.key==="uucss_enable_uucss"?t.jsx("div",{className:"px-1",children:t.jsxs("div",{className:"flex gap-1 items-center text-xs border border-amber-600 bg-amber-300/30 w-fit rounded-lg px-1 py-[2px] leading-3",children:[t.jsx(To,{className:"h-[18px] w-[18px] text-amber-600"}),"Unused CSS and Critical CSS optimization options cannot be enabled simultaneously."]})}):D&&t.jsx("div",{className:"px-1",children:t.jsx(nx,{status:Q})}),t.jsx(br,{mode:"onboard",children:t.jsx(me,{text:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-purple-750 font-medium",children:"PRO"})," feature"]}),children:t.jsx(Bm,{className:"w-4 text-brand-400"})})})]})]}),t.jsx("p",{className:`text-sm font-normal select-none ${r.status?"":"-mt-1"}`,children:r.description?r.description:r.name})]})]},n)})},ax=({item:e,itemIndex:r,updateValue:n,actionRequired:s})=>{const{dispatch:a,openCategory:o}=xe(),i=d=>{a(ae("openAudits",[d.id])),a(ae("activeTab",d.type==="passed_audit"?"passed_audits":d.type==="opportunity"?"opportunities":d.type)),setTimeout(()=>{var u;(u=document.getElementById(`audit-${d.id}`))==null||u.scrollIntoView({behavior:"smooth"})},10)};return t.jsxs("div",{className:"w-full mb-3.5 px-2.5 py-3 rounded-2xl dark:bg-brand-950 bg-brand-0 dark:hover:border-brand-700/70 hover:border-brand-400/60",children:[t.jsx(sx,{showIcons:!1,settings:e,updateValue:n,actionRequired:s,index:r}),e.audits.length>0&&t.jsxs("ul",{className:"flex mt-2 justify-start ml-14",children:[t.jsx(O1,{cls:"w-4 mr-2 -mt-2"}),e.audits.map((d,u)=>t.jsxs("li",{onClick:()=>i(d),className:"relative flex cursor-pointer gap-2 font-medium text-sm hover:bg-brand-100 dark:bg-brand-900 bg-white border w-fit rounded-xl items-center py-1.5 px-1.5 mr-2",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-7 h-7 rounded-full dark:bg-brand-700 bg-brand-200/50",children:d.scoreDisplayMode==="informative"?t.jsx(t.Fragment,{children:t.jsx("span",{className:"w-2 h-2 border-2 border-brand-400/60 rounded-full"})}):d.type==="passed_audit"?t.jsx(Be,{className:"w-5 fill-green-600"}):d.type==="opportunity"?t.jsxs(t.Fragment,{children:[t.jsx(Ee,{className:S("w-2 stroke-0 fill-orange-600 animate-ping absolute inline-flex opacity-75")}),t.jsx(Ee,{className:S("w-2 stroke-0 fill-orange-600 relative inline-flex")})]}):d.type==="diagnostics"?t.jsxs(t.Fragment,{children:[t.jsx(Ee,{className:S("w-2 stroke-0 fill-yellow-400 animate-ping absolute inline-flex opacity-75")}),t.jsx(Ee,{className:S("w-2 stroke-0 fill-yellow-400 relative inline-flex")})]}):null}),t.jsxs("div",{className:"flex flex-col ",children:[t.jsx("span",{className:"select-none",children:d.name}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"dark:bg-brand-950 bg-white border w-fit rounded-lg items-center py-py px-1 mr-2 text-gray-400 block font-medium text-[10px] ",children:d.type.replace(/_/g," ").replace(/\b\w/g,f=>f.toUpperCase())}),t.jsx("div",{className:" text-gray-500 text-xs block",children:d.displayValue?d.displayValue:""})]})]}),t.jsx(kl,{className:"h-5"})]},u))]})]})},ox=e=>e==="css"||e==="cdn"?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1),ix=e=>{switch(e){case"cdn":return 625;case"font":return 515;case"css":return 130;case"javascript":return 255;case"image":return 395;case"cache":return 740;default:return 395}},lx=({})=>{var jt,_t;const{settings:e,data:r,activeReport:n,settingsLoading:s,activeGear:a,revisions:o}=ce(ve),[i,d]=l.useState("css"),[u,f]=l.useState({}),{dispatch:m,openCategory:x,activeTab:v,auditsReturn:j,testModeStatus:y,settingsMode:w}=xe(),_=["css","javascript","image","font","cdn","cache"],[M,T]=l.useState(!0),L=["starter","accelerate","turboMax"],$=l.useRef(null),[X,z]=l.useState("custom"),[A,D]=l.useState(!1),[U,Q]=l.useState(""),{toast:Y}=gt(),{testMode:Z}=ce(ve),{handleTestModeSwitchChange:G}=$s(),{options:te}=he(),k=l.useMemo(()=>({cache:t.jsx(ld,{}),cdn:t.jsx(id,{}),image:t.jsx(ad,{}),javascript:t.jsx(jr,{}),js:t.jsx(jr,{}),font:t.jsx(od,{}),css:t.jsx(sd,{})}),[]),O=l.useMemo(()=>({cache:t.jsx(Pg,{}),cdn:t.jsx(Tg,{}),image:t.jsx(Rg,{}),javascript:t.jsx(Qa,{}),js:t.jsx(Qa,{}),font:t.jsx(Mg,{}),css:t.jsx(Eg,{})}),[]),V=l.useCallback(B=>{var pe,ye,Te;const re={},fe=[...((pe=r==null?void 0:r.grouped)==null?void 0:pe.passed_audits)||[],...((ye=r==null?void 0:r.grouped)==null?void 0:ye.diagnostics)||[],...((Te=r==null?void 0:r.grouped)==null?void 0:Te.opportunities)||[]];return B.forEach(_e=>{re[_e.category]||(re[_e.category]=[]),re[_e.category].push({..._e,audits:(fe||[]).filter(lt=>lt.settings.find(ct=>ct.name===_e.name))})}),re},[e,r,n]);l.useEffect(()=>{const B=V(e||[]),re=Object.keys(B).sort((pe,ye)=>{const Te=_.indexOf(pe),_e=_.indexOf(ye);return Te-_e}),fe={};re.forEach(pe=>{fe[pe]=B[pe]}),f(fe),x?d(x):m(ae("openCategory","css"))},[e,r,n]);const oe=l.useCallback((B,re,fe)=>{m(_i(B.audits[0],B,fe,re))},[]),[q,be]=l.useState([]),[Me,$e]=l.useState([]),Ye=l.useRef(!0);l.useEffect(()=>{if(Ye.current){Ye.current=!1;return}if(u&&M){const B=[],re=[];_.forEach(fe=>{if(u[fe]){const pe=u[fe].slice().sort((_e,lt)=>{const ct=_e.audits.some(Ft=>Ft.type!=="passed_audit"),rr=lt.audits.some(Ft=>Ft.type!=="passed_audit");if(ct&&!rr)return-1;if(!ct&&rr)return 1;const Ct=_e.inputs[0].value,nr=lt.inputs[0].value;return Ct&&!nr?-1:!Ct&&nr?1:0}),ye=pe.filter(_e=>!qe(_e)),Te=pe.filter(_e=>qe(_e));B.push(...ye),re.push(...Te)}}),be(B),$e(re),T(!1)}},[u]);const nt=(B,re)=>{var fe;if(vt(B),a==="custom"&&!re)(fe=$.current)==null||fe.click();else if(m(gr(B)),!Me)return},vt=B=>{let re;B==="turboMax"&&!Z&&(re=Y({description:t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex font-semibold w-full gap-2 text-center items-center",children:[t.jsx(To,{className:"w-5 text-orange-600"}),"Do you want to turn on test mode?",t.jsxs(Le,{className:"px-2",onClick:async fe=>{re&&re.dismiss(),await G(!0)},variant:"outline",children:[t.jsx(Sl,{className:"h-5 w-5 text-gray-500"}),"Yes"]}),t.jsxs(Le,{className:"px-2",onClick:fe=>{re&&re.dismiss()},variant:"outline",children:[t.jsx(Rl,{className:"h-5 w-5 text-gray-500"}),"No"]})]})})},99999999))};l.useEffect(()=>{T(!0)},[n]),l.useEffect(()=>{},[e]),l.useEffect(()=>{(o==null?void 0:o.length)==0&&!a&&m(gr("accelerate"))},[e]);const Je={starter:"Optimizes foundational aspects for faster load speeds by removing unused CSS, minifying CSS and JavaScript, caching pages, and self-hosting Google Fonts.",accelerate:"Starter mode + RapidLoad CDN, serving next-gen images, and enhancing image handling with lazy loading, while also deferring JavaScript and adding crucial image attributes.",turboMax:"Unlock peak performance potential including Accelerator mode + generating critical CSS, advanced JavaScript handling methods, such as delaying execution for improved speed and efficiency.",custom:"Tailor your optimization strategy to your needs, combining features like Accelerator mode and advanced JavaScript handling for personalized performance."},ke=U||a,qe=B=>{const re=B.inputs[0].value&&B.audits.some(pe=>pe.type==="passed_audit"),fe=B.audits.some(pe=>pe.type!=="passed_audit");return re||fe},[Fe,bt]=l.useState({}),[yt,dn]=l.useState(!1);l.useEffect(()=>{if(yt){const B={};Object.keys(u).forEach(re=>{B[re]=!1}),bt(B),dn(!1)}},[u]),l.useEffect(()=>{j&&(D(!0),m(ae("auditsReturn",!1)))},[j]),q.filter(B=>B.category===i);const[wt,tr]=l.useState({cpcss:!1,uucss:!1,cpcssuucss:!1}),Qe=l.useCallback(()=>{const B=e.some(pe=>{var ye;return(ye=pe.inputs.find(Te=>Te.key==="uucss_enable_cpcss"))==null?void 0:ye.value}),re=e.some(pe=>{var ye;return(ye=pe.inputs.find(Te=>Te.key==="uucss_enable_uucss"))==null?void 0:ye.value}),fe=e.some(pe=>{var ye;return(ye=pe.inputs.find(Te=>Te.key==="enable_uucss_on_cpcss"))==null?void 0:ye.value});tr({cpcss:B,uucss:re,cpcssuucss:!fe})},[e]);return l.useEffect(()=>{Qe()},[e,Qe]),l.useEffect(()=>{m(ae("uucssError",wt.cpcss&&wt.uucss&&wt.cpcssuucss))},[wt,m]),t.jsxs("div",{className:"dark:bg-brand-800/40 bg-brand-200 px-9 py-8 mt-2 rounded-3xl",children:[t.jsx(A1,{}),t.jsxs("div",{className:"pb-4",children:[s&&t.jsx("div",{children:"loading..."}),t.jsx("h3",{className:"font-semibold text-lg",children:"Performance Gears"}),t.jsx("span",{className:"font-normal text-sm text-zinc-600 dark:text-brand-300",children:"Select your Performance Mode: Starter, Accelerate, TurboMax, or Customize, to fine-tune your site's speed."})]}),t.jsx("div",{className:"flex gap-4","data-tour":"settings-gear",children:L.map((B,re)=>t.jsx("div",{className:`cursor-pointer transition-all flex px-4 py-4 min-w-[166px] min-h-[166px] items-center justify-center w-fit rounded-3xl dark:bg-brand-950 bg-brand-0 dark:hover:border-purple-700 dark:border-brand-700/70 hover:border-purple-700 border border-brand-200 border-[3px] ${B===a?" border-purple-700 dark:border-purple-700":""}`,onClick:fe=>{z(B),nt(B)},onMouseEnter:()=>Q(B),onMouseLeave:()=>Q(""),children:t.jsxs("div",{className:`flex flex-col gap-1 items-center text-center ${B==="turboMax"?" pt-1.5":""}`,children:[["starter","accelerate","turboMax"].includes(B)&&a===B&&t.jsx("div",{className:"absolute ml-28 -mt-4",children:t.jsx(Be,{className:"w-6 h-6 text-purple-800"})}),B==="starter"&&t.jsx(_g,{cls:"px-2 py-2"}),B==="accelerate"&&t.jsx(Cg,{cls:"px-2 py-2"}),B==="turboMax"&&t.jsx(Ng,{cls:"px-2 py-2"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-semibold capitalize",children:B}),B==="turboMax"&&t.jsx("p",{className:"font-normal text-[10px] leading-none",children:"Test Mode Recommended"})]})]})},re))}),t.jsx(vr,{title:"Modified Customize Settings changes",description:"Switching to Performance Modes will result in the loss of any customized settings.",action:"Activate",performanceGear:!0,cancel:"Cancel",onClick:()=>{nt(X,!0)},children:t.jsx("div",{ref:$})}),t.jsxs("div",{className:"py-4 ",children:[U?t.jsxs("h3",{className:"font-semibold dark:text-brand-300 capitalize",children:[U," ",a===U&&"Activated"]}):t.jsxs("h3",{className:"font-semibold dark:text-brand-300 capitalize",children:[a," Activated"]}),t.jsx("span",{className:"font-normal text-sm text-zinc-600 dark:text-brand-300",children:Je[ke]})]}),t.jsx("div",{children:s?t.jsx("div",{className:`w-48 animate-pulse h-10 select-none transition-all rounded-2xl cursor-pointer
- flex items-center gap-2 px-4 py-2 -ml-1 text-sm font-medium dark:hover:border-purple-700 dark:border-brand-700/70 hover:border-purple-700 border border-brand-200 border-[3px] dark:hover:bg-brand-950 bg-brand-0 dark:bg-brand-950`}):t.jsxs("div",{onClick:()=>{z("custom"),D(B=>!B)},onMouseEnter:()=>Q("custom"),onMouseLeave:()=>Q(""),className:S(`select-none w-fit transition-all rounded-2xl cursor-pointer
- flex items-center gap-2 px-4 py-2 -ml-1 text-sm font-medium dark:hover:border-purple-700 dark:border-brand-700/70 hover:border-purple-700 border border-brand-200 border-[3px] dark:hover:bg-brand-950 bg-brand-0 dark:bg-brand-950 `,a==="custom"&&"border-purple-700"),"data-tour":"customize-settings",children:[a==="custom"&&t.jsx("div",{className:"",children:t.jsx(Be,{className:"w-6 h-6 text-purple-800"})}),"Customize Settings ",t.jsx(S0,{className:S("w-4 rounded-[15px] transition-transform",A&&"-rotate-180")})]})}),A&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"py-3 relative",children:t.jsx(T1,{width:ix(i)||220,category:i})}),t.jsx("ul",{className:"flex gap-3 ml-12",children:_.map((B,re)=>t.jsx("li",{onClick:fe=>{d(B),m(ae("openCategory",B))},children:t.jsxs(Se.div,{id:B,transition:{duration:.5},className:S("cursor-pointer select-none flex gap-2 transition-all items-center border border-transparent py-[6px] pr-3 pl-[7px] rounded-2xl w-fit mb-4 hover:bg-brand-50 dark:bg-brand-950/60 dark:hover:bg-brand-950 bg-brand-0 hover:shadow-md",i===B&&"dark:bg-brand-950 shadow-md transition-all"),children:[t.jsx("div",{children:i===B?t.jsx(t.Fragment,{children:k[B]}):t.jsx(t.Fragment,{children:O[B]})}),t.jsx("span",{className:"font-medium tracking-wide",children:ox(B)})]})},re))}),t.jsx("div",{className:S(r?"min-h-[380px]":"min-h-[280px]"),children:t.jsxs("ul",{children:[(jt=u[i])==null?void 0:jt.map((B,re)=>t.jsx("li",{children:t.jsx(Se.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3,delay:re?.05*re:0},children:t.jsx(ax,{item:B,itemIndex:re,updateValue:oe,actionRequired:!0},`${B.category}-${re}`)})},`${B.category}-${re}`)),((_t=u[i])==null?void 0:_t.length)<=2&&t.jsxs(Se.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"flex flex-col gap-2 items-center px-2 mt-12 w-full mb-6",children:[t.jsx("div",{children:t.jsx("img",{alt:"Good Job!",className:"w-60 -ml-6",src:te!=null&&te.page_optimizer_base?(te==null?void 0:te.page_optimizer_base)+"/success.svg":"/success.svg"})}),t.jsx("span",{className:"flex text-sm mt-4 gap-2",children:`You're so close to perfection! One more fix and it's flawless!"`})]})]})})]})]})},cx="new-titan-prompt",dx=()=>{const{data:e,loading:r,reanalyze:n,settings:s,error:a}=ce(ve),{dispatch:o,activeTab:i,openAudits:d,storePassedAudits:u,settingsMode:f}=xe(),[m,x]=l.useState(!1),v=l.useRef(null),[j,y]=de.useState(!1),[w,_]=l.useState(!!localStorage.getItem(cx)),{options:M,setOpenAudits:T,mode:L,manipulatingStyles:$,savingData:X,togglePerformance:z,setTogglePerformance:A,version:D}=he(),U=[{key:"opportunities",name:"Opportunities",color:"border-orange-400",activeColor:"bg-orange-400"},{key:"diagnostics",name:"Diagnostics",color:"border-yellow-400 ",activeColor:"bg-yellow-400 "},{key:"passed_audits",name:"Passed Audits",color:"border-green-600",activeColor:"bg-green-600"}],Q=!["onboard","preview"].includes(L);return l.useEffect(()=>{setTimeout(()=>{Q&&!w&&(_(!0),y(!0))},1e3)},[]),l.useState(!1),t.jsxs("div",{"data-tour":"audits",children:[t.jsxs("h2",{className:"text-lg ml-5 mb-4 flex gap-2 font-normal items-center",children:[!z&&t.jsx(Fs,{}),"Fix Performance Issues"]}),t.jsx("div",{ref:v,style:{height:"1px"}}),t.jsxs("div",{className:S("tabs flex sticky gap-2 -top-1 z-10"),children:[t.jsxs("div",{onClick:()=>o(ae("activeTab","configurations")),className:S("whitespace-nowrap dark:bg-brand-930/90 bg-brand-0 border-2 border-transparent rounded-[20px] cursor-pointer w-[200px] flex items-center gap-2 px-5 py-3 text-sm font-medium",i==="configurations"?"font-medium ":"text-brand-500 dark:hover:text-brand-300"),"data-tour":"speed-settings",children:[" ",t.jsx(Nl,{className:"w-4 rounded-[15px]"})," Speed Settings"]}),t.jsxs(it,{"data-tour":"audit-groups",className:S("dark:bg-brand-930/90 bg-brand-0 flex justify-between items-center select-none p-0 pl-6 pr-3 rounded-[20px]",m&&"rounded-b-xl rounded-t-none shadow-lg"),children:[t.jsx("div",{className:"flex",children:U.map(Y=>t.jsxs("div",{onClick:()=>o(ae("activeTab",Y.key)),className:S("cursor-pointer flex items-center gap-2 px-4 py-3 text-sm font-medium",m&&"py-3",i===Y.key?"font-medium ":"text-brand-500 dark:hover:text-brand-300"),children:[Y.name,Y.key!=="configurations"&&t.jsx("div",{className:S("flex text-xxs items-center justify-center rounded-full w-6 h-6 border-2",m&&"w-5 h-5 border",r&&!n?"bg-zinc-200 border-zinc-300/30 text-zinc-300/30":S(Y.color,i===Y.key&&Y.activeColor)),children:t.jsx("div",{className:S(i===Y.key&&" text-white dark:text-brand-900"),children:(e==null?void 0:e.grouped[`${Y.key}`].length)||"-"})})]},Y.key))}),t.jsx("div",{className:"flex items-center",children:t.jsx(Ve,{children:d.length>1&&t.jsx(V1,{children:t.jsx("div",{onClick:Y=>o(ae("openAudits",[])),className:"dark:hover:bg-brand-700 hover:bg-brand-100 w-9 h-9 rounded-full flex items-center justify-center",children:t.jsx(me,{text:"Collpase all Audits",children:t.jsx(Lm,{className:"w-5 text-brand-500 dark:text-brand-200"})})})})})})]})]}),t.jsx("div",{className:"audits pt-6 flex mb-24",children:t.jsx("div",{className:"w-full flex flex-col gap-2.5",children:t.jsxs(Ve,{initial:!1,children:[t.jsx("div",{className:"grid grid-cols-12 gap-6 w-full relative ",children:t.jsx("div",{className:"col-span-12 flex flex-col gap-4",children:i==="configurations"?t.jsx(t.Fragment,{children:t.jsx(lx,{})}):t.jsx(jg,{activeTab:i})})},"performance"),t.jsx("div",{children:i!=="configurations"&&(!(e!=null&&e.grouped[i])||(e==null?void 0:e.grouped[i].length)<=0)&&t.jsxs(Se.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"flex flex-col gap-8 items-center px-8 pt-40 w-full",children:[t.jsx("div",{children:t.jsx("img",{alt:"Good Job!",className:"w-64",src:M!=null&&M.page_optimizer_base?(M==null?void 0:M.page_optimizer_base)+"/success.svg":"/success.svg"})}),t.jsx("span",{className:"flex gap-2",children:"Brilliantly done! It's clear you've mastered this."})]})},"audit-blank"),t.jsx("div",{})]})})})]})},Td=({children:e,uuid:r})=>t.jsx(Se.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},children:e},r),ux=()=>{const{data:e,loading:r,error:n,activeReport:s}=ce(ve),{activeMetric:a}=xe();Tt(a==null?void 0:a.score);const{togglePerformance:o,options:i}=he(),d=l.useMemo(()=>{var v,j;let x=[...((v=e==null?void 0:e.grouped)==null?void 0:v.opportunities)||[],...((j=e==null?void 0:e.grouped)==null?void 0:j.diagnostics)||[]];return(a==null?void 0:a.refs.acronym)==="SI"?x.filter(y=>y.scoreDisplayMode!=="informative"):x.filter(y=>y.metrics.find(w=>w.id===(a==null?void 0:a.id)))},[e,a]),u=l.useMemo(()=>(a==null||a.refs.acronym,[a!=null&&a.potentialGain?t.jsxs(t.Fragment,{children:["Potential gain ",t.jsxs("span",{className:"text-brand-800 dark:text-brand-500 font-medium",children:[a==null?void 0:a.potentialGain.toFixed(0)," points"]})," "]}):null,t.jsxs(t.Fragment,{children:["Weighs ",t.jsxs("span",{className:"text-brand-800 dark:text-brand-500 font-medium",children:[a==null?void 0:a.refs.weight,"%"]})," of your page speed score"]})]),[a,s]),f={TBT:{description:"Imagine you're reading a storybook and there's a sticker covering some words. TBT, or Total Blocking Time, is like the time you wait for someone to remove that sticker. In websites, it's the time you wait before you can play or interact with the site. The shorter the wait, the better! ",learn_more:"https://web.dev/tbt/"},LCP:{description:"Imagine you're waiting for a picture in your storybook to appear. LCP, or Largest Contentful Paint, is like the time it takes for the biggest and most important picture in the story to fully show up. On websites, it's how long you wait to see the main part of the page. The faster it appears, the better the website is at showing you its main content quickly!",learn_more:"https://web.dev/lcp/"},FCP:{description:"Imagine opening a storybook, eager for the first picture. FCP, or First Contentful Paint, is the time it takes for that first image or word to appear. On websites, it's about how swiftly the starting content loads. The faster it appears, the sooner the website's story begins for you!",learn_more:"https://web.dev/fcp/"},SI:{description:"Imagine cookies baking. SI, or Speed Index, measures how fast most cookies are ready. On websites, it's how quickly main content appears. Faster cookies (or content) mean a better experience!",learn_more:"https://web.dev/si/"},CLS:{description:"While building a puzzle, imagine pieces suddenly shifting on their own. Confusing, right? CLS, or Cumulative Layout Shift, is like that for websites. It's when page elements move unexpectedly. The less they shift, the better the experience!",learn_more:"https://web.dev/cls/"}},m={mobile:{LCP:{good:2500,poor:4e3},FID:{good:100,poor:300},CLS:{good:.1,poor:.25},FCP:{good:1800,poor:3e3},SI:{good:3400,poor:5800},TBT:{good:300,poor:600}},desktop:{LCP:{good:2e3,poor:4e3},FID:{good:100,poor:300},CLS:{good:.1,poor:.25},FCP:{good:1e3,poor:3e3},SI:{good:1300,poor:2500},TBT:{good:200,poor:600}}};return a?t.jsxs(Td,{uuid:a!=null&&a.id?a.id:"no-key",children:[t.jsx("div",{className:"ml-6",children:!o&&t.jsx(Fs,{})}),t.jsxs("div",{className:"flex flex-col gap-3 lg:mt-16 ml-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 border-b pb-6",children:[t.jsxs("div",{className:"text-4xl font-medium",children:[" ",a==null?void 0:a.title]}),t.jsxs("div",{className:"dark:text-brand-300 text-brand-600 text-md ",children:[t.jsx("span",{children:f[a.refs.acronym].description})," ",t.jsx("a",{target:"_blank",className:"text-purple-750",href:f[a==null?void 0:a.refs.acronym].learn_more,children:"Learn more"})]}),t.jsx("div",{children:t.jsxs("ul",{className:"flex ml-2 items-center text-sm gap-3 text-brand-500 dark:text-brand-400",children:[t.jsxs("li",{className:"flex items-center gap-1.5",children:[t.jsx(Ee,{style:{fill:Tt(a==null?void 0:a.score)[1]},className:"w-3 stroke-none mt-[1px] dark:fill-brand-700"})," ",t.jsxs("span",{children:[(a==null?void 0:a.icon)==="pass"&&t.jsxs(t.Fragment,{children:["Great! You kept it below ",t.jsxs("span",{className:"text-brand-800 dark:text-brand-500 font-medium",children:[m[s][a==null?void 0:a.refs.acronym].good,a.refs.acronym!=="CLS"&&"ms"]})]}),((a==null?void 0:a.icon)==="fail"||(a==null?void 0:a.icon)==="average")&&t.jsxs(t.Fragment,{children:["Should be below ",t.jsxs("span",{className:"text-brand-800 dark:text-brand-500 font-medium",children:[m[s][a==null?void 0:a.refs.acronym].good,a.refs.acronym!=="CLS"&&"ms"]})]})]})]}),u.map((x,v)=>x&&t.jsxs("li",{className:"group flex gap-1.5 items-center",children:[t.jsx(Ee,{className:"w-3 stroke-none mt-[1px] group-last:fill-brand-300 fill-green-600 :fill-brand-300 dark:fill-green-700"})," ",t.jsx("span",{children:x})]},v))]})})]}),d.length>0?t.jsxs("div",{className:"flex gap-4 flex-col w-full",children:[t.jsx("div",{className:"borderx-b px-4 w-full font-medium text-lg",children:"Related Audits"}),t.jsx("div",{className:"flex flex-col gap-4",children:d.map((x,v)=>t.jsx("div",{className:"relative",children:t.jsx(nd,{metrics:!1,index:v,audit:x})},v))})]}):t.jsxs(Se.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"flex flex-col gap-8 items-center px-8 pt-40 w-full",children:[t.jsx("div",{children:t.jsx("img",{alt:"Good Job!",className:"w-64",src:i!=null&&i.page_optimizer_base?(i==null?void 0:i.page_optimizer_base)+"/success.svg":"/success.svg"})}),t.jsx("span",{className:"flex gap-2",children:"Brilliantly done! It's clear you've mastered this."})]})]})]}):t.jsx(t.Fragment,{})},fx=de.memo(ux);function px(){const{data:e,loading:r,error:n,testMode:s}=ce(ve);Tt(e==null?void 0:e.performance);const{dispatch:a,activeMetric:o}=xe(),{options:i,savingData:d,togglePerformance:u,optimizerContainer:f,invalidatingCache:m}=he();let x=i==null?void 0:i.optimizer_url;return l.useEffect(()=>{if(d){const v=document.getElementById("rapidload-page-optimizer-content");v==null||v.scrollTo(0,0)}},[d]),t.jsxs(Se.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:"linear",duration:.04},id:"rapidload-page-optimizer-wrapper",translate:"no",className:S(" bg-white font-sans overflow-hidden fixed z-[100000] w-screen h-screen top-0 left-0 flex min-h-screen flex-col text-base items-center ","dark:text-brand-300 text-brand-800","notranslate"),children:[t.jsx(Ve,{children:s&&t.jsx(Se.div,{initial:{borderWidth:"0px"},animate:{borderWidth:"5px"},exit:{borderWidth:"0px"},transition:{duration:.5},className:S("absolute inset-0 z-[110002] pointer-events-none","border-solid border-[#f7b250] rounded-none"),children:t.jsx("div",{className:S("absolute -inset-[3px] rounded-xl","border-[3px] border-[#f7b250]")})})}),t.jsx(c1,{url:x}),t.jsx("div",{id:"rapidload-page-optimizer-content",className:S("overflow-y-auto scrollbar-stable w-full h-fit pb-20 -mt-[70px] ","dark:bg-brand-900 bg-brand-200/60 min-h-screen",d&&"relative overflow-hidden"),children:t.jsxs("section",{ref:f,className:S("relative container grid grid-cols-none lg:grid-cols-12 lg:grid-rows-0 gap-6 pt-[72px] mt-4"),children:[(d||m)&&t.jsx("div",{className:"fixed inset-0 flex justify-center items-center z-[110000] bg-brand-50/80 dark:bg-brand-950/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",children:t.jsxs("div",{className:"fixed top-1/2 flex gap-2 items-center justify-center",children:[t.jsx(Ge,{className:"w-5 animate-spin"}),d&&"Saving Changes...",m&&"Flushing Cache..."]})}),t.jsx("div",{className:"col-span-12 w-full"}),t.jsxs(t.Fragment,{children:[u&&t.jsxs("aside",{className:"col-span-12 lg:col-span-3",children:[t.jsxs("div",{className:"text-lg ml-5 flex items-center gap-2",children:["Page Insights ",u&&t.jsx(Fs,{})," "]}),t.jsx("div",{className:"widgets pt-4 flex",children:t.jsx($1,{})})]}),t.jsx("article",{className:S(u?"col-span-12 lg:col-span-9":"col-span-12"),children:t.jsx(Ve,{initial:!0,mode:"wait",children:o?t.jsx(fx,{}):t.jsx(Td,{uuid:"perf",children:t.jsx(dx,{})})})})]})]})}),t.jsx(Kc,{})]})}var Pd={exports:{}};(function(e,r){(function(n){e.exports=n()})(function(){var n=["navigation","request","process","log","user","state","error","manual"],s=function(c,p,g){for(var h=g,b=0,C=c.length;b=c&&g<=p}},x=function(c){return typeof c=="function"||i(c)&&a(c,function(p){return typeof p=="function"}).length===c.length},v=function(c){return typeof c=="string"&&!!c.length},j={},y=function(){return{unhandledExceptions:!0,unhandledRejections:!0}};j.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:v},appVersion:{defaultValue:function(){},message:"should be a string",validate:function(c){return c===void 0||v(c)}},appType:{defaultValue:function(){},message:"should be a string",validate:function(c){return c===void 0||v(c)}},autoDetectErrors:{defaultValue:function(){return!0},message:"should be true|false",validate:function(c){return c===!0||c===!1}},enabledErrorTypes:{defaultValue:function(){return y()},message:"should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",allowPartialObject:!0,validate:function(c){if(typeof c!="object"||!c)return!1;var p=f(c),g=f(y());return!(a(p,function(h){return o(g,h)}).length0)}},onError:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:x},onSession:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:x},onBreadcrumb:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:x},endpoints:{defaultValue:function(){return{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}},message:"should be an object containing endpoint URLs { notify, sessions }",validate:function(c){return c&&typeof c=="object"&&v(c.notify)&&v(c.sessions)&&a(f(c),function(p){return!o(["notify","sessions"],p)}).length===0}},autoTrackSessions:{defaultValue:function(c){return!0},message:"should be true|false",validate:function(c){return c===!0||c===!1}},enabledReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(c){return c===null||i(c)&&a(c,function(p){return typeof p=="string"}).length===c.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(c){return typeof c=="string"&&c.length}},maxBreadcrumbs:{defaultValue:function(){return 25},message:"should be a number ≤100",validate:function(c){return m(0,100)(c)}},enabledBreadcrumbTypes:{defaultValue:function(){return n},message:"should be null or a list of available breadcrumb types ("+n.join(",")+")",validate:function(c){return c===null||i(c)&&s(c,function(p,g){return p===!1?p:o(n,g)},!0)}},context:{defaultValue:function(){},message:"should be a string",validate:function(c){return c===void 0||typeof c=="string"}},user:{defaultValue:function(){return{}},message:"should be an object with { id, email, name } properties",validate:function(c){return c===null||c&&s(f(c),function(p,g){return p&&o(["id","email","name"],g)},!0)}},metadata:{defaultValue:function(){return{}},message:"should be an object",validate:function(c){return typeof c=="object"&&c!==null}},logger:{defaultValue:function(){},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(c){return!c||c&&s(["debug","info","warn","error"],function(p,g){return p&&typeof c[g]=="function"},!0)}},redactedKeys:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(c){return i(c)&&c.length===a(c,function(p){return typeof p=="string"||p&&typeof p.test=="function"}).length}},plugins:{defaultValue:function(){return[]},message:"should be an array of plugin objects",validate:function(c){return i(c)&&c.length===a(c,function(p){return p&&typeof p=="object"&&typeof p.load=="function"}).length}},featureFlags:{defaultValue:function(){return[]},message:'should be an array of objects that have a "name" property',validate:function(c){return i(c)&&c.length===a(c,function(p){return p&&typeof p=="object"&&typeof p.name=="string"}).length}}};var w=function(c){for(var p=1;p-1&&(E=E.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var F=E.replace(/^\s+/,"").replace(/\(eval code/g,"("),I=F.match(/ (\((.+):(\d+):(\d+)\)$)/);F=I?F.replace(I[0],""):F;var H=F.split(/\s+/).slice(1),P=this.extractLocation(I?I[1]:H.pop()),ee=H.join(" ")||void 0,se=["eval",""].indexOf(P[0])>-1?void 0:P[0];return new p({functionName:ee,fileName:se,lineNumber:P[1],columnNumber:P[2],source:E})},this)},parseFFOrSafari:function(N){var R=N.stack.split(`
-`).filter(function(E){return!E.match(b)},this);return R.map(function(E){if(E.indexOf(" > eval")>-1&&(E=E.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),E.indexOf("@")===-1&&E.indexOf(":")===-1)return new p({functionName:E});var F=/((.*".+"[^@]*)?[^@]*)(?:@)/,I=E.match(F),H=I&&I[1]?I[1]:void 0,P=this.extractLocation(E.replace(F,""));return new p({functionName:H,fileName:P[0],lineNumber:P[1],columnNumber:P[2],source:E})},this)},parseOpera:function(N){return!N.stacktrace||N.message.indexOf(`
+ `}function h1(e){var r=e.counterClockwise,n=e.dashRatio,s=e.pathRadius,a=Math.PI*2*s,o=(1-n)*a;return{strokeDasharray:a+"px "+a+"px",strokeDashoffset:(r?-o:o)+"px"}}var g1=function(e){d1(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.prototype.getBackgroundPadding=function(){return this.props.background?this.props.backgroundPadding:0},r.prototype.getPathRadius=function(){return qa-this.props.strokeWidth/2-this.getBackgroundPadding()},r.prototype.getPathRatio=function(){var n=this.props,s=n.value,a=n.minValue,o=n.maxValue,i=Math.min(Math.max(s,a),o);return(i-a)/(o-a)},r.prototype.render=function(){var n=this.props,s=n.circleRatio,a=n.className,o=n.classes,i=n.counterClockwise,d=n.styles,u=n.strokeWidth,f=n.text,m=this.getPathRadius(),x=this.getPathRatio();return l.createElement("svg",{className:o.root+" "+a,style:d.root,viewBox:"0 0 "+f1+" "+p1,"data-test-id":"CircularProgressbar"},this.props.background?l.createElement("circle",{className:o.background,style:d.background,cx:qn,cy:Wn,r:qa}):null,l.createElement(Wa,{className:o.trail,counterClockwise:i,dashRatio:s,pathRadius:m,strokeWidth:u,style:d.trail}),l.createElement(Wa,{className:o.path,counterClockwise:i,dashRatio:x*s,pathRadius:m,strokeWidth:u,style:d.path}),f?l.createElement("text",{className:o.text,style:d.text,x:qn,y:Wn},f):null)},r.defaultProps={background:!1,backgroundPadding:0,circleRatio:1,classes:{root:"CircularProgressbar",trail:"CircularProgressbar-trail",path:"CircularProgressbar-path",text:"CircularProgressbar-text",background:"CircularProgressbar-background"},counterClockwise:!1,className:"",maxValue:100,minValue:0,strokeWidth:8,styles:{root:{},trail:{},path:{},text:{},background:{}},text:""},r}(l.Component);function x1(e){e.children;var r=u1(e,["children"]);return l.createElement("div",{"data-test-id":"CircularProgressbarWithChildren"},l.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},l.createElement(g1,Kn({},r)),e.children?l.createElement("div",{"data-test-id":"CircularProgressbarWithChildren__children",style:{position:"absolute",width:"100%",height:"100%",marginTop:"-100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},e.children):null))}function v1(e){var r=e.rotation,n=e.strokeLinecap,s=e.textColor,a=e.textSize,o=e.pathColor,i=e.pathTransition,d=e.pathTransitionDuration,u=e.trailColor,f=e.backgroundColor,m=r==null?void 0:"rotate("+r+"turn)",x=r==null?void 0:"center center";return{root:{},path:cr({stroke:o,strokeLinecap:n,transform:m,transformOrigin:x,transition:i,transitionDuration:d==null?void 0:d+"s"}),trail:cr({stroke:u,strokeLinecap:n,transform:m,transformOrigin:x}),text:cr({fill:s,fontSize:a}),background:cr({fill:f})}}function cr(e){return Object.keys(e).forEach(function(r){e[r]==null&&delete e[r]}),e}const Tt=e=>{const[r,n]=l.useState("fail"),[s,a]=l.useState("transparent"),[o,i]=l.useState("transparent"),d=l.useCallback((u=null)=>{const m=u||e;return!m||m<50?(a("#ff4e43"),i(`rgb(255, 51, 51, ${.08} )`),n("fail")):m<90?(a("#FFAA33"),i(`rgb(255, 170, 51, ${.08})`),n("average")):m<101&&(a("#09B42F"),i(`rgb(9, 180, 4, ${.08})`),n("pass")),[r,s,o]},[e]);return l.useEffect(()=>{d()},[]),l.useEffect(()=>{d()},[e]),[r,s,o,d]},Za=["Initiating analysis","Fetching assets","Running PageSpeed Insights","Analyzing performance","Evaluating metrics","Compiling results","Almost done"],b1=({performance:e,className:r,scoreClassName:n,background:s=!0,stroke:a=4,children:o,animate:i=!0,loading:d=!1})=>{const[u,f]=l.useState(i?0:e||0),[m,x]=l.useState(-1),[v,j,b]=Tt(e),w=l.useCallback(()=>{if(e&&i){let T=0;const L=setInterval(()=>{T+=1,T<=e?f(T):clearInterval(L)},10);return()=>clearInterval(L)}},[e,i]),_=l.useCallback(()=>{if(d){x(0);const T=setInterval(()=>{x(L=>L>=Za.length-1?0:L+1)},7e3);return()=>clearInterval(T)}else x(-1)},[d]);l.useEffect(w,[w]),l.useEffect(_,[_]);const R=l.useMemo(()=>v1({pathColor:j,trailColor:s?"transparent":b,pathTransitionDuration:.5,strokeLinecap:"round",backgroundColor:b}),[j,s,b]);return t.jsx(x1,{strokeWidth:a,background:s,className:S("max-h-[176px] relative w-full align-middle",r,d&&"animate-spin"),styles:R,value:d?85:u,children:t.jsx(Ve,{initial:!1,children:t.jsxs("div",{style:{color:j},className:S("w-full flex flex-col items-center text-center text-4xl transition-all ease-out duration-300 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 font-bold",n,o&&"gap-1",d&&"gap-2"),children:[!d&&t.jsx("span",{children:u.toFixed(0)}),t.jsx(Ve,{mode:"wait",children:d&&m!==-1&&t.jsx(ke.span,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.3,ease:[.4,0,.2,1]},className:S("text-xs font-normal px-6"),children:d&&Za[m]},m)}),o&&t.jsx(ke.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},children:o},"children")]})})})},$s=de.memo(b1),y1=({metrics:e=[],performance:r})=>{const n=["First Contentful Paint","Largest Contentful Paint","Total Blocking Time","Cumulative Layout Shift","Speed Index"],s=e.sort((u,f)=>n.indexOf(u.title)-n.indexOf(f.title)),{dispatch:a,activeMetric:o,hoveredMetric:i}=ge(),{optimizerContainer:d}=ve();return l.useEffect(()=>{var u;o&&((u=d.current)==null||u.scrollIntoView({behavior:"smooth"}))},[o]),t.jsx("div",{className:"w-full lg:flex flex-col lg:grid-cols-none grid grid-cols-2 grid-rows-3",children:s.sort((u,f)=>f.potentialGain-u.potentialGain).map((u,f)=>t.jsxs("div",{onClick:m=>{a(ae("activeMetric",u))},onMouseEnter:()=>{const m=setTimeout(()=>{a(ae("hoveredMetric",u))},100);return()=>clearTimeout(m)},onMouseLeave:()=>{const m=setTimeout(()=>{a(ae("hoveredMetric",null))},100);return()=>clearTimeout(m)},className:S("lg:last:rounded-b-3xl select-none cursor-pointer dark:hover:bg-brand-900/50 hover:bg-brand-100/50 group flex flex-row justify-between items-center last:border-b-0 border-b lg:border-b-0 lg:border-t lg:even:border-l-0 even:border-l px-3 lg:px-6 py-2.5",u.id===(o==null?void 0:o.id)&&"bg-brand-100/80 dark:bg-brand-900/80 "),children:[t.jsxs("div",{className:"flex flex-col justify-between",children:[t.jsx("div",{className:"flex items-center gap-1.5 flex-row text-sm font-medium",children:t.jsxs("div",{className:"inline-flex flex-col",children:[t.jsx("span",{children:u.title}),t.jsx("span",{className:"text-xs text-brand-500 font-normal",children:u.potentialGain>1?t.jsxs(t.Fragment,{children:["Enhance this for ",t.jsxs("span",{className:"group-hover:text-green-600",children:[u.potentialGain.toFixed(0)," point boost."]})," "]}):"Looks great, well done!"})]})}),t.jsx("div",{style:{color:Tt(u.score)[1]},className:"text-lg font-medium text-brand-500",children:u.displayValue})]}),t.jsx("div",{className:"hidden xl:block",children:(i==null?void 0:i.id)===u.id?t.jsx("div",{className:S("flex items-center justify-center w-[36px] h-[36px] rounded-full bg-brand-200 dark:bg-brand-800"),children:t.jsx(Ri,{className:"w-4"})}):t.jsx("div",{className:S(""),children:t.jsx($s,{background:!1,stroke:10,scoreClassName:"text-[12px]",className:"h-9",performance:u.score})})})]},f))})},Bc=({action:e=!0})=>{const{theme:r,setTheme:n,changeTheme:s}=At();return t.jsx("div",{className:"cursor-pointer select-none",onClick:a=>e&&s(),children:r==="dark"?t.jsx(za,{className:"w-5"}):r==="light"?t.jsx(Zm,{className:"w-5"}):t.jsx(za,{className:"w-5"})})};let Xa={clear_cache:t.jsx(Ei,{className:"w-3.5"}),clear_page_cache:t.jsx(Li,{className:"w-5"}),clear_all_optimizations:t.jsx(Oi,{className:"w-3.5"}),clear_css_optimizations:t.jsx(Om,{className:"w-3.5"}),clear_js_optimizations:t.jsx(Pm,{className:"w-3.5"}),clear_font_optimizations:t.jsx(Um,{className:"w-3.5"}),default:t.jsx(zn,{className:"w-3.5"})};const w1=()=>{const{actions:e,settings:r}=ce(xe);ve();let[n,s]=l.useState(e.map(o=>({...o,loading:!1})));l.useEffect(()=>{s(e.map(o=>({...o,loading:!1})))},[e]);const a=async o=>{try{s(d=>d.map(u=>u.control_icon===o.control_icon?{...u,loading:!0}:u));let i=await fetch(o.action.replace(/&/g,"&"));Ue({duration:10,description:t.jsxs("div",{className:"flex w-full gap-2 text-center items-center",children:["Successfully completed ",t.jsx(Ai,{className:"w-5 text-green-600"})," "]})})}catch(i){Ue({duration:10,description:t.jsxs("div",{className:"flex w-full gap-2 text-center items-center",children:["An error occurred - ",i==null?void 0:i.message," ",t.jsx(Mm,{className:"w-5 text-red-600"})," "]})}),console.error(i)}s(i=>i.map(d=>d.control_icon===o.control_icon?{...d,loading:!1}:d))};return e?t.jsx("div",{className:"items-center justify-center flex py-1",children:n.filter(o=>o.category==="general").map(o=>t.jsx(Oe,{disabled:o.loading,onClick:i=>a(o),className:"rounded-[15px] ",variant:"ghost",children:t.jsxs("div",{className:"flex flex-col gap-1 items-center ",children:[o.loading?t.jsx("span",{children:t.jsx(Ge,{className:"motion-safe:animate-spin w-4"})}):Xa[o.control_icon]||Xa.default,t.jsx("span",{className:"text-xxs font-normal text-brand-500",children:o.control_label})]})},o.control_icon))}):t.jsx(t.Fragment,{})},Ya="titan-tour-prompt",j1=()=>{const{changeTheme:e}=At(),[r,n]=l.useState(()=>{const m=localStorage.getItem(Ya);return m?JSON.parse(m):!0}),{data:s,error:a,loading:o,revisions:i}=ce(xe),{dispatch:d,hoveredMetric:u,activeMetric:f}=ge();return l.useEffect(()=>{localStorage.setItem(Ya,JSON.stringify(r))},[r]),t.jsxs(it,{className:"flex items-center justify-center py-2 rounded-xl",children:[(s==null?void 0:s.loadingExperience)&&!f&&t.jsx(t.Fragment,{children:t.jsx(Oe,{"data-tour":"analyze",onClick:()=>{d(An("isTourOpen",!0)),n(!1)},className:"transition-none h-12 px-3 rounded-2xl border-none bg-transparent",variant:"outline",children:t.jsxs("div",{className:"flex flex-col gap-1 items-center",children:[t.jsx(Im,{className:S("w-5")}),t.jsx("span",{className:"text-xxs font-normal text-brand-500",children:"Get Started"})]})})}),t.jsx(Oe,{onClick:m=>e(),className:"transition-none h-12 px-3 rounded-2xl border-none bg-transparent",variant:"outline",children:t.jsxs("div",{className:"flex flex-col gap-1 items-center",children:[t.jsx(Bc,{}),t.jsx("span",{className:"text-xxs font-normal text-brand-500",children:"Theme"})]})}),t.jsx(w1,{})]})},_1=()=>{const[e,r]=l.useState(null),[n,s]=l.useState(""),[a,o]=l.useState(!1),[i,d]=l.useState(!1),{toast:u}=gt();l.useMemo(()=>[{Component:Cm,value:"annoyed"},{Component:Dm,value:"frown"},{Component:Vm,value:"meh"},{Component:Wm,value:"smile"},{Component:qm,value:"smilePlus"}],[]);const f=async()=>{if(!e)return;const m=new et;try{o(!0),await m.post("rapidload_titan_feedback",{smiley:e,detail:n}),u({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["Thank you! Your feedback is sent. ",t.jsx(Be,{className:"w-5 text-green-600"})]})}),o(!1),r(""),s(""),d(!1)}catch(x){u({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[x.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]})}),o(!1)}};return l.useEffect(()=>{e&&f()},[e]),l.useEffect(()=>{setTimeout(()=>{d(!0)},30*1)},[]),i?t.jsxs(it,{className:S("flex flex-col gap-4 px-6 py-5 bg-brand-0/70 rounded-xl"),children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("div",{className:"text-sm font-medium",children:"How was the experience?"}),t.jsx("div",{className:"text-xs text-brand-500",children:"Feedback helps us improve the product work better for you."})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(Oe,{onClick:m=>{r("good")},className:S(e==="good"&&"bg-brand-300"),variant:"outline",children:[a&&e==="good"?t.jsx(Ge,{className:"w-4 animate-spin"}):t.jsx(Ym,{className:"w-4"}),"Good"]}),t.jsxs(Oe,{onClick:m=>{r("bad")},className:S(e==="bad"&&"bg-brand-300"),variant:"outline",children:[a&&e==="bad"?t.jsx(Ge,{className:"w-4 animate-spin"}):t.jsx(Xm,{className:"w-4"}),"Bad"]})]})]}):t.jsx(t.Fragment,{})},Fs=()=>{const{options:e}=ve(),{dispatch:r}=ge(),{toast:n}=gt(),[s,a]=l.useState(null);let o=e==null?void 0:e.optimizer_url;return{handleTestModeSwitchChange:d=>new Promise(async(u,f)=>{try{r(ae("testModeStatus",d)),r(ae("testModeLoading",!0)),s&&clearTimeout(s);const m=setTimeout(async()=>{const x=await r(pm(e,o,String(d)));x.success?(r(ae("testModeLoading",!1)),n({description:t.jsxs("div",{className:"flex gap-2 text-left items-center",children:[t.jsx("div",{className:"h-12 w-12 flex bg-green-200 justify-center items-center rounded-lg",children:t.jsx(kl,{className:"h-6 w-6 text-green-600"})}),t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("span",{className:"font-semibold dark:text-brand-300",children:["Test Mode turned ",d?"on":"off"," successfully"]}),t.jsx("span",{className:"font-normal text-xs text-zinc-600 dark:text-brand-400",children:d?"Changes will not affect the live site.":"All changes will be applied to the live site."})]})]}),className:"p-3"})):(n({description:t.jsxs("div",{className:"flex gap-2 text-left items-center",children:[t.jsx("div",{className:"h-12 w-12 flex bg-red-200 justify-center items-center rounded-lg",children:t.jsx(Ml,{className:"h-6 w-6 text-red-600"})}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"font-semibold dark:text-brand-300",children:"Failed to turn on Test Mode"}),t.jsx("span",{className:"font-normal text-xs text-zinc-600 dark:text-brand-400",children:x.error})]})]}),className:"p-3"},5e5),r(ae("testModeStatus",!1)),r(ae("testModeLoading",!1))),u(x)},1e3);a(m)}catch(m){f(m)}})}};function C1({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M7.84 1.804A1 1 0 0 1 8.82 1h2.36a1 1 0 0 1 .98.804l.331 1.652a6.993 6.993 0 0 1 1.929 1.115l1.598-.54a1 1 0 0 1 1.186.447l1.18 2.044a1 1 0 0 1-.205 1.251l-1.267 1.113a7.047 7.047 0 0 1 0 2.228l1.267 1.113a1 1 0 0 1 .206 1.25l-1.18 2.045a1 1 0 0 1-1.187.447l-1.598-.54a6.993 6.993 0 0 1-1.929 1.115l-.33 1.652a1 1 0 0 1-.98.804H8.82a1 1 0 0 1-.98-.804l-.331-1.652a6.993 6.993 0 0 1-1.929-1.115l-1.598.54a1 1 0 0 1-1.186-.447l-1.18-2.044a1 1 0 0 1 .205-1.251l1.267-1.114a7.05 7.05 0 0 1 0-2.227L1.821 7.773a1 1 0 0 1-.206-1.25l1.18-2.045a1 1 0 0 1 1.187-.447l1.598.54A6.992 6.992 0 0 1 7.51 3.456l.33-1.652ZM10 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",clipRule:"evenodd"}))}const N1=l.forwardRef(C1);function S1({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const k1=l.forwardRef(S1);function E1({title:e,titleId:r,...n},s){return l.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":r},n),e?l.createElement("title",{id:r},e):null,l.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",clipRule:"evenodd"}))}const R1=l.forwardRef(E1),zc=({error:e,className:r})=>t.jsxs("div",{className:S("flex flex-col pt-3 gap-2",r),children:[t.jsx("div",{className:"w-fit",children:t.jsx(k1,{className:"w-8 fill-red-500"})}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"font-medium text-md ",children:"Oops! Something went wrong"}),t.jsxs("span",{className:"text-sm text-brand-700 dark:text-brand-300",children:["Refresh the page, If the error persists",t.jsx("br",{}),"please ",t.jsx("a",{target:"_blank",className:"text-purple-750",href:"https://rapidload.zendesk.com/hc/en-us",children:"contact support"})]}),t.jsxs("span",{className:"text-sm text-brand-500 dark:text-brand-200 border-t mt-2 pt-2 mb-6 max-w-[350px]",children:[t.jsx("span",{className:"font-medium text-brand-800 dark:text-brand-400",children:"Details:"})," ",e]})]})]}),M1=34,T1=({width:e=400,category:r})=>{const[n,s]=l.useState(!0);l.useEffect(()=>{s(!0);const i=setTimeout(()=>{s(!1)},80);return()=>clearTimeout(i)},[r,e]);const a=`M${Math.min(e-(e-66),e-9.5)} 1C${Math.min(e-(e-66),e-9.5)} 8.5 ${Math.min(e-(e-72),e-9.5)} 8 ${Math.min(e-(e-75.5),e-9.5)} 8C${Math.min(e-(e-89.7),e-9.5)} 8 ${Math.min(e-(e-130.5),e-9.5)} 8 ${e-9.5} 8C${e-5.5} 8 ${e-.5} 9.5 ${e-.5} 15.5`,o=2;return t.jsxs("div",{className:"absolute -left-7 top-0.5",children:[!n&&t.jsx("svg",{className:"absolute selectionBar",width:e,height:"16",viewBox:`0 0 ${e} 16`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-600 stroke-purple-800/10",d:a,strokeWidth:o})}),t.jsx("svg",{width:e,height:"16",viewBox:`0 0 ${e} 16`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-500 stroke-purple-600/10",d:a,strokeWidth:o})})]})},P1=({width:e=400,category:r})=>{const[n,s]=l.useState(!0);l.useEffect(()=>{s(!0);const i=setTimeout(()=>{s(!1)},80);return()=>clearTimeout(i)},[r,e]);const a=`M${Math.min(e-(e-66),e-9.5)} 1C${Math.min(e-(e-66),e-9.5)} 8.5 ${Math.min(e-(e-72),e-9.5)} 8 ${Math.min(e-(e-75.5),e-9.5)} 8C${Math.min(e-(e-89.7),e-9.5)} 8 ${Math.min(e-(e-130.5),e-9.5)} 8 ${e-9.5} 8C${e-5.5} 8 ${e-.5} 9.5 ${e-.5} 15.5`,o=2;return t.jsxs("div",{className:"absolute pl-11 -top-0.5",children:[!n&&t.jsx("svg",{className:"absolute selectionBar",width:e,height:"16",viewBox:`0 0 ${e} 16`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-600 stroke-brand-300/90",d:a,strokeWidth:o})}),t.jsx("svg",{width:e,height:"16",viewBox:`0 0 ${e} 16`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-500 stroke-brand-300/50",d:a,strokeWidth:o})})]})},A1=({cls:e})=>t.jsx("div",{className:"absolute -top-3 left-7",children:t.jsx("svg",{className:`${e}`,width:"62",height:"15",viewBox:"0 0 62 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-600 stroke-brand-300",d:"M1 0.5V1C1 4.86599 4.13401 8 8 8H54C57.866 8 61 11.134 61 15V15",stroke:"#D4D4D8",strokeWidth:"2"})})}),O1=({cls:e})=>t.jsx("svg",{className:`${e}`,width:M1,height:"40",viewBox:"0 0 8 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{className:"dark:stroke-brand-600 stroke-brand-300",d:"M0.5 0.5V12.5C0.5 17.5 4.3 17.5 7.5 17.5",strokeLinecap:"round",strokeLinejoin:"round"})}),L1=()=>{const{testMode:e}=ce(xe),[r,n]=l.useState(!1),{testModeStatus:s,testModeLoading:a,dispatch:o}=ge(),{handleTestModeSwitchChange:i}=Fs(),{options:d,mode:u}=ve(),{revisions:f}=ce(xe);l.useEffect(()=>{o(e&&u==="onboard"?ae("testModeStatus",!1):ae("testModeStatus",e))},[e,o]);const m=async x=>{await i(x)};return l.useEffect(()=>{n(a)},[s,a,e]),t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-2 justify-center",children:[t.jsx("div",{className:"w-fit",children:t.jsxs("div",{"data-tour":"test-mode",className:"select-none relative flex dark:bg-brand-800 py-0.5 pl-[2px] pr-[4px] rounded-2xl cursor-pointer bg-brand-0",children:[t.jsx(ke.span,{layoutId:"bubble",className:S("absolute w-[78px] rounded-[14px] border-2 border-brand-200/80 text-black -z-1 h-[44px] text-sm flex flex-col gap-2 px-3 py-2.5 font-medium dark:bg-brand-950",s&&"w-[110px] right-0.5 border-amber-500/80"),style:{borderRadius:14},transition:{type:"spring",bounce:0,duration:.6}}),t.jsxs("div",{onClick:async()=>{s&&await m(!1)},className:`relative z-1 items-center text-sm flex gap-2 px-3 py-2.5 font-medium rounded-2xl ${s?"text-brand-500":""}`,children:[t.jsx(Se,{className:S(`w-1.5 stroke-0 ${s?"fill-brand-300":"fill-green-600"} animate-ping absolute inline-flex opacity-75`)}),t.jsx(Se,{className:S(`w-1.5 stroke-0 ${s?"fill-brand-300":"fill-green-600"} relative inline-flex`)}),"Live"]}),t.jsx("div",{onClick:async()=>{s||await m(!0)},className:"relative justify-center items-center z-1 text-sm flex pl-6 pr-5 py-2.5 whitespace-nowrap font-medium rounded-2xl text-brand-500",children:"Test Mode"})]})}),t.jsx(ue,{text:r?"loading":"Preview",className:"dark:bg-brand-930/90",children:t.jsx("div",{onClick:()=>{!r&&window.open(d.optimizer_url+"?rapidload_preview","_blank")},className:`flex gap-2 items-center text-sm h-12 rounded-[14px] bg-brand-0 dark:bg-brand-930/90 px-4 py-2 ${(f==null?void 0:f.length)>0,""}`,"data-tour":"preview-button",children:r?t.jsx(Ge,{className:"w-5 animate-spin"}):t.jsx(fr,{className:"w-5 text-gray-500"})})})]}),t.jsx("div",{className:"relative mt-4 -mb-2 rotate-180 ",children:t.jsx(P1,{width:e?110:200})})]})},D1=({metric:e})=>{const[r,n,s,a]=Tt(e.score);return t.jsx("div",{style:{color:n||"#515151"},className:"text-md font-medium text-brand-500",children:e.displayValue})},I1=({pagespeed:e,priority:r=!0})=>{var O;const[n,s]=l.useState(!1),[a,o]=l.useState(!1),{data:i,error:d,reanalyze:u,revisions:f,loading:m}=ce(xe);l.useState(0);const[x,v]=l.useState(!1),{dispatch:j,hoveredMetric:b,activeMetric:w}=ge(),{options:_}=ve(),{settingsMode:R,testModeStatus:T,testModeLoading:L}=ge(),{testMode:$}=ce(H=>H.app);l.useState(null);const[X,V]=l.useState(($==null?void 0:$.status)||!1),[A,D]=l.useState(!1);Fs(),_==null||_.optimizer_url,l.useEffect(()=>{$&&j(ae("testModeStatus",$.status||!1))},[$]),l.useEffect(()=>{V(T),D(L)},[T,L]),l.useCallback(()=>{s(!n)},[n]);const z={LARGEST_CONTENTFUL_PAINT_MS:"LCP",FIRST_INPUT_DELAY_MS:"FID",CUMULATIVE_LAYOUT_SHIFT_SCORE:"CLS",FIRST_CONTENTFUL_PAINT_MS:"FCP",INTERACTION_TO_NEXT_PAINT:"INP",EXPERIMENTAL_TIME_TO_FIRST_BYTE:"TTFB"},Q=["LARGEST_CONTENTFUL_PAINT_MS","FIRST_INPUT_DELAY_MS","CUMULATIVE_LAYOUT_SHIFT_SCORE","FIRST_CONTENTFUL_PAINT_MS","INTERACTION_TO_NEXT_PAINT","EXPERIMENTAL_TIME_TO_FIRST_BYTE"],Y=H=>z[H]||H;Q.map(H=>{var oe,q;return{metricName:Y(H),metric:(oe=i==null?void 0:i.loadingExperience)!=null&&oe.metrics?(q=i==null?void 0:i.loadingExperience)==null?void 0:q.metrics[H]:null}});let Z=b,G=Number((O=Z!=null&&Z.potentialGain?Z==null?void 0:Z.potentialGain:0)==null?void 0:O.toFixed(0));const[te,k]=l.useState(1);return l.useEffect(()=>{k(H=>H+1)},[]),l.useEffect(()=>{a||j(ae("activeMetric",null))},[a]),t.jsx(t.Fragment,{children:t.jsxs("div",{className:"w-full flex flex-col gap-4",children:[t.jsx(L1,{}),t.jsxs(it,{"data-tour":"speed-insights",className:S("overflow-hidden border border-transparent flex flex-col sm:flex-row lg:flex-col justify-around",a&&"border-brand-200 dark:border-brand-800"),children:[t.jsx("div",{className:S("content px-4 relative flex w-full sm:w-1/2 lg:w-full flex-col justify-center items-center gap-3 py-2.5",!d&&"px-4 lg:px-4 lg:pb-0 xl:px-8"),children:d?t.jsx(zc,{error:d}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex gap-6",children:t.jsx("div",{className:"relative flex flex-col gap-3 px-4 items-center",children:t.jsx("div",{className:"mt-6",children:!i||x?t.jsx(Gt,{className:"w-44 h-44 rounded-full"}):t.jsx($s,{loading:u,performance:i!=null&&i.performance&&G&&Z?i.performance+G>=99?99:i.performance+G:i==null?void 0:i.performance,children:!!(Z&&G)&&t.jsxs("div",{className:"flex gap-1 flex-col text-xxs font-normal",children:[t.jsx("span",{children:Z==null?void 0:Z.title}),t.jsxs("span",{className:"text-sm text-green-600 -ml-1",children:["+",G]})]})})})})}),t.jsxs("div",{className:"flex flex-col text-center gap-1",children:[t.jsxs("div",{children:[Z?"Forecasted Score":"Performance"," "]}),t.jsx("div",{className:"text-xs text-brand-500 dark:text-brand-300 font-light",children:"Values are estimated and may vary with Google Page Speed Insights."})]}),t.jsxs("div",{className:"flex justify-around text-sm gap-4 font-normal w-full mb-5 text-brand-700 dark:text-brand-300",children:[t.jsxs("div",{className:"flex lg:flex-col xl:flex-row items-center gap-1",children:[t.jsx(Zt,{icon:"fail"}),"0-49"]}),t.jsxs("div",{className:"flex lg:flex-col xl:flex-row items-center gap-1",children:[t.jsx(Zt,{icon:"average"}),"50-89"]}),t.jsxs("div",{className:"flex lg:flex-col xl:flex-row items-center gap-1",children:[t.jsx(Zt,{icon:"pass"}),"89-100"]})]})]})}),t.jsxs("div",{className:"border-t",children:[t.jsxs(Oe,{onClick:H=>!m&&o(oe=>!oe),variant:"outline",className:S("select-none border-b border-l-0 border-t-0 border-r-0 rounded-none bg-transparent hover:bg-transparent text-center text-xs text-brand-600 py-2",a&&"border-b-0"),"data-tour":"expand-metrics",children:[a?"Collapse":"Expand"," Metrics"]}),(i==null?void 0:i.metrics)&&!a&&t.jsx(t.Fragment,{children:t.jsx("div",{className:"flex justify-around my-2 px-2",onMouseLeave:()=>j(ae("hoveredMetric",null)),children:i.metrics.map(H=>t.jsxs("div",{onMouseEnter:()=>j(ae("hoveredMetric",H)),className:`text-xs text-center flex flex-col\r
+ gap-0.5 px-2 py-2 bg-brand-100/20 hover:bg-brand-100 cursor-default rounded-[14px]`,children:[t.jsx("div",{className:"font-medium tracking-wider ",children:H.refs.acronym}),t.jsx(D1,{metric:H})]},H.id))})})]}),(i==null?void 0:i.metrics)&&a&&t.jsxs("div",{className:S("sticky top-0 w-full sm:w-1/2 lg:w-full border-l lg:border-l-0"),"data-tour":"metrics",children:[t.jsxs("div",{onClick:H=>j(ae("activeMetric",null)),className:S("flex gap-3 items-center font-medium dark:hover:bg-brand-900/70 px-6 py-3 border-b lg:border-b-0 lg:border-t cursor-pointer text-sm",!w&&"bg-brand-100/80 dark:bg-brand-900/80 "),children:[t.jsx("span",{children:t.jsx($m,{className:"w-4 text-brand-400"})})," All Audits"]}),t.jsx(y1,{performance:i==null?void 0:i.performance,metrics:i.metrics})]})]}),t.jsx(j1,{}),t.jsx(l.Suspense,{children:t.jsx(_1,{},te)})]})})},$1=de.memo(I1),F1=Hu,Vc=l.forwardRef(({className:e,...r},n)=>t.jsx(go,{ref:n,className:S("fixed top-0 z-[150000] flex max-h-screen w-fitt flex-col-reverse p-4 sm:bottom-0 sm:left-1/2 -translate-x-1/2 sm:top-auto sm:flex-col md:min-w-[400px]",e),...r}));Vc.displayName=go.displayName;const B1=tn("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-bottom-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background",destructive:"destructive group border-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Hc=l.forwardRef(({className:e,variant:r,...n},s)=>t.jsx(t.Fragment,{children:t.jsx(xo,{ref:s,className:S(B1({variant:r}),e),...n})}));Hc.displayName=xo.displayName;const z1=l.forwardRef(({className:e,...r},n)=>t.jsx(vo,{ref:n,className:S("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...r}));z1.displayName=vo.displayName;const Uc=l.forwardRef(({className:e,...r},n)=>t.jsx(bo,{ref:n,className:S("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...r,children:t.jsx(rn,{className:"h-4 w-4"})}));Uc.displayName=bo.displayName;const Gc=l.forwardRef(({className:e,...r},n)=>t.jsx(yo,{ref:n,className:S("text-sm font-semibold",e),...r}));Gc.displayName=yo.displayName;const Kc=l.forwardRef(({className:e,...r},n)=>t.jsx(wo,{ref:n,className:S("text-sm opacity-90",e),...r}));Kc.displayName=wo.displayName;function qc(){const{toasts:e}=gt();return t.jsxs(F1,{duration:3500,children:[e.map(function({id:r,title:n,description:s,action:a,...o}){return t.jsxs(Hc,{className:"flex justify-center text-brand-800 dark:text-brand-200",...o,children:[t.jsxs("div",{className:"grid gap-1",children:[n&&t.jsx(Gc,{children:n}),s&&t.jsx(Kc,{children:s})]}),a,t.jsx(Uc,{})]},r)}),t.jsx(Vc,{})]})}const Bs=()=>{const{togglePerformance:e,setTogglePerformance:r}=ve();return t.jsx(ue,{text:"Toggle Sidebar",children:t.jsx("span",{className:"cursor-pointer",onClick:()=>{r(n=>!n)},children:e?t.jsx(Nm,{className:"rotate-90 xl:rotate-0 h-4 w-4 text-gray-500"}):t.jsx(Sm,{className:"rotate-90 xl:rotate-0 h-4 w-4 text-gray-500"})})})},V1=({children:e,uuid:r="random",className:n})=>{const s={hidden:{opacity:0,scale:.9},visible:{opacity:1,scale:1}};return t.jsx(ke.div,{initial:"hidden",animate:"visible",exit:"hidden",variants:s,className:n,children:e},r)},H1=({content:e,className:r})=>{const n=e==null?void 0:e.split(/\[(.*?)\]\((.*?)\)/);return t.jsx("div",{className:S("text-sm py-0 px-2",r),children:n==null?void 0:n.map((s,a)=>{if(a%3===1){const o=n[a+1];return t.jsx("a",{className:"text-purple-750/80 dark:text-brand-500",href:o,target:"_blank",rel:"noopener noreferrer",children:s},a)}else return a%3===0?t.jsx("span",{children:s},a):null})})},U1=e=>e==="css"||e==="cdn"?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1),Wc=({audit:e,max:r=2,type:n,auditSettings:s,className:a,hideActions:o,children:i})=>{const{settings:d}=ce(xe),u=ot(),{activeTab:f,openCategory:m,openAudits:x}=ge();return n=ai(e,n),s||(s=e.settings),l.useCallback((v,j,b)=>{u(Ni(e,v,b,j))},[d]),t.jsx(t.Fragment,{children:s&&s.length>0&&t.jsxs("div",{className:S("flex flex-wrap gap-2 items-center",a),children:[i||"",s.filter(v=>n?v.category===n:!0).map((v,j)=>t.jsxs("div",{className:S("relative flex cursor-pointer gap-2 px-2 font-medium text-sm hover:bg-brand-100 dark:bg-brand-900 bg-brand-50 border w-fit rounded-xl items-center pr-2 py-1"),onClick:b=>{u(ae("openCategory",v.category)),u(ae("activeTab","configurations")),u(ae("activeMetric",null)),u(ae("auditsReturn",!0))},children:[t.jsx(b0,{className:S("h-6 w-6 text-gray-500")}),t.jsxs("span",{className:"normal-case",children:["Go ",m===v.category?"Back":""," to ",U1(v.category)," Settings"]})]}))]},s.join(","))})};var G1=function(r,n){for(var s=r.split("."),a=n.split("."),o=0;o<3;o++){var i=Number(s[o]),d=Number(a[o]);if(i>d)return 1;if(d>i)return-1;if(!isNaN(i)&&isNaN(d))return 1;if(isNaN(i)&&!isNaN(d))return-1}return 0};const K1=kr(G1),q1=tn("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Zc=l.forwardRef(({className:e,variant:r,...n},s)=>t.jsx("div",{ref:s,role:"alert",className:S(q1({variant:r}),e),...n}));Zc.displayName="Alert";const W1=l.forwardRef(({className:e,...r},n)=>t.jsx("h5",{ref:n,className:S("mb-1 font-medium leading-none tracking-tight",e),...r}));W1.displayName="AlertTitle";const Xc=l.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:S("text-sm [&_p]:leading-relaxed",e),...r}));Xc.displayName="AlertDescription";const Z1=({audit:e,group:r,open:n,setOpen:s,index:a})=>{var m,x;const o=typeof r.items[0].url!="string"&&((x=(m=r.items[0].url)==null?void 0:m.file_type)==null?void 0:x.label)||r.type;let i=l.useMemo(()=>{let v=o.toLowerCase();return v==="table"?"Additional Information":v==="unknown"?"Unattributable items":`${o} Files`},[r]);"grouped_items"in e.files&&e.files.grouped_items.length===1&&o.toLowerCase()==="unknown"&&(i="");let d=r.items;const u=d.filter(v=>!(v!=null&&v.passed))||[],f=d.filter(v=>v==null?void 0:v.passed)||[];return t.jsx(t.Fragment,{children:t.jsxs("div",{"data-tour":`${e.id}-file-group-${a}-header`,className:S("flex flex-col xl:flex-row justify-between xl:items-center gap-3 xl:gap-2 font-medium text-sm capitalize px-4 py-3",n&&"border-b"),children:[t.jsxs("div",{className:"flex gap-2 items-center px-2",children:[t.jsx("div",{className:"flex gap-2",children:t.jsx(ue,{asChild:!0,text:`${n?"Hide":"Show"} ${i??i}`,children:t.jsxs("button",{className:"flex gap-2",onClick:v=>s(j=>!j),children:[n?t.jsx(Vn,{className:"w-5 h-5 dark:text-brand-500 text-brand-900"}):t.jsx(Rl,{className:"w-5 h-5 dark:text-brand-500 text-brand-900"}),t.jsx("span",{children:i||"Related Resources"})]})})}),t.jsxs("div",{className:"opacity-50 text-xs",children:[u.length>0&&t.jsxs("span",{children:[u.length," Resource",u.length>1?"s":""]}),u.length>0&&f.length>0&&", ",f.length>0&&t.jsxs("span",{children:[f.length," Optimized Resource",f.length>1?"s":""]})]})]}),e.settings.length>0&&t.jsx("div",{"data-tour":`${e.id}-group-${a}-settings`,className:"flex flex-col gap-3 xl:px-4",children:t.jsx(Wc,{type:r.type,audit:e})})]})})},X1=({id:e="auditContent",isOpen:r,initialRender:n=!1,children:s,onAnimationComplete:a,onHeightChange:o,className:i,...d})=>{const[u,f]=l.useState(!n),m=l.useRef(null),x={open:{height:"auto",opacity:1,overflow:"visible"},closed:{height:0,opacity:0,overflow:"hidden"}};return l.useEffect(()=>{f(!1)},[]),t.jsx(Ve,{mode:"wait",children:r&&t.jsx(ke.div,{ref:m,className:S("w-full",i),variants:x,transition:{duration:.1},initial:u?"open":"closed",animate:"open",exit:"closed",...d,children:s},e)})},ln=de.memo(X1),Y1=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],J1=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Q1=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],eg=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Ja=(e,r,n)=>{let s=e;return typeof r=="string"||Array.isArray(r)?s=e.toLocaleString(r,n):(r===!0||n!==void 0)&&(s=e.toLocaleString(void 0,n)),s};function Yc(e,r){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);r={bits:!1,binary:!1,space:!0,...r};const n=r.bits?r.binary?eg:Q1:r.binary?J1:Y1,s=r.space?" ":"";if(r.signed&&e===0)return` 0${s}${n[0]}`;const a=e<0,o=a?"-":r.signed?"+":"";a&&(e=-e);let i;if(r.minimumFractionDigits!==void 0&&(i={minimumFractionDigits:r.minimumFractionDigits}),r.maximumFractionDigits!==void 0&&(i={maximumFractionDigits:r.maximumFractionDigits,...i}),e<1){const m=Ja(e,r.locale,i);return o+m+s+n[0]}const d=Math.min(Math.floor(r.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(r.binary?1024:1e3)**d,i||(e=e.toPrecision(3));const u=Ja(Number(e),r.locale,i),f=n[d];return o+u+s+f}function tg(e){if(typeof e!="number")throw new TypeError("Expected a number");const r=e>0?Math.floor:Math.ceil;return{days:r(e/864e5),hours:r(e/36e5)%24,minutes:r(e/6e4)%60,seconds:r(e/1e3)%60,milliseconds:r(e)%1e3,microseconds:r(e*1e3)%1e3,nanoseconds:r(e*1e6)%1e3}}const rg=(e,r)=>r===1?e:`${e}s`,ng=1e-7;function sg(e,r={}){if(!Number.isFinite(e))throw new TypeError("Expected a finite number");r.colonNotation&&(r.compact=!1,r.formatSubMilliseconds=!1,r.separateMilliseconds=!1,r.verbose=!1),r.compact&&(r.secondsDecimalDigits=0,r.millisecondsDecimalDigits=0);const n=[],s=(i,d)=>{const u=Math.floor(i*10**d+ng);return(Math.round(u)/10**d).toFixed(d)},a=(i,d,u,f)=>{if((n.length===0||!r.colonNotation)&&i===0&&!(r.colonNotation&&u==="m"))return;f=(f||i||"0").toString();let m,x;if(r.colonNotation){m=n.length>0?":":"",x="";const v=f.includes(".")?f.split(".")[0].length:f.length,j=n.length>0?2:1;f="0".repeat(Math.max(0,j-v))+f}else m="",x=r.verbose?" "+rg(d,i):u;n.push(m+f+x)},o=tg(e);if(a(Math.trunc(o.days/365),"year","y"),a(o.days%365,"day","d"),a(o.hours,"hour","h"),a(o.minutes,"minute","m"),r.separateMilliseconds||r.formatSubMilliseconds||!r.colonNotation&&e<1e3)if(a(o.seconds,"second","s"),r.formatSubMilliseconds)a(o.milliseconds,"millisecond","ms"),a(o.microseconds,"microsecond","µs"),a(o.nanoseconds,"nanosecond","ns");else{const i=o.milliseconds+o.microseconds/1e3+o.nanoseconds/1e6,d=typeof r.millisecondsDecimalDigits=="number"?r.millisecondsDecimalDigits:0,u=i>=1?Math.round(i):Math.ceil(i),f=d?i.toFixed(d):u;a(Number.parseFloat(f),"millisecond","ms",f)}else{const i=e/1e3%60,d=typeof r.secondsDecimalDigits=="number"?r.secondsDecimalDigits:1,u=s(i,d),f=r.keepDecimalsOnWholeSeconds?u:u.replace(/\.0+$/,"");a(Number.parseFloat(f),"second","s",f)}if(n.length===0)return"0"+(r.verbose?" milliseconds":"ms");if(r.compact)return n[0];if(typeof r.unitCount=="number"){const i=r.colonNotation?"":" ";return n.slice(0,Math.max(r.unitCount,1)).join(i)}return r.colonNotation?n.join(""):n.join(" ")}const Jc=({className:e,children:r})=>t.jsx(ue,{delay:0,text:t.jsx(t.Fragment,{children:r}),children:t.jsx(Se,{className:S("w-2.5 fill-blue-500 stroke-0",e)})}),ag=()=>t.jsx(Jc,{className:"animate-pulse fill-orange-500",children:t.jsxs("span",{className:"flex gap-2 items-center",children:[" ",t.jsx(Hm,{className:"w-4 animate-spin text-orange-500"}),"Optimization in progress"]})}),og=({cell:e})=>{var m;let[r,n]=l.useState(!1);const[s,a]=l.useState(null),[o,i]=l.useState(null);let d=e.getValue().url?e.getValue().url:e.getValue();if(!d)return t.jsx(t.Fragment,{});const u=d.includes("images.rapidload-cdn.io");let f="";return((m=e.table.options.meta)==null?void 0:m.type)==="image"&&e.table.options.columns.find(x=>x.id==="node")&&(f=e.row.getValue("node")),l.useEffect(()=>(d&&u&&(async()=>{try{const v=await fetch(d);if(!v.ok)throw new Error("Failed to fetch image");const j=await v.blob(),b=URL.createObjectURL(j);i({redirected:v.redirected,status:v.status,statusText:v.statusText}),a(b),n(!0)}catch{a(d),n(!0)}})(),()=>{s&&URL.revokeObjectURL(s)}),[d]),t.jsxs("div",{className:"flex items-center gap-3",children:[(o==null?void 0:o.redirected)&&((o==null?void 0:o.status)===302||(o==null?void 0:o.status)===307)&&u&&t.jsx(ag,{}),t.jsxs(Qr,{children:[t.jsx(en,{children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"w-6 h-6",children:t.jsx("div",{style:{backgroundImage:`url(${s||d})`},className:"w-6 h-6 bg-cover bg-center border rounded-md overflow-hidden"})}),d&&t.jsxs("a",{className:"text-left",target:"_blank",href:d,children:[t.jsx("span",{children:pr(d,40)}),t.jsx("span",{children:t.jsx(fr,{className:"ml-1.5 inline-block w-3.5"})})]})]})}),t.jsx(Qt,{className:"max-w-[768px] min-w-[32px] min-h-[32px]",children:t.jsxs("div",{className:"flex flex-row items-center gap-3 py-1",children:[t.jsxs("div",{className:"relative",children:[t.jsx("img",{alt:d,onError:()=>n(!0),onLoadCapture:()=>n(!0),className:"max-w-[160px]",src:s||d}),!r&&t.jsx("div",{className:"absolute left-1/2 -translate-y-1/2 top-1/2 -translate-x-1/2",children:t.jsx(Em,{className:"animate-spin text-purple-750 w-6"})})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{children:[(f==null?void 0:f.nodeLabel)!==(f==null?void 0:f.selector)&&t.jsx("span",{className:"ml-2 mb-2",children:d==null?void 0:d.nodeLabel}),t.jsx(Xt,{lang:"jsx",code:f==null?void 0:f.selector})]}),t.jsx(Xt,{code:f==null?void 0:f.snippet})]})]})})]})]})},ig=({audit:e,cell:r,heading:n})=>{var o;let s=r.getValue(),a=!1;return r.table.options.columns.find(i=>i.id==="passed")&&(a=r.row.getValue("passed")),!s.toString().startsWith("data:image")&&(si(e.id)||((o=s==null?void 0:s.file_type)==null?void 0:o.value)==="image")?t.jsx(og,{cell:r}):_p(s)?t.jsxs("a",{className:"text-left",target:"_blank",href:s,children:[t.jsx("span",{children:pr(s,60)}),t.jsx(fr,{className:"w-4 inline-block ml-2"})]}):typeof s=="object"&&typeof(s==null?void 0:s.url)=="string"?t.jsxs("a",{className:"text-left inline-flex items-center align-middle",target:"_blank",href:s.url,children:[a&&t.jsx("span",{className:"inline-flex gap-1 mr-1",children:t.jsx(ue,{text:"Successfully Optimized file",children:t.jsx(Be,{className:"w-5 inline-block text-green-600"})})}),t.jsxs("span",{className:"items-center gap-2",children:[pr(s.url,60)," ",t.jsx(fr,{className:"w-4 inline-block -mt-0.5"})]})]}):t.jsx("span",{children:s})},Qc=Wu,ed=Zu,td=Xu,zs=l.forwardRef(({className:e,children:r,...n},s)=>t.jsxs(jo,{ref:s,className:S("flex h-10 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[r,t.jsx(Uu,{asChild:!0,children:t.jsx(Ti,{className:"h-4 w-4 opacity-50"})})]}));zs.displayName=jo.displayName;const Vs=l.forwardRef(({className:e,children:r,position:n="popper",...s},a)=>t.jsx(_o,{ref:a,className:S("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...s,children:t.jsx(Gu,{className:S("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})}));Vs.displayName=_o.displayName;const Hs=l.forwardRef(({className:e,...r},n)=>t.jsx(Co,{ref:n,className:S("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...r}));Hs.displayName=Co.displayName;const Us=l.forwardRef(({className:e,children:r,...n},s)=>t.jsxs(No,{ref:s,className:S("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Ku,{children:t.jsx(Mi,{className:"h-4 w-4"})})}),t.jsx(qu,{children:r})]}));Us.displayName=No.displayName;const lg=l.forwardRef(({className:e,...r},n)=>t.jsx(So,{ref:n,className:S("-mx-1 my-1 h-px bg-muted",e),...r}));lg.displayName=So.displayName;const cg=({audit:e,heading:r,cell:n})=>{var X;const{getValue:s,row:a}=n;let o=a.getValue("url"),i=s();const{data:d,settings:u,changes:f}=ce(xe);let m=f?f.files.filter(V=>V.file===o.url).map(V=>V.value):[];const x=(X=o==null?void 0:o.file_type)==null?void 0:X.value,v=l.useMemo(()=>{var V,A;return(A=(V=d==null?void 0:d.meta)==null?void 0:V.controls.dropdown_options.filter(D=>D.type==x)[0])==null?void 0:A.options},[d,x]);if((i==null?void 0:i.control_type)!=="dropdown"||!i)return t.jsx("span",{});const j=ot(),[b,w]=l.useState(i.value||"none"),_=l.useCallback(V=>{let A=b;w(V),j(mm(e,o.url?o.url:o,V,A))},[b,e,o,j]),R=V=>{switch(V){case"none":return"No Action";default:return V}},T=l.useCallback((V,A)=>{if(["javascript","js"].includes(A)){let D=u==null?void 0:u.find(z=>z.name==="Defer Javascript");if(D!=null&&D.inputs[0].value)return b==="defer"&&_("none"),V.filter(z=>z!=="defer")}return V},[u,b,_]),L=l.useMemo(()=>{const V=T(v,x);return V==null?void 0:V.map(A=>t.jsx(Us,{className:"capitalize cursor-pointer",value:A,children:R(A)},A))},[v,x,b,u]),$=l.useCallback(()=>{m!=null&&m.length&&_(m[0])},[m,_]);return v?t.jsxs("div",{"data-tour":`${e.id}-file-action-${a.index}`,className:"relative",children:[m&&m.length>0&&m[0]!==m[m.length-1]&&t.jsx("span",{className:"absolute -left-4 top-2",children:t.jsx(ue,{delay:0,text:t.jsxs("span",{className:"flex gap-2 items-center",children:["This action has been changed",t.jsxs("button",{onClick:$,className:"flex gap-2 border px-2 hover:bg-brand-100 dark:hover:bg-brand-800 rounded-xl text-xs items-center",children:[t.jsx(Jm,{className:"w-4 text-blue-500"})," Reset"]})]}),children:t.jsx(Se,{className:"w-2 fill-blue-500 stroke-0"})})}),t.jsxs(Qc,{value:b,onValueChange:_,children:[t.jsx(zs,{className:"w-[180px] capitalize",children:t.jsx(td,{placeholder:"Select action"})}),t.jsx(Vs,{"data-tour":`${e.id}-file-action-${a.index}-content`,className:"z-[100001]",children:t.jsxs(ed,{children:[t.jsx(Hs,{children:"Actions"}),L]})})]})]}):t.jsx(t.Fragment,{})},dg=({cell:e,heading:r})=>{var o,i,d,u;let n=e.getValue(),s=((i=(o=e.row.original)==null?void 0:o.subItems)==null?void 0:i.items[0])||{};if(!n)return t.jsx(t.Fragment,{});let a=n.snippet;return t.jsxs("div",{className:"text-xs p-3",children:[t.jsxs(Qr,{children:[t.jsx(en,{className:"w-full",children:t.jsx(Xt,{code:a})}),t.jsxs(Qt,{className:"flex flex-col",children:[(n==null?void 0:n.nodeLabel)!==(n==null?void 0:n.selector)&&t.jsx("span",{className:"ml-2 mb-2",children:n==null?void 0:n.nodeLabel}),t.jsx(Xt,{lang:"css",code:n==null?void 0:n.selector})]})]}),((d=r==null?void 0:r.subItemsHeading)==null?void 0:d.key)&&((u=r==null?void 0:r.subItemsHeading)==null?void 0:u.key)in s&&t.jsx("div",{className:"px-2 pt-2 min-w-max",children:s[r.subItemsHeading.key]})]})},ug=({cell:e})=>{let r=e.getValue();return t.jsx("div",{children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("a",{target:"_blank",className:"hover:text-purple-750",href:r.url,children:r.url}),t.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsx("span",{className:"opacity-90 text-blue-800 dark:text-brand-400 text-xs capitalize",children:r.urlProvider}),t.jsx(Se,{className:"w-1.5 fill-brand-600 stroke-none"}),t.jsxs("span",{className:"opacity-90 text-xs",children:[t.jsx("span",{className:"text-blue-800 dark:text-brand-400",children:"Code Location :"})," Line ",r.line,", Column ",r.column]})]})]})})},fg=({audit:e,heading:r,cell:n})=>{var o,i,d,u;let s=n.getValue(),a=((i=(o=n.row.original)==null?void 0:o.subItems)==null?void 0:i.items[0])||{};return!s&&a?t.jsx(t.Fragment,{children:((d=r==null?void 0:r.subItemsHeading)==null?void 0:d.key)&&((u=r==null?void 0:r.subItemsHeading)==null?void 0:u.key)in a&&t.jsx("div",{className:"px-2 pt-2 text-brand-500 dark:text-brand-300 min-w-max",children:a[r.subItemsHeading.key]})}):s?r.valueType==="url"?t.jsx(ig,{heading:r,audit:e,cell:n}):r.valueType==="controls"?t.jsx(cg,{cell:n,audit:e,heading:r}):r.valueType==="bytes"?t.jsx("span",{children:Yc(s)}):["ms","timespanMs"].includes(r.valueType)?t.jsx("span",{children:sg(n.getValue())}):r.valueType==="node"?t.jsx(dg,{heading:r,cell:n}):r.valueType==="numeric"&&typeof s=="number"?t.jsx("span",{children:Cp(s,r.granularity)}):r.valueType==="numeric"&&typeof s=="object"?t.jsx("span",{children:s.value}):r.valueType==="source-location"?t.jsx(ug,{cell:n}):typeof s=="object"?t.jsx("span",{children:JSON.stringify(s)}):r.valueType==="text"?t.jsx("span",{children:s}):t.jsx("span",{children:JSON.stringify(s)}):t.jsx(t.Fragment,{})},pg=(e,r,n,s)=>{const a=Ju(),o=`table_${e.id}`,i=l.useMemo(()=>r.map(f=>(f.key=f.key?f.key:f.label?f.label.toLowerCase():"no-key",a.accessor(m=>m[f.key],{id:f.key,meta:f,cell:m=>t.jsx(fg,{audit:e,heading:f,cell:m}),header:()=>t.jsx("span",{children:f.label}),enableHiding:!0}))),[r,e,a]),d=l.useMemo(()=>{let f={pattern:!1,file_type:!1,passed:!1};si(e.id)&&(f.node=!1);const m=n.flatMap(v=>Object.entries(v).filter(([j,b])=>b===""||typeof b=="object"&&Object.keys(b).length===0).map(([j])=>j));let x=Object.keys(n[0]);return x.includes("subItems")||(i.filter(v=>!x.includes(v.id?v.id:"")).forEach(v=>{v.id&&(f[v.id]=!1)}),m.forEach(v=>f[v]=!1)),f},[e.id,i,n]);return[Yu({data:n,columns:i,getCoreRowModel:Qu(),getPaginationRowModel:ef(),meta:{tableId:o,type:s},initialState:{pagination:{pageSize:5},columnVisibility:d},autoResetPageIndex:!1})]},mg=({audit:e,group:r,index:n})=>{var o,i;if(!((o=r==null?void 0:r.items)!=null&&o.length))return t.jsx(t.Fragment,{});const s=d=>{switch(d){case"timespanMs":case"ms":return"160px";case"bytes":return"140px";case"controls":return"200px";default:return"auto"}},[a]=pg(e,(r.headings?r.headings:(i=e==null?void 0:e.files)==null?void 0:i.headings)||[],r.items,r.type);return t.jsxs("div",{"data-tour":`${e.id}-group-${n}-table`,className:"px-4 py-3",children:[t.jsx("div",{className:"w-full border rounded-[20px] overflow-hidden",children:t.jsxs("table",{className:"w-full dark:text-brand-300 text-brand-800",children:[t.jsx("thead",{children:a==null?void 0:a.getHeaderGroups().map(d=>t.jsx("tr",{children:d.headers.map(u=>t.jsx("th",{className:"first:pl-6 px-2 py-3 dark:bg-brand-900 bg-brand-100 font-medium text-xs text-left",children:u.isPlaceholder?null:Na(u.column.columnDef.header,u.getContext())},u.id))},d.id))}),t.jsx("tbody",{children:a==null?void 0:a.getRowModel().rows.map(d=>t.jsx("tr",{className:S(),children:d.getVisibleCells().map(u=>{var f;return t.jsx("td",{style:{width:s((f=u.column.columnDef.meta)==null?void 0:f.valueType)},className:S("first:pl-4 py-2 border-t px-2 text-sm h-[50px] items-center"),children:Na(u.column.columnDef.cell,u.getContext())},u.id)})},d.id))})]})}),a.getPageCount()>1&&t.jsx("div",{className:"w-full flex justify-end pb-0 py-2",children:t.jsxs("ul",{className:"flex gap-1 items-center",children:[t.jsx("li",{onClick:d=>{a.previousPage()},className:S("disabled:opacity-30 hover:bg-brand-100 px-3 py-1 cursor-pointer rounded text-xs",!a.getCanPreviousPage()&&"opacity-30 cursor-no-drop"),children:t.jsx(km,{className:"w-4"})}),[...Array(a.getPageCount())].map((d,u)=>t.jsx("li",{className:S("dark:hover:bg-brand-700 hover:bg-brand-100 border px-3 py-1.5 cursor-pointer rounded text-xs",a.getState().pagination.pageIndex===u?"dark:bg-brand-600 bg-brand-200":""),onClick:()=>{a.setPageIndex(f=>u)},children:u+1},u)),t.jsx("li",{onClick:d=>{a.getCanNextPage()&&a.nextPage()},className:S("disabled:opacity-30 hover:bg-brand-100 px-3 py-1 cursor-pointer rounded text-xs",!a.getCanNextPage()&&"opacity-30 cursor-no-drop"),children:t.jsx(Pi,{className:"w-4"})})]})})]})},hg=de.memo(mg),Qa=({audit:e,index:r,group:n,type:s="table"})=>{const[a,o]=l.useState(s==="table"&&r===0||s==="list");return t.jsxs("div",{"data-tour":`${e.id}-group-${r}`,className:S("flex flex-col",s=="table"&&"border-t"),children:[s=="table"&&t.jsx("div",{className:S("flex flex-col gap-3 justify-center "),children:t.jsx(Z1,{index:r,audit:e,open:a,setOpen:o,group:n})}),t.jsx(ln,{isOpen:a,children:t.jsx(hg,{index:r,group:n,audit:e})})]})},rd=({node:e,isLastChild:r=!1,isRoot:n=!1})=>t.jsxs("div",{className:"relative pl-6",children:[!n&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"absolute top-0 left-2 h-3 border-l border-gray-300"}),t.jsx("div",{className:"absolute top-3 left-2 w-3 border-t border-gray-300"})]}),e.children&&!n&&t.jsx("div",{className:"absolute top-2.5 left-2 h-full border-l border-gray-300"}),!r&&!n&&t.jsx("div",{className:"absolute top-2.5 left-2 h-full border-l border-gray-300"}),t.jsx("div",{className:" mb-1",children:t.jsxs("a",{href:e.request.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex gap-1 text-xs text-brand-700 hover:text-purple-750",children:[t.jsxs("span",{children:[" ",pr(e.request.url,50,!1)]}),t.jsx("span",{className:"text-brand-400",children:Yc(e.request.transferSize)})]})}),e.children&&t.jsx("div",{children:Object.entries(e.children).map(([s,a],o,i)=>t.jsx(rd,{node:a,isLastChild:o===i.length-1},a.request.url))})]}),gg=({data:e})=>t.jsx("div",{className:"p-4",children:t.jsx(rd,{node:e,isRoot:!0})}),xg={"server-response-time":[t.jsxs(t.Fragment,{children:["Time spent should be less than ",t.jsx("span",{className:"text-brand-700 dark:text-brand-200",children:"600ms"}),"."]})],"dom-size":[t.jsxs(t.Fragment,{children:["Keep the number of DOM elements in the body section under ",t.jsx("span",{className:"text-brand-700 dark:text-brand-200",children:"800"}),"."]})]},vg=({audit:e,setHelpOpen:r})=>t.jsx(t.Fragment,{children:t.jsxs("div",{className:"absolute flex flex-col gap-3 bottom-0 w-full h-fit px-6 py-4 bg-brand-50 border z-50 rounded-3xl",children:[t.jsxs("div",{className:"flex items-center justify-between border-b pb-2",children:[t.jsx("h2",{className:"font-normal",children:"Why this audit is still not being resolved?"}),t.jsx("button",{onClick:n=>r(!1),children:t.jsx(rn,{className:"text-brand-500 w-5 h-5"})})]}),t.jsxs("div",{className:"py-2 px-2 text-sm",children:["This could be due to one or more of the following reasons",t.jsx("ul",{className:"list-disc pl-6 mt-1 text-brand-700/80",children:t.jsx("li",{children:"You have server-side caching on your website. Clear the server-side cache."})})]})]})}),nd=({audit:e,helpOpen:r,setHelpOpen:n})=>{var i,d,u,f,m,x,v,j;const{options:s}=ve();let a=l.useMemo(()=>e.settings.filter(b=>{var w,_;return!((_=(w=e.files)==null?void 0:w.grouped_items)!=null&&_.map(R=>ai(e,R.type)).includes(b.category))}),[]),o=l.useMemo(()=>xg[e.id]||[],[]);return t.jsxs("div",{className:"relative border-t w-full pt-4",children:[r&&t.jsx(vg,{setHelpOpen:n,audit:e}),t.jsx("div",{className:"pb-4 text-brand-700 dark:text-brand-300",children:t.jsxs("div",{className:"px-4 ml-2",children:[t.jsx(H1,{content:e.description}),K1(s.rapidload_version,"2.1.14")===1&&["bootup-time","unused-javascript"].includes(e.id)&&e.type==="passed_audit"&&t.jsxs(Zc,{className:"mt-4 flex items-center gap-2",children:[t.jsx("div",{children:t.jsx(Fm,{className:"h-5 w-5 text-blue-500"})}),t.jsxs(Xc,{className:"flex items-center gap-1",children:["You can exclude delayed javascript files using ",t.jsxs("span",{className:"flex items-center text-brand-900 font-medium",children:["RapidLoad dashboard ",t.jsx(Ri,{className:"w-4"})," Javascript"]})]})]}),o.length>0&&t.jsx("ul",{className:"px-3 mt-2 flex text-sm gap-3 text-brand-500 dark:text-brand-400",children:o.map((b,w)=>b&&t.jsxs("li",{className:"flex gap-1.5 items-center",children:[t.jsx(Se,{className:"w-2 stroke-none mt-[1px] fill-brand-300 dark:fill-brand-700"})," ",t.jsx("span",{children:b})]},w))})]})}),e.settings.length>0&&a.length>0&&t.jsx("div",{className:"border-t py-4 px-4",children:t.jsxs("div",{"data-tour":`${e.id}-recommended-settings`,className:"w-fit flex flex-col gap-3",children:[t.jsx("div",{className:"font-medium text-sm ml-2",children:e.settings.length!==a.length?"Additional Settings":"Recommended Settings"}),t.jsx(Wc,{audit:e,auditSettings:a})]})}),((i=e.files)==null?void 0:i.type)==="criticalrequestchain"&&t.jsx("div",{className:"border-t",children:t.jsx(gg,{data:(d=e.files)==null?void 0:d.chains[Object.keys(e.files.chains)[0]]})}),(((u=e.files)==null?void 0:u.type)==="opportunity"||((f=e.files)==null?void 0:f.type)==="table")&&((x=(m=e.files)==null?void 0:m.grouped_items)==null?void 0:x.map((b,w)=>t.jsx(Qa,{index:w,audit:e,group:b},w))),((v=e.files)==null?void 0:v.type)==="list"&&t.jsx(t.Fragment,{children:(j=e.files)==null?void 0:j.items.map((b,w)=>{var _;return(b==null?void 0:b.type)==="table"&&((_=b.items)==null?void 0:_.length)>0&&t.jsx(Qa,{index:w,audit:e,group:b,type:"list"},w)})})]})};nd.displayName="AuditContent";const bg=l.forwardRef(({audit:e,index:r,actions:n=!0,metrics:s=!0},a)=>{var R,T,L,$,X,V;ce(xe);const{dispatch:o,openAudits:i}=ge();l.useState(!1),l.useState(!1);const[d,u]=l.useState(!1),f=((T=(R=e.files)==null?void 0:R.items)==null?void 0:T.length)>0||e.settings.length>0,m=l.useRef(null),x=sf(m,{once:!0});if(!(e!=null&&e.id))return t.jsx(t.Fragment,{});const v=l.useMemo(()=>i.includes(e.id),[i]),j=l.useCallback(()=>{const D=i.includes(e.id)?i.filter(z=>z!==e.id):[...i,e.id];o(ae("openAudits",D))},[i]);let b=e.icon;e.type==="passed_audit"&&(b="pass");const w=()=>{var Q,Y;const A=((Y=(Q=e.files)==null?void 0:Q.items)==null?void 0:Y.length)||0,D=e.settings.length||0;if(A===0&&D===0)return"";let z="";return D>0&&(z+=` ${D} ${D===1?"Action":"Actions"}`),A>0&&(D>0&&(z+=", "),z+=` ${A} ${A===1?"Resource":"Resources"}`),`${z}`},_=l.useMemo(()=>e.settings.filter(A=>A.inputs[0].value),[e.settings]);return l.useMemo(()=>e.metrics.reduce((A,D)=>D.potentialGain+A,0),[e.metrics]),t.jsx("div",{id:`audit-${e.id}`,className:"w-full scroll-m-28",ref:m,children:t.jsx(Ve,{children:x&&t.jsx(ke.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:(r||1)*.005},className:"relative w-full",children:t.jsxs(it,{"data-tour":`audit-${e.id}`,spreader:!!(($=(L=e==null?void 0:e.files)==null?void 0:L.items)!=null&&$.length)&&!v,className:S("overflow-hidden w-full flex justify-center flex-col items-center p-0",v?"shadow-lg dark:shadow-brand-800/30":"dark:hover:border-brand-700/70 hover:border-brand-400/60"),children:[t.jsxs("div",{className:S("min-h-[56px] relative flex justify-between w-full py-2 px-4"),children:[t.jsxs("div",{className:"flex gap-3 font-normal items-center text-base",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-7 h-7 rounded-full dark:bg-brand-700 bg-brand-200/50",children:e.scoreDisplayMode==="informative"?t.jsx("span",{className:"w-3 h-3 border-2 border-brand-400/60 rounded-full"}):t.jsx(Zt,{icon:b})}),t.jsxs("div",{className:"flex flex-col justify-around",children:[t.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.name,s&&e.metrics&&t.jsx("div",{className:"flex gap-1.5 text-xxs",children:e.metrics.map((A,D)=>t.jsx("div",{children:(e.type!=="passed_audit"||e.scoreDisplayMode!=="informative")&&A.potentialGain>0?t.jsx(ue,{asChild:!0,text:e.type!=="passed_audit"&&e.scoreDisplayMode!=="informative"&&A.potentialGain>0&&`Potential +${A.potentialGain.toFixed(0)} Score Boost`,children:t.jsxs("div",{className:S("transition-colors flex gap-1 cursor-default hover:bg-brand-100 dark:hover:bg-brand-800 border py-1 px-1.5 rounded-md"),children:[A.refs.acronym,e.type!=="passed_audit"&&e.scoreDisplayMode!=="informative"&&A.potentialGain>0&&t.jsx(t.Fragment,{children:A.potentialGain>=.5&&t.jsxs("span",{className:S("text-green-800"),children:[" +",A.potentialGain.toFixed(0)]})})]},A.id)}):t.jsxs("div",{className:S("transition-colors flex gap-1 cursor-default hover:bg-brand-100 dark:hover:bg-brand-800 border py-1 px-1.5 rounded-md"),children:[A.refs.acronym,t.jsx(t.Fragment,{children:A.potentialGain>=.5&&t.jsxs("span",{className:S("text-green-800"),children:[" +",A.potentialGain.toFixed(0)]})})]},A.id)},D))}),_.length>0&&!v&&t.jsx(ue,{delay:0,text:t.jsxs("span",{className:"text-sm text-center",children:[_.length," Active Action",_.length>1?"s":""]}),className:"flex flex-col border gap-2 bg-white dark:bg-brand-950 rounded-lg py-2 px-2",children:t.jsxs("div",{onClick:()=>j(),className:S("cursor-pointer select-none text-xs text-brand-700 dark:text-brand-500 hover:bg-brand-100 dark:hover:bg-brand-800 transition-colors items-center flex gap-1.5 rounded-2xl",_.length>1&&"border py-0.5 px-2"),children:[_.length>1?_.length:"",t.jsx("div",{className:"bg-blue-500 w-1.5 h-1.5 shadow-lg rounded-full -right-1 -top-1"})]})})]}),t.jsxs("span",{className:"flex text-xxs leading-tight opacity-70",children:[e.displayValue&&t.jsx("span",{children:e.displayValue}),Dn]})]})]}),t.jsxs("div",{className:"flex gap-3 items-center",children:[!v&&(((V=(X=e.files)==null?void 0:X.items)==null?void 0:V.length)>0||e.settings.length>0)&&t.jsx("div",{className:"text-xs opacity-50",children:w()}),n&&t.jsx(ue,{text:f?"Show resources and actions":"Learn more about this audit",children:t.jsxs("div",{"data-tour":r===0?"audits-show-actions":void 0,onClick:()=>j(),className:`min-w-[125px] cursor-pointer flex items-center gap-2 pl-4 pr-2 py-1.5 text-sm rounded-2xl dark:hover:bg-brand-800 hover:bg-brand-100 transition-colors ${v?" dark:bg-brand-900 border ":"border "}`,children:[f?v?"Hide Actions":"Show Actions":"Learn More",f?v?t.jsx(Vn,{className:"w-6 h-6 dark:text-brand-500 text-brand-900"}):t.jsx(Rl,{className:"w-6 h-6 dark:text-brand-500 text-brand-900"}):v?t.jsx(Vn,{className:"w-6 h-6 dark:text-brand-500 text-brand-900"}):t.jsx(R1,{className:"w-6 h-6 dark:text-brand-500 text-brand-900"})]})})]})]}),t.jsx(ln,{id:e.id,className:"audit-content",initialRender:!0,isOpen:v,children:t.jsx(nd,{helpOpen:d,setHelpOpen:u,audit:e})})]})},e.id)})})}),sd=de.memo(bg),yg=()=>t.jsx(it,{spreader:!1,children:t.jsxs("div",{className:"w-full flex justify-between px-4 py-3 rounded-3xl text-center bg-white h-14",children:[t.jsxs("div",{className:"flex gap-2 items-center",children:[t.jsx("div",{className:"bg-brand-100 w-7 h-7 rounded-full animate-pulse"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:"flex gap-1",children:[t.jsx("div",{className:"bg-brand-100 w-64 h-6 rounded-lg animate-pulse"}),t.jsx("div",{className:"bg-brand-100 w-12 h-6 rounded-2xl border border-brand-200/50 animate-pulse"})]}),t.jsx("div",{className:"bg-brand-100 w-52 h-2 rounded-lg"})]})]}),t.jsxs("div",{className:"flex gap-3 items-center",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx("div",{className:"bg-brand-100 w-16 h-3 rounded-2xl"}),t.jsx("div",{className:"bg-brand-100 w-16 h-3 rounded-2xl"})]}),t.jsx("div",{className:"bg-brand-100 w-36 h-full rounded-2xl animate-pulse border"})]})]})}),wg=({activeTab:e})=>{const{data:r,loading:n,reanalyze:s,error:a}=ce(xe),o=l.useMemo(()=>r?(r==null?void 0:r.grouped)[e]||[]:[],[e,r]);return t.jsx(Ve,{initial:!1,children:n&&!s?new Array(5).fill(null).map((i,d)=>t.jsx(ke.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:d*.05},className:"relative",children:t.jsx(yg,{},d)},`${d}-${e}`)):o.map((i,d)=>t.jsx("div",{children:t.jsx(ke.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},transition:{delay:d*.005},className:"relative",children:t.jsx(sd,{index:d,audit:i})},d)},i.id))})},jg=de.memo(wg),_g=({cls:e})=>t.jsxs("svg",{className:`${e}`,width:"84",height:"75",viewBox:"0 0 74 65",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.7568 64.6651C49.946 63.7025 63.2062 49.2644 62.224 32.4198C62.0603 29.6926 61.5691 27.1258 60.7506 24.559L60.2595 24.8799C61.078 27.4467 61.5691 30.1739 61.5691 32.9011C61.5691 47.6601 49.2912 59.5315 34.2302 59.5315C33.7391 59.5315 33.248 59.5315 32.7568 59.5315V64.6651Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.41602 51.3504C10.982 59.3716 20.1496 64.3448 29.972 64.6656V59.2112C22.2778 57.9278 15.7295 54.5589 11.4731 47.9815L5.41602 51.3504Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.63385 20.3886C-1.2951 29.6932 -0.803979 40.1208 3.9435 48.9441L10.1643 45.4148C7.05392 38.8374 7.21763 31.2974 10.6555 24.8805L2.63385 20.3886Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.9723 0.335922C18.8403 1.61932 9.0179 8.19671 3.7793 17.8222L11.9646 22.4745C16.0573 16.5388 22.6055 12.849 29.8086 12.3677V0.335922H29.9723Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.9117 13.1694C54.1998 4.66694 43.7226 -0.306215 32.918 0.0146335V12.2069C38.8114 12.5277 44.2137 14.7737 48.4701 18.7843L60.9117 13.1694Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.4475 29.3722C34.5579 29.3722 37.1772 31.7785 37.1772 34.987C37.1772 38.0351 34.7216 40.6019 31.4475 40.6019C28.3371 40.6019 25.7178 38.1955 25.7178 34.987C25.7178 31.9389 28.3371 29.3722 31.4475 29.3722Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.4615 14.7733L50.436 26.1635L33.4106 37.3931L31.9372 34.8264L30.4639 32.2596L48.9627 23.5967L67.4615 14.7733Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M73.1907 11.7255L68.4433 16.5382H68.2795L68.1158 16.3778C67.9521 15.7361 67.7884 15.0944 67.461 14.6131C67.1336 14.1319 66.8062 13.6506 66.3151 13.1693C66.1514 13.1693 66.1514 13.0089 66.1514 12.8485C66.1514 12.8485 66.1514 12.8485 66.3151 12.688L73.027 11.0838C73.1907 11.0838 73.1907 11.0838 73.1907 11.2442C73.3544 11.5651 73.3544 11.7255 73.1907 11.7255Z",fill:"#673B9B"})]}),Cg=({cls:e})=>t.jsxs("svg",{className:`${e}`,width:"84",height:"75",viewBox:"0 0 74 65",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.7568 64.6651C49.946 63.7025 63.2062 49.2644 62.224 32.4198C62.0603 29.6926 61.5691 27.1258 60.7506 24.559L60.2595 24.8799C61.078 27.4467 61.5691 30.1739 61.5691 32.9011C61.5691 47.6601 49.2912 59.5315 34.2302 59.5315C33.7391 59.5315 33.248 59.5315 32.7568 59.5315V64.6651Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.41602 51.3504C10.982 59.3716 20.1496 64.3448 29.972 64.6656V59.2112C22.2778 57.9278 15.7295 54.5589 11.4731 47.9815L5.41602 51.3504Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.63385 20.3886C-1.2951 29.6932 -0.803979 40.1208 3.9435 48.9441L10.1643 45.4148C7.05392 38.8374 7.21763 31.2974 10.6555 24.8805L2.63385 20.3886Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.9723 0.335922C18.8403 1.61932 9.0179 8.19671 3.7793 17.8222L11.9646 22.4745C16.0573 16.5388 22.6055 12.849 29.8086 12.3677V0.335922H29.9723Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.9117 13.1694C54.1998 4.66694 43.7226 -0.306215 32.918 0.0146335V12.2069C38.8114 12.5277 44.2137 14.7737 48.4701 18.7843L60.9117 13.1694Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.4475 29.3722C34.5579 29.3722 37.1772 31.7785 37.1772 34.987C37.1772 38.0351 34.7216 40.6019 31.4475 40.6019C28.3371 40.6019 25.7178 38.1955 25.7178 34.987C25.7178 31.9389 28.3371 29.3722 31.4475 29.3722Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.4615 14.7733L50.436 26.1635L33.4106 37.3931L31.9372 34.8264L30.4639 32.2596L48.9627 23.5967L67.4615 14.7733Z",fill:"#673B9B"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M73.1907 11.7255L68.4433 16.5382H68.2795L68.1158 16.3778C67.9521 15.7361 67.7884 15.0944 67.461 14.6131C67.1336 14.1319 66.8062 13.6506 66.3151 13.1693C66.1514 13.1693 66.1514 13.0089 66.1514 12.8485C66.1514 12.8485 66.1514 12.8485 66.3151 12.688L73.027 11.0838C73.1907 11.0838 73.1907 11.0838 73.1907 11.2442C73.3544 11.5651 73.3544 11.7255 73.1907 11.7255Z",fill:"#673B9B"})]}),Ng=({cls:e})=>t.jsxs("svg",{className:`${e}`,width:"84",height:"75",viewBox:"0 0 74 65",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.7568 64.6651C49.946 63.7025 63.2062 49.2644 62.224 32.4198C62.0603 29.6926 61.5691 27.1258 60.7506 24.559L60.2595 24.8799C61.078 27.4467 61.5691 30.1739 61.5691 32.9011C61.5691 47.6601 49.2912 59.5315 34.2302 59.5315C33.7391 59.5315 33.248 59.5315 32.7568 59.5315V64.6651Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.41602 51.3504C10.982 59.3716 20.1496 64.3448 29.972 64.6656V59.2112C22.2778 57.9278 15.7295 54.5589 11.4731 47.9815L5.41602 51.3504Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.63385 20.3886C-1.2951 29.6932 -0.803979 40.1208 3.9435 48.9441L10.1643 45.4148C7.05392 38.8374 7.21763 31.2974 10.6555 24.8805L2.63385 20.3886Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.9723 0.335922C18.8403 1.61932 9.0179 8.19671 3.7793 17.8222L11.9646 22.4745C16.0573 16.5388 22.6055 12.849 29.8086 12.3677V0.335922H29.9723Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M60.9117 13.1694C54.1998 4.66694 43.7226 -0.306215 32.918 0.0146335V12.2069C38.8114 12.5277 44.2137 14.7737 48.4701 18.7843L60.9117 13.1694Z",fill:"#DDDFE4"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31.4475 29.3722C34.5579 29.3722 37.1772 31.7785 37.1772 34.987C37.1772 38.0351 34.7216 40.6019 31.4475 40.6019C28.3371 40.6019 25.7178 38.1955 25.7178 34.987C25.7178 31.9389 28.3371 29.3722 31.4475 29.3722Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.4615 14.7733L50.436 26.1635L33.4106 37.3931L31.9372 34.8264L30.4639 32.2596L48.9627 23.5967L67.4615 14.7733Z",fill:"#5B3786"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M73.1907 11.7255L68.4433 16.5382H68.2795L68.1158 16.3778C67.9521 15.7361 67.7884 15.0944 67.461 14.6131C67.1336 14.1319 66.8062 13.6506 66.3151 13.1693C66.1514 13.1693 66.1514 13.0089 66.1514 12.8485C66.1514 12.8485 66.1514 12.8485 66.3151 12.688L73.027 11.0838C73.1907 11.0838 73.1907 11.0838 73.1907 11.2442C73.3544 11.5651 73.3544 11.7255 73.1907 11.7255Z",fill:"#5B3786"})]}),Sg=34,kg=34,Lt=({children:e,bg:r="transparent"})=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Sg,height:kg,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:r}),e]}),Eg=()=>t.jsx(Lt,{children:t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 7.00689H8.07C7.53 7.00689 7.25 7.00689 7.16 7.16689C7.02665 7.35185 6.96938 7.58094 7 7.80689C7.00646 8.36465 6.97975 8.9223 6.92 9.47689C6.88923 9.73554 6.81127 9.98636 6.69 10.2169C6.52022 10.4949 6.28285 10.7254 6 10.8869C6.28821 11.0502 6.52669 11.2887 6.69 11.5769C6.85676 11.9408 6.94208 12.3366 6.94 12.7369L7 14.2969C7.00825 14.3648 7.03221 14.4299 7.07 14.4869C7.10698 14.5458 7.15868 14.5941 7.22 14.6269C7.48081 14.7409 7.76757 14.7824 8.05 14.7469H9.5V7.00689ZM11.9 14.7469H13.31C13.89 14.7469 14.11 14.7469 14.22 14.5969C14.3518 14.4297 14.416 14.2192 14.4 14.0069C14.3984 13.4154 14.4318 12.8244 14.5 12.2369C14.5414 11.9829 14.6295 11.7387 14.76 11.5169C14.9196 11.2689 15.1399 11.0658 15.4 10.9269C15.1402 10.7799 14.9151 10.5786 14.74 10.3369C14.6214 10.1426 14.5369 9.92958 14.49 9.70689C14.4433 9.24022 14.4133 8.80689 14.4 8.40689C14.3969 8.05251 14.3736 7.6986 14.33 7.34689C14.2882 7.24858 14.2141 7.16746 14.12 7.11689C13.858 7.02075 13.5781 6.98321 13.3 7.00689H11.9V14.7469Z",fill:"#BBBBBB",stroke:"#333333"})}),eo=()=>t.jsx(Lt,{children:t.jsx("path",{d:"M13.0614 8.4258L15.315 10.6924C15.4283 10.8063 15.4283 10.9909 15.315 11.1048L13.0614 13.3714M7.93851 13.3714L5.68491 11.1048C5.57166 10.9909 5.57166 10.8063 5.68491 10.6924L7.93851 8.4258M11.1662 6.70001L9.92659 15",stroke:"#333333",strokeLinecap:"round"})}),Rg=()=>t.jsxs(Lt,{children:[t.jsx("circle",{cx:"8.40002",cy:"12.6",r:"3",fill:"#BBBBBB",stroke:"#333333"}),t.jsx("circle",{cx:"13.6501",cy:"7.35004",r:"1.95",fill:"#BBBBBB",stroke:"#333333"})]}),Mg=()=>t.jsxs(Lt,{children:[t.jsx("path",{d:"M11.1095 12.9899C11.053 13.2628 10.9683 13.4416 10.8366 13.5357C10.7049 13.6298 10.4696 13.6674 10.1309 13.6674L10.0933 14.8153C10.7895 14.8153 11.3165 14.693 11.674 14.4296C12.0222 14.1661 12.2574 13.7239 12.3891 13.084L13.1042 9.405H13.904L14.1675 8.44526H13.2924L13.4053 7.89952C13.4618 7.5796 13.6688 7.41023 14.0263 7.41023C14.2522 7.41023 14.4498 7.44787 14.6003 7.50433L14.9955 6.48812C14.6944 6.3658 14.3463 6.29994 13.9511 6.29994C13.49 6.29994 13.0948 6.45049 12.7561 6.73277C12.4174 7.01504 12.2009 7.38201 12.1163 7.83365L11.9939 8.44526H11.2506L11.0624 9.405H11.8058L11.1095 12.9899Z",fill:"#333333"}),t.jsx("path",{d:"M6.30005 12.9617H7.67381L8.16309 10.4494H10.2049L10.4213 9.31085H8.38891L8.64296 8.00296H10.9388L11.1647 6.84562H7.49503L6.30005 12.9617Z",fill:"#333333"})]}),Tg=()=>t.jsxs(Lt,{children:[t.jsx("path",{d:"M7.70002 14.7C6.9279 14.7 6.26812 14.4244 5.72068 13.8731C5.17324 13.3219 4.89969 12.6481 4.90002 11.8519C4.90002 11.1694 5.09942 10.5612 5.49821 10.0275C5.89699 9.49374 6.41881 9.15249 7.06366 9.00374C7.27578 8.19874 7.70002 7.54686 8.33639 7.04811C8.97275 6.54936 9.69396 6.29999 10.5 6.29999C11.4928 6.29999 12.335 6.65664 13.0266 7.36994C13.7183 8.08324 14.064 8.95159 14.0637 9.97499C14.6491 10.045 15.135 10.3054 15.5212 10.7562C15.9074 11.207 16.1004 11.7341 16.1 12.3375C16.1 12.9937 15.8772 13.5516 15.4316 14.0112C14.986 14.4707 14.4451 14.7003 13.8091 14.7H7.70002Z",fill:"#BBBBBB",stroke:"#333333"}),t.jsx("path",{d:"M10.08 9.72018V13.3H9.36371V11.2299L9.38174 10.5172C9.26837 10.6369 9.18591 10.7194 9.13438 10.7647L8.7453 11.0939L8.40002 10.6396L10.08 9.09996V9.72018Z",fill:"#333333"}),t.jsx("path",{d:"M10.92 12.6798L10.92 9.09999L11.6363 9.09999L11.6363 11.1701L11.6183 11.8828C11.7316 11.7631 11.8141 11.6806 11.8656 11.6352L12.2547 11.3061L12.6 11.7604L10.92 13.3L10.92 12.6798Z",fill:"#333333"})]}),Pg=()=>t.jsxs(Lt,{children:[t.jsx("path",{d:"M16.1 8.89999H16.6V8.39999V8.29999C16.6 6.91928 15.4807 5.79999 14.1 5.79999H6.90002C5.51931 5.79999 4.40002 6.91928 4.40002 8.29999V8.39999V8.89999H4.90002H16.1Z",fill:"#BBBBBB",stroke:"#333333"}),t.jsx("path",{d:"M4.90002 8.59991H4.40002V9.09991V12.6999C4.40002 14.0806 5.51931 15.1999 6.90002 15.1999H14.1C15.4807 15.1999 16.6 14.0806 16.6 12.6999V9.09991V8.59991H16.1H4.90002Z",fill:"#BBBBBB",stroke:"#333333"}),t.jsx("path",{d:"M11.5 10L9.54585 11.3052L10.3377 11.7893L9.5 13L11.4542 11.7134L10.6633 11.2309L11.5 10Z",fill:"#333333"})]}),Dt=34,It=34,ad=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#7F54B3"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 7.00689H8.07C7.53 7.00689 7.25 7.00689 7.16 7.16689C7.02665 7.35185 6.96938 7.58094 7 7.80689C7.00646 8.36465 6.97975 8.9223 6.92 9.47689C6.88923 9.73554 6.81127 9.98636 6.69 10.2169C6.52022 10.4949 6.28285 10.7254 6 10.8869C6.28821 11.0502 6.52669 11.2887 6.69 11.5769C6.85676 11.9408 6.94208 12.3366 6.94 12.7369L7 14.2969C7.00825 14.3648 7.03221 14.4299 7.07 14.4869C7.10698 14.5458 7.15868 14.5941 7.22 14.6269C7.48081 14.7409 7.76757 14.7824 8.05 14.7469H9.5V7.00689ZM11.9 14.7469H13.31C13.89 14.7469 14.11 14.7469 14.22 14.5969C14.3518 14.4297 14.416 14.2192 14.4 14.0069C14.3984 13.4154 14.4318 12.8244 14.5 12.2369C14.5414 11.9829 14.6295 11.7387 14.76 11.5169C14.9196 11.2689 15.1399 11.0658 15.4 10.9269C15.1402 10.7799 14.9151 10.5786 14.74 10.3369C14.6214 10.1426 14.5369 9.92958 14.49 9.70689C14.4433 9.24022 14.4133 8.80689 14.4 8.40689C14.3969 8.05251 14.3736 7.6986 14.33 7.34689C14.2882 7.24858 14.2141 7.16746 14.12 7.11689C13.858 7.02075 13.5781 6.98321 13.3 7.00689H11.9V14.7469Z",fill:"#7148A2",stroke:"#E7E7E7"})]}),jr=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#FDC20A"}),t.jsx("path",{d:"M13.0614 8.4258L15.315 10.6924C15.4283 10.8063 15.4283 10.9909 15.315 11.1048L13.0614 13.3714M7.93851 13.3714L5.68491 11.1048C5.57166 10.9909 5.57166 10.8063 5.68491 10.6924L7.93851 8.4258M11.1662 6.70001L9.92659 15",stroke:"white",strokeLinecap:"round"})]}),od=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#11BFE6"}),t.jsx("circle",{cx:"8.40002",cy:"12.6",r:"3",fill:"#0E9AB9",stroke:"white"}),t.jsx("circle",{cx:"13.6501",cy:"7.35003",r:"1.95",fill:"#0E9AB9",stroke:"white"})]}),id=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#295ECF"}),t.jsx("path",{d:"M11.1095 12.9899C11.053 13.2628 10.9683 13.4416 10.8366 13.5357C10.7049 13.6298 10.4696 13.6674 10.1309 13.6674L10.0933 14.8153C10.7895 14.8153 11.3165 14.693 11.674 14.4296C12.0222 14.1661 12.2574 13.7239 12.3891 13.084L13.1042 9.40501H13.904L14.1675 8.44526H13.2924L13.4053 7.89952C13.4618 7.57961 13.6688 7.41024 14.0263 7.41024C14.2522 7.41024 14.4498 7.44788 14.6003 7.50433L14.9955 6.48813C14.6944 6.36581 14.3463 6.29994 13.9511 6.29994C13.49 6.29994 13.0948 6.45049 12.7561 6.73277C12.4174 7.01505 12.2009 7.38201 12.1163 7.83366L11.9939 8.44526H11.2506L11.0624 9.40501H11.8058L11.1095 12.9899Z",fill:"white"}),t.jsx("path",{d:"M6.30005 12.9617H7.67381L8.16309 10.4494H10.2049L10.4213 9.31085H8.38891L8.64296 8.00296H10.9388L11.1647 6.84562H7.49503L6.30005 12.9617Z",fill:"white"})]}),ld=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#1EB47D"}),t.jsx("path",{d:"M7.70002 14.7C6.9279 14.7 6.26812 14.4244 5.72068 13.8731C5.17324 13.3219 4.89969 12.6481 4.90002 11.8519C4.90002 11.1694 5.09942 10.5612 5.49821 10.0275C5.89699 9.49374 6.41881 9.15249 7.06366 9.00374C7.27578 8.19874 7.70002 7.54686 8.33639 7.04811C8.97275 6.54936 9.69396 6.29999 10.5 6.29999C11.4928 6.29999 12.335 6.65664 13.0266 7.36994C13.7183 8.08324 14.064 8.95159 14.0637 9.97499C14.6491 10.045 15.135 10.3054 15.5212 10.7562C15.9074 11.207 16.1004 11.7341 16.1 12.3375C16.1 12.9937 15.8772 13.5516 15.4316 14.0112C14.986 14.4707 14.4451 14.7003 13.8091 14.7H7.70002Z",fill:"#157F58",stroke:"white"}),t.jsx("path",{d:"M10.08 9.72018V13.3H9.36371V11.2299L9.38174 10.5172C9.26837 10.6369 9.18591 10.7194 9.13438 10.7647L8.7453 11.0939L8.40002 10.6396L10.08 9.09996V9.72018Z",fill:"white"}),t.jsx("path",{d:"M10.92 12.6798L10.92 9.09999L11.6363 9.09999L11.6363 11.1701L11.6183 11.8828C11.7316 11.7631 11.8141 11.6806 11.8656 11.6352L12.2547 11.3061L12.6 11.7604L10.92 13.3L10.92 12.6798Z",fill:"white"})]}),cd=()=>t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:Dt,height:It,viewBox:"0 0 21 21",fill:"none",children:[t.jsx("path",{d:"M14.2056 0H6.79443C3.04197 0 0 3.04197 0 6.79443V14.2056C0 17.958 3.04197 21 6.79443 21H14.2056C17.958 21 21 17.958 21 14.2056V6.79443C21 3.04197 17.958 0 14.2056 0Z",fill:"#FF7D00"}),t.jsx("path",{d:"M16.1 8.89999H16.6V8.39999V8.29999C16.6 6.91928 15.4807 5.79999 14.1 5.79999H6.90002C5.51931 5.79999 4.40002 6.91928 4.40002 8.29999V8.39999V8.89999H4.90002H16.1Z",fill:"#C76200",stroke:"white"}),t.jsx("path",{d:"M4.90002 8.59991H4.40002V9.09991V12.6999C4.40002 14.0806 5.51931 15.1999 6.90002 15.1999H14.1C15.4807 15.1999 16.6 14.0806 16.6 12.6999V9.09991V8.59991H16.1H4.90002Z",fill:"#C76200",stroke:"white"}),t.jsx("path",{d:"M11.5 10L9.54585 11.3052L10.3377 11.7893L9.5 13L11.4542 11.7134L10.6633 11.2309L11.5 10Z",fill:"white"})]});var Gs="Checkbox",[Ag,Zx]=Ze(Gs),[Og,Lg]=Ag(Gs),dd=l.forwardRef((e,r)=>{const{__scopeCheckbox:n,name:s,checked:a,defaultChecked:o,required:i,disabled:d,value:u="on",onCheckedChange:f,...m}=e,[x,v]=l.useState(null),j=Re(r,L=>v(L)),b=l.useRef(!1),w=x?!!x.closest("form"):!0,[_=!1,R]=Xe({prop:a,defaultProp:o,onChange:f}),T=l.useRef(_);return l.useEffect(()=>{const L=x==null?void 0:x.form;if(L){const $=()=>R(T.current);return L.addEventListener("reset",$),()=>L.removeEventListener("reset",$)}},[x,R]),t.jsxs(Og,{scope:n,state:_,disabled:d,children:[t.jsx(fe.button,{type:"button",role:"checkbox","aria-checked":ft(_)?"mixed":_,"aria-required":i,"data-state":pd(_),"data-disabled":d?"":void 0,disabled:d,value:u,...m,ref:j,onKeyDown:K(e.onKeyDown,L=>{L.key==="Enter"&&L.preventDefault()}),onClick:K(e.onClick,L=>{R($=>ft($)?!0:!$),w&&(b.current=L.isPropagationStopped(),b.current||L.stopPropagation())})}),w&&t.jsx(Dg,{control:x,bubbles:!b.current,name:s,value:u,checked:_,required:i,disabled:d,style:{transform:"translateX(-100%)"}})]})});dd.displayName=Gs;var ud="CheckboxIndicator",fd=l.forwardRef((e,r)=>{const{__scopeCheckbox:n,forceMount:s,...a}=e,o=Lg(ud,n);return t.jsx(tt,{present:s||ft(o.state)||o.state===!0,children:t.jsx(fe.span,{"data-state":pd(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:r,style:{pointerEvents:"none",...e.style}})})});fd.displayName=ud;var Dg=e=>{const{control:r,checked:n,bubbles:s=!0,...a}=e,o=l.useRef(null),i=ko(n),d=Eo(r);return l.useEffect(()=>{const u=o.current,f=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(f,"checked").set;if(i!==n&&x){const v=new Event("click",{bubbles:s});u.indeterminate=ft(n),x.call(u,ft(n)?!1:n),u.dispatchEvent(v)}},[i,n,s]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:ft(n)?!1:n,...a,tabIndex:-1,ref:o,style:{...e.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ft(e){return e==="indeterminate"}function pd(e){return ft(e)?"indeterminate":e?"checked":"unchecked"}var md=dd,Ig=fd;function $g(e,r){if(e==null)return{};var n={},s=Object.keys(e),a,o;for(o=0;o=0)&&(n[a]=e[a]);return n}var Fg=["color"],Bg=l.forwardRef(function(e,r){var n=e.color,s=n===void 0?"currentColor":n,a=$g(e,Fg);return l.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),l.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:s,fillRule:"evenodd",clipRule:"evenodd"}))});const Ks=l.forwardRef(({className:e,...r},n)=>t.jsx(md,{className:S("peer inline-flex h-[20px] w-[20px] cursor-pointer items-center rounded-md border-2 border-gray-400 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 relative mr-1.5",e),...r,ref:n,children:t.jsx(Ig,{className:"absolute -left-0.5 transition ease-in-out delay-150",children:t.jsx(Bg,{className:"h-[20px] w-[20px] text-white bg-black rounded-md dark:bg-zinc-400 dark:text-black"})})}));Ks.displayName=md.displayName;var zg="Label",hd=l.forwardRef((e,r)=>t.jsx(fe.label,{...e,ref:r,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));hd.displayName=zg;var gd=hd;const Vg=tn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),We=l.forwardRef(({className:e,...r},n)=>t.jsx(gd,{ref:n,className:S(Vg(),e),...r}));We.displayName=gd.displayName;var qs="Switch",[Hg,Xx]=Ze(qs),[Ug,Gg]=Hg(qs),xd=l.forwardRef((e,r)=>{const{__scopeSwitch:n,name:s,checked:a,defaultChecked:o,required:i,disabled:d,value:u="on",onCheckedChange:f,...m}=e,[x,v]=l.useState(null),j=Re(r,T=>v(T)),b=l.useRef(!1),w=x?!!x.closest("form"):!0,[_=!1,R]=Xe({prop:a,defaultProp:o,onChange:f});return t.jsxs(Ug,{scope:n,checked:_,disabled:d,children:[t.jsx(fe.button,{type:"button",role:"switch","aria-checked":_,"aria-required":i,"data-state":yd(_),"data-disabled":d?"":void 0,disabled:d,value:u,...m,ref:j,onClick:K(e.onClick,T=>{R(L=>!L),w&&(b.current=T.isPropagationStopped(),b.current||T.stopPropagation())})}),w&&t.jsx(Kg,{control:x,bubbles:!b.current,name:s,value:u,checked:_,required:i,disabled:d,style:{transform:"translateX(-100%)"}})]})});xd.displayName=qs;var vd="SwitchThumb",bd=l.forwardRef((e,r)=>{const{__scopeSwitch:n,...s}=e,a=Gg(vd,n);return t.jsx(fe.span,{"data-state":yd(a.checked),"data-disabled":a.disabled?"":void 0,...s,ref:r})});bd.displayName=vd;var Kg=e=>{const{control:r,checked:n,bubbles:s=!0,...a}=e,o=l.useRef(null),i=ko(n),d=Eo(r);return l.useEffect(()=>{const u=o.current,f=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(f,"checked").set;if(i!==n&&x){const v=new Event("click",{bubbles:s});x.call(u,n),u.dispatchEvent(v)}},[i,n,s]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:o,style:{...e.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function yd(e){return e?"checked":"unchecked"}var wd=xd,qg=bd;const Kt=l.forwardRef(({className:e,...r},n)=>t.jsx(wd,{className:S("peer inline-flex h-[18px] w-[35px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-purple-750 data-[state=unchecked]:bg-brand-300",e),...r,ref:n,children:t.jsx(qg,{className:S("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Kt.displayName=wd.displayName;const jd=l.forwardRef(({className:e,...r},n)=>t.jsx("textarea",{cols:500,rows:4,className:S("flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));jd.displayName="Textarea";var Wg="Toggle",_d=l.forwardRef((e,r)=>{const{pressed:n,defaultPressed:s=!1,onPressedChange:a,...o}=e,[i=!1,d]=Xe({prop:n,onChange:a,defaultProp:s});return t.jsx(fe.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:r,onClick:K(e.onClick,()=>{e.disabled||d(!i)})})});_d.displayName=Wg;var $t="ToggleGroup",[Cd,Yx]=Ze($t,[sn]),Nd=sn(),Ws=de.forwardRef((e,r)=>{const{type:n,...s}=e;if(n==="single"){const a=s;return t.jsx(Zg,{...a,ref:r})}if(n==="multiple"){const a=s;return t.jsx(Xg,{...a,ref:r})}throw new Error(`Missing prop \`type\` expected on \`${$t}\``)});Ws.displayName=$t;var[Sd,kd]=Cd($t),Zg=de.forwardRef((e,r)=>{const{value:n,defaultValue:s,onValueChange:a=()=>{},...o}=e,[i,d]=Xe({prop:n,defaultProp:s,onChange:a});return t.jsx(Sd,{scope:e.__scopeToggleGroup,type:"single",value:i?[i]:[],onItemActivate:d,onItemDeactivate:de.useCallback(()=>d(""),[d]),children:t.jsx(Ed,{...o,ref:r})})}),Xg=de.forwardRef((e,r)=>{const{value:n,defaultValue:s,onValueChange:a=()=>{},...o}=e,[i=[],d]=Xe({prop:n,defaultProp:s,onChange:a}),u=de.useCallback(m=>d((x=[])=>[...x,m]),[d]),f=de.useCallback(m=>d((x=[])=>x.filter(v=>v!==m)),[d]);return t.jsx(Sd,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:u,onItemDeactivate:f,children:t.jsx(Ed,{...o,ref:r})})});Ws.displayName=$t;var[Yg,Jg]=Cd($t),Ed=de.forwardRef((e,r)=>{const{__scopeToggleGroup:n,disabled:s=!1,rovingFocus:a=!0,orientation:o,dir:i,loop:d=!0,...u}=e,f=Nd(n),m=es(i),x={role:"group",dir:m,...u};return t.jsx(Yg,{scope:n,rovingFocus:a,disabled:s,children:a?t.jsx(Il,{asChild:!0,...f,orientation:o,dir:m,loop:d,children:t.jsx(fe.div,{...x,ref:r})}):t.jsx(fe.div,{...x,ref:r})})}),_r="ToggleGroupItem",Rd=de.forwardRef((e,r)=>{const n=kd(_r,e.__scopeToggleGroup),s=Jg(_r,e.__scopeToggleGroup),a=Nd(e.__scopeToggleGroup),o=n.value.includes(e.value),i=s.disabled||e.disabled,d={...e,pressed:o,disabled:i},u=de.useRef(null);return s.rovingFocus?t.jsx($l,{asChild:!0,...a,focusable:!i,active:o,ref:u,children:t.jsx(to,{...d,ref:r})}):t.jsx(to,{...d,ref:r})});Rd.displayName=_r;var to=de.forwardRef((e,r)=>{const{__scopeToggleGroup:n,value:s,...a}=e,o=kd(_r,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},d=o.type==="single"?i:void 0;return t.jsx(_d,{...d,...a,ref:r,onPressedChange:u=>{u?o.onItemActivate(s):o.onItemDeactivate(s)}})}),Qg=Ws,Md=Rd;const ro=Qg,Zn=l.forwardRef(({className:e,children:r,...n},s)=>t.jsx(Md,{ref:s,className:S("relative flex h-[35px] px-2 items-center justify-center bg-white text-base leading-4 rounded focus:z-10 focus:outline-none hover:bg-purple-750/20 data-[state=on]:bg-purple-750 data-[state=on]:text-brand-100",e),...n,children:r}));Zn.displayName=Md.displayName;const Td=l.forwardRef(({className:e,type:r,...n},s)=>t.jsx("input",{type:r,className:S("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...n}));Td.displayName="Input";const ex={"rotate-cw":Gm,"check-circle":Ai,clipboard:Tm},tx=({input:e,updates:r,update:n})=>{var V,A,D,z,Q,Y,Z,G,te;const[s,a]=l.useState(!1),{options:o}=ve();ce(xe);const[i,d]=l.useState("third_party"),[u,f]=l.useState({}),m=["third_party","plugins","theme"],x=l.useMemo(()=>{var k;return e?(k=r.find(O=>O.key===e.key))==null?void 0:k.value:""},[e,r]),v=l.useCallback(k=>{var O;return e?(O=r.find(H=>H.key===`${e.key}.${k}`))==null?void 0:O.value:""},[e,r]);if(!e)return t.jsx(t.Fragment,{});const j=async()=>{if(e.action){a(!0);try{await new et(o,e.action).post(),Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["Your action is successful ",t.jsx(Be,{className:"w-5 text-green-600"})]}),duration:0})}catch(k){Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[k.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]}),duration:0})}a(!1)}},b=async k=>{f(O=>({...O,[k.key]:!0}));try{if(k.action==="clipboard")await navigator.clipboard.writeText(x),Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["CDN URL copied to clipboard ",t.jsx(Be,{className:"w-5 text-green-600"})]}),duration:0});else{const H=await new et(o,k.action).post();H!=null&&H.data&&k.action_response_mutates&&k.action_response_mutates.forEach(oe=>{console.log(oe,H.data[oe]),n(H.data[oe],oe,!0)}),Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[k.control_label," action successful ",t.jsx(Be,{className:"w-5 text-green-600"})]}),duration:0})}}catch(O){Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[O.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]}),duration:0})}f(O=>({...O,[k.key]:!1}))},w=l.useMemo(()=>{var k;return(k=e==null?void 0:e.control_values)==null?void 0:k.reduce((O,H)=>{O[H.type]||(O[H.type]=[]);const oe=Array.isArray(x)?x.includes(H.id):x===H.id;return O[H.type].push({...H,isSelected:oe}),O},{})},[e,r]),_=(k,O)=>{const H=k?[...x||[],O]:(x||[]).filter(oe=>oe!==O);n(H,e.key)},R=k=>{k.preventDefault(),n(k.target.value,e.key)},[T,L]=l.useState(!1),$=()=>{L(k=>!k)};return l.useMemo(()=>{if(!(e!=null&&e.control_visibility))return!0;const k=new Map(r.map(({key:O,value:H})=>[O,H]));return e.control_visibility.some(O=>k.get(O.key)===O.value)},[e==null?void 0:e.control_visibility,r])?t.jsxs("div",{className:"flex flex-col justify-start items-center gap-3 normal-case",children:[(e==null?void 0:e.control_type)==="checkbox"&&t.jsx(We,{htmlFor:"name",className:"flex flex-col text-left w-full dark:text-brand-300 bg-brand-100/30 rounded-xl py-4 px-4 border border-brand-200/60",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:e.control_label}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[335px]",children:e.control_description})]}),t.jsx(Kt,{checked:x,onCheckedChange:k=>n(k,e.key),className:"self-center"})]})}),e.control_type==="textarea"&&t.jsxs(We,{htmlFor:"name",className:"flex flex-col text-left w-full bg-brand-100/30 dark:text-brand-300 rounded-xl py-4 px-4 border border-brand-200/60",children:[t.jsx("span",{children:e.control_label}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600",children:e.control_description}),t.jsx(jd,{id:e.key,className:"focus:outline-none focus-visible:ring-0 dark:text-brand-300 focus-visible:ring-offset-0 mt-2",value:x,onChange:k=>n(k.target.value,e.key)})]}),e.control_type==="input"&&t.jsxs(We,{htmlFor:"name",className:"flex flex-col text-left w-full bg-brand-100/30 dark:text-brand-300 rounded-xl py-4 px-4 border border-brand-200/60",children:[t.jsx("span",{children:e.control_label}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600",children:e.control_description}),t.jsxs("div",{className:"flex w-full items-center gap-2 mt-2",children:[t.jsx(Td,{id:e.key,type:((V=e.control_props)==null?void 0:V.type)||"text",readOnly:((A=e.control_props)==null?void 0:A.readonly)||(e==null?void 0:e.readonly)||!1,placeholder:(e==null?void 0:e.placeholder)||"",className:"flex-grow focus:outline-none focus-visible:ring-0 dark:text-brand-300 focus-visible:ring-offset-0",value:x,onChange:(D=e.control_props)!=null&&D.readonly||e!=null&&e.readonly?void 0:R,...e.control_props}),t.jsx("div",{className:"flex-shrink-0 flex gap-2",children:(z=e.actions)==null?void 0:z.map(k=>{const O=k.control_icon?ex[k.control_icon]:null;return t.jsx(cs,{delayDuration:0,children:t.jsxs(Qr,{children:[t.jsx(en,{asChild:!0,children:t.jsxs(pt,{disabled:u[k.key],className:"flex-shrink-0 flex gap-2 whitespace-nowrap",onClick:()=>b(k),variant:"outline",children:[u[k.key]&&t.jsx(Ge,{className:"w-4 animate-spin -ml-1"}),O&&t.jsx(O,{className:"w-4 h-4"}),!O&&k.control_label]})}),t.jsx(Qt,{className:"max-w-[200px] p-2 text-sm break-words",sideOffset:5,children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"font-semibold text-sm mb-1",children:k.control_label}),t.jsx("span",{className:"text-xs font-normal truncate",children:k.control_description})]})})]})},k.key)})})]})]}),e.control_type==="button"&&t.jsx(We,{htmlFor:"name",className:"flex ml-4 text-left w-full",children:t.jsxs(pt,{disabled:s,className:"flex gap-2",onClick:k=>j(),variant:"outline",children:[s&&t.jsx(Ge,{className:"w-4 animate-spin -ml-1"}),e.control_label]})}),e.control_type==="options"&&t.jsx(We,{htmlFor:"name",className:"flex flex-col text-left w-full dark:text-brand-300 bg-brand-100/30 rounded-xl py-4 px-4 border border-brand-200/60",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:e.control_label}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[335px]",children:e.control_description})]}),t.jsxs(Qc,{value:x,onValueChange:k=>n(k,e.key),children:[t.jsx(zs,{className:"w-[130px] capitalize bg-brand-0",children:t.jsx(td,{placeholder:"Select action"})}),t.jsx(Vs,{className:"z-[100001]",children:t.jsxs(ed,{children:[t.jsx(Hs,{children:"Actions"}),(Q=e==null?void 0:e.control_values)==null?void 0:Q.map((k,O)=>t.jsx(Us,{className:"capitalize cursor-pointer",value:k,children:k},O))]})})]})]})}),e.control_type==="number-range"&&t.jsx(We,{htmlFor:"name",className:"flex flex-col gap-4 text-left w-full dark:text-brand-300 bg-brand-100/30 rounded-xl py-4 px-4 border border-brand-200/60",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:e.control_label}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[335px]",children:e.control_description})]}),t.jsx(ro,{className:"inline-flex bg-mauve6 rounded border border-1 space-x-px ",type:"single",value:String(x),onValueChange:k=>n(k,e.key),"aria-label":"Select action",children:(Y=e==null?void 0:e.control_values)==null?void 0:Y.map((k,O)=>t.jsxs(Zn,{value:String(k),"aria-label":k,children:[k,e==null?void 0:e.control_values_suffix]},O))})]})}),e.control_type==="accordion"&&t.jsxs(We,{htmlFor:"name",className:"flex flex-col text-left w-full dark:text-brand-300 bg-brand-100/30 rounded-xl py-4 px-4 border border-brand-200/60",children:[t.jsxs("div",{className:"flex items-center justify-between cursor-pointer ",onClick:$,children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:"Misc Options"}),t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[425px]",children:"This base page optimization will be used on all the other pages in the selected group."})]}),t.jsx(El,{className:`h-5 transition-all ${T&&"rotate-[90deg]"}`})]}),t.jsx(ln,{id:e.key,className:"flex flex-col text-left w-full gap-4 mt-6 ml-3",initialRender:!0,isOpen:T,children:(Z=e==null?void 0:e.inputs)==null?void 0:Z.map(k=>t.jsxs(We,{className:"flex gap-1",children:[t.jsx(Ks,{checked:v(k.key),onCheckedChange:O=>n(O,`${e.key}.${k.key}`)}),t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{className:"cursor-pointer",children:k.control_label}),t.jsx("span",{className:"text-sm font-normal text-gray-600 sm:max-w-[425px]",children:k.control_description})]})]},k.key))})]}),(e==null?void 0:e.control_type)==="radio"&&t.jsx(We,{htmlFor:"name",className:"flex flex-col text-left w-full dark:text-brand-300 bg-brand-100/30 rounded-xl py-4 px-4 border border-brand-200/60",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex flex-col",children:[t.jsx("span",{children:e.control_label}),(G=e==null?void 0:e.control_values_description)!=null&&G.length?e.control_values_description.map(k=>k.value===x&&t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[335px]",children:k.description},k.value)):t.jsx("span",{className:"pt-2 text-sm font-normal text-gray-600 sm:max-w-[335px]",children:e.control_description})]}),t.jsx(ro,{className:"inline-flex bg-mauve6 rounded border border-1 space-x-px ",type:"single",value:String(x),onValueChange:k=>n(k,e.key),"aria-label":"Select action",children:(te=e==null?void 0:e.control_values)==null?void 0:te.map((k,O)=>t.jsx(Zn,{className:"w-fit px-4",value:String(k),"aria-label":k,children:k},O))})]})}),e.control_type==="tab"&&t.jsxs("div",{className:"w-full",children:[t.jsx("div",{className:"flex bg-brand-100/60 w-fit rounded-t-lg",children:m.map((k,O)=>t.jsx("button",{onClick:H=>d(k),className:`flex items-center border-b-white py-2 px-4 w-fit dark:text-brand-300 ${k==="third_party"?"rounded-tl-lg":k==="theme"?"rounded-tr-lg ":""} ${i===k?"bg-white dark:bg-brand-900 rounded-t-lg":"dark:bg-brand-950 bg-brand-200/60 text-slate-500"} dark:hover:border-brand-700/70 `,children:k.replace(/_/g," ").replace(/\b\w/g,H=>H.toUpperCase())},O))}),t.jsxs("div",{className:"flex flex-wrap gap-2 overflow-y-auto scrollbar-stable max-h-[300px] w-full bg-white dark:border-brand-900 rounded-md rounded-tl-none px-4 py-4 dark:bg-brand-900 ",children:[Array.isArray(w[i])&&w[i]&&i=="third_party"&&t.jsx(t.Fragment,{children:w[i].map((k,O)=>t.jsxs("div",{className:"flex gap-2 cursor-pointer font-medium text-sm bg-purple-50/60 dark:text-brand-300 dark:bg-brand-950 border border-brand-200/60 dark:border-brand-950 w-fit rounded-xl items-center py-1.5 px-2",children:[k==null?void 0:k.name,t.jsx(Kt,{checked:k==null?void 0:k.isSelected,onCheckedChange:H=>_(H,k.id)})]},O))}),Array.isArray(w[i])&&w[i]&&i=="plugins"&&t.jsx(t.Fragment,{children:w[i].map((k,O)=>t.jsxs("div",{className:"flex gap-2 cursor-pointer font-medium text-sm bg-purple-50/60 dark:text-brand-300 dark:bg-brand-950 border border-brand-200/60 dark:border-brand-950 w-fit rounded-xl items-center py-1.5 px-2",children:[k==null?void 0:k.name,t.jsx(Kt,{checked:k==null?void 0:k.isSelected,onCheckedChange:H=>_(H,k.id)})]},O))}),Array.isArray(w[i])&&w[i]&&i=="theme"&&t.jsx(t.Fragment,{children:w[i].map((k,O)=>t.jsxs("div",{className:" flex gap-2 cursor-pointer font-medium text-sm bg-purple-50/60 dark:text-brand-300 dark:bg-brand-950 border border-brand-200/60 dark:border-brand-950 w-fit rounded-xl items-center py-1.5 px-2",children:[k==null?void 0:k.name,t.jsx(Kt,{checked:k==null?void 0:k.isSelected,onCheckedChange:H=>_(H,k.id)})]},O))})]})]})]}):t.jsx(t.Fragment,{})},rx=de.memo(tx),nx=de.memo(({status:e})=>{var r,n,s,a;return e?e.status==="failed"||e.status==="Miss"?t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex gap-1 items-center text-xs border border-rose-600 w-fit rounded-lg px-1 py-py",children:[t.jsx(Jc,{className:"fill-rose-600",children:t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsxs("span",{className:"flex gap-2 items-center",children:[t.jsx(Se,{className:"w-2 fill-rose-500 stroke-0"}),"Error while optimizing ",((r=e.error)==null?void 0:r.code)&&`(Code: ${(n=e.error)==null?void 0:n.code})`]}),t.jsx("span",{className:"text-brand-500 ml-4",children:(s=e.error)!=null&&s.message?(a=e.error)==null?void 0:a.message:"Failed to Optimize"})]})}),t.jsx("span",{className:"capitalize",children:e.status})]})}):e.status==="queued"?t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex gap-2 items-center text-xs w-fit rounded-lg",children:[t.jsx(Se,{className:S("animate-pulse w-2.5 fill-amber-500 stroke-0")}),"Waiting in the queue"]})}):e.status==="waiting"?t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex gap-2 items-center text-xs w-fit rounded-lg",children:[t.jsx(Se,{className:S("animate-pulse w-2.5 fill-amber-500 stroke-0")}),"Waiting"]})}):e.status==="processing"?t.jsx(t.Fragment,{children:t.jsxs("div",{className:" flex gap-2 items-center text-xs w-fit rounded-lg",children:[t.jsx(Ge,{className:"w-4 animate-spin "}),"Optimization in progress"]})}):e.status==="success"||e.status==="Hit"?t.jsx(t.Fragment,{children:t.jsxs("div",{className:" flex gap-1.5 items-center text-xs w-fit rounded-lg",children:[t.jsx(Se,{className:S("animate-pulse w-2.5 fill-green-600 stroke-0 -mt-[1px]")}),e!=null&&e.message||e.status==="Hit"?"Hit":"Optimized"]})}):t.jsx(t.Fragment,{}):t.jsx(t.Fragment,{})}),sx=({updateValue:e,settings:r,index:n,hideActions:s,showIcons:a=!0,actionRequired:o})=>{if(!r)return t.jsx(t.Fragment,{});const{dispatch:i,uucssError:d}=ge(),{mode:u,options:f}=ve(),[m,x]=de.useState(!1),[v,j]=l.useState(!1),[b,...w]=l.useMemo(()=>r.inputs,[r]),[_,R]=l.useState(w.reduce((Z,G,te,k)=>{const{key:O,value:H,inputs:oe}=G;return oe&&oe.forEach((q,be,Me)=>{Z.push({key:`${O}.${q.key}`,value:q.value})}),Z.push({key:O,value:H}),Z},[])),T=l.useCallback((Z,G,te=!1)=>{_.find(O=>O.key===G)?(te&&e(r,Z,G),R(_.map(O=>(O.key===G&&(O.value=Z),O)))):R([..._,{key:G,value:Z}])},[_,r,w]);let L=l.useMemo(()=>({cache:t.jsx(cd,{}),cdn:t.jsx(ld,{}),image:t.jsx(od,{}),javascript:t.jsx(jr,{}),js:t.jsx(jr,{}),font:t.jsx(id,{}),css:t.jsx(ad,{})}),[]);const $=l.useMemo(()=>w.length>0,[w]),X=l.useCallback(()=>{_.forEach(({key:Z,value:G})=>{e(r,G,Z)}),x(!1)},[_,m]),V=async Z=>{j(!0);try{await new et(f,void 0,Z.action||Z.value||void 0).post(),Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["Your action is successful ",t.jsx(Be,{className:"w-5 text-green-600"})]})})}catch(G){j(!1),Ue({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:[G.message," ",t.jsx(ht,{className:"w-5 text-red-600"})]})})}j(!1)};ge();const A=()=>{!o||["onboard","preview"].includes(u)||(e(r,!b.value,b.key),i(gr("custom")))},[D,z]=l.useState(!1);l.useEffect(()=>{r.status&&b.value||r!=null&&r.status&&b.control_type==="button"?z(!0):z(!1)},[r]);const[Q,Y]=l.useState(r.status);return l.useEffect(()=>{if(!r.status||!b.value)return;const Z=["processing","queued","success"].includes(r.status.status),G={"Critical CSS":"cpcss","Remove Unused CSS":"uucss","Page Cache":"cache","Cache Policy":"cache_policy"}[r.name];if(!Z||!G)return;const te=async()=>{try{const H=(await i(fm(f,f==null?void 0:f.optimizer_url,[G])))[G];Y(H),["success","failed","Miss"].includes(H.status)&&clearInterval(k)}catch(O){console.error("Error fetching CSS status:",O),clearInterval(k)}};te();const k=setInterval(te,5e3);return()=>clearInterval(k)},[r,f,i,m]),t.jsx(t.Fragment,{children:t.jsxs("div",{className:S("relative flex gap-2 font-medium text-base w-fit items-center pr-2 py-1",a?"px-0.5":"px-2"),children:[a&&L[r.category],!s&&t.jsx(t.Fragment,{children:b&&t.jsx(t.Fragment,{children:b.control_type==="checkbox"&&t.jsx(t.Fragment,{children:t.jsx(Ks,{disabled:["onboard","preview"].includes(u),className:o?"":"border-dashed",checked:b.value,onCheckedChange:Z=>{e(r,Z,b.key),i(gr("custom"))}})})})}),t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"relative flex gap-2 font-medium text-base w-fit items-center pr-2 py-0.5",children:[t.jsx("div",{className:"select-none cursor-pointer",onClick:A,children:r.name}),!s&&t.jsxs(t.Fragment,{children:[b&&t.jsx(t.Fragment,{children:b.control_type==="button"&&t.jsx(pt,{loading:v,disabled:v,onClick:Z=>V(b),className:"flex -mr-0.5 gap-1 py-1 px-2.5 h-auto rounded-[8px]",children:t.jsx("span",{className:"text-xs py-1 px-0.5",children:b.control_label})})}),t.jsx(br,{children:$&&t.jsxs(Oc,{open:m,onOpenChange:x,children:[t.jsx(Lc,{disabled:!0,asChild:!0,className:`${b.value?"":"cursor-not-allowed opacity-50 pointer-events-none"}`,children:t.jsx("div",{children:t.jsx(ue,{text:`${r.name} Settings`,children:t.jsx(N1,{className:"w-5 text-brand-400"})})})}),t.jsxs(Ls,{asChild:!0,className:`${r.name==="Delay Javascript"?"sm:max-w-[650px] bg-brand-100":"sm:max-w-[600px]"} cursor-auto`,children:[t.jsxs(Ds,{className:"border-b px-6 py-8 mt-1",children:[t.jsxs(Is,{children:[r.name," Settings"]}),t.jsxs(Fc,{children:["Make changes to your ",t.jsx("span",{className:"lowercase",children:r.name})," settings here. Click save when you're done."]})]}),t.jsx("div",{className:"grid gap-4 px-6 py-4",children:w.map((Z,G)=>t.jsx(rx,{input:Z,updates:_,update:T},G))}),t.jsxs($c,{className:"px-6 py-3 border-t",children:[t.jsx(Oe,{onClick:Z=>X(),className:"text-sm",children:"Save changes"}),t.jsx(Oe,{onClick:Z=>x(!1),variant:"outline",className:"text-sm",children:"Close"})]})]})]})}),d&&b.key==="uucss_enable_uucss"?t.jsx("div",{className:"px-1",children:t.jsxs("div",{className:"flex gap-1 items-center text-xs border border-amber-600 bg-amber-300/30 w-fit rounded-lg px-1 py-[2px] leading-3",children:[t.jsx(Po,{className:"h-[18px] w-[18px] text-amber-600"}),"Unused CSS and Critical CSS optimization options cannot be enabled simultaneously."]})}):D&&t.jsx("div",{className:"px-1",children:t.jsx(nx,{status:Q})}),t.jsx(br,{mode:"onboard",children:t.jsx(ue,{text:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-purple-750 font-medium",children:"PRO"})," feature"]}),children:t.jsx(Bm,{className:"w-4 text-brand-400"})})})]})]}),t.jsx("p",{className:`text-sm font-normal select-none ${r.status?"":"-mt-1"}`,children:r.description?r.description:r.name})]})]},n)})},ax=({item:e,itemIndex:r,updateValue:n,actionRequired:s})=>{const{dispatch:a,openCategory:o}=ge(),i=d=>{a(ae("openAudits",[d.id])),a(ae("activeTab",d.type==="passed_audit"?"passed_audits":d.type==="opportunity"?"opportunities":d.type)),setTimeout(()=>{var u;(u=document.getElementById(`audit-${d.id}`))==null||u.scrollIntoView({behavior:"smooth"})},10)};return t.jsxs("div",{className:"w-full mb-3.5 px-2.5 py-3 rounded-2xl dark:bg-brand-950 bg-brand-0 dark:hover:border-brand-700/70 hover:border-brand-400/60",children:[t.jsx(sx,{showIcons:!1,settings:e,updateValue:n,actionRequired:s,index:r}),e.audits.length>0&&t.jsxs("ul",{className:"flex mt-2 justify-start ml-14",children:[t.jsx(O1,{cls:"w-4 mr-2 -mt-2"}),e.audits.map((d,u)=>t.jsxs("li",{onClick:()=>i(d),className:"relative flex cursor-pointer gap-2 font-medium text-sm hover:bg-brand-100 dark:bg-brand-900 bg-white border w-fit rounded-xl items-center py-1.5 px-1.5 mr-2",children:[t.jsx("div",{className:"inline-flex items-center justify-center w-7 h-7 rounded-full dark:bg-brand-700 bg-brand-200/50",children:d.scoreDisplayMode==="informative"?t.jsx(t.Fragment,{children:t.jsx("span",{className:"w-2 h-2 border-2 border-brand-400/60 rounded-full"})}):d.type==="passed_audit"?t.jsx(Be,{className:"w-5 fill-green-600"}):d.type==="opportunity"?t.jsxs(t.Fragment,{children:[t.jsx(Se,{className:S("w-2 stroke-0 fill-orange-600 animate-ping absolute inline-flex opacity-75")}),t.jsx(Se,{className:S("w-2 stroke-0 fill-orange-600 relative inline-flex")})]}):d.type==="diagnostics"?t.jsxs(t.Fragment,{children:[t.jsx(Se,{className:S("w-2 stroke-0 fill-yellow-400 animate-ping absolute inline-flex opacity-75")}),t.jsx(Se,{className:S("w-2 stroke-0 fill-yellow-400 relative inline-flex")})]}):null}),t.jsxs("div",{className:"flex flex-col ",children:[t.jsx("span",{className:"select-none",children:d.name}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"dark:bg-brand-950 bg-white border w-fit rounded-lg items-center py-py px-1 mr-2 text-gray-400 block font-medium text-[10px] ",children:d.type.replace(/_/g," ").replace(/\b\w/g,f=>f.toUpperCase())}),t.jsx("div",{className:" text-gray-500 text-xs block",children:d.displayValue?d.displayValue:""})]})]}),t.jsx(El,{className:"h-5"})]},u))]})]})},ox=e=>e==="css"||e==="cdn"?e.toUpperCase():e.charAt(0).toUpperCase()+e.slice(1),ix=e=>{switch(e){case"cdn":return 625;case"font":return 515;case"css":return 130;case"javascript":return 255;case"image":return 395;case"cache":return 740;default:return 395}},lx=({})=>{var jt,_t;const{settings:e,data:r,activeReport:n,settingsLoading:s,activeGear:a,revisions:o}=ce(xe),[i,d]=l.useState("css"),[u,f]=l.useState({}),{dispatch:m,openCategory:x,activeTab:v,auditsReturn:j,testModeStatus:b,settingsMode:w}=ge(),_=["css","javascript","image","font","cdn","cache"],[R,T]=l.useState(!0),L=["starter","accelerate","turboMax"],$=l.useRef(null),[X,V]=l.useState("custom"),[A,D]=l.useState(!1),[z,Q]=l.useState(""),{toast:Y}=gt(),{testMode:Z}=ce(xe),{handleTestModeSwitchChange:G}=Fs(),{options:te}=ve(),k=l.useMemo(()=>({cache:t.jsx(cd,{}),cdn:t.jsx(ld,{}),image:t.jsx(od,{}),javascript:t.jsx(jr,{}),js:t.jsx(jr,{}),font:t.jsx(id,{}),css:t.jsx(ad,{})}),[]),O=l.useMemo(()=>({cache:t.jsx(Pg,{}),cdn:t.jsx(Tg,{}),image:t.jsx(Rg,{}),javascript:t.jsx(eo,{}),js:t.jsx(eo,{}),font:t.jsx(Mg,{}),css:t.jsx(Eg,{})}),[]),H=l.useCallback(B=>{var me,ye,Te;const re={},pe=[...((me=r==null?void 0:r.grouped)==null?void 0:me.passed_audits)||[],...((ye=r==null?void 0:r.grouped)==null?void 0:ye.diagnostics)||[],...((Te=r==null?void 0:r.grouped)==null?void 0:Te.opportunities)||[]];return B.forEach(_e=>{re[_e.category]||(re[_e.category]=[]),re[_e.category].push({..._e,audits:(pe||[]).filter(lt=>lt.settings.find(ct=>ct.name===_e.name))})}),re},[e,r,n]);l.useEffect(()=>{const B=H(e||[]),re=Object.keys(B).sort((me,ye)=>{const Te=_.indexOf(me),_e=_.indexOf(ye);return Te-_e}),pe={};re.forEach(me=>{pe[me]=B[me]}),f(pe),x?d(x):m(ae("openCategory","css"))},[e,r,n]);const oe=l.useCallback((B,re,pe)=>{m(Ni(B.audits[0],B,pe,re))},[]),[q,be]=l.useState([]),[Me,$e]=l.useState([]),Ye=l.useRef(!0);l.useEffect(()=>{if(Ye.current){Ye.current=!1;return}if(u&&R){const B=[],re=[];_.forEach(pe=>{if(u[pe]){const me=u[pe].slice().sort((_e,lt)=>{const ct=_e.audits.some(Ft=>Ft.type!=="passed_audit"),nr=lt.audits.some(Ft=>Ft.type!=="passed_audit");if(ct&&!nr)return-1;if(!ct&&nr)return 1;const Ct=_e.inputs[0].value,sr=lt.inputs[0].value;return Ct&&!sr?-1:!Ct&&sr?1:0}),ye=me.filter(_e=>!qe(_e)),Te=me.filter(_e=>qe(_e));B.push(...ye),re.push(...Te)}}),be(B),$e(re),T(!1)}},[u]);const nt=(B,re)=>{var pe;if(vt(B),a==="custom"&&!re)(pe=$.current)==null||pe.click();else if(m(gr(B)),!Me)return},vt=B=>{let re;B==="turboMax"&&!Z&&(re=Y({description:t.jsx(t.Fragment,{children:t.jsxs("div",{className:"flex font-semibold w-full gap-2 text-center items-center",children:[t.jsx(Po,{className:"w-5 text-orange-600"}),"Do you want to turn on test mode?",t.jsxs(Oe,{className:"px-2",onClick:async pe=>{re&&re.dismiss(),await G(!0)},variant:"outline",children:[t.jsx(kl,{className:"h-5 w-5 text-gray-500"}),"Yes"]}),t.jsxs(Oe,{className:"px-2",onClick:pe=>{re&&re.dismiss()},variant:"outline",children:[t.jsx(Ml,{className:"h-5 w-5 text-gray-500"}),"No"]})]})})},99999999))};l.useEffect(()=>{T(!0)},[n]),l.useEffect(()=>{},[e]),l.useEffect(()=>{(o==null?void 0:o.length)==0&&!a&&m(gr("accelerate"))},[e]);const Je={starter:"Optimizes foundational aspects for faster load speeds by removing unused CSS, minifying CSS and JavaScript, caching pages, and self-hosting Google Fonts.",accelerate:"Starter mode + RapidLoad CDN, serving next-gen images, and enhancing image handling with lazy loading, while also deferring JavaScript and adding crucial image attributes.",turboMax:"Unlock peak performance potential including Accelerator mode + generating critical CSS, advanced JavaScript handling methods, such as delaying execution for improved speed and efficiency.",custom:"Tailor your optimization strategy to your needs, combining features like Accelerator mode and advanced JavaScript handling for personalized performance."},Ee=z||a,qe=B=>{const re=B.inputs[0].value&&B.audits.some(me=>me.type==="passed_audit"),pe=B.audits.some(me=>me.type!=="passed_audit");return re||pe},[Fe,bt]=l.useState({}),[yt,dn]=l.useState(!1);l.useEffect(()=>{if(yt){const B={};Object.keys(u).forEach(re=>{B[re]=!1}),bt(B),dn(!1)}},[u]),l.useEffect(()=>{j&&(D(!0),m(ae("auditsReturn",!1)))},[j]),q.filter(B=>B.category===i);const[wt,rr]=l.useState({cpcss:!1,uucss:!1,cpcssuucss:!1}),Qe=l.useCallback(()=>{const B=e.some(me=>{var ye;return(ye=me.inputs.find(Te=>Te.key==="uucss_enable_cpcss"))==null?void 0:ye.value}),re=e.some(me=>{var ye;return(ye=me.inputs.find(Te=>Te.key==="uucss_enable_uucss"))==null?void 0:ye.value}),pe=e.some(me=>{var ye;return(ye=me.inputs.find(Te=>Te.key==="enable_uucss_on_cpcss"))==null?void 0:ye.value});rr({cpcss:B,uucss:re,cpcssuucss:!pe})},[e]);return l.useEffect(()=>{Qe()},[e,Qe]),l.useEffect(()=>{m(ae("uucssError",wt.cpcss&&wt.uucss&&wt.cpcssuucss))},[wt,m]),t.jsxs("div",{className:"dark:bg-brand-800/40 bg-brand-200 px-9 py-8 mt-2 rounded-3xl",children:[t.jsx(A1,{}),t.jsxs("div",{className:"pb-4",children:[t.jsx("h3",{className:"font-semibold text-lg",children:"Performance Gears"}),t.jsx("span",{className:"font-normal text-sm text-zinc-600 dark:text-brand-300",children:"Select your Performance Mode: Starter, Accelerate, TurboMax, or Customize, to fine-tune your site's speed."})]}),t.jsx("div",{className:"flex gap-4","data-tour":"settings-gear",children:L.map((B,re)=>t.jsx("div",{className:`cursor-pointer transition-all flex px-4 py-4 min-w-[166px] min-h-[166px] items-center justify-center w-fit rounded-3xl dark:bg-brand-950 bg-brand-0 dark:hover:border-purple-700 dark:border-brand-700/70 hover:border-purple-700 border border-brand-200 border-[3px] ${B===a?" border-purple-700 dark:border-purple-700":""}`,onClick:pe=>{V(B),nt(B)},onMouseEnter:()=>Q(B),onMouseLeave:()=>Q(""),children:t.jsxs("div",{className:`flex flex-col gap-1 items-center text-center ${B==="turboMax"?" pt-1.5":""}`,children:[["starter","accelerate","turboMax"].includes(B)&&a===B&&t.jsx("div",{className:"absolute ml-28 -mt-4",children:t.jsx(Be,{className:"w-6 h-6 text-purple-800"})}),B==="starter"&&t.jsx(_g,{cls:"px-2 py-2"}),B==="accelerate"&&t.jsx(Cg,{cls:"px-2 py-2"}),B==="turboMax"&&t.jsx(Ng,{cls:"px-2 py-2"}),t.jsxs("div",{children:[t.jsx("p",{className:"font-semibold capitalize",children:B}),B==="turboMax"&&t.jsx("p",{className:"font-normal text-[10px] leading-none",children:"Test Mode Recommended"})]})]})},re))}),t.jsx(vr,{title:"Modified Customize Settings changes",description:"Switching to Performance Modes will result in the loss of any customized settings.",action:"Activate",performanceGear:!0,cancel:"Cancel",onClick:()=>{nt(X,!0)},children:t.jsx("div",{ref:$})}),t.jsxs("div",{className:"py-4 ",children:[z?t.jsxs("h3",{className:"font-semibold dark:text-brand-300 capitalize",children:[z," ",a===z&&"Activated"]}):t.jsxs("h3",{className:"font-semibold dark:text-brand-300 capitalize",children:[a," Activated"]}),t.jsx("span",{className:"font-normal text-sm text-zinc-600 dark:text-brand-300",children:Je[Ee]})]}),t.jsx("div",{children:s?t.jsx("div",{className:`w-48 animate-pulse h-10 select-none transition-all rounded-2xl cursor-pointer\r
+ flex items-center gap-2 px-4 py-2 -ml-1 text-sm font-medium dark:hover:border-purple-700 dark:border-brand-700/70 hover:border-purple-700 border border-brand-200 border-[3px] dark:hover:bg-brand-950 bg-brand-0 dark:bg-brand-950`}):t.jsxs("div",{onClick:()=>{V("custom"),D(B=>!B)},onMouseEnter:()=>Q("custom"),onMouseLeave:()=>Q(""),className:S(`select-none w-fit transition-all rounded-2xl cursor-pointer
+ flex items-center gap-2 px-4 py-2 -ml-1 text-sm font-medium dark:hover:border-purple-700 dark:border-brand-700/70 hover:border-purple-700 border border-brand-200 border-[3px] dark:hover:bg-brand-950 bg-brand-0 dark:bg-brand-950 `,a==="custom"&&"border-purple-700"),"data-tour":"customize-settings",children:[a==="custom"&&t.jsx("div",{className:"",children:t.jsx(Be,{className:"w-6 h-6 text-purple-800"})}),"Customize Settings ",t.jsx(S0,{className:S("w-4 rounded-[15px] transition-transform",A&&"-rotate-180")})]})}),A&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"py-3 relative",children:t.jsx(T1,{width:ix(i)||220,category:i})}),t.jsx("ul",{className:"flex gap-3 ml-12",children:_.map((B,re)=>t.jsx("li",{onClick:pe=>{d(B),m(ae("openCategory",B))},children:t.jsxs(ke.div,{id:B,transition:{duration:.5},className:S("cursor-pointer select-none flex gap-2 transition-all items-center border border-transparent py-[6px] pr-3 pl-[7px] rounded-2xl w-fit mb-4 hover:bg-brand-50 dark:bg-brand-950/60 dark:hover:bg-brand-950 bg-brand-0 hover:shadow-md",i===B&&"dark:bg-brand-950 shadow-md transition-all"),children:[t.jsx("div",{children:i===B?t.jsx(t.Fragment,{children:k[B]}):t.jsx(t.Fragment,{children:O[B]})}),t.jsx("span",{className:"font-medium tracking-wide",children:ox(B)})]})},re))}),t.jsx("div",{className:S(r?"min-h-[380px]":"min-h-[280px]"),children:t.jsxs("ul",{children:[(jt=u[i])==null?void 0:jt.map((B,re)=>t.jsx("li",{children:t.jsx(ke.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3,delay:re?.05*re:0},children:t.jsx(ax,{item:B,itemIndex:re,updateValue:oe,actionRequired:!0},`${B.category}-${re}`)})},`${B.category}-${re}`)),((_t=u[i])==null?void 0:_t.length)<=2&&t.jsxs(ke.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"flex flex-col gap-2 items-center px-2 mt-12 w-full mb-6",children:[t.jsx("div",{children:t.jsx("img",{alt:"Good Job!",className:"w-60 -ml-6",src:te!=null&&te.page_optimizer_base?(te==null?void 0:te.page_optimizer_base)+"/success.svg":"/success.svg"})}),t.jsx("span",{className:"flex text-sm mt-4 gap-2",children:`You're so close to perfection! One more fix and it's flawless!"`})]})]})})]})]})},cx="new-titan-prompt",dx=()=>{const{data:e,loading:r,reanalyze:n,settings:s,error:a}=ce(xe),{dispatch:o,activeTab:i,openAudits:d,storePassedAudits:u,settingsMode:f}=ge(),[m,x]=l.useState(!1),v=l.useRef(null),[j,b]=de.useState(!1),[w,_]=l.useState(!!localStorage.getItem(cx)),{options:R,setOpenAudits:T,mode:L,manipulatingStyles:$,savingData:X,togglePerformance:V,setTogglePerformance:A,version:D}=ve(),z=[{key:"opportunities",name:"Opportunities",color:"border-orange-400",activeColor:"bg-orange-400"},{key:"diagnostics",name:"Diagnostics",color:"border-yellow-400 ",activeColor:"bg-yellow-400 "},{key:"passed_audits",name:"Passed Audits",color:"border-green-600",activeColor:"bg-green-600"}],Q=!["onboard","preview"].includes(L);return l.useEffect(()=>{setTimeout(()=>{Q&&!w&&(_(!0),b(!0))},1e3)},[]),l.useState(!1),t.jsxs("div",{"data-tour":"audits",children:[t.jsxs("h2",{className:"text-lg ml-5 mb-4 flex gap-2 font-normal items-center",children:[!V&&t.jsx(Bs,{}),"Fix Performance Issues"]}),t.jsx("div",{ref:v,style:{height:"1px"}}),t.jsxs("div",{className:S("tabs flex sticky gap-2 -top-1 z-10"),children:[t.jsxs("div",{onClick:()=>o(ae("activeTab","configurations")),className:S("whitespace-nowrap dark:bg-brand-930/90 bg-brand-0 border-2 border-transparent rounded-[20px] cursor-pointer w-[200px] flex items-center gap-2 px-5 py-3 text-sm font-medium",i==="configurations"?"font-medium ":"text-brand-500 dark:hover:text-brand-300"),"data-tour":"speed-settings",children:[" ",t.jsx(Sl,{className:"w-4 rounded-[15px]"})," Speed Settings"]}),t.jsxs(it,{"data-tour":"audit-groups",className:S("dark:bg-brand-930/90 bg-brand-0 flex justify-between items-center select-none p-0 pl-6 pr-3 rounded-[20px]",m&&"rounded-b-xl rounded-t-none shadow-lg"),children:[t.jsx("div",{className:"flex",children:z.map(Y=>t.jsxs("div",{onClick:()=>o(ae("activeTab",Y.key)),className:S("cursor-pointer flex items-center gap-2 px-4 py-3 text-sm font-medium",m&&"py-3",i===Y.key?"font-medium ":"text-brand-500 dark:hover:text-brand-300"),children:[Y.name,Y.key!=="configurations"&&t.jsx("div",{className:S("flex text-xxs items-center justify-center rounded-full w-6 h-6 border-2",m&&"w-5 h-5 border",r&&!n?"bg-zinc-200 border-zinc-300/30 text-zinc-300/30":S(Y.color,i===Y.key&&Y.activeColor)),children:t.jsx("div",{className:S(i===Y.key&&" text-white dark:text-brand-900"),children:(e==null?void 0:e.grouped[`${Y.key}`].length)||"-"})})]},Y.key))}),t.jsx("div",{className:"flex items-center",children:t.jsx(Ve,{children:d.length>1&&t.jsx(V1,{children:t.jsx("div",{onClick:Y=>o(ae("openAudits",[])),className:"dark:hover:bg-brand-700 hover:bg-brand-100 w-9 h-9 rounded-full flex items-center justify-center",children:t.jsx(ue,{text:"Collpase all Audits",children:t.jsx(Lm,{className:"w-5 text-brand-500 dark:text-brand-200"})})})})})})]})]}),t.jsx("div",{className:"audits pt-6 flex mb-24",children:t.jsx("div",{className:"w-full flex flex-col gap-2.5",children:t.jsxs(Ve,{initial:!1,children:[t.jsx("div",{className:"grid grid-cols-12 gap-6 w-full relative ",children:t.jsx("div",{className:"col-span-12 flex flex-col gap-4",children:i==="configurations"?t.jsx(t.Fragment,{children:t.jsx(lx,{})}):t.jsx(jg,{activeTab:i})})},"performance"),t.jsx("div",{children:i!=="configurations"&&(!(e!=null&&e.grouped[i])||(e==null?void 0:e.grouped[i].length)<=0)&&t.jsxs(ke.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"flex flex-col gap-8 items-center px-8 pt-40 w-full",children:[t.jsx("div",{children:t.jsx("img",{alt:"Good Job!",className:"w-64",src:R!=null&&R.page_optimizer_base?(R==null?void 0:R.page_optimizer_base)+"/success.svg":"/success.svg"})}),t.jsx("span",{className:"flex gap-2",children:"Brilliantly done! It's clear you've mastered this."})]})},"audit-blank"),t.jsx("div",{})]})})})]})},Pd=({children:e,uuid:r})=>t.jsx(ke.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},children:e},r),ux=()=>{const{data:e,loading:r,error:n,activeReport:s}=ce(xe),{activeMetric:a}=ge();Tt(a==null?void 0:a.score);const{togglePerformance:o,options:i}=ve(),d=l.useMemo(()=>{var v,j;let x=[...((v=e==null?void 0:e.grouped)==null?void 0:v.opportunities)||[],...((j=e==null?void 0:e.grouped)==null?void 0:j.diagnostics)||[]];return(a==null?void 0:a.refs.acronym)==="SI"?x.filter(b=>b.scoreDisplayMode!=="informative"):x.filter(b=>b.metrics.find(w=>w.id===(a==null?void 0:a.id)))},[e,a]),u=l.useMemo(()=>(a==null||a.refs.acronym,[a!=null&&a.potentialGain?t.jsxs(t.Fragment,{children:["Potential gain ",t.jsxs("span",{className:"text-brand-800 dark:text-brand-500 font-medium",children:[a==null?void 0:a.potentialGain.toFixed(0)," points"]})," "]}):null,t.jsxs(t.Fragment,{children:["Weighs ",t.jsxs("span",{className:"text-brand-800 dark:text-brand-500 font-medium",children:[a==null?void 0:a.refs.weight,"%"]})," of your page speed score"]})]),[a,s]),f={TBT:{description:"Imagine you're reading a storybook and there's a sticker covering some words. TBT, or Total Blocking Time, is like the time you wait for someone to remove that sticker. In websites, it's the time you wait before you can play or interact with the site. The shorter the wait, the better! ",learn_more:"https://web.dev/tbt/"},LCP:{description:"Imagine you're waiting for a picture in your storybook to appear. LCP, or Largest Contentful Paint, is like the time it takes for the biggest and most important picture in the story to fully show up. On websites, it's how long you wait to see the main part of the page. The faster it appears, the better the website is at showing you its main content quickly!",learn_more:"https://web.dev/lcp/"},FCP:{description:"Imagine opening a storybook, eager for the first picture. FCP, or First Contentful Paint, is the time it takes for that first image or word to appear. On websites, it's about how swiftly the starting content loads. The faster it appears, the sooner the website's story begins for you!",learn_more:"https://web.dev/fcp/"},SI:{description:"Imagine cookies baking. SI, or Speed Index, measures how fast most cookies are ready. On websites, it's how quickly main content appears. Faster cookies (or content) mean a better experience!",learn_more:"https://web.dev/si/"},CLS:{description:"While building a puzzle, imagine pieces suddenly shifting on their own. Confusing, right? CLS, or Cumulative Layout Shift, is like that for websites. It's when page elements move unexpectedly. The less they shift, the better the experience!",learn_more:"https://web.dev/cls/"}},m={mobile:{LCP:{good:2500,poor:4e3},FID:{good:100,poor:300},CLS:{good:.1,poor:.25},FCP:{good:1800,poor:3e3},SI:{good:3400,poor:5800},TBT:{good:300,poor:600}},desktop:{LCP:{good:2e3,poor:4e3},FID:{good:100,poor:300},CLS:{good:.1,poor:.25},FCP:{good:1e3,poor:3e3},SI:{good:1300,poor:2500},TBT:{good:200,poor:600}}};return a?t.jsxs(Pd,{uuid:a!=null&&a.id?a.id:"no-key",children:[t.jsx("div",{className:"ml-6",children:!o&&t.jsx(Bs,{})}),t.jsxs("div",{className:"flex flex-col gap-3 lg:mt-16 ml-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 border-b pb-6",children:[t.jsxs("div",{className:"text-4xl font-medium",children:[" ",a==null?void 0:a.title]}),t.jsxs("div",{className:"dark:text-brand-300 text-brand-600 text-md ",children:[t.jsx("span",{children:f[a.refs.acronym].description})," ",t.jsx("a",{target:"_blank",className:"text-purple-750",href:f[a==null?void 0:a.refs.acronym].learn_more,children:"Learn more"})]}),t.jsx("div",{children:t.jsxs("ul",{className:"flex ml-2 items-center text-sm gap-3 text-brand-500 dark:text-brand-400",children:[t.jsxs("li",{className:"flex items-center gap-1.5",children:[t.jsx(Se,{style:{fill:Tt(a==null?void 0:a.score)[1]},className:"w-3 stroke-none mt-[1px] dark:fill-brand-700"})," ",t.jsxs("span",{children:[(a==null?void 0:a.icon)==="pass"&&t.jsxs(t.Fragment,{children:["Great! You kept it below ",t.jsxs("span",{className:"text-brand-800 dark:text-brand-500 font-medium",children:[m[s][a==null?void 0:a.refs.acronym].good,a.refs.acronym!=="CLS"&&"ms"]})]}),((a==null?void 0:a.icon)==="fail"||(a==null?void 0:a.icon)==="average")&&t.jsxs(t.Fragment,{children:["Should be below ",t.jsxs("span",{className:"text-brand-800 dark:text-brand-500 font-medium",children:[m[s][a==null?void 0:a.refs.acronym].good,a.refs.acronym!=="CLS"&&"ms"]})]})]})]}),u.map((x,v)=>x&&t.jsxs("li",{className:"group flex gap-1.5 items-center",children:[t.jsx(Se,{className:"w-3 stroke-none mt-[1px] group-last:fill-brand-300 fill-green-600 :fill-brand-300 dark:fill-green-700"})," ",t.jsx("span",{children:x})]},v))]})})]}),d.length>0?t.jsxs("div",{className:"flex gap-4 flex-col w-full",children:[t.jsx("div",{className:"borderx-b px-4 w-full font-medium text-lg",children:"Related Audits"}),t.jsx("div",{className:"flex flex-col gap-4",children:d.map((x,v)=>t.jsx("div",{className:"relative",children:t.jsx(sd,{metrics:!1,index:v,audit:x})},v))})]}):t.jsxs(ke.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"flex flex-col gap-8 items-center px-8 pt-40 w-full",children:[t.jsx("div",{children:t.jsx("img",{alt:"Good Job!",className:"w-64",src:i!=null&&i.page_optimizer_base?(i==null?void 0:i.page_optimizer_base)+"/success.svg":"/success.svg"})}),t.jsx("span",{className:"flex gap-2",children:"Brilliantly done! It's clear you've mastered this."})]})]})]}):t.jsx(t.Fragment,{})},fx=de.memo(ux);function px(){const{data:e,loading:r,error:n,testMode:s}=ce(xe);Tt(e==null?void 0:e.performance);const{dispatch:a,activeMetric:o,testModeStatus:i}=ge(),{options:d,savingData:u,togglePerformance:f,optimizerContainer:m,invalidatingCache:x}=ve();let v=d==null?void 0:d.optimizer_url;return l.useEffect(()=>{if(u){const j=document.getElementById("rapidload-page-optimizer-content");j==null||j.scrollTo(0,0)}},[u]),t.jsxs(ke.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:"linear",duration:.04},id:"rapidload-page-optimizer-wrapper",translate:"no",className:S(" bg-white font-sans overflow-hidden fixed z-[100000] w-screen h-screen top-0 left-0 flex min-h-screen flex-col text-base items-center ","dark:text-brand-300 text-brand-800","notranslate"),children:[t.jsx(Ve,{children:i&&t.jsx(ke.div,{initial:{borderWidth:"0px"},animate:{borderWidth:"5px"},exit:{borderWidth:"0px"},transition:{duration:.5},className:S("absolute inset-0 z-[110002] pointer-events-none","border-solid border-[#f7b250] rounded-none"),children:t.jsx("div",{className:S("absolute -inset-[3px] rounded-xl","border-[3px] border-[#f7b250]")})})}),t.jsx(c1,{url:v}),t.jsx("div",{id:"rapidload-page-optimizer-content",className:S("overflow-y-auto scrollbar-stable w-full h-fit pb-20 -mt-[70px] ","dark:bg-brand-900 bg-brand-200/60 min-h-screen",u&&"relative overflow-hidden"),children:t.jsxs("section",{ref:m,className:S("relative container grid grid-cols-none lg:grid-cols-12 lg:grid-rows-0 gap-6 pt-[72px] mt-4"),children:[(u||x)&&t.jsx("div",{className:"fixed inset-0 flex justify-center items-center z-[110000] bg-brand-50/80 dark:bg-brand-950/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",children:t.jsxs("div",{className:"fixed top-1/2 flex gap-2 items-center justify-center",children:[t.jsx(Ge,{className:"w-5 animate-spin"}),u&&"Saving Changes...",x&&"Flushing Cache..."]})}),t.jsx("div",{className:"col-span-12 w-full"}),t.jsxs(t.Fragment,{children:[f&&t.jsxs("aside",{className:"col-span-12 lg:col-span-3",children:[t.jsxs("div",{className:"text-lg ml-5 flex items-center gap-2",children:["Page Insights ",f&&t.jsx(Bs,{})," "]}),t.jsx("div",{className:"widgets pt-4 flex",children:t.jsx($1,{})})]}),t.jsx("article",{className:S(f?"col-span-12 lg:col-span-9":"col-span-12"),children:t.jsx(Ve,{initial:!0,mode:"wait",children:o?t.jsx(fx,{}):t.jsx(Pd,{uuid:"perf",children:t.jsx(dx,{})})})})]})]})}),t.jsx(qc,{})]})}var Ad={exports:{}};(function(e,r){(function(n){e.exports=n()})(function(){var n=["navigation","request","process","log","user","state","error","manual"],s=function(c,p,g){for(var h=g,y=0,C=c.length;y=c&&g<=p}},x=function(c){return typeof c=="function"||i(c)&&a(c,function(p){return typeof p=="function"}).length===c.length},v=function(c){return typeof c=="string"&&!!c.length},j={},b=function(){return{unhandledExceptions:!0,unhandledRejections:!0}};j.schema={apiKey:{defaultValue:function(){return null},message:"is required",validate:v},appVersion:{defaultValue:function(){},message:"should be a string",validate:function(c){return c===void 0||v(c)}},appType:{defaultValue:function(){},message:"should be a string",validate:function(c){return c===void 0||v(c)}},autoDetectErrors:{defaultValue:function(){return!0},message:"should be true|false",validate:function(c){return c===!0||c===!1}},enabledErrorTypes:{defaultValue:function(){return b()},message:"should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }",allowPartialObject:!0,validate:function(c){if(typeof c!="object"||!c)return!1;var p=f(c),g=f(b());return!(a(p,function(h){return o(g,h)}).length0)}},onError:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:x},onSession:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:x},onBreadcrumb:{defaultValue:function(){return[]},message:"should be a function or array of functions",validate:x},endpoints:{defaultValue:function(){return{notify:"https://notify.bugsnag.com",sessions:"https://sessions.bugsnag.com"}},message:"should be an object containing endpoint URLs { notify, sessions }",validate:function(c){return c&&typeof c=="object"&&v(c.notify)&&v(c.sessions)&&a(f(c),function(p){return!o(["notify","sessions"],p)}).length===0}},autoTrackSessions:{defaultValue:function(c){return!0},message:"should be true|false",validate:function(c){return c===!0||c===!1}},enabledReleaseStages:{defaultValue:function(){return null},message:"should be an array of strings",validate:function(c){return c===null||i(c)&&a(c,function(p){return typeof p=="string"}).length===c.length}},releaseStage:{defaultValue:function(){return"production"},message:"should be a string",validate:function(c){return typeof c=="string"&&c.length}},maxBreadcrumbs:{defaultValue:function(){return 25},message:"should be a number ≤100",validate:function(c){return m(0,100)(c)}},enabledBreadcrumbTypes:{defaultValue:function(){return n},message:"should be null or a list of available breadcrumb types ("+n.join(",")+")",validate:function(c){return c===null||i(c)&&s(c,function(p,g){return p===!1?p:o(n,g)},!0)}},context:{defaultValue:function(){},message:"should be a string",validate:function(c){return c===void 0||typeof c=="string"}},user:{defaultValue:function(){return{}},message:"should be an object with { id, email, name } properties",validate:function(c){return c===null||c&&s(f(c),function(p,g){return p&&o(["id","email","name"],g)},!0)}},metadata:{defaultValue:function(){return{}},message:"should be an object",validate:function(c){return typeof c=="object"&&c!==null}},logger:{defaultValue:function(){},message:"should be null or an object with methods { debug, info, warn, error }",validate:function(c){return!c||c&&s(["debug","info","warn","error"],function(p,g){return p&&typeof c[g]=="function"},!0)}},redactedKeys:{defaultValue:function(){return["password"]},message:"should be an array of strings|regexes",validate:function(c){return i(c)&&c.length===a(c,function(p){return typeof p=="string"||p&&typeof p.test=="function"}).length}},plugins:{defaultValue:function(){return[]},message:"should be an array of plugin objects",validate:function(c){return i(c)&&c.length===a(c,function(p){return p&&typeof p=="object"&&typeof p.load=="function"}).length}},featureFlags:{defaultValue:function(){return[]},message:'should be an array of objects that have a "name" property',validate:function(c){return i(c)&&c.length===a(c,function(p){return p&&typeof p=="object"&&typeof p.name=="string"}).length}}};var w=function(c){for(var p=1;p-1&&(E=E.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var F=E.replace(/^\s+/,"").replace(/\(eval code/g,"("),I=F.match(/ (\((.+):(\d+):(\d+)\)$)/);F=I?F.replace(I[0],""):F;var U=F.split(/\s+/).slice(1),P=this.extractLocation(I?I[1]:U.pop()),ee=U.join(" ")||void 0,se=["eval",""].indexOf(P[0])>-1?void 0:P[0];return new p({functionName:ee,fileName:se,lineNumber:P[1],columnNumber:P[2],source:E})},this)},parseFFOrSafari:function(N){var M=N.stack.split(`
+`).filter(function(E){return!E.match(y)},this);return M.map(function(E){if(E.indexOf(" > eval")>-1&&(E=E.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),E.indexOf("@")===-1&&E.indexOf(":")===-1)return new p({functionName:E});var F=/((.*".+"[^@]*)?[^@]*)(?:@)/,I=E.match(F),U=I&&I[1]?I[1]:void 0,P=this.extractLocation(E.replace(F,""));return new p({functionName:U,fileName:P[0],lineNumber:P[1],columnNumber:P[2],source:E})},this)},parseOpera:function(N){return!N.stacktrace||N.message.indexOf(`
`)>-1&&N.message.split(`
`).length>N.stacktrace.split(`
-`).length?this.parseOpera9(N):N.stack?this.parseOpera11(N):this.parseOpera10(N)},parseOpera9:function(N){for(var R=/Line (\d+).*script (?:in )?(\S+)/i,E=N.message.split(`
-`),F=[],I=2,H=E.length;I/,"$2").replace(/\([^\)]*\)/g,"")||void 0,ee;H.match(/\(([^\)]*)\)/)&&(ee=H.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var se=ee===void 0||ee==="[arguments not available]"?void 0:ee.split(",");return new p({functionName:P,args:se,fileName:I[0],lineNumber:I[1],columnNumber:I[2],source:E})},this)}}});var U=D,Q=function(c,p,g,h){var b=h&&h.redactedKeys?h.redactedKeys:[],C=h&&h.redactedPaths?h.redactedPaths:[];return JSON.stringify($e(c,b,C),p,g)},Y=20,Z=25e3,G=8,te="...";function k(c){return c instanceof Error||/^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(c))}function O(c){return"[Throws: "+(c?c.message:"?")+"]"}function V(c,p){for(var g=0,h=c.length;gG&&b>Z}if(b++,R.length>Y||E())return te;if(N===null||typeof N!="object")return N;if(V(h,N))return"[Circular]";if(h.push(N),typeof N.toJSON=="function")try{b--;var F=C(N.toJSON(),R);return h.pop(),F}catch(ne){return O(ne)}var I=k(N);if(I){b--;var H=C({name:N.name,message:N.message},R);return h.pop(),H}if(be(N)){for(var P=[],ee=0,se=N.length;ee-1&&!p.file&&!p.method&&(p.file="global code"),p},fe=function(c){return/^global code$/i.test(c)?"global code":c},pe=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},ye=function(c){return typeof c=="string"?c:""};function Te(c,p,g,h){return{errorClass:ye(c),errorMessage:ye(p),type:g,stacktrace:s(h,function(b,C){var N=re(C);try{return JSON.stringify(N)==="{}"?b:b.concat(N)}catch{return b}},[])}}function _e(c){return c.cause?[c].concat(_e(c.cause)):[c]}B.getStacktrace=function(c,p,g){if(qe(c))return U.parse(c).slice(p);try{return a(jt.backtrace(),function(h){return(h.functionName||"").indexOf("StackGenerator$$")===-1}).slice(1+g)}catch{return[]}},B.create=function(c,p,g,h,b,C){b===void 0&&(b=0);var N=ct(c,p,h,C),R=N[0],E=N[1],F;try{var I=B.getStacktrace(R,E>0?1+E+b:0,1+b);F=new B(R.name,R.message,I,g,c)}catch{F=new B(R.name,R.message,[],g,c)}if(R.name==="InvalidError"&&F.addMetadata(""+h,"non-error parameter",lt(c)),R.cause){var H,P=_e(R).slice(1),ee=_(P,function(se){var ge=yt(se)&&qe(se)?U.parse(se):[],W=ct(se,!0,"error cause"),ne=W[0];return ne.name==="InvalidError"&&F.addMetadata("error cause",lt(se)),Te(ne.name,ne.message,B.__type,ge)});(H=F.errors).push.apply(H,ee)}return F};var lt=function(c){return c===null?"null":c===void 0?"undefined":c},ct=function(c,p,g,h){var b,C=0,N=function(R){var E=g==="error cause"?"was":"received";h&&h.warn(g+" "+E+' a non-error: "'+R+'"');var F=new Error(g+" "+E+' a non-error. See "'+g+'" tab for more detail.');return F.name="InvalidError",F};if(!p)yt(c)?b=c:(b=N(typeof c),C+=2);else switch(typeof c){case"string":case"number":case"boolean":b=new Error(String(c)),C+=1;break;case"function":b=N("function"),C+=2;break;case"object":c!==null&&yt(c)?b=c:c!==null&&rr(c)?(b=new Error(c.message||c.errorMessage),b.name=c.name||c.errorClass,C+=1):(b=N(c===null?"null":"unsupported object"),C+=2);break;default:b=N("nothing"),C+=2}if(!qe(b))try{throw b}catch(R){qe(R)&&(b=R,C=1)}return[b,C]};B.__type="browserjs";var rr=function(c){return(typeof c.name=="string"||typeof c.errorClass=="string")&&(typeof c.message=="string"||typeof c.errorMessage=="string")},Ct=B,nr=function(c,p,g){var h=0,b=function(){if(h>=c.length)return g(null,!0);p(c[h],function(C,N){if(C)return g(C);if(N===!1)return g(null,!1);h++,b()})};b()},Ft=function(c,p,g,h){var b=function(C,N){if(typeof C!="function")return N(null);try{if(C.length!==2){var R=C(p);return R&&typeof R.then=="function"?R.then(function(E){return setTimeout(function(){return N(null,E)})},function(E){setTimeout(function(){return g(E),N(null,!0)})}):N(null,R)}C(p,function(E,F){if(E)return g(E),N(null);N(null,F)})}catch(E){g(E),N(null)}};nr(c,b,h)},Xs=function(c,p,g,h){for(var b=!1,C=c.slice();!b&&C.length;)try{b=C.pop()(p)===!1}catch(N){h.error("Error occurred in "+g+" callback, continuing anyway…"),h.error(N)}return b},un=function(p,g){var h="000000000"+p;return h.substr(h.length-g)},Ys=typeof window=="object"?window:self,Js=0;for(var Ud in Ys)Object.hasOwnProperty.call(Ys,Ud)&&Js++;var Gd=navigator.mimeTypes?navigator.mimeTypes.length:0,Kd=un((Gd+navigator.userAgent.length).toString(36)+Js.toString(36),4),Qs=function(){return Kd},Bt=0,fn=4,sr=36,ea=Math.pow(sr,fn);function ta(){return un((Math.random()*ea<<0).toString(sr),fn)}function qd(){return Bt=Btthis._config.maxBreadcrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(this._breadcrumbs.length-this._config.maxBreadcrumbs))}},p._isBreadcrumbTypeEnabled=function(h){var b=this._config.enabledBreadcrumbTypes;return b===null||o(b,h)},p.notify=function(h,b,C){C===void 0&&(C=st);var N=Ct.create(h,!0,void 0,"notify()",this._depth+1,this._logger);this._notify(N,b,C)},p._notify=function(h,b,C){var N=this;if(C===void 0&&(C=st),h.app=w({},h.app,{releaseStage:this._config.releaseStage,version:this._config.appVersion,type:this._config.appType}),h.context=h.context||this._context,h._metadata=w({},h._metadata,this._metadata),h._user=w({},h._user,this._user),h.breadcrumbs=this._breadcrumbs.slice(),mn(h._features,this._features,h._featuresIndex),this._config.enabledReleaseStages!==null&&!o(this._config.enabledReleaseStages,this._config.releaseStage))return this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration"),C(null,h);var R=h.severity,E=function(I){N._logger.error("Error occurred in onError callback, continuing anyway…"),N._logger.error(I)},F=[].concat(this._cbs.e).concat(b);Ft(F,h,E,function(I,H){if(I&&E(I),!H)return N._logger.debug("Event not sent due to onError callback"),C(null,h);N._isBreadcrumbTypeEnabled("error")&&c.prototype.leaveBreadcrumb.call(N,h.errors[0].errorClass,{errorClass:h.errors[0].errorClass,errorMessage:h.errors[0].errorMessage,severity:h.severity},"error"),R!==h.severity&&(h._handledState.severityReason={type:"userCallbackSetSeverity"}),h.unhandled!==h._handledState.unhandled&&(h._handledState.severityReason.unhandledOverridden=!0,h._handledState.unhandled=h.unhandled),N._session&&(N._session._track(h),h._session=N._session),N._delivery.sendEvent({apiKey:h.apiKey||N._config.apiKey,notifier:N._notifier,events:[h]},function(P){return C(P,h)})})},c}(),Qd=function(c,p){var g=new Error(`Invalid configuration
-`+_(f(c),function(h){return" - "+h+" "+c[h]+", got "+eu(p[h])}).join(`
+`).length?this.parseOpera9(N):N.stack?this.parseOpera11(N):this.parseOpera10(N)},parseOpera9:function(N){for(var M=/Line (\d+).*script (?:in )?(\S+)/i,E=N.message.split(`
+`),F=[],I=2,U=E.length;I/,"$2").replace(/\([^\)]*\)/g,"")||void 0,ee;U.match(/\(([^\)]*)\)/)&&(ee=U.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var se=ee===void 0||ee==="[arguments not available]"?void 0:ee.split(",");return new p({functionName:P,args:se,fileName:I[0],lineNumber:I[1],columnNumber:I[2],source:E})},this)}}});var z=D,Q=function(c,p,g,h){var y=h&&h.redactedKeys?h.redactedKeys:[],C=h&&h.redactedPaths?h.redactedPaths:[];return JSON.stringify($e(c,y,C),p,g)},Y=20,Z=25e3,G=8,te="...";function k(c){return c instanceof Error||/^\[object (Error|(Dom)?Exception)\]$/.test(Object.prototype.toString.call(c))}function O(c){return"[Throws: "+(c?c.message:"?")+"]"}function H(c,p){for(var g=0,h=c.length;gG&&y>Z}if(y++,M.length>Y||E())return te;if(N===null||typeof N!="object")return N;if(H(h,N))return"[Circular]";if(h.push(N),typeof N.toJSON=="function")try{y--;var F=C(N.toJSON(),M);return h.pop(),F}catch(ne){return O(ne)}var I=k(N);if(I){y--;var U=C({name:N.name,message:N.message},M);return h.pop(),U}if(be(N)){for(var P=[],ee=0,se=N.length;ee-1&&!p.file&&!p.method&&(p.file="global code"),p},pe=function(c){return/^global code$/i.test(c)?"global code":c},me=function(){return{unhandled:!1,severity:"warning",severityReason:{type:"handledException"}}},ye=function(c){return typeof c=="string"?c:""};function Te(c,p,g,h){return{errorClass:ye(c),errorMessage:ye(p),type:g,stacktrace:s(h,function(y,C){var N=re(C);try{return JSON.stringify(N)==="{}"?y:y.concat(N)}catch{return y}},[])}}function _e(c){return c.cause?[c].concat(_e(c.cause)):[c]}B.getStacktrace=function(c,p,g){if(qe(c))return z.parse(c).slice(p);try{return a(jt.backtrace(),function(h){return(h.functionName||"").indexOf("StackGenerator$$")===-1}).slice(1+g)}catch{return[]}},B.create=function(c,p,g,h,y,C){y===void 0&&(y=0);var N=ct(c,p,h,C),M=N[0],E=N[1],F;try{var I=B.getStacktrace(M,E>0?1+E+y:0,1+y);F=new B(M.name,M.message,I,g,c)}catch{F=new B(M.name,M.message,[],g,c)}if(M.name==="InvalidError"&&F.addMetadata(""+h,"non-error parameter",lt(c)),M.cause){var U,P=_e(M).slice(1),ee=_(P,function(se){var he=yt(se)&&qe(se)?z.parse(se):[],W=ct(se,!0,"error cause"),ne=W[0];return ne.name==="InvalidError"&&F.addMetadata("error cause",lt(se)),Te(ne.name,ne.message,B.__type,he)});(U=F.errors).push.apply(U,ee)}return F};var lt=function(c){return c===null?"null":c===void 0?"undefined":c},ct=function(c,p,g,h){var y,C=0,N=function(M){var E=g==="error cause"?"was":"received";h&&h.warn(g+" "+E+' a non-error: "'+M+'"');var F=new Error(g+" "+E+' a non-error. See "'+g+'" tab for more detail.');return F.name="InvalidError",F};if(!p)yt(c)?y=c:(y=N(typeof c),C+=2);else switch(typeof c){case"string":case"number":case"boolean":y=new Error(String(c)),C+=1;break;case"function":y=N("function"),C+=2;break;case"object":c!==null&&yt(c)?y=c:c!==null&&nr(c)?(y=new Error(c.message||c.errorMessage),y.name=c.name||c.errorClass,C+=1):(y=N(c===null?"null":"unsupported object"),C+=2);break;default:y=N("nothing"),C+=2}if(!qe(y))try{throw y}catch(M){qe(M)&&(y=M,C=1)}return[y,C]};B.__type="browserjs";var nr=function(c){return(typeof c.name=="string"||typeof c.errorClass=="string")&&(typeof c.message=="string"||typeof c.errorMessage=="string")},Ct=B,sr=function(c,p,g){var h=0,y=function(){if(h>=c.length)return g(null,!0);p(c[h],function(C,N){if(C)return g(C);if(N===!1)return g(null,!1);h++,y()})};y()},Ft=function(c,p,g,h){var y=function(C,N){if(typeof C!="function")return N(null);try{if(C.length!==2){var M=C(p);return M&&typeof M.then=="function"?M.then(function(E){return setTimeout(function(){return N(null,E)})},function(E){setTimeout(function(){return g(E),N(null,!0)})}):N(null,M)}C(p,function(E,F){if(E)return g(E),N(null);N(null,F)})}catch(E){g(E),N(null)}};sr(c,y,h)},Ys=function(c,p,g,h){for(var y=!1,C=c.slice();!y&&C.length;)try{y=C.pop()(p)===!1}catch(N){h.error("Error occurred in "+g+" callback, continuing anyway…"),h.error(N)}return y},un=function(p,g){var h="000000000"+p;return h.substr(h.length-g)},Js=typeof window=="object"?window:self,Qs=0;for(var Gd in Js)Object.hasOwnProperty.call(Js,Gd)&&Qs++;var Kd=navigator.mimeTypes?navigator.mimeTypes.length:0,qd=un((Kd+navigator.userAgent.length).toString(36)+Qs.toString(36),4),ea=function(){return qd},Bt=0,fn=4,ar=36,ta=Math.pow(ar,fn);function ra(){return un((Math.random()*ta<<0).toString(ar),fn)}function Wd(){return Bt=Btthis._config.maxBreadcrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(this._breadcrumbs.length-this._config.maxBreadcrumbs))}},p._isBreadcrumbTypeEnabled=function(h){var y=this._config.enabledBreadcrumbTypes;return y===null||o(y,h)},p.notify=function(h,y,C){C===void 0&&(C=st);var N=Ct.create(h,!0,void 0,"notify()",this._depth+1,this._logger);this._notify(N,y,C)},p._notify=function(h,y,C){var N=this;if(C===void 0&&(C=st),h.app=w({},h.app,{releaseStage:this._config.releaseStage,version:this._config.appVersion,type:this._config.appType}),h.context=h.context||this._context,h._metadata=w({},h._metadata,this._metadata),h._user=w({},h._user,this._user),h.breadcrumbs=this._breadcrumbs.slice(),mn(h._features,this._features,h._featuresIndex),this._config.enabledReleaseStages!==null&&!o(this._config.enabledReleaseStages,this._config.releaseStage))return this._logger.warn("Event not sent due to releaseStage/enabledReleaseStages configuration"),C(null,h);var M=h.severity,E=function(I){N._logger.error("Error occurred in onError callback, continuing anyway…"),N._logger.error(I)},F=[].concat(this._cbs.e).concat(y);Ft(F,h,E,function(I,U){if(I&&E(I),!U)return N._logger.debug("Event not sent due to onError callback"),C(null,h);N._isBreadcrumbTypeEnabled("error")&&c.prototype.leaveBreadcrumb.call(N,h.errors[0].errorClass,{errorClass:h.errors[0].errorClass,errorMessage:h.errors[0].errorMessage,severity:h.severity},"error"),M!==h.severity&&(h._handledState.severityReason={type:"userCallbackSetSeverity"}),h.unhandled!==h._handledState.unhandled&&(h._handledState.severityReason.unhandledOverridden=!0,h._handledState.unhandled=h.unhandled),N._session&&(N._session._track(h),h._session=N._session),N._delivery.sendEvent({apiKey:h.apiKey||N._config.apiKey,notifier:N._notifier,events:[h]},function(P){return C(P,h)})})},c}(),eu=function(c,p){var g=new Error(`Invalid configuration
+`+_(f(c),function(h){return" - "+h+" "+c[h]+", got "+tu(p[h])}).join(`
-`));return g},eu=function(c){switch(typeof c){case"string":case"number":case"object":return JSON.stringify(c);default:return String(c)}},hn=Jd,Nt={},na=["events.[].metaData","events.[].breadcrumbs.[].metaData","events.[].request"];Nt.event=function(c,p){var g=Q(c,null,null,{redactedPaths:na,redactedKeys:p});return g.length>1e6&&(c.events[0]._metadata={notifier:`WARNING!
+`));return g},tu=function(c){switch(typeof c){case"string":case"number":case"object":return JSON.stringify(c);default:return String(c)}},hn=Qd,Nt={},sa=["events.[].metaData","events.[].breadcrumbs.[].metaData","events.[].request"];Nt.event=function(c,p){var g=Q(c,null,null,{redactedPaths:sa,redactedKeys:p});return g.length>1e6&&(c.events[0]._metadata={notifier:`WARNING!
Serialized payload was `+g.length/1e6+`MB (limit = 1MB)
-metadata was removed`},g=Q(c,null,null,{redactedPaths:na,redactedKeys:p})),g},Nt.session=function(c,p){var g=Q(c,null,null);return g};var gn={};gn=function(c,p){return p===void 0&&(p=window),{sendEvent:function(g,h){h===void 0&&(h=function(){});var b=sa(c._config,"notify","4",p),C=Nt.event(g,c._config.redactedKeys),N=new p.XDomainRequest;N.onload=function(){h(null)},N.onerror=function(){var R=new Error("Event failed to send");c._logger.error("Event failed to send…",R),C.length>1e6&&c._logger.warn("Event oversized ("+(C.length/1e6).toFixed(2)+" MB)"),h(R)},N.open("POST",b),setTimeout(function(){try{N.send(C)}catch(R){c._logger.error(R),h(R)}},0)},sendSession:function(g,h){h===void 0&&(h=function(){});var b=sa(c._config,"sessions","1",p),C=new p.XDomainRequest;C.onload=function(){h(null)},C.open("POST",b),setTimeout(function(){try{C.send(Nt.session(g,c._config.redactedKeys))}catch(N){c._logger.error(N),h(N)}},0)}}};var sa=function(c,p,g,h){var b=JSON.parse(JSON.stringify(new Date)),C=tu(c.endpoints[p],h.location.protocol);return C+"?apiKey="+encodeURIComponent(c.apiKey)+"&payloadVersion="+g+"&sentAt="+encodeURIComponent(b)},tu=gn._matchPageProtocol=function(c,p){return p==="http:"?c.replace(/^https:/,"http:"):c},ru=function(c,p){return p===void 0&&(p=window),{sendEvent:function(g,h){h===void 0&&(h=function(){});try{var b=c._config.endpoints.notify,C=new p.XMLHttpRequest,N=Nt.event(g,c._config.redactedKeys);C.onreadystatechange=function(){if(C.readyState===p.XMLHttpRequest.DONE){var R=C.status;if(R===0||R>=400){var E=new Error("Request failed with status "+R);c._logger.error("Event failed to send…",E),N.length>1e6&&c._logger.warn("Event oversized ("+(N.length/1e6).toFixed(2)+" MB)"),h(E)}else h(null)}},C.open("POST",b),C.setRequestHeader("Content-Type","application/json"),C.setRequestHeader("Bugsnag-Api-Key",g.apiKey||c._config.apiKey),C.setRequestHeader("Bugsnag-Payload-Version","4"),C.setRequestHeader("Bugsnag-Sent-At",new Date().toISOString()),C.send(N)}catch(R){c._logger.error(R)}},sendSession:function(g,h){h===void 0&&(h=function(){});try{var b=c._config.endpoints.sessions,C=new p.XMLHttpRequest;C.onreadystatechange=function(){if(C.readyState===p.XMLHttpRequest.DONE){var N=C.status;if(N===0||N>=400){var R=new Error("Request failed with status "+N);c._logger.error("Session failed to send…",R),h(R)}else h(null)}},C.open("POST",b),C.setRequestHeader("Content-Type","application/json"),C.setRequestHeader("Bugsnag-Api-Key",c._config.apiKey),C.setRequestHeader("Bugsnag-Payload-Version","1"),C.setRequestHeader("Bugsnag-Sent-At",new Date().toISOString()),C.send(Nt.session(g,c._config.redactedKeys))}catch(N){c._logger.error(N)}}}},aa=new Date,nu=function(){aa=new Date},su={name:"appDuration",load:function(c){return c.addOnError(function(p){var g=new Date;p.app.duration=g-aa},!0),{reset:nu}}},au=function(c){return c===void 0&&(c=window),{load:function(p){p.addOnError(function(g){g.context===void 0&&(g.context=c.location.pathname)},!0)}}},xn=function(p,g){var h="000000000"+p;return h.substr(h.length-g)},oa=typeof window=="object"?window:self,ia=0;for(var ou in oa)Object.hasOwnProperty.call(oa,ou)&&ia++;var iu=navigator.mimeTypes?navigator.mimeTypes.length:0,lu=xn((iu+navigator.userAgent.length).toString(36)+ia.toString(36),4),la=function(){return lu},zt=0,vn=4,ar=36,ca=Math.pow(ar,vn);function da(){return xn((Math.random()*ca<<0).toString(ar),vn)}function cu(){return zt=ztp.document.documentElement.clientHeight?"landscape":"portrait"),g._config.generateAnonymousId&&(h.id=uu(p)),g.addOnSession(function(b){b.device=w({},b.device,h),g._config.collectUserIp||pa(b)}),g.addOnError(function(b){b.device=w({},b.device,h,{time:new Date}),g._config.collectUserIp||pa(b)},!0)},configSchema:{generateAnonymousId:{validate:function(g){return g===!0||g===!1},defaultValue:function(){return!0},message:"should be true|false"}}}},pa=function(c){var p=c.getUser();(!p||!p.id)&&c.setUser(c.device.id)},pu=function(c){return c===void 0&&(c=window),{load:function(p){p.addOnError(function(g){g.request&&g.request.url||(g.request=w({},g.request,{url:c.location.href}))},!0)}}},mu={load:function(c){c._sessionDelegate=hu}},hu={startSession:function(c,p){var g=c;return g._session=p,g._pausedSession=null,g._config.enabledReleaseStages!==null&&!o(g._config.enabledReleaseStages,g._config.releaseStage)?(g._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration"),g):(g._delivery.sendSession({notifier:g._notifier,device:p.device,app:p.app,sessions:[{id:p.id,startedAt:p.startedAt,user:p._user}]}),g)},resumeSession:function(c){return c._session?c:c._pausedSession?(c._session=c._pausedSession,c._pausedSession=null,c):c.startSession()},pauseSession:function(c){c._pausedSession=c._session,c._session=null}},gu={load:function(c){c._config.collectUserIp||c.addOnError(function(p){p._user&&typeof p._user.id>"u"&&delete p._user.id,p._user=w({id:"[REDACTED]"},p._user),p.request=w({clientIp:"[REDACTED]"},p.request)})},configSchema:{collectUserIp:{defaultValue:function(){return!0},message:"should be true|false",validate:function(c){return c===!0||c===!1}}}},ma={};ma.load=function(c){var p=/^(local-)?dev(elopment)?$/.test(c._config.releaseStage);p||!c._isBreadcrumbTypeEnabled("log")||_(xu,function(g){var h=console[g];console[g]=function(){for(var b=arguments.length,C=new Array(b),N=0;N"].concat(b.split(`
-`)),Ce=W-1,we=Math.max(Ce-3,0),Oe=Math.min(Ce+3,ne.length);return s(ne.slice(we,Oe),function(Ae,Vt,jn){return Ae[we+1+jn]=Vt.length<=ha?Vt:Vt.substr(0,ha),Ae},{})};g.addOnError(function(W){W.errors[0].stacktrace=a(W.errors[0].stacktrace,function(Ae){return!/__trace__$/.test(Ae.method)});var ne=W.errors[0].stacktrace[0],Ce=function(Ae){return Ae.replace(/#.*$/,"").replace(/\?.*$/,"")};if(!(ne&&ne.file&&Ce(ne.file)!==Ce(h))){var we=H();if(we){var Oe=we.innerHTML;W.addMetadata("script","content",Oe.length<=ga?Oe:Oe.substr(0,ga)),ne&&ne.lineNumber&&(ne.code=P(ne.lineNumber))}}},!0);var ee=_(["setTimeout","setInterval","setImmediate","requestAnimationFrame"],function(W){return bn(p,W,function(ne){return ge(ne,function(Ce){return{get:function(){return Ce[0]},replace:function(we){Ce[0]=we}}})})}),se=ee[0];_(["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],function(W){!p[W]||!p[W].prototype||!Object.prototype.hasOwnProperty.call(p[W].prototype,"addEventListener")||(bn(p[W].prototype,"addEventListener",function(ne){return ge(ne,xa)}),bn(p[W].prototype,"removeEventListener",function(ne){return ge(ne,xa,!0)}))});function ge(W,ne,Ce){return Ce===void 0&&(Ce=!1),function(){var we=[].slice.call(arguments);try{var Oe=ne(we),Ae=Oe.get();if(Ce&&W.apply(this,we),typeof Ae!="function")return W.apply(this,we);if(Ae.__trace__)Oe.replace(Ae.__trace__);else{var Vt=H();Ae.__trace__=function(){I(Vt),se(function(){I(null)},0);var Au=Ae.apply(this,arguments);return I(null),Au},Ae.__trace__.__trace__=Ae.__trace__,Oe.replace(Ae.__trace__)}}catch{}if(W.apply)return W.apply(this,we);switch(we.length){case 1:return W(we[0]);case 2:return W(we[0],we[1]);default:return W()}}}},configSchema:{trackInlineScripts:{validate:function(g){return g===!0||g===!1},defaultValue:function(){return!0},message:"should be true|false"}}}};function bn(c,p,g){var h=c[p];if(!h)return h;var b=g(h);return c[p]=b,h}function xa(c){var p=!!c[1]&&typeof c[1].handleEvent=="function";return{get:function(){return p?c[1].handleEvent:c[1]},replace:function(g){p?c[1].handleEvent=g:c[1]=g}}}var bu=function(c){return c===void 0&&(c=window),{load:function(p){"addEventListener"in c&&p._isBreadcrumbTypeEnabled("user")&&c.addEventListener("click",function(g){var h,b;try{h=wu(g.target),b=va(g.target,c)}catch{h="[hidden]",b="[hidden]",p._logger.error("Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z")}p.leaveBreadcrumb("UI click",{targetText:h,targetSelector:b},"user")},!0)}}},yu=/^\s*([^\s][\s\S]{0,139}[^\s])?\s*/;function wu(c){var p=c.textContent||c.innerText||"";return!p&&(c.type==="submit"||c.type==="button")&&(p=c.value),p=p.replace(yu,"$1"),p.length>140?p.slice(0,135)+"(...)":p}function va(c,p){var g=[c.tagName];if(c.id&&g.push("#"+c.id),c.className&&c.className.length&&g.push("."+c.className.split(" ").join(".")),!p.document.querySelectorAll||!Array.prototype.indexOf)return g.join("");try{if(p.document.querySelectorAll(g.join("")).length===1)return g.join("")}catch{return g.join("")}if(c.parentNode.childNodes.length>1){var h=Array.prototype.indexOf.call(c.parentNode.childNodes,c)+1;g.push(":nth-child("+h+")")}return p.document.querySelectorAll(g.join("")).length===1?g.join(""):c.parentNode?va(c.parentNode,p)+" > "+g.join(""):g.join("")}var ba={};ba=function(c){c===void 0&&(c=window);var p={load:function(g){if("addEventListener"in c&&g._isBreadcrumbTypeEnabled("navigation")){var h=function(b){return function(){return g.leaveBreadcrumb(b,{},"navigation")}};c.addEventListener("pagehide",h("Page hidden"),!0),c.addEventListener("pageshow",h("Page shown"),!0),c.addEventListener("load",h("Page loaded"),!0),c.document.addEventListener("DOMContentLoaded",h("DOMContentLoaded"),!0),c.addEventListener("load",function(){return c.addEventListener("popstate",h("Navigated back"),!0)}),c.addEventListener("hashchange",function(b){var C=b.oldURL?{from:or(b.oldURL,c),to:or(b.newURL,c),state:wa(c)}:{to:or(c.location.href,c)};g.leaveBreadcrumb("Hash changed",C,"navigation")},!0),c.history.replaceState&&ya(g,c.history,"replaceState",c),c.history.pushState&&ya(g,c.history,"pushState",c)}}};return p};var or=function(c,p){var g=p.document.createElement("A");return g.href=c,""+g.pathname+g.search+g.hash},ju=function(c,p,g,h){var b=or(c.location.href,c);return{title:g,state:p,prevState:wa(c),to:h||b,from:b}},ya=function(c,p,g,h){var b=p[g];p[g]=function(C,N,R){c.leaveBreadcrumb("History "+g,ju(h,C,N,R),"navigation"),typeof c.resetEventCount=="function"&&c.resetEventCount(),c._config.autoTrackSessions&&c.startSession(),b.apply(p,[C,N].concat(R!==void 0?R:[]))}},wa=function(c){try{return c.history.state}catch{}},St="request",_u=function(c,p){c===void 0&&(c=[]),p===void 0&&(p=window);var g={load:function(h){if(!h._isBreadcrumbTypeEnabled("request"))return;var b=[h._config.endpoints.notify,h._config.endpoints.sessions].concat(c);C(),E();function C(){if("addEventListener"in p.XMLHttpRequest.prototype){var H=p.XMLHttpRequest.prototype.open;p.XMLHttpRequest.prototype.open=function(ee,se){var ge=this,W=!1,ne=function(){return R(ee,se)},Ce=function(){return N(ee,se,ge.status)};W&&(this.removeEventListener("load",Ce),this.removeEventListener("error",ne)),this.addEventListener("load",Ce),this.addEventListener("error",ne),W=!0,H.apply(this,arguments)}}}function N(H,P,ee){if(P===void 0){h._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.");return}if(!(typeof P=="string"&&o(b,P.replace(/\?.*$/,"")))){var se={status:ee,request:H+" "+P};ee>=400?h.leaveBreadcrumb("XMLHttpRequest failed",se,St):h.leaveBreadcrumb("XMLHttpRequest succeeded",se,St)}}function R(H,P){if(P===void 0){h._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.");return}typeof P=="string"&&o(b,P.replace(/\?.*$/,""))||h.leaveBreadcrumb("XMLHttpRequest error",{request:H+" "+P},St)}function E(){if(!(!("fetch"in p)||p.fetch.polyfill)){var H=p.fetch;p.fetch=function(){var ee=arguments,se=arguments[0],ge=arguments[1],W,ne=null;return se&&typeof se=="object"?(ne=se.url,ge&&"method"in ge?W=ge.method:se&&"method"in se&&(W=se.method)):(ne=se,ge&&"method"in ge&&(W=ge.method)),W===void 0&&(W="GET"),new Promise(function(Ce,we){H.apply(void 0,ee).then(function(Oe){F(Oe,W,ne),Ce(Oe)}).catch(function(Oe){I(W,ne),we(Oe)})})}}}var F=function(H,P,ee){var se={status:H.status,request:P+" "+ee};H.status>=400?h.leaveBreadcrumb("fetch() failed",se,St):h.leaveBreadcrumb("fetch() succeeded",se,St)},I=function(H,P){h.leaveBreadcrumb("fetch() error",{request:H+" "+P},St)}}};return g},Cu={load:function(c){var p=0;c.addOnError(function(g){if(p>=c._config.maxEvents)return c._logger.warn("Cancelling event send due to maxEvents per session limit of "+c._config.maxEvents+" being reached"),!1;p++}),c.resetEventCount=function(){p=0}},configSchema:{maxEvents:{defaultValue:function(){return 10},message:"should be a positive integer ≤100",validate:function(c){return m(1,100)(c)}}}},yn={};yn={load:function(c){c.addOnError(function(p){var g=s(p.errors,function(h,b){return h.concat(b.stacktrace)},[]);_(g,function(h){h.file=Nu(h.file)})})}};var Nu=yn._strip=function(c){return typeof c=="string"?c.replace(/\?.*$/,"").replace(/#.*$/,""):c},Su=function(c,p){return c===void 0&&(c=window),p===void 0&&(p="window onerror"),{load:function(g){if(!g._config.autoDetectErrors||!g._config.enabledErrorTypes.unhandledExceptions)return;function h(C,N,R,E,F){if(R===0&&/Script error\.?/.test(C))g._logger.warn("Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z");else{var I={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},H;if(F)H=g.Event.create(F,!0,I,p,1),ja(H.errors[0].stacktrace,N,R,E);else if(typeof C=="object"&&C!==null&&(!N||typeof N!="string")&&!R&&!E&&!F){var P=C.type?"Event: "+C.type:"Error",ee=C.message||C.detail||"";H=g.Event.create({name:P,message:ee},!0,I,p,1),H.originalError=C,H.addMetadata(p,{event:C,extraParameters:N})}else H=g.Event.create(C,!0,I,p,1),ja(H.errors[0].stacktrace,N,R,E);g._notify(H)}typeof b=="function"&&b.apply(this,arguments)}var b=c.onerror;c.onerror=h}}},ja=function(c,p,g,h){c[0]||c.push({});var b=c[0];!b.file&&typeof p=="string"&&(b.file=p),!b.lineNumber&&wn(g)&&(b.lineNumber=g),b.columnNumber||(wn(h)?b.columnNumber=h:window.event&&wn(window.event.errorCharacter)&&(b.columnNumber=window.event.errorCharacter))},wn=function(c){return typeof c=="number"&&String.call(c)!=="NaN"},ku=function(c){c===void 0&&(c=window);var p={load:function(g){if(!(!g._config.autoDetectErrors||!g._config.enabledErrorTypes.unhandledRejections)){var h=function(b){var C=b.reason,N=!1;try{b.detail&&b.detail.reason&&(C=b.detail.reason,N=!0)}catch{}var R=g.Event.create(C,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledPromiseRejection"}},"unhandledrejection handler",1,g._logger);N&&_(R.errors[0].stacktrace,Eu(C)),g._notify(R,function(E){if(yt(E.originalError)&&!E.originalError.stack){var F;E.addMetadata("unhandledRejection handler",(F={},F[Object.prototype.toString.call(E.originalError)]={name:E.originalError.name,message:E.originalError.message,code:E.originalError.code},F))}})};"addEventListener"in c?c.addEventListener("unhandledrejection",h):c.onunhandledrejection=function(b,C){h({detail:{reason:b,promise:C}})}}}};return p},Eu=function(c){return function(p){p.file!==c.toString()&&p.method&&(p.method=p.method.replace(/^\s+/,""))}},dt={},Ru="Bugsnag JavaScript",Mu="7.25.0",Tu="https://github.com/bugsnag/bugsnag-js",Pu=w({},j.schema,L),Pe={_client:null,createClient:function(c){typeof c=="string"&&(c={apiKey:c}),c||(c={});var p=[su,fu(),au(),pu(),Cu,mu,gu,yn,Su(),ku(),ba(),bu(),_u(),ma,vu()],g=new hn(c,Pu,p,{name:Ru,version:Mu,url:Tu});return g._setDelivery(window.XDomainRequest?gn:ru),g._logger.debug("Loaded!"),g.leaveBreadcrumb("Bugsnag loaded",{},"state"),g._config.autoTrackSessions?g.startSession():g},start:function(c){return Pe._client?(Pe._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),Pe._client):(Pe._client=Pe.createClient(c),Pe._client)},isStarted:function(){return Pe._client!=null}};return _(["resetEventCount"].concat(f(hn.prototype)),function(c){/^_/.test(c)||(Pe[c]=function(){if(!Pe._client)return console.log("Bugsnag."+c+"() was called before Bugsnag.start()");Pe._client._depth+=1;var p=Pe._client[c].apply(Pe._client,arguments);return Pe._client._depth-=1,p})}),dt=Pe,dt.Client=hn,dt.Event=Ct,dt.Session=pn,dt.Breadcrumb=z,dt.default=Pe,dt})})(Pd);var mx=Pd.exports,hx=mx;const Et=kr(hx),gx=de.lazy(()=>Ro(()=>import("./index.Uyygx8b3.js"),__vite__mapDeps([0,1,2,3,4]))),xx=de.lazy(()=>Ro(()=>import("./InitTour.DaMiyxQJ.js"),__vite__mapDeps([5,1,2,3,4]))),vx=({popup:e,_showOptimizer:r=!1})=>{l.useState(null);const{showOptimizer:n,setShowOptimizer:s,mode:a,options:o}=he();l.useState(null);const[i,d]=l.useState(!1),u=ot(),{activeReport:f}=ce(v=>v.app),{isDark:m}=At(),x=window.rapidload_optimizer?Cp(window.rapidload_optimizer.test_mode):!1;return l.useEffect(()=>{r&&s(!0),document.body.classList.add("rl-page-optimizer-loaded"),document.body.classList.add("rpo-loaded"),e&&document.body.classList.add("rpo-loaded:with-popup"),setTimeout(()=>{d(!0)},50),Et.leaveBreadcrumb("Titan Loaded")},[]),l.useEffect(()=>{n?Et.leaveBreadcrumb("Titan Opened"):Et.leaveBreadcrumb("Titan Closed")},[n]),l.useEffect(()=>{u(pm(o,o.optimizer_url,!1)),u(hr(o,o.optimizer_url,!1)),u(ae("testModeStatus",x))},[u,f]),t.jsx(Ve,{children:i&&n&&t.jsxs(t.Fragment,{children:[t.jsx(l.Suspense,{children:t.jsx(gx,{isDark:m,children:t.jsx(xx,{mode:a})})}),t.jsx(px,{})]})})};var Ad,ro=Eo;Ad=ro.createRoot,ro.hydrateRoot;const no=({children:e,node:r,styles:n,disabled:s=!0})=>{const a=l.useRef(r),[o,i]=l.useState(null),{theme:d,setIsDark:u}=At(),f="rapidload-dark";if(xe(),l.useEffect(()=>{s&&i(document.body),o&&(d==="dark"?(o.classList.add(f),u(!0)):d==="light"?(o.classList.remove(f),u(!1)):d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?(o.classList.add(f),u(!0)):(o.classList.remove(f),u(!1))))},[d,o,r]),s)return t.jsx(t.Fragment,{children:e});l.useEffect(()=>{var x;if(a.current){const v=a.current.attachShadow({mode:"open"});if(n){const y=document.getElementById("rapidload_page_optimizer-css");let w=(x=window==null?void 0:window.rapidload_optimizer)==null?void 0:x.titan_stylesheet_url;w||(w=(y==null?void 0:y.href)||n);const _=document.createElement("link");_.setAttribute("rel","stylesheet"),_.setAttribute("href",w),v.appendChild(_)}const j=document.createElement("div");v.appendChild(j),i(j)}},[n]);let m=o?tf.createPortal(e,o):"";return t.jsxs(t.Fragment,{children:[m,!r&&t.jsx("div",{id:"rapidload-optimizer-shadow-dom",ref:a})]})},Tn=({title:e,success:r=!1,items:n=[]})=>{const[s,a]=l.useState(!1),o=({icon:i})=>i==="pass"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",children:t.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"green"})}):i==="average"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",children:t.jsx("rect",{width:"8",height:"8",fill:"orange"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",children:t.jsx("polygon",{points:"4,0 0,8 8,8",fill:"red"})});return t.jsxs(it,{className:"cursor-pointer dark:bg-brand-950 bg-white",children:[t.jsxs("div",{onClick:()=>{a(i=>!i)},className:"select-none flex justify-between w-full items-center py-2.5 px-4",children:[t.jsxs("div",{className:"flex gap-4 items-center pr-8 ",children:[t.jsx("div",{className:"text-sm",children:e}),r?t.jsxs("div",{className:"text-xs dark:text-brand-600 border border-green-500 bg-green-50 flex gap-1 items-center pr-2 pl-1 py-0.5 rounded-full",children:[t.jsx(Be,{className:"w-5 text-green-600"})," ",n.length," audits"]}):t.jsxs("div",{className:"text-xs dark:text-brand-600 border border-red-300 bg-red-100 flex gap-1 items-center pr-2 pl-1 py-0.5 rounded-full",children:[t.jsx(ht,{className:"w-5 text-red-500"})," ",n.length," audits"]})]}),n.length>0&&t.jsx(Ri,{className:"w-5"})]}),t.jsx(ln,{isOpen:s,children:t.jsx("div",{className:"w-full text-left flex flex-col divide-y",children:n.map(i=>t.jsxs("div",{className:"last:pb-3 flex text-sm items-center gap-2 py-2 px-4",children:[t.jsx("span",{children:t.jsx(o,{icon:i.icon})}),t.jsx("span",{className:"flex flex-col",children:t.jsx("span",{className:"text-xs",children:i.name})})]},i.id)).slice(0,3)})})]})};var Pn,Ws="HoverCard",[Od,Jx]=Ze(Ws,[Pt]),cn=Pt(),[bx,Zs]=Od(Ws),Ld=e=>{const{__scopeHoverCard:r,children:n,open:s,defaultOpen:a,onOpenChange:o,openDelay:i=700,closeDelay:d=300}=e,u=cn(r),f=l.useRef(0),m=l.useRef(0),x=l.useRef(!1),v=l.useRef(!1),[j=!1,y]=Xe({prop:s,defaultProp:a,onChange:o}),w=l.useCallback(()=>{clearTimeout(m.current),f.current=window.setTimeout(()=>y(!0),i)},[i,y]),_=l.useCallback(()=>{clearTimeout(f.current),!x.current&&!v.current&&(m.current=window.setTimeout(()=>y(!1),d))},[d,y]),M=l.useCallback(()=>y(!1),[y]);return l.useEffect(()=>()=>{clearTimeout(f.current),clearTimeout(m.current)},[]),t.jsx(bx,{scope:r,open:j,onOpenChange:y,onOpen:w,onClose:_,onDismiss:M,hasSelectionRef:x,isPointerDownOnContentRef:v,children:t.jsx(Jn,{...u,children:n})})};Ld.displayName=Ws;var Dd="HoverCardTrigger",Id=l.forwardRef((e,r)=>{const{__scopeHoverCard:n,...s}=e,a=Zs(Dd,n),o=cn(n);return t.jsx(Zn,{asChild:!0,...o,children:t.jsx(ue.a,{"data-state":a.open?"open":"closed",...s,ref:r,onPointerEnter:K(e.onPointerEnter,Nr(a.onOpen)),onPointerLeave:K(e.onPointerLeave,Nr(a.onClose)),onFocus:K(e.onFocus,a.onOpen),onBlur:K(e.onBlur,a.onClose),onTouchStart:K(e.onTouchStart,i=>i.preventDefault())})})});Id.displayName=Dd;var yx="HoverCardPortal",[Qx,wx]=Od(yx,{forceMount:void 0}),Cr="HoverCardContent",$d=l.forwardRef((e,r)=>{const n=wx(Cr,e.__scopeHoverCard),{forceMount:s=n.forceMount,...a}=e,o=Zs(Cr,e.__scopeHoverCard);return t.jsx(tt,{present:s||o.open,children:t.jsx(jx,{"data-state":o.open?"open":"closed",...a,onPointerEnter:K(e.onPointerEnter,Nr(o.onOpen)),onPointerLeave:K(e.onPointerLeave,Nr(o.onClose)),ref:r})})});$d.displayName=Cr;var jx=l.forwardRef((e,r)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,...d}=e,u=Zs(Cr,n),f=cn(n),m=l.useRef(null),x=Re(r,m),[v,j]=l.useState(!1);return l.useEffect(()=>{if(v){const y=document.body;return Pn=y.style.userSelect||y.style.webkitUserSelect,y.style.userSelect="none",y.style.webkitUserSelect="none",()=>{y.style.userSelect=Pn,y.style.webkitUserSelect=Pn}}},[v]),l.useEffect(()=>{if(m.current){const y=()=>{j(!1),u.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var _;((_=document.getSelection())==null?void 0:_.toString())!==""&&(u.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",y),()=>{document.removeEventListener("pointerup",y),u.hasSelectionRef.current=!1,u.isPointerDownOnContentRef.current=!1}}},[u.isPointerDownOnContentRef,u.hasSelectionRef]),l.useEffect(()=>{m.current&&Nx(m.current).forEach(w=>w.setAttribute("tabindex","-1"))}),t.jsx(Sr,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:K(o,y=>{y.preventDefault()}),onDismiss:u.onDismiss,children:t.jsx(Xn,{...f,...d,onPointerDown:K(d.onPointerDown,y=>{y.currentTarget.contains(y.target)&&j(!0),u.hasSelectionRef.current=!1,u.isPointerDownOnContentRef.current=!0}),ref:x,style:{...d.style,userSelect:v?"text":void 0,WebkitUserSelect:v?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),_x="HoverCardArrow",Cx=l.forwardRef((e,r)=>{const{__scopeHoverCard:n,...s}=e,a=cn(n);return t.jsx(Yn,{...a,...s,ref:r})});Cx.displayName=_x;function Nr(e){return r=>r.pointerType==="touch"?void 0:e()}function Nx(e){const r=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)r.push(n.currentNode);return r}var Sx=Ld,kx=Id,Fd=$d;const Ex=Sx,Rx=kx,Bd=l.forwardRef(({className:e,align:r="center",sideOffset:n=4,...s},a)=>t.jsx(Fd,{ref:a,align:r,sideOffset:n,className:S("z-50 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s}));Bd.displayName=Fd.displayName;const Mx=()=>{var M,T,L;const{setShowOptimizer:e,options:r,version:n}=he(),{data:s,error:a,loading:o,activeReport:i}=ce(ve),[d,u]=l.useState(0),{toast:f}=gt(),[m,x]=l.useState("#ECECED"),[v,j]=l.useState(!1),y=ot(),w=()=>{const $=(s==null?void 0:s.performance)??0;$<50?x("#FF3333"):$<90?x("#FFAA33"):$<101&&x("#09B42F")};l.useEffect(()=>{if(w(),!o&&s){let $=0;const X=setInterval(()=>{$+=1,$<=s.performance?u($):clearInterval(X)},10);return()=>clearInterval(X)}},[s,o]);const _=()=>{if(!r.actions)return t.jsx(t.Fragment,{});let[$,X]=l.useState(r.actions.map(D=>({...D,loading:!1}))),z={clear_cache:t.jsx(Si,{className:"w-4"}),clear_page_cache:t.jsx(Ai,{className:"w-4"}),clear_optimization:t.jsx(Pi,{className:"w-4"})};const A=async D=>{try{X(Q=>Q.map(Y=>Y.icon===D.icon?{...Y,loading:!0}:Y));let U=await fetch(D.href.replace(/&/g,"&"));f({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["Successfully completed ",t.jsx(Be,{className:"w-5 text-green-600"})," "]})})}catch(U){console.error(U)}X(U=>U.map(Q=>Q.icon===D.icon?{...Q,loading:!1}:Q))};return t.jsx(t.Fragment,{children:$.map(D=>t.jsx(me,{text:D.tooltip,children:t.jsxs(Le,{disabled:D.loading,onClick:U=>A(D),className:"rounded-[15px] dark:bg-brand-950/50 bg-brand-100/50",variant:"outline",children:[D.loading&&t.jsx("span",{children:t.jsx(Ge,{className:"motion-safe:animate-spin w-4"})}),z[D.icon]]})},D.icon))})};return t.jsx("div",{className:S("relative text-base text-brand-950 dark:text-brand-50 flex flex-col justify-center min-w-[565px] min-h-[295px] w-fit py-6 px-6 mx-16 my-2 ","backdrop-blur-md bg-brand-100/90 dark:bg-brand-900/95 shadow-xl rounded-[50px] border border-brand-500/20 "),children:t.jsxs("div",{className:"flex gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 px-4 items-center",children:[t.jsx("div",{className:"mt-2",children:o||v||a?t.jsx(Gt,{className:"w-44 h-44 rounded-full"}):t.jsx(Is,{className:"h-[176px]",performance:s==null?void 0:s.performance})}),t.jsx("div",{className:"text-xs w-full flex justify-center",children:t.jsx(me,{asChild:!0,text:"Switch Report",children:t.jsxs("button",{onClick:()=>y(Bn(i==="desktop"?"mobile":"desktop")),className:"backdrop-blur-md dark:bg-brand-950/10 bg-brand-50/50 capitalize inline-flex gap-2 justify-center items-center border rounded-full py-1 px-3",children:[i==="desktop"?t.jsx(Oi,{className:"w-4 h-5"}):t.jsx(Mo,{className:"h-5"}),t.jsx("span",{children:i})]})})}),t.jsxs("div",{className:"flex justify-around text-sm text-brand-700 dark:text-brand-300 gap-4 font-light w-full",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",children:t.jsx("polygon",{points:"5,0 0,10 10,10",fill:"red"})}),"0-49"]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",children:t.jsx("rect",{width:"10",height:"10",fill:"orange"})}),"50-89"]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",children:t.jsx("circle",{cx:"5",cy:"5",r:"5",fill:"green"})}),"89-100"]})]})]}),t.jsxs("div",{className:"flex flex-col flex-grow",children:[t.jsxs("div",{className:"flex gap-2 text-md justify-between items-center font-medium text-left mb-3 px-3",children:[t.jsxs("div",{className:"flex gap-2 items-center",children:["Speed insights ",t.jsxs("span",{className:"text-xxs leading-tight text-brand-400",children:["v",n]})]}),t.jsxs("div",{className:"flex gap-2 text-brand-600 dark:text-brand-400",children:[t.jsx(me,{text:"Go to Plugin Dashboard",children:t.jsx("a",{className:"flex hover:dark:text-brand-100 justify-center rounded-full w-7 h-7 p-0.5 text-xs items-center gap-2",href:r!=null&&r.dashboard_url?r==null?void 0:r.dashboard_url:"#",children:t.jsx(Rm,{className:"w-5"})})}),t.jsx(me,{text:"Switch theme",children:t.jsx("div",{className:"hover:dark:text-brand-100",children:t.jsx(Fc,{})})})]})]}),a?t.jsx("div",{className:"flex flex-col gap-2",children:t.jsx(Bc,{error:a})}):t.jsxs(t.Fragment,{children:[o||v?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Gt,{className:"w-full h-[48px] rounded-[18px]"}),t.jsx(Gt,{className:"w-full h-[48px] rounded-[18px]"}),t.jsx(Gt,{className:"w-full h-[48px] rounded-[18px]"})]}):t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Tn,{title:"Opportunities",items:(M=s==null?void 0:s.grouped)==null?void 0:M.opportunities}),t.jsx(Tn,{title:"Diagnostics",items:(T=s==null?void 0:s.grouped)==null?void 0:T.diagnostics}),t.jsx(Tn,{title:"Passed Audits",success:!0,items:(L=s==null?void 0:s.grouped)==null?void 0:L.passed_audits})]}),t.jsx("hr",{className:"my-3 mx-6"})]}),t.jsxs("div",{className:"flex gap-3 text-sm",children:[t.jsxs(Le,{onClick:$=>{e(!0)},children:[t.jsx(Nl,{className:"w-4 text-white dark:text-brand-900 rounded-[15px]"})," Titan Optimizer"]}),t.jsx(_,{})]})]})]})})},Tx=({children:e})=>{const{options:r}=he();l.useState(!1);const n=r==null?void 0:r.plugin_url;return t.jsxs(Ex,{openDelay:0,children:[t.jsx("a",{href:r!=null&&r.dashboard_url?r==null?void 0:r.dashboard_url:"#",children:t.jsx(Rx,{asChild:!0,children:t.jsx("div",{className:`${n?"flex gap-1 items-center cursor-pointer text-white":"bg-gray-900 dark:bg-brand-900 py-1 cursor-pointer"}`,children:e})})}),t.jsx(Bd,{id:"rpo-popup-content",className:"font-sans animate-rl-scale-in z-[99999]",sideOffset:5,children:t.jsx(Mx,{})})]})};function Px(){const{options:e}=he();return l.useEffect(()=>{Et.leaveBreadcrumb("Popup Loaded")},[]),t.jsxs("div",{id:"rl-react-popup-wrapper",translate:"no",className:`notranslate
- font-sans ${e?"":"flex flex-col justify-center text-center "}`,children:[t.jsxs(Tx,{children:[e&&e.plugin_url&&t.jsx("span",{className:"rl-icon",children:t.jsx("img",{src:(e==null?void 0:e.plugin_url)+"/assets/images/logo-icon-light.svg",alt:"RapidLoad logo"})}),t.jsx("span",{className:"rl-label",children:"RapidLoad"})]}),t.jsx(Kc,{})]})}const Ax=({children:e,mode:r,modeData:n,showOptimizer:s,global:a,popup:o})=>t.jsx(t.Fragment,{children:t.jsx(Qf,{store:ji,children:t.jsx(wp,{children:t.jsx(rp,{global:a,initShowOptimizerValue:s,mode:r,modeData:n,children:t.jsx(ls,{children:t.jsx(sf,{features:af,children:e})})})})})});var zd={exports:{}};(function(e,r){(function(n){e.exports=n()})(function(){var n={};function s(){return s=Object.assign?Object.assign.bind():function(f){for(var m=1;m1e6&&c._logger.warn("Event oversized ("+(C.length/1e6).toFixed(2)+" MB)"),h(M)},N.open("POST",y),setTimeout(function(){try{N.send(C)}catch(M){c._logger.error(M),h(M)}},0)},sendSession:function(g,h){h===void 0&&(h=function(){});var y=aa(c._config,"sessions","1",p),C=new p.XDomainRequest;C.onload=function(){h(null)},C.open("POST",y),setTimeout(function(){try{C.send(Nt.session(g,c._config.redactedKeys))}catch(N){c._logger.error(N),h(N)}},0)}}};var aa=function(c,p,g,h){var y=JSON.parse(JSON.stringify(new Date)),C=ru(c.endpoints[p],h.location.protocol);return C+"?apiKey="+encodeURIComponent(c.apiKey)+"&payloadVersion="+g+"&sentAt="+encodeURIComponent(y)},ru=gn._matchPageProtocol=function(c,p){return p==="http:"?c.replace(/^https:/,"http:"):c},nu=function(c,p){return p===void 0&&(p=window),{sendEvent:function(g,h){h===void 0&&(h=function(){});try{var y=c._config.endpoints.notify,C=new p.XMLHttpRequest,N=Nt.event(g,c._config.redactedKeys);C.onreadystatechange=function(){if(C.readyState===p.XMLHttpRequest.DONE){var M=C.status;if(M===0||M>=400){var E=new Error("Request failed with status "+M);c._logger.error("Event failed to send…",E),N.length>1e6&&c._logger.warn("Event oversized ("+(N.length/1e6).toFixed(2)+" MB)"),h(E)}else h(null)}},C.open("POST",y),C.setRequestHeader("Content-Type","application/json"),C.setRequestHeader("Bugsnag-Api-Key",g.apiKey||c._config.apiKey),C.setRequestHeader("Bugsnag-Payload-Version","4"),C.setRequestHeader("Bugsnag-Sent-At",new Date().toISOString()),C.send(N)}catch(M){c._logger.error(M)}},sendSession:function(g,h){h===void 0&&(h=function(){});try{var y=c._config.endpoints.sessions,C=new p.XMLHttpRequest;C.onreadystatechange=function(){if(C.readyState===p.XMLHttpRequest.DONE){var N=C.status;if(N===0||N>=400){var M=new Error("Request failed with status "+N);c._logger.error("Session failed to send…",M),h(M)}else h(null)}},C.open("POST",y),C.setRequestHeader("Content-Type","application/json"),C.setRequestHeader("Bugsnag-Api-Key",c._config.apiKey),C.setRequestHeader("Bugsnag-Payload-Version","1"),C.setRequestHeader("Bugsnag-Sent-At",new Date().toISOString()),C.send(Nt.session(g,c._config.redactedKeys))}catch(N){c._logger.error(N)}}}},oa=new Date,su=function(){oa=new Date},au={name:"appDuration",load:function(c){return c.addOnError(function(p){var g=new Date;p.app.duration=g-oa},!0),{reset:su}}},ou=function(c){return c===void 0&&(c=window),{load:function(p){p.addOnError(function(g){g.context===void 0&&(g.context=c.location.pathname)},!0)}}},xn=function(p,g){var h="000000000"+p;return h.substr(h.length-g)},ia=typeof window=="object"?window:self,la=0;for(var iu in ia)Object.hasOwnProperty.call(ia,iu)&&la++;var lu=navigator.mimeTypes?navigator.mimeTypes.length:0,cu=xn((lu+navigator.userAgent.length).toString(36)+la.toString(36),4),ca=function(){return cu},zt=0,vn=4,or=36,da=Math.pow(or,vn);function ua(){return xn((Math.random()*da<<0).toString(or),vn)}function du(){return zt=ztp.document.documentElement.clientHeight?"landscape":"portrait"),g._config.generateAnonymousId&&(h.id=fu(p)),g.addOnSession(function(y){y.device=w({},y.device,h),g._config.collectUserIp||ma(y)}),g.addOnError(function(y){y.device=w({},y.device,h,{time:new Date}),g._config.collectUserIp||ma(y)},!0)},configSchema:{generateAnonymousId:{validate:function(g){return g===!0||g===!1},defaultValue:function(){return!0},message:"should be true|false"}}}},ma=function(c){var p=c.getUser();(!p||!p.id)&&c.setUser(c.device.id)},mu=function(c){return c===void 0&&(c=window),{load:function(p){p.addOnError(function(g){g.request&&g.request.url||(g.request=w({},g.request,{url:c.location.href}))},!0)}}},hu={load:function(c){c._sessionDelegate=gu}},gu={startSession:function(c,p){var g=c;return g._session=p,g._pausedSession=null,g._config.enabledReleaseStages!==null&&!o(g._config.enabledReleaseStages,g._config.releaseStage)?(g._logger.warn("Session not sent due to releaseStage/enabledReleaseStages configuration"),g):(g._delivery.sendSession({notifier:g._notifier,device:p.device,app:p.app,sessions:[{id:p.id,startedAt:p.startedAt,user:p._user}]}),g)},resumeSession:function(c){return c._session?c:c._pausedSession?(c._session=c._pausedSession,c._pausedSession=null,c):c.startSession()},pauseSession:function(c){c._pausedSession=c._session,c._session=null}},xu={load:function(c){c._config.collectUserIp||c.addOnError(function(p){p._user&&typeof p._user.id>"u"&&delete p._user.id,p._user=w({id:"[REDACTED]"},p._user),p.request=w({clientIp:"[REDACTED]"},p.request)})},configSchema:{collectUserIp:{defaultValue:function(){return!0},message:"should be true|false",validate:function(c){return c===!0||c===!1}}}},ha={};ha.load=function(c){var p=/^(local-)?dev(elopment)?$/.test(c._config.releaseStage);p||!c._isBreadcrumbTypeEnabled("log")||_(vu,function(g){var h=console[g];console[g]=function(){for(var y=arguments.length,C=new Array(y),N=0;N"].concat(y.split(`
+`)),Ce=W-1,we=Math.max(Ce-3,0),Le=Math.min(Ce+3,ne.length);return s(ne.slice(we,Le),function(Ae,Vt,jn){return Ae[we+1+jn]=Vt.length<=ga?Vt:Vt.substr(0,ga),Ae},{})};g.addOnError(function(W){W.errors[0].stacktrace=a(W.errors[0].stacktrace,function(Ae){return!/__trace__$/.test(Ae.method)});var ne=W.errors[0].stacktrace[0],Ce=function(Ae){return Ae.replace(/#.*$/,"").replace(/\?.*$/,"")};if(!(ne&&ne.file&&Ce(ne.file)!==Ce(h))){var we=U();if(we){var Le=we.innerHTML;W.addMetadata("script","content",Le.length<=xa?Le:Le.substr(0,xa)),ne&&ne.lineNumber&&(ne.code=P(ne.lineNumber))}}},!0);var ee=_(["setTimeout","setInterval","setImmediate","requestAnimationFrame"],function(W){return bn(p,W,function(ne){return he(ne,function(Ce){return{get:function(){return Ce[0]},replace:function(we){Ce[0]=we}}})})}),se=ee[0];_(["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],function(W){!p[W]||!p[W].prototype||!Object.prototype.hasOwnProperty.call(p[W].prototype,"addEventListener")||(bn(p[W].prototype,"addEventListener",function(ne){return he(ne,va)}),bn(p[W].prototype,"removeEventListener",function(ne){return he(ne,va,!0)}))});function he(W,ne,Ce){return Ce===void 0&&(Ce=!1),function(){var we=[].slice.call(arguments);try{var Le=ne(we),Ae=Le.get();if(Ce&&W.apply(this,we),typeof Ae!="function")return W.apply(this,we);if(Ae.__trace__)Le.replace(Ae.__trace__);else{var Vt=U();Ae.__trace__=function(){I(Vt),se(function(){I(null)},0);var Ou=Ae.apply(this,arguments);return I(null),Ou},Ae.__trace__.__trace__=Ae.__trace__,Le.replace(Ae.__trace__)}}catch{}if(W.apply)return W.apply(this,we);switch(we.length){case 1:return W(we[0]);case 2:return W(we[0],we[1]);default:return W()}}}},configSchema:{trackInlineScripts:{validate:function(g){return g===!0||g===!1},defaultValue:function(){return!0},message:"should be true|false"}}}};function bn(c,p,g){var h=c[p];if(!h)return h;var y=g(h);return c[p]=y,h}function va(c){var p=!!c[1]&&typeof c[1].handleEvent=="function";return{get:function(){return p?c[1].handleEvent:c[1]},replace:function(g){p?c[1].handleEvent=g:c[1]=g}}}var yu=function(c){return c===void 0&&(c=window),{load:function(p){"addEventListener"in c&&p._isBreadcrumbTypeEnabled("user")&&c.addEventListener("click",function(g){var h,y;try{h=ju(g.target),y=ba(g.target,c)}catch{h="[hidden]",y="[hidden]",p._logger.error("Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z")}p.leaveBreadcrumb("UI click",{targetText:h,targetSelector:y},"user")},!0)}}},wu=/^\s*([^\s][\s\S]{0,139}[^\s])?\s*/;function ju(c){var p=c.textContent||c.innerText||"";return!p&&(c.type==="submit"||c.type==="button")&&(p=c.value),p=p.replace(wu,"$1"),p.length>140?p.slice(0,135)+"(...)":p}function ba(c,p){var g=[c.tagName];if(c.id&&g.push("#"+c.id),c.className&&c.className.length&&g.push("."+c.className.split(" ").join(".")),!p.document.querySelectorAll||!Array.prototype.indexOf)return g.join("");try{if(p.document.querySelectorAll(g.join("")).length===1)return g.join("")}catch{return g.join("")}if(c.parentNode.childNodes.length>1){var h=Array.prototype.indexOf.call(c.parentNode.childNodes,c)+1;g.push(":nth-child("+h+")")}return p.document.querySelectorAll(g.join("")).length===1?g.join(""):c.parentNode?ba(c.parentNode,p)+" > "+g.join(""):g.join("")}var ya={};ya=function(c){c===void 0&&(c=window);var p={load:function(g){if("addEventListener"in c&&g._isBreadcrumbTypeEnabled("navigation")){var h=function(y){return function(){return g.leaveBreadcrumb(y,{},"navigation")}};c.addEventListener("pagehide",h("Page hidden"),!0),c.addEventListener("pageshow",h("Page shown"),!0),c.addEventListener("load",h("Page loaded"),!0),c.document.addEventListener("DOMContentLoaded",h("DOMContentLoaded"),!0),c.addEventListener("load",function(){return c.addEventListener("popstate",h("Navigated back"),!0)}),c.addEventListener("hashchange",function(y){var C=y.oldURL?{from:ir(y.oldURL,c),to:ir(y.newURL,c),state:ja(c)}:{to:ir(c.location.href,c)};g.leaveBreadcrumb("Hash changed",C,"navigation")},!0),c.history.replaceState&&wa(g,c.history,"replaceState",c),c.history.pushState&&wa(g,c.history,"pushState",c)}}};return p};var ir=function(c,p){var g=p.document.createElement("A");return g.href=c,""+g.pathname+g.search+g.hash},_u=function(c,p,g,h){var y=ir(c.location.href,c);return{title:g,state:p,prevState:ja(c),to:h||y,from:y}},wa=function(c,p,g,h){var y=p[g];p[g]=function(C,N,M){c.leaveBreadcrumb("History "+g,_u(h,C,N,M),"navigation"),typeof c.resetEventCount=="function"&&c.resetEventCount(),c._config.autoTrackSessions&&c.startSession(),y.apply(p,[C,N].concat(M!==void 0?M:[]))}},ja=function(c){try{return c.history.state}catch{}},St="request",Cu=function(c,p){c===void 0&&(c=[]),p===void 0&&(p=window);var g={load:function(h){if(!h._isBreadcrumbTypeEnabled("request"))return;var y=[h._config.endpoints.notify,h._config.endpoints.sessions].concat(c);C(),E();function C(){if("addEventListener"in p.XMLHttpRequest.prototype){var U=p.XMLHttpRequest.prototype.open;p.XMLHttpRequest.prototype.open=function(ee,se){var he=this,W=!1,ne=function(){return M(ee,se)},Ce=function(){return N(ee,se,he.status)};W&&(this.removeEventListener("load",Ce),this.removeEventListener("error",ne)),this.addEventListener("load",Ce),this.addEventListener("error",ne),W=!0,U.apply(this,arguments)}}}function N(U,P,ee){if(P===void 0){h._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.");return}if(!(typeof P=="string"&&o(y,P.replace(/\?.*$/,"")))){var se={status:ee,request:U+" "+P};ee>=400?h.leaveBreadcrumb("XMLHttpRequest failed",se,St):h.leaveBreadcrumb("XMLHttpRequest succeeded",se,St)}}function M(U,P){if(P===void 0){h._logger.warn("The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.");return}typeof P=="string"&&o(y,P.replace(/\?.*$/,""))||h.leaveBreadcrumb("XMLHttpRequest error",{request:U+" "+P},St)}function E(){if(!(!("fetch"in p)||p.fetch.polyfill)){var U=p.fetch;p.fetch=function(){var ee=arguments,se=arguments[0],he=arguments[1],W,ne=null;return se&&typeof se=="object"?(ne=se.url,he&&"method"in he?W=he.method:se&&"method"in se&&(W=se.method)):(ne=se,he&&"method"in he&&(W=he.method)),W===void 0&&(W="GET"),new Promise(function(Ce,we){U.apply(void 0,ee).then(function(Le){F(Le,W,ne),Ce(Le)}).catch(function(Le){I(W,ne),we(Le)})})}}}var F=function(U,P,ee){var se={status:U.status,request:P+" "+ee};U.status>=400?h.leaveBreadcrumb("fetch() failed",se,St):h.leaveBreadcrumb("fetch() succeeded",se,St)},I=function(U,P){h.leaveBreadcrumb("fetch() error",{request:U+" "+P},St)}}};return g},Nu={load:function(c){var p=0;c.addOnError(function(g){if(p>=c._config.maxEvents)return c._logger.warn("Cancelling event send due to maxEvents per session limit of "+c._config.maxEvents+" being reached"),!1;p++}),c.resetEventCount=function(){p=0}},configSchema:{maxEvents:{defaultValue:function(){return 10},message:"should be a positive integer ≤100",validate:function(c){return m(1,100)(c)}}}},yn={};yn={load:function(c){c.addOnError(function(p){var g=s(p.errors,function(h,y){return h.concat(y.stacktrace)},[]);_(g,function(h){h.file=Su(h.file)})})}};var Su=yn._strip=function(c){return typeof c=="string"?c.replace(/\?.*$/,"").replace(/#.*$/,""):c},ku=function(c,p){return c===void 0&&(c=window),p===void 0&&(p="window onerror"),{load:function(g){if(!g._config.autoDetectErrors||!g._config.enabledErrorTypes.unhandledExceptions)return;function h(C,N,M,E,F){if(M===0&&/Script error\.?/.test(C))g._logger.warn("Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z");else{var I={severity:"error",unhandled:!0,severityReason:{type:"unhandledException"}},U;if(F)U=g.Event.create(F,!0,I,p,1),_a(U.errors[0].stacktrace,N,M,E);else if(typeof C=="object"&&C!==null&&(!N||typeof N!="string")&&!M&&!E&&!F){var P=C.type?"Event: "+C.type:"Error",ee=C.message||C.detail||"";U=g.Event.create({name:P,message:ee},!0,I,p,1),U.originalError=C,U.addMetadata(p,{event:C,extraParameters:N})}else U=g.Event.create(C,!0,I,p,1),_a(U.errors[0].stacktrace,N,M,E);g._notify(U)}typeof y=="function"&&y.apply(this,arguments)}var y=c.onerror;c.onerror=h}}},_a=function(c,p,g,h){c[0]||c.push({});var y=c[0];!y.file&&typeof p=="string"&&(y.file=p),!y.lineNumber&&wn(g)&&(y.lineNumber=g),y.columnNumber||(wn(h)?y.columnNumber=h:window.event&&wn(window.event.errorCharacter)&&(y.columnNumber=window.event.errorCharacter))},wn=function(c){return typeof c=="number"&&String.call(c)!=="NaN"},Eu=function(c){c===void 0&&(c=window);var p={load:function(g){if(!(!g._config.autoDetectErrors||!g._config.enabledErrorTypes.unhandledRejections)){var h=function(y){var C=y.reason,N=!1;try{y.detail&&y.detail.reason&&(C=y.detail.reason,N=!0)}catch{}var M=g.Event.create(C,!1,{severity:"error",unhandled:!0,severityReason:{type:"unhandledPromiseRejection"}},"unhandledrejection handler",1,g._logger);N&&_(M.errors[0].stacktrace,Ru(C)),g._notify(M,function(E){if(yt(E.originalError)&&!E.originalError.stack){var F;E.addMetadata("unhandledRejection handler",(F={},F[Object.prototype.toString.call(E.originalError)]={name:E.originalError.name,message:E.originalError.message,code:E.originalError.code},F))}})};"addEventListener"in c?c.addEventListener("unhandledrejection",h):c.onunhandledrejection=function(y,C){h({detail:{reason:y,promise:C}})}}}};return p},Ru=function(c){return function(p){p.file!==c.toString()&&p.method&&(p.method=p.method.replace(/^\s+/,""))}},dt={},Mu="Bugsnag JavaScript",Tu="7.25.0",Pu="https://github.com/bugsnag/bugsnag-js",Au=w({},j.schema,L),Pe={_client:null,createClient:function(c){typeof c=="string"&&(c={apiKey:c}),c||(c={});var p=[au,pu(),ou(),mu(),Nu,hu,xu,yn,ku(),Eu(),ya(),yu(),Cu(),ha,bu()],g=new hn(c,Au,p,{name:Mu,version:Tu,url:Pu});return g._setDelivery(window.XDomainRequest?gn:nu),g._logger.debug("Loaded!"),g.leaveBreadcrumb("Bugsnag loaded",{},"state"),g._config.autoTrackSessions?g.startSession():g},start:function(c){return Pe._client?(Pe._client._logger.warn("Bugsnag.start() was called more than once. Ignoring."),Pe._client):(Pe._client=Pe.createClient(c),Pe._client)},isStarted:function(){return Pe._client!=null}};return _(["resetEventCount"].concat(f(hn.prototype)),function(c){/^_/.test(c)||(Pe[c]=function(){if(!Pe._client)return console.log("Bugsnag."+c+"() was called before Bugsnag.start()");Pe._client._depth+=1;var p=Pe._client[c].apply(Pe._client,arguments);return Pe._client._depth-=1,p})}),dt=Pe,dt.Client=hn,dt.Event=Ct,dt.Session=pn,dt.Breadcrumb=V,dt.default=Pe,dt})})(Ad);var mx=Ad.exports,hx=mx;const Et=kr(hx),gx=de.lazy(()=>Mo(()=>import("./index.j2mLwiGu.js"),__vite__mapDeps([0,1,2,3,4]))),xx=de.lazy(()=>Mo(()=>import("./InitTour.B1DnpL1R.js"),__vite__mapDeps([5,1,2,3,4]))),vx=({popup:e,_showOptimizer:r=!1})=>{l.useState(null);const{showOptimizer:n,setShowOptimizer:s,mode:a,options:o}=ve();l.useState(null);const[i,d]=l.useState(!1),u=ot(),{activeReport:f}=ce(v=>v.app),{isDark:m}=At(),x=window.rapidload_optimizer?Np(window.rapidload_optimizer.test_mode):!1;return l.useEffect(()=>{r&&s(!0),document.body.classList.add("rl-page-optimizer-loaded"),document.body.classList.add("rpo-loaded"),e&&document.body.classList.add("rpo-loaded:with-popup"),setTimeout(()=>{d(!0)},50),Et.leaveBreadcrumb("Titan Loaded")},[]),l.useEffect(()=>{n?Et.leaveBreadcrumb("Titan Opened"):Et.leaveBreadcrumb("Titan Closed")},[n]),l.useEffect(()=>{u(Ci(o,o.optimizer_url,!1)),u(Wt(o,o.optimizer_url,!1)),u(ae("testModeStatus",x))},[u,f]),t.jsx(Ve,{children:i&&n&&t.jsxs(t.Fragment,{children:[t.jsx(l.Suspense,{children:t.jsx(gx,{isDark:m,children:t.jsx(xx,{mode:a})})}),t.jsx(px,{})]})})};var Od,no=Ro;Od=no.createRoot,no.hydrateRoot;const so=({children:e,node:r,styles:n,disabled:s=!0})=>{const a=l.useRef(r),[o,i]=l.useState(null),{theme:d,setIsDark:u}=At(),f="rapidload-dark";if(ge(),l.useEffect(()=>{s&&i(document.body),o&&(d==="dark"?(o.classList.add(f),u(!0)):d==="light"?(o.classList.remove(f),u(!1)):d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?(o.classList.add(f),u(!0)):(o.classList.remove(f),u(!1))))},[d,o,r]),s)return t.jsx(t.Fragment,{children:e});l.useEffect(()=>{var x;if(a.current){const v=a.current.attachShadow({mode:"open"});if(n){const b=document.getElementById("rapidload_page_optimizer-css");let w=(x=window==null?void 0:window.rapidload_optimizer)==null?void 0:x.titan_stylesheet_url;w||(w=(b==null?void 0:b.href)||n);const _=document.createElement("link");_.setAttribute("rel","stylesheet"),_.setAttribute("href",w),v.appendChild(_)}const j=document.createElement("div");v.appendChild(j),i(j)}},[n]);let m=o?rf.createPortal(e,o):"";return t.jsxs(t.Fragment,{children:[m,!r&&t.jsx("div",{id:"rapidload-optimizer-shadow-dom",ref:a})]})},Tn=({title:e,success:r=!1,items:n=[]})=>{const[s,a]=l.useState(!1),o=({icon:i})=>i==="pass"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",children:t.jsx("circle",{cx:"4",cy:"4",r:"4",fill:"green"})}):i==="average"?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",children:t.jsx("rect",{width:"8",height:"8",fill:"orange"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",children:t.jsx("polygon",{points:"4,0 0,8 8,8",fill:"red"})});return t.jsxs(it,{className:"cursor-pointer dark:bg-brand-950 bg-white",children:[t.jsxs("div",{onClick:()=>{a(i=>!i)},className:"select-none flex justify-between w-full items-center py-2.5 px-4",children:[t.jsxs("div",{className:"flex gap-4 items-center pr-8 ",children:[t.jsx("div",{className:"text-sm",children:e}),r?t.jsxs("div",{className:"text-xs dark:text-brand-600 border border-green-500 bg-green-50 flex gap-1 items-center pr-2 pl-1 py-0.5 rounded-full",children:[t.jsx(Be,{className:"w-5 text-green-600"})," ",n.length," audits"]}):t.jsxs("div",{className:"text-xs dark:text-brand-600 border border-red-300 bg-red-100 flex gap-1 items-center pr-2 pl-1 py-0.5 rounded-full",children:[t.jsx(ht,{className:"w-5 text-red-500"})," ",n.length," audits"]})]}),n.length>0&&t.jsx(Ti,{className:"w-5"})]}),t.jsx(ln,{isOpen:s,children:t.jsx("div",{className:"w-full text-left flex flex-col divide-y",children:n.map(i=>t.jsxs("div",{className:"last:pb-3 flex text-sm items-center gap-2 py-2 px-4",children:[t.jsx("span",{children:t.jsx(o,{icon:i.icon})}),t.jsx("span",{className:"flex flex-col",children:t.jsx("span",{className:"text-xs",children:i.name})})]},i.id)).slice(0,3)})})]})};var Pn,Zs="HoverCard",[Ld,Jx]=Ze(Zs,[Pt]),cn=Pt(),[bx,Xs]=Ld(Zs),Dd=e=>{const{__scopeHoverCard:r,children:n,open:s,defaultOpen:a,onOpenChange:o,openDelay:i=700,closeDelay:d=300}=e,u=cn(r),f=l.useRef(0),m=l.useRef(0),x=l.useRef(!1),v=l.useRef(!1),[j=!1,b]=Xe({prop:s,defaultProp:a,onChange:o}),w=l.useCallback(()=>{clearTimeout(m.current),f.current=window.setTimeout(()=>b(!0),i)},[i,b]),_=l.useCallback(()=>{clearTimeout(f.current),!x.current&&!v.current&&(m.current=window.setTimeout(()=>b(!1),d))},[d,b]),R=l.useCallback(()=>b(!1),[b]);return l.useEffect(()=>()=>{clearTimeout(f.current),clearTimeout(m.current)},[]),t.jsx(bx,{scope:r,open:j,onOpenChange:b,onOpen:w,onClose:_,onDismiss:R,hasSelectionRef:x,isPointerDownOnContentRef:v,children:t.jsx(Qn,{...u,children:n})})};Dd.displayName=Zs;var Id="HoverCardTrigger",$d=l.forwardRef((e,r)=>{const{__scopeHoverCard:n,...s}=e,a=Xs(Id,n),o=cn(n);return t.jsx(Xn,{asChild:!0,...o,children:t.jsx(fe.a,{"data-state":a.open?"open":"closed",...s,ref:r,onPointerEnter:K(e.onPointerEnter,Nr(a.onOpen)),onPointerLeave:K(e.onPointerLeave,Nr(a.onClose)),onFocus:K(e.onFocus,a.onOpen),onBlur:K(e.onBlur,a.onClose),onTouchStart:K(e.onTouchStart,i=>i.preventDefault())})})});$d.displayName=Id;var yx="HoverCardPortal",[Qx,wx]=Ld(yx,{forceMount:void 0}),Cr="HoverCardContent",Fd=l.forwardRef((e,r)=>{const n=wx(Cr,e.__scopeHoverCard),{forceMount:s=n.forceMount,...a}=e,o=Xs(Cr,e.__scopeHoverCard);return t.jsx(tt,{present:s||o.open,children:t.jsx(jx,{"data-state":o.open?"open":"closed",...a,onPointerEnter:K(e.onPointerEnter,Nr(o.onOpen)),onPointerLeave:K(e.onPointerLeave,Nr(o.onClose)),ref:r})})});Fd.displayName=Cr;var jx=l.forwardRef((e,r)=>{const{__scopeHoverCard:n,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,...d}=e,u=Xs(Cr,n),f=cn(n),m=l.useRef(null),x=Re(r,m),[v,j]=l.useState(!1);return l.useEffect(()=>{if(v){const b=document.body;return Pn=b.style.userSelect||b.style.webkitUserSelect,b.style.userSelect="none",b.style.webkitUserSelect="none",()=>{b.style.userSelect=Pn,b.style.webkitUserSelect=Pn}}},[v]),l.useEffect(()=>{if(m.current){const b=()=>{j(!1),u.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var _;((_=document.getSelection())==null?void 0:_.toString())!==""&&(u.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",b),()=>{document.removeEventListener("pointerup",b),u.hasSelectionRef.current=!1,u.isPointerDownOnContentRef.current=!1}}},[u.isPointerDownOnContentRef,u.hasSelectionRef]),l.useEffect(()=>{m.current&&Nx(m.current).forEach(w=>w.setAttribute("tabindex","-1"))}),t.jsx(Sr,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:K(o,b=>{b.preventDefault()}),onDismiss:u.onDismiss,children:t.jsx(Yn,{...f,...d,onPointerDown:K(d.onPointerDown,b=>{b.currentTarget.contains(b.target)&&j(!0),u.hasSelectionRef.current=!1,u.isPointerDownOnContentRef.current=!0}),ref:x,style:{...d.style,userSelect:v?"text":void 0,WebkitUserSelect:v?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),_x="HoverCardArrow",Cx=l.forwardRef((e,r)=>{const{__scopeHoverCard:n,...s}=e,a=cn(n);return t.jsx(Jn,{...a,...s,ref:r})});Cx.displayName=_x;function Nr(e){return r=>r.pointerType==="touch"?void 0:e()}function Nx(e){const r=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)r.push(n.currentNode);return r}var Sx=Dd,kx=$d,Bd=Fd;const Ex=Sx,Rx=kx,zd=l.forwardRef(({className:e,align:r="center",sideOffset:n=4,...s},a)=>t.jsx(Bd,{ref:a,align:r,sideOffset:n,className:S("z-50 outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s}));zd.displayName=Bd.displayName;const Mx=()=>{var R,T,L;const{setShowOptimizer:e,options:r,version:n}=ve(),{data:s,error:a,loading:o,activeReport:i}=ce(xe),[d,u]=l.useState(0),{toast:f}=gt(),[m,x]=l.useState("#ECECED"),[v,j]=l.useState(!1),b=ot(),w=()=>{const $=(s==null?void 0:s.performance)??0;$<50?x("#FF3333"):$<90?x("#FFAA33"):$<101&&x("#09B42F")};l.useEffect(()=>{if(w(),!o&&s){let $=0;const X=setInterval(()=>{$+=1,$<=s.performance?u($):clearInterval(X)},10);return()=>clearInterval(X)}},[s,o]);const _=()=>{if(!r.actions)return t.jsx(t.Fragment,{});let[$,X]=l.useState(r.actions.map(D=>({...D,loading:!1}))),V={clear_cache:t.jsx(Ei,{className:"w-4"}),clear_page_cache:t.jsx(Li,{className:"w-4"}),clear_optimization:t.jsx(Oi,{className:"w-4"})};const A=async D=>{try{X(Q=>Q.map(Y=>Y.icon===D.icon?{...Y,loading:!0}:Y));let z=await fetch(D.href.replace(/&/g,"&"));f({description:t.jsxs("div",{className:"flex w-full gap-2 text-center",children:["Successfully completed ",t.jsx(Be,{className:"w-5 text-green-600"})," "]})})}catch(z){console.error(z)}X(z=>z.map(Q=>Q.icon===D.icon?{...Q,loading:!1}:Q))};return t.jsx(t.Fragment,{children:$.map(D=>t.jsx(ue,{text:D.tooltip,children:t.jsxs(Oe,{disabled:D.loading,onClick:z=>A(D),className:"rounded-[15px] dark:bg-brand-950/50 bg-brand-100/50",variant:"outline",children:[D.loading&&t.jsx("span",{children:t.jsx(Ge,{className:"motion-safe:animate-spin w-4"})}),V[D.icon]]})},D.icon))})};return t.jsx("div",{className:S("relative text-base text-brand-950 dark:text-brand-50 flex flex-col justify-center min-w-[565px] min-h-[295px] w-fit py-6 px-6 mx-16 my-2 ","backdrop-blur-md bg-brand-100/90 dark:bg-brand-900/95 shadow-xl rounded-[50px] border border-brand-500/20 "),children:t.jsxs("div",{className:"flex gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 px-4 items-center",children:[t.jsx("div",{className:"mt-2",children:o||v||a?t.jsx(Gt,{className:"w-44 h-44 rounded-full"}):t.jsx($s,{className:"h-[176px]",performance:s==null?void 0:s.performance})}),t.jsx("div",{className:"text-xs w-full flex justify-center",children:t.jsx(ue,{asChild:!0,text:"Switch Report",children:t.jsxs("button",{onClick:()=>b(Bn(i==="desktop"?"mobile":"desktop")),className:"backdrop-blur-md dark:bg-brand-950/10 bg-brand-50/50 capitalize inline-flex gap-2 justify-center items-center border rounded-full py-1 px-3",children:[i==="desktop"?t.jsx(Di,{className:"w-4 h-5"}):t.jsx(To,{className:"h-5"}),t.jsx("span",{children:i})]})})}),t.jsxs("div",{className:"flex justify-around text-sm text-brand-700 dark:text-brand-300 gap-4 font-light w-full",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",children:t.jsx("polygon",{points:"5,0 0,10 10,10",fill:"red"})}),"0-49"]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",children:t.jsx("rect",{width:"10",height:"10",fill:"orange"})}),"50-89"]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",children:t.jsx("circle",{cx:"5",cy:"5",r:"5",fill:"green"})}),"89-100"]})]})]}),t.jsxs("div",{className:"flex flex-col flex-grow",children:[t.jsxs("div",{className:"flex gap-2 text-md justify-between items-center font-medium text-left mb-3 px-3",children:[t.jsxs("div",{className:"flex gap-2 items-center",children:["Speed insights ",t.jsxs("span",{className:"text-xxs leading-tight text-brand-400",children:["v",n]})]}),t.jsxs("div",{className:"flex gap-2 text-brand-600 dark:text-brand-400",children:[t.jsx(ue,{text:"Go to Plugin Dashboard",children:t.jsx("a",{className:"flex hover:dark:text-brand-100 justify-center rounded-full w-7 h-7 p-0.5 text-xs items-center gap-2",href:r!=null&&r.dashboard_url?r==null?void 0:r.dashboard_url:"#",children:t.jsx(Rm,{className:"w-5"})})}),t.jsx(ue,{text:"Switch theme",children:t.jsx("div",{className:"hover:dark:text-brand-100",children:t.jsx(Bc,{})})})]})]}),a?t.jsx("div",{className:"flex flex-col gap-2",children:t.jsx(zc,{error:a})}):t.jsxs(t.Fragment,{children:[o||v?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Gt,{className:"w-full h-[48px] rounded-[18px]"}),t.jsx(Gt,{className:"w-full h-[48px] rounded-[18px]"}),t.jsx(Gt,{className:"w-full h-[48px] rounded-[18px]"})]}):t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Tn,{title:"Opportunities",items:(R=s==null?void 0:s.grouped)==null?void 0:R.opportunities}),t.jsx(Tn,{title:"Diagnostics",items:(T=s==null?void 0:s.grouped)==null?void 0:T.diagnostics}),t.jsx(Tn,{title:"Passed Audits",success:!0,items:(L=s==null?void 0:s.grouped)==null?void 0:L.passed_audits})]}),t.jsx("hr",{className:"my-3 mx-6"})]}),t.jsxs("div",{className:"flex gap-3 text-sm",children:[t.jsxs(Oe,{onClick:$=>{e(!0)},children:[t.jsx(Sl,{className:"w-4 text-white dark:text-brand-900 rounded-[15px]"})," Titan Optimizer"]}),t.jsx(_,{})]})]})]})})},Tx=({children:e})=>{const{options:r}=ve();l.useState(!1);const n=r==null?void 0:r.plugin_url;return t.jsxs(Ex,{openDelay:0,children:[t.jsx("a",{href:r!=null&&r.dashboard_url?r==null?void 0:r.dashboard_url:"#",children:t.jsx(Rx,{asChild:!0,children:t.jsx("div",{className:`${n?"flex gap-1 items-center cursor-pointer text-white":"bg-gray-900 dark:bg-brand-900 py-1 cursor-pointer"}`,children:e})})}),t.jsx(zd,{id:"rpo-popup-content",className:"font-sans animate-rl-scale-in z-[99999]",sideOffset:5,children:t.jsx(Mx,{})})]})};function Px(){const{options:e}=ve();return l.useEffect(()=>{Et.leaveBreadcrumb("Popup Loaded")},[]),t.jsxs("div",{id:"rl-react-popup-wrapper",translate:"no",className:`notranslate
+ font-sans ${e?"":"flex flex-col justify-center text-center "}`,children:[t.jsxs(Tx,{children:[e&&e.plugin_url&&t.jsx("span",{className:"rl-icon",children:t.jsx("img",{src:(e==null?void 0:e.plugin_url)+"/assets/images/logo-icon-light.svg",alt:"RapidLoad logo"})}),t.jsx("span",{className:"rl-label",children:"RapidLoad"})]}),t.jsx(qc,{})]})}const Ax=({children:e,mode:r,modeData:n,showOptimizer:s,global:a,popup:o})=>t.jsx(t.Fragment,{children:t.jsx(ep,{store:_i,children:t.jsx(jp,{children:t.jsx(np,{global:a,initShowOptimizerValue:s,mode:r,modeData:n,children:t.jsx(cs,{children:t.jsx(af,{features:of,children:e})})})})})});var Vd={exports:{}};(function(e,r){(function(n){e.exports=n()})(function(){var n={};function s(){return s=Object.assign?Object.assign.bind():function(f){for(var m=1;m{console.error(e,r)},Vd=()=>{const e={background:"white",bottom:0,position:"absolute",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"10px",marginBottom:"20px",border:"1px solid #F44336",boxShadow:"0 10px 15px -3px #F44336, 0 4px 6px -4px rgb(0 0 0 / 0.1)",fontSize:"14px"},r={background:"red",padding:"5px 15px",fontSize:"12px",borderRadius:"5px",color:"white",marginLeft:"10px"};return t.jsx("div",{className:"rpo-app-crashed",style:e,children:t.jsxs("div",{className:"rpo-error",children:["RapidLoad Titan Optimizer crashed :( ",t.jsx("button",{style:r,onClick:n=>window.location.reload(),children:"Reload"})]})})},Ix=({fallback:e,onError:r,children:n})=>ao?t.jsx(ao,{FallbackComponent:Vd,children:n}):n;class Hd{constructor({mode:r="normal",container:n,showOptimizer:s=!1,popup:a=null,modeData:o,global:i=!1,shadowRoot:d=!0}){Ad(n).render(t.jsx(Ix,{fallback:t.jsx(Vd,{}),onError:Dx,children:t.jsxs(Ax,{mode:r,modeData:o,popup:a,global:i,showOptimizer:s,children:[a&&t.jsx(no,{disabled:!d,node:a,styles:Na,children:t.jsx(Px,{})}),t.jsx(no,{disabled:!d,styles:Na,children:t.jsx(vx,{_showOptimizer:s,popup:a})})]})}))}static showOptimizer(r){const n=new CustomEvent("rapidLoad:set-optimizer",{detail:{status:r}});window.dispatchEvent(n)}}window.RapidLoadOptimizer=Hd;document.addEventListener("DOMContentLoaded",()=>{var e;if((e=window==null?void 0:window.rapidload_optimizer)!=null&&e.load_optimizer){const r=document.getElementById("rapidload-page-optimizer");let n=$x(document.getElementById("rl-node-wrapper"));new Hd({container:r,popup:n,mode:"normal"})}});function $x(e){var s;if(!e)return;const r=e.parentNode,n=document.createElement("div");n.innerHTML=r==null?void 0:r.innerHTML;for(let a=0;a{console.error(e,r)},Hd=()=>{const e={background:"white",bottom:0,position:"absolute",left:"50%",transform:"translateX(-50%)",padding:"10px 20px",borderRadius:"10px",marginBottom:"20px",border:"1px solid #F44336",boxShadow:"0 10px 15px -3px #F44336, 0 4px 6px -4px rgb(0 0 0 / 0.1)",fontSize:"14px"},r={background:"red",padding:"5px 15px",fontSize:"12px",borderRadius:"5px",color:"white",marginLeft:"10px"};return t.jsx("div",{className:"rpo-app-crashed",style:e,children:t.jsxs("div",{className:"rpo-error",children:["RapidLoad Titan Optimizer crashed :( ",t.jsx("button",{style:r,onClick:n=>window.location.reload(),children:"Reload"})]})})},Ix=({fallback:e,onError:r,children:n})=>oo?t.jsx(oo,{FallbackComponent:Hd,children:n}):n;class Ud{constructor({mode:r="normal",container:n,showOptimizer:s=!1,popup:a=null,modeData:o,global:i=!1,shadowRoot:d=!0}){Od(n).render(t.jsx(Ix,{fallback:t.jsx(Hd,{}),onError:Dx,children:t.jsxs(Ax,{mode:r,modeData:o,popup:a,global:i,showOptimizer:s,children:[a&&t.jsx(so,{disabled:!d,node:a,styles:Sa,children:t.jsx(Px,{})}),t.jsx(so,{disabled:!d,styles:Sa,children:t.jsx(vx,{_showOptimizer:s,popup:a})})]})}))}static showOptimizer(r){const n=new CustomEvent("rapidLoad:set-optimizer",{detail:{status:r}});window.dispatchEvent(n)}}window.RapidLoadOptimizer=Ud;document.addEventListener("DOMContentLoaded",()=>{var e;if((e=window==null?void 0:window.rapidload_optimizer)!=null&&e.load_optimizer){const r=document.getElementById("rapidload-page-optimizer");let n=$x(document.getElementById("rl-node-wrapper"));new Ud({container:r,popup:n,mode:"normal"})}});function $x(e){var s;if(!e)return;const r=e.parentNode,n=document.createElement("div");n.innerHTML=r==null?void 0:r.innerHTML;for(let a=0;a batch = newBatch; // Supply a getter just to skip dealing with ESM bindings\n\nexport const getBatch = () => batch;","import * as React from 'react';\nconst ContextKey = Symbol.for(`react-redux-context`);\nconst gT = typeof globalThis !== \"undefined\" ? globalThis :\n/* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */\n{};\n\nfunction getContext() {\n var _gT$ContextKey;\n\n if (!React.createContext) return {};\n const contextMap = (_gT$ContextKey = gT[ContextKey]) != null ? _gT$ContextKey : gT[ContextKey] = new Map();\n let realContext = contextMap.get(React.createContext);\n\n if (!realContext) {\n realContext = React.createContext(null);\n\n if (process.env.NODE_ENV !== 'production') {\n realContext.displayName = 'ReactRedux';\n }\n\n contextMap.set(React.createContext, realContext);\n }\n\n return realContext;\n}\n\nexport const ReactReduxContext = /*#__PURE__*/getContext();\nexport default ReactReduxContext;","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\n\n/**\r\n * Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level\r\n * hook that you should usually not need to call directly.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useReduxContext` hook bound to the specified context.\r\n */\nexport function createReduxContextHook(context = ReactReduxContext) {\n return function useReduxContext() {\n const contextValue = useContext(context);\n\n if (process.env.NODE_ENV !== 'production' && !contextValue) {\n throw new Error('could not find react-redux context value; please ensure the component is wrapped in a ');\n }\n\n return contextValue;\n };\n}\n/**\r\n * A hook to access the value of the `ReactReduxContext`. This is a low-level\r\n * hook that you should usually not need to call directly.\r\n *\r\n * @returns {any} the value of the `ReactReduxContext`\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useReduxContext } from 'react-redux'\r\n *\r\n * export const CounterComponent = () => {\r\n * const { store } = useReduxContext()\r\n * return {store.getState()}
\r\n * }\r\n */\n\nexport const useReduxContext = /*#__PURE__*/createReduxContextHook();","export const notInitialized = () => {\n throw new Error('uSES not initialized!');\n};","import { useCallback, useDebugValue, useRef } from 'react';\nimport { createReduxContextHook, useReduxContext as useDefaultReduxContext } from './useReduxContext';\nimport { ReactReduxContext } from '../components/Context';\nimport { notInitialized } from '../utils/useSyncExternalStore';\nlet useSyncExternalStoreWithSelector = notInitialized;\nexport const initializeUseSelector = fn => {\n useSyncExternalStoreWithSelector = fn;\n};\n\nconst refEquality = (a, b) => a === b;\n/**\r\n * Hook factory, which creates a `useSelector` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useSelector` hook bound to the specified context.\r\n */\n\n\nexport function createSelectorHook(context = ReactReduxContext) {\n const useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : createReduxContextHook(context);\n return function useSelector(selector, equalityFnOrOptions = {}) {\n const {\n equalityFn = refEquality,\n stabilityCheck = undefined,\n noopCheck = undefined\n } = typeof equalityFnOrOptions === 'function' ? {\n equalityFn: equalityFnOrOptions\n } : equalityFnOrOptions;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!selector) {\n throw new Error(`You must pass a selector to useSelector`);\n }\n\n if (typeof selector !== 'function') {\n throw new Error(`You must pass a function as a selector to useSelector`);\n }\n\n if (typeof equalityFn !== 'function') {\n throw new Error(`You must pass a function as an equality function to useSelector`);\n }\n }\n\n const {\n store,\n subscription,\n getServerState,\n stabilityCheck: globalStabilityCheck,\n noopCheck: globalNoopCheck\n } = useReduxContext();\n const firstRun = useRef(true);\n const wrappedSelector = useCallback({\n [selector.name](state) {\n const selected = selector(state);\n\n if (process.env.NODE_ENV !== 'production') {\n const finalStabilityCheck = typeof stabilityCheck === 'undefined' ? globalStabilityCheck : stabilityCheck;\n\n if (finalStabilityCheck === 'always' || finalStabilityCheck === 'once' && firstRun.current) {\n const toCompare = selector(state);\n\n if (!equalityFn(selected, toCompare)) {\n let stack = undefined;\n\n try {\n throw new Error();\n } catch (e) {\n ;\n ({\n stack\n } = e);\n }\n\n console.warn('Selector ' + (selector.name || 'unknown') + ' returned a different result when called with the same parameters. This can lead to unnecessary rerenders.' + '\\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization', {\n state,\n selected,\n selected2: toCompare,\n stack\n });\n }\n }\n\n const finalNoopCheck = typeof noopCheck === 'undefined' ? globalNoopCheck : noopCheck;\n\n if (finalNoopCheck === 'always' || finalNoopCheck === 'once' && firstRun.current) {\n // @ts-ignore\n if (selected === state) {\n let stack = undefined;\n\n try {\n throw new Error();\n } catch (e) {\n ;\n ({\n stack\n } = e);\n }\n\n console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.', {\n stack\n });\n }\n }\n\n if (firstRun.current) firstRun.current = false;\n }\n\n return selected;\n }\n\n }[selector.name], [selector, globalStabilityCheck, stabilityCheck]);\n const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);\n useDebugValue(selectedState);\n return selectedState;\n };\n}\n/**\r\n * A hook to access the redux store's state. This hook takes a selector function\r\n * as an argument. The selector is called with the store state.\r\n *\r\n * This hook takes an optional equality comparison function as the second parameter\r\n * that allows you to customize the way the selected state is compared to determine\r\n * whether the component needs to be re-rendered.\r\n *\r\n * @param {Function} selector the selector function\r\n * @param {Function=} equalityFn the function that will be used to determine equality\r\n *\r\n * @returns {any} the selected state\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useSelector } from 'react-redux'\r\n *\r\n * export const CounterComponent = () => {\r\n * const counter = useSelector(state => state.counter)\r\n * return {counter}
\r\n * }\r\n */\n\nexport const useSelector = /*#__PURE__*/createSelectorHook();","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/**\n * @license React\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=Symbol.for(\"react.element\"),c=Symbol.for(\"react.portal\"),d=Symbol.for(\"react.fragment\"),e=Symbol.for(\"react.strict_mode\"),f=Symbol.for(\"react.profiler\"),g=Symbol.for(\"react.provider\"),h=Symbol.for(\"react.context\"),k=Symbol.for(\"react.server_context\"),l=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),n=Symbol.for(\"react.suspense_list\"),p=Symbol.for(\"react.memo\"),q=Symbol.for(\"react.lazy\"),t=Symbol.for(\"react.offscreen\"),u;u=Symbol.for(\"react.module.reference\");\nfunction v(a){if(\"object\"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;\nexports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};\nexports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||\"object\"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;\n","import { getBatch } from './batch'; // encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nfunction createListenerCollection() {\n const batch = getBatch();\n let first = null;\n let last = null;\n return {\n clear() {\n first = null;\n last = null;\n },\n\n notify() {\n batch(() => {\n let listener = first;\n\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n\n get() {\n let listeners = [];\n let listener = first;\n\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n\n return listeners;\n },\n\n subscribe(callback) {\n let isSubscribed = true;\n let listener = last = {\n callback,\n next: null,\n prev: last\n };\n\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n\n return function unsubscribe() {\n if (!isSubscribed || first === null) return;\n isSubscribed = false;\n\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n\n };\n}\n\nconst nullListeners = {\n notify() {},\n\n get: () => []\n};\nexport function createSubscription(store, parentSub) {\n let unsubscribe;\n let listeners = nullListeners; // Reasons to keep the subscription active\n\n let subscriptionsAmount = 0; // Is this specific subscription subscribed (or only nested ones?)\n\n let selfSubscribed = false;\n\n function addNestedSub(listener) {\n trySubscribe();\n const cleanupListener = listeners.subscribe(listener); // cleanup nested sub\n\n let removed = false;\n return () => {\n if (!removed) {\n removed = true;\n cleanupListener();\n tryUnsubscribe();\n }\n };\n }\n\n function notifyNestedSubs() {\n listeners.notify();\n }\n\n function handleChangeWrapper() {\n if (subscription.onStateChange) {\n subscription.onStateChange();\n }\n }\n\n function isSubscribed() {\n return selfSubscribed;\n }\n\n function trySubscribe() {\n subscriptionsAmount++;\n\n if (!unsubscribe) {\n unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);\n listeners = createListenerCollection();\n }\n }\n\n function tryUnsubscribe() {\n subscriptionsAmount--;\n\n if (unsubscribe && subscriptionsAmount === 0) {\n unsubscribe();\n unsubscribe = undefined;\n listeners.clear();\n listeners = nullListeners;\n }\n }\n\n function trySubscribeSelf() {\n if (!selfSubscribed) {\n selfSubscribed = true;\n trySubscribe();\n }\n }\n\n function tryUnsubscribeSelf() {\n if (selfSubscribed) {\n selfSubscribed = false;\n tryUnsubscribe();\n }\n }\n\n const subscription = {\n addNestedSub,\n notifyNestedSubs,\n handleChangeWrapper,\n isSubscribed,\n trySubscribe: trySubscribeSelf,\n tryUnsubscribe: tryUnsubscribeSelf,\n getListeners: () => listeners\n };\n return subscription;\n}","import * as React from 'react'; // React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser. We need useLayoutEffect to ensure the store\n// subscription callback always has the selector from the latest render commit\n// available, otherwise a store update may happen between render and the effect,\n// which may cause missed updates; we also must ensure the store subscription\n// is created synchronously, otherwise a store update may occur before the\n// subscription is created and an inconsistent state may be observed\n// Matches logic in React's `shared/ExecutionEnvironment` file\n\nexport const canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\nexport const useIsomorphicLayoutEffect = canUseDOM ? React.useLayoutEffect : React.useEffect;","import * as React from 'react';\nimport { ReactReduxContext } from './Context';\nimport { createSubscription } from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\n\nfunction Provider({\n store,\n context,\n children,\n serverState,\n stabilityCheck = 'once',\n noopCheck = 'once'\n}) {\n const contextValue = React.useMemo(() => {\n const subscription = createSubscription(store);\n return {\n store,\n subscription,\n getServerState: serverState ? () => serverState : undefined,\n stabilityCheck,\n noopCheck\n };\n }, [store, serverState, stabilityCheck, noopCheck]);\n const previousState = React.useMemo(() => store.getState(), [store]);\n useIsomorphicLayoutEffect(() => {\n const {\n subscription\n } = contextValue;\n subscription.onStateChange = subscription.notifyNestedSubs;\n subscription.trySubscribe();\n\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n\n return () => {\n subscription.tryUnsubscribe();\n subscription.onStateChange = undefined;\n };\n }, [contextValue, previousState]);\n const Context = context || ReactReduxContext; // @ts-ignore 'AnyAction' is assignable to the constraint of type 'A', but 'A' could be instantiated with a different subtype\n\n return /*#__PURE__*/React.createElement(Context.Provider, {\n value: contextValue\n }, children);\n}\n\nexport default Provider;","import { ReactReduxContext } from '../components/Context';\nimport { useReduxContext as useDefaultReduxContext, createReduxContextHook } from './useReduxContext';\n/**\r\n * Hook factory, which creates a `useStore` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useStore` hook bound to the specified context.\r\n */\n\nexport function createStoreHook(context = ReactReduxContext) {\n const useReduxContext = // @ts-ignore\n context === ReactReduxContext ? useDefaultReduxContext : // @ts-ignore\n createReduxContextHook(context);\n return function useStore() {\n const {\n store\n } = useReduxContext(); // @ts-ignore\n\n return store;\n };\n}\n/**\r\n * A hook to access the redux store.\r\n *\r\n * @returns {any} the redux store\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useStore } from 'react-redux'\r\n *\r\n * export const ExampleComponent = () => {\r\n * const store = useStore()\r\n * return {store.getState()}
\r\n * }\r\n */\n\nexport const useStore = /*#__PURE__*/createStoreHook();","import { ReactReduxContext } from '../components/Context';\nimport { useStore as useDefaultStore, createStoreHook } from './useStore';\n/**\r\n * Hook factory, which creates a `useDispatch` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useDispatch` hook bound to the specified context.\r\n */\n\nexport function createDispatchHook(context = ReactReduxContext) {\n const useStore = // @ts-ignore\n context === ReactReduxContext ? useDefaultStore : createStoreHook(context);\n return function useDispatch() {\n const store = useStore(); // @ts-ignore\n\n return store.dispatch;\n };\n}\n/**\r\n * A hook to access the redux `dispatch` function.\r\n *\r\n * @returns {any|function} redux store's `dispatch` function\r\n *\r\n * @example\r\n *\r\n * import React, { useCallback } from 'react'\r\n * import { useDispatch } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const dispatch = useDispatch()\r\n * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])\r\n * return (\r\n * \r\n * {value} \r\n * Increase counter \r\n *
\r\n * )\r\n * }\r\n */\n\nexport const useDispatch = /*#__PURE__*/createDispatchHook();","// The primary entry point assumes we're working with standard ReactDOM/RN, but\n// older versions that do not include `useSyncExternalStore` (React 16.9 - 17.x).\n// Because of that, the useSyncExternalStore compat shim is needed.\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';\nimport { setBatch } from './utils/batch';\nimport { initializeUseSelector } from './hooks/useSelector';\nimport { initializeConnect } from './components/connect';\ninitializeUseSelector(useSyncExternalStoreWithSelector);\ninitializeConnect(useSyncExternalStore); // Enable batched updates in our subscriptions for use\n// with standard React renderers (ReactDOM, React Native)\n\nsetBatch(batch);\nexport { batch };\nexport * from './exports';","import {ThunkDispatch} from \"redux-thunk\";\r\nimport {useDispatch, useSelector} from \"react-redux\";\r\nimport {CommonAction, CommonState} from \"../store/common/commonTypes\";\r\nimport {RootState} from \"../store/app/appTypes\";\r\n\r\nconst useCommonDispatch = () => {\r\n\r\n const dispatch: ThunkDispatch = useDispatch();\r\n const common: CommonState['mobile'] | CommonState = useSelector((state: RootState) => state.common[state.app.activeReport])\r\n const root: CommonState = useSelector((state: RootState) => state.common)\r\n\r\n\r\n return {\r\n dispatch,\r\n common,\r\n ...common,\r\n ...root\r\n }\r\n}\r\n\r\nexport default useCommonDispatch","export type CommonState = {\r\n optimizerRoot: ShadowRoot | null\r\n mode: RapidLoadOptimizerModes,\r\n modeData?: RapidLoadOptimizerModeData\r\n isTourOpen: boolean\r\n\r\n mobile : {\r\n activeTab: AuditTypes;\r\n activeMetric?: Metric | null;\r\n hoveredMetric?: Metric | null;\r\n openAudits: string[];\r\n openCategory?: SettingsCategory | '';\r\n storePassedAudits?:string[];\r\n inProgress: boolean;\r\n settingsMode: PerformanceGear | null;\r\n testModeStatus: boolean;\r\n testModeLoading: boolean;\r\n auditsReturn: boolean;\r\n uucssError: boolean;\r\n }\r\n desktop : {\r\n activeTab: AuditTypes;\r\n activeMetric?: Metric | null;\r\n hoveredMetric?: Metric | null;\r\n openAudits: string[];\r\n openCategory?: SettingsCategory | '';\r\n storePassedAudits?:string[];\r\n inProgress: boolean;\r\n settingsMode: PerformanceGear | null;\r\n testModeStatus: boolean;\r\n testModeLoading: boolean;\r\n auditsReturn: boolean;\r\n uucssError: boolean;\r\n }\r\n\r\n};\r\n\r\nexport const SET_STATE = 'SET_STATE';\r\nexport const SET_ROOT_STATE = 'SET_ROOT_STATE';\r\n\r\ninterface SetStateAction {\r\n type: typeof SET_STATE;\r\n payload: {\r\n activeReport: ReportType,\r\n key: string,\r\n value: any\r\n }\r\n}\r\n\r\ninterface SetRootStateAction {\r\n type: typeof SET_ROOT_STATE;\r\n payload: {\r\n key: string,\r\n value: any\r\n }\r\n}\r\n\r\nexport type CommonAction = SetStateAction | SetRootStateAction","import {ThunkAction, ThunkDispatch} from 'redux-thunk';\r\nimport {AnyAction} from 'redux';\r\nimport {RootState} from \"../app/appTypes\";\r\nimport {CommonAction, CommonState, SET_ROOT_STATE} from \"./commonTypes\";\r\nimport {SET_STATE} from \"./commonTypes\";\r\n\r\n\r\nexport const setCommonState = (\r\n key : keyof CommonState['mobile'],\r\n value: any,\r\n): ThunkAction => {\r\n \r\n return async (dispatch: ThunkDispatch, getState) => {\r\n\r\n const activeReport = getState().app.activeReport\r\n dispatch({\r\n type: SET_STATE, payload : {\r\n activeReport: activeReport,\r\n key,\r\n value\r\n }\r\n })\r\n }\r\n}\r\n\r\nexport const setCommonRootState = (\r\n key : keyof CommonState,\r\n value: any,\r\n): ThunkAction => {\r\n\r\n return async (dispatch: ThunkDispatch, getState) => {\r\n\r\n dispatch({\r\n type: SET_ROOT_STATE, payload : {\r\n key,\r\n value\r\n }\r\n })\r\n }\r\n}","import {\r\n createContext,\r\n Dispatch,\r\n ReactNode,\r\n RefObject,\r\n SetStateAction,\r\n useContext,\r\n useEffect,\r\n useRef,\r\n useState\r\n} from 'react';\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\nimport {setCommonRootState} from \"../store/common/commonActions\";\r\n\r\ninterface OptimizerContextProps {\r\n openAudits: string[],\r\n setOpenAudits: Dispatch>;\r\n showOptimizer: boolean;\r\n setShowOptimizer: Dispatch>;\r\n options: WordPressOptions,\r\n version: string,\r\n mode: RapidLoadOptimizerModes\r\n modeData?: RapidLoadOptimizerModeData\r\n manipulatingStyles: boolean\r\n savingData: boolean;\r\n setSavingData: Dispatch>;\r\n global: boolean\r\n togglePerformance: boolean;\r\n setTogglePerformance: Dispatch>;\r\n optimizerContainer: RefObject\r\n invalidatingCache: boolean\r\n setInvalidatingCache: Dispatch>;\r\n}\r\n\r\nexport const AppContext = createContext(null)\r\n\r\n\r\nexport const AppProvider = ({ children, initShowOptimizerValue, global, mode, modeData } : {\r\n children: ReactNode\r\n mode: RapidLoadOptimizerModes\r\n modeData?: RapidLoadOptimizerModeData\r\n initShowOptimizerValue?: boolean,\r\n global: boolean\r\n}) => {\r\n const isAdminBar = document.getElementById('wpadminbar');\r\n\r\n const [showOptimizer, setShowOptimizer] = useState(false);\r\n const [manipulatingStyles, setManipulatingStyles] = useState(false);\r\n const [mounted, setMounted] = useState(false);\r\n const [sheetsHidden, setSheetsHidden]= useState(false)\r\n const [openAudits, setOpenAudits] = useState([]);\r\n const [options, setOptions] = useState((\r\n {\r\n optimizer_url: 'https://rapidload.io/',\r\n ajax_url: \"http://rapidload.local/wp-admin/admin-ajax.php\",\r\n page_optimizer_base: '',\r\n page_optimizer_package_base: '',\r\n plugin_url: '',\r\n nonce: '',\r\n timezone: 'UTC',\r\n actions: [],\r\n load_optimizer: false,\r\n rapidload_version: '2.2.0',\r\n rest_url: 'https://rapidload.local/wp-json/rapidload/v1',\r\n ...(\r\n window.rapidload_optimizer ? window.rapidload_optimizer : {}\r\n ),\r\n }\r\n ))\r\n const [type, setType] = useState('desktop');\r\n const [savingData, setSavingData] = useState(false)\r\n const [togglePerformance, setTogglePerformance] = useState(true);\r\n const optimizerContainer = useRef(null);\r\n const [invalidatingCache, setInvalidatingCache] = useState(false)\r\n const { dispatch } = useCommonDispatch()\r\n\r\n useEffect(() => {\r\n const updateData = (event: RapidLoadSetOptimizerEvent) => {\r\n const { detail } = event\r\n\r\n if (typeof detail?.status !== undefined) {\r\n setShowOptimizer(detail?.status || false);\r\n }\r\n };\r\n\r\n window.addEventListener('rapidLoad:set-optimizer', updateData);\r\n \r\n setMounted(true)\r\n\r\n if (mode) {\r\n dispatch(setCommonRootState('mode', mode));\r\n }\r\n\r\n if (modeData) {\r\n dispatch(setCommonRootState('modeData', modeData));\r\n }\r\n\r\n const event =\r\n new CustomEvent('rapidLoad:optimizer-mounted');\r\n\r\n window.dispatchEvent(event);\r\n\r\n return () => {\r\n window.removeEventListener('rapidLoad:set-optimizer', updateData);\r\n };\r\n }, [])\r\n\r\n useEffect(() => {\r\n\r\n if (showOptimizer) {\r\n document.documentElement.classList.add('rapidload-optimizer-open')\r\n } else {\r\n document.documentElement.classList.remove('rapidload-optimizer-open')\r\n }\r\n \r\n }, [showOptimizer])\r\n\r\n const _setShowOptimizer = (value: SetStateAction) => {\r\n\r\n if (!value) {\r\n // giving a breath to enabled stylesheets to paint\r\n requestAnimationFrame(() => {\r\n setShowOptimizer(value)\r\n });\r\n } else {\r\n setShowOptimizer(value)\r\n }\r\n }\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n};\r\n\r\nexport const useAppContext = () => {\r\n const context = useContext(AppContext);\r\n\r\n if (context === null) {\r\n throw new Error('useAppContext must be used within an AppProvider');\r\n }\r\n\r\n return context;\r\n}","\"use client\";\n\n// packages/react/tooltip/src/Tooltip.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Slottable } from \"@radix-ui/react-slot\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport * as VisuallyHiddenPrimitive from \"@radix-ui/react-visually-hidden\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar [createTooltipContext, createTooltipScope] = createContextScope(\"Tooltip\", [\n createPopperScope\n]);\nvar usePopperScope = createPopperScope();\nvar PROVIDER_NAME = \"TooltipProvider\";\nvar DEFAULT_DELAY_DURATION = 700;\nvar TOOLTIP_OPEN = \"tooltip.open\";\nvar [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME);\nvar TooltipProvider = (props) => {\n const {\n __scopeTooltip,\n delayDuration = DEFAULT_DELAY_DURATION,\n skipDelayDuration = 300,\n disableHoverableContent = false,\n children\n } = props;\n const [isOpenDelayed, setIsOpenDelayed] = React.useState(true);\n const isPointerInTransitRef = React.useRef(false);\n const skipDelayTimerRef = React.useRef(0);\n React.useEffect(() => {\n const skipDelayTimer = skipDelayTimerRef.current;\n return () => window.clearTimeout(skipDelayTimer);\n }, []);\n return /* @__PURE__ */ jsx(\n TooltipProviderContextProvider,\n {\n scope: __scopeTooltip,\n isOpenDelayed,\n delayDuration,\n onOpen: React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n setIsOpenDelayed(false);\n }, []),\n onClose: React.useCallback(() => {\n window.clearTimeout(skipDelayTimerRef.current);\n skipDelayTimerRef.current = window.setTimeout(\n () => setIsOpenDelayed(true),\n skipDelayDuration\n );\n }, [skipDelayDuration]),\n isPointerInTransitRef,\n onPointerInTransitChange: React.useCallback((inTransit) => {\n isPointerInTransitRef.current = inTransit;\n }, []),\n disableHoverableContent,\n children\n }\n );\n};\nTooltipProvider.displayName = PROVIDER_NAME;\nvar TOOLTIP_NAME = \"Tooltip\";\nvar [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME);\nvar Tooltip = (props) => {\n const {\n __scopeTooltip,\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disableHoverableContent: disableHoverableContentProp,\n delayDuration: delayDurationProp\n } = props;\n const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const [trigger, setTrigger] = React.useState(null);\n const contentId = useId();\n const openTimerRef = React.useRef(0);\n const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;\n const delayDuration = delayDurationProp ?? providerContext.delayDuration;\n const wasOpenDelayedRef = React.useRef(false);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: (open2) => {\n if (open2) {\n providerContext.onOpen();\n document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN));\n } else {\n providerContext.onClose();\n }\n onOpenChange?.(open2);\n }\n });\n const stateAttribute = React.useMemo(() => {\n return open ? wasOpenDelayedRef.current ? \"delayed-open\" : \"instant-open\" : \"closed\";\n }, [open]);\n const handleOpen = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n wasOpenDelayedRef.current = false;\n setOpen(true);\n }, [setOpen]);\n const handleClose = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n setOpen(false);\n }, [setOpen]);\n const handleDelayedOpen = React.useCallback(() => {\n window.clearTimeout(openTimerRef.current);\n openTimerRef.current = window.setTimeout(() => {\n wasOpenDelayedRef.current = true;\n setOpen(true);\n }, delayDuration);\n }, [delayDuration, setOpen]);\n React.useEffect(() => {\n return () => window.clearTimeout(openTimerRef.current);\n }, []);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n TooltipContextProvider,\n {\n scope: __scopeTooltip,\n contentId,\n open,\n stateAttribute,\n trigger,\n onTriggerChange: setTrigger,\n onTriggerEnter: React.useCallback(() => {\n if (providerContext.isOpenDelayed) handleDelayedOpen();\n else handleOpen();\n }, [providerContext.isOpenDelayed, handleDelayedOpen, handleOpen]),\n onTriggerLeave: React.useCallback(() => {\n if (disableHoverableContent) {\n handleClose();\n } else {\n window.clearTimeout(openTimerRef.current);\n }\n }, [handleClose, disableHoverableContent]),\n onOpen: handleOpen,\n onClose: handleClose,\n disableHoverableContent,\n children\n }\n ) });\n};\nTooltip.displayName = TOOLTIP_NAME;\nvar TRIGGER_NAME = \"TooltipTrigger\";\nvar TooltipTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTooltip, ...triggerProps } = props;\n const context = useTooltipContext(TRIGGER_NAME, __scopeTooltip);\n const providerContext = useTooltipProviderContext(TRIGGER_NAME, __scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, context.onTriggerChange);\n const isPointerDownRef = React.useRef(false);\n const hasPointerMoveOpenedRef = React.useRef(false);\n const handlePointerUp = React.useCallback(() => isPointerDownRef.current = false, []);\n React.useEffect(() => {\n return () => document.removeEventListener(\"pointerup\", handlePointerUp);\n }, [handlePointerUp]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n \"aria-describedby\": context.open ? context.contentId : void 0,\n \"data-state\": context.stateAttribute,\n ...triggerProps,\n ref: composedRefs,\n onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {\n if (event.pointerType === \"touch\") return;\n if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) {\n context.onTriggerEnter();\n hasPointerMoveOpenedRef.current = true;\n }\n }),\n onPointerLeave: composeEventHandlers(props.onPointerLeave, () => {\n context.onTriggerLeave();\n hasPointerMoveOpenedRef.current = false;\n }),\n onPointerDown: composeEventHandlers(props.onPointerDown, () => {\n isPointerDownRef.current = true;\n document.addEventListener(\"pointerup\", handlePointerUp, { once: true });\n }),\n onFocus: composeEventHandlers(props.onFocus, () => {\n if (!isPointerDownRef.current) context.onOpen();\n }),\n onBlur: composeEventHandlers(props.onBlur, context.onClose),\n onClick: composeEventHandlers(props.onClick, context.onClose)\n }\n ) });\n }\n);\nTooltipTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"TooltipPortal\";\nvar [PortalProvider, usePortalContext] = createTooltipContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar TooltipPortal = (props) => {\n const { __scopeTooltip, forceMount, children, container } = props;\n const context = useTooltipContext(PORTAL_NAME, __scopeTooltip);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeTooltip, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nTooltipPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"TooltipContent\";\nvar TooltipContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeTooltip);\n const { forceMount = portalContext.forceMount, side = \"top\", ...contentProps } = props;\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.disableHoverableContent ? /* @__PURE__ */ jsx(TooltipContentImpl, { side, ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(TooltipContentHoverable, { side, ...contentProps, ref: forwardedRef }) });\n }\n);\nvar TooltipContentHoverable = React.forwardRef((props, forwardedRef) => {\n const context = useTooltipContext(CONTENT_NAME, props.__scopeTooltip);\n const providerContext = useTooltipProviderContext(CONTENT_NAME, props.__scopeTooltip);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [pointerGraceArea, setPointerGraceArea] = React.useState(null);\n const { trigger, onClose } = context;\n const content = ref.current;\n const { onPointerInTransitChange } = providerContext;\n const handleRemoveGraceArea = React.useCallback(() => {\n setPointerGraceArea(null);\n onPointerInTransitChange(false);\n }, [onPointerInTransitChange]);\n const handleCreateGraceArea = React.useCallback(\n (event, hoverTarget) => {\n const currentTarget = event.currentTarget;\n const exitPoint = { x: event.clientX, y: event.clientY };\n const exitSide = getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect());\n const paddedExitPoints = getPaddedExitPoints(exitPoint, exitSide);\n const hoverTargetPoints = getPointsFromRect(hoverTarget.getBoundingClientRect());\n const graceArea = getHull([...paddedExitPoints, ...hoverTargetPoints]);\n setPointerGraceArea(graceArea);\n onPointerInTransitChange(true);\n },\n [onPointerInTransitChange]\n );\n React.useEffect(() => {\n return () => handleRemoveGraceArea();\n }, [handleRemoveGraceArea]);\n React.useEffect(() => {\n if (trigger && content) {\n const handleTriggerLeave = (event) => handleCreateGraceArea(event, content);\n const handleContentLeave = (event) => handleCreateGraceArea(event, trigger);\n trigger.addEventListener(\"pointerleave\", handleTriggerLeave);\n content.addEventListener(\"pointerleave\", handleContentLeave);\n return () => {\n trigger.removeEventListener(\"pointerleave\", handleTriggerLeave);\n content.removeEventListener(\"pointerleave\", handleContentLeave);\n };\n }\n }, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]);\n React.useEffect(() => {\n if (pointerGraceArea) {\n const handleTrackPointerGrace = (event) => {\n const target = event.target;\n const pointerPosition = { x: event.clientX, y: event.clientY };\n const hasEnteredTarget = trigger?.contains(target) || content?.contains(target);\n const isPointerOutsideGraceArea = !isPointInPolygon(pointerPosition, pointerGraceArea);\n if (hasEnteredTarget) {\n handleRemoveGraceArea();\n } else if (isPointerOutsideGraceArea) {\n handleRemoveGraceArea();\n onClose();\n }\n };\n document.addEventListener(\"pointermove\", handleTrackPointerGrace);\n return () => document.removeEventListener(\"pointermove\", handleTrackPointerGrace);\n }\n }, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]);\n return /* @__PURE__ */ jsx(TooltipContentImpl, { ...props, ref: composedRefs });\n});\nvar [VisuallyHiddenContentContextProvider, useVisuallyHiddenContentContext] = createTooltipContext(TOOLTIP_NAME, { isInside: false });\nvar TooltipContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeTooltip,\n children,\n \"aria-label\": ariaLabel,\n onEscapeKeyDown,\n onPointerDownOutside,\n ...contentProps\n } = props;\n const context = useTooltipContext(CONTENT_NAME, __scopeTooltip);\n const popperScope = usePopperScope(__scopeTooltip);\n const { onClose } = context;\n React.useEffect(() => {\n document.addEventListener(TOOLTIP_OPEN, onClose);\n return () => document.removeEventListener(TOOLTIP_OPEN, onClose);\n }, [onClose]);\n React.useEffect(() => {\n if (context.trigger) {\n const handleScroll = (event) => {\n const target = event.target;\n if (target?.contains(context.trigger)) onClose();\n };\n window.addEventListener(\"scroll\", handleScroll, { capture: true });\n return () => window.removeEventListener(\"scroll\", handleScroll, { capture: true });\n }\n }, [context.trigger, onClose]);\n return /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents: false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside: (event) => event.preventDefault(),\n onDismiss: onClose,\n children: /* @__PURE__ */ jsxs(\n PopperPrimitive.Content,\n {\n \"data-state\": context.stateAttribute,\n ...popperScope,\n ...contentProps,\n ref: forwardedRef,\n style: {\n ...contentProps.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-tooltip-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-tooltip-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-tooltip-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-tooltip-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-tooltip-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n },\n children: [\n /* @__PURE__ */ jsx(Slottable, { children }),\n /* @__PURE__ */ jsx(VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true, children: /* @__PURE__ */ jsx(VisuallyHiddenPrimitive.Root, { id: context.contentId, role: \"tooltip\", children: ariaLabel || children }) })\n ]\n }\n )\n }\n );\n }\n);\nTooltipContent.displayName = CONTENT_NAME;\nvar ARROW_NAME = \"TooltipArrow\";\nvar TooltipArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeTooltip, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeTooltip);\n const visuallyHiddenContentContext = useVisuallyHiddenContentContext(\n ARROW_NAME,\n __scopeTooltip\n );\n return visuallyHiddenContentContext.isInside ? null : /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nTooltipArrow.displayName = ARROW_NAME;\nfunction getExitSideFromRect(point, rect) {\n const top = Math.abs(rect.top - point.y);\n const bottom = Math.abs(rect.bottom - point.y);\n const right = Math.abs(rect.right - point.x);\n const left = Math.abs(rect.left - point.x);\n switch (Math.min(top, bottom, right, left)) {\n case left:\n return \"left\";\n case right:\n return \"right\";\n case top:\n return \"top\";\n case bottom:\n return \"bottom\";\n default:\n throw new Error(\"unreachable\");\n }\n}\nfunction getPaddedExitPoints(exitPoint, exitSide, padding = 5) {\n const paddedExitPoints = [];\n switch (exitSide) {\n case \"top\":\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y + padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case \"bottom\":\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y - padding }\n );\n break;\n case \"left\":\n paddedExitPoints.push(\n { x: exitPoint.x + padding, y: exitPoint.y - padding },\n { x: exitPoint.x + padding, y: exitPoint.y + padding }\n );\n break;\n case \"right\":\n paddedExitPoints.push(\n { x: exitPoint.x - padding, y: exitPoint.y - padding },\n { x: exitPoint.x - padding, y: exitPoint.y + padding }\n );\n break;\n }\n return paddedExitPoints;\n}\nfunction getPointsFromRect(rect) {\n const { top, right, bottom, left } = rect;\n return [\n { x: left, y: top },\n { x: right, y: top },\n { x: right, y: bottom },\n { x: left, y: bottom }\n ];\n}\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\nfunction getHull(points) {\n const newPoints = points.slice();\n newPoints.sort((a, b) => {\n if (a.x < b.x) return -1;\n else if (a.x > b.x) return 1;\n else if (a.y < b.y) return -1;\n else if (a.y > b.y) return 1;\n else return 0;\n });\n return getHullPresorted(newPoints);\n}\nfunction getHullPresorted(points) {\n if (points.length <= 1) return points.slice();\n const upperHull = [];\n for (let i = 0; i < points.length; i++) {\n const p = points[i];\n while (upperHull.length >= 2) {\n const q = upperHull[upperHull.length - 1];\n const r = upperHull[upperHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop();\n else break;\n }\n upperHull.push(p);\n }\n upperHull.pop();\n const lowerHull = [];\n for (let i = points.length - 1; i >= 0; i--) {\n const p = points[i];\n while (lowerHull.length >= 2) {\n const q = lowerHull[lowerHull.length - 1];\n const r = lowerHull[lowerHull.length - 2];\n if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop();\n else break;\n }\n lowerHull.push(p);\n }\n lowerHull.pop();\n if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) {\n return upperHull;\n } else {\n return upperHull.concat(lowerHull);\n }\n}\nvar Provider = TooltipProvider;\nvar Root3 = Tooltip;\nvar Trigger = TooltipTrigger;\nvar Portal = TooltipPortal;\nvar Content2 = TooltipContent;\nvar Arrow2 = TooltipArrow;\nexport {\n Arrow2 as Arrow,\n Content2 as Content,\n Portal,\n Provider,\n Root3 as Root,\n Tooltip,\n TooltipArrow,\n TooltipContent,\n TooltipPortal,\n TooltipProvider,\n TooltipTrigger,\n Trigger,\n createTooltipScope\n};\n//# sourceMappingURL=index.mjs.map\n","import {createContext, Dispatch, ReactNode, SetStateAction, useContext, useEffect, useState} from \"react\";\r\nimport {AppContext} from \"./app\";\r\n\r\ninterface RootContextProps {\r\n theme: string\r\n setTheme: Dispatch>\r\n isDark: boolean\r\n setIsDark: Dispatch>\r\n changeTheme: () => void\r\n}\r\n\r\nexport const RootContext = createContext(null)\r\n\r\ninterface RootProviderProps {\r\n children: ReactNode\r\n}\r\n\r\nconst RootProvider = ({ children }: RootProviderProps) => {\r\n const [theme, setTheme] = useState('light')\r\n const [isDark, setIsDark] = useState(false)\r\n\r\n useEffect(() => {\r\n //@ts-ignore\r\n const localTheme = typeof window !== 'undefined' && window.localStorage.getItem('rapidload-theme');\r\n if(localTheme) {\r\n setTheme(localTheme);\r\n }\r\n\r\n }, []);\r\n\r\n useEffect(() => {\r\n typeof window !== 'undefined' && window.localStorage.setItem('rapidload-theme', theme)\r\n }, [theme])\r\n\r\n const changeTheme = () => {\r\n if(theme === 'dark') {\r\n setTheme('light');\r\n } else {\r\n setTheme('dark');\r\n }\r\n }\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\nexport default RootProvider\r\n\r\nexport const useRootContext = () => {\r\n const context = useContext(RootContext);\r\n\r\n if (context === null) {\r\n throw new Error('useRootContext must be used within an useRootContext');\r\n }\r\n\r\n return context;\r\n}","import {Highlight, themes} from \"prism-react-renderer\";\r\nimport {cn} from \"lib/utils\";\r\nimport {useRootContext} from \"../../context/root\";\r\n\r\ninterface CodeProps {\r\n code: string\r\n lang?: string\r\n className?: string\r\n}\r\n\r\nconst Code = ({ code, lang = 'html' , className} : CodeProps) => {\r\n\r\n const { theme, isDark } = useRootContext()\r\n\r\n return (\r\n \r\n {({className : cls, style, tokens, getLineProps, getTokenProps}) => (\r\n \r\n {tokens.map((line, i) => (\r\n \r\n {line.map((token, key) => (\r\n \r\n ))}\r\n
\r\n ))}\r\n \r\n )}\r\n \r\n )\r\n}\r\n\r\nexport default Code","import { type ClassValue, clsx } from \"clsx\"\r\nimport Code from \"components/ui/code\";\r\nimport {twMerge} from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs))\r\n}\r\n\r\nexport function isImageAudit(audit_id: string) {\r\n return [\r\n 'offscreen-images',\r\n 'modern-image-formats',\r\n 'unsized-images',\r\n 'uses-responsive-images',\r\n 'uses-optimized-images'\r\n ].includes(audit_id)\r\n}\r\n\r\nexport function transformFileType(audit: Audit, type?: string) {\r\n\r\n if(audit.id === 'lcp-lazy-loaded' && type === 'unknown') {\r\n type = 'image';\r\n }\r\n\r\n if (type === 'google_font') {\r\n type = 'font'\r\n }\r\n\r\n if (type === 'data_image') {\r\n type = 'image'\r\n }\r\n\r\n if (type === 'js') {\r\n type = 'javascript'\r\n }\r\n\r\n return type\r\n}\r\n\r\nexport const isDev = import.meta.env.DEV\r\n\r\nexport function isUrl(input: string): boolean {\r\n try {\r\n new URL(input);\r\n return true;\r\n } catch (error) {\r\n return false;\r\n }\r\n}\r\n\r\nexport function truncateMiddleOfURL(url: string, maxLength: number, showDomain: boolean = true) {\r\n try {\r\n if (url === 'Unattributable') {\r\n return url;\r\n }\r\n\r\n const parsedURL = new URL(url);\r\n\r\n // Check if the URL has a trailing slash\r\n const hasTrailingSlash = url.endsWith('/');\r\n\r\n // Check if the last part of the pathname is empty (no trailing slash)\r\n const isHomepage = parsedURL.pathname.split('/').pop() === '';\r\n\r\n if (isHomepage) {\r\n // If it's a homepage, remove the trailing slash and return the URL\r\n const truncatedURL = `${parsedURL.protocol}//${parsedURL.host}`;\r\n return truncatedURL;\r\n }\r\n\r\n const pathSegments = parsedURL.pathname.split('/');\r\n const penultimatePart = pathSegments[pathSegments.length - 2];\r\n const lastPart = pathSegments[pathSegments.length - 1];\r\n\r\n let baseTruncatedURL = showDomain\r\n ? `${parsedURL.protocol}//${parsedURL.host}/.../${penultimatePart}/`\r\n : `.../${penultimatePart}/`;\r\n\r\n let finalLastPart = lastPart;\r\n\r\n // If the constructed URL is longer than maxLength, trim the earlier portion of the filename\r\n if (baseTruncatedURL.length + lastPart.length > maxLength) {\r\n const overflowLength = (baseTruncatedURL.length + lastPart.length) - maxLength;\r\n finalLastPart = `...${lastPart.slice(overflowLength + 3)}`;\r\n }\r\n\r\n const truncatedURL = baseTruncatedURL + finalLastPart + (hasTrailingSlash ? '/' : '');\r\n\r\n return truncatedURL;\r\n } catch (error) {\r\n // console.error('Invalid URL:', url);\r\n\r\n if (url) {\r\n return
;\r\n }\r\n }\r\n}\r\n\r\n\r\nexport function formatNumberWithGranularity(number: number, granularity: number = 1): string {\r\n const roundedValue = Math.round(number / granularity) * granularity;\r\n return roundedValue.toFixed(Math.max(0, Math.ceil(-Math.log10(granularity))));\r\n}\r\n\r\nexport function timeAgo(timestamp: number) {\r\n const date : Date = new Date(timestamp);\r\n const now : Date= new Date();\r\n // @ts-ignore\r\n const secondsAgo = Math.round((now - date) / 1000);\r\n const minutesAgo = Math.round(secondsAgo / 60);\r\n const hoursAgo = Math.round(minutesAgo / 60);\r\n const daysAgo = Math.round(hoursAgo / 24);\r\n const monthsAgo = Math.round(daysAgo / 30.44); // Using the average number of days in a month (365.24/12)\r\n const yearsAgo = Math.round(daysAgo / 365.24); // Using the average number of days in a year (considering leap years)\r\n\r\n if (secondsAgo < 60) {\r\n return `just now`;\r\n } else if (secondsAgo < 60) {\r\n return `${secondsAgo} seconds ago`;\r\n } else if (minutesAgo < 60) {\r\n return `${minutesAgo} minutes ago`;\r\n } else if (hoursAgo < 24) {\r\n return `${hoursAgo} hours ago`;\r\n } else if (daysAgo < 30) {\r\n return `${daysAgo} days ago`;\r\n } else if (monthsAgo < 12) {\r\n return `${monthsAgo} months ago`;\r\n } else {\r\n return `${yearsAgo} years ago`;\r\n }\r\n}\r\n\r\nexport function toBoolean(value: any): boolean {\r\n return value === true || value === 1 || value === '1' || value === 'true';\r\n}","import * as React from \"react\"\r\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\"\r\n\r\nimport { cn } from \"../../lib/utils\"\r\n\r\nconst TooltipProvider = TooltipPrimitive.Provider\r\n\r\nconst Tooltip = TooltipPrimitive.Root\r\n\r\nconst TooltipTrigger = TooltipPrimitive.Trigger\r\n\r\nconst TooltipContent = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, sideOffset = 4, ...props }, ref) => (\r\n \r\n))\r\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\r\n\r\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }\r\n","import {Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } from \"components/ui/tooltip\";\r\nimport {Undo2} from \"lucide-react\";\r\nimport {ReactNode, MouseEvent} from \"react\";\r\nimport {cn} from \"lib/utils\";\r\nimport {TooltipPortal} from \"@radix-ui/react-tooltip\";\r\n\r\ninterface TooltipTextProps {\r\n text: string | ReactNode\r\n children: ReactNode,\r\n className?: string\r\n onClick?: () => void,\r\n asChild?: boolean\r\n delay?: number\r\n}\r\n\r\nconst TooltipText = ({ text, children, onClick, className, asChild = false, delay = 500} : TooltipTextProps) => {\r\n return (\r\n \r\n \r\n onClick && onClick()} className={cn(\r\n 'flex items-center',\r\n )}>\r\n {children}\r\n \r\n {text} \r\n \r\n \r\n )\r\n}\r\n\r\nexport default TooltipText","import {CommonState} from \"../common/commonTypes\";\r\nimport { LucideIcon } from \"lucide-react\";\r\n\r\nexport interface RootState {\r\n app: AppState;\r\n common: CommonState\r\n}\r\n\r\ninterface Report {\r\n data?: OptimizerResults | null;\r\n original?: OptimizerResults | null;\r\n error?: string | null;\r\n loading: boolean\r\n settings?: AuditSetting[],\r\n originalSettings?: AuditSetting[],\r\n revisions: Revision[],\r\n changes: {\r\n files: Array\r\n },\r\n state: {\r\n fresh?: boolean\r\n }\r\n}\r\n\r\nexport interface AppState {\r\n activeReport: ReportType,\r\n cssStatus: CSSStatusResponse | null;\r\n testMode: TestMode | null;\r\n report: {\r\n mobile: Report,\r\n desktop: Report,\r\n },\r\n settings: {\r\n performance: {\r\n [key in ReportType]: {\r\n original: AuditSetting[],\r\n state: AuditSetting[],\r\n error: string | null;\r\n loading: boolean\r\n }\r\n },\r\n general: {\r\n test_mode: boolean | TestMode\r\n performance_gear: PerformanceGear\r\n },\r\n actions: AuditSettingInput[]\r\n },\r\n}\r\n\r\nexport const FETCH_REPORT_REQUEST = 'FETCH_REPORT_REQUEST';\r\nexport const FETCH_REPORT_SUCCESS = 'FETCH_REPORT_SUCCESS';\r\nexport const FETCH_REPORT_FAILURE = 'FETCH_REPORT_FAILURE';\r\nexport const FETCH_SETTING_REQUEST = 'FETCH_SETTING_REQUEST';\r\nexport const FETCH_SETTING_SUCCESS = 'FETCH_SETTING_SUCCESS';\r\nexport const FETCH_SETTING_FAILURE = 'FETCH_SETTING_FAILURE';\r\nexport const UPDATE_SETTINGS = 'UPDATE_SETTINGS';\r\nexport const CHANGE_GEAR = 'CHANGE_GEAR';\r\nexport const CHANGE_REPORT_TYPE = 'CHANGE_REPORT_TYPE';\r\nexport const UPDATE_FILE_ACTION = 'UPDATE_FILE_ACTION';\r\nexport const GET_CSS_STATUS_SUCCESS = 'GET_CSS_STATUS_SUCCESS';\r\nexport const UPDATE_TEST_MODE = 'UPDATE_TEST_MODE';\r\n\r\ninterface GetCSSStatusSuccess {\r\n type: typeof GET_CSS_STATUS_SUCCESS,\r\n payload : CSSStatusResponse,\r\n\r\n}\r\n\r\ninterface UpdateTestMode {\r\n type: typeof UPDATE_TEST_MODE,\r\n payload : TestMode,\r\n\r\n}\r\n\r\ninterface FetchDataRequestAction {\r\n type: typeof FETCH_REPORT_REQUEST;\r\n activeReport: ReportType\r\n}\r\n\r\n// Define action interfaces\r\ninterface FetchDataSuccessAction {\r\n type: typeof FETCH_REPORT_SUCCESS;\r\n payload: {\r\n data: any\r\n activeReport: ReportType\r\n }\r\n}\r\n\r\ninterface FetchDataFailureAction {\r\n type: typeof FETCH_REPORT_FAILURE;\r\n error: string;\r\n}\r\n\r\ninterface FetchSettingsRequestAction {\r\n type: typeof FETCH_SETTING_REQUEST;\r\n activeReport: ReportType\r\n}\r\n\r\n// Define action interfaces\r\ninterface FetchSettingsSuccessAction {\r\n type: typeof FETCH_SETTING_SUCCESS;\r\n payload: {\r\n data: any\r\n activeReport: ReportType\r\n }\r\n}\r\n\r\ninterface FetchSettingsFailureAction {\r\n type: typeof FETCH_SETTING_FAILURE;\r\n error: string;\r\n}\r\ninterface UpdateSettingsAction {\r\n type: typeof UPDATE_SETTINGS;\r\n payload : {\r\n settings : AuditSetting[];\r\n },\r\n}\r\n\r\ninterface ChangeGearAction {\r\n type: typeof CHANGE_GEAR;\r\n payload : {\r\n settings : AuditSetting[];\r\n mode: PerformanceGear\r\n },\r\n}\r\n\r\ninterface ChangeReportTypeAction {\r\n type: typeof CHANGE_REPORT_TYPE;\r\n reportType: ReportType\r\n}\r\n\r\ninterface UpdateFileActionAction {\r\n type: typeof UPDATE_FILE_ACTION;\r\n payload : {\r\n audit: Audit\r\n file: string\r\n value: string\r\n prev: string\r\n }\r\n}\r\n\r\n\r\n// Define the combined action type\r\nexport type AppAction = FetchDataRequestAction | FetchDataSuccessAction | FetchDataFailureAction |\r\n FetchSettingsRequestAction | FetchSettingsSuccessAction | FetchSettingsFailureAction | ChangeGearAction|\r\n UpdateSettingsAction | ChangeReportTypeAction | UpdateFileActionAction | GetCSSStatusSuccess | UpdateTestMode;\r\n\r\n","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\n\n/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nfunction formatProdErrorMessage(code) {\n return \"Minified Redux error #\" + code + \"; visit https://redux.js.org/Errors?code=\" + code + \" for the full message or \" + 'use the non-minified dev environment for full errors. ';\n}\n\n// Inlined version of the `symbol-observable` polyfill\nvar $$observable = (function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n})();\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\nfunction miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}\n\nfunction ctorName(val) {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\n\nfunction isError(val) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n}\n\nfunction isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n}\n\nfunction kindOf(val) {\n var typeOfVal = typeof val;\n\n if (process.env.NODE_ENV !== 'production') {\n typeOfVal = miniKindOf(val);\n }\n\n return typeOfVal;\n}\n\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"Expected the enhancer to be a function. Instead, received: '\" + kindOf(enhancer) + \"'\");\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"Expected the root reducer to be a function. Instead, received: '\" + kindOf(reducer) + \"'\");\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"Expected the listener to be a function. Instead, received: '\" + kindOf(listener) + \"'\");\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"Actions must be plain objects. Instead, the actual type was: '\" + kindOf(action) + \"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.\");\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"Expected the nextReducer to be a function. Instead, received: '\" + kindOf(nextReducer));\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"Expected the observer to be an object. Instead, received: '\" + kindOf(observer) + \"'\");\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nvar legacy_createStore = createStore;\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + kindOf(inputState) + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle '\" + ActionTypes.INIT + \"' or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"When called with an action of type \" + (actionType ? \"\\\"\" + String(actionType) + \"\\\"\" : '(unknown type)') + \", the slice reducer for key \\\"\" + _key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\");\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"bindActionCreators expected an object or a function, but instead received: '\" + kindOf(actionCreators) + \"'. \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread(_objectSpread({}, store), {}, {\n dispatch: _dispatch\n });\n };\n };\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore, legacy_createStore };\n","import {\r\n AppAction,\r\n AppState,\r\n CHANGE_GEAR,\r\n CHANGE_REPORT_TYPE,\r\n FETCH_REPORT_FAILURE,\r\n FETCH_REPORT_REQUEST,\r\n FETCH_REPORT_SUCCESS,\r\n FETCH_SETTING_FAILURE,\r\n FETCH_SETTING_REQUEST,\r\n FETCH_SETTING_SUCCESS,\r\n GET_CSS_STATUS_SUCCESS,\r\n UPDATE_FILE_ACTION,\r\n UPDATE_SETTINGS,\r\n UPDATE_TEST_MODE\r\n} from \"./appTypes\";\r\n\r\nconst blankReport = {\r\n original: null,\r\n changes: {\r\n files: []\r\n },\r\n data: null,\r\n error: null,\r\n loading: false,\r\n settings: [],\r\n originalSettings: [],\r\n revisions: [],\r\n state: {}\r\n}\r\n\r\nconst initialState: AppState = {\r\n activeReport: 'desktop',\r\n cssStatus: null,\r\n testMode: null,\r\n report: {\r\n mobile: blankReport,\r\n desktop: blankReport,\r\n },\r\n settings: {\r\n performance: {\r\n mobile: {\r\n original: [],\r\n state: [],\r\n error: null,\r\n loading: false,\r\n },\r\n desktop: {\r\n original: [],\r\n state: [],\r\n error: null,\r\n loading: false,\r\n }\r\n },\r\n general: {\r\n test_mode: true,\r\n performance_gear: 'accelerate'\r\n },\r\n actions: []\r\n }\r\n};\r\n\r\nconst appReducer = (state = initialState, action: AppAction): AppState => {\r\n\r\n switch (action.type) {\r\n case GET_CSS_STATUS_SUCCESS:\r\n return {\r\n ...state,\r\n cssStatus: action.payload\r\n };\r\n case UPDATE_TEST_MODE:\r\n return {\r\n ...state,\r\n testMode: action.payload,\r\n settings: {\r\n ...state.settings,\r\n general: {\r\n ...state.settings.general,\r\n test_mode : action.payload.status \r\n }\r\n }\r\n };\r\n case FETCH_REPORT_REQUEST:\r\n return {\r\n ...state,\r\n report: {\r\n ...state.report,\r\n [state.activeReport] : {\r\n ...state.report[state.activeReport],\r\n loading: true,\r\n error: null\r\n }\r\n }\r\n };\r\n\r\n case FETCH_REPORT_SUCCESS:\r\n return {\r\n ...state,\r\n report: {\r\n ...state.report,\r\n [action.payload.activeReport] : {\r\n ...state.report[action.payload.activeReport],\r\n // original: JSON.parse(JSON.stringify(action.payload.data.data)),\r\n data: action.payload.data.data,\r\n error: null,\r\n loading: false,\r\n // settings: action.payload.data.settings,\r\n // originalSettings: JSON.parse(JSON.stringify(action.payload.data.settings)),\r\n revisions: action.payload.data.revisions,\r\n }\r\n }\r\n };\r\n case FETCH_REPORT_FAILURE:\r\n return {\r\n ...state,\r\n report: {\r\n ...state.report,\r\n [state.activeReport] : {\r\n error: action.error,\r\n loading: false\r\n }\r\n }\r\n };\r\n case FETCH_SETTING_REQUEST:\r\n return {\r\n ...state,\r\n settings: {\r\n ...state.settings,\r\n performance: {\r\n ...state.settings.performance,\r\n [state.activeReport] : {\r\n ...state.settings.performance[state.activeReport],\r\n loading: true,\r\n error: null\r\n }\r\n }\r\n },\r\n };\r\n case FETCH_SETTING_SUCCESS:\r\n return {\r\n ...state,\r\n settings: {\r\n ...state.settings,\r\n general: action.payload.data.general,\r\n actions: action.payload.data.actions,\r\n performance: {\r\n ...state.settings.performance,\r\n [action.payload.activeReport] : {\r\n ...state.settings.performance[action.payload.activeReport],\r\n original: JSON.parse(JSON.stringify(action.payload.data.data)),\r\n state: action.payload.data.data,\r\n error: null,\r\n loading: false,\r\n }\r\n }\r\n }\r\n };\r\n case FETCH_SETTING_FAILURE:\r\n return {\r\n ...state,\r\n settings: {\r\n ...state.settings,\r\n performance: {\r\n ...state.settings.performance,\r\n [state.activeReport] : {\r\n error: action.error,\r\n loading: false\r\n }\r\n }\r\n }\r\n };\r\n case UPDATE_SETTINGS:\r\n return {\r\n ...state,\r\n settings: {\r\n ...state.settings,\r\n performance: {\r\n ...state.settings.performance,\r\n [state.activeReport] : {\r\n ...state.settings.performance[state.activeReport],\r\n state: action.payload.settings,\r\n },\r\n }\r\n }\r\n };\r\n case CHANGE_GEAR:\r\n return {\r\n ...state,\r\n settings: {\r\n ...state.settings,\r\n general: {\r\n ...state.settings.general,\r\n performance_gear: action.payload.mode\r\n },\r\n performance: {\r\n ...state.settings.performance,\r\n [state.activeReport] : {\r\n ...state.settings.performance[state.activeReport],\r\n state: action.payload.settings,\r\n }\r\n }\r\n }\r\n };\r\n case CHANGE_REPORT_TYPE:\r\n return {\r\n ...state,\r\n activeReport: action.reportType\r\n };\r\n case UPDATE_FILE_ACTION:\r\n\r\n const { payload } = action;\r\n const activeReport = state.report[state.activeReport];\r\n const changes = activeReport.changes.files.filter(f => f.file === payload.file)\r\n\r\n if (changes.length == 0) {\r\n activeReport.changes.files.push({\r\n ...payload,\r\n value: payload.prev\r\n });\r\n }\r\n\r\n activeReport.changes.files.push(payload);\r\n\r\n if (activeReport.data) {\r\n activeReport.data.audits = activeReport.data.audits.map((audit) => {\r\n\r\n\r\n if (audit.files && audit.files.items && (audit.files.type === 'table' || audit.files.type === 'opportunity')) {\r\n const updateActionValue = (item: AuditTableResource) => {\r\n if (item.url && typeof item.url === 'object' && item.action && item.url.url === payload.file) {\r\n\r\n // reporting changes\r\n // if (!changes) {\r\n // activeReport.changes.files.push({\r\n // audit: audit.id,\r\n // file: item.url.url,\r\n // value: item.action.value\r\n // });\r\n // } else{\r\n // activeReport.changes.files.push(action.payload)\r\n // }\r\n\r\n\r\n return {\r\n ...item,\r\n action: {\r\n ...item.action,\r\n value: payload.value,\r\n },\r\n };\r\n }\r\n return item;\r\n };\r\n\r\n audit.files.items = audit.files.items.map(updateActionValue);\r\n\r\n if (audit.files.grouped_items) {\r\n audit.files.grouped_items = audit.files.grouped_items.map((group) => ({\r\n ...group,\r\n items: group.items.map(updateActionValue),\r\n }));\r\n }\r\n }\r\n\r\n return audit;\r\n });\r\n }\r\n\r\n return {\r\n ...state,\r\n [state.activeReport]: {\r\n ...activeReport,\r\n },\r\n };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default appReducer;\r\n\r\n","import {CommonAction, CommonState, SET_ROOT_STATE, SET_STATE} from \"./commonTypes\";\r\n\r\nconst initialState: CommonState = {\r\n optimizerRoot: null,\r\n mode: \"normal\",\r\n isTourOpen: false,\r\n mobile: {\r\n activeTab: 'configurations',\r\n openAudits: [],\r\n hoveredMetric: null,\r\n activeMetric: null,\r\n settingsMode: null\r\n },\r\n desktop: {\r\n activeTab: 'configurations',\r\n openAudits: [],\r\n hoveredMetric: null,\r\n activeMetric: null,\r\n settingsMode: null\r\n }\r\n};\r\n\r\nconst commonReducer = (state = initialState, action: CommonAction): CommonState => {\r\n\r\n switch (action.type) {\r\n case SET_STATE:\r\n return {\r\n ...state,\r\n [action.payload.activeReport] : {\r\n ...state[action.payload.activeReport],\r\n ... {\r\n [action.payload.key] : action.payload.value\r\n }\r\n }\r\n };\r\n case SET_ROOT_STATE:\r\n return {\r\n ...state,\r\n ... {\r\n [action.payload.key] : action.payload.value\r\n }\r\n };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nexport default commonReducer;\r\n\r\n","// reducers.ts\r\nimport { combineReducers } from 'redux';\r\nimport appReducer from '../app/appReducer';\r\nimport {RootState} from \"../app/appTypes\";\r\nimport commonReducer from \"../common/commonReducer\";\r\n\r\n\r\n\r\nconst rootReducer = combineReducers({\r\n app: appReducer,\r\n common: commonReducer\r\n});\r\n\r\nexport default rootReducer;\r\n","// src/utils/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\n\n// src/utils/symbol-observable.ts\nvar $$observable = /* @__PURE__ */ (() => typeof Symbol === \"function\" && Symbol.observable || \"@@observable\")();\nvar symbol_observable_default = $$observable;\n\n// src/utils/actionTypes.ts\nvar randomString = () => Math.random().toString(36).substring(7).split(\"\").join(\".\");\nvar ActionTypes = {\n INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,\n REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nvar actionTypes_default = ActionTypes;\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null)\n return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}\n\n// src/utils/kindOf.ts\nfunction miniKindOf(val) {\n if (val === void 0)\n return \"undefined\";\n if (val === null)\n return \"null\";\n const type = typeof val;\n switch (type) {\n case \"boolean\":\n case \"string\":\n case \"number\":\n case \"symbol\":\n case \"function\": {\n return type;\n }\n }\n if (Array.isArray(val))\n return \"array\";\n if (isDate(val))\n return \"date\";\n if (isError(val))\n return \"error\";\n const constructorName = ctorName(val);\n switch (constructorName) {\n case \"Symbol\":\n case \"Promise\":\n case \"WeakMap\":\n case \"WeakSet\":\n case \"Map\":\n case \"Set\":\n return constructorName;\n }\n return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\\s/g, \"\");\n}\nfunction ctorName(val) {\n return typeof val.constructor === \"function\" ? val.constructor.name : null;\n}\nfunction isError(val) {\n return val instanceof Error || typeof val.message === \"string\" && val.constructor && typeof val.constructor.stackTraceLimit === \"number\";\n}\nfunction isDate(val) {\n if (val instanceof Date)\n return true;\n return typeof val.toDateString === \"function\" && typeof val.getDate === \"function\" && typeof val.setDate === \"function\";\n}\nfunction kindOf(val) {\n let typeOfVal = typeof val;\n if (process.env.NODE_ENV !== \"production\") {\n typeOfVal = miniKindOf(val);\n }\n return typeOfVal;\n}\n\n// src/createStore.ts\nfunction createStore(reducer, preloadedState, enhancer) {\n if (typeof reducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"function\" || typeof enhancer === \"function\" && typeof arguments[3] === \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.\");\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"undefined\") {\n enhancer = preloadedState;\n preloadedState = void 0;\n }\n if (typeof enhancer !== \"undefined\") {\n if (typeof enhancer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, preloadedState);\n }\n let currentReducer = reducer;\n let currentState = preloadedState;\n let currentListeners = /* @__PURE__ */ new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = /* @__PURE__ */ new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.\");\n }\n return currentState;\n }\n function subscribe(listener) {\n if (typeof listener !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);\n }\n if (typeof action.type === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : \"Reducers may not dispatch actions.\");\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach((listener) => {\n listener();\n });\n return action;\n }\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = nextReducer;\n dispatch({\n type: actionTypes_default.REPLACE\n });\n }\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer) {\n if (typeof observer !== \"object\" || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = observer;\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [symbol_observable_default]() {\n return this;\n }\n };\n }\n dispatch({\n type: actionTypes_default.INIT\n });\n const store = {\n dispatch,\n subscribe,\n getState,\n replaceReducer,\n [symbol_observable_default]: observable\n };\n return store;\n}\nfunction legacy_createStore(reducer, preloadedState, enhancer) {\n return createStore(reducer, preloadedState, enhancer);\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/combineReducers.ts\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n const reducerKeys = Object.keys(reducers);\n const argumentName = action && action.type === actionTypes_default.INIT ? \"preloadedState argument passed to createStore\" : \"previous state received by the reducer\";\n if (reducerKeys.length === 0) {\n return \"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.\";\n }\n if (!isPlainObject(inputState)) {\n return `The ${argumentName} has unexpected type of \"${kindOf(inputState)}\". Expected argument to be an object with the following keys: \"${reducerKeys.join('\", \"')}\"`;\n }\n const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);\n unexpectedKeys.forEach((key) => {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === actionTypes_default.REPLACE)\n return;\n if (unexpectedKeys.length > 0) {\n return `Unexpected ${unexpectedKeys.length > 1 ? \"keys\" : \"key\"} \"${unexpectedKeys.join('\", \"')}\" found in ${argumentName}. Expected to find one of the known reducer keys instead: \"${reducerKeys.join('\", \"')}\". Unexpected keys will be ignored.`;\n }\n}\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach((key) => {\n const reducer = reducers[key];\n const initialState = reducer(void 0, {\n type: actionTypes_default.INIT\n });\n if (typeof initialState === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : `The slice reducer for key \"${key}\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);\n }\n if (typeof reducer(void 0, {\n type: actionTypes_default.PROBE_UNKNOWN_ACTION()\n }) === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : `The slice reducer for key \"${key}\" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in \"redux/*\" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);\n }\n });\n}\nfunction combineReducers(reducers) {\n const reducerKeys = Object.keys(reducers);\n const finalReducers = {};\n for (let i = 0; i < reducerKeys.length; i++) {\n const key = reducerKeys[i];\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof reducers[key] === \"undefined\") {\n warning(`No reducer provided for key \"${key}\"`);\n }\n }\n if (typeof reducers[key] === \"function\") {\n finalReducers[key] = reducers[key];\n }\n }\n const finalReducerKeys = Object.keys(finalReducers);\n let unexpectedKeyCache;\n if (process.env.NODE_ENV !== \"production\") {\n unexpectedKeyCache = {};\n }\n let shapeAssertionError;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n return function combination(state = {}, action) {\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n if (process.env.NODE_ENV !== \"production\") {\n const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n let hasChanged = false;\n const nextState = {};\n for (let i = 0; i < finalReducerKeys.length; i++) {\n const key = finalReducerKeys[i];\n const reducer = finalReducers[key];\n const previousStateForKey = state[key];\n const nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === \"undefined\") {\n const actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `\"${String(actionType)}\"` : \"(unknown type)\"}, the slice reducer for key \"${key}\" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);\n }\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\n// src/bindActionCreators.ts\nfunction bindActionCreator(actionCreator, dispatch) {\n return function(...args) {\n return dispatch(actionCreator.apply(this, args));\n };\n}\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === \"function\") {\n return bindActionCreator(actionCreators, dispatch);\n }\n if (typeof actionCreators !== \"object\" || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : `bindActionCreators expected an object or a function, but instead received: '${kindOf(actionCreators)}'. Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?`);\n }\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n// src/compose.ts\nfunction compose(...funcs) {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n if (funcs.length === 1) {\n return funcs[0];\n }\n return funcs.reduce((a, b) => (...args) => a(b(...args)));\n}\n\n// src/applyMiddleware.ts\nfunction applyMiddleware(...middlewares) {\n return (createStore2) => (reducer, preloadedState) => {\n const store = createStore2(reducer, preloadedState);\n let dispatch = () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.\");\n };\n const middlewareAPI = {\n getState: store.getState,\n dispatch: (action, ...args) => dispatch(action, ...args)\n };\n const chain = middlewares.map((middleware) => middleware(middlewareAPI));\n dispatch = compose(...chain)(store.dispatch);\n return {\n ...store,\n dispatch\n };\n };\n}\n\n// src/utils/isAction.ts\nfunction isAction(action) {\n return isPlainObject(action) && \"type\" in action && typeof action.type === \"string\";\n}\nexport {\n actionTypes_default as __DO_NOT_USE__ActionTypes,\n applyMiddleware,\n bindActionCreators,\n combineReducers,\n compose,\n createStore,\n isAction,\n isPlainObject,\n legacy_createStore\n};\n//# sourceMappingURL=redux.mjs.map","// src/devModeChecks/identityFunctionCheck.ts\nvar runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {\n if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {\n let isInputSameAsOutput = false;\n try {\n const emptyObject = {};\n if (resultFunc(emptyObject) === emptyObject)\n isInputSameAsOutput = true;\n } catch {\n }\n if (isInputSameAsOutput) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"The result function returned its own inputs without modification. e.g\\n`createSelector([state => state.todos], todos => todos)`\\nThis could lead to inefficient memoization and unnecessary re-renders.\\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.\",\n { stack }\n );\n }\n }\n};\n\n// src/devModeChecks/inputStabilityCheck.ts\nvar runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {\n const { memoize, memoizeOptions } = options;\n const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;\n const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions);\n const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);\n if (!areInputSelectorResultsEqual) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"An input selector returned a different result when passed same arguments.\\nThis means your output selector will likely run more frequently than intended.\\nAvoid returning a new reference inside your input selector, e.g.\\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`\",\n {\n arguments: inputSelectorArgs,\n firstInputs: inputSelectorResults,\n secondInputs: inputSelectorResultsCopy,\n stack\n }\n );\n }\n};\n\n// src/devModeChecks/setGlobalDevModeChecks.ts\nvar globalDevModeChecks = {\n inputStabilityCheck: \"once\",\n identityFunctionCheck: \"once\"\n};\nvar setGlobalDevModeChecks = (devModeChecks) => {\n Object.assign(globalDevModeChecks, devModeChecks);\n};\n\n// src/utils.ts\nvar NOT_FOUND = /* @__PURE__ */ Symbol(\"NOT_FOUND\");\nfunction assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {\n if (typeof func !== \"function\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsObject(object, errorMessage = `expected an object, instead received ${typeof object}`) {\n if (typeof object !== \"object\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {\n if (!array.every((item) => typeof item === \"function\")) {\n const itemTypes = array.map(\n (item) => typeof item === \"function\" ? `function ${item.name || \"unnamed\"}()` : typeof item\n ).join(\", \");\n throw new TypeError(`${errorMessage}[${itemTypes}]`);\n }\n}\nvar ensureIsArray = (item) => {\n return Array.isArray(item) ? item : [item];\n};\nfunction getDependencies(createSelectorArgs) {\n const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;\n assertIsArrayOfFunctions(\n dependencies,\n `createSelector expects all input-selectors to be functions, but received the following types: `\n );\n return dependencies;\n}\nfunction collectInputSelectorResults(dependencies, inputSelectorArgs) {\n const inputSelectorResults = [];\n const { length } = dependencies;\n for (let i = 0; i < length; i++) {\n inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));\n }\n return inputSelectorResults;\n}\nvar getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => {\n const { identityFunctionCheck, inputStabilityCheck } = {\n ...globalDevModeChecks,\n ...devModeChecks\n };\n return {\n identityFunctionCheck: {\n shouldRun: identityFunctionCheck === \"always\" || identityFunctionCheck === \"once\" && firstRun,\n run: runIdentityFunctionCheck\n },\n inputStabilityCheck: {\n shouldRun: inputStabilityCheck === \"always\" || inputStabilityCheck === \"once\" && firstRun,\n run: runInputStabilityCheck\n }\n };\n};\n\n// src/autotrackMemoize/autotracking.ts\nvar $REVISION = 0;\nvar CURRENT_TRACKER = null;\nvar Cell = class {\n revision = $REVISION;\n _value;\n _lastValue;\n _isEqual = tripleEq;\n constructor(initialValue, isEqual = tripleEq) {\n this._value = this._lastValue = initialValue;\n this._isEqual = isEqual;\n }\n // Whenever a storage value is read, it'll add itself to the current tracker if\n // one exists, entangling its state with that cache.\n get value() {\n CURRENT_TRACKER?.add(this);\n return this._value;\n }\n // Whenever a storage value is updated, we bump the global revision clock,\n // assign the revision for this storage to the new value, _and_ we schedule a\n // rerender. This is important, and it's what makes autotracking _pull_\n // based. We don't actively tell the caches which depend on the storage that\n // anything has happened. Instead, we recompute the caches when needed.\n set value(newValue) {\n if (this.value === newValue)\n return;\n this._value = newValue;\n this.revision = ++$REVISION;\n }\n};\nfunction tripleEq(a, b) {\n return a === b;\n}\nvar TrackingCache = class {\n _cachedValue;\n _cachedRevision = -1;\n _deps = [];\n hits = 0;\n fn;\n constructor(fn) {\n this.fn = fn;\n }\n clear() {\n this._cachedValue = void 0;\n this._cachedRevision = -1;\n this._deps = [];\n this.hits = 0;\n }\n get value() {\n if (this.revision > this._cachedRevision) {\n const { fn } = this;\n const currentTracker = /* @__PURE__ */ new Set();\n const prevTracker = CURRENT_TRACKER;\n CURRENT_TRACKER = currentTracker;\n this._cachedValue = fn();\n CURRENT_TRACKER = prevTracker;\n this.hits++;\n this._deps = Array.from(currentTracker);\n this._cachedRevision = this.revision;\n }\n CURRENT_TRACKER?.add(this);\n return this._cachedValue;\n }\n get revision() {\n return Math.max(...this._deps.map((d) => d.revision), 0);\n }\n};\nfunction getValue(cell) {\n if (!(cell instanceof Cell)) {\n console.warn(\"Not a valid cell! \", cell);\n }\n return cell.value;\n}\nfunction setValue(storage, value) {\n if (!(storage instanceof Cell)) {\n throw new TypeError(\n \"setValue must be passed a tracked store created with `createStorage`.\"\n );\n }\n storage.value = storage._lastValue = value;\n}\nfunction createCell(initialValue, isEqual = tripleEq) {\n return new Cell(initialValue, isEqual);\n}\nfunction createCache(fn) {\n assertIsFunction(\n fn,\n \"the first parameter to `createCache` must be a function\"\n );\n return new TrackingCache(fn);\n}\n\n// src/autotrackMemoize/tracking.ts\nvar neverEq = (a, b) => false;\nfunction createTag() {\n return createCell(null, neverEq);\n}\nfunction dirtyTag(tag, value) {\n setValue(tag, value);\n}\nvar consumeCollection = (node) => {\n let tag = node.collectionTag;\n if (tag === null) {\n tag = node.collectionTag = createTag();\n }\n getValue(tag);\n};\nvar dirtyCollection = (node) => {\n const tag = node.collectionTag;\n if (tag !== null) {\n dirtyTag(tag, null);\n }\n};\n\n// src/autotrackMemoize/proxy.ts\nvar REDUX_PROXY_LABEL = Symbol();\nvar nextId = 0;\nvar proto = Object.getPrototypeOf({});\nvar ObjectTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy(this, objectProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar objectProxyHandler = {\n get(node, key) {\n function calculateResult() {\n const { value } = node;\n const childValue = Reflect.get(value, key);\n if (typeof key === \"symbol\") {\n return childValue;\n }\n if (key in proto) {\n return childValue;\n }\n if (typeof childValue === \"object\" && childValue !== null) {\n let childNode = node.children[key];\n if (childNode === void 0) {\n childNode = node.children[key] = createNode(childValue);\n }\n if (childNode.tag) {\n getValue(childNode.tag);\n }\n return childNode.proxy;\n } else {\n let tag = node.tags[key];\n if (tag === void 0) {\n tag = node.tags[key] = createTag();\n tag.value = childValue;\n }\n getValue(tag);\n return childValue;\n }\n }\n const res = calculateResult();\n return res;\n },\n ownKeys(node) {\n consumeCollection(node);\n return Reflect.ownKeys(node.value);\n },\n getOwnPropertyDescriptor(node, prop) {\n return Reflect.getOwnPropertyDescriptor(node.value, prop);\n },\n has(node, prop) {\n return Reflect.has(node.value, prop);\n }\n};\nvar ArrayTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy([this], arrayProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar arrayProxyHandler = {\n get([node], key) {\n if (key === \"length\") {\n consumeCollection(node);\n }\n return objectProxyHandler.get(node, key);\n },\n ownKeys([node]) {\n return objectProxyHandler.ownKeys(node);\n },\n getOwnPropertyDescriptor([node], prop) {\n return objectProxyHandler.getOwnPropertyDescriptor(node, prop);\n },\n has([node], prop) {\n return objectProxyHandler.has(node, prop);\n }\n};\nfunction createNode(value) {\n if (Array.isArray(value)) {\n return new ArrayTreeNode(value);\n }\n return new ObjectTreeNode(value);\n}\nfunction updateNode(node, newValue) {\n const { value, tags, children } = node;\n node.value = newValue;\n if (Array.isArray(value) && Array.isArray(newValue) && value.length !== newValue.length) {\n dirtyCollection(node);\n } else {\n if (value !== newValue) {\n let oldKeysSize = 0;\n let newKeysSize = 0;\n let anyKeysAdded = false;\n for (const _key in value) {\n oldKeysSize++;\n }\n for (const key in newValue) {\n newKeysSize++;\n if (!(key in value)) {\n anyKeysAdded = true;\n break;\n }\n }\n const isDifferent = anyKeysAdded || oldKeysSize !== newKeysSize;\n if (isDifferent) {\n dirtyCollection(node);\n }\n }\n }\n for (const key in tags) {\n const childValue = value[key];\n const newChildValue = newValue[key];\n if (childValue !== newChildValue) {\n dirtyCollection(node);\n dirtyTag(tags[key], newChildValue);\n }\n if (typeof newChildValue === \"object\" && newChildValue !== null) {\n delete tags[key];\n }\n }\n for (const key in children) {\n const childNode = children[key];\n const newChildValue = newValue[key];\n const childValue = childNode.value;\n if (childValue === newChildValue) {\n continue;\n } else if (typeof newChildValue === \"object\" && newChildValue !== null) {\n updateNode(childNode, newChildValue);\n } else {\n deleteNode(childNode);\n delete children[key];\n }\n }\n}\nfunction deleteNode(node) {\n if (node.tag) {\n dirtyTag(node.tag, null);\n }\n dirtyCollection(node);\n for (const key in node.tags) {\n dirtyTag(node.tags[key], null);\n }\n for (const key in node.children) {\n deleteNode(node.children[key]);\n }\n}\n\n// src/lruMemoize.ts\nfunction createSingletonCache(equals) {\n let entry;\n return {\n get(key) {\n if (entry && equals(entry.key, key)) {\n return entry.value;\n }\n return NOT_FOUND;\n },\n put(key, value) {\n entry = { key, value };\n },\n getEntries() {\n return entry ? [entry] : [];\n },\n clear() {\n entry = void 0;\n }\n };\n}\nfunction createLruCache(maxSize, equals) {\n let entries = [];\n function get(key) {\n const cacheIndex = entries.findIndex((entry) => equals(key, entry.key));\n if (cacheIndex > -1) {\n const entry = entries[cacheIndex];\n if (cacheIndex > 0) {\n entries.splice(cacheIndex, 1);\n entries.unshift(entry);\n }\n return entry.value;\n }\n return NOT_FOUND;\n }\n function put(key, value) {\n if (get(key) === NOT_FOUND) {\n entries.unshift({ key, value });\n if (entries.length > maxSize) {\n entries.pop();\n }\n }\n }\n function getEntries() {\n return entries;\n }\n function clear() {\n entries = [];\n }\n return { get, put, getEntries, clear };\n}\nvar referenceEqualityCheck = (a, b) => a === b;\nfunction createCacheKeyComparator(equalityCheck) {\n return function areArgumentsShallowlyEqual(prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n const { length } = prev;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n return true;\n };\n}\nfunction lruMemoize(func, equalityCheckOrOptions) {\n const providedOptions = typeof equalityCheckOrOptions === \"object\" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions };\n const {\n equalityCheck = referenceEqualityCheck,\n maxSize = 1,\n resultEqualityCheck\n } = providedOptions;\n const comparator = createCacheKeyComparator(equalityCheck);\n let resultsCount = 0;\n const cache = maxSize <= 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);\n function memoized() {\n let value = cache.get(arguments);\n if (value === NOT_FOUND) {\n value = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const entries = cache.getEntries();\n const matchingEntry = entries.find(\n (entry) => resultEqualityCheck(entry.value, value)\n );\n if (matchingEntry) {\n value = matchingEntry.value;\n resultsCount !== 0 && resultsCount--;\n }\n }\n cache.put(arguments, value);\n }\n return value;\n }\n memoized.clearCache = () => {\n cache.clear();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/autotrackMemoize/autotrackMemoize.ts\nfunction autotrackMemoize(func) {\n const node = createNode(\n []\n );\n let lastArgs = null;\n const shallowEqual = createCacheKeyComparator(referenceEqualityCheck);\n const cache = createCache(() => {\n const res = func.apply(null, node.proxy);\n return res;\n });\n function memoized() {\n if (!shallowEqual(lastArgs, arguments)) {\n updateNode(node, arguments);\n lastArgs = arguments;\n }\n return cache.value;\n }\n memoized.clearCache = () => {\n return cache.clear();\n };\n return memoized;\n}\n\n// src/weakMapMemoize.ts\nvar StrongRef = class {\n constructor(value) {\n this.value = value;\n }\n deref() {\n return this.value;\n }\n};\nvar Ref = typeof WeakRef !== \"undefined\" ? WeakRef : StrongRef;\nvar UNTERMINATED = 0;\nvar TERMINATED = 1;\nfunction createCacheNode() {\n return {\n s: UNTERMINATED,\n v: void 0,\n o: null,\n p: null\n };\n}\nfunction weakMapMemoize(func, options = {}) {\n let fnNode = createCacheNode();\n const { resultEqualityCheck } = options;\n let lastResult;\n let resultsCount = 0;\n function memoized() {\n let cacheNode = fnNode;\n const { length } = arguments;\n for (let i = 0, l = length; i < l; i++) {\n const arg = arguments[i];\n if (typeof arg === \"function\" || typeof arg === \"object\" && arg !== null) {\n let objectCache = cacheNode.o;\n if (objectCache === null) {\n cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap();\n }\n const objectNode = objectCache.get(arg);\n if (objectNode === void 0) {\n cacheNode = createCacheNode();\n objectCache.set(arg, cacheNode);\n } else {\n cacheNode = objectNode;\n }\n } else {\n let primitiveCache = cacheNode.p;\n if (primitiveCache === null) {\n cacheNode.p = primitiveCache = /* @__PURE__ */ new Map();\n }\n const primitiveNode = primitiveCache.get(arg);\n if (primitiveNode === void 0) {\n cacheNode = createCacheNode();\n primitiveCache.set(arg, cacheNode);\n } else {\n cacheNode = primitiveNode;\n }\n }\n }\n const terminatedNode = cacheNode;\n let result;\n if (cacheNode.s === TERMINATED) {\n result = cacheNode.v;\n } else {\n result = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const lastResultValue = lastResult?.deref?.() ?? lastResult;\n if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {\n result = lastResultValue;\n resultsCount !== 0 && resultsCount--;\n }\n const needsWeakRef = typeof result === \"object\" && result !== null || typeof result === \"function\";\n lastResult = needsWeakRef ? new Ref(result) : result;\n }\n }\n terminatedNode.s = TERMINATED;\n terminatedNode.v = result;\n return result;\n }\n memoized.clearCache = () => {\n fnNode = createCacheNode();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/createSelectorCreator.ts\nfunction createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {\n const createSelectorCreatorOptions = typeof memoizeOrOptions === \"function\" ? {\n memoize: memoizeOrOptions,\n memoizeOptions: memoizeOptionsFromArgs\n } : memoizeOrOptions;\n const createSelector2 = (...createSelectorArgs) => {\n let recomputations = 0;\n let dependencyRecomputations = 0;\n let lastResult;\n let directlyPassedOptions = {};\n let resultFunc = createSelectorArgs.pop();\n if (typeof resultFunc === \"object\") {\n directlyPassedOptions = resultFunc;\n resultFunc = createSelectorArgs.pop();\n }\n assertIsFunction(\n resultFunc,\n `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`\n );\n const combinedOptions = {\n ...createSelectorCreatorOptions,\n ...directlyPassedOptions\n };\n const {\n memoize,\n memoizeOptions = [],\n argsMemoize = weakMapMemoize,\n argsMemoizeOptions = [],\n devModeChecks = {}\n } = combinedOptions;\n const finalMemoizeOptions = ensureIsArray(memoizeOptions);\n const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions);\n const dependencies = getDependencies(createSelectorArgs);\n const memoizedResultFunc = memoize(function recomputationWrapper() {\n recomputations++;\n return resultFunc.apply(\n null,\n arguments\n );\n }, ...finalMemoizeOptions);\n let firstRun = true;\n const selector = argsMemoize(function dependenciesChecker() {\n dependencyRecomputations++;\n const inputSelectorResults = collectInputSelectorResults(\n dependencies,\n arguments\n );\n lastResult = memoizedResultFunc.apply(null, inputSelectorResults);\n if (process.env.NODE_ENV !== \"production\") {\n const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks);\n if (identityFunctionCheck.shouldRun) {\n identityFunctionCheck.run(\n resultFunc,\n inputSelectorResults,\n lastResult\n );\n }\n if (inputStabilityCheck.shouldRun) {\n const inputSelectorResultsCopy = collectInputSelectorResults(\n dependencies,\n arguments\n );\n inputStabilityCheck.run(\n { inputSelectorResults, inputSelectorResultsCopy },\n { memoize, memoizeOptions: finalMemoizeOptions },\n arguments\n );\n }\n if (firstRun)\n firstRun = false;\n }\n return lastResult;\n }, ...finalArgsMemoizeOptions);\n return Object.assign(selector, {\n resultFunc,\n memoizedResultFunc,\n dependencies,\n dependencyRecomputations: () => dependencyRecomputations,\n resetDependencyRecomputations: () => {\n dependencyRecomputations = 0;\n },\n lastResult: () => lastResult,\n recomputations: () => recomputations,\n resetRecomputations: () => {\n recomputations = 0;\n },\n memoize,\n argsMemoize\n });\n };\n Object.assign(createSelector2, {\n withTypes: () => createSelector2\n });\n return createSelector2;\n}\nvar createSelector = /* @__PURE__ */ createSelectorCreator(weakMapMemoize);\n\n// src/createStructuredSelector.ts\nvar createStructuredSelector = Object.assign(\n (inputSelectorsObject, selectorCreator = createSelector) => {\n assertIsObject(\n inputSelectorsObject,\n `createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}`\n );\n const inputSelectorKeys = Object.keys(inputSelectorsObject);\n const dependencies = inputSelectorKeys.map(\n (key) => inputSelectorsObject[key]\n );\n const structuredSelector = selectorCreator(\n dependencies,\n (...inputSelectorResults) => {\n return inputSelectorResults.reduce((composition, value, index) => {\n composition[inputSelectorKeys[index]] = value;\n return composition;\n }, {});\n }\n );\n return structuredSelector;\n },\n { withTypes: () => createStructuredSelector }\n);\nexport {\n createSelector,\n createSelectorCreator,\n createStructuredSelector,\n lruMemoize,\n referenceEqualityCheck,\n setGlobalDevModeChecks,\n autotrackMemoize as unstable_autotrackMemoize,\n weakMapMemoize\n};\n//# sourceMappingURL=reselect.mjs.map","// src/index.ts\nfunction createThunkMiddleware(extraArgument) {\n const middleware = ({ dispatch, getState }) => (next) => (action) => {\n if (typeof action === \"function\") {\n return action(dispatch, getState, extraArgument);\n }\n return next(action);\n };\n return middleware;\n}\nvar thunk = createThunkMiddleware();\nvar withExtraArgument = createThunkMiddleware;\nexport {\n thunk,\n withExtraArgument\n};\n","// src/index.ts\nexport * from \"redux\";\nimport { produce, current as current3, freeze, original as original2, isDraft as isDraft5 } from \"immer\";\nimport { createSelector, createSelectorCreator as createSelectorCreator2, lruMemoize, weakMapMemoize as weakMapMemoize2 } from \"reselect\";\n\n// src/createDraftSafeSelector.ts\nimport { current, isDraft } from \"immer\";\nimport { createSelectorCreator, weakMapMemoize } from \"reselect\";\nvar createDraftSafeSelectorCreator = (...args) => {\n const createSelector2 = createSelectorCreator(...args);\n const createDraftSafeSelector2 = Object.assign((...args2) => {\n const selector = createSelector2(...args2);\n const wrappedSelector = (value, ...rest) => selector(isDraft(value) ? current(value) : value, ...rest);\n Object.assign(wrappedSelector, selector);\n return wrappedSelector;\n }, {\n withTypes: () => createDraftSafeSelector2\n });\n return createDraftSafeSelector2;\n};\nvar createDraftSafeSelector = /* @__PURE__ */ createDraftSafeSelectorCreator(weakMapMemoize);\n\n// src/configureStore.ts\nimport { applyMiddleware, createStore, compose as compose2, combineReducers, isPlainObject as isPlainObject2 } from \"redux\";\n\n// src/devtoolsExtension.ts\nimport { compose } from \"redux\";\nvar composeWithDevTools = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {\n if (arguments.length === 0) return void 0;\n if (typeof arguments[0] === \"object\") return compose;\n return compose.apply(null, arguments);\n};\nvar devToolsEnhancer = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() {\n return function(noop3) {\n return noop3;\n };\n};\n\n// src/getDefaultMiddleware.ts\nimport { thunk as thunkMiddleware, withExtraArgument } from \"redux-thunk\";\n\n// src/createAction.ts\nimport { isAction } from \"redux\";\n\n// src/tsHelpers.ts\nvar hasMatchFunction = (v) => {\n return v && typeof v.match === \"function\";\n};\n\n// src/createAction.ts\nfunction createAction(type, prepareAction) {\n function actionCreator(...args) {\n if (prepareAction) {\n let prepared = prepareAction(...args);\n if (!prepared) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"prepareAction did not return an object\");\n }\n return {\n type,\n payload: prepared.payload,\n ...\"meta\" in prepared && {\n meta: prepared.meta\n },\n ...\"error\" in prepared && {\n error: prepared.error\n }\n };\n }\n return {\n type,\n payload: args[0]\n };\n }\n actionCreator.toString = () => `${type}`;\n actionCreator.type = type;\n actionCreator.match = (action) => isAction(action) && action.type === type;\n return actionCreator;\n}\nfunction isActionCreator(action) {\n return typeof action === \"function\" && \"type\" in action && // hasMatchFunction only wants Matchers but I don't see the point in rewriting it\n hasMatchFunction(action);\n}\nfunction isFSA(action) {\n return isAction(action) && Object.keys(action).every(isValidKey);\n}\nfunction isValidKey(key) {\n return [\"type\", \"payload\", \"error\", \"meta\"].indexOf(key) > -1;\n}\n\n// src/actionCreatorInvariantMiddleware.ts\nfunction getMessage(type) {\n const splitType = type ? `${type}`.split(\"/\") : [];\n const actionName = splitType[splitType.length - 1] || \"actionCreator\";\n return `Detected an action creator with type \"${type || \"unknown\"}\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. \\`dispatch(${actionName}())\\` instead of \\`dispatch(${actionName})\\`. This is necessary even if the action has no payload.`;\n}\nfunction createActionCreatorInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n }\n const {\n isActionCreator: isActionCreator2 = isActionCreator\n } = options;\n return () => (next) => (action) => {\n if (isActionCreator2(action)) {\n console.warn(getMessage(action.type));\n }\n return next(action);\n };\n}\n\n// src/utils.ts\nimport { produce as createNextState, isDraftable } from \"immer\";\nfunction getTimeMeasureUtils(maxDelay, fnName) {\n let elapsed = 0;\n return {\n measureTime(fn) {\n const started = Date.now();\n try {\n return fn();\n } finally {\n const finished = Date.now();\n elapsed += finished - started;\n }\n },\n warnIfExceeded() {\n if (elapsed > maxDelay) {\n console.warn(`${fnName} took ${elapsed}ms, which is more than the warning threshold of ${maxDelay}ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.`);\n }\n }\n };\n}\nfunction find(iterable, comparator) {\n for (const entry of iterable) {\n if (comparator(entry)) {\n return entry;\n }\n }\n return void 0;\n}\nvar Tuple = class _Tuple extends Array {\n constructor(...items) {\n super(...items);\n Object.setPrototypeOf(this, _Tuple.prototype);\n }\n static get [Symbol.species]() {\n return _Tuple;\n }\n concat(...arr) {\n return super.concat.apply(this, arr);\n }\n prepend(...arr) {\n if (arr.length === 1 && Array.isArray(arr[0])) {\n return new _Tuple(...arr[0].concat(this));\n }\n return new _Tuple(...arr.concat(this));\n }\n};\nfunction freezeDraftable(val) {\n return isDraftable(val) ? createNextState(val, () => {\n }) : val;\n}\nfunction emplace(map, key, handler) {\n if (map.has(key)) {\n let value = map.get(key);\n if (handler.update) {\n value = handler.update(value, key, map);\n map.set(key, value);\n }\n return value;\n }\n if (!handler.insert) throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"No insert provided for key not already in map\");\n const inserted = handler.insert(key, map);\n map.set(key, inserted);\n return inserted;\n}\n\n// src/immutableStateInvariantMiddleware.ts\nfunction isImmutableDefault(value) {\n return typeof value !== \"object\" || value == null || Object.isFrozen(value);\n}\nfunction trackForMutations(isImmutable, ignorePaths, obj) {\n const trackedProperties = trackProperties(isImmutable, ignorePaths, obj);\n return {\n detectMutations() {\n return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);\n }\n };\n}\nfunction trackProperties(isImmutable, ignorePaths = [], obj, path = \"\", checkedObjects = /* @__PURE__ */ new Set()) {\n const tracked = {\n value: obj\n };\n if (!isImmutable(obj) && !checkedObjects.has(obj)) {\n checkedObjects.add(obj);\n tracked.children = {};\n for (const key in obj) {\n const childPath = path ? path + \".\" + key : key;\n if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {\n continue;\n }\n tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);\n }\n }\n return tracked;\n}\nfunction detectMutations(isImmutable, ignoredPaths = [], trackedProperty, obj, sameParentRef = false, path = \"\") {\n const prevObj = trackedProperty ? trackedProperty.value : void 0;\n const sameRef = prevObj === obj;\n if (sameParentRef && !sameRef && !Number.isNaN(obj)) {\n return {\n wasMutated: true,\n path\n };\n }\n if (isImmutable(prevObj) || isImmutable(obj)) {\n return {\n wasMutated: false\n };\n }\n const keysToDetect = {};\n for (let key in trackedProperty.children) {\n keysToDetect[key] = true;\n }\n for (let key in obj) {\n keysToDetect[key] = true;\n }\n const hasIgnoredPaths = ignoredPaths.length > 0;\n for (let key in keysToDetect) {\n const nestedPath = path ? path + \".\" + key : key;\n if (hasIgnoredPaths) {\n const hasMatches = ignoredPaths.some((ignored) => {\n if (ignored instanceof RegExp) {\n return ignored.test(nestedPath);\n }\n return nestedPath === ignored;\n });\n if (hasMatches) {\n continue;\n }\n }\n const result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);\n if (result.wasMutated) {\n return result;\n }\n }\n return {\n wasMutated: false\n };\n}\nfunction createImmutableStateInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n } else {\n let stringify2 = function(obj, serializer, indent, decycler) {\n return JSON.stringify(obj, getSerialize2(serializer, decycler), indent);\n }, getSerialize2 = function(serializer, decycler) {\n let stack = [], keys = [];\n if (!decycler) decycler = function(_, value) {\n if (stack[0] === value) return \"[Circular ~]\";\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\";\n };\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this);\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\n if (~stack.indexOf(value)) value = decycler.call(this, key, value);\n } else stack.push(value);\n return serializer == null ? value : serializer.call(this, key, value);\n };\n };\n var stringify = stringify2, getSerialize = getSerialize2;\n let {\n isImmutable = isImmutableDefault,\n ignoredPaths,\n warnAfter = 32\n } = options;\n const track = trackForMutations.bind(null, isImmutable, ignoredPaths);\n return ({\n getState\n }) => {\n let state = getState();\n let tracker = track(state);\n let result;\n return (next) => (action) => {\n const measureUtils = getTimeMeasureUtils(warnAfter, \"ImmutableStateInvariantMiddleware\");\n measureUtils.measureTime(() => {\n state = getState();\n result = tracker.detectMutations();\n tracker = track(state);\n if (result.wasMutated) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(19) : `A state mutation was detected between dispatches, in the path '${result.path || \"\"}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`);\n }\n });\n const dispatchedAction = next(action);\n measureUtils.measureTime(() => {\n state = getState();\n result = tracker.detectMutations();\n tracker = track(state);\n if (result.wasMutated) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(20) : `A state mutation was detected inside a dispatch, in the path: ${result.path || \"\"}. Take a look at the reducer(s) handling the action ${stringify2(action)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`);\n }\n });\n measureUtils.warnIfExceeded();\n return dispatchedAction;\n };\n };\n }\n}\n\n// src/serializableStateInvariantMiddleware.ts\nimport { isAction as isAction2, isPlainObject } from \"redux\";\nfunction isPlain(val) {\n const type = typeof val;\n return val == null || type === \"string\" || type === \"boolean\" || type === \"number\" || Array.isArray(val) || isPlainObject(val);\n}\nfunction findNonSerializableValue(value, path = \"\", isSerializable = isPlain, getEntries, ignoredPaths = [], cache) {\n let foundNestedSerializable;\n if (!isSerializable(value)) {\n return {\n keyPath: path || \"\",\n value\n };\n }\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n if (cache?.has(value)) return false;\n const entries = getEntries != null ? getEntries(value) : Object.entries(value);\n const hasIgnoredPaths = ignoredPaths.length > 0;\n for (const [key, nestedValue] of entries) {\n const nestedPath = path ? path + \".\" + key : key;\n if (hasIgnoredPaths) {\n const hasMatches = ignoredPaths.some((ignored) => {\n if (ignored instanceof RegExp) {\n return ignored.test(nestedPath);\n }\n return nestedPath === ignored;\n });\n if (hasMatches) {\n continue;\n }\n }\n if (!isSerializable(nestedValue)) {\n return {\n keyPath: nestedPath,\n value: nestedValue\n };\n }\n if (typeof nestedValue === \"object\") {\n foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);\n if (foundNestedSerializable) {\n return foundNestedSerializable;\n }\n }\n }\n if (cache && isNestedFrozen(value)) cache.add(value);\n return false;\n}\nfunction isNestedFrozen(value) {\n if (!Object.isFrozen(value)) return false;\n for (const nestedValue of Object.values(value)) {\n if (typeof nestedValue !== \"object\" || nestedValue === null) continue;\n if (!isNestedFrozen(nestedValue)) return false;\n }\n return true;\n}\nfunction createSerializableStateInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n } else {\n const {\n isSerializable = isPlain,\n getEntries,\n ignoredActions = [],\n ignoredActionPaths = [\"meta.arg\", \"meta.baseQueryMeta\"],\n ignoredPaths = [],\n warnAfter = 32,\n ignoreState = false,\n ignoreActions = false,\n disableCache = false\n } = options;\n const cache = !disableCache && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0;\n return (storeAPI) => (next) => (action) => {\n if (!isAction2(action)) {\n return next(action);\n }\n const result = next(action);\n const measureUtils = getTimeMeasureUtils(warnAfter, \"SerializableStateInvariantMiddleware\");\n if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {\n measureUtils.measureTime(() => {\n const foundActionNonSerializableValue = findNonSerializableValue(action, \"\", isSerializable, getEntries, ignoredActionPaths, cache);\n if (foundActionNonSerializableValue) {\n const {\n keyPath,\n value\n } = foundActionNonSerializableValue;\n console.error(`A non-serializable value was detected in an action, in the path: \\`${keyPath}\\`. Value:`, value, \"\\nTake a look at the logic that dispatched this action: \", action, \"\\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)\", \"\\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)\");\n }\n });\n }\n if (!ignoreState) {\n measureUtils.measureTime(() => {\n const state = storeAPI.getState();\n const foundStateNonSerializableValue = findNonSerializableValue(state, \"\", isSerializable, getEntries, ignoredPaths, cache);\n if (foundStateNonSerializableValue) {\n const {\n keyPath,\n value\n } = foundStateNonSerializableValue;\n console.error(`A non-serializable value was detected in the state, in the path: \\`${keyPath}\\`. Value:`, value, `\nTake a look at the reducer(s) handling this action type: ${action.type}.\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`);\n }\n });\n measureUtils.warnIfExceeded();\n }\n return result;\n };\n }\n}\n\n// src/getDefaultMiddleware.ts\nfunction isBoolean(x) {\n return typeof x === \"boolean\";\n}\nvar buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) {\n const {\n thunk = true,\n immutableCheck = true,\n serializableCheck = true,\n actionCreatorCheck = true\n } = options ?? {};\n let middlewareArray = new Tuple();\n if (thunk) {\n if (isBoolean(thunk)) {\n middlewareArray.push(thunkMiddleware);\n } else {\n middlewareArray.push(withExtraArgument(thunk.extraArgument));\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (immutableCheck) {\n let immutableOptions = {};\n if (!isBoolean(immutableCheck)) {\n immutableOptions = immutableCheck;\n }\n middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));\n }\n if (serializableCheck) {\n let serializableOptions = {};\n if (!isBoolean(serializableCheck)) {\n serializableOptions = serializableCheck;\n }\n middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));\n }\n if (actionCreatorCheck) {\n let actionCreatorOptions = {};\n if (!isBoolean(actionCreatorCheck)) {\n actionCreatorOptions = actionCreatorCheck;\n }\n middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions));\n }\n }\n return middlewareArray;\n};\n\n// src/autoBatchEnhancer.ts\nvar SHOULD_AUTOBATCH = \"RTK_autoBatch\";\nvar prepareAutoBatched = () => (payload) => ({\n payload,\n meta: {\n [SHOULD_AUTOBATCH]: true\n }\n});\nvar createQueueWithTimer = (timeout) => {\n return (notify) => {\n setTimeout(notify, timeout);\n };\n};\nvar rAF = typeof window !== \"undefined\" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);\nvar autoBatchEnhancer = (options = {\n type: \"raf\"\n}) => (next) => (...args) => {\n const store = next(...args);\n let notifying = true;\n let shouldNotifyAtEndOfTick = false;\n let notificationQueued = false;\n const listeners = /* @__PURE__ */ new Set();\n const queueCallback = options.type === \"tick\" ? queueMicrotask : options.type === \"raf\" ? rAF : options.type === \"callback\" ? options.queueNotification : createQueueWithTimer(options.timeout);\n const notifyListeners = () => {\n notificationQueued = false;\n if (shouldNotifyAtEndOfTick) {\n shouldNotifyAtEndOfTick = false;\n listeners.forEach((l) => l());\n }\n };\n return Object.assign({}, store, {\n // Override the base `store.subscribe` method to keep original listeners\n // from running if we're delaying notifications\n subscribe(listener2) {\n const wrappedListener = () => notifying && listener2();\n const unsubscribe = store.subscribe(wrappedListener);\n listeners.add(listener2);\n return () => {\n unsubscribe();\n listeners.delete(listener2);\n };\n },\n // Override the base `store.dispatch` method so that we can check actions\n // for the `shouldAutoBatch` flag and determine if batching is active\n dispatch(action) {\n try {\n notifying = !action?.meta?.[SHOULD_AUTOBATCH];\n shouldNotifyAtEndOfTick = !notifying;\n if (shouldNotifyAtEndOfTick) {\n if (!notificationQueued) {\n notificationQueued = true;\n queueCallback(notifyListeners);\n }\n }\n return store.dispatch(action);\n } finally {\n notifying = true;\n }\n }\n });\n};\n\n// src/getDefaultEnhancers.ts\nvar buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) {\n const {\n autoBatch = true\n } = options ?? {};\n let enhancerArray = new Tuple(middlewareEnhancer);\n if (autoBatch) {\n enhancerArray.push(autoBatchEnhancer(typeof autoBatch === \"object\" ? autoBatch : void 0));\n }\n return enhancerArray;\n};\n\n// src/configureStore.ts\nfunction configureStore(options) {\n const getDefaultMiddleware = buildGetDefaultMiddleware();\n const {\n reducer = void 0,\n middleware,\n devTools = true,\n preloadedState = void 0,\n enhancers = void 0\n } = options || {};\n let rootReducer;\n if (typeof reducer === \"function\") {\n rootReducer = reducer;\n } else if (isPlainObject2(reducer)) {\n rootReducer = combineReducers(reducer);\n } else {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers\");\n }\n if (process.env.NODE_ENV !== \"production\" && middleware && typeof middleware !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"`middleware` field must be a callback\");\n }\n let finalMiddleware;\n if (typeof middleware === \"function\") {\n finalMiddleware = middleware(getDefaultMiddleware);\n if (process.env.NODE_ENV !== \"production\" && !Array.isArray(finalMiddleware)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"when using a middleware builder function, an array of middleware must be returned\");\n }\n } else {\n finalMiddleware = getDefaultMiddleware();\n }\n if (process.env.NODE_ENV !== \"production\" && finalMiddleware.some((item) => typeof item !== \"function\")) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"each middleware provided to configureStore must be a function\");\n }\n let finalCompose = compose2;\n if (devTools) {\n finalCompose = composeWithDevTools({\n // Enable capture of stack traces for dispatched Redux actions\n trace: process.env.NODE_ENV !== \"production\",\n ...typeof devTools === \"object\" && devTools\n });\n }\n const middlewareEnhancer = applyMiddleware(...finalMiddleware);\n const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer);\n if (process.env.NODE_ENV !== \"production\" && enhancers && typeof enhancers !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"`enhancers` field must be a callback\");\n }\n let storeEnhancers = typeof enhancers === \"function\" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();\n if (process.env.NODE_ENV !== \"production\" && !Array.isArray(storeEnhancers)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"`enhancers` callback must return an array\");\n }\n if (process.env.NODE_ENV !== \"production\" && storeEnhancers.some((item) => typeof item !== \"function\")) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"each enhancer provided to configureStore must be a function\");\n }\n if (process.env.NODE_ENV !== \"production\" && finalMiddleware.length && !storeEnhancers.includes(middlewareEnhancer)) {\n console.error(\"middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`\");\n }\n const composedEnhancer = finalCompose(...storeEnhancers);\n return createStore(rootReducer, preloadedState, composedEnhancer);\n}\n\n// src/createReducer.ts\nimport { produce as createNextState2, isDraft as isDraft2, isDraftable as isDraftable2 } from \"immer\";\n\n// src/mapBuilders.ts\nfunction executeReducerBuilderCallback(builderCallback) {\n const actionsMap = {};\n const actionMatchers = [];\n let defaultCaseReducer;\n const builder = {\n addCase(typeOrActionCreator, reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (actionMatchers.length > 0) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(26) : \"`builder.addCase` should only be called before calling `builder.addMatcher`\");\n }\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(27) : \"`builder.addCase` should only be called before calling `builder.addDefaultCase`\");\n }\n }\n const type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\n if (!type) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(28) : \"`builder.addCase` cannot be called with an empty action type\");\n }\n if (type in actionsMap) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(29) : `\\`builder.addCase\\` cannot be called with two reducers for the same action type '${type}'`);\n }\n actionsMap[type] = reducer;\n return builder;\n },\n addMatcher(matcher, reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(30) : \"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`\");\n }\n }\n actionMatchers.push({\n matcher,\n reducer\n });\n return builder;\n },\n addDefaultCase(reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(31) : \"`builder.addDefaultCase` can only be called once\");\n }\n }\n defaultCaseReducer = reducer;\n return builder;\n }\n };\n builderCallback(builder);\n return [actionsMap, actionMatchers, defaultCaseReducer];\n}\n\n// src/createReducer.ts\nfunction isStateFunction(x) {\n return typeof x === \"function\";\n}\nfunction createReducer(initialState, mapOrBuilderCallback) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof mapOrBuilderCallback === \"object\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : \"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer\");\n }\n }\n let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback);\n let getInitialState;\n if (isStateFunction(initialState)) {\n getInitialState = () => freezeDraftable(initialState());\n } else {\n const frozenInitialState = freezeDraftable(initialState);\n getInitialState = () => frozenInitialState;\n }\n function reducer(state = getInitialState(), action) {\n let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({\n matcher\n }) => matcher(action)).map(({\n reducer: reducer2\n }) => reducer2)];\n if (caseReducers.filter((cr) => !!cr).length === 0) {\n caseReducers = [finalDefaultCaseReducer];\n }\n return caseReducers.reduce((previousState, caseReducer) => {\n if (caseReducer) {\n if (isDraft2(previousState)) {\n const draft = previousState;\n const result = caseReducer(draft, action);\n if (result === void 0) {\n return previousState;\n }\n return result;\n } else if (!isDraftable2(previousState)) {\n const result = caseReducer(previousState, action);\n if (result === void 0) {\n if (previousState === null) {\n return previousState;\n }\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : \"A case reducer on a non-draftable value must not return undefined\");\n }\n return result;\n } else {\n return createNextState2(previousState, (draft) => {\n return caseReducer(draft, action);\n });\n }\n }\n return previousState;\n }, state);\n }\n reducer.getInitialState = getInitialState;\n return reducer;\n}\n\n// src/matchers.ts\nvar matches = (matcher, action) => {\n if (hasMatchFunction(matcher)) {\n return matcher.match(action);\n } else {\n return matcher(action);\n }\n};\nfunction isAnyOf(...matchers) {\n return (action) => {\n return matchers.some((matcher) => matches(matcher, action));\n };\n}\nfunction isAllOf(...matchers) {\n return (action) => {\n return matchers.every((matcher) => matches(matcher, action));\n };\n}\nfunction hasExpectedRequestMetadata(action, validStatus) {\n if (!action || !action.meta) return false;\n const hasValidRequestId = typeof action.meta.requestId === \"string\";\n const hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;\n return hasValidRequestId && hasValidRequestStatus;\n}\nfunction isAsyncThunkArray(a) {\n return typeof a[0] === \"function\" && \"pending\" in a[0] && \"fulfilled\" in a[0] && \"rejected\" in a[0];\n}\nfunction isPending(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"pending\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isPending()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.pending));\n}\nfunction isRejected(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"rejected\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isRejected()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.rejected));\n}\nfunction isRejectedWithValue(...asyncThunks) {\n const hasFlag = (action) => {\n return action && action.meta && action.meta.rejectedWithValue;\n };\n if (asyncThunks.length === 0) {\n return isAllOf(isRejected(...asyncThunks), hasFlag);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isRejectedWithValue()(asyncThunks[0]);\n }\n return isAllOf(isRejected(...asyncThunks), hasFlag);\n}\nfunction isFulfilled(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"fulfilled\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isFulfilled()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.fulfilled));\n}\nfunction isAsyncThunkAction(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"pending\", \"fulfilled\", \"rejected\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isAsyncThunkAction()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.flatMap((asyncThunk) => [asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled]));\n}\n\n// src/nanoid.ts\nvar urlAlphabet = \"ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW\";\nvar nanoid = (size = 21) => {\n let id = \"\";\n let i = size;\n while (i--) {\n id += urlAlphabet[Math.random() * 64 | 0];\n }\n return id;\n};\n\n// src/createAsyncThunk.ts\nvar commonProperties = [\"name\", \"message\", \"stack\", \"code\"];\nvar RejectWithValue = class {\n constructor(payload, meta) {\n this.payload = payload;\n this.meta = meta;\n }\n /*\n type-only property to distinguish between RejectWithValue and FulfillWithMeta\n does not exist at runtime\n */\n _type;\n};\nvar FulfillWithMeta = class {\n constructor(payload, meta) {\n this.payload = payload;\n this.meta = meta;\n }\n /*\n type-only property to distinguish between RejectWithValue and FulfillWithMeta\n does not exist at runtime\n */\n _type;\n};\nvar miniSerializeError = (value) => {\n if (typeof value === \"object\" && value !== null) {\n const simpleError = {};\n for (const property of commonProperties) {\n if (typeof value[property] === \"string\") {\n simpleError[property] = value[property];\n }\n }\n return simpleError;\n }\n return {\n message: String(value)\n };\n};\nvar createAsyncThunk = /* @__PURE__ */ (() => {\n function createAsyncThunk2(typePrefix, payloadCreator, options) {\n const fulfilled = createAction(typePrefix + \"/fulfilled\", (payload, requestId, arg, meta) => ({\n payload,\n meta: {\n ...meta || {},\n arg,\n requestId,\n requestStatus: \"fulfilled\"\n }\n }));\n const pending = createAction(typePrefix + \"/pending\", (requestId, arg, meta) => ({\n payload: void 0,\n meta: {\n ...meta || {},\n arg,\n requestId,\n requestStatus: \"pending\"\n }\n }));\n const rejected = createAction(typePrefix + \"/rejected\", (error, requestId, arg, payload, meta) => ({\n payload,\n error: (options && options.serializeError || miniSerializeError)(error || \"Rejected\"),\n meta: {\n ...meta || {},\n arg,\n requestId,\n rejectedWithValue: !!payload,\n requestStatus: \"rejected\",\n aborted: error?.name === \"AbortError\",\n condition: error?.name === \"ConditionError\"\n }\n }));\n function actionCreator(arg) {\n return (dispatch, getState, extra) => {\n const requestId = options?.idGenerator ? options.idGenerator(arg) : nanoid();\n const abortController = new AbortController();\n let abortHandler;\n let abortReason;\n function abort(reason) {\n abortReason = reason;\n abortController.abort();\n }\n const promise = async function() {\n let finalAction;\n try {\n let conditionResult = options?.condition?.(arg, {\n getState,\n extra\n });\n if (isThenable(conditionResult)) {\n conditionResult = await conditionResult;\n }\n if (conditionResult === false || abortController.signal.aborted) {\n throw {\n name: \"ConditionError\",\n message: \"Aborted due to condition callback returning false.\"\n };\n }\n const abortedPromise = new Promise((_, reject) => {\n abortHandler = () => {\n reject({\n name: \"AbortError\",\n message: abortReason || \"Aborted\"\n });\n };\n abortController.signal.addEventListener(\"abort\", abortHandler);\n });\n dispatch(pending(requestId, arg, options?.getPendingMeta?.({\n requestId,\n arg\n }, {\n getState,\n extra\n })));\n finalAction = await Promise.race([abortedPromise, Promise.resolve(payloadCreator(arg, {\n dispatch,\n getState,\n extra,\n requestId,\n signal: abortController.signal,\n abort,\n rejectWithValue: (value, meta) => {\n return new RejectWithValue(value, meta);\n },\n fulfillWithValue: (value, meta) => {\n return new FulfillWithMeta(value, meta);\n }\n })).then((result) => {\n if (result instanceof RejectWithValue) {\n throw result;\n }\n if (result instanceof FulfillWithMeta) {\n return fulfilled(result.payload, requestId, arg, result.meta);\n }\n return fulfilled(result, requestId, arg);\n })]);\n } catch (err) {\n finalAction = err instanceof RejectWithValue ? rejected(null, requestId, arg, err.payload, err.meta) : rejected(err, requestId, arg);\n } finally {\n if (abortHandler) {\n abortController.signal.removeEventListener(\"abort\", abortHandler);\n }\n }\n const skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;\n if (!skipDispatch) {\n dispatch(finalAction);\n }\n return finalAction;\n }();\n return Object.assign(promise, {\n abort,\n requestId,\n arg,\n unwrap() {\n return promise.then(unwrapResult);\n }\n });\n };\n }\n return Object.assign(actionCreator, {\n pending,\n rejected,\n fulfilled,\n settled: isAnyOf(rejected, fulfilled),\n typePrefix\n });\n }\n createAsyncThunk2.withTypes = () => createAsyncThunk2;\n return createAsyncThunk2;\n})();\nfunction unwrapResult(action) {\n if (action.meta && action.meta.rejectedWithValue) {\n throw action.payload;\n }\n if (action.error) {\n throw action.error;\n }\n return action.payload;\n}\nfunction isThenable(value) {\n return value !== null && typeof value === \"object\" && typeof value.then === \"function\";\n}\n\n// src/createSlice.ts\nvar asyncThunkSymbol = /* @__PURE__ */ Symbol.for(\"rtk-slice-createasyncthunk\");\nvar asyncThunkCreator = {\n [asyncThunkSymbol]: createAsyncThunk\n};\nvar ReducerType = /* @__PURE__ */ ((ReducerType2) => {\n ReducerType2[\"reducer\"] = \"reducer\";\n ReducerType2[\"reducerWithPrepare\"] = \"reducerWithPrepare\";\n ReducerType2[\"asyncThunk\"] = \"asyncThunk\";\n return ReducerType2;\n})(ReducerType || {});\nfunction getType(slice, actionKey) {\n return `${slice}/${actionKey}`;\n}\nfunction buildCreateSlice({\n creators\n} = {}) {\n const cAT = creators?.asyncThunk?.[asyncThunkSymbol];\n return function createSlice2(options) {\n const {\n name,\n reducerPath = name\n } = options;\n if (!name) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"`name` is a required option for createSlice\");\n }\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n if (options.initialState === void 0) {\n console.error(\"You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`\");\n }\n }\n const reducers = (typeof options.reducers === \"function\" ? options.reducers(buildReducerCreators()) : options.reducers) || {};\n const reducerNames = Object.keys(reducers);\n const context = {\n sliceCaseReducersByName: {},\n sliceCaseReducersByType: {},\n actionCreators: {},\n sliceMatchers: []\n };\n const contextMethods = {\n addCase(typeOrActionCreator, reducer2) {\n const type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\n if (!type) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"`context.addCase` cannot be called with an empty action type\");\n }\n if (type in context.sliceCaseReducersByType) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"`context.addCase` cannot be called with two reducers for the same action type: \" + type);\n }\n context.sliceCaseReducersByType[type] = reducer2;\n return contextMethods;\n },\n addMatcher(matcher, reducer2) {\n context.sliceMatchers.push({\n matcher,\n reducer: reducer2\n });\n return contextMethods;\n },\n exposeAction(name2, actionCreator) {\n context.actionCreators[name2] = actionCreator;\n return contextMethods;\n },\n exposeCaseReducer(name2, reducer2) {\n context.sliceCaseReducersByName[name2] = reducer2;\n return contextMethods;\n }\n };\n reducerNames.forEach((reducerName) => {\n const reducerDefinition = reducers[reducerName];\n const reducerDetails = {\n reducerName,\n type: getType(name, reducerName),\n createNotation: typeof options.reducers === \"function\"\n };\n if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) {\n handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT);\n } else {\n handleNormalReducerDefinition(reducerDetails, reducerDefinition, contextMethods);\n }\n });\n function buildReducer() {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof options.extraReducers === \"object\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice\");\n }\n }\n const [extraReducers = {}, actionMatchers = [], defaultCaseReducer = void 0] = typeof options.extraReducers === \"function\" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers];\n const finalCaseReducers = {\n ...extraReducers,\n ...context.sliceCaseReducersByType\n };\n return createReducer(options.initialState, (builder) => {\n for (let key in finalCaseReducers) {\n builder.addCase(key, finalCaseReducers[key]);\n }\n for (let sM of context.sliceMatchers) {\n builder.addMatcher(sM.matcher, sM.reducer);\n }\n for (let m of actionMatchers) {\n builder.addMatcher(m.matcher, m.reducer);\n }\n if (defaultCaseReducer) {\n builder.addDefaultCase(defaultCaseReducer);\n }\n });\n }\n const selectSelf = (state) => state;\n const injectedSelectorCache = /* @__PURE__ */ new Map();\n let _reducer;\n function reducer(state, action) {\n if (!_reducer) _reducer = buildReducer();\n return _reducer(state, action);\n }\n function getInitialState() {\n if (!_reducer) _reducer = buildReducer();\n return _reducer.getInitialState();\n }\n function makeSelectorProps(reducerPath2, injected = false) {\n function selectSlice(state) {\n let sliceState = state[reducerPath2];\n if (typeof sliceState === \"undefined\") {\n if (injected) {\n sliceState = getInitialState();\n } else if (process.env.NODE_ENV !== \"production\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"selectSlice returned undefined for an uninjected slice reducer\");\n }\n }\n return sliceState;\n }\n function getSelectors(selectState = selectSelf) {\n const selectorCache = emplace(injectedSelectorCache, injected, {\n insert: () => /* @__PURE__ */ new WeakMap()\n });\n return emplace(selectorCache, selectState, {\n insert: () => {\n const map = {};\n for (const [name2, selector] of Object.entries(options.selectors ?? {})) {\n map[name2] = wrapSelector(selector, selectState, getInitialState, injected);\n }\n return map;\n }\n });\n }\n return {\n reducerPath: reducerPath2,\n getSelectors,\n get selectors() {\n return getSelectors(selectSlice);\n },\n selectSlice\n };\n }\n const slice = {\n name,\n reducer,\n actions: context.actionCreators,\n caseReducers: context.sliceCaseReducersByName,\n getInitialState,\n ...makeSelectorProps(reducerPath),\n injectInto(injectable, {\n reducerPath: pathOpt,\n ...config\n } = {}) {\n const newReducerPath = pathOpt ?? reducerPath;\n injectable.inject({\n reducerPath: newReducerPath,\n reducer\n }, config);\n return {\n ...slice,\n ...makeSelectorProps(newReducerPath, true)\n };\n }\n };\n return slice;\n };\n}\nfunction wrapSelector(selector, selectState, getInitialState, injected) {\n function wrapper(rootState, ...args) {\n let sliceState = selectState(rootState);\n if (typeof sliceState === \"undefined\") {\n if (injected) {\n sliceState = getInitialState();\n } else if (process.env.NODE_ENV !== \"production\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"selectState returned undefined for an uninjected slice reducer\");\n }\n }\n return selector(sliceState, ...args);\n }\n wrapper.unwrapped = selector;\n return wrapper;\n}\nvar createSlice = /* @__PURE__ */ buildCreateSlice();\nfunction buildReducerCreators() {\n function asyncThunk(payloadCreator, config) {\n return {\n _reducerDefinitionType: \"asyncThunk\" /* asyncThunk */,\n payloadCreator,\n ...config\n };\n }\n asyncThunk.withTypes = () => asyncThunk;\n return {\n reducer(caseReducer) {\n return Object.assign({\n // hack so the wrapping function has the same name as the original\n // we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original\n [caseReducer.name](...args) {\n return caseReducer(...args);\n }\n }[caseReducer.name], {\n _reducerDefinitionType: \"reducer\" /* reducer */\n });\n },\n preparedReducer(prepare, reducer) {\n return {\n _reducerDefinitionType: \"reducerWithPrepare\" /* reducerWithPrepare */,\n prepare,\n reducer\n };\n },\n asyncThunk\n };\n}\nfunction handleNormalReducerDefinition({\n type,\n reducerName,\n createNotation\n}, maybeReducerWithPrepare, context) {\n let caseReducer;\n let prepareCallback;\n if (\"reducer\" in maybeReducerWithPrepare) {\n if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : \"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.\");\n }\n caseReducer = maybeReducerWithPrepare.reducer;\n prepareCallback = maybeReducerWithPrepare.prepare;\n } else {\n caseReducer = maybeReducerWithPrepare;\n }\n context.addCase(type, caseReducer).exposeCaseReducer(reducerName, caseReducer).exposeAction(reducerName, prepareCallback ? createAction(type, prepareCallback) : createAction(type));\n}\nfunction isAsyncThunkSliceReducerDefinition(reducerDefinition) {\n return reducerDefinition._reducerDefinitionType === \"asyncThunk\" /* asyncThunk */;\n}\nfunction isCaseReducerWithPrepareDefinition(reducerDefinition) {\n return reducerDefinition._reducerDefinitionType === \"reducerWithPrepare\" /* reducerWithPrepare */;\n}\nfunction handleThunkCaseReducerDefinition({\n type,\n reducerName\n}, reducerDefinition, context, cAT) {\n if (!cAT) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(18) : \"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.\");\n }\n const {\n payloadCreator,\n fulfilled,\n pending,\n rejected,\n settled,\n options\n } = reducerDefinition;\n const thunk = cAT(type, payloadCreator, options);\n context.exposeAction(reducerName, thunk);\n if (fulfilled) {\n context.addCase(thunk.fulfilled, fulfilled);\n }\n if (pending) {\n context.addCase(thunk.pending, pending);\n }\n if (rejected) {\n context.addCase(thunk.rejected, rejected);\n }\n if (settled) {\n context.addMatcher(thunk.settled, settled);\n }\n context.exposeCaseReducer(reducerName, {\n fulfilled: fulfilled || noop,\n pending: pending || noop,\n rejected: rejected || noop,\n settled: settled || noop\n });\n}\nfunction noop() {\n}\n\n// src/entities/entity_state.ts\nfunction getInitialEntityState() {\n return {\n ids: [],\n entities: {}\n };\n}\nfunction createInitialStateFactory(stateAdapter) {\n function getInitialState(additionalState = {}, entities) {\n const state = Object.assign(getInitialEntityState(), additionalState);\n return entities ? stateAdapter.setAll(state, entities) : state;\n }\n return {\n getInitialState\n };\n}\n\n// src/entities/state_selectors.ts\nfunction createSelectorsFactory() {\n function getSelectors(selectState, options = {}) {\n const {\n createSelector: createSelector2 = createDraftSafeSelector\n } = options;\n const selectIds = (state) => state.ids;\n const selectEntities = (state) => state.entities;\n const selectAll = createSelector2(selectIds, selectEntities, (ids, entities) => ids.map((id) => entities[id]));\n const selectId = (_, id) => id;\n const selectById = (entities, id) => entities[id];\n const selectTotal = createSelector2(selectIds, (ids) => ids.length);\n if (!selectState) {\n return {\n selectIds,\n selectEntities,\n selectAll,\n selectTotal,\n selectById: createSelector2(selectEntities, selectId, selectById)\n };\n }\n const selectGlobalizedEntities = createSelector2(selectState, selectEntities);\n return {\n selectIds: createSelector2(selectState, selectIds),\n selectEntities: selectGlobalizedEntities,\n selectAll: createSelector2(selectState, selectAll),\n selectTotal: createSelector2(selectState, selectTotal),\n selectById: createSelector2(selectGlobalizedEntities, selectId, selectById)\n };\n }\n return {\n getSelectors\n };\n}\n\n// src/entities/state_adapter.ts\nimport { produce as createNextState3, isDraft as isDraft3 } from \"immer\";\nvar isDraftTyped = isDraft3;\nfunction createSingleArgumentStateOperator(mutator) {\n const operator = createStateOperator((_, state) => mutator(state));\n return function operation(state) {\n return operator(state, void 0);\n };\n}\nfunction createStateOperator(mutator) {\n return function operation(state, arg) {\n function isPayloadActionArgument(arg2) {\n return isFSA(arg2);\n }\n const runMutator = (draft) => {\n if (isPayloadActionArgument(arg)) {\n mutator(arg.payload, draft);\n } else {\n mutator(arg, draft);\n }\n };\n if (isDraftTyped(state)) {\n runMutator(state);\n return state;\n }\n return createNextState3(state, runMutator);\n };\n}\n\n// src/entities/utils.ts\nimport { current as current2, isDraft as isDraft4 } from \"immer\";\nfunction selectIdValue(entity, selectId) {\n const key = selectId(entity);\n if (process.env.NODE_ENV !== \"production\" && key === void 0) {\n console.warn(\"The entity passed to the `selectId` implementation returned undefined.\", \"You should probably provide your own `selectId` implementation.\", \"The entity that was passed:\", entity, \"The `selectId` implementation:\", selectId.toString());\n }\n return key;\n}\nfunction ensureEntitiesArray(entities) {\n if (!Array.isArray(entities)) {\n entities = Object.values(entities);\n }\n return entities;\n}\nfunction getCurrent(value) {\n return isDraft4(value) ? current2(value) : value;\n}\nfunction splitAddedUpdatedEntities(newEntities, selectId, state) {\n newEntities = ensureEntitiesArray(newEntities);\n const existingIdsArray = getCurrent(state.ids);\n const existingIds = new Set(existingIdsArray);\n const added = [];\n const updated = [];\n for (const entity of newEntities) {\n const id = selectIdValue(entity, selectId);\n if (existingIds.has(id)) {\n updated.push({\n id,\n changes: entity\n });\n } else {\n added.push(entity);\n }\n }\n return [added, updated, existingIdsArray];\n}\n\n// src/entities/unsorted_state_adapter.ts\nfunction createUnsortedStateAdapter(selectId) {\n function addOneMutably(entity, state) {\n const key = selectIdValue(entity, selectId);\n if (key in state.entities) {\n return;\n }\n state.ids.push(key);\n state.entities[key] = entity;\n }\n function addManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n for (const entity of newEntities) {\n addOneMutably(entity, state);\n }\n }\n function setOneMutably(entity, state) {\n const key = selectIdValue(entity, selectId);\n if (!(key in state.entities)) {\n state.ids.push(key);\n }\n ;\n state.entities[key] = entity;\n }\n function setManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n for (const entity of newEntities) {\n setOneMutably(entity, state);\n }\n }\n function setAllMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n state.ids = [];\n state.entities = {};\n addManyMutably(newEntities, state);\n }\n function removeOneMutably(key, state) {\n return removeManyMutably([key], state);\n }\n function removeManyMutably(keys, state) {\n let didMutate = false;\n keys.forEach((key) => {\n if (key in state.entities) {\n delete state.entities[key];\n didMutate = true;\n }\n });\n if (didMutate) {\n state.ids = state.ids.filter((id) => id in state.entities);\n }\n }\n function removeAllMutably(state) {\n Object.assign(state, {\n ids: [],\n entities: {}\n });\n }\n function takeNewKey(keys, update, state) {\n const original3 = state.entities[update.id];\n if (original3 === void 0) {\n return false;\n }\n const updated = Object.assign({}, original3, update.changes);\n const newKey = selectIdValue(updated, selectId);\n const hasNewKey = newKey !== update.id;\n if (hasNewKey) {\n keys[update.id] = newKey;\n delete state.entities[update.id];\n }\n ;\n state.entities[newKey] = updated;\n return hasNewKey;\n }\n function updateOneMutably(update, state) {\n return updateManyMutably([update], state);\n }\n function updateManyMutably(updates, state) {\n const newKeys = {};\n const updatesPerEntity = {};\n updates.forEach((update) => {\n if (update.id in state.entities) {\n updatesPerEntity[update.id] = {\n id: update.id,\n // Spreads ignore falsy values, so this works even if there isn't\n // an existing update already at this key\n changes: {\n ...updatesPerEntity[update.id]?.changes,\n ...update.changes\n }\n };\n }\n });\n updates = Object.values(updatesPerEntity);\n const didMutateEntities = updates.length > 0;\n if (didMutateEntities) {\n const didMutateIds = updates.filter((update) => takeNewKey(newKeys, update, state)).length > 0;\n if (didMutateIds) {\n state.ids = Object.values(state.entities).map((e) => selectIdValue(e, selectId));\n }\n }\n }\n function upsertOneMutably(entity, state) {\n return upsertManyMutably([entity], state);\n }\n function upsertManyMutably(newEntities, state) {\n const [added, updated] = splitAddedUpdatedEntities(newEntities, selectId, state);\n updateManyMutably(updated, state);\n addManyMutably(added, state);\n }\n return {\n removeAll: createSingleArgumentStateOperator(removeAllMutably),\n addOne: createStateOperator(addOneMutably),\n addMany: createStateOperator(addManyMutably),\n setOne: createStateOperator(setOneMutably),\n setMany: createStateOperator(setManyMutably),\n setAll: createStateOperator(setAllMutably),\n updateOne: createStateOperator(updateOneMutably),\n updateMany: createStateOperator(updateManyMutably),\n upsertOne: createStateOperator(upsertOneMutably),\n upsertMany: createStateOperator(upsertManyMutably),\n removeOne: createStateOperator(removeOneMutably),\n removeMany: createStateOperator(removeManyMutably)\n };\n}\n\n// src/entities/sorted_state_adapter.ts\nfunction findInsertIndex(sortedItems, item, comparisonFunction) {\n let lowIndex = 0;\n let highIndex = sortedItems.length;\n while (lowIndex < highIndex) {\n let middleIndex = lowIndex + highIndex >>> 1;\n const currentItem = sortedItems[middleIndex];\n const res = comparisonFunction(item, currentItem);\n if (res >= 0) {\n lowIndex = middleIndex + 1;\n } else {\n highIndex = middleIndex;\n }\n }\n return lowIndex;\n}\nfunction insert(sortedItems, item, comparisonFunction) {\n const insertAtIndex = findInsertIndex(sortedItems, item, comparisonFunction);\n sortedItems.splice(insertAtIndex, 0, item);\n return sortedItems;\n}\nfunction createSortedStateAdapter(selectId, comparer) {\n const {\n removeOne,\n removeMany,\n removeAll\n } = createUnsortedStateAdapter(selectId);\n function addOneMutably(entity, state) {\n return addManyMutably([entity], state);\n }\n function addManyMutably(newEntities, state, existingIds) {\n newEntities = ensureEntitiesArray(newEntities);\n const existingKeys = new Set(existingIds ?? getCurrent(state.ids));\n const models = newEntities.filter((model) => !existingKeys.has(selectIdValue(model, selectId)));\n if (models.length !== 0) {\n mergeFunction(state, models);\n }\n }\n function setOneMutably(entity, state) {\n return setManyMutably([entity], state);\n }\n function setManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n if (newEntities.length !== 0) {\n for (const item of newEntities) {\n delete state.entities[selectId(item)];\n }\n mergeFunction(state, newEntities);\n }\n }\n function setAllMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n state.entities = {};\n state.ids = [];\n addManyMutably(newEntities, state, []);\n }\n function updateOneMutably(update, state) {\n return updateManyMutably([update], state);\n }\n function updateManyMutably(updates, state) {\n let appliedUpdates = false;\n let replacedIds = false;\n for (let update of updates) {\n const entity = state.entities[update.id];\n if (!entity) {\n continue;\n }\n appliedUpdates = true;\n Object.assign(entity, update.changes);\n const newId = selectId(entity);\n if (update.id !== newId) {\n replacedIds = true;\n delete state.entities[update.id];\n const oldIndex = state.ids.indexOf(update.id);\n state.ids[oldIndex] = newId;\n state.entities[newId] = entity;\n }\n }\n if (appliedUpdates) {\n mergeFunction(state, [], appliedUpdates, replacedIds);\n }\n }\n function upsertOneMutably(entity, state) {\n return upsertManyMutably([entity], state);\n }\n function upsertManyMutably(newEntities, state) {\n const [added, updated, existingIdsArray] = splitAddedUpdatedEntities(newEntities, selectId, state);\n if (updated.length) {\n updateManyMutably(updated, state);\n }\n if (added.length) {\n addManyMutably(added, state, existingIdsArray);\n }\n }\n function areArraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] === b[i]) {\n continue;\n }\n return false;\n }\n return true;\n }\n const mergeFunction = (state, addedItems, appliedUpdates, replacedIds) => {\n const currentEntities = getCurrent(state.entities);\n const currentIds = getCurrent(state.ids);\n const stateEntities = state.entities;\n let ids = currentIds;\n if (replacedIds) {\n ids = new Set(currentIds);\n }\n let sortedEntities = [];\n for (const id of ids) {\n const entity = currentEntities[id];\n if (entity) {\n sortedEntities.push(entity);\n }\n }\n const wasPreviouslyEmpty = sortedEntities.length === 0;\n for (const item of addedItems) {\n stateEntities[selectId(item)] = item;\n if (!wasPreviouslyEmpty) {\n insert(sortedEntities, item, comparer);\n }\n }\n if (wasPreviouslyEmpty) {\n sortedEntities = addedItems.slice().sort(comparer);\n } else if (appliedUpdates) {\n sortedEntities.sort(comparer);\n }\n const newSortedIds = sortedEntities.map(selectId);\n if (!areArraysEqual(currentIds, newSortedIds)) {\n state.ids = newSortedIds;\n }\n };\n return {\n removeOne,\n removeMany,\n removeAll,\n addOne: createStateOperator(addOneMutably),\n updateOne: createStateOperator(updateOneMutably),\n upsertOne: createStateOperator(upsertOneMutably),\n setOne: createStateOperator(setOneMutably),\n setMany: createStateOperator(setManyMutably),\n setAll: createStateOperator(setAllMutably),\n addMany: createStateOperator(addManyMutably),\n updateMany: createStateOperator(updateManyMutably),\n upsertMany: createStateOperator(upsertManyMutably)\n };\n}\n\n// src/entities/create_adapter.ts\nfunction createEntityAdapter(options = {}) {\n const {\n selectId,\n sortComparer\n } = {\n sortComparer: false,\n selectId: (instance) => instance.id,\n ...options\n };\n const stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);\n const stateFactory = createInitialStateFactory(stateAdapter);\n const selectorsFactory = createSelectorsFactory();\n return {\n selectId,\n sortComparer,\n ...stateFactory,\n ...selectorsFactory,\n ...stateAdapter\n };\n}\n\n// src/listenerMiddleware/index.ts\nimport { isAction as isAction3 } from \"redux\";\n\n// src/listenerMiddleware/exceptions.ts\nvar task = \"task\";\nvar listener = \"listener\";\nvar completed = \"completed\";\nvar cancelled = \"cancelled\";\nvar taskCancelled = `task-${cancelled}`;\nvar taskCompleted = `task-${completed}`;\nvar listenerCancelled = `${listener}-${cancelled}`;\nvar listenerCompleted = `${listener}-${completed}`;\nvar TaskAbortError = class {\n constructor(code) {\n this.code = code;\n this.message = `${task} ${cancelled} (reason: ${code})`;\n }\n name = \"TaskAbortError\";\n message;\n};\n\n// src/listenerMiddleware/utils.ts\nvar assertFunction = (func, expected) => {\n if (typeof func !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(32) : `${expected} is not a function`);\n }\n};\nvar noop2 = () => {\n};\nvar catchRejection = (promise, onError = noop2) => {\n promise.catch(onError);\n return promise;\n};\nvar addAbortSignalListener = (abortSignal, callback) => {\n abortSignal.addEventListener(\"abort\", callback, {\n once: true\n });\n return () => abortSignal.removeEventListener(\"abort\", callback);\n};\nvar abortControllerWithReason = (abortController, reason) => {\n const signal = abortController.signal;\n if (signal.aborted) {\n return;\n }\n if (!(\"reason\" in signal)) {\n Object.defineProperty(signal, \"reason\", {\n enumerable: true,\n value: reason,\n configurable: true,\n writable: true\n });\n }\n ;\n abortController.abort(reason);\n};\n\n// src/listenerMiddleware/task.ts\nvar validateActive = (signal) => {\n if (signal.aborted) {\n const {\n reason\n } = signal;\n throw new TaskAbortError(reason);\n }\n};\nfunction raceWithSignal(signal, promise) {\n let cleanup = noop2;\n return new Promise((resolve, reject) => {\n const notifyRejection = () => reject(new TaskAbortError(signal.reason));\n if (signal.aborted) {\n notifyRejection();\n return;\n }\n cleanup = addAbortSignalListener(signal, notifyRejection);\n promise.finally(() => cleanup()).then(resolve, reject);\n }).finally(() => {\n cleanup = noop2;\n });\n}\nvar runTask = async (task2, cleanUp) => {\n try {\n await Promise.resolve();\n const value = await task2();\n return {\n status: \"ok\",\n value\n };\n } catch (error) {\n return {\n status: error instanceof TaskAbortError ? \"cancelled\" : \"rejected\",\n error\n };\n } finally {\n cleanUp?.();\n }\n};\nvar createPause = (signal) => {\n return (promise) => {\n return catchRejection(raceWithSignal(signal, promise).then((output) => {\n validateActive(signal);\n return output;\n }));\n };\n};\nvar createDelay = (signal) => {\n const pause = createPause(signal);\n return (timeoutMs) => {\n return pause(new Promise((resolve) => setTimeout(resolve, timeoutMs)));\n };\n};\n\n// src/listenerMiddleware/index.ts\nvar {\n assign\n} = Object;\nvar INTERNAL_NIL_TOKEN = {};\nvar alm = \"listenerMiddleware\";\nvar createFork = (parentAbortSignal, parentBlockingPromises) => {\n const linkControllers = (controller) => addAbortSignalListener(parentAbortSignal, () => abortControllerWithReason(controller, parentAbortSignal.reason));\n return (taskExecutor, opts) => {\n assertFunction(taskExecutor, \"taskExecutor\");\n const childAbortController = new AbortController();\n linkControllers(childAbortController);\n const result = runTask(async () => {\n validateActive(parentAbortSignal);\n validateActive(childAbortController.signal);\n const result2 = await taskExecutor({\n pause: createPause(childAbortController.signal),\n delay: createDelay(childAbortController.signal),\n signal: childAbortController.signal\n });\n validateActive(childAbortController.signal);\n return result2;\n }, () => abortControllerWithReason(childAbortController, taskCompleted));\n if (opts?.autoJoin) {\n parentBlockingPromises.push(result.catch(noop2));\n }\n return {\n result: createPause(parentAbortSignal)(result),\n cancel() {\n abortControllerWithReason(childAbortController, taskCancelled);\n }\n };\n };\n};\nvar createTakePattern = (startListening, signal) => {\n const take = async (predicate, timeout) => {\n validateActive(signal);\n let unsubscribe = () => {\n };\n const tuplePromise = new Promise((resolve, reject) => {\n let stopListening = startListening({\n predicate,\n effect: (action, listenerApi) => {\n listenerApi.unsubscribe();\n resolve([action, listenerApi.getState(), listenerApi.getOriginalState()]);\n }\n });\n unsubscribe = () => {\n stopListening();\n reject();\n };\n });\n const promises = [tuplePromise];\n if (timeout != null) {\n promises.push(new Promise((resolve) => setTimeout(resolve, timeout, null)));\n }\n try {\n const output = await raceWithSignal(signal, Promise.race(promises));\n validateActive(signal);\n return output;\n } finally {\n unsubscribe();\n }\n };\n return (predicate, timeout) => catchRejection(take(predicate, timeout));\n};\nvar getListenerEntryPropsFrom = (options) => {\n let {\n type,\n actionCreator,\n matcher,\n predicate,\n effect\n } = options;\n if (type) {\n predicate = createAction(type).match;\n } else if (actionCreator) {\n type = actionCreator.type;\n predicate = actionCreator.match;\n } else if (matcher) {\n predicate = matcher;\n } else if (predicate) {\n } else {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(21) : \"Creating or removing a listener requires one of the known fields for matching an action\");\n }\n assertFunction(effect, \"options.listener\");\n return {\n predicate,\n type,\n effect\n };\n};\nvar createListenerEntry = /* @__PURE__ */ assign((options) => {\n const {\n type,\n predicate,\n effect\n } = getListenerEntryPropsFrom(options);\n const id = nanoid();\n const entry = {\n id,\n effect,\n type,\n predicate,\n pending: /* @__PURE__ */ new Set(),\n unsubscribe: () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(22) : \"Unsubscribe not initialized\");\n }\n };\n return entry;\n}, {\n withTypes: () => createListenerEntry\n});\nvar cancelActiveListeners = (entry) => {\n entry.pending.forEach((controller) => {\n abortControllerWithReason(controller, listenerCancelled);\n });\n};\nvar createClearListenerMiddleware = (listenerMap) => {\n return () => {\n listenerMap.forEach(cancelActiveListeners);\n listenerMap.clear();\n };\n};\nvar safelyNotifyError = (errorHandler, errorToNotify, errorInfo) => {\n try {\n errorHandler(errorToNotify, errorInfo);\n } catch (errorHandlerError) {\n setTimeout(() => {\n throw errorHandlerError;\n }, 0);\n }\n};\nvar addListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/add`), {\n withTypes: () => addListener\n});\nvar clearAllListeners = /* @__PURE__ */ createAction(`${alm}/removeAll`);\nvar removeListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/remove`), {\n withTypes: () => removeListener\n});\nvar defaultErrorHandler = (...args) => {\n console.error(`${alm}/error`, ...args);\n};\nvar createListenerMiddleware = (middlewareOptions = {}) => {\n const listenerMap = /* @__PURE__ */ new Map();\n const {\n extra,\n onError = defaultErrorHandler\n } = middlewareOptions;\n assertFunction(onError, \"onError\");\n const insertEntry = (entry) => {\n entry.unsubscribe = () => listenerMap.delete(entry.id);\n listenerMap.set(entry.id, entry);\n return (cancelOptions) => {\n entry.unsubscribe();\n if (cancelOptions?.cancelActive) {\n cancelActiveListeners(entry);\n }\n };\n };\n const startListening = (options) => {\n let entry = find(Array.from(listenerMap.values()), (existingEntry) => existingEntry.effect === options.effect);\n if (!entry) {\n entry = createListenerEntry(options);\n }\n return insertEntry(entry);\n };\n assign(startListening, {\n withTypes: () => startListening\n });\n const stopListening = (options) => {\n const {\n type,\n effect,\n predicate\n } = getListenerEntryPropsFrom(options);\n const entry = find(Array.from(listenerMap.values()), (entry2) => {\n const matchPredicateOrType = typeof type === \"string\" ? entry2.type === type : entry2.predicate === predicate;\n return matchPredicateOrType && entry2.effect === effect;\n });\n if (entry) {\n entry.unsubscribe();\n if (options.cancelActive) {\n cancelActiveListeners(entry);\n }\n }\n return !!entry;\n };\n assign(stopListening, {\n withTypes: () => stopListening\n });\n const notifyListener = async (entry, action, api, getOriginalState) => {\n const internalTaskController = new AbortController();\n const take = createTakePattern(startListening, internalTaskController.signal);\n const autoJoinPromises = [];\n try {\n entry.pending.add(internalTaskController);\n await Promise.resolve(entry.effect(\n action,\n // Use assign() rather than ... to avoid extra helper functions added to bundle\n assign({}, api, {\n getOriginalState,\n condition: (predicate, timeout) => take(predicate, timeout).then(Boolean),\n take,\n delay: createDelay(internalTaskController.signal),\n pause: createPause(internalTaskController.signal),\n extra,\n signal: internalTaskController.signal,\n fork: createFork(internalTaskController.signal, autoJoinPromises),\n unsubscribe: entry.unsubscribe,\n subscribe: () => {\n listenerMap.set(entry.id, entry);\n },\n cancelActiveListeners: () => {\n entry.pending.forEach((controller, _, set) => {\n if (controller !== internalTaskController) {\n abortControllerWithReason(controller, listenerCancelled);\n set.delete(controller);\n }\n });\n },\n cancel: () => {\n abortControllerWithReason(internalTaskController, listenerCancelled);\n entry.pending.delete(internalTaskController);\n },\n throwIfCancelled: () => {\n validateActive(internalTaskController.signal);\n }\n })\n ));\n } catch (listenerError) {\n if (!(listenerError instanceof TaskAbortError)) {\n safelyNotifyError(onError, listenerError, {\n raisedBy: \"effect\"\n });\n }\n } finally {\n await Promise.all(autoJoinPromises);\n abortControllerWithReason(internalTaskController, listenerCompleted);\n entry.pending.delete(internalTaskController);\n }\n };\n const clearListenerMiddleware = createClearListenerMiddleware(listenerMap);\n const middleware = (api) => (next) => (action) => {\n if (!isAction3(action)) {\n return next(action);\n }\n if (addListener.match(action)) {\n return startListening(action.payload);\n }\n if (clearAllListeners.match(action)) {\n clearListenerMiddleware();\n return;\n }\n if (removeListener.match(action)) {\n return stopListening(action.payload);\n }\n let originalState = api.getState();\n const getOriginalState = () => {\n if (originalState === INTERNAL_NIL_TOKEN) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(23) : `${alm}: getOriginalState can only be called synchronously`);\n }\n return originalState;\n };\n let result;\n try {\n result = next(action);\n if (listenerMap.size > 0) {\n const currentState = api.getState();\n const listenerEntries = Array.from(listenerMap.values());\n for (const entry of listenerEntries) {\n let runListener = false;\n try {\n runListener = entry.predicate(action, currentState, originalState);\n } catch (predicateError) {\n runListener = false;\n safelyNotifyError(onError, predicateError, {\n raisedBy: \"predicate\"\n });\n }\n if (!runListener) {\n continue;\n }\n notifyListener(entry, action, api, getOriginalState);\n }\n }\n } finally {\n originalState = INTERNAL_NIL_TOKEN;\n }\n return result;\n };\n return {\n middleware,\n startListening,\n stopListening,\n clearListeners: clearListenerMiddleware\n };\n};\n\n// src/dynamicMiddleware/index.ts\nimport { compose as compose3 } from \"redux\";\nvar createMiddlewareEntry = (middleware) => ({\n id: nanoid(),\n middleware,\n applied: /* @__PURE__ */ new Map()\n});\nvar matchInstance = (instanceId) => (action) => action?.meta?.instanceId === instanceId;\nvar createDynamicMiddleware = () => {\n const instanceId = nanoid();\n const middlewareMap = /* @__PURE__ */ new Map();\n const withMiddleware = Object.assign(createAction(\"dynamicMiddleware/add\", (...middlewares) => ({\n payload: middlewares,\n meta: {\n instanceId\n }\n })), {\n withTypes: () => withMiddleware\n });\n const addMiddleware = Object.assign(function addMiddleware2(...middlewares) {\n middlewares.forEach((middleware2) => {\n let entry = find(Array.from(middlewareMap.values()), (entry2) => entry2.middleware === middleware2);\n if (!entry) {\n entry = createMiddlewareEntry(middleware2);\n }\n middlewareMap.set(entry.id, entry);\n });\n }, {\n withTypes: () => addMiddleware\n });\n const getFinalMiddleware = (api) => {\n const appliedMiddleware = Array.from(middlewareMap.values()).map((entry) => emplace(entry.applied, api, {\n insert: () => entry.middleware(api)\n }));\n return compose3(...appliedMiddleware);\n };\n const isWithMiddleware = isAllOf(withMiddleware, matchInstance(instanceId));\n const middleware = (api) => (next) => (action) => {\n if (isWithMiddleware(action)) {\n addMiddleware(...action.payload);\n return api.dispatch;\n }\n return getFinalMiddleware(api)(next)(action);\n };\n return {\n middleware,\n addMiddleware,\n withMiddleware,\n instanceId\n };\n};\n\n// src/combineSlices.ts\nimport { combineReducers as combineReducers2 } from \"redux\";\nvar isSliceLike = (maybeSliceLike) => \"reducerPath\" in maybeSliceLike && typeof maybeSliceLike.reducerPath === \"string\";\nvar getReducers = (slices) => slices.flatMap((sliceOrMap) => isSliceLike(sliceOrMap) ? [[sliceOrMap.reducerPath, sliceOrMap.reducer]] : Object.entries(sliceOrMap));\nvar ORIGINAL_STATE = Symbol.for(\"rtk-state-proxy-original\");\nvar isStateProxy = (value) => !!value && !!value[ORIGINAL_STATE];\nvar stateProxyMap = /* @__PURE__ */ new WeakMap();\nvar createStateProxy = (state, reducerMap) => emplace(stateProxyMap, state, {\n insert: () => new Proxy(state, {\n get: (target, prop, receiver) => {\n if (prop === ORIGINAL_STATE) return target;\n const result = Reflect.get(target, prop, receiver);\n if (typeof result === \"undefined\") {\n const reducer = reducerMap[prop.toString()];\n if (reducer) {\n const reducerResult = reducer(void 0, {\n type: nanoid()\n });\n if (typeof reducerResult === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(24) : `The slice reducer for key \"${prop.toString()}\" returned undefined when called for selector(). If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);\n }\n return reducerResult;\n }\n }\n return result;\n }\n })\n});\nvar original = (state) => {\n if (!isStateProxy(state)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(25) : \"original must be used on state Proxy\");\n }\n return state[ORIGINAL_STATE];\n};\nvar noopReducer = (state = {}) => state;\nfunction combineSlices(...slices) {\n const reducerMap = Object.fromEntries(getReducers(slices));\n const getReducer = () => Object.keys(reducerMap).length ? combineReducers2(reducerMap) : noopReducer;\n let reducer = getReducer();\n function combinedReducer(state, action) {\n return reducer(state, action);\n }\n combinedReducer.withLazyLoadedSlices = () => combinedReducer;\n const inject = (slice, config = {}) => {\n const {\n reducerPath,\n reducer: reducerToInject\n } = slice;\n const currentReducer = reducerMap[reducerPath];\n if (!config.overrideExisting && currentReducer && currentReducer !== reducerToInject) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n console.error(`called \\`inject\\` to override already-existing reducer ${reducerPath} without specifying \\`overrideExisting: true\\``);\n }\n return combinedReducer;\n }\n reducerMap[reducerPath] = reducerToInject;\n reducer = getReducer();\n return combinedReducer;\n };\n const selector = Object.assign(function makeSelector(selectorFn, selectState) {\n return function selector2(state, ...args) {\n return selectorFn(createStateProxy(selectState ? selectState(state, ...args) : state, reducerMap), ...args);\n };\n }, {\n original\n });\n return Object.assign(combinedReducer, {\n inject,\n selector\n });\n}\n\n// src/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\nexport {\n ReducerType,\n SHOULD_AUTOBATCH,\n TaskAbortError,\n Tuple,\n addListener,\n asyncThunkCreator,\n autoBatchEnhancer,\n buildCreateSlice,\n clearAllListeners,\n combineSlices,\n configureStore,\n createAction,\n createActionCreatorInvariantMiddleware,\n createAsyncThunk,\n createDraftSafeSelector,\n createDraftSafeSelectorCreator,\n createDynamicMiddleware,\n createEntityAdapter,\n createImmutableStateInvariantMiddleware,\n createListenerMiddleware,\n produce as createNextState,\n createReducer,\n createSelector,\n createSelectorCreator2 as createSelectorCreator,\n createSerializableStateInvariantMiddleware,\n createSlice,\n current3 as current,\n findNonSerializableValue,\n formatProdErrorMessage,\n freeze,\n isActionCreator,\n isAllOf,\n isAnyOf,\n isAsyncThunkAction,\n isDraft5 as isDraft,\n isFSA as isFluxStandardAction,\n isFulfilled,\n isImmutableDefault,\n isPending,\n isPlain,\n isRejected,\n isRejectedWithValue,\n lruMemoize,\n miniSerializeError,\n nanoid,\n original2 as original,\n prepareAutoBatched,\n removeListener,\n unwrapResult,\n weakMapMemoize2 as weakMapMemoize\n};\n//# sourceMappingURL=redux-toolkit.modern.mjs.map","import rootReducer from './reducers';\r\nimport {configureStore} from \"@reduxjs/toolkit\"; // You need to create this file later\r\n\r\nconst store = configureStore({\r\n reducer: rootReducer,\r\n});\r\n\r\nexport default store;\r\n","// Inspired by react-hot-toast library\r\nimport * as React from \"react\"\r\n\r\nimport type {\r\n ToastActionElement,\r\n ToastProps,\r\n} from \"src/components/ui/toast\"\r\n\r\nconst TOAST_LIMIT = 1\r\nconst TOAST_REMOVE_DELAY = 1000000\r\n\r\ntype ToasterToast = ToastProps & {\r\n id: string\r\n title?: React.ReactNode\r\n description?: React.ReactNode\r\n action?: ToastActionElement\r\n}\r\n\r\nconst actionTypes = {\r\n ADD_TOAST: \"ADD_TOAST\",\r\n UPDATE_TOAST: \"UPDATE_TOAST\",\r\n DISMISS_TOAST: \"DISMISS_TOAST\",\r\n REMOVE_TOAST: \"REMOVE_TOAST\",\r\n} as const\r\n\r\nlet count = 0\r\n\r\nfunction genId() {\r\n count = (count + 1) % Number.MAX_VALUE\r\n return count.toString()\r\n}\r\n\r\ntype ActionType = typeof actionTypes\r\n\r\ntype Action =\r\n | {\r\n type: ActionType[\"ADD_TOAST\"]\r\n toast: ToasterToast\r\n }\r\n | {\r\n type: ActionType[\"UPDATE_TOAST\"]\r\n toast: Partial\r\n }\r\n | {\r\n type: ActionType[\"DISMISS_TOAST\"]\r\n toastId?: ToasterToast[\"id\"]\r\n }\r\n | {\r\n type: ActionType[\"REMOVE_TOAST\"]\r\n toastId?: ToasterToast[\"id\"]\r\n }\r\n\r\ninterface State {\r\n toasts: ToasterToast[]\r\n}\r\n\r\nconst toastTimeouts = new Map>()\r\n\r\nconst addToRemoveQueue = (toastId: string) => {\r\n if (toastTimeouts.has(toastId)) {\r\n return\r\n }\r\n\r\n const timeout = setTimeout(() => {\r\n toastTimeouts.delete(toastId)\r\n dispatch({\r\n type: \"REMOVE_TOAST\",\r\n toastId: toastId,\r\n })\r\n }, TOAST_REMOVE_DELAY)\r\n\r\n toastTimeouts.set(toastId, timeout)\r\n}\r\n\r\nexport const reducer = (state: State, action: Action): State => {\r\n\r\n switch (action.type) {\r\n case \"ADD_TOAST\":\r\n return {\r\n ...state,\r\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\r\n }\r\n\r\n case \"UPDATE_TOAST\":\r\n return {\r\n ...state,\r\n toasts: state.toasts.map((t) =>\r\n t.id === action.toast.id ? { ...t, ...action.toast } : t\r\n ),\r\n }\r\n\r\n case \"DISMISS_TOAST\": {\r\n const { toastId } = action\r\n\r\n // ! Side effects ! - This could be extracted into a dismissToast() action,\r\n // but I'll keep it here for simplicity\r\n if (toastId) {\r\n addToRemoveQueue(toastId)\r\n } else {\r\n state.toasts.forEach((toast) => {\r\n addToRemoveQueue(toast.id)\r\n })\r\n }\r\n\r\n return {\r\n ...state,\r\n toasts: state.toasts.map((t) =>\r\n t.id === toastId || toastId === undefined\r\n ? {\r\n ...t,\r\n open: false,\r\n }\r\n : t\r\n ),\r\n }\r\n }\r\n case \"REMOVE_TOAST\":\r\n if (action.toastId === undefined) {\r\n return {\r\n ...state,\r\n toasts: [],\r\n }\r\n }\r\n return {\r\n ...state,\r\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\r\n }\r\n }\r\n}\r\n\r\nconst listeners: Array<(state: State) => void> = []\r\n\r\nlet memoryState: State = { toasts: [] }\r\n\r\nfunction dispatch(action: Action) {\r\n memoryState = reducer(memoryState, action)\r\n listeners.forEach((listener) => {\r\n listener(memoryState)\r\n })\r\n}\r\n\r\ntype Toast = Omit\r\n\r\nfunction toast({ ...props }: Toast, closeDuration= 3000) {\r\n const id = genId()\r\n\r\n const update = (props: ToasterToast) =>\r\n dispatch({\r\n type: \"UPDATE_TOAST\",\r\n toast: { ...props, id },\r\n })\r\n const dismiss = () => dispatch({ type: \"DISMISS_TOAST\", toastId: id })\r\n\r\n dispatch({\r\n type: \"ADD_TOAST\",\r\n toast: {\r\n ...props,\r\n id,\r\n open: true,\r\n duration: closeDuration,\r\n onOpenChange: (open) => {\r\n if (!open) dismiss();\r\n },\r\n },\r\n });\r\n\r\n return {\r\n id: id,\r\n dismiss,\r\n update,\r\n }\r\n}\r\n\r\nfunction useToast() {\r\n const [state, setState] = React.useState(memoryState)\r\n\r\n React.useEffect(() => {\r\n\r\n listeners.push(setState)\r\n return () => {\r\n const index = listeners.indexOf(setState)\r\n if (index > -1) {\r\n listeners.splice(index, 1)\r\n }\r\n }\r\n }, [state])\r\n\r\n return {\r\n ...state,\r\n toast,\r\n dismiss: (toastId?: string) => dispatch({ type: \"DISMISS_TOAST\", toastId }),\r\n }\r\n}\r\n\r\nexport { useToast, toast }\r\n","import {isDev, toBoolean} from \"lib/utils\";\r\nimport store from \"../store\";\r\nimport { toast } from \"components/ui/use-toast\";\r\n\r\nclass ApiService {\r\n public baseURL: URL;\r\n private options: WordPressOptions;\r\n\r\n\r\n constructor(options?: WordPressOptions, query?: string, action?: string) {\r\n\r\n if (!options) {\r\n options = window.rapidload_optimizer\r\n }\r\n\r\n this.options = options\r\n\r\n let base = options?.ajax_url\r\n ? options.ajax_url\r\n : \"http://rapidload.local/wp-admin/admin-ajax.php\";\r\n\r\n const queryParams = new URLSearchParams(query);\r\n\r\n if (action) {\r\n queryParams.append(\"action\", action);\r\n }\r\n\r\n if (options?.nonce && !queryParams.has('nonce')) {\r\n queryParams.append(\"nonce\", options.nonce);\r\n }\r\n\r\n this.baseURL = new URL(base + \"?\" + queryParams.toString());\r\n\r\n }\r\n\r\n async throwIfError(response: Response, state: any = null) {\r\n\r\n if (!response.ok) {\r\n throw new Error(\"Oops! The request failed\");\r\n }\r\n\r\n let data = await response.json();\r\n\r\n if (!data.success) {\r\n\r\n if (data.data.reload) {\r\n return data.data\r\n }\r\n\r\n if (Array.isArray(data?.data)) {\r\n\r\n throw new Error(\r\n `[Code:${data.data[0].code}] ${data.data[0].detail ? data.data[0].detail : 'Internal error occurred on our end :('}`\r\n );\r\n }\r\n\r\n throw new Error(\r\n \"Problem Retrieving Data: Our Apologies. For Assistance, Please Reach Out to Customer Support.\"\r\n );\r\n }\r\n\r\n return {\r\n ...data,\r\n state\r\n }\r\n }\r\n\r\n async fetchPageSpeed(url: string, activeReport: string, reload: boolean): Promise {\r\n\r\n try {\r\n let fresh = reload\r\n let data = null\r\n\r\n if (reload) {\r\n data = await this.analyzeViaAPI(url, activeReport);\r\n\r\n if(data?.errors) {\r\n if (Array.isArray(data?.errors)) {\r\n throw new Error(\r\n `[Code:${data.errors[0].code}] ${data.errors[0].detail}`\r\n );\r\n }\r\n\r\n throw new Error(\r\n `Oops! Something went wrong :(`\r\n );\r\n }\r\n }\r\n\r\n const query = new URLSearchParams();\r\n\r\n this.baseURL.searchParams.append('action', 'fetch_page_speed')\r\n this.baseURL.searchParams.append('url', url)\r\n this.baseURL.searchParams.append('strategy', activeReport)\r\n this.baseURL.searchParams.append('new', reload as unknown as string)\r\n this.baseURL.searchParams.append('is_dev', isDev as unknown as string)\r\n // this.baseURL.searchParams.append('settingsMode', settingsMode || '')\r\n\r\n const response = await fetch(this.baseURL, {\r\n method: data ? \"POST\": \"GET\",\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n },\r\n ...(\r\n data ? {\r\n body : JSON.stringify( {\r\n page_speed: data\r\n })\r\n } : {}\r\n )\r\n });\r\n\r\n\r\n let responseData = await this.throwIfError(response, {\r\n fresh: reload\r\n });\r\n\r\n if (responseData?.reload) {\r\n return await this.fetchPageSpeed(url, activeReport, true);\r\n }\r\n\r\n return responseData\r\n\r\n } catch (error) {\r\n console.error(error);\r\n throw error;\r\n }\r\n }\r\n\r\n async fetchSettings(url: string, activeReport: string, reload: boolean): Promise {\r\n\r\n try {\r\n let fresh = reload\r\n let data = null\r\n\r\n const query = new URLSearchParams();\r\n\r\n this.baseURL.searchParams.append('action', 'fetch_titan_settings')\r\n this.baseURL.searchParams.append('url', url)\r\n this.baseURL.searchParams.append('strategy', activeReport)\r\n this.baseURL.searchParams.append('new', reload as unknown as string)\r\n this.baseURL.searchParams.append('is_dev', isDev as unknown as string)\r\n // this.baseURL.searchParams.append('settingsMode', settingsMode || '')\r\n\r\n const response = await fetch(this.baseURL, {\r\n method: data ? \"POST\": \"GET\",\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n }\r\n });\r\n\r\n\r\n let responseData = await this.throwIfError(response, {\r\n fresh: reload\r\n });\r\n\r\n if (responseData?.reload) {\r\n return await this.fetchPageSpeed(url, activeReport, true);\r\n }\r\n\r\n return responseData\r\n\r\n } catch (error) {\r\n console.error(error);\r\n toast({\r\n description: 'Failed to fetch RapidLoad settings!',\r\n variant: 'destructive',\r\n })\r\n throw error;\r\n }\r\n }\r\n\r\n async analyzeViaAPI(url: string, strategy: string) {\r\n\r\n try {\r\n const state = store.getState()\r\n const data = state.app.report[state.app.activeReport]\r\n const settings = state.app.settings.performance[state.app.activeReport]\r\n const testModeStatus = state.app.testMode?.status ?? state.app.settings.general.test_mode ?? false;\r\n const previewUrl = testModeStatus ? '?rapidload_preview': '';\r\n\r\n const api_root = this.options?.api_root || 'https://api.rapidload.io/api/v1';\r\n const pageSpeedURL = new URL(`${api_root}/page-speed`);\r\n\r\n pageSpeedURL.searchParams.append('url', url + previewUrl)\r\n pageSpeedURL.searchParams.append('strategy', state.app.activeReport)\r\n pageSpeedURL.searchParams.append('plugin_version', this.options.rapidload_version)\r\n pageSpeedURL.searchParams.append('titan_version', __OPTIMIZER_VERSION__)\r\n\r\n if (this.options.license_key) {\r\n pageSpeedURL.searchParams.append('api_key', this.options.license_key);\r\n }\r\n\r\n const pageSpeed = await fetch(pageSpeedURL, {\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n },\r\n body: JSON.stringify({\r\n settings: settings.state?.\r\n flatMap(t =>\r\n t.inputs\r\n .filter(({ value }) => value != null)\r\n .map(({ key, value }) => ({ key, value, status: t.status })))\r\n || []\r\n })\r\n });\r\n\r\n return await pageSpeed.json()\r\n\r\n } catch (error) {\r\n console.error(error);\r\n throw error;\r\n }\r\n }\r\n\r\n async getCSSJobStatus(url: string, types: string[]): Promise {\r\n try {\r\n this.baseURL.searchParams.append('action', 'rapidload_css_job_status');\r\n this.baseURL.searchParams.append('url', url)\r\n this.baseURL.searchParams.append('types', types.join(','))\r\n\r\n const response = await fetch(this.baseURL, {\r\n method: 'GET',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n },\r\n });\r\n return this.throwIfError(response);\r\n } catch (error) {\r\n console.error(error);\r\n throw error;\r\n }\r\n }\r\n\r\n async getTestMode(url: string, mode: string): Promise {\r\n try {\r\n this.baseURL.searchParams.append('action', 'rapidload_switch_test_mode');\r\n this.baseURL.searchParams.append('url', url)\r\n this.baseURL.searchParams.append('test_mode', mode)\r\n\r\n const response = await fetch(this.baseURL, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n },\r\n\r\n });\r\n return this.throwIfError(response);\r\n } catch (error) {\r\n console.error(error);\r\n throw error;\r\n }\r\n }\r\n\r\n async updateSettings(url: string, activeReport: string, data: any, global: boolean, analyze: boolean) {\r\n try {\r\n\r\n const query = new URLSearchParams();\r\n\r\n if (this.baseURL.searchParams.get('action')) {\r\n this.baseURL.searchParams.delete('action')\r\n }\r\n\r\n this.baseURL.searchParams.append('action', 'update_titan_settings');\r\n\r\n if(global) this.baseURL.searchParams.append('global', 'true')\r\n if(analyze) this.baseURL.searchParams.append('analyze', 'true')\r\n\r\n this.baseURL.searchParams.append('url', url)\r\n this.baseURL.searchParams.append('strategy', activeReport)\r\n // this.baseURL.searchParams.append('settingsMode', settingsMode)\r\n\r\n const response = await fetch(this.baseURL, {\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n },\r\n body: JSON.stringify({\r\n settings: {\r\n general: {\r\n performance_gear: data.activeGear\r\n },\r\n performance: data.settings\r\n },\r\n }),\r\n });\r\n\r\n\r\n\r\n return this.throwIfError(response);\r\n } catch (error) {\r\n console.error(error);\r\n throw error;\r\n }\r\n }\r\n\r\n async post(action : string | null = null, queryParams: {[p: string] : string} = {}) {\r\n\r\n try {\r\n\r\n if(action) {\r\n if (this.baseURL.searchParams.get('action')) {\r\n this.baseURL.searchParams.delete('action')\r\n }\r\n this.baseURL.searchParams.append('action', action)\r\n }\r\n\r\n for (let key of Object.keys(queryParams)) {\r\n if (!this.baseURL.searchParams.has(key)) {\r\n this.baseURL.searchParams.append(key, queryParams[key]);\r\n }\r\n }\r\n\r\n const response = await fetch(this.baseURL, {\r\n method: \"GET\",\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n }\r\n });\r\n\r\n return this.throwIfError(response);\r\n } catch (error) {\r\n console.error(error);\r\n throw error;\r\n }\r\n }\r\n\r\n async request(endpoint: string,\r\n params:{[p: string] : string} = {},\r\n type: 'GET' | 'POST' | 'PUT' | 'DELETE' = 'GET'\r\n ) {\r\n\r\n let base = new URL(this.options.rest_url);\r\n\r\n try {\r\n\r\n\r\n for (let key of Object.keys(params)) {\r\n if (!base.searchParams.has(key)) {\r\n base.searchParams.append(key, params[key]);\r\n }\r\n }\r\n\r\n base.pathname += endpoint;\r\n\r\n const response = await fetch(base, {\r\n method: type,\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n }\r\n });\r\n\r\n return this.throwIfError(response);\r\n } catch (error) {\r\n console.error(error);\r\n throw error;\r\n }\r\n\r\n }\r\n rest() {\r\n return this\r\n }\r\n}\r\n\r\nexport default ApiService;\r\n","import {ThunkAction, ThunkDispatch} from 'redux-thunk';\r\nimport {AnyAction} from 'redux';\r\nimport {\r\n AppAction,\r\n CHANGE_GEAR,\r\n CHANGE_REPORT_TYPE,\r\n FETCH_REPORT_FAILURE,\r\n FETCH_REPORT_REQUEST,\r\n FETCH_REPORT_SUCCESS,\r\n FETCH_SETTING_FAILURE,\r\n FETCH_SETTING_REQUEST,\r\n FETCH_SETTING_SUCCESS,\r\n GET_CSS_STATUS_SUCCESS,\r\n RootState,\r\n UPDATE_FILE_ACTION,\r\n UPDATE_SETTINGS,\r\n UPDATE_TEST_MODE\r\n} from \"./appTypes\";\r\nimport ApiService from \"../../services/api\";\r\nimport Audit from \"app/page-optimizer/components/audit/Audit\";\r\n\r\nconst transformAudit = (audit: Audit, metrics : Metric[]) => {\r\n\r\n audit.metrics = metrics.filter(m => m?.refs?.relevantAudits?.includes(audit.id))\r\n\r\n if (audit.files && (audit.files.type === 'opportunity' || audit.files.type === 'table')) {\r\n\r\n if (audit?.files?.items?.length > 0) {\r\n\r\n audit.files.grouped_items = audit.files.items.reduce((result: GroupedAuditResource[] , item) => {\r\n\r\n let key = 'unknown'\r\n\r\n if (item.url && typeof item.url !== 'string') {\r\n const { url, file_type } = item.url;\r\n\r\n if (file_type.value) {\r\n key = file_type.value\r\n }\r\n }\r\n\r\n const existingGroup = result.find(group => group.type === key);\r\n\r\n if (existingGroup) {\r\n existingGroup.items.push(item);\r\n } else {\r\n result.push({ type: key, items: [item] });\r\n }\r\n\r\n return result;\r\n }, []);\r\n\r\n\r\n\r\n }\r\n\r\n }\r\n \r\n return audit\r\n}\r\n\r\nconst transformReport = (data: any) => {\r\n\r\n const metrics = data.data?.page_speed?.metrics.map((metric: Metric) => ({\r\n ...metric,\r\n potentialGain: metric.refs ? (metric.refs?.weight - (metric.refs?.weight / 100) * metric.score) : 0\r\n }))\r\n\r\n const audits : Audit[] = data.data.page_speed.audits\r\n .sort((a: Audit, b: Audit) => a.score - b.score)\r\n .map( (a: Audit) => transformAudit(a, metrics))\r\n\r\n const sortAuditsWithActions = (a: Audit, b: Audit) => {\r\n const aFirstCondition = a.settings.filter(s => s.inputs[0].value).length > 0;\r\n const bFirstCondition = b.settings.filter(s => s.inputs[0].value).length > 0;\r\n\r\n if (aFirstCondition && !bFirstCondition) return -1;\r\n if (!aFirstCondition && bFirstCondition) return 1;\r\n\r\n const aSecondCondition = a.settings.length > 0;\r\n const bSecondCondition = b.settings.length > 0;\r\n\r\n if (aSecondCondition && !bSecondCondition) return -1;\r\n if (!aSecondCondition && bSecondCondition) return 1;\r\n\r\n const aThirdCondition = (a.files?.items?.length || 0) > 0;\r\n const bThirdCondition = (b.files?.items?.length || 0) > 0;\r\n\r\n if (aThirdCondition && !bThirdCondition) return -1;\r\n if (!aThirdCondition && bThirdCondition) return 1;\r\n\r\n return 0;\r\n }\r\n\r\n const _data = {\r\n data: {\r\n performance: data.data.page_speed.performance ? parseFloat(data.data?.page_speed?.performance.toFixed(0)) : 0,\r\n\r\n ...data.data.page_speed,\r\n grouped : {\r\n passed_audits: audits.filter(audit => audit.type === 'passed_audit').sort(\r\n sortAuditsWithActions\r\n ),\r\n opportunities: audits.filter(audit => audit.type === 'opportunity'),\r\n diagnostics: audits.filter(audit => audit.type === \"diagnostics\")\r\n .sort((a, b) => (a.scoreDisplayMode === 'informative' ? 1 : -1)),\r\n },\r\n metrics : metrics,\r\n },\r\n\r\n success: data.success,\r\n // settings: initiateSettings(audits),\r\n revisions: data.data.revisions.map(({created_at, timestamp, data, id }: any) => {\r\n return {\r\n id,\r\n created_at,\r\n timestamp,\r\n data: {\r\n performance: data.performance\r\n }\r\n }\r\n }),\r\n individual_file_actions: data.data['individual-file-actions'],\r\n state: data.state\r\n };\r\n\r\n\r\n delete _data.data.audits\r\n return _data\r\n}\r\n\r\nconst transformSettings = (data: any) => {\r\n\r\n\r\n if (!data.success) {\r\n return data\r\n }\r\n\r\n const settings = data?.data?.performance || [];\r\n\r\n return {\r\n general: {\r\n performance_gear: data?.data?.general?.performance_gear,\r\n test_mode: data?.data?.general?.test_mode === \"1\"\r\n },\r\n actions: data?.data?.actions,\r\n data: settings.map((s: AuditSetting) => ({\r\n ...s,\r\n inputs: s.inputs.map(input => ({\r\n ...input,\r\n ...(\r\n input.control_type === 'checkbox' &&\r\n {\r\n value: input.value === '1' || input.value === true\r\n }\r\n ),\r\n ...(input.inputs && {\r\n inputs: input.inputs.map(i => {\r\n return {\r\n ...i,\r\n value: i.control_type === 'checkbox' ? i.value === '1' || i.value === true : i.value\r\n }\r\n })\r\n }),\r\n }))\r\n }))\r\n }\r\n}\r\n\r\n\r\nexport const getCSSStatus = (options: WordPressOptions, url: string, types: string[]): ThunkAction, RootState, unknown, AnyAction> => {\r\n\r\n const api = new ApiService(options);\r\n\r\n return async (dispatch: ThunkDispatch, getState) => {\r\n\r\n try {\r\n const cssJobStatusResult = await api.getCSSJobStatus(url, types);\r\n dispatch({\r\n type: GET_CSS_STATUS_SUCCESS,\r\n payload : cssJobStatusResult.data\r\n })\r\n return cssJobStatusResult?.data;\r\n\r\n } catch (error) {\r\n console.error('Error fetching CSS job status:', error);\r\n }\r\n\r\n\r\n }\r\n}\r\n// : ThunkAction =>\r\n\r\nexport const getTestModeStatus = (options: WordPressOptions, url: string, mode?: string): ThunkAction, RootState, unknown, AnyAction> => {\r\n\r\n const api = new ApiService(options);\r\n\r\n return async (dispatch: ThunkDispatch, getState): Promise<{ success: boolean, error?: string }> => {\r\n\r\n try {\r\n const fetchTestModeData = await api.getTestMode(url, mode || '');\r\n dispatch({\r\n type: UPDATE_TEST_MODE,\r\n payload : fetchTestModeData?.data\r\n })\r\n return { success: true };\r\n } catch (error: any) {\r\n console.error('Error on Test Mode:', error);\r\n let errorMessage: string;\r\n if (error instanceof Error) {\r\n errorMessage = error.message;\r\n } else if (typeof error === 'string') {\r\n errorMessage = error;\r\n } else {\r\n errorMessage = 'An unknown error occurred';\r\n }\r\n return { success: false, error: errorMessage };\r\n }\r\n\r\n\r\n }\r\n}\r\n\r\nexport const fetchReport = (options: WordPressOptions, url : string, reload = false, inprogress = false): ThunkAction => {\r\n\r\n const api = new ApiService(options);\r\n\r\n return async (dispatch: ThunkDispatch, getState) => {\r\n try {\r\n const currentState = getState(); // Access the current state\r\n const activeReport = currentState.app.activeReport;\r\n const activeReportData = currentState.app.report[activeReport]\r\n\r\n // TODO: don't let people bam on keyboard while waiting to laod the page speed\r\n // if(activeReportData.loading && activeReportData.data ) {\r\n // console.log('don\\'t bam the mouse! we are loading your page speed details 😉');\r\n // return;\r\n // }\r\n \r\n if (activeReportData.loading) {\r\n return;\r\n }\r\n\r\n if (activeReportData.data && !reload && !inprogress) {\r\n return;\r\n }\r\n\r\n dispatch({ type: FETCH_REPORT_REQUEST, activeReport });\r\n\r\n const response = await api.fetchPageSpeed(\r\n url,\r\n activeReport,\r\n reload,\r\n );\r\n\r\n\r\n dispatch({ type: FETCH_REPORT_SUCCESS, payload: {\r\n activeReport,\r\n data: transformReport(response)\r\n }});\r\n\r\n\r\n } catch (error) {\r\n if (error instanceof Error) {\r\n dispatch({ type: FETCH_REPORT_FAILURE, error: error.message });\r\n } else {\r\n dispatch({ type: FETCH_REPORT_FAILURE, error: 'Unknown error occurred' });\r\n }\r\n }\r\n };\r\n};\r\n\r\nexport const fetchSettings = (options: WordPressOptions, url : string, reload = false, inprogress = false): ThunkAction => {\r\n\r\n const api = new ApiService(options);\r\n\r\n return async (dispatch: ThunkDispatch, getState) => {\r\n try {\r\n const currentState = getState(); // Access the current state\r\n const activeReport = currentState.app.activeReport;\r\n const activeSettingsData = currentState.app.settings.performance[activeReport]\r\n\r\n // TODO: don't let people bam on keyboard while waiting to load the page speed\r\n // if(activeReportData.loading && activeReportData.data ) {\r\n // console.log('don\\'t bam the mouse! we are loading your page speed details 😉');\r\n // return;\r\n // }\r\n\r\n if (activeSettingsData.loading) {\r\n return;\r\n }\r\n\r\n if (activeSettingsData?.state?.length > 0 && !reload) {\r\n return;\r\n }\r\n\r\n dispatch({ type: FETCH_SETTING_REQUEST, activeReport });\r\n\r\n const response = await api.fetchSettings(\r\n url,\r\n activeReport,\r\n reload,\r\n );\r\n\r\n\r\n dispatch({ type: FETCH_SETTING_SUCCESS, payload: {\r\n activeReport,\r\n data: transformSettings(response),\r\n }});\r\n\r\n\r\n } catch (error) {\r\n if (error instanceof Error) {\r\n dispatch({ type: FETCH_SETTING_FAILURE, error: error.message });\r\n } else {\r\n dispatch({ type: FETCH_SETTING_FAILURE, error: 'Unknown error occurred' });\r\n }\r\n }\r\n };\r\n};\r\n\r\nexport const updateSettings = (\r\n audit: Audit,\r\n setting: AuditSetting,\r\n key: string, // key of the input\r\n payload: any, // changed value\r\n\r\n ): ThunkAction => {\r\n\r\n return async (dispatch: ThunkDispatch, getState) => {\r\n const currentState = getState(); // Access the current state\r\n const deviceType = currentState?.app?.activeReport;\r\n\r\n // @ts-ignore\r\n const newOptions: AuditSetting[] = currentState?.app?.settings.performance[deviceType]?.state?.map((s: AuditSetting) => {\r\n if (s.name !== setting.name) {\r\n return s; // Early return if the setting name doesn't match\r\n }\r\n\r\n const inputKey = key.split('.')\r\n\r\n return {\r\n ...s,\r\n inputs: s.inputs.map(input =>\r\n inputKey.length > 1 ?\r\n (input?.inputs && input.key === inputKey[0]) ? {\r\n ...input,\r\n inputs: input?.inputs.map((i: AuditSettingInput) => i.key === inputKey[1] ? {\r\n ...i,\r\n value: payload\r\n } : i)\r\n } : input :\r\n input.key === key ? {...input, value: payload} : input\r\n )\r\n }\r\n }) || [];\r\n \r\n dispatch({ type: UPDATE_SETTINGS , payload : {\r\n settings: newOptions\r\n } });\r\n }\r\n}\r\n\r\nexport const changeGear = (\r\n mode: BasePerformanceGear | PerformanceGear,\r\n): ThunkAction => {\r\n\r\n const starter = ['Remove Unused CSS', 'Minify CSS', 'Minify Javascript', 'Page Cache', 'Self Host Google Fonts'];\r\n const accelerate = [...starter, 'RapidLoad CDN', 'Serve next-gen Images', 'Lazy Load Iframes', 'Lazy Load Images', 'Exclude LCP image from Lazy Load', 'Add Width and Height Attributes', 'Defer Javascript'];\r\n const turboMax = [...accelerate, 'Delay Javascript', 'Critical CSS', 'Serve next-gen Images (AVIF, WEBP)'];\r\n\r\n return async (dispatch: ThunkDispatch, getState) => {\r\n const currentState = getState(); // Access the current state\r\n const deviceType = currentState?.app?.activeReport;\r\n const settings = currentState?.app?.settings.performance[deviceType]?.state;\r\n const activeGear = settings?.find(s => s.category === 'gear')?.inputs[0].value\r\n\r\n // don't update if the mode is sam\r\n if (activeGear === mode) {\r\n return;\r\n }\r\n\r\n const modes : {\r\n [key in BasePerformanceGear] : string[]\r\n } = {starter, accelerate, turboMax};\r\n\r\n // excluding perf gear from updates.\r\n const newOptions: AuditSetting[] = settings\r\n ?.map((s: AuditSetting) => ({\r\n ...s,\r\n inputs: s.inputs.map((input, index) => ({\r\n ...input,\r\n value: index === 0 ? (\r\n s.category === 'gear' ? mode :\r\n // update values only if it is not custom.\r\n (mode === 'custom' ? input.value : modes[mode]?.includes(s.name))\r\n // return input value for all the other sub-options\r\n ) : input.value\r\n }))\r\n })) || [];\r\n\r\n dispatch({\r\n type: CHANGE_GEAR, payload: {\r\n settings: newOptions,\r\n mode\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport const changeReport = (\r\n type: ReportType\r\n): ThunkAction => {\r\n return async (dispatch: ThunkDispatch, getState) => {\r\n dispatch({\r\n type: CHANGE_REPORT_TYPE,\r\n reportType: type\r\n })\r\n }\r\n}\r\n\r\nexport const updateFileAction = (\r\n audit: Audit,\r\n file: string,\r\n value: any,\r\n prev: any\r\n): ThunkAction => {\r\n return async (dispatch: ThunkDispatch, getState) => {\r\n \r\n dispatch({\r\n type: UPDATE_FILE_ACTION, payload : {\r\n audit: audit,\r\n file: file,\r\n value: value,\r\n prev: prev,\r\n }\r\n })\r\n }\r\n}","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n if ((a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n for (i of a.entries())\n if (!b.has(i[0])) return false;\n for (i of a.entries())\n if (!equal(i[1], b.get(i[0]))) return false;\n return true;\n }\n\n if ((a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n for (i of a.entries())\n if (!b.has(i[0])) return false;\n return true;\n }\n\n if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (key === '_owner' && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n continue;\n }\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","import { createSelector } from 'reselect';\r\nimport {RootState} from \"./appTypes\";\r\nimport equal from \"fast-deep-equal/es6/react\";\r\n\r\nexport const state = (state: RootState) => state.app;\r\n\r\nfunction optimizeChangesFiles(changes : any ) {\r\n const result = [];\r\n\r\n if (!changes?.files) {\r\n return []\r\n }\r\n\r\n for (const change of changes?.files) {\r\n let found = false;\r\n\r\n for (let i = 0; i < result.length; i++) {\r\n if (result[i].audit === change.audit.id && result[i].file === change.file) {\r\n found = true;\r\n result[i].changes.push(change.value);\r\n // @ts-ignore\r\n result[i].changed = result[i].changes[0] !== result[i].changes[result[i].changes.length - 1];\r\n break;\r\n }\r\n }\r\n\r\n if (!found) {\r\n result.push({\r\n audit: change.audit.id,\r\n file: change.file,\r\n changes: [change.value],\r\n changed: false\r\n });\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n\r\n\r\nexport const optimizerData = createSelector(\r\n state, // Input selector\r\n (state) => {\r\n\r\n const report = state.report[state.activeReport];\r\n const settings = state.settings.performance[state.activeReport];\r\n const activeGear = state.settings.general.performance_gear\r\n const actions = state.settings.actions\r\n const testMode = state.settings.general.test_mode\r\n\r\n return {\r\n ...report,\r\n activeReport: state.activeReport,\r\n settings: settings.state,\r\n settingsOriginal: settings.original,\r\n settingsLoading: settings.loading,\r\n actions,\r\n activeGear,\r\n testMode,\r\n touched: !equal(settings.original, settings.state) || !!optimizeChangesFiles(report.changes).find(i => i?.changed),\r\n fresh : report?.state?.fresh,\r\n reanalyze: report.data !== null && report.loading\r\n }\r\n }\r\n);\r\n\r\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;ttypeof value === \"boolean\" ? \"\".concat(value) : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>{\n return (props)=>{\n var ref;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants , defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1)=>{\n let { class: cvClass , className: cvClassName , ...compoundVariantOptions } = param1;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n};\n\n\n//# sourceMappingURL=index.mjs.map","import SpeedIndex from \"app/page-optimizer/spaces/Metrics\";\r\nimport {AnimatePresence, m} from \"framer-motion\";\r\nimport React, {ReactNode} from \"react\";\r\n\r\ninterface SlideUpProps {\r\n children: ReactNode\r\n uuid: string | number\r\n}\r\n\r\nconst SlideLeft = ({ children, uuid } : SlideUpProps) => {\r\n return (\r\n\r\n \r\n {children}\r\n \r\n\r\n )\r\n}\r\n\r\nexport default SlideLeft","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\nconst mergeClasses = (...classes) => classes.filter((className, index, array) => {\n return Boolean(className) && array.indexOf(className) === index;\n}).join(\" \");\n\nexport { mergeClasses, toKebabCase };\n//# sourceMappingURL=utils.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nvar defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\nimport { mergeClasses } from './shared/src/utils.js';\n\nconst Icon = forwardRef(\n ({\n color = \"currentColor\",\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = \"\",\n children,\n iconNode,\n ...rest\n }, ref) => {\n return createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: mergeClasses(\"lucide\", className),\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n );\n }\n);\n\nexport { Icon as default };\n//# sourceMappingURL=Icon.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport { mergeClasses, toKebabCase } from './shared/src/utils.js';\nimport Icon from './Icon.js';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({ className, ...props }, ref) => createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),\n ...props\n })\n );\n Component.displayName = `${iconName}`;\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Annoyed = createLucideIcon(\"Annoyed\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M8 15h8\", key: \"45n4r\" }],\n [\"path\", { d: \"M8 9h2\", key: \"1g203m\" }],\n [\"path\", { d: \"M14 9h2\", key: \"116p9w\" }]\n]);\n\nexport { Annoyed as default };\n//# sourceMappingURL=annoyed.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Archive = createLucideIcon(\"Archive\", [\n [\"rect\", { width: \"20\", height: \"5\", x: \"2\", y: \"3\", rx: \"1\", key: \"1wp1u1\" }],\n [\"path\", { d: \"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\", key: \"1s80jp\" }],\n [\"path\", { d: \"M10 12h4\", key: \"a56b0p\" }]\n]);\n\nexport { Archive as default };\n//# sourceMappingURL=archive.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ArrowLeftToLine = createLucideIcon(\"ArrowLeftToLine\", [\n [\"path\", { d: \"M3 19V5\", key: \"rwsyhb\" }],\n [\"path\", { d: \"m13 6-6 6 6 6\", key: \"1yhaz7\" }],\n [\"path\", { d: \"M7 12h14\", key: \"uoisry\" }]\n]);\n\nexport { ArrowLeftToLine as default };\n//# sourceMappingURL=arrow-left-to-line.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ArrowRightToLine = createLucideIcon(\"ArrowRightToLine\", [\n [\"path\", { d: \"M17 12H3\", key: \"8awo09\" }],\n [\"path\", { d: \"m11 18 6-6-6-6\", key: \"8c2y43\" }],\n [\"path\", { d: \"M21 5v14\", key: \"nzette\" }]\n]);\n\nexport { ArrowRightToLine as default };\n//# sourceMappingURL=arrow-right-to-line.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ArrowRight = createLucideIcon(\"ArrowRight\", [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"m12 5 7 7-7 7\", key: \"xquz4c\" }]\n]);\n\nexport { ArrowRight as default };\n//# sourceMappingURL=arrow-right.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Check = createLucideIcon(\"Check\", [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]]);\n\nexport { Check as default };\n//# sourceMappingURL=check.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ChevronDown = createLucideIcon(\"ChevronDown\", [\n [\"path\", { d: \"m6 9 6 6 6-6\", key: \"qrunsl\" }]\n]);\n\nexport { ChevronDown as default };\n//# sourceMappingURL=chevron-down.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ChevronLeft = createLucideIcon(\"ChevronLeft\", [\n [\"path\", { d: \"m15 18-6-6 6-6\", key: \"1wnfg3\" }]\n]);\n\nexport { ChevronLeft as default };\n//# sourceMappingURL=chevron-left.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ChevronRight = createLucideIcon(\"ChevronRight\", [\n [\"path\", { d: \"m9 18 6-6-6-6\", key: \"mthhwq\" }]\n]);\n\nexport { ChevronRight as default };\n//# sourceMappingURL=chevron-right.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst CircleCheckBig = createLucideIcon(\"CircleCheckBig\", [\n [\"path\", { d: \"M22 11.08V12a10 10 0 1 1-5.93-9.14\", key: \"g774vq\" }],\n [\"path\", { d: \"m9 11 3 3L22 4\", key: \"1pflzl\" }]\n]);\n\nexport { CircleCheckBig as default };\n//# sourceMappingURL=circle-check-big.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst CircleDashed = createLucideIcon(\"CircleDashed\", [\n [\"path\", { d: \"M10.1 2.182a10 10 0 0 1 3.8 0\", key: \"5ilxe3\" }],\n [\"path\", { d: \"M13.9 21.818a10 10 0 0 1-3.8 0\", key: \"11zvb9\" }],\n [\"path\", { d: \"M17.609 3.721a10 10 0 0 1 2.69 2.7\", key: \"1iw5b2\" }],\n [\"path\", { d: \"M2.182 13.9a10 10 0 0 1 0-3.8\", key: \"c0bmvh\" }],\n [\"path\", { d: \"M20.279 17.609a10 10 0 0 1-2.7 2.69\", key: \"1ruxm7\" }],\n [\"path\", { d: \"M21.818 10.1a10 10 0 0 1 0 3.8\", key: \"qkgqxc\" }],\n [\"path\", { d: \"M3.721 6.391a10 10 0 0 1 2.7-2.69\", key: \"1mcia2\" }],\n [\"path\", { d: \"M6.391 20.279a10 10 0 0 1-2.69-2.7\", key: \"1fvljs\" }]\n]);\n\nexport { CircleDashed as default };\n//# sourceMappingURL=circle-dashed.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst CircleGauge = createLucideIcon(\"CircleGauge\", [\n [\"path\", { d: \"M15.6 2.7a10 10 0 1 0 5.7 5.7\", key: \"1e0p6d\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"2\", key: \"1c9p78\" }],\n [\"path\", { d: \"M13.4 10.6 19 5\", key: \"1kr7tw\" }]\n]);\n\nexport { CircleGauge as default };\n//# sourceMappingURL=circle-gauge.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst CircleUser = createLucideIcon(\"CircleUser\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"circle\", { cx: \"12\", cy: \"10\", r: \"3\", key: \"ilqhr7\" }],\n [\"path\", { d: \"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662\", key: \"154egf\" }]\n]);\n\nexport { CircleUser as default };\n//# sourceMappingURL=circle-user.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst CircleX = createLucideIcon(\"CircleX\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"m15 9-6 6\", key: \"1uzhvr\" }],\n [\"path\", { d: \"m9 9 6 6\", key: \"z0biqf\" }]\n]);\n\nexport { CircleX as default };\n//# sourceMappingURL=circle-x.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Circle = createLucideIcon(\"Circle\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }]\n]);\n\nexport { Circle as default };\n//# sourceMappingURL=circle.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Clipboard = createLucideIcon(\"Clipboard\", [\n [\"rect\", { width: \"8\", height: \"4\", x: \"8\", y: \"2\", rx: \"1\", ry: \"1\", key: \"tgr4d6\" }],\n [\n \"path\",\n {\n d: \"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\",\n key: \"116196\"\n }\n ]\n]);\n\nexport { Clipboard as default };\n//# sourceMappingURL=clipboard.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Code = createLucideIcon(\"Code\", [\n [\"polyline\", { points: \"16 18 22 12 16 6\", key: \"z7tu5w\" }],\n [\"polyline\", { points: \"8 6 2 12 8 18\", key: \"1eg1df\" }]\n]);\n\nexport { Code as default };\n//# sourceMappingURL=code.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Dot = createLucideIcon(\"Dot\", [\n [\"circle\", { cx: \"12.1\", cy: \"12.1\", r: \"1\", key: \"18d7e5\" }]\n]);\n\nexport { Dot as default };\n//# sourceMappingURL=dot.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst EllipsisVertical = createLucideIcon(\"EllipsisVertical\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"1\", key: \"41hilf\" }],\n [\"circle\", { cx: \"12\", cy: \"5\", r: \"1\", key: \"gxeob9\" }],\n [\"circle\", { cx: \"12\", cy: \"19\", r: \"1\", key: \"lyex9k\" }]\n]);\n\nexport { EllipsisVertical as default };\n//# sourceMappingURL=ellipsis-vertical.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst FileCode2 = createLucideIcon(\"FileCode2\", [\n [\"path\", { d: \"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4\", key: \"1pf5j1\" }],\n [\"path\", { d: \"M14 2v4a2 2 0 0 0 2 2h4\", key: \"tnqrlb\" }],\n [\"path\", { d: \"m5 12-3 3 3 3\", key: \"oke12k\" }],\n [\"path\", { d: \"m9 18 3-3-3-3\", key: \"112psh\" }]\n]);\n\nexport { FileCode2 as default };\n//# sourceMappingURL=file-code-2.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst FileMinus2 = createLucideIcon(\"FileMinus2\", [\n [\"path\", { d: \"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4\", key: \"1pf5j1\" }],\n [\"path\", { d: \"M14 2v4a2 2 0 0 0 2 2h4\", key: \"tnqrlb\" }],\n [\"path\", { d: \"M3 15h6\", key: \"4e2qda\" }]\n]);\n\nexport { FileMinus2 as default };\n//# sourceMappingURL=file-minus-2.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst FileType = createLucideIcon(\"FileType\", [\n [\"path\", { d: \"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z\", key: \"1rqfz7\" }],\n [\"path\", { d: \"M14 2v4a2 2 0 0 0 2 2h4\", key: \"tnqrlb\" }],\n [\"path\", { d: \"M9 13v-1h6v1\", key: \"1bb014\" }],\n [\"path\", { d: \"M12 12v6\", key: \"3ahymv\" }],\n [\"path\", { d: \"M11 18h2\", key: \"12mj7e\" }]\n]);\n\nexport { FileType as default };\n//# sourceMappingURL=file-type.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst FoldVertical = createLucideIcon(\"FoldVertical\", [\n [\"path\", { d: \"M12 22v-6\", key: \"6o8u61\" }],\n [\"path\", { d: \"M12 8V2\", key: \"1wkif3\" }],\n [\"path\", { d: \"M4 12H2\", key: \"rhcxmi\" }],\n [\"path\", { d: \"M10 12H8\", key: \"s88cx1\" }],\n [\"path\", { d: \"M16 12h-2\", key: \"10asgb\" }],\n [\"path\", { d: \"M22 12h-2\", key: \"14jgyd\" }],\n [\"path\", { d: \"m15 19-3-3-3 3\", key: \"e37ymu\" }],\n [\"path\", { d: \"m15 5-3 3-3-3\", key: \"19d6lf\" }]\n]);\n\nexport { FoldVertical as default };\n//# sourceMappingURL=fold-vertical.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Frown = createLucideIcon(\"Frown\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M16 16s-1.5-2-4-2-4 2-4 2\", key: \"epbg0q\" }],\n [\"line\", { x1: \"9\", x2: \"9.01\", y1: \"9\", y2: \"9\", key: \"yxxnd0\" }],\n [\"line\", { x1: \"15\", x2: \"15.01\", y1: \"9\", y2: \"9\", key: \"1p4y9e\" }]\n]);\n\nexport { Frown as default };\n//# sourceMappingURL=frown.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst GraduationCap = createLucideIcon(\"GraduationCap\", [\n [\n \"path\",\n {\n d: \"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z\",\n key: \"j76jl0\"\n }\n ],\n [\"path\", { d: \"M22 10v6\", key: \"1lu8f3\" }],\n [\"path\", { d: \"M6 12.5V16a6 3 0 0 0 12 0v-3.5\", key: \"1r8lef\" }]\n]);\n\nexport { GraduationCap as default };\n//# sourceMappingURL=graduation-cap.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Hash = createLucideIcon(\"Hash\", [\n [\"line\", { x1: \"4\", x2: \"20\", y1: \"9\", y2: \"9\", key: \"4lhtct\" }],\n [\"line\", { x1: \"4\", x2: \"20\", y1: \"15\", y2: \"15\", key: \"vyu0kd\" }],\n [\"line\", { x1: \"10\", x2: \"8\", y1: \"3\", y2: \"21\", key: \"1ggp8o\" }],\n [\"line\", { x1: \"16\", x2: \"14\", y1: \"3\", y2: \"21\", key: \"weycgp\" }]\n]);\n\nexport { Hash as default };\n//# sourceMappingURL=hash.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Info = createLucideIcon(\"Info\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M12 16v-4\", key: \"1dtifu\" }],\n [\"path\", { d: \"M12 8h.01\", key: \"e9boi3\" }]\n]);\n\nexport { Info as default };\n//# sourceMappingURL=info.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Loader = createLucideIcon(\"Loader\", [\n [\"path\", { d: \"M12 2v4\", key: \"3427ic\" }],\n [\"path\", { d: \"m16.2 7.8 2.9-2.9\", key: \"r700ao\" }],\n [\"path\", { d: \"M18 12h4\", key: \"wj9ykh\" }],\n [\"path\", { d: \"m16.2 16.2 2.9 2.9\", key: \"1bxg5t\" }],\n [\"path\", { d: \"M12 18v4\", key: \"jadmvz\" }],\n [\"path\", { d: \"m4.9 19.1 2.9-2.9\", key: \"bwix9q\" }],\n [\"path\", { d: \"M2 12h4\", key: \"j09sii\" }],\n [\"path\", { d: \"m4.9 4.9 2.9 2.9\", key: \"giyufr\" }]\n]);\n\nexport { Loader as default };\n//# sourceMappingURL=loader.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Lock = createLucideIcon(\"Lock\", [\n [\"rect\", { width: \"18\", height: \"11\", x: \"3\", y: \"11\", rx: \"2\", ry: \"2\", key: \"1w4ew1\" }],\n [\"path\", { d: \"M7 11V7a5 5 0 0 1 10 0v4\", key: \"fwvmzm\" }]\n]);\n\nexport { Lock as default };\n//# sourceMappingURL=lock.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst LogOut = createLucideIcon(\"LogOut\", [\n [\"path\", { d: \"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\", key: \"1uf3rs\" }],\n [\"polyline\", { points: \"16 17 21 12 16 7\", key: \"1gabdz\" }],\n [\"line\", { x1: \"21\", x2: \"9\", y1: \"12\", y2: \"12\", key: \"1uyos4\" }]\n]);\n\nexport { LogOut as default };\n//# sourceMappingURL=log-out.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Meh = createLucideIcon(\"Meh\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"8\", x2: \"16\", y1: \"15\", y2: \"15\", key: \"1xb1d9\" }],\n [\"line\", { x1: \"9\", x2: \"9.01\", y1: \"9\", y2: \"9\", key: \"yxxnd0\" }],\n [\"line\", { x1: \"15\", x2: \"15.01\", y1: \"9\", y2: \"9\", key: \"1p4y9e\" }]\n]);\n\nexport { Meh as default };\n//# sourceMappingURL=meh.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Monitor = createLucideIcon(\"Monitor\", [\n [\"rect\", { width: \"20\", height: \"14\", x: \"2\", y: \"3\", rx: \"2\", key: \"48i651\" }],\n [\"line\", { x1: \"8\", x2: \"16\", y1: \"21\", y2: \"21\", key: \"1svkeh\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"17\", y2: \"21\", key: \"vw1qmm\" }]\n]);\n\nexport { Monitor as default };\n//# sourceMappingURL=monitor.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Moon = createLucideIcon(\"Moon\", [\n [\"path\", { d: \"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z\", key: \"a7tn18\" }]\n]);\n\nexport { Moon as default };\n//# sourceMappingURL=moon.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst RefreshCcw = createLucideIcon(\"RefreshCcw\", [\n [\"path\", { d: \"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\", key: \"14sxne\" }],\n [\"path\", { d: \"M3 3v5h5\", key: \"1xhq8a\" }],\n [\"path\", { d: \"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16\", key: \"1hlbsb\" }],\n [\"path\", { d: \"M16 16h5v5\", key: \"ccwih5\" }]\n]);\n\nexport { RefreshCcw as default };\n//# sourceMappingURL=refresh-ccw.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst RefreshCw = createLucideIcon(\"RefreshCw\", [\n [\"path\", { d: \"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\", key: \"v9h5vc\" }],\n [\"path\", { d: \"M21 3v5h-5\", key: \"1q7to0\" }],\n [\"path\", { d: \"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\", key: \"3uifl3\" }],\n [\"path\", { d: \"M8 16H3v5\", key: \"1cv678\" }]\n]);\n\nexport { RefreshCw as default };\n//# sourceMappingURL=refresh-cw.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst RemoveFormatting = createLucideIcon(\"RemoveFormatting\", [\n [\"path\", { d: \"M4 7V4h16v3\", key: \"9msm58\" }],\n [\"path\", { d: \"M5 20h6\", key: \"1h6pxn\" }],\n [\"path\", { d: \"M13 4 8 20\", key: \"kqq6aj\" }],\n [\"path\", { d: \"m15 15 5 5\", key: \"me55sn\" }],\n [\"path\", { d: \"m20 15-5 5\", key: \"11p7ol\" }]\n]);\n\nexport { RemoveFormatting as default };\n//# sourceMappingURL=remove-formatting.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst RotateCw = createLucideIcon(\"RotateCw\", [\n [\"path\", { d: \"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\", key: \"1p45f6\" }],\n [\"path\", { d: \"M21 3v5h-5\", key: \"1q7to0\" }]\n]);\n\nexport { RotateCw as default };\n//# sourceMappingURL=rotate-cw.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Save = createLucideIcon(\"Save\", [\n [\n \"path\",\n {\n d: \"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z\",\n key: \"1c8476\"\n }\n ],\n [\"path\", { d: \"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7\", key: \"1ydtos\" }],\n [\"path\", { d: \"M7 3v4a1 1 0 0 0 1 1h7\", key: \"t51u73\" }]\n]);\n\nexport { Save as default };\n//# sourceMappingURL=save.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst SmilePlus = createLucideIcon(\"SmilePlus\", [\n [\"path\", { d: \"M22 11v1a10 10 0 1 1-9-10\", key: \"ew0xw9\" }],\n [\"path\", { d: \"M8 14s1.5 2 4 2 4-2 4-2\", key: \"1y1vjs\" }],\n [\"line\", { x1: \"9\", x2: \"9.01\", y1: \"9\", y2: \"9\", key: \"yxxnd0\" }],\n [\"line\", { x1: \"15\", x2: \"15.01\", y1: \"9\", y2: \"9\", key: \"1p4y9e\" }],\n [\"path\", { d: \"M16 5h6\", key: \"1vod17\" }],\n [\"path\", { d: \"M19 2v6\", key: \"4bpg5p\" }]\n]);\n\nexport { SmilePlus as default };\n//# sourceMappingURL=smile-plus.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Smile = createLucideIcon(\"Smile\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"path\", { d: \"M8 14s1.5 2 4 2 4-2 4-2\", key: \"1y1vjs\" }],\n [\"line\", { x1: \"9\", x2: \"9.01\", y1: \"9\", y2: \"9\", key: \"yxxnd0\" }],\n [\"line\", { x1: \"15\", x2: \"15.01\", y1: \"9\", y2: \"9\", key: \"1p4y9e\" }]\n]);\n\nexport { Smile as default };\n//# sourceMappingURL=smile.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Sun = createLucideIcon(\"Sun\", [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"4\", key: \"4exip2\" }],\n [\"path\", { d: \"M12 2v2\", key: \"tus03m\" }],\n [\"path\", { d: \"M12 20v2\", key: \"1lh1kg\" }],\n [\"path\", { d: \"m4.93 4.93 1.41 1.41\", key: \"149t6j\" }],\n [\"path\", { d: \"m17.66 17.66 1.41 1.41\", key: \"ptbguv\" }],\n [\"path\", { d: \"M2 12h2\", key: \"1t8f8n\" }],\n [\"path\", { d: \"M20 12h2\", key: \"1q8mjw\" }],\n [\"path\", { d: \"m6.34 17.66-1.41 1.41\", key: \"1m8zz5\" }],\n [\"path\", { d: \"m19.07 4.93-1.41 1.41\", key: \"1shlcs\" }]\n]);\n\nexport { Sun as default };\n//# sourceMappingURL=sun.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ThumbsDown = createLucideIcon(\"ThumbsDown\", [\n [\"path\", { d: \"M17 14V2\", key: \"8ymqnk\" }],\n [\n \"path\",\n {\n d: \"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z\",\n key: \"m61m77\"\n }\n ]\n]);\n\nexport { ThumbsDown as default };\n//# sourceMappingURL=thumbs-down.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ThumbsUp = createLucideIcon(\"ThumbsUp\", [\n [\"path\", { d: \"M7 10v12\", key: \"1qc93n\" }],\n [\n \"path\",\n {\n d: \"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z\",\n key: \"emmmcr\"\n }\n ]\n]);\n\nexport { ThumbsUp as default };\n//# sourceMappingURL=thumbs-up.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Undo2 = createLucideIcon(\"Undo2\", [\n [\"path\", { d: \"M9 14 4 9l5-5\", key: \"102s5s\" }],\n [\"path\", { d: \"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11\", key: \"f3b9sd\" }]\n]);\n\nexport { Undo2 as default };\n//# sourceMappingURL=undo-2.js.map\n","/**\n * @license lucide-react v0.417.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst X = createLucideIcon(\"X\", [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n]);\n\nexport { X as default };\n//# sourceMappingURL=x.js.map\n","import * as React from \"react\"\r\nimport { Slot, Slottable } from \"@radix-ui/react-slot\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"lib/utils\"\r\nimport SlideLeft from \"components/animation/SlideLeft\";\r\nimport {Loader} from \"lucide-react\";\r\nimport {AnimatePresence} from \"framer-motion\";\r\n\r\nconst buttonVariants = cva(\r\n \"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\r\n destructive:\r\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\r\n outline:\r\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground dark:bg-accent dark:text-accent-foreground\",\r\n secondary:\r\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\r\n link: \"text-primary underline-offset-4 hover:underline\",\r\n },\r\n size: {\r\n default: \"h-10 px-4 py-2\",\r\n sm: \"h-9 rounded-md px-3\",\r\n lg: \"h-11 rounded-md px-8\",\r\n icon: \"h-10 w-10\",\r\n },\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n size: \"default\",\r\n },\r\n }\r\n)\r\n\r\nexport interface ButtonProps\r\n extends React.ButtonHTMLAttributes,\r\n VariantProps {\r\n asChild?: boolean\r\n loading?: boolean\r\n}\r\n\r\nconst Button = React.forwardRef(\r\n ({ loading, children, className, variant, size, asChild = false, ...props }, ref) => {\r\n const Comp = asChild ? 'div' as 'button' : \"button\"\r\n\r\n\r\n\r\n return (\r\n \r\n \r\n {loading &&\r\n \r\n \r\n \r\n }\r\n \r\n\r\n {children} \r\n )\r\n }\r\n)\r\nButton.displayName = \"Button\"\r\n\r\nexport { Button, buttonVariants }\r\n","import {ReactNode, MouseEvent} from \"react\";\r\nimport {cn} from \"lib/utils\";\r\nimport {Button, buttonVariants} from \"components/ui/button\";\r\nimport * as React from \"react\";\r\nimport {VariantProps} from \"class-variance-authority\";\r\nimport {ChevronDown} from \"lucide-react\";\r\n\r\n\r\nexport interface ButtonProps\r\n extends React.ButtonHTMLAttributes,\r\n VariantProps {\r\n asChild?: boolean\r\n}\r\n\r\nconst AppButton = ({children, className, ...props}: ButtonProps) => {\r\n\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\nexport default AppButton","\"use client\";\n\n// packages/react/dialog/src/Dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContext, createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: forwardedRef,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n useFocusGuards();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: composedRefs,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ),\n /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })\n ] })\n ] });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar TITLE_WARNING_NAME = \"DialogTitleWarning\";\nvar [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"dialog\"\n});\nvar TitleWarning = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n return null;\n};\nvar DESCRIPTION_WARNING_NAME = \"DialogDescriptionWarning\";\nvar DescriptionWarning = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute(\"aria-describedby\");\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n return null;\n};\nvar Root = Dialog;\nvar Trigger = DialogTrigger;\nvar Portal = DialogPortal;\nvar Overlay = DialogOverlay;\nvar Content = DialogContent;\nvar Title = DialogTitle;\nvar Description = DialogDescription;\nvar Close = DialogClose;\nexport {\n Close,\n Content,\n Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// packages/react/alert-dialog/src/AlertDialog.tsx\nimport * as React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { createDialogScope } from \"@radix-ui/react-dialog\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Slottable } from \"@radix-ui/react-slot\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar ROOT_NAME = \"AlertDialog\";\nvar [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [\n createDialogScope\n]);\nvar useDialogScope = createDialogScope();\nvar AlertDialog = (props) => {\n const { __scopeAlertDialog, ...alertDialogProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...dialogScope, ...alertDialogProps, modal: true });\n};\nAlertDialog.displayName = ROOT_NAME;\nvar TRIGGER_NAME = \"AlertDialogTrigger\";\nvar AlertDialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...triggerProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ...dialogScope, ...triggerProps, ref: forwardedRef });\n }\n);\nAlertDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"AlertDialogPortal\";\nvar AlertDialogPortal = (props) => {\n const { __scopeAlertDialog, ...portalProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...dialogScope, ...portalProps });\n};\nAlertDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"AlertDialogOverlay\";\nvar AlertDialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...overlayProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { ...dialogScope, ...overlayProps, ref: forwardedRef });\n }\n);\nAlertDialogOverlay.displayName = OVERLAY_NAME;\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME);\nvar AlertDialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, children, ...contentProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const cancelRef = React.useRef(null);\n return /* @__PURE__ */ jsx(\n DialogPrimitive.WarningProvider,\n {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ jsx(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ jsxs(\n DialogPrimitive.Content,\n {\n role: \"alertdialog\",\n ...dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {\n event.preventDefault();\n cancelRef.current?.focus({ preventScroll: true });\n }),\n onPointerDownOutside: (event) => event.preventDefault(),\n onInteractOutside: (event) => event.preventDefault(),\n children: [\n /* @__PURE__ */ jsx(Slottable, { children }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef })\n ]\n }\n ) })\n }\n );\n }\n);\nAlertDialogContent.displayName = CONTENT_NAME;\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...titleProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Title, { ...dialogScope, ...titleProps, ref: forwardedRef });\n }\n);\nAlertDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescription = React.forwardRef((props, forwardedRef) => {\n const { __scopeAlertDialog, ...descriptionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Description, { ...dialogScope, ...descriptionProps, ref: forwardedRef });\n});\nAlertDialogDescription.displayName = DESCRIPTION_NAME;\nvar ACTION_NAME = \"AlertDialogAction\";\nvar AlertDialogAction = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...actionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...actionProps, ref: forwardedRef });\n }\n);\nAlertDialogAction.displayName = ACTION_NAME;\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...cancelProps } = props;\n const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const ref = useComposedRefs(forwardedRef, cancelRef);\n return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...cancelProps, ref });\n }\n);\nAlertDialogCancel.displayName = CANCEL_NAME;\nvar DescriptionWarning = ({ contentRef }) => {\n const MESSAGE = `\\`${CONTENT_NAME}\\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \\`${CONTENT_NAME}\\` by passing a \\`${DESCRIPTION_NAME}\\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \\`id\\` and passing the same value to the \\`aria-describedby\\` prop in \\`${CONTENT_NAME}\\`. If the description is confusing or duplicative for sighted users, you can use the \\`@radix-ui/react-visually-hidden\\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;\n React.useEffect(() => {\n const hasDescription = document.getElementById(\n contentRef.current?.getAttribute(\"aria-describedby\")\n );\n if (!hasDescription) console.warn(MESSAGE);\n }, [MESSAGE, contentRef]);\n return null;\n};\nvar Root2 = AlertDialog;\nvar Trigger2 = AlertDialogTrigger;\nvar Portal2 = AlertDialogPortal;\nvar Overlay2 = AlertDialogOverlay;\nvar Content2 = AlertDialogContent;\nvar Action = AlertDialogAction;\nvar Cancel = AlertDialogCancel;\nvar Title2 = AlertDialogTitle;\nvar Description2 = AlertDialogDescription;\nexport {\n Action,\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n Cancel,\n Content2 as Content,\n Description2 as Description,\n Overlay2 as Overlay,\n Portal2 as Portal,\n Root2 as Root,\n Title2 as Title,\n Trigger2 as Trigger,\n createAlertDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from \"react\"\r\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\"\r\n\r\nimport { cn } from \"lib/utils\"\r\nimport { buttonVariants } from \"@/components/ui/button\"\r\n\r\nconst AlertDialog = AlertDialogPrimitive.Root\r\n\r\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger\r\n\r\nconst AlertDialogPortal = ({\r\n className,\r\n ...props\r\n}: AlertDialogPrimitive.AlertDialogPortalProps & { className?: string }) => (\r\n \r\n)\r\nAlertDialogPortal.displayName = AlertDialogPrimitive.Portal.displayName\r\n\r\nconst AlertDialogOverlay = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, children, ...props }, ref) => (\r\n \r\n))\r\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName\r\n\r\ntype AlertDialogContentProps = React.ComponentPropsWithoutRef & {\r\n container?: typeof document.body;\r\n};\r\n\r\nconst AlertDialogContent = React.forwardRef<\r\n React.ElementRef,\r\n AlertDialogContentProps\r\n>(({ className, ...props }, refEl) => (\r\n \r\n \r\n \r\n \r\n))\r\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName\r\n\r\nconst AlertDialogHeader = ({\r\n className,\r\n ...props\r\n}: React.HTMLAttributes) => (\r\n
\r\n)\r\nAlertDialogHeader.displayName = \"AlertDialogHeader\"\r\n\r\nconst AlertDialogFooter = ({\r\n className,\r\n ...props\r\n}: React.HTMLAttributes) => (\r\n
\r\n)\r\nAlertDialogFooter.displayName = \"AlertDialogFooter\"\r\n\r\nconst AlertDialogTitle = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName\r\n\r\nconst AlertDialogDescription = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nAlertDialogDescription.displayName =\r\n AlertDialogPrimitive.Description.displayName\r\n\r\nconst AlertDialogAction = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName\r\n\r\nconst AlertDialogCancel = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName\r\n\r\nexport {\r\n AlertDialog,\r\n AlertDialogTrigger,\r\n AlertDialogContent,\r\n AlertDialogHeader,\r\n AlertDialogFooter,\r\n AlertDialogTitle,\r\n AlertDialogDescription,\r\n AlertDialogAction,\r\n AlertDialogCancel,\r\n}\r\n","import * as React from \"react\";\nfunction ArrowLeftCircleIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-4.28 9.22a.75.75 0 0 0 0 1.06l3 3a.75.75 0 1 0 1.06-1.06l-1.72-1.72h5.69a.75.75 0 0 0 0-1.5h-5.69l1.72-1.72a.75.75 0 0 0-1.06-1.06l-3 3Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ArrowLeftCircleIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction ArrowPathIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ArrowPathIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction BoltIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M14.615 1.595a.75.75 0 0 1 .359.852L12.982 9.75h7.268a.75.75 0 0 1 .548 1.262l-10.5 11.25a.75.75 0 0 1-1.272-.71l1.992-7.302H3.75a.75.75 0 0 1-.548-1.262l10.5-11.25a.75.75 0 0 1 .913-.143Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(BoltIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction CheckCircleIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(CheckCircleIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction CheckIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(CheckIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction ChevronDownIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ChevronDownIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction ChevronRightIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ChevronRightIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction MinusCircleIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(MinusCircleIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction PlusCircleIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 9a.75.75 0 0 0-1.5 0v2.25H9a.75.75 0 0 0 0 1.5h2.25V15a.75.75 0 0 0 1.5 0v-2.25H15a.75.75 0 0 0 0-1.5h-2.25V9Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(PlusCircleIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction XCircleIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(XCircleIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction XMarkIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(XMarkIcon);\nexport default ForwardRef;","export const semver = /^[v^~<>=]*?(\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+)(?:\\.([x*]|\\d+))?(?:-([\\da-z\\-]+(?:\\.[\\da-z\\-]+)*))?(?:\\+[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?)?)?$/i;\nexport const validateAndParse = (version) => {\n if (typeof version !== 'string') {\n throw new TypeError('Invalid argument expected string');\n }\n const match = version.match(semver);\n if (!match) {\n throw new Error(`Invalid argument not valid semver ('${version}' received)`);\n }\n match.shift();\n return match;\n};\nconst isWildcard = (s) => s === '*' || s === 'x' || s === 'X';\nconst tryParse = (v) => {\n const n = parseInt(v, 10);\n return isNaN(n) ? v : n;\n};\nconst forceType = (a, b) => typeof a !== typeof b ? [String(a), String(b)] : [a, b];\nconst compareStrings = (a, b) => {\n if (isWildcard(a) || isWildcard(b))\n return 0;\n const [ap, bp] = forceType(tryParse(a), tryParse(b));\n if (ap > bp)\n return 1;\n if (ap < bp)\n return -1;\n return 0;\n};\nexport const compareSegments = (a, b) => {\n for (let i = 0; i < Math.max(a.length, b.length); i++) {\n const r = compareStrings(a[i] || '0', b[i] || '0');\n if (r !== 0)\n return r;\n }\n return 0;\n};\n//# sourceMappingURL=utils.js.map","import { compareSegments, validateAndParse } from './utils.js';\n/**\n * Compare [semver](https://semver.org/) version strings to find greater, equal or lesser.\n * This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`.\n * @param v1 - First version to compare\n * @param v2 - Second version to compare\n * @returns Numeric value compatible with the [Array.sort(fn) interface](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters).\n */\nexport const compareVersions = (v1, v2) => {\n // validate input and split into segments\n const n1 = validateAndParse(v1);\n const n2 = validateAndParse(v2);\n // pop off the patch\n const p1 = n1.pop();\n const p2 = n2.pop();\n // validate numbers\n const r = compareSegments(n1, n2);\n if (r !== 0)\n return r;\n // validate pre-release\n if (p1 && p2) {\n return compareSegments(p1.split('.'), p2.split('.'));\n }\n else if (p1 || p2) {\n return p1 ? -1 : 1;\n }\n return 0;\n};\n//# sourceMappingURL=compareVersions.js.map","import React, {useCallback, useEffect} from \"react\";\r\nimport ApiService from \"../services/api\";\r\nimport {CheckCircleIcon, XCircleIcon} from \"@heroicons/react/24/solid\";\r\nimport {fetchReport} from \"../store/app/appActions\";\r\nimport {useAppContext} from \"../context/app\";\r\nimport {useToast} from \"components/ui/use-toast\";\r\nimport {useDispatch, useSelector} from \"react-redux\";\r\nimport {optimizerData} from \"../store/app/appSelector\";\r\nimport {ThunkDispatch} from \"redux-thunk\";\r\nimport {AppAction, RootState} from \"../store/app/appTypes\";\r\nimport { compareVersions } from 'compare-versions';\r\nimport {setCommonState} from \"../store/common/commonActions\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\n\r\nconst useSubmitSettings = () => {\r\n\r\n const {\r\n setShowOptimizer,\r\n options ,\r\n modeData,\r\n savingData,\r\n setSavingData,\r\n invalidatingCache,\r\n setInvalidatingCache,\r\n global,\r\n } = useAppContext()\r\n\r\n\r\n\r\n const dispatch: ThunkDispatch = useDispatch();\r\n const { settingsMode } = useCommonDispatch()\r\n\r\n const {\r\n fresh,\r\n touched,\r\n activeReport,\r\n data,\r\n settings,\r\n activeGear\r\n } =\r\n useSelector(optimizerData)\r\n\r\n //omit grouped from data and updateData\r\n const { grouped, ...restData } = data || {};\r\n const updatedData = {\r\n ...restData,\r\n settingsMode: settingsMode,\r\n };\r\n\r\n const url = options?.optimizer_url;\r\n const { toast } = useToast()\r\n\r\n\r\n const submitSettings = useCallback(async (analyze = false, global = false) => {\r\n\r\n if (savingData) {\r\n return;\r\n }\r\n\r\n const api = new ApiService(options);\r\n\r\n try {\r\n\r\n\r\n setSavingData(true);\r\n\r\n\r\n const res = await api.updateSettings(\r\n url,\r\n activeReport,\r\n {\r\n settings,\r\n activeGear\r\n },\r\n global,\r\n analyze,\r\n );\r\n\r\n toast({\r\n description: Your settings have been saved successfully
,\r\n })\r\n\r\n if (analyze) {\r\n setSavingData(false)\r\n\r\n const USER_AGENTS = {\r\n mobile: 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.133 Mobile Safari/537.36',\r\n desktop: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'\r\n };\r\n\r\n try{\r\n setInvalidatingCache(true)\r\n await api.post('clear_page_cache', {\r\n url\r\n })\r\n\r\n const rest = api.rest()\r\n\r\n if(compareVersions(options?.rapidload_version, '2.2.11') > 0){\r\n await api.post(`preload_page`, {\r\n url: options.optimizer_url,\r\n user_agent: activeReport === 'mobile' ? USER_AGENTS.mobile : USER_AGENTS.desktop,\r\n nonce: options.nonce as string,\r\n job_id: data?.job_id as string,\r\n });\r\n }else{\r\n await rest.request('/ping', {\r\n 'url' : options.optimizer_url,\r\n 'user_agent' : activeReport === 'mobile' ? USER_AGENTS.mobile : USER_AGENTS.desktop,\r\n 'nonce': options?.nonce as string,\r\n 'job_id': data?.job_id as string,\r\n })\r\n }\r\n\r\n setInvalidatingCache(false)\r\n }\r\n catch (e: any) {\r\n setInvalidatingCache(false)\r\n toast({\r\n description: {e.message}
,\r\n })\r\n }\r\n\r\n dispatch(fetchReport(options, url, true));\r\n\r\n }else if(!analyze){\r\n\r\n }\r\n\r\n\r\n\r\n } catch (error: any) {\r\n toast({\r\n description: {error.message}
,\r\n })\r\n\r\n }\r\n\r\n\r\n setSavingData(false)\r\n setInvalidatingCache(false)\r\n\r\n }, [data, activeReport, savingData, invalidatingCache, settings, activeGear ])\r\n\r\n return {\r\n submitSettings\r\n }\r\n}\r\n\r\nexport default useSubmitSettings","import {\r\n AlertDialog,\r\n AlertDialogAction,\r\n AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter,\r\n AlertDialogHeader, AlertDialogTitle,\r\n AlertDialogTrigger\r\n} from \"components/ui/alert-dialog\";\r\nimport {ReactNode, useEffect} from \"react\";\r\nimport {useSelector} from \"react-redux\";\r\nimport {optimizerData} from \"../../../../store/app/appSelector\";\r\nimport useSubmitSettings from \"hooks/useSubmitSettings\";\r\nimport {XIcon} from \"lucide-react\";\r\nimport { Cancel } from \"@radix-ui/react-alert-dialog\"\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\nimport {setCommonState} from \"../../../../store/common/commonActions\";\r\nimport {ThunkDispatch} from \"redux-thunk\";\r\nimport {AppAction, RootState} from \"../../../../store/app/appTypes\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\nimport {useAppContext} from \"../../../../context/app\";\r\nimport {fetchSettings} from \"../../../../store/app/appActions\";\r\n\r\ninterface Props {\r\n children: ReactNode\r\n onClick: () => void\r\n onCancel?: () => void\r\n title?: string\r\n description?: string\r\n action?: string\r\n cancel?: string\r\n performanceGear?: boolean\r\n}\r\n\r\nconst UnsavedChanges = ({children , onClick, title, description, action = 'Save & Exit', onCancel, cancel, performanceGear }: Props) => {\r\n\r\n const { touched, fresh, settings, settingsOriginal } = useSelector(optimizerData)\r\n const { submitSettings } = useSubmitSettings()\r\n\r\n if(!performanceGear){\r\n if (!(fresh ? true : touched)) {\r\n return onClick()} >\r\n {children}\r\n
\r\n }\r\n }\r\n\r\n const submit = async () => {\r\n\r\n //await submitSettings(action === 'Save & Analyze');\r\n if(!performanceGear){\r\n await submitSettings(false);\r\n }\r\n onClick();\r\n\r\n\r\n }\r\n\r\n // useEffect(() => {\r\n // if(!loading){\r\n // dispatch(fetchSettings(options, options.optimizer_url, true))\r\n // }\r\n // }, [loading]);\r\n\r\n return (\r\n \r\n \r\n \r\n {children}\r\n
\r\n \r\n \r\n \r\n
\r\n {title ? title: 'Continue without Saving?'}\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {description ? description : 'You have changes that haven\\'t been saved. If you are leave now, your edits will be lost.'}\r\n
\r\n \r\n\r\n \r\n
\r\n submit()}>{action} \r\n\r\n onCancel && onCancel() }>\r\n {cancel ? cancel : 'Discard'}\r\n \r\n \r\n
\r\n \r\n \r\n );\r\n}\r\n\r\nexport default UnsavedChanges","import {useEffect, useState} from \"react\";\r\nimport {timeAgo} from \"lib/utils\";\r\n\r\ninterface TimeAgoProps {\r\n timestamp: number\r\n}\r\n\r\nconst TimeAgo = ({ timestamp }: TimeAgoProps) => {\r\n\r\n const x = timeAgo(timestamp)\r\n const [time, setTime] = useState(x)\r\n\r\n\r\n useEffect(() => {\r\n const interval = setInterval(() => {\r\n setTime(timeAgo(timestamp)); // This will cause a re-render\r\n }, 1000 * 60); // Every 5 seconds\r\n return () => clearInterval(interval); // Cleanup on component unmount\r\n }, []); // Empty dependency array to run this effect once on mount\r\n\r\n\r\n return <>{timeAgo(timestamp)}>\r\n}\r\n\r\nexport default TimeAgo","import {cn} from \"lib/utils\";\r\nimport {ArrowTopRightOnSquareIcon} from \"@heroicons/react/24/outline\";\r\nimport TimeAgo from \"components/TimeAgo\";\r\nimport React, {useState} from \"react\";\r\nimport {useAppContext} from \"../../../../context/app\";\r\nimport {useSelector} from \"react-redux\";\r\nimport {optimizerData} from \"../../../../store/app/appSelector\";\r\nimport {ArrowDown, ArrowUp, Dot} from \"lucide-react\";\r\nimport {AppState, RootState} from \"../../../../store/app/appTypes\";\r\n\r\n\r\nconst UrlPreview = () => {\r\n\r\n const [isFaviconLoaded, setIsFaviconLoaded] = useState(false)\r\n const {data, loading, error, activeReport} = useSelector(optimizerData);\r\n const { report} = useSelector((state: RootState) => state.app);\r\n const { mobile, desktop } = report\r\n\r\n const {\r\n togglePerformance,\r\n options\r\n } = useAppContext()\r\n\r\n const url = options.optimizer_url\r\n\r\n return \r\n
\r\n
\r\n {data?.loadingExperience?.initial_url ? decodeURIComponent(data.loadingExperience.initial_url.replace('?rapidload_preview', '')) : url}\r\n {/*
*/}\r\n
\r\n\r\n {!error &&\r\n
\r\n {!data ?\r\n
:\r\n <>\r\n {data?.loadingExperience?.timestamp &&\r\n <>\r\n Last analyzed
\r\n >\r\n }\r\n\r\n {activeReport === 'mobile' && desktop?.data?.performance &&\r\n <>\r\n \r\n \r\n {Number(desktop?.data?.performance).toFixed(0)} Desktop\r\n
\r\n >\r\n }\r\n\r\n\r\n {activeReport === 'desktop' && mobile?.data?.performance &&\r\n <>\r\n \r\n \r\n {Number(mobile?.data?.performance).toFixed(0)} Mobile\r\n
\r\n >\r\n }\r\n >}\r\n\r\n \r\n\r\n }\r\n
\r\n
\r\n}\r\n\r\nexport default UrlPreview","import {useAppContext} from \"../../../context/app\";\r\nimport {ReactNode} from \"react\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\n\r\ninterface ModeProps {\r\n mode?: RapidLoadOptimizerModes\r\n // children: (props: ModeRenderProps ) => JSX.Element\r\n children: ReactNode\r\n}\r\nconst Mode = ({ children, mode = 'normal' }: ModeProps) => {\r\n const { mode: _mode } = useCommonDispatch()\r\n\r\n if (mode === _mode) {\r\n return <>{children}>\r\n }\r\n\r\n return <>>\r\n}\r\n\r\nexport default Mode","\"use client\";\n\n// packages/react/roving-focus/src/RovingFocusGroup.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId,\n onChange: onCurrentTabStopIdChange\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n })\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// packages/react/menu/src/Menu.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs, composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport * as RovingFocusGroup from \"@radix-ui/react-roving-focus\";\nimport { createRovingFocusGroupScope } from \"@radix-ui/react-roving-focus\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SELECTION_KEYS = [\"Enter\", \" \"];\nvar FIRST_KEYS = [\"ArrowDown\", \"PageUp\", \"Home\"];\nvar LAST_KEYS = [\"ArrowUp\", \"PageDown\", \"End\"];\nvar FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nvar SUB_OPEN_KEYS = {\n ltr: [...SELECTION_KEYS, \"ArrowRight\"],\n rtl: [...SELECTION_KEYS, \"ArrowLeft\"]\n};\nvar SUB_CLOSE_KEYS = {\n ltr: [\"ArrowLeft\"],\n rtl: [\"ArrowRight\"]\n};\nvar MENU_NAME = \"Menu\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);\nvar [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [\n createCollectionScope,\n createPopperScope,\n createRovingFocusGroupScope\n]);\nvar usePopperScope = createPopperScope();\nvar useRovingFocusGroupScope = createRovingFocusGroupScope();\nvar [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);\nvar [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);\nvar Menu = (props) => {\n const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;\n const popperScope = usePopperScope(__scopeMenu);\n const [content, setContent] = React.useState(null);\n const isUsingKeyboardRef = React.useRef(false);\n const handleOpenChange = useCallbackRef(onOpenChange);\n const direction = useDirection(dir);\n React.useEffect(() => {\n const handleKeyDown = () => {\n isUsingKeyboardRef.current = true;\n document.addEventListener(\"pointerdown\", handlePointer, { capture: true, once: true });\n document.addEventListener(\"pointermove\", handlePointer, { capture: true, once: true });\n };\n const handlePointer = () => isUsingKeyboardRef.current = false;\n document.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n document.removeEventListener(\"pointerdown\", handlePointer, { capture: true });\n document.removeEventListener(\"pointermove\", handlePointer, { capture: true });\n };\n }, []);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuRootProvider,\n {\n scope: __scopeMenu,\n onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]),\n isUsingKeyboardRef,\n dir: direction,\n modal,\n children\n }\n )\n }\n ) });\n};\nMenu.displayName = MENU_NAME;\nvar ANCHOR_NAME = \"MenuAnchor\";\nvar MenuAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...anchorProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nMenuAnchor.displayName = ANCHOR_NAME;\nvar PORTAL_NAME = \"MenuPortal\";\nvar [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar MenuPortal = (props) => {\n const { __scopeMenu, forceMount, children, container } = props;\n const context = useMenuContext(PORTAL_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nMenuPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"MenuContent\";\nvar [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME);\nvar MenuContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });\n }\n);\nvar MenuRootContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const content = ref.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: context.open,\n disableOutsideScroll: true,\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n ),\n onDismiss: () => context.onOpenChange(false)\n }\n );\n }\n);\nvar MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n onDismiss: () => context.onOpenChange(false)\n }\n );\n});\nvar MenuContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeMenu,\n loop = false,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEntryFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n disableOutsideScroll,\n ...contentProps\n } = props;\n const context = useMenuContext(CONTENT_NAME, __scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const getItems = useCollection(__scopeMenu);\n const [currentItemId, setCurrentItemId] = React.useState(null);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n const timerRef = React.useRef(0);\n const searchRef = React.useRef(\"\");\n const pointerGraceTimerRef = React.useRef(0);\n const pointerGraceIntentRef = React.useRef(null);\n const pointerDirRef = React.useRef(\"right\");\n const lastPointerXRef = React.useRef(0);\n const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment;\n const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;\n const handleTypeaheadSearch = (key) => {\n const search = searchRef.current + key;\n const items = getItems().filter((item) => !item.disabled);\n const currentItem = document.activeElement;\n const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;\n const values = items.map((item) => item.textValue);\n const nextMatch = getNextMatch(values, search, currentMatch);\n const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n (function updateSearch(value) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = window.setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n if (newItem) {\n setTimeout(() => newItem.focus());\n }\n };\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n useFocusGuards();\n const isPointerMovingToSubmenu = React.useCallback((event) => {\n const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentProvider,\n {\n scope: __scopeMenu,\n searchRef,\n onItemEnter: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n onItemLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) return;\n contentRef.current?.focus();\n setCurrentItemId(null);\n },\n [isPointerMovingToSubmenu]\n ),\n onTriggerLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n pointerGraceTimerRef,\n onPointerGraceIntentChange: React.useCallback((intent) => {\n pointerGraceIntentRef.current = intent;\n }, []),\n children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n trapped: trapFocus,\n onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {\n event.preventDefault();\n contentRef.current?.focus({ preventScroll: true });\n }),\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n children: /* @__PURE__ */ jsx(\n RovingFocusGroup.Root,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n dir: rootContext.dir,\n orientation: \"vertical\",\n loop,\n currentTabStopId: currentItemId,\n onCurrentTabStopIdChange: setCurrentItemId,\n onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {\n if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n }),\n preventScrollOnEntryFocus: true,\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n role: \"menu\",\n \"aria-orientation\": \"vertical\",\n \"data-state\": getOpenState(context.open),\n \"data-radix-menu-content\": \"\",\n dir: rootContext.dir,\n ...popperScope,\n ...contentProps,\n ref: composedRefs,\n style: { outline: \"none\", ...contentProps.style },\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const target = event.target;\n const isKeyDownInside = target.closest(\"[data-radix-menu-content]\") === event.currentTarget;\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n const isCharacterKey = event.key.length === 1;\n if (isKeyDownInside) {\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n }\n const content = contentRef.current;\n if (event.target !== content) return;\n if (!FIRST_LAST_KEYS.includes(event.key)) return;\n event.preventDefault();\n const items = getItems().filter((item) => !item.disabled);\n const candidateNodes = items.map((item) => item.ref.current);\n if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n focusFirst(candidateNodes);\n }),\n onBlur: composeEventHandlers(props.onBlur, (event) => {\n if (!event.currentTarget.contains(event.target)) {\n window.clearTimeout(timerRef.current);\n searchRef.current = \"\";\n }\n }),\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n const target = event.target;\n const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n if (event.currentTarget.contains(target) && pointerXHasChanged) {\n const newDir = event.clientX > lastPointerXRef.current ? \"right\" : \"left\";\n pointerDirRef.current = newDir;\n lastPointerXRef.current = event.clientX;\n }\n })\n )\n }\n )\n }\n )\n }\n )\n }\n ) })\n }\n );\n }\n);\nMenuContent.displayName = CONTENT_NAME;\nvar GROUP_NAME = \"MenuGroup\";\nvar MenuGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...groupProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { role: \"group\", ...groupProps, ref: forwardedRef });\n }\n);\nMenuGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"MenuLabel\";\nvar MenuLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...labelProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });\n }\n);\nMenuLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"MenuItem\";\nvar ITEM_SELECT = \"menu.itemSelect\";\nvar MenuItem = React.forwardRef(\n (props, forwardedRef) => {\n const { disabled = false, onSelect, ...itemProps } = props;\n const ref = React.useRef(null);\n const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = React.useRef(false);\n const handleSelect = () => {\n const menuItem = ref.current;\n if (!disabled && menuItem) {\n const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });\n menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });\n dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n if (itemSelectEvent.defaultPrevented) {\n isPointerDownRef.current = false;\n } else {\n rootContext.onClose();\n }\n }\n };\n return /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n ...itemProps,\n ref: composedRefs,\n disabled,\n onClick: composeEventHandlers(props.onClick, handleSelect),\n onPointerDown: (event) => {\n props.onPointerDown?.(event);\n isPointerDownRef.current = true;\n },\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n if (!isPointerDownRef.current) event.currentTarget?.click();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (disabled || isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) {\n event.currentTarget.click();\n event.preventDefault();\n }\n })\n }\n );\n }\n);\nMenuItem.displayName = ITEM_NAME;\nvar MenuItemImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;\n const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [isFocused, setIsFocused] = React.useState(false);\n const [textContent, setTextContent] = React.useState(\"\");\n React.useEffect(() => {\n const menuItem = ref.current;\n if (menuItem) {\n setTextContent((menuItem.textContent ?? \"\").trim());\n }\n }, [itemProps.children]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeMenu,\n disabled,\n textValue: textValue ?? textContent,\n children: /* @__PURE__ */ jsx(RovingFocusGroup.Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"menuitem\",\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n ...itemProps,\n ref: composedRefs,\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n if (disabled) {\n contentContext.onItemLeave(event);\n } else {\n contentContext.onItemEnter(event);\n if (!event.defaultPrevented) {\n const item = event.currentTarget;\n item.focus({ preventScroll: true });\n }\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => contentContext.onItemLeave(event))\n ),\n onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))\n }\n ) })\n }\n );\n }\n);\nvar CHECKBOX_ITEM_NAME = \"MenuCheckboxItem\";\nvar MenuCheckboxItem = React.forwardRef(\n (props, forwardedRef) => {\n const { checked = false, onCheckedChange, ...checkboxItemProps } = props;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemcheckbox\",\n \"aria-checked\": isIndeterminate(checked) ? \"mixed\" : checked,\n ...checkboxItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n checkboxItemProps.onSelect,\n () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\nvar RADIO_GROUP_NAME = \"MenuRadioGroup\";\nvar [RadioGroupProvider, useRadioGroupContext] = createMenuContext(\n RADIO_GROUP_NAME,\n { value: void 0, onValueChange: () => {\n } }\n);\nvar MenuRadioGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { value, onValueChange, ...groupProps } = props;\n const handleValueChange = useCallbackRef(onValueChange);\n return /* @__PURE__ */ jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });\n }\n);\nMenuRadioGroup.displayName = RADIO_GROUP_NAME;\nvar RADIO_ITEM_NAME = \"MenuRadioItem\";\nvar MenuRadioItem = React.forwardRef(\n (props, forwardedRef) => {\n const { value, ...radioItemProps } = props;\n const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);\n const checked = value === context.value;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemradio\",\n \"aria-checked\": checked,\n ...radioItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n radioItemProps.onSelect,\n () => context.onValueChange?.(value),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuRadioItem.displayName = RADIO_ITEM_NAME;\nvar ITEM_INDICATOR_NAME = \"MenuItemIndicator\";\nvar [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(\n ITEM_INDICATOR_NAME,\n { checked: false }\n);\nvar MenuItemIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;\n const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(\n Presence,\n {\n present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...itemIndicatorProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(indicatorContext.checked)\n }\n )\n }\n );\n }\n);\nMenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\nvar SEPARATOR_NAME = \"MenuSeparator\";\nvar MenuSeparator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...separatorProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"separator\",\n \"aria-orientation\": \"horizontal\",\n ...separatorProps,\n ref: forwardedRef\n }\n );\n }\n);\nMenuSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"MenuArrow\";\nvar MenuArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nMenuArrow.displayName = ARROW_NAME;\nvar SUB_NAME = \"MenuSub\";\nvar [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);\nvar MenuSub = (props) => {\n const { __scopeMenu, children, open = false, onOpenChange } = props;\n const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const [trigger, setTrigger] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const handleOpenChange = useCallbackRef(onOpenChange);\n React.useEffect(() => {\n if (parentMenuContext.open === false) handleOpenChange(false);\n return () => handleOpenChange(false);\n }, [parentMenuContext.open, handleOpenChange]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuSubProvider,\n {\n scope: __scopeMenu,\n contentId: useId(),\n triggerId: useId(),\n trigger,\n onTriggerChange: setTrigger,\n children\n }\n )\n }\n ) });\n};\nMenuSub.displayName = SUB_NAME;\nvar SUB_TRIGGER_NAME = \"MenuSubTrigger\";\nvar MenuSubTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const openTimerRef = React.useRef(null);\n const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n const scope = { __scopeMenu: props.__scopeMenu };\n const clearOpenTimer = React.useCallback(() => {\n if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }, []);\n React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n React.useEffect(() => {\n const pointerGraceTimer = pointerGraceTimerRef.current;\n return () => {\n window.clearTimeout(pointerGraceTimer);\n onPointerGraceIntentChange(null);\n };\n }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n return /* @__PURE__ */ jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n id: subContext.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": subContext.contentId,\n \"data-state\": getOpenState(context.open),\n ...props,\n ref: composeRefs(forwardedRef, subContext.onTriggerChange),\n onClick: (event) => {\n props.onClick?.(event);\n if (props.disabled || event.defaultPrevented) return;\n event.currentTarget.focus();\n if (!context.open) context.onOpenChange(true);\n },\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n contentContext.onItemEnter(event);\n if (event.defaultPrevented) return;\n if (!props.disabled && !context.open && !openTimerRef.current) {\n contentContext.onPointerGraceIntentChange(null);\n openTimerRef.current = window.setTimeout(() => {\n context.onOpenChange(true);\n clearOpenTimer();\n }, 100);\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => {\n clearOpenTimer();\n const contentRect = context.content?.getBoundingClientRect();\n if (contentRect) {\n const side = context.content?.dataset.side;\n const rightSide = side === \"right\";\n const bleed = rightSide ? -5 : 5;\n const contentNearEdge = contentRect[rightSide ? \"left\" : \"right\"];\n const contentFarEdge = contentRect[rightSide ? \"right\" : \"left\"];\n contentContext.onPointerGraceIntentChange({\n area: [\n // Apply a bleed on clientX to ensure that our exit point is\n // consistently within polygon bounds\n { x: event.clientX + bleed, y: event.clientY },\n { x: contentNearEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.bottom },\n { x: contentNearEdge, y: contentRect.bottom }\n ],\n side\n });\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300\n );\n } else {\n contentContext.onTriggerLeave(event);\n if (event.defaultPrevented) return;\n contentContext.onPointerGraceIntentChange(null);\n }\n })\n ),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (props.disabled || isTypingAhead && event.key === \" \") return;\n if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n context.onOpenChange(true);\n context.content?.focus();\n event.preventDefault();\n }\n })\n }\n ) });\n }\n);\nMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\nvar SUB_CONTENT_NAME = \"MenuSubContent\";\nvar MenuSubContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...subContentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n id: subContext.contentId,\n \"aria-labelledby\": subContext.triggerId,\n ...subContentProps,\n ref: composedRefs,\n align: \"start\",\n side: rootContext.dir === \"rtl\" ? \"left\" : \"right\",\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n trapFocus: false,\n onOpenAutoFocus: (event) => {\n if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();\n event.preventDefault();\n },\n onCloseAutoFocus: (event) => event.preventDefault(),\n onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {\n if (event.target !== subContext.trigger) context.onOpenChange(false);\n }),\n onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => {\n rootContext.onClose();\n event.preventDefault();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isKeyDownInside = event.currentTarget.contains(event.target);\n const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n if (isKeyDownInside && isCloseKey) {\n context.onOpenChange(false);\n subContext.trigger?.focus();\n event.preventDefault();\n }\n })\n }\n ) }) }) });\n }\n);\nMenuSubContent.displayName = SUB_CONTENT_NAME;\nfunction getOpenState(open) {\n return open ? \"open\" : \"closed\";\n}\nfunction isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nfunction getCheckedState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nfunction focusFirst(candidates) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nfunction getNextMatch(values, search, currentMatch) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find(\n (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextMatch !== currentMatch ? nextMatch : void 0;\n}\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const xi = polygon[i].x;\n const yi = polygon[i].y;\n const xj = polygon[j].x;\n const yj = polygon[j].y;\n const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\nfunction isPointerInGraceArea(event, area) {\n if (!area) return false;\n const cursorPos = { x: event.clientX, y: event.clientY };\n return isPointInPolygon(cursorPos, area);\n}\nfunction whenMouse(handler) {\n return (event) => event.pointerType === \"mouse\" ? handler(event) : void 0;\n}\nvar Root3 = Menu;\nvar Anchor2 = MenuAnchor;\nvar Portal = MenuPortal;\nvar Content2 = MenuContent;\nvar Group = MenuGroup;\nvar Label = MenuLabel;\nvar Item2 = MenuItem;\nvar CheckboxItem = MenuCheckboxItem;\nvar RadioGroup = MenuRadioGroup;\nvar RadioItem = MenuRadioItem;\nvar ItemIndicator = MenuItemIndicator;\nvar Separator = MenuSeparator;\nvar Arrow2 = MenuArrow;\nvar Sub = MenuSub;\nvar SubTrigger = MenuSubTrigger;\nvar SubContent = MenuSubContent;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n CheckboxItem,\n Content2 as Content,\n Group,\n Item2 as Item,\n ItemIndicator,\n Label,\n Menu,\n MenuAnchor,\n MenuArrow,\n MenuCheckboxItem,\n MenuContent,\n MenuGroup,\n MenuItem,\n MenuItemIndicator,\n MenuLabel,\n MenuPortal,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSeparator,\n MenuSub,\n MenuSubContent,\n MenuSubTrigger,\n Portal,\n RadioGroup,\n RadioItem,\n Root3 as Root,\n Separator,\n Sub,\n SubContent,\n SubTrigger,\n createMenuScope\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// packages/react/dropdown-menu/src/DropdownMenu.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport * as MenuPrimitive from \"@radix-ui/react-menu\";\nimport { createMenuScope } from \"@radix-ui/react-menu\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DROPDOWN_MENU_NAME = \"DropdownMenu\";\nvar [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(\n DROPDOWN_MENU_NAME,\n [createMenuScope]\n);\nvar useMenuScope = createMenuScope();\nvar [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);\nvar DropdownMenu = (props) => {\n const {\n __scopeDropdownMenu,\n children,\n dir,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const triggerRef = React.useRef(null);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(\n DropdownMenuProvider,\n {\n scope: __scopeDropdownMenu,\n triggerId: useId(),\n triggerRef,\n contentId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children: /* @__PURE__ */ jsx(MenuPrimitive.Root, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })\n }\n );\n};\nDropdownMenu.displayName = DROPDOWN_MENU_NAME;\nvar TRIGGER_NAME = \"DropdownMenuTrigger\";\nvar DropdownMenuTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;\n const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Anchor, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n id: context.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.open ? context.contentId : void 0,\n \"data-state\": context.open ? \"open\" : \"closed\",\n \"data-disabled\": disabled ? \"\" : void 0,\n disabled,\n ...triggerProps,\n ref: composeRefs(forwardedRef, context.triggerRef),\n onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {\n if (!disabled && event.button === 0 && event.ctrlKey === false) {\n context.onOpenToggle();\n if (!context.open) event.preventDefault();\n }\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (disabled) return;\n if ([\"Enter\", \" \"].includes(event.key)) context.onOpenToggle();\n if (event.key === \"ArrowDown\") context.onOpenChange(true);\n if ([\"Enter\", \" \", \"ArrowDown\"].includes(event.key)) event.preventDefault();\n })\n }\n ) });\n }\n);\nDropdownMenuTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DropdownMenuPortal\";\nvar DropdownMenuPortal = (props) => {\n const { __scopeDropdownMenu, ...portalProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Portal, { ...menuScope, ...portalProps });\n};\nDropdownMenuPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"DropdownMenuContent\";\nvar DropdownMenuContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...contentProps } = props;\n const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const hasInteractedOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n MenuPrimitive.Content,\n {\n id: context.contentId,\n \"aria-labelledby\": context.triggerId,\n ...menuScope,\n ...contentProps,\n ref: forwardedRef,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n hasInteractedOutsideRef.current = false;\n event.preventDefault();\n }),\n onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;\n }),\n style: {\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-dropdown-menu-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-dropdown-menu-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-dropdown-menu-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-dropdown-menu-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-dropdown-menu-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n }\n);\nDropdownMenuContent.displayName = CONTENT_NAME;\nvar GROUP_NAME = \"DropdownMenuGroup\";\nvar DropdownMenuGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...groupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Group, { ...menuScope, ...groupProps, ref: forwardedRef });\n }\n);\nDropdownMenuGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"DropdownMenuLabel\";\nvar DropdownMenuLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...labelProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Label, { ...menuScope, ...labelProps, ref: forwardedRef });\n }\n);\nDropdownMenuLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"DropdownMenuItem\";\nvar DropdownMenuItem = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Item, { ...menuScope, ...itemProps, ref: forwardedRef });\n }\n);\nDropdownMenuItem.displayName = ITEM_NAME;\nvar CHECKBOX_ITEM_NAME = \"DropdownMenuCheckboxItem\";\nvar DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...checkboxItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });\n});\nDropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\nvar RADIO_GROUP_NAME = \"DropdownMenuRadioGroup\";\nvar DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioGroupProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });\n});\nDropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;\nvar RADIO_ITEM_NAME = \"DropdownMenuRadioItem\";\nvar DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...radioItemProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });\n});\nDropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;\nvar INDICATOR_NAME = \"DropdownMenuItemIndicator\";\nvar DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...itemIndicatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });\n});\nDropdownMenuItemIndicator.displayName = INDICATOR_NAME;\nvar SEPARATOR_NAME = \"DropdownMenuSeparator\";\nvar DropdownMenuSeparator = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...separatorProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });\n});\nDropdownMenuSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"DropdownMenuArrow\";\nvar DropdownMenuArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDropdownMenu, ...arrowProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.Arrow, { ...menuScope, ...arrowProps, ref: forwardedRef });\n }\n);\nDropdownMenuArrow.displayName = ARROW_NAME;\nvar DropdownMenuSub = (props) => {\n const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen,\n onChange: onOpenChange\n });\n return /* @__PURE__ */ jsx(MenuPrimitive.Sub, { ...menuScope, open, onOpenChange: setOpen, children });\n};\nvar SUB_TRIGGER_NAME = \"DropdownMenuSubTrigger\";\nvar DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...subTriggerProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(MenuPrimitive.SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });\n});\nDropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\nvar SUB_CONTENT_NAME = \"DropdownMenuSubContent\";\nvar DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => {\n const { __scopeDropdownMenu, ...subContentProps } = props;\n const menuScope = useMenuScope(__scopeDropdownMenu);\n return /* @__PURE__ */ jsx(\n MenuPrimitive.SubContent,\n {\n ...menuScope,\n ...subContentProps,\n ref: forwardedRef,\n style: {\n ...props.style,\n // re-namespace exposed content custom properties\n ...{\n \"--radix-dropdown-menu-content-transform-origin\": \"var(--radix-popper-transform-origin)\",\n \"--radix-dropdown-menu-content-available-width\": \"var(--radix-popper-available-width)\",\n \"--radix-dropdown-menu-content-available-height\": \"var(--radix-popper-available-height)\",\n \"--radix-dropdown-menu-trigger-width\": \"var(--radix-popper-anchor-width)\",\n \"--radix-dropdown-menu-trigger-height\": \"var(--radix-popper-anchor-height)\"\n }\n }\n }\n );\n});\nDropdownMenuSubContent.displayName = SUB_CONTENT_NAME;\nvar Root2 = DropdownMenu;\nvar Trigger = DropdownMenuTrigger;\nvar Portal2 = DropdownMenuPortal;\nvar Content2 = DropdownMenuContent;\nvar Group2 = DropdownMenuGroup;\nvar Label2 = DropdownMenuLabel;\nvar Item2 = DropdownMenuItem;\nvar CheckboxItem2 = DropdownMenuCheckboxItem;\nvar RadioGroup2 = DropdownMenuRadioGroup;\nvar RadioItem2 = DropdownMenuRadioItem;\nvar ItemIndicator2 = DropdownMenuItemIndicator;\nvar Separator2 = DropdownMenuSeparator;\nvar Arrow2 = DropdownMenuArrow;\nvar Sub2 = DropdownMenuSub;\nvar SubTrigger2 = DropdownMenuSubTrigger;\nvar SubContent2 = DropdownMenuSubContent;\nexport {\n Arrow2 as Arrow,\n CheckboxItem2 as CheckboxItem,\n Content2 as Content,\n DropdownMenu,\n DropdownMenuArrow,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuItemIndicator,\n DropdownMenuLabel,\n DropdownMenuPortal,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n Group2 as Group,\n Item2 as Item,\n ItemIndicator2 as ItemIndicator,\n Label2 as Label,\n Portal2 as Portal,\n RadioGroup2 as RadioGroup,\n RadioItem2 as RadioItem,\n Root2 as Root,\n Separator2 as Separator,\n Sub2 as Sub,\n SubContent2 as SubContent,\n SubTrigger2 as SubTrigger,\n Trigger,\n createDropdownMenuScope\n};\n//# sourceMappingURL=index.mjs.map\n","import * as React from \"react\"\r\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\"\r\nimport { Check, ChevronRight, Circle } from \"lucide-react\"\r\n\r\nimport { cn } from \"lib/utils\"\r\n\r\nconst DropdownMenu = DropdownMenuPrimitive.Root\r\n\r\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\r\n\r\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\r\n\r\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\r\n\r\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\r\n\r\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\r\n\r\nconst DropdownMenuSubTrigger = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef & {\r\n inset?: boolean\r\n }\r\n>(({ className, inset, children, ...props }, ref) => (\r\n \r\n {children}\r\n \r\n \r\n))\r\nDropdownMenuSubTrigger.displayName =\r\n DropdownMenuPrimitive.SubTrigger.displayName\r\n\r\nconst DropdownMenuSubContent = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nDropdownMenuSubContent.displayName =\r\n DropdownMenuPrimitive.SubContent.displayName\r\n\r\nconst DropdownMenuContent = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, sideOffset = 4, ...props }, ref) => (\r\n \r\n))\r\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\r\n\r\nconst DropdownMenuItem = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef & {\r\n inset?: boolean\r\n }\r\n>(({ className, inset, ...props }, ref) => (\r\n \r\n))\r\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\r\n\r\nconst DropdownMenuCheckboxItem = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, children, checked, ...props }, ref) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n {children}\r\n \r\n))\r\nDropdownMenuCheckboxItem.displayName =\r\n DropdownMenuPrimitive.CheckboxItem.displayName\r\n\r\nconst DropdownMenuRadioItem = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, children, ...props }, ref) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n {children}\r\n \r\n))\r\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\r\n\r\nconst DropdownMenuLabel = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef & {\r\n inset?: boolean\r\n }\r\n>(({ className, inset, ...props }, ref) => (\r\n \r\n))\r\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\r\n\r\nconst DropdownMenuSeparator = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\r\n\r\nconst DropdownMenuShortcut = ({\r\n className,\r\n ...props\r\n}: React.HTMLAttributes) => {\r\n return (\r\n \r\n )\r\n}\r\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\"\r\n\r\nexport {\r\n DropdownMenu,\r\n DropdownMenuTrigger,\r\n DropdownMenuContent,\r\n DropdownMenuItem,\r\n DropdownMenuCheckboxItem,\r\n DropdownMenuRadioItem,\r\n DropdownMenuLabel,\r\n DropdownMenuSeparator,\r\n DropdownMenuShortcut,\r\n DropdownMenuGroup,\r\n DropdownMenuPortal,\r\n DropdownMenuSub,\r\n DropdownMenuSubContent,\r\n DropdownMenuSubTrigger,\r\n DropdownMenuRadioGroup,\r\n}\r\n","import * as React from \"react\"\r\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\"\r\nimport { X } from \"lucide-react\"\r\n\r\nimport { cn } from \"lib/utils\"\r\n\r\nconst Dialog = DialogPrimitive.Root\r\n\r\nconst DialogTrigger = DialogPrimitive.Trigger\r\n\r\nconst DialogPortal = DialogPrimitive.Portal\r\n\r\nDialogPortal.displayName = DialogPrimitive.Portal.displayName\r\n\r\nconst DialogClose = DialogPrimitive.Close\r\n\r\nconst DialogOverlay = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n
\r\n))\r\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\r\n\r\nconst DialogContent = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, children, ...props }, ref) => (\r\n \r\n \r\n \r\n \r\n {children}\r\n \r\n \r\n Close \r\n \r\n
\r\n \r\n \r\n\r\n \r\n))\r\nDialogContent.displayName = DialogPrimitive.Content.displayName\r\n\r\nconst DialogHeader = ({\r\n className,\r\n ...props\r\n}: React.HTMLAttributes) => (\r\n
\r\n)\r\nDialogHeader.displayName = \"DialogHeader\"\r\n\r\nconst DialogFooter = ({\r\n className,\r\n ...props\r\n}: React.HTMLAttributes) => (\r\n
\r\n)\r\nDialogFooter.displayName = \"DialogFooter\"\r\n\r\nconst DialogTitle = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nDialogTitle.displayName = DialogPrimitive.Title.displayName\r\n\r\nconst DialogDescription = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nDialogDescription.displayName = DialogPrimitive.Description.displayName\r\n\r\nexport {\r\n Dialog,\r\n DialogPortal,\r\n DialogOverlay,\r\n DialogClose,\r\n DialogTrigger,\r\n DialogContent,\r\n DialogHeader,\r\n DialogFooter,\r\n DialogTitle,\r\n DialogDescription,\r\n}\r\n","import {FC, forwardRef, ReactNode} from \"react\";\r\nimport {cn} from \"lib/utils\";\r\ninterface CardProps {\r\n children: ReactNode;\r\n className?: string;\r\n spreader?: boolean\r\n}\r\n\r\nconst Card = forwardRef(({ children, className, spreader = false, ...props }, ref) => {\r\n\r\n return (\r\n \r\n\r\n
\r\n {children}\r\n
\r\n\r\n {spreader && (\r\n
\r\n )}\r\n\r\n\r\n
\r\n )\r\n})\r\n\r\nexport default Card","import React, {FC } from 'react';\r\n\r\ninterface SvgProps {\r\n cls?: string;\r\n}\r\n\r\nconst width = 34;\r\nconst height = 34;\r\n\r\nexport const Pass:FC = ({cls}) => (\r\n \r\n \r\n \r\n);\r\n\r\nexport const Fail:FC = ({cls}) => (\r\n \r\n \r\n \r\n);\r\n\r\nexport const Average:FC = ({cls}) => (\r\n \r\n \r\n \r\n);\r\n\r\nexport const TitanLogo: FC = ({cls}) => (\r\n \r\n \r\n \r\n \r\n);\r\n\r\n","import React, {useEffect, useState} from 'react';\r\nimport { Pass, Fail, Average } from '../icons/icon-svg';\r\nimport {cn} from \"lib/utils\";\r\n\r\ninterface IconProps {\r\n icon?: string;\r\n className?: string; // Add className prop\r\n}\r\n\r\nconst PerformanceIcons = ({ icon, className }: IconProps) => {\r\n let [iconComponent, setIcon] = useState(<>>);\r\n\r\n\r\n useEffect(() => {\r\n\r\n if (icon === 'pass' || icon === 'FAST' || icon === 'passed_audit' ) {\r\n setIcon( )\r\n } else if (icon === 'average' || icon === 'AVERAGE') {\r\n setIcon( )\r\n } else if (icon === 'fail' || icon === 'SLOW' ) {\r\n setIcon( )\r\n }\r\n\r\n }, [])\r\n\r\n return (\r\n \r\n {iconComponent}\r\n \r\n );\r\n};\r\n\r\nexport default PerformanceIcons;\r\n","import Mode from \"app/page-optimizer/components/Mode\";\r\nimport {\r\n AlertDialog, AlertDialogAction, AlertDialogCancel,\r\n AlertDialogContent, AlertDialogDescription, AlertDialogFooter,\r\n AlertDialogHeader,\r\n AlertDialogTitle,\r\n AlertDialogTrigger\r\n} from \"components/ui/alert-dialog\";\r\nimport {\r\n DropdownMenu,\r\n DropdownMenuContent, DropdownMenuItem,\r\n DropdownMenuLabel,\r\n DropdownMenuSeparator,\r\n DropdownMenuTrigger\r\n} from \"components/ui/dropdown-menu\";\r\nimport {Button} from \"components/ui/button\";\r\nimport {ChevronDown, ChevronUp, Loader, MoreVertical, SaveIcon, UserCircle} from \"lucide-react\";\r\nimport AppButton from \"components/ui/app-button\";\r\nimport {Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger} from \"components/ui/dialog\";\r\nimport {ArrowPathIcon, CheckCircleIcon, XCircleIcon} from \"@heroicons/react/24/solid\";\r\nimport Card from \"components/ui/card\";\r\nimport PerformanceIcons from \"app/page-optimizer/components/performance-widgets/PerformanceIcons\";\r\nimport React, {useCallback, useEffect, useMemo, useRef, useState} from \"react\";\r\nimport {useAppContext} from \"../../../../context/app\";\r\nimport {useDispatch, useSelector} from \"react-redux\";\r\nimport {optimizerData} from \"../../../../store/app/appSelector\";\r\nimport {ThunkDispatch} from \"redux-thunk\";\r\nimport {AppAction, FETCH_REPORT_REQUEST, RootState} from \"../../../../store/app/appTypes\";\r\nimport {useToast} from \"components/ui/use-toast\";\r\nimport {cn} from \"lib/utils\";\r\nimport useSubmitSettings from \"hooks/useSubmitSettings\";\r\nimport UnsavedChanges from \"app/page-optimizer/components/footer/unsaved-changes\";\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\n\r\nconst SaveChanges = () => {\r\n\r\n\r\n const {\r\n setShowOptimizer,\r\n options ,\r\n modeData,\r\n savingData,\r\n setSavingData,\r\n invalidatingCache,\r\n setInvalidatingCache,\r\n global\r\n } = useAppContext()\r\n\r\n let url = options?.optimizer_url;\r\n const { toast } = useToast()\r\n\r\n const { submitSettings } = useSubmitSettings()\r\n\r\n\r\n const defaultAction = global ? 2 : 0\r\n const [open, setOpen] = useState(false)\r\n const [inProgress, setInProgress] = useState(false)\r\n const refSaveButton = useRef(null);\r\n const [activeAction, setActiveAction] = useState(defaultAction)\r\n const [modalAction, setModalAction] = useState(defaultAction)\r\n\r\n const dispatch: ThunkDispatch = useDispatch();\r\n\r\n const {\r\n fresh,\r\n touched,\r\n activeReport,\r\n data,\r\n settings\r\n } =\r\n useSelector(optimizerData)\r\n\r\n\r\n useEffect(() => {\r\n\r\n if (touched && !global) {\r\n setActiveAction(1)\r\n } else if (global) {\r\n setActiveAction(2)\r\n } else {\r\n setActiveAction(0)\r\n }\r\n\r\n }, [touched])\r\n\r\n\r\n const status = {\r\n queued: 'Waiting in the queue...',\r\n processing: 'Waiting in the queue...',\r\n success: 'Successfully Optimized',\r\n failed: 'Error while optimizing'\r\n }\r\n\r\n const inProgressSettings = useMemo(() => {\r\n return settings?.filter(s => ['Critical CSS', 'Remove Unused CSS'].includes(s.name) && s.status?.status !== 'success') || []\r\n }, [ settings ])\r\n\r\n\r\n const saveActions =[\r\n {\r\n text: 'Apply Optimization',\r\n title: 'Save Changes?',\r\n description: \"You have made changes to your settings. Click 'Save Changes' to apply your modifications or 'Discard' to revert to the previous state.\",\r\n onClick : () => submitSettings(true)\r\n },\r\n {\r\n text: \r\n {/*Save & Analyze*/} Apply Optimization\r\n {/**/}\r\n {/* */}\r\n {/* 2 */}\r\n {/* */}\r\n
,\r\n title: 'Do you want to Apply Optimization?',\r\n description: \r\n {/*{false ?*/}\r\n {inProgressSettings.length > 0 ?\r\n
\r\n
\r\n You've made changes to your settings. For accurate results, wait for all tasks to complete before saving and re-analyzing.\r\n
\r\n {/*
*/}\r\n\r\n {/*
*/}\r\n {/*
*/}\r\n {/* */}\r\n {/*
*/}\r\n {/*
*/}\r\n {/*
setInProgress(p => !p)} className='font-medium flex gap-1 items-center'>*/}\r\n {/* Tasks in Progress {!inProgress ? : }*/}\r\n {/* */}\r\n {/*
*/}\r\n {/* This could take 1-3 minutes to complete.*/}\r\n {/*
*/}\r\n {/*
*/}\r\n {/*
*/}\r\n\r\n {/*
*/}\r\n {/* */}\r\n {/* {inProgressSettings.map((i, index) => (*/}\r\n {/*
*/}\r\n {/*
*/}\r\n {/* */}\r\n {/*
*/}\r\n {/*
*/}\r\n {/*
{i.name}
*/}\r\n {/* {i.status?.status &&*/}\r\n {/*
{status[i.status?.status]}
*/}\r\n {/* }*/}\r\n {/*
*/}\r\n {/*
*/}\r\n {/* ))}*/}\r\n {/*
*/}\r\n {/* */}\r\n\r\n {/*
*/}\r\n
\r\n :\r\n
\r\n You have made changes to your settings. Click 'Apply Optimization' to apply your modifications and re-analyze the page or 'Discard' to revert to the previous state.\r\n
\r\n }\r\n
,\r\n onClick : () => {\r\n submitSettings(true)\r\n },\r\n action_text: \"Apply Optimization\"\r\n },\r\n {\r\n text: 'Apply for Entire Site',\r\n title: 'Apply these settings as entire site?',\r\n description: \"You have made changes to your settings. Click 'Save Changes' to override entire site settings or 'Discard' to revert to the previous state.\",\r\n onClick : () => {\r\n submitSettings(false, true)\r\n }\r\n },\r\n ]\r\n\r\n const computeDialogData = useCallback((data: OptimizerResults | null | undefined) => {\r\n if (!data) {\r\n return null;\r\n }\r\n\r\n const show = 5;\r\n const audits = [...data.grouped.opportunities, ...data.grouped.diagnostics].filter(audit => (audit.files?.items?.length > 0 || audit.settings.length > 0));\r\n const count = audits.length;\r\n const balance = count - show;\r\n\r\n return {\r\n show,\r\n balance,\r\n count,\r\n audits\r\n };\r\n }, [data?.audits]);\r\n\r\n\r\n const dialogData = useMemo(() => ( computeDialogData(data)), [data]);\r\n\r\n const savable = useMemo(() => {\r\n return fresh ? true : (touched)\r\n }, [fresh, touched])\r\n\r\n return <>\r\n \r\n \r\n
\r\n \r\n \r\n setModalAction(activeAction)}\r\n className={cn(\r\n 'flex gap-2 items-center pl-3 pr-2 h-full',\r\n )}>\r\n {(savingData || invalidatingCache) ?\r\n :\r\n }\r\n {saveActions[activeAction].text}\r\n \r\n\r\n\r\n \r\n\r\n {/**/}\r\n {/* */}\r\n {/* Syncing Changes...*/}\r\n {/*
*/}\r\n\r\n { setShowOptimizer(false) }}\r\n cancel='Discard & Leave'\r\n onClick={() => { setShowOptimizer(false) }} >\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n Additional Options \r\n {saveActions.filter((e, i) => activeAction !== i).map((action, index) => (\r\n \r\n \r\n {\r\n setTimeout(() => {\r\n setOpen(true)\r\n setModalAction(saveActions.indexOf(action))\r\n }, 100)\r\n }}>{action.text} \r\n \r\n ))}\r\n \r\n \r\n\r\n \r\n \r\n
\r\n {saveActions[modalAction].title} \r\n \r\n \r\n {saveActions[modalAction].description}\r\n
\r\n \r\n \r\n
\r\n saveActions[modalAction].onClick()} >\r\n {saveActions[modalAction]?.action_text ? saveActions[modalAction].action_text : 'Save Changes'}\r\n \r\n setOpen(false)}>Discard \r\n \r\n
\r\n \r\n \r\n {/*
{ setShowOptimizer(false) }}*/}\r\n {/* cancel='Discard & Leave'*/}\r\n {/* onClick={() => setShowOptimizer(false)}>*/}\r\n {/* Close */}\r\n {/* */}\r\n
\r\n \r\n\r\n \r\n \r\n \r\n
0 && 'pointer-events-auto opacity-100 cursor-pointer' )}>\r\n \r\n {savingData ? : }\r\n Connect your Account \r\n\r\n \r\n
\r\n \r\n {dialogData && (\r\n <>\r\n RapidLoad can improve {dialogData.count} Audits \r\n \r\n
\r\n {data && dialogData.audits.slice(0, dialogData.show).map((audit) => (\r\n \r\n \r\n \r\n
\r\n {audit.scoreDisplayMode === 'informative' ?
:
}\r\n\r\n \r\n
\r\n {audit.name}\r\n {audit.displayValue && (\r\n {audit.displayValue} \r\n )}\r\n
\r\n
\r\n \r\n \r\n ))}\r\n {data && !!dialogData.balance && dialogData.balance > 0 && (\r\n and {dialogData.balance} more audit{dialogData.balance > 1 && 's'}... \r\n )}\r\n \r\n
\r\n \r\n >\r\n )}\r\n \r\n \r\n
\r\n \r\n \r\n {/**/}\r\n {/* {inProgress && }*/}\r\n {/* */}\r\n >\r\n}\r\n\r\nexport default SaveChanges","import {\r\n DevicePhoneMobileIcon\r\n} from \"@heroicons/react/24/outline\";\r\nimport React, {useEffect} from \"react\";\r\nimport { useAppContext } from \"../../../context/app\";\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\nimport { ThunkDispatch } from \"redux-thunk\";\r\nimport { AppAction, RootState } from \"../../../store/app/appTypes\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport {changeReport, fetchReport, fetchSettings} from \"../../../store/app/appActions\";\r\nimport { optimizerData } from \"../../../store/app/appSelector\";\r\nimport AppButton from \"components/ui/app-button\";\r\nimport { cn } from \"lib/utils\";\r\nimport {\r\n LogOut,\r\n Monitor,\r\n RefreshCw\r\n} from \"lucide-react\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\nimport { AnimatePresence, motion } from \"framer-motion\";\r\nimport { setCommonState } from \"../../../store/common/commonActions\";\r\nimport UnsavedChanges from \"app/page-optimizer/components/footer/unsaved-changes\";\r\nimport UrlPreview from \"app/page-optimizer/components/footer/url-preview\";\r\nimport SaveChanges from \"app/page-optimizer/components/footer/save-changes\";\r\nimport { useRootContext } from \"../../../context/root\";\r\n\r\nconst Header = ({ url }: { url: string }) => {\r\n\r\n const {\r\n setShowOptimizer,\r\n options,\r\n version,\r\n savingData,\r\n invalidatingCache,\r\n mode\r\n } = useAppContext()\r\n\r\n const { activeReport,\r\n loading,\r\n testMode,\r\n reanalyze,\r\n settings, settingsOriginal\r\n } = useSelector(optimizerData);\r\n const { inProgress, testModeStatus } = useCommonDispatch()\r\n const {\r\n dispatch: commonDispatch\r\n } = useCommonDispatch()\r\n\r\n\r\n const dispatch: ThunkDispatch = useDispatch();\r\n const { isDark } = useRootContext();\r\n\r\n useEffect(() => {\r\n if(!savingData && !invalidatingCache){\r\n dispatch(fetchSettings(options, options.optimizer_url, true))\r\n }\r\n }, [savingData, invalidatingCache]);\r\n\r\n // useEffect(() => {\r\n // if (settings && settingsOriginal) {\r\n // settings.forEach((setting, settingIndex) => {\r\n // const originalSetting = settingsOriginal[settingIndex];\r\n //\r\n // setting.inputs.forEach((input, inputIndex) => {\r\n // const originalInput = originalSetting.inputs[inputIndex];\r\n //\r\n // if (input.value !== originalInput.value) {\r\n // console.log(`Difference found in object index ${settingIndex}, input index ${inputIndex}:`);\r\n // console.log(`Key: ${input.key}`, `Name: ${setting.name}` , `control_label: ${input.control_label}`);\r\n // console.log(`Current Value: ${input.value}, Original Value: ${originalInput.value}`);\r\n // }\r\n // });\r\n // });\r\n // }\r\n // }, [settings, settingsOriginal]);\r\n\r\n\r\n return (\r\n <>\r\n\r\n \r\n \r\n {testModeStatus && (\r\n \r\n Test Mode turned on, \r\n optimizations are safely previewed without affecting your live website. Perfect for experimentation and fine-tuning.\r\n \r\n )}\r\n \r\n >\r\n )\r\n}\r\n\r\nexport default Header","import { cn } from \"../../lib/utils\"\r\n\r\nfunction Skeleton({\r\n className,\r\n ...props\r\n}: React.HTMLAttributes) {\r\n return (\r\n
\r\n )\r\n}\r\n\r\nexport { Skeleton }\r\n","import { createElement, Component } from 'react';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\n\nvar VIEWBOX_WIDTH = 100;\r\nvar VIEWBOX_HEIGHT = 100;\r\nvar VIEWBOX_HEIGHT_HALF = 50;\r\nvar VIEWBOX_CENTER_X = 50;\r\nvar VIEWBOX_CENTER_Y = 50;\n\nfunction Path(_a) {\r\n var className = _a.className, counterClockwise = _a.counterClockwise, dashRatio = _a.dashRatio, pathRadius = _a.pathRadius, strokeWidth = _a.strokeWidth, style = _a.style;\r\n return (createElement(\"path\", { className: className, style: Object.assign({}, style, getDashStyle({ pathRadius: pathRadius, dashRatio: dashRatio, counterClockwise: counterClockwise })), d: getPathDescription({\r\n pathRadius: pathRadius,\r\n counterClockwise: counterClockwise,\r\n }), strokeWidth: strokeWidth, fillOpacity: 0 }));\r\n}\r\nfunction getPathDescription(_a) {\r\n var pathRadius = _a.pathRadius, counterClockwise = _a.counterClockwise;\r\n var radius = pathRadius;\r\n var rotation = counterClockwise ? 1 : 0;\r\n return \"\\n M \" + VIEWBOX_CENTER_X + \",\" + VIEWBOX_CENTER_Y + \"\\n m 0,-\" + radius + \"\\n a \" + radius + \",\" + radius + \" \" + rotation + \" 1 1 0,\" + 2 * radius + \"\\n a \" + radius + \",\" + radius + \" \" + rotation + \" 1 1 0,-\" + 2 * radius + \"\\n \";\r\n}\r\nfunction getDashStyle(_a) {\r\n var counterClockwise = _a.counterClockwise, dashRatio = _a.dashRatio, pathRadius = _a.pathRadius;\r\n var diameter = Math.PI * 2 * pathRadius;\r\n var gapLength = (1 - dashRatio) * diameter;\r\n return {\r\n strokeDasharray: diameter + \"px \" + diameter + \"px\",\r\n strokeDashoffset: (counterClockwise ? -gapLength : gapLength) + \"px\",\r\n };\r\n}\n\nvar CircularProgressbar = (function (_super) {\r\n __extends(CircularProgressbar, _super);\r\n function CircularProgressbar() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n CircularProgressbar.prototype.getBackgroundPadding = function () {\r\n if (!this.props.background) {\r\n return 0;\r\n }\r\n return this.props.backgroundPadding;\r\n };\r\n CircularProgressbar.prototype.getPathRadius = function () {\r\n return VIEWBOX_HEIGHT_HALF - this.props.strokeWidth / 2 - this.getBackgroundPadding();\r\n };\r\n CircularProgressbar.prototype.getPathRatio = function () {\r\n var _a = this.props, value = _a.value, minValue = _a.minValue, maxValue = _a.maxValue;\r\n var boundedValue = Math.min(Math.max(value, minValue), maxValue);\r\n return (boundedValue - minValue) / (maxValue - minValue);\r\n };\r\n CircularProgressbar.prototype.render = function () {\r\n var _a = this.props, circleRatio = _a.circleRatio, className = _a.className, classes = _a.classes, counterClockwise = _a.counterClockwise, styles = _a.styles, strokeWidth = _a.strokeWidth, text = _a.text;\r\n var pathRadius = this.getPathRadius();\r\n var pathRatio = this.getPathRatio();\r\n return (createElement(\"svg\", { className: classes.root + \" \" + className, style: styles.root, viewBox: \"0 0 \" + VIEWBOX_WIDTH + \" \" + VIEWBOX_HEIGHT, \"data-test-id\": \"CircularProgressbar\" },\r\n this.props.background ? (createElement(\"circle\", { className: classes.background, style: styles.background, cx: VIEWBOX_CENTER_X, cy: VIEWBOX_CENTER_Y, r: VIEWBOX_HEIGHT_HALF })) : null,\r\n createElement(Path, { className: classes.trail, counterClockwise: counterClockwise, dashRatio: circleRatio, pathRadius: pathRadius, strokeWidth: strokeWidth, style: styles.trail }),\r\n createElement(Path, { className: classes.path, counterClockwise: counterClockwise, dashRatio: pathRatio * circleRatio, pathRadius: pathRadius, strokeWidth: strokeWidth, style: styles.path }),\r\n text ? (createElement(\"text\", { className: classes.text, style: styles.text, x: VIEWBOX_CENTER_X, y: VIEWBOX_CENTER_Y }, text)) : null));\r\n };\r\n CircularProgressbar.defaultProps = {\r\n background: false,\r\n backgroundPadding: 0,\r\n circleRatio: 1,\r\n classes: {\r\n root: 'CircularProgressbar',\r\n trail: 'CircularProgressbar-trail',\r\n path: 'CircularProgressbar-path',\r\n text: 'CircularProgressbar-text',\r\n background: 'CircularProgressbar-background',\r\n },\r\n counterClockwise: false,\r\n className: '',\r\n maxValue: 100,\r\n minValue: 0,\r\n strokeWidth: 8,\r\n styles: {\r\n root: {},\r\n trail: {},\r\n path: {},\r\n text: {},\r\n background: {},\r\n },\r\n text: '',\r\n };\r\n return CircularProgressbar;\r\n}(Component));\n\nfunction CircularProgressbarWithChildren(props) {\r\n var children = props.children, circularProgressbarProps = __rest(props, [\"children\"]);\r\n return (createElement(\"div\", { \"data-test-id\": \"CircularProgressbarWithChildren\" },\r\n createElement(\"div\", { style: { position: 'relative', width: '100%', height: '100%' } },\r\n createElement(CircularProgressbar, __assign({}, circularProgressbarProps)),\r\n props.children ? (createElement(\"div\", { \"data-test-id\": \"CircularProgressbarWithChildren__children\", style: {\r\n position: 'absolute',\r\n width: '100%',\r\n height: '100%',\r\n marginTop: '-100%',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n } }, props.children)) : null)));\r\n}\n\nfunction buildStyles(_a) {\r\n var rotation = _a.rotation, strokeLinecap = _a.strokeLinecap, textColor = _a.textColor, textSize = _a.textSize, pathColor = _a.pathColor, pathTransition = _a.pathTransition, pathTransitionDuration = _a.pathTransitionDuration, trailColor = _a.trailColor, backgroundColor = _a.backgroundColor;\r\n var rotationTransform = rotation == null ? undefined : \"rotate(\" + rotation + \"turn)\";\r\n var rotationTransformOrigin = rotation == null ? undefined : 'center center';\r\n return {\r\n root: {},\r\n path: removeUndefinedValues({\r\n stroke: pathColor,\r\n strokeLinecap: strokeLinecap,\r\n transform: rotationTransform,\r\n transformOrigin: rotationTransformOrigin,\r\n transition: pathTransition,\r\n transitionDuration: pathTransitionDuration == null ? undefined : pathTransitionDuration + \"s\",\r\n }),\r\n trail: removeUndefinedValues({\r\n stroke: trailColor,\r\n strokeLinecap: strokeLinecap,\r\n transform: rotationTransform,\r\n transformOrigin: rotationTransformOrigin,\r\n }),\r\n text: removeUndefinedValues({\r\n fill: textColor,\r\n fontSize: textSize,\r\n }),\r\n background: removeUndefinedValues({\r\n fill: backgroundColor,\r\n }),\r\n };\r\n}\r\nfunction removeUndefinedValues(obj) {\r\n Object.keys(obj).forEach(function (key) {\r\n if (obj[key] == null) {\r\n delete obj[key];\r\n }\r\n });\r\n return obj;\r\n}\n\nexport { CircularProgressbar, CircularProgressbarWithChildren, buildStyles };\n//# sourceMappingURL=index.esm.js.map\n","import {useCallback, useEffect, useState} from \"react\";\r\n\r\nconst usePerformanceColors = (performance?: number) => {\r\n\r\n const [performanceIcon, setPerformanceIcon] = useState('fail');\r\n const [progressbarColor, setProgressbarColor] = useState('transparent');\r\n const [progressbarBg, setProgressbarBg] = useState('transparent');\r\n\r\n const progressBarColorCode = useCallback( (_perf = null) => {\r\n const bgOpacity = 0.08\r\n const _performance = _perf ? _perf : performance\r\n\r\n if (!_performance || _performance < 50) {\r\n setProgressbarColor('#ff4e43');\r\n setProgressbarBg(`rgb(255, 51, 51, ${bgOpacity} )`);\r\n setPerformanceIcon('fail')\r\n } else if (_performance < 90) {\r\n setProgressbarColor('#FFAA33');\r\n setProgressbarBg(`rgb(255, 170, 51, ${bgOpacity})`);\r\n setPerformanceIcon('average')\r\n } else if (_performance < 101) {\r\n setProgressbarColor('#09B42F');\r\n setProgressbarBg(`rgb(9, 180, 4, ${bgOpacity})`);\r\n setPerformanceIcon('pass')\r\n }\r\n\r\n return [performanceIcon, progressbarColor, progressbarBg]\r\n }, [performance]);\r\n\r\n useEffect(() => {\r\n progressBarColorCode()\r\n }, [])\r\n\r\n useEffect(() => {\r\n progressBarColorCode()\r\n }, [performance])\r\n\r\n return [performanceIcon, progressbarColor, progressbarBg, progressBarColorCode]\r\n}\r\n\r\nexport default usePerformanceColors","import { buildStyles, CircularProgressbarWithChildren } from \"react-circular-progressbar\";\r\nimport React, { ReactNode, useEffect, useState, useCallback, useMemo } from \"react\";\r\nimport usePerformanceColors from \"hooks/usePerformanceColors\";\r\nimport { cn } from \"lib/utils\";\r\nimport { AnimatePresence, m } from \"framer-motion\";\r\nimport { Loader } from \"lucide-react\";\r\n\r\ninterface PerformanceProgressBarProps {\r\n performance?: number\r\n className?: string\r\n scoreClassName?: string\r\n background?: boolean\r\n stroke?: number\r\n children?: ReactNode\r\n animate?: boolean\r\n loading?: boolean\r\n}\r\n\r\nconst messages = [\r\n 'Initiating analysis',\r\n 'Fetching assets',\r\n 'Running PageSpeed Insights',\r\n 'Analyzing performance',\r\n 'Evaluating metrics',\r\n 'Compiling results',\r\n 'Almost done',\r\n];\r\n\r\nconst PerformanceProgressBar: React.FC = ({\r\n performance,\r\n className,\r\n scoreClassName,\r\n background = true,\r\n stroke = 4,\r\n children,\r\n animate = true,\r\n loading = false\r\n}) => {\r\n const [score, setScore] = useState(animate ? 0 : performance || 0);\r\n const [message, setMessage] = useState(-1); // Change initial state to -1\r\n\r\n const [performanceIcon, progressbarColor, progressbarBg] = usePerformanceColors(performance);\r\n\r\n const animateScore = useCallback(() => {\r\n if (performance && animate) {\r\n let currentNumber = 0;\r\n const timer = setInterval(() => {\r\n currentNumber += 1;\r\n if (currentNumber <= performance) {\r\n setScore(currentNumber);\r\n } else {\r\n clearInterval(timer);\r\n }\r\n }, 10);\r\n return () => clearInterval(timer);\r\n }\r\n }, [performance, animate]);\r\n\r\n const cycleMessages = useCallback(() => {\r\n if (loading) {\r\n setMessage(0); // Set initial message immediately\r\n const interval = setInterval(() => {\r\n setMessage(p => (p >= messages.length - 1 ? 0 : p + 1));\r\n }, 7000);\r\n return () => clearInterval(interval);\r\n } else {\r\n setMessage(-1); // Reset message when not loading\r\n }\r\n }, [loading]);\r\n\r\n useEffect(animateScore, [animateScore]);\r\n useEffect(cycleMessages, [cycleMessages]);\r\n\r\n const progressBarStyles = useMemo(() => buildStyles({\r\n pathColor: progressbarColor,\r\n trailColor: !background ? progressbarBg : 'transparent',\r\n pathTransitionDuration: 0.5,\r\n strokeLinecap: 'round',\r\n backgroundColor: progressbarBg\r\n }), [progressbarColor, background, progressbarBg]);\r\n\r\n return (\r\n \r\n \r\n \r\n {!loading &&
{score.toFixed(0)} }\r\n\r\n
\r\n {loading && message !== -1 && (\r\n \r\n {loading && messages[message]}\r\n \r\n )}\r\n \r\n\r\n {children && (\r\n
\r\n {children}\r\n \r\n )}\r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default React.memo(PerformanceProgressBar);","import PerformanceIcons from \"app/page-optimizer/components/performance-widgets/PerformanceIcons\";\r\nimport Card from \"components/ui/card\";\r\nimport React, {useEffect, useState} from \"react\";\r\nimport {JsonView} from \"react-json-view-lite\";\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\nimport usePerformanceColors from \"hooks/usePerformanceColors\";\r\nimport PerformanceProgressBar from \"components/performance-progress-bar\";\r\nimport {cn} from \"lib/utils\";\r\nimport {ArrowRight, Info} from \"lucide-react\";\r\nimport {useAppContext} from \"../../../../context/app\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\nimport {setCommonState} from \"../../../../store/common/commonActions\";\r\nimport {AnimatePresence, m} from \"framer-motion\";\r\n\r\n\r\ninterface MetricsProps {\r\n metrics: Metric[]\r\n performance: number\r\n}\r\n\r\nconst Metrics = ({ metrics = [], performance } : MetricsProps) => {\r\n\r\n const desiredMetricsOrder = [\"First Contentful Paint\", \"Largest Contentful Paint\", \"Total Blocking Time\", \"Cumulative Layout Shift\", \"Speed Index\"];\r\n const sortedMetricsData = metrics.sort((a, b) => desiredMetricsOrder.indexOf(a.title) - desiredMetricsOrder.indexOf(b.title));\r\n const { dispatch, activeMetric, hoveredMetric} = useCommonDispatch()\r\n\r\n\r\n\r\n const { optimizerContainer } = useAppContext()\r\n\r\n const slideVariants = {\r\n initial: {\r\n x: '-20%', // Starts off the right side of the screen\r\n opacity: 0\r\n },\r\n in: {\r\n x: '0%', // Slides in from the right to its original position\r\n opacity: 1\r\n },\r\n out: {\r\n x: '20%', // Slides out to the left\r\n opacity: 0\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n\r\n if (activeMetric) {\r\n optimizerContainer.current?.scrollIntoView({\r\n behavior: 'smooth'\r\n })\r\n }\r\n\r\n }, [activeMetric])\r\n\r\n return (\r\n \r\n\r\n\r\n\r\n {sortedMetricsData\r\n .sort((a,b) => b.potentialGain - a.potentialGain)\r\n .map((metric, index) => (\r\n
{\r\n dispatch(setCommonState('activeMetric',metric))\r\n }}\r\n onMouseEnter={() => {\r\n const delayedDispatch = setTimeout(() => {\r\n dispatch(setCommonState('hoveredMetric', metric));\r\n }, 100);\r\n return () => clearTimeout(delayedDispatch);\r\n }}\r\n onMouseLeave={() => {\r\n const delayedDispatch = setTimeout(() => {\r\n dispatch(setCommonState('hoveredMetric', null));\r\n }, 100);\r\n return () => clearTimeout(delayedDispatch);\r\n }}\r\n className={cn(\r\n 'lg:last:rounded-b-3xl select-none cursor-pointer dark:hover:bg-brand-900/50 hover:bg-brand-100/50 group flex flex-row justify-between items-center ' +\r\n 'last:border-b-0 border-b lg:border-b-0 lg:border-t lg:even:border-l-0 even:border-l px-3 lg:px-6 py-2.5',\r\n metric.id === activeMetric?.id && 'bg-brand-100/80 dark:bg-brand-900/80 '\r\n\r\n )}>\r\n
\r\n
\r\n
\r\n \r\n {metric.title}\r\n \r\n \r\n\r\n {metric.potentialGain > 1 ?\r\n <>Enhance this for { metric.potentialGain.toFixed(0) } point boost. > :\r\n `Looks great, well done!`}\r\n\r\n \r\n
\r\n\r\n {/*
*/}\r\n
\r\n
\r\n {metric.displayValue}\r\n
\r\n
\r\n
\r\n { hoveredMetric?.id === metric.id ?\r\n
\r\n :\r\n\r\n
\r\n\r\n }\r\n
\r\n
\r\n ))}\r\n
\r\n )\r\n}\r\n\r\nexport default Metrics","import { useEffect, useState } from 'react';\r\nimport {useRootContext} from \"../../context/root\";\r\nimport {Monitor, Moon, Sun} from \"lucide-react\";\r\n\r\nconst ThemeSwitcher = ({action = true}: {action?: boolean}) => {\r\n\r\n const { theme, setTheme, changeTheme } = useRootContext()\r\n\r\n return (\r\n action && changeTheme() }>\r\n { theme === 'dark' ? (\r\n \r\n ) : theme === 'light' ? (\r\n \r\n ) : (\r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default ThemeSwitcher;\r\n","import React, { ReactNode, useEffect, useMemo, useState } from 'react';\r\nimport { Archive, CheckCircleIcon, Code, FileCode2, FileJson, FileJson2, FileMinus2, FileType, Loader, LucideIcon, RefreshCw, RemoveFormatting, Type, XCircleIcon } from \"lucide-react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { optimizerData } from \"../store/app/appSelector\";\r\nimport Card from \"components/ui/card\";\r\nimport AppButton from \"components/ui/app-button\";\r\nimport TooltipText from './ui/tooltip-text';\r\nimport { toast } from './ui/use-toast';\r\nimport { useAppContext } from '../context/app';\r\n\r\ninterface ActionItem {\r\n id: string;\r\n label: string;\r\n icon: LucideIcon;\r\n}\r\n\r\nlet icons: { [key: string]: ReactNode } = {\r\n clear_cache: ,\r\n clear_page_cache: ,\r\n clear_all_optimizations: ,\r\n clear_css_optimizations: ,\r\n clear_js_optimizations:
,\r\n clear_font_optimizations: ,\r\n default: \r\n}\r\n\r\ntype GlobalAction = AuditSettingInput & {\r\n category: string\r\n loading?: boolean\r\n}\r\n\r\nconst RapidLoadActions: React.FC = () => {\r\n const { actions, settings } = useSelector(optimizerData);\r\n const {options} = useAppContext()\r\n\r\n \r\n let [_actions, setActions] = useState(actions.map((a: any) => ({\r\n ...a,\r\n loading: false\r\n })))\r\n\r\n useEffect(() => {\r\n setActions(actions.map((a: any) => ({\r\n ...a,\r\n loading: false\r\n })))\r\n }, [actions])\r\n\r\n const triggerAction = async (action: GlobalAction) => {\r\n\r\n try {\r\n setActions(prev => prev.map(a =>\r\n a.control_icon === action.control_icon ? {\r\n ...a,\r\n loading: true\r\n } : a\r\n ))\r\n\r\n let result = await fetch(action.action.replace(/&/g, '&'));\r\n\r\n toast({\r\n duration: 10,\r\n description: Successfully completed
\r\n })\r\n\r\n } catch (e: any) {\r\n toast({\r\n duration: 10,\r\n description: An error occurred - {e?.message}
\r\n });\r\n console.error(e);\r\n }\r\n\r\n setActions(prev => prev.map(a =>\r\n a.control_icon === action.control_icon ? {\r\n ...a,\r\n loading: false\r\n } : a\r\n ))\r\n }\r\n\r\n\r\n if(!actions) {\r\n return <>>\r\n }\r\n\r\n return (\r\n \r\n {_actions.filter((action: GlobalAction) => action.category === 'general').map((action) => (\r\n
triggerAction(action)}\r\n className='rounded-[15px] ' variant='ghost'>\r\n \r\n {action.loading ?\r\n \r\n \r\n :\r\n icons[action.control_icon] || icons.default}\r\n {action.control_label} \r\n
\r\n \r\n ))}\r\n
\r\n );\r\n};\r\n\r\nexport default RapidLoadActions;","import Mode from \"app/page-optimizer/components/Mode\";\r\nimport {Popover, PopoverContent, PopoverTrigger} from \"components/ui/popover\";\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\nimport {GraduationCapIcon, History} from \"lucide-react\";\r\nimport {cn, timeAgo} from \"lib/utils\";\r\nimport PerformanceProgressBar from \"components/performance-progress-bar\";\r\nimport ThemeSwitcher from \"components/ui/theme-switcher\";\r\nimport {AnimatePresence} from \"framer-motion\";\r\nimport ScaleUp from \"components/animation/ScaleUp\";\r\nimport AppButton from \"components/ui/app-button\";\r\nimport {setCommonRootState} from \"../../../../store/common/commonActions\";\r\nimport Card from \"components/ui/card\";\r\nimport React, {useEffect, useState} from \"react\";\r\nimport {useSelector} from \"react-redux\";\r\nimport {optimizerData} from \"../../../../store/app/appSelector\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\nimport {useRootContext} from \"../../../../context/root\";\r\nimport RapidLoadActions from \"components/RapidLoadActions\";\r\n\r\nconst tourPromptKey = 'titan-tour-prompt'\r\n\r\nconst SideBarActions = () => {\r\n const { changeTheme } = useRootContext()\r\n\r\n const [tourPrompt, setTourPrompt] = useState(() => {\r\n const storedData = localStorage.getItem(tourPromptKey);\r\n return storedData ? JSON.parse(storedData) : true;\r\n })\r\n\r\n const {data, error, loading, revisions} = useSelector(optimizerData);\r\n const { dispatch, hoveredMetric, activeMetric} = useCommonDispatch()\r\n\r\n\r\n useEffect(() => {\r\n localStorage.setItem(tourPromptKey, JSON.stringify(tourPrompt));\r\n }, [tourPrompt])\r\n\r\n return \r\n\r\n {(data?.loadingExperience && !activeMetric) &&\r\n <>\r\n {/**/}\r\n {/* {tourPrompt &&*/}\r\n {/* */}\r\n {/* setTourPrompt(false)}*/}\r\n {/* className='absolute animate-bounce-horizontal text-sm left-[110px] text-brand-400 font-normal'>*/}\r\n {/* 👈 Ready to get Started? Take a quick tour*/}\r\n {/*
*/}\r\n {/* */}\r\n {/* }*/}\r\n {/* */}\r\n\r\n {\r\n dispatch(setCommonRootState('isTourOpen', true))\r\n setTourPrompt(false)\r\n }}\r\n className='transition-none h-12 px-3 rounded-2xl border-none bg-transparent' variant='outline'>\r\n \r\n \r\n Get Started \r\n
\r\n\r\n\r\n \r\n >\r\n }\r\n\r\n changeTheme()}\r\n className='transition-none h-12 px-3 rounded-2xl border-none bg-transparent' variant='outline'>\r\n \r\n \r\n Theme \r\n
\r\n\r\n\r\n \r\n\r\n\r\n \r\n\r\n \r\n\r\n\r\n}\r\n\r\nexport default SideBarActions","import React, {useEffect, useMemo, useState} from \"react\";\r\nimport {Annoyed, Frown, Loader, MehIcon, Smile, SmilePlus, ThumbsDownIcon, ThumbsUpIcon} from \"lucide-react\";\r\nimport {cn} from \"lib/utils\";\r\nimport {Textarea} from \"components/ui/textarea\";\r\nimport Accordion from \"components/accordion\";\r\nimport Card from \"components/ui/card\";\r\nimport {Button} from \"components/ui/button\";\r\nimport ApiService from \"../../../../services/api\";\r\nimport {useToast} from \"components/ui/use-toast\";\r\nimport {CheckCircleIcon, XCircleIcon} from \"@heroicons/react/24/solid\";\r\nimport { LazyMotion, domAnimation, m } from \"framer-motion\"\r\nimport AppButton from \"components/ui/app-button\";\r\nimport ThumbUp\r\n from \"../../../../../../../../../woocommerce/packages/woocommerce-blocks/assets/js/icons/library/thumb-up\";\r\n\r\nconst Feedback = () => {\r\n\r\n const [activeFeedback, setActiveFeedback] = useState(null)\r\n const [notes, setNotes] = useState('')\r\n const [loading, setLoading] = useState(false)\r\n const [showFeedback, setShowFeedback] = useState(false)\r\n const { toast } = useToast()\r\n\r\n const FeedbackComponents = useMemo(() => [\r\n {Component: Annoyed, value: 'annoyed'},\r\n {Component: Frown, value: 'frown'},\r\n {Component: MehIcon, value: 'meh'},\r\n {Component: Smile, value: 'smile'},\r\n {Component: SmilePlus, value: 'smilePlus'}\r\n ], []);\r\n\r\n const handleFeedback = async () => {\r\n\r\n if (!activeFeedback) {\r\n return;\r\n }\r\n\r\n const api = new ApiService();\r\n\r\n try {\r\n setLoading(true)\r\n await api.post(\r\n 'rapidload_titan_feedback',\r\n {\r\n smiley: activeFeedback,\r\n detail: notes\r\n }\r\n )\r\n\r\n toast({\r\n description: Thank you! Your feedback is\r\n sent.
,\r\n })\r\n\r\n setLoading(false)\r\n setActiveFeedback('')\r\n setNotes('')\r\n setShowFeedback(false);\r\n\r\n } catch (error: any) {\r\n\r\n toast({\r\n description: {error.message}
,\r\n })\r\n\r\n setLoading(false)\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n\r\n if (!activeFeedback) {\r\n return;\r\n }\r\n\r\n handleFeedback();\r\n\r\n }, [activeFeedback])\r\n\r\n\r\n useEffect(() => {\r\n\r\n setTimeout(() => {\r\n setShowFeedback(true)\r\n }, 30 * 1)\r\n }, [])\r\n\r\n if (!showFeedback) {\r\n return <>>;\r\n }\r\n\r\n return (\r\n \r\n \r\n
How was the experience?
\r\n
Feedback helps us improve the product work better for you.\r\n
\r\n
\r\n\r\n \r\n
{\r\n\r\n setActiveFeedback('good');\r\n }}\r\n className={cn(\r\n activeFeedback === 'good' && 'bg-brand-300'\r\n )}\r\n variant='outline'>\r\n\r\n {loading && activeFeedback === 'good' ?\r\n \r\n :\r\n \r\n }\r\n\r\n\r\n Good \r\n
{\r\n setActiveFeedback('bad');\r\n }}\r\n className={cn(\r\n activeFeedback === 'bad' && 'bg-brand-300'\r\n )}\r\n variant='outline'>\r\n {loading && activeFeedback === 'bad' ?\r\n \r\n :\r\n \r\n }\r\n Bad \r\n
\r\n \r\n );\r\n}\r\n\r\nexport default Feedback","// testModeUtils.js\r\nimport { getTestModeStatus } from \"../store/app/appActions\";\r\nimport React, { useEffect, useState } from 'react';\r\nimport { useToast } from \"components/ui/use-toast\";\r\nimport { CheckCircleIcon, XCircleIcon, CheckIcon, XMarkIcon } from \"@heroicons/react/24/solid\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\nimport {setCommonState} from \"../store/common/commonActions\";\r\nimport {useAppContext} from \"../context/app\";\r\n\r\n\r\nexport const useTestModeUtils = () => {\r\n const {options} = useAppContext();\r\n const { dispatch } = useCommonDispatch();\r\n const { toast } = useToast();\r\n const [timeoutId, setTimeoutId] = useState(null);\r\n let url = options?.optimizer_url;\r\n\r\n const handleTestModeSwitchChange = (isChecked: boolean) => {\r\n return new Promise(async (resolve, reject) => {\r\n try {\r\n dispatch(setCommonState('testModeStatus', isChecked));\r\n dispatch(setCommonState('testModeLoading', true));\r\n if (timeoutId) {\r\n clearTimeout(timeoutId);\r\n }\r\n\r\n const newTimeoutId = setTimeout(async () => {\r\n const result = await dispatch(getTestModeStatus(options, url, String(isChecked)));\r\n if (result.success) {\r\n dispatch(setCommonState('testModeLoading', false));\r\n toast({\r\n description: (\r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n Test Mode turned {isChecked ? 'on' : 'off'} successfully \r\n {isChecked ? 'Changes will not affect the live site.' : 'All changes will be applied to the live site.'} \r\n
\r\n
\r\n ),\r\n className:'p-3',\r\n });\r\n } else {\r\n toast({\r\n description: (\r\n \r\n
\r\n \r\n
\r\n\r\n
\r\n Failed to turn on Test Mode \r\n {result.error} \r\n
\r\n
\r\n ),\r\n className:'p-3',\r\n }, 500000);\r\n dispatch(setCommonState('testModeStatus', false));\r\n dispatch(setCommonState('testModeLoading', false));\r\n }\r\n resolve(result); // Resolve with the result\r\n }, 1000);\r\n setTimeoutId(newTimeoutId);\r\n } catch (error) {\r\n reject(error); // Reject if there's an error\r\n }\r\n });\r\n };\r\n\r\n return {handleTestModeSwitchChange};\r\n};\r\n","import * as React from \"react\";\nfunction Cog6ToothIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M7.84 1.804A1 1 0 0 1 8.82 1h2.36a1 1 0 0 1 .98.804l.331 1.652a6.993 6.993 0 0 1 1.929 1.115l1.598-.54a1 1 0 0 1 1.186.447l1.18 2.044a1 1 0 0 1-.205 1.251l-1.267 1.113a7.047 7.047 0 0 1 0 2.228l1.267 1.113a1 1 0 0 1 .206 1.25l-1.18 2.045a1 1 0 0 1-1.187.447l-1.598-.54a6.993 6.993 0 0 1-1.929 1.115l-.33 1.652a1 1 0 0 1-.98.804H8.82a1 1 0 0 1-.98-.804l-.331-1.652a6.993 6.993 0 0 1-1.929-1.115l-1.598.54a1 1 0 0 1-1.186-.447l-1.18-2.044a1 1 0 0 1 .205-1.251l1.267-1.114a7.05 7.05 0 0 1 0-2.227L1.821 7.773a1 1 0 0 1-.206-1.25l1.18-2.045a1 1 0 0 1 1.187-.447l1.598.54A6.992 6.992 0 0 1 7.51 3.456l.33-1.652ZM10 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(Cog6ToothIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction ExclamationCircleIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(ExclamationCircleIcon);\nexport default ForwardRef;","import * as React from \"react\";\nfunction InformationCircleIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(InformationCircleIcon);\nexport default ForwardRef;","import {ExclamationCircleIcon} from \"@heroicons/react/20/solid\";\r\nimport React from \"react\";\r\nimport {cn} from \"lib/utils\";\r\n\r\n\r\nconst ErrorFetch = ({ error, className }: { error: string, className?: string}) => {\r\n return \r\n
\r\n \r\n
\r\n
\r\n
Oops! Something went wrong \r\n
Refresh the page, If the error persists\r\n \r\n please contact support \r\n \r\n
Details: {error}\r\n
\r\n
\r\n}\r\n\r\nexport default ErrorFetch","import React, {FC, useEffect, useState } from 'react';\r\n\r\ninterface SvgProps {\r\n cls?: string;\r\n}\r\n\r\nconst width = 34;\r\nconst height = 34;\r\n\r\nexport const SettingsLine: FC = ({ width = 400, category }) => {\r\n const [animate, setAnimate] = useState(true);\r\n\r\n useEffect(() => {\r\n setAnimate(true);\r\n\r\n const timeoutId = setTimeout(() => {\r\n setAnimate(false);\r\n }, 80);\r\n\r\n return () => clearTimeout(timeoutId);\r\n\r\n }, [category, width]);\r\n\r\n // Adjusting path values based on the new width\r\n const adjustedPath = `M${Math.min(width - (width - 66), width - 9.5)} 1C${Math.min(width - (width - 66), width - 9.5)} 8.5 ${Math.min(width - (width - 72), width - 9.5)} 8 ${Math.min(width - (width - 75.5), width - 9.5)} 8C${Math.min(width - (width - 89.7), width - 9.5)} 8 ${Math.min(width - (width - 130.5), width - 9.5)} 8 ${width - 9.5} 8C${width - 5.5} 8 ${width - 0.5} 9.5 ${width - 0.5} 15.5`;\r\n const strokeWidth = 2;\r\n\r\n return (\r\n \r\n {!animate &&\r\n
\r\n \r\n \r\n }\r\n\r\n
\r\n \r\n \r\n
\r\n );\r\n};\r\n\r\n\r\nexport const TestModeLine: FC = ({ width = 400, category }) => {\r\n const [animate, setAnimate] = useState(true);\r\n\r\n useEffect(() => {\r\n setAnimate(true);\r\n\r\n const timeoutId = setTimeout(() => {\r\n setAnimate(false);\r\n }, 80);\r\n\r\n return () => clearTimeout(timeoutId);\r\n\r\n }, [category, width]);\r\n\r\n // Adjusting path values based on the new width\r\n const adjustedPath = `M${Math.min(width - (width - 66), width - 9.5)} 1C${Math.min(width - (width - 66), width - 9.5)} 8.5 ${Math.min(width - (width - 72), width - 9.5)} 8 ${Math.min(width - (width - 75.5), width - 9.5)} 8C${Math.min(width - (width - 89.7), width - 9.5)} 8 ${Math.min(width - (width - 130.5), width - 9.5)} 8 ${width - 9.5} 8C${width - 5.5} 8 ${width - 0.5} 9.5 ${width - 0.5} 15.5`;\r\n const strokeWidth = 2;\r\n\r\n return (\r\n \r\n {!animate &&\r\n
\r\n \r\n \r\n }\r\n\r\n
\r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport const SettingsStraightLine: FC = ({cls}) => (\r\n \r\n);\r\n\r\nexport const AuditsLine:FC = ({cls}) => (\r\n \r\n \r\n \r\n);","import { m } from \"framer-motion\";\r\nimport React, { useEffect, useState } from \"react\";\r\nimport { useSelector } from \"react-redux\";\r\nimport { setCommonState } from \"../../../store/common/commonActions\";\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\nimport { Circle, Loader } from \"lucide-react\";\r\nimport { ArrowTopRightOnSquareIcon } from \"@heroicons/react/24/outline\";\r\nimport { TestModeLine } from \"app/page-optimizer/components/icons/line-icons\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\nimport { useTestModeUtils } from \"hooks/testModeUtils\";\r\nimport { useAppContext } from \"../../../context/app\";\r\nimport { optimizerData } from \"../../../store/app/appSelector\";\r\nimport { cn } from \"lib/utils\";\r\n\r\nconst TestModeSwitcher = () => {\r\n\r\n const { testMode } = useSelector(optimizerData);\r\n const [loadingStatus, setLoadingStatus] = useState(false);\r\n const { testModeStatus, testModeLoading, dispatch } = useCommonDispatch();\r\n const { handleTestModeSwitchChange } = useTestModeUtils();\r\n const { options, mode } = useAppContext();\r\n const { revisions } = useSelector(optimizerData);\r\n\r\n useEffect(() => {\r\n if (testMode && mode === 'onboard') {\r\n dispatch(setCommonState('testModeStatus', false));\r\n }\r\n else {\r\n dispatch(setCommonState('testModeStatus', testMode));\r\n }\r\n\r\n\r\n }, [testMode, dispatch]);\r\n\r\n const handleSwitchChange = async (isChecked: boolean) => {\r\n await handleTestModeSwitchChange(isChecked);\r\n };\r\n\r\n useEffect(() => {\r\n setLoadingStatus(testModeLoading);\r\n }, [testModeStatus, testModeLoading, testMode]);\r\n\r\n\r\n return \r\n
\r\n
\r\n
\r\n {/*
*/}\r\n {/*
*/}\r\n
\r\n\r\n
{\r\n if (testModeStatus) {\r\n await handleSwitchChange(false);\r\n }\r\n }}\r\n className={`relative z-1 items-center text-sm flex gap-2 px-3 py-2.5 font-medium rounded-2xl ${testModeStatus ? 'text-brand-500' : ''}`}\r\n >\r\n \r\n \r\n Live\r\n
\r\n\r\n
{\r\n if (!testModeStatus) {\r\n await handleSwitchChange(true);\r\n }\r\n }}\r\n className={`relative justify-center items-center z-1 text-sm flex pl-6 pr-5 py-2.5 whitespace-nowrap font-medium rounded-2xl ${testModeStatus ? 'text-brand-500' : 'text-brand-500'}`}\r\n >\r\n Test Mode\r\n
\r\n
\r\n
\r\n
\r\n {\r\n\r\n {\r\n !loadingStatus && window.open(options.optimizer_url + '?rapidload_preview', '_blank');\r\n }\r\n\r\n }}\r\n className={`flex gap-2 items-center text-sm h-12 rounded-[14px] bg-brand-0 dark:bg-brand-930/90 px-4 py-2 ${revisions?.length > 0\r\n ? '' : ''}`} data-tour=\"preview-button\">\r\n\r\n {loadingStatus ?
:\r\n
}\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n}\r\n\r\nexport default TestModeSwitcher","import React, { ReactNode, Suspense, useCallback, useEffect, useMemo, useRef, useState } from 'react';\r\nimport PerformanceIcons from 'app/page-optimizer/components/performance-widgets/PerformanceIcons';\r\nimport { useSelector } from \"react-redux\";\r\nimport { optimizerData } from \"../../../../store/app/appSelector\";\r\nimport { useAppContext } from \"../../../../context/app\";\r\nimport { Skeleton } from \"components/ui/skeleton\"\r\nimport { cn, timeAgo } from \"lib/utils\";\r\nimport Card from \"components/ui/card\";\r\nimport PerformanceProgressBar from \"components/performance-progress-bar\";\r\nimport Metrics from \"app/page-optimizer/components/performance-widgets/Metrics\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\nimport { setCommonRootState, setCommonState } from \"../../../../store/common/commonActions\";\r\nimport {\r\n Circle, GraduationCapIcon,\r\n Hash, History, Loader, Monitor,\r\n} from \"lucide-react\";\r\nimport SideBarActions from \"app/page-optimizer/components/performance-widgets/SideBarActions\";\r\nimport xusePerformanceColors from \"hooks/usePerformanceColors\";\r\nimport AppButton from \"components/ui/app-button\";\r\nimport Feedback from \"app/page-optimizer/components/performance-widgets/Feedback\";\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\nimport { changeReport } from \"../../../../store/app/appActions\";\r\nimport { ArrowTopRightOnSquareIcon, DevicePhoneMobileIcon, InformationCircleIcon } from \"@heroicons/react/24/outline\";\r\nimport { getTestModeStatus } from \"../../../../store/app/appActions\";\r\nimport { useToast } from \"components/ui/use-toast\";\r\nimport { RootState } from \"../../../../store/app/appTypes\";\r\nimport { CheckCircleIcon, XCircleIcon } from \"@heroicons/react/24/solid\";\r\nimport { TestModeLine } from \"app/page-optimizer/components/icons/line-icons\";\r\nimport { useTestModeUtils } from 'hooks/testModeUtils';\r\nimport { AnimatePresence, m } from \"framer-motion\";\r\nimport ErrorFetch from \"components/ErrorFetch\";\r\nimport TestModeSwitcher from \"app/page-optimizer/components/TestModeSwitcher\";\r\nimport { Button } from 'components/ui/button';\r\nimport RapidLoadActions from \"components/RapidLoadActions\";\r\n// const Feedback = React.lazy(() =>\r\n// import('app/page-optimizer/components/performance-widgets/Feedback'))\r\n\r\ninterface PageSpeedScoreProps {\r\n pagespeed?: any;\r\n priority?: boolean;\r\n}\r\n\r\nconst MetricValue = ({ metric }: { metric: Metric }) => {\r\n const [x, y, z, progressBarColorCode] = xusePerformanceColors(metric.score)\r\n\r\n return \r\n {metric.displayValue}\r\n
\r\n}\r\n\r\n\r\nconst PageSpeedScore = ({ pagespeed, priority = true }: PageSpeedScoreProps) => {\r\n const [isCoreWebClicked, setCoreWebIsClicked] = useState(false);\r\n const [expanded, setExpanded] = useState(false)\r\n\r\n\r\n const { data, error, reanalyze, revisions, loading } = useSelector(optimizerData);\r\n const [performance, setPerformance] = useState(0)\r\n const [on, setOn] = useState(false)\r\n\r\n const { dispatch, hoveredMetric, activeMetric } = useCommonDispatch()\r\n\r\n //Test Mode\r\n const { options } = useAppContext();\r\n const { settingsMode, testModeStatus, testModeLoading } = useCommonDispatch();\r\n const { testMode } = useSelector((state: RootState) => state.app);\r\n const [timeoutId, setTimeoutId] = useState(null);\r\n const [localSwitchState, setLocalSwitchState] = useState(testMode?.status || false);\r\n const [loadingStatus, setLoadingStatus] = useState(false);\r\n\r\n const { handleTestModeSwitchChange } = useTestModeUtils();\r\n\r\n let url = options?.optimizer_url;\r\n\r\n useEffect(() => {\r\n if (testMode) {\r\n dispatch(setCommonState('testModeStatus', testMode.status || false));\r\n }\r\n\r\n }, [testMode]);\r\n\r\n\r\n const handleSwitchChange = async (isChecked: boolean) => {\r\n await handleTestModeSwitchChange(isChecked);\r\n };\r\n\r\n useEffect(() => {\r\n setLocalSwitchState(testModeStatus);\r\n setLoadingStatus(testModeLoading);\r\n }, [testModeStatus, testModeLoading]);\r\n\r\n const handleCoreWebClick = useCallback(() => {\r\n setCoreWebIsClicked(!isCoreWebClicked);\r\n }, [isCoreWebClicked]);\r\n\r\n // reorder experience start\r\n const metricNameMappings: Record = {\r\n \"LARGEST_CONTENTFUL_PAINT_MS\": \"LCP\",\r\n \"FIRST_INPUT_DELAY_MS\": \"FID\",\r\n \"CUMULATIVE_LAYOUT_SHIFT_SCORE\": \"CLS\",\r\n \"FIRST_CONTENTFUL_PAINT_MS\": \"FCP\",\r\n \"INTERACTION_TO_NEXT_PAINT\": \"INP\",\r\n \"EXPERIMENTAL_TIME_TO_FIRST_BYTE\": \"TTFB\",\r\n\r\n };\r\n\r\n const experianceOrder: string[] = [\r\n \"LARGEST_CONTENTFUL_PAINT_MS\",\r\n \"FIRST_INPUT_DELAY_MS\",\r\n \"CUMULATIVE_LAYOUT_SHIFT_SCORE\",\r\n \"FIRST_CONTENTFUL_PAINT_MS\",\r\n \"INTERACTION_TO_NEXT_PAINT\",\r\n \"EXPERIMENTAL_TIME_TO_FIRST_BYTE\",\r\n\r\n ];\r\n\r\n const getAbbreviation = (metricName: string): string => metricNameMappings[metricName] || metricName;\r\n\r\n const sortedExperience = experianceOrder.map(metricName => ({\r\n metricName: getAbbreviation(metricName),\r\n metric: data?.loadingExperience?.metrics ? data?.loadingExperience?.metrics[metricName] : null,\r\n }));\r\n\r\n const FirstLettersComponent = ({ text }: { text: string }) => {\r\n const replacedText = getAbbreviation(text);\r\n return <>{replacedText}>;\r\n };\r\n\r\n let metric = hoveredMetric\r\n\r\n let gain = Number((metric?.potentialGain ? metric?.potentialGain : 0)?.toFixed(0))\r\n\r\n const [key, setKey] = useState(1);\r\n\r\n useEffect(() => {\r\n setKey(prevKey => prevKey + 1);\r\n }, []);\r\n\r\n useEffect(() => {\r\n\r\n if (!expanded) {\r\n dispatch(setCommonState('activeMetric', null));\r\n }\r\n\r\n }, [expanded])\r\n\r\n\r\n return <>\r\n {/*min-w-[310px]*/}\r\n\r\n \r\n
\r\n
\r\n\r\n \r\n\r\n {error ?\r\n
\r\n : <>\r\n\r\n
\r\n
\r\n\r\n
\r\n {!data || on ? (\r\n
\r\n ) : (\r\n
= 99) ? 99 :\r\n data.performance + gain : data?.performance}>\r\n {!!(metric && gain) && (\r\n \r\n \r\n {metric?.title}\r\n \r\n +{gain} \r\n
\r\n )}\r\n \r\n )}\r\n
\r\n
\r\n
\r\n\r\n
\r\n
{metric ? 'Forecasted Score' : 'Performance'}
\r\n
\r\n Values are estimated and may vary with Google Page Speed Insights.\r\n
\r\n
\r\n
\r\n\r\n\r\n >\r\n }\r\n\r\n
\r\n\r\n \r\n
!loading && setExpanded(p => !p)}\r\n variant='outline'\r\n className={cn(\r\n 'select-none border-b border-l-0 border-t-0 border-r-0 rounded-none bg-transparent hover:bg-transparent text-center text-xs text-brand-600 py-2',\r\n expanded && 'border-b-0'\r\n )}\r\n data-tour=\"expand-metrics\">\r\n {expanded ? 'Collapse' : 'Expand'} Metrics\r\n \r\n\r\n {(data?.metrics && !expanded) && (\r\n <>\r\n
dispatch(setCommonState('hoveredMetric', null))}\r\n >\r\n {data.metrics.map(metric => (\r\n
dispatch(setCommonState('hoveredMetric', metric))}\r\n\r\n className='text-xs text-center flex flex-col\r\n gap-0.5 px-2 py-2 bg-brand-100/20 hover:bg-brand-100 cursor-default rounded-[14px]'>\r\n
{metric.refs.acronym}
\r\n
\r\n
\r\n ))}\r\n
\r\n\r\n >\r\n )}\r\n\r\n
\r\n\r\n {(data?.metrics && expanded) && (\r\n \r\n
dispatch(setCommonState('activeMetric', null))}\r\n className={cn(\r\n 'flex gap-3 items-center font-medium dark:hover:bg-brand-900/70 px-6 py-3 border-b lg:border-b-0 lg:border-t cursor-pointer text-sm',\r\n !activeMetric && 'bg-brand-100/80 dark:bg-brand-900/80 '\r\n )\r\n }>\r\n All Audits\r\n
\r\n
\r\n
\r\n )}\r\n \r\n
\r\n\r\n
\r\n \r\n \r\n\r\n
\r\n >\r\n}\r\n\r\nexport default React.memo(PageSpeedScore)","import * as React from \"react\"\r\nimport * as ToastPrimitives from \"@radix-ui/react-toast\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { X } from \"lucide-react\"\r\n\r\nimport { cn } from \"lib/utils\"\r\n\r\nconst ToastProvider = ToastPrimitives.Provider\r\n\r\nconst ToastViewport = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nToastViewport.displayName = ToastPrimitives.Viewport.displayName\r\n\r\nconst toastVariants = cva(\r\n \"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-bottom-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"border bg-background\",\r\n destructive:\r\n \"destructive group border-destructive text-destructive-foreground\",\r\n },\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n },\r\n }\r\n)\r\n\r\nconst Toast = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef &\r\n VariantProps\r\n>(({ className, variant, ...props }, ref) => {\r\n return (\r\n <>\r\n \r\n >\r\n )\r\n})\r\nToast.displayName = ToastPrimitives.Root.displayName\r\n\r\nconst ToastAction = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nToastAction.displayName = ToastPrimitives.Action.displayName\r\n\r\nconst ToastClose = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n \r\n \r\n))\r\nToastClose.displayName = ToastPrimitives.Close.displayName\r\n\r\nconst ToastTitle = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nToastTitle.displayName = ToastPrimitives.Title.displayName\r\n\r\nconst ToastDescription = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nToastDescription.displayName = ToastPrimitives.Description.displayName\r\n\r\ntype ToastProps = React.ComponentPropsWithoutRef\r\n\r\ntype ToastActionElement = React.ReactElement\r\n\r\nexport {\r\n type ToastProps,\r\n type ToastActionElement,\r\n ToastProvider,\r\n ToastViewport,\r\n Toast,\r\n ToastTitle,\r\n ToastDescription,\r\n ToastClose,\r\n ToastAction,\r\n}\r\n","import {\r\n Toast,\r\n ToastClose,\r\n ToastDescription,\r\n ToastProvider,\r\n ToastTitle,\r\n ToastViewport,\r\n} from \"@/components/ui/toast\"\r\nimport { useToast } from \"@/components/ui/use-toast\"\r\n\r\nexport function Toaster() {\r\n const { toasts } = useToast()\r\n\r\n return (\r\n \r\n {toasts.map(function ({ id, title, description, action, ...props }) {\r\n return (\r\n \r\n \r\n {title && {title} }\r\n {description && (\r\n {description} \r\n )}\r\n
\r\n {action}\r\n \r\n \r\n )\r\n })}\r\n \r\n \r\n )\r\n}\r\n","import TooltipText from \"components/ui/tooltip-text\";\r\nimport {ArrowLeftToLine, ArrowRightToLine} from \"lucide-react\";\r\nimport React from \"react\";\r\nimport {useAppContext} from \"../context/app\";\r\n\r\nconst TogglePerformance = () => {\r\n\r\n const {\r\n togglePerformance,\r\n setTogglePerformance\r\n } = useAppContext()\r\n\r\n return (\r\n \r\n {\r\n setTogglePerformance(prev => !prev)\r\n }}>\r\n {(togglePerformance) ? :\r\n }\r\n \r\n \r\n )\r\n}\r\n\r\nexport default TogglePerformance","import SpeedIndex from \"app/page-optimizer/spaces/Metrics\";\r\nimport {AnimatePresence, m} from \"framer-motion\";\r\nimport React, {ReactNode} from \"react\";\r\n\r\ninterface SlideUpProps {\r\n children: ReactNode\r\n uuid?: string | number\r\n className?: string\r\n}\r\n\r\nconst ScaleUp = ({ children, uuid = 'random', className } : SlideUpProps) => {\r\n\r\n const variants = {\r\n hidden: { opacity: 0, scale: 0.9 },\r\n visible: { opacity: 1, scale: 1 }\r\n };\r\n\r\n return (\r\n\r\n \r\n {children}\r\n \r\n\r\n )\r\n}\r\n\r\nexport default ScaleUp","import {cn} from \"lib/utils\";\r\n\r\nconst Description = ({ content, className} : {content?: string, className?: string}) => {\r\n const parts = content?.split(/\\[(.*?)\\]\\((.*?)\\)/);\r\n\r\n return (\r\n \r\n {parts?.map((part, index) => {\r\n if (index % 3 === 1) {\r\n // Creating anchor tag for links\r\n const link = parts[index + 1];\r\n return (\r\n
\r\n {part}\r\n \r\n );\r\n } else if (index % 3 === 0) {\r\n // Displaying regular text\r\n return
{part} ;\r\n } else {\r\n return null;\r\n }\r\n })}\r\n
\r\n );\r\n}\r\n\r\nexport default Description","import Setting from \"app/page-optimizer/components/audit/Setting\";\r\nimport React, {ReactNode, useCallback} from \"react\";\r\nimport {useDispatch, useSelector} from \"react-redux\";\r\nimport {optimizerData} from \"../../../../store/app/appSelector\";\r\nimport {cn, transformFileType} from \"lib/utils\";\r\nimport {JsonView} from \"react-json-view-lite\";\r\nimport {updateSettings} from \"../../../../store/app/appActions\";\r\nimport {ThunkDispatch} from \"redux-thunk\";\r\nimport {AppAction, RootState} from \"../../../../store/app/appTypes\";\r\nimport {setCommonState} from \"../../../../store/common/commonActions\";\r\nimport {ChevronLeftIcon, ArrowLeftCircleIcon } from \"@heroicons/react/24/solid\";\r\nimport {Circle} from \"lucide-react\";\r\nimport useCommonDispatch from \"hooks/useCommonDispatch\";\r\n\r\ninterface SettingsProps {\r\n audit: Audit\r\n auditSettings?: AuditSetting[]\r\n max?: number\r\n type?: string\r\n className?: string\r\n hideActions?: boolean\r\n children?: ReactNode\r\n}\r\nconst capitalizeCategory = (category: string) => {\r\n if (category === 'css' || category === 'cdn') {\r\n return category.toUpperCase();\r\n } else {\r\n return category.charAt(0).toUpperCase() + category.slice(1);\r\n }\r\n};\r\n\r\nconst Settings = ({ audit, max = 2, type, auditSettings, className, hideActions, children }: SettingsProps ) => {\r\n const {settings} = useSelector(optimizerData);\r\n const dispatch: ThunkDispatch = useDispatch();\r\n const { activeTab, openCategory, openAudits} = useCommonDispatch()\r\n\r\n type = transformFileType(audit, type);\r\n\r\n if (!auditSettings) {\r\n auditSettings = audit.settings\r\n }\r\n\r\n const updateValue = useCallback( (setting: AuditSetting, value: any, key: string) => {\r\n\r\n dispatch(updateSettings(\r\n audit,\r\n setting,\r\n key,\r\n value\r\n ));\r\n }, [settings])\r\n\r\n return (\r\n <>\r\n {/* false}/>*/}\r\n {auditSettings && auditSettings.length > 0 &&(\r\n\r\n \r\n {children ? children : ''}\r\n {auditSettings.filter(i => {\r\n\r\n if (!type) {\r\n return true\r\n }\r\n\r\n return i.category === type;\r\n }).map((s, index) => (\r\n\r\n
{\r\n\r\n dispatch(setCommonState('openCategory', s.category));\r\n dispatch(setCommonState('activeTab', 'configurations'));\r\n dispatch(setCommonState('activeMetric', null))\r\n dispatch(setCommonState('auditsReturn', true));\r\n\r\n }}\r\n\r\n >\r\n
Go {openCategory === s.category? 'Back' : ''} to {capitalizeCategory(s.category)} Settings \r\n\r\n //
_s.name === s.name)} index={index} />\r\n ))}\r\n \r\n )}\r\n >\r\n );\r\n}\r\n\r\nexport default Settings","module.exports = function cmp (a, b) {\n var pa = a.split('.');\n var pb = b.split('.');\n for (var i = 0; i < 3; i++) {\n var na = Number(pa[i]);\n var nb = Number(pb[i]);\n if (na > nb) return 1;\n if (nb > na) return -1;\n if (!isNaN(na) && isNaN(nb)) return 1;\n if (isNaN(na) && !isNaN(nb)) return -1;\n }\n return 0;\n};\n","import * as React from \"react\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\n\r\nimport { cn } from \"lib/utils\"\r\n\r\nconst alertVariants = cva(\r\n \"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground\",\r\n {\r\n variants: {\r\n variant: {\r\n default: \"bg-background text-foreground\",\r\n destructive:\r\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\",\r\n },\r\n },\r\n defaultVariants: {\r\n variant: \"default\",\r\n },\r\n }\r\n)\r\n\r\nconst Alert = React.forwardRef<\r\n HTMLDivElement,\r\n React.HTMLAttributes & VariantProps\r\n>(({ className, variant, ...props }, ref) => (\r\n
\r\n))\r\nAlert.displayName = \"Alert\"\r\n\r\nconst AlertTitle = React.forwardRef<\r\n HTMLParagraphElement,\r\n React.HTMLAttributes\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nAlertTitle.displayName = \"AlertTitle\"\r\n\r\nconst AlertDescription = React.forwardRef<\r\n HTMLParagraphElement,\r\n React.HTMLAttributes\r\n>(({ className, ...props }, ref) => (\r\n
\r\n))\r\nAlertDescription.displayName = \"AlertDescription\"\r\n\r\nexport { Alert, AlertTitle, AlertDescription }\r\n","import Settings from \"app/page-optimizer/components/audit/Settings\";\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\nimport {MinusCircleIcon, PlusCircleIcon} from \"@heroicons/react/24/solid\";\r\nimport React, {Dispatch, SetStateAction, useMemo} from \"react\";\r\nimport {Table} from \"@tanstack/react-table\";\r\nimport {useSelector} from \"react-redux\";\r\nimport {optimizerData} from \"../../../../../store/app/appSelector\";\r\nimport {JsonView} from \"react-json-view-lite\";\r\nimport {cn} from \"lib/utils\";\r\n\r\ninterface FilesTableHeaderProps {\r\n audit: Audit\r\n group: any\r\n open: boolean,\r\n setOpen: Dispatch>\r\n index:number\r\n}\r\n\r\nconst FilesTableHeader = ({audit, group, open, setOpen, index} : FilesTableHeaderProps) => {\r\n\r\n\r\n\r\n const label = (typeof group.items[0].url !== 'string' && group.items[0].url?.file_type?.label) || group.type\r\n let title = useMemo(() => {\r\n\r\n let l = label.toLowerCase()\r\n\r\n if (l === 'table') {\r\n return 'Additional Information'\r\n }\r\n\r\n\r\n if (l === 'unknown') {\r\n return 'Unattributable items';\r\n }\r\n\r\n return `${label} Files`;\r\n\r\n }, [group])\r\n\r\n if (\"grouped_items\" in audit.files && audit.files.grouped_items.length === 1 && label.toLowerCase() === 'unknown') {\r\n title = ''\r\n }\r\n\r\n let rows = group.items\r\n\r\n // @ts-ignore\r\n const resources = rows.filter((r) => !r?.passed) || []\r\n // @ts-ignore\r\n const passed = rows.filter((r) => r?.passed) || []\r\n\r\n return (\r\n <>\r\n \r\n\r\n
\r\n
\r\n
\r\n setOpen(p => !p)}>\r\n { open ?\r\n :\r\n \r\n }\r\n {title ? title : \"Related Resources\"} \r\n \r\n \r\n
\r\n\r\n
\r\n {resources.length > 0 && (\r\n {resources.length} Resource{resources.length > 1 ? 's' : ''} \r\n )}\r\n {(resources.length > 0 && passed.length > 0) && ', '}\r\n {passed.length > 0 && (\r\n {passed.length} Optimized Resource{passed.length > 1 ? 's' : ''} \r\n )}\r\n
\r\n
\r\n\r\n {(audit.settings.length > 0) && (\r\n
\r\n \r\n
\r\n )}\r\n\r\n
\r\n >\r\n );\r\n}\r\n\r\nexport default FilesTableHeader","import React, {ReactNode, useEffect, useRef, useState} from 'react';\r\nimport {AnimatePresence, m} from 'framer-motion';\r\nimport {cn} from \"lib/utils\";\r\n\r\ninterface AccordionProps{\r\n id?: string,\r\n isOpen: boolean;\r\n initialRender?: boolean\r\n onAnimationComplete?: () => void\r\n onHeightChange?: () => void\r\n children: ReactNode,\r\n className?: string\r\n}\r\n\r\n const Accordion: React.FC = ({\r\n id= 'auditContent',\r\n isOpen,\r\n initialRender = false,\r\n children,\r\n onAnimationComplete,\r\n onHeightChange,\r\n className,\r\n ...props\r\n }) => {\r\n const [isFirstRender, setIsFirstRender] = useState(!initialRender);\r\n const divRef = useRef(null); // Reference for the m.div\r\n const variants = {\r\n open: { height: 'auto', opacity: 1, overflow: 'visible' },\r\n closed: { height: 0, opacity: 0, overflow: 'hidden' },\r\n };\r\n\r\n useEffect(() => {\r\n setIsFirstRender(false);\r\n }, []);\r\n\r\n return (\r\n \r\n {isOpen && (\r\n \r\n { children }\r\n \r\n )}\r\n \r\n );\r\n}\r\n\r\n\r\nexport default React.memo(Accordion);","const BYTE_UNITS = [\n\t'B',\n\t'kB',\n\t'MB',\n\t'GB',\n\t'TB',\n\t'PB',\n\t'EB',\n\t'ZB',\n\t'YB',\n];\n\nconst BIBYTE_UNITS = [\n\t'B',\n\t'KiB',\n\t'MiB',\n\t'GiB',\n\t'TiB',\n\t'PiB',\n\t'EiB',\n\t'ZiB',\n\t'YiB',\n];\n\nconst BIT_UNITS = [\n\t'b',\n\t'kbit',\n\t'Mbit',\n\t'Gbit',\n\t'Tbit',\n\t'Pbit',\n\t'Ebit',\n\t'Zbit',\n\t'Ybit',\n];\n\nconst BIBIT_UNITS = [\n\t'b',\n\t'kibit',\n\t'Mibit',\n\t'Gibit',\n\t'Tibit',\n\t'Pibit',\n\t'Eibit',\n\t'Zibit',\n\t'Yibit',\n];\n\n/*\nFormats the given number using `Number#toLocaleString`.\n- If locale is a string, the value is expected to be a locale-key (for example: `de`).\n- If locale is true, the system default locale is used for translation.\n- If no value for locale is specified, the number is returned unmodified.\n*/\nconst toLocaleString = (number, locale, options) => {\n\tlet result = number;\n\tif (typeof locale === 'string' || Array.isArray(locale)) {\n\t\tresult = number.toLocaleString(locale, options);\n\t} else if (locale === true || options !== undefined) {\n\t\tresult = number.toLocaleString(undefined, options);\n\t}\n\n\treturn result;\n};\n\nexport default function prettyBytes(number, options) {\n\tif (!Number.isFinite(number)) {\n\t\tthrow new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);\n\t}\n\n\toptions = {\n\t\tbits: false,\n\t\tbinary: false,\n\t\tspace: true,\n\t\t...options,\n\t};\n\n\tconst UNITS = options.bits\n\t\t? (options.binary ? BIBIT_UNITS : BIT_UNITS)\n\t\t: (options.binary ? BIBYTE_UNITS : BYTE_UNITS);\n\n\tconst separator = options.space ? ' ' : '';\n\n\tif (options.signed && number === 0) {\n\t\treturn ` 0${separator}${UNITS[0]}`;\n\t}\n\n\tconst isNegative = number < 0;\n\tconst prefix = isNegative ? '-' : (options.signed ? '+' : '');\n\n\tif (isNegative) {\n\t\tnumber = -number;\n\t}\n\n\tlet localeOptions;\n\n\tif (options.minimumFractionDigits !== undefined) {\n\t\tlocaleOptions = {minimumFractionDigits: options.minimumFractionDigits};\n\t}\n\n\tif (options.maximumFractionDigits !== undefined) {\n\t\tlocaleOptions = {maximumFractionDigits: options.maximumFractionDigits, ...localeOptions};\n\t}\n\n\tif (number < 1) {\n\t\tconst numberString = toLocaleString(number, options.locale, localeOptions);\n\t\treturn prefix + numberString + separator + UNITS[0];\n\t}\n\n\tconst exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);\n\tnumber /= (options.binary ? 1024 : 1000) ** exponent;\n\n\tif (!localeOptions) {\n\t\tnumber = number.toPrecision(3);\n\t}\n\n\tconst numberString = toLocaleString(Number(number), options.locale, localeOptions);\n\n\tconst unit = UNITS[exponent];\n\n\treturn prefix + numberString + separator + unit;\n}\n","export default function parseMilliseconds(milliseconds) {\n\tif (typeof milliseconds !== 'number') {\n\t\tthrow new TypeError('Expected a number');\n\t}\n\n\tconst roundTowardsZero = milliseconds > 0 ? Math.floor : Math.ceil;\n\n\treturn {\n\t\tdays: roundTowardsZero(milliseconds / 86400000),\n\t\thours: roundTowardsZero(milliseconds / 3600000) % 24,\n\t\tminutes: roundTowardsZero(milliseconds / 60000) % 60,\n\t\tseconds: roundTowardsZero(milliseconds / 1000) % 60,\n\t\tmilliseconds: roundTowardsZero(milliseconds) % 1000,\n\t\tmicroseconds: roundTowardsZero(milliseconds * 1000) % 1000,\n\t\tnanoseconds: roundTowardsZero(milliseconds * 1e6) % 1000\n\t};\n}\n","import parseMilliseconds from 'parse-ms';\n\nconst pluralize = (word, count) => count === 1 ? word : `${word}s`;\n\nconst SECOND_ROUNDING_EPSILON = 0.000_000_1;\n\nexport default function prettyMilliseconds(milliseconds, options = {}) {\n\tif (!Number.isFinite(milliseconds)) {\n\t\tthrow new TypeError('Expected a finite number');\n\t}\n\n\tif (options.colonNotation) {\n\t\toptions.compact = false;\n\t\toptions.formatSubMilliseconds = false;\n\t\toptions.separateMilliseconds = false;\n\t\toptions.verbose = false;\n\t}\n\n\tif (options.compact) {\n\t\toptions.secondsDecimalDigits = 0;\n\t\toptions.millisecondsDecimalDigits = 0;\n\t}\n\n\tconst result = [];\n\n\tconst floorDecimals = (value, decimalDigits) => {\n\t\tconst flooredInterimValue = Math.floor((value * (10 ** decimalDigits)) + SECOND_ROUNDING_EPSILON);\n\t\tconst flooredValue = Math.round(flooredInterimValue) / (10 ** decimalDigits);\n\t\treturn flooredValue.toFixed(decimalDigits);\n\t};\n\n\tconst add = (value, long, short, valueString) => {\n\t\tif ((result.length === 0 || !options.colonNotation) && value === 0 && !(options.colonNotation && short === 'm')) {\n\t\t\treturn;\n\t\t}\n\n\t\tvalueString = (valueString || value || '0').toString();\n\t\tlet prefix;\n\t\tlet suffix;\n\t\tif (options.colonNotation) {\n\t\t\tprefix = result.length > 0 ? ':' : '';\n\t\t\tsuffix = '';\n\t\t\tconst wholeDigits = valueString.includes('.') ? valueString.split('.')[0].length : valueString.length;\n\t\t\tconst minLength = result.length > 0 ? 2 : 1;\n\t\t\tvalueString = '0'.repeat(Math.max(0, minLength - wholeDigits)) + valueString;\n\t\t} else {\n\t\t\tprefix = '';\n\t\t\tsuffix = options.verbose ? ' ' + pluralize(long, value) : short;\n\t\t}\n\n\t\tresult.push(prefix + valueString + suffix);\n\t};\n\n\tconst parsed = parseMilliseconds(milliseconds);\n\n\tadd(Math.trunc(parsed.days / 365), 'year', 'y');\n\tadd(parsed.days % 365, 'day', 'd');\n\tadd(parsed.hours, 'hour', 'h');\n\tadd(parsed.minutes, 'minute', 'm');\n\n\tif (\n\t\toptions.separateMilliseconds\n\t\t|| options.formatSubMilliseconds\n\t\t|| (!options.colonNotation && milliseconds < 1000)\n\t) {\n\t\tadd(parsed.seconds, 'second', 's');\n\t\tif (options.formatSubMilliseconds) {\n\t\t\tadd(parsed.milliseconds, 'millisecond', 'ms');\n\t\t\tadd(parsed.microseconds, 'microsecond', 'µs');\n\t\t\tadd(parsed.nanoseconds, 'nanosecond', 'ns');\n\t\t} else {\n\t\t\tconst millisecondsAndBelow\n\t\t\t\t= parsed.milliseconds\n\t\t\t\t+ (parsed.microseconds / 1000)\n\t\t\t\t+ (parsed.nanoseconds / 1e6);\n\n\t\t\tconst millisecondsDecimalDigits\n\t\t\t\t= typeof options.millisecondsDecimalDigits === 'number'\n\t\t\t\t\t? options.millisecondsDecimalDigits\n\t\t\t\t\t: 0;\n\n\t\t\tconst roundedMiliseconds = millisecondsAndBelow >= 1\n\t\t\t\t? Math.round(millisecondsAndBelow)\n\t\t\t\t: Math.ceil(millisecondsAndBelow);\n\n\t\t\tconst millisecondsString = millisecondsDecimalDigits\n\t\t\t\t? millisecondsAndBelow.toFixed(millisecondsDecimalDigits)\n\t\t\t\t: roundedMiliseconds;\n\n\t\t\tadd(\n\t\t\t\tNumber.parseFloat(millisecondsString),\n\t\t\t\t'millisecond',\n\t\t\t\t'ms',\n\t\t\t\tmillisecondsString,\n\t\t\t);\n\t\t}\n\t} else {\n\t\tconst seconds = (milliseconds / 1000) % 60;\n\t\tconst secondsDecimalDigits\n\t\t\t= typeof options.secondsDecimalDigits === 'number'\n\t\t\t\t? options.secondsDecimalDigits\n\t\t\t\t: 1;\n\t\tconst secondsFixed = floorDecimals(seconds, secondsDecimalDigits);\n\t\tconst secondsString = options.keepDecimalsOnWholeSeconds\n\t\t\t? secondsFixed\n\t\t\t: secondsFixed.replace(/\\.0+$/, '');\n\t\tadd(Number.parseFloat(secondsString), 'second', 's', secondsString);\n\t}\n\n\tif (result.length === 0) {\n\t\treturn '0' + (options.verbose ? ' milliseconds' : 'ms');\n\t}\n\n\tif (options.compact) {\n\t\treturn result[0];\n\t}\n\n\tif (typeof options.unitCount === 'number') {\n\t\tconst separator = options.colonNotation ? '' : ' ';\n\t\treturn result.slice(0, Math.max(options.unitCount, 1)).join(separator);\n\t}\n\n\treturn options.colonNotation ? result.join('') : result.join(' ');\n}\n","import TooltipText from \"components/ui/tooltip-text\";\r\nimport {Circle, RefreshCcw} from \"lucide-react\";\r\nimport React, {ReactNode} from \"react\";\r\nimport {cn} from \"lib/utils\";\r\n\r\ninterface IndicatorProps {\r\n children: ReactNode\r\n className: string\r\n}\r\n\r\nconst Indicator = ({ className, children }: IndicatorProps) => {\r\n\r\n\r\n return (\r\n {children}>}>\r\n \r\n \r\n )\r\n}\r\n\r\nexport default Indicator","import {Circle, RefreshCcw} from \"lucide-react\";\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\nimport React from \"react\";\r\nimport Indicator from \"components/indicator\";\r\n\r\nconst InProgress = () => {\r\n\r\n return (\r\n \r\n \r\n Optimization in progress\r\n \r\n \r\n )\r\n}\r\n\r\nexport default InProgress","import {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from \"components/ui/tooltip\";\r\nimport {truncateMiddleOfURL} from \"lib/utils\";\r\nimport {ArrowTopRightOnSquareIcon} from \"@heroicons/react/24/outline\";\r\nimport {Circle, CircleDashed, RefreshCcw, RefreshCcwDot} from \"lucide-react\";\r\nimport React, {useEffect, useMemo, useState} from \"react\";\r\nimport {CellContext} from \"@tanstack/react-table\";\r\nimport Code from \"components/ui/code\";\r\nimport {JsonView} from \"react-json-view-lite\";\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\nimport InProgress from \"components/in-progress\";\r\n\r\n\r\ninterface AuditColumnImageProps {\r\n cell: CellContext\r\n}\r\n\r\ninterface FetchDetails {\r\n redirected: boolean;\r\n status: number;\r\n statusText: string;\r\n}\r\n\r\nconst AuditColumnImage = ({ cell } : AuditColumnImageProps) => {\r\n\r\n let [loaded, setLoaded] = useState(false);\r\n const [imageUrl, setImageUrl] = useState(null);\r\n const [imageDetails, setImageDetails] = useState(null);\r\n\r\n\r\n let value = cell.getValue().url ? cell.getValue().url : cell.getValue()\r\n\r\n if (!value) {\r\n return <>>\r\n }\r\n\r\n const shouldFetch = value.includes('images.rapidload-cdn.io');\r\n let snippet : any = '';\r\n\r\n if (cell.table.options.meta?.type === 'image' && cell.table.options.columns.find(c => c.id === 'node')) {\r\n // @ts-ignore\r\n snippet = cell.row.getValue('node') as {\r\n nodeLabel: string\r\n selector: string\r\n snippet: string\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n const fetchImageDetails = async () => {\r\n try {\r\n const response = await fetch(value);\r\n\r\n if (!response.ok) {\r\n throw new Error(\"Failed to fetch image\");\r\n }\r\n\r\n const blob = await response.blob();\r\n const objectUrl = URL.createObjectURL(blob);\r\n\r\n setImageDetails({\r\n redirected: response.redirected,\r\n status: response.status,\r\n statusText: response.statusText\r\n });\r\n setImageUrl(objectUrl);\r\n\r\n setLoaded(true)\r\n } catch (error) {\r\n setImageUrl(value); // Set the original value as a fallback\r\n setLoaded(true)\r\n }\r\n };\r\n\r\n if (value && shouldFetch) {\r\n fetchImageDetails();\r\n }\r\n\r\n // Don't forget to revoke the object URL to free up memory when the component unmounts\r\n return () => {\r\n if (imageUrl) {\r\n URL.revokeObjectURL(imageUrl);\r\n }\r\n };\r\n }, [value]);\r\n\r\n\r\n return (\r\n \r\n\r\n {(\r\n imageDetails?.redirected\r\n && (imageDetails?.status === 302 || imageDetails?.status === 307)\r\n && shouldFetch\r\n ) && (\r\n
\r\n )}\r\n\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
setLoaded(true)}\r\n onLoadCapture={() => setLoaded(true)}\r\n className='max-w-[160px]'\r\n src={imageUrl || value}\r\n />\r\n\r\n {!loaded && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n {snippet && (\r\n
\r\n\r\n
\r\n {(snippet?.nodeLabel !== snippet?.selector) && (\r\n {value?.nodeLabel} \r\n )}\r\n
\r\n
\r\n
\r\n\r\n
\r\n )}\r\n
\r\n\r\n\r\n \r\n \r\n
\r\n );\r\n}\r\n\r\nexport default AuditColumnImage","import React, {useState} from \"react\";\r\nimport {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from \"components/ui/tooltip\";\r\nimport {isImageAudit, isUrl, truncateMiddleOfURL} from \"lib/utils\";\r\nimport {ArrowTopRightOnSquareIcon} from \"@heroicons/react/24/outline\";\r\nimport {CellContext} from \"@tanstack/react-table\";\r\nimport AuditColumnImage from \"app/page-optimizer/components/audit/content/columns/image\";\r\nimport Code from \"components/ui/code\";\r\nimport {CheckCircleIcon} from \"@heroicons/react/24/solid\";\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\n\r\ninterface AuditColumnUrlProps {\r\n audit : Audit,\r\n cell: CellContext\r\n heading: AuditHeadings\r\n\r\n}\r\n\r\nconst AuditColumnUrl = ({audit, cell, heading} : AuditColumnUrlProps) => {\r\n\r\n let value = cell.getValue()\r\n let passed = false\r\n\r\n if (cell.table.options.columns.find(c => c.id === 'passed')) {\r\n passed = cell.row.getValue('passed')\r\n }\r\n \r\n if (!value.toString().startsWith('data:image') && (isImageAudit(audit.id) || value?.file_type?.value === 'image')) {\r\n return ;\r\n } else if (isUrl(value)) {\r\n return (\r\n \r\n {truncateMiddleOfURL(value, 60)} \r\n \r\n \r\n );\r\n } else if (typeof value === 'object' && typeof value?.url === 'string') {\r\n return (\r\n \r\n {passed && (\r\n \r\n {/**/}\r\n {/*
*/}\r\n {/* */}\r\n \r\n \r\n \r\n \r\n )}\r\n \r\n {truncateMiddleOfURL(value.url, 60)} \r\n \r\n );\r\n } else {\r\n return {value} ;\r\n }\r\n}\r\n\r\nexport default AuditColumnUrl","import * as React from \"react\"\r\nimport * as SelectPrimitive from \"@radix-ui/react-select\"\r\nimport { Check, ChevronDown } from \"lucide-react\"\r\n\r\nimport { cn } from \"../../lib/utils\"\r\n\r\nconst Select = SelectPrimitive.Root\r\n\r\nconst SelectGroup = SelectPrimitive.Group\r\n\r\nconst SelectValue = SelectPrimitive.Value\r\n\r\nconst SelectTrigger = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, children, ...props }, ref) => (\r\n \r\n {children}\r\n \r\n \r\n \r\n \r\n))\r\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\r\n\r\nconst SelectContent = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, children, position = \"popper\", ...props }, ref) => (\r\n \r\n \r\n {children}\r\n \r\n \r\n))\r\nSelectContent.displayName = SelectPrimitive.Content.displayName\r\n\r\nconst SelectLabel = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nSelectLabel.displayName = SelectPrimitive.Label.displayName\r\n\r\nconst SelectItem = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, children, ...props }, ref) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n {children} \r\n \r\n))\r\nSelectItem.displayName = SelectPrimitive.Item.displayName\r\n\r\nconst SelectSeparator = React.forwardRef<\r\n React.ElementRef,\r\n React.ComponentPropsWithoutRef\r\n>(({ className, ...props }, ref) => (\r\n \r\n))\r\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\r\n\r\nexport {\r\n Select,\r\n SelectGroup,\r\n SelectValue,\r\n SelectTrigger,\r\n SelectContent,\r\n SelectLabel,\r\n SelectItem,\r\n SelectSeparator,\r\n}\r\n","import {\r\n Select,\r\n SelectContent,\r\n SelectGroup,\r\n SelectItem,\r\n SelectLabel,\r\n SelectTrigger,\r\n SelectValue,\r\n} from \"components/ui/select\";\r\nimport React, {useCallback, useEffect, useMemo, useState} from \"react\";\r\nimport {CellContext} from \"@tanstack/react-table\";\r\nimport {ThunkDispatch} from \"redux-thunk\";\r\nimport {AppAction, RootState} from \"../../../../../../store/app/appTypes\";\r\nimport {useDispatch, useSelector} from \"react-redux\";\r\nimport {updateFileAction} from \"../../../../../../store/app/appActions\";\r\nimport {optimizerData} from \"../../../../../../store/app/appSelector\";\r\nimport {Circle, CircleDot, PencilLine, Undo, Undo2} from \"lucide-react\";\r\nimport TooltipText from \"components/ui/tooltip-text\";\r\n\r\ninterface AuditColumnDropdownProps {\r\n heading: AuditHeadings;\r\n audit: Audit;\r\n cell: CellContext;\r\n}\r\n\r\nconst AuditColumnDropdown = ({ audit, heading, cell }: AuditColumnDropdownProps) => {\r\n const { getValue, row } = cell;\r\n let url = row.getValue(\"url\") as any;\r\n let value = getValue();\r\n\r\n const { data, settings, changes } = useSelector(optimizerData);\r\n let fileChanges = changes ? changes.files.filter(f => f.file === url.url).map(f => f.value) : [];\r\n const file_type = url?.file_type?.value;\r\n\r\n const options = useMemo(() => {\r\n return data?.meta?.controls.dropdown_options.filter((o) => o.type == file_type)[0]?.options;\r\n }, [data, file_type]);\r\n\r\n if (value?.control_type !== 'dropdown' || !value) {\r\n return ;\r\n }\r\n const dispatch: ThunkDispatch = useDispatch();\r\n const [action, setAction] = useState(value.value || \"none\");\r\n\r\n const updateAction = useCallback((v: string) => {\r\n let prev = action;\r\n setAction(v);\r\n dispatch(updateFileAction(audit, url.url ? url.url : url, v, prev));\r\n }, [action, audit, url, dispatch]);\r\n\r\n const transformLabel = (value: string) => {\r\n switch (value) {\r\n case \"none\":\r\n return \"No Action\";\r\n default:\r\n return value;\r\n }\r\n };\r\n\r\n const mutateOptions = useCallback((options: string[] | any, file_type: string) => {\r\n if (['javascript', 'js'].includes(file_type)) {\r\n let defer = settings?.find(setting => setting.name === 'Defer Javascript');\r\n\r\n if (defer?.inputs[0].value) {\r\n if (action === 'defer') {\r\n updateAction('none');\r\n }\r\n return options.filter((option: string) => option !== 'defer');\r\n }\r\n }\r\n return options;\r\n }, [settings, action, updateAction]);\r\n\r\n const renderSelectItems = useMemo(() => {\r\n const mutatedOptions = mutateOptions(options, file_type);\r\n return mutatedOptions?.map((value: string) => (\r\n \r\n {transformLabel(value)}\r\n \r\n ));\r\n }, [options, file_type, action, settings]);\r\n\r\n\r\n\r\n const handleResetAction = useCallback(() => {\r\n if (fileChanges?.length) {\r\n updateAction(fileChanges[0]);\r\n }\r\n }, [fileChanges, updateAction]);\r\n\r\n if (!options) {\r\n return <>>;\r\n }\r\n\r\n return (\r\n \r\n {fileChanges && (fileChanges.length > 0 && fileChanges[0] !== fileChanges[fileChanges.length - 1]) && (\r\n \r\n \r\n This action has been changed\r\n \r\n Reset\r\n \r\n \r\n }>\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Actions \r\n {renderSelectItems}\r\n \r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default AuditColumnDropdown;","import {CellContext} from \"@tanstack/react-table\";\r\nimport Code from \"components/ui/code\";\r\nimport {Tooltip, TooltipContent, TooltipTrigger} from \"components/ui/tooltip\";\r\nimport React from \"react\";\r\nimport {JsonView} from \"react-json-view-lite\";\r\n\r\ninterface AuditNodeColumnProps {\r\n cell: CellContext\r\n heading: AuditHeadings\r\n}\r\n\r\nconst AuditNodeColumn = ({cell, heading}: AuditNodeColumnProps) => {\r\n\r\n let value = cell.getValue();\r\n let subItems = cell.row.original?.subItems?.items[0] || {}\r\n\r\n if (!value) {\r\n return <>>\r\n }\r\n\r\n let snippet = value.snippet\r\n\r\n return (\r\n \r\n
\r\n \r\n
\r\n \r\n \r\n {(value?.nodeLabel !== value?.selector) && (\r\n {value?.nodeLabel} \r\n )}\r\n
\r\n \r\n \r\n\r\n {(heading?.subItemsHeading?.key && heading?.subItemsHeading?.key in subItems) && (\r\n
\r\n {subItems[heading.subItemsHeading.key]}\r\n
\r\n )}\r\n\r\n
\r\n );\r\n}\r\n\r\nexport default AuditNodeColumn","import React from \"react\";\r\nimport {CellContext} from \"@tanstack/react-table\";\r\nimport {truncateMiddleOfURL} from \"lib/utils\";\r\nimport {Circle} from \"lucide-react\";\r\n\r\n\r\ninterface SourceColumnProps {\r\n cell: CellContext\r\n}\r\n\r\nconst SourceColumn = ({cell}: SourceColumnProps) => {\r\n\r\n let value = cell.getValue()\r\n\r\n return (\r\n \r\n
\r\n
{value.url} \r\n
\r\n {value.urlProvider} \r\n \r\n \r\n Code Location : Line {value.line}, Column {value.column} \r\n
\r\n
\r\n
\r\n )\r\n}\r\n\r\nexport default SourceColumn","import React, {useState} from \"react\";\r\nimport prettyBytes from \"pretty-bytes\";\r\nimport prettyMilliseconds from \"pretty-ms\";\r\nimport {CellContext} from \"@tanstack/react-table\";\r\nimport {formatNumberWithGranularity, isDev, truncateMiddleOfURL} from \"lib/utils\";\r\nimport AuditColumnUrl from \"app/page-optimizer/components/audit/content/columns/url\";\r\nimport AuditColumnDropdown from \"app/page-optimizer/components/audit/content/columns/dropdown\";\r\nimport AuditNodeColumn from \"app/page-optimizer/components/audit/content/columns/node\";\r\nimport SourceColumn from \"app/page-optimizer/components/audit/content/columns/source\";\r\n\r\n\r\ninterface AuditColumnProps {\r\n audit: Audit\r\n heading: AuditHeadings,\r\n cell: CellContext,\r\n}\r\n\r\nconst AuditColumns = ({ audit, heading, cell } : AuditColumnProps) => {\r\n let value = cell.getValue()\r\n let subItems = cell.row.original?.subItems?.items[0] || {}\r\n\r\n if (!value && subItems) {\r\n return <>\r\n {(heading?.subItemsHeading?.key && heading?.subItemsHeading?.key in subItems) && (\r\n \r\n {subItems[heading.subItemsHeading.key]}\r\n
\r\n )}\r\n >;\r\n }\r\n\r\n if (!value) {\r\n return <>>;\r\n }\r\n\r\n\r\n\r\n if (heading.valueType === 'url') {\r\n return ;\r\n }\r\n\r\n if (heading.valueType === 'controls') {\r\n return \r\n }\r\n\r\n if (heading.valueType === 'bytes') {\r\n return {prettyBytes(value as number)} \r\n }\r\n\r\n if (['ms', 'timespanMs'].includes(heading.valueType as string)) {\r\n return {prettyMilliseconds(cell.getValue() as number)} \r\n }\r\n\r\n if (heading.valueType === 'node') {\r\n return \r\n }\r\n\r\n if (heading.valueType === 'numeric' && typeof value === 'number') {\r\n return {formatNumberWithGranularity((value as number), heading.granularity)} \r\n }\r\n\r\n if (heading.valueType === 'numeric' && typeof value === 'object') {\r\n return {(value.value as number)} \r\n }\r\n\r\n if (heading.valueType === 'source-location') {\r\n return \r\n }\r\n\r\n if (typeof value === 'object') {\r\n return {JSON.stringify(value)} \r\n }\r\n\r\n if (heading.valueType === 'text') {\r\n return {value} \r\n }\r\n\r\n if (isDev) {\r\n console.log('col', value, heading.valueType, audit.id);\r\n }\r\n \r\n\r\n\r\n return {JSON.stringify(value)} ;\r\n\r\n}\r\n\r\nexport default AuditColumns","import {\r\n ColumnDef,\r\n ColumnHelper,\r\n createColumnHelper,\r\n getCoreRowModel,\r\n getPaginationRowModel,\r\n useReactTable\r\n} from \"@tanstack/react-table\";\r\nimport AuditColumns from \"app/page-optimizer/components/audit/content/columns\";\r\nimport {isImageAudit} from \"lib/utils\";\r\nimport React, { useMemo } from \"react\";\r\n\r\nconst useTable = (\r\n audit: Audit,\r\n headings: AuditHeadings[],\r\n items: AuditResource[],\r\n type: string\r\n) => {\r\n const columnHelper = createColumnHelper();\r\n const tableId = `table_${audit.id}`;\r\n\r\n // @ts-ignore\r\n const columns: ColumnHelper[] = useMemo(() => {\r\n return headings.map((heading) => {\r\n heading.key = heading.key ? heading.key : (heading.label ? heading.label.toLowerCase() : 'no-key')\r\n\r\n return columnHelper.accessor(\r\n (row) => row[heading.key as keyof AuditResource],\r\n {\r\n id: heading.key,\r\n meta: heading,\r\n cell: (info) => ,\r\n header: () => {heading.label} ,\r\n enableHiding: true,\r\n }\r\n );\r\n });\r\n }, [headings, audit, columnHelper]);\r\n\r\n const hiddenColumns = useMemo(() => {\r\n let hiddenColumns: { [id: string]: boolean } = {\r\n pattern: false,\r\n file_type: false,\r\n passed: false\r\n };\r\n\r\n if (isImageAudit(audit.id)) {\r\n hiddenColumns.node = false;\r\n }\r\n\r\n const blankKeys = items.flatMap(obj =>\r\n Object.entries(obj)\r\n .filter(([key, value]) => value === '' || (typeof value === 'object' && Object.keys(value).length === 0))\r\n .map(([key]) => key)\r\n ); \r\n\r\n let firstRow = Object.keys(items[0]);\r\n\r\n if (!firstRow.includes('subItems')) {\r\n\r\n columns.filter(c => !firstRow.includes(c.id ? c.id : '')).forEach(c => {\r\n if (c.id) hiddenColumns[c.id] = false;\r\n });\r\n\r\n blankKeys.forEach(key => hiddenColumns[key] = false)\r\n \r\n }\r\n\r\n return hiddenColumns;\r\n }, [audit.id, columns, items]);\r\n\r\n const table = useReactTable({\r\n data: items,\r\n columns: columns ,\r\n getCoreRowModel: getCoreRowModel(),\r\n getPaginationRowModel: getPaginationRowModel(),\r\n meta: {\r\n tableId,\r\n type\r\n },\r\n initialState: {\r\n pagination: {\r\n pageSize: 5\r\n },\r\n columnVisibility: hiddenColumns\r\n },\r\n autoResetPageIndex: false,\r\n });\r\n\r\n return [table];\r\n};\r\n\r\nexport default useTable;\r\n","import useTable from \"hooks/useTable\";\r\nimport {flexRender} from \"@tanstack/react-table\";\r\nimport {cn} from \"lib/utils\";\r\nimport {ChevronLeft, ChevronRight} from \"lucide-react\";\r\nimport React from \"react\";\r\nimport {JsonView} from \"react-json-view-lite\";\r\n\r\ninterface FileGroupProps {\r\n audit: Audit\r\n group: any\r\n index: number\r\n}\r\n\r\nconst FileTable = ({audit, group, index }: FileGroupProps) => {\r\n\r\n if (!group?.items?.length) {\r\n return <>>\r\n }\r\n\r\n const cellWidth = (valueType: string) => {\r\n switch (valueType) {\r\n case \"timespanMs\":\r\n case \"ms\":\r\n return \"160px\";\r\n case \"bytes\":\r\n return \"140px\";\r\n case \"controls\":\r\n return \"200px\";\r\n default:\r\n return \"auto\";\r\n }\r\n };\r\n\r\n const [table] = useTable(\r\n audit,\r\n (group.headings ? group.headings : audit?.files?.headings) || [],\r\n group.items,\r\n group.type\r\n )\r\n\r\n return (\r\n \r\n
\r\n
\r\n \r\n {table?.getHeaderGroups().map((headerGroup) => (\r\n \r\n {headerGroup.headers\r\n .map((header) => (\r\n \r\n {header.isPlaceholder\r\n ? null\r\n : flexRender(header.column.columnDef.header, header.getContext())}\r\n \r\n ))}\r\n \r\n ))}\r\n \r\n \r\n {table?.getRowModel().rows.map((row) => (\r\n \r\n {row.getVisibleCells().map((cell) => (\r\n \r\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\r\n {/*{cell.column.columnDef.meta?.valueType}*/}\r\n \r\n ))}\r\n \r\n ))}\r\n \r\n
\r\n
\r\n {table.getPageCount() > 1 && (\r\n
\r\n
\r\n {\r\n table.previousPage()\r\n }}\r\n className={cn(\r\n \"disabled:opacity-30 hover:bg-brand-100 px-3 py-1 cursor-pointer rounded text-xs\",\r\n !table.getCanPreviousPage() && 'opacity-30 cursor-no-drop'\r\n )}>\r\n \r\n \r\n {[...Array(table.getPageCount())].map((i, index) => (\r\n {\r\n table.setPageIndex(e => index);\r\n }}\r\n key={index}\r\n >\r\n {index + 1}\r\n \r\n ))}\r\n {\r\n if(table.getCanNextPage()) {\r\n table.nextPage()\r\n }\r\n }}\r\n className={cn(\r\n \"disabled:opacity-30 hover:bg-brand-100 px-3 py-1 cursor-pointer rounded text-xs\",\r\n !table.getCanNextPage() && 'opacity-30 cursor-no-drop'\r\n )}>\r\n \r\n \r\n \r\n
\r\n )}\r\n\r\n
\r\n );\r\n}\r\n\r\nexport default React.memo(FileTable)","import {cn} from \"lib/utils\";\r\nimport React, {useEffect, useState} from \"react\";\r\nimport FilesTableHeader from \"app/page-optimizer/components/audit/content/header\";\r\nimport Accordion from \"components/accordion\";\r\nimport FileTable from \"app/page-optimizer/components/audit/content/table\";\r\nimport {JsonView} from \"react-json-view-lite\";\r\n\r\n\r\ninterface FilesTableProps {\r\n audit: Audit\r\n group: any\r\n index: number\r\n type?: 'list' | 'table'\r\n}\r\n\r\nconst FilesGroup = ({ audit, index, group, type = 'table' }: FilesTableProps) => {\r\n\r\n const [open, setOpen] = useState((type === 'table' && index === 0) || (type === 'list') )\r\n\r\n\r\n return (\r\n \r\n {type == 'table' && (\r\n
\r\n \r\n
\r\n )}\r\n\r\n
\r\n \r\n {/**/}\r\n \r\n\r\n\r\n
\r\n )\r\n}\r\n\r\nexport default FilesGroup","import React from 'react';\r\nimport {truncateMiddleOfURL} from \"lib/utils\";\r\nimport prettyBytes from \"pretty-bytes\";\r\nimport prettyMilliseconds from \"pretty-ms\";\r\n\r\n// Props type for the TreeNode component\r\ntype TreeNodeProps = {\r\n node: CriticalChainTreeNodeType;\r\n isLastChild?: boolean;\r\n isRoot?: boolean;\r\n};\r\n\r\n// Props type for the Treeview component\r\ntype TreeviewProps = {\r\n data: CriticalChainTreeNodeType;\r\n};\r\n\r\nconst TreeNode = ({ node, isLastChild = false, isRoot = false }: TreeNodeProps) => {\r\n return (\r\n \r\n {!isRoot && (\r\n <>\r\n
\r\n
\r\n >\r\n )}\r\n\r\n {(node.children && !isRoot) && (\r\n
\r\n )}\r\n\r\n {!isLastChild && !isRoot && (\r\n
\r\n )}\r\n\r\n
\r\n\r\n {node.children &&\r\n
\r\n {Object.entries(node.children).map(([key, childNode], index, arr) => (\r\n \r\n ))}\r\n
\r\n }\r\n
\r\n );\r\n}\r\n\r\nconst Treeview = ({ data }: TreeviewProps) => {\r\n return (\r\n \r\n \r\n
\r\n );\r\n}\r\n\r\nexport default Treeview;\r\n","import {ReactNode} from \"react\";\r\n\r\nexport const auditPoints : {\r\n [id: string]: ReactNode[]\r\n} = {\r\n \"server-response-time\" : [\r\n <>Time spent should be less than 600ms .>,\r\n ],\r\n \"dom-size\" : [\r\n <>Keep the number of DOM elements in the body section under 800 .>,\r\n ]\r\n}\r\n\r\n","import {XIcon} from \"lucide-react\";\r\nimport React, {Dispatch, SetStateAction, useState} from \"react\";\r\n\r\ninterface SupportCardProps {\r\n audit: Audit\r\n setHelpOpen: Dispatch>\r\n}\r\n\r\nconst SupportCard = ({audit, setHelpOpen}: SupportCardProps) => {\r\n\r\n return <>\r\n \r\n
\r\n
Why this audit is still not being resolved? \r\n setHelpOpen(false)}> \r\n \r\n\r\n
\r\n This could be due to one or more of the following reasons\r\n\r\n
\r\n You have server-side caching on your website. Clear the server-side cache. \r\n \r\n
\r\n
\r\n >\r\n}\r\n\r\nexport default SupportCard","import React, {Dispatch, SetStateAction, useEffect, useMemo} from \"react\";\r\nimport Description from \"app/page-optimizer/components/audit/Description\";\r\nimport Settings from \"app/page-optimizer/components/audit/Settings\";\r\nimport {JsonView} from \"react-json-view-lite\";\r\n\r\ninterface AuditContentProps {\r\n audit: Audit;\r\n helpOpen: boolean\r\n setHelpOpen: Dispatch>\r\n}\r\n\r\nimport version from 'semver-compare';\r\n\r\nimport { Alert, AlertDescription, AlertTitle } from \"@/components/ui/alert\"\r\nimport {\r\n RowData\r\n} from \"@tanstack/react-table\";\r\nimport {isDev, transformFileType} from \"lib/utils\";\r\nimport FileGroup from \"app/page-optimizer/components/audit/content/FileGroup\";\r\nimport Treeview from \"components/tree-view\";\r\nimport {ArrowRight, ArrowRightFromLine, ArrowRightToLine, Circle, Info, Terminal, XIcon} from \"lucide-react\";\r\nimport {auditPoints} from \"app/page-optimizer/components/audit/KeyPoints\";\r\nimport {XCircleIcon} from \"@heroicons/react/24/solid\";\r\nimport SupportCard from \"app/page-optimizer/components/audit/SupportCard\";\r\nimport {useAppContext} from \"../../../../../context/app\";\r\nimport ApiService from \"../../../../../services/api\";\r\nimport {Button} from \"components/ui/button\";\r\n\r\n\r\ndeclare module '@tanstack/react-table' {\r\n interface TableMeta {\r\n tableId: string\r\n type: string\r\n }\r\n}\r\n\r\n\r\n\r\nconst AuditContent = ({audit, helpOpen, setHelpOpen}: AuditContentProps) => {\r\n\r\n const {options} = useAppContext()\r\n\r\n if (isDev && audit.files?.type && ![\"table\", \"opportunity\", \"list\", \"criticalrequestchain\"].includes(audit.files.type)) {\r\n return false}/>;\r\n }\r\n\r\n let remainingSettings = useMemo(() => (\r\n audit\r\n .settings\r\n // @ts-ignore\r\n .filter(s => ! audit.files?.grouped_items?.map(group => transformFileType(audit, group.type))\r\n .includes(s.category) )),\r\n [])\r\n\r\n let points = useMemo(() => {\r\n return auditPoints[audit.id] || []\r\n }, [])\r\n\r\n async function ping() {\r\n let api = new ApiService(options).rest()\r\n\r\n let data = await api.request('/ping', {\r\n 'url' : 'https://rapidload.local/',\r\n // 'nonce': window.rapidload_optimizer?.nonce || ''\r\n })\r\n }\r\n\r\n return (\r\n \r\n {helpOpen &&\r\n
\r\n }\r\n \r\n