diff --git a/src/admin/build/index.asset.php b/src/admin/build/index.asset.php index 1cbcddc5..03ef5690 100644 --- a/src/admin/build/index.asset.php +++ b/src/admin/build/index.asset.php @@ -1 +1 @@ - array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element'), 'version' => '5580cf5e497048ad6da1'); + array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-components', 'wp-element'), 'version' => 'b2996cbb70403a634fea'); diff --git a/src/admin/build/index.js b/src/admin/build/index.js index 229152a3..444435ce 100644 --- a/src/admin/build/index.js +++ b/src/admin/build/index.js @@ -1 +1 @@ -(()=>{"use strict";var e={609(e){e.exports=window.React}};const t={};function n(i){const a=t[i];if(void 0!==a)return a.exports;const r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}n.m=e,n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;iPromise.all(Object.keys(n.f).reduce((t,i)=>(n.f[i](e,t),t),[])),n.u=e=>(({42:"reactPlayerTwitch",85:"reactPlayerTiktok",173:"reactPlayerVimeo",262:"reactPlayerHls",340:"reactPlayerWistia",353:"reactPlayerPreview",395:"reactPlayerDash",446:"reactPlayerYouTube",723:"reactPlayerMux",771:"reactPlayerSpotify"}[e]||e)+".js?ver="+{42:"710c587562705dc3edd6",85:"227f06b07c7896379b77",173:"7d9bbd44745edc1a5193",262:"718fb6a76ccbaa6efdf8",303:"a1ff3fceba330af721da",340:"04d39123ad122f8f341a",353:"a9bc7e4ae05b4f773de6",395:"1ef572a58903e0b5a82d",446:"1e02662c73bc7bb442b9",723:"1c0a47c111c88f4bb0ab",771:"63f098237b966138094f",945:"b8e062ddfc36f6bb19cb",985:"d30d768acc6f77987861"}[e]),n.miniCssF=e=>{},n.o=(e,t)=>Object.hasOwn(e,t),(()=>{const e={},t="simplystatic-settings:";n.l=(i,a,r,s)=>{if(e[i])return void e[i].push(a);let o,l;if(void 0!==r){const e=document.getElementsByTagName("script");for(var c=0;c{o.onerror=o.onload=null,clearTimeout(p);const a=e[i];if(delete e[i],o.parentNode?.removeChild(o),a?.forEach(e=>e(n)),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=d.bind(null,o.onerror),o.onload=d.bind(null,o.onload),l&&document.head.appendChild(o)}})(),n.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;globalThis.importScripts&&(e=globalThis.location+"");const t=globalThis.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const n=t.getElementsByTagName("script");if(n.length){let t=n.length-1;for(;t>-1&&(!e||!/^http(s?):/.test(e));)e=n[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{const e={57:0};n.f.j=(t,i)=>{let a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)i.push(a[2]);else{const r=new Promise((n,i)=>a=e[t]=[n,i]);i.push(a[2]=r);const s=n.p+n.u(t),o=new Error,l=i=>{if(n.o(e,t)&&(a=e[t],0!==a&&(e[t]=void 0),a)){const e=i&&("load"===i.type?"missing":i.type),n=i&&i.target&&i.target.src;o.message="Loading chunk "+t+" failed.\n("+e+": "+n+")",o.name="ChunkLoadError",o.type=e,o.request=n,a[1](o)}};n.l(s,l,"chunk-"+t,t)}};const t=(t,i)=>{let[a,r,s]=i;var o,l,c=0;if(a.some(t=>0!==e[t])){for(o in r)n.o(r,o)&&(n.m[o]=r[o]);s&&s(n)}for(t&&t(i);c{n.current=e},[e]),(0,i.useEffect)(()=>{if(null!==t){const e=setInterval(function(){n.current()},t);return()=>clearInterval(e)}},[t])}const o=window.ReactJSXRuntime,{__}=wp.i18n,l=(0,i.createContext)(),c=e=>{let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){throw new Error(__("The server returned an invalid response.","simply-static"))}if(t&&"object"==typeof t){const e=Number.parseInt(t.status,10);if(Number.isFinite(e)&&e>=400)throw new Error(t.message||__("The requested action could not be completed.","simply-static"))}return t},d=function(e){const t=(e={})=>({running:!!e.running,status:e.status||{},progress:e.progress||{},message:e.message||__("Rollback in progress. Simply Static export actions are locked until the rollback has finished.","simply-static")}),[n,a]=(0,i.useState)(!1),[d,p]=(0,i.useState)(0),[u,m]=(0,i.useState)(!1),[h,g]=(0,i.useState)(!1),[x,f]=(0,i.useState)(()=>t(options.snapshot_rollback)),[y,b]=(0,i.useState)(!1),[_,v]=(0,i.useState)({}),w=(0,i.useRef)(_),[S,C]=(0,i.useState)({}),[j,k]=(0,i.useState)("yes"),[R,E]=(0,i.useState)(1),[N,P]=(0,i.useState)([]),[B,D]=(0,i.useState)(!1),T=!!x.running,F=()=>r()({path:"/simplystatic/v1/settings"}).then(e=>(w.current=e,v(e),e)),I=()=>{r()({path:"/simplystatic/v1/is-running",method:"GET"}).then(e=>{var n="string"==typeof e?JSON.parse(e):e;a(n.running),m(n.paused),n.snapshot_rollback&&f(t(n.snapshot_rollback)),n.delayed&&p(n.delayed_until)})};function M(e){try{const t=options&&options.integrations;if(!t)return null;if(Array.isArray(t)){for(let n=0;n{const t=M(e);return!(!t||!t.requires_ui_reload)},A=e=>N.indexOf(e)>=0,L=e=>{let t=_.integrations;return!(!1===t||!t||!Array.isArray(t))&&t.indexOf(e)>=0};return s(()=>{p(d-1)},d>0?1e3:null),s(()=>{I()},n||d||T?5e3:null),(0,i.useEffect)(()=>{options.current_settings?(w.current=options.current_settings,v(options.current_settings)):F(),options.can_view_diagnostics&&r()({path:"/simplystatic/v1/system-status"}).then(e=>{C(e),r()({path:"/simplystatic/v1/system-status/passed"}).then(e=>{let t=JSON.parse(e);k(t.passed)})}),I(),E(options.blog_id)},[]),(0,o.jsx)(l.Provider,{value:{settings:_,configs:S,passedChecks:j,settingsSaved:y,setSettingsSaved:b,updateSetting:(e,t)=>{v(n=>{const i={...n,[e]:t};return w.current=i,i})},setSettings:v,saveSettings:()=>{const e=N&&N.length>0;return r()({path:"/simplystatic/v1/settings",method:"POST",data:w.current}).then(t=>(P([]),{resp:t,shouldReload:e}))},resetSettings:()=>r()({path:"/simplystatic/v1/settings/reset",method:"POST"}).then(e=>{const t=c(e);return 200===t.status&&t.data&&(w.current=t.data,v(t.data)),t}),resetDatabase:()=>r()({path:"/simplystatic/v1/settings/reset-database",method:"POST"}).then(c),resetBackgroundQueue:()=>r()({path:"/simplystatic/v1/settings/reset-background-queue",method:"POST"}).then(c),getSettings:F,updateFromNetwork:e=>r()({path:"/simplystatic/v1/update-from-network",method:"POST",data:{blog_id:e}}).then(c).then(F),importSettings:e=>r()({path:"/simplystatic/v1/settings",method:"POST",data:{...e,__simply_static_import:!0}}).then(c).then(F),migrateSettings:()=>r()({path:"/simplystatic/v1/migrate",method:"POST",data:{migrate:!0}}).then(c).then(F),resetDiagnostics:()=>{r()({path:"/simplystatic/v1/reset-diagnostics",method:"POST"})},isRunning:n,setIsRunning:a,isPaused:u,setIsPaused:m,setIsResumed:g,isResumed:h,snapshotRollback:x,setSnapshotRollback:f,isRollbackRunning:T,blogId:R,setBlogId:E,isPro:()=>!!options.is_multisite||!!options.connect&&!!options.connect.is_connected,isStudio:()=>!!/(static\d*|onstatic)\.studio/.test(options.home)||!!options.version_studio,isIntegrationActive:L,canRunIntegration:e=>!!L(e)&&!A(e),maybeQueueIntegration:e=>{H(e)&&(A(e)||P(t=>t&&t.indexOf(e)>=0?t:[...t||[],e]))},maybeUnqueueIntegration:e=>{H(e)&&A(e)&&P(t=>(t||[]).filter(t=>t!==e))},isQueuedIntegration:A,getIntegrationById:M,showMobileNav:B,setShowMobileNav:D,isDelayed:d},children:e.children})},p=window.wp.components;var u=n(609),m=n.n(u);const h=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,g=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,x=/\.(m3u8)($|\?)/i,f=/\.(mpd)($|\?)/i,y=/stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/,b=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,_=/vimeo\.com\/(?!progressive_redirect).+/,v=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,w=/open\.spotify\.com\/(\w+)\/(\w+)/i,S=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/,C=/tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/,j=(e,t)=>{if(Array.isArray(e)){for(const n of e){if("string"==typeof n&&j(n,t))return!0;if(j(n.src,t))return!0}return!1}return t(e)},k={html:e=>j(e,e=>h.test(e)||g.test(e)),hls:e=>j(e,e=>x.test(e)),dash:e=>j(e,e=>f.test(e)),mux:e=>y.test(e),youtube:e=>b.test(e),vimeo:e=>_.test(e)&&!g.test(e)&&!x.test(e),wistia:e=>v.test(e),spotify:e=>w.test(e),twitch:e=>S.test(e),tiktok:e=>C.test(e)};var R=u.forwardRef((e,t)=>{const n=h.test(`${e.src}`)?"audio":"video";return u.createElement(n,{...e,ref:t},e.children)}),E=[{key:"hls",name:"hls.js",canPlay:k.hls,canEnablePIP:()=>!0,player:(0,u.lazy)(()=>Promise.all([n.e(985),n.e(945),n.e(262)]).then(n.bind(n,805)))},{key:"dash",name:"dash.js",canPlay:k.dash,canEnablePIP:()=>!0,player:(0,u.lazy)(()=>Promise.all([n.e(985),n.e(395)]).then(n.bind(n,517)))},{key:"mux",name:"Mux",canPlay:k.mux,canEnablePIP:()=>!0,player:(0,u.lazy)(()=>Promise.all([n.e(985),n.e(945),n.e(723)]).then(n.bind(n,813)))},{key:"youtube",name:"YouTube",canPlay:k.youtube,player:(0,u.lazy)(()=>n.e(446).then(n.bind(n,808)))},{key:"vimeo",name:"Vimeo",canPlay:k.vimeo,player:(0,u.lazy)(()=>n.e(173).then(n.bind(n,183)))},{key:"wistia",name:"Wistia",canPlay:k.wistia,canEnablePIP:()=>!0,player:(0,u.lazy)(()=>n.e(340).then(n.bind(n,868)))},{key:"spotify",name:"Spotify",canPlay:k.spotify,canEnablePIP:()=>!1,player:(0,u.lazy)(()=>n.e(771).then(n.bind(n,653)))},{key:"twitch",name:"Twitch",canPlay:k.twitch,canEnablePIP:()=>!1,player:(0,u.lazy)(()=>n.e(42).then(n.bind(n,682)))},{key:"tiktok",name:"TikTok",canPlay:k.tiktok,canEnablePIP:()=>!1,player:(0,u.lazy)(()=>n.e(85).then(n.bind(n,188)))},{key:"html",name:"html",canPlay:k.html,canEnablePIP:()=>!0,player:R}];const N={width:"320px",height:"180px",volume:1,playbackRate:1,previewTabIndex:0,previewAriaLabel:"",oEmbedUrl:"https://noembed.com/embed?url={url}"},P=u.forwardRef((e,t)=>{const{playing:n,pip:i}=e,a=e.activePlayer,r=(0,u.useRef)(null),s=(0,u.useRef)(!0);if((0,u.useEffect)(()=>{var t,i;r.current&&(r.current.paused&&!0===n&&r.current.play(),r.current.paused||!1!==n||r.current.pause(),r.current.playbackRate=null!=(t=e.playbackRate)?t:1,r.current.volume=null!=(i=e.volume)?i:1)}),(0,u.useEffect)(()=>{var e,t,n,a,s;if(r.current&&globalThis.document){if(i&&!document.pictureInPictureElement)try{null==(t=(e=r.current).requestPictureInPicture)||t.call(e)}catch(e){}if(!i&&document.pictureInPictureElement)try{null==(a=(n=r.current).exitPictureInPicture)||a.call(n),null==(s=document.exitPictureInPicture)||s.call(document)}catch(e){}}},[i]),!a)return null;const o={},l=["onReady","onStart"];for(const t in e)t.startsWith("on")&&!l.includes(t)&&(o[t]=e[t]);return u.createElement(a,{...o,style:e.style,className:e.className,slot:e.slot,ref:(0,u.useCallback)(e=>{r.current=e,"function"==typeof t?t(e):null!==t&&(t.current=e)},[t]),src:e.src,crossOrigin:e.crossOrigin,preload:e.preload,controls:e.controls,muted:e.muted,autoPlay:e.autoPlay,loop:e.loop,playsInline:e.playsInline,disableRemotePlayback:e.disableRemotePlayback,config:e.config,onLoadStart:t=>{var n,i;s.current=!0,null==(n=e.onReady)||n.call(e),null==(i=e.onLoadStart)||i.call(e,t)},onPlay:t=>{var n,i;s.current&&(s.current=!1,null==(n=e.onStart)||n.call(e,t)),null==(i=e.onPlay)||i.call(e,t)}},e.children)});P.displayName="Player";var B=P;const D=(0,u.lazy)(()=>n.e(353).then(n.bind(n,924))),T=[],F=({children:e})=>e;var I=((e,t)=>{const n=u.forwardRef((n,i)=>{const a={...N,...n},{src:r,slot:s,className:o,style:l,width:c,height:d,fallback:p,wrapper:m}=a,[h,g]=(0,u.useState)(!!a.light);(0,u.useEffect)(()=>{a.light?g(!0):g(!1)},[a.light]);const x=e=>{var t;g(!1),null==(t=a.onClickPreview)||t.call(a,e)},f=m??F,y=!1===p?F:u.Suspense;return u.createElement(f,{slot:s,className:o,style:{width:c,height:d,...l}},u.createElement(y,{fallback:p},h?(e=>{if(!e)return null;const{light:t,playIcon:n,previewTabIndex:i,oEmbedUrl:r,previewAriaLabel:s}=a;return u.createElement(D,{src:e,light:t,playIcon:n,previewTabIndex:i,previewAriaLabel:s,oEmbedUrl:r,onClickPreview:x})})(r):(n=>{var r,l;const c=(n=>{for(const t of[...T,...e])if(n&&t.canPlay(n))return t;return t||null})(n);if(!c)return null;const{style:d,width:p,height:m,wrapper:h}=a,g=null==(r=a.config)?void 0:r[c.key];return u.createElement(B,{...a,ref:i,activePlayer:null!=(l=c.player)?l:c,slot:h?void 0:s,className:h?void 0:o,style:h?{display:"block",width:"100%",height:"100%"}:{display:"block",width:p,height:m,...d},config:g})})(r)))});return n.displayName="ReactPlayer",n.addCustomPlayer=e=>{T.push(e)},n.removeCustomPlayers=()=>{T.length=0},n.canPlay=t=>{if(t)for(const n of[...T,...e])if(n.canPlay(t))return!0;return!1},n.canEnablePIP=t=>{var n;if(t)for(const i of[...T,...e])if(i.canPlay(t)&&(null==(n=i.canEnablePIP)?void 0:n.call(i)))return!0;return!1},n})(E,E[E.length-1]);const{__:M}=wp.i18n,H=function({title:e,videoUrl:t}){const[n,a]=(0,i.useState)(!1);return(0,o.jsxs)(o.Fragment,{children:[n&&(0,o.jsx)("div",{className:"simply-static-video-modal-background",children:(0,o.jsx)(p.Modal,{title:e,className:"simply-static-video-modal",onRequestClose:()=>a(!1),children:(0,o.jsx)(I,{src:t,controls:!0,width:"920px",height:"560px",playsInline:!0})})}),(0,o.jsx)(p.Button,{variant:"link",className:"simply-static-video-button",onClick:()=>a(!0),children:(0,o.jsx)(p.Dashicon,{icon:"format-video"})})]})},{__:A}=wp.i18n,L=function({heading:e,children:t,cta:n=A("Explore Pro →","simply-static"),ctaUrl:i="https://simplystatic.com/simply-static-pro/?utm_source=plugin&utm_medium=settings&utm_campaign=studio-notice"}){return(0,o.jsxs)(p.Notice,{status:"warning",isDismissible:!1,className:"studio-settings-notice",children:[(0,o.jsx)("h3",{children:e}),(0,o.jsx)("div",{className:"studio-settings-notice__body",children:t}),n&&i&&(0,o.jsx)(p.Button,{variant:"secondary",href:i,target:"_blank",rel:"noopener noreferrer",className:"studio-settings-notice__cta",children:n})]})},{__:z}=wp.i18n,O=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isPro:c,isRunning:d,setIsRunning:u,isStudio:m}=(0,i.useContext)(l),[h,g]=(0,i.useState)("relative"),[x,f]=(0,i.useState)(!1),[y,b]=(0,i.useState)("https://"),[_,v]=(0,i.useState)(""),[w,S]=(0,i.useState)("/"),[C,j]=(0,i.useState)(!1),[k,R]=(0,i.useState)(!1),[E,N]=(0,i.useState)(!1),[P,B]=(0,i.useState)(!1),[D,T]=(0,i.useState)(!1),[F,I]=(0,i.useState)(!1),[M,A]=(0,i.useState)([]),[O,W]=(0,i.useState)([]),[U,G]=(0,i.useState)(null),[$,q]=(0,i.useState)([]),[K,V]=(0,i.useState)([]),[J,Y]=(0,i.useState)(null),[X,Q]=(0,i.useState)([]),[Z,ee]=(0,i.useState)([]),[te,ne]=(0,i.useState)(null),[ie,ae]=(0,i.useState)([]),[re,se]=(0,i.useState)([]),[oe,le]=(0,i.useState)(null),[ce,de]=(0,i.useState)([]);return(0,i.useEffect)(()=>{G(null),r()({path:"/simplystatic/v1/crawlers",parse:!0}).then(n=>{if("string"==typeof n)try{n=JSON.parse(n)}catch(e){return void G("Error parsing API response: "+e.message)}if(n&&n.data&&n.data.length>0){const i=n.data.filter(e=>e.can_run);if(A(i),e.crawlers&&Array.isArray(e.crawlers)&&0!==e.crawlers.length){if(Array.isArray(e.crawlers)){const n=e.crawlers.filter(e=>i.some(t=>t.id===e));if(0===n.length){const e=i.map(e=>e.id);W(e),t("crawlers",e)}else W(n)}}else{const e=i.filter(e=>e.active).map(e=>e.id);W(e),t("crawlers",e)}}else G("Invalid API response structure or empty crawlers array")}).catch(e=>{G("Error fetching crawlers: "+(e.message||"Unknown error"))}),Y(null),r()({path:"/simplystatic/v1/post-types",parse:!0}).then(e=>{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return void Y("Error parsing API response: "+e.message)}e&&e.data&&e.data.length>0?q(e.data):Y("Invalid API response structure or empty post types array")}).catch(e=>{Y("Error fetching post types: "+(e.message||"Unknown error"))}),ne(null),r()({path:"/simplystatic/v1/active-plugins",parse:!0}).then(n=>{"string"==typeof n&&(n=JSON.parse(n));const i=Array.isArray(n?.data)?n.data:[];Q(i);const a=Array.isArray(e.plugins_to_include)?e.plugins_to_include:[],r=i.map(e=>e.slug),s=a.filter(e=>r.includes(e));let o=s.length>0?s:r;i.filter(e=>e.required).map(e=>e.slug).forEach(e=>{o.includes(e)||(o=[...o,e])}),ee(o),t("plugins_to_include",o)}).catch(e=>ne(e?.message||"Unknown error")),le(null),r()({path:"/simplystatic/v1/active-themes",parse:!0}).then(n=>{"string"==typeof n&&(n=JSON.parse(n));const i=Array.isArray(n?.data)?n.data:[];ae(i);const a=Array.isArray(e.themes_to_include)?e.themes_to_include:[],r=i.map(e=>e.slug),s=a.filter(e=>r.includes(e)),o=s.length>0?s:r;se(o),t("themes_to_include",o)}).catch(e=>le(e?.message||"Unknown error")),r()({path:"/simplystatic/v1/pages"}).then(e=>{let t=e||[];t.unshift({label:z("No page selected","simply-static"),value:0}),de(t)}).catch(()=>{de([])})},[]),(0,i.useEffect)(()=>{e.destination_url_type&&g(e.destination_url_type),e.destination_scheme&&b(e.destination_scheme),e.destination_host&&v(e.destination_host),e.relative_path&&S(e.relative_path),(e.use_forms||e.use_comments)&&f(!0),e.force_replace_url&&j(e.force_replace_url),e.generate_404&&N(e.generate_404),e.add_feeds&&T(e.add_feeds),e.add_rest_api&&I(e.add_rest_api),e.smart_crawl&&B(e.smart_crawl),e.crawlers&&W(e.crawlers)},[e]),(0,i.useEffect)(()=>{if(!$.length||!Object.keys(e).length)return;const n=$.map(e=>e.name),i=Array.isArray(e.post_types)?e.post_types:null,a=(i||[]).filter(e=>$.some(t=>t.name===e)),r=!!e.post_types_configured,s=!i||!r&&!i.length;V(s?n:a),i&&i.length!==a.length&&(t("post_types",a),t("post_types_configured",!0))},[$,e.post_types,e.post_types_configured]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[z("Replacing URLs","simply-static"),(0,o.jsx)(H,{title:z("How to replace URLs","simply-static"),videoUrl:"https://youtu.be/cb8jAMJlfGI"})]})}),(0,o.jsxs)(p.CardBody,{children:[m()&&(0,o.jsx)(L,{heading:z("URL replacement is handled by Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:z("Studio manages the public URL for this environment automatically, so you do not need to configure replacement URLs manually.","simply-static")})}),(0,o.jsx)("p",{children:z("When exporting your static site, any links to your WordPress site will be replaced by one of the following: absolute URLs, relative URLs, or URLs contructed for offline use.","simply-static")}),(0,o.jsx)(p.SelectControl,{label:z("Replacing URLs","simply-static"),value:h,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:m(),options:[{label:z("Absolute URLs","simply-static"),value:"absolute"},{label:z("Relative Path","simply-static"),value:"relative"},{label:z("Offline Usage","simply-static"),value:"offline"}],onChange:e=>{g(e),t("destination_url_type",e)}}),"absolute"===h&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{style:{minWidth:"15%",marginTop:"15px"},children:(0,o.jsx)(p.SelectControl,{label:z("Scheme","simply-static"),value:y,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:m(),options:[{label:"https://",value:"https://"},{label:"http://",value:"http://"},{label:"//",value:"//"}],onChange:e=>{b(e),t("destination_scheme",e)}})}),(0,o.jsx)(p.FlexItem,{style:{minWidth:"85%"},children:(0,o.jsx)(p.TextControl,{label:z("Host","simply-static"),type:"text",placeholder:"example.com",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:m(),value:_,onChange:e=>{v(e),t("destination_host",e)}})})]}),(0,o.jsx)("p",{children:z("Convert all URLs for your WordPress site to absolute URLs at the domain specified above.","simply-static")})]}),"relative"===h&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextControl,{label:z("Path","simply-static"),type:"text",placeholder:"/",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:m(),value:w,onChange:e=>{S(e),t("relative_path",e)}}),(0,o.jsxs)("p",{children:[z("Convert all URLs for your WordPress site to relative URLs that will work at any domain.","simply-static"),(0,o.jsx)("br",{}),z("Optionally specify a path above if you intend to place the files in a subdirectory.","simply-static")]}),(0,o.jsxs)(p.Notice,{status:"warning",isDismissible:!1,children:[(0,o.jsxs)("b",{children:[z("Example","simply-static"),": "]}),z("enter /path above if you wanted to serve your files at www.example.com/path/","simply-static")]})]}),"offline"===h&&(0,o.jsx)("p",{children:z("Convert all URLs for your WordPress site so that you can browse the site locally on your own computer without hosting it on a web server.","simply-static")}),!x&&(0,o.jsx)(p.ToggleControl,{label:z("Force URL replacements","simply-static"),__nextHasNoMarginBottom:!0,disabled:m(),help:z(C?"Replace all occurrences of the WordPress URL with the static URL (includes inline CSS and JS).":"Replace only occurrences of the WordPress URL that match our tag list.","simply-static"),checked:C,onChange:e=>{j(e),t("force_replace_url",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[z("Enhanced Crawl","simply-static"),(0,o.jsx)(H,{title:z("How Enhanced Crawl improves your static exports","simply-static"),videoUrl:"https://youtu.be/QfKxeQ1w7tU"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:z("Enhanced Crawl uses native WordPress functions to find all pages and files when running a static export.","simply-static")}),(0,o.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,o.jsx)(o.Fragment,{children:z("Enable Enhanced Crawl","simply-static")}),help:z(P?"Find pages and files via Enhanced Crawl.":"Don't find pages and files via Enhanced Crawl.","simply-static"),checked:P,onChange:e=>{B(e),t("smart_crawl",e)}}),P&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:2}),U&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Notice,{status:"error",isDismissible:!1,children:[z("Error loading crawlers: ","simply-static")," ",U]}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}),M.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.FormTokenField,{label:z("Active Crawlers","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:O.map(e=>{const t=M.find(t=>t.id===e);return t?t.name:e}),suggestions:M.map(e=>e.name),onChange:e=>{const n=e.map(e=>{let t=M.find(t=>t.name===e);return t||(t=M.find(t=>t.name.toLowerCase()===(e||"").toLowerCase())),t||(t=M.find(t=>t.id===e)),t?t.id:null}).filter(e=>!!e&&M.some(t=>t.id===e));W(n),t("crawlers",n)},help:z("Select which crawlers to activate. If none selected, all crawlers will be active by default.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field"}),(0,o.jsx)(p.__experimentalSpacer,{margin:2}),O.includes("post_type")&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:2}),J&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Notice,{status:"error",isDismissible:!1,children:[z("Error loading post types: ","simply-static")," ",J]}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}),$.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.FormTokenField,{label:z("Post Types to Include","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:Array.isArray(K)?K.map(e=>{const t=$.find(t=>t.name===e);return t?t.label:e}):[],suggestions:$.map(e=>e.label),onChange:e=>{const n=e.map(e=>{let t=$.find(t=>t.label===e);return t||(t=$.find(t=>t.label.toLowerCase()===e.toLowerCase())),t||(t=$.find(t=>t.name===e)),t?t.name:null}).filter(Boolean);V(n),t("post_types",n),t("post_types_configured",!0)},help:z("Select which post types to include in the static export. All public post types are selected by default.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field"}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}):(0,o.jsx)("p",{children:z("Loading post types...","simply-static")})]}),O.includes("plugin_assets")&&(0,o.jsxs)(o.Fragment,{children:[te&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Notice,{status:"error",isDismissible:!1,children:[z("Error loading plugins: ","simply-static")," ",te]}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}),X.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.FormTokenField,{label:z("Plugins to Include","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:!c(),value:Array.isArray(Z)?Z.map(e=>{const t=X.find(t=>t.slug===e);return t?t.label:e}):[],suggestions:X.map(e=>e.label),onChange:e=>{let n=e.map(e=>{let t=X.find(t=>t.label===e)||X.find(t=>t.label.toLowerCase()===String(e).toLowerCase())||X.find(t=>t.slug===e);return t?t.slug:e});X.filter(e=>e.required).map(e=>e.slug).forEach(e=>{n.includes(e)||(n=[...n,e])}),ee(n),t("plugins_to_include",n)},help:z("Select which active plugins to include. All active plugins are included by default; remove tokens to exclude them.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field"}),!c()&&(0,o.jsxs)(p.ExternalLink,{style:{marginTop:"5px"},href:"https://simplystatic.com",children:[" ",z("Requires Simply Static Pro","simply-static")]})]}):(0,o.jsx)("p",{children:z("Loading plugins...","simply-static")})]}),O.includes("theme_assets")&&(0,o.jsxs)(o.Fragment,{children:[oe&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Notice,{status:"error",isDismissible:!1,children:[z("Error loading themes: ","simply-static")," ",oe]}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}),ie.length>0?(0,o.jsxs)(o.Fragment,{children:[c()&&(0,o.jsx)(p.__experimentalSpacer,{margin:"5px"}),(0,o.jsx)(p.FormTokenField,{label:z("Themes to Include","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:!c(),value:Array.isArray(re)?re.map(e=>{const t=ie.find(t=>t.slug===e);return t?t.label:e}):[],suggestions:ie.map(e=>e.label),onChange:e=>{const n=e.map(e=>{let t=ie.find(t=>t.label===e)||ie.find(t=>t.label.toLowerCase()===String(e).toLowerCase())||ie.find(t=>t.slug===e);return t?t.slug:e});se(n),t("themes_to_include",n)},help:z("Select which theme(s) to include. The active theme and parent (if any) are included by default; remove tokens to exclude them.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field"}),!c()&&(0,o.jsxs)(p.ExternalLink,{style:{marginTop:"5px"},href:"https://simplystatic.com",children:[" ",z("Requires Simply Static Pro","simply-static")]}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}):(0,o.jsx)("p",{children:z("Loading themes...","simply-static")})]}),(0,o.jsx)("div",{className:"crawler-descriptions",children:M.map(e=>(0,o.jsx)("div",{className:"crawler-description",children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{className:"crawler-name",children:(0,o.jsxs)("strong",{children:[e.name,":"]})}),(0,o.jsx)(p.FlexItem,{children:e.description})]})},e.id))})]}):(0,o.jsx)("p",{children:z("Loading crawlers...","simply-static")})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[z("404","simply-static"),(0,o.jsx)(H,{title:z("How to manage 404 pages?","simply-static"),videoUrl:"https://youtu.be/dnRtuQrXG-k"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,o.jsx)(o.Fragment,{children:z("Generate 404 Page?","simply-static")}),help:z(E?"Generate a 404 page based on your theme template.":"Don't generate a 404 page.","simply-static"),checked:E,onChange:e=>{N(e),t("generate_404",e)}}),E&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.SelectControl,{label:(0,o.jsx)(o.Fragment,{children:c&&"function"==typeof c&&c()?(0,o.jsx)(o.Fragment,{children:z("Custom 404 page (optional)","simply-static")}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{style:{position:"relative",bottom:"-15px"},children:z("Custom 404 page (optional)","simply-static")}),(0,o.jsx)(p.ExternalLink,{href:"https://simplystatic.com",children:z("Requires Simply Static Pro","simply-static")})]})}),value:e.custom_404_page??0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:ce,disabled:!(c&&"function"==typeof c&&c()),onChange:e=>{t("custom_404_page",e)},help:z("If selected, Simply Static will use the content of this page for the 404 page instead of the theme default.","simply-static")}),!(!c||"function"!=typeof c)&&c()&&(0,o.jsx)(p.Button,{variant:"secondary",disabled:d,isBusy:d,onClick:()=>{d||(u(!0),r()({path:"/simplystatic/v1/export-404",method:"POST"}).then(e=>{try{e&&!1===e.success&&e.message?alert(e.message):window.location.reload()}catch(e){window.location.reload()}}).catch(()=>{u(!1),alert(z("Failed to start 404 push.","simply-static"))}))},children:z("Push 404 Page","simply-static")})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[z("Include","simply-static"),(0,o.jsx)(H,{title:z("Include & Exclude files and pages","simply-static"),videoUrl:"https://youtu.be/voAHfwVMLi8"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextareaControl,{label:z("Additional URLs","simply-static"),placeholder:options.home+"/hidden-page/\n/\\/blog\\/.*$/i ",__nextHasNoMarginBottom:!0,help:z("You can enter full URLs or regex (wrap with / /). Examples: https://example.com/private/ or /\\/blog\\/.*$/i (one per line).","simply-static"),value:e.additional_urls,onChange:e=>{t("additional_urls",e)}}),(0,o.jsx)(p.TextareaControl,{label:z("Additional Files and Directories","simply-static"),placeholder:options.home_path+"additional-directory/\n"+options.home_path+"additional-file.html\n/\\.pdf$/i",__nextHasNoMarginBottom:!0,help:z("Enter absolute paths or regex (wrap with / /). Examples: /\\.pdf$/i or /wp-content\\/uploads\\/reports\\/.*/ (one per line).","simply-static"),value:e.additional_files,onChange:e=>{t("additional_files",e)}}),(0,o.jsx)(p.Button,{variant:"secondary",onClick:()=>{try{navigator.clipboard.writeText(options.home_path),R(!0),setTimeout(()=>R(!1),1500)}catch(e){console.error("Clipboard copy failed",e)}},children:z(k?"Copied home path":"Copy home path","simply-static")}),(0,o.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,o.jsx)(o.Fragment,{children:z("Include RSS Feeds?","simply-static")}),help:z(D?"Include feed URLs of all your posts.":"Don't include feed URLs for all your posts.","simply-static"),checked:D,onChange:e=>{T(e),t("add_feeds",e)}}),(0,o.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,o.jsx)(o.Fragment,{children:z("Include Rest API?","simply-static")}),help:z(F?"Include all Rest API endpoints as JSON files.":"Don't include Rest API endpoints as JSON files.","simply-static"),checked:F,onChange:e=>{I(e),t("add_rest_api",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[z("Exclude","simply-static"),(0,o.jsx)(H,{title:z("Include & Exclude files and pages","simply-static"),videoUrl:"https://youtu.be/voAHfwVMLi8"})]})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.TextareaControl,{label:z("Urls to exclude","simply-static"),placeholder:"/some-directory/\n.jpg\n/\\.(pdf|zip)$/i\n/\\/private\\/.*/",__nextHasNoMarginBottom:!0,help:z("You can enter substrings or regex (wrap with / /). Examples: .jpg or /\\.(pdf|zip)$/i or //private/.*/ (one per line).","simply-static"),value:e.urls_to_exclude,onChange:e=>{t("urls_to_exclude",e)}})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:z("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:(0,o.jsx)(p.Button,{onClick:()=>{n(),s(!0),setTimeout(function(){s(!1)},2e3)},variant:"primary",children:z("Save Settings","simply-static")})})]})},{__:W}=wp.i18n,U=function(){const{configs:e,resetDiagnostics:t}=(0,i.useContext)(l),[n,a]=(0,i.useState)(!1);return(0,o.jsx)("div",{className:"inner-settings",children:(0,o.jsxs)("div",{children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[W("Diagnostics","simply-static"),(0,o.jsx)(H,{title:W("How to use diagnostics","simply-static"),videoUrl:"https://youtu.be/X59YMlz6F2s"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:W("Our diagnostics tool provides detailed insights into your WordPress installation and server configuration and tells you exactly what needs to be optimized to get the most out of Simply Static. Click the button below to get the latest results.","simply-static")}),(0,o.jsx)("p",{children:(0,o.jsx)(p.Button,{onClick:()=>{t(),a(!0),setTimeout(function(){window.location.reload()},2e3)},variant:"secondary",children:W("Reset Diagnostics","simply-static")})}),n?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:W("Diagnostics resetted successfully.","simply-static")})})}):""]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),Object.keys(e).map(t=>{const n=e[t];return(0,o.jsxs)("div",{children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:t})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)("div",{children:(0,o.jsx)("table",{style:{width:"100%",tableLayout:"fixed"},children:(0,o.jsx)("tbody",{className:"table-data",children:Object.entries(n).map(e=>(0,o.jsxs)("tr",{className:"table-row",children:[(0,o.jsxs)("td",{className:"diagnostics-icon",children:[" ",e[1].test?(0,o.jsx)(p.Dashicon,{className:"icon-yes",icon:"yes"}):(0,o.jsx)(p.Dashicon,{className:"icon-no",icon:"no"})]}),(0,o.jsx)("td",{className:"diagnostics-test",children:(0,o.jsx)("b",{children:e[0]})}),(0,o.jsx)("td",{children:e[1].test}),(0,o.jsxs)("td",{className:"diagnostics-result",children:[" ",e[1].test?(0,o.jsx)("p",{children:e[1].description}):(0,o.jsx)("p",{children:e[1].error})]})]},e[0]))})})})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]},t)})]})})},{__:G}=wp.i18n,$=function(){const{importSettings:e,resetSettings:t,migrateSettings:n,resetDatabase:a,resetBackgroundQueue:r,isRunning:s,isPaused:c,isRollbackRunning:d}=(0,i.useContext)(l),[u,m]=(0,i.useState)(!1),[h,g]=(0,i.useState)(!1),[x,f]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),[_,v]=(0,i.useState)(!1),[w,S]=(0,i.useState)(!1),[C,j]=(0,i.useState)(""),[k,R]=(0,i.useState)(""),[E,N]=(0,i.useState)(!1),[P,B]=(0,i.useState)(""),[D,T]=(0,i.useState)(!1),[F,I]=(0,i.useState)(""),[M,A]=(0,i.useState)(""),L=s||c||d,z=""!==F,O=async(e,t,n)=>{I(e),A("");try{return await t(),(i=n)(!0),window.setTimeout(()=>i(!1),2e3),!0}catch(e){return A(e&&e.message?e.message:G("The requested action could not be completed.","simply-static")),!1}finally{I("")}var i};return(0,o.jsxs)("div",{className:"inner-settings",children:[L&&(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Import, reset, and migration actions are unavailable until the active export or rollback finishes.","simply-static")})}),M&&(0,o.jsx)(p.Notice,{status:"error",isDismissible:!0,onRemove:()=>A(""),children:(0,o.jsx)("p",{children:M})}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[G("Export","simply-static"),(0,o.jsx)(H,{title:G("Export & Import settings","simply-static"),videoUrl:"https://youtu.be/fmM123Y-gwg"})]})}),(0,o.jsx)(p.CardBody,{children:u?(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(o.Fragment,{children:[E&&(0,o.jsx)("p",{children:G("Preparing export...","simply-static")}),P&&(0,o.jsx)(p.Notice,{status:"error",isDismissible:!0,children:(0,o.jsx)("p",{children:P})}),!E&&!P&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{style:{marginBottom:"12px"},children:(0,o.jsx)("textarea",{className:"ss-export-textarea",value:k,readOnly:!0,style:{width:"100%",height:"300px",fontFamily:'Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',fontSize:"12px",whiteSpace:"pre",overflow:"auto",boxSizing:"border-box"}})}),(0,o.jsx)("p",{children:(0,o.jsx)(p.ClipboardButton,{variant:"secondary",text:k,onCopy:()=>S(!0),onFinishCopy:()=>S(!1),children:G(w?"Copied!":"Copy export data","simply-static")})})]})]})}):(0,o.jsx)("p",{children:(0,o.jsx)(p.Button,{onClick:()=>{m(!0),N(!0),B(""),wp.apiFetch({path:"/simplystatic/v1/settings/export",method:"GET"}).then(e=>{try{let t=e;"string"==typeof e&&(t=JSON.parse(e));const n=JSON.stringify(t||{},null,2);R(n)}catch(e){B(G("Failed to prepare export JSON.","simply-static")),R("")}}).catch(()=>{B(G("Failed to fetch export data.","simply-static")),R("")}).finally(()=>N(!1))},variant:"primary",children:G("Export Settings","simply-static")})})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[G("Import","simply-static"),(0,o.jsx)(H,{title:G("Export & Import settings","simply-static"),videoUrl:"https://youtu.be/fmM123Y-gwg"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:G("Paste in the JSON string you got from your export to import all settings for the plugin.","simply-static")}),(0,o.jsx)("label",{className:"screen-reader-text",htmlFor:"ss-import-data",children:G("Settings JSON to import","simply-static")}),(0,o.jsx)("textarea",{id:"ss-import-data",rows:"8",name:"import-data",value:C,onChange:e=>{j(e.target.value),A("")}}),(0,o.jsx)("p",{children:(0,o.jsx)(p.Button,{onClick:async()=>{let t;try{if(t=JSON.parse(C),!t||Array.isArray(t)||"object"!=typeof t)throw new Error(G("Import data must be a JSON object.","simply-static"))}catch(e){return void A(e&&e.message?e.message:G("Enter valid settings JSON before importing.","simply-static"))}await O("import",()=>e(t),g)},disabled:L||z||""===C.trim(),isBusy:"import"===F,variant:"primary",children:G("Import Settings","simply-static")})}),h?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Settings imported successfully.","simply-static")})})}):""]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:G("Reset","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:G('By clicking the "Reset Plugin Settings", you will reset all plugin settings. This can be useful if you want to import a new set of settings or you want a fresh start.',"simply-static")}),(0,o.jsx)("p",{children:G('If you click the "Reset Database Table" button instead, you will keep all your settings, and we will only recreate our DB table.',"simply-static")}),(0,o.jsx)("p",{children:G('If the background process is stuck and your debug log shows "There is already an export running", use the "Reset Background Queue" button to clear the queue and locks.',"simply-static")}),(0,o.jsxs)("p",{children:[(0,o.jsx)(p.Button,{onClick:()=>O("reset-settings",t,f),disabled:L||z,isBusy:"reset-settings"===F,variant:"primary",children:G("Reset Plugin Settings","simply-static")}),(0,o.jsx)(p.Button,{onClick:()=>O("reset-database",a,b),className:"reset-db-btn",disabled:L||z,isBusy:"reset-database"===F,variant:"primary",children:G("Reset Database Table","simply-static")}),(0,o.jsx)(p.Button,{onClick:()=>O("reset-background",r,T),className:"reset-bg-btn",disabled:z,isBusy:"reset-background"===F,variant:"primary",children:G("Reset Background Queue","simply-static")})]}),x?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Settings reset successfully.","simply-static")})})}):"",y?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Database table reset successfully.","simply-static")})})}):"",D?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Background queue reset successfully.","simply-static")})})}):""]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:G("Migrate Settings","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:G("Migrate all of your settings to Simply Static 3.0","simply-static")}),(0,o.jsx)("p",{children:(0,o.jsx)(p.Button,{onClick:async()=>{await O("migrate",n,v)&&window.setTimeout(()=>window.location.reload(),1e3)},disabled:L||z,isBusy:"migrate"===F,variant:"primary",children:G("Migrate settings","simply-static")})}),_?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Settings migration completed successfully.","simply-static")})})}):""]})]})]})},{__:q}=wp.i18n,K=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isRunning:c,isPro:d,isStudio:u}=(0,i.useContext)(l),[m,h]=(0,i.useState)(!1),[g,x]=(0,i.useState)(""),[f,y]=(0,i.useState)("zip"),[b,_]=(0,i.useState)(!1),[v,w]=(0,i.useState)("personal"),[S,C]=(0,i.useState)("private"),[j,k]=(0,i.useState)(!1),[R,E]=(0,i.useState)(!1),[N,P]=(0,i.useState)(!1),[B,D]=(0,i.useState)("us-east-2"),[T,F]=(0,i.useState)("aws-iam-key"),[I,M]=(0,i.useState)(!1),[A,z]=(0,i.useState)(!1),[O,W]=(0,i.useState)(!1),[U,G]=(0,i.useState)(!1),[$]=(0,i.useState)([{label:q("ZIP Archive","simply-static"),value:"zip"},{label:q("Local Directory","simply-static"),value:"local"},{label:q("Static Studio","simply-static"),value:"simply-static-studio"},{label:q("SFTP","simply-static"),value:"sftp"},{label:q("GitHub","simply-static"),value:"github"},{label:q("AWS S3","simply-static"),value:"aws-s3"},{label:q("Bunny CDN","simply-static"),value:"cdn"},{label:q("Tiiny.host","simply-static"),value:"tiiny"}]),K=!u()||!!options.allow_studio_deployment_settings,V=()=>{n(),s(!0),W(!1),setTimeout(function(){s(!1)},2e3)};(0,i.useEffect)(()=>{e.delivery_method&&y(e.delivery_method),e.clear_directory_before_export&&_(e.clear_directory_before_export),e.github_account_type&&w(e.github_account_type),e.github_repository_visibility&&C(e.github_repository_visibility),e.github_repository_visibility&&C(e.github_repository_visibility),e.github_throttle_requests&&P(e.github_throttle_requests),e.aws_empty&&k(e.aws_empty),e.aws_disable_acl&&E(e.aws_disable_acl),e.aws_auth_method&&F(e.aws_auth_method),e.aws_region&&D(e.aws_region),r()({path:"/simplystatic/v1/pages"}).then(e=>{let t=e;t.unshift({label:q("No page selected","simply-static"),value:0}),z(t)})},[e]);const J=()=>{options.studio_migrate_active?window.location.href=options.studio_migrate_url:(h(!0),x(""),r()({path:"/simplystatic/v1/install-studio-migrate",method:"POST"}).then(e=>{e&&e.success&&e.redirect?window.location.href=e.redirect:(x(e?.message||q("Something went wrong.","simply-static")),h(!1))}).catch(e=>{x(e?.message||q("Something went wrong.","simply-static")),h(!1)}))};return(0,o.jsxs)("div",{className:"inner-settings",children:[!u()&&!d()&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Card,{children:(0,o.jsx)(p.CardBody,{children:(0,o.jsxs)(p.Flex,{direction:"column",gap:2,children:[(0,o.jsxs)("p",{style:{margin:0},children:[(0,o.jsx)("strong",{children:q("⚡ Migrate to Static Studio","simply-static")}),": ",q("The all-in-one Static WordPress cloud-hosting platform. Enjoy secure WordPress, the fastest exports, and the best-performing static site hosting in one package.","simply-static")]}),g&&!m&&(0,o.jsx)(p.Notice,{status:"error",isDismissible:!1,children:(0,o.jsx)("p",{children:g})}),(0,o.jsx)("div",{children:(0,o.jsx)(p.Button,{variant:"primary",isBusy:m,disabled:m,onClick:J,children:m?q("Installing…","simply-static"):options.studio_migrate_active?q("Open Migration Settings","simply-static"):q("Install & Activate Migration Plugin","simply-static")})})]})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:q("Deployment Settings","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:q("Choose from a variety of deployment methods. Depending on your selection we either provide a ZIP file, export to a local directory or send your files to a remote destination.","simply-static")}),(0,o.jsx)(p.SelectControl,{label:q("Deployment method","simply-static"),value:f,options:$,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:!K,onChange:e=>{y(e),t("delivery_method",e),W(!0)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),u()&&(0,o.jsxs)(L,{heading:q("Deployment is automatic on Studio","simply-static"),cta:q("See how Pro deployment works →","simply-static"),children:[(0,o.jsx)("p",{children:q("Your site is built and published automatically every time you make a change, with no destinations to set up and no pipelines to maintain. That's the whole idea of Studio.","simply-static")}),(0,o.jsx)("p",{children:q("Want to choose exactly where your files go? Deploying to GitHub, Amazon S3, BunnyCDN, SFTP and more is part of Simply Static Pro, where you own and control your deployment pipeline.","simply-static")})]}),K&&(0,o.jsxs)(o.Fragment,{children:["simply-static-studio"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:q("Static Studio","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{style:{marginTop:0,marginBottom:"4px"},children:q("The all-in-one Static WordPress cloud-hosting platform.","simply-static")}),(0,o.jsx)("p",{style:{marginTop:0,marginBottom:"4px"},children:q("Enjoy secure WordPress, the fastest exports, and the best-performing static site hosting in one package.","simply-static")}),(0,o.jsx)("p",{style:{marginTop:0,marginBottom:"12px"},children:q("Migrate your existing WordPress site to Static Studio with one click.","simply-static")}),g&&!m&&(0,o.jsx)(p.Notice,{status:"error",isDismissible:!1,children:(0,o.jsx)("p",{children:g})}),(0,o.jsxs)(p.Flex,{direction:"row",gap:3,children:[(0,o.jsx)(p.Button,{variant:"primary",isBusy:m,disabled:m,onClick:J,children:m?q("Installing…","simply-static"):options.studio_migrate_active?q("Open Migration Settings","simply-static"):q("Install & Activate Migration Plugin","simply-static")}),(0,o.jsx)("a",{className:"button",href:"https://simplystatic.com/simply-static-studio/",target:"_blank",children:q("Learn more about Static Studio","simply-static")})]})]})]}),"zip"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[q("ZIP","simply-static"),(0,o.jsx)(H,{title:q("How to export a ZIP file","simply-static"),videoUrl:"https://youtu.be/WHaFjDte6zI"})]})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)("p",{children:q("Get a download link in the activity log once the static export has finished.","simply-static")})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),"local"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[q("Local Directory","simply-static"),(0,o.jsx)(H,{title:q("How to deploy to a local directory","simply-static"),videoUrl:"https://youtu.be/ZRdXQB5slnY"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:q("Path","simply-static"),type:"text",help:q("This is the directory where your static files will be saved. We will create it automatically on the first export if it doesn't exist.","simply-static"),placeholder:options.home_path+"public_static/",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.local_dir,onChange:e=>{t("local_dir",e)}}),(0,o.jsx)(p.Button,{variant:"secondary",onClick:()=>{try{navigator.clipboard.writeText(options.home_path),M(!0),setTimeout(()=>M(!1),1500)}catch(e){console.error("Clipboard copy failed",e)}},children:q(I?"Copied home path":"Copy home path","simply-static")}),(0,o.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:q("Clear Local Directory","simply-static"),help:q(b?"Clear local directory before running an export.":"Don't clear local directory before running an export.","simply-static"),checked:b,onChange:e=>{_(e),t("clear_directory_before_export",e)}})]})]}),(0,o.jsxs)(o.Fragment,{children:["github"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[q("GitHub","simply-static")," ",(0,o.jsx)(H,{title:q("How to deploy to a GitHub (2/2)","simply-static"),videoUrl:"https://youtu.be/HqyTKwZuUAM"})]})}),("free"===options.plan||!d())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",q("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:q("GitHub enables you to export your static website to one of the common static hosting providers like Netlify, Cloudflare Pages or GitHub Pages.","simply-static")}),(0,o.jsx)(p.SelectControl,{label:q("Account Type","simply-static"),value:v,help:q("Depending on the account type the settings fields will change.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:q("Personal","simply-static"),value:"personal"},{label:q("Organization","simply-static"),value:"organization"}],onChange:e=>{w(e),t("github_account_type",e)}}),"organization"===v?(0,o.jsx)(p.TextControl,{label:q("Organization","simply-static"),type:"text",help:q("Enter the name of your organization.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_user,onChange:e=>{t("github_user",e)}}):(0,o.jsx)(p.TextControl,{label:q("Username","simply-static"),type:"text",help:q("Enter your GitHub username.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_user,onChange:e=>{t("github_user",e)}}),(0,o.jsx)(p.TextControl,{label:q("E-Mail","simply-static"),type:"email",help:q("Enter your GitHub email address. This will be used to commit files to your repository.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_email,onChange:e=>{t("github_email",e)}}),(0,o.jsx)(p.TextControl,{label:(0,o.jsxs)(o.Fragment,{children:[q("Personal Access Token","simply-static"),(0,o.jsx)(H,{title:q("How to prepare your GitHub account","simply-static"),videoUrl:"https://youtu.be/fjsJJmPeKuc"})]}),type:"password",help:(0,o.jsxs)(o.Fragment,{children:[q("You need a personal access token from GitHub. Learn how to get one ","simply-static"),(0,o.jsx)("a",{href:"https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic",target:"_blank",children:q("here","simply-static")})]}),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_personal_access_token,onChange:e=>{t("github_personal_access_token",e)}}),(0,o.jsx)(p.TextControl,{label:q("Repository","simply-static"),type:"text",help:q("Enter a name for your repository (lowercase without spaces or special characters).","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_repository,onChange:e=>{t("github_repository",e)}}),(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:(0,o.jsxs)("p",{children:[q("Ensure to create the repository and add a readme file to it before running an export as shown in the docs ","simply-static"),(0,o.jsx)("a",{href:"https://docs.simplystatic.com/article/33-set-up-the-github-integration/",target:"_blank",children:q("here","simply-static")})]})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsx)(p.TextControl,{label:q("Folder","simply-static"),type:"text",help:q("Enter a relative path to a folder if you want to push files under it. Example: for github.com/USER/REPOSITORY/folder1, enter folder1","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_folder_path,onChange:e=>{t("github_folder_path",e)}}),"organization"===v&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:(0,o.jsx)("p",{children:q("You need to create the repository manually within your organization before connecting it.","simply-static")})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)(p.SelectControl,{label:q("Visiblity","simply-static"),value:S,help:q("Decide if you want to make your repository public or private.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:q("Public","simply-static"),value:"public"},{label:q("Private","simply-static"),value:"private"}],onChange:e=>{C(e),t("github_repository_visibility",e)}}),(0,o.jsx)(p.TextControl,{label:q("Branch","simply-static"),type:e.github_branch,placeholder:"main",help:q('Simply Static automatically uses "main" as branch. You may want to modify that for example to gh-pages. for GitHub Pages.',"simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_branch,onChange:e=>{t("github_branch",e)}}),(0,o.jsx)(p.TextControl,{label:q("Webhook URL","simply-static"),type:"url",help:q("Enter your Webhook URL here and Simply Static will send a POST request after all files are commited to GitHub.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_webhook_url,onChange:e=>{t("github_webhook_url",e)}}),(0,o.jsx)(p.ToggleControl,{label:q("Throttle Requests","simply-static"),help:q("Enable this option if you are experiencing issues with the GitHub API rate limit.","simply-static"),disabled:"free"===options.plan||!d(),__nextHasNoMarginBottom:!0,checked:N,onChange:e=>{P(e),t("github_throttle_requests",e)}}),(0,o.jsx)(p.TextControl,{label:q("Batch size","simply-static"),type:"number",help:q("Enter the number of files you want to be processed in a single batch. If current export fails to deploy, lower the number.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_batch_size??100,onChange:e=>{t("github_batch_size",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),"tiiny"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[q("Tiiny.host","simply-static")," ",(0,o.jsx)(H,{title:q("How to deploy to Tiiny.host","simply-static"),videoUrl:"https://youtu.be/Y9EDaQkGl1Y"})]})}),("free"===options.plan||!d())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",q("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:q("Deploying to Tiiny.host is the easiest and fastest deployment option available in Simply Static Pro.","simply-static")}),(0,o.jsx)(p.TextControl,{disabled:!0,label:q("E-Mail","simply-static"),type:"text",help:(0,o.jsxs)(o.Fragment,{children:[q("This field is auto-filled with the e-mail address used for activating Simply Static Pro.","simply-static"),(0,o.jsx)("br",{}),(0,o.jsx)("b",{children:q("An account will be created automatically on your first deployment.","simply-static")})]}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:options.admin_email}),(0,o.jsx)(p.TextControl,{label:q("Subdomain","simply-static"),type:"text",help:q("That's the part before your TLD. Your full URL is the combination of the subdomain plus the domain suffix.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.tiiny_subdomain,onChange:e=>{t("tiiny_subdomain",e)}}),(0,o.jsx)(p.TextControl,{label:q("Domain Suffix","simply-static"),type:"text",help:q("This defaults to tiiny.site. If you have a custom domain configured in Tiiny.host, you can also use that one.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.tiiny_domain_suffix,onChange:e=>{t("tiiny_domain_suffix",e)}}),(0,o.jsx)(p.TextControl,{label:q("Password Protection","simply-static"),type:"password",help:q("Adding a password will activate password protection on your static site. The website is only visible with the password.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.tiiny_password,onChange:e=>{t("tiiny_password",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),"cdn"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[q("Bunny CDN","simply-static"),(0,o.jsx)(H,{title:q("How to deploy to Bunny CDN","simply-static"),videoUrl:"https://youtu.be/FBRg1BI41VY"})]})}),("free"===options.plan||!d())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",q("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:q("Bunny CDN is a fast and reliable CDN provider that you can run your static website on.","simply-static")}),(0,o.jsx)(p.TextControl,{label:q("Bunny CDN API Key","simply-static"),type:"password",help:(0,o.jsxs)(o.Fragment,{children:[q("Enter your API Key from Bunny CDN. You can find your API-Key as described ","simply-static"),(0,o.jsx)("a",{href:"https://support.bunny.net/hc/en-us/articles/360012168840-Where-do-I-find-my-API-key",target:"_blank",children:q("here","simply-static")})]}),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_api_key,onChange:e=>{t("cdn_api_key",e)}}),(0,o.jsx)(p.TextControl,{label:q("Storage Host","simply-static"),type:"text",help:(0,o.jsxs)(o.Fragment,{children:[q("Depending on your location, you have a different storage host. You find out which URL to use ","simply-static"),(0,o.jsx)("a",{href:"https://docs.bunny.net/reference/storage-api#storage-endpoints",target:"_blank",children:q("here","simply-static")})]}),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_storage_host,onChange:e=>{t("cdn_storage_host",e)}}),(0,o.jsx)(p.TextControl,{label:q("Bunny CDN Access Key","simply-static"),type:"password",help:q("Enter your Acess Key from Bunny CDN. You will find it within your storage zone setttings within FTP & API Access -> Password.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_access_key,onChange:e=>{t("cdn_access_key",e)}}),(0,o.jsx)(p.TextControl,{label:q("Pull Zone","simply-static"),type:"text",help:q("A pull zone is the connection of your CDN to the internet. Simply Static will try to find an existing pull zone with the provided name, if there is none it creates a new pull zone.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_pull_zone,onChange:e=>{t("cdn_pull_zone",e)}}),(0,o.jsx)(p.TextControl,{label:q("Storage Zone","simply-static"),type:"text",help:q("A storage zone contains your static files. Simply Static will try to find an existing storage zone with the provided name, if there is none it creates a new storage zone.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_storage_zone,onChange:e=>{t("cdn_storage_zone",e)}}),(0,o.jsx)(p.TextControl,{label:q("Subdirectory","simply-static"),type:"text",placeholder:"/subdirectory/",help:q("If you want to transfer the files to a specific subdirectory on your storage zone add the name of that directory here.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_directory,onChange:e=>{t("cdn_directory",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),"aws-s3"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[q("Amazon AWS S3","simply-static"),(0,o.jsx)(H,{title:q("How to deploy to Amazon AWS S3","simply-static"),videoUrl:"https://youtu.be/rtn21J86Upc"})]})}),("free"===options.plan||!d())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",q("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.SelectControl,{label:q("Authentication Method","simply-static"),value:T,options:[{label:q("AWS IAM Access Key","simply-static"),value:"aws-iam-key"},{label:q("AWS EC2","simply-static"),value:"aws-ec2"}],disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>{F(e),t("aws_auth_method",e)}}),"aws-iam-key"===T&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextControl,{label:q("Access Key ID","simply-static"),type:"text",help:(0,o.jsxs)(o.Fragment,{children:[q("Enter your Access Key from AWS. Learn how to get one ","simply-static"),(0,o.jsx)("a",{href:"https://docs.aws.amazon.com/en_en/IAM/latest/UserGuide/id_credentials_access-keys.html",target:"_blank",children:q("here","simply-static")})]}),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_access_key,onChange:e=>{t("aws_access_key",e)}}),(0,o.jsx)(p.TextControl,{label:q("Secret Access Key","simply-static"),type:"password",help:(0,o.jsxs)(o.Fragment,{children:[q("Enter your Secret Key from AWS. Learn how to get one ","simply-static"),(0,o.jsx)("a",{href:"https://docs.aws.amazon.com/en_en/IAM/latest/UserGuide/id_credentials_access-keys.html",target:"_blank",children:q("here","simply-static")})]}),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_access_secret,onChange:e=>{t("aws_access_secret",e)}})]}),(0,o.jsx)(p.SelectControl,{label:q("Region","simply-static"),value:B,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:q("US East (Ohio)","simply-static"),value:"us-east-2"},{label:q("US East (N. Virginia)","simply-static"),value:"us-east-1"},{label:q("US West (N. California)","simply-static"),value:"us-west-1"},{label:q("US West (Oregon)","simply-static"),value:"us-west-2"},{label:q("Africa (Cape Town)","simply-static"),value:"af-south-1"},{label:q("Asia Pacific (Hong Kong)","simply-static"),value:"ap-east-1"},{label:q("Asia Pacific (Hyderabad)","simply-static"),value:"ap-south-2"},{label:q("Asia Pacific (Jakarta)","simply-static"),value:"ap-southeast-3"},{label:q("Asia Pacific (Melbourne)","simply-static"),value:"ap-southeast-4"},{label:q("Asia Pacific (Mumbai)","simply-static"),value:"ap-south-1"},{label:q("Asia Pacific (Osaka)","simply-static"),value:"ap-northeast-3"},{label:q("Asia Pacific (Seoul)","simply-static"),value:"ap-northeast-2"},{label:q("Asia Pacific (Singapore)","simply-static"),value:"ap-southeast-1"},{label:q("Asia Pacific (Sydney)","simply-static"),value:"ap-southeast-2"},{label:q("Asia Pacific (Tokyo)","simply-static"),value:"ap-northeast-1"},{label:q("Canada (Central)","simply-static"),value:"ca-central-1"},{label:q("Europe (Frankfurt)","simply-static"),value:"eu-central-1"},{label:q("Europe (Ireland)","simply-static"),value:"eu-west-1"},{label:q("Europe (London)","simply-static"),value:"eu-west-2"},{label:q("Europe (Milan)","simply-static"),value:"eu-south-1"},{label:q("Europe (Paris)","simply-static"),value:"eu-west-3"},{label:q("Europe (Spain)","simply-static"),value:"eu-south-2"},{label:q("Europe (Stockholm)","simply-static"),value:"eu-north-1"},{label:q("Europe (Zurich)","simply-static"),value:"eu-central-2"},{label:q("Middle East (Bahrain)","simply-static"),value:"me-south-1"},{label:q("Middle East (UAE)","simply-static"),value:"me-central-1"},{label:q("South America (São Paulo)","simply-static"),value:"sa-east-1"},{label:q("AWS GovCloud (US-East)","simply-static"),value:"us-gov-east-1"},{label:q("AWS GovCloud (US-West)","simply-static"),value:"us-gov-west-1"}],disabled:"free"===options.plan||!d(),onChange:e=>{D(e),t("aws_region",e)}}),(0,o.jsx)(p.TextControl,{label:q("Bucket","simply-static"),type:"text",help:q("Add the name of your bucket here.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_bucket,onChange:e=>{t("aws_bucket",e)}}),(0,o.jsx)(p.TextControl,{label:q("Subdirectory","simply-static"),type:"text",help:q("Add an optional subdirectory for your bucket","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_subdirectory,onChange:e=>{t("aws_subdirectory",e)}}),(0,o.jsx)(p.TextControl,{label:q("Cloudfront Distribution ID","simply-static"),type:"text",help:q("We automatically invalidate the cache after each export.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_distribution_id,onChange:e=>{t("aws_distribution_id",e)}}),(0,o.jsx)(p.TextControl,{label:q("Webhook URL","simply-static"),type:"url",help:q("Enter your Webhook URL here and Simply Static will send a POST request after all files are transferred to AWS S3.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_webhook_url,onChange:e=>{t("aws_webhook_url",e)}}),(0,o.jsx)(p.ToggleControl,{label:q("Disable ACL on uploads?","simply-static"),help:q(R?'ACL header will not be sent. Required for buckets with "Bucket owner enforced" (ACLs disabled).':"ACL header will be sent with uploads. Disable this if your bucket has ACLs disabled.","simply-static"),disabled:"free"===options.plan||!d(),__nextHasNoMarginBottom:!0,checked:R,onChange:e=>{E(e),t("aws_disable_acl",e)}}),(0,o.jsx)(p.ToggleControl,{label:q("Empty bucket before new export?","simply-static"),help:q(j?"Clear bucket before new export.":"Don't clear bucket before new export.","simply-static"),disabled:"free"===options.plan||!d(),__nextHasNoMarginBottom:!0,checked:j,onChange:e=>{k(e),t("aws_empty",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),"sftp"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[q("SFTP","simply-static")," ",(0,o.jsx)(H,{title:q("How to deploy via SFTP","simply-static"),videoUrl:"https://youtu.be/6-QR9wZA3VQ"})]})}),("free"===options.plan||!d())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",q("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:q("Host","simply-static"),type:"text",help:q("Enter your SFTP host.","simply-static"),value:e.sftp_host,disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>{t("sftp_host",e)}}),(0,o.jsx)(p.TextControl,{label:q("Port","simply-static"),type:"number",disabled:"free"===options.plan||!d(),help:q("Enter your SFTP port.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.sftp_port,onChange:e=>{t("sftp_port",e)}}),(0,o.jsx)(p.TextControl,{label:q("SFTP username","simply-static"),help:q("Enter your SFTP username.","simply-static"),type:"text",disabled:"free"===options.plan||!d(),placeholder:"username",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.sftp_user,onChange:e=>{t("sftp_user",e)}}),(0,o.jsx)(p.TextControl,{label:q("SFTP password","simply-static"),type:"password",disabled:"free"===options.plan||!d(),help:q("Enter your SFTP password.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.sftp_pass,onChange:e=>{t("sftp_pass",e)}}),(0,o.jsx)(p.TextareaControl,{label:q("SFTP private key","simply-static"),disabled:"free"===options.plan||!d(),__nextHasNoMarginBottom:!0,placeholder:q("OPTIONAL: This is only required if you need to authenticate via a private key to access your SFTP server.","simply-static"),help:q("Enter your SFTP private key if you want passwordless upload and the server is configured to allow it. You can set it as a constant in wp-config.php by using define('SSP_SFTP_KEY', 'YOUR_KEY')","simply-static"),value:e.sftp_private_key,onChange:e=>{t("sftp_private_key",e)}}),(0,o.jsx)(p.TextControl,{label:q("SFTP folder","simply-static"),help:q('Leave empty to upload to the default SFTP folder. Enter a folder path where you want the static files to be uploaded to (example: "uploads" will upload to uploads folder. "uploads/new-folder" will upload files to "new-folder"). ',"simply-static"),type:"text",disabled:"free"===options.plan||!d(),placeholder:"",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.sftp_folder,onChange:e=>{t("sftp_folder",e)}}),(0,o.jsx)(p.ToggleControl,{label:q("Bulk upload via zip archive","simply-static"),help:q("Instead of uploading files one by one, this creates a zip archive locally, uploads it as a single file, and extracts it on the remote server. This can significantly speed up deployments with many files. Requires unzip or python3 on the remote server.","simply-static"),disabled:"free"===options.plan||!d(),checked:e.sftp_bulk_upload,onChange:e=>{t("sftp_bulk_upload",e)}})]})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:q("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsxs)("div",{className:"save-settings",children:[K&&(0,o.jsx)(o.Fragment,{children:"free"!==options.plan||u()?(0,o.jsx)(p.Button,{onClick:V,variant:"primary",children:q("Save Settings","simply-static")}):(0,o.jsxs)(o.Fragment,{children:["zip"===f&&(0,o.jsx)(p.Button,{onClick:V,variant:"primary",children:q("Save Settings","simply-static")}),"local"===f&&(0,o.jsx)(p.Button,{onClick:V,variant:"primary",children:q("Save Settings","simply-static")})]})}),K&&"pro"===options.plan&&d()&&(0,o.jsxs)(p.Button,{disabled:c||O||U,variant:"secondary",isBusy:c||U,onClick:()=>{G(!0),r()({path:"/simplystatic/v1/apply-single",method:"POST"}).then(e=>{404===parseInt(e.status)?alert(e.message):window.location.reload()})},children:[O&&q("Save settings to test","simply-static"),!O&&q("Test Deployment","simply-static")]})]})]})},{__:V}=wp.i18n,J=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isPro:c}=(0,i.useContext)(l),[d,u]=(0,i.useState)(!1),[m,h]=(0,i.useState)(!1),[g,x]=(0,i.useState)(!1),[f,y]=(0,i.useState)(!0),[b,_]=(0,i.useState)(!1),[v,w]=(0,i.useState)(!1),[S,C]=(0,i.useState)(null),[j,k]=(0,i.useState)(null);return(0,i.useEffect)(()=>{r()({path:"/simplystatic/v1/pages-slugs"}).then(e=>{let t=e;t.unshift({label:V("No page selected","simply-static"),value:""}),_(t)}),e.use_forms&&u(e.use_forms),e.use_comments&&x(e.use_comments),void 0!==e.save_form_entries?y(!!e.save_form_entries):y(!0),void 0!==e.use_form_conditional_loading&&h(!!e.use_form_conditional_loading)},[e]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:V("Forms","simply-static")})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",V("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:V("Use forms?","simply-static"),__nextHasNoMarginBottom:!0,help:V(d?"Use Forms on your static website.":"Don't use forms on your static website.","simply-static"),disabled:"free"===options.plan||!c(),checked:d,onChange:e=>{u(e),t("use_forms",e)}}),d&&(0,o.jsx)(p.ToggleControl,{label:V("Store form entries","simply-static"),__nextHasNoMarginBottom:!0,help:V(f?"Store form entries inside WordPress (requires Simply Static Webhook).":"Do not store form entries in WordPress.","simply-static"),disabled:"free"===options.plan||!c(),checked:!!f,onChange:e=>{y(e),t("save_form_entries",e)}}),d&&(0,o.jsx)(p.ToggleControl,{label:V("Enable conditional loading","simply-static"),__nextHasNoMarginBottom:!0,help:V(m?"Form scripts are only loaded on pages that contain a connected form.":"Form scripts are loaded on all pages for maximum compatibility.","simply-static"),disabled:"free"===options.plan||!c(),checked:m,onChange:e=>{h(e),t("use_form_conditional_loading",e)}}),d&&options.form_connection_url&&"free"!==options.plan&&(0,o.jsx)(p.Button,{href:options.form_connection_url,variant:"secondary",children:V("Create a form connection","simply-static")})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:V("Comments","simply-static")})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",V("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:V("Use comments?","simply-static"),__nextHasNoMarginBottom:!0,help:V(g?"Use comments on your static website.":"Don't use comments on your static website.","simply-static"),disabled:"free"===options.plan||!c(),checked:g,onChange:e=>{x(e),t("use_comments",e)}}),g&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.SelectControl,{label:V("Select a redirect page","content-protector"),options:b,help:V("The post will be regenerated after comment submission, but it might take a while so its good practice to redirect the visitor.","simply-static"),disabled:"free"===options.plan||!c(),value:e.comment_redirect,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>{t("comment_redirect",e)}})})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(d||g)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:V("Captcha","simply-static")})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",V("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:V("We will automatically protect your forms and comments with a captcha on your static site.","simply-static")}),(0,o.jsx)(p.SelectControl,{label:V("Captcha Service","simply-static"),help:V("Choose which captcha service to use.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.captcha_service||"",options:[{label:V("Choose Service","simply-static"),value:""},{label:V("Cloudflare Turnstile","simply-static"),value:"turnstile"},{label:V("Google reCAPTCHA v3","simply-static"),value:"recaptcha_v3"}],onChange:e=>t("captcha_service",e)}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),j&&(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Notice,{status:j.type,isDismissible:!0,onRemove:()=>k(null),children:j.message}),(0,o.jsx)(p.__experimentalSpacer,{margin:3})]})}),(0,o.jsx)(p.Button,{variant:"secondary",disabled:"free"===options.plan||!c()||v,isBusy:v,onClick:()=>{w(!0),k(null),r()({path:"/simplystatic/v1/captcha/detect-credentials"}).then(n=>{if(w(!1),!n.success)return void k({type:"error",message:V("Failed to detect credentials.","simply-static")});const i=n.credentials,a=e.captcha_service||"";let r=null,s="";if("turnstile"===a&&i.turnstile&&i.turnstile.length>0)r=i.turnstile[0],s=r.source,t("cloudflare_turnstile_site_key",r.site_key),t("cloudflare_turnstile_secret_key",r.secret_key),k({type:"success",message:V("Turnstile credentials copied from ","simply-static")+s+"!"});else if("recaptcha_v3"===a&&i.recaptcha&&i.recaptcha.length>0)r=i.recaptcha[0],s=r.source,t("recaptcha_site_key",r.site_key),t("recaptcha_secret_key",r.secret_key),k({type:"success",message:V("ReCaptcha credentials copied from ","simply-static")+s+"!"});else{let e="";"turnstile"===a&&i.recaptcha&&i.recaptcha.length>0?e=V(" ReCaptcha credentials were found - switch to ReCaptcha v3 to use them.","simply-static"):"recaptcha_v3"===a&&i.turnstile&&i.turnstile.length>0&&(e=V(" Turnstile credentials were found - switch to Turnstile to use them.","simply-static")),k({type:"warning",message:V("No credentials found for the selected captcha service.","simply-static")+e})}C(i)}).catch(e=>{w(!1),k({type:"error",message:V("Error detecting credentials: ","simply-static")+(e.message||V("Unknown error","simply-static"))})})},children:V(v?"Detecting...":"Copy existing Credentials","simply-static")}),(0,o.jsx)("p",{className:"components-base-control__help",children:V("Automatically detect and copy captcha credentials from form plugins like Contact Form 7, WPForms, or Fluent Forms.","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),"turnstile"===e.captcha_service&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextControl,{label:V("Site Key","simply-static"),help:V("Your public key will be used on the static site.","simply-static"),placeholder:V("Enter your Turnstile site key","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.cloudflare_turnstile_site_key||"",onChange:e=>t("cloudflare_turnstile_site_key",e)}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.TextControl,{label:V("Secret Key","simply-static"),help:V("Your secret key will be stored in WordPress.","simply-static"),placeholder:V("Enter your Turnstile secret key","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.cloudflare_turnstile_secret_key||"",onChange:e=>t("cloudflare_turnstile_secret_key",e)}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.SelectControl,{label:V("Theme","simply-static"),help:V("Choose how the widget should look on your site.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.cloudflare_turnstile_theme||"auto",options:[{label:V("Auto","simply-static"),value:"auto"},{label:V("Light","simply-static"),value:"light"},{label:V("Dark","simply-static"),value:"dark"}],onChange:e=>t("cloudflare_turnstile_theme",e)}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.SelectControl,{label:V("Size","simply-static"),help:V("Choose the widget size.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.cloudflare_turnstile_size||"normal",options:[{label:V("Normal","simply-static"),value:"normal"},{label:V("Flexible","simply-static"),value:"flexible"},{label:V("Compact","simply-static"),value:"compact"}],onChange:e=>t("cloudflare_turnstile_size",e)})]}),"recaptcha_v3"===e.captcha_service&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextControl,{label:V("Site Key","simply-static"),help:V("Your public key will be used on the static site.","simply-static"),placeholder:V("Enter your reCAPTCHA v3 site key","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.recaptcha_site_key||"",onChange:e=>t("recaptcha_site_key",e)}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.TextControl,{label:V("Secret Key","simply-static"),help:V("Your secret key will be stored in WordPress.","simply-static"),placeholder:V("Enter your reCAPTCHA v3 secret key","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.recaptcha_secret_key||"",onChange:e=>t("recaptcha_secret_key",e)})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:V("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:"pro"===options.plan&&c()&&(0,o.jsx)(p.Button,{onClick:()=>{n(),s(!0),setTimeout(function(){s(!1),d&&(localStorage.setItem("ss-initial-page","/forms"),window.location.reload())},2e3)},variant:"primary",children:V("Save Settings","simply-static")})})]})},{__:Y}=wp.i18n,X=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:r,isPro:s}=(0,i.useContext)(l),[c,d]=(0,i.useState)(!1),[u,m]=(0,i.useState)("fuse"),[h,g]=(0,i.useState)(!1),x=()=>g(!0);(0,i.useEffect)(()=>{Object.prototype.hasOwnProperty.call(e,"use_search")&&d(!!e.use_search),e.search_type&&m(e.search_type)},[e]);const f=e.search_show_submit??e.search_fuse_show_submit??!1;return(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:Y("Search","simply-static")})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Y("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:Y("Use search?","simply-static"),__nextHasNoMarginBottom:!0,help:Y(c?"Use search on your static website.":"Don't use search on your static website.","simply-static"),disabled:"free"===options.plan||!s(),checked:c,onChange:e=>{d(e),t("use_search",e)}}),(0,o.jsx)(p.SelectControl,{label:Y("Search Type","simply-static"),value:u,help:Y("Decide which search type you want to use. Fuse runs locally based on a file, and Algolia is an external API service.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:"Fuse JS",value:"fuse"},{label:"Algolia API",value:"algolia"}],onChange:e=>{m(e),t("search_type",e)}}),c&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.ToggleControl,{label:Y("Use Search Results Page","simply-static"),__nextHasNoMarginBottom:!0,help:Y("Simply Static will create a static search results page and the export will include a special __qs directory.","simply-static"),disabled:"free"===options.plan||!s(),checked:e.use_search_results_page??!0,onChange:e=>{t("use_search_results_page",e)}}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.ToggleControl,{label:Y("Use Submit Button","simply-static"),__nextHasNoMarginBottom:!0,help:Y("Show or hide the submit button in the search UI.","simply-static"),disabled:"free"===options.plan||!s(),checked:e.search_show_submit??e.search_fuse_show_submit??!1,onChange:e=>{t("search_show_submit",e)}}),f&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextControl,{label:Y("Submit button text","simply-static"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,placeholder:Y("Search","simply-static"),help:Y("Customize the submit button text or HTML (e.g., add an icon).","simply-static"),disabled:"free"===options.plan||!s(),value:e.search_submit_text??e.search_fuse_submit_text,onChange:e=>{t("search_submit_text",e)}})}),(0,o.jsx)(p.ToggleControl,{label:Y("Show excerpt in suggestions/results","simply-static"),__nextHasNoMarginBottom:!0,help:Y("Enable to display the excerpt below each search suggestion and result item.","simply-static"),disabled:"free"===options.plan||!s(),checked:e.search_show_excerpt??!1,onChange:e=>{t("search_show_excerpt",e)}}),(0,o.jsx)(p.TextControl,{label:Y("Input placeholder","simply-static"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,placeholder:Y("Search..","simply-static"),help:Y("Customize the placeholder text for the search input.","simply-static"),disabled:"free"===options.plan||!s(),value:e.search_placeholder??e.search_fuse_placeholder,onChange:e=>{t("search_placeholder",e)}})]})]})]}),(0,o.jsxs)(o.Fragment,{children:[h&&(0,o.jsxs)(p.Modal,{title:Y("How to select data with meta tags","simply-static"),onRequestClose:()=>g(!1),children:[(0,o.jsx)("p",{children:Y("Targeting for excerpt in the meta description tag.","simply-static")}),(0,o.jsx)("pre",{children:''}),(0,o.jsx)("p",{children:Y("Adding such meta in the excerpt field would be:","simply-static")}),(0,o.jsx)("pre",{children:"description|content"}),(0,o.jsx)("p",{children:Y("Targeting for title in the property meta tag.","simply-static")}),(0,o.jsx)("pre",{children:''}),(0,o.jsx)("p",{children:Y("Adding such meta in the excerpt field would be:","simply-static")}),(0,o.jsx)("pre",{children:"property|og:title"}),(0,o.jsx)("p",{children:Y('If the second item (after | ) is not content, we\'ll use it as value of that attribute (property="og:title" in this example) and use content for value.',"simply-static")}),(0,o.jsx)("p",{children:(0,o.jsx)("strong",{children:Y("Caution: Use meta tags that exist everywhere for title.","simply-static")})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:Y("Indexing","simply-static")})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Y("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:Y("CSS-Selector for Title","simply-static"),type:"text",placeholder:"title",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,o.jsxs)(o.Fragment,{children:[Y("Add the CSS selector which contains the title of the page/post","simply-static")," ",(0,o.jsx)(p.Button,{variant:"link",onClick:x,children:Y("Or meta tags. Click for more information.","simply-static")})]}),disabled:"free"===options.plan||!s(),value:e.search_index_title,onChange:e=>{t("search_index_title",e)}}),(0,o.jsx)(p.TextControl,{label:Y("CSS-Selector for Content","simply-static"),type:"text",placeholder:"body",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,o.jsxs)(o.Fragment,{children:[Y("Add the CSS selector which contains the content of the page/post.","simply-static")," ",(0,o.jsx)(p.Button,{variant:"link",onClick:x,children:Y("Or meta tags. Click for more information.","simply-static")})]}),disabled:"free"===options.plan||!s(),value:e.search_index_content,onChange:e=>{t("search_index_content",e)}}),(0,o.jsx)(p.TextControl,{label:Y("CSS-Selector for Excerpt","simply-static"),type:"text",placeholder:".entry-content",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,o.jsxs)(o.Fragment,{children:[Y("Add the CSS selector which contains the excerpt of the page/post.","simply-static")," ",(0,o.jsx)(p.Button,{variant:"link",onClick:x,children:Y("Or meta tags. Click for more information.","simply-static")})]}),disabled:"free"===options.plan||!s(),value:e.search_index_excerpt,onChange:e=>{t("search_index_excerpt",e)}}),(0,o.jsx)(p.TextareaControl,{label:Y("Exclude URLs","simply-static"),placeholder:"author\narchive\ncategory",__nextHasNoMarginBottom:!0,help:Y("Exclude URLs from indexing (one per line). You can use full URLs, parts of an URL or plain words (like stop words).","simply-static"),disabled:"free"===options.plan||!s(),value:e.search_excludable,onChange:e=>{t("search_excludable",e)}})]})]})]}),"fuse"===u&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[Y("Fuse.js","simply-static"),(0,o.jsx)(H,{title:Y("How to add search with FuseJS","simply-static"),videoUrl:"https://youtu.be/K34l1DXjCHk"})]})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Y("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:Y("CSS-Selector","simply-static"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add the CSS selector for the
element that contains your search input field.","simply-static"),disabled:"free"===options.plan||!s(),value:e.fuse_selector,onChange:e=>{t("fuse_selector",e)}}),(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:Y("If you have multiple search elements with different CSS selectors, separate them by a comma (,) such as: .search-form, .custom-search-form","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsx)(p.__experimentalNumberControl,{label:Y("Threshold","simply-static"),isShiftStepEnabled:!0,step:.1,min:.1,max:1,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y(" A threshold of 0.0 requires a perfect match, a threshold of 1.0 would match anything.","simply-static"),disabled:"free"===options.plan||!s(),value:e.fuse_threshold,placeholder:.1,onChange:e=>{t("fuse_threshold",e)}}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsx)(p.ToggleControl,{label:Y("Use Extended Search","simply-static"),__nextHasNoMarginBottom:!0,help:Y("Enable Fuse.js extended search operators such as exact match, prefix, suffix, and inverse match.","simply-static"),disabled:"free"===options.plan||!s(),checked:e.fuse_use_extended_search,onChange:e=>{t("fuse_use_extended_search",e)}}),(0,o.jsx)(p.ToggleControl,{label:Y("Ignore Location","simply-static"),__nextHasNoMarginBottom:!0,help:Y("When enabled, the search will look for a match anywhere in the string, regardless of position. By default, Fuse.js favors matches near the beginning of a string.","simply-static"),disabled:"free"===options.plan||!s(),checked:e.fuse_ignore_location,onChange:e=>{t("fuse_ignore_location",e)}}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsx)("h4",{children:Y("Weight","simply-static")}),(0,o.jsx)("p",{children:Y("Weighted search allows you to prioritize certain fields in your search results. A higher weight means results matching that field will appear higher in the results list. Default weight is 1.","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsxs)(p.Flex,{gap:4,align:"flex-start",wrap:!0,children:[(0,o.jsx)(p.FlexItem,{style:{flex:1,minWidth:"120px"},children:(0,o.jsx)(p.__experimentalNumberControl,{label:Y("Title Weight","simply-static"),isShiftStepEnabled:!0,step:1,min:1,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!s(),value:e.fuse_weight_title??1,placeholder:1,onChange:e=>{t("fuse_weight_title",e)}})}),(0,o.jsx)(p.FlexItem,{style:{flex:1,minWidth:"120px"},children:(0,o.jsx)(p.__experimentalNumberControl,{label:Y("Content Weight","simply-static"),isShiftStepEnabled:!0,step:1,min:1,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!s(),value:e.fuse_weight_content??1,placeholder:1,onChange:e=>{t("fuse_weight_content",e)}})}),(0,o.jsx)(p.FlexItem,{style:{flex:1,minWidth:"120px"},children:(0,o.jsx)(p.__experimentalNumberControl,{label:Y("Excerpt Weight","simply-static"),isShiftStepEnabled:!0,step:1,min:1,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!s(),value:e.fuse_weight_excerpt??1,placeholder:1,onChange:e=>{t("fuse_weight_excerpt",e)}})})]})]})]})]}),"algolia"===u&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[Y("Algolia API","simply-static"),(0,o.jsx)(H,{title:Y("How to add search with the Algolia API","simply-static"),videoUrl:"https://youtu.be/H9PNZSl0KnU"})]})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Y("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:Y("Application ID","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add your Algolia App ID.","simply-static"),disabled:"free"===options.plan||!s(),value:e.algolia_app_id,onChange:e=>{t("algolia_app_id",e)}}),(0,o.jsx)(p.TextControl,{label:Y("Admin API Key","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add your Algolia Admin API Key.","simply-static"),disabled:"free"===options.plan||!s(),value:e.algolia_admin_api_key,onChange:e=>{t("algolia_admin_api_key",e)}}),(0,o.jsx)(p.TextControl,{label:Y("Search-Only API Key","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add your Algolia Search-Only API Key here. This is the only key that will be visible on your static site.","simply-static"),disabled:"free"===options.plan||!s(),value:e.algolia_search_api_key,onChange:e=>{t("algolia_search_api_key",e)}}),(0,o.jsx)(p.TextControl,{label:Y("Name for your index","simply-static"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add your Algolia index name here.","simply-static"),disabled:"free"===options.plan||!s(),value:e.algolia_index,onChange:e=>{t("algolia_index",e)}}),(0,o.jsx)(p.TextControl,{label:Y("CSS-Selector","simply-static"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add the CSS selector for the element that contains your search input field.","simply-static"),disabled:"free"===options.plan||!s(),value:e.algolia_selector,onChange:e=>{t("algolia_selector",e)}}),(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:Y("If you have multiple search elements with different CSS selectors, separate them by a comma (,) such as: .search-form, .custom-search-form","simply-static")})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:Y("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:"pro"===options.plan&&s()&&(0,o.jsx)(p.Button,{onClick:()=>{n(),r(!0),setTimeout(function(){r(!1)},2e3)},variant:"primary",children:Y("Save Settings","simply-static")})})]})},{__:Q}=wp.i18n,Z=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isPro:c,isStudio:d}=(0,i.useContext)(l),[u,m]=(0,i.useState)(!1),[h,g]=(0,i.useState)(!1),[x,f]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null);return(0,i.useEffect)(()=>{e.debugging_mode&&m(e.debugging_mode),e.server_cron&&g(e.server_cron)},[e]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[Q("Basic Auth","simply-static"),(0,o.jsx)(H,{title:Q("How to set up basic auth","simply-static"),videoUrl:"https://youtu.be/6udSR3_zSOU"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:Q("If you've secured WordPress with HTTP Basic Auth you need to specify the username and password to use below.","simply-static")}),(0,o.jsx)(p.TextControl,{label:Q("Basic Auth Username","simply-static"),autoComplete:"off",type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.http_basic_auth_username,onChange:e=>{t("http_basic_auth_username",e)}}),(0,o.jsx)(p.TextControl,{label:Q("Basic Auth Password","simply-static"),type:"password",autoComplete:"off",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.http_basic_auth_password,onChange:e=>{t("http_basic_auth_password",e)}}),(0,o.jsx)(p.ToggleControl,{label:Q("Enable Basic Auth","simply-static"),__nextHasNoMarginBottom:!0,help:(0,o.jsx)(o.Fragment,{children:"free"===options.plan?(0,o.jsx)(o.Fragment,{children:Q("Automatically setting up Basic Auth requires Simply Static Pro.","simply-static")}):(0,o.jsx)(o.Fragment,{children:Q("Once enabled we will put your entire website behind password protection.","simply-static")})}),disabled:"free"===options.plan||!c(),checked:!!e.http_basic_auth_on,onChange:e=>{t("http_basic_auth_on",e)}}),e.http_basic_auth_on&&(!e.http_basic_auth_username||!e.http_basic_auth_password)&&(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:Q("Requires Username & Password to work","simply-static")})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Q("Temporary Files","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[d()&&(0,o.jsx)(L,{heading:Q("Temporary files are managed by Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:Q("Studio provisions and cleans up build storage automatically for each environment, so there is no temporary directory to configure.","simply-static")})}),(0,o.jsx)(p.TextControl,{label:Q("Temporary Files Directory","simply-static"),type:"text",placeholder:options.temp_files_dir,help:Q("Optionally specify the directory to save your temporary files. This directory must exist and be writeable.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:d(),value:e.temp_files_dir,onChange:e=>{t("temp_files_dir",e)}}),y&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Notice,{status:y.type,isDismissible:!0,onRemove:()=>b(null),children:y.message}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)(p.Button,{isSecondary:!0,onClick:async()=>{f(!0),b(null);try{const e=await r()({path:"/simplystatic/v1/clear-temp-files",method:"POST"});let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){}if(t&&200===t.status)b({type:"success",message:Q("Temporary files cleared.","simply-static")});else{const e=t&&t.message?t.message:Q("Could not clear temporary files.","simply-static");b({type:"error",message:e})}}catch(e){b({type:"error",message:Q("Request failed. Please try again.","simply-static")})}finally{f(!1)}},disabled:d()||x,isBusy:x,children:Q(x?"Clearing…":"Clear Temporary Files","simply-static")})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Q("Whitelist Plugins","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.TextareaControl,{label:Q("Whitelist plugins in diagnostics","simply-static"),placeholder:"autoptimize\nwp-search-with-algolia\nwp-rocket",help:Q("If you want to exclude certain plugins from the diagnostics check add the plugin slugs here (one per line).","simply-static"),__nextHasNoMarginBottom:!0,value:e.whitelist_plugins,onChange:e=>{t("whitelist_plugins",e)}})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Q("Proxy Setup","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[d()&&(0,o.jsx)(L,{heading:Q("Proxy setup is handled by Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:Q("Studio already knows the WordPress origin and public Studio URL for this environment, so you do not need to configure a proxy URL manually.","simply-static")})}),(0,o.jsx)(p.TextControl,{label:Q("Origin URL","simply-static"),type:"url",help:Q("If the URL of your WordPress installation differs from the public-facing URL (Proxy Setup), add the public URL here.","simply-static"),placeholder:options.home,autoComplete:"off",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:d(),value:e.origin_url,onChange:e=>{t("origin_url",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Q("Debug Log","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.ToggleControl,{label:Q("Activate Debug Log","simply-static"),help:Q("Enable it to download the debug log from Simply Static -> Generate.","simply-static"),__nextHasNoMarginBottom:!0,checked:u,onChange:e=>{m(e),t("debugging_mode",e)}})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Q("Cron","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[d()&&(0,o.jsx)(L,{heading:Q("Cron is automatic on Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:Q("Studio starts builds automatically when your site changes, so you do not need a server-side cron job to trigger exports.","simply-static")})}),(0,o.jsx)(p.ToggleControl,{label:Q("Use server-side cron job","simply-static"),help:Q("Enable this if you use a server-side cron job instead of the default WP-Cron.","simply-static"),__nextHasNoMarginBottom:!0,disabled:d(),checked:h,onChange:e=>{g(e),t("server_cron",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:Q("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:(0,o.jsx)(p.Button,{onClick:()=>{n(),s(!0),setTimeout(function(){s(!1)},2e3)},variant:"primary",children:Q("Save Settings","simply-static")})})]})},{__:ee}=wp.i18n,te=function({integration:e,settings:t,toggleIntegration:n}){let i=e.active;const a=e.pro,r=e.can_run,s=e.always_active;void 0!==t.integrations&&!1!==t.integrations&&(i=t.integrations.indexOf(e.id)>=0);let l="pro"===options.plan||!a;const c="ss-adminbar"===e.id;let d=!1;c&&void 0!==t.integrations&&!1!==t.integrations&&(d=t.integrations.indexOf("ss-command-center")>=0);const u=c&&d;return(0,o.jsx)(p.Card,{children:(0,o.jsx)(p.CardHeader,{className:"ss-integration",children:(0,o.jsxs)(p.Flex,{align:"flex-start",justify:"space-between",children:[(0,o.jsxs)(p.FlexBlock,{style:{flex:"0 0 70%",maxWidth:"70%"},children:[(0,o.jsxs)("strong",{children:[e.name||e.id,"redirection"===e.id&&(0,o.jsx)(H,{title:ee("Automated Redirects with Redirection","simply-static"),videoUrl:"https://youtu.be/sS4BQcZ4dN8"}),"complianz"===e.id&&(0,o.jsx)(H,{title:ee("Cookie Consent with Complianz","simply-static"),videoUrl:"https://youtu.be/GPKYtt8A5QE"})]}),""!==e.description&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("br",{}),e.description]})]}),(0,o.jsxs)(p.FlexBlock,{style:{flex:"0 0 30%",maxWidth:"30%"},className:"ss-align-right ss-no-shrink",children:[!r&&(0,o.jsxs)("span",{children:[(0,o.jsx)("em",{children:"Missing Plugin"}),!l&&(0,o.jsx)("div",{children:(0,o.jsx)(p.Button,{variant:"link",href:"https://simplystatic.com/pricing/",children:ee("Requires Simply Static Pro","simply-static")})})]}),r&&l&&!s&&(0,o.jsxs)(p.Flex,{justify:"flex-end",direction:"column",style:{alignItems:"flex-end"},children:[(0,o.jsx)(p.ToggleControl,{className:"integration-toggle",__nextHasNoMarginBottom:!0,checked:!u&&i,disabled:u,onChange:t=>{n(e.id,t)}}),u&&(0,o.jsx)("em",{style:{fontSize:"12px",color:"#757575"},children:ee("Disabled by Command Center","simply-static")})]}),r&&l&&s&&(0,o.jsx)("em",{children:"Always Active"}),r&&!l&&(0,o.jsx)(p.Button,{variant:"primary",href:"https://simplystatic.com/pricing/",children:ee("Get the Pro version","simply-static")})]})]})})})},{__:ne}=wp.i18n,ie=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:r,maybeQueueIntegration:s}=(0,i.useContext)(l),c=(n,i)=>{i?(n=>{let i=e.integrations;!1===i&&(i=[]),i.indexOf(n)>=0||(i.push(n),t("integrations",i),s(n))})(n):(n=>{let i=e.integrations;!1===i&&(i=[]);const a=i.indexOf(n);a<0||(i.splice(a,1),t("integrations",i),s(n))})(n)},d=Object.keys(options.integrations).filter(e=>options.integrations[e].can_run&&!options.integrations[e].always_active),u=Object.keys(options.integrations).filter(e=>!options.integrations[e].can_run&&!options.integrations[e].always_active);return(0,o.jsxs)("div",{className:"inner-settings",children:[d.map(t=>{const n=options.integrations[t];return(0,o.jsx)(te,{integration:n,settings:e,toggleIntegration:c},n.id||t)}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),u.map(t=>{const n=options.integrations[t];return(0,o.jsx)(te,{integration:n,settings:e,toggleIntegration:c},n.id||t)}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:ne("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:(0,o.jsx)(p.Button,{onClick:async()=>{try{const{shouldReload:e}=await n();if(r(!0),e)return void setTimeout(()=>{try{if("undefined"!=typeof window){const e="/integrations";if(window.localStorage)try{window.localStorage.setItem("ss-initial-page",e)}catch(e){}}}catch(e){}window.location.reload()},400)}catch(e){}setTimeout(function(){r(!1)},2e3)},variant:"primary",children:ne("Save Settings","simply-static")})})]})},{__:ae}=wp.i18n,re=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:r}=(0,i.useContext)(l),[s,c]=(0,i.useState)({}),d="undefined"!=typeof options&&options.current_settings&&options.current_settings.ss_uam_access?options.current_settings.ss_uam_access:{},u=(0,i.useMemo)(()=>[{label:ae("Administrator","simply-static"),value:"administrator"},{label:ae("Editor","simply-static"),value:"editor"},{label:ae("Author","simply-static"),value:"author"},{label:ae("Contributor","simply-static"),value:"contributor"},{label:ae("Subscriber","simply-static"),value:"subscriber"}],[]),m=(0,i.useMemo)(()=>[{key:"activity",label:ae("Activity Log","simply-static"),route:"/"},{key:"diagnostics",label:ae("Diagnostics","simply-static"),route:"/diagnostics"}],[]),h=(0,i.useMemo)(()=>[{key:"general",label:ae("General","simply-static"),route:"/general"},{key:"deployment",label:ae("Deploy","simply-static"),route:"/deployment"},{key:"forms",label:ae("Forms","simply-static"),route:"/forms"},{key:"search",label:ae("Search","simply-static"),route:"/search"},{key:"optimize",label:ae("Optimize","simply-static"),route:"/optimize"},{key:"hide-wp",label:ae("Hide WP","simply-static"),route:"/hide-wp"},{key:"workflow",label:ae("Workflow","simply-static"),route:"/workflow"}],[]),g=(0,i.useMemo)(()=>[{key:"integrations",label:ae("Integrations","simply-static"),route:"/integrations"},{key:"utilities",label:ae("Utilities","simply-static"),route:"/utilities"},{key:"debug",label:ae("Debug","simply-static"),route:"/debug"},{key:"uam",label:ae("UAM","simply-static"),route:"/uam"}],[]),x=(0,i.useMemo)(()=>{const t=[{key:"menu_generate",label:ae("Generate","simply-static")},{key:"menu_settings",label:ae("Settings","simply-static")},{key:"menu_diagnostics",label:ae("Diagnostics","simply-static")},{key:"menu_form_connections",label:ae("Form Connections","simply-static")}];return e?.ss_use_builds&&t.push({key:"menu_builds",label:ae("Builds","simply-static")}),t},[e?.ss_use_builds]);(0,i.useEffect)(()=>{c({...e?.ss_uam_access||{}})},[e]);const f=(e,n)=>{const i={...s,[e]:n};c(i),t("ss_uam_access",i)},y=({id:e,label:t,value:n,onChange:i})=>(0,o.jsxs)(p.Flex,{align:"center",gap:3,children:[(0,o.jsx)(p.FlexItem,{style:{minWidth:260},children:(0,o.jsx)("b",{id:`${e}-label`,children:t})}),(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.SelectControl,{"aria-label":t,value:n,options:u,onChange:i})})]}),b=(e,t)=>s&&Object.prototype.hasOwnProperty.call(s,e)&&s[e]?s[e]:d&&Object.prototype.hasOwnProperty.call(d,e)&&d[e]?d[e]:t;return(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("UAM (User Access Management)","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)("p",{children:ae("Control who can access Simply Static pages, menu entries, and selected features by assigning a minimum WordPress role.","simply-static")})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("Tools","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.Flex,{direction:"column",gap:3,children:m.map(e=>{const t="activity"===e.key?"editor":"administrator";return(0,o.jsx)(y,{id:`uam-${e.key}`,label:e.label,value:b(e.key,t),onChange:t=>f(e.key,t)},e.key)})})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("Settings","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.Flex,{direction:"column",gap:3,children:h.map(e=>(0,o.jsx)(y,{id:`uam-${e.key}`,label:e.label,value:b(e.key,"administrator"),onChange:t=>f(e.key,t)},e.key))})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("Advanced","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.Flex,{direction:"column",gap:3,children:g.map(e=>(0,o.jsx)(y,{id:`uam-${e.key}`,label:e.label,value:b(e.key,"administrator"),onChange:t=>f(e.key,t)},e.key))})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("Menu","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.Flex,{direction:"column",gap:3,children:x.map(e=>{const t="menu_generate"===e.key?"editor":"administrator";return(0,o.jsx)(y,{id:`uam-${e.key}`,label:e.label,value:b(e.key,t),onChange:t=>f(e.key,t)},e.key)})})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("Features","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsxs)(p.Flex,{direction:"column",gap:3,children:[(0,o.jsx)(y,{id:"uam-adminbar",label:ae("Admin Bar","simply-static"),value:b("adminbar","editor"),onChange:e=>f("adminbar",e)}),(0,o.jsx)(y,{id:"uam-single-export",label:ae("Single Export (Button)","simply-static"),value:b("single_export_button","editor"),onChange:e=>f("single_export_button",e)})]})})]}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:ae("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:(0,o.jsx)(p.Button,{onClick:()=>{n(),r(!0),setTimeout(function(){r(!1)},2e3)},variant:"primary",children:ae("Save Settings","simply-static")})})]})};function se(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,a,r=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(e){a={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var oe=function(e){var t=e.children;return m().createElement("div",{className:"react-terminal-line"},t)};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("/**\n * Modfied version of [termynal.js](https://github.com/ines/termynal/blob/master/termynal.css).\n *\n * @author Ines Montani \n * @version 0.0.1\n * @license MIT\n */\n .react-terminal-wrapper {\n width: 100%;\n background: #252a33;\n color: #eee;\n font-size: 18px;\n font-family: 'Fira Mono', Consolas, Menlo, Monaco, 'Courier New', Courier, monospace;\n border-radius: 4px;\n padding: 75px 45px 35px;\n position: relative;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n.react-terminal {\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n\n.react-terminal-wrapper.react-terminal-light {\n background: #ddd;\n color: #1a1e24;\n}\n\n.react-terminal-window-buttons {\n position: absolute;\n top: 15px;\n left: 15px;\n display: flex;\n flex-direction: row;\n gap: 10px;\n}\n\n.react-terminal-window-buttons button {\n width: 15px;\n height: 15px;\n border-radius: 50%;\n border: 0;\n}\n\n.react-terminal-window-buttons button.clickable {\n cursor: pointer;\n}\n\n.react-terminal-window-buttons button.red-btn {\n background: #d9515d;\n}\n\n.react-terminal-window-buttons button.yellow-btn {\n background: #f4c025;\n}\n\n.react-terminal-window-buttons button.green-btn {\n background: #3ec930;\n}\n\n.react-terminal-wrapper:after {\n content: attr(data-terminal-name);\n position: absolute;\n color: #a2a2a2;\n top: 5px;\n left: 0;\n width: 100%;\n text-align: center;\n pointer-events: none;\n}\n\n.react-terminal-wrapper.react-terminal-light:after {\n color: #D76D77;\n}\n\n.react-terminal-line {\n white-space: pre;\n}\n\n.react-terminal-line:before {\n /* Set up defaults and ensure empty lines are displayed. */\n content: '';\n display: inline-block;\n vertical-align: middle;\n color: #a2a2a2;\n}\n\n.react-terminal-light .react-terminal-line:before {\n color: #D76D77;\n}\n\n.react-terminal-input:before {\n margin-right: 0.75em;\n content: '$';\n}\n\n.react-terminal-input[data-terminal-prompt]:before {\n content: attr(data-terminal-prompt);\n}\n\n.react-terminal-wrapper:focus-within .react-terminal-active-input .cursor {\n position: relative;\n display: inline-block;\n width: 0.55em;\n height: 1em;\n top: 0.225em;\n background: #fff;\n -webkit-animation: blink 1s infinite;\n animation: blink 1s infinite;\n}\n\n/* Cursor animation */\n\n@-webkit-keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n\n@keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n\n.terminal-hidden-input {\n position: fixed;\n left: -1000px;\n}\n\n/* .react-terminal-progress {\n display: flex;\n margin: .5rem 0;\n}\n\n.react-terminal-progress-bar {\n background-color: #fff;\n border-radius: .25rem;\n width: 25%;\n}\n\n.react-terminal-wrapper.react-terminal-light .react-terminal-progress-bar {\n background-color: #000;\n} */\n");var le,ce,de=function(e){var t=e.redBtnCallback,n=e.yellowBtnCallback,i=e.greenBtnCallback;return m().createElement("div",{className:"react-terminal-window-buttons"},m().createElement("button",{className:"".concat(n?"clickable":""," red-btn"),disabled:!t,onClick:t}),m().createElement("button",{className:"".concat(n?"clickable":""," yellow-btn"),disabled:!n,onClick:n}),m().createElement("button",{className:"".concat(i?"clickable":""," green-btn"),disabled:!i,onClick:i}))};(ce=le||(le={}))[ce.Light=0]="Light",ce[ce.Dark=1]="Dark";var pe=function(e){var t=e.name,n=e.prompt,i=e.height,a=void 0===i?"600px":i,r=e.colorMode,s=e.onInput,o=e.children,l=e.startingInputValue,c=void 0===l?"":l,d=e.redBtnCallback,p=e.yellowBtnCallback,h=e.greenBtnCallback,g=e.TopButtonsPanel,x=void 0===g?de:g,f=se((0,u.useState)(""),2),y=f[0],b=f[1],_=se((0,u.useState)(0),2),v=_[0],w=_[1],S=(0,u.useRef)(null);(0,u.useEffect)(function(){b(c.trim())},[c]),(0,u.useEffect)(function(){var e,t;if(null!=s){var n=[],i=function(e){var t=function(){var t;return null===(t=null==e?void 0:e.querySelector(".terminal-hidden-input"))||void 0===t?void 0:t.focus()};null==e||e.addEventListener("click",t),n.push({terminalEl:e,listener:t})};try{for(var a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(document.getElementsByClassName("react-terminal-wrapper")),r=a.next();!r.done;r=a.next())i(r.value)}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return function(){n.forEach(function(e){e.terminalEl.removeEventListener("click",e.listener)})}}},[s]);var C=["react-terminal-wrapper"];return r===le.Light&&C.push("react-terminal-light"),m().createElement("div",{className:C.join(" "),"data-terminal-name":t},m().createElement(x,{redBtnCallback:d,yellowBtnCallback:p,greenBtnCallback:h}),m().createElement("div",{className:"react-terminal",style:{height:a}},o,"function"==typeof s&&m().createElement("div",{className:"react-terminal-line react-terminal-input react-terminal-active-input","data-terminal-prompt":n||"$",key:"terminal-line-prompt"},y,m().createElement("span",{className:"cursor",style:{left:"".concat(v+1,"px")}})),m().createElement("div",{ref:S})),m().createElement("input",{className:"terminal-hidden-input",placeholder:"Terminal Hidden Input",value:y,autoFocus:null!=s,onChange:function(e){b(e.target.value)},onKeyDown:function(e){var t,n;if(s)if("Enter"===e.key)s(y),w(0),b(""),setTimeout(function(){var e;return null===(e=null==S?void 0:S.current)||void 0===e?void 0:e.scrollIntoView({behavior:"auto",block:"nearest"})},500);else if(["ArrowLeft","ArrowRight","ArrowDown","ArrowUp","Delete"].includes(e.key)){var i=e.currentTarget,a="",r=y.length-(i.selectionStart||0);r=(t=r)>(n=y.length)?n:t<0?0:t,"ArrowLeft"===e.key?(r>y.length-1&&r--,a=y.slice(y.length-1-r)):"ArrowRight"===e.key||"Delete"===e.key?a=y.slice(y.length-r+1):"ArrowUp"===e.key&&(a=y.slice(0));var o=function(e,t){var n=document.createElement("span");n.style.visibility="hidden",n.style.position="absolute",n.style.fontSize=window.getComputedStyle(e).fontSize,n.style.fontFamily=window.getComputedStyle(e).fontFamily,n.innerText=t,document.body.appendChild(n);var i=n.getBoundingClientRect().width;return document.body.removeChild(n),-i}(i,a);w(o)}}}))};const ue=new Set(["http:","https:"]);function me(e){if(e&&"object"==typeof e)return e;if("string"!=typeof e)return null;try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch{return null}}function he(e){return null==e?"":String(e).replace(/<\s*br\s*\/?>/gi," ").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim()}function ge(e){if("string"!=typeof e)return null;const t=e.trim();if(!t)return null;if(/^\/(?!\/)/.test(t))try{const e=new URL("https://simply-static.invalid/"),n=new URL(t,e);if(n.origin!==e.origin)return null;const i=`${n.pathname}${n.search}${n.hash}`;return{href:i,label:i}}catch{return null}if(!/^https?:\/\//i.test(t))return null;try{const e=new URL(t);return ue.has(e.protocol)?e.username||e.password?null:{href:e.href,label:`${e.pathname}${e.search}${e.hash}`||"/"}:null}catch{return null}}const{__:xe}=wp.i18n,fe=function(){const{isRunning:e,isResumed:t,blogId:n,snapshotRollback:a,isRollbackRunning:c}=(0,i.useContext)(l),d=a&&a.message?a.message:xe("Rollback in progress. Simply Static export actions are locked until the rollback has finished.","simply-static"),u=a&&a.progress?a.progress:{},m=u.label?`${u.label}${u.total?` (${u.percent||0}%, ${u.completed||0}/${u.total})`:""}`:d,[h,g]=(0,i.useState)([(0,o.jsx)(oe,{children:xe("Waiting for new push…","simply-static")},"waiting")]),x=(0,i.useRef)({blogId:null,controller:null,promise:null,queued:!1,sequence:0}),f=(0,i.useRef)(!0),y=(0,i.useCallback)(()=>{if(x.current.promise&&x.current.blogId===n)return x.current.queued=!0,x.current.promise;const e="undefined"!=typeof AbortController?new AbortController:null,t=x.current.sequence+1,i={path:"/simplystatic/v1/activity-log?blog_id="+n+"&is_network_admin="+options.is_network,method:"GET"};e&&(i.signal=e.signal);const a=r()(i).then(e=>{const n=me(e);if(!n||!n.data||"object"!=typeof n.data)return;if(!f.current||t!==x.current.sequence)return;const i=Object.entries(n.data).map(([e,t])=>{const n=t&&"object"==typeof t?t:{},i=he(n.datetime),a=function(e){const t=null==e?"":String(e),n={before:he(t),after:"",link:null},i=t.match(/^([\s\S]*?)]*?)>([^<>]*)<\/a>([\s\S]*?)$/i);if(!i)return n;const a=i[1],r=i[2],s=he(i[3]),o=i[4];if(/[<>]/.test(a+o)||!s)return n;const l=function(e){const t=new Set(["href","target","rel"]),n={};let i=e;for(;i.length;){const e=i.match(/^\s+([a-z][a-z0-9_-]*)\s*=\s*(["'])(.*?)\2/i);if(!e)return null;const a=e[1].toLowerCase();if(!t.has(a)||Object.prototype.hasOwnProperty.call(n,a))return null;n[a]=e[3],i=i.slice(e[0].length)}if(n.target&&"_blank"!==n.target.toLowerCase())return null;if(n.rel){const e=n.rel.toLowerCase().split(/\s+/).filter(Boolean);if(!e.includes("noopener")||e.some(e=>!["noopener","noreferrer"].includes(e)))return null}return n}(r);if(!l||!l.href)return n;const c=l.href.replace(/&(?:amp|#0*38|#x0*26);/gi,"&").trim();if(!/^https?:\/\//i.test(c))return n;const d=ge(c);return d&&/^https?:\/\//i.test(d.href)?{before:he(a),after:he(o),link:{href:d.href,label:s}}:n}(n.message),r=e.includes("pause")||e.includes("cancel"),s=e.includes("resume");return(0,o.jsxs)(oe,{children:["[",i,"]"," ",(0,o.jsxs)("span",{className:`${r?"is-error":""} ${s?"is-success":""}`,children:[a.before,a.before&&a.link?" ":null,a.link&&(0,o.jsx)("a",{href:a.link.href,target:"_blank",rel:"noopener noreferrer",children:a.link.label}),a.after&&(a.before||a.link)?" ":null,a.after]})]},e)});g(i)}).catch(e=>{!e||e.name}).finally(()=>{if(t===x.current.sequence){const e=x.current.queued;x.current={blogId:n,controller:null,promise:null,queued:!1,sequence:t},e&&f.current&&y()}});return x.current={blogId:n,controller:e,promise:a,queued:!1,sequence:t},a},[n]);return(0,i.useEffect)(()=>(f.current=!0,()=>{f.current=!1,x.current.controller&&x.current.controller.abort()}),[]),s(()=>{y()},e?2500:null),(0,i.useEffect)(()=>{e&&!t&&g([(0,o.jsx)(oe,{children:xe("Waiting for new push…","simply-static")},"waiting")]),e&&t&&g([(0,o.jsx)(oe,{children:xe("Resuming the push…","simply-static")},"resuming")]),y()},[e,t,y]),(0,o.jsxs)(o.Fragment,{children:[c&&(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,className:"rollback-lock-notice",children:(0,o.jsxs)("p",{children:[(0,o.jsx)(p.Dashicon,{icon:"update"}),(0,o.jsx)("strong",{children:xe("Rollback in progress","simply-static")}),(0,o.jsx)("span",{children:m})]})}),(0,o.jsx)(pe,{name:xe("Activity Log","simply-static"),height:"250px",colorMode:le.Dark,children:h})]})};!function(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===t&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}(".rdt_table{position:relative;box-sizing:border-box;display:flex;flex-direction:column;width:100%;height:100%;max-width:100%;min-width:fit-content;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-bg, #fff);font-family:var(--rdt-font-family, inherit);color-scheme:var(--rdt-color-scheme, light);--rdt-sort-icon-size: calc(var(--rdt-icon-size, 18px) * .8)}.rdt_tableDisabled{pointer-events:none;opacity:.4}.rdt_wrapper{position:relative;width:100%;min-width:fit-content}.rdt_responsiveWrapper{position:relative;width:100%;border-radius:inherit}.rdt_responsiveWrapperScroll{overflow-x:auto;overflow-y:hidden;min-height:0;overscroll-behavior-x:contain;touch-action:pan-x pan-y;-webkit-overflow-scrolling:touch}.rdt_responsiveWrapperFixed{overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch;min-height:0;overscroll-behavior-x:contain;touch-action:pan-x pan-y}.rdt_responsiveWrapperHideScrollbar{scrollbar-width:none}.rdt_responsiveWrapperHideScrollbar::-webkit-scrollbar{display:none}.rdt_pinnedScrollbarTrack{position:relative;height:8px;background:var(--rdt-color-bg, #fff);cursor:pointer;user-select:none}.rdt_pinnedScrollbarThumb{position:absolute;top:1px;left:0;height:6px;border-radius:3px;background:var(--rdt-color-scrollbar-thumb, rgba(0, 0, 0, .25));cursor:grab;transition:background .15s}.rdt_pinnedScrollbarThumb:hover,.rdt_pinnedScrollbarThumb:active{background:var(--rdt-color-scrollbar-thumb-hover, rgba(0, 0, 0, .45))}.rdt_head{display:flex;flex-direction:column;width:100%;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));font-size:var(--rdt-font-size-header, 12px);font-weight:500}.rdt_headFixed{position:sticky;top:0;z-index:1}.rdt_headRow{display:flex;align-items:stretch;width:100%;min-height:var(--rdt-header-height, 52px);background-color:var(--rdt-color-header-bg, var(--rdt-color-bg, #fff));border-bottom:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12))}.rdt_headRowDense{min-height:32px}.rdt_body{display:flex;flex-direction:column}.rdt_row{display:flex;align-items:stretch;align-content:stretch;width:100%;box-sizing:border-box;font-size:var(--rdt-font-size, 13px);font-weight:400;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-bg, #fff);min-height:var(--rdt-row-height, 48px)}.rdt_row:not(:last-of-type) .rdt_cellBase,.rdt_row:not(:last-of-type) .rdt_rightPinSpacer{border-bottom:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12))}.rdt_rowDense{min-height:32px}.rdt_rowStriped{color:var(--rdt-color-striped-text, rgba(0, 0, 0, .87));background-color:var(--rdt-color-striped, #fafafa)}.rdt_rowSelected{color:var(--rdt-color-selected-text, rgba(0, 0, 0, .87));background-color:var(--rdt-color-selected, #e3f2fd)}.rdt_rowHighlight:hover{color:var(--rdt-color-highlight-text, rgba(0, 0, 0, .87));background-color:var(--rdt-color-highlight, #eee);outline:1px solid var(--rdt-color-bg, #fff);transition-duration:.15s;transition-property:background-color}.rdt_rowPointer:hover{cursor:pointer}.rdt_cellBase{position:relative;display:flex;align-items:center;box-sizing:border-box;line-height:normal;padding-left:var(--rdt-cell-padding-x, 16px);padding-right:var(--rdt-cell-padding-x, 16px);word-break:break-word}.rdt_headSeparator .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_cellBaseHead:not(.rdt_groupCell):before,.rdt_headSeparatorFull .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_cellBaseHead:not(.rdt_groupCell):before,.rdt_colSeparator .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_cellBase:not(.rdt_cellBaseHead):before,.rdt_colSeparatorFull .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_cellBase:not(.rdt_cellBaseHead):before,.rdt_headSeparator .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_rightPinSpacer:before,.rdt_headSeparatorFull .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_rightPinSpacer:before,.rdt_colSeparator .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_rightPinSpacer:before,.rdt_colSeparatorFull .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_rightPinSpacer:before{content:\"\";position:absolute;inset-inline-start:0;top:var(--_sep-top, 20%);height:var(--_sep-h, 60%);width:1px;background:var(--rdt-col-sep-color, var(--rdt-color-divider, rgba(0, 0, 0, .12)));pointer-events:none}.rdt_headSeparatorFull .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_cellBaseHead:not(.rdt_groupCell):before,.rdt_colSeparatorFull .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_cellBase:not(.rdt_cellBaseHead):before,.rdt_headSeparatorFull .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_rightPinSpacer:before,.rdt_colSeparatorFull .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_rightPinSpacer:before{--_sep-top: 0;--_sep-h: 100%}.rdt_rightPinSpacer{position:relative;overflow:hidden}.rdt_cellNoPadding{padding:0}.rdt_Checkbox{position:relative;display:inline-flex;flex-shrink:0;width:var(--rdt-checkbox-size, 18px);height:var(--rdt-checkbox-size, 18px);cursor:pointer}.rdt_Checkbox.rdt_disabled{cursor:default;opacity:.38}.rdt_Checkbox>input[type=checkbox]{position:absolute;opacity:0;inset:0;margin:0;width:100%;height:100%;cursor:inherit;z-index:1}.rdt_Checkbox:before{content:\"\";position:absolute;inset:0;box-sizing:border-box;border-radius:var(--rdt-checkbox-radius, 2px);border:2px solid currentColor;opacity:.54;background:transparent;transition:background .15s,border-color .15s,opacity .15s}.rdt_Checkbox.rdt_checked:before,.rdt_Checkbox.rdt_indeterminate:before{background:var(--rdt-color-primary, #1976d2);border-color:var(--rdt-color-primary, #1976d2);opacity:1}.rdt_Checkbox:after{content:\"\";position:absolute;inset:0;background-repeat:no-repeat;background-position:center;pointer-events:none}.rdt_Checkbox.rdt_checked:after{background-image:url(\"data:image/svg+xml,\")}.rdt_Checkbox.rdt_indeterminate:after{background-image:url(\"data:image/svg+xml,\")}.rdt_cellCheckbox{flex:0 0 var(--rdt-system-col-width, 48px);min-width:var(--rdt-system-col-width, 48px);justify-content:center;align-items:center;user-select:none;white-space:nowrap}.rdt_cellExpander{white-space:nowrap;font-weight:400;min-width:var(--rdt-system-col-width, 48px)}.rdt_columnCheckbox{flex:0 0 var(--rdt-system-col-width, 48px);justify-content:center;align-items:center;user-select:none;white-space:nowrap;font-size:unset}.rdt_columnExpander{white-space:nowrap;min-width:var(--rdt-system-col-width, 48px)}.rdt_columnSortable{display:inline-flex;align-items:center;justify-content:inherit;height:100%;width:100%;outline:none;user-select:none;overflow:hidden}.rdt_columnSortableEnabled{cursor:pointer}.rdt_columnSortableEnabled:not(.rdt_columnSortableActive):hover,.rdt_columnSortableEnabled:not(.rdt_columnSortableActive):focus{opacity:.7}.rdt_columnSortableEnabled:not(.rdt_columnSortableActive):hover span,.rdt_columnSortableEnabled:not(.rdt_columnSortableActive):focus span{opacity:.7}.rdt_columnText{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.rdt_filterContainer{position:relative;display:inline-flex;align-items:center;margin-inline-start:4px;flex-shrink:0}.rdt_filterIcon{display:inline-flex;align-items:center;justify-content:center;position:relative;background:none;border:none;cursor:pointer;color:var(--rdt-color-btn, rgba(0, 0, 0, .54));border-radius:50%;width:22px;height:22px;padding:0;transition:background-color .2s,color .2s;touch-action:manipulation}.rdt_filterIcon:hover,.rdt_filterIcon:focus{background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .08));outline:none}.rdt_filterIconActive{color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87))}.rdt_filterDot{position:absolute;top:3px;inset-inline-end:3px;width:5px;height:5px;border-radius:50%;background-color:var(--rdt-color-primary, #1976d2);pointer-events:none}.rdt_filterPanel{z-index:9999;display:flex;flex-direction:column;gap:6px;background:var(--rdt-color-bg, #fff);border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .18));border-radius:var(--rdt-border-radius, 6px);box-shadow:0 4px 16px #00000024;padding:10px;min-width:260px;max-width:calc(100vw - 24px);box-sizing:border-box}.rdt_filterConditionRow{display:flex;align-items:center;gap:4px}.rdt_filterSelect{flex:0 0 auto;font-size:12px;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background:var(--rdt-color-bg, #fff);border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .24));border-radius:calc(var(--rdt-border-radius, 6px) * .6);padding:3px 4px;cursor:pointer;max-width:140px}.rdt_filterSelect:focus{outline:2px solid var(--rdt-color-primary, #1976d2);outline-offset:-1px}.rdt_filterInput{flex:1;min-width:0;font-size:12px;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background:var(--rdt-color-bg, #fff);border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .24));border-radius:calc(var(--rdt-border-radius, 6px) * .6);padding:3px 6px}.rdt_filterInput:focus{outline:2px solid var(--rdt-color-primary, #1976d2);outline-offset:-1px}.rdt_filterBetweenSep{font-size:11px;color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));white-space:nowrap}.rdt_filterRemoveBtn{background:none;border:none;cursor:pointer;color:var(--rdt-color-btn, rgba(0, 0, 0, .54));font-size:11px;padding:2px 4px;border-radius:3px;line-height:1}.rdt_filterRemoveBtn:hover{background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .08))}.rdt_filterLogicRow{display:flex;gap:4px}.rdt_filterLogicBtn{font-size:11px;font-weight:600;padding:2px 8px;border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .24));border-radius:3px;background:none;cursor:pointer;color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54))}.rdt_filterLogicBtnActive{background-color:var(--rdt-color-primary, #1976d2);border-color:var(--rdt-color-primary, #1976d2);color:#fff}.rdt_filterAddCondition{background:none;border:none;cursor:pointer;font-size:12px;color:var(--rdt-color-primary, #1976d2);padding:0;text-align:left}.rdt_filterAddCondition:hover{text-decoration:underline}.rdt_filterActions{display:flex;justify-content:flex-end;gap:6px;padding-top:4px;border-top:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12));margin-top:2px}.rdt_filterBtn{font-size:12px;padding:4px 12px;border-radius:4px;border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .24));background:none;cursor:pointer;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87))}.rdt_filterBtn:hover{background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .06))}.rdt_filterBtnPrimary{background-color:var(--rdt-color-primary, #1976d2);border-color:var(--rdt-color-primary, #1976d2);color:#fff}.rdt_filterBtnPrimary:hover{background-color:#1565c0}@supports (background-color: color-mix(in srgb,red 1%,black)){.rdt_filterBtnPrimary:hover{background-color:color-mix(in srgb,var(--rdt-color-primary, #1976d2) 85%,black)}}.rdt_kebabIcon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;position:relative;background:none;border:none;cursor:pointer;color:var(--rdt-color-btn, rgba(0, 0, 0, .54));border-radius:50%;width:22px;height:22px;padding:0;margin-inline-start:4px;transition:background-color .2s,color .2s;touch-action:manipulation}.rdt_kebabIcon:hover,.rdt_kebabIcon:focus{background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .08));outline:none}.rdt_contextMenu{z-index:9999;display:flex;flex-direction:column;min-width:180px;max-width:calc(100vw - 24px);padding:4px;box-sizing:border-box;background:var(--rdt-color-bg, #fff);border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .18));border-radius:var(--rdt-border-radius, 6px);box-shadow:0 4px 16px #00000024}.rdt_contextMenuItem{display:flex;align-items:center;gap:8px;width:100%;background:none;border:none;border-radius:calc(var(--rdt-border-radius, 6px) * .6);padding:6px 10px;font-size:13px;text-align:start;cursor:pointer;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87))}.rdt_contextMenuItem:hover:not(:disabled),.rdt_contextMenuItem:focus{background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .08));outline:none}.rdt_contextMenuItem:disabled{color:var(--rdt-color-btn-disabled, rgba(0, 0, 0, .34));cursor:default}.rdt_contextMenuItemIcon{display:inline-flex;align-items:center}.rdt_contextMenuSeparator{height:1px;margin:4px 6px;background:var(--rdt-color-divider, rgba(0, 0, 0, .12))}.rdt_rowKebabCell{position:sticky;inset-inline-end:8px;align-self:center;display:flex;justify-content:center;align-items:center;width:34px;margin-inline-start:-34px;overflow:visible;z-index:2;background-color:inherit}.rdt_rowKebabCell.rdt_rowKebabStart{inset-inline-end:auto;inset-inline-start:8px;margin-inline-start:0;margin-inline-end:-34px;order:-1}.rdt_rowKebab{opacity:0}.rdt_row:hover .rdt_rowKebab,.rdt_row:focus-within .rdt_rowKebab{opacity:1}@media(hover:none){.rdt_rowKebab{opacity:1}}.rdt_dragGhost{position:fixed;top:-9999px;left:-9999px;display:flex;align-items:center;gap:8px;padding:0 var(--rdt-cell-padding-x, 16px);box-sizing:border-box;background:var(--rdt-color-bg, #fff);color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12));border-radius:calc(var(--rdt-border-radius, 6px) * .5);font-size:var(--rdt-font-size-header, 12px);font-weight:500;white-space:nowrap;overflow:hidden;box-shadow:0 4px 16px #0000002e;pointer-events:none;opacity:.96}.rdt_dragGhostIcon{display:flex;align-items:center;flex-shrink:0;opacity:.45}.rdt_dragGhostLabel{overflow:hidden;text-overflow:ellipsis}.rdt_TableCol[draggable=true]{cursor:grab;user-select:none}.rdt_TableCol[draggable=true]:active{cursor:grabbing}.rdt_cellEditable{cursor:text;transition:background-color .15s}.rdt_cellEditable:hover{background-color:var(--rdt-color-cell-edit-hover, rgba(25, 118, 210, .06))}@supports (background-color: color-mix(in srgb,red 1%,transparent)){.rdt_cellEditable:hover{background-color:var(--rdt-color-cell-edit-hover, color-mix(in srgb, var(--rdt-color-primary, #1976d2) 6%, transparent))}}.rdt_cellEditable:hover>div[data-tag]{border-bottom:1px dashed var(--rdt-color-cell-edit-hover-border, rgba(25, 118, 210, .4));margin-bottom:-1px}@supports (border-color: color-mix(in srgb,red 1%,transparent)){.rdt_cellEditable:hover>div[data-tag]{border-bottom-color:var(--rdt-color-cell-edit-hover-border, color-mix(in srgb, var(--rdt-color-primary, #1976d2) 40%, transparent))}}.rdt_cellEditing{background-color:var(--rdt-color-cell-edit-bg, rgba(25, 118, 210, .08));box-shadow:inset 0 0 0 2px var(--rdt-color-primary, #1976d2);z-index:3;align-items:stretch;padding-top:0;padding-bottom:0}.rdt_row:not(:last-of-type) .rdt_cellEditing{border-bottom-color:transparent}@supports (background-color: color-mix(in srgb,red 1%,white)){.rdt_cellEditing{background-color:var(--rdt-color-cell-edit-bg, color-mix(in srgb, var(--rdt-color-primary, #1976d2) 8%, var(--rdt-color-bg, #fff)))}}.rdt_editInput,.rdt_editSelect{display:block;box-sizing:border-box;width:calc(100% + 2 * var(--rdt-cell-padding-x, 16px));min-height:var(--rdt-row-height, 48px);align-self:stretch;margin:0 calc(-1 * var(--rdt-cell-padding-x, 16px));padding:0 var(--rdt-cell-padding-x, 16px);font:inherit;color:inherit;background:transparent;border:none;outline:none;appearance:none;-webkit-appearance:none}.rdt_editInput::placeholder{color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));opacity:.7}.rdt_cellEditing:has(.rdt_editSelect):after{content:\"\";position:absolute;inset-inline-end:var(--rdt-cell-padding-x, 16px);top:50%;transform:translateY(-50%);width:12px;height:8px;pointer-events:none;background-color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));mask-image:url(\"data:image/svg+xml,\");mask-size:100% 100%;-webkit-mask-image:url(\"data:image/svg+xml,\");-webkit-mask-size:100% 100%}.rdt_editSelect{padding-inline-end:calc(var(--rdt-cell-padding-x, 16px) + 24px)}.rdt_rowDense .rdt_editInput,.rdt_rowDense .rdt_editSelect{min-height:32px}.rdt_editCheckboxWrap{display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%;cursor:pointer;user-select:none}.rdt_editCheckbox{appearance:auto;cursor:pointer;margin:0;width:16px;height:16px}.rdt_editCheckboxWrap:focus-visible{outline:2px solid var(--rdt-color-primary);outline-offset:-2px;border-radius:var(--rdt-border-radius, 4px)}.rdt_editCustomWrap{display:flex;align-items:center;width:100%;height:100%;padding:0 var(--rdt-cell-padding-x, 16px)}.rdt_cellEditError{box-shadow:inset 0 0 0 2px var(--rdt-color-cell-edit-error, #dc2626)}.rdt_editErrorTip{position:absolute;bottom:100%;left:0;margin-bottom:2px;padding:2px 6px;font-size:11px;line-height:1.4;color:#fff;background:var(--rdt-color-cell-edit-error, #dc2626);border-radius:var(--rdt-border-radius, 4px);white-space:nowrap;pointer-events:none;z-index:5}.rdt_TableCell.rdt_cellEditError{position:relative}.rdt_table[role=grid] [data-nav-row]:focus-within:not(.rdt_cellEditing){outline:2px solid var(--rdt-color-primary, #1976d2);outline-offset:-2px;z-index:2}.rdt_pinLeft,.rdt_pinRight{background-color:inherit}.rdt_pinLeftLast{box-shadow:1px 0 0 var(--rdt-color-pin-border, var(--rdt-color-divider, rgba(0, 0, 0, .12)))}.rdt_pinRightFirst{box-shadow:-1px 0 0 var(--rdt-color-pin-border, var(--rdt-color-divider, rgba(0, 0, 0, .12)))}.rdt_pinLeftLast+.rdt_cellBase,.rdt_pinRightFirst{--rdt-col-sep-color: transparent}.rdt_pinLeftLast:dir(rtl){box-shadow:-1px 0 0 var(--rdt-color-pin-border, var(--rdt-color-divider, rgba(0, 0, 0, .12)))}.rdt_pinRightFirst:dir(rtl){box-shadow:1px 0 0 var(--rdt-color-pin-border, var(--rdt-color-divider, rgba(0, 0, 0, .12)))}.rdt_resizeHandle{position:absolute;inset-inline-end:-5px;top:0;height:100%;width:10px;cursor:col-resize;user-select:none;touch-action:none;z-index:1}.rdt_cellBaseHead:last-child .rdt_resizeHandle{inset-inline-end:0;z-index:2}.rdt_resizeHandle:after{content:\"\";position:absolute;top:0;height:100%;width:3px;inset-inline-end:3px}.rdt_cellBaseHead:last-child .rdt_resizeHandle:after{inset-inline-end:0}.rdt_resizeHandle:hover:after,.rdt_resizeHandle:active:after{background-color:var(--rdt-color-primary, #1976d2)}.rdt_headGrid{display:grid;grid-template-rows:var(--rdt-header-height, 52px) var(--rdt-header-height, 52px);width:100%;background-color:var(--rdt-color-header-bg, var(--rdt-color-bg, #fff));border-bottom:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12));background-image:linear-gradient(to bottom,transparent calc(var(--rdt-header-height, 52px) - 1px),var(--rdt-color-divider, rgba(0, 0, 0, .12)) calc(var(--rdt-header-height, 52px) - 1px),var(--rdt-color-divider, rgba(0, 0, 0, .12)) var(--rdt-header-height, 52px),transparent var(--rdt-header-height, 52px))}.rdt_headGridDense{grid-template-rows:32px 32px;background-image:linear-gradient(to bottom,transparent 31px,var(--rdt-color-divider, rgba(0, 0, 0, .12)) 31px,var(--rdt-color-divider, rgba(0, 0, 0, .12)) 32px,transparent 32px)}.rdt_groupCell{position:relative;display:flex;align-items:center;justify-content:center;padding:0 var(--rdt-cell-padding-x, 16px);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));box-sizing:border-box}.rdt_groupCellReorder{cursor:grab;user-select:none}.rdt_groupCellDragging{cursor:grabbing}.rdt_groupCell+.rdt_groupCell:before{content:\"\";position:absolute;inset-inline-start:0;top:20%;height:60%;width:1px;background:var(--rdt-col-sep-color, var(--rdt-color-divider, rgba(0, 0, 0, .12)));pointer-events:none}.rdt_sortIcon i,.rdt_sortIcon svg{transition-duration:95ms;transition-property:transform;color:inherit;font-size:18px;height:18px;width:18px;backface-visibility:hidden;transform-style:preserve-3d}.rdt_sortIconInactive i,.rdt_sortIconInactive svg{opacity:0}.rdt_sortIconActive i,.rdt_sortIconActive svg{opacity:1}.rdt_sortIconAsc i,.rdt_sortIconAsc svg{transform:rotate(180deg)}.rdt_sortPriority{display:inline-flex;align-items:center;justify-content:center;min-width:14px;height:14px;margin:0 2px;padding:0 3px;border-radius:7px;font-size:10px;line-height:1;font-weight:600;color:var(--rdt-color-bg, #fff);background-color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54))}.rdt_expanderRow{width:100%;box-sizing:border-box;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-bg, #fff)}.rdt_expanderButton{display:inline-flex;align-items:center;justify-content:center;margin:auto;user-select:none;white-space:nowrap;border:none;background-color:transparent;color:var(--rdt-color-btn, rgba(0, 0, 0, .54));fill:var(--rdt-color-btn, rgba(0, 0, 0, .54));border-radius:var(--rdt-border-radius, 4px);transition:background-color .15s;padding:4px}.rdt_expanderButton svg{margin:auto;width:var(--rdt-icon-size, 18px);height:var(--rdt-icon-size, 18px);flex-shrink:0}.rdt_expanderButton:hover:not(:disabled){cursor:pointer;background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .12))}.rdt_expanderButton:focus{outline:none;background-color:var(--rdt-color-btn-focus, rgba(0, 0, 0, .12))}.rdt_expanderButton:disabled{color:var(--rdt-color-btn-disabled, rgba(0, 0, 0, .18));fill:var(--rdt-color-btn-disabled, rgba(0, 0, 0, .18))}.rdt_header{position:relative;box-sizing:border-box;overflow:hidden;display:flex;flex:1 1 auto;align-items:center;justify-content:space-between;width:100%;flex-wrap:wrap;font-size:22px;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-header-bg, var(--rdt-color-bg, #fff));min-height:56px;padding-left:16px;padding-right:8px;gap:4px}@media(max-width:599px){.rdt_header{font-size:18px;padding-left:12px;padding-right:6px}.rdt_headerActions{flex:0 0 auto}}.rdt_headerTitle{flex:1 0 auto;font-weight:400}.rdt_headerActions{flex:1 0 auto;display:flex;align-items:center;justify-content:flex-end}.rdt_headerActions>*{margin-left:5px}.rdt_subheader{position:relative;display:flex;flex:1 1 auto;box-sizing:border-box;align-items:center;padding:4px 16px 4px 24px;width:100%;background-color:var(--rdt-color-header-bg, var(--rdt-color-bg, #fff));min-height:52px}.rdt_subheaderLeft{justify-content:flex-start}.rdt_subheaderRight{justify-content:flex-end}.rdt_subheaderCenter{justify-content:center}.rdt_subheaderWrap{flex-wrap:wrap}.rdt_noData{box-sizing:border-box;width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-bg, #fff)}.rdt_progress{position:relative;box-sizing:border-box;width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-bg, #fff)}@keyframes rdt_shimmer{0%{background-position:-400px 0}to{background-position:400px 0}}@keyframes rdt_spin{to{transform:rotate(360deg)}}.rdt_skeletonPulse{background:linear-gradient(90deg,var(--rdt-color-divider, rgba(0,0,0,.08)) 25%,rgba(255,255,255,.5) 50%,var(--rdt-color-divider, rgba(0,0,0,.08)) 75%);background-size:800px 100%;animation:rdt_shimmer 1.4s ease-in-out infinite}.rdt_bodyBusy{opacity:.4;pointer-events:none;user-select:none;transition:opacity .15s ease}.rdt_bodyOverlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none}.rdt_footer{display:flex;flex-direction:column;background-color:var(--rdt-color-footer-bg, var(--rdt-color-bg, #fff))}.rdt_footerRow{display:flex;align-items:stretch;width:100%;box-sizing:border-box;min-height:var(--rdt-row-height, 48px);font-size:var(--rdt-font-size, 13px);font-weight:600;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));border-top:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12))}.rdt_footerCell{background-color:inherit}.rdt_footerSystemCell{flex:0 0 var(--rdt-system-col-width, 40px);min-width:0;max-width:var(--rdt-system-col-width, 40px)}.rdt_pagination{display:flex;flex:1 1 auto;justify-content:flex-end;align-items:center;box-sizing:border-box;padding-right:var(--rdt-cell-padding-x, 8px);padding-left:var(--rdt-cell-padding-x, 8px);width:100%;font-size:var(--rdt-font-size, 13px);font-family:var(--rdt-font-family, inherit);color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));background-color:var(--rdt-color-bg, #fff);min-height:var(--rdt-row-height, 52px)}.rdt_paginationButton{position:relative;display:flex;align-items:center;justify-content:center;user-select:none;border:none;border-radius:calc(var(--rdt-border-radius, 4px) * 100);height:calc(var(--rdt-icon-size, 18px) + 16px);width:calc(var(--rdt-icon-size, 18px) + 16px);padding:0;margin:0;cursor:pointer;transition:background-color .15s;color:var(--rdt-color-btn, rgba(0, 0, 0, .54));fill:var(--rdt-color-btn, rgba(0, 0, 0, .54));background-color:transparent}.rdt_paginationButton svg{width:var(--rdt-icon-size, 18px);height:var(--rdt-icon-size, 18px);flex-shrink:0}.rdt_paginationButton:disabled{cursor:unset;color:var(--rdt-color-btn-disabled, rgba(0, 0, 0, .18));fill:var(--rdt-color-btn-disabled, rgba(0, 0, 0, .18))}.rdt_paginationButton:hover:not(:disabled){background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .12))}.rdt_paginationButton:focus{outline:none;background-color:var(--rdt-color-btn-focus, rgba(0, 0, 0, .12))}.rdt_paginationButtonRTL{transform:scale(-1)}.rdt_paginationPageList{display:flex;align-items:center;border-radius:var(--rdt-border-radius, 4px);white-space:nowrap}.rdt_paginationNarrow{justify-content:center;padding-left:4px;padding-right:4px}.rdt_paginationNarrow .rdt_paginationPageList{width:100%;justify-content:space-around}.rdt_paginationSpan{flex-shrink:1;user-select:none}.rdt_paginationRange{flex-shrink:1;user-select:none;margin:0 24px}.rdt_paginationRowLabel{flex-shrink:1;user-select:none;margin:0 4px}.rdt_selectWrapper{position:relative;display:inline-flex;align-items:center;flex-shrink:0;font-size:inherit;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .24));border-radius:var(--rdt-border-radius, 4px);background-color:var(--rdt-color-bg, #fff);height:28px;margin-left:8px;transition:border-color .15s}.rdt_selectWrapper:focus-within{border-color:var(--rdt-color-primary, #1976d2);outline:2px solid var(--rdt-color-primary, #1976d2);outline-offset:-1px}.rdt_selectWrapper svg{top:50%;inset-inline-end:2px;transform:translateY(-50%);color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));position:absolute;fill:none;stroke:currentColor;width:18px;height:18px;display:inline-block;user-select:none;pointer-events:none}.rdt_selectControl{cursor:pointer;height:100%;max-width:100%;user-select:none;padding-inline-start:8px;padding-inline-end:22px;box-sizing:border-box;font-size:inherit;font-family:inherit;color:inherit;border:none;background-color:transparent;appearance:none;flex-shrink:0;outline:none}.rdt_selectControl::-ms-expand{display:none}.rdt_selectControl option{color:initial;background-color:var(--rdt-color-bg, #fff)}@media(max-width:599px){.rdt_row{min-height:max(var(--rdt-row-height, 48px),48px)}.rdt_cellBase{padding-left:var(--rdt-cell-padding-x-mobile, 12px);padding-right:var(--rdt-cell-padding-x-mobile, 12px)}.rdt_paginationButton{height:44px;width:44px}}@media(max-width:599px){.rdt_hideOnSm{display:none}}@media(max-width:959px){.rdt_hideOnMd{display:none}}@media(max-width:1279px){.rdt_hideOnLg{display:none}}@keyframes rdt_rowEnter{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.rdt_animatedRow{animation:rdt_rowEnter .18s ease both;animation-delay:calc(var(--rdt-row-index, 0) * 16ms)}.rdt_expanderRowAnimated{display:grid;animation:rdt_expandIn .22s cubic-bezier(.2,0,0,1) forwards}.rdt_expanderRowClosing{animation:rdt_expandOut .22s cubic-bezier(.2,0,0,1) forwards}@keyframes rdt_expandIn{0%{grid-template-rows:0fr;opacity:0}to{grid-template-rows:1fr;opacity:1}}@keyframes rdt_expandOut{0%{grid-template-rows:1fr;opacity:1}to{grid-template-rows:0fr;opacity:0}}.rdt_expanderRowAnimated>.rdt_expanderRow{overflow:hidden;min-height:0}@keyframes rdt_sortPulse{0%{background-color:transparent}30%{background-color:var(--rdt-color-selected, #e3f2fd)}to{background-color:transparent}}.rdt_sortActive{animation:rdt_sortPulse .4s ease both}@media(prefers-reduced-motion:reduce){.rdt_animatedRow,.rdt_sortActive{animation:none!important;transition:none!important}.rdt_expanderRowAnimated,.rdt_expanderRowClosing{animation:none!important;grid-template-rows:1fr!important;opacity:1!important}}\n");var ye=u.createContext({});function be(){return u.useContext(ye)}function _e({disabled:e,className:t,style:n,...i}){let a=be();return u.createElement("div",{className:["rdt_table",e&&"rdt_tableDisabled",t].filter(Boolean).join(" "),style:{...a.table?.style,...n},...i})}function ve({title:e,actions:t=null}){let n=be();return u.createElement("div",{className:"rdt_TableHeader",style:n.header?.style},u.createElement("div",{className:"rdt_header"},u.createElement("div",{className:"rdt_headerTitle"},e),t&&u.createElement("div",{className:"rdt_headerActions"},t)))}var we={left:"rdt_subheaderLeft",right:"rdt_subheaderRight",center:"rdt_subheaderCenter"};function Se({align:e="right",wrapContent:t=!0,children:n}){let i=be();return u.createElement("header",{className:["rdt_subheader",we[e],t&&"rdt_subheaderWrap"].filter(Boolean).join(" "),style:i.subHeader?.style},n)}var Ce=u.forwardRef(function({$responsive:e,$fixedHeader:t,$fixedHeaderScrollHeight:n="100vh",$hiddenScrollbar:i,className:a,style:r,...s},o){let l=be();return u.createElement("div",{ref:o,className:["rdt_responsiveWrapper",t?"rdt_responsiveWrapperFixed":e?"rdt_responsiveWrapperScroll":void 0,i&&"rdt_responsiveWrapperHideScrollbar",a].filter(Boolean).join(" "),style:{...t&&{maxHeight:n},...l.responsiveWrapper?.style,...r},...s})}),je=Ce;function ke({style:e,...t}){let n=be();return u.createElement("div",{className:"rdt_wrapper",style:{...n.tableWrapper?.style,...e},...t})}var Re=()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M7 10L12 15L17 10"}));function Ee({defaultValue:e,onChange:t,...n}){return u.createElement("div",{className:"rdt_selectWrapper"},u.createElement("select",{className:"rdt_selectControl",onChange:t,defaultValue:e,...n}),u.createElement(Re,null))}var Ne=(e=>(e.ASC="asc",e.DESC="desc",e))(Ne||{}),Pe="allowRowEvents",Be=(e=>(e.LTR="ltr",e.RTL="rtl",e.AUTO="auto",e))(Be||{}),De=(e=>(e.LEFT="left",e.RIGHT="right",e.CENTER="center",e))(De||{}),Te=(e=>(e.SM="sm",e.MD="md",e.LG="lg",e))(Te||{});function Fe(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Ie(e,t){let n={...e};for(let e of Object.keys(t)){let i=t[e],a=n[e];Fe(i)&&Fe(a)?n[e]=Ie(a,i):void 0!==i&&(n[e]=i)}return n}function Me(e,t){return e[t]}function He(e=""){return"number"!=typeof e&&(!e||0===e.length)}function Ae(e,t,n,i){let a="asc"===i?1:-1,r=n(e),s=n(t),o=null==r,l=null==s;return o||l?o&&l?0:o?1:-1:rs?1*a:0}var Le=()=>0;function ze(e=[],t,n=0){return[...e.slice(0,n),t,...e.slice(n)]}function Oe(e=[],t,n="id"){let i=e.slice(),a=Me(t,n);return a?i.splice(i.findIndex(e=>Me(e,n)===a),1):i.splice(i.findIndex(e=>e===t),1),i}function We(e){return e.map((e,t)=>{let n={...e,sortable:e.sortable||!!e.sortFunction||void 0};return e.id||(n.id=t+1),n})}function Ue(e,t){return Math.ceil(e/t)}function Ge(e,t){return Math.min(e,t)}var $e=()=>null;function qe(e,t=[],n=[]){let i={},a=[...n];return t.length&&t.forEach(t=>{if(!t.when||"function"!=typeof t.when)throw new Error('"when" must be defined in the conditional style object and must be function');t.when(e)&&(i=t.style||{},t.classNames&&(a=[...a,...t.classNames]),"function"==typeof t.style&&(i=t.style(e)||{}))}),{conditionalStyle:i,classNames:a.join(" ")}}function Ke(e,t=[],n="id"){let i=Me(e,n);return i?t.some(e=>Me(e,n)===i):t.some(t=>t===e)}function Ve(e,t,n){return(e?1:0)+(t&&!n?1:0)}function Je(e,t){return t?e.findIndex(e=>Ye(e.id,t)):-1}function Ye(e,t){return e==t}var Xe={left:{},right:{}};function Qe(e,t){if(null!=e.id&&null!=t[e.id])return t[e.id];let n=e.width??e.minWidth??"100px",i=parseFloat(n);return isNaN(i)?100:i}function Ze(){if(typeof window>"u"||typeof document>"u")return 48;let e=document.querySelector(".rdt_table")??document.documentElement,t=getComputedStyle(e).getPropertyValue("--rdt-system-col-width").trim();if(!t)return 48;let n=parseFloat(t);return isNaN(n)?48:n}function et(e,t,n){let i=t??Xe,a=e.id,r="left"===e.pinned&&null!=a&&null!=i.left[a],s="right"===e.pinned&&null!=a&&null!=i.right[a],o=r?Object.values(i.left):[],l=s?Object.values(i.right):[],c=o.length?Math.max(...o):-1,d=l.length?Math.max(...l):-1,p=r&&null!=a&&i.left[a]===c,u=s&&null!=a&&i.right[a]===d;return{pinnedLeft:r,pinnedRight:s,isLastLeftPin:p,isFirstRightPin:u,style:r?{position:"sticky",insetInlineStart:i.left[a],...null!=n&&{zIndex:n}}:s?{position:"sticky",insetInlineEnd:i.right[a],...null!=n&&{zIndex:n}}:{},className:[r&&"rdt_pinLeft",p&&"rdt_pinLeftLast",s&&"rdt_pinRight",u&&"rdt_pinRightFirst"].filter(Boolean).join(" ")}}function tt(e){for(let t of e)if(!t.omit&&"right"===t.pinned)return t.id??null;return null}function nt(e,t){let n=null!=t?`${t}px`:void 0;return{grow:null!=n?0:e.grow,width:n??e.width,minWidth:n??e.minWidth,maxWidth:n??e.maxWidth}}function it(e,t,n,i){return e=i-n?"right":void 0}var at=typeof window<"u"?u.useLayoutEffect:u.useEffect,rt=function(e="auto"){let t="object"==typeof window,[n,i]=u.useState(!1);return u.useEffect(()=>{if(t){if("auto"===e){let e=!(!window.document||!window.document.createElement),t=document.getElementsByTagName("BODY")[0],n=document.getElementsByTagName("HTML")[0],a="rtl"===t.dir||"rtl"===n.dir;return void i(e&&a)}i("rtl"===e)}},[e,t]),n},st={first:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M5 6V18"}),u.createElement("path",{d:"M15 18L9 12L15 6"})),null),last:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M19 6V18"}),u.createElement("path",{d:"M9 18L15 12L9 6"})),null),next:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M9 18L15 12L9 6"})),null),previous:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M15 18L9 12L15 6"})),null)},ot={collapsed:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M9 18L15 12L9 6"})),null),expanded:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M18 9L12 15L6 9"})),null)},lt={columns:[],data:[],title:"",keyField:"id",selectableRows:!1,selectableRowsHighlight:!1,selectableRowsNoSelectAll:!1,selectableRowSelected:null,selectableRowDisabled:null,selectableRowsComponent:"input",selectableRowsComponentProps:{},selectableRowsVisibleOnly:!1,selectableRowsSingle:!1,clearSelectedRows:!1,expandableRows:!1,expandableRowDisabled:null,expandableRowExpanded:null,expandOnRowClicked:!1,expandableRowsHideExpander:!1,expandOnRowDoubleClicked:!1,expandableInheritConditionalStyles:!1,expandableRowsComponent:function(){return u.createElement("div",null,"To add an expander pass in a component instance via ",u.createElement("strong",null,"expandableRowsComponent"),". You can then access props.data from this component.")},expandableRowsComponentProps:{},progressPending:!1,progressComponent:u.createElement("div",{style:{width:28,height:28,borderRadius:"50%",border:"3px solid var(--rdt-color-divider, rgba(0,0,0,0.12))",borderTopColor:"var(--rdt-color-text-primary, rgba(0,0,0,0.87))",animation:"rdt_spin 0.7s linear infinite"}}),persistTableHead:!1,sortFunction:null,sortServer:!1,sortMulti:!1,striped:!1,highlightOnHover:!1,pointerOnHover:!1,actions:null,defaultSortFieldId:null,defaultSortAsc:!0,responsive:!0,noDataComponent:u.createElement("div",{style:{padding:"24px"}},"There are no records to display"),disabled:!1,noTableHead:!1,noHeader:!1,subHeader:void 0,subHeaderAlign:"right",subHeaderWrap:!0,fixedHeader:!1,fixedHeaderScrollHeight:"100vh",pagination:!1,paginationServer:!1,paginationServerOptions:{persistSelectedOnSort:!1,persistSelectedOnPageChange:!1},paginationDefaultPage:1,paginationResetDefaultPage:!1,paginationTotalRows:0,paginationPerPage:10,paginationPosition:"bottom",paginationRowsPerPageOptions:[10,15,20,25,30],paginationComponent:null,paginationComponentOptions:{},dense:!1,conditionalRowStyles:[],theme:"default",colorMode:"light",customStyles:{},direction:"auto",onChangePage:$e,onChangeRowsPerPage:$e,onRowClicked:$e,onRowDoubleClicked:$e,onRowMiddleClicked:$e,onRowMouseEnter:$e,onRowMouseLeave:$e,onRowExpandToggled:$e,onSelectedRowsChange:$e,onSort:$e,onColumnOrderChange:$e},ct={rowsPerPageText:"Rows per page:",rangeSeparatorText:"of",noRowsPerPage:!1,selectAllRowsItem:!1,selectAllRowsItemText:"All"},dt=u.memo(function({rowsPerPage:e,rowCount:t,currentPage:n,direction:i=lt.direction,paginationRowsPerPageOptions:a=lt.paginationRowsPerPageOptions,paginationIcons:r=st,paginationComponentOptions:s=lt.paginationComponentOptions,localization:o,onChangeRowsPerPage:l=lt.onChangeRowsPerPage,onChangePage:c=lt.onChangePage}){let d=u.useRef(null),[p,m]=u.useState(0);at(()=>{let e=d.current;if(!e)return;let t=()=>m(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let h=rt(i),g=p>599,x=Ue(t,e),f=n*e,y=f-e+1,b=1===n,_=n===x,v={...ct,...s},w=n===x?`${y}-${t} ${v.rangeSeparatorText} ${t}`:`${y}-${f} ${v.rangeSeparatorText} ${t}`,S={...st,...r},C=u.useCallback(()=>c(n-1,t),[n,c,t]),j=u.useCallback(()=>c(n+1,t),[n,c,t]),k=u.useCallback(()=>c(1,t),[c,t]),R=u.useCallback(()=>c(Ue(t,e),t),[c,t,e]),E=u.useCallback(e=>l(Number(e.target.value),n),[n,l]),N=a.map(e=>u.createElement("option",{key:e,value:e},e));v.selectAllRowsItem&&N.push(u.createElement("option",{key:-1,value:t},v.selectAllRowsItemText));let P=be(),B=u.createElement(Ee,{onChange:E,defaultValue:e,"aria-label":v.rowsPerPageText},N),D=e=>["rdt_paginationButton",e&&"rdt_paginationButtonRTL"].filter(Boolean).join(" ");return u.createElement("nav",{ref:d,className:["rdt_pagination","rdt_Pagination",!g&&"rdt_paginationNarrow"].filter(Boolean).join(" "),"aria-label":o?.navigationAriaLabel??"Table pagination",style:P.pagination?.style},!v.noRowsPerPage&&g&&u.createElement(u.Fragment,null,u.createElement("span",{className:"rdt_paginationRowLabel"},v.rowsPerPageText),B),g&&u.createElement("span",{className:"rdt_paginationRange"},w),u.createElement("div",{className:"rdt_paginationPageList"},u.createElement("button",{id:"pagination-first-page",type:"button","aria-label":o?.firstPageAriaLabel??"First Page","aria-disabled":b,onClick:k,disabled:b,className:D(h),style:P.pagination?.pageButtonsStyle},S.first),u.createElement("button",{id:"pagination-previous-page",type:"button","aria-label":o?.previousPageAriaLabel??"Previous Page","aria-disabled":b,onClick:C,disabled:b,className:D(h),style:P.pagination?.pageButtonsStyle},S.previous),!v.noRowsPerPage&&!g&&B,u.createElement("button",{id:"pagination-next-page",type:"button","aria-label":o?.nextPageAriaLabel??"Next Page","aria-disabled":_,onClick:j,disabled:_,className:D(h),style:P.pagination?.pageButtonsStyle},S.next),u.createElement("button",{id:"pagination-last-page",type:"button","aria-label":o?.lastPageAriaLabel??"Last Page","aria-disabled":_,onClick:R,disabled:_,className:D(h),style:P.pagination?.pageButtonsStyle},S.last)))});function pt({$fixedHeader:e,className:t,style:n,...i}){let a=be();return u.createElement("div",{className:["rdt_head",e&&"rdt_headFixed",t].filter(Boolean).join(" "),style:{...a.head?.style,...n},...i})}var ut=u.forwardRef(function({$dense:e,className:t,style:n,...i},a){let r=be();return u.createElement("div",{ref:a,className:["rdt_headRow",e&&"rdt_headRowDense",t].filter(Boolean).join(" "),style:{...r.headRow?.style,...e&&r.headRow?.denseStyle,...n},...i})}),mt=ut;function ht({$headCell:e,$noPadding:t,headStyle:n,cellStyle:i,className:a,style:r,...s}){let o=["rdt_cellBase",e&&"rdt_cellBaseHead",t&&"rdt_cellNoPadding",a].filter(Boolean).join(" ");return u.createElement("div",{className:o,style:{...e?n:i,...r},...s})}var gt=u.forwardRef(function({button:e,grow:t,maxWidth:n,minWidth:i,width:a,right:r,center:s,compact:o,hide:l,allowOverflow:c,$headCell:d,$noPadding:p,headStyle:m,cellStyle:h,className:g,style:x,...f},y){let b=function(e){let{button:t,grow:n,maxWidth:i,minWidth:a,width:r,right:s,center:o,compact:l}=e;return{flexGrow:0===n||t?0:n??1,flexShrink:0,flexBasis:0,maxWidth:r??i??"100%",minWidth:r??a??"100px",justifyContent:s?"flex-end":o||t?"center":void 0,padding:l||t?0:void 0}}({button:e,grow:t,maxWidth:n,minWidth:i,width:a,right:r,center:s,compact:o}),_=["rdt_cellBase",d&&"rdt_cellBaseHead",p&&"rdt_cellNoPadding",(v=l)?"sm"===v?"rdt_hideOnSm":"md"===v?"rdt_hideOnMd":"lg"===v?"rdt_hideOnLg":"":"",g].filter(Boolean).join(" ");var v;return u.createElement("div",{ref:y,className:_,style:{...d?m:h,...b,...x},...f})}),xt=({sortActive:e,sortDirection:t})=>u.createElement("span",{"aria-hidden":"true",style:{display:"inline-flex",flexGrow:0,flexShrink:0,marginLeft:"2px",opacity:e?1:0,transition:e?"opacity 0.15s ease":"none"}},u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",role:"presentation",style:{width:"var(--rdt-sort-icon-size, 12px)",height:"var(--rdt-sort-icon-size, 12px)",transform:e&&"desc"===t?"rotate(180deg)":void 0,transition:e?"transform 0.15s ease":"none"}},u.createElement("path",{d:"M12 19V5M6 11L12 5L18 11"})));function ft(e="text"){return{condition1:{operator:"text"===e?"contains":"equals"}}}function yt(e){return"blank"===e.operator||"notBlank"===e.operator||""!==(e.value?.trim()??"")}function bt(e){return yt(e.condition1)}function _t(e,t,n){let{operator:i,value:a="",value2:r=""}=e;if("blank"===i)return""===t.trim();if("notBlank"===i)return""!==t.trim();if("number"===n){let e=parseFloat(t);if(isNaN(e))return!1;let n=parseFloat(a),s=parseFloat(r);switch(i){case"equals":return e===n;case"notEquals":return e!==n;case"gt":return e>n;case"gte":return e>=n;case"lt":return e=n&&e<=s;default:return!0}}if("date"===n){let e=new Date(t);if(isNaN(e.getTime()))return!1;let n=new Date(a),s=new Date(r);switch(i){case"equals":return e.toDateString()===n.toDateString();case"before":return en;case"between":return e>=n&&e<=s;default:return!0}}let s=t.toLowerCase(),o=a.toLowerCase();switch(i){case"contains":return s.includes(o);case"notContains":return!s.includes(o);case"equals":return s===o;case"notEquals":return s!==o;case"startsWith":return s.startsWith(o);case"endsWith":return s.endsWith(o);default:return!0}}var vt={};var wt=[{value:"contains",label:"Contains"},{value:"notContains",label:"Does not contain"},{value:"equals",label:"Equals"},{value:"notEquals",label:"Does not equal"},{value:"startsWith",label:"Begins with"},{value:"endsWith",label:"Ends with"},{value:"blank",label:"Blank",noInput:!0},{value:"notBlank",label:"Not blank",noInput:!0}],St=[{value:"equals",label:"Equals"},{value:"notEquals",label:"Does not equal"},{value:"gt",label:"Greater than"},{value:"gte",label:"Greater than or equal"},{value:"lt",label:"Less than"},{value:"lte",label:"Less than or equal"},{value:"between",label:"Between",twoInputs:!0},{value:"blank",label:"Blank",noInput:!0},{value:"notBlank",label:"Not blank",noInput:!0}],Ct=[{value:"equals",label:"Equals"},{value:"before",label:"Before"},{value:"after",label:"After"},{value:"between",label:"Between",twoInputs:!0},{value:"blank",label:"Blank",noInput:!0},{value:"notBlank",label:"Not blank",noInput:!0}];function jt(e){return"text"===e?"contains":"equals"}function kt(e){return{operator:jt(e)}}function Rt({condition:e,filterType:t,options:n,onChange:i,onRemove:a}){let r=function(e,t){let n="number"===e?St:"date"===e?Ct:wt;return t?n.map(e=>t[e.value]?{...e,label:t[e.value]}:e):n}(t,n.operators),s=r.find(t=>t.value===e.operator)??r[0],o="number"===t?"number":"date"===t?"date":"text";return u.createElement("div",{className:"rdt_filterConditionRow"},u.createElement("select",{className:"rdt_filterSelect",value:e.operator,onChange:e=>i({operator:e.target.value}),"aria-label":n.operatorAriaLabel??"Filter operator"},r.map(e=>u.createElement("option",{key:e.value,value:e.value},e.label))),!s.noInput&&u.createElement("input",{className:"rdt_filterInput",type:o,value:e.value??"",placeholder:n.valuePlaceholder??"Value",onChange:t=>i({...e,value:t.target.value}),onKeyDown:e=>e.stopPropagation(),"aria-label":n.valueAriaLabel??"Filter value"}),s.twoInputs&&u.createElement(u.Fragment,null,u.createElement("span",{className:"rdt_filterBetweenSep"},n.betweenSeparatorText??"and"),u.createElement("input",{className:"rdt_filterInput",type:o,value:e.value2??"",placeholder:n.value2Placeholder??"Value",onChange:t=>i({...e,value2:t.target.value}),onKeyDown:e=>e.stopPropagation(),"aria-label":n.value2AriaLabel??"Filter second value"})),a&&u.createElement("button",{type:"button",className:"rdt_filterRemoveBtn",onClick:a,"aria-label":n.removeConditionAriaLabel??"Remove condition"},"✕"))}function Et({columnId:e,filterValue:t,filterType:n="text",options:i={},onFilterChange:a}){let[r,s]=u.useState(!1),[o,l]=u.useState(null),[c,d]=u.useState(()=>t??ft(n)),p=u.useRef(null),m=u.useRef(null),h=u.useRef(t);u.useEffect(()=>{h.current!==t&&(h.current=t,d(t??ft(n)))},[t,n]);let g=u.useRef(null);u.useEffect(()=>{if(r)return g.current?.querySelector("select, input, button")?.focus(),document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),window.addEventListener("scroll",n,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t),window.removeEventListener("scroll",n,!0),window.removeEventListener("resize",i)};function e(e){let t=e.target;p.current&&!p.current.contains(t)&&g.current&&!g.current.contains(t)&&s(!1)}function t(e){"Escape"===e.key&&s(!1)}function n(e){g.current&&e.target instanceof Node&&g.current.contains(e.target)||s(!1)}function i(){s(!1)}},[r]);let x=bt(t);function f(e){d(t=>({...t,logic:e}))}return u.createElement("div",{ref:p,className:"rdt_filterContainer"},u.createElement("button",{ref:m,type:"button",className:["rdt_filterIcon",x&&"rdt_filterIconActive"].filter(Boolean).join(" "),"aria-label":x?i.filterActiveAriaLabel??"Filter active":i.filterColumnAriaLabel??"Filter column","aria-pressed":r,onClick:e=>{e.stopPropagation(),function(){if(!r&&m.current){let e=m.current.getBoundingClientRect(),t=260,n=8,i=window.innerWidth-t-n,a=Math.min(Math.max(n,e.left),Math.max(n,i));l({top:e.bottom+4,left:a})}s(e=>!e)}()}},u.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},u.createElement("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})),x&&u.createElement("span",{className:"rdt_filterDot"})),r&&o&&u.createElement("div",{ref:g,className:"rdt_filterPanel",role:"dialog","aria-label":i.filterPanelAriaLabel??"Column filter",style:{position:"fixed",top:o.top,left:o.left}},u.createElement(Rt,{condition:c.condition1,filterType:n,options:i,onChange:function(e){d(t=>({...t,condition1:e}))}}),c.condition2?u.createElement(u.Fragment,null,u.createElement("div",{className:"rdt_filterLogicRow"},u.createElement("button",{type:"button",className:["rdt_filterLogicBtn","OR"!==c.logic&&"rdt_filterLogicBtnActive"].filter(Boolean).join(" "),"aria-pressed":"OR"!==c.logic,onClick:()=>f("AND")},i.andLabel??"AND"),u.createElement("button",{type:"button",className:["rdt_filterLogicBtn","OR"===c.logic&&"rdt_filterLogicBtnActive"].filter(Boolean).join(" "),"aria-pressed":"OR"===c.logic,onClick:()=>f("OR")},i.orLabel??"OR")),u.createElement(Rt,{condition:c.condition2,filterType:n,options:i,onChange:function(e){d(t=>({...t,condition2:e}))},onRemove:function(){d(e=>({condition1:e.condition1}))}})):u.createElement("button",{type:"button",className:"rdt_filterAddCondition","aria-label":i.addConditionAriaLabel??"Add a second filter condition",onClick:function(){d(e=>({...e,condition2:kt(n),logic:e.logic??"AND"}))}},i.addConditionLabel??"+ Add condition"),u.createElement("div",{className:"rdt_filterActions"},u.createElement("button",{type:"button",className:"rdt_filterBtn",onClick:function(){let t=ft(n);d(t),a(e,t),s(!1)}},i.clearLabel??"Clear"),u.createElement("button",{type:"button",className:"rdt_filterBtn rdt_filterBtnPrimary",onClick:function(){a(e,c),s(!1)}},i.applyLabel??"Apply"))))}function Nt(e,t,n,i){e.style.transform=`translate${n}(${t}px)`,e.style.transition="none",e.getBoundingClientRect(),e.style.transition=`transform ${i}s cubic-bezier(0.2, 0, 0, 1)`,e.style.transform="";let a=()=>{e.style.transform="",e.style.transition="",e.removeEventListener("transitionend",a)};e.addEventListener("transitionend",a)}function Pt(e,t){e.dataTransfer.effectAllowed="move";let n=e.currentTarget.getBoundingClientRect(),i=document.createElement("div");i.className="rdt_dragGhost";let a=document.createElement("span");a.className="rdt_dragGhostIcon",a.setAttribute("aria-hidden","true"),a.innerHTML='';let r=document.createElement("span");r.className="rdt_dragGhostLabel",r.textContent=t,i.appendChild(a),i.appendChild(r),i.style.width=`${n.width}px`,i.style.height=`${n.height}px`,document.body.appendChild(i),e.dataTransfer.setDragImage(i,e.clientX-n.left,e.clientY-n.top),setTimeout(()=>document.body.removeChild(i),0)}var Bt=u.memo(function({column:e,disabled:t,draggingColumnId:n,sorting:i,filterValue:a,filterLocalization:r,onFilterChange:s,columnDrag:o,resizedWidth:l,onResizeStart:c,pinnedOffsets:d,gridStyle:p,cellNavigation:m,activeCell:h,navCol:g,headerMenu:x}){let f=be(),{sortDirection:y,sortColumns:b,sortMulti:_,defaultSortDirection:v,sortIcon:w,sortServer:S,pagination:C,paginationServer:j,persistSelectedOnSort:k,selectableRowsVisibleOnly:R,onSort:E}=i,[N,P]=u.useState(!1),B=u.useRef(null);if(u.useEffect(()=>{B.current&&P(B.current.scrollWidth>B.current.clientWidth)},[N]),e.omit)return null;let D=t=>{!e.sortable&&!e.selector||E({type:"SORT_CHANGE",selectedColumn:e,additive:_&&t,defaultSortDirection:v,clearSelectedOnSort:C&&j&&!k||S||R})},T=b.findIndex(t=>Ye(t.column.id,e.id)),F=-1===T?void 0:b[T],I=F?F.sortDirection:y,M=e=>u.createElement(xt,{sortActive:e,sortDirection:I}),H=()=>u.createElement("span",{className:["rdt_sortIcon",L?"rdt_sortIconActive":"rdt_sortIconInactive","asc"===I&&"rdt_sortIconAsc","__rdt_custom_sort_icon__"].filter(Boolean).join(" ")},w),A=()=>_&&b.length>1&&-1!==T?u.createElement("span",{className:"rdt_sortPriority","aria-hidden":"true"},T+1):null,L=!(!e.sortable||-1===T),z=!e.sortable||t,O=m?m&&-1===h?.row&&h?.col===g?0:-1:z?-1:0,W=m?{"data-nav-row":-1,"data-nav-col":g}:void 0,U=e.sortable&&!w&&!e.right,G=e.sortable&&!w&&e.right,$=e.sortable&&w&&!e.right,q=e.sortable&&w&&e.right,K=Ye(e.id,n),V=et(e,d,2),J=null!=l?{width:`${l}px`,minWidth:`${l}px`,maxWidth:`${l}px`,flex:"none"}:void 0;return u.createElement(gt,{"data-column-id":e.id,className:["rdt_TableCol",V.className].filter(Boolean).join(" "),$headCell:!0,allowOverflow:e.allowOverflow,button:e.button,compact:e.compact,grow:null!=l?0:e.grow,hide:e.hide,maxWidth:null!=l?void 0:e.maxWidth,minWidth:null!=l?void 0:e.minWidth,right:e.right,center:e.center,width:null!=l?void 0:e.width,draggable:e.reorder,headStyle:f.headCells?.style,style:{...K?f.headCells?.draggingStyle:void 0,...J,...V.style,..."sticky"!==V.style.position&&{position:"relative"},...p},onDragStart:t=>{e.reorder&&"string"==typeof e.name&&Pt(t,e.name),o.onDragStart(t)},onDragOver:o.onDragOver,onDragEnd:o.onDragEnd,onDragEnter:o.onDragEnter,onDragLeave:o.onDragLeave,onPointerDown:e.reorder?o.onPointerDown:void 0,onContextMenu:x?.rightClick?t=>x.onContextMenu(e,t):void 0,...W,"data-nav-widget":m&&e.name?"true":void 0,...m&&!e.name?{role:"columnheader",tabIndex:O}:void 0},e.name&&u.createElement("div",{"data-column-id":e.id,"data-sort-id":e.id,role:"columnheader",tabIndex:O,className:["rdt_TableCol_Sortable","rdt_columnSortable",!z&&"rdt_columnSortableEnabled",!z&&L&&"rdt_columnSortableActive"].filter(Boolean).join(" "),onClick:z?void 0:e=>{D(e.ctrlKey||e.metaKey)},onKeyDown:z?void 0:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),D(e.ctrlKey||e.metaKey))},"aria-sort":z?void 0:L?"asc"===I?"ascending":"descending":"none"},!z&&q&&H(),!z&&G&&M(L),!z&&e.right&&A(),"string"==typeof e.name?u.createElement("div",{title:N?e.name:void 0,ref:B,"data-column-id":e.id,className:"rdt_columnText"},e.name):e.name,!z&&!e.right&&A(),!z&&$&&H(),!z&&U&&M(L)),e.filterable&&null!=e.id&&u.createElement(Et,{columnId:e.id,filterValue:a,filterType:e.filterType,options:r,onFilterChange:s}),x?.menuButton&&u.createElement("button",{type:"button",className:"rdt_kebabIcon","aria-label":x.ariaLabel,"aria-haspopup":"menu",onClick:t=>{t.stopPropagation(),x.onMenuButtonClick(e,t)},onPointerDown:e=>e.stopPropagation()},u.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},u.createElement("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}))),c&&null!=e.id&&u.createElement("div",{className:"rdt_resizeHandle",onPointerDown:t=>{t.stopPropagation(),c(e.id,t)},"aria-hidden":"true"}))},function(e,t){if(e.column!==t.column||e.headerMenu!==t.headerMenu||e.columnDrag!==t.columnDrag)return!1;if(e.sorting!==t.sorting){let n=e.sorting,i=t.sorting;if(n.sortMulti!==i.sortMulti||n.sortIcon!==i.sortIcon)return!1;let a=n.sortColumns.findIndex(t=>Ye(t.column.id,e.column.id)),r=i.sortColumns.findIndex(e=>Ye(e.column.id,t.column.id));if(a!==r||-1!==a&&n.sortColumns[a].sortDirection!==i.sortColumns[r].sortDirection||-1===a&&n.sortDirection!==i.sortDirection)return!1;if(n.sortMulti&&n.sortColumns.length!==i.sortColumns.length&&n.sortColumns.length>1!=i.sortColumns.length>1)return!1}if(e.draggingColumnId!==t.draggingColumnId&&Ye(e.column.id,e.draggingColumnId)!==Ye(t.column.id,t.draggingColumnId))return!1;if(e.filterValue!==t.filterValue||e.filterLocalization!==t.filterLocalization||e.resizedWidth!==t.resizedWidth||e.disabled!==t.disabled)return!1;if(e.pinnedOffsets!==t.pinnedOffsets){let n=t.column.id,i=e.pinnedOffsets?.left[n],a=t.pinnedOffsets?.left[n],r=e.pinnedOffsets?.right[n],s=t.pinnedOffsets?.right[n];if(i!==a||r!==s)return!1;let o=e.pinnedOffsets?Object.keys(e.pinnedOffsets.left).length:0,l=t.pinnedOffsets?Object.keys(t.pinnedOffsets.left).length:0,c=e.pinnedOffsets?Object.keys(e.pinnedOffsets.right).length:0,d=t.pinnedOffsets?Object.keys(t.pinnedOffsets.right).length:0;if(o!==l||c!==d)return!1}let n=e.gridStyle,i=t.gridStyle;return!(!(n===i||n&&i&&n.gridColumn===i.gridColumn&&n.gridRow===i.gridRow)||e.cellNavigation!==t.cellNavigation||e.navCol!==t.navCol)&&(!!e.cellNavigation&&-1===e.activeCell?.row&&e.activeCell?.col===e.navCol)==(!!t.cellNavigation&&-1===t.activeCell?.row&&t.activeCell?.col===t.navCol)}),Dt="input",Tt=u.memo(function({name:e,component:t=Dt,componentOptions:n={style:{}},indeterminate:i=!1,checked:a=!1,disabled:r=!1,onClick:s=$e,tabIndex:o}){let l=e=>{e&&(e.indeterminate=i)},c=u.useMemo(()=>function(e,...t){let n;for(let[i,a]of Object.entries(e))"function"==typeof a&&(n={...n??e,[i]:a(...t)});return n??e}(n,i),[n,i]);if(t!==Dt)return u.createElement(t,{type:"checkbox",ref:l,style:n.style,onClick:r?$e:s,name:e,"aria-label":e,checked:a,disabled:r,...c,...void 0!==o&&{tabIndex:o},onChange:$e});let d=["rdt_Checkbox",a&&"rdt_checked",i&&"rdt_indeterminate",r&&"rdt_disabled"].filter(Boolean).join(" ");return u.createElement("span",{className:d},u.createElement("input",{type:"checkbox",ref:l,onClick:r?$e:s,name:e,"aria-label":e,checked:a,disabled:r,tabIndex:o,onChange:$e}))}),Ft=u.createContext(null);function It(){let e=u.useContext(Ft);if(!e)throw new Error("useHeadContext must be used inside DataTable");return e}var Mt=function(){let{selectAll:e,cellNavigation:t,activeCell:n}=It();if(!e)return null;let{allSelected:i,selectedRows:a,visibleRows:r,disabled:s,keyField:o,mergeSelections:l}=e,c=a.length>0&&!i,d=s?r.filter(e=>!s(e)):r,p=0===d.length,m=Math.min(r.length,d.length),h=t&&-1===n?.row&&0===n?.col;return u.createElement(ht,{className:["rdt_TableCol","rdt_columnCheckbox"].join(" "),role:"columnheader",$headCell:!0,$noPadding:!0,tabIndex:t?-1:void 0,"data-nav-row":t?-1:void 0,"data-nav-col":t?0:void 0,"data-nav-widget":t?"true":void 0},u.createElement(Tt,{name:"Select all rows",component:e.component,componentOptions:e.componentProps,onClick:()=>{e.onSelectAllRows({type:"SELECT_ALL_ROWS",rows:d,rowCount:m,mergeSelections:l,keyField:o})},checked:i,indeterminate:c,disabled:p,tabIndex:t?h?0:-1:void 0}))},Ht=function(){let e=be();return u.createElement(ht,{className:"rdt_columnExpander",$noPadding:!0,style:e.expanderCell?.style})};function At(){return u.createElement("div",{"aria-hidden":"true",className:"rdt_rightPinSpacer",style:{flex:"1 1 auto",minWidth:0}})}var Lt=function({columns:e,columnGroups:t,selectableRows:n,expandableRows:i,expandableRowsHideExpander:a}){let{sorting:r,selectAll:s,fixedHeader:o,dense:l,draggingColumnId:c,draggingGroupKey:d,filtering:p,columnWidths:m,pinnedOffsets:h,resize:g,cellNavigation:x,activeCell:f,headerMenu:y,columnDrag:b}=It(),_={draggingGroupKey:d,onGroupDragStart:b.onGroupDragStart,onGroupDragEnter:b.onGroupDragEnter,onGroupDragOver:b.onGroupDragOver,onGroupDragEnd:b.onGroupDragEnd,onGroupPointerDown:b.onGroupPointerDown},v=e.filter(e=>!e.omit),w=t&&t.length>0,S=u.useRef(null),C=u.useRef(new Map),j=u.useRef(!1),k=u.useMemo(()=>v.map(e=>e.id).join(","),[v]),R=u.useMemo(()=>(t??[]).map(e=>e.columnIds[0]).join(","),[t]);at(()=>{let e=S.current;if(!e)return;let t=window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=j.current;j.current=!0;let i=(e,i)=>{let a=e.getBoundingClientRect().left,r=C.current.get(i);C.current.set(i,a),!(!n||t||null==r||Math.abs(r-a)<1)&&Nt(e,r-a,"X",.2)};e.querySelectorAll("[data-column-id]").forEach(e=>{i(e,`col:${e.dataset.columnId}`)}),e.querySelectorAll("[data-group-key]").forEach(e=>{i(e,`grp:${e.dataset.groupKey}`)});let a=C.current,r=j;return()=>{r.current=!1,a.clear()}},[k,R]);let E=u.useMemo(()=>{if(!t)return{};let e={};for(let n of t)e[String(n.name)]=n.columnIds.filter(e=>v.some(t=>String(t.id)===String(e))).length;return e},[t,v]),N=u.useMemo(()=>{if(!t)return new Set;let e=new Set([].concat(...t.map(e=>e.columnIds)).map(String));return new Set(v.map(e=>String(e.id)).filter(t=>!e.has(t)))},[t,v]),P=Ve(n,i,a),B=e=>({column:e,disabled:r.sortDisabled,sorting:r,filterValue:p.filterValues[e.id]??ft(e.filterType),filterLocalization:p.localization,resizedWidth:m[e.id],onFilterChange:p.onFilterChange,onResizeStart:g?.onResizeStart,pinnedOffsets:h,columnDrag:b,draggingColumnId:c,cellNavigation:x,activeCell:f,navCol:P+v.indexOf(e),headerMenu:y}),D=u.useMemo(()=>tt(e),[e]);if(w){let e=function(e,t,n){let i=[];for(let e=0;e{let n=P+t+1,i=N.has(String(e.id)),{resizedWidth:a,...r}=B(e);return u.createElement(Bt,{key:e.id,...r,gridStyle:{gridColumn:String(n),gridRow:i?"1 / span 2":"2"}})}),function(e,t,n,i,a,r){let s=[],o=0;for(;oe.columnIds.map(String).includes(c));if(e){let t=i[String(e.name)]??1,n=a+o+1,l=n+t,c=String(e.columnIds[0]),d=r?.draggingGroupKey===c;s.push(u.createElement("div",{key:c,className:["rdt_groupCell",e.reorder&&"rdt_groupCellReorder",d&&"rdt_groupCellDragging"].filter(Boolean).join(" "),draggable:e.reorder||void 0,"data-group-key":e.reorder?c:void 0,onDragStart:e.reorder?r?.onGroupDragStart:void 0,onDragEnter:e.reorder?r?.onGroupDragEnter:void 0,onDragOver:e.reorder?r?.onGroupDragOver:void 0,onDragEnd:e.reorder?r?.onGroupDragEnd:void 0,onPointerDown:e.reorder?r?.onGroupPointerDown:void 0,style:{gridColumn:`${n} / ${l}`,gridRow:"1",...d?{opacity:.5}:void 0,...e.align&&"center"!==e.align?{justifyContent:"right"===e.align?"flex-end":"flex-start"}:void 0}},e.reorder?u.createElement("span",{style:{pointerEvents:"none"}},e.name):e.name)),o+=t}else o++}}return s}(v,t,N,E,P,_)))}return u.createElement(pt,{className:"rdt_TableHead",role:"rowgroup",$fixedHeader:o},u.createElement(mt,{ref:S,className:"rdt_TableHeadRow",role:"row",$dense:l},n&&(s?.hideSelectAll?u.createElement(ht,{style:{flex:"0 0 var(--rdt-system-col-width, 48px)"}}):u.createElement(Mt,null)),i&&!a&&u.createElement(Ht,null),e.map(e=>u.createElement(u.Fragment,{key:e.id},null!=D&&e.id===D&&u.createElement(At,null),u.createElement(Bt,{...B(e)})))))},zt=u.forwardRef(function({className:e,...t},n){return u.createElement("div",{ref:n,className:["rdt_body",e].filter(Boolean).join(" "),...t})}),Ot=zt,Wt=u.createContext(null);function Ut(){let e=u.useContext(Wt);if(!e)throw new Error("useRowContext must be used inside DataTable");return e}var Gt=function({edit:e,row:t,column:n,cellNavigation:i}){let{editor:a,editing:r,editValue:s,setEditValue:o,editError:l,inputRef:c,seedValue:d,cancelEdit:p,commitEdit:m,handleInputKeyDown:h,handleCheckboxCommit:g}=e;return u.createElement(u.Fragment,null,r&&("text"===a?.type||"number"===a?.type||"date"===a?.type)&&u.createElement("input",{ref:c,type:"text"===a.type?void 0:a.type,className:"rdt_editInput",value:s,placeholder:"date"===a.type?void 0:a.placeholder,min:"text"===a.type?void 0:a.min,max:"text"===a.type?void 0:a.max,step:"number"===a.type?a.step:void 0,"aria-invalid":!!l,onChange:e=>o(e.target.value),onBlur:()=>m(),onKeyDown:h,onClick:e=>e.stopPropagation()}),"checkbox"===a?.type&&u.createElement("div",{className:"rdt_editCheckboxWrap",onClick:g,onKeyDown:e=>{(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),g(e))}},u.createElement("input",{type:"checkbox",className:"rdt_editCheckbox","aria-checked":"true"===d(),checked:"true"===d(),tabIndex:i?-1:void 0,onChange:g,onClick:e=>e.stopPropagation()})),r&&"select"===a?.type&&u.createElement("select",{ref:c,className:"rdt_editSelect",value:s,"aria-invalid":!!l,onChange:e=>{o(e.target.value),m(e.target.value)},onBlur:()=>m(),onKeyDown:h,onClick:e=>e.stopPropagation()},void 0!==a.placeholder&&u.createElement("option",{value:"",disabled:!0,hidden:!0},a.placeholder),a.options.map(e=>u.createElement("option",{key:e.value,value:e.value},"string"==typeof e.label||"number"==typeof e.label?e.label:e.value))),r&&"custom"===a?.type&&u.createElement("div",{className:"rdt_editCustomWrap",onClick:e=>e.stopPropagation()},a.render({row:t,value:s,setValue:o,commit:m,cancel:p,column:n})),l&&u.createElement("span",{className:"rdt_editErrorTip",role:"alert"},l))},$t=u.memo(function({id:e,column:t,row:n,rowIndex:i,navCol:a,dataTag:r,isDragging:s}){let o=be(),{columnDrag:l,columnWidths:c,pinnedOffsets:d,cellNavigation:p,activeCell:m}=Ut(),h=null!=t.id?c[t.id]:void 0,{conditionalStyle:g,classNames:x}=qe(n,t.conditionalCellStyles,["rdt_TableCell"]),f=function(e,t,n){let i=u.useMemo(()=>e.editor??(e.editable?{type:"text"}:void 0),[e.editor,e.editable]),[a,r]=u.useState(!1),[s,o]=u.useState(""),[l,c]=u.useState(null),d=u.useRef(null),p=u.useCallback(()=>{let i=e.selector?e.selector(t,n):void 0;return null==i?"":"boolean"==typeof i?i?"true":"false":String(i)},[e,t,n]),m=u.useCallback(()=>{i&&(o(p()),c(null),r(!0))},[i,p]);u.useEffect(()=>{a&&d.current?.focus()},[a]);let h=u.useCallback(()=>{r(!1),c(null)},[]),g=u.useCallback(n=>{let i=n??s;if(e.validate){let n=e.validate(i,t,e);if(!1===n)return void h();if("string"==typeof n)return c(n),void d.current?.focus()}r(!1),c(null),e.onCellEdit?.(t,i,e)},[e,t,s,h]);return{editor:i,editing:a,editValue:s,setEditValue:o,editError:l,inputRef:d,seedValue:p,startEdit:m,cancelEdit:h,commitEdit:g,handleInputKeyDown:e=>{"Enter"===e.key&&g(),"Escape"===e.key&&h()},handleCheckboxCommit:e=>{e.stopPropagation();let t="true"===p();g(t?"false":"true")}}}(t,n,i),{editor:y,editing:b,editError:_,startEdit:v,handleCheckboxCommit:w}=f,S=p&&null!=m&&m.row===i&&m.col===a,C=u.useRef(null),j=u.useRef(!1);u.useEffect(()=>{if(p&&S&&j.current&&!b){let e=C.current;e&&(document.activeElement===document.body||e.contains(document.activeElement))&&e.focus()}j.current=b},[p,S,b]);let k=et(t,d,1),R=y&&!b?"rdt_cellEditable":"",E=b?"rdt_cellEditing":"",N=_?"rdt_cellEditError":"";return u.createElement(gt,{ref:C,id:e,"data-column-id":t.id,role:p?"gridcell":"cell",className:[x,k.className,R,E,N].filter(Boolean).join(" "),"data-tag":r,button:t.button,center:t.center,compact:t.compact,hide:t.hide,right:t.right,...nt(t,h),cellStyle:o.cells?.style,style:{...t.style,...s?o.cells?.draggingStyle:void 0,...g,...k.style},draggable:t.reorder||void 0,onDragStart:t.reorder?l.onDragStart:void 0,onDragOver:t.reorder?l.onDragOver:void 0,onDragEnd:t.reorder?l.onDragEnd:void 0,onDragEnter:t.reorder?l.onDragEnter:void 0,onDragLeave:t.reorder?l.onDragLeave:void 0,tabIndex:p?S?0:-1:void 0,"data-nav-row":p?i:void 0,"data-nav-col":p?a:void 0,onKeyDown:p?e=>{if(!b){if(("Enter"===e.key||"F2"===e.key)&&y&&"checkbox"!==y.type)return e.preventDefault(),void v();" "===e.key&&"checkbox"===y?.type&&(e.preventDefault(),w(e))}}:void 0,onClick:y&&!b&&"checkbox"!==y.type?v:void 0},y&&u.createElement(Gt,{edit:f,row:n,column:t,cellNavigation:!!p}),!b&&"checkbox"!==y?.type&&u.createElement(u.Fragment,null,!t.cell&&u.createElement("div",{"data-tag":r,style:{whiteSpace:t.wrap?"normal":"nowrap",overflow:t.allowOverflow?"visible":"hidden",textOverflow:"ellipsis"}},function(e){return"bigint"==typeof e?e.toString():e instanceof Date?e.toLocaleString():e}(function(e,t,n,i){return t?n&&"function"==typeof n?n(e,i):t(e,i):null}(n,t.selector,t.format,i))),t.cell&&t.cell(n,i,t,e)))}),qt=function({name:e,keyField:t,row:n,rowCount:i,selected:a,selection:r,nav:s}){let{component:o,componentProps:l,single:c,disabled:d,range:p,onSelectedRow:m,onSelectedRange:h,visibleRowsRef:g,lastSelectedKeyRef:x}=r,f=!(!d||!d(n)),y=Me(n,t);return u.createElement(ht,{onClick:e=>e.stopPropagation(),className:["rdt_TableCell","rdt_cellCheckbox"].join(" "),role:s?"gridcell":"cell",$noPadding:!0,tabIndex:s?-1:void 0,"data-nav-row":s?.row,"data-nav-col":s?.col,"data-nav-widget":s?"true":void 0},u.createElement(Tt,{name:e,component:o,componentOptions:l,checked:a,"aria-checked":a,onClick:e=>{let r=e?.nativeEvent,s=!(!r||!("shiftKey"in r))&&r.shiftKey,o=x.current;if(s&&p&&!c&&null!=o&&null!=y&&o!==y){let e=g.current,n=e.findIndex(e=>Me(e,t)===o),r=e.findIndex(e=>Me(e,t)===y);if(-1!==n&&-1!==r){let[s,o]=nd(e)):void 0;return h({type:"SELECT_RANGE",keyField:t,rangeRows:l,rowCount:i,select:c,disabledRows:p}),void(x.current=y)}}m({type:"SELECT_SINGLE_ROW",row:n,isSelected:a,keyField:t,rowCount:i,singleSelect:c}),He(y)||(x.current=y)},disabled:f,tabIndex:s?s.active?0:-1:void 0}))},Kt=function({disabled:e=!1,expanded:t=!1,expandableIcon:n,expandableRowsOptions:i,id:a,row:r,onToggled:s,tabIndex:o}){let l=be(),c=t?n.expanded:n.collapsed;return u.createElement("button",{className:"rdt_expanderButton",style:l.expanderButton?.style,"aria-disabled":e,onClick:()=>s&&s(r),"data-testid":`expander-button-${a}`,disabled:e,tabIndex:o,"aria-label":t?i?.collapseRowAriaLabel??"Collapse Row":i?.expandRowAriaLabel??"Expand Row",type:"button"},c)},Vt=function({row:e,expanded:t=!1,expandableIcon:n,expandableRowsOptions:i,id:a,onToggled:r,disabled:s=!1,nav:o}){let l=be();return u.createElement(ht,{onClick:e=>e.stopPropagation(),className:"rdt_cellExpander",$noPadding:!0,style:l.expanderCell?.style,role:o?"gridcell":void 0,tabIndex:o?-1:void 0,"data-nav-row":o?.row,"data-nav-col":o?.col,"data-nav-widget":o?"true":void 0},u.createElement(Kt,{id:a,row:e,expanded:t,expandableIcon:n,expandableRowsOptions:i,disabled:s,onToggled:r,tabIndex:o?o.active?0:-1:void 0}))},Jt=u.memo(function({data:e,ExpanderComponent:t,expanderComponentProps:n,extendedRowStyle:i,extendedClassNames:a,animate:r,closing:s}){let o=be(),l=["rdt_ExpanderRow","rdt_expanderRow",...a.split(" ").filter(e=>"rdt_TableRow"!==e)].join(" ");return u.createElement("div",{className:r?s?"rdt_expanderRowAnimated rdt_expanderRowClosing":"rdt_expanderRowAnimated":void 0},u.createElement("div",{className:l,style:{...o.expanderRow?.style,...i}},u.createElement(t,{data:e,...n})))});function Yt(e,t){switch(t.type){case"open":return{expanded:!0,mounted:!0,closing:!1};case"close":return{...e,expanded:!1,closing:!0};case"unmount":return{expanded:!1,mounted:!1,closing:!1};case"sync":return{expanded:t.value,mounted:t.value,closing:!1};default:return e}}function Xt(e){return e.target.getAttribute("data-tag")===Pe}var Qt=u.memo(function({defaultExpanded:e=!1,defaultExpanderDisabled:t=!1,draggingColumnId:n,id:i,isNew:a,newRowIndex:r,row:s,rowCount:o,rowIndex:l,selected:c}){let d=be(),{columns:p,conditionalRowStyles:m,dense:h,expansion:g,highlightOnHover:x,keyField:f,rowEvents:y,selection:b,pointerOnHover:_,striped:v,cellNavigation:w,activeCell:S,animateRows:C,rowMenu:j}=Ut(),{expanded:k,expanderMounted:R,isClosing:E,openExpander:N,closeExpander:P}=function(e,t){let[n,i]=u.useReducer(Yt,{expanded:e,mounted:e,closing:!1});u.useEffect(()=>{i({type:"sync",value:e})},[e]);let a=u.useRef(null),r=u.useCallback(()=>{a.current&&clearTimeout(a.current),i({type:"open"})},[]),s=u.useCallback(()=>{t?(i({type:"close"}),a.current=setTimeout(()=>{i({type:"unmount"})},220)):i({type:"unmount"})},[t]);return{expanded:n.expanded,expanderMounted:n.mounted,isClosing:n.closing,openExpander:r,closeExpander:s}}(e,C),B=!!b,D=!!g,T=!!g?.expandOnRowClicked,F=!!g?.expandOnRowDoubleClicked,I=!!g?.hideExpander,M=g?.onToggled,H=u.useCallback(()=>{let e=!k;M?.(e,s),e?N():P()},[k,M,s,N,P]),{onRowClicked:A,onRowDoubleClicked:L,onRowMiddleClicked:z,onRowMouseEnter:O,onRowMouseLeave:W}=y,U=_||D&&(T||F),G=u.useCallback(e=>{Xt(e)&&(A(s,e),!t&&D&&T&&H())},[t,T,D,H,A,s]),$=u.useCallback(e=>{e.target===e.currentTarget&&"Enter"===e.key&&(!t&&D&&T&&H(),A(s,e))},[t,D,T,H,A,s]),q=u.useCallback(e=>{Xt(e)&&(L(s,e),!t&&D&&F&&H())},[t,F,D,H,L,s]),K=u.useCallback(e=>{Xt(e)&&z(s,e)},[z,s]),V=j?.onContextMenu,J=u.useCallback(e=>V?.(s,l,e),[V,s,l]),Y=u.useCallback(e=>O(s,e),[O,s]),X=u.useCallback(e=>W(s,e),[W,s]),Q=Me(s,f)??l,Z=Ve(B,D,I),ee=u.useMemo(()=>{let e=new Map,t=0;for(let n of p)n.omit||e.set(n,t++);return e},[p]),te=w&&S?.row===l,ne=u.useMemo(()=>tt(p),[p]),{conditionalStyle:ie,classNames:ae}=u.useMemo(()=>qe(s,m,["rdt_TableRow"]),[s,m]),re=!!b?.highlight&&c,se=g?.inheritConditionalStyles?ie:{},oe=v&&function(e){return e%2==0}(l),le=C&&a,ce=[ae,"rdt_row",h&&"rdt_rowDense",oe&&"rdt_rowStriped",re&&"rdt_rowSelected",x&&"rdt_rowHighlight",!t&&U&&"rdt_rowPointer",le&&"rdt_animatedRow"].filter(Boolean).join(" "),de={...d.rows?.style,...h&&d.rows?.denseStyle,...oe&&d.rows?.stripedStyle,...re&&d.rows?.selectedHighlightStyle,...ie,...le?{"--rdt-row-index":r}:null};return u.createElement(u.Fragment,null,u.createElement("div",{id:`row-${i}`,role:"row","aria-selected":B?c:void 0,tabIndex:w?-1:!t&&U?0:-1,className:ce,style:de,onClick:G,onKeyDown:$,onDoubleClick:q,onAuxClick:K,onContextMenu:j?.rightClick?J:void 0,onMouseEnter:Y,onMouseLeave:X},b&&u.createElement(qt,{name:`Select row ${Q}`,keyField:f,row:s,rowCount:o,selected:c,selection:b,nav:w?{row:l,col:0,active:te&&0===S?.col}:void 0}),g&&!g.hideExpander&&u.createElement(Vt,{id:Q,expandableIcon:g.icon,expandableRowsOptions:g.localization,expanded:k,row:s,onToggled:H,disabled:t,nav:w?{row:l,col:B?1:0,active:te&&S?.col===(B?1:0)}:void 0}),p.map(e=>e.omit?null:u.createElement(u.Fragment,{key:`cell-${e.id}-${Q}`},null!=ne&&e.id===ne&&u.createElement(At,null),u.createElement($t,{id:`cell-${e.id}-${Q}`,dataTag:e.ignoreRowClick||e.button?null:Pe,column:e,row:s,rowIndex:l,navCol:Z+(ee.get(e)??0),isDragging:Ye(n,e.id)}))),j?.menuButton&&u.createElement("div",{className:"rdt_rowKebabCell"+("start"===j.menuButtonPosition?" rdt_rowKebabStart":"")},u.createElement("button",{type:"button",className:"rdt_kebabIcon rdt_rowKebab","aria-label":j.ariaLabel,"aria-haspopup":"menu",onClick:e=>{e.stopPropagation(),j.onMenuButtonClick(s,l,e)}},u.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},u.createElement("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}))))),g&&R&&g.component&&u.createElement(Jt,{key:`expander-${Q}`,data:s,extendedRowStyle:se,extendedClassNames:ae,ExpanderComponent:g.component,expanderComponentProps:g.componentProps??{},animate:C,closing:E}))},function(e,t){return!(e.row!==t.row||e.selected!==t.selected||e.defaultExpanded!==t.defaultExpanded||e.defaultExpanderDisabled!==t.defaultExpanderDisabled||e.draggingColumnId!==t.draggingColumnId||e.rowCount!==t.rowCount||e.rowIndex!==t.rowIndex||e.isNew!==t.isNew||e.newRowIndex!==t.newRowIndex)});function Zt({style:e,...t}){let n=be();return u.createElement("div",{role:"status",className:"rdt_noData",style:{...n.noData?.style,...e},...t})}function en({basis:e}){return u.createElement("div",{className:"rdt_cellBase",style:{flex:`1 1 ${e}`,minWidth:0,padding:"8px 16px",display:"flex",alignItems:"center"}},u.createElement("div",{className:"rdt_skeletonPulse",style:{height:14,borderRadius:4,width:"70%"}}))}function tn({colCount:e,index:t}){return u.createElement("div",{className:"rdt_row","aria-hidden":"true",style:{opacity:1-.15*t,minHeight:48}},Array.from({length:e}).map((e,t)=>u.createElement(en,{key:t,basis:0===t?"160px":"120px"})))}var nn=function({tableRows:e,sortedData:t,selectedRows:n,keyField:i,isBusy:a,columnCount:r,noDataComponent:s,progressComponent:o,expandableRowExpanded:l,expandableRowDisabled:c,bodyRef:d,prevRowTopsRef:p}){let{expansion:m,animateRows:h}=Ut(),g=t.length>0,x=u.useMemo(()=>new Set(n.map(e=>Me(e,i))),[n,i]),[f,y]=u.useReducer(()=>!0,!1);u.useEffect(()=>{y()},[]);let b=u.useMemo(()=>new Set,[i]),_=u.useRef(b);at(()=>{_.current=b},[b]);let[,v]=u.useReducer(e=>e+1,0);at(()=>{if(!h||!f)return void(p.current=new Map);let e=window.matchMedia("(prefers-reduced-motion: reduce)").matches,t=d.current;if(!t)return;let n=p.current;if(0===n.size)return;let i=!1;t.querySelectorAll('[id^="row-"]').forEach(t=>{let a=t.id.slice(4),r=t.getBoundingClientRect().top,s=n.get(a);if(null==s)return _.current.delete(a),void(i=!0);e||Math.abs(s-r)<1||Nt(t,s-r,"Y",.22)}),p.current=new Map,i&&v()},[e]);let w=u.useMemo(()=>{let t=0;return e.map((e,a)=>{let r=Me(e,i),s=He(r)?a:r,o=He(r)?n.includes(e):x.has(r),l=h&&f&&!b.has(s);return{row:e,id:s,selected:o,isNew:l,newRowIndex:l?Math.min(t++,10):0}})},[e,i,n,x,h,f,b]);return u.useEffect(()=>{if(h)for(let e of w)e.isNew&&_.current.add(e.id)},[w,h]),u.createElement(u.Fragment,null,!g&&!a&&u.createElement(Zt,null,s),a&&!g&&u.createElement(Ot,{className:"rdt_TableBody",role:"rowgroup"},Array.from({length:5}).map((e,t)=>u.createElement(tn,{key:t,colCount:r,index:t}))),g&&u.createElement("div",{style:{position:"relative"}},u.createElement(Ot,{ref:d,className:"rdt_TableBody"+(a?" rdt_bodyBusy":""),role:"rowgroup"},w.map((e,n)=>{let{row:i,id:a,selected:r,isNew:s,newRowIndex:o}=e,d=!!(m&&l&&l(i)),p=!!(m&&c&&c(i));return u.createElement(Qt,{id:a,key:a,"data-row-id":a,row:i,rowCount:t.length,rowIndex:n,selected:r,isNew:s,newRowIndex:o,defaultExpanded:d,defaultExpanderDisabled:p})})),a&&u.createElement("div",{className:"rdt_bodyOverlay","aria-hidden":"true"},o)))},an=u.memo(function({Pagination:e,onChangePage:t,onChangeRowsPerPage:n,rowCount:i,currentPage:a,rowsPerPage:r,direction:s,paginationRowsPerPageOptions:o,paginationIcons:l,paginationComponentOptions:c,localization:d,position:p}){let m="1px solid var(--rdt-color-divider, rgba(0, 0, 0, 0.12))";return u.createElement("div",{style:"top"===p?{borderBottom:m}:{borderTop:m}},u.createElement(e,{onChangePage:t,onChangeRowsPerPage:n,rowCount:i,currentPage:a,rowsPerPage:r,direction:s,paginationRowsPerPageOptions:o,paginationIcons:l,paginationComponentOptions:c,localization:d}))}),rn=function({columns:e,rows:t,selectableRows:n,expandableRows:i,expandableRowsHideExpander:a,footerComponent:r}){let s=be(),{columnWidths:o,pinnedOffsets:l,cellNavigation:c}=Ut(),d=u.useMemo(()=>tt(e),[e]),p={...s.footer?.style};return r?u.createElement("div",{role:"rowgroup",className:"rdt_footer",style:p},u.createElement(r,{rows:t,columns:e})):u.createElement("div",{role:"rowgroup",className:"rdt_footer",style:p},u.createElement("div",{role:"row",className:"rdt_footerRow"},n&&u.createElement("div",{"aria-hidden":"true",className:"rdt_cellBase rdt_footerSystemCell"}),i&&!a&&u.createElement("div",{"aria-hidden":"true",className:"rdt_cellBase rdt_footerSystemCell"}),e.map(e=>{if(e.omit)return null;let n=null!=e.id?o[e.id]:void 0,i=et(e,l,1);return u.createElement(u.Fragment,{key:`footer-${e.id}`},null!=d&&e.id===d&&u.createElement(At,null),u.createElement(gt,{role:c?"gridcell":"cell","data-column-id":e.id,className:["rdt_footerCell",i.className].filter(Boolean).join(" "),button:e.button,center:e.center,compact:e.compact,hide:e.hide,right:e.right,...nt(e,n),cellStyle:s.footerCells?.style,style:{...e.style,...i.style}},function(e,t){return null==e?null:"function"==typeof e?e(t):e}(e.footer,t)))})))};function sn({scrollRef:e,leftInset:t,rightInset:n}){let i=u.useId(),a=u.useRef(null),r=u.useRef(null),[s,o]=u.useState(0),[l,c]=u.useState(0),[d,p]=u.useState(!1),[m,h]=u.useState(0),g=u.useRef(!1),x=u.useRef(0),f=u.useRef(0),y=u.useCallback(()=>{let t=e.current;if(!t)return;let{scrollWidth:n,clientWidth:i,scrollLeft:r}=t,s=n>i;if(p(s),!s)return;let l=a.current?.clientWidth??0;if(0===l)return;let d=i/n,u=Math.max(d*l,30),m=l-u,g=n-i,x="rtl"===getComputedStyle(t).direction,f=x?r+g:r;o(u),c(f/g*m);let y=x?-r:r;h(g>0?Math.round(y/g*100):0)},[e]);u.useEffect(()=>{let t=e.current;if(!t)return;t.id||(t.id=i),t.addEventListener("scroll",y,{passive:!0});let n=new ResizeObserver(y);return n.observe(t),t.firstElementChild&&n.observe(t.firstElementChild),y(),()=>{t.removeEventListener("scroll",y),n.disconnect()}},[e,i,y]);let b=u.useCallback(t=>{t.preventDefault();let n=e.current;if(!n)return;g.current=!0,x.current=t.clientX,f.current=n.scrollLeft;let i=e=>{if(!g.current)return;let t=a.current;if(!n||!t)return;let{scrollWidth:i,clientWidth:r}=n,s=t.clientWidth,o=s-Math.max(r/i*s,30),l=i-r,c=(e.clientX-x.current)/o*l,d="rtl"===getComputedStyle(n).direction,p=d?-l:0,u=d?0:l;n.scrollLeft=Math.max(p,Math.min(u,f.current+c))},r=()=>{g.current=!1,window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",r)};window.addEventListener("mousemove",i),window.addEventListener("mouseup",r)},[e]),_=u.useCallback(t=>{let n=e.current;if(!n)return;let i=.1*n.clientWidth;"ArrowLeft"===t.key?(t.preventDefault(),n.scrollLeft-=i):"ArrowRight"===t.key?(t.preventDefault(),n.scrollLeft+=i):"Home"===t.key?(t.preventDefault(),n.scrollLeft=0):"End"===t.key&&(t.preventDefault(),n.scrollLeft="rtl"===getComputedStyle(n).direction?-n.scrollWidth:n.scrollWidth)},[e]),v=u.useCallback(t=>{let n=r.current;if(n&&n.contains(t.target))return;let i=e.current,s=a.current;if(!i||!s)return;let o=s.getBoundingClientRect(),c=t.clientX-o.left,{scrollWidth:d,clientWidth:p}=i,u=c0&&t.every(e=>e.startsWith("--"))}function pn(e){return e&&"string"!=typeof e?dn(e)?cn.default:Ie(cn.default,e):cn[e]??cn.default}var un=(e,t)=>{let n=u.useRef(!0);u.useEffect(()=>{n.current?n.current=!1:e()},t)},mn={column:"data-column-id",group:"data-group-key"};function hn(e,t){let n=!e.toggleOnSelectedRowsChange;switch(t.type){case"SELECT_ALL_ROWS":{let{keyField:n,rows:i,rowCount:a,mergeSelections:r}=t,s=!e.allSelected,o=!e.toggleOnSelectedRowsChange;if(r){let t=s?[...e.selectedRows,...i.filter(t=>!Ke(t,e.selectedRows,n))]:e.selectedRows.filter(e=>!Ke(e,i,n));return{...e,allSelected:s,selectedCount:t.length,selectedRows:t,toggleOnSelectedRowsChange:o}}return{...e,allSelected:s,selectedCount:s?a:0,selectedRows:s?i:[],toggleOnSelectedRowsChange:o}}case"SELECT_SINGLE_ROW":{let{keyField:i,row:a,isSelected:r,rowCount:s,singleSelect:o}=t;return o?r?{...e,selectedCount:0,allSelected:!1,selectedRows:[],toggleOnSelectedRowsChange:n}:{...e,selectedCount:1,allSelected:!1,selectedRows:[a],toggleOnSelectedRowsChange:n}:r?{...e,selectedCount:e.selectedRows.length>0?e.selectedRows.length-1:0,allSelected:!1,selectedRows:Oe(e.selectedRows,a,i),toggleOnSelectedRowsChange:n}:{...e,selectedCount:e.selectedRows.length+1,allSelected:e.selectedRows.length+1===s,selectedRows:ze(e.selectedRows,a),toggleOnSelectedRowsChange:n}}case"SELECT_RANGE":{let i,{keyField:a,rangeRows:r,rowCount:s,select:o,disabledRows:l}=t,c=l&&l.length>0?new Set(l):null,d=c?r.filter(e=>!c.has(e)):r;return i=o?[...e.selectedRows,...d.filter(t=>!Ke(t,e.selectedRows,a))]:e.selectedRows.filter(e=>!Ke(e,d,a)),{...e,selectedRows:i,selectedCount:i.length,allSelected:i.length===s&&s>0,toggleOnSelectedRowsChange:n}}case"SELECT_MULTIPLE_ROWS":{let{keyField:i,selectedRows:a,totalRows:r,mergeSelections:s}=t;if(s){let t=[...e.selectedRows,...a.filter(t=>!Ke(t,e.selectedRows,i))];return{...e,selectedCount:t.length,allSelected:!1,selectedRows:t,toggleOnSelectedRowsChange:n}}return{...e,selectedCount:a.length,allSelected:a.length===r,selectedRows:a,toggleOnSelectedRowsChange:n}}case"CLEAR_SELECTED_ROWS":{let{selectedRowsFlag:n}=t;return{...e,allSelected:!1,selectedCount:0,selectedRows:[],selectedRowsFlag:n}}case"CLEAR_SORT":{let{defaultSortColumn:n,defaultSortDirection:i}=t,a=null!=n.id||!!n.selector;return{...e,selectedColumn:n,sortDirection:i,sortColumns:a?[{column:n,sortDirection:i}]:[]}}case"SORT_CHANGE":{let i,{selectedColumn:a,clearSelectedOnSort:r,additive:s,defaultSortDirection:o,direction:l}=t,c=o,d="asc"===c?"desc":"asc",p=e.sortColumns.findIndex(e=>Ye(e.column.id,a.id));i=l?s?-1===p?[...e.sortColumns,{column:a,sortDirection:l}]:e.sortColumns.map((e,t)=>t===p?{column:a,sortDirection:l}:e):[{column:a,sortDirection:l}]:s?-1===p?[...e.sortColumns,{column:a,sortDirection:c}]:e.sortColumns[p].sortDirection===c?e.sortColumns.map((e,t)=>t===p?{column:a,sortDirection:d}:e):e.sortColumns.filter((e,t)=>t!==p):1===e.sortColumns.length&&0===p?e.sortColumns[0].sortDirection===c?[{column:a,sortDirection:d}]:[]:[{column:a,sortDirection:c}];let u=i[0];return{...e,selectedColumn:u?u.column:{},sortDirection:u?u.sortDirection:o,sortColumns:i,currentPage:1,sortTriggeredPageReset:!0,...r&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n}}}case"CHANGE_PAGE":{let{page:i,paginationServer:a,visibleOnly:r,persistSelectedOnPageChange:s}=t;return{...e,currentPage:i,sortTriggeredPageReset:!1,...a&&s&&{allSelected:!1},...(a&&!s||r)&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n}}}case"CHANGE_ROWS_PER_PAGE":{let{rowsPerPage:n,page:i}=t;return{...e,currentPage:i,rowsPerPage:n,sortTriggeredPageReset:!1}}default:return t}}function gn(){if(typeof window>"u")return!1;let e=localStorage.getItem("theme");return e?"dark"===e:document.documentElement.classList.contains("dark")||window.matchMedia("(prefers-color-scheme: dark)").matches}var xn=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"];function fn({groups:e,position:t,anchorRect:n,isRTL:i,ariaLabel:a,onSelect:r,onClose:s}){let o=u.useRef(null);at(()=>{let e=o.current;if(!e)return;let a=e.getBoundingClientRect(),r=n?i?n.right-a.width:n.left:t.x,s=n?n.bottom+4:t.y;if(r+a.width>window.innerWidth-8&&(r=window.innerWidth-a.width-8),r=Math.max(8,r),s+a.height>window.innerHeight-8){let e=(n?n.top-4:t.y)-a.height;s=e>=8?e:Math.max(8,window.innerHeight-a.height-8)}e.style.left=`${r}px`,e.style.top=`${s}px`,e.style.visibility="visible"},[t,n,i]),u.useEffect(()=>{function e(e){o.current&&!o.current.contains(e.target)&&s(!1)}function t(e){o.current&&e.target instanceof Node&&o.current.contains(e.target)||s(!1)}function n(){s(!1)}return o.current?.querySelector('[role="menuitem"]:not([aria-disabled="true"])')?.focus(),document.addEventListener("pointerdown",e),window.addEventListener("scroll",t,!0),window.addEventListener("resize",n),()=>{document.removeEventListener("pointerdown",e),window.removeEventListener("scroll",t,!0),window.removeEventListener("resize",n)}},[s]);let l=e.filter(e=>e.length>0);return u.createElement("div",{ref:o,className:"rdt_contextMenu",role:"menu","aria-label":a,tabIndex:-1,style:{position:"fixed",top:t.y,left:t.x,visibility:"hidden"},onKeyDown:e=>{if("Escape"===e.key)return e.stopPropagation(),void s(!0);if("Tab"===e.key)return void s(!1);if("ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Home"!==e.key&&"End"!==e.key)return;e.preventDefault();let t=Array.from(o.current?.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')??[]);if(0===t.length)return;let n,i=t.indexOf(document.activeElement);n="Home"===e.key?0:"End"===e.key?t.length-1:"ArrowDown"===e.key?-1===i?0:(i+1)%t.length:i<=0?t.length-1:i-1,t[n].focus()},onContextMenu:e=>e.preventDefault()},l.map((e,t)=>u.createElement(u.Fragment,{key:t},t>0&&u.createElement("div",{className:"rdt_contextMenuSeparator",role:"separator"}),e.map(e=>u.createElement("button",{key:e.id,type:"button",role:"menuitem",className:"rdt_contextMenuItem",tabIndex:-1,disabled:e.disabled,"aria-disabled":e.disabled||void 0,onClick:()=>r(e)},e.icon&&u.createElement("span",{className:"rdt_contextMenuItemIcon","aria-hidden":"true"},e.icon),e.label)))))}var yn=u.forwardRef(function(e,t){let{data:n=lt.data,columns:i=lt.columns,title:a=lt.title,actions:r=lt.actions,keyField:s=lt.keyField,striped:o=lt.striped,highlightOnHover:l=lt.highlightOnHover,pointerOnHover:c=lt.pointerOnHover,dense:d=lt.dense,selectableRows:p=lt.selectableRows,selectableRowsSingle:m=lt.selectableRowsSingle,selectableRowsHighlight:h=lt.selectableRowsHighlight,selectableRowsNoSelectAll:g=lt.selectableRowsNoSelectAll,selectableRowsVisibleOnly:x=lt.selectableRowsVisibleOnly,selectableRowsRange:f=!0,selectableRowSelected:y=lt.selectableRowSelected,selectableRowDisabled:b=lt.selectableRowDisabled,selectableRowsComponent:_,selectableRowsComponentProps:v,selectedRows:w,onRowExpandToggled:S=lt.onRowExpandToggled,onSelectedRowsChange:C=lt.onSelectedRowsChange,onChangeRowsPerPage:j=lt.onChangeRowsPerPage,onChangePage:k=lt.onChangePage,paginationServer:R=lt.paginationServer,paginationServerOptions:E=lt.paginationServerOptions,paginationTotalRows:N=lt.paginationTotalRows,paginationDefaultPage:P=lt.paginationDefaultPage,paginationPage:B,paginationResetDefaultPage:D=lt.paginationResetDefaultPage,paginationPerPage:T=lt.paginationPerPage,paginationPosition:F=lt.paginationPosition,paginationRowsPerPageOptions:I=lt.paginationRowsPerPageOptions,paginationComponent:M=lt.paginationComponent,paginationComponentOptions:H=lt.paginationComponentOptions,responsive:A=lt.responsive,progressPending:L=lt.progressPending,progressComponent:z=lt.progressComponent,persistTableHead:O=lt.persistTableHead,noDataComponent:W=lt.noDataComponent,disabled:U=lt.disabled,noTableHead:G=lt.noTableHead,noHeader:$=lt.noHeader,fixedHeader:q=lt.fixedHeader,fixedHeaderScrollHeight:K=lt.fixedHeaderScrollHeight,pagination:V=lt.pagination,subHeader:J=lt.subHeader,subHeaderAlign:Y=lt.subHeaderAlign,subHeaderWrap:X=lt.subHeaderWrap,expandableRows:Q=lt.expandableRows,onRowClicked:Z=lt.onRowClicked,onRowDoubleClicked:ee=lt.onRowDoubleClicked,onRowMiddleClicked:te=lt.onRowMiddleClicked,onRowMouseEnter:ne=lt.onRowMouseEnter,onRowMouseLeave:ie=lt.onRowMouseLeave,onScroll:ae,onSort:re=lt.onSort,sortFunction:se=lt.sortFunction,sortServer:oe=lt.sortServer,sortMulti:le=lt.sortMulti,expandableRowsComponent:ce=lt.expandableRowsComponent,expandableRowsComponentProps:de=lt.expandableRowsComponentProps,expandableRowDisabled:pe=lt.expandableRowDisabled,expandableRowsHideExpander:ue=lt.expandableRowsHideExpander,expandOnRowClicked:me=lt.expandOnRowClicked,expandOnRowDoubleClicked:he=lt.expandOnRowDoubleClicked,expandableRowExpanded:ge=lt.expandableRowExpanded,expandableInheritConditionalStyles:xe=lt.expandableInheritConditionalStyles,defaultSortFieldId:fe=lt.defaultSortFieldId,defaultSortAsc:be=lt.defaultSortAsc,conditionalRowStyles:we=lt.conditionalRowStyles,theme:Ce=lt.theme,colorMode:Re=lt.colorMode,customStyles:Ee=lt.customStyles,direction:Ne=lt.direction,onColumnOrderChange:Pe=lt.onColumnOrderChange,onColumnGroupOrderChange:Be,columnGroups:De,filterValues:Te,onFilterChange:Fe,contextMenu:Me,contextMenuActions:He,onContextMenuAction:ze,localization:Oe,columnFilterOptions:$e,expandableRowsOptions:qe,resizable:Ke=!1,initialColumnWidths:et,onColumnResize:tt,animateRows:nt=!1,cellNavigation:ct=!1,columnSeparator:pt,headerSeparator:ut,footerComponent:mt,showFooter:ht,className:gt,ariaLabel:xt}=e,wt=u.useMemo(()=>({...Oe,filter:{...$e,...Oe?.filter},expandable:{...qe,...Oe?.expandable},contextMenu:Oe?.contextMenu??{}}),[Oe,$e,qe]),{sortIcon:St,expandableIcon:Ct,paginationIcons:jt,clearSelectedRows:kt=lt.clearSelectedRows}=e,Rt=u.useMemo(()=>pn(Ce),[Ce]),Et=St??Rt.icons?.sort??null,Nt=u.useMemo(()=>({...ot,...Rt.icons?.expandable,...Ct}),[Rt,Ct]),Bt={...st,...Rt.icons?.pagination,...jt},Dt=_??lt.selectableRowsComponent,Tt=v??lt.selectableRowsComponentProps;u.useEffect(()=>{p&&n.length>0&&void 0===n[0][s]&&console.warn(`DataTable: keyField "${s}" returned undefined for your data. Row selection requires a stable unique identifier — set the keyField prop to the unique identifier field in your row data.`)},[]);let It=u.useId(),{filterValues:Mt,handleFilterChange:Ht,filteredData:At,filtering:zt}=function(e,t,n,i=vt){let[a,r]=u.useState({}),s=t??a,o=u.useCallback((e,t)=>{n?n(e,t):r(n=>({...n,[e]:t}))},[n]),l=u.useMemo(()=>Object.entries(s).filter(([,e])=>bt(e)),[s]),c=u.useCallback(t=>0===l.length?t:t.filter(t=>l.every(([n,i])=>{let a=e.find(e=>String(e.id)===n);return!a||function(e,t,n){let i=n.filterType??"text";if(n.filterFunction)return n.filterFunction(e,t);let a=n.selector?n.selector(e):"",r=String(a??""),s=_t(t.condition1,r,i);if(t.condition2&&yt(t.condition2)){let e=_t(t.condition2,r,i);return"OR"===t.logic?s||e:s&&e}return s}(t,i,a)})),[l,e]),d=u.useMemo(()=>({filterValues:s,localization:i,onFilterChange:o}),[s,i,o]);return{filterValues:s,handleFilterChange:o,filteredData:c,filtering:d}}(i,Te,Fe,wt.filter),Ot=rt(Ne),{columnWidths:Ut,handleResizeStart:Gt}=function({initialColumnWidths:e,onColumnResize:t,isRTL:n=!1}={}){let[i,a]=u.useState(e??{}),r=u.useRef(null),s=u.useRef(t),o=u.useRef(n);at(()=>{s.current=t,o.current=n});let l=u.useCallback((e,t)=>{if(typeof document>"u")return;t.preventDefault();let n=t.currentTarget.closest("[data-column-id]")?.offsetWidth??100;function i(e){if(!r.current)return;let{columnId:t}=r.current,n=(e.clientX-r.current.startX)*(o.current?-1:1),i=Math.max(40,r.current.startWidth+n);a(e=>({...e,[t]:i}))}r.current={columnId:e,startX:t.clientX,startWidth:n},document.addEventListener("pointermove",i),document.addEventListener("pointerup",function e(){if(r.current){let{columnId:e}=r.current;a(t=>{let n=t[e];return null!=n&&s.current?.(e,n,t),t})}r.current=null,document.removeEventListener("pointermove",i),document.removeEventListener("pointerup",e)})},[]);return{columnWidths:i,handleResizeStart:l}}({initialColumnWidths:et,onColumnResize:tt,isRTL:Ot}),$t=function(e,t){return u.useMemo(()=>e?{onResizeStart:t}:null,[e,t])}(Ke,Gt),{tableColumns:qt,tableGroups:Kt,draggingColumnId:Vt,draggingGroupKey:Jt,columnDrag:Yt,handlePinColumn:Xt,handleHideColumn:Qt,handleResetColumns:Zt,defaultSortDirection:en,defaultSortColumn:tn}=function(e,t,n,i,a,r){let[s,o]=u.useState(()=>We(e)),[l,c]=u.useState(()=>i??[]),[d,p]=u.useState(""),[m,h]=u.useState(""),g=u.useRef(""),x=u.useRef(""),f=u.useRef(!1);un(()=>{o(We(e))},[e]),un(()=>{c(i??[])},[i]);let y=u.useCallback(e=>{if(!g.current||e===g.current||l.length>0&&!(l.find(e=>e.columnIds.some(e=>String(e)===g.current))?.columnIds??[]).some(t=>String(t)===e))return;let n=Je(s,g.current),i=Je(s,e);if(-1===n||-1===i)return;let a=[...s],[r]=a.splice(n,1);a.splice(i,0,r);let c=a.filter(e=>"left"===e.pinned).length,d=a.filter(e=>"right"===e.pinned).length,p={};for(let e=0;e{let i=t[n];if(i)return{...e,pinned:i};let{pinned:a,...r}=e;return r});let n=e.filter(e=>"left"===e.pinned).length,i=e.filter(e=>"right"===e.pinned).length;return 0===n&&0===i?e:e.map((t,a)=>{if(a0&&a>=e.length-i)return{...t,pinned:"right"};let{pinned:r,...s}=t;return s})}(a,p);o(u),t(u)},[t,s,l]),b=u.useCallback(e=>{if(f.current)return;let{attributes:t}=e.target,n=t.getNamedItem("data-column-id")?.value;n&&(g.current=s[Je(s,n)]?.id?.toString()||"",p(g.current))},[s]),_=u.useCallback(e=>{if(f.current)return;let t=e.currentTarget;if(t.contains(e.relatedTarget))return;let n=t.getAttribute("data-column-id");n&&y(n)},[y]),v=u.useCallback(e=>{e.preventDefault()},[]),w=u.useCallback(e=>{e.preventDefault()},[]),S=u.useCallback(e=>{e.preventDefault(),g.current="",p("")},[]),C=u.useCallback(e=>{let t=e.currentTarget.getAttribute("data-group-key");if(t){f.current=!0,x.current=t,h(t);let n=l.find(e=>String(e.columnIds[0])===t);Pt(e,"string"==typeof n?.name?n.name:"")}},[l]),j=u.useCallback(e=>{if(!x.current||e===x.current)return;let i=l.find(e=>String(e.columnIds[0])===x.current),a=l.find(t=>String(t.columnIds[0])===e);if(!i||!a)return;let r=new Set(i.columnIds.map(String)),d=new Set(a.columnIds.map(String)),p=function(e,t,n){let i=[],a=e.filter(e=>t.has(String(e.id))),r=e.filter(e=>n.has(String(e.id))),s=!1,o=!1;for(let l of e){let e=String(l.id);t.has(e)?s||(i.push(...r),s=!0):n.has(e)?o||(i.push(...a),o=!0):i.push(l)}return i}(s,r,d),u=l.indexOf(i),m=l.indexOf(a),h=[...l];h[u]=a,h[m]=i,o(p),c(h),t(p),n?.(h,p)},[n,t,s,l]),k=u.useCallback(e=>{e.preventDefault();let t=e.currentTarget;if(t.contains(e.relatedTarget))return;let n=t.getAttribute("data-group-key");n&&j(n)},[j]),R=u.useCallback(e=>{e.preventDefault()},[]),E=u.useCallback(e=>{e.preventDefault(),f.current=!1,x.current="",h("")},[]),{handlePointerDown:N,handleGroupPointerDown:P}=function({onGrab:e,onMove:t,onRelease:n}){let i=u.useRef({onGrab:e,onMove:t,onRelease:n});u.useEffect(()=>{i.current={onGrab:e,onMove:t,onRelease:n}},[e,t,n]);let a=u.useRef(null),r=u.useCallback((e,t)=>{if(typeof document>"u"||"mouse"===t.pointerType)return;let n=t.currentTarget.getAttribute(mn[e]);if(!n)return;let r=t.pointerId;function s(t){let n=a.current;if(!n||t.pointerId!==n.pointerId||!n.active)return;t.preventDefault();let r=document.elementFromPoint(t.clientX,t.clientY)?.closest(`[${mn[e]}]`)?.getAttribute(mn[e]);r&&i.current.onMove(e,r)}function o(){let t=a.current;t&&(clearTimeout(t.longPressTimer),i.current.onRelease(e),document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",o),document.removeEventListener("pointercancel",o),a.current=null)}let l=setTimeout(()=>{let t=a.current;t&&(t.active=!0,i.current.onGrab(e,n))},250);a.current={pointerId:r,longPressTimer:l,active:!1,cleanup:o},document.addEventListener("pointermove",s,{passive:!1}),document.addEventListener("pointerup",o),document.addEventListener("pointercancel",o)},[]);u.useEffect(()=>()=>{a.current?.cleanup()},[]);let s=u.useCallback(e=>r("column",e),[r]),o=u.useCallback(e=>r("group",e),[r]);return{handlePointerDown:s,handleGroupPointerDown:o}}({onGrab:u.useCallback((e,t)=>{"group"===e?(f.current=!0,x.current=t,h(t)):(g.current=t,p(t))},[]),onMove:(e,t)=>"group"===e?j(t):y(t),onRelease:u.useCallback(e=>{"group"===e?(f.current=!1,x.current="",h("")):(g.current="",p(""))},[])}),B=u.useCallback((e,n)=>{let i=function(e,t,n){let i=Je(e,String(t));if(-1===i)return e;let a,r=[...e],[s]=r.splice(i,1),{pinned:o,...l}=s,c=n?{...l,pinned:n}:l,d=r.filter(e=>"left"===e.pinned).length,p=r.filter(e=>"right"===e.pinned).length;return a="left"===n?d:"right"===n||"right"===s.pinned?r.length-p:d,r.splice(a,0,c),r}(s,e,n);i!==s&&(o(i),t(i))},[t,s]),D=u.useCallback(e=>{o(t=>t.map(t=>String(t.id)===String(e)?{...t,omit:!0}:t))},[]),T=u.useCallback(()=>{o(We(e)),c(i??[])},[e,i]),F=function(e=!1){return e?"asc":"desc"}(r),I=u.useMemo(()=>s[Je(s,a?.toString())]||{},[a,s]),M=u.useMemo(()=>({onDragStart:b,onDragOver:v,onDragEnd:S,onDragEnter:_,onDragLeave:w,onGroupDragStart:C,onGroupDragEnter:k,onGroupDragOver:R,onGroupDragEnd:E,onPointerDown:N,onGroupPointerDown:P}),[b,v,S,_,w,C,k,R,E,N,P]);return{tableColumns:s,tableGroups:l,draggingColumnId:d,draggingGroupKey:m,columnDrag:M,handlePinColumn:B,handleHideColumn:D,handleResetColumns:T,defaultSortDirection:F,defaultSortColumn:I}}(i,Pe,Be,De,fe,be),{effectiveColumns:on,pinnedOffsets:ln,pinnedTotalWidths:cn,hasPinnedColumns:yn}=function({tableColumns:e,tableGroups:t,columnGroups:n,columnWidths:i,selectableRows:a,expandableRows:r,expandableRowsHideExpander:s}){let o=t.length>0||null!=n&&n.length>0,l=u.useMemo(()=>o?e.map(e=>{if(!e.pinned)return e;let{pinned:t,...n}=e;return n}):e,[o,e]),c=u.useRef(!1);u.useEffect(()=>{!o||c.current||e.some(e=>e.pinned)&&(c.current=!0,console.warn("DataTable: column pinning is not supported alongside columnGroups. `pinned` has been stripped from affected columns. Remove `columnGroups` or remove `pinned` from your column definitions to use pinning."))},[o,e]);let d=u.useMemo(()=>function(e,t,n,i,a){let r=e.filter(e=>!e.omit);if(!r.some(e=>e.pinned))return Xe;let s=Ze(),o={},l=Ve(n,i,a)*s;for(let e of r.filter(e=>"left"===e.pinned))null!=e.id&&(o[e.id]=l),l+=Qe(e,t);let c={},d=0;for(let e of[...r.filter(e=>"right"===e.pinned)].reverse())null!=e.id&&(c[e.id]=d),d+=Qe(e,t);return{left:o,right:c}}(l,i,a,r,s),[l,i,a,r,s]),p=u.useMemo(()=>function(e,t,n,i,a){let r=e.filter(e=>!e.omit);if(!r.some(e=>e.pinned))return{left:0,right:0};let s=Ze(),o=Ve(n,i,a)*s;for(let e of r.filter(e=>"left"===e.pinned))o+=Qe(e,t);let l=0;for(let e of r.filter(e=>"right"===e.pinned))l+=Qe(e,t);return{left:o,right:l}}(l,i,a,r,s),[l,i,a,r,s]),m=p.left>0||p.right>0;return{effectiveColumns:l,pinnedOffsets:d,pinnedTotalWidths:p,hasPinnedColumns:m}}({tableColumns:qt,tableGroups:Kt,columnGroups:De,columnWidths:Ut,selectableRows:p,expandableRows:Q,expandableRowsHideExpander:ue}),bn=u.useRef(null),{tableState:vn,handleSort:wn,handleSelectAllRows:Sn,handleSelectedRow:Cn,handleSelectedRange:jn,handleChangePage:kn,handleChangeRowsPerPage:Rn,handleClearSelectedRows:En,handleClearSort:Nn}=function(e){let{data:t,keyField:n,defaultSortColumn:i,defaultSortDirection:a,paginationDefaultPage:r,paginationPerPage:s,paginationServer:o,paginationServerOptions:l,paginationTotalRows:c,pagination:d,selectableRowsSingle:p,selectableRowsVisibleOnly:m,selectableRowSelected:h,clearSelectedRows:g,paginationPage:x,paginationResetDefaultPage:f,controlledSelectedRows:y,onSelectedRowsChange:b,onChangePage:_,onChangeRowsPerPage:v}=e,{persistSelectedOnSort:w=!1,persistSelectedOnPageChange:S=!1}=l,C=o&&(S||w),j=null!=i.id||!!i.selector,[k,R]=u.useReducer(hn,{allSelected:!1,selectedCount:0,selectedRows:[],selectedColumn:i,toggleOnSelectedRowsChange:!1,sortDirection:a,sortColumns:j?[{column:i,sortDirection:a}]:[],currentPage:r,rowsPerPage:s,selectedRowsFlag:!1,sortTriggeredPageReset:!1}),E=u.useCallback(()=>{R({type:"CLEAR_SELECTED_ROWS",selectedRowsFlag:!1})},[]),N=u.useCallback(()=>{R({type:"CLEAR_SORT",defaultSortColumn:i,defaultSortDirection:a})},[i,a]),P=u.useCallback(e=>{R(e)},[]),B=u.useCallback(e=>{R(e)},[]),D=u.useCallback(e=>{R(e)},[]),T=u.useCallback(e=>{R(e)},[]),F=u.useCallback(e=>{R({type:"CHANGE_PAGE",page:e,paginationServer:o,visibleOnly:m,persistSelectedOnPageChange:S})},[o,S,m]),I=u.useCallback((e,t)=>{let n=Ue(c||t,e),i=Ge(k.currentPage,n);o||F(i),R({type:"CHANGE_ROWS_PER_PAGE",page:i,rowsPerPage:e})},[k.currentPage,o,c,F]);return un(()=>{b({allSelected:k.allSelected,selectedCount:k.selectedCount,selectedRows:k.selectedRows.slice(0)})},[k.toggleOnSelectedRowsChange]),un(()=>{k.sortTriggeredPageReset||_(k.currentPage,c||t.length)},[k.currentPage]),un(()=>{v(k.rowsPerPage,k.currentPage)},[k.rowsPerPage]),un(()=>{F(r)},[r,f]),un(()=>{void 0!==x&&F(x)},[x]),un(()=>{if(d&&o&&c>0){let e=Ue(c,k.rowsPerPage),t=Ge(k.currentPage,e);k.currentPage!==t&&F(t)}},[c]),u.useEffect(()=>{R({type:"CLEAR_SELECTED_ROWS",selectedRowsFlag:g})},[p,g]),u.useEffect(()=>{if(!h)return;let e=t.filter(e=>h(e)),i=p?e.slice(0,1):e;R({type:"SELECT_MULTIPLE_ROWS",keyField:n,selectedRows:i,totalRows:t.length,mergeSelections:C})},[t]),{tableState:y?{...k,selectedRows:y,selectedCount:y.length,allSelected:y.length>0&&y.length===(t?.length??0)}:k,handleSort:P,handleSelectAllRows:B,handleSelectedRow:D,handleSelectedRange:T,handleChangePage:F,handleChangeRowsPerPage:I,handleClearSelectedRows:E,handleClearSort:N}}({data:n,keyField:s,defaultSortColumn:tn,defaultSortDirection:en,paginationDefaultPage:P,paginationPerPage:T,paginationServer:R,paginationServerOptions:E,paginationTotalRows:N,pagination:V,selectableRowsSingle:m,selectableRowsVisibleOnly:x,selectableRowSelected:y,clearSelectedRows:kt,paginationPage:B,paginationResetDefaultPage:D,controlledSelectedRows:w,onSelectedRowsChange:C,onChangePage:k,onChangeRowsPerPage:j}),Pn=u.useRef([]),Bn=u.useRef(null);u.useImperativeHandle(t,()=>({clearSelectedRows:En,clearSort:Nn}),[En,Nn]);let{bodyRef:Dn,prevRowTopsRef:Tn,handleSort:Fn}=function(e){let[,t]=u.useTransition(),n=u.useRef(null),i=u.useRef(new Map),a=u.useCallback(a=>{if(n.current){let e=new Map;n.current.querySelectorAll('[id^="row-"]').forEach(t=>{e.set(t.id.slice(4),t.getBoundingClientRect().top)}),i.current=e}t(()=>e(a))},[e]);return{bodyRef:n,prevRowTopsRef:i,handleSort:a}}(wn),{rowsPerPage:In,currentPage:Mn,selectedRows:Hn,allSelected:An,selectedColumn:Ln,sortDirection:_n,sortColumns:zn}=vn,{sortedData:On,tableRows:Wn}=function(e){let{data:t,selectedColumn:n,sortDirection:i,sortColumns:a,currentPage:r,rowsPerPage:s,pagination:o,paginationServer:l,sortServer:c,sortFunction:d,onSort:p}=e,m=u.useMemo(()=>{if(c)return t;if(a.length>1)return function(e,t){return 0===t.length?e:e.map((e,t)=>({row:e,index:t})).sort((e,n)=>{for(let{column:i,sortDirection:a}of t){let t="asc"===a?1:-1;if(i.sortFunction&&"function"==typeof i.sortFunction){let a=i.sortFunction(e.row,n.row);if(0!==a)return a*t;continue}let r=i.selector;if(!r)continue;let s=Ae(e.row,n.row,r,a);if(0!==s)return s}return e.index-n.index}).map(({row:e})=>e)}(t,a);if(n?.sortFunction&&"function"==typeof n.sortFunction){let e=n.sortFunction,a="asc"===i?e:(t,n)=>-1*e(t,n);return[...t].sort(a)}return function(e,t,n,i){return t?i&&"function"==typeof i?i(e.slice(0),t,n):e.slice(0).sort((e,i)=>Ae(e,i,t,n)):i&&"function"==typeof i?i(e.slice(0),Le,n):e}(t,n?.selector,i,d)},[c,n,i,a,t,d]),h=u.useMemo(()=>{if(o&&!l){let e=r*s,t=e-s;return m.slice(t,e)}return m},[r,o,l,s,m]),g=u.useRef(p),x=u.useRef({selectedColumn:n,sortDirection:i,sortColumns:a});return u.useEffect(()=>{g.current=p},[p]),u.useEffect(()=>{(x.current.selectedColumn!==n||x.current.sortDirection!==i||x.current.sortColumns!==a)&&(x.current={selectedColumn:n,sortDirection:i,sortColumns:a},g.current(n,i,m.slice(0),a))},[n,i,a,m]),{sortedData:m,tableRows:h}}({data:n,selectedColumn:Ln,sortDirection:_n,sortColumns:zn,currentPage:Mn,rowsPerPage:In,pagination:V,paginationServer:R,sortServer:oe,sortFunction:se,onSort:re}),Un=u.useMemo(()=>At(On),[At,On]),Gn=u.useMemo(()=>At(Wn),[At,Wn]),{persistSelectedOnSort:$n=!1,persistSelectedOnPageChange:qn=!1}=E,Kn=!(!R||!qn&&!$n),Vn=function({contextMenu:e,contextMenuActions:t,onContextMenuAction:n,localization:i,tableColumns:a,columnGroups:r,sortColumns:s,defaultSortDirection:o,clearSelectedOnSort:l,filterValues:c,onSort:d,onClearSort:p,onFilterChange:m,onPinColumn:h,onHideColumn:g,onResetColumns:x}){let[f,y]=u.useState(null),b=u.useRef(null),_=e?{header:"object"!=typeof e||!1!==e.header,row:"object"!=typeof e||!1!==e.row,trigger:"object"==typeof e&&e.trigger||"right-click",menuPosition:"object"==typeof e&&e.menuPosition||"end"}:null,v="right-click"===_?.trigger||"both"===_?.trigger,w="menu-button"===_?.trigger||"both"===_?.trigger,S=!!_?.header,C=!!_?.row&&!!t?.row,j=_?.menuPosition??"end",k=u.useRef(t?.row);u.useEffect(()=>{k.current=t?.row});let R=u.useCallback((e,t)=>{t.preventDefault(),b.current=t.currentTarget,y({ctx:{type:"header",column:e},position:{x:t.clientX,y:t.clientY},anchorRect:null})},[]),E=u.useCallback((e,t)=>{b.current=t.currentTarget;let n=t.currentTarget.getBoundingClientRect();y({ctx:{type:"header",column:e},position:{x:n.left,y:n.bottom+4},anchorRect:n})},[]),N=u.useCallback((e,t,n)=>{0!==(k.current?.(e,t)??[]).length&&(n.preventDefault(),b.current=n.currentTarget,y({ctx:{type:"row",row:e,rowIndex:t},position:{x:n.clientX,y:n.clientY},anchorRect:null}))},[]),P=u.useCallback((e,t,n)=>{if(0===(k.current?.(e,t)??[]).length)return;b.current=n.currentTarget;let i=n.currentTarget.getBoundingClientRect();y({ctx:{type:"row",row:e,rowIndex:t},position:{x:i.left,y:i.bottom+4},anchorRect:i})},[]),B=u.useCallback(e=>a.find(t=>Ye(t.id,e.id))??e,[a]),D=u.useMemo(()=>{if(!f)return null;let{ctx:e,position:n,anchorRect:o}=f;if("row"===e.type)return{groups:[t?.row?.(e.row,e.rowIndex)??[]],position:n,anchorRect:o,ariaLabel:i.rowMenuAriaLabel??"Row menu"};let l=B(e.column),c=[];l.sortable&&c.push([{id:"sort-asc",label:i.sortAscLabel??"Sort ascending"},{id:"sort-desc",label:i.sortDescLabel??"Sort descending"},{id:"clear-sort",label:i.clearSortLabel??"Clear sort",disabled:0===s.length}]);let d=[];r?.length||("left"!==l.pinned&&d.push({id:"pin-left",label:i.pinLeftLabel??"Pin left"}),"right"!==l.pinned&&d.push({id:"pin-right",label:i.pinRightLabel??"Pin right"}),l.pinned&&d.push({id:"unpin",label:i.unpinLabel??"Unpin"}));let p=a.filter(e=>!e.omit).length;d.push({id:"hide-column",label:i.hideColumnLabel??"Hide column",disabled:p<=1}),c.push(d),c.push([{id:"reset",label:i.resetLabel??"Reset table"}]);let u="function"==typeof t?.header?t.header(l):t?.header;return u?.length&&c.push(u),{groups:c,position:n,anchorRect:o,ariaLabel:i.headerMenuAriaLabel??"Column menu"}},[f,t,i,B,s,r,a]),T=u.useCallback(e=>{y(null),e&&b.current?.focus(),b.current=null},[]),F=u.useCallback(e=>{if(!f)return;let{ctx:t}=f;if("header"===t.type){let i=B(t.column);switch(e.id){case"sort-asc":case"sort-desc":d({type:"SORT_CHANGE",selectedColumn:i,additive:!1,defaultSortDirection:o,direction:"sort-asc"===e.id?"asc":"desc",clearSelectedOnSort:l});break;case"clear-sort":p();break;case"pin-left":h(i.id,"left");break;case"pin-right":h(i.id,"right");break;case"unpin":h(i.id);break;case"hide-column":g(i.id);break;case"reset":x(),p();for(let e of Object.keys(c)){let t=a.find(t=>String(t.id)===e);m(e,ft(t?.filterType))}}n?.(e,{type:"header",column:i})}else n?.(e,t);T(!0)},[f,B,d,o,l,p,h,g,x,c,a,m,n,T]),I=i.headerMenuButtonAriaLabel??"Column actions",M=i.rowMenuButtonAriaLabel??"Row actions";return{header:u.useMemo(()=>S?{rightClick:v,menuButton:w,ariaLabel:I,onContextMenu:R,onMenuButtonClick:E}:null,[S,v,w,I,R,E]),row:u.useMemo(()=>C?{rightClick:v,menuButton:w,menuButtonPosition:j,ariaLabel:M,onContextMenu:N,onMenuButtonClick:P}:null,[C,v,w,j,M,N,P]),open:D,onSelect:F,onClose:T}}({contextMenu:Me,contextMenuActions:He,onContextMenuAction:ze,localization:wt.contextMenu,tableColumns:qt,columnGroups:De,sortColumns:zn,defaultSortDirection:en,clearSelectedOnSort:V&&R&&!$n||oe||x,filterValues:Mt,onSort:Fn,onClearSort:Nn,onFilterChange:Ht,onPinColumn:Xt,onHideColumn:Qt,onResetColumns:Zt}),Jn=V&&!L&&n.length>0,Yn=M||dt,Xn=u.useMemo(()=>((e={})=>Ie({},e))(Ee),[Ee]),Qn=function(e="light"){let[t,n]=(0,u.useState)(()=>gn()?"dark":"light");return(0,u.useEffect)(()=>{if("system"!==e)return;let t=()=>n(gn()?"dark":"light");t();let i=window.matchMedia("(prefers-color-scheme: dark)");i.addEventListener("change",t);let a=new MutationObserver(t);return a.observe(document.documentElement,{attributeFilter:["class"]}),window.addEventListener("storage",t),()=>{i.removeEventListener("change",t),a.disconnect(),window.removeEventListener("storage",t)}},[e]),"system"===e?t:e}(Re),Zn=u.useMemo(()=>function(e,t="light"){if(e&&"string"!=typeof e&&dn(e))return e;let n=pn(e);return function(e){let t={"--rdt-color-scheme":e.colorScheme??"light","--rdt-color-primary":e.primary??"#1976d2","--rdt-color-text-primary":e.text.primary,"--rdt-color-text-secondary":e.text.secondary,"--rdt-color-text-disabled":e.text.disabled,"--rdt-color-bg":e.background.default,"--rdt-color-context-bg":e.context.background,...e.background.header?{"--rdt-color-header-bg":e.background.header}:{},...e.background.footer?{"--rdt-color-footer-bg":e.background.footer}:{},"--rdt-color-context-text":e.context.text,"--rdt-color-divider":e.divider.default,"--rdt-color-btn":e.button.default,"--rdt-color-btn-focus":e.button.focus,"--rdt-color-btn-hover":e.button.hover,"--rdt-color-btn-disabled":e.button.disabled,"--rdt-color-selected":e.selected.default,"--rdt-color-selected-text":e.selected.text,"--rdt-color-highlight":e.highlightOnHover.default,"--rdt-color-highlight-text":e.highlightOnHover.text,"--rdt-color-striped":e.striped.default,"--rdt-color-striped-text":e.striped.text};return null!=e.spacing?.rowHeight&&(t["--rdt-row-height"]=e.spacing.rowHeight),null!=e.spacing?.headerHeight&&(t["--rdt-header-height"]=e.spacing.headerHeight),null!=e.spacing?.cellPaddingX&&(t["--rdt-cell-padding-x"]=e.spacing.cellPaddingX),null!=e.spacing?.iconSize&&(t["--rdt-icon-size"]=e.spacing.iconSize),null!=e.typography?.fontSize&&(t["--rdt-font-size"]=e.typography.fontSize),null!=e.typography?.fontSizeHeader&&(t["--rdt-font-size-header"]=e.typography.fontSizeHeader),null!=e.typography?.fontFamily&&(t["--rdt-font-family"]=e.typography.fontFamily),null!=e.shape?.borderRadius&&(t["--rdt-border-radius"]=e.shape.borderRadius),null!=e.checkbox?.size&&(t["--rdt-checkbox-size"]=e.checkbox.size),null!=e.checkbox?.borderRadius&&(t["--rdt-checkbox-radius"]=e.checkbox.borderRadius),t}("dark"===t&&n.darkMode?Ie(n,{...n.darkMode,colorScheme:"dark"}):n)}(Ce,Qn),[Ce,Qn]),ei=u.useMemo(()=>({..."auto"!==Ne&&{dir:Ne}}),[Ne]),ti=L,ni=u.useCallback(e=>kn(e),[kn]),ii=u.useCallback(e=>Rn(e,Gn.length),[Rn,Gn.length]),ai=!G&&(O||L||Un.length>0),ri=!($||!a&&!r),{activeCell:si,handleNavFocus:oi,handleNavKeyDown:li}=function({cellNavigation:e,selectableRows:t,expandableRows:n,expandableRowsHideExpander:i,effectiveColumns:a,filteredTableRowCount:r,showTableHead:s}){let[o,l]=u.useState(null),c=Ve(t,n,i)+a.filter(e=>!e.omit).length,d=s?-1:0,p=r-1,m=u.useMemo(()=>{if(!e||0===c||p=0?0:d,col:0};return{row:Math.min(Math.max(t.row,d),p),col:Math.min(Math.max(t.col,0),c-1)}},[e,o,d,p,c]),h=u.useCallback(e=>{let t=e.target.closest("[data-nav-row]");if(!t)return;let n=Number(t.dataset.navRow),i=Number(t.dataset.navCol);l(e=>e&&e.row===n&&e.col===i?e:{row:n,col:i})},[]),g=u.useCallback(e=>{if(e.defaultPrevented||!xn.includes(e.key)&&" "!==e.key)return;let t=e.target,n=t.closest("[data-nav-row]");if(!n)return;if(" "===e.key)return void(t===n&&e.preventDefault());let i=t.tagName;if(t.isContentEditable||"TEXTAREA"===i||"SELECT"===i||"INPUT"===i&&!["checkbox","radio","button"].includes(t.type)||t.closest(".rdt_editCustomWrap"))return;let a="rtl"===getComputedStyle(e.currentTarget).direction,r=Number(n.dataset.navRow),s=Number(n.dataset.navCol),o=r,l=s;switch(e.key){case"ArrowRight":l+=a?-1:1;break;case"ArrowLeft":l+=a?1:-1;break;case"ArrowDown":o+=1;break;case"ArrowUp":o-=1;break;case"Home":l=0,(e.ctrlKey||e.metaKey)&&(o=p>=0?0:d);break;case"End":l=c-1,(e.ctrlKey||e.metaKey)&&(o=p>=0?p:d)}o=Math.min(Math.max(o,d),Math.max(p,d)),l=Math.min(Math.max(l,0),Math.max(c-1,0)),e.preventDefault(),(o!==r||l!==s)&&function(e,t,n){let i=e.querySelector(`[data-nav-row="${t}"][data-nav-col="${n}"]`);if(!i){let a=Number.POSITIVE_INFINITY;e.querySelectorAll(`[data-nav-row="${t}"]`).forEach(e=>{let t=Math.abs(Number(e.dataset.navCol)-n);ton.some(e=>!e.omit&&void 0!==e.footer),[on]),di=!1!==ht&&!L&&(!0===ht||!!mt||ci);V&&!R&&Un.length>0&&0===Gn.length&&ni(Ge(Mn,Ue(Un.length,In)));let pi=x?Gn:Un,ui=qn||m||g;at(()=>{Pn.current=Gn},[Gn]);let mi=function(e){let{sortDirection:t,sortColumns:n,sortDisabled:i,sortMulti:a,defaultSortDirection:r,sortIcon:s,sortServer:o,pagination:l,paginationServer:c,persistSelectedOnSort:d,selectableRowsVisibleOnly:p,onSort:m}=e;return u.useMemo(()=>({sortDirection:t,sortColumns:n,sortDisabled:i,sortMulti:a,defaultSortDirection:r,sortIcon:s,sortServer:o,pagination:l,paginationServer:c,persistSelectedOnSort:d,selectableRowsVisibleOnly:p,onSort:m}),[t,n,i,a,r,s,o,l,c,d,p,m])}({sortDirection:_n,sortColumns:zn,sortDisabled:L||0===Un.length,sortMulti:le,defaultSortDirection:en,sortIcon:Et,sortServer:oe,pagination:V,paginationServer:R,persistSelectedOnSort:$n,selectableRowsVisibleOnly:x,onSort:Fn}),hi=function(e){let{selectableRows:t,component:n,componentProps:i,highlight:a,single:r,disabled:s,range:o,onSelectedRow:l,onSelectedRange:c,visibleRowsRef:d,lastSelectedKeyRef:p,allSelected:m,selectedRows:h,visibleRows:g,keyField:x,mergeSelections:f,hideSelectAll:y,onSelectAllRows:b}=e;return{row:u.useMemo(()=>t?{component:n,componentProps:i,highlight:a,single:r,disabled:s,range:o,onSelectedRow:l,onSelectedRange:c,visibleRowsRef:d,lastSelectedKeyRef:p}:null,[t,n,i,a,r,s,o,l,c,d,p]),selectAll:u.useMemo(()=>t?{allSelected:m,selectedRows:h,visibleRows:g,component:n,componentProps:i,disabled:s,keyField:x,mergeSelections:f,hideSelectAll:y,onSelectAllRows:b}:null,[t,m,h,g,n,i,s,x,f,y,b])}}({selectableRows:p,component:Dt,componentProps:Tt,highlight:h,single:m,disabled:b,range:f,onSelectedRow:Cn,onSelectedRange:jn,visibleRowsRef:Pn,lastSelectedKeyRef:Bn,allSelected:An,selectedRows:Hn,visibleRows:pi,keyField:s,mergeSelections:Kn,hideSelectAll:ui,onSelectAllRows:Sn}),gi=function(e){let{expandableRows:t,icon:n,component:i,componentProps:a,hideExpander:r,expandOnRowClicked:s,expandOnRowDoubleClicked:o,inheritConditionalStyles:l,onToggled:c,localization:d}=e;return u.useMemo(()=>t?{icon:n,component:i,componentProps:a,hideExpander:r,expandOnRowClicked:s,expandOnRowDoubleClicked:o,inheritConditionalStyles:l,onToggled:c,localization:d}:null,[t,n,i,a,r,s,o,l,c,d])}({expandableRows:Q,icon:Nt,component:ce,componentProps:de,hideExpander:ue,expandOnRowClicked:me,expandOnRowDoubleClicked:he,inheritConditionalStyles:xe,onToggled:S,localization:wt.expandable}),xi=function(e){let{onRowClicked:t,onRowDoubleClicked:n,onRowMiddleClicked:i,onRowMouseEnter:a,onRowMouseLeave:r}=e;return u.useMemo(()=>({onRowClicked:t,onRowDoubleClicked:n,onRowMiddleClicked:i,onRowMouseEnter:a,onRowMouseLeave:r}),[t,n,i,a,r])}({onRowClicked:Z,onRowDoubleClicked:ee,onRowMiddleClicked:te,onRowMouseEnter:ne,onRowMouseLeave:ie}),fi=function(e){return u.useMemo(()=>e,[e.keyField,e.columns,e.dense,e.striped,e.highlightOnHover,e.pointerOnHover,e.conditionalRowStyles,e.selection,e.expansion,e.rowEvents,e.columnDrag,e.columnWidths,e.pinnedOffsets,e.animateRows,e.cellNavigation,e.activeCell,e.rowMenu])}({keyField:s,columns:on,dense:d,striped:o,highlightOnHover:l,pointerOnHover:c,conditionalRowStyles:we,selection:hi.row,expansion:gi,rowEvents:xi,columnDrag:Yt,columnWidths:Ut,pinnedOffsets:ln,animateRows:nt,cellNavigation:ct,activeCell:si,rowMenu:Vn.row}),yi=function(e){return u.useMemo(()=>e,[e.sorting,e.fixedHeader,e.dense,e.draggingColumnId,e.draggingGroupKey,e.filtering,e.columnWidths,e.pinnedOffsets,e.resize,e.selectAll,e.cellNavigation,e.activeCell,e.columnDrag,e.headerMenu])}({sorting:mi,fixedHeader:q,dense:d,draggingColumnId:Vt,draggingGroupKey:Jt,filtering:zt,columnWidths:Ut,pinnedOffsets:ln,resize:$t,selectAll:hi.selectAll,cellNavigation:ct,activeCell:si,headerMenu:Vn.header,columnDrag:Yt}),bi={Pagination:Yn,onChangePage:ni,onChangeRowsPerPage:ii,rowCount:N||Un.length,currentPage:Mn,rowsPerPage:In,direction:Ne,paginationRowsPerPageOptions:I,paginationIcons:Bt,paginationComponentOptions:H,localization:wt.pagination},_i=void 0!==pt?pt:Rt.columnSeparator??!1,vi=void 0!==ut?ut:Rt.headerSeparator??!0,wi="full"===_i?"rdt_colSeparatorFull":_i?"rdt_colSeparator":void 0,Si=!1===vi?void 0:"full"===vi?"rdt_headSeparatorFull":"rdt_headSeparator";return u.createElement(ye.Provider,{value:Xn},u.createElement(Ft.Provider,{value:yi},u.createElement(Wt.Provider,{value:fi},u.createElement("div",{style:Zn,className:[wi,Si].filter(Boolean).join(" ")||void 0},ri&&u.createElement(ve,{title:a,actions:r}),J&&u.createElement(Se,{align:Y,wrapContent:X},J),Jn&&("top"===F||"both"===F)&&u.createElement(an,{...bi,position:"top"}),u.createElement(je,{ref:bn,$responsive:A,$fixedHeader:q,$fixedHeaderScrollHeight:K,$hiddenScrollbar:yn&&A,className:gt,onScroll:ae,...ei},u.createElement(ke,null,u.createElement(_e,{id:It,disabled:U,className:"rdt_Table",role:ct?"grid":"table","aria-busy":ti,onKeyDown:ct?li:void 0,onFocus:ct?oi:void 0,...xt&&{"aria-label":xt}},ai&&u.createElement(Lt,{columns:on,columnGroups:Kt.length?Kt:De,selectableRows:p,expandableRows:Q,expandableRowsHideExpander:ue}),u.createElement(nn,{tableRows:Gn,sortedData:Un,selectedRows:Hn,keyField:s,isBusy:ti,columnCount:qt.length,noDataComponent:W,progressComponent:z,expandableRowExpanded:ge,expandableRowDisabled:pe,bodyRef:Dn,prevRowTopsRef:Tn}),di&&u.createElement(rn,{columns:on,rows:Un,selectableRows:p,expandableRows:Q,expandableRowsHideExpander:ue,footerComponent:mt})))),yn&&A&&u.createElement(sn,{scrollRef:bn,leftInset:cn.left,rightInset:cn.right}),Jn&&("bottom"===F||"both"===F)&&u.createElement(an,{...bi}),Vn.open&&u.createElement(fn,{groups:Vn.open.groups,position:Vn.open.position,anchorRect:Vn.open.anchorRect,isRTL:Ot,ariaLabel:Vn.open.ariaLabel,onSelect:Vn.onSelect,onClose:Vn.onClose})))))}),bn=yn;const{__:vn}=wp.i18n,wn=function(){const{isRunning:e,blogId:t,isPro:n}=(0,i.useContext)(l),[a,c]=(0,i.useState)({static_pages:[],total_static_pages:0}),[d,u]=(0,i.useState)(!1),[m,h]=(0,i.useState)(""),[g,x]=(0,i.useState)(25),[f,y]=(0,i.useState)(1),[b,_]=(0,i.useState)(!1),[v,w]=(0,i.useState)(""),[S,C]=(0,i.useState)("export"),[j,k]=(0,i.useState)(null),R=(0,i.useRef)(1),E=(0,i.useRef)(25),N=(0,i.useRef)(""),P=(0,i.useRef)({controller:null,sequence:0}),B=(0,i.useRef)(!1),D=(0,i.useRef)(!0),T=(0,i.useCallback)(()=>{P.current.sequence+=1,P.current.controller&&P.current.controller.abort(),P.current.controller=null},[]),F=(0,i.useCallback)(({page:e=R.current,perPage:n=E.current,search:i=N.current,showLoading:a=!0,cancelPrevious:s=!0}={})=>{const o=Math.max(1,Number.parseInt(e,10)||1),l=Math.min(200,Math.max(1,Number.parseInt(n,10)||25)),d="string"==typeof i?i:"";if(!s&&P.current.controller)return Promise.resolve(null);s&&T();const p="undefined"!=typeof AbortController?new AbortController:null,m=P.current.sequence+1;P.current={controller:p,sequence:m},a&&u(!0),h("");const g={path:`/simplystatic/v1/export-log?page=${o}&per_page=${l}&blog_id=${encodeURIComponent(t)}&is_network_admin=${options.is_network}&search=${encodeURIComponent(d)}`,method:"GET"};return p&&(g.signal=p.signal),r()(g).then(e=>{const t=me(e);if(!t||!t.data||"object"!=typeof t.data)throw new Error(vn("Invalid export log response.","simply-static"));if(!D.current||m!==P.current.sequence)return null;const n=t.data;return c(e=>({...e,...n,static_pages:Array.isArray(n.static_pages)?n.static_pages:e.static_pages,total_static_pages:Number.parseInt(n.total_static_pages,10)||0})),R.current=o,y(o),n}).catch(e=>(e&&"AbortError"===e.name||D.current&&m===P.current.sequence&&h(e&&e.message?e.message:vn("Could not load the export log.","simply-static")),null)).finally(()=>{m===P.current.sequence&&(P.current.controller=null,D.current&&u(!1))})},[t,T]),I=(0,i.useCallback)(()=>r()({path:"/simplystatic/v1/export-type",method:"GET"}).then(e=>{const t=me(e);t&&200===t.status&&t.data&&(C(t.data.export_type),k(t.data.export_type_id))}).catch(()=>{C(options.last_export_end?"Update":"export"),k(null)}),[]);(0,i.useEffect)(()=>(D.current=!0,()=>{D.current=!1,T()}),[T]),(0,i.useEffect)(()=>{R.current=1,y(1),F({page:1})},[t,F]),(0,i.useEffect)(()=>{I()},[I,e]),(0,i.useEffect)(()=>{if(!B.current)return void(B.current=!0);const e=window.setTimeout(()=>{R.current=1,y(1),_(e=>!e),F({page:1,search:v})},300);return()=>window.clearTimeout(e)},[v,F]),s(()=>{F({showLoading:!1,cancelPrevious:!1})},e?5e3:null);const M=n()?"40%":"60%",H=[{name:vn("Code","simply-static"),selector:e=>e.code,sortable:!0,width:"12%"},{name:vn("URL","simply-static"),selector:e=>{const t=e&&"string"==typeof e.url?e.url:"";if(!t)return(0,o.jsx)("span",{children:"-"});const n=ge(t);return n?(0,o.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:n.href,children:n.label}):(0,o.jsx)("span",{children:t})},sortable:!0,sortFunction:(e,t)=>String(e&&e.url||"").localeCompare(String(t&&t.url||"")),width:M,wrap:!0}],A={name:vn("Export Type","simply-static"),selector:()=>"Build"===S||"Single"===S?`${S} (ID: ${j})`:S,sortable:!0,width:"20%"},L={name:vn("Notes","simply-static"),wrap:!0,selector:e=>(0,o.jsx)("span",{children:he(e&&e.notes)}),sortable:!0,sortFunction:(e,t)=>he(e&&e.notes).localeCompare(he(t&&t.notes)),width:"28%"},z=n()?[...H,A,L]:[...H,L];return(0,o.jsxs)("div",{className:"log-table-container",children:[(0,o.jsx)(p.Flex,{children:(0,o.jsxs)(p.FlexItem,{children:[(0,o.jsx)("label",{className:"screen-reader-text",htmlFor:"export-search",children:vn("Search export log","simply-static")}),(0,o.jsx)("input",{id:"export-search",className:"ss-export-log-search",type:"search",placeholder:vn("Search…","simply-static"),value:v,onChange:e=>{const t=e.target.value;T(),u(!1),N.current=t,w(t)}})]})}),m&&(0,o.jsx)(p.Notice,{status:"error",isDismissible:!1,children:(0,o.jsx)("p",{children:m})}),(0,o.jsx)(bn,{columns:z,data:a.static_pages||[],pagination:!0,paginationServer:!0,paginationDefaultPage:f,paginationResetDefaultPageToggle:b,paginationTotalRows:a.total_static_pages,paginationPerPage:g,paginationRowsPerPageOptions:[25,50,100,200],progressPending:d,progressComponent:(0,o.jsxs)("div",{style:{padding:"24px",textAlign:"center"},children:[(0,o.jsx)(p.Spinner,{}),(0,o.jsx)("div",{style:{marginTop:"8px"},children:vn("Loading…","simply-static")})]}),onChangeRowsPerPage:(e,t)=>{E.current=e,R.current=t,x(e),y(t),F({page:t,perPage:e})},onChangePage:e=>{R.current=e,y(e),F({page:e})}})]})},{__:Sn}=wp.i18n,Cn=function(){const[e,t]=(0,i.useState)(!1);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Button,{variant:"primary",href:options.log_file,download:!0,style:{marginRight:"10px"},children:Sn("Download Log","simply-static")}),(0,o.jsx)(p.Button,{variant:"secondary",onClick:()=>{r()({path:"/simplystatic/v1/delete-log",method:"POST"}),t(!0),setTimeout(function(){t(!1)},2e3)},children:Sn("Clear Log","simply-static")}),e&&(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:Sn("Log file cleared.","simply-static")})})})]})},{__:jn}=wp.i18n,kn=function(e){const{children:t,canGenerate:n,isPaused:i,isDelayed:a,startExport:r,cancelExport:s,pauseExport:l,resumeExport:c,buttonLabel:d}=e,u="function"==typeof l,m="function"==typeof s,h="function"==typeof c,g="function"==typeof r;return(0,o.jsxs)("div",{className:"generate-buttons-container",children:[n&&g&&(0,o.jsxs)(p.Button,{onClick:()=>{r()},disabled:!n||a,className:"generate",children:[n&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Dashicon,{icon:"update"}),d||jn("Push","simply-static")]}),n&&a>0&&(0,o.jsxs)(o.Fragment,{children:[" ",a,"s"]}),!n&&(0,o.jsx)(p.Dashicon,{icon:"update spin"})]}),!n&&(0,o.jsxs)(o.Fragment,{children:[!i&&u&&(0,o.jsx)(p.Button,{label:jn("Pause","simply-static"),className:"ss-generate-media-button","aria-label":jn("Pause","simply-static"),onClick:()=>l(),children:(0,o.jsx)(p.Dashicon,{icon:"controls-pause"})}),i&&h&&(0,o.jsx)(p.Button,{label:jn("Resume","simply-static"),className:"ss-generate-media-button","aria-label":jn("Resume","simply-static"),onClick:()=>c(),children:(0,o.jsx)(p.Dashicon,{icon:"controls-play"})}),m&&(0,o.jsx)(p.Button,{onClick:()=>s(),label:jn("Cancel","simply-static"),className:"ss-generate-cancel-button","aria-label":jn("Cancel","simply-static"),children:(0,o.jsx)(p.Dashicon,{icon:"no"})})]}),t]})},{__:Rn}=wp.i18n,En=function(e){const{site:t,setAnyRunning:n}=e,a=t.id,[s,l]=(0,i.useState)(!t.running&&!t.paused),[c,d]=(0,i.useState)(t.running),[m,h]=(0,i.useState)(t.paused);(0,u.useEffect)(()=>{c&&n(!0)},[c]),(0,u.useEffect)(()=>{h(t.paused),d(t.running),l(!t.running&&!t.paused)},[t]);const g=()=>"pro"===options.plan;return(0,o.jsxs)("tr",{children:[(0,o.jsxs)("td",{children:[t.name,(0,o.jsx)("br",{}),(0,o.jsx)("a",{href:t.url,children:t.url})]}),(0,o.jsx)("td",{children:t.status}),(0,o.jsx)("td",{className:"generate-container network-generate-container",children:(0,o.jsxs)(kn,{site:t,canGenerate:s,startExport:g()?()=>{l(!1),h(!1),r()({path:"/simplystatic/v1/start-export",method:"POST",data:{blog_id:a,type:"export",is_network_admin:options.is_network}}).then(e=>{500!==JSON.parse(e).status?d(!0):l(!0)})}:null,isPaused:m,isRunning:c,cancelExport:g()?()=>{r()({path:"/simplystatic/v1/cancel-export",method:"POST",data:{blog_id:a,is_network_admin:options.is_network}}).then(e=>{h(!1),d(!1),l(!0)})}:null,pauseExport:g()?()=>{r()({path:"/simplystatic/v1/pause-export",method:"POST",data:{blog_id:a,is_network_admin:options.is_network}}).then(e=>{d(!1),h(!0)})}:null,resumeExport:g()?()=>{r()({path:"/simplystatic/v1/resume-export",method:"POST",data:{blog_id:a,is_network_admin:options.is_network}}).then(e=>{h(!1),d(!0)})}:null,children:[!g()&&(0,o.jsxs)(p.Button,{label:"Generate","aria-label":Rn("Generate","simply-static"),className:"generate",disabled:!0,children:[(0,o.jsx)(p.Dashicon,{icon:"update"}),Rn("Generate","simply-static")]}),(0,o.jsx)(p.Button,{className:"sub-site-settings",onClick:()=>window.location=t.settings_url,children:(0,o.jsx)(p.Dashicon,{icon:"admin-generic"})}),!g()&&(0,o.jsx)(p.Button,{target:"_blank",variant:"link",href:"https://simplystatic.com/pricing/",children:Rn("Upgrade to manage from network.","simply-static")})]})})]})},{__:Nn}=wp.i18n,Pn=function(e){const[t,n]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[c,d]=(0,i.useState)(0),p=(0,i.useRef)(!1);function m(){p.current||(p.current=!0,r()({path:"/simplystatic/v1/sites",method:"GET"}).then(e=>{let t=[],i=!1;e.data.forEach(function(e){t.push(e),e.running&&(i=!0)}),n(t),l(i)}).catch(()=>{}).finally(()=>{p.current=!1}))}return s(()=>{m()},a?1e4:3e5),s(()=>{var e;!c&&t.length>0&&d(t[0].id),c&&(e=c,r()({path:"/simplystatic/v1/trigger-cron",method:"POST",data:{blog_id:e}}).then(n=>{var i=JSON.parse(n);200===i.status?console.log("CRON triggered successfully for site "+e):console.error("Failed to trigger CRON:",i.message);let a=function(e){let n=function(){let e=[];return t.forEach(function(t){e.push(t.id)}),e}();if(0===n.length)return 0;let i=n.indexOf(e);return-1===i?n[0]:(i++,n[i]||n[0])}(e);d(a)}).catch(e=>{console.error("Error triggering CRON:",e)}))},a?15e4:null),(0,u.useEffect)(()=>{m()},[]),(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("table",{className:"wp-list-table widefat fixed striped posts simple-static-sites",children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{children:[(0,o.jsx)("th",{children:Nn("Name","simply-static")}),(0,o.jsx)("th",{children:Nn("Status","simply-static")}),(0,o.jsx)("th",{children:Nn("Actions","simply-static")})]})}),(0,o.jsx)("tbody",{children:t.map(e=>(0,o.jsx)(En,{setAnyRunning:l,site:e},e.id))})]})})},{__:Bn}=wp.i18n;function Dn(){const[e,t]=(0,i.useState)(!1);(0,i.useEffect)(()=>{try{if(options.is_network||"pro"===options.plan)return void t(!1);const e=new Date,n=e.getFullYear(),i=new Date(n,10,28,0,0,0),a=new Date(n,11,5,23,59,59),r=`ss_bf_banner_dismissed_${n}`,s=!("undefined"==typeof window||!window.localStorage)&&"1"===window.localStorage.getItem(r);t(!s&&e>=i&&e<=a)}catch(e){t(!1)}},[]);const n=()=>{try{const e=`ss_bf_banner_dismissed_${(new Date).getFullYear()}`;"undefined"!=typeof window&&window.localStorage&&window.localStorage.setItem(e,"1")}catch(e){}t(!1)};return e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"notice",isDismissible:!0,onRemove:n,className:"bf-banner",children:(0,o.jsxs)("p",{children:[(0,o.jsx)("strong",{children:"BLACK FRIDAY"}),": Upgrade to ",(0,o.jsx)("b",{children:"Simply Static Pro"})," and save ",(0,o.jsx)("b",{children:"25%"})," by using the code ",(0,o.jsx)("b",{children:"SSBF25"})," ",(0,o.jsx)(p.Button,{isPrimary:!0,href:"https://simplystatic.com/pricing/?utm_source=plugin&utm_medium=banner&utm_campaign=bf",target:"_blank",rel:"noopener noreferrer",style:{marginLeft:8},children:Bn("Buy now","simply-static")})]})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}):null}const{__:Tn}=wp.i18n,Fn=function(){const{settings:e,blogId:t,setBlogId:n}=(0,i.useContext)(l);return(0,o.jsxs)("div",{className:"inner-settings",children:[!options.is_network&&options.can_view_activity_log&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Dn,{}),(0,o.jsx)(fe,{}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsxs)(p.Flex,{align:"top",children:[options.is_network&&(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsx)(p.Card,{children:(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(Pn,{})})})}),e.debugging_mode&&options.log_file&&options.can_manage_settings&&!options.is_network&&(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Tn("Debugging","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(Cn,{})})]})})]}),!options.is_network&&options.can_view_activity_log&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Tn("Export Log","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(wn,{})})]})]})]})},{__:In}=wp.i18n,Mn=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isPro:c,isStudio:d}=(0,i.useContext)(l),[u,m]=(0,i.useState)(!1),[h,g]=(0,i.useState)(!1),[x,f]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),[_,v]=(0,i.useState)(!1),[w,S]=(0,i.useState)(!1),[C,j]=(0,i.useState)(!1),[k,R]=(0,i.useState)(!1),[E,N]=(0,i.useState)(!1),[P,B]=(0,i.useState)(!1),[D,T]=(0,i.useState)(!1),[F,I]=(0,i.useState)(!1),[M,A]=(0,i.useState)(!1),[z,O]=(0,i.useState)(!1),[W,U]=(0,i.useState)(!1),[G,$]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{e.use_minify&&m(e.use_minify),e.minify_css&&g(e.minify_css),e.minify_js&&f(e.minify_js),e.use_css_optimize&&b(e.use_css_optimize),e.css_optimize_defer_css&&v(e.css_optimize_defer_css),e.css_optimize_defer_js&&S(e.css_optimize_defer_js),e.css_optimize_google_fonts&&j(e.css_optimize_google_fonts),R(!!e.css_optimize_preconnect_hints),e.css_optimize_delay_js&&N(e.css_optimize_delay_js),e.css_js_aggregate_css&&B(e.css_js_aggregate_css),e.css_js_aggregate_js&&T(e.css_js_aggregate_js),e.css_js_aggregate_protect_jquery&&I(e.css_js_aggregate_protect_jquery),e.use_critical_css&&A(e.use_critical_css),e.version_css&&O(e.version_css),e.version_js&&U(e.version_js)},[e]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[In("Minify & Aggregation","simply-static"),(0,o.jsx)(H,{title:In("How to minify HTML, CSS and JavaScript?","simply-static"),videoUrl:"https://youtu.be/52IKv5ai-i4"})]})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",In("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:In("Minify and aggregate CSS, JavaScript, and HTML files to reduce file sizes and HTTP requests for faster page loads.","simply-static")}),(0,o.jsx)(p.ToggleControl,{label:In("Enable Minify & Aggregation?","simply-static"),__nextHasNoMarginBottom:!0,help:In(u?"Minify and aggregate files on your static website.":"Don't minify or aggregate files on your static website.","simply-static"),disabled:"free"===options.plan||!c(),checked:u,onChange:e=>{m(e),t("use_minify",e)}}),u&&(0,o.jsxs)(o.Fragment,{children:[d()&&(0,o.jsx)(L,{heading:In("Minification is handled by Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:In("Studio prepares optimized build assets automatically, so the low-level CSS and JavaScript minification options are not needed for Studio environments.","simply-static")})}),(0,o.jsx)("h4",{style:{marginTop:"16px",marginBottom:"8px"},children:In("Minify","simply-static")}),(0,o.jsx)(p.ToggleControl,{label:In("Minify CSS","simply-static"),__nextHasNoMarginBottom:!0,help:In(h?"Minify CSS files.":"Don't minify CSS files.","simply-static"),disabled:d()||"free"===options.plan||!c(),checked:h,onChange:e=>{g(e),t("minify_css",e)}}),h&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextareaControl,{label:In("Exclude Stylesheet URLs","simply-static"),__nextHasNoMarginBottom:!0,help:In("Exclude URLs from minification (one per line).","simply-static"),disabled:d()||"free"===options.plan||!c(),value:e.minify_css_exclude,onChange:e=>{t("minify_css_exclude",e)}})}),(0,o.jsx)(p.ToggleControl,{label:In("Minify JavaScript","simply-static"),__nextHasNoMarginBottom:!0,help:In(x?"Minify JavaScript files.":"Don't minify JavaScript files.","simply-static"),disabled:d()||"free"===options.plan||!c(),checked:x,onChange:e=>{f(e),t("minify_js",e)}}),x&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextareaControl,{label:In("Exclude JavaScript URLs","simply-static"),__nextHasNoMarginBottom:!0,help:In("Exclude URLs from minification (one per line).","simply-static"),disabled:d()||"free"===options.plan||!c(),value:e.minify_js_exclude,onChange:e=>{t("minify_js_exclude",e)}})}),(0,o.jsx)(p.ToggleControl,{label:In("Protect jQuery Globals","simply-static"),__nextHasNoMarginBottom:!0,help:In("Prevent mangling of jQuery, $, and wp global variables during JS minification.","simply-static"),disabled:d()||"free"===options.plan||!c(),checked:F,onChange:e=>{I(e),t("css_js_aggregate_protect_jquery",e)}}),(0,o.jsx)("h4",{style:{marginTop:"16px",marginBottom:"8px"},children:In("Aggregate","simply-static")}),(0,o.jsx)(p.ToggleControl,{label:In("Aggregate CSS","simply-static"),__nextHasNoMarginBottom:!0,help:In("Combine multiple CSS files into fewer bundles grouped by media attribute and deferral status.","simply-static"),disabled:"free"===options.plan||!c(),checked:P,onChange:e=>{B(e),t("css_js_aggregate_css",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Aggregate JavaScript","simply-static"),__nextHasNoMarginBottom:!0,help:In("Combine multiple JS files into fewer bundles grouped by loading attributes (defer, async, delayed) and position (head/body).","simply-static"),disabled:"free"===options.plan||!c(),checked:D,onChange:e=>{T(e),t("css_js_aggregate_js",e)}}),(0,o.jsx)(p.TextareaControl,{label:In("Exclude Patterns","simply-static"),__nextHasNoMarginBottom:!0,help:In("Glob patterns for files to exclude from aggregation (one per line). Use this for scripts that break when concatenated, such as Google Maps init scripts, payment gateway SDKs, or scripts using document.write().","simply-static"),disabled:"free"===options.plan||!c(),value:e.css_js_aggregate_exclude_patterns,placeholder:"*maps*\n*stripe*\n*paypal*",onChange:e=>{t("css_js_aggregate_exclude_patterns",e)}})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:In("Defer & Delay","simply-static")})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",In("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:In("Eliminate render-blocking CSS and JavaScript resources to improve Lighthouse scores and page load speed.","simply-static")}),(0,o.jsx)(p.ToggleControl,{label:In("Enable Defer & Delay?","simply-static"),__nextHasNoMarginBottom:!0,help:In(y?"Optimize render-blocking resources during static export.":"Don't optimize render-blocking resources.","simply-static"),disabled:"free"===options.plan||!c(),checked:y,onChange:e=>{b(e),t("use_css_optimize",e)}}),y&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.ToggleControl,{label:In("Defer Non-Critical CSS","simply-static"),__nextHasNoMarginBottom:!0,help:In('Convert non-critical stylesheets to load asynchronously using the media="print" pattern.',"simply-static"),disabled:"free"===options.plan||!c(),checked:_,onChange:e=>{v(e),t("css_optimize_defer_css",e)}}),_&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextareaControl,{label:In("Critical CSS Patterns","simply-static"),__nextHasNoMarginBottom:!0,help:In("Glob patterns for stylesheets that must remain render-blocking (one per line). Default: */style.css, */styles.css, */global.css, */theme*.css, */wp-block-*.css","simply-static"),disabled:"free"===options.plan||!c(),value:e.css_optimize_critical_patterns,placeholder:"*/style.css\n*/styles.css\n*/global.css\n*/theme*.css\n*/wp-block-*.css",onChange:e=>{t("css_optimize_critical_patterns",e)}})}),(0,o.jsx)(p.ToggleControl,{label:In("Defer Synchronous Scripts","simply-static"),__nextHasNoMarginBottom:!0,help:In("Add the defer attribute to render-blocking scripts. Preserves execution order (safe for jQuery dependencies).","simply-static"),disabled:"free"===options.plan||!c(),checked:w,onChange:e=>{S(e),t("css_optimize_defer_js",e)}}),w&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextareaControl,{label:In("Defer Exclude Patterns","simply-static"),__nextHasNoMarginBottom:!0,help:In("Additional glob patterns for scripts to exclude from deferral (one per line). Built-in patterns already exclude WordPress core scripts: jQuery, wp-i18n, wp-hooks, wp-url, wp-api-fetch, and wp-api.","simply-static"),disabled:"free"===options.plan||!c(),value:e.css_optimize_defer_js_excludes,placeholder:"*my-critical-script.js*\n*another-script*",onChange:e=>{t("css_optimize_defer_js_excludes",e)}})}),(0,o.jsx)(p.ToggleControl,{label:In("Optimize Google Fonts","simply-static"),__nextHasNoMarginBottom:!0,help:In("Preload Google Fonts stylesheets, inject the Google Fonts preconnect hint, and add display=swap for faster font loading.","simply-static"),disabled:"free"===options.plan||!c(),checked:C,onChange:e=>{j(e),t("css_optimize_google_fonts",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Add Preconnect Hints","simply-static"),__nextHasNoMarginBottom:!0,help:In("Add preconnect resource hints for high-value third-party font, icon, script, and image origins found in exported pages.","simply-static"),disabled:"free"===options.plan||!c(),checked:k,onChange:e=>{R(e),t("css_optimize_preconnect_hints",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Delay Non-Critical JavaScript","simply-static"),__nextHasNoMarginBottom:!0,help:In("Delay third-party scripts (analytics, tag managers, tracking pixels) until user interaction to reduce Total Blocking Time. Scripts load on first click, scroll, or keypress.","simply-static"),disabled:"free"===options.plan||!c(),checked:E,onChange:e=>{N(e),t("css_optimize_delay_js",e)}}),E&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextareaControl,{label:In("Additional Delay Patterns","simply-static"),__nextHasNoMarginBottom:!0,help:In("Additional glob patterns for scripts to delay (one per line). Built-in patterns already cover Google (Tag Manager, Analytics, Ads, ReCaptcha), HubSpot, Facebook/Meta Pixel, Hotjar, Clarity, Bing UET, Cloudflare (Insights, Turnstile), CleanTalk, Matomo/Piwik, Plausible, Twitter/X, LinkedIn, Pinterest, Tawk.to, Crisp, LiveChat, Intercom, Drift, Tidio, Segment, Amplitude, Mixpanel, Optimizely, Mouseflow, Lucky Orange, Crazy Egg, FullStory, LogRocket, and Sentry.","simply-static"),disabled:"free"===options.plan||!c(),value:e.css_optimize_delay_js_patterns,placeholder:"*example-tracking.com*\n*custom-analytics*",onChange:e=>{t("css_optimize_delay_js_patterns",e)}})})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[In("Image Optimization","simply-static"),(0,o.jsx)(H,{title:In("How to optimize images with ShortPixel?","simply-static"),videoUrl:"https://youtu.be/OIfKcXz3cxY"})]})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",In("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[d()&&(0,o.jsx)(L,{heading:In("Image optimization is handled by Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:In("Studio optimizes the static build pipeline for its hosting environment, so you do not need to connect ShortPixel for Studio deployments.","simply-static")})}),(0,o.jsx)(p.ToggleControl,{label:In("Optimize Images with ShortPixel?","simply-static"),__nextHasNoMarginBottom:!0,help:e.shortpixel_enabled?In("Optimize images with the ShortPixel API.","simply-static"):In("Don't optimize images with the ShortPixel API.","simply-static"),disabled:d()||"free"===options.plan||!c(),checked:!!e.shortpixel_enabled,onChange:e=>{t("shortpixel_enabled",e)}}),e.shortpixel_enabled&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextControl,{label:In("ShortPixel API Key","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.shortpixel_api_key,disabled:d()||"free"===options.plan||!c(),onChange:e=>{t("shortpixel_api_key",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Convert to webP","simply-static"),__nextHasNoMarginBottom:!0,help:e.shortpixel_webp_enabled?In("Convert images to webp format.","simply-static"):In("Don't convert images to webp format","simply-static"),checked:!!e.shortpixel_webp_enabled,disabled:d()||"free"===options.plan||!c(),onChange:e=>{t("shortpixel_webp_enabled",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Backup the original images?","simply-static"),__nextHasNoMarginBottom:!0,help:e.shortpixel_backup_enabled?In("Back original images.","simply-static"):In("Don't backup original images.","simply-static"),checked:!!e.shortpixel_backup_enabled,disabled:d()||"free"===options.plan||!c(),onChange:e=>{t("shortpixel_backup_enabled",e)}}),e.shortpixel_backup_enabled&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:In("It will preserve every image which might increase your disk space usage.","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{padding:1}),(0,o.jsxs)(p.Button,{disabled:d()||G,onClick:()=>{$(!0),r()({path:"/simplystatic/v1/shortpixel-restore",method:"POST"}).then(e=>{const t=JSON.parse(e);$(!1),alert(t.message)}).catch(e=>{$(!1),alert(e.message)})},variant:"secondary",children:[!G&&In("Restore Original Images","simply-static"),G&&[(0,o.jsx)(p.Dashicon,{icon:"update spin"}),In("Restoring...","simply-static")]]})]})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:In("Critical CSS","simply-static")})}),!d()&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com/simply-static-studio/",children:[" ",In("Requires Static Studio","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:In("Generate critical above-the-fold CSS to eliminate render-blocking stylesheets and improve page load speed. Critical CSS is generated for the homepage and injected into every page.","simply-static")}),(0,o.jsx)(p.ToggleControl,{label:In("Enable Critical CSS Generation?","simply-static"),__nextHasNoMarginBottom:!0,help:In(M?"Critical CSS will be generated during static export.":"Don't generate critical CSS.","simply-static"),disabled:!d(),checked:M,onChange:e=>{A(e),t("use_critical_css",e)}}),M&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextareaControl,{label:In("Additional URLs","simply-static"),__nextHasNoMarginBottom:!0,help:In("By default, critical CSS is generated from the homepage only. Add additional page URLs here (one per line) if those pages have significantly different styles.","simply-static"),disabled:!d(),value:e.critical_css_additional_urls,placeholder:"https://example.com/about\nhttps://example.com/contact",onChange:e=>{t("critical_css_additional_urls",e)}}),(0,o.jsx)(p.TextareaControl,{label:In("Custom CSS","simply-static"),__nextHasNoMarginBottom:!0,help:In("Add custom CSS that will be appended to the generated critical CSS. Use this to fix minor visual glitches.","simply-static"),disabled:!d(),value:e.critical_css_custom,placeholder:".header { position: sticky; top: 0; }",onChange:e=>{t("critical_css_custom",e)}})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:In("Versioning","simply-static")})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",In("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:In("Version CSS?","simply-static"),__nextHasNoMarginBottom:!0,help:In(z?"Appends a version query string to CSS files.":"Don't append a version query string to CSS files.","simply-static"),disabled:"free"===options.plan||!c(),checked:z,onChange:e=>{O(e),t("version_css",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Version JavaScript?","simply-static"),__nextHasNoMarginBottom:!0,help:In(W?"Appends a version query string to JavaScript files.":"Don't append a version query string to JavaScript files.","simply-static"),disabled:"free"===options.plan||!c(),checked:W,onChange:e=>{U(e),t("version_js",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:In("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:"pro"===options.plan&&c()&&(0,o.jsx)(p.Button,{onClick:()=>{n(),s(!0),setTimeout(function(){s(!1)},2e3)},variant:"primary",children:In("Save Settings","simply-static")})})]})},{__:Hn}=wp.i18n,An=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:r,isPro:s}=(0,i.useContext)(l),[c,d]=(0,i.useState)("wp-content"),[u,m]=(0,i.useState)("wp-includes"),[h,g]=(0,i.useState)("uploads"),[x,f]=(0,i.useState)("plugins"),[y,b]=(0,i.useState)("themes"),[_,v]=(0,i.useState)("style"),[w,S]=(0,i.useState)("author"),[C,j]=(0,i.useState)(!1),[k,R]=(0,i.useState)(!1),[E,N]=(0,i.useState)(!1),[P,B]=(0,i.useState)(!1),[D,T]=(0,i.useState)(!1),[F,I]=(0,i.useState)(!1),[M,A]=(0,i.useState)(!1),[L,z]=(0,i.useState)(!1),[O,W]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{e.wp_content_directory&&d(e.wp_content_directory),e.wp_includes_directory&&m(e.wp_includes_directory),e.wp_uploads_directory&&g(e.wp_uploads_directory),e.wp_plugins_directory&&f(e.wp_plugins_directory),e.wp_themes_directory&&b(e.wp_themes_directory),e.theme_style_name&&v(e.theme_style_name),e.author_url&&S(e.author_url),e.hide_version&&j(e.hide_version),e.hide_generator&&N(e.hide_generator),e.hide_prefetch&&R(e.hide_prefetch),e.hide_rsd&&B(e.hide_rsd),e.hide_emotes&&T(e.hide_emotes),e.disable_xmlrpc&&I(e.disable_xmlrpc),e.disable_embed&&A(e.disable_embed),e.disable_db_debug&&z(e.disable_db_debug),e.disable_wlw_manifest&&W(e.disable_wlw_manifest)},[e]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[Hn("Replace","simply-static"),(0,o.jsx)(H,{title:Hn("How to replace WP default paths","simply-static"),videoUrl:"https://youtu.be/GedyNJJMGaY"})]})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Hn("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:Hn("wp-content directory","simply-static"),help:Hn('Replace the "wp-content" directory.',"simply-static"),disabled:"free"===options.plan||!s(),type:"text",placeholder:"wp-content",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c,onChange:e=>{t("wp_content_directory",e)}}),(0,o.jsx)(p.TextControl,{label:Hn("wp-includes directory","simply-static"),help:Hn('Replace the "wp-includes" directory.',"simply-static"),disabled:"free"===options.plan||!s(),type:"text",placeholder:"wp-includes",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:u,onChange:e=>{t("wp_includes_directory",e)}}),(0,o.jsxs)("div",{className:"ss-directory-input-group",children:[(0,o.jsx)("label",{className:"components-base-control__label",children:Hn("Uploads directory","simply-static")}),(0,o.jsxs)(p.Flex,{align:"flex-start",gap:0,children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.TextControl,{disabled:!0,type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c+"/",className:"ss-directory-prefix"})}),(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsx)(p.TextControl,{disabled:"free"===options.plan||!s(),type:"text",placeholder:"uploads",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:h,onChange:e=>{g(e),t("wp_uploads_directory",e)}})})]}),(0,o.jsx)("p",{className:"components-base-control__help",children:Hn('Replace the "wp-content/uploads" directory.',"simply-static")})]}),(0,o.jsxs)("div",{className:"ss-directory-input-group",children:[(0,o.jsx)("label",{className:"components-base-control__label",children:Hn("Plugins directory","simply-static")}),(0,o.jsxs)(p.Flex,{align:"flex-start",gap:0,children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.TextControl,{disabled:!0,type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c+"/",className:"ss-directory-prefix"})}),(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsx)(p.TextControl,{disabled:"free"===options.plan||!s(),type:"text",placeholder:"plugins",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:x,onChange:e=>{f(e),t("wp_plugins_directory",e)}})})]}),(0,o.jsx)("p",{className:"components-base-control__help",children:Hn('Replace the "wp-content/plugins" directory.',"simply-static")})]}),(0,o.jsxs)("div",{className:"ss-directory-input-group",children:[(0,o.jsx)("label",{className:"components-base-control__label",children:Hn("Themes directory","simply-static")}),(0,o.jsxs)(p.Flex,{align:"flex-start",gap:0,children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.TextControl,{disabled:!0,type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c+"/",className:"ss-directory-prefix"})}),(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsx)(p.TextControl,{disabled:"free"===options.plan||!s(),type:"text",placeholder:"themes",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:y,onChange:e=>{b(e),t("wp_themes_directory",e)}})})]}),(0,o.jsx)("p",{className:"components-base-control__help",children:Hn('Replace the "wp-content/themes" directory.',"simply-static")})]}),(0,o.jsx)(p.__experimentalInputControl,{label:Hn("Theme style name","simply-static"),help:Hn("Replace the style.css filename.","simply-static"),disabled:"free"===options.plan||!s(),type:"text",className:"ss-theme-style-name",suffix:".css",placeholder:"style",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:_,onChange:e=>{v(e),t("theme_style_name",e)}}),(0,o.jsx)(p.TextControl,{label:Hn("Author URL","simply-static"),help:Hn("Replace the author url.","simply-static"),disabled:"free"===options.plan||!s(),type:"text",placeholder:"author",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:w,onChange:e=>{S(e),t("author_url",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[Hn("Hide","simply-static"),(0,o.jsx)(H,{title:Hn("How to hide and disable WP core features","simply-static"),videoUrl:"https://youtu.be/GijIsrfFB8o"})]})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Hn("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:Hn("Hide WordPress Version","simply-static"),__nextHasNoMarginBottom:!0,checked:C,disabled:"free"===options.plan||!s(),onChange:e=>{j(e),t("hide_version",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Hide WordPress Generator Meta","simply-static"),__nextHasNoMarginBottom:!0,checked:E,disabled:"free"===options.plan||!s(),onChange:e=>{N(e),t("hide_generator",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Hide DNS Prefetch WordPress link","simply-static"),__nextHasNoMarginBottom:!0,checked:k,disabled:"free"===options.plan||!s(),onChange:e=>{R(e),t("hide_prefetch",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Hide RSD Header","simply-static"),__nextHasNoMarginBottom:!0,checked:P,disabled:"free"===options.plan||!s(),onChange:e=>{B(e),t("hide_rsd",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[Hn("Disable","simply-static"),(0,o.jsx)(H,{title:Hn("How to hide and disable WP core features","simply-static"),videoUrl:"https://youtu.be/GijIsrfFB8o"})]})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Hn("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:Hn("Disable XML-RPC","simply-static"),__nextHasNoMarginBottom:!0,checked:F,disabled:"free"===options.plan||!s(),onChange:e=>{I(e),t("disable_xmlrpc",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Disable Embed Scripts","simply-static"),__nextHasNoMarginBottom:!0,checked:M,disabled:"free"===options.plan||!s(),onChange:e=>{A(e),t("disable_embed",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Disable DB Debug in Frontend","simply-static"),__nextHasNoMarginBottom:!0,checked:L,disabled:"free"===options.plan||!s(),onChange:e=>{z(e),t("disable_db_debug",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Disable WLW Manifest Scripts","simply-static"),__nextHasNoMarginBottom:!0,checked:O,disabled:"free"===options.plan||!s(),onChange:e=>{W(e),t("disable_wlw_manifest",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Disable Emojis","simply-static"),__nextHasNoMarginBottom:!0,checked:D,disabled:"free"===options.plan||!s(),onChange:e=>{T(e),t("hide_emotes",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:Hn("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:"pro"===options.plan&&s()&&(0,o.jsx)(p.Button,{onClick:()=>{n(),r(!0),setTimeout(function(){r(!1)},2e3)},variant:"primary",children:Hn("Save Settings","simply-static")})})]})},{__:Ln}=wp.i18n,zn=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isPro:c}=(0,i.useContext)(l),d="function"!=typeof c||!!c(),[u,m]=(0,i.useState)([]),[h,g]=(0,i.useState)({}),[x,f]=(0,i.useState)([]),[y,b]=(0,i.useState)([]),[_,v]=(0,i.useState)({}),[w,S]=(0,i.useState)([]),[C,j]=(0,i.useState)(!0),[k,R]=(0,i.useState)(!1),[E,N]=(0,i.useState)(!1),[P,B]=(0,i.useState)(3),[D,T]=(0,i.useState)(""),[F,I]=(0,i.useState)(["export","update","build","single"]),[M,H]=(0,i.useState)(!0),[A,L]=(0,i.useState)(!0),[z,O]=(0,i.useState)(!1),[W,U]=(0,i.useState)(!1),[G,$]=(0,i.useState)([]),[q,K]=(0,i.useState)([]),[V,J]=(0,i.useState)({}),[Y,X]=(0,i.useState)([]);return(0,i.useEffect)(()=>{if(j(!1!==e.ss_use_single_exports),R(!!e.ss_single_export_add_xml_sitemap),r()({path:"/simplystatic/v1/pages"}).then(t=>{const n=t.map(e=>e.label),i={};t.forEach(e=>i[e.label]=e.value),m(n),g(i);const a=Array.isArray(e.ss_single_pages)?e.ss_single_pages:[];if(a.length>0){const e=a.map(e=>{const n=t.find(t=>String(t.value)===String(e));return n?n.label:String(e)});f(e)}}),r()({path:"/simplystatic/v1/taxonomies"}).then(t=>{const n=t.map(e=>e.label),i={};t.forEach(e=>i[e.label]=e.value),b(n),v(i);const a=Array.isArray(e.ss_single_taxonomy_archives)?e.ss_single_taxonomy_archives:[];if(a.length>0){const e=a.map(e=>{const n=t.find(t=>String(t.value)===String(e));return n?n.label:String(e)});S(e)}}),r()({path:"/simplystatic/v1/post-types",parse:!0}).then(e=>{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return void $([])}let t=Array.isArray(e)?e:e&&e.data?e.data:[];$(t)}),H(!!e.ss_single_include_archives||void 0===e.ss_single_include_archives),L(!!e.ss_single_include_pagination||void 0===e.ss_single_include_pagination),O(!!e.ss_use_builds),U(!!e.ss_tools_submenu),N(!!e.ss_single_auto_export),void 0!==e.ss_single_auto_export_delay){const t=parseInt(e.ss_single_auto_export_delay,10);B(Number.isNaN(t)?3:Math.max(0,t))}else B(3);T(e.ss_webhook_url||e.ss_single_export_webhook_url||"");Array.isArray(e.ss_webhook_enabled_types)&&e.ss_webhook_enabled_types.length?I(e.ss_webhook_enabled_types):I(e.ss_single_export_webhook_url&&e.ss_single_export_webhook_url.length?["single"]:["export","update","build","single"])},[e.ss_single_pages,e.ss_single_taxonomy_archives,e.ss_use_builds]),(0,i.useEffect)(()=>{if(!G.length)return K([]),void J({});const n=G.map(e=>e.label),i={};G.forEach(e=>i[e.label]=e.name),K(n),J(i);const a=Array.isArray(e.ss_single_auto_export_types)?e.ss_single_auto_export_types:[],r=a.filter(e=>G.some(t=>String(t.name)===String(e))),s=r.map(e=>G.find(t=>String(t.name)===String(e)).label);X(s),Array.isArray(e.ss_single_auto_export_types)&&a.length!==r.length&&t("ss_single_auto_export_types",r)},[G,e.ss_single_auto_export_types]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("strong",{children:Ln("Single Push","simply-static")})}),("free"===options.plan||!d)&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.ExternalLink,{href:"https://simplystatic.com",children:Ln("Requires Simply Static Pro","simply-static")})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:Ln("Use Single Push?","simply-static"),help:Ln(C?"Quickly push updates to your static site while editing pages/posts.":"Do not allow quick updates while editing posts/pages.","simply-static"),checked:!!C,disabled:!d,onChange:e=>{d&&(j(e),t("ss_use_single_exports",e))}}),C&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.ToggleControl,{label:Ln("Use Auto Push?","simply-static"),help:Ln(E?"Automatically schedule a Single Push when a post/page is updated/published.":"Do not automatically run Single Push when a post/page is updated/published.","simply-static"),checked:!!E,disabled:!d,onChange:e=>{d&&(N(e),t("ss_single_auto_export",e))}}),E&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.FormTokenField,{label:Ln("Auto Push Post Types","simply-static"),__next40pxDefaultSize:!0,value:Y,suggestions:q,onChange:e=>{if(!d)return;const n=Object.values(V),i=e.map(e=>V[e]?V[e]:n.includes(e)?e:null).filter(Boolean),a=i.map(e=>{const t=Object.entries(V).find(([,t])=>t===e);return t?t[0]:e});X(a),t("ss_single_auto_export_types",i)},help:Ln("Choose which public post types should trigger automatic single pushes when updated. If none is selected, all public post types are used.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field",disabled:!d}),(0,o.jsx)("p",{className:"description",children:Ln("Choose which public post types should trigger automatic single pushes when updated. If none is selected, all public post types are used.","simply-static")})]}),E&&(0,o.jsx)(p.__experimentalInputControl,{label:Ln("Auto push delay (seconds)","simply-static"),help:Ln("Delay before the automatic Single Push starts after a change is detected.","simply-static"),type:"number",min:0,value:P,disabled:!d,onChange:e=>{if(!d)return;const n=parseInt(e,10),i=Number.isNaN(n)?0:Math.max(0,n);B(i),t("ss_single_auto_export_delay",i)}}),(0,o.jsx)(p.FormTokenField,{label:Ln("Pages to update","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:x,suggestions:u,onChange:e=>{if(!d)return;f(e);const n=e.map(e=>{if(h[e])return h[e];const t=parseInt(e,10);return isNaN(t)?null:t}).filter(e=>null!==e);t("ss_single_pages",n)},help:Ln("Select which pages should start a Single Push. If none selected, we use your homepage.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:200,className:"horizontal-token-field",disabled:!d}),(0,o.jsx)("p",{className:"description",children:Ln("Choose which pages/files should be updated when running a Single Push.","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{margin:2}),(0,o.jsx)(p.FormTokenField,{label:Ln("Taxonomy Archives","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:w,suggestions:y,onChange:e=>{if(!d)return;S(e);const n=e.map(e=>_[e]?_[e]:e).filter(Boolean);t("ss_single_taxonomy_archives",n)},help:Ln("Choose which taxonomy archives to include for selected pages/posts (e.g., Categories, Tags, or custom taxonomies).","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field",disabled:!d}),(0,o.jsx)("p",{className:"description",children:Ln("Choose which taxonomies should be updated when running a Single Push.","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{margin:2}),(0,o.jsx)(p.ToggleControl,{label:Ln("Update archives (author/date/post_type)","simply-static"),help:Ln(M?"Update archive URLs when running a Single Push.":"Do not update archive URLs.","simply-static"),checked:!!M,disabled:!d,onChange:e=>{d&&(H(e),t("ss_single_include_archives",e))}}),(0,o.jsx)(p.ToggleControl,{label:Ln("Update pagination","simply-static"),help:Ln(A?"Update pagination URLs when running a Single Push.":"Do not update pagination URLs.","simply-static"),checked:!!A,disabled:!d,onChange:e=>{d&&(L(e),t("ss_single_include_pagination",e))}}),(0,o.jsx)(p.ToggleControl,{label:Ln("Update XML sitemap","simply-static"),help:Ln(k?"Update XML sitemaps when running a Single Push.":"Do not update XML sitemaps.","simply-static"),checked:!!k,disabled:!d,onChange:e=>{d&&(R(e),t("ss_single_export_add_xml_sitemap",e))}})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("strong",{children:Ln("Builds","simply-static")})}),("free"===options.plan||!d)&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.ExternalLink,{href:"https://simplystatic.com",children:Ln("Requires Simply Static Pro","simply-static")})})]})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.ToggleControl,{label:Ln("Enable Builds","simply-static"),help:Ln(z?"Use builds to quickly update a list of pages and files on your static site.":"Builds are disabled.","simply-static"),checked:!!z,disabled:!d,onChange:e=>{d&&(O(e),t("ss_use_builds",e))}})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("strong",{children:Ln("Tools Submenu","simply-static")})}),("free"===options.plan||!d)&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.ExternalLink,{href:"https://simplystatic.com",children:Ln("Requires Simply Static Pro","simply-static")})})]})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.ToggleControl,{label:Ln("Move menu to Tools submenu","simply-static"),help:Ln(W?"The Simply Static menu is placed under the Tools menu in the admin sidebar.":"The Simply Static menu is shown as a top-level item in the admin sidebar.","simply-static"),checked:!!W,disabled:!d,onChange:e=>{d&&(U(e),t("ss_tools_submenu",e))}})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("strong",{children:Ln("Webhook","simply-static")})}),("free"===options.plan||!d)&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.ExternalLink,{href:"https://simplystatic.com",children:Ln("Requires Simply Static Pro","simply-static")})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:Ln("Webhook URL","simply-static"),placeholder:"https://example.com/webhook-endpoint",value:D,disabled:!d,onChange:e=>{d&&(T(e),t("ss_webhook_url",e))},help:Ln("Simply Static will POST a JSON payload to this URL after pushes finish.","simply-static")}),(0,o.jsx)("p",{className:"description",children:Ln("Fire for these push types:","simply-static")}),(0,o.jsx)("div",{className:"ss-webhook-types",children:["export","update","build","single"].map(e=>(0,o.jsx)(p.ToggleControl,{label:Ln("export"===e?"Full Site":"update"===e?"Update":"build"===e?"Build":"Single","simply-static"),checked:F.includes(e),disabled:!d,onChange:n=>{if(!d)return;const i=new Set(F);n?i.add(e):i.delete(e);const a=Array.from(i);I(a),t("ss_webhook_enabled_types",a)}},e))}),(0,o.jsx)("p",{className:"description",children:Ln("Payload includes event, site_url, export_type, identifiers (when available), timestamp, and success.","simply-static")})]})]}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:Ln("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),d&&(0,o.jsx)("div",{className:"save-settings",children:(0,o.jsx)(p.Button,{onClick:()=>{d&&(n(),s(!0),setTimeout(()=>s(!1),2e3))},variant:"primary",children:Ln("Save Settings","simply-static")})})]})},{__:On}=wp.i18n,Wn=function(){const{isPro:e,isStudio:t}=(0,i.useContext)(l);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("h4",{className:"settings-headline",children:On("Version","simply-static")}),"pro"===options.plan&&e()?(0,o.jsx)(o.Fragment,{children:t()?(0,o.jsxs)("p",{className:"version-number",children:["Free: ",(0,o.jsx)("b",{children:options.version}),(0,o.jsx)("br",{}),"Pro: ",(0,o.jsx)("b",{children:options.version_pro}),(0,o.jsx)("br",{}),"Studio: ",(0,o.jsx)("b",{children:options.version_studio})]}):(0,o.jsxs)("p",{className:"version-number",children:["Free: ",(0,o.jsx)("b",{children:options.version}),(0,o.jsx)("br",{}),"Pro: ",(0,o.jsx)("b",{children:options.version_pro})]})}):(0,o.jsxs)("p",{className:"version-number",children:["Version: ",(0,o.jsx)("b",{children:options.version})]})]})},{__:Un}=wp.i18n,Gn=function(e=null){const{isPro:t}=(0,i.useContext)(l);return(0,o.jsxs)(p.Card,{className:"plugin-nav",children:[(0,o.jsx)("div",{className:"plugin-logo",children:(0,o.jsx)("img",{alt:"Logo",src:options.logo})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Button,{href:"https://simplystatic.com/changelogs/",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"editor-ul"})," ",Un("Changelog","simply-static")]}),(0,o.jsxs)(p.Button,{href:"https://docs.simplystatic.com",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-links"})," ",Un("Documentation","simply-static")]}),"free"===options.plan&&(0,o.jsxs)(p.Button,{href:"https://simplystatic.com",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-site-alt3"}),"Simply Static Pro"]}),(0,o.jsx)(Wn,{})]})},{__:$n}=wp.i18n;function qn({onClose:e,setSelectableEnvironments:t,setSelectedEnvironment:n}){const[a,s]=(0,i.useState)(""),[l,c]=(0,i.useState)(!1);return(0,o.jsxs)("div",{className:"ss-environment-form",children:[(0,o.jsx)(p.TextControl,{label:"Name",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>s(e),value:a}),(0,o.jsx)("p",{children:$n("A new environment will be created with the current configuration.","simply-static")}),(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexBlock,{children:(0,o.jsx)(p.Button,{variant:"primary",onClick:()=>{c(!0),r()({path:"/simplystatic/v1/environment",method:"POST",data:{title:a}}).then(i=>{let a=Object.keys(i.environments).map(function(e){return{label:i.environments[e],value:e}});t(a),n(i.current_environment),e()}).catch(e=>{alert(e.message)}).finally(()=>c(!1))},isBusy:l,children:$n(l?"Creating...":"Create","simply-static")})}),(0,o.jsx)(p.FlexBlock,{children:(0,o.jsx)(p.Button,{variant:"secondary",onClick:e,children:$n("Cancel","simply-static")})})]})]})}const{__:Kn}=wp.i18n;function Vn({onChange:e,current:t,environments:n,disabled:i,onDelete:a,isStudio:r}){const s=Kn(r?"Choose an environment. If you like to create new ones, please set them up in your Static Studio dashboard.":"Choose an environment or create a new one to configure settings.","simply-static");return(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{style:{minWidth:"80%"},children:(0,o.jsx)(p.SelectControl,{disabled:i,value:t,options:n,help:s,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e})}),(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.Button,{className:"environment-delete-button",variant:"tertiary",label:Kn("Delete selected environment","simply-static"),size:"small",icon:"trash",disabled:i,onClick:a})})]})}const{__:Jn}=wp.i18n;function Yn({getSettings:e,isRunning:t}){const{getIntegrationById:n,isStudio:a}=(0,i.useContext)(l),s=()=>{try{if("undefined"==typeof options)return!1;if("pro"!==options.plan)return!1;const e=n?n("environments"):null;return!(!e||!e.active&&!e.can_run)}catch(e){return!1}},[c,d]=(0,i.useState)(""),[u,m]=(0,i.useState)([]),[h,g]=(0,i.useState)(!1),[x,f]=(0,i.useState)(!1),y=!!a&&a();return(0,i.useEffect)(()=>{s()&&r()({path:"/simplystatic/v1/environment",method:"GET"}).then(e=>{let t=Object.keys(e.environments).map(function(t){return{label:e.environments[t],value:t}});m(t),d(e.current_environment)}).catch(e=>{})},[]),(0,i.useEffect)(()=>{y&&g(!1)},[y]),(0,o.jsxs)("div",{className:"environment-container",children:[(0,o.jsxs)("h4",{className:"settings-headline",children:[" ",Jn("Environment","simply-static")]}),!h&&c&&(0,o.jsxs)("p",{children:["Current: ",(0,o.jsx)("strong",{children:x?Jn("Changing ...","simply-static"):u.filter(e=>e.value===c).pop().label})]}),!h&&u.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Vn,{onChange:t=>{f(!0),s()?r()({path:"/simplystatic/v1/environment",method:"PUT",data:{version:t}}).then(()=>{e(),d(t)}).catch(e=>alert(e.message)).finally(()=>{f(!1)}):f(!1)},environments:u,onDelete:()=>{f(!0),s()?r()({path:"/simplystatic/v1/environment",method:"DELETE",data:{version:c}}).then(t=>{e();let n=Object.keys(t.environments).map(function(e){return{label:t.environments[e],value:e}});m(n),d(t.current_environment)}).catch(e=>alert(e.message)).finally(()=>{f(!1)}):f(!1)},current:c,disabled:t||x,isStudio:y}),(0,o.jsx)("div",{className:"environment-extension-slot","data-ss-environment-sidebar-slot":!0})]}),!h&&!y&&(0,o.jsx)(p.Button,{disabled:t||x,variant:"primary",size:"large",onClick:()=>g(!0),children:"Create an Environment"}),h&&!y&&(0,o.jsx)(qn,{onClose:()=>g(!1),setSelectedEnvironment:d,setSelectableEnvironments:m})]})}function Xn(e){if(!e||"object"!=typeof e)return null;const t=e.snapshot_rollback&&"object"==typeof e.snapshot_rollback?e.snapshot_rollback:{};return e.rollback_running||t.running?{...t,running:!0}:null}const{__:Qn,sprintf:Zn}=wp.i18n,ei=(e,t)=>"string"==typeof e&&e.trim()?e.trim():t,ti=(e,t)=>{if(e&&e.data){const t=ei(e.data.message,"");if(t)return t}return ei(e&&e.message,t)},ni=function(e=null){const{isRunning:t,setIsRunning:n,isResumed:a,setIsResumed:c,isPaused:d,setIsPaused:u,blogId:m,settings:h,updateFromNetwork:g,getSettings:x,isPro:f,canRunIntegration:y,showMobileNav:b,setShowMobileNav:_,isDelayed:v,snapshotRollback:w,setSnapshotRollback:S,isRollbackRunning:C}=(0,i.useContext)(l),{activeItem:j,setActiveItem:k}=e,[R,E]=(0,i.useState)(!1),[N,P]=(0,i.useState)("current"),[B,D]=(0,i.useState)([]),[T,F]=(0,i.useState)(!1),[I,M]=(0,i.useState)("export"),[H,A]=(0,i.useState)(!0),[L,z]=(0,i.useState)(!1),[O,W]=(0,i.useState)(0),U=(0,i.useRef)(!1),G=(0,i.useRef)(!1),$=w&&w.message?w.message:Qn("Rollback in progress. Simply Static export actions are locked until the rollback has finished.","simply-static"),q=w&&w.progress?w.progress:{},K=q.label?`${q.label}${q.total?` (${q.percent||0}%, ${q.completed||0}/${q.total})`:""}`:$,V=()=>{options.is_multisite&&r()({path:"/simplystatic/v1/check-can-run",method:"GET"}).then(e=>{JSON.parse(e).can_run?A(!0):A(!1)}).catch(()=>{})};s(()=>{V()},options.is_multisite&&!t?1e5:null),(0,i.useEffect)(()=>{options.is_multisite&&V()},[]),(0,i.useEffect)(()=>{if(E(t||d||C),options.selectable_sites&&!options.is_network&&options.is_multisite){let e=options.selectable_sites.slice().sort(function(e,t){return(e.name||"").localeCompare(t.name||"")}).map(function(e){return{label:`${e.name} (#${e.blog_id})`,value:e.blog_id}});e.unshift({label:Qn("Use current settings","simply-static"),value:"current"}),D(e)}},[options,t,d,C]),(0,i.useEffect)(()=>{r()({path:"/simplystatic/v1/unpushed-changes",method:"GET"}).then(e=>{const t=JSON.parse(e),n=t.data?t.data.total:0;W(n),U.current||G.current||(n>0&&"pro"===options.plan&&f()?M("update"):M("export"),U.current=!0)}).catch(()=>{W(0),U.current||G.current||(M("export"),U.current=!0)})},[h,t]);const J=(e,t,n)=>r()({path:e,method:"POST",data:{blog_id:m}}).then(e=>(((e,t)=>{let n=e;if("string"==typeof e)try{n=JSON.parse(e)}catch(e){throw new Error(t)}if(!n||"object"!=typeof n||Array.isArray(n))throw new Error(t);const i=Number(n.status);if(!Number.isInteger(i)||i<200||i>=300)throw new Error(ei(n.message,t))})(e,n),t(),!0)).catch(e=>(alert(ti(e,n)),!1));let Y="";if(Object.keys(options.builds).length){const e=Object.keys(options.builds).map(e=>(0,o.jsx)("option",{value:e,children:options.builds[e]},e));e.sort((e,t)=>e.props.children.localeCompare(t.props.children)),Y=(0,o.jsx)("optgroup",{label:"Builds",children:e})}const X=options.integrations&&options.integrations.multilingual?options.integrations.multilingual:{},Q=(void 0===options.can_export_languages||options.can_export_languages)&&"pro"===options.plan&&f()&&y("multilingual")&&X.can_run,Z=Q?(()=>{const e=options.languages||options.multilingual_languages||options.available_languages||[];let t=[];return t=Array.isArray(e)?e.map(e=>"string"==typeof e?{label:e,value:e}:{label:e.label||e.name||e.native_name||e.code||e.slug,value:e.value||e.code||e.slug||e.locale}):Object.keys(e).map(t=>{const n=e[t];return{label:"string"==typeof n?n:n.label||n.name||n.native_name||t,value:"string"==typeof n?t:n.value||n.code||n.slug||n.locale||t}}),t=t.filter(e=>e.label&&e.value),t})():[];let ee="";Z.length&&(ee=(0,o.jsx)("optgroup",{label:Qn("Languages","simply-static"),children:Z.map(e=>(0,o.jsx)("option",{value:`language:${e.value}`,children:e.label},e.value))})),(0,i.useEffect)(()=>{Q||0!==I.indexOf("language:")||M("export")},[Q,I]);const te=e=>{try{return!options.allowed_pages||options.allowed_pages.includes(e)}catch(e){return!0}},ne=["/","/diagnostics"].some(te),ie=["/general","/deployment","/forms","/search","/optimize","/hide-wp","/workflow"].some(te),ae=["/integrations","/utilities","/debug","/uam"].some(te);return(0,o.jsxs)(p.Card,{className:"plugin-nav",children:[(0,o.jsx)("div",{className:"plugin-logo",children:(0,o.jsx)("img",{alt:"Logo",src:options.logo})}),(0,o.jsxs)("div",{className:`generate-container ${R&&!C?"generating":""} ${C?"rollback-locked":""}`,children:[(0,o.jsxs)(p.SelectControl,{className:"generate-type",value:I,disabled:R,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>{G.current=!0,M(e)},children:[(0,o.jsx)("option",{value:"export",children:Qn("Full Site","simply-static")}),"pro"===options.plan&&f()?(0,o.jsx)("option",{value:"update",children:Qn("Changes Only","simply-static")}):(0,o.jsx)("option",{disabled:!0,value:"update",children:Qn("Changes Only (Requires Simply Static Pro)","simply-static")}),Y,ee]}),H&&!C&&(0,o.jsx)(kn,{canGenerate:!R,startExport:()=>{if(C)return void alert($);E(!0),c(!1),u(!1);const e="language:",i=0===I.indexOf(e);r()({path:"/simplystatic/v1/start-export",method:"POST",data:{blog_id:m,type:i?"export":I,language:i?I.replace(e,""):""}}).then(e=>{var i=JSON.parse(e);if(500===i.status)return alert(i.message),void E(!1);if(409===i.status){const e=i.message||$,n=Xn(i);return n&&S({...n,status:n,message:e}),alert(e),void E(!!n||t||d||C)}n(!0)}).catch(e=>{const n=e&&e.data&&409===e.data.status?Xn(e.data):null,i=e.message||$;n&&S({...n,status:n,message:i}),alert(i),E(!!n||t||d||C)})},cancelExport:()=>{const e=Qn("The export could not be cancelled. Please try again.","simply-static");return J("/simplystatic/v1/cancel-export",()=>{c(!1),u(!1),n(!1),E(!1)},e)},pauseExport:()=>{const e=Qn("The export could not be paused. Please try again.","simply-static");return J("/simplystatic/v1/pause-export",()=>{n(!1),c(!1),u(!0)},e)},resumeExport:()=>{const e=Qn("The export could not be resumed. Please try again.","simply-static");return J("/simplystatic/v1/resume-export",()=>{c(!0),u(!1),n(!0)},e)},isRunning:t,isPaused:d,isResumed:a,isDelayed:v,buttonLabel:Qn("Push","simply-static")}),C&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Button,{disabled:!0,className:"generate rollback-locked-button",children:[(0,o.jsx)(p.Dashicon,{icon:"update"}),Qn("Rollback in progress","simply-static")]}),(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,className:"rollback-lock-sidebar-notice",children:(0,o.jsx)("p",{children:K})})]}),O>0&&!C&&!t&&!d&&"pro"===options.plan&&f()&&(0,o.jsx)(p.Notice,{status:"info",isDismissible:!1,className:"unpushed-changes-notice",children:(0,o.jsx)("p",{children:Zn(Qn("You have %d unpushed changes.","simply-static"),O)})}),O>0&&!C&&!t&&!d&&!("pro"===options.plan&&f())&&(0,o.jsx)(p.Tooltip,{text:Qn("Upgrade to Simply Static Pro to push only changes.","simply-static"),children:(0,o.jsx)(p.Notice,{status:"info",isDismissible:!1,className:"unpushed-changes-notice",children:(0,o.jsx)("p",{children:Zn(Qn("You have %d unpushed changes.","simply-static"),O)})})}),!C&&!H&&options.is_multisite&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Button,{disabled:!0,className:"generate",children:[(0,o.jsx)(p.Dashicon,{icon:"update"}),Qn("Push","simply-static")]}),(0,o.jsx)(p.Button,{target:"_blank",variant:"link",href:"https://simplystatic.com/pricing/",children:Qn("A push from another site is running. Upgrade to queue them.","simply-static")}),(0,o.jsx)(p.Button,{variant:"link",isBusy:L,disabled:L,onClick:()=>{z(!0),r()({path:"/simplystatic/v1/reset-export-lock",method:"POST"}).then(()=>{A(!0)}).catch(()=>{A(!1)}).finally(()=>{z(!1)})},children:Qn("Reset push lock","simply-static")})]})]}),(0,o.jsxs)(p.CardBody,{children:["pro"===options.plan&&f()&&(0,o.jsx)(o.Fragment,{children:!options.is_network&&y("environments")&&(0,o.jsx)(Yn,{isRunning:t||C,getSettings:x})}),!options.is_network&&options.is_multisite&&(0,o.jsxs)("div",{className:"import-container",children:[(0,o.jsxs)("h4",{className:"settings-headline",children:[" ",Qn("Import","simply-static")]}),(0,o.jsx)(p.SelectControl,{value:N,options:B,help:Qn("Choose a subsite to import settings from.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>{P(e)}}),"current"!==N&&(0,o.jsx)(p.Button,{isPrimary:!0,isBusy:T,disabled:T,onClick:()=>{(e=>{F(!0);const t=Qn("The settings could not be imported. Please try again.","simply-static");Promise.resolve().then(()=>g(e)).then(()=>(window.location.reload(),!0)).catch(e=>(alert(ti(e,t)),!1)).finally(()=>{F(!1)})})(N)},children:Qn("Import Settings","simply-static")}),T?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"info",isDismissible:!1,className:"upgrade-network-notice",children:(0,o.jsx)("p",{children:Qn("Importing settings…","simply-static")})})}):""]}),ne&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("h4",{className:"settings-headline",children:[" ",Qn("Tools","simply-static")]}),te("/")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/"),_(!b)},className:"/"===j?"is-active-item generate":"generate",path:"/",children:[(0,o.jsx)(p.Dashicon,{icon:"update"})," ",Qn("Activity Log","simply-static")]}),te("/diagnostics")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/diagnostics"),_(!b)},className:"/diagnostics"===j?"is-active-item":"",path:"/diagnostics",children:[(0,o.jsx)(p.Dashicon,{icon:"bell"})," ",Qn("Diagnostics","simply-static")]})]})]}),ie&&(0,o.jsxs)(p.CardBody,{children:[(0,o.jsxs)("h4",{className:"settings-headline",children:[" ",Qn("Settings","simply-static")]}),te("/general")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/general"),_(!b)},className:"/general"===j?"is-active-item":"",path:"/general",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-generic"})," ",Qn("General","simply-static")]}),!options.is_network&&te("/deployment")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/deployment"),_(!b)},className:"/deployment"===j?"is-active-item":"",path:"/deployment",children:[(0,o.jsx)(p.Dashicon,{icon:"migrate"})," ",Qn("Deploy","simply-static")]}),!options.is_network&&(0,o.jsxs)(o.Fragment,{children:[te("/forms")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/forms"),_(!b)},className:"/forms"===j?"is-active-item":"",path:"/forms",children:[(0,o.jsx)(p.Dashicon,{icon:"align-center"})," ",Qn("Forms","simply-static")]}),te("/search")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/search"),_(!b)},className:"/search"===j?"is-active-item":"",path:"/search",children:[(0,o.jsx)(p.Dashicon,{icon:"search"})," ",Qn("Search","simply-static")]}),te("/optimize")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/optimize"),_(!b)},className:"/optimize"===j?"is-active-item":"",path:"/optimize",children:[(0,o.jsx)(p.Dashicon,{icon:"dashboard"})," ",Qn("Optimize","simply-static")]}),te("/hide-wp")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/hide-wp"),_(!b)},className:"/hide-wp"===j?"is-active-item":"",path:"/hide-wp",children:[(0,o.jsx)(p.Dashicon,{icon:"hidden"})," ",Qn("Hide WP","simply-static")]})]})]}),ae&&(0,o.jsxs)(p.CardBody,{children:[(0,o.jsxs)("h4",{className:"settings-headline",children:[" ",Qn("Advanced","simply-static")]}),te("/integrations")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/integrations"),_(!b)},className:"/integrations"===j?"is-active-item":"",path:"/integrations",children:[(0,o.jsx)(p.Dashicon,{icon:"block-default"})," ",Qn("Integrations","simply-static")]}),te("/workflow")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/workflow"),_(!b)},className:"/workflow"===j?"is-active-item":"",path:"/workflow",children:[(0,o.jsx)(p.Dashicon,{icon:"randomize"})," ",Qn("Workflow","simply-static")]}),te("/utilities")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/utilities"),_(!b)},className:"/utilities"===j?"is-active-item":"",path:"/utilities",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-tools"})," ",Qn("Utilities","simply-static")]}),te("/debug")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/debug"),_(!b)},className:"/debug"===j?"is-active-item":"",path:"/debug",children:[(0,o.jsx)(p.Dashicon,{icon:"editor-help"})," ",Qn("Debug","simply-static")]}),options.uam_enabled&&te("/uam")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/uam"),_(!b)},className:"/uam"===j?"is-active-item":"",path:"/uam",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-users"})," ",Qn("UAM","simply-static")]})]}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("h4",{className:"settings-headline",children:"Learn"}),(0,o.jsxs)(p.Button,{href:"https://docs.simplystatic.com",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-links"})," ",Qn("Documentation","simply-static")]}),(0,o.jsxs)(p.Button,{href:"https://www.youtube.com/playlist?list=PLcpe8_rNg8U5g1gCOa0Ge6T17f50nSvmg",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"format-video"})," ",Qn("Video Course","simply-static")]}),(0,o.jsxs)(p.Button,{href:"https://simplystatic.com/tutorials/",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"edit"})," ",Qn("Tutorials","simply-static")]})]}),(0,o.jsx)(Wn,{})]})},{__:ii}=wp.i18n;function ai(){return(0,o.jsxs)("div",{className:"promo-sidebar",children:[(0,o.jsx)("div",{className:"promo-card promo-card-pro",children:(0,o.jsxs)("div",{className:"promo-card-inner",children:[(0,o.jsx)("span",{className:"promo-badge",children:ii("Pro","simply-static")}),(0,o.jsx)("h3",{className:"promo-headline",children:ii("Simply Static Pro","simply-static")}),(0,o.jsx)("p",{className:"promo-description",children:ii("Unlock single push, change detection, environments, search, forms, and much more.","simply-static")}),(0,o.jsxs)("ul",{className:"promo-features",children:[(0,o.jsx)("li",{children:ii("Push only changes","simply-static")}),(0,o.jsx)("li",{children:ii("Search integration","simply-static")}),(0,o.jsx)("li",{children:ii("Form handling","simply-static")}),(0,o.jsx)("li",{children:ii("Multilingual support","simply-static")}),(0,o.jsx)("li",{children:ii("Minification and image optimization","simply-static")})]}),(0,o.jsx)(p.Button,{isPrimary:!0,href:"https://simplystatic.com/simply-static-pro/?utm_source=plugin&utm_medium=promo-sidebar&utm_campaign=pro",target:"_blank",rel:"noopener noreferrer",className:"promo-button",children:ii("Get Simply Static Pro →","simply-static")})]})}),(0,o.jsx)("div",{className:"promo-card promo-card-studio",children:(0,o.jsxs)("div",{className:"promo-card-inner",children:[(0,o.jsx)("span",{className:"promo-badge promo-badge-studio",children:ii("Studio","simply-static")}),(0,o.jsx)("h3",{className:"promo-headline",children:ii("Static Studio","simply-static")}),(0,o.jsx)("p",{className:"promo-description",children:ii("The all-in-one WordPress operations platform for static sites, including Site Health, reports, performance checks, uptime monitoring, and hosting.","simply-static")}),(0,o.jsxs)("ul",{className:"promo-features",children:[(0,o.jsx)("li",{children:ii("14-day trial with 3 sites included","simply-static")}),(0,o.jsx)("li",{children:ii("Site Health and reports","simply-static")}),(0,o.jsx)("li",{children:ii("Performance checks and uptime monitoring","simply-static")}),(0,o.jsx)("li",{children:ii("All Pro features included","simply-static")})]}),(0,o.jsx)(p.Button,{isPrimary:!0,href:"https://simplystatic.com/simply-static-studio/?utm_source=plugin&utm_medium=promo-sidebar&utm_campaign=studio",target:"_blank",rel:"noopener noreferrer",className:"promo-button promo-button-studio",children:ii("Start 14-Day Free Trial →","simply-static")})]})})]})}const{__:ri}=wp.i18n,si=["/","/diagnostics","/general","/deployment","/forms","/search","/optimize","/hide-wp","/workflow","/utilities","/debug","/uam","/integrations"],oi={"activity-log":"/",generate:"/",deploy:"/deployment"},li=()=>{if("undefined"==typeof window||!window.location.hash)return null;let e=window.location.hash.replace(/^#\/?/,"").split("?")[0];try{e=decodeURIComponent(e).trim()}catch(e){return null}if(!e)return null;if(oi[e])return oi[e];const t=`/${e}`;return si.includes(t)?t:null},ci=function(){const{isRunning:e,isPaused:t,passedChecks:n,isPro:a,showMobileNav:r,setShowMobileNav:s,settings:c}=(0,i.useContext)(l),d=e=>(e=>{try{return!(!si.includes(e)||options.allowed_pages&&!options.allowed_pages.includes(e)||"/uam"===e&&!options.uam_enabled)}catch(e){return!0}})(e)?e:options.initial,u=()=>{const e=li();return d(e||(localStorage.getItem("ss-initial-page")?localStorage.getItem("ss-initial-page"):options.initial))},[m,h]=(0,i.useState)(u),[g,x]=(0,i.useState)(u),[f,y]=(0,i.useState)(!1),b=e=>{"undefined"!=typeof window&&window.history&&window.history.replaceState&&window.history.replaceState({...window.history.state,ssRoute:e},"",window.location.href)};(0,i.useEffect)(()=>{let e=localStorage.getItem("ss-initial-page");const t=li();if(!f){y(!0);let n=options.initial;t?n=t:e&&(n=e,localStorage.removeItem("ss-initial-page"));const i=d(n);h(i),x(i),b(i)}},[options,e,t]),(0,i.useEffect)(()=>{const e=()=>{const e=d(li()||(()=>{if("undefined"==typeof window||!window.history||!window.history.state)return null;const e=window.history.state.ssRoute;return si.includes(e)?e:null})()||options.initial);h(e),x(e)};return window.addEventListener("hashchange",e),window.addEventListener("popstate",e),()=>{window.removeEventListener("hashchange",e),window.removeEventListener("popstate",e)}},[]);const _=e=>{if(h(e),"undefined"==typeof window||!window.history)return;const t=(e=>"/"===e?"":e.replace(/^\//,""))(e);t?window.location.hash!==`#${t}`?window.history.pushState({...window.history.state,ssRoute:e},"",`#${t}`):b(e):window.location.hash?window.history.pushState({...window.history.state,ssRoute:e},"",`${window.location.pathname}${window.location.search}`):b(e)};return(0,o.jsx)("div",{className:"plugin-settings-container",children:(0,o.jsxs)(p.__experimentalNavigatorProvider,{initialPath:g,style:{minHeight:window.innerHeight-(wpadminbar?wpadminbar.clientHeight:0)-1+"px"},children:[(0,o.jsxs)(p.Button,{type:"button","aria-expanded":r,"aria-controls":"simply-static-mobile-nav",onClick:()=>{s(!0)},className:"show-nav",children:[(0,o.jsx)(p.Dashicon,{icon:"align-center"})," ",ri("Toggle menu","simply-static")]}),r&&(0,o.jsxs)("div",{id:"simply-static-mobile-nav",className:"mobile-nav-overlay",role:"dialog","aria-modal":"true","aria-label":ri("Simply Static menu","simply-static"),children:[(0,o.jsxs)("div",{className:"mobile-nav-header",children:[(0,o.jsx)("span",{children:ri("Menu","simply-static")}),(0,o.jsx)(p.Button,{isSmall:!0,variant:"tertiary","aria-label":ri("Close menu","simply-static"),onClick:()=>s(!1),children:(0,o.jsx)(p.Dashicon,{icon:"no-alt"})})]}),(0,o.jsx)("div",{className:"mobile-nav-content",children:options.is_network?(0,o.jsx)(Gn,{}):(0,o.jsx)(ni,{setActiveItem:_,activeItem:m})})]}),(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{className:"sidebar",children:options.is_network?(0,o.jsx)(Gn,{}):(0,o.jsx)(ni,{setActiveItem:_,activeItem:m})}),(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsxs)("div",{className:"plugin-settings",children:["no"!==n||options.is_network?"":(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsxs)(p.Notice,{status:"notice",isDismissible:!1,className:"/"==m?"diagnostics-notice diagnostics-notice-generate":"diagnostics-notice",children:[(0,o.jsxs)("p",{children:[ri("There are errors in diagnostics that may negatively affect your static push.","simply-static"),(0,o.jsx)("br",{}),ri("Please review them and get them fixed to avoid problems.","simply-static")]}),(0,o.jsxs)(p.__experimentalNavigatorButton,{isSecondary:!0,onClick:()=>{_("/diagnostics"),s(!r)},className:"/diagnostics"===m?"is-active-item":"",path:"/diagnostics",children:[(0,o.jsx)(p.Dashicon,{icon:"editor-help"})," ",ri("Visit Diagnostics","simply-static")]})]})}),"pro"!==options.plan||a()?"":(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Notice,{status:"error",isDismissible:!1,className:"/"==m?"diagnostics-notice diagnostics-notice-generate":"diagnostics-notice",children:[(0,o.jsxs)("p",{children:[ri("You are using the pro version without a valid license.","simply-static"),(0,o.jsx)("br",{}),ri("We have temporarily disabled all the pro features now. Please contact our support to have the problem solved.","simply-static")]}),(0,o.jsx)(p.Button,{isPrimary:!0,href:"https://simplystatic.com/support/",target:"_blank",children:"Contact Support"})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:"5px"})]})}),"/"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/",children:(0,o.jsx)(Fn,{})}),"/diagnostics"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/diagnostics",children:(0,o.jsx)(U,{})}),"/general"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/general",children:(0,o.jsx)(O,{})}),"/deployment"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/deployment",children:(0,o.jsx)(K,{})}),"/forms"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/forms",children:(0,o.jsx)(J,{})}),"/search"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/search",children:(0,o.jsx)(X,{})}),"/optimize"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/optimize",children:(0,o.jsx)(Mn,{})}),"/hide-wp"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/hide-wp",children:(0,o.jsx)(An,{})}),"/workflow"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/workflow",children:(0,o.jsx)(zn,{})}),"/utilities"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/utilities",children:(0,o.jsx)($,{})}),"/debug"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/debug",children:(0,o.jsx)(Z,{})}),"/uam"===m&&options.uam_enabled&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/uam",children:(0,o.jsx)(re,{})}),"/integrations"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/integrations",children:(0,o.jsx)(ie,{})})]})}),"pro"!==options.plan&&(0,o.jsx)(p.FlexItem,{className:"promo-sidebar-container",children:(0,o.jsx)(ai,{})})]})]})})},di=function(){return(0,o.jsx)(d,{children:(0,o.jsx)("div",{children:(0,o.jsx)(ci,{})})})};if(window.options&&"simplystatic-settings"===window.options.screen){const e=document.getElementById("simplystatic-settings");e&&(0,i.createRoot)(e).render((0,o.jsx)(di,{}))}})(); \ No newline at end of file +(()=>{"use strict";var e={609(e){e.exports=window.React}};const t={};function n(i){const a=t[i];if(void 0!==a)return a.exports;const r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}n.m=e,n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;iPromise.all(Object.keys(n.f).reduce((t,i)=>(n.f[i](e,t),t),[])),n.u=e=>(({42:"reactPlayerTwitch",85:"reactPlayerTiktok",173:"reactPlayerVimeo",262:"reactPlayerHls",340:"reactPlayerWistia",353:"reactPlayerPreview",395:"reactPlayerDash",446:"reactPlayerYouTube",723:"reactPlayerMux",771:"reactPlayerSpotify"}[e]||e)+".js?ver="+{42:"710c587562705dc3edd6",85:"227f06b07c7896379b77",173:"7d9bbd44745edc1a5193",262:"718fb6a76ccbaa6efdf8",303:"a1ff3fceba330af721da",340:"04d39123ad122f8f341a",353:"a9bc7e4ae05b4f773de6",395:"1ef572a58903e0b5a82d",446:"1e02662c73bc7bb442b9",723:"1c0a47c111c88f4bb0ab",771:"63f098237b966138094f",945:"b8e062ddfc36f6bb19cb",985:"d30d768acc6f77987861"}[e]),n.miniCssF=e=>{},n.o=(e,t)=>Object.hasOwn(e,t),(()=>{const e={},t="simplystatic-settings:";n.l=(i,a,r,s)=>{if(e[i])return void e[i].push(a);let o,l;if(void 0!==r){const e=document.getElementsByTagName("script");for(var c=0;c{o.onerror=o.onload=null,clearTimeout(p);const a=e[i];if(delete e[i],o.parentNode?.removeChild(o),a?.forEach(e=>e(n)),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=d.bind(null,o.onerror),o.onload=d.bind(null,o.onload),l&&document.head.appendChild(o)}})(),n.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;globalThis.importScripts&&(e=globalThis.location+"");const t=globalThis.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const n=t.getElementsByTagName("script");if(n.length){let t=n.length-1;for(;t>-1&&(!e||!/^http(s?):/.test(e));)e=n[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{const e={57:0};n.f.j=(t,i)=>{let a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)i.push(a[2]);else{const r=new Promise((n,i)=>a=e[t]=[n,i]);i.push(a[2]=r);const s=n.p+n.u(t),o=new Error,l=i=>{if(n.o(e,t)&&(a=e[t],0!==a&&(e[t]=void 0),a)){const e=i&&("load"===i.type?"missing":i.type),n=i&&i.target&&i.target.src;o.message="Loading chunk "+t+" failed.\n("+e+": "+n+")",o.name="ChunkLoadError",o.type=e,o.request=n,a[1](o)}};n.l(s,l,"chunk-"+t,t)}};const t=(t,i)=>{let[a,r,s]=i;var o,l,c=0;if(a.some(t=>0!==e[t])){for(o in r)n.o(r,o)&&(n.m[o]=r[o]);s&&s(n)}for(t&&t(i);c{n.current=e},[e]),(0,i.useEffect)(()=>{if(null!==t){const e=setInterval(function(){n.current()},t);return()=>clearInterval(e)}},[t])}const o=window.ReactJSXRuntime,{__}=wp.i18n,l=(0,i.createContext)(),c=e=>{let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){throw new Error(__("The server returned an invalid response.","simply-static"))}if(t&&"object"==typeof t){const e=Number.parseInt(t.status,10);if(Number.isFinite(e)&&e>=400)throw new Error(t.message||__("The requested action could not be completed.","simply-static"))}return t},d=function(e){const t=(e={})=>({running:!!e.running,status:e.status||{},progress:e.progress||{},message:e.message||__("Rollback in progress. Simply Static export actions are locked until the rollback has finished.","simply-static")}),[n,a]=(0,i.useState)(!1),[d,p]=(0,i.useState)(0),[u,m]=(0,i.useState)(!1),[h,g]=(0,i.useState)(!1),[x,f]=(0,i.useState)(()=>t(options.snapshot_rollback)),[y,b]=(0,i.useState)(!1),[_,v]=(0,i.useState)({}),w=(0,i.useRef)(_),[S,C]=(0,i.useState)({}),[j,k]=(0,i.useState)("yes"),[R,E]=(0,i.useState)(1),[N,P]=(0,i.useState)([]),[B,D]=(0,i.useState)(!1),T=!!x.running,F=()=>r()({path:"/simplystatic/v1/settings"}).then(e=>(w.current=e,v(e),e)),I=()=>{r()({path:"/simplystatic/v1/is-running",method:"GET"}).then(e=>{var n="string"==typeof e?JSON.parse(e):e;a(n.running),m(n.paused),n.snapshot_rollback&&f(t(n.snapshot_rollback)),n.delayed&&p(n.delayed_until)})};function M(e){try{const t=options&&options.integrations;if(!t)return null;if(Array.isArray(t)){for(let n=0;n{const t=M(e);return!(!t||!t.requires_ui_reload)},A=e=>N.indexOf(e)>=0,L=e=>{let t=_.integrations;return!(!1===t||!t||!Array.isArray(t))&&t.indexOf(e)>=0};return s(()=>{p(d-1)},d>0?1e3:null),s(()=>{I()},n||d||T?5e3:null),(0,i.useEffect)(()=>{options.current_settings?(w.current=options.current_settings,v(options.current_settings)):F(),options.can_view_diagnostics&&r()({path:"/simplystatic/v1/system-status"}).then(e=>{C(e),r()({path:"/simplystatic/v1/system-status/passed"}).then(e=>{let t=JSON.parse(e);k(t.passed)})}),I(),E(options.blog_id)},[]),(0,o.jsx)(l.Provider,{value:{settings:_,configs:S,passedChecks:j,settingsSaved:y,setSettingsSaved:b,updateSetting:(e,t)=>{v(n=>{const i={...n,[e]:t};return w.current=i,i})},setSettings:v,saveSettings:()=>{const e=N&&N.length>0;return r()({path:"/simplystatic/v1/settings",method:"POST",data:w.current}).then(t=>(P([]),{resp:t,shouldReload:e}))},resetSettings:()=>r()({path:"/simplystatic/v1/settings/reset",method:"POST"}).then(e=>{const t=c(e);return 200===t.status&&t.data&&(w.current=t.data,v(t.data)),t}),resetDatabase:()=>r()({path:"/simplystatic/v1/settings/reset-database",method:"POST"}).then(c),resetBackgroundQueue:()=>r()({path:"/simplystatic/v1/settings/reset-background-queue",method:"POST"}).then(c),getSettings:F,updateFromNetwork:e=>r()({path:"/simplystatic/v1/update-from-network",method:"POST",data:{blog_id:e}}).then(c).then(F),importSettings:e=>r()({path:"/simplystatic/v1/settings",method:"POST",data:{...e,__simply_static_import:!0}}).then(c).then(F),migrateSettings:()=>r()({path:"/simplystatic/v1/migrate",method:"POST",data:{migrate:!0}}).then(c).then(F),resetDiagnostics:()=>{r()({path:"/simplystatic/v1/reset-diagnostics",method:"POST"})},isRunning:n,setIsRunning:a,isPaused:u,setIsPaused:m,setIsResumed:g,isResumed:h,snapshotRollback:x,setSnapshotRollback:f,isRollbackRunning:T,blogId:R,setBlogId:E,isPro:()=>!!options.is_multisite||!!options.connect&&!!options.connect.is_connected,isStudio:()=>!!/(static\d*|onstatic)\.studio/.test(options.home)||!!options.version_studio,isIntegrationActive:L,canRunIntegration:e=>!!L(e)&&!A(e),maybeQueueIntegration:e=>{H(e)&&(A(e)||P(t=>t&&t.indexOf(e)>=0?t:[...t||[],e]))},maybeUnqueueIntegration:e=>{H(e)&&A(e)&&P(t=>(t||[]).filter(t=>t!==e))},isQueuedIntegration:A,getIntegrationById:M,showMobileNav:B,setShowMobileNav:D,isDelayed:d},children:e.children})},p=window.wp.components;var u=n(609),m=n.n(u);const h=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,g=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,x=/\.(m3u8)($|\?)/i,f=/\.(mpd)($|\?)/i,y=/stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/,b=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,_=/vimeo\.com\/(?!progressive_redirect).+/,v=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,w=/open\.spotify\.com\/(\w+)\/(\w+)/i,S=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/,C=/tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/,j=(e,t)=>{if(Array.isArray(e)){for(const n of e){if("string"==typeof n&&j(n,t))return!0;if(j(n.src,t))return!0}return!1}return t(e)},k={html:e=>j(e,e=>h.test(e)||g.test(e)),hls:e=>j(e,e=>x.test(e)),dash:e=>j(e,e=>f.test(e)),mux:e=>y.test(e),youtube:e=>b.test(e),vimeo:e=>_.test(e)&&!g.test(e)&&!x.test(e),wistia:e=>v.test(e),spotify:e=>w.test(e),twitch:e=>S.test(e),tiktok:e=>C.test(e)};var R=u.forwardRef((e,t)=>{const n=h.test(`${e.src}`)?"audio":"video";return u.createElement(n,{...e,ref:t},e.children)}),E=[{key:"hls",name:"hls.js",canPlay:k.hls,canEnablePIP:()=>!0,player:(0,u.lazy)(()=>Promise.all([n.e(985),n.e(945),n.e(262)]).then(n.bind(n,805)))},{key:"dash",name:"dash.js",canPlay:k.dash,canEnablePIP:()=>!0,player:(0,u.lazy)(()=>Promise.all([n.e(985),n.e(395)]).then(n.bind(n,517)))},{key:"mux",name:"Mux",canPlay:k.mux,canEnablePIP:()=>!0,player:(0,u.lazy)(()=>Promise.all([n.e(985),n.e(945),n.e(723)]).then(n.bind(n,813)))},{key:"youtube",name:"YouTube",canPlay:k.youtube,player:(0,u.lazy)(()=>n.e(446).then(n.bind(n,808)))},{key:"vimeo",name:"Vimeo",canPlay:k.vimeo,player:(0,u.lazy)(()=>n.e(173).then(n.bind(n,183)))},{key:"wistia",name:"Wistia",canPlay:k.wistia,canEnablePIP:()=>!0,player:(0,u.lazy)(()=>n.e(340).then(n.bind(n,868)))},{key:"spotify",name:"Spotify",canPlay:k.spotify,canEnablePIP:()=>!1,player:(0,u.lazy)(()=>n.e(771).then(n.bind(n,653)))},{key:"twitch",name:"Twitch",canPlay:k.twitch,canEnablePIP:()=>!1,player:(0,u.lazy)(()=>n.e(42).then(n.bind(n,682)))},{key:"tiktok",name:"TikTok",canPlay:k.tiktok,canEnablePIP:()=>!1,player:(0,u.lazy)(()=>n.e(85).then(n.bind(n,188)))},{key:"html",name:"html",canPlay:k.html,canEnablePIP:()=>!0,player:R}];const N={width:"320px",height:"180px",volume:1,playbackRate:1,previewTabIndex:0,previewAriaLabel:"",oEmbedUrl:"https://noembed.com/embed?url={url}"},P=u.forwardRef((e,t)=>{const{playing:n,pip:i}=e,a=e.activePlayer,r=(0,u.useRef)(null),s=(0,u.useRef)(!0);if((0,u.useEffect)(()=>{var t,i;r.current&&(r.current.paused&&!0===n&&r.current.play(),r.current.paused||!1!==n||r.current.pause(),r.current.playbackRate=null!=(t=e.playbackRate)?t:1,r.current.volume=null!=(i=e.volume)?i:1)}),(0,u.useEffect)(()=>{var e,t,n,a,s;if(r.current&&globalThis.document){if(i&&!document.pictureInPictureElement)try{null==(t=(e=r.current).requestPictureInPicture)||t.call(e)}catch(e){}if(!i&&document.pictureInPictureElement)try{null==(a=(n=r.current).exitPictureInPicture)||a.call(n),null==(s=document.exitPictureInPicture)||s.call(document)}catch(e){}}},[i]),!a)return null;const o={},l=["onReady","onStart"];for(const t in e)t.startsWith("on")&&!l.includes(t)&&(o[t]=e[t]);return u.createElement(a,{...o,style:e.style,className:e.className,slot:e.slot,ref:(0,u.useCallback)(e=>{r.current=e,"function"==typeof t?t(e):null!==t&&(t.current=e)},[t]),src:e.src,crossOrigin:e.crossOrigin,preload:e.preload,controls:e.controls,muted:e.muted,autoPlay:e.autoPlay,loop:e.loop,playsInline:e.playsInline,disableRemotePlayback:e.disableRemotePlayback,config:e.config,onLoadStart:t=>{var n,i;s.current=!0,null==(n=e.onReady)||n.call(e),null==(i=e.onLoadStart)||i.call(e,t)},onPlay:t=>{var n,i;s.current&&(s.current=!1,null==(n=e.onStart)||n.call(e,t)),null==(i=e.onPlay)||i.call(e,t)}},e.children)});P.displayName="Player";var B=P;const D=(0,u.lazy)(()=>n.e(353).then(n.bind(n,924))),T=[],F=({children:e})=>e;var I=((e,t)=>{const n=u.forwardRef((n,i)=>{const a={...N,...n},{src:r,slot:s,className:o,style:l,width:c,height:d,fallback:p,wrapper:m}=a,[h,g]=(0,u.useState)(!!a.light);(0,u.useEffect)(()=>{a.light?g(!0):g(!1)},[a.light]);const x=e=>{var t;g(!1),null==(t=a.onClickPreview)||t.call(a,e)},f=m??F,y=!1===p?F:u.Suspense;return u.createElement(f,{slot:s,className:o,style:{width:c,height:d,...l}},u.createElement(y,{fallback:p},h?(e=>{if(!e)return null;const{light:t,playIcon:n,previewTabIndex:i,oEmbedUrl:r,previewAriaLabel:s}=a;return u.createElement(D,{src:e,light:t,playIcon:n,previewTabIndex:i,previewAriaLabel:s,oEmbedUrl:r,onClickPreview:x})})(r):(n=>{var r,l;const c=(n=>{for(const t of[...T,...e])if(n&&t.canPlay(n))return t;return t||null})(n);if(!c)return null;const{style:d,width:p,height:m,wrapper:h}=a,g=null==(r=a.config)?void 0:r[c.key];return u.createElement(B,{...a,ref:i,activePlayer:null!=(l=c.player)?l:c,slot:h?void 0:s,className:h?void 0:o,style:h?{display:"block",width:"100%",height:"100%"}:{display:"block",width:p,height:m,...d},config:g})})(r)))});return n.displayName="ReactPlayer",n.addCustomPlayer=e=>{T.push(e)},n.removeCustomPlayers=()=>{T.length=0},n.canPlay=t=>{if(t)for(const n of[...T,...e])if(n.canPlay(t))return!0;return!1},n.canEnablePIP=t=>{var n;if(t)for(const i of[...T,...e])if(i.canPlay(t)&&(null==(n=i.canEnablePIP)?void 0:n.call(i)))return!0;return!1},n})(E,E[E.length-1]);const{__:M}=wp.i18n,H=function({title:e,videoUrl:t}){const[n,a]=(0,i.useState)(!1);return(0,o.jsxs)(o.Fragment,{children:[n&&(0,o.jsx)("div",{className:"simply-static-video-modal-background",children:(0,o.jsx)(p.Modal,{title:e,className:"simply-static-video-modal",onRequestClose:()=>a(!1),children:(0,o.jsx)(I,{src:t,controls:!0,width:"920px",height:"560px",playsInline:!0})})}),(0,o.jsx)(p.Button,{variant:"link",className:"simply-static-video-button",onClick:()=>a(!0),children:(0,o.jsx)(p.Dashicon,{icon:"format-video"})})]})},{__:A}=wp.i18n,L=function({heading:e,children:t,cta:n=A("Explore Pro →","simply-static"),ctaUrl:i="https://simplystatic.com/simply-static-pro/?utm_source=plugin&utm_medium=settings&utm_campaign=studio-notice"}){return(0,o.jsxs)(p.Notice,{status:"warning",isDismissible:!1,className:"studio-settings-notice",children:[(0,o.jsx)("h3",{children:e}),(0,o.jsx)("div",{className:"studio-settings-notice__body",children:t}),n&&i&&(0,o.jsx)(p.Button,{variant:"secondary",href:i,target:"_blank",rel:"noopener noreferrer",className:"studio-settings-notice__cta",children:n})]})},{__:z}=wp.i18n,O=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isPro:c,isRunning:d,setIsRunning:u,isStudio:m}=(0,i.useContext)(l),[h,g]=(0,i.useState)("relative"),[x,f]=(0,i.useState)(!1),[y,b]=(0,i.useState)("https://"),[_,v]=(0,i.useState)(""),[w,S]=(0,i.useState)("/"),[C,j]=(0,i.useState)(!1),[k,R]=(0,i.useState)(!1),[E,N]=(0,i.useState)(!1),[P,B]=(0,i.useState)(!1),[D,T]=(0,i.useState)(!1),[F,I]=(0,i.useState)(!1),[M,A]=(0,i.useState)([]),[O,W]=(0,i.useState)([]),[U,G]=(0,i.useState)(null),[$,q]=(0,i.useState)([]),[K,V]=(0,i.useState)([]),[J,Y]=(0,i.useState)(null),[X,Q]=(0,i.useState)([]),[Z,ee]=(0,i.useState)([]),[te,ne]=(0,i.useState)(null),[ie,ae]=(0,i.useState)([]),[re,se]=(0,i.useState)([]),[oe,le]=(0,i.useState)(null),[ce,de]=(0,i.useState)([]);return(0,i.useEffect)(()=>{G(null),r()({path:"/simplystatic/v1/crawlers",parse:!0}).then(n=>{if("string"==typeof n)try{n=JSON.parse(n)}catch(e){return void G("Error parsing API response: "+e.message)}if(n&&n.data&&n.data.length>0){const i=n.data.filter(e=>e.can_run);if(A(i),e.crawlers&&Array.isArray(e.crawlers)&&0!==e.crawlers.length){if(Array.isArray(e.crawlers)){const n=e.crawlers.filter(e=>i.some(t=>t.id===e));if(0===n.length){const e=i.map(e=>e.id);W(e),t("crawlers",e)}else W(n)}}else{const e=i.filter(e=>e.active).map(e=>e.id);W(e),t("crawlers",e)}}else G("Invalid API response structure or empty crawlers array")}).catch(e=>{G("Error fetching crawlers: "+(e.message||"Unknown error"))}),Y(null),r()({path:"/simplystatic/v1/post-types",parse:!0}).then(e=>{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return void Y("Error parsing API response: "+e.message)}e&&e.data&&e.data.length>0?q(e.data):Y("Invalid API response structure or empty post types array")}).catch(e=>{Y("Error fetching post types: "+(e.message||"Unknown error"))}),ne(null),r()({path:"/simplystatic/v1/active-plugins",parse:!0}).then(n=>{"string"==typeof n&&(n=JSON.parse(n));const i=Array.isArray(n?.data)?n.data:[];Q(i);const a=Array.isArray(e.plugins_to_include)?e.plugins_to_include:[],r=i.map(e=>e.slug),s=a.filter(e=>r.includes(e));let o=s.length>0?s:r;i.filter(e=>e.required).map(e=>e.slug).forEach(e=>{o.includes(e)||(o=[...o,e])}),ee(o),t("plugins_to_include",o)}).catch(e=>ne(e?.message||"Unknown error")),le(null),r()({path:"/simplystatic/v1/active-themes",parse:!0}).then(n=>{"string"==typeof n&&(n=JSON.parse(n));const i=Array.isArray(n?.data)?n.data:[];ae(i);const a=Array.isArray(e.themes_to_include)?e.themes_to_include:[],r=i.map(e=>e.slug),s=a.filter(e=>r.includes(e)),o=s.length>0?s:r;se(o),t("themes_to_include",o)}).catch(e=>le(e?.message||"Unknown error")),r()({path:"/simplystatic/v1/pages"}).then(e=>{let t=e||[];t.unshift({label:z("No page selected","simply-static"),value:0}),de(t)}).catch(()=>{de([])})},[]),(0,i.useEffect)(()=>{e.destination_url_type&&g(e.destination_url_type),e.destination_scheme&&b(e.destination_scheme),e.destination_host&&v(e.destination_host),e.relative_path&&S(e.relative_path),(e.use_forms||e.use_comments)&&f(!0),e.force_replace_url&&j(e.force_replace_url),e.generate_404&&N(e.generate_404),e.add_feeds&&T(e.add_feeds),e.add_rest_api&&I(e.add_rest_api),e.smart_crawl&&B(e.smart_crawl),e.crawlers&&W(e.crawlers)},[e]),(0,i.useEffect)(()=>{if(!$.length||!Object.keys(e).length)return;const n=$.map(e=>e.name),i=Array.isArray(e.post_types)?e.post_types:null,a=(i||[]).filter(e=>$.some(t=>t.name===e)),r=!!e.post_types_configured,s=!i||!r&&!i.length;V(s?n:a),i&&i.length!==a.length&&(t("post_types",a),t("post_types_configured",!0))},[$,e.post_types,e.post_types_configured]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[z("Replacing URLs","simply-static"),(0,o.jsx)(H,{title:z("How to replace URLs","simply-static"),videoUrl:"https://youtu.be/cb8jAMJlfGI"})]})}),(0,o.jsxs)(p.CardBody,{children:[m()&&(0,o.jsx)(L,{heading:z("URL replacement is handled by Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:z("Studio manages the public URL for this environment automatically, so you do not need to configure replacement URLs manually.","simply-static")})}),(0,o.jsx)("p",{children:z("When exporting your static site, any links to your WordPress site will be replaced by one of the following: absolute URLs, relative URLs, or URLs contructed for offline use.","simply-static")}),(0,o.jsx)(p.SelectControl,{label:z("Replacing URLs","simply-static"),value:h,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:m(),options:[{label:z("Absolute URLs","simply-static"),value:"absolute"},{label:z("Relative Path","simply-static"),value:"relative"},{label:z("Offline Usage","simply-static"),value:"offline"}],onChange:e=>{g(e),t("destination_url_type",e)}}),"absolute"===h&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{style:{minWidth:"15%",marginTop:"15px"},children:(0,o.jsx)(p.SelectControl,{label:z("Scheme","simply-static"),value:y,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:m(),options:[{label:"https://",value:"https://"},{label:"http://",value:"http://"},{label:"//",value:"//"}],onChange:e=>{b(e),t("destination_scheme",e)}})}),(0,o.jsx)(p.FlexItem,{style:{minWidth:"85%"},children:(0,o.jsx)(p.TextControl,{label:z("Host","simply-static"),type:"text",placeholder:"example.com",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:m(),value:_,onChange:e=>{v(e),t("destination_host",e)}})})]}),(0,o.jsx)("p",{children:z("Convert all URLs for your WordPress site to absolute URLs at the domain specified above.","simply-static")})]}),"relative"===h&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextControl,{label:z("Path","simply-static"),type:"text",placeholder:"/",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:m(),value:w,onChange:e=>{S(e),t("relative_path",e)}}),(0,o.jsxs)("p",{children:[z("Convert all URLs for your WordPress site to relative URLs that will work at any domain.","simply-static"),(0,o.jsx)("br",{}),z("Optionally specify a path above if you intend to place the files in a subdirectory.","simply-static")]}),(0,o.jsxs)(p.Notice,{status:"warning",isDismissible:!1,children:[(0,o.jsxs)("b",{children:[z("Example","simply-static"),": "]}),z("enter /path above if you wanted to serve your files at www.example.com/path/","simply-static")]})]}),"offline"===h&&(0,o.jsx)("p",{children:z("Convert all URLs for your WordPress site so that you can browse the site locally on your own computer without hosting it on a web server.","simply-static")}),!x&&(0,o.jsx)(p.ToggleControl,{label:z("Force URL replacements","simply-static"),__nextHasNoMarginBottom:!0,disabled:m(),help:z(C?"Replace all occurrences of the WordPress URL with the static URL (includes inline CSS and JS).":"Replace only occurrences of the WordPress URL that match our tag list.","simply-static"),checked:C,onChange:e=>{j(e),t("force_replace_url",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[z("Enhanced Crawl","simply-static"),(0,o.jsx)(H,{title:z("How Enhanced Crawl improves your static exports","simply-static"),videoUrl:"https://youtu.be/QfKxeQ1w7tU"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:z("Enhanced Crawl uses native WordPress functions to find all pages and files when running a static export.","simply-static")}),(0,o.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,o.jsx)(o.Fragment,{children:z("Enable Enhanced Crawl","simply-static")}),help:z(P?"Find pages and files via Enhanced Crawl.":"Don't find pages and files via Enhanced Crawl.","simply-static"),checked:P,onChange:e=>{B(e),t("smart_crawl",e)}}),P&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:2}),U&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Notice,{status:"error",isDismissible:!1,children:[z("Error loading crawlers: ","simply-static")," ",U]}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}),M.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.FormTokenField,{label:z("Active Crawlers","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:O.map(e=>{const t=M.find(t=>t.id===e);return t?t.name:e}),suggestions:M.map(e=>e.name),onChange:e=>{const n=e.map(e=>{let t=M.find(t=>t.name===e);return t||(t=M.find(t=>t.name.toLowerCase()===(e||"").toLowerCase())),t||(t=M.find(t=>t.id===e)),t?t.id:null}).filter(e=>!!e&&M.some(t=>t.id===e));W(n),t("crawlers",n)},help:z("Select which crawlers to activate. If none selected, all crawlers will be active by default.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field"}),(0,o.jsx)(p.__experimentalSpacer,{margin:2}),O.includes("post_type")&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:2}),J&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Notice,{status:"error",isDismissible:!1,children:[z("Error loading post types: ","simply-static")," ",J]}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}),$.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.FormTokenField,{label:z("Post Types to Include","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:Array.isArray(K)?K.map(e=>{const t=$.find(t=>t.name===e);return t?t.label:e}):[],suggestions:$.map(e=>e.label),onChange:e=>{const n=e.map(e=>{let t=$.find(t=>t.label===e);return t||(t=$.find(t=>t.label.toLowerCase()===e.toLowerCase())),t||(t=$.find(t=>t.name===e)),t?t.name:null}).filter(Boolean);V(n),t("post_types",n),t("post_types_configured",!0)},help:z("Select which post types to include in the static export. All public post types are selected by default.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field"}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}):(0,o.jsx)("p",{children:z("Loading post types...","simply-static")})]}),O.includes("plugin_assets")&&(0,o.jsxs)(o.Fragment,{children:[te&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Notice,{status:"error",isDismissible:!1,children:[z("Error loading plugins: ","simply-static")," ",te]}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}),X.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.FormTokenField,{label:z("Plugins to Include","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:!c(),value:Array.isArray(Z)?Z.map(e=>{const t=X.find(t=>t.slug===e);return t?t.label:e}):[],suggestions:X.map(e=>e.label),onChange:e=>{let n=e.map(e=>{let t=X.find(t=>t.label===e)||X.find(t=>t.label.toLowerCase()===String(e).toLowerCase())||X.find(t=>t.slug===e);return t?t.slug:e});X.filter(e=>e.required).map(e=>e.slug).forEach(e=>{n.includes(e)||(n=[...n,e])}),ee(n),t("plugins_to_include",n)},help:z("Select which active plugins to include. All active plugins are included by default; remove tokens to exclude them.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field"}),!c()&&(0,o.jsxs)(p.ExternalLink,{style:{marginTop:"5px"},href:"https://simplystatic.com",children:[" ",z("Requires Simply Static Pro","simply-static")]})]}):(0,o.jsx)("p",{children:z("Loading plugins...","simply-static")})]}),O.includes("theme_assets")&&(0,o.jsxs)(o.Fragment,{children:[oe&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Notice,{status:"error",isDismissible:!1,children:[z("Error loading themes: ","simply-static")," ",oe]}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}),ie.length>0?(0,o.jsxs)(o.Fragment,{children:[c()&&(0,o.jsx)(p.__experimentalSpacer,{margin:"5px"}),(0,o.jsx)(p.FormTokenField,{label:z("Themes to Include","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:!c(),value:Array.isArray(re)?re.map(e=>{const t=ie.find(t=>t.slug===e);return t?t.label:e}):[],suggestions:ie.map(e=>e.label),onChange:e=>{const n=e.map(e=>{let t=ie.find(t=>t.label===e)||ie.find(t=>t.label.toLowerCase()===String(e).toLowerCase())||ie.find(t=>t.slug===e);return t?t.slug:e});se(n),t("themes_to_include",n)},help:z("Select which theme(s) to include. The active theme and parent (if any) are included by default; remove tokens to exclude them.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field"}),!c()&&(0,o.jsxs)(p.ExternalLink,{style:{marginTop:"5px"},href:"https://simplystatic.com",children:[" ",z("Requires Simply Static Pro","simply-static")]}),(0,o.jsx)(p.__experimentalSpacer,{margin:2})]}):(0,o.jsx)("p",{children:z("Loading themes...","simply-static")})]}),(0,o.jsx)("div",{className:"crawler-descriptions",children:M.map(e=>(0,o.jsx)("div",{className:"crawler-description",children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{className:"crawler-name",children:(0,o.jsxs)("strong",{children:[e.name,":"]})}),(0,o.jsx)(p.FlexItem,{children:e.description})]})},e.id))})]}):(0,o.jsx)("p",{children:z("Loading crawlers...","simply-static")})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[z("404","simply-static"),(0,o.jsx)(H,{title:z("How to manage 404 pages?","simply-static"),videoUrl:"https://youtu.be/dnRtuQrXG-k"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,o.jsx)(o.Fragment,{children:z("Generate 404 Page?","simply-static")}),help:z(E?"Generate a 404 page based on your theme template.":"Don't generate a 404 page.","simply-static"),checked:E,onChange:e=>{N(e),t("generate_404",e)}}),E&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.SelectControl,{label:(0,o.jsx)(o.Fragment,{children:c&&"function"==typeof c&&c()?(0,o.jsx)(o.Fragment,{children:z("Custom 404 page (optional)","simply-static")}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{style:{position:"relative",bottom:"-15px"},children:z("Custom 404 page (optional)","simply-static")}),(0,o.jsx)(p.ExternalLink,{href:"https://simplystatic.com",children:z("Requires Simply Static Pro","simply-static")})]})}),value:e.custom_404_page??0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:ce,disabled:!(c&&"function"==typeof c&&c()),onChange:e=>{t("custom_404_page",e)},help:z("If selected, Simply Static will use the content of this page for the 404 page instead of the theme default.","simply-static")}),!(!c||"function"!=typeof c)&&c()&&(0,o.jsx)(p.Button,{variant:"secondary",disabled:d,isBusy:d,onClick:()=>{d||(u(!0),r()({path:"/simplystatic/v1/export-404",method:"POST"}).then(e=>{try{e&&!1===e.success&&e.message?alert(e.message):window.location.reload()}catch(e){window.location.reload()}}).catch(()=>{u(!1),alert(z("Failed to start 404 push.","simply-static"))}))},children:z("Push 404 Page","simply-static")})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[z("Include","simply-static"),(0,o.jsx)(H,{title:z("Include & Exclude files and pages","simply-static"),videoUrl:"https://youtu.be/voAHfwVMLi8"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextareaControl,{label:z("Additional URLs","simply-static"),placeholder:options.home+"/hidden-page/\n/\\/blog\\/.*$/i ",__nextHasNoMarginBottom:!0,help:z("You can enter full URLs or regex (wrap with / /). Examples: https://example.com/private/ or /\\/blog\\/.*$/i (one per line).","simply-static"),value:e.additional_urls,onChange:e=>{t("additional_urls",e)}}),(0,o.jsx)(p.TextareaControl,{label:z("Additional Files and Directories","simply-static"),placeholder:options.home_path+"additional-directory/\n"+options.home_path+"additional-file.html\n/\\.pdf$/i",__nextHasNoMarginBottom:!0,help:z("Enter absolute paths or regex (wrap with / /). Examples: /\\.pdf$/i or /wp-content\\/uploads\\/reports\\/.*/ (one per line).","simply-static"),value:e.additional_files,onChange:e=>{t("additional_files",e)}}),(0,o.jsx)(p.Button,{variant:"secondary",onClick:()=>{try{navigator.clipboard.writeText(options.home_path),R(!0),setTimeout(()=>R(!1),1500)}catch(e){console.error("Clipboard copy failed",e)}},children:z(k?"Copied home path":"Copy home path","simply-static")}),(0,o.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,o.jsx)(o.Fragment,{children:z("Include RSS Feeds?","simply-static")}),help:z(D?"Include feed URLs of all your posts.":"Don't include feed URLs for all your posts.","simply-static"),checked:D,onChange:e=>{T(e),t("add_feeds",e)}}),(0,o.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,o.jsx)(o.Fragment,{children:z("Include Rest API?","simply-static")}),help:z(F?"Include all Rest API endpoints as JSON files.":"Don't include Rest API endpoints as JSON files.","simply-static"),checked:F,onChange:e=>{I(e),t("add_rest_api",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[z("Exclude","simply-static"),(0,o.jsx)(H,{title:z("Include & Exclude files and pages","simply-static"),videoUrl:"https://youtu.be/voAHfwVMLi8"})]})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.TextareaControl,{label:z("Urls to exclude","simply-static"),placeholder:"/some-directory/\n.jpg\n/\\.(pdf|zip)$/i\n/\\/private\\/.*/",__nextHasNoMarginBottom:!0,help:z("You can enter substrings or regex (wrap with / /). Examples: .jpg or /\\.(pdf|zip)$/i or //private/.*/ (one per line).","simply-static"),value:e.urls_to_exclude,onChange:e=>{t("urls_to_exclude",e)}})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:z("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:(0,o.jsx)(p.Button,{onClick:()=>{n(),s(!0),setTimeout(function(){s(!1)},2e3)},variant:"primary",children:z("Save Settings","simply-static")})})]})},{__:W}=wp.i18n,U=function(){const{configs:e,resetDiagnostics:t}=(0,i.useContext)(l),[n,a]=(0,i.useState)(!1);return(0,o.jsx)("div",{className:"inner-settings",children:(0,o.jsxs)("div",{children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[W("Diagnostics","simply-static"),(0,o.jsx)(H,{title:W("How to use diagnostics","simply-static"),videoUrl:"https://youtu.be/X59YMlz6F2s"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:W("Our diagnostics tool provides detailed insights into your WordPress installation and server configuration and tells you exactly what needs to be optimized to get the most out of Simply Static. Click the button below to get the latest results.","simply-static")}),(0,o.jsx)("p",{children:(0,o.jsx)(p.Button,{onClick:()=>{t(),a(!0),setTimeout(function(){window.location.reload()},2e3)},variant:"secondary",children:W("Reset Diagnostics","simply-static")})}),n?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:W("Diagnostics resetted successfully.","simply-static")})})}):""]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),Object.keys(e).map(t=>{const n=e[t];return(0,o.jsxs)("div",{children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:t})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)("div",{children:(0,o.jsx)("table",{style:{width:"100%",tableLayout:"fixed"},children:(0,o.jsx)("tbody",{className:"table-data",children:Object.entries(n).map(e=>(0,o.jsxs)("tr",{className:"table-row",children:[(0,o.jsxs)("td",{className:"diagnostics-icon",children:[" ",e[1].test?(0,o.jsx)(p.Dashicon,{className:"icon-yes",icon:"yes"}):(0,o.jsx)(p.Dashicon,{className:"icon-no",icon:"no"})]}),(0,o.jsx)("td",{className:"diagnostics-test",children:(0,o.jsx)("b",{children:e[0]})}),(0,o.jsx)("td",{children:e[1].test}),(0,o.jsxs)("td",{className:"diagnostics-result",children:[" ",e[1].test?(0,o.jsx)("p",{children:e[1].description}):(0,o.jsx)("p",{children:e[1].error})]})]},e[0]))})})})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]},t)})]})})},{__:G}=wp.i18n,$=function(){const{importSettings:e,resetSettings:t,migrateSettings:n,resetDatabase:a,resetBackgroundQueue:r,isRunning:s,isPaused:c,isRollbackRunning:d}=(0,i.useContext)(l),[u,m]=(0,i.useState)(!1),[h,g]=(0,i.useState)(!1),[x,f]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),[_,v]=(0,i.useState)(!1),[w,S]=(0,i.useState)(!1),[C,j]=(0,i.useState)(""),[k,R]=(0,i.useState)(""),[E,N]=(0,i.useState)(!1),[P,B]=(0,i.useState)(""),[D,T]=(0,i.useState)(!1),[F,I]=(0,i.useState)(""),[M,A]=(0,i.useState)(""),L=s||c||d,z=""!==F,O=async(e,t,n)=>{I(e),A("");try{return await t(),(i=n)(!0),window.setTimeout(()=>i(!1),2e3),!0}catch(e){return A(e&&e.message?e.message:G("The requested action could not be completed.","simply-static")),!1}finally{I("")}var i};return(0,o.jsxs)("div",{className:"inner-settings",children:[L&&(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Import, reset, and migration actions are unavailable until the active export or rollback finishes.","simply-static")})}),M&&(0,o.jsx)(p.Notice,{status:"error",isDismissible:!0,onRemove:()=>A(""),children:(0,o.jsx)("p",{children:M})}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[G("Export","simply-static"),(0,o.jsx)(H,{title:G("Export & Import settings","simply-static"),videoUrl:"https://youtu.be/fmM123Y-gwg"})]})}),(0,o.jsx)(p.CardBody,{children:u?(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(o.Fragment,{children:[E&&(0,o.jsx)("p",{children:G("Preparing export...","simply-static")}),P&&(0,o.jsx)(p.Notice,{status:"error",isDismissible:!0,children:(0,o.jsx)("p",{children:P})}),!E&&!P&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{style:{marginBottom:"12px"},children:(0,o.jsx)("textarea",{className:"ss-export-textarea",value:k,readOnly:!0,style:{width:"100%",height:"300px",fontFamily:'Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',fontSize:"12px",whiteSpace:"pre",overflow:"auto",boxSizing:"border-box"}})}),(0,o.jsx)("p",{children:(0,o.jsx)(p.ClipboardButton,{variant:"secondary",text:k,onCopy:()=>S(!0),onFinishCopy:()=>S(!1),children:G(w?"Copied!":"Copy export data","simply-static")})})]})]})}):(0,o.jsx)("p",{children:(0,o.jsx)(p.Button,{onClick:()=>{m(!0),N(!0),B(""),wp.apiFetch({path:"/simplystatic/v1/settings/export",method:"GET"}).then(e=>{try{let t=e;"string"==typeof e&&(t=JSON.parse(e));const n=JSON.stringify(t||{},null,2);R(n)}catch(e){B(G("Failed to prepare export JSON.","simply-static")),R("")}}).catch(()=>{B(G("Failed to fetch export data.","simply-static")),R("")}).finally(()=>N(!1))},variant:"primary",children:G("Export Settings","simply-static")})})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[G("Import","simply-static"),(0,o.jsx)(H,{title:G("Export & Import settings","simply-static"),videoUrl:"https://youtu.be/fmM123Y-gwg"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:G("Paste in the JSON string you got from your export to import all settings for the plugin.","simply-static")}),(0,o.jsx)("label",{className:"screen-reader-text",htmlFor:"ss-import-data",children:G("Settings JSON to import","simply-static")}),(0,o.jsx)("textarea",{id:"ss-import-data",rows:"8",name:"import-data",value:C,onChange:e=>{j(e.target.value),A("")}}),(0,o.jsx)("p",{children:(0,o.jsx)(p.Button,{onClick:async()=>{let t;try{if(t=JSON.parse(C),!t||Array.isArray(t)||"object"!=typeof t)throw new Error(G("Import data must be a JSON object.","simply-static"))}catch(e){return void A(e&&e.message?e.message:G("Enter valid settings JSON before importing.","simply-static"))}await O("import",()=>e(t),g)},disabled:L||z||""===C.trim(),isBusy:"import"===F,variant:"primary",children:G("Import Settings","simply-static")})}),h?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Settings imported successfully.","simply-static")})})}):""]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:G("Reset","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:G('By clicking the "Reset Plugin Settings", you will reset all plugin settings. This can be useful if you want to import a new set of settings or you want a fresh start.',"simply-static")}),(0,o.jsx)("p",{children:G('If you click the "Reset Database Table" button instead, you will keep all your settings, and we will only recreate our DB table.',"simply-static")}),(0,o.jsx)("p",{children:G('If the background process is stuck and your debug log shows "There is already an export running", use the "Reset Background Queue" button to clear the queue and locks.',"simply-static")}),(0,o.jsxs)("p",{children:[(0,o.jsx)(p.Button,{onClick:()=>O("reset-settings",t,f),disabled:L||z,isBusy:"reset-settings"===F,variant:"primary",children:G("Reset Plugin Settings","simply-static")}),(0,o.jsx)(p.Button,{onClick:()=>O("reset-database",a,b),className:"reset-db-btn",disabled:L||z,isBusy:"reset-database"===F,variant:"primary",children:G("Reset Database Table","simply-static")}),(0,o.jsx)(p.Button,{onClick:()=>O("reset-background",r,T),className:"reset-bg-btn",disabled:z,isBusy:"reset-background"===F,variant:"primary",children:G("Reset Background Queue","simply-static")})]}),x?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Settings reset successfully.","simply-static")})})}):"",y?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Database table reset successfully.","simply-static")})})}):"",D?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Background queue reset successfully.","simply-static")})})}):""]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:G("Migrate Settings","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:G("Migrate all of your settings to Simply Static 3.0","simply-static")}),(0,o.jsx)("p",{children:(0,o.jsx)(p.Button,{onClick:async()=>{await O("migrate",n,v)&&window.setTimeout(()=>window.location.reload(),1e3)},disabled:L||z,isBusy:"migrate"===F,variant:"primary",children:G("Migrate settings","simply-static")})}),_?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:G("Settings migration completed successfully.","simply-static")})})}):""]})]})]})},{__:q}=wp.i18n,K=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isRunning:c,isPro:d,isStudio:u}=(0,i.useContext)(l),[m,h]=(0,i.useState)(!1),[g,x]=(0,i.useState)(""),[f,y]=(0,i.useState)("zip"),[b,_]=(0,i.useState)(!1),[v,w]=(0,i.useState)("personal"),[S,C]=(0,i.useState)("private"),[j,k]=(0,i.useState)(!1),[R,E]=(0,i.useState)(!1),[N,P]=(0,i.useState)(!1),[B,D]=(0,i.useState)("us-east-2"),[T,F]=(0,i.useState)("aws-iam-key"),[I,M]=(0,i.useState)(!1),[A,z]=(0,i.useState)(!1),[O,W]=(0,i.useState)(!1),[U,G]=(0,i.useState)(!1),[$]=(0,i.useState)([{label:q("ZIP Archive","simply-static"),value:"zip"},{label:q("Local Directory","simply-static"),value:"local"},{label:q("Static Studio","simply-static"),value:"simply-static-studio"},{label:q("SFTP","simply-static"),value:"sftp"},{label:q("GitHub","simply-static"),value:"github"},{label:q("AWS S3","simply-static"),value:"aws-s3"},{label:q("Bunny CDN","simply-static"),value:"cdn"},{label:q("Tiiny.host","simply-static"),value:"tiiny"}]),K=!u()||!!options.allow_studio_deployment_settings,V=()=>{n(),s(!0),W(!1),setTimeout(function(){s(!1)},2e3)};(0,i.useEffect)(()=>{e.delivery_method&&y(e.delivery_method),e.clear_directory_before_export&&_(e.clear_directory_before_export),e.github_account_type&&w(e.github_account_type),e.github_repository_visibility&&C(e.github_repository_visibility),e.github_repository_visibility&&C(e.github_repository_visibility),e.github_throttle_requests&&P(e.github_throttle_requests),e.aws_empty&&k(e.aws_empty),e.aws_disable_acl&&E(e.aws_disable_acl),e.aws_auth_method&&F(e.aws_auth_method),e.aws_region&&D(e.aws_region),r()({path:"/simplystatic/v1/pages"}).then(e=>{let t=e;t.unshift({label:q("No page selected","simply-static"),value:0}),z(t)})},[e]);const J=()=>{options.studio_migrate_active?window.location.href=options.studio_migrate_url:(h(!0),x(""),r()({path:"/simplystatic/v1/install-studio-migrate",method:"POST"}).then(e=>{e&&e.success&&e.redirect?window.location.href=e.redirect:(x(e?.message||q("Something went wrong.","simply-static")),h(!1))}).catch(e=>{x(e?.message||q("Something went wrong.","simply-static")),h(!1)}))};return(0,o.jsxs)("div",{className:"inner-settings",children:[!u()&&!d()&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Card,{children:(0,o.jsx)(p.CardBody,{children:(0,o.jsxs)(p.Flex,{direction:"column",gap:2,children:[(0,o.jsxs)("p",{style:{margin:0},children:[(0,o.jsx)("strong",{children:q("⚡ Migrate to Static Studio","simply-static")}),": ",q("The all-in-one Static WordPress cloud-hosting platform. Enjoy secure WordPress, the fastest exports, and the best-performing static site hosting in one package.","simply-static")]}),g&&!m&&(0,o.jsx)(p.Notice,{status:"error",isDismissible:!1,children:(0,o.jsx)("p",{children:g})}),(0,o.jsx)("div",{children:(0,o.jsx)(p.Button,{variant:"primary",isBusy:m,disabled:m,onClick:J,children:m?q("Installing…","simply-static"):options.studio_migrate_active?q("Open Migration Settings","simply-static"):q("Install & Activate Migration Plugin","simply-static")})})]})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:q("Deployment Settings","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:q("Choose from a variety of deployment methods. Depending on your selection we either provide a ZIP file, export to a local directory or send your files to a remote destination.","simply-static")}),(0,o.jsx)(p.SelectControl,{label:q("Deployment method","simply-static"),value:f,options:$,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:!K,onChange:e=>{y(e),t("delivery_method",e),W(!0)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),u()&&(0,o.jsxs)(L,{heading:q("Deployment is automatic on Studio","simply-static"),cta:q("See how Pro deployment works →","simply-static"),children:[(0,o.jsx)("p",{children:q("Your site is built and published automatically every time you make a change, with no destinations to set up and no pipelines to maintain. That's the whole idea of Studio.","simply-static")}),(0,o.jsx)("p",{children:q("Want to choose exactly where your files go? Deploying to GitHub, Amazon S3, BunnyCDN, SFTP and more is part of Simply Static Pro, where you own and control your deployment pipeline.","simply-static")})]}),K&&(0,o.jsxs)(o.Fragment,{children:["simply-static-studio"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:q("Static Studio","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{style:{marginTop:0,marginBottom:"4px"},children:q("The all-in-one Static WordPress cloud-hosting platform.","simply-static")}),(0,o.jsx)("p",{style:{marginTop:0,marginBottom:"4px"},children:q("Enjoy secure WordPress, the fastest exports, and the best-performing static site hosting in one package.","simply-static")}),(0,o.jsx)("p",{style:{marginTop:0,marginBottom:"12px"},children:q("Migrate your existing WordPress site to Static Studio with one click.","simply-static")}),g&&!m&&(0,o.jsx)(p.Notice,{status:"error",isDismissible:!1,children:(0,o.jsx)("p",{children:g})}),(0,o.jsxs)(p.Flex,{direction:"row",gap:3,children:[(0,o.jsx)(p.Button,{variant:"primary",isBusy:m,disabled:m,onClick:J,children:m?q("Installing…","simply-static"):options.studio_migrate_active?q("Open Migration Settings","simply-static"):q("Install & Activate Migration Plugin","simply-static")}),(0,o.jsx)("a",{className:"button",href:"https://simplystatic.com/simply-static-studio/",target:"_blank",children:q("Learn more about Static Studio","simply-static")})]})]})]}),"zip"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[q("ZIP","simply-static"),(0,o.jsx)(H,{title:q("How to export a ZIP file","simply-static"),videoUrl:"https://youtu.be/WHaFjDte6zI"})]})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)("p",{children:q("Get a download link in the activity log once the static export has finished.","simply-static")})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),"local"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[q("Local Directory","simply-static"),(0,o.jsx)(H,{title:q("How to deploy to a local directory","simply-static"),videoUrl:"https://youtu.be/ZRdXQB5slnY"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:q("Path","simply-static"),type:"text",help:q("This is the directory where your static files will be saved. We will create it automatically on the first export if it doesn't exist.","simply-static"),placeholder:options.home_path+"public_static/",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.local_dir,onChange:e=>{t("local_dir",e)}}),(0,o.jsx)(p.Button,{variant:"secondary",onClick:()=>{try{navigator.clipboard.writeText(options.home_path),M(!0),setTimeout(()=>M(!1),1500)}catch(e){console.error("Clipboard copy failed",e)}},children:q(I?"Copied home path":"Copy home path","simply-static")}),(0,o.jsx)(p.ToggleControl,{__nextHasNoMarginBottom:!0,label:q("Clear Local Directory","simply-static"),help:q(b?"Clear local directory before running an export.":"Don't clear local directory before running an export.","simply-static"),checked:b,onChange:e=>{_(e),t("clear_directory_before_export",e)}})]})]}),(0,o.jsxs)(o.Fragment,{children:["github"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[q("GitHub","simply-static")," ",(0,o.jsx)(H,{title:q("How to deploy to a GitHub (2/2)","simply-static"),videoUrl:"https://youtu.be/HqyTKwZuUAM"})]})}),("free"===options.plan||!d())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",q("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:q("GitHub enables you to export your static website to one of the common static hosting providers like Netlify, Cloudflare Pages or GitHub Pages.","simply-static")}),(0,o.jsx)(p.SelectControl,{label:q("Account Type","simply-static"),value:v,help:q("Depending on the account type the settings fields will change.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:q("Personal","simply-static"),value:"personal"},{label:q("Organization","simply-static"),value:"organization"}],onChange:e=>{w(e),t("github_account_type",e)}}),"organization"===v?(0,o.jsx)(p.TextControl,{label:q("Organization","simply-static"),type:"text",help:q("Enter the name of your organization.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_user,onChange:e=>{t("github_user",e)}}):(0,o.jsx)(p.TextControl,{label:q("Username","simply-static"),type:"text",help:q("Enter your GitHub username.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_user,onChange:e=>{t("github_user",e)}}),(0,o.jsx)(p.TextControl,{label:q("E-Mail","simply-static"),type:"email",help:q("Enter your GitHub email address. This will be used to commit files to your repository.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_email,onChange:e=>{t("github_email",e)}}),(0,o.jsx)(p.TextControl,{label:(0,o.jsxs)(o.Fragment,{children:[q("Personal Access Token","simply-static"),(0,o.jsx)(H,{title:q("How to prepare your GitHub account","simply-static"),videoUrl:"https://youtu.be/fjsJJmPeKuc"})]}),type:"password",help:(0,o.jsxs)(o.Fragment,{children:[q("You need a personal access token from GitHub. Learn how to get one ","simply-static"),(0,o.jsx)("a",{href:"https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic",target:"_blank",children:q("here","simply-static")})]}),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_personal_access_token,onChange:e=>{t("github_personal_access_token",e)}}),(0,o.jsx)(p.TextControl,{label:q("Repository","simply-static"),type:"text",help:q("Enter a name for your repository (lowercase without spaces or special characters).","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_repository,onChange:e=>{t("github_repository",e)}}),(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:(0,o.jsxs)("p",{children:[q("Ensure to create the repository and add a readme file to it before running an export as shown in the docs ","simply-static"),(0,o.jsx)("a",{href:"https://docs.simplystatic.com/article/33-set-up-the-github-integration/",target:"_blank",children:q("here","simply-static")})]})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsx)(p.TextControl,{label:q("Folder","simply-static"),type:"text",help:q("Enter a relative path to a folder if you want to push files under it. Example: for github.com/USER/REPOSITORY/folder1, enter folder1","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_folder_path,onChange:e=>{t("github_folder_path",e)}}),"organization"===v&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:(0,o.jsx)("p",{children:q("You need to create the repository manually within your organization before connecting it.","simply-static")})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)(p.SelectControl,{label:q("Visiblity","simply-static"),value:S,help:q("Decide if you want to make your repository public or private.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:q("Public","simply-static"),value:"public"},{label:q("Private","simply-static"),value:"private"}],onChange:e=>{C(e),t("github_repository_visibility",e)}}),(0,o.jsx)(p.TextControl,{label:q("Branch","simply-static"),type:e.github_branch,placeholder:"main",help:q('Simply Static automatically uses "main" as branch. You may want to modify that for example to gh-pages. for GitHub Pages.',"simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_branch,onChange:e=>{t("github_branch",e)}}),(0,o.jsx)(p.TextControl,{label:q("Webhook URL","simply-static"),type:"url",help:q("Enter your Webhook URL here and Simply Static will send a POST request after all files are commited to GitHub.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_webhook_url,onChange:e=>{t("github_webhook_url",e)}}),(0,o.jsx)(p.ToggleControl,{label:q("Throttle Requests","simply-static"),help:q("Enable this option if you are experiencing issues with the GitHub API rate limit.","simply-static"),disabled:"free"===options.plan||!d(),__nextHasNoMarginBottom:!0,checked:N,onChange:e=>{P(e),t("github_throttle_requests",e)}}),(0,o.jsx)(p.TextControl,{label:q("Batch size","simply-static"),type:"number",help:q("Enter the number of files you want to be processed in a single batch. If current export fails to deploy, lower the number.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.github_batch_size??100,onChange:e=>{t("github_batch_size",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),"tiiny"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[q("Tiiny.host","simply-static")," ",(0,o.jsx)(H,{title:q("How to deploy to Tiiny.host","simply-static"),videoUrl:"https://youtu.be/Y9EDaQkGl1Y"})]})}),("free"===options.plan||!d())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",q("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:q("Deploying to Tiiny.host is the easiest and fastest deployment option available in Simply Static Pro.","simply-static")}),(0,o.jsx)(p.TextControl,{disabled:!0,label:q("E-Mail","simply-static"),type:"text",help:(0,o.jsxs)(o.Fragment,{children:[q("This field is auto-filled with the e-mail address used for activating Simply Static Pro.","simply-static"),(0,o.jsx)("br",{}),(0,o.jsx)("b",{children:q("An account will be created automatically on your first deployment.","simply-static")})]}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:options.admin_email}),(0,o.jsx)(p.TextControl,{label:q("Subdomain","simply-static"),type:"text",help:q("That's the part before your TLD. Your full URL is the combination of the subdomain plus the domain suffix.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.tiiny_subdomain,onChange:e=>{t("tiiny_subdomain",e)}}),(0,o.jsx)(p.TextControl,{label:q("Domain Suffix","simply-static"),type:"text",help:q("This defaults to tiiny.site. If you have a custom domain configured in Tiiny.host, you can also use that one.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.tiiny_domain_suffix,onChange:e=>{t("tiiny_domain_suffix",e)}}),(0,o.jsx)(p.TextControl,{label:q("Password Protection","simply-static"),type:"password",help:q("Adding a password will activate password protection on your static site. The website is only visible with the password.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.tiiny_password,onChange:e=>{t("tiiny_password",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),"cdn"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[q("Bunny CDN","simply-static"),(0,o.jsx)(H,{title:q("How to deploy to Bunny CDN","simply-static"),videoUrl:"https://youtu.be/FBRg1BI41VY"})]})}),("free"===options.plan||!d())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",q("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:q("Bunny CDN is a fast and reliable CDN provider that you can run your static website on.","simply-static")}),(0,o.jsx)(p.TextControl,{label:q("Bunny CDN API Key","simply-static"),type:"password",help:(0,o.jsxs)(o.Fragment,{children:[q("Enter your API Key from Bunny CDN. You can find your API-Key as described ","simply-static"),(0,o.jsx)("a",{href:"https://support.bunny.net/hc/en-us/articles/360012168840-Where-do-I-find-my-API-key",target:"_blank",children:q("here","simply-static")})]}),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_api_key,onChange:e=>{t("cdn_api_key",e)}}),(0,o.jsx)(p.TextControl,{label:q("Storage Host","simply-static"),type:"text",help:(0,o.jsxs)(o.Fragment,{children:[q("Depending on your location, you have a different storage host. You find out which URL to use ","simply-static"),(0,o.jsx)("a",{href:"https://docs.bunny.net/reference/storage-api#storage-endpoints",target:"_blank",children:q("here","simply-static")})]}),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_storage_host,onChange:e=>{t("cdn_storage_host",e)}}),(0,o.jsx)(p.TextControl,{label:q("Bunny CDN Access Key","simply-static"),type:"password",help:q("Enter your Acess Key from Bunny CDN. You will find it within your storage zone setttings within FTP & API Access -> Password.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_access_key,onChange:e=>{t("cdn_access_key",e)}}),(0,o.jsx)(p.TextControl,{label:q("Pull Zone","simply-static"),type:"text",help:q("A pull zone is the connection of your CDN to the internet. Simply Static will try to find an existing pull zone with the provided name, if there is none it creates a new pull zone.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_pull_zone,onChange:e=>{t("cdn_pull_zone",e)}}),(0,o.jsx)(p.TextControl,{label:q("Storage Zone","simply-static"),type:"text",help:q("A storage zone contains your static files. Simply Static will try to find an existing storage zone with the provided name, if there is none it creates a new storage zone.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_storage_zone,onChange:e=>{t("cdn_storage_zone",e)}}),(0,o.jsx)(p.TextControl,{label:q("Subdirectory","simply-static"),type:"text",placeholder:"/subdirectory/",help:q("If you want to transfer the files to a specific subdirectory on your storage zone add the name of that directory here.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.cdn_directory,onChange:e=>{t("cdn_directory",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),"aws-s3"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[q("Amazon AWS S3","simply-static"),(0,o.jsx)(H,{title:q("How to deploy to Amazon AWS S3","simply-static"),videoUrl:"https://youtu.be/rtn21J86Upc"})]})}),("free"===options.plan||!d())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",q("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.SelectControl,{label:q("Authentication Method","simply-static"),value:T,options:[{label:q("AWS IAM Access Key","simply-static"),value:"aws-iam-key"},{label:q("AWS EC2","simply-static"),value:"aws-ec2"}],disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>{F(e),t("aws_auth_method",e)}}),"aws-iam-key"===T&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextControl,{label:q("Access Key ID","simply-static"),type:"text",help:(0,o.jsxs)(o.Fragment,{children:[q("Enter your Access Key from AWS. Learn how to get one ","simply-static"),(0,o.jsx)("a",{href:"https://docs.aws.amazon.com/en_en/IAM/latest/UserGuide/id_credentials_access-keys.html",target:"_blank",children:q("here","simply-static")})]}),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_access_key,onChange:e=>{t("aws_access_key",e)}}),(0,o.jsx)(p.TextControl,{label:q("Secret Access Key","simply-static"),type:"password",help:(0,o.jsxs)(o.Fragment,{children:[q("Enter your Secret Key from AWS. Learn how to get one ","simply-static"),(0,o.jsx)("a",{href:"https://docs.aws.amazon.com/en_en/IAM/latest/UserGuide/id_credentials_access-keys.html",target:"_blank",children:q("here","simply-static")})]}),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_access_secret,onChange:e=>{t("aws_access_secret",e)}})]}),(0,o.jsx)(p.SelectControl,{label:q("Region","simply-static"),value:B,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:q("US East (Ohio)","simply-static"),value:"us-east-2"},{label:q("US East (N. Virginia)","simply-static"),value:"us-east-1"},{label:q("US West (N. California)","simply-static"),value:"us-west-1"},{label:q("US West (Oregon)","simply-static"),value:"us-west-2"},{label:q("Africa (Cape Town)","simply-static"),value:"af-south-1"},{label:q("Asia Pacific (Hong Kong)","simply-static"),value:"ap-east-1"},{label:q("Asia Pacific (Hyderabad)","simply-static"),value:"ap-south-2"},{label:q("Asia Pacific (Jakarta)","simply-static"),value:"ap-southeast-3"},{label:q("Asia Pacific (Melbourne)","simply-static"),value:"ap-southeast-4"},{label:q("Asia Pacific (Mumbai)","simply-static"),value:"ap-south-1"},{label:q("Asia Pacific (Osaka)","simply-static"),value:"ap-northeast-3"},{label:q("Asia Pacific (Seoul)","simply-static"),value:"ap-northeast-2"},{label:q("Asia Pacific (Singapore)","simply-static"),value:"ap-southeast-1"},{label:q("Asia Pacific (Sydney)","simply-static"),value:"ap-southeast-2"},{label:q("Asia Pacific (Tokyo)","simply-static"),value:"ap-northeast-1"},{label:q("Canada (Central)","simply-static"),value:"ca-central-1"},{label:q("Europe (Frankfurt)","simply-static"),value:"eu-central-1"},{label:q("Europe (Ireland)","simply-static"),value:"eu-west-1"},{label:q("Europe (London)","simply-static"),value:"eu-west-2"},{label:q("Europe (Milan)","simply-static"),value:"eu-south-1"},{label:q("Europe (Paris)","simply-static"),value:"eu-west-3"},{label:q("Europe (Spain)","simply-static"),value:"eu-south-2"},{label:q("Europe (Stockholm)","simply-static"),value:"eu-north-1"},{label:q("Europe (Zurich)","simply-static"),value:"eu-central-2"},{label:q("Middle East (Bahrain)","simply-static"),value:"me-south-1"},{label:q("Middle East (UAE)","simply-static"),value:"me-central-1"},{label:q("South America (São Paulo)","simply-static"),value:"sa-east-1"},{label:q("AWS GovCloud (US-East)","simply-static"),value:"us-gov-east-1"},{label:q("AWS GovCloud (US-West)","simply-static"),value:"us-gov-west-1"}],disabled:"free"===options.plan||!d(),onChange:e=>{D(e),t("aws_region",e)}}),(0,o.jsx)(p.TextControl,{label:q("Bucket","simply-static"),type:"text",help:q("Add the name of your bucket here.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_bucket,onChange:e=>{t("aws_bucket",e)}}),(0,o.jsx)(p.TextControl,{label:q("Subdirectory","simply-static"),type:"text",help:q("Add an optional subdirectory for your bucket","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_subdirectory,onChange:e=>{t("aws_subdirectory",e)}}),(0,o.jsx)(p.TextControl,{label:q("Cloudfront Distribution ID","simply-static"),type:"text",help:q("We automatically invalidate the cache after each export.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_distribution_id,onChange:e=>{t("aws_distribution_id",e)}}),(0,o.jsx)(p.TextControl,{label:q("Webhook URL","simply-static"),type:"url",help:q("Enter your Webhook URL here and Simply Static will send a POST request after all files are transferred to AWS S3.","simply-static"),disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.aws_webhook_url,onChange:e=>{t("aws_webhook_url",e)}}),(0,o.jsx)(p.ToggleControl,{label:q("Disable ACL on uploads?","simply-static"),help:q(R?'ACL header will not be sent. Required for buckets with "Bucket owner enforced" (ACLs disabled).':"ACL header will be sent with uploads. Disable this if your bucket has ACLs disabled.","simply-static"),disabled:"free"===options.plan||!d(),__nextHasNoMarginBottom:!0,checked:R,onChange:e=>{E(e),t("aws_disable_acl",e)}}),(0,o.jsx)(p.ToggleControl,{label:q("Empty bucket before new export?","simply-static"),help:q(j?"Clear bucket before new export.":"Don't clear bucket before new export.","simply-static"),disabled:"free"===options.plan||!d(),__nextHasNoMarginBottom:!0,checked:j,onChange:e=>{k(e),t("aws_empty",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),"sftp"===f&&(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[q("SFTP","simply-static")," ",(0,o.jsx)(H,{title:q("How to deploy via SFTP","simply-static"),videoUrl:"https://youtu.be/6-QR9wZA3VQ"})]})}),("free"===options.plan||!d())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",q("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:q("Host","simply-static"),type:"text",help:q("Enter your SFTP host.","simply-static"),value:e.sftp_host,disabled:"free"===options.plan||!d(),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>{t("sftp_host",e)}}),(0,o.jsx)(p.TextControl,{label:q("Port","simply-static"),type:"number",disabled:"free"===options.plan||!d(),help:q("Enter your SFTP port.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.sftp_port,onChange:e=>{t("sftp_port",e)}}),(0,o.jsx)(p.TextControl,{label:q("SFTP username","simply-static"),help:q("Enter your SFTP username.","simply-static"),type:"text",disabled:"free"===options.plan||!d(),placeholder:"username",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.sftp_user,onChange:e=>{t("sftp_user",e)}}),(0,o.jsx)(p.TextControl,{label:q("SFTP password","simply-static"),type:"password",disabled:"free"===options.plan||!d(),help:q("Enter your SFTP password.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.sftp_pass,onChange:e=>{t("sftp_pass",e)}}),(0,o.jsx)(p.TextareaControl,{label:q("SFTP private key","simply-static"),disabled:"free"===options.plan||!d(),__nextHasNoMarginBottom:!0,placeholder:q("OPTIONAL: This is only required if you need to authenticate via a private key to access your SFTP server.","simply-static"),help:q("Enter your SFTP private key if you want passwordless upload and the server is configured to allow it. You can set it as a constant in wp-config.php by using define('SSP_SFTP_KEY', 'YOUR_KEY')","simply-static"),value:e.sftp_private_key,onChange:e=>{t("sftp_private_key",e)}}),(0,o.jsx)(p.TextControl,{label:q("SFTP folder","simply-static"),help:q('Leave empty to upload to the default SFTP folder. Enter a folder path where you want the static files to be uploaded to (example: "uploads" will upload to uploads folder. "uploads/new-folder" will upload files to "new-folder"). ',"simply-static"),type:"text",disabled:"free"===options.plan||!d(),placeholder:"",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.sftp_folder,onChange:e=>{t("sftp_folder",e)}}),(0,o.jsx)(p.ToggleControl,{label:q("Bulk upload via zip archive","simply-static"),help:q("Instead of uploading files one by one, this creates a zip archive locally, uploads it as a single file, and extracts it on the remote server. This can significantly speed up deployments with many files. Requires unzip or python3 on the remote server.","simply-static"),disabled:"free"===options.plan||!d(),checked:e.sftp_bulk_upload,onChange:e=>{t("sftp_bulk_upload",e)}})]})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:q("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsxs)("div",{className:"save-settings",children:[K&&(0,o.jsx)(o.Fragment,{children:"free"!==options.plan||u()?(0,o.jsx)(p.Button,{onClick:V,variant:"primary",children:q("Save Settings","simply-static")}):(0,o.jsxs)(o.Fragment,{children:["zip"===f&&(0,o.jsx)(p.Button,{onClick:V,variant:"primary",children:q("Save Settings","simply-static")}),"local"===f&&(0,o.jsx)(p.Button,{onClick:V,variant:"primary",children:q("Save Settings","simply-static")})]})}),K&&"pro"===options.plan&&d()&&(0,o.jsxs)(p.Button,{disabled:c||O||U,variant:"secondary",isBusy:c||U,onClick:()=>{G(!0),r()({path:"/simplystatic/v1/apply-single",method:"POST"}).then(e=>{404===parseInt(e.status)?alert(e.message):window.location.reload()})},children:[O&&q("Save settings to test","simply-static"),!O&&q("Test Deployment","simply-static")]})]})]})},{__:V}=wp.i18n,J=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isPro:c}=(0,i.useContext)(l),[d,u]=(0,i.useState)(!1),[m,h]=(0,i.useState)(!1),[g,x]=(0,i.useState)(!1),[f,y]=(0,i.useState)(!0),[b,_]=(0,i.useState)(!1),[v,w]=(0,i.useState)(!1),[S,C]=(0,i.useState)(null),[j,k]=(0,i.useState)(null);return(0,i.useEffect)(()=>{r()({path:"/simplystatic/v1/pages-slugs"}).then(e=>{let t=e;t.unshift({label:V("No page selected","simply-static"),value:""}),_(t)}),e.use_forms&&u(e.use_forms),e.use_comments&&x(e.use_comments),void 0!==e.save_form_entries?y(!!e.save_form_entries):y(!0),void 0!==e.use_form_conditional_loading&&h(!!e.use_form_conditional_loading)},[e]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:V("Forms","simply-static")})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",V("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:V("Use forms?","simply-static"),__nextHasNoMarginBottom:!0,help:V(d?"Use Forms on your static website.":"Don't use forms on your static website.","simply-static"),disabled:"free"===options.plan||!c(),checked:d,onChange:e=>{u(e),t("use_forms",e)}}),d&&(0,o.jsx)(p.ToggleControl,{label:V("Store form entries","simply-static"),__nextHasNoMarginBottom:!0,help:V(f?"Store form entries inside WordPress (requires Simply Static Webhook).":"Do not store form entries in WordPress.","simply-static"),disabled:"free"===options.plan||!c(),checked:!!f,onChange:e=>{y(e),t("save_form_entries",e)}}),d&&(0,o.jsx)(p.ToggleControl,{label:V("Enable conditional loading","simply-static"),__nextHasNoMarginBottom:!0,help:V(m?"Form scripts are only loaded on pages that contain a connected form.":"Form scripts are loaded on all pages for maximum compatibility.","simply-static"),disabled:"free"===options.plan||!c(),checked:m,onChange:e=>{h(e),t("use_form_conditional_loading",e)}}),d&&options.form_connection_url&&"free"!==options.plan&&(0,o.jsx)(p.Button,{href:options.form_connection_url,variant:"secondary",children:V("Create a form connection","simply-static")})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:V("Comments","simply-static")})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",V("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:V("Use comments?","simply-static"),__nextHasNoMarginBottom:!0,help:V(g?"Use comments on your static website.":"Don't use comments on your static website.","simply-static"),disabled:"free"===options.plan||!c(),checked:g,onChange:e=>{x(e),t("use_comments",e)}}),g&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.SelectControl,{label:V("Select a redirect page","content-protector"),options:b,help:V("The post will be regenerated after comment submission, but it might take a while so its good practice to redirect the visitor.","simply-static"),disabled:"free"===options.plan||!c(),value:e.comment_redirect,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>{t("comment_redirect",e)}})})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(d||g)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:V("Captcha","simply-static")})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",V("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:V("We will automatically protect your forms and comments with a captcha on your static site.","simply-static")}),(0,o.jsx)(p.SelectControl,{label:V("Captcha Service","simply-static"),help:V("Choose which captcha service to use.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.captcha_service||"",options:[{label:V("Choose Service","simply-static"),value:""},{label:V("Cloudflare Turnstile","simply-static"),value:"turnstile"},{label:V("Google reCAPTCHA v3","simply-static"),value:"recaptcha_v3"}],onChange:e=>t("captcha_service",e)}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),j&&(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Notice,{status:j.type,isDismissible:!0,onRemove:()=>k(null),children:j.message}),(0,o.jsx)(p.__experimentalSpacer,{margin:3})]})}),(0,o.jsx)(p.Button,{variant:"secondary",disabled:"free"===options.plan||!c()||v,isBusy:v,onClick:()=>{w(!0),k(null),r()({path:"/simplystatic/v1/captcha/detect-credentials"}).then(n=>{if(w(!1),!n.success)return void k({type:"error",message:V("Failed to detect credentials.","simply-static")});const i=n.credentials,a=e.captcha_service||"";let r=null,s="";if("turnstile"===a&&i.turnstile&&i.turnstile.length>0)r=i.turnstile[0],s=r.source,t("cloudflare_turnstile_site_key",r.site_key),t("cloudflare_turnstile_secret_key",r.secret_key),k({type:"success",message:V("Turnstile credentials copied from ","simply-static")+s+"!"});else if("recaptcha_v3"===a&&i.recaptcha&&i.recaptcha.length>0)r=i.recaptcha[0],s=r.source,t("recaptcha_site_key",r.site_key),t("recaptcha_secret_key",r.secret_key),k({type:"success",message:V("ReCaptcha credentials copied from ","simply-static")+s+"!"});else{let e="";"turnstile"===a&&i.recaptcha&&i.recaptcha.length>0?e=V(" ReCaptcha credentials were found - switch to ReCaptcha v3 to use them.","simply-static"):"recaptcha_v3"===a&&i.turnstile&&i.turnstile.length>0&&(e=V(" Turnstile credentials were found - switch to Turnstile to use them.","simply-static")),k({type:"warning",message:V("No credentials found for the selected captcha service.","simply-static")+e})}C(i)}).catch(e=>{w(!1),k({type:"error",message:V("Error detecting credentials: ","simply-static")+(e.message||V("Unknown error","simply-static"))})})},children:V(v?"Detecting...":"Copy existing Credentials","simply-static")}),(0,o.jsx)("p",{className:"components-base-control__help",children:V("Automatically detect and copy captcha credentials from form plugins like Contact Form 7, WPForms, or Fluent Forms.","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),"turnstile"===e.captcha_service&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextControl,{label:V("Site Key","simply-static"),help:V("Your public key will be used on the static site.","simply-static"),placeholder:V("Enter your Turnstile site key","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.cloudflare_turnstile_site_key||"",onChange:e=>t("cloudflare_turnstile_site_key",e)}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.TextControl,{label:V("Secret Key","simply-static"),help:V("Your secret key will be stored in WordPress.","simply-static"),placeholder:V("Enter your Turnstile secret key","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.cloudflare_turnstile_secret_key||"",onChange:e=>t("cloudflare_turnstile_secret_key",e)}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.SelectControl,{label:V("Theme","simply-static"),help:V("Choose how the widget should look on your site.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.cloudflare_turnstile_theme||"auto",options:[{label:V("Auto","simply-static"),value:"auto"},{label:V("Light","simply-static"),value:"light"},{label:V("Dark","simply-static"),value:"dark"}],onChange:e=>t("cloudflare_turnstile_theme",e)}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.SelectControl,{label:V("Size","simply-static"),help:V("Choose the widget size.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.cloudflare_turnstile_size||"normal",options:[{label:V("Normal","simply-static"),value:"normal"},{label:V("Flexible","simply-static"),value:"flexible"},{label:V("Compact","simply-static"),value:"compact"}],onChange:e=>t("cloudflare_turnstile_size",e)})]}),"recaptcha_v3"===e.captcha_service&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextControl,{label:V("Site Key","simply-static"),help:V("Your public key will be used on the static site.","simply-static"),placeholder:V("Enter your reCAPTCHA v3 site key","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.recaptcha_site_key||"",onChange:e=>t("recaptcha_site_key",e)}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.TextControl,{label:V("Secret Key","simply-static"),help:V("Your secret key will be stored in WordPress.","simply-static"),placeholder:V("Enter your reCAPTCHA v3 secret key","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!c(),value:e.recaptcha_secret_key||"",onChange:e=>t("recaptcha_secret_key",e)})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:V("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:"pro"===options.plan&&c()&&(0,o.jsx)(p.Button,{onClick:()=>{n(),s(!0),setTimeout(function(){s(!1),d&&(localStorage.setItem("ss-initial-page","/forms"),window.location.reload())},2e3)},variant:"primary",children:V("Save Settings","simply-static")})})]})},{__:Y}=wp.i18n,X=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:r,isPro:s}=(0,i.useContext)(l),[c,d]=(0,i.useState)(!1),[u,m]=(0,i.useState)("fuse"),[h,g]=(0,i.useState)(!1),x=()=>g(!0);(0,i.useEffect)(()=>{Object.prototype.hasOwnProperty.call(e,"use_search")&&d(!!e.use_search),e.search_type&&m(e.search_type)},[e]);const f=e.search_show_submit??e.search_fuse_show_submit??!1;return(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:Y("Search","simply-static")})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Y("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:Y("Use search?","simply-static"),__nextHasNoMarginBottom:!0,help:Y(c?"Use search on your static website.":"Don't use search on your static website.","simply-static"),disabled:"free"===options.plan||!s(),checked:c,onChange:e=>{d(e),t("use_search",e)}}),(0,o.jsx)(p.SelectControl,{label:Y("Search Type","simply-static"),value:u,help:Y("Decide which search type you want to use. Fuse runs locally based on a file, and Algolia is an external API service.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,options:[{label:"Fuse JS",value:"fuse"},{label:"Algolia API",value:"algolia"}],onChange:e=>{m(e),t("search_type",e)}}),c&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.ToggleControl,{label:Y("Use Search Results Page","simply-static"),__nextHasNoMarginBottom:!0,help:Y("Simply Static will create a static search results page and the export will include a special __qs directory.","simply-static"),disabled:"free"===options.plan||!s(),checked:e.use_search_results_page??!0,onChange:e=>{t("use_search_results_page",e)}}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsx)(p.ToggleControl,{label:Y("Use Submit Button","simply-static"),__nextHasNoMarginBottom:!0,help:Y("Show or hide the submit button in the search UI.","simply-static"),disabled:"free"===options.plan||!s(),checked:e.search_show_submit??e.search_fuse_show_submit??!1,onChange:e=>{t("search_show_submit",e)}}),f&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextControl,{label:Y("Submit button text","simply-static"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,placeholder:Y("Search","simply-static"),help:Y("Customize the submit button text or HTML (e.g., add an icon).","simply-static"),disabled:"free"===options.plan||!s(),value:e.search_submit_text??e.search_fuse_submit_text,onChange:e=>{t("search_submit_text",e)}})}),(0,o.jsx)(p.ToggleControl,{label:Y("Show excerpt in suggestions/results","simply-static"),__nextHasNoMarginBottom:!0,help:Y("Enable to display the excerpt below each search suggestion and result item.","simply-static"),disabled:"free"===options.plan||!s(),checked:e.search_show_excerpt??!1,onChange:e=>{t("search_show_excerpt",e)}}),(0,o.jsx)(p.TextControl,{label:Y("Input placeholder","simply-static"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,placeholder:Y("Search..","simply-static"),help:Y("Customize the placeholder text for the search input.","simply-static"),disabled:"free"===options.plan||!s(),value:e.search_placeholder??e.search_fuse_placeholder,onChange:e=>{t("search_placeholder",e)}})]})]})]}),(0,o.jsxs)(o.Fragment,{children:[h&&(0,o.jsxs)(p.Modal,{title:Y("How to select data with meta tags","simply-static"),onRequestClose:()=>g(!1),children:[(0,o.jsx)("p",{children:Y("Targeting for excerpt in the meta description tag.","simply-static")}),(0,o.jsx)("pre",{children:''}),(0,o.jsx)("p",{children:Y("Adding such meta in the excerpt field would be:","simply-static")}),(0,o.jsx)("pre",{children:"description|content"}),(0,o.jsx)("p",{children:Y("Targeting for title in the property meta tag.","simply-static")}),(0,o.jsx)("pre",{children:''}),(0,o.jsx)("p",{children:Y("Adding such meta in the excerpt field would be:","simply-static")}),(0,o.jsx)("pre",{children:"property|og:title"}),(0,o.jsx)("p",{children:Y('If the second item (after | ) is not content, we\'ll use it as value of that attribute (property="og:title" in this example) and use content for value.',"simply-static")}),(0,o.jsx)("p",{children:(0,o.jsx)("strong",{children:Y("Caution: Use meta tags that exist everywhere for title.","simply-static")})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:Y("Indexing","simply-static")})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Y("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:Y("CSS-Selector for Title","simply-static"),type:"text",placeholder:"title",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,o.jsxs)(o.Fragment,{children:[Y("Add the CSS selector which contains the title of the page/post","simply-static")," ",(0,o.jsx)(p.Button,{variant:"link",onClick:x,children:Y("Or meta tags. Click for more information.","simply-static")})]}),disabled:"free"===options.plan||!s(),value:e.search_index_title,onChange:e=>{t("search_index_title",e)}}),(0,o.jsx)(p.TextControl,{label:Y("CSS-Selector for Content","simply-static"),type:"text",placeholder:"body",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,o.jsxs)(o.Fragment,{children:[Y("Add the CSS selector which contains the content of the page/post.","simply-static")," ",(0,o.jsx)(p.Button,{variant:"link",onClick:x,children:Y("Or meta tags. Click for more information.","simply-static")})]}),disabled:"free"===options.plan||!s(),value:e.search_index_content,onChange:e=>{t("search_index_content",e)}}),(0,o.jsx)(p.TextControl,{label:Y("CSS-Selector for Excerpt","simply-static"),type:"text",placeholder:".entry-content",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:(0,o.jsxs)(o.Fragment,{children:[Y("Add the CSS selector which contains the excerpt of the page/post.","simply-static")," ",(0,o.jsx)(p.Button,{variant:"link",onClick:x,children:Y("Or meta tags. Click for more information.","simply-static")})]}),disabled:"free"===options.plan||!s(),value:e.search_index_excerpt,onChange:e=>{t("search_index_excerpt",e)}}),(0,o.jsx)(p.TextareaControl,{label:Y("Exclude URLs","simply-static"),placeholder:"author\narchive\ncategory",__nextHasNoMarginBottom:!0,help:Y("Exclude URLs from indexing (one per line). You can use full URLs, parts of an URL or plain words (like stop words).","simply-static"),disabled:"free"===options.plan||!s(),value:e.search_excludable,onChange:e=>{t("search_excludable",e)}})]})]})]}),"fuse"===u&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[Y("Fuse.js","simply-static"),(0,o.jsx)(H,{title:Y("How to add search with FuseJS","simply-static"),videoUrl:"https://youtu.be/K34l1DXjCHk"})]})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Y("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:Y("CSS-Selector","simply-static"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add the CSS selector for the element that contains your search input field.","simply-static"),disabled:"free"===options.plan||!s(),value:e.fuse_selector,onChange:e=>{t("fuse_selector",e)}}),(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:Y("If you have multiple search elements with different CSS selectors, separate them by a comma (,) such as: .search-form, .custom-search-form","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsx)(p.__experimentalNumberControl,{label:Y("Threshold","simply-static"),isShiftStepEnabled:!0,step:.1,min:.1,max:1,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y(" A threshold of 0.0 requires a perfect match, a threshold of 1.0 would match anything.","simply-static"),disabled:"free"===options.plan||!s(),value:e.fuse_threshold,placeholder:.1,onChange:e=>{t("fuse_threshold",e)}}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsx)(p.ToggleControl,{label:Y("Use Extended Search","simply-static"),__nextHasNoMarginBottom:!0,help:Y("Enable Fuse.js extended search operators such as exact match, prefix, suffix, and inverse match.","simply-static"),disabled:"free"===options.plan||!s(),checked:e.fuse_use_extended_search,onChange:e=>{t("fuse_use_extended_search",e)}}),(0,o.jsx)(p.ToggleControl,{label:Y("Ignore Location","simply-static"),__nextHasNoMarginBottom:!0,help:Y("When enabled, the search will look for a match anywhere in the string, regardless of position. By default, Fuse.js favors matches near the beginning of a string.","simply-static"),disabled:"free"===options.plan||!s(),checked:e.fuse_ignore_location,onChange:e=>{t("fuse_ignore_location",e)}}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsx)("h4",{children:Y("Weight","simply-static")}),(0,o.jsx)("p",{children:Y("Weighted search allows you to prioritize certain fields in your search results. A higher weight means results matching that field will appear higher in the results list. Default weight is 1.","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{margin:3}),(0,o.jsxs)(p.Flex,{gap:4,align:"flex-start",wrap:!0,children:[(0,o.jsx)(p.FlexItem,{style:{flex:1,minWidth:"120px"},children:(0,o.jsx)(p.__experimentalNumberControl,{label:Y("Title Weight","simply-static"),isShiftStepEnabled:!0,step:1,min:1,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!s(),value:e.fuse_weight_title??1,placeholder:1,onChange:e=>{t("fuse_weight_title",e)}})}),(0,o.jsx)(p.FlexItem,{style:{flex:1,minWidth:"120px"},children:(0,o.jsx)(p.__experimentalNumberControl,{label:Y("Content Weight","simply-static"),isShiftStepEnabled:!0,step:1,min:1,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!s(),value:e.fuse_weight_content??1,placeholder:1,onChange:e=>{t("fuse_weight_content",e)}})}),(0,o.jsx)(p.FlexItem,{style:{flex:1,minWidth:"120px"},children:(0,o.jsx)(p.__experimentalNumberControl,{label:Y("Excerpt Weight","simply-static"),isShiftStepEnabled:!0,step:1,min:1,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:"free"===options.plan||!s(),value:e.fuse_weight_excerpt??1,placeholder:1,onChange:e=>{t("fuse_weight_excerpt",e)}})})]})]})]})]}),"algolia"===u&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[Y("Algolia API","simply-static"),(0,o.jsx)(H,{title:Y("How to add search with the Algolia API","simply-static"),videoUrl:"https://youtu.be/H9PNZSl0KnU"})]})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Y("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:Y("Application ID","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add your Algolia App ID.","simply-static"),disabled:"free"===options.plan||!s(),value:e.algolia_app_id,onChange:e=>{t("algolia_app_id",e)}}),(0,o.jsx)(p.TextControl,{label:Y("Admin API Key","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add your Algolia Admin API Key.","simply-static"),disabled:"free"===options.plan||!s(),value:e.algolia_admin_api_key,onChange:e=>{t("algolia_admin_api_key",e)}}),(0,o.jsx)(p.TextControl,{label:Y("Search-Only API Key","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add your Algolia Search-Only API Key here. This is the only key that will be visible on your static site.","simply-static"),disabled:"free"===options.plan||!s(),value:e.algolia_search_api_key,onChange:e=>{t("algolia_search_api_key",e)}}),(0,o.jsx)(p.TextControl,{label:Y("Name for your index","simply-static"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add your Algolia index name here.","simply-static"),disabled:"free"===options.plan||!s(),value:e.algolia_index,onChange:e=>{t("algolia_index",e)}}),(0,o.jsx)(p.TextControl,{label:Y("CSS-Selector","simply-static"),type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,help:Y("Add the CSS selector for the element that contains your search input field.","simply-static"),disabled:"free"===options.plan||!s(),value:e.algolia_selector,onChange:e=>{t("algolia_selector",e)}}),(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:Y("If you have multiple search elements with different CSS selectors, separate them by a comma (,) such as: .search-form, .custom-search-form","simply-static")})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:Y("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:"pro"===options.plan&&s()&&(0,o.jsx)(p.Button,{onClick:()=>{n(),r(!0),setTimeout(function(){r(!1)},2e3)},variant:"primary",children:Y("Save Settings","simply-static")})})]})},{__:Q}=wp.i18n,Z=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isPro:c,isStudio:d}=(0,i.useContext)(l),[u,m]=(0,i.useState)(!1),[h,g]=(0,i.useState)(!1),[x,f]=(0,i.useState)(!1),[y,b]=(0,i.useState)(null);return(0,i.useEffect)(()=>{e.debugging_mode&&m(e.debugging_mode),e.server_cron&&g(e.server_cron)},[e]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)("b",{children:[Q("Basic Auth","simply-static"),(0,o.jsx)(H,{title:Q("How to set up basic auth","simply-static"),videoUrl:"https://youtu.be/6udSR3_zSOU"})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:Q("If you've secured WordPress with HTTP Basic Auth you need to specify the username and password to use below.","simply-static")}),(0,o.jsx)(p.TextControl,{label:Q("Basic Auth Username","simply-static"),autoComplete:"off",type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.http_basic_auth_username,onChange:e=>{t("http_basic_auth_username",e)}}),(0,o.jsx)(p.TextControl,{label:Q("Basic Auth Password","simply-static"),type:"password",autoComplete:"off",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.http_basic_auth_password,onChange:e=>{t("http_basic_auth_password",e)}}),(0,o.jsx)(p.ToggleControl,{label:Q("Enable Basic Auth","simply-static"),__nextHasNoMarginBottom:!0,help:(0,o.jsx)(o.Fragment,{children:"free"===options.plan?(0,o.jsx)(o.Fragment,{children:Q("Automatically setting up Basic Auth requires Simply Static Pro.","simply-static")}):(0,o.jsx)(o.Fragment,{children:Q("Once enabled we will put your entire website behind password protection.","simply-static")})}),disabled:"free"===options.plan||!c(),checked:!!e.http_basic_auth_on,onChange:e=>{t("http_basic_auth_on",e)}}),e.http_basic_auth_on&&(!e.http_basic_auth_username||!e.http_basic_auth_password)&&(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:Q("Requires Username & Password to work","simply-static")})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Q("Temporary Files","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[d()&&(0,o.jsx)(L,{heading:Q("Temporary files are managed by Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:Q("Studio provisions and cleans up build storage automatically for each environment, so there is no temporary directory to configure.","simply-static")})}),(0,o.jsx)(p.TextControl,{label:Q("Temporary Files Directory","simply-static"),type:"text",placeholder:options.temp_files_dir,help:Q("Optionally specify the directory to save your temporary files. This directory must exist and be writeable.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:d(),value:e.temp_files_dir,onChange:e=>{t("temp_files_dir",e)}}),y&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Notice,{status:y.type,isDismissible:!0,onRemove:()=>b(null),children:y.message}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)(p.Button,{isSecondary:!0,onClick:async()=>{f(!0),b(null);try{const e=await r()({path:"/simplystatic/v1/clear-temp-files",method:"POST"});let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){}if(t&&200===t.status)b({type:"success",message:Q("Temporary files cleared.","simply-static")});else{const e=t&&t.message?t.message:Q("Could not clear temporary files.","simply-static");b({type:"error",message:e})}}catch(e){b({type:"error",message:Q("Request failed. Please try again.","simply-static")})}finally{f(!1)}},disabled:d()||x,isBusy:x,children:Q(x?"Clearing…":"Clear Temporary Files","simply-static")})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Q("Whitelist Plugins","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.TextareaControl,{label:Q("Whitelist plugins in diagnostics","simply-static"),placeholder:"autoptimize\nwp-search-with-algolia\nwp-rocket",help:Q("If you want to exclude certain plugins from the diagnostics check add the plugin slugs here (one per line).","simply-static"),__nextHasNoMarginBottom:!0,value:e.whitelist_plugins,onChange:e=>{t("whitelist_plugins",e)}})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Q("Proxy Setup","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[d()&&(0,o.jsx)(L,{heading:Q("Proxy setup is handled by Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:Q("Studio already knows the WordPress origin and public Studio URL for this environment, so you do not need to configure a proxy URL manually.","simply-static")})}),(0,o.jsx)(p.TextControl,{label:Q("Origin URL","simply-static"),type:"url",help:Q("If the URL of your WordPress installation differs from the public-facing URL (Proxy Setup), add the public URL here.","simply-static"),placeholder:options.home,autoComplete:"off",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,disabled:d(),value:e.origin_url,onChange:e=>{t("origin_url",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Q("Debug Log","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.ToggleControl,{label:Q("Activate Debug Log","simply-static"),help:Q("Enable it to download the debug log from Simply Static -> Generate.","simply-static"),__nextHasNoMarginBottom:!0,checked:u,onChange:e=>{m(e),t("debugging_mode",e)}})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Q("Cron","simply-static")})}),(0,o.jsxs)(p.CardBody,{children:[d()&&(0,o.jsx)(L,{heading:Q("Cron is automatic on Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:Q("Studio starts builds automatically when your site changes, so you do not need a server-side cron job to trigger exports.","simply-static")})}),(0,o.jsx)(p.ToggleControl,{label:Q("Use server-side cron job","simply-static"),help:Q("Enable this if you use a server-side cron job instead of the default WP-Cron.","simply-static"),__nextHasNoMarginBottom:!0,disabled:d(),checked:h,onChange:e=>{g(e),t("server_cron",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:Q("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:(0,o.jsx)(p.Button,{onClick:()=>{n(),s(!0),setTimeout(function(){s(!1)},2e3)},variant:"primary",children:Q("Save Settings","simply-static")})})]})},{__:ee}=wp.i18n,te=function({integration:e,settings:t,toggleIntegration:n}){let i=e.active;const a=e.pro,r=e.can_run,s=e.always_active;void 0!==t.integrations&&!1!==t.integrations&&(i=t.integrations.indexOf(e.id)>=0);let l="pro"===options.plan||!a;const c="ss-adminbar"===e.id;let d=!1;c&&void 0!==t.integrations&&!1!==t.integrations&&(d=t.integrations.indexOf("ss-command-center")>=0);const u=c&&d;return(0,o.jsx)(p.Card,{children:(0,o.jsx)(p.CardHeader,{className:"ss-integration",children:(0,o.jsxs)(p.Flex,{align:"flex-start",justify:"space-between",children:[(0,o.jsxs)(p.FlexBlock,{style:{flex:"0 0 70%",maxWidth:"70%"},children:[(0,o.jsxs)("strong",{children:[e.name||e.id,"redirection"===e.id&&(0,o.jsx)(H,{title:ee("Automated Redirects with Redirection","simply-static"),videoUrl:"https://youtu.be/sS4BQcZ4dN8"}),"complianz"===e.id&&(0,o.jsx)(H,{title:ee("Cookie Consent with Complianz","simply-static"),videoUrl:"https://youtu.be/GPKYtt8A5QE"})]}),""!==e.description&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("br",{}),e.description]})]}),(0,o.jsxs)(p.FlexBlock,{style:{flex:"0 0 30%",maxWidth:"30%"},className:"ss-align-right ss-no-shrink",children:[!r&&(0,o.jsxs)("span",{children:[(0,o.jsx)("em",{children:"Missing Plugin"}),!l&&(0,o.jsx)("div",{children:(0,o.jsx)(p.Button,{variant:"link",href:"https://simplystatic.com/pricing/",children:ee("Requires Simply Static Pro","simply-static")})})]}),r&&l&&!s&&(0,o.jsxs)(p.Flex,{justify:"flex-end",direction:"column",style:{alignItems:"flex-end"},children:[(0,o.jsx)(p.ToggleControl,{className:"integration-toggle",__nextHasNoMarginBottom:!0,checked:!u&&i,disabled:u,onChange:t=>{n(e.id,t)}}),u&&(0,o.jsx)("em",{style:{fontSize:"12px",color:"#757575"},children:ee("Disabled by Command Center","simply-static")})]}),r&&l&&s&&(0,o.jsx)("em",{children:"Always Active"}),r&&!l&&(0,o.jsx)(p.Button,{variant:"primary",href:"https://simplystatic.com/pricing/",children:ee("Get the Pro version","simply-static")})]})]})})})},{__:ne}=wp.i18n,ie=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:r,maybeQueueIntegration:s}=(0,i.useContext)(l),c=(n,i)=>{i?(n=>{let i=e.integrations;!1===i&&(i=[]),i.indexOf(n)>=0||(i.push(n),t("integrations",i),s(n))})(n):(n=>{let i=e.integrations;!1===i&&(i=[]);const a=i.indexOf(n);a<0||(i.splice(a,1),t("integrations",i),s(n))})(n)},d=Object.keys(options.integrations).filter(e=>options.integrations[e].can_run&&!options.integrations[e].always_active),u=Object.keys(options.integrations).filter(e=>!options.integrations[e].can_run&&!options.integrations[e].always_active);return(0,o.jsxs)("div",{className:"inner-settings",children:[d.map(t=>{const n=options.integrations[t];return(0,o.jsx)(te,{integration:n,settings:e,toggleIntegration:c},n.id||t)}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),u.map(t=>{const n=options.integrations[t];return(0,o.jsx)(te,{integration:n,settings:e,toggleIntegration:c},n.id||t)}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:ne("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:(0,o.jsx)(p.Button,{onClick:async()=>{try{const{shouldReload:e}=await n();if(r(!0),e)return void setTimeout(()=>{try{if("undefined"!=typeof window){const e="/integrations";if(window.localStorage)try{window.localStorage.setItem("ss-initial-page",e)}catch(e){}}}catch(e){}window.location.reload()},400)}catch(e){}setTimeout(function(){r(!1)},2e3)},variant:"primary",children:ne("Save Settings","simply-static")})})]})},{__:ae}=wp.i18n,re=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:r}=(0,i.useContext)(l),[s,c]=(0,i.useState)({}),d="undefined"!=typeof options&&options.current_settings&&options.current_settings.ss_uam_access?options.current_settings.ss_uam_access:{},u=(0,i.useMemo)(()=>[{label:ae("Administrator","simply-static"),value:"administrator"},{label:ae("Editor","simply-static"),value:"editor"},{label:ae("Author","simply-static"),value:"author"},{label:ae("Contributor","simply-static"),value:"contributor"},{label:ae("Subscriber","simply-static"),value:"subscriber"}],[]),m=(0,i.useMemo)(()=>[{key:"activity",label:ae("Activity Log","simply-static"),route:"/"},{key:"diagnostics",label:ae("Diagnostics","simply-static"),route:"/diagnostics"}],[]),h=(0,i.useMemo)(()=>[{key:"general",label:ae("General","simply-static"),route:"/general"},{key:"deployment",label:ae("Deploy","simply-static"),route:"/deployment"},{key:"forms",label:ae("Forms","simply-static"),route:"/forms"},{key:"search",label:ae("Search","simply-static"),route:"/search"},{key:"optimize",label:ae("Optimize","simply-static"),route:"/optimize"},{key:"hide-wp",label:ae("Hide WP","simply-static"),route:"/hide-wp"},{key:"workflow",label:ae("Workflow","simply-static"),route:"/workflow"}],[]),g=(0,i.useMemo)(()=>[{key:"integrations",label:ae("Integrations","simply-static"),route:"/integrations"},{key:"utilities",label:ae("Utilities","simply-static"),route:"/utilities"},{key:"debug",label:ae("Debug","simply-static"),route:"/debug"},{key:"uam",label:ae("UAM","simply-static"),route:"/uam"}],[]),x=(0,i.useMemo)(()=>{const t=[{key:"menu_generate",label:ae("Generate","simply-static")},{key:"menu_settings",label:ae("Settings","simply-static")},{key:"menu_diagnostics",label:ae("Diagnostics","simply-static")},{key:"menu_form_connections",label:ae("Form Connections","simply-static")}];return e?.ss_use_builds&&t.push({key:"menu_builds",label:ae("Builds","simply-static")}),t},[e?.ss_use_builds]);(0,i.useEffect)(()=>{c({...e?.ss_uam_access||{}})},[e]);const f=(e,n)=>{const i={...s,[e]:n};c(i),t("ss_uam_access",i)},y=({id:e,label:t,value:n,onChange:i})=>(0,o.jsxs)(p.Flex,{align:"center",gap:3,children:[(0,o.jsx)(p.FlexItem,{style:{minWidth:260},children:(0,o.jsx)("b",{id:`${e}-label`,children:t})}),(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.SelectControl,{"aria-label":t,value:n,options:u,onChange:i})})]}),b=(e,t)=>s&&Object.prototype.hasOwnProperty.call(s,e)&&s[e]?s[e]:d&&Object.prototype.hasOwnProperty.call(d,e)&&d[e]?d[e]:t;return(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("UAM (User Access Management)","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)("p",{children:ae("Control who can access Simply Static pages, menu entries, and selected features by assigning a minimum WordPress role.","simply-static")})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("Tools","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.Flex,{direction:"column",gap:3,children:m.map(e=>{const t="activity"===e.key?"editor":"administrator";return(0,o.jsx)(y,{id:`uam-${e.key}`,label:e.label,value:b(e.key,t),onChange:t=>f(e.key,t)},e.key)})})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("Settings","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.Flex,{direction:"column",gap:3,children:h.map(e=>(0,o.jsx)(y,{id:`uam-${e.key}`,label:e.label,value:b(e.key,"administrator"),onChange:t=>f(e.key,t)},e.key))})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("Advanced","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.Flex,{direction:"column",gap:3,children:g.map(e=>(0,o.jsx)(y,{id:`uam-${e.key}`,label:e.label,value:b(e.key,"administrator"),onChange:t=>f(e.key,t)},e.key))})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("Menu","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.Flex,{direction:"column",gap:3,children:x.map(e=>{const t="menu_generate"===e.key?"editor":"administrator";return(0,o.jsx)(y,{id:`uam-${e.key}`,label:e.label,value:b(e.key,t),onChange:t=>f(e.key,t)},e.key)})})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:ae("Features","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsxs)(p.Flex,{direction:"column",gap:3,children:[(0,o.jsx)(y,{id:"uam-adminbar",label:ae("Admin Bar","simply-static"),value:b("adminbar","editor"),onChange:e=>f("adminbar",e)}),(0,o.jsx)(y,{id:"uam-single-export",label:ae("Single Export (Button)","simply-static"),value:b("single_export_button","editor"),onChange:e=>f("single_export_button",e)})]})})]}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:ae("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:(0,o.jsx)(p.Button,{onClick:()=>{n(),r(!0),setTimeout(function(){r(!1)},2e3)},variant:"primary",children:ae("Save Settings","simply-static")})})]})};function se(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,a,r=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(e){a={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var oe=function(e){var t=e.children;return m().createElement("div",{className:"react-terminal-line"},t)};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===n&&i.firstChild?i.insertBefore(a,i.firstChild):i.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}("/**\n * Modfied version of [termynal.js](https://github.com/ines/termynal/blob/master/termynal.css).\n *\n * @author Ines Montani \n * @version 0.0.1\n * @license MIT\n */\n .react-terminal-wrapper {\n width: 100%;\n background: #252a33;\n color: #eee;\n font-size: 18px;\n font-family: 'Fira Mono', Consolas, Menlo, Monaco, 'Courier New', Courier, monospace;\n border-radius: 4px;\n padding: 75px 45px 35px;\n position: relative;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n.react-terminal {\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n\n.react-terminal-wrapper.react-terminal-light {\n background: #ddd;\n color: #1a1e24;\n}\n\n.react-terminal-window-buttons {\n position: absolute;\n top: 15px;\n left: 15px;\n display: flex;\n flex-direction: row;\n gap: 10px;\n}\n\n.react-terminal-window-buttons button {\n width: 15px;\n height: 15px;\n border-radius: 50%;\n border: 0;\n}\n\n.react-terminal-window-buttons button.clickable {\n cursor: pointer;\n}\n\n.react-terminal-window-buttons button.red-btn {\n background: #d9515d;\n}\n\n.react-terminal-window-buttons button.yellow-btn {\n background: #f4c025;\n}\n\n.react-terminal-window-buttons button.green-btn {\n background: #3ec930;\n}\n\n.react-terminal-wrapper:after {\n content: attr(data-terminal-name);\n position: absolute;\n color: #a2a2a2;\n top: 5px;\n left: 0;\n width: 100%;\n text-align: center;\n pointer-events: none;\n}\n\n.react-terminal-wrapper.react-terminal-light:after {\n color: #D76D77;\n}\n\n.react-terminal-line {\n white-space: pre;\n}\n\n.react-terminal-line:before {\n /* Set up defaults and ensure empty lines are displayed. */\n content: '';\n display: inline-block;\n vertical-align: middle;\n color: #a2a2a2;\n}\n\n.react-terminal-light .react-terminal-line:before {\n color: #D76D77;\n}\n\n.react-terminal-input:before {\n margin-right: 0.75em;\n content: '$';\n}\n\n.react-terminal-input[data-terminal-prompt]:before {\n content: attr(data-terminal-prompt);\n}\n\n.react-terminal-wrapper:focus-within .react-terminal-active-input .cursor {\n position: relative;\n display: inline-block;\n width: 0.55em;\n height: 1em;\n top: 0.225em;\n background: #fff;\n -webkit-animation: blink 1s infinite;\n animation: blink 1s infinite;\n}\n\n/* Cursor animation */\n\n@-webkit-keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n\n@keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n\n.terminal-hidden-input {\n position: fixed;\n left: -1000px;\n}\n\n/* .react-terminal-progress {\n display: flex;\n margin: .5rem 0;\n}\n\n.react-terminal-progress-bar {\n background-color: #fff;\n border-radius: .25rem;\n width: 25%;\n}\n\n.react-terminal-wrapper.react-terminal-light .react-terminal-progress-bar {\n background-color: #000;\n} */\n");var le,ce,de=function(e){var t=e.redBtnCallback,n=e.yellowBtnCallback,i=e.greenBtnCallback;return m().createElement("div",{className:"react-terminal-window-buttons"},m().createElement("button",{className:"".concat(n?"clickable":""," red-btn"),disabled:!t,onClick:t}),m().createElement("button",{className:"".concat(n?"clickable":""," yellow-btn"),disabled:!n,onClick:n}),m().createElement("button",{className:"".concat(i?"clickable":""," green-btn"),disabled:!i,onClick:i}))};(ce=le||(le={}))[ce.Light=0]="Light",ce[ce.Dark=1]="Dark";var pe=function(e){var t=e.name,n=e.prompt,i=e.height,a=void 0===i?"600px":i,r=e.colorMode,s=e.onInput,o=e.children,l=e.startingInputValue,c=void 0===l?"":l,d=e.redBtnCallback,p=e.yellowBtnCallback,h=e.greenBtnCallback,g=e.TopButtonsPanel,x=void 0===g?de:g,f=se((0,u.useState)(""),2),y=f[0],b=f[1],_=se((0,u.useState)(0),2),v=_[0],w=_[1],S=(0,u.useRef)(null);(0,u.useEffect)(function(){b(c.trim())},[c]),(0,u.useEffect)(function(){var e,t;if(null!=s){var n=[],i=function(e){var t=function(){var t;return null===(t=null==e?void 0:e.querySelector(".terminal-hidden-input"))||void 0===t?void 0:t.focus()};null==e||e.addEventListener("click",t),n.push({terminalEl:e,listener:t})};try{for(var a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(document.getElementsByClassName("react-terminal-wrapper")),r=a.next();!r.done;r=a.next())i(r.value)}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return function(){n.forEach(function(e){e.terminalEl.removeEventListener("click",e.listener)})}}},[s]);var C=["react-terminal-wrapper"];return r===le.Light&&C.push("react-terminal-light"),m().createElement("div",{className:C.join(" "),"data-terminal-name":t},m().createElement(x,{redBtnCallback:d,yellowBtnCallback:p,greenBtnCallback:h}),m().createElement("div",{className:"react-terminal",style:{height:a}},o,"function"==typeof s&&m().createElement("div",{className:"react-terminal-line react-terminal-input react-terminal-active-input","data-terminal-prompt":n||"$",key:"terminal-line-prompt"},y,m().createElement("span",{className:"cursor",style:{left:"".concat(v+1,"px")}})),m().createElement("div",{ref:S})),m().createElement("input",{className:"terminal-hidden-input",placeholder:"Terminal Hidden Input",value:y,autoFocus:null!=s,onChange:function(e){b(e.target.value)},onKeyDown:function(e){var t,n;if(s)if("Enter"===e.key)s(y),w(0),b(""),setTimeout(function(){var e;return null===(e=null==S?void 0:S.current)||void 0===e?void 0:e.scrollIntoView({behavior:"auto",block:"nearest"})},500);else if(["ArrowLeft","ArrowRight","ArrowDown","ArrowUp","Delete"].includes(e.key)){var i=e.currentTarget,a="",r=y.length-(i.selectionStart||0);r=(t=r)>(n=y.length)?n:t<0?0:t,"ArrowLeft"===e.key?(r>y.length-1&&r--,a=y.slice(y.length-1-r)):"ArrowRight"===e.key||"Delete"===e.key?a=y.slice(y.length-r+1):"ArrowUp"===e.key&&(a=y.slice(0));var o=function(e,t){var n=document.createElement("span");n.style.visibility="hidden",n.style.position="absolute",n.style.fontSize=window.getComputedStyle(e).fontSize,n.style.fontFamily=window.getComputedStyle(e).fontFamily,n.innerText=t,document.body.appendChild(n);var i=n.getBoundingClientRect().width;return document.body.removeChild(n),-i}(i,a);w(o)}}}))};const ue=new Set(["http:","https:"]);function me(e){if(e&&"object"==typeof e)return e;if("string"!=typeof e)return null;try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch{return null}}function he(e){return null==e?"":String(e).replace(/<\s*br\s*\/?>/gi," ").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim()}function ge(e){if("string"!=typeof e)return null;const t=e.trim();if(!t)return null;if(/^\/(?!\/)/.test(t))try{const e=new URL("https://simply-static.invalid/"),n=new URL(t,e);if(n.origin!==e.origin)return null;const i=`${n.pathname}${n.search}${n.hash}`;return{href:i,label:i}}catch{return null}if(!/^https?:\/\//i.test(t))return null;try{const e=new URL(t);return ue.has(e.protocol)?e.username||e.password?null:{href:e.href,label:`${e.pathname}${e.search}${e.hash}`||"/"}:null}catch{return null}}const{__:xe}=wp.i18n,fe=function(){const{isRunning:e,isResumed:t,blogId:n,snapshotRollback:a,isRollbackRunning:c}=(0,i.useContext)(l),d=a&&a.message?a.message:xe("Rollback in progress. Simply Static export actions are locked until the rollback has finished.","simply-static"),u=a&&a.progress?a.progress:{},m=u.label?`${u.label}${u.total?` (${u.percent||0}%, ${u.completed||0}/${u.total})`:""}`:d,[h,g]=(0,i.useState)([(0,o.jsx)(oe,{children:xe("Waiting for new push…","simply-static")},"waiting")]),x=(0,i.useRef)({blogId:null,controller:null,promise:null,queued:!1,sequence:0}),f=(0,i.useRef)(!0),y=(0,i.useCallback)(()=>{if(x.current.promise&&x.current.blogId===n)return x.current.queued=!0,x.current.promise;const e="undefined"!=typeof AbortController?new AbortController:null,t=x.current.sequence+1,i={path:"/simplystatic/v1/activity-log?blog_id="+n+"&is_network_admin="+options.is_network,method:"GET"};e&&(i.signal=e.signal);const a=r()(i).then(e=>{const n=me(e);if(!n||!n.data||"object"!=typeof n.data)return;if(!f.current||t!==x.current.sequence)return;const i=Object.entries(n.data).map(([e,t])=>{const n=t&&"object"==typeof t?t:{},i=he(n.datetime),a=function(e){const t=e&&"object"==typeof e?e:{},n=function(e){const t=null==e?"":String(e),n={before:he(t),after:"",link:null},i=t.match(/^([\s\S]*?)]*?)>([^<>]*)<\/a>([\s\S]*?)$/i);if(!i)return n;const a=i[1],r=i[2],s=he(i[3]),o=i[4];if(/[<>]/.test(a+o)||!s)return n;const l=function(e){const t=new Set(["href","target","rel"]),n={};let i=e;for(;i.length;){const e=i.match(/^\s+([a-z][a-z0-9_-]*)\s*=\s*(["'])(.*?)\2/i);if(!e)return null;const a=e[1].toLowerCase();if(!t.has(a)||Object.prototype.hasOwnProperty.call(n,a))return null;n[a]=e[3],i=i.slice(e[0].length)}if(n.target&&"_blank"!==n.target.toLowerCase())return null;if(n.rel){const e=n.rel.toLowerCase().split(/\s+/).filter(Boolean);if(!e.includes("noopener")||e.some(e=>!["noopener","noreferrer"].includes(e)))return null}return n}(r);if(!l||!l.href)return n;const c=l.href.replace(/&(?:amp|#0*38|#x0*26);/gi,"&").trim();if(!/^https?:\/\//i.test(c))return n;const d=ge(c);return d&&/^https?:\/\//i.test(d.href)?{before:he(a),after:he(o),link:{href:d.href,label:s}}:n}(t.message);if(!t.link||"object"!=typeof t.link)return n;const i=ge(t.link.url);return i?{...n,link:{href:i.href,label:he(t.link.label)||i.label}}:n}(n),r=e.includes("pause")||e.includes("cancel"),s=e.includes("resume");return(0,o.jsxs)(oe,{children:["[",i,"]"," ",(0,o.jsxs)("span",{className:`${r?"is-error":""} ${s?"is-success":""}`,children:[a.before,a.before&&a.link?" ":null,a.link&&(0,o.jsx)("a",{href:a.link.href,target:"_blank",rel:"noopener noreferrer",children:a.link.label}),a.after&&(a.before||a.link)?" ":null,a.after]})]},e)});g(i)}).catch(e=>{!e||e.name}).finally(()=>{if(t===x.current.sequence){const e=x.current.queued;x.current={blogId:n,controller:null,promise:null,queued:!1,sequence:t},e&&f.current&&y()}});return x.current={blogId:n,controller:e,promise:a,queued:!1,sequence:t},a},[n]);return(0,i.useEffect)(()=>(f.current=!0,()=>{f.current=!1,x.current.controller&&x.current.controller.abort()}),[]),s(()=>{y()},e?2500:null),(0,i.useEffect)(()=>{e&&!t&&g([(0,o.jsx)(oe,{children:xe("Waiting for new push…","simply-static")},"waiting")]),e&&t&&g([(0,o.jsx)(oe,{children:xe("Resuming the push…","simply-static")},"resuming")]),y()},[e,t,y]),(0,o.jsxs)(o.Fragment,{children:[c&&(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,className:"rollback-lock-notice",children:(0,o.jsxs)("p",{children:[(0,o.jsx)(p.Dashicon,{icon:"update"}),(0,o.jsx)("strong",{children:xe("Rollback in progress","simply-static")}),(0,o.jsx)("span",{children:m})]})}),(0,o.jsx)(pe,{name:xe("Activity Log","simply-static"),height:"250px",colorMode:le.Dark,children:h})]})};!function(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===t&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}(".rdt_table{position:relative;box-sizing:border-box;display:flex;flex-direction:column;width:100%;height:100%;max-width:100%;min-width:fit-content;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-bg, #fff);font-family:var(--rdt-font-family, inherit);color-scheme:var(--rdt-color-scheme, light);--rdt-sort-icon-size: calc(var(--rdt-icon-size, 18px) * .8)}.rdt_tableDisabled{pointer-events:none;opacity:.4}.rdt_wrapper{position:relative;width:100%;min-width:fit-content}.rdt_responsiveWrapper{position:relative;width:100%;border-radius:inherit}.rdt_responsiveWrapperScroll{overflow-x:auto;overflow-y:hidden;min-height:0;overscroll-behavior-x:contain;touch-action:pan-x pan-y;-webkit-overflow-scrolling:touch}.rdt_responsiveWrapperFixed{overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch;min-height:0;overscroll-behavior-x:contain;touch-action:pan-x pan-y}.rdt_responsiveWrapperHideScrollbar{scrollbar-width:none}.rdt_responsiveWrapperHideScrollbar::-webkit-scrollbar{display:none}.rdt_pinnedScrollbarTrack{position:relative;height:8px;background:var(--rdt-color-bg, #fff);cursor:pointer;user-select:none}.rdt_pinnedScrollbarThumb{position:absolute;top:1px;left:0;height:6px;border-radius:3px;background:var(--rdt-color-scrollbar-thumb, rgba(0, 0, 0, .25));cursor:grab;transition:background .15s}.rdt_pinnedScrollbarThumb:hover,.rdt_pinnedScrollbarThumb:active{background:var(--rdt-color-scrollbar-thumb-hover, rgba(0, 0, 0, .45))}.rdt_head{display:flex;flex-direction:column;width:100%;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));font-size:var(--rdt-font-size-header, 12px);font-weight:500}.rdt_headFixed{position:sticky;top:0;z-index:1}.rdt_headRow{display:flex;align-items:stretch;width:100%;min-height:var(--rdt-header-height, 52px);background-color:var(--rdt-color-header-bg, var(--rdt-color-bg, #fff));border-bottom:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12))}.rdt_headRowDense{min-height:32px}.rdt_body{display:flex;flex-direction:column}.rdt_row{display:flex;align-items:stretch;align-content:stretch;width:100%;box-sizing:border-box;font-size:var(--rdt-font-size, 13px);font-weight:400;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-bg, #fff);min-height:var(--rdt-row-height, 48px)}.rdt_row:not(:last-of-type) .rdt_cellBase,.rdt_row:not(:last-of-type) .rdt_rightPinSpacer{border-bottom:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12))}.rdt_rowDense{min-height:32px}.rdt_rowStriped{color:var(--rdt-color-striped-text, rgba(0, 0, 0, .87));background-color:var(--rdt-color-striped, #fafafa)}.rdt_rowSelected{color:var(--rdt-color-selected-text, rgba(0, 0, 0, .87));background-color:var(--rdt-color-selected, #e3f2fd)}.rdt_rowHighlight:hover{color:var(--rdt-color-highlight-text, rgba(0, 0, 0, .87));background-color:var(--rdt-color-highlight, #eee);outline:1px solid var(--rdt-color-bg, #fff);transition-duration:.15s;transition-property:background-color}.rdt_rowPointer:hover{cursor:pointer}.rdt_cellBase{position:relative;display:flex;align-items:center;box-sizing:border-box;line-height:normal;padding-left:var(--rdt-cell-padding-x, 16px);padding-right:var(--rdt-cell-padding-x, 16px);word-break:break-word}.rdt_headSeparator .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_cellBaseHead:not(.rdt_groupCell):before,.rdt_headSeparatorFull .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_cellBaseHead:not(.rdt_groupCell):before,.rdt_colSeparator .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_cellBase:not(.rdt_cellBaseHead):before,.rdt_colSeparatorFull .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_cellBase:not(.rdt_cellBaseHead):before,.rdt_headSeparator .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_rightPinSpacer:before,.rdt_headSeparatorFull .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_rightPinSpacer:before,.rdt_colSeparator .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_rightPinSpacer:before,.rdt_colSeparatorFull .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_rightPinSpacer:before{content:\"\";position:absolute;inset-inline-start:0;top:var(--_sep-top, 20%);height:var(--_sep-h, 60%);width:1px;background:var(--rdt-col-sep-color, var(--rdt-color-divider, rgba(0, 0, 0, .12)));pointer-events:none}.rdt_headSeparatorFull .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_cellBaseHead:not(.rdt_groupCell):before,.rdt_colSeparatorFull .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_cellBase:not(.rdt_cellBaseHead):before,.rdt_headSeparatorFull .rdt_cellBaseHead:not(.rdt_groupCell)+.rdt_rightPinSpacer:before,.rdt_colSeparatorFull .rdt_cellBase:not(.rdt_cellBaseHead)+.rdt_rightPinSpacer:before{--_sep-top: 0;--_sep-h: 100%}.rdt_rightPinSpacer{position:relative;overflow:hidden}.rdt_cellNoPadding{padding:0}.rdt_Checkbox{position:relative;display:inline-flex;flex-shrink:0;width:var(--rdt-checkbox-size, 18px);height:var(--rdt-checkbox-size, 18px);cursor:pointer}.rdt_Checkbox.rdt_disabled{cursor:default;opacity:.38}.rdt_Checkbox>input[type=checkbox]{position:absolute;opacity:0;inset:0;margin:0;width:100%;height:100%;cursor:inherit;z-index:1}.rdt_Checkbox:before{content:\"\";position:absolute;inset:0;box-sizing:border-box;border-radius:var(--rdt-checkbox-radius, 2px);border:2px solid currentColor;opacity:.54;background:transparent;transition:background .15s,border-color .15s,opacity .15s}.rdt_Checkbox.rdt_checked:before,.rdt_Checkbox.rdt_indeterminate:before{background:var(--rdt-color-primary, #1976d2);border-color:var(--rdt-color-primary, #1976d2);opacity:1}.rdt_Checkbox:after{content:\"\";position:absolute;inset:0;background-repeat:no-repeat;background-position:center;pointer-events:none}.rdt_Checkbox.rdt_checked:after{background-image:url(\"data:image/svg+xml,\")}.rdt_Checkbox.rdt_indeterminate:after{background-image:url(\"data:image/svg+xml,\")}.rdt_cellCheckbox{flex:0 0 var(--rdt-system-col-width, 48px);min-width:var(--rdt-system-col-width, 48px);justify-content:center;align-items:center;user-select:none;white-space:nowrap}.rdt_cellExpander{white-space:nowrap;font-weight:400;min-width:var(--rdt-system-col-width, 48px)}.rdt_columnCheckbox{flex:0 0 var(--rdt-system-col-width, 48px);justify-content:center;align-items:center;user-select:none;white-space:nowrap;font-size:unset}.rdt_columnExpander{white-space:nowrap;min-width:var(--rdt-system-col-width, 48px)}.rdt_columnSortable{display:inline-flex;align-items:center;justify-content:inherit;height:100%;width:100%;outline:none;user-select:none;overflow:hidden}.rdt_columnSortableEnabled{cursor:pointer}.rdt_columnSortableEnabled:not(.rdt_columnSortableActive):hover,.rdt_columnSortableEnabled:not(.rdt_columnSortableActive):focus{opacity:.7}.rdt_columnSortableEnabled:not(.rdt_columnSortableActive):hover span,.rdt_columnSortableEnabled:not(.rdt_columnSortableActive):focus span{opacity:.7}.rdt_columnText{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.rdt_filterContainer{position:relative;display:inline-flex;align-items:center;margin-inline-start:4px;flex-shrink:0}.rdt_filterIcon{display:inline-flex;align-items:center;justify-content:center;position:relative;background:none;border:none;cursor:pointer;color:var(--rdt-color-btn, rgba(0, 0, 0, .54));border-radius:50%;width:22px;height:22px;padding:0;transition:background-color .2s,color .2s;touch-action:manipulation}.rdt_filterIcon:hover,.rdt_filterIcon:focus{background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .08));outline:none}.rdt_filterIconActive{color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87))}.rdt_filterDot{position:absolute;top:3px;inset-inline-end:3px;width:5px;height:5px;border-radius:50%;background-color:var(--rdt-color-primary, #1976d2);pointer-events:none}.rdt_filterPanel{z-index:9999;display:flex;flex-direction:column;gap:6px;background:var(--rdt-color-bg, #fff);border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .18));border-radius:var(--rdt-border-radius, 6px);box-shadow:0 4px 16px #00000024;padding:10px;min-width:260px;max-width:calc(100vw - 24px);box-sizing:border-box}.rdt_filterConditionRow{display:flex;align-items:center;gap:4px}.rdt_filterSelect{flex:0 0 auto;font-size:12px;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background:var(--rdt-color-bg, #fff);border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .24));border-radius:calc(var(--rdt-border-radius, 6px) * .6);padding:3px 4px;cursor:pointer;max-width:140px}.rdt_filterSelect:focus{outline:2px solid var(--rdt-color-primary, #1976d2);outline-offset:-1px}.rdt_filterInput{flex:1;min-width:0;font-size:12px;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background:var(--rdt-color-bg, #fff);border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .24));border-radius:calc(var(--rdt-border-radius, 6px) * .6);padding:3px 6px}.rdt_filterInput:focus{outline:2px solid var(--rdt-color-primary, #1976d2);outline-offset:-1px}.rdt_filterBetweenSep{font-size:11px;color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));white-space:nowrap}.rdt_filterRemoveBtn{background:none;border:none;cursor:pointer;color:var(--rdt-color-btn, rgba(0, 0, 0, .54));font-size:11px;padding:2px 4px;border-radius:3px;line-height:1}.rdt_filterRemoveBtn:hover{background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .08))}.rdt_filterLogicRow{display:flex;gap:4px}.rdt_filterLogicBtn{font-size:11px;font-weight:600;padding:2px 8px;border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .24));border-radius:3px;background:none;cursor:pointer;color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54))}.rdt_filterLogicBtnActive{background-color:var(--rdt-color-primary, #1976d2);border-color:var(--rdt-color-primary, #1976d2);color:#fff}.rdt_filterAddCondition{background:none;border:none;cursor:pointer;font-size:12px;color:var(--rdt-color-primary, #1976d2);padding:0;text-align:left}.rdt_filterAddCondition:hover{text-decoration:underline}.rdt_filterActions{display:flex;justify-content:flex-end;gap:6px;padding-top:4px;border-top:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12));margin-top:2px}.rdt_filterBtn{font-size:12px;padding:4px 12px;border-radius:4px;border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .24));background:none;cursor:pointer;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87))}.rdt_filterBtn:hover{background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .06))}.rdt_filterBtnPrimary{background-color:var(--rdt-color-primary, #1976d2);border-color:var(--rdt-color-primary, #1976d2);color:#fff}.rdt_filterBtnPrimary:hover{background-color:#1565c0}@supports (background-color: color-mix(in srgb,red 1%,black)){.rdt_filterBtnPrimary:hover{background-color:color-mix(in srgb,var(--rdt-color-primary, #1976d2) 85%,black)}}.rdt_kebabIcon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;position:relative;background:none;border:none;cursor:pointer;color:var(--rdt-color-btn, rgba(0, 0, 0, .54));border-radius:50%;width:22px;height:22px;padding:0;margin-inline-start:4px;transition:background-color .2s,color .2s;touch-action:manipulation}.rdt_kebabIcon:hover,.rdt_kebabIcon:focus{background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .08));outline:none}.rdt_contextMenu{z-index:9999;display:flex;flex-direction:column;min-width:180px;max-width:calc(100vw - 24px);padding:4px;box-sizing:border-box;background:var(--rdt-color-bg, #fff);border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .18));border-radius:var(--rdt-border-radius, 6px);box-shadow:0 4px 16px #00000024}.rdt_contextMenuItem{display:flex;align-items:center;gap:8px;width:100%;background:none;border:none;border-radius:calc(var(--rdt-border-radius, 6px) * .6);padding:6px 10px;font-size:13px;text-align:start;cursor:pointer;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87))}.rdt_contextMenuItem:hover:not(:disabled),.rdt_contextMenuItem:focus{background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .08));outline:none}.rdt_contextMenuItem:disabled{color:var(--rdt-color-btn-disabled, rgba(0, 0, 0, .34));cursor:default}.rdt_contextMenuItemIcon{display:inline-flex;align-items:center}.rdt_contextMenuSeparator{height:1px;margin:4px 6px;background:var(--rdt-color-divider, rgba(0, 0, 0, .12))}.rdt_rowKebabCell{position:sticky;inset-inline-end:8px;align-self:center;display:flex;justify-content:center;align-items:center;width:34px;margin-inline-start:-34px;overflow:visible;z-index:2;background-color:inherit}.rdt_rowKebabCell.rdt_rowKebabStart{inset-inline-end:auto;inset-inline-start:8px;margin-inline-start:0;margin-inline-end:-34px;order:-1}.rdt_rowKebab{opacity:0}.rdt_row:hover .rdt_rowKebab,.rdt_row:focus-within .rdt_rowKebab{opacity:1}@media(hover:none){.rdt_rowKebab{opacity:1}}.rdt_dragGhost{position:fixed;top:-9999px;left:-9999px;display:flex;align-items:center;gap:8px;padding:0 var(--rdt-cell-padding-x, 16px);box-sizing:border-box;background:var(--rdt-color-bg, #fff);color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12));border-radius:calc(var(--rdt-border-radius, 6px) * .5);font-size:var(--rdt-font-size-header, 12px);font-weight:500;white-space:nowrap;overflow:hidden;box-shadow:0 4px 16px #0000002e;pointer-events:none;opacity:.96}.rdt_dragGhostIcon{display:flex;align-items:center;flex-shrink:0;opacity:.45}.rdt_dragGhostLabel{overflow:hidden;text-overflow:ellipsis}.rdt_TableCol[draggable=true]{cursor:grab;user-select:none}.rdt_TableCol[draggable=true]:active{cursor:grabbing}.rdt_cellEditable{cursor:text;transition:background-color .15s}.rdt_cellEditable:hover{background-color:var(--rdt-color-cell-edit-hover, rgba(25, 118, 210, .06))}@supports (background-color: color-mix(in srgb,red 1%,transparent)){.rdt_cellEditable:hover{background-color:var(--rdt-color-cell-edit-hover, color-mix(in srgb, var(--rdt-color-primary, #1976d2) 6%, transparent))}}.rdt_cellEditable:hover>div[data-tag]{border-bottom:1px dashed var(--rdt-color-cell-edit-hover-border, rgba(25, 118, 210, .4));margin-bottom:-1px}@supports (border-color: color-mix(in srgb,red 1%,transparent)){.rdt_cellEditable:hover>div[data-tag]{border-bottom-color:var(--rdt-color-cell-edit-hover-border, color-mix(in srgb, var(--rdt-color-primary, #1976d2) 40%, transparent))}}.rdt_cellEditing{background-color:var(--rdt-color-cell-edit-bg, rgba(25, 118, 210, .08));box-shadow:inset 0 0 0 2px var(--rdt-color-primary, #1976d2);z-index:3;align-items:stretch;padding-top:0;padding-bottom:0}.rdt_row:not(:last-of-type) .rdt_cellEditing{border-bottom-color:transparent}@supports (background-color: color-mix(in srgb,red 1%,white)){.rdt_cellEditing{background-color:var(--rdt-color-cell-edit-bg, color-mix(in srgb, var(--rdt-color-primary, #1976d2) 8%, var(--rdt-color-bg, #fff)))}}.rdt_editInput,.rdt_editSelect{display:block;box-sizing:border-box;width:calc(100% + 2 * var(--rdt-cell-padding-x, 16px));min-height:var(--rdt-row-height, 48px);align-self:stretch;margin:0 calc(-1 * var(--rdt-cell-padding-x, 16px));padding:0 var(--rdt-cell-padding-x, 16px);font:inherit;color:inherit;background:transparent;border:none;outline:none;appearance:none;-webkit-appearance:none}.rdt_editInput::placeholder{color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));opacity:.7}.rdt_cellEditing:has(.rdt_editSelect):after{content:\"\";position:absolute;inset-inline-end:var(--rdt-cell-padding-x, 16px);top:50%;transform:translateY(-50%);width:12px;height:8px;pointer-events:none;background-color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));mask-image:url(\"data:image/svg+xml,\");mask-size:100% 100%;-webkit-mask-image:url(\"data:image/svg+xml,\");-webkit-mask-size:100% 100%}.rdt_editSelect{padding-inline-end:calc(var(--rdt-cell-padding-x, 16px) + 24px)}.rdt_rowDense .rdt_editInput,.rdt_rowDense .rdt_editSelect{min-height:32px}.rdt_editCheckboxWrap{display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%;cursor:pointer;user-select:none}.rdt_editCheckbox{appearance:auto;cursor:pointer;margin:0;width:16px;height:16px}.rdt_editCheckboxWrap:focus-visible{outline:2px solid var(--rdt-color-primary);outline-offset:-2px;border-radius:var(--rdt-border-radius, 4px)}.rdt_editCustomWrap{display:flex;align-items:center;width:100%;height:100%;padding:0 var(--rdt-cell-padding-x, 16px)}.rdt_cellEditError{box-shadow:inset 0 0 0 2px var(--rdt-color-cell-edit-error, #dc2626)}.rdt_editErrorTip{position:absolute;bottom:100%;left:0;margin-bottom:2px;padding:2px 6px;font-size:11px;line-height:1.4;color:#fff;background:var(--rdt-color-cell-edit-error, #dc2626);border-radius:var(--rdt-border-radius, 4px);white-space:nowrap;pointer-events:none;z-index:5}.rdt_TableCell.rdt_cellEditError{position:relative}.rdt_table[role=grid] [data-nav-row]:focus-within:not(.rdt_cellEditing){outline:2px solid var(--rdt-color-primary, #1976d2);outline-offset:-2px;z-index:2}.rdt_pinLeft,.rdt_pinRight{background-color:inherit}.rdt_pinLeftLast{box-shadow:1px 0 0 var(--rdt-color-pin-border, var(--rdt-color-divider, rgba(0, 0, 0, .12)))}.rdt_pinRightFirst{box-shadow:-1px 0 0 var(--rdt-color-pin-border, var(--rdt-color-divider, rgba(0, 0, 0, .12)))}.rdt_pinLeftLast+.rdt_cellBase,.rdt_pinRightFirst{--rdt-col-sep-color: transparent}.rdt_pinLeftLast:dir(rtl){box-shadow:-1px 0 0 var(--rdt-color-pin-border, var(--rdt-color-divider, rgba(0, 0, 0, .12)))}.rdt_pinRightFirst:dir(rtl){box-shadow:1px 0 0 var(--rdt-color-pin-border, var(--rdt-color-divider, rgba(0, 0, 0, .12)))}.rdt_resizeHandle{position:absolute;inset-inline-end:-5px;top:0;height:100%;width:10px;cursor:col-resize;user-select:none;touch-action:none;z-index:1}.rdt_cellBaseHead:last-child .rdt_resizeHandle{inset-inline-end:0;z-index:2}.rdt_resizeHandle:after{content:\"\";position:absolute;top:0;height:100%;width:3px;inset-inline-end:3px}.rdt_cellBaseHead:last-child .rdt_resizeHandle:after{inset-inline-end:0}.rdt_resizeHandle:hover:after,.rdt_resizeHandle:active:after{background-color:var(--rdt-color-primary, #1976d2)}.rdt_headGrid{display:grid;grid-template-rows:var(--rdt-header-height, 52px) var(--rdt-header-height, 52px);width:100%;background-color:var(--rdt-color-header-bg, var(--rdt-color-bg, #fff));border-bottom:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12));background-image:linear-gradient(to bottom,transparent calc(var(--rdt-header-height, 52px) - 1px),var(--rdt-color-divider, rgba(0, 0, 0, .12)) calc(var(--rdt-header-height, 52px) - 1px),var(--rdt-color-divider, rgba(0, 0, 0, .12)) var(--rdt-header-height, 52px),transparent var(--rdt-header-height, 52px))}.rdt_headGridDense{grid-template-rows:32px 32px;background-image:linear-gradient(to bottom,transparent 31px,var(--rdt-color-divider, rgba(0, 0, 0, .12)) 31px,var(--rdt-color-divider, rgba(0, 0, 0, .12)) 32px,transparent 32px)}.rdt_groupCell{position:relative;display:flex;align-items:center;justify-content:center;padding:0 var(--rdt-cell-padding-x, 16px);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));box-sizing:border-box}.rdt_groupCellReorder{cursor:grab;user-select:none}.rdt_groupCellDragging{cursor:grabbing}.rdt_groupCell+.rdt_groupCell:before{content:\"\";position:absolute;inset-inline-start:0;top:20%;height:60%;width:1px;background:var(--rdt-col-sep-color, var(--rdt-color-divider, rgba(0, 0, 0, .12)));pointer-events:none}.rdt_sortIcon i,.rdt_sortIcon svg{transition-duration:95ms;transition-property:transform;color:inherit;font-size:18px;height:18px;width:18px;backface-visibility:hidden;transform-style:preserve-3d}.rdt_sortIconInactive i,.rdt_sortIconInactive svg{opacity:0}.rdt_sortIconActive i,.rdt_sortIconActive svg{opacity:1}.rdt_sortIconAsc i,.rdt_sortIconAsc svg{transform:rotate(180deg)}.rdt_sortPriority{display:inline-flex;align-items:center;justify-content:center;min-width:14px;height:14px;margin:0 2px;padding:0 3px;border-radius:7px;font-size:10px;line-height:1;font-weight:600;color:var(--rdt-color-bg, #fff);background-color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54))}.rdt_expanderRow{width:100%;box-sizing:border-box;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-bg, #fff)}.rdt_expanderButton{display:inline-flex;align-items:center;justify-content:center;margin:auto;user-select:none;white-space:nowrap;border:none;background-color:transparent;color:var(--rdt-color-btn, rgba(0, 0, 0, .54));fill:var(--rdt-color-btn, rgba(0, 0, 0, .54));border-radius:var(--rdt-border-radius, 4px);transition:background-color .15s;padding:4px}.rdt_expanderButton svg{margin:auto;width:var(--rdt-icon-size, 18px);height:var(--rdt-icon-size, 18px);flex-shrink:0}.rdt_expanderButton:hover:not(:disabled){cursor:pointer;background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .12))}.rdt_expanderButton:focus{outline:none;background-color:var(--rdt-color-btn-focus, rgba(0, 0, 0, .12))}.rdt_expanderButton:disabled{color:var(--rdt-color-btn-disabled, rgba(0, 0, 0, .18));fill:var(--rdt-color-btn-disabled, rgba(0, 0, 0, .18))}.rdt_header{position:relative;box-sizing:border-box;overflow:hidden;display:flex;flex:1 1 auto;align-items:center;justify-content:space-between;width:100%;flex-wrap:wrap;font-size:22px;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-header-bg, var(--rdt-color-bg, #fff));min-height:56px;padding-left:16px;padding-right:8px;gap:4px}@media(max-width:599px){.rdt_header{font-size:18px;padding-left:12px;padding-right:6px}.rdt_headerActions{flex:0 0 auto}}.rdt_headerTitle{flex:1 0 auto;font-weight:400}.rdt_headerActions{flex:1 0 auto;display:flex;align-items:center;justify-content:flex-end}.rdt_headerActions>*{margin-left:5px}.rdt_subheader{position:relative;display:flex;flex:1 1 auto;box-sizing:border-box;align-items:center;padding:4px 16px 4px 24px;width:100%;background-color:var(--rdt-color-header-bg, var(--rdt-color-bg, #fff));min-height:52px}.rdt_subheaderLeft{justify-content:flex-start}.rdt_subheaderRight{justify-content:flex-end}.rdt_subheaderCenter{justify-content:center}.rdt_subheaderWrap{flex-wrap:wrap}.rdt_noData{box-sizing:border-box;width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-bg, #fff)}.rdt_progress{position:relative;box-sizing:border-box;width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));background-color:var(--rdt-color-bg, #fff)}@keyframes rdt_shimmer{0%{background-position:-400px 0}to{background-position:400px 0}}@keyframes rdt_spin{to{transform:rotate(360deg)}}.rdt_skeletonPulse{background:linear-gradient(90deg,var(--rdt-color-divider, rgba(0,0,0,.08)) 25%,rgba(255,255,255,.5) 50%,var(--rdt-color-divider, rgba(0,0,0,.08)) 75%);background-size:800px 100%;animation:rdt_shimmer 1.4s ease-in-out infinite}.rdt_bodyBusy{opacity:.4;pointer-events:none;user-select:none;transition:opacity .15s ease}.rdt_bodyOverlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none}.rdt_footer{display:flex;flex-direction:column;background-color:var(--rdt-color-footer-bg, var(--rdt-color-bg, #fff))}.rdt_footerRow{display:flex;align-items:stretch;width:100%;box-sizing:border-box;min-height:var(--rdt-row-height, 48px);font-size:var(--rdt-font-size, 13px);font-weight:600;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));border-top:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .12))}.rdt_footerCell{background-color:inherit}.rdt_footerSystemCell{flex:0 0 var(--rdt-system-col-width, 40px);min-width:0;max-width:var(--rdt-system-col-width, 40px)}.rdt_pagination{display:flex;flex:1 1 auto;justify-content:flex-end;align-items:center;box-sizing:border-box;padding-right:var(--rdt-cell-padding-x, 8px);padding-left:var(--rdt-cell-padding-x, 8px);width:100%;font-size:var(--rdt-font-size, 13px);font-family:var(--rdt-font-family, inherit);color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));background-color:var(--rdt-color-bg, #fff);min-height:var(--rdt-row-height, 52px)}.rdt_paginationButton{position:relative;display:flex;align-items:center;justify-content:center;user-select:none;border:none;border-radius:calc(var(--rdt-border-radius, 4px) * 100);height:calc(var(--rdt-icon-size, 18px) + 16px);width:calc(var(--rdt-icon-size, 18px) + 16px);padding:0;margin:0;cursor:pointer;transition:background-color .15s;color:var(--rdt-color-btn, rgba(0, 0, 0, .54));fill:var(--rdt-color-btn, rgba(0, 0, 0, .54));background-color:transparent}.rdt_paginationButton svg{width:var(--rdt-icon-size, 18px);height:var(--rdt-icon-size, 18px);flex-shrink:0}.rdt_paginationButton:disabled{cursor:unset;color:var(--rdt-color-btn-disabled, rgba(0, 0, 0, .18));fill:var(--rdt-color-btn-disabled, rgba(0, 0, 0, .18))}.rdt_paginationButton:hover:not(:disabled){background-color:var(--rdt-color-btn-hover, rgba(0, 0, 0, .12))}.rdt_paginationButton:focus{outline:none;background-color:var(--rdt-color-btn-focus, rgba(0, 0, 0, .12))}.rdt_paginationButtonRTL{transform:scale(-1)}.rdt_paginationPageList{display:flex;align-items:center;border-radius:var(--rdt-border-radius, 4px);white-space:nowrap}.rdt_paginationNarrow{justify-content:center;padding-left:4px;padding-right:4px}.rdt_paginationNarrow .rdt_paginationPageList{width:100%;justify-content:space-around}.rdt_paginationSpan{flex-shrink:1;user-select:none}.rdt_paginationRange{flex-shrink:1;user-select:none;margin:0 24px}.rdt_paginationRowLabel{flex-shrink:1;user-select:none;margin:0 4px}.rdt_selectWrapper{position:relative;display:inline-flex;align-items:center;flex-shrink:0;font-size:inherit;color:var(--rdt-color-text-primary, rgba(0, 0, 0, .87));border:1px solid var(--rdt-color-divider, rgba(0, 0, 0, .24));border-radius:var(--rdt-border-radius, 4px);background-color:var(--rdt-color-bg, #fff);height:28px;margin-left:8px;transition:border-color .15s}.rdt_selectWrapper:focus-within{border-color:var(--rdt-color-primary, #1976d2);outline:2px solid var(--rdt-color-primary, #1976d2);outline-offset:-1px}.rdt_selectWrapper svg{top:50%;inset-inline-end:2px;transform:translateY(-50%);color:var(--rdt-color-text-secondary, rgba(0, 0, 0, .54));position:absolute;fill:none;stroke:currentColor;width:18px;height:18px;display:inline-block;user-select:none;pointer-events:none}.rdt_selectControl{cursor:pointer;height:100%;max-width:100%;user-select:none;padding-inline-start:8px;padding-inline-end:22px;box-sizing:border-box;font-size:inherit;font-family:inherit;color:inherit;border:none;background-color:transparent;appearance:none;flex-shrink:0;outline:none}.rdt_selectControl::-ms-expand{display:none}.rdt_selectControl option{color:initial;background-color:var(--rdt-color-bg, #fff)}@media(max-width:599px){.rdt_row{min-height:max(var(--rdt-row-height, 48px),48px)}.rdt_cellBase{padding-left:var(--rdt-cell-padding-x-mobile, 12px);padding-right:var(--rdt-cell-padding-x-mobile, 12px)}.rdt_paginationButton{height:44px;width:44px}}@media(max-width:599px){.rdt_hideOnSm{display:none}}@media(max-width:959px){.rdt_hideOnMd{display:none}}@media(max-width:1279px){.rdt_hideOnLg{display:none}}@keyframes rdt_rowEnter{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.rdt_animatedRow{animation:rdt_rowEnter .18s ease both;animation-delay:calc(var(--rdt-row-index, 0) * 16ms)}.rdt_expanderRowAnimated{display:grid;animation:rdt_expandIn .22s cubic-bezier(.2,0,0,1) forwards}.rdt_expanderRowClosing{animation:rdt_expandOut .22s cubic-bezier(.2,0,0,1) forwards}@keyframes rdt_expandIn{0%{grid-template-rows:0fr;opacity:0}to{grid-template-rows:1fr;opacity:1}}@keyframes rdt_expandOut{0%{grid-template-rows:1fr;opacity:1}to{grid-template-rows:0fr;opacity:0}}.rdt_expanderRowAnimated>.rdt_expanderRow{overflow:hidden;min-height:0}@keyframes rdt_sortPulse{0%{background-color:transparent}30%{background-color:var(--rdt-color-selected, #e3f2fd)}to{background-color:transparent}}.rdt_sortActive{animation:rdt_sortPulse .4s ease both}@media(prefers-reduced-motion:reduce){.rdt_animatedRow,.rdt_sortActive{animation:none!important;transition:none!important}.rdt_expanderRowAnimated,.rdt_expanderRowClosing{animation:none!important;grid-template-rows:1fr!important;opacity:1!important}}\n");var ye=u.createContext({});function be(){return u.useContext(ye)}function _e({disabled:e,className:t,style:n,...i}){let a=be();return u.createElement("div",{className:["rdt_table",e&&"rdt_tableDisabled",t].filter(Boolean).join(" "),style:{...a.table?.style,...n},...i})}function ve({title:e,actions:t=null}){let n=be();return u.createElement("div",{className:"rdt_TableHeader",style:n.header?.style},u.createElement("div",{className:"rdt_header"},u.createElement("div",{className:"rdt_headerTitle"},e),t&&u.createElement("div",{className:"rdt_headerActions"},t)))}var we={left:"rdt_subheaderLeft",right:"rdt_subheaderRight",center:"rdt_subheaderCenter"};function Se({align:e="right",wrapContent:t=!0,children:n}){let i=be();return u.createElement("header",{className:["rdt_subheader",we[e],t&&"rdt_subheaderWrap"].filter(Boolean).join(" "),style:i.subHeader?.style},n)}var Ce=u.forwardRef(function({$responsive:e,$fixedHeader:t,$fixedHeaderScrollHeight:n="100vh",$hiddenScrollbar:i,className:a,style:r,...s},o){let l=be();return u.createElement("div",{ref:o,className:["rdt_responsiveWrapper",t?"rdt_responsiveWrapperFixed":e?"rdt_responsiveWrapperScroll":void 0,i&&"rdt_responsiveWrapperHideScrollbar",a].filter(Boolean).join(" "),style:{...t&&{maxHeight:n},...l.responsiveWrapper?.style,...r},...s})}),je=Ce;function ke({style:e,...t}){let n=be();return u.createElement("div",{className:"rdt_wrapper",style:{...n.tableWrapper?.style,...e},...t})}var Re=()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M7 10L12 15L17 10"}));function Ee({defaultValue:e,onChange:t,...n}){return u.createElement("div",{className:"rdt_selectWrapper"},u.createElement("select",{className:"rdt_selectControl",onChange:t,defaultValue:e,...n}),u.createElement(Re,null))}var Ne=(e=>(e.ASC="asc",e.DESC="desc",e))(Ne||{}),Pe="allowRowEvents",Be=(e=>(e.LTR="ltr",e.RTL="rtl",e.AUTO="auto",e))(Be||{}),De=(e=>(e.LEFT="left",e.RIGHT="right",e.CENTER="center",e))(De||{}),Te=(e=>(e.SM="sm",e.MD="md",e.LG="lg",e))(Te||{});function Fe(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function Ie(e,t){let n={...e};for(let e of Object.keys(t)){let i=t[e],a=n[e];Fe(i)&&Fe(a)?n[e]=Ie(a,i):void 0!==i&&(n[e]=i)}return n}function Me(e,t){return e[t]}function He(e=""){return"number"!=typeof e&&(!e||0===e.length)}function Ae(e,t,n,i){let a="asc"===i?1:-1,r=n(e),s=n(t),o=null==r,l=null==s;return o||l?o&&l?0:o?1:-1:rs?1*a:0}var Le=()=>0;function ze(e=[],t,n=0){return[...e.slice(0,n),t,...e.slice(n)]}function Oe(e=[],t,n="id"){let i=e.slice(),a=Me(t,n);return a?i.splice(i.findIndex(e=>Me(e,n)===a),1):i.splice(i.findIndex(e=>e===t),1),i}function We(e){return e.map((e,t)=>{let n={...e,sortable:e.sortable||!!e.sortFunction||void 0};return e.id||(n.id=t+1),n})}function Ue(e,t){return Math.ceil(e/t)}function Ge(e,t){return Math.min(e,t)}var $e=()=>null;function qe(e,t=[],n=[]){let i={},a=[...n];return t.length&&t.forEach(t=>{if(!t.when||"function"!=typeof t.when)throw new Error('"when" must be defined in the conditional style object and must be function');t.when(e)&&(i=t.style||{},t.classNames&&(a=[...a,...t.classNames]),"function"==typeof t.style&&(i=t.style(e)||{}))}),{conditionalStyle:i,classNames:a.join(" ")}}function Ke(e,t=[],n="id"){let i=Me(e,n);return i?t.some(e=>Me(e,n)===i):t.some(t=>t===e)}function Ve(e,t,n){return(e?1:0)+(t&&!n?1:0)}function Je(e,t){return t?e.findIndex(e=>Ye(e.id,t)):-1}function Ye(e,t){return e==t}var Xe={left:{},right:{}};function Qe(e,t){if(null!=e.id&&null!=t[e.id])return t[e.id];let n=e.width??e.minWidth??"100px",i=parseFloat(n);return isNaN(i)?100:i}function Ze(){if(typeof window>"u"||typeof document>"u")return 48;let e=document.querySelector(".rdt_table")??document.documentElement,t=getComputedStyle(e).getPropertyValue("--rdt-system-col-width").trim();if(!t)return 48;let n=parseFloat(t);return isNaN(n)?48:n}function et(e,t,n){let i=t??Xe,a=e.id,r="left"===e.pinned&&null!=a&&null!=i.left[a],s="right"===e.pinned&&null!=a&&null!=i.right[a],o=r?Object.values(i.left):[],l=s?Object.values(i.right):[],c=o.length?Math.max(...o):-1,d=l.length?Math.max(...l):-1,p=r&&null!=a&&i.left[a]===c,u=s&&null!=a&&i.right[a]===d;return{pinnedLeft:r,pinnedRight:s,isLastLeftPin:p,isFirstRightPin:u,style:r?{position:"sticky",insetInlineStart:i.left[a],...null!=n&&{zIndex:n}}:s?{position:"sticky",insetInlineEnd:i.right[a],...null!=n&&{zIndex:n}}:{},className:[r&&"rdt_pinLeft",p&&"rdt_pinLeftLast",s&&"rdt_pinRight",u&&"rdt_pinRightFirst"].filter(Boolean).join(" ")}}function tt(e){for(let t of e)if(!t.omit&&"right"===t.pinned)return t.id??null;return null}function nt(e,t){let n=null!=t?`${t}px`:void 0;return{grow:null!=n?0:e.grow,width:n??e.width,minWidth:n??e.minWidth,maxWidth:n??e.maxWidth}}function it(e,t,n,i){return e=i-n?"right":void 0}var at=typeof window<"u"?u.useLayoutEffect:u.useEffect,rt=function(e="auto"){let t="object"==typeof window,[n,i]=u.useState(!1);return u.useEffect(()=>{if(t){if("auto"===e){let e=!(!window.document||!window.document.createElement),t=document.getElementsByTagName("BODY")[0],n=document.getElementsByTagName("HTML")[0],a="rtl"===t.dir||"rtl"===n.dir;return void i(e&&a)}i("rtl"===e)}},[e,t]),n},st={first:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M5 6V18"}),u.createElement("path",{d:"M15 18L9 12L15 6"})),null),last:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M19 6V18"}),u.createElement("path",{d:"M9 18L15 12L9 6"})),null),next:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M9 18L15 12L9 6"})),null),previous:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M15 18L9 12L15 6"})),null)},ot={collapsed:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M9 18L15 12L9 6"})),null),expanded:u.createElement(()=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",role:"presentation"},u.createElement("path",{d:"M18 9L12 15L6 9"})),null)},lt={columns:[],data:[],title:"",keyField:"id",selectableRows:!1,selectableRowsHighlight:!1,selectableRowsNoSelectAll:!1,selectableRowSelected:null,selectableRowDisabled:null,selectableRowsComponent:"input",selectableRowsComponentProps:{},selectableRowsVisibleOnly:!1,selectableRowsSingle:!1,clearSelectedRows:!1,expandableRows:!1,expandableRowDisabled:null,expandableRowExpanded:null,expandOnRowClicked:!1,expandableRowsHideExpander:!1,expandOnRowDoubleClicked:!1,expandableInheritConditionalStyles:!1,expandableRowsComponent:function(){return u.createElement("div",null,"To add an expander pass in a component instance via ",u.createElement("strong",null,"expandableRowsComponent"),". You can then access props.data from this component.")},expandableRowsComponentProps:{},progressPending:!1,progressComponent:u.createElement("div",{style:{width:28,height:28,borderRadius:"50%",border:"3px solid var(--rdt-color-divider, rgba(0,0,0,0.12))",borderTopColor:"var(--rdt-color-text-primary, rgba(0,0,0,0.87))",animation:"rdt_spin 0.7s linear infinite"}}),persistTableHead:!1,sortFunction:null,sortServer:!1,sortMulti:!1,striped:!1,highlightOnHover:!1,pointerOnHover:!1,actions:null,defaultSortFieldId:null,defaultSortAsc:!0,responsive:!0,noDataComponent:u.createElement("div",{style:{padding:"24px"}},"There are no records to display"),disabled:!1,noTableHead:!1,noHeader:!1,subHeader:void 0,subHeaderAlign:"right",subHeaderWrap:!0,fixedHeader:!1,fixedHeaderScrollHeight:"100vh",pagination:!1,paginationServer:!1,paginationServerOptions:{persistSelectedOnSort:!1,persistSelectedOnPageChange:!1},paginationDefaultPage:1,paginationResetDefaultPage:!1,paginationTotalRows:0,paginationPerPage:10,paginationPosition:"bottom",paginationRowsPerPageOptions:[10,15,20,25,30],paginationComponent:null,paginationComponentOptions:{},dense:!1,conditionalRowStyles:[],theme:"default",colorMode:"light",customStyles:{},direction:"auto",onChangePage:$e,onChangeRowsPerPage:$e,onRowClicked:$e,onRowDoubleClicked:$e,onRowMiddleClicked:$e,onRowMouseEnter:$e,onRowMouseLeave:$e,onRowExpandToggled:$e,onSelectedRowsChange:$e,onSort:$e,onColumnOrderChange:$e},ct={rowsPerPageText:"Rows per page:",rangeSeparatorText:"of",noRowsPerPage:!1,selectAllRowsItem:!1,selectAllRowsItemText:"All"},dt=u.memo(function({rowsPerPage:e,rowCount:t,currentPage:n,direction:i=lt.direction,paginationRowsPerPageOptions:a=lt.paginationRowsPerPageOptions,paginationIcons:r=st,paginationComponentOptions:s=lt.paginationComponentOptions,localization:o,onChangeRowsPerPage:l=lt.onChangeRowsPerPage,onChangePage:c=lt.onChangePage}){let d=u.useRef(null),[p,m]=u.useState(0);at(()=>{let e=d.current;if(!e)return;let t=()=>m(e.getBoundingClientRect().width);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let h=rt(i),g=p>599,x=Ue(t,e),f=n*e,y=f-e+1,b=1===n,_=n===x,v={...ct,...s},w=n===x?`${y}-${t} ${v.rangeSeparatorText} ${t}`:`${y}-${f} ${v.rangeSeparatorText} ${t}`,S={...st,...r},C=u.useCallback(()=>c(n-1,t),[n,c,t]),j=u.useCallback(()=>c(n+1,t),[n,c,t]),k=u.useCallback(()=>c(1,t),[c,t]),R=u.useCallback(()=>c(Ue(t,e),t),[c,t,e]),E=u.useCallback(e=>l(Number(e.target.value),n),[n,l]),N=a.map(e=>u.createElement("option",{key:e,value:e},e));v.selectAllRowsItem&&N.push(u.createElement("option",{key:-1,value:t},v.selectAllRowsItemText));let P=be(),B=u.createElement(Ee,{onChange:E,defaultValue:e,"aria-label":v.rowsPerPageText},N),D=e=>["rdt_paginationButton",e&&"rdt_paginationButtonRTL"].filter(Boolean).join(" ");return u.createElement("nav",{ref:d,className:["rdt_pagination","rdt_Pagination",!g&&"rdt_paginationNarrow"].filter(Boolean).join(" "),"aria-label":o?.navigationAriaLabel??"Table pagination",style:P.pagination?.style},!v.noRowsPerPage&&g&&u.createElement(u.Fragment,null,u.createElement("span",{className:"rdt_paginationRowLabel"},v.rowsPerPageText),B),g&&u.createElement("span",{className:"rdt_paginationRange"},w),u.createElement("div",{className:"rdt_paginationPageList"},u.createElement("button",{id:"pagination-first-page",type:"button","aria-label":o?.firstPageAriaLabel??"First Page","aria-disabled":b,onClick:k,disabled:b,className:D(h),style:P.pagination?.pageButtonsStyle},S.first),u.createElement("button",{id:"pagination-previous-page",type:"button","aria-label":o?.previousPageAriaLabel??"Previous Page","aria-disabled":b,onClick:C,disabled:b,className:D(h),style:P.pagination?.pageButtonsStyle},S.previous),!v.noRowsPerPage&&!g&&B,u.createElement("button",{id:"pagination-next-page",type:"button","aria-label":o?.nextPageAriaLabel??"Next Page","aria-disabled":_,onClick:j,disabled:_,className:D(h),style:P.pagination?.pageButtonsStyle},S.next),u.createElement("button",{id:"pagination-last-page",type:"button","aria-label":o?.lastPageAriaLabel??"Last Page","aria-disabled":_,onClick:R,disabled:_,className:D(h),style:P.pagination?.pageButtonsStyle},S.last)))});function pt({$fixedHeader:e,className:t,style:n,...i}){let a=be();return u.createElement("div",{className:["rdt_head",e&&"rdt_headFixed",t].filter(Boolean).join(" "),style:{...a.head?.style,...n},...i})}var ut=u.forwardRef(function({$dense:e,className:t,style:n,...i},a){let r=be();return u.createElement("div",{ref:a,className:["rdt_headRow",e&&"rdt_headRowDense",t].filter(Boolean).join(" "),style:{...r.headRow?.style,...e&&r.headRow?.denseStyle,...n},...i})}),mt=ut;function ht({$headCell:e,$noPadding:t,headStyle:n,cellStyle:i,className:a,style:r,...s}){let o=["rdt_cellBase",e&&"rdt_cellBaseHead",t&&"rdt_cellNoPadding",a].filter(Boolean).join(" ");return u.createElement("div",{className:o,style:{...e?n:i,...r},...s})}var gt=u.forwardRef(function({button:e,grow:t,maxWidth:n,minWidth:i,width:a,right:r,center:s,compact:o,hide:l,allowOverflow:c,$headCell:d,$noPadding:p,headStyle:m,cellStyle:h,className:g,style:x,...f},y){let b=function(e){let{button:t,grow:n,maxWidth:i,minWidth:a,width:r,right:s,center:o,compact:l}=e;return{flexGrow:0===n||t?0:n??1,flexShrink:0,flexBasis:0,maxWidth:r??i??"100%",minWidth:r??a??"100px",justifyContent:s?"flex-end":o||t?"center":void 0,padding:l||t?0:void 0}}({button:e,grow:t,maxWidth:n,minWidth:i,width:a,right:r,center:s,compact:o}),_=["rdt_cellBase",d&&"rdt_cellBaseHead",p&&"rdt_cellNoPadding",(v=l)?"sm"===v?"rdt_hideOnSm":"md"===v?"rdt_hideOnMd":"lg"===v?"rdt_hideOnLg":"":"",g].filter(Boolean).join(" ");var v;return u.createElement("div",{ref:y,className:_,style:{...d?m:h,...b,...x},...f})}),xt=({sortActive:e,sortDirection:t})=>u.createElement("span",{"aria-hidden":"true",style:{display:"inline-flex",flexGrow:0,flexShrink:0,marginLeft:"2px",opacity:e?1:0,transition:e?"opacity 0.15s ease":"none"}},u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",role:"presentation",style:{width:"var(--rdt-sort-icon-size, 12px)",height:"var(--rdt-sort-icon-size, 12px)",transform:e&&"desc"===t?"rotate(180deg)":void 0,transition:e?"transform 0.15s ease":"none"}},u.createElement("path",{d:"M12 19V5M6 11L12 5L18 11"})));function ft(e="text"){return{condition1:{operator:"text"===e?"contains":"equals"}}}function yt(e){return"blank"===e.operator||"notBlank"===e.operator||""!==(e.value?.trim()??"")}function bt(e){return yt(e.condition1)}function _t(e,t,n){let{operator:i,value:a="",value2:r=""}=e;if("blank"===i)return""===t.trim();if("notBlank"===i)return""!==t.trim();if("number"===n){let e=parseFloat(t);if(isNaN(e))return!1;let n=parseFloat(a),s=parseFloat(r);switch(i){case"equals":return e===n;case"notEquals":return e!==n;case"gt":return e>n;case"gte":return e>=n;case"lt":return e=n&&e<=s;default:return!0}}if("date"===n){let e=new Date(t);if(isNaN(e.getTime()))return!1;let n=new Date(a),s=new Date(r);switch(i){case"equals":return e.toDateString()===n.toDateString();case"before":return en;case"between":return e>=n&&e<=s;default:return!0}}let s=t.toLowerCase(),o=a.toLowerCase();switch(i){case"contains":return s.includes(o);case"notContains":return!s.includes(o);case"equals":return s===o;case"notEquals":return s!==o;case"startsWith":return s.startsWith(o);case"endsWith":return s.endsWith(o);default:return!0}}var vt={};var wt=[{value:"contains",label:"Contains"},{value:"notContains",label:"Does not contain"},{value:"equals",label:"Equals"},{value:"notEquals",label:"Does not equal"},{value:"startsWith",label:"Begins with"},{value:"endsWith",label:"Ends with"},{value:"blank",label:"Blank",noInput:!0},{value:"notBlank",label:"Not blank",noInput:!0}],St=[{value:"equals",label:"Equals"},{value:"notEquals",label:"Does not equal"},{value:"gt",label:"Greater than"},{value:"gte",label:"Greater than or equal"},{value:"lt",label:"Less than"},{value:"lte",label:"Less than or equal"},{value:"between",label:"Between",twoInputs:!0},{value:"blank",label:"Blank",noInput:!0},{value:"notBlank",label:"Not blank",noInput:!0}],Ct=[{value:"equals",label:"Equals"},{value:"before",label:"Before"},{value:"after",label:"After"},{value:"between",label:"Between",twoInputs:!0},{value:"blank",label:"Blank",noInput:!0},{value:"notBlank",label:"Not blank",noInput:!0}];function jt(e){return"text"===e?"contains":"equals"}function kt(e){return{operator:jt(e)}}function Rt({condition:e,filterType:t,options:n,onChange:i,onRemove:a}){let r=function(e,t){let n="number"===e?St:"date"===e?Ct:wt;return t?n.map(e=>t[e.value]?{...e,label:t[e.value]}:e):n}(t,n.operators),s=r.find(t=>t.value===e.operator)??r[0],o="number"===t?"number":"date"===t?"date":"text";return u.createElement("div",{className:"rdt_filterConditionRow"},u.createElement("select",{className:"rdt_filterSelect",value:e.operator,onChange:e=>i({operator:e.target.value}),"aria-label":n.operatorAriaLabel??"Filter operator"},r.map(e=>u.createElement("option",{key:e.value,value:e.value},e.label))),!s.noInput&&u.createElement("input",{className:"rdt_filterInput",type:o,value:e.value??"",placeholder:n.valuePlaceholder??"Value",onChange:t=>i({...e,value:t.target.value}),onKeyDown:e=>e.stopPropagation(),"aria-label":n.valueAriaLabel??"Filter value"}),s.twoInputs&&u.createElement(u.Fragment,null,u.createElement("span",{className:"rdt_filterBetweenSep"},n.betweenSeparatorText??"and"),u.createElement("input",{className:"rdt_filterInput",type:o,value:e.value2??"",placeholder:n.value2Placeholder??"Value",onChange:t=>i({...e,value2:t.target.value}),onKeyDown:e=>e.stopPropagation(),"aria-label":n.value2AriaLabel??"Filter second value"})),a&&u.createElement("button",{type:"button",className:"rdt_filterRemoveBtn",onClick:a,"aria-label":n.removeConditionAriaLabel??"Remove condition"},"✕"))}function Et({columnId:e,filterValue:t,filterType:n="text",options:i={},onFilterChange:a}){let[r,s]=u.useState(!1),[o,l]=u.useState(null),[c,d]=u.useState(()=>t??ft(n)),p=u.useRef(null),m=u.useRef(null),h=u.useRef(t);u.useEffect(()=>{h.current!==t&&(h.current=t,d(t??ft(n)))},[t,n]);let g=u.useRef(null);u.useEffect(()=>{if(r)return g.current?.querySelector("select, input, button")?.focus(),document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),window.addEventListener("scroll",n,!0),window.addEventListener("resize",i),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t),window.removeEventListener("scroll",n,!0),window.removeEventListener("resize",i)};function e(e){let t=e.target;p.current&&!p.current.contains(t)&&g.current&&!g.current.contains(t)&&s(!1)}function t(e){"Escape"===e.key&&s(!1)}function n(e){g.current&&e.target instanceof Node&&g.current.contains(e.target)||s(!1)}function i(){s(!1)}},[r]);let x=bt(t);function f(e){d(t=>({...t,logic:e}))}return u.createElement("div",{ref:p,className:"rdt_filterContainer"},u.createElement("button",{ref:m,type:"button",className:["rdt_filterIcon",x&&"rdt_filterIconActive"].filter(Boolean).join(" "),"aria-label":x?i.filterActiveAriaLabel??"Filter active":i.filterColumnAriaLabel??"Filter column","aria-pressed":r,onClick:e=>{e.stopPropagation(),function(){if(!r&&m.current){let e=m.current.getBoundingClientRect(),t=260,n=8,i=window.innerWidth-t-n,a=Math.min(Math.max(n,e.left),Math.max(n,i));l({top:e.bottom+4,left:a})}s(e=>!e)}()}},u.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},u.createElement("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})),x&&u.createElement("span",{className:"rdt_filterDot"})),r&&o&&u.createElement("div",{ref:g,className:"rdt_filterPanel",role:"dialog","aria-label":i.filterPanelAriaLabel??"Column filter",style:{position:"fixed",top:o.top,left:o.left}},u.createElement(Rt,{condition:c.condition1,filterType:n,options:i,onChange:function(e){d(t=>({...t,condition1:e}))}}),c.condition2?u.createElement(u.Fragment,null,u.createElement("div",{className:"rdt_filterLogicRow"},u.createElement("button",{type:"button",className:["rdt_filterLogicBtn","OR"!==c.logic&&"rdt_filterLogicBtnActive"].filter(Boolean).join(" "),"aria-pressed":"OR"!==c.logic,onClick:()=>f("AND")},i.andLabel??"AND"),u.createElement("button",{type:"button",className:["rdt_filterLogicBtn","OR"===c.logic&&"rdt_filterLogicBtnActive"].filter(Boolean).join(" "),"aria-pressed":"OR"===c.logic,onClick:()=>f("OR")},i.orLabel??"OR")),u.createElement(Rt,{condition:c.condition2,filterType:n,options:i,onChange:function(e){d(t=>({...t,condition2:e}))},onRemove:function(){d(e=>({condition1:e.condition1}))}})):u.createElement("button",{type:"button",className:"rdt_filterAddCondition","aria-label":i.addConditionAriaLabel??"Add a second filter condition",onClick:function(){d(e=>({...e,condition2:kt(n),logic:e.logic??"AND"}))}},i.addConditionLabel??"+ Add condition"),u.createElement("div",{className:"rdt_filterActions"},u.createElement("button",{type:"button",className:"rdt_filterBtn",onClick:function(){let t=ft(n);d(t),a(e,t),s(!1)}},i.clearLabel??"Clear"),u.createElement("button",{type:"button",className:"rdt_filterBtn rdt_filterBtnPrimary",onClick:function(){a(e,c),s(!1)}},i.applyLabel??"Apply"))))}function Nt(e,t,n,i){e.style.transform=`translate${n}(${t}px)`,e.style.transition="none",e.getBoundingClientRect(),e.style.transition=`transform ${i}s cubic-bezier(0.2, 0, 0, 1)`,e.style.transform="";let a=()=>{e.style.transform="",e.style.transition="",e.removeEventListener("transitionend",a)};e.addEventListener("transitionend",a)}function Pt(e,t){e.dataTransfer.effectAllowed="move";let n=e.currentTarget.getBoundingClientRect(),i=document.createElement("div");i.className="rdt_dragGhost";let a=document.createElement("span");a.className="rdt_dragGhostIcon",a.setAttribute("aria-hidden","true"),a.innerHTML='';let r=document.createElement("span");r.className="rdt_dragGhostLabel",r.textContent=t,i.appendChild(a),i.appendChild(r),i.style.width=`${n.width}px`,i.style.height=`${n.height}px`,document.body.appendChild(i),e.dataTransfer.setDragImage(i,e.clientX-n.left,e.clientY-n.top),setTimeout(()=>document.body.removeChild(i),0)}var Bt=u.memo(function({column:e,disabled:t,draggingColumnId:n,sorting:i,filterValue:a,filterLocalization:r,onFilterChange:s,columnDrag:o,resizedWidth:l,onResizeStart:c,pinnedOffsets:d,gridStyle:p,cellNavigation:m,activeCell:h,navCol:g,headerMenu:x}){let f=be(),{sortDirection:y,sortColumns:b,sortMulti:_,defaultSortDirection:v,sortIcon:w,sortServer:S,pagination:C,paginationServer:j,persistSelectedOnSort:k,selectableRowsVisibleOnly:R,onSort:E}=i,[N,P]=u.useState(!1),B=u.useRef(null);if(u.useEffect(()=>{B.current&&P(B.current.scrollWidth>B.current.clientWidth)},[N]),e.omit)return null;let D=t=>{!e.sortable&&!e.selector||E({type:"SORT_CHANGE",selectedColumn:e,additive:_&&t,defaultSortDirection:v,clearSelectedOnSort:C&&j&&!k||S||R})},T=b.findIndex(t=>Ye(t.column.id,e.id)),F=-1===T?void 0:b[T],I=F?F.sortDirection:y,M=e=>u.createElement(xt,{sortActive:e,sortDirection:I}),H=()=>u.createElement("span",{className:["rdt_sortIcon",L?"rdt_sortIconActive":"rdt_sortIconInactive","asc"===I&&"rdt_sortIconAsc","__rdt_custom_sort_icon__"].filter(Boolean).join(" ")},w),A=()=>_&&b.length>1&&-1!==T?u.createElement("span",{className:"rdt_sortPriority","aria-hidden":"true"},T+1):null,L=!(!e.sortable||-1===T),z=!e.sortable||t,O=m?m&&-1===h?.row&&h?.col===g?0:-1:z?-1:0,W=m?{"data-nav-row":-1,"data-nav-col":g}:void 0,U=e.sortable&&!w&&!e.right,G=e.sortable&&!w&&e.right,$=e.sortable&&w&&!e.right,q=e.sortable&&w&&e.right,K=Ye(e.id,n),V=et(e,d,2),J=null!=l?{width:`${l}px`,minWidth:`${l}px`,maxWidth:`${l}px`,flex:"none"}:void 0;return u.createElement(gt,{"data-column-id":e.id,className:["rdt_TableCol",V.className].filter(Boolean).join(" "),$headCell:!0,allowOverflow:e.allowOverflow,button:e.button,compact:e.compact,grow:null!=l?0:e.grow,hide:e.hide,maxWidth:null!=l?void 0:e.maxWidth,minWidth:null!=l?void 0:e.minWidth,right:e.right,center:e.center,width:null!=l?void 0:e.width,draggable:e.reorder,headStyle:f.headCells?.style,style:{...K?f.headCells?.draggingStyle:void 0,...J,...V.style,..."sticky"!==V.style.position&&{position:"relative"},...p},onDragStart:t=>{e.reorder&&"string"==typeof e.name&&Pt(t,e.name),o.onDragStart(t)},onDragOver:o.onDragOver,onDragEnd:o.onDragEnd,onDragEnter:o.onDragEnter,onDragLeave:o.onDragLeave,onPointerDown:e.reorder?o.onPointerDown:void 0,onContextMenu:x?.rightClick?t=>x.onContextMenu(e,t):void 0,...W,"data-nav-widget":m&&e.name?"true":void 0,...m&&!e.name?{role:"columnheader",tabIndex:O}:void 0},e.name&&u.createElement("div",{"data-column-id":e.id,"data-sort-id":e.id,role:"columnheader",tabIndex:O,className:["rdt_TableCol_Sortable","rdt_columnSortable",!z&&"rdt_columnSortableEnabled",!z&&L&&"rdt_columnSortableActive"].filter(Boolean).join(" "),onClick:z?void 0:e=>{D(e.ctrlKey||e.metaKey)},onKeyDown:z?void 0:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),D(e.ctrlKey||e.metaKey))},"aria-sort":z?void 0:L?"asc"===I?"ascending":"descending":"none"},!z&&q&&H(),!z&&G&&M(L),!z&&e.right&&A(),"string"==typeof e.name?u.createElement("div",{title:N?e.name:void 0,ref:B,"data-column-id":e.id,className:"rdt_columnText"},e.name):e.name,!z&&!e.right&&A(),!z&&$&&H(),!z&&U&&M(L)),e.filterable&&null!=e.id&&u.createElement(Et,{columnId:e.id,filterValue:a,filterType:e.filterType,options:r,onFilterChange:s}),x?.menuButton&&u.createElement("button",{type:"button",className:"rdt_kebabIcon","aria-label":x.ariaLabel,"aria-haspopup":"menu",onClick:t=>{t.stopPropagation(),x.onMenuButtonClick(e,t)},onPointerDown:e=>e.stopPropagation()},u.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},u.createElement("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}))),c&&null!=e.id&&u.createElement("div",{className:"rdt_resizeHandle",onPointerDown:t=>{t.stopPropagation(),c(e.id,t)},"aria-hidden":"true"}))},function(e,t){if(e.column!==t.column||e.headerMenu!==t.headerMenu||e.columnDrag!==t.columnDrag)return!1;if(e.sorting!==t.sorting){let n=e.sorting,i=t.sorting;if(n.sortMulti!==i.sortMulti||n.sortIcon!==i.sortIcon)return!1;let a=n.sortColumns.findIndex(t=>Ye(t.column.id,e.column.id)),r=i.sortColumns.findIndex(e=>Ye(e.column.id,t.column.id));if(a!==r||-1!==a&&n.sortColumns[a].sortDirection!==i.sortColumns[r].sortDirection||-1===a&&n.sortDirection!==i.sortDirection)return!1;if(n.sortMulti&&n.sortColumns.length!==i.sortColumns.length&&n.sortColumns.length>1!=i.sortColumns.length>1)return!1}if(e.draggingColumnId!==t.draggingColumnId&&Ye(e.column.id,e.draggingColumnId)!==Ye(t.column.id,t.draggingColumnId))return!1;if(e.filterValue!==t.filterValue||e.filterLocalization!==t.filterLocalization||e.resizedWidth!==t.resizedWidth||e.disabled!==t.disabled)return!1;if(e.pinnedOffsets!==t.pinnedOffsets){let n=t.column.id,i=e.pinnedOffsets?.left[n],a=t.pinnedOffsets?.left[n],r=e.pinnedOffsets?.right[n],s=t.pinnedOffsets?.right[n];if(i!==a||r!==s)return!1;let o=e.pinnedOffsets?Object.keys(e.pinnedOffsets.left).length:0,l=t.pinnedOffsets?Object.keys(t.pinnedOffsets.left).length:0,c=e.pinnedOffsets?Object.keys(e.pinnedOffsets.right).length:0,d=t.pinnedOffsets?Object.keys(t.pinnedOffsets.right).length:0;if(o!==l||c!==d)return!1}let n=e.gridStyle,i=t.gridStyle;return!(!(n===i||n&&i&&n.gridColumn===i.gridColumn&&n.gridRow===i.gridRow)||e.cellNavigation!==t.cellNavigation||e.navCol!==t.navCol)&&(!!e.cellNavigation&&-1===e.activeCell?.row&&e.activeCell?.col===e.navCol)==(!!t.cellNavigation&&-1===t.activeCell?.row&&t.activeCell?.col===t.navCol)}),Dt="input",Tt=u.memo(function({name:e,component:t=Dt,componentOptions:n={style:{}},indeterminate:i=!1,checked:a=!1,disabled:r=!1,onClick:s=$e,tabIndex:o}){let l=e=>{e&&(e.indeterminate=i)},c=u.useMemo(()=>function(e,...t){let n;for(let[i,a]of Object.entries(e))"function"==typeof a&&(n={...n??e,[i]:a(...t)});return n??e}(n,i),[n,i]);if(t!==Dt)return u.createElement(t,{type:"checkbox",ref:l,style:n.style,onClick:r?$e:s,name:e,"aria-label":e,checked:a,disabled:r,...c,...void 0!==o&&{tabIndex:o},onChange:$e});let d=["rdt_Checkbox",a&&"rdt_checked",i&&"rdt_indeterminate",r&&"rdt_disabled"].filter(Boolean).join(" ");return u.createElement("span",{className:d},u.createElement("input",{type:"checkbox",ref:l,onClick:r?$e:s,name:e,"aria-label":e,checked:a,disabled:r,tabIndex:o,onChange:$e}))}),Ft=u.createContext(null);function It(){let e=u.useContext(Ft);if(!e)throw new Error("useHeadContext must be used inside DataTable");return e}var Mt=function(){let{selectAll:e,cellNavigation:t,activeCell:n}=It();if(!e)return null;let{allSelected:i,selectedRows:a,visibleRows:r,disabled:s,keyField:o,mergeSelections:l}=e,c=a.length>0&&!i,d=s?r.filter(e=>!s(e)):r,p=0===d.length,m=Math.min(r.length,d.length),h=t&&-1===n?.row&&0===n?.col;return u.createElement(ht,{className:["rdt_TableCol","rdt_columnCheckbox"].join(" "),role:"columnheader",$headCell:!0,$noPadding:!0,tabIndex:t?-1:void 0,"data-nav-row":t?-1:void 0,"data-nav-col":t?0:void 0,"data-nav-widget":t?"true":void 0},u.createElement(Tt,{name:"Select all rows",component:e.component,componentOptions:e.componentProps,onClick:()=>{e.onSelectAllRows({type:"SELECT_ALL_ROWS",rows:d,rowCount:m,mergeSelections:l,keyField:o})},checked:i,indeterminate:c,disabled:p,tabIndex:t?h?0:-1:void 0}))},Ht=function(){let e=be();return u.createElement(ht,{className:"rdt_columnExpander",$noPadding:!0,style:e.expanderCell?.style})};function At(){return u.createElement("div",{"aria-hidden":"true",className:"rdt_rightPinSpacer",style:{flex:"1 1 auto",minWidth:0}})}var Lt=function({columns:e,columnGroups:t,selectableRows:n,expandableRows:i,expandableRowsHideExpander:a}){let{sorting:r,selectAll:s,fixedHeader:o,dense:l,draggingColumnId:c,draggingGroupKey:d,filtering:p,columnWidths:m,pinnedOffsets:h,resize:g,cellNavigation:x,activeCell:f,headerMenu:y,columnDrag:b}=It(),_={draggingGroupKey:d,onGroupDragStart:b.onGroupDragStart,onGroupDragEnter:b.onGroupDragEnter,onGroupDragOver:b.onGroupDragOver,onGroupDragEnd:b.onGroupDragEnd,onGroupPointerDown:b.onGroupPointerDown},v=e.filter(e=>!e.omit),w=t&&t.length>0,S=u.useRef(null),C=u.useRef(new Map),j=u.useRef(!1),k=u.useMemo(()=>v.map(e=>e.id).join(","),[v]),R=u.useMemo(()=>(t??[]).map(e=>e.columnIds[0]).join(","),[t]);at(()=>{let e=S.current;if(!e)return;let t=window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=j.current;j.current=!0;let i=(e,i)=>{let a=e.getBoundingClientRect().left,r=C.current.get(i);C.current.set(i,a),!(!n||t||null==r||Math.abs(r-a)<1)&&Nt(e,r-a,"X",.2)};e.querySelectorAll("[data-column-id]").forEach(e=>{i(e,`col:${e.dataset.columnId}`)}),e.querySelectorAll("[data-group-key]").forEach(e=>{i(e,`grp:${e.dataset.groupKey}`)});let a=C.current,r=j;return()=>{r.current=!1,a.clear()}},[k,R]);let E=u.useMemo(()=>{if(!t)return{};let e={};for(let n of t)e[String(n.name)]=n.columnIds.filter(e=>v.some(t=>String(t.id)===String(e))).length;return e},[t,v]),N=u.useMemo(()=>{if(!t)return new Set;let e=new Set([].concat(...t.map(e=>e.columnIds)).map(String));return new Set(v.map(e=>String(e.id)).filter(t=>!e.has(t)))},[t,v]),P=Ve(n,i,a),B=e=>({column:e,disabled:r.sortDisabled,sorting:r,filterValue:p.filterValues[e.id]??ft(e.filterType),filterLocalization:p.localization,resizedWidth:m[e.id],onFilterChange:p.onFilterChange,onResizeStart:g?.onResizeStart,pinnedOffsets:h,columnDrag:b,draggingColumnId:c,cellNavigation:x,activeCell:f,navCol:P+v.indexOf(e),headerMenu:y}),D=u.useMemo(()=>tt(e),[e]);if(w){let e=function(e,t,n){let i=[];for(let e=0;e{let n=P+t+1,i=N.has(String(e.id)),{resizedWidth:a,...r}=B(e);return u.createElement(Bt,{key:e.id,...r,gridStyle:{gridColumn:String(n),gridRow:i?"1 / span 2":"2"}})}),function(e,t,n,i,a,r){let s=[],o=0;for(;oe.columnIds.map(String).includes(c));if(e){let t=i[String(e.name)]??1,n=a+o+1,l=n+t,c=String(e.columnIds[0]),d=r?.draggingGroupKey===c;s.push(u.createElement("div",{key:c,className:["rdt_groupCell",e.reorder&&"rdt_groupCellReorder",d&&"rdt_groupCellDragging"].filter(Boolean).join(" "),draggable:e.reorder||void 0,"data-group-key":e.reorder?c:void 0,onDragStart:e.reorder?r?.onGroupDragStart:void 0,onDragEnter:e.reorder?r?.onGroupDragEnter:void 0,onDragOver:e.reorder?r?.onGroupDragOver:void 0,onDragEnd:e.reorder?r?.onGroupDragEnd:void 0,onPointerDown:e.reorder?r?.onGroupPointerDown:void 0,style:{gridColumn:`${n} / ${l}`,gridRow:"1",...d?{opacity:.5}:void 0,...e.align&&"center"!==e.align?{justifyContent:"right"===e.align?"flex-end":"flex-start"}:void 0}},e.reorder?u.createElement("span",{style:{pointerEvents:"none"}},e.name):e.name)),o+=t}else o++}}return s}(v,t,N,E,P,_)))}return u.createElement(pt,{className:"rdt_TableHead",role:"rowgroup",$fixedHeader:o},u.createElement(mt,{ref:S,className:"rdt_TableHeadRow",role:"row",$dense:l},n&&(s?.hideSelectAll?u.createElement(ht,{style:{flex:"0 0 var(--rdt-system-col-width, 48px)"}}):u.createElement(Mt,null)),i&&!a&&u.createElement(Ht,null),e.map(e=>u.createElement(u.Fragment,{key:e.id},null!=D&&e.id===D&&u.createElement(At,null),u.createElement(Bt,{...B(e)})))))},zt=u.forwardRef(function({className:e,...t},n){return u.createElement("div",{ref:n,className:["rdt_body",e].filter(Boolean).join(" "),...t})}),Ot=zt,Wt=u.createContext(null);function Ut(){let e=u.useContext(Wt);if(!e)throw new Error("useRowContext must be used inside DataTable");return e}var Gt=function({edit:e,row:t,column:n,cellNavigation:i}){let{editor:a,editing:r,editValue:s,setEditValue:o,editError:l,inputRef:c,seedValue:d,cancelEdit:p,commitEdit:m,handleInputKeyDown:h,handleCheckboxCommit:g}=e;return u.createElement(u.Fragment,null,r&&("text"===a?.type||"number"===a?.type||"date"===a?.type)&&u.createElement("input",{ref:c,type:"text"===a.type?void 0:a.type,className:"rdt_editInput",value:s,placeholder:"date"===a.type?void 0:a.placeholder,min:"text"===a.type?void 0:a.min,max:"text"===a.type?void 0:a.max,step:"number"===a.type?a.step:void 0,"aria-invalid":!!l,onChange:e=>o(e.target.value),onBlur:()=>m(),onKeyDown:h,onClick:e=>e.stopPropagation()}),"checkbox"===a?.type&&u.createElement("div",{className:"rdt_editCheckboxWrap",onClick:g,onKeyDown:e=>{(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),g(e))}},u.createElement("input",{type:"checkbox",className:"rdt_editCheckbox","aria-checked":"true"===d(),checked:"true"===d(),tabIndex:i?-1:void 0,onChange:g,onClick:e=>e.stopPropagation()})),r&&"select"===a?.type&&u.createElement("select",{ref:c,className:"rdt_editSelect",value:s,"aria-invalid":!!l,onChange:e=>{o(e.target.value),m(e.target.value)},onBlur:()=>m(),onKeyDown:h,onClick:e=>e.stopPropagation()},void 0!==a.placeholder&&u.createElement("option",{value:"",disabled:!0,hidden:!0},a.placeholder),a.options.map(e=>u.createElement("option",{key:e.value,value:e.value},"string"==typeof e.label||"number"==typeof e.label?e.label:e.value))),r&&"custom"===a?.type&&u.createElement("div",{className:"rdt_editCustomWrap",onClick:e=>e.stopPropagation()},a.render({row:t,value:s,setValue:o,commit:m,cancel:p,column:n})),l&&u.createElement("span",{className:"rdt_editErrorTip",role:"alert"},l))},$t=u.memo(function({id:e,column:t,row:n,rowIndex:i,navCol:a,dataTag:r,isDragging:s}){let o=be(),{columnDrag:l,columnWidths:c,pinnedOffsets:d,cellNavigation:p,activeCell:m}=Ut(),h=null!=t.id?c[t.id]:void 0,{conditionalStyle:g,classNames:x}=qe(n,t.conditionalCellStyles,["rdt_TableCell"]),f=function(e,t,n){let i=u.useMemo(()=>e.editor??(e.editable?{type:"text"}:void 0),[e.editor,e.editable]),[a,r]=u.useState(!1),[s,o]=u.useState(""),[l,c]=u.useState(null),d=u.useRef(null),p=u.useCallback(()=>{let i=e.selector?e.selector(t,n):void 0;return null==i?"":"boolean"==typeof i?i?"true":"false":String(i)},[e,t,n]),m=u.useCallback(()=>{i&&(o(p()),c(null),r(!0))},[i,p]);u.useEffect(()=>{a&&d.current?.focus()},[a]);let h=u.useCallback(()=>{r(!1),c(null)},[]),g=u.useCallback(n=>{let i=n??s;if(e.validate){let n=e.validate(i,t,e);if(!1===n)return void h();if("string"==typeof n)return c(n),void d.current?.focus()}r(!1),c(null),e.onCellEdit?.(t,i,e)},[e,t,s,h]);return{editor:i,editing:a,editValue:s,setEditValue:o,editError:l,inputRef:d,seedValue:p,startEdit:m,cancelEdit:h,commitEdit:g,handleInputKeyDown:e=>{"Enter"===e.key&&g(),"Escape"===e.key&&h()},handleCheckboxCommit:e=>{e.stopPropagation();let t="true"===p();g(t?"false":"true")}}}(t,n,i),{editor:y,editing:b,editError:_,startEdit:v,handleCheckboxCommit:w}=f,S=p&&null!=m&&m.row===i&&m.col===a,C=u.useRef(null),j=u.useRef(!1);u.useEffect(()=>{if(p&&S&&j.current&&!b){let e=C.current;e&&(document.activeElement===document.body||e.contains(document.activeElement))&&e.focus()}j.current=b},[p,S,b]);let k=et(t,d,1),R=y&&!b?"rdt_cellEditable":"",E=b?"rdt_cellEditing":"",N=_?"rdt_cellEditError":"";return u.createElement(gt,{ref:C,id:e,"data-column-id":t.id,role:p?"gridcell":"cell",className:[x,k.className,R,E,N].filter(Boolean).join(" "),"data-tag":r,button:t.button,center:t.center,compact:t.compact,hide:t.hide,right:t.right,...nt(t,h),cellStyle:o.cells?.style,style:{...t.style,...s?o.cells?.draggingStyle:void 0,...g,...k.style},draggable:t.reorder||void 0,onDragStart:t.reorder?l.onDragStart:void 0,onDragOver:t.reorder?l.onDragOver:void 0,onDragEnd:t.reorder?l.onDragEnd:void 0,onDragEnter:t.reorder?l.onDragEnter:void 0,onDragLeave:t.reorder?l.onDragLeave:void 0,tabIndex:p?S?0:-1:void 0,"data-nav-row":p?i:void 0,"data-nav-col":p?a:void 0,onKeyDown:p?e=>{if(!b){if(("Enter"===e.key||"F2"===e.key)&&y&&"checkbox"!==y.type)return e.preventDefault(),void v();" "===e.key&&"checkbox"===y?.type&&(e.preventDefault(),w(e))}}:void 0,onClick:y&&!b&&"checkbox"!==y.type?v:void 0},y&&u.createElement(Gt,{edit:f,row:n,column:t,cellNavigation:!!p}),!b&&"checkbox"!==y?.type&&u.createElement(u.Fragment,null,!t.cell&&u.createElement("div",{"data-tag":r,style:{whiteSpace:t.wrap?"normal":"nowrap",overflow:t.allowOverflow?"visible":"hidden",textOverflow:"ellipsis"}},function(e){return"bigint"==typeof e?e.toString():e instanceof Date?e.toLocaleString():e}(function(e,t,n,i){return t?n&&"function"==typeof n?n(e,i):t(e,i):null}(n,t.selector,t.format,i))),t.cell&&t.cell(n,i,t,e)))}),qt=function({name:e,keyField:t,row:n,rowCount:i,selected:a,selection:r,nav:s}){let{component:o,componentProps:l,single:c,disabled:d,range:p,onSelectedRow:m,onSelectedRange:h,visibleRowsRef:g,lastSelectedKeyRef:x}=r,f=!(!d||!d(n)),y=Me(n,t);return u.createElement(ht,{onClick:e=>e.stopPropagation(),className:["rdt_TableCell","rdt_cellCheckbox"].join(" "),role:s?"gridcell":"cell",$noPadding:!0,tabIndex:s?-1:void 0,"data-nav-row":s?.row,"data-nav-col":s?.col,"data-nav-widget":s?"true":void 0},u.createElement(Tt,{name:e,component:o,componentOptions:l,checked:a,"aria-checked":a,onClick:e=>{let r=e?.nativeEvent,s=!(!r||!("shiftKey"in r))&&r.shiftKey,o=x.current;if(s&&p&&!c&&null!=o&&null!=y&&o!==y){let e=g.current,n=e.findIndex(e=>Me(e,t)===o),r=e.findIndex(e=>Me(e,t)===y);if(-1!==n&&-1!==r){let[s,o]=nd(e)):void 0;return h({type:"SELECT_RANGE",keyField:t,rangeRows:l,rowCount:i,select:c,disabledRows:p}),void(x.current=y)}}m({type:"SELECT_SINGLE_ROW",row:n,isSelected:a,keyField:t,rowCount:i,singleSelect:c}),He(y)||(x.current=y)},disabled:f,tabIndex:s?s.active?0:-1:void 0}))},Kt=function({disabled:e=!1,expanded:t=!1,expandableIcon:n,expandableRowsOptions:i,id:a,row:r,onToggled:s,tabIndex:o}){let l=be(),c=t?n.expanded:n.collapsed;return u.createElement("button",{className:"rdt_expanderButton",style:l.expanderButton?.style,"aria-disabled":e,onClick:()=>s&&s(r),"data-testid":`expander-button-${a}`,disabled:e,tabIndex:o,"aria-label":t?i?.collapseRowAriaLabel??"Collapse Row":i?.expandRowAriaLabel??"Expand Row",type:"button"},c)},Vt=function({row:e,expanded:t=!1,expandableIcon:n,expandableRowsOptions:i,id:a,onToggled:r,disabled:s=!1,nav:o}){let l=be();return u.createElement(ht,{onClick:e=>e.stopPropagation(),className:"rdt_cellExpander",$noPadding:!0,style:l.expanderCell?.style,role:o?"gridcell":void 0,tabIndex:o?-1:void 0,"data-nav-row":o?.row,"data-nav-col":o?.col,"data-nav-widget":o?"true":void 0},u.createElement(Kt,{id:a,row:e,expanded:t,expandableIcon:n,expandableRowsOptions:i,disabled:s,onToggled:r,tabIndex:o?o.active?0:-1:void 0}))},Jt=u.memo(function({data:e,ExpanderComponent:t,expanderComponentProps:n,extendedRowStyle:i,extendedClassNames:a,animate:r,closing:s}){let o=be(),l=["rdt_ExpanderRow","rdt_expanderRow",...a.split(" ").filter(e=>"rdt_TableRow"!==e)].join(" ");return u.createElement("div",{className:r?s?"rdt_expanderRowAnimated rdt_expanderRowClosing":"rdt_expanderRowAnimated":void 0},u.createElement("div",{className:l,style:{...o.expanderRow?.style,...i}},u.createElement(t,{data:e,...n})))});function Yt(e,t){switch(t.type){case"open":return{expanded:!0,mounted:!0,closing:!1};case"close":return{...e,expanded:!1,closing:!0};case"unmount":return{expanded:!1,mounted:!1,closing:!1};case"sync":return{expanded:t.value,mounted:t.value,closing:!1};default:return e}}function Xt(e){return e.target.getAttribute("data-tag")===Pe}var Qt=u.memo(function({defaultExpanded:e=!1,defaultExpanderDisabled:t=!1,draggingColumnId:n,id:i,isNew:a,newRowIndex:r,row:s,rowCount:o,rowIndex:l,selected:c}){let d=be(),{columns:p,conditionalRowStyles:m,dense:h,expansion:g,highlightOnHover:x,keyField:f,rowEvents:y,selection:b,pointerOnHover:_,striped:v,cellNavigation:w,activeCell:S,animateRows:C,rowMenu:j}=Ut(),{expanded:k,expanderMounted:R,isClosing:E,openExpander:N,closeExpander:P}=function(e,t){let[n,i]=u.useReducer(Yt,{expanded:e,mounted:e,closing:!1});u.useEffect(()=>{i({type:"sync",value:e})},[e]);let a=u.useRef(null),r=u.useCallback(()=>{a.current&&clearTimeout(a.current),i({type:"open"})},[]),s=u.useCallback(()=>{t?(i({type:"close"}),a.current=setTimeout(()=>{i({type:"unmount"})},220)):i({type:"unmount"})},[t]);return{expanded:n.expanded,expanderMounted:n.mounted,isClosing:n.closing,openExpander:r,closeExpander:s}}(e,C),B=!!b,D=!!g,T=!!g?.expandOnRowClicked,F=!!g?.expandOnRowDoubleClicked,I=!!g?.hideExpander,M=g?.onToggled,H=u.useCallback(()=>{let e=!k;M?.(e,s),e?N():P()},[k,M,s,N,P]),{onRowClicked:A,onRowDoubleClicked:L,onRowMiddleClicked:z,onRowMouseEnter:O,onRowMouseLeave:W}=y,U=_||D&&(T||F),G=u.useCallback(e=>{Xt(e)&&(A(s,e),!t&&D&&T&&H())},[t,T,D,H,A,s]),$=u.useCallback(e=>{e.target===e.currentTarget&&"Enter"===e.key&&(!t&&D&&T&&H(),A(s,e))},[t,D,T,H,A,s]),q=u.useCallback(e=>{Xt(e)&&(L(s,e),!t&&D&&F&&H())},[t,F,D,H,L,s]),K=u.useCallback(e=>{Xt(e)&&z(s,e)},[z,s]),V=j?.onContextMenu,J=u.useCallback(e=>V?.(s,l,e),[V,s,l]),Y=u.useCallback(e=>O(s,e),[O,s]),X=u.useCallback(e=>W(s,e),[W,s]),Q=Me(s,f)??l,Z=Ve(B,D,I),ee=u.useMemo(()=>{let e=new Map,t=0;for(let n of p)n.omit||e.set(n,t++);return e},[p]),te=w&&S?.row===l,ne=u.useMemo(()=>tt(p),[p]),{conditionalStyle:ie,classNames:ae}=u.useMemo(()=>qe(s,m,["rdt_TableRow"]),[s,m]),re=!!b?.highlight&&c,se=g?.inheritConditionalStyles?ie:{},oe=v&&function(e){return e%2==0}(l),le=C&&a,ce=[ae,"rdt_row",h&&"rdt_rowDense",oe&&"rdt_rowStriped",re&&"rdt_rowSelected",x&&"rdt_rowHighlight",!t&&U&&"rdt_rowPointer",le&&"rdt_animatedRow"].filter(Boolean).join(" "),de={...d.rows?.style,...h&&d.rows?.denseStyle,...oe&&d.rows?.stripedStyle,...re&&d.rows?.selectedHighlightStyle,...ie,...le?{"--rdt-row-index":r}:null};return u.createElement(u.Fragment,null,u.createElement("div",{id:`row-${i}`,role:"row","aria-selected":B?c:void 0,tabIndex:w?-1:!t&&U?0:-1,className:ce,style:de,onClick:G,onKeyDown:$,onDoubleClick:q,onAuxClick:K,onContextMenu:j?.rightClick?J:void 0,onMouseEnter:Y,onMouseLeave:X},b&&u.createElement(qt,{name:`Select row ${Q}`,keyField:f,row:s,rowCount:o,selected:c,selection:b,nav:w?{row:l,col:0,active:te&&0===S?.col}:void 0}),g&&!g.hideExpander&&u.createElement(Vt,{id:Q,expandableIcon:g.icon,expandableRowsOptions:g.localization,expanded:k,row:s,onToggled:H,disabled:t,nav:w?{row:l,col:B?1:0,active:te&&S?.col===(B?1:0)}:void 0}),p.map(e=>e.omit?null:u.createElement(u.Fragment,{key:`cell-${e.id}-${Q}`},null!=ne&&e.id===ne&&u.createElement(At,null),u.createElement($t,{id:`cell-${e.id}-${Q}`,dataTag:e.ignoreRowClick||e.button?null:Pe,column:e,row:s,rowIndex:l,navCol:Z+(ee.get(e)??0),isDragging:Ye(n,e.id)}))),j?.menuButton&&u.createElement("div",{className:"rdt_rowKebabCell"+("start"===j.menuButtonPosition?" rdt_rowKebabStart":"")},u.createElement("button",{type:"button",className:"rdt_kebabIcon rdt_rowKebab","aria-label":j.ariaLabel,"aria-haspopup":"menu",onClick:e=>{e.stopPropagation(),j.onMenuButtonClick(s,l,e)}},u.createElement("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},u.createElement("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}))))),g&&R&&g.component&&u.createElement(Jt,{key:`expander-${Q}`,data:s,extendedRowStyle:se,extendedClassNames:ae,ExpanderComponent:g.component,expanderComponentProps:g.componentProps??{},animate:C,closing:E}))},function(e,t){return!(e.row!==t.row||e.selected!==t.selected||e.defaultExpanded!==t.defaultExpanded||e.defaultExpanderDisabled!==t.defaultExpanderDisabled||e.draggingColumnId!==t.draggingColumnId||e.rowCount!==t.rowCount||e.rowIndex!==t.rowIndex||e.isNew!==t.isNew||e.newRowIndex!==t.newRowIndex)});function Zt({style:e,...t}){let n=be();return u.createElement("div",{role:"status",className:"rdt_noData",style:{...n.noData?.style,...e},...t})}function en({basis:e}){return u.createElement("div",{className:"rdt_cellBase",style:{flex:`1 1 ${e}`,minWidth:0,padding:"8px 16px",display:"flex",alignItems:"center"}},u.createElement("div",{className:"rdt_skeletonPulse",style:{height:14,borderRadius:4,width:"70%"}}))}function tn({colCount:e,index:t}){return u.createElement("div",{className:"rdt_row","aria-hidden":"true",style:{opacity:1-.15*t,minHeight:48}},Array.from({length:e}).map((e,t)=>u.createElement(en,{key:t,basis:0===t?"160px":"120px"})))}var nn=function({tableRows:e,sortedData:t,selectedRows:n,keyField:i,isBusy:a,columnCount:r,noDataComponent:s,progressComponent:o,expandableRowExpanded:l,expandableRowDisabled:c,bodyRef:d,prevRowTopsRef:p}){let{expansion:m,animateRows:h}=Ut(),g=t.length>0,x=u.useMemo(()=>new Set(n.map(e=>Me(e,i))),[n,i]),[f,y]=u.useReducer(()=>!0,!1);u.useEffect(()=>{y()},[]);let b=u.useMemo(()=>new Set,[i]),_=u.useRef(b);at(()=>{_.current=b},[b]);let[,v]=u.useReducer(e=>e+1,0);at(()=>{if(!h||!f)return void(p.current=new Map);let e=window.matchMedia("(prefers-reduced-motion: reduce)").matches,t=d.current;if(!t)return;let n=p.current;if(0===n.size)return;let i=!1;t.querySelectorAll('[id^="row-"]').forEach(t=>{let a=t.id.slice(4),r=t.getBoundingClientRect().top,s=n.get(a);if(null==s)return _.current.delete(a),void(i=!0);e||Math.abs(s-r)<1||Nt(t,s-r,"Y",.22)}),p.current=new Map,i&&v()},[e]);let w=u.useMemo(()=>{let t=0;return e.map((e,a)=>{let r=Me(e,i),s=He(r)?a:r,o=He(r)?n.includes(e):x.has(r),l=h&&f&&!b.has(s);return{row:e,id:s,selected:o,isNew:l,newRowIndex:l?Math.min(t++,10):0}})},[e,i,n,x,h,f,b]);return u.useEffect(()=>{if(h)for(let e of w)e.isNew&&_.current.add(e.id)},[w,h]),u.createElement(u.Fragment,null,!g&&!a&&u.createElement(Zt,null,s),a&&!g&&u.createElement(Ot,{className:"rdt_TableBody",role:"rowgroup"},Array.from({length:5}).map((e,t)=>u.createElement(tn,{key:t,colCount:r,index:t}))),g&&u.createElement("div",{style:{position:"relative"}},u.createElement(Ot,{ref:d,className:"rdt_TableBody"+(a?" rdt_bodyBusy":""),role:"rowgroup"},w.map((e,n)=>{let{row:i,id:a,selected:r,isNew:s,newRowIndex:o}=e,d=!!(m&&l&&l(i)),p=!!(m&&c&&c(i));return u.createElement(Qt,{id:a,key:a,"data-row-id":a,row:i,rowCount:t.length,rowIndex:n,selected:r,isNew:s,newRowIndex:o,defaultExpanded:d,defaultExpanderDisabled:p})})),a&&u.createElement("div",{className:"rdt_bodyOverlay","aria-hidden":"true"},o)))},an=u.memo(function({Pagination:e,onChangePage:t,onChangeRowsPerPage:n,rowCount:i,currentPage:a,rowsPerPage:r,direction:s,paginationRowsPerPageOptions:o,paginationIcons:l,paginationComponentOptions:c,localization:d,position:p}){let m="1px solid var(--rdt-color-divider, rgba(0, 0, 0, 0.12))";return u.createElement("div",{style:"top"===p?{borderBottom:m}:{borderTop:m}},u.createElement(e,{onChangePage:t,onChangeRowsPerPage:n,rowCount:i,currentPage:a,rowsPerPage:r,direction:s,paginationRowsPerPageOptions:o,paginationIcons:l,paginationComponentOptions:c,localization:d}))}),rn=function({columns:e,rows:t,selectableRows:n,expandableRows:i,expandableRowsHideExpander:a,footerComponent:r}){let s=be(),{columnWidths:o,pinnedOffsets:l,cellNavigation:c}=Ut(),d=u.useMemo(()=>tt(e),[e]),p={...s.footer?.style};return r?u.createElement("div",{role:"rowgroup",className:"rdt_footer",style:p},u.createElement(r,{rows:t,columns:e})):u.createElement("div",{role:"rowgroup",className:"rdt_footer",style:p},u.createElement("div",{role:"row",className:"rdt_footerRow"},n&&u.createElement("div",{"aria-hidden":"true",className:"rdt_cellBase rdt_footerSystemCell"}),i&&!a&&u.createElement("div",{"aria-hidden":"true",className:"rdt_cellBase rdt_footerSystemCell"}),e.map(e=>{if(e.omit)return null;let n=null!=e.id?o[e.id]:void 0,i=et(e,l,1);return u.createElement(u.Fragment,{key:`footer-${e.id}`},null!=d&&e.id===d&&u.createElement(At,null),u.createElement(gt,{role:c?"gridcell":"cell","data-column-id":e.id,className:["rdt_footerCell",i.className].filter(Boolean).join(" "),button:e.button,center:e.center,compact:e.compact,hide:e.hide,right:e.right,...nt(e,n),cellStyle:s.footerCells?.style,style:{...e.style,...i.style}},function(e,t){return null==e?null:"function"==typeof e?e(t):e}(e.footer,t)))})))};function sn({scrollRef:e,leftInset:t,rightInset:n}){let i=u.useId(),a=u.useRef(null),r=u.useRef(null),[s,o]=u.useState(0),[l,c]=u.useState(0),[d,p]=u.useState(!1),[m,h]=u.useState(0),g=u.useRef(!1),x=u.useRef(0),f=u.useRef(0),y=u.useCallback(()=>{let t=e.current;if(!t)return;let{scrollWidth:n,clientWidth:i,scrollLeft:r}=t,s=n>i;if(p(s),!s)return;let l=a.current?.clientWidth??0;if(0===l)return;let d=i/n,u=Math.max(d*l,30),m=l-u,g=n-i,x="rtl"===getComputedStyle(t).direction,f=x?r+g:r;o(u),c(f/g*m);let y=x?-r:r;h(g>0?Math.round(y/g*100):0)},[e]);u.useEffect(()=>{let t=e.current;if(!t)return;t.id||(t.id=i),t.addEventListener("scroll",y,{passive:!0});let n=new ResizeObserver(y);return n.observe(t),t.firstElementChild&&n.observe(t.firstElementChild),y(),()=>{t.removeEventListener("scroll",y),n.disconnect()}},[e,i,y]);let b=u.useCallback(t=>{t.preventDefault();let n=e.current;if(!n)return;g.current=!0,x.current=t.clientX,f.current=n.scrollLeft;let i=e=>{if(!g.current)return;let t=a.current;if(!n||!t)return;let{scrollWidth:i,clientWidth:r}=n,s=t.clientWidth,o=s-Math.max(r/i*s,30),l=i-r,c=(e.clientX-x.current)/o*l,d="rtl"===getComputedStyle(n).direction,p=d?-l:0,u=d?0:l;n.scrollLeft=Math.max(p,Math.min(u,f.current+c))},r=()=>{g.current=!1,window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",r)};window.addEventListener("mousemove",i),window.addEventListener("mouseup",r)},[e]),_=u.useCallback(t=>{let n=e.current;if(!n)return;let i=.1*n.clientWidth;"ArrowLeft"===t.key?(t.preventDefault(),n.scrollLeft-=i):"ArrowRight"===t.key?(t.preventDefault(),n.scrollLeft+=i):"Home"===t.key?(t.preventDefault(),n.scrollLeft=0):"End"===t.key&&(t.preventDefault(),n.scrollLeft="rtl"===getComputedStyle(n).direction?-n.scrollWidth:n.scrollWidth)},[e]),v=u.useCallback(t=>{let n=r.current;if(n&&n.contains(t.target))return;let i=e.current,s=a.current;if(!i||!s)return;let o=s.getBoundingClientRect(),c=t.clientX-o.left,{scrollWidth:d,clientWidth:p}=i,u=c0&&t.every(e=>e.startsWith("--"))}function pn(e){return e&&"string"!=typeof e?dn(e)?cn.default:Ie(cn.default,e):cn[e]??cn.default}var un=(e,t)=>{let n=u.useRef(!0);u.useEffect(()=>{n.current?n.current=!1:e()},t)},mn={column:"data-column-id",group:"data-group-key"};function hn(e,t){let n=!e.toggleOnSelectedRowsChange;switch(t.type){case"SELECT_ALL_ROWS":{let{keyField:n,rows:i,rowCount:a,mergeSelections:r}=t,s=!e.allSelected,o=!e.toggleOnSelectedRowsChange;if(r){let t=s?[...e.selectedRows,...i.filter(t=>!Ke(t,e.selectedRows,n))]:e.selectedRows.filter(e=>!Ke(e,i,n));return{...e,allSelected:s,selectedCount:t.length,selectedRows:t,toggleOnSelectedRowsChange:o}}return{...e,allSelected:s,selectedCount:s?a:0,selectedRows:s?i:[],toggleOnSelectedRowsChange:o}}case"SELECT_SINGLE_ROW":{let{keyField:i,row:a,isSelected:r,rowCount:s,singleSelect:o}=t;return o?r?{...e,selectedCount:0,allSelected:!1,selectedRows:[],toggleOnSelectedRowsChange:n}:{...e,selectedCount:1,allSelected:!1,selectedRows:[a],toggleOnSelectedRowsChange:n}:r?{...e,selectedCount:e.selectedRows.length>0?e.selectedRows.length-1:0,allSelected:!1,selectedRows:Oe(e.selectedRows,a,i),toggleOnSelectedRowsChange:n}:{...e,selectedCount:e.selectedRows.length+1,allSelected:e.selectedRows.length+1===s,selectedRows:ze(e.selectedRows,a),toggleOnSelectedRowsChange:n}}case"SELECT_RANGE":{let i,{keyField:a,rangeRows:r,rowCount:s,select:o,disabledRows:l}=t,c=l&&l.length>0?new Set(l):null,d=c?r.filter(e=>!c.has(e)):r;return i=o?[...e.selectedRows,...d.filter(t=>!Ke(t,e.selectedRows,a))]:e.selectedRows.filter(e=>!Ke(e,d,a)),{...e,selectedRows:i,selectedCount:i.length,allSelected:i.length===s&&s>0,toggleOnSelectedRowsChange:n}}case"SELECT_MULTIPLE_ROWS":{let{keyField:i,selectedRows:a,totalRows:r,mergeSelections:s}=t;if(s){let t=[...e.selectedRows,...a.filter(t=>!Ke(t,e.selectedRows,i))];return{...e,selectedCount:t.length,allSelected:!1,selectedRows:t,toggleOnSelectedRowsChange:n}}return{...e,selectedCount:a.length,allSelected:a.length===r,selectedRows:a,toggleOnSelectedRowsChange:n}}case"CLEAR_SELECTED_ROWS":{let{selectedRowsFlag:n}=t;return{...e,allSelected:!1,selectedCount:0,selectedRows:[],selectedRowsFlag:n}}case"CLEAR_SORT":{let{defaultSortColumn:n,defaultSortDirection:i}=t,a=null!=n.id||!!n.selector;return{...e,selectedColumn:n,sortDirection:i,sortColumns:a?[{column:n,sortDirection:i}]:[]}}case"SORT_CHANGE":{let i,{selectedColumn:a,clearSelectedOnSort:r,additive:s,defaultSortDirection:o,direction:l}=t,c=o,d="asc"===c?"desc":"asc",p=e.sortColumns.findIndex(e=>Ye(e.column.id,a.id));i=l?s?-1===p?[...e.sortColumns,{column:a,sortDirection:l}]:e.sortColumns.map((e,t)=>t===p?{column:a,sortDirection:l}:e):[{column:a,sortDirection:l}]:s?-1===p?[...e.sortColumns,{column:a,sortDirection:c}]:e.sortColumns[p].sortDirection===c?e.sortColumns.map((e,t)=>t===p?{column:a,sortDirection:d}:e):e.sortColumns.filter((e,t)=>t!==p):1===e.sortColumns.length&&0===p?e.sortColumns[0].sortDirection===c?[{column:a,sortDirection:d}]:[]:[{column:a,sortDirection:c}];let u=i[0];return{...e,selectedColumn:u?u.column:{},sortDirection:u?u.sortDirection:o,sortColumns:i,currentPage:1,sortTriggeredPageReset:!0,...r&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n}}}case"CHANGE_PAGE":{let{page:i,paginationServer:a,visibleOnly:r,persistSelectedOnPageChange:s}=t;return{...e,currentPage:i,sortTriggeredPageReset:!1,...a&&s&&{allSelected:!1},...(a&&!s||r)&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n}}}case"CHANGE_ROWS_PER_PAGE":{let{rowsPerPage:n,page:i}=t;return{...e,currentPage:i,rowsPerPage:n,sortTriggeredPageReset:!1}}default:return t}}function gn(){if(typeof window>"u")return!1;let e=localStorage.getItem("theme");return e?"dark"===e:document.documentElement.classList.contains("dark")||window.matchMedia("(prefers-color-scheme: dark)").matches}var xn=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Home","End"];function fn({groups:e,position:t,anchorRect:n,isRTL:i,ariaLabel:a,onSelect:r,onClose:s}){let o=u.useRef(null);at(()=>{let e=o.current;if(!e)return;let a=e.getBoundingClientRect(),r=n?i?n.right-a.width:n.left:t.x,s=n?n.bottom+4:t.y;if(r+a.width>window.innerWidth-8&&(r=window.innerWidth-a.width-8),r=Math.max(8,r),s+a.height>window.innerHeight-8){let e=(n?n.top-4:t.y)-a.height;s=e>=8?e:Math.max(8,window.innerHeight-a.height-8)}e.style.left=`${r}px`,e.style.top=`${s}px`,e.style.visibility="visible"},[t,n,i]),u.useEffect(()=>{function e(e){o.current&&!o.current.contains(e.target)&&s(!1)}function t(e){o.current&&e.target instanceof Node&&o.current.contains(e.target)||s(!1)}function n(){s(!1)}return o.current?.querySelector('[role="menuitem"]:not([aria-disabled="true"])')?.focus(),document.addEventListener("pointerdown",e),window.addEventListener("scroll",t,!0),window.addEventListener("resize",n),()=>{document.removeEventListener("pointerdown",e),window.removeEventListener("scroll",t,!0),window.removeEventListener("resize",n)}},[s]);let l=e.filter(e=>e.length>0);return u.createElement("div",{ref:o,className:"rdt_contextMenu",role:"menu","aria-label":a,tabIndex:-1,style:{position:"fixed",top:t.y,left:t.x,visibility:"hidden"},onKeyDown:e=>{if("Escape"===e.key)return e.stopPropagation(),void s(!0);if("Tab"===e.key)return void s(!1);if("ArrowDown"!==e.key&&"ArrowUp"!==e.key&&"Home"!==e.key&&"End"!==e.key)return;e.preventDefault();let t=Array.from(o.current?.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')??[]);if(0===t.length)return;let n,i=t.indexOf(document.activeElement);n="Home"===e.key?0:"End"===e.key?t.length-1:"ArrowDown"===e.key?-1===i?0:(i+1)%t.length:i<=0?t.length-1:i-1,t[n].focus()},onContextMenu:e=>e.preventDefault()},l.map((e,t)=>u.createElement(u.Fragment,{key:t},t>0&&u.createElement("div",{className:"rdt_contextMenuSeparator",role:"separator"}),e.map(e=>u.createElement("button",{key:e.id,type:"button",role:"menuitem",className:"rdt_contextMenuItem",tabIndex:-1,disabled:e.disabled,"aria-disabled":e.disabled||void 0,onClick:()=>r(e)},e.icon&&u.createElement("span",{className:"rdt_contextMenuItemIcon","aria-hidden":"true"},e.icon),e.label)))))}var yn=u.forwardRef(function(e,t){let{data:n=lt.data,columns:i=lt.columns,title:a=lt.title,actions:r=lt.actions,keyField:s=lt.keyField,striped:o=lt.striped,highlightOnHover:l=lt.highlightOnHover,pointerOnHover:c=lt.pointerOnHover,dense:d=lt.dense,selectableRows:p=lt.selectableRows,selectableRowsSingle:m=lt.selectableRowsSingle,selectableRowsHighlight:h=lt.selectableRowsHighlight,selectableRowsNoSelectAll:g=lt.selectableRowsNoSelectAll,selectableRowsVisibleOnly:x=lt.selectableRowsVisibleOnly,selectableRowsRange:f=!0,selectableRowSelected:y=lt.selectableRowSelected,selectableRowDisabled:b=lt.selectableRowDisabled,selectableRowsComponent:_,selectableRowsComponentProps:v,selectedRows:w,onRowExpandToggled:S=lt.onRowExpandToggled,onSelectedRowsChange:C=lt.onSelectedRowsChange,onChangeRowsPerPage:j=lt.onChangeRowsPerPage,onChangePage:k=lt.onChangePage,paginationServer:R=lt.paginationServer,paginationServerOptions:E=lt.paginationServerOptions,paginationTotalRows:N=lt.paginationTotalRows,paginationDefaultPage:P=lt.paginationDefaultPage,paginationPage:B,paginationResetDefaultPage:D=lt.paginationResetDefaultPage,paginationPerPage:T=lt.paginationPerPage,paginationPosition:F=lt.paginationPosition,paginationRowsPerPageOptions:I=lt.paginationRowsPerPageOptions,paginationComponent:M=lt.paginationComponent,paginationComponentOptions:H=lt.paginationComponentOptions,responsive:A=lt.responsive,progressPending:L=lt.progressPending,progressComponent:z=lt.progressComponent,persistTableHead:O=lt.persistTableHead,noDataComponent:W=lt.noDataComponent,disabled:U=lt.disabled,noTableHead:G=lt.noTableHead,noHeader:$=lt.noHeader,fixedHeader:q=lt.fixedHeader,fixedHeaderScrollHeight:K=lt.fixedHeaderScrollHeight,pagination:V=lt.pagination,subHeader:J=lt.subHeader,subHeaderAlign:Y=lt.subHeaderAlign,subHeaderWrap:X=lt.subHeaderWrap,expandableRows:Q=lt.expandableRows,onRowClicked:Z=lt.onRowClicked,onRowDoubleClicked:ee=lt.onRowDoubleClicked,onRowMiddleClicked:te=lt.onRowMiddleClicked,onRowMouseEnter:ne=lt.onRowMouseEnter,onRowMouseLeave:ie=lt.onRowMouseLeave,onScroll:ae,onSort:re=lt.onSort,sortFunction:se=lt.sortFunction,sortServer:oe=lt.sortServer,sortMulti:le=lt.sortMulti,expandableRowsComponent:ce=lt.expandableRowsComponent,expandableRowsComponentProps:de=lt.expandableRowsComponentProps,expandableRowDisabled:pe=lt.expandableRowDisabled,expandableRowsHideExpander:ue=lt.expandableRowsHideExpander,expandOnRowClicked:me=lt.expandOnRowClicked,expandOnRowDoubleClicked:he=lt.expandOnRowDoubleClicked,expandableRowExpanded:ge=lt.expandableRowExpanded,expandableInheritConditionalStyles:xe=lt.expandableInheritConditionalStyles,defaultSortFieldId:fe=lt.defaultSortFieldId,defaultSortAsc:be=lt.defaultSortAsc,conditionalRowStyles:we=lt.conditionalRowStyles,theme:Ce=lt.theme,colorMode:Re=lt.colorMode,customStyles:Ee=lt.customStyles,direction:Ne=lt.direction,onColumnOrderChange:Pe=lt.onColumnOrderChange,onColumnGroupOrderChange:Be,columnGroups:De,filterValues:Te,onFilterChange:Fe,contextMenu:Me,contextMenuActions:He,onContextMenuAction:ze,localization:Oe,columnFilterOptions:$e,expandableRowsOptions:qe,resizable:Ke=!1,initialColumnWidths:et,onColumnResize:tt,animateRows:nt=!1,cellNavigation:ct=!1,columnSeparator:pt,headerSeparator:ut,footerComponent:mt,showFooter:ht,className:gt,ariaLabel:xt}=e,wt=u.useMemo(()=>({...Oe,filter:{...$e,...Oe?.filter},expandable:{...qe,...Oe?.expandable},contextMenu:Oe?.contextMenu??{}}),[Oe,$e,qe]),{sortIcon:St,expandableIcon:Ct,paginationIcons:jt,clearSelectedRows:kt=lt.clearSelectedRows}=e,Rt=u.useMemo(()=>pn(Ce),[Ce]),Et=St??Rt.icons?.sort??null,Nt=u.useMemo(()=>({...ot,...Rt.icons?.expandable,...Ct}),[Rt,Ct]),Bt={...st,...Rt.icons?.pagination,...jt},Dt=_??lt.selectableRowsComponent,Tt=v??lt.selectableRowsComponentProps;u.useEffect(()=>{p&&n.length>0&&void 0===n[0][s]&&console.warn(`DataTable: keyField "${s}" returned undefined for your data. Row selection requires a stable unique identifier — set the keyField prop to the unique identifier field in your row data.`)},[]);let It=u.useId(),{filterValues:Mt,handleFilterChange:Ht,filteredData:At,filtering:zt}=function(e,t,n,i=vt){let[a,r]=u.useState({}),s=t??a,o=u.useCallback((e,t)=>{n?n(e,t):r(n=>({...n,[e]:t}))},[n]),l=u.useMemo(()=>Object.entries(s).filter(([,e])=>bt(e)),[s]),c=u.useCallback(t=>0===l.length?t:t.filter(t=>l.every(([n,i])=>{let a=e.find(e=>String(e.id)===n);return!a||function(e,t,n){let i=n.filterType??"text";if(n.filterFunction)return n.filterFunction(e,t);let a=n.selector?n.selector(e):"",r=String(a??""),s=_t(t.condition1,r,i);if(t.condition2&&yt(t.condition2)){let e=_t(t.condition2,r,i);return"OR"===t.logic?s||e:s&&e}return s}(t,i,a)})),[l,e]),d=u.useMemo(()=>({filterValues:s,localization:i,onFilterChange:o}),[s,i,o]);return{filterValues:s,handleFilterChange:o,filteredData:c,filtering:d}}(i,Te,Fe,wt.filter),Ot=rt(Ne),{columnWidths:Ut,handleResizeStart:Gt}=function({initialColumnWidths:e,onColumnResize:t,isRTL:n=!1}={}){let[i,a]=u.useState(e??{}),r=u.useRef(null),s=u.useRef(t),o=u.useRef(n);at(()=>{s.current=t,o.current=n});let l=u.useCallback((e,t)=>{if(typeof document>"u")return;t.preventDefault();let n=t.currentTarget.closest("[data-column-id]")?.offsetWidth??100;function i(e){if(!r.current)return;let{columnId:t}=r.current,n=(e.clientX-r.current.startX)*(o.current?-1:1),i=Math.max(40,r.current.startWidth+n);a(e=>({...e,[t]:i}))}r.current={columnId:e,startX:t.clientX,startWidth:n},document.addEventListener("pointermove",i),document.addEventListener("pointerup",function e(){if(r.current){let{columnId:e}=r.current;a(t=>{let n=t[e];return null!=n&&s.current?.(e,n,t),t})}r.current=null,document.removeEventListener("pointermove",i),document.removeEventListener("pointerup",e)})},[]);return{columnWidths:i,handleResizeStart:l}}({initialColumnWidths:et,onColumnResize:tt,isRTL:Ot}),$t=function(e,t){return u.useMemo(()=>e?{onResizeStart:t}:null,[e,t])}(Ke,Gt),{tableColumns:qt,tableGroups:Kt,draggingColumnId:Vt,draggingGroupKey:Jt,columnDrag:Yt,handlePinColumn:Xt,handleHideColumn:Qt,handleResetColumns:Zt,defaultSortDirection:en,defaultSortColumn:tn}=function(e,t,n,i,a,r){let[s,o]=u.useState(()=>We(e)),[l,c]=u.useState(()=>i??[]),[d,p]=u.useState(""),[m,h]=u.useState(""),g=u.useRef(""),x=u.useRef(""),f=u.useRef(!1);un(()=>{o(We(e))},[e]),un(()=>{c(i??[])},[i]);let y=u.useCallback(e=>{if(!g.current||e===g.current||l.length>0&&!(l.find(e=>e.columnIds.some(e=>String(e)===g.current))?.columnIds??[]).some(t=>String(t)===e))return;let n=Je(s,g.current),i=Je(s,e);if(-1===n||-1===i)return;let a=[...s],[r]=a.splice(n,1);a.splice(i,0,r);let c=a.filter(e=>"left"===e.pinned).length,d=a.filter(e=>"right"===e.pinned).length,p={};for(let e=0;e{let i=t[n];if(i)return{...e,pinned:i};let{pinned:a,...r}=e;return r});let n=e.filter(e=>"left"===e.pinned).length,i=e.filter(e=>"right"===e.pinned).length;return 0===n&&0===i?e:e.map((t,a)=>{if(a0&&a>=e.length-i)return{...t,pinned:"right"};let{pinned:r,...s}=t;return s})}(a,p);o(u),t(u)},[t,s,l]),b=u.useCallback(e=>{if(f.current)return;let{attributes:t}=e.target,n=t.getNamedItem("data-column-id")?.value;n&&(g.current=s[Je(s,n)]?.id?.toString()||"",p(g.current))},[s]),_=u.useCallback(e=>{if(f.current)return;let t=e.currentTarget;if(t.contains(e.relatedTarget))return;let n=t.getAttribute("data-column-id");n&&y(n)},[y]),v=u.useCallback(e=>{e.preventDefault()},[]),w=u.useCallback(e=>{e.preventDefault()},[]),S=u.useCallback(e=>{e.preventDefault(),g.current="",p("")},[]),C=u.useCallback(e=>{let t=e.currentTarget.getAttribute("data-group-key");if(t){f.current=!0,x.current=t,h(t);let n=l.find(e=>String(e.columnIds[0])===t);Pt(e,"string"==typeof n?.name?n.name:"")}},[l]),j=u.useCallback(e=>{if(!x.current||e===x.current)return;let i=l.find(e=>String(e.columnIds[0])===x.current),a=l.find(t=>String(t.columnIds[0])===e);if(!i||!a)return;let r=new Set(i.columnIds.map(String)),d=new Set(a.columnIds.map(String)),p=function(e,t,n){let i=[],a=e.filter(e=>t.has(String(e.id))),r=e.filter(e=>n.has(String(e.id))),s=!1,o=!1;for(let l of e){let e=String(l.id);t.has(e)?s||(i.push(...r),s=!0):n.has(e)?o||(i.push(...a),o=!0):i.push(l)}return i}(s,r,d),u=l.indexOf(i),m=l.indexOf(a),h=[...l];h[u]=a,h[m]=i,o(p),c(h),t(p),n?.(h,p)},[n,t,s,l]),k=u.useCallback(e=>{e.preventDefault();let t=e.currentTarget;if(t.contains(e.relatedTarget))return;let n=t.getAttribute("data-group-key");n&&j(n)},[j]),R=u.useCallback(e=>{e.preventDefault()},[]),E=u.useCallback(e=>{e.preventDefault(),f.current=!1,x.current="",h("")},[]),{handlePointerDown:N,handleGroupPointerDown:P}=function({onGrab:e,onMove:t,onRelease:n}){let i=u.useRef({onGrab:e,onMove:t,onRelease:n});u.useEffect(()=>{i.current={onGrab:e,onMove:t,onRelease:n}},[e,t,n]);let a=u.useRef(null),r=u.useCallback((e,t)=>{if(typeof document>"u"||"mouse"===t.pointerType)return;let n=t.currentTarget.getAttribute(mn[e]);if(!n)return;let r=t.pointerId;function s(t){let n=a.current;if(!n||t.pointerId!==n.pointerId||!n.active)return;t.preventDefault();let r=document.elementFromPoint(t.clientX,t.clientY)?.closest(`[${mn[e]}]`)?.getAttribute(mn[e]);r&&i.current.onMove(e,r)}function o(){let t=a.current;t&&(clearTimeout(t.longPressTimer),i.current.onRelease(e),document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",o),document.removeEventListener("pointercancel",o),a.current=null)}let l=setTimeout(()=>{let t=a.current;t&&(t.active=!0,i.current.onGrab(e,n))},250);a.current={pointerId:r,longPressTimer:l,active:!1,cleanup:o},document.addEventListener("pointermove",s,{passive:!1}),document.addEventListener("pointerup",o),document.addEventListener("pointercancel",o)},[]);u.useEffect(()=>()=>{a.current?.cleanup()},[]);let s=u.useCallback(e=>r("column",e),[r]),o=u.useCallback(e=>r("group",e),[r]);return{handlePointerDown:s,handleGroupPointerDown:o}}({onGrab:u.useCallback((e,t)=>{"group"===e?(f.current=!0,x.current=t,h(t)):(g.current=t,p(t))},[]),onMove:(e,t)=>"group"===e?j(t):y(t),onRelease:u.useCallback(e=>{"group"===e?(f.current=!1,x.current="",h("")):(g.current="",p(""))},[])}),B=u.useCallback((e,n)=>{let i=function(e,t,n){let i=Je(e,String(t));if(-1===i)return e;let a,r=[...e],[s]=r.splice(i,1),{pinned:o,...l}=s,c=n?{...l,pinned:n}:l,d=r.filter(e=>"left"===e.pinned).length,p=r.filter(e=>"right"===e.pinned).length;return a="left"===n?d:"right"===n||"right"===s.pinned?r.length-p:d,r.splice(a,0,c),r}(s,e,n);i!==s&&(o(i),t(i))},[t,s]),D=u.useCallback(e=>{o(t=>t.map(t=>String(t.id)===String(e)?{...t,omit:!0}:t))},[]),T=u.useCallback(()=>{o(We(e)),c(i??[])},[e,i]),F=function(e=!1){return e?"asc":"desc"}(r),I=u.useMemo(()=>s[Je(s,a?.toString())]||{},[a,s]),M=u.useMemo(()=>({onDragStart:b,onDragOver:v,onDragEnd:S,onDragEnter:_,onDragLeave:w,onGroupDragStart:C,onGroupDragEnter:k,onGroupDragOver:R,onGroupDragEnd:E,onPointerDown:N,onGroupPointerDown:P}),[b,v,S,_,w,C,k,R,E,N,P]);return{tableColumns:s,tableGroups:l,draggingColumnId:d,draggingGroupKey:m,columnDrag:M,handlePinColumn:B,handleHideColumn:D,handleResetColumns:T,defaultSortDirection:F,defaultSortColumn:I}}(i,Pe,Be,De,fe,be),{effectiveColumns:on,pinnedOffsets:ln,pinnedTotalWidths:cn,hasPinnedColumns:yn}=function({tableColumns:e,tableGroups:t,columnGroups:n,columnWidths:i,selectableRows:a,expandableRows:r,expandableRowsHideExpander:s}){let o=t.length>0||null!=n&&n.length>0,l=u.useMemo(()=>o?e.map(e=>{if(!e.pinned)return e;let{pinned:t,...n}=e;return n}):e,[o,e]),c=u.useRef(!1);u.useEffect(()=>{!o||c.current||e.some(e=>e.pinned)&&(c.current=!0,console.warn("DataTable: column pinning is not supported alongside columnGroups. `pinned` has been stripped from affected columns. Remove `columnGroups` or remove `pinned` from your column definitions to use pinning."))},[o,e]);let d=u.useMemo(()=>function(e,t,n,i,a){let r=e.filter(e=>!e.omit);if(!r.some(e=>e.pinned))return Xe;let s=Ze(),o={},l=Ve(n,i,a)*s;for(let e of r.filter(e=>"left"===e.pinned))null!=e.id&&(o[e.id]=l),l+=Qe(e,t);let c={},d=0;for(let e of[...r.filter(e=>"right"===e.pinned)].reverse())null!=e.id&&(c[e.id]=d),d+=Qe(e,t);return{left:o,right:c}}(l,i,a,r,s),[l,i,a,r,s]),p=u.useMemo(()=>function(e,t,n,i,a){let r=e.filter(e=>!e.omit);if(!r.some(e=>e.pinned))return{left:0,right:0};let s=Ze(),o=Ve(n,i,a)*s;for(let e of r.filter(e=>"left"===e.pinned))o+=Qe(e,t);let l=0;for(let e of r.filter(e=>"right"===e.pinned))l+=Qe(e,t);return{left:o,right:l}}(l,i,a,r,s),[l,i,a,r,s]),m=p.left>0||p.right>0;return{effectiveColumns:l,pinnedOffsets:d,pinnedTotalWidths:p,hasPinnedColumns:m}}({tableColumns:qt,tableGroups:Kt,columnGroups:De,columnWidths:Ut,selectableRows:p,expandableRows:Q,expandableRowsHideExpander:ue}),bn=u.useRef(null),{tableState:vn,handleSort:wn,handleSelectAllRows:Sn,handleSelectedRow:Cn,handleSelectedRange:jn,handleChangePage:kn,handleChangeRowsPerPage:Rn,handleClearSelectedRows:En,handleClearSort:Nn}=function(e){let{data:t,keyField:n,defaultSortColumn:i,defaultSortDirection:a,paginationDefaultPage:r,paginationPerPage:s,paginationServer:o,paginationServerOptions:l,paginationTotalRows:c,pagination:d,selectableRowsSingle:p,selectableRowsVisibleOnly:m,selectableRowSelected:h,clearSelectedRows:g,paginationPage:x,paginationResetDefaultPage:f,controlledSelectedRows:y,onSelectedRowsChange:b,onChangePage:_,onChangeRowsPerPage:v}=e,{persistSelectedOnSort:w=!1,persistSelectedOnPageChange:S=!1}=l,C=o&&(S||w),j=null!=i.id||!!i.selector,[k,R]=u.useReducer(hn,{allSelected:!1,selectedCount:0,selectedRows:[],selectedColumn:i,toggleOnSelectedRowsChange:!1,sortDirection:a,sortColumns:j?[{column:i,sortDirection:a}]:[],currentPage:r,rowsPerPage:s,selectedRowsFlag:!1,sortTriggeredPageReset:!1}),E=u.useCallback(()=>{R({type:"CLEAR_SELECTED_ROWS",selectedRowsFlag:!1})},[]),N=u.useCallback(()=>{R({type:"CLEAR_SORT",defaultSortColumn:i,defaultSortDirection:a})},[i,a]),P=u.useCallback(e=>{R(e)},[]),B=u.useCallback(e=>{R(e)},[]),D=u.useCallback(e=>{R(e)},[]),T=u.useCallback(e=>{R(e)},[]),F=u.useCallback(e=>{R({type:"CHANGE_PAGE",page:e,paginationServer:o,visibleOnly:m,persistSelectedOnPageChange:S})},[o,S,m]),I=u.useCallback((e,t)=>{let n=Ue(c||t,e),i=Ge(k.currentPage,n);o||F(i),R({type:"CHANGE_ROWS_PER_PAGE",page:i,rowsPerPage:e})},[k.currentPage,o,c,F]);return un(()=>{b({allSelected:k.allSelected,selectedCount:k.selectedCount,selectedRows:k.selectedRows.slice(0)})},[k.toggleOnSelectedRowsChange]),un(()=>{k.sortTriggeredPageReset||_(k.currentPage,c||t.length)},[k.currentPage]),un(()=>{v(k.rowsPerPage,k.currentPage)},[k.rowsPerPage]),un(()=>{F(r)},[r,f]),un(()=>{void 0!==x&&F(x)},[x]),un(()=>{if(d&&o&&c>0){let e=Ue(c,k.rowsPerPage),t=Ge(k.currentPage,e);k.currentPage!==t&&F(t)}},[c]),u.useEffect(()=>{R({type:"CLEAR_SELECTED_ROWS",selectedRowsFlag:g})},[p,g]),u.useEffect(()=>{if(!h)return;let e=t.filter(e=>h(e)),i=p?e.slice(0,1):e;R({type:"SELECT_MULTIPLE_ROWS",keyField:n,selectedRows:i,totalRows:t.length,mergeSelections:C})},[t]),{tableState:y?{...k,selectedRows:y,selectedCount:y.length,allSelected:y.length>0&&y.length===(t?.length??0)}:k,handleSort:P,handleSelectAllRows:B,handleSelectedRow:D,handleSelectedRange:T,handleChangePage:F,handleChangeRowsPerPage:I,handleClearSelectedRows:E,handleClearSort:N}}({data:n,keyField:s,defaultSortColumn:tn,defaultSortDirection:en,paginationDefaultPage:P,paginationPerPage:T,paginationServer:R,paginationServerOptions:E,paginationTotalRows:N,pagination:V,selectableRowsSingle:m,selectableRowsVisibleOnly:x,selectableRowSelected:y,clearSelectedRows:kt,paginationPage:B,paginationResetDefaultPage:D,controlledSelectedRows:w,onSelectedRowsChange:C,onChangePage:k,onChangeRowsPerPage:j}),Pn=u.useRef([]),Bn=u.useRef(null);u.useImperativeHandle(t,()=>({clearSelectedRows:En,clearSort:Nn}),[En,Nn]);let{bodyRef:Dn,prevRowTopsRef:Tn,handleSort:Fn}=function(e){let[,t]=u.useTransition(),n=u.useRef(null),i=u.useRef(new Map),a=u.useCallback(a=>{if(n.current){let e=new Map;n.current.querySelectorAll('[id^="row-"]').forEach(t=>{e.set(t.id.slice(4),t.getBoundingClientRect().top)}),i.current=e}t(()=>e(a))},[e]);return{bodyRef:n,prevRowTopsRef:i,handleSort:a}}(wn),{rowsPerPage:In,currentPage:Mn,selectedRows:Hn,allSelected:An,selectedColumn:Ln,sortDirection:_n,sortColumns:zn}=vn,{sortedData:On,tableRows:Wn}=function(e){let{data:t,selectedColumn:n,sortDirection:i,sortColumns:a,currentPage:r,rowsPerPage:s,pagination:o,paginationServer:l,sortServer:c,sortFunction:d,onSort:p}=e,m=u.useMemo(()=>{if(c)return t;if(a.length>1)return function(e,t){return 0===t.length?e:e.map((e,t)=>({row:e,index:t})).sort((e,n)=>{for(let{column:i,sortDirection:a}of t){let t="asc"===a?1:-1;if(i.sortFunction&&"function"==typeof i.sortFunction){let a=i.sortFunction(e.row,n.row);if(0!==a)return a*t;continue}let r=i.selector;if(!r)continue;let s=Ae(e.row,n.row,r,a);if(0!==s)return s}return e.index-n.index}).map(({row:e})=>e)}(t,a);if(n?.sortFunction&&"function"==typeof n.sortFunction){let e=n.sortFunction,a="asc"===i?e:(t,n)=>-1*e(t,n);return[...t].sort(a)}return function(e,t,n,i){return t?i&&"function"==typeof i?i(e.slice(0),t,n):e.slice(0).sort((e,i)=>Ae(e,i,t,n)):i&&"function"==typeof i?i(e.slice(0),Le,n):e}(t,n?.selector,i,d)},[c,n,i,a,t,d]),h=u.useMemo(()=>{if(o&&!l){let e=r*s,t=e-s;return m.slice(t,e)}return m},[r,o,l,s,m]),g=u.useRef(p),x=u.useRef({selectedColumn:n,sortDirection:i,sortColumns:a});return u.useEffect(()=>{g.current=p},[p]),u.useEffect(()=>{(x.current.selectedColumn!==n||x.current.sortDirection!==i||x.current.sortColumns!==a)&&(x.current={selectedColumn:n,sortDirection:i,sortColumns:a},g.current(n,i,m.slice(0),a))},[n,i,a,m]),{sortedData:m,tableRows:h}}({data:n,selectedColumn:Ln,sortDirection:_n,sortColumns:zn,currentPage:Mn,rowsPerPage:In,pagination:V,paginationServer:R,sortServer:oe,sortFunction:se,onSort:re}),Un=u.useMemo(()=>At(On),[At,On]),Gn=u.useMemo(()=>At(Wn),[At,Wn]),{persistSelectedOnSort:$n=!1,persistSelectedOnPageChange:qn=!1}=E,Kn=!(!R||!qn&&!$n),Vn=function({contextMenu:e,contextMenuActions:t,onContextMenuAction:n,localization:i,tableColumns:a,columnGroups:r,sortColumns:s,defaultSortDirection:o,clearSelectedOnSort:l,filterValues:c,onSort:d,onClearSort:p,onFilterChange:m,onPinColumn:h,onHideColumn:g,onResetColumns:x}){let[f,y]=u.useState(null),b=u.useRef(null),_=e?{header:"object"!=typeof e||!1!==e.header,row:"object"!=typeof e||!1!==e.row,trigger:"object"==typeof e&&e.trigger||"right-click",menuPosition:"object"==typeof e&&e.menuPosition||"end"}:null,v="right-click"===_?.trigger||"both"===_?.trigger,w="menu-button"===_?.trigger||"both"===_?.trigger,S=!!_?.header,C=!!_?.row&&!!t?.row,j=_?.menuPosition??"end",k=u.useRef(t?.row);u.useEffect(()=>{k.current=t?.row});let R=u.useCallback((e,t)=>{t.preventDefault(),b.current=t.currentTarget,y({ctx:{type:"header",column:e},position:{x:t.clientX,y:t.clientY},anchorRect:null})},[]),E=u.useCallback((e,t)=>{b.current=t.currentTarget;let n=t.currentTarget.getBoundingClientRect();y({ctx:{type:"header",column:e},position:{x:n.left,y:n.bottom+4},anchorRect:n})},[]),N=u.useCallback((e,t,n)=>{0!==(k.current?.(e,t)??[]).length&&(n.preventDefault(),b.current=n.currentTarget,y({ctx:{type:"row",row:e,rowIndex:t},position:{x:n.clientX,y:n.clientY},anchorRect:null}))},[]),P=u.useCallback((e,t,n)=>{if(0===(k.current?.(e,t)??[]).length)return;b.current=n.currentTarget;let i=n.currentTarget.getBoundingClientRect();y({ctx:{type:"row",row:e,rowIndex:t},position:{x:i.left,y:i.bottom+4},anchorRect:i})},[]),B=u.useCallback(e=>a.find(t=>Ye(t.id,e.id))??e,[a]),D=u.useMemo(()=>{if(!f)return null;let{ctx:e,position:n,anchorRect:o}=f;if("row"===e.type)return{groups:[t?.row?.(e.row,e.rowIndex)??[]],position:n,anchorRect:o,ariaLabel:i.rowMenuAriaLabel??"Row menu"};let l=B(e.column),c=[];l.sortable&&c.push([{id:"sort-asc",label:i.sortAscLabel??"Sort ascending"},{id:"sort-desc",label:i.sortDescLabel??"Sort descending"},{id:"clear-sort",label:i.clearSortLabel??"Clear sort",disabled:0===s.length}]);let d=[];r?.length||("left"!==l.pinned&&d.push({id:"pin-left",label:i.pinLeftLabel??"Pin left"}),"right"!==l.pinned&&d.push({id:"pin-right",label:i.pinRightLabel??"Pin right"}),l.pinned&&d.push({id:"unpin",label:i.unpinLabel??"Unpin"}));let p=a.filter(e=>!e.omit).length;d.push({id:"hide-column",label:i.hideColumnLabel??"Hide column",disabled:p<=1}),c.push(d),c.push([{id:"reset",label:i.resetLabel??"Reset table"}]);let u="function"==typeof t?.header?t.header(l):t?.header;return u?.length&&c.push(u),{groups:c,position:n,anchorRect:o,ariaLabel:i.headerMenuAriaLabel??"Column menu"}},[f,t,i,B,s,r,a]),T=u.useCallback(e=>{y(null),e&&b.current?.focus(),b.current=null},[]),F=u.useCallback(e=>{if(!f)return;let{ctx:t}=f;if("header"===t.type){let i=B(t.column);switch(e.id){case"sort-asc":case"sort-desc":d({type:"SORT_CHANGE",selectedColumn:i,additive:!1,defaultSortDirection:o,direction:"sort-asc"===e.id?"asc":"desc",clearSelectedOnSort:l});break;case"clear-sort":p();break;case"pin-left":h(i.id,"left");break;case"pin-right":h(i.id,"right");break;case"unpin":h(i.id);break;case"hide-column":g(i.id);break;case"reset":x(),p();for(let e of Object.keys(c)){let t=a.find(t=>String(t.id)===e);m(e,ft(t?.filterType))}}n?.(e,{type:"header",column:i})}else n?.(e,t);T(!0)},[f,B,d,o,l,p,h,g,x,c,a,m,n,T]),I=i.headerMenuButtonAriaLabel??"Column actions",M=i.rowMenuButtonAriaLabel??"Row actions";return{header:u.useMemo(()=>S?{rightClick:v,menuButton:w,ariaLabel:I,onContextMenu:R,onMenuButtonClick:E}:null,[S,v,w,I,R,E]),row:u.useMemo(()=>C?{rightClick:v,menuButton:w,menuButtonPosition:j,ariaLabel:M,onContextMenu:N,onMenuButtonClick:P}:null,[C,v,w,j,M,N,P]),open:D,onSelect:F,onClose:T}}({contextMenu:Me,contextMenuActions:He,onContextMenuAction:ze,localization:wt.contextMenu,tableColumns:qt,columnGroups:De,sortColumns:zn,defaultSortDirection:en,clearSelectedOnSort:V&&R&&!$n||oe||x,filterValues:Mt,onSort:Fn,onClearSort:Nn,onFilterChange:Ht,onPinColumn:Xt,onHideColumn:Qt,onResetColumns:Zt}),Jn=V&&!L&&n.length>0,Yn=M||dt,Xn=u.useMemo(()=>((e={})=>Ie({},e))(Ee),[Ee]),Qn=function(e="light"){let[t,n]=(0,u.useState)(()=>gn()?"dark":"light");return(0,u.useEffect)(()=>{if("system"!==e)return;let t=()=>n(gn()?"dark":"light");t();let i=window.matchMedia("(prefers-color-scheme: dark)");i.addEventListener("change",t);let a=new MutationObserver(t);return a.observe(document.documentElement,{attributeFilter:["class"]}),window.addEventListener("storage",t),()=>{i.removeEventListener("change",t),a.disconnect(),window.removeEventListener("storage",t)}},[e]),"system"===e?t:e}(Re),Zn=u.useMemo(()=>function(e,t="light"){if(e&&"string"!=typeof e&&dn(e))return e;let n=pn(e);return function(e){let t={"--rdt-color-scheme":e.colorScheme??"light","--rdt-color-primary":e.primary??"#1976d2","--rdt-color-text-primary":e.text.primary,"--rdt-color-text-secondary":e.text.secondary,"--rdt-color-text-disabled":e.text.disabled,"--rdt-color-bg":e.background.default,"--rdt-color-context-bg":e.context.background,...e.background.header?{"--rdt-color-header-bg":e.background.header}:{},...e.background.footer?{"--rdt-color-footer-bg":e.background.footer}:{},"--rdt-color-context-text":e.context.text,"--rdt-color-divider":e.divider.default,"--rdt-color-btn":e.button.default,"--rdt-color-btn-focus":e.button.focus,"--rdt-color-btn-hover":e.button.hover,"--rdt-color-btn-disabled":e.button.disabled,"--rdt-color-selected":e.selected.default,"--rdt-color-selected-text":e.selected.text,"--rdt-color-highlight":e.highlightOnHover.default,"--rdt-color-highlight-text":e.highlightOnHover.text,"--rdt-color-striped":e.striped.default,"--rdt-color-striped-text":e.striped.text};return null!=e.spacing?.rowHeight&&(t["--rdt-row-height"]=e.spacing.rowHeight),null!=e.spacing?.headerHeight&&(t["--rdt-header-height"]=e.spacing.headerHeight),null!=e.spacing?.cellPaddingX&&(t["--rdt-cell-padding-x"]=e.spacing.cellPaddingX),null!=e.spacing?.iconSize&&(t["--rdt-icon-size"]=e.spacing.iconSize),null!=e.typography?.fontSize&&(t["--rdt-font-size"]=e.typography.fontSize),null!=e.typography?.fontSizeHeader&&(t["--rdt-font-size-header"]=e.typography.fontSizeHeader),null!=e.typography?.fontFamily&&(t["--rdt-font-family"]=e.typography.fontFamily),null!=e.shape?.borderRadius&&(t["--rdt-border-radius"]=e.shape.borderRadius),null!=e.checkbox?.size&&(t["--rdt-checkbox-size"]=e.checkbox.size),null!=e.checkbox?.borderRadius&&(t["--rdt-checkbox-radius"]=e.checkbox.borderRadius),t}("dark"===t&&n.darkMode?Ie(n,{...n.darkMode,colorScheme:"dark"}):n)}(Ce,Qn),[Ce,Qn]),ei=u.useMemo(()=>({..."auto"!==Ne&&{dir:Ne}}),[Ne]),ti=L,ni=u.useCallback(e=>kn(e),[kn]),ii=u.useCallback(e=>Rn(e,Gn.length),[Rn,Gn.length]),ai=!G&&(O||L||Un.length>0),ri=!($||!a&&!r),{activeCell:si,handleNavFocus:oi,handleNavKeyDown:li}=function({cellNavigation:e,selectableRows:t,expandableRows:n,expandableRowsHideExpander:i,effectiveColumns:a,filteredTableRowCount:r,showTableHead:s}){let[o,l]=u.useState(null),c=Ve(t,n,i)+a.filter(e=>!e.omit).length,d=s?-1:0,p=r-1,m=u.useMemo(()=>{if(!e||0===c||p=0?0:d,col:0};return{row:Math.min(Math.max(t.row,d),p),col:Math.min(Math.max(t.col,0),c-1)}},[e,o,d,p,c]),h=u.useCallback(e=>{let t=e.target.closest("[data-nav-row]");if(!t)return;let n=Number(t.dataset.navRow),i=Number(t.dataset.navCol);l(e=>e&&e.row===n&&e.col===i?e:{row:n,col:i})},[]),g=u.useCallback(e=>{if(e.defaultPrevented||!xn.includes(e.key)&&" "!==e.key)return;let t=e.target,n=t.closest("[data-nav-row]");if(!n)return;if(" "===e.key)return void(t===n&&e.preventDefault());let i=t.tagName;if(t.isContentEditable||"TEXTAREA"===i||"SELECT"===i||"INPUT"===i&&!["checkbox","radio","button"].includes(t.type)||t.closest(".rdt_editCustomWrap"))return;let a="rtl"===getComputedStyle(e.currentTarget).direction,r=Number(n.dataset.navRow),s=Number(n.dataset.navCol),o=r,l=s;switch(e.key){case"ArrowRight":l+=a?-1:1;break;case"ArrowLeft":l+=a?1:-1;break;case"ArrowDown":o+=1;break;case"ArrowUp":o-=1;break;case"Home":l=0,(e.ctrlKey||e.metaKey)&&(o=p>=0?0:d);break;case"End":l=c-1,(e.ctrlKey||e.metaKey)&&(o=p>=0?p:d)}o=Math.min(Math.max(o,d),Math.max(p,d)),l=Math.min(Math.max(l,0),Math.max(c-1,0)),e.preventDefault(),(o!==r||l!==s)&&function(e,t,n){let i=e.querySelector(`[data-nav-row="${t}"][data-nav-col="${n}"]`);if(!i){let a=Number.POSITIVE_INFINITY;e.querySelectorAll(`[data-nav-row="${t}"]`).forEach(e=>{let t=Math.abs(Number(e.dataset.navCol)-n);ton.some(e=>!e.omit&&void 0!==e.footer),[on]),di=!1!==ht&&!L&&(!0===ht||!!mt||ci);V&&!R&&Un.length>0&&0===Gn.length&&ni(Ge(Mn,Ue(Un.length,In)));let pi=x?Gn:Un,ui=qn||m||g;at(()=>{Pn.current=Gn},[Gn]);let mi=function(e){let{sortDirection:t,sortColumns:n,sortDisabled:i,sortMulti:a,defaultSortDirection:r,sortIcon:s,sortServer:o,pagination:l,paginationServer:c,persistSelectedOnSort:d,selectableRowsVisibleOnly:p,onSort:m}=e;return u.useMemo(()=>({sortDirection:t,sortColumns:n,sortDisabled:i,sortMulti:a,defaultSortDirection:r,sortIcon:s,sortServer:o,pagination:l,paginationServer:c,persistSelectedOnSort:d,selectableRowsVisibleOnly:p,onSort:m}),[t,n,i,a,r,s,o,l,c,d,p,m])}({sortDirection:_n,sortColumns:zn,sortDisabled:L||0===Un.length,sortMulti:le,defaultSortDirection:en,sortIcon:Et,sortServer:oe,pagination:V,paginationServer:R,persistSelectedOnSort:$n,selectableRowsVisibleOnly:x,onSort:Fn}),hi=function(e){let{selectableRows:t,component:n,componentProps:i,highlight:a,single:r,disabled:s,range:o,onSelectedRow:l,onSelectedRange:c,visibleRowsRef:d,lastSelectedKeyRef:p,allSelected:m,selectedRows:h,visibleRows:g,keyField:x,mergeSelections:f,hideSelectAll:y,onSelectAllRows:b}=e;return{row:u.useMemo(()=>t?{component:n,componentProps:i,highlight:a,single:r,disabled:s,range:o,onSelectedRow:l,onSelectedRange:c,visibleRowsRef:d,lastSelectedKeyRef:p}:null,[t,n,i,a,r,s,o,l,c,d,p]),selectAll:u.useMemo(()=>t?{allSelected:m,selectedRows:h,visibleRows:g,component:n,componentProps:i,disabled:s,keyField:x,mergeSelections:f,hideSelectAll:y,onSelectAllRows:b}:null,[t,m,h,g,n,i,s,x,f,y,b])}}({selectableRows:p,component:Dt,componentProps:Tt,highlight:h,single:m,disabled:b,range:f,onSelectedRow:Cn,onSelectedRange:jn,visibleRowsRef:Pn,lastSelectedKeyRef:Bn,allSelected:An,selectedRows:Hn,visibleRows:pi,keyField:s,mergeSelections:Kn,hideSelectAll:ui,onSelectAllRows:Sn}),gi=function(e){let{expandableRows:t,icon:n,component:i,componentProps:a,hideExpander:r,expandOnRowClicked:s,expandOnRowDoubleClicked:o,inheritConditionalStyles:l,onToggled:c,localization:d}=e;return u.useMemo(()=>t?{icon:n,component:i,componentProps:a,hideExpander:r,expandOnRowClicked:s,expandOnRowDoubleClicked:o,inheritConditionalStyles:l,onToggled:c,localization:d}:null,[t,n,i,a,r,s,o,l,c,d])}({expandableRows:Q,icon:Nt,component:ce,componentProps:de,hideExpander:ue,expandOnRowClicked:me,expandOnRowDoubleClicked:he,inheritConditionalStyles:xe,onToggled:S,localization:wt.expandable}),xi=function(e){let{onRowClicked:t,onRowDoubleClicked:n,onRowMiddleClicked:i,onRowMouseEnter:a,onRowMouseLeave:r}=e;return u.useMemo(()=>({onRowClicked:t,onRowDoubleClicked:n,onRowMiddleClicked:i,onRowMouseEnter:a,onRowMouseLeave:r}),[t,n,i,a,r])}({onRowClicked:Z,onRowDoubleClicked:ee,onRowMiddleClicked:te,onRowMouseEnter:ne,onRowMouseLeave:ie}),fi=function(e){return u.useMemo(()=>e,[e.keyField,e.columns,e.dense,e.striped,e.highlightOnHover,e.pointerOnHover,e.conditionalRowStyles,e.selection,e.expansion,e.rowEvents,e.columnDrag,e.columnWidths,e.pinnedOffsets,e.animateRows,e.cellNavigation,e.activeCell,e.rowMenu])}({keyField:s,columns:on,dense:d,striped:o,highlightOnHover:l,pointerOnHover:c,conditionalRowStyles:we,selection:hi.row,expansion:gi,rowEvents:xi,columnDrag:Yt,columnWidths:Ut,pinnedOffsets:ln,animateRows:nt,cellNavigation:ct,activeCell:si,rowMenu:Vn.row}),yi=function(e){return u.useMemo(()=>e,[e.sorting,e.fixedHeader,e.dense,e.draggingColumnId,e.draggingGroupKey,e.filtering,e.columnWidths,e.pinnedOffsets,e.resize,e.selectAll,e.cellNavigation,e.activeCell,e.columnDrag,e.headerMenu])}({sorting:mi,fixedHeader:q,dense:d,draggingColumnId:Vt,draggingGroupKey:Jt,filtering:zt,columnWidths:Ut,pinnedOffsets:ln,resize:$t,selectAll:hi.selectAll,cellNavigation:ct,activeCell:si,headerMenu:Vn.header,columnDrag:Yt}),bi={Pagination:Yn,onChangePage:ni,onChangeRowsPerPage:ii,rowCount:N||Un.length,currentPage:Mn,rowsPerPage:In,direction:Ne,paginationRowsPerPageOptions:I,paginationIcons:Bt,paginationComponentOptions:H,localization:wt.pagination},_i=void 0!==pt?pt:Rt.columnSeparator??!1,vi=void 0!==ut?ut:Rt.headerSeparator??!0,wi="full"===_i?"rdt_colSeparatorFull":_i?"rdt_colSeparator":void 0,Si=!1===vi?void 0:"full"===vi?"rdt_headSeparatorFull":"rdt_headSeparator";return u.createElement(ye.Provider,{value:Xn},u.createElement(Ft.Provider,{value:yi},u.createElement(Wt.Provider,{value:fi},u.createElement("div",{style:Zn,className:[wi,Si].filter(Boolean).join(" ")||void 0},ri&&u.createElement(ve,{title:a,actions:r}),J&&u.createElement(Se,{align:Y,wrapContent:X},J),Jn&&("top"===F||"both"===F)&&u.createElement(an,{...bi,position:"top"}),u.createElement(je,{ref:bn,$responsive:A,$fixedHeader:q,$fixedHeaderScrollHeight:K,$hiddenScrollbar:yn&&A,className:gt,onScroll:ae,...ei},u.createElement(ke,null,u.createElement(_e,{id:It,disabled:U,className:"rdt_Table",role:ct?"grid":"table","aria-busy":ti,onKeyDown:ct?li:void 0,onFocus:ct?oi:void 0,...xt&&{"aria-label":xt}},ai&&u.createElement(Lt,{columns:on,columnGroups:Kt.length?Kt:De,selectableRows:p,expandableRows:Q,expandableRowsHideExpander:ue}),u.createElement(nn,{tableRows:Gn,sortedData:Un,selectedRows:Hn,keyField:s,isBusy:ti,columnCount:qt.length,noDataComponent:W,progressComponent:z,expandableRowExpanded:ge,expandableRowDisabled:pe,bodyRef:Dn,prevRowTopsRef:Tn}),di&&u.createElement(rn,{columns:on,rows:Un,selectableRows:p,expandableRows:Q,expandableRowsHideExpander:ue,footerComponent:mt})))),yn&&A&&u.createElement(sn,{scrollRef:bn,leftInset:cn.left,rightInset:cn.right}),Jn&&("bottom"===F||"both"===F)&&u.createElement(an,{...bi}),Vn.open&&u.createElement(fn,{groups:Vn.open.groups,position:Vn.open.position,anchorRect:Vn.open.anchorRect,isRTL:Ot,ariaLabel:Vn.open.ariaLabel,onSelect:Vn.onSelect,onClose:Vn.onClose})))))}),bn=yn;const{__:vn}=wp.i18n,wn=function(){const{isRunning:e,blogId:t,isPro:n}=(0,i.useContext)(l),[a,c]=(0,i.useState)({static_pages:[],total_static_pages:0}),[d,u]=(0,i.useState)(!1),[m,h]=(0,i.useState)(""),[g,x]=(0,i.useState)(25),[f,y]=(0,i.useState)(1),[b,_]=(0,i.useState)(!1),[v,w]=(0,i.useState)(""),[S,C]=(0,i.useState)("export"),[j,k]=(0,i.useState)(null),R=(0,i.useRef)(1),E=(0,i.useRef)(25),N=(0,i.useRef)(""),P=(0,i.useRef)({controller:null,sequence:0}),B=(0,i.useRef)(!1),D=(0,i.useRef)(!0),T=(0,i.useCallback)(()=>{P.current.sequence+=1,P.current.controller&&P.current.controller.abort(),P.current.controller=null},[]),F=(0,i.useCallback)(({page:e=R.current,perPage:n=E.current,search:i=N.current,showLoading:a=!0,cancelPrevious:s=!0}={})=>{const o=Math.max(1,Number.parseInt(e,10)||1),l=Math.min(200,Math.max(1,Number.parseInt(n,10)||25)),d="string"==typeof i?i:"";if(!s&&P.current.controller)return Promise.resolve(null);s&&T();const p="undefined"!=typeof AbortController?new AbortController:null,m=P.current.sequence+1;P.current={controller:p,sequence:m},a&&u(!0),h("");const g={path:`/simplystatic/v1/export-log?page=${o}&per_page=${l}&blog_id=${encodeURIComponent(t)}&is_network_admin=${options.is_network}&search=${encodeURIComponent(d)}`,method:"GET"};return p&&(g.signal=p.signal),r()(g).then(e=>{const t=me(e);if(!t||!t.data||"object"!=typeof t.data)throw new Error(vn("Invalid export log response.","simply-static"));if(!D.current||m!==P.current.sequence)return null;const n=t.data;return c(e=>({...e,...n,static_pages:Array.isArray(n.static_pages)?n.static_pages:e.static_pages,total_static_pages:Number.parseInt(n.total_static_pages,10)||0})),R.current=o,y(o),n}).catch(e=>(e&&"AbortError"===e.name||D.current&&m===P.current.sequence&&h(e&&e.message?e.message:vn("Could not load the export log.","simply-static")),null)).finally(()=>{m===P.current.sequence&&(P.current.controller=null,D.current&&u(!1))})},[t,T]),I=(0,i.useCallback)(()=>r()({path:"/simplystatic/v1/export-type",method:"GET"}).then(e=>{const t=me(e);t&&200===t.status&&t.data&&(C(t.data.export_type),k(t.data.export_type_id))}).catch(()=>{C(options.last_export_end?"Update":"export"),k(null)}),[]);(0,i.useEffect)(()=>(D.current=!0,()=>{D.current=!1,T()}),[T]),(0,i.useEffect)(()=>{R.current=1,y(1),F({page:1})},[t,F]),(0,i.useEffect)(()=>{I()},[I,e]),(0,i.useEffect)(()=>{if(!B.current)return void(B.current=!0);const e=window.setTimeout(()=>{R.current=1,y(1),_(e=>!e),F({page:1,search:v})},300);return()=>window.clearTimeout(e)},[v,F]),s(()=>{F({showLoading:!1,cancelPrevious:!1})},e?5e3:null);const M=n()?"40%":"60%",H=[{name:vn("Code","simply-static"),selector:e=>e.code,sortable:!0,width:"12%"},{name:vn("URL","simply-static"),selector:e=>{const t=e&&"string"==typeof e.url?e.url:"";if(!t)return(0,o.jsx)("span",{children:"-"});const n=ge(t);return n?(0,o.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:n.href,children:n.label}):(0,o.jsx)("span",{children:t})},sortable:!0,sortFunction:(e,t)=>String(e&&e.url||"").localeCompare(String(t&&t.url||"")),width:M,wrap:!0}],A={name:vn("Export Type","simply-static"),selector:()=>"Build"===S||"Single"===S?`${S} (ID: ${j})`:S,sortable:!0,width:"20%"},L={name:vn("Notes","simply-static"),wrap:!0,selector:e=>(0,o.jsx)("span",{children:he(e&&e.notes)}),sortable:!0,sortFunction:(e,t)=>he(e&&e.notes).localeCompare(he(t&&t.notes)),width:"28%"},z=n()?[...H,A,L]:[...H,L];return(0,o.jsxs)("div",{className:"log-table-container",children:[(0,o.jsx)(p.Flex,{children:(0,o.jsxs)(p.FlexItem,{children:[(0,o.jsx)("label",{className:"screen-reader-text",htmlFor:"export-search",children:vn("Search export log","simply-static")}),(0,o.jsx)("input",{id:"export-search",className:"ss-export-log-search",type:"search",placeholder:vn("Search…","simply-static"),value:v,onChange:e=>{const t=e.target.value;T(),u(!1),N.current=t,w(t)}})]})}),m&&(0,o.jsx)(p.Notice,{status:"error",isDismissible:!1,children:(0,o.jsx)("p",{children:m})}),(0,o.jsx)(bn,{columns:z,data:a.static_pages||[],pagination:!0,paginationServer:!0,paginationDefaultPage:f,paginationResetDefaultPageToggle:b,paginationTotalRows:a.total_static_pages,paginationPerPage:g,paginationRowsPerPageOptions:[25,50,100,200],progressPending:d,progressComponent:(0,o.jsxs)("div",{style:{padding:"24px",textAlign:"center"},children:[(0,o.jsx)(p.Spinner,{}),(0,o.jsx)("div",{style:{marginTop:"8px"},children:vn("Loading…","simply-static")})]}),onChangeRowsPerPage:(e,t)=>{E.current=e,R.current=t,x(e),y(t),F({page:t,perPage:e})},onChangePage:e=>{R.current=e,y(e),F({page:e})}})]})},{__:Sn}=wp.i18n,Cn=function(){const[e,t]=(0,i.useState)(!1);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Button,{variant:"primary",href:options.log_file,download:!0,style:{marginRight:"10px"},children:Sn("Download Log","simply-static")}),(0,o.jsx)(p.Button,{variant:"secondary",onClick:()=>{r()({path:"/simplystatic/v1/delete-log",method:"POST"}),t(!0),setTimeout(function(){t(!1)},2e3)},children:Sn("Clear Log","simply-static")}),e&&(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:Sn("Log file cleared.","simply-static")})})})]})},{__:jn}=wp.i18n,kn=function(e){const{children:t,canGenerate:n,isPaused:i,isDelayed:a,startExport:r,cancelExport:s,pauseExport:l,resumeExport:c,buttonLabel:d}=e,u="function"==typeof l,m="function"==typeof s,h="function"==typeof c,g="function"==typeof r;return(0,o.jsxs)("div",{className:"generate-buttons-container",children:[n&&g&&(0,o.jsxs)(p.Button,{onClick:()=>{r()},disabled:!n||a,className:"generate",children:[n&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Dashicon,{icon:"update"}),d||jn("Push","simply-static")]}),n&&a>0&&(0,o.jsxs)(o.Fragment,{children:[" ",a,"s"]}),!n&&(0,o.jsx)(p.Dashicon,{icon:"update spin"})]}),!n&&(0,o.jsxs)(o.Fragment,{children:[!i&&u&&(0,o.jsx)(p.Button,{label:jn("Pause","simply-static"),className:"ss-generate-media-button","aria-label":jn("Pause","simply-static"),onClick:()=>l(),children:(0,o.jsx)(p.Dashicon,{icon:"controls-pause"})}),i&&h&&(0,o.jsx)(p.Button,{label:jn("Resume","simply-static"),className:"ss-generate-media-button","aria-label":jn("Resume","simply-static"),onClick:()=>c(),children:(0,o.jsx)(p.Dashicon,{icon:"controls-play"})}),m&&(0,o.jsx)(p.Button,{onClick:()=>s(),label:jn("Cancel","simply-static"),className:"ss-generate-cancel-button","aria-label":jn("Cancel","simply-static"),children:(0,o.jsx)(p.Dashicon,{icon:"no"})})]}),t]})},{__:Rn}=wp.i18n,En=function(e){const{site:t,setAnyRunning:n}=e,a=t.id,[s,l]=(0,i.useState)(!t.running&&!t.paused),[c,d]=(0,i.useState)(t.running),[m,h]=(0,i.useState)(t.paused);(0,u.useEffect)(()=>{c&&n(!0)},[c]),(0,u.useEffect)(()=>{h(t.paused),d(t.running),l(!t.running&&!t.paused)},[t]);const g=()=>"pro"===options.plan;return(0,o.jsxs)("tr",{children:[(0,o.jsxs)("td",{children:[t.name,(0,o.jsx)("br",{}),(0,o.jsx)("a",{href:t.url,children:t.url})]}),(0,o.jsx)("td",{children:t.status}),(0,o.jsx)("td",{className:"generate-container network-generate-container",children:(0,o.jsxs)(kn,{site:t,canGenerate:s,startExport:g()?()=>{l(!1),h(!1),r()({path:"/simplystatic/v1/start-export",method:"POST",data:{blog_id:a,type:"export",is_network_admin:options.is_network}}).then(e=>{500!==JSON.parse(e).status?d(!0):l(!0)})}:null,isPaused:m,isRunning:c,cancelExport:g()?()=>{r()({path:"/simplystatic/v1/cancel-export",method:"POST",data:{blog_id:a,is_network_admin:options.is_network}}).then(e=>{h(!1),d(!1),l(!0)})}:null,pauseExport:g()?()=>{r()({path:"/simplystatic/v1/pause-export",method:"POST",data:{blog_id:a,is_network_admin:options.is_network}}).then(e=>{d(!1),h(!0)})}:null,resumeExport:g()?()=>{r()({path:"/simplystatic/v1/resume-export",method:"POST",data:{blog_id:a,is_network_admin:options.is_network}}).then(e=>{h(!1),d(!0)})}:null,children:[!g()&&(0,o.jsxs)(p.Button,{label:"Generate","aria-label":Rn("Generate","simply-static"),className:"generate",disabled:!0,children:[(0,o.jsx)(p.Dashicon,{icon:"update"}),Rn("Generate","simply-static")]}),(0,o.jsx)(p.Button,{className:"sub-site-settings",onClick:()=>window.location=t.settings_url,children:(0,o.jsx)(p.Dashicon,{icon:"admin-generic"})}),!g()&&(0,o.jsx)(p.Button,{target:"_blank",variant:"link",href:"https://simplystatic.com/pricing/",children:Rn("Upgrade to manage from network.","simply-static")})]})})]})},{__:Nn}=wp.i18n,Pn=function(e){const[t,n]=(0,i.useState)([]),[a,l]=(0,i.useState)(!1),[c,d]=(0,i.useState)(0),p=(0,i.useRef)(!1);function m(){p.current||(p.current=!0,r()({path:"/simplystatic/v1/sites",method:"GET"}).then(e=>{let t=[],i=!1;e.data.forEach(function(e){t.push(e),e.running&&(i=!0)}),n(t),l(i)}).catch(()=>{}).finally(()=>{p.current=!1}))}return s(()=>{m()},a?1e4:3e5),s(()=>{var e;!c&&t.length>0&&d(t[0].id),c&&(e=c,r()({path:"/simplystatic/v1/trigger-cron",method:"POST",data:{blog_id:e}}).then(n=>{var i=JSON.parse(n);200===i.status?console.log("CRON triggered successfully for site "+e):console.error("Failed to trigger CRON:",i.message);let a=function(e){let n=function(){let e=[];return t.forEach(function(t){e.push(t.id)}),e}();if(0===n.length)return 0;let i=n.indexOf(e);return-1===i?n[0]:(i++,n[i]||n[0])}(e);d(a)}).catch(e=>{console.error("Error triggering CRON:",e)}))},a?15e4:null),(0,u.useEffect)(()=>{m()},[]),(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("table",{className:"wp-list-table widefat fixed striped posts simple-static-sites",children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{children:[(0,o.jsx)("th",{children:Nn("Name","simply-static")}),(0,o.jsx)("th",{children:Nn("Status","simply-static")}),(0,o.jsx)("th",{children:Nn("Actions","simply-static")})]})}),(0,o.jsx)("tbody",{children:t.map(e=>(0,o.jsx)(En,{setAnyRunning:l,site:e},e.id))})]})})},{__:Bn}=wp.i18n;function Dn(){const[e,t]=(0,i.useState)(!1);(0,i.useEffect)(()=>{try{if(options.is_network||"pro"===options.plan)return void t(!1);const e=new Date,n=e.getFullYear(),i=new Date(n,10,28,0,0,0),a=new Date(n,11,5,23,59,59),r=`ss_bf_banner_dismissed_${n}`,s=!("undefined"==typeof window||!window.localStorage)&&"1"===window.localStorage.getItem(r);t(!s&&e>=i&&e<=a)}catch(e){t(!1)}},[]);const n=()=>{try{const e=`ss_bf_banner_dismissed_${(new Date).getFullYear()}`;"undefined"!=typeof window&&window.localStorage&&window.localStorage.setItem(e,"1")}catch(e){}t(!1)};return e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"notice",isDismissible:!0,onRemove:n,className:"bf-banner",children:(0,o.jsxs)("p",{children:[(0,o.jsx)("strong",{children:"BLACK FRIDAY"}),": Upgrade to ",(0,o.jsx)("b",{children:"Simply Static Pro"})," and save ",(0,o.jsx)("b",{children:"25%"})," by using the code ",(0,o.jsx)("b",{children:"SSBF25"})," ",(0,o.jsx)(p.Button,{isPrimary:!0,href:"https://simplystatic.com/pricing/?utm_source=plugin&utm_medium=banner&utm_campaign=bf",target:"_blank",rel:"noopener noreferrer",style:{marginLeft:8},children:Bn("Buy now","simply-static")})]})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}):null}const{__:Tn}=wp.i18n,Fn=function(){const{settings:e,blogId:t,setBlogId:n}=(0,i.useContext)(l);return(0,o.jsxs)("div",{className:"inner-settings",children:[!options.is_network&&options.can_view_activity_log&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Dn,{}),(0,o.jsx)(fe,{}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsxs)(p.Flex,{align:"top",children:[options.is_network&&(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsx)(p.Card,{children:(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(Pn,{})})})}),e.debugging_mode&&options.log_file&&options.can_manage_settings&&!options.is_network&&(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Tn("Debugging","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(Cn,{})})]})})]}),!options.is_network&&options.can_view_activity_log&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsx)("b",{children:Tn("Export Log","simply-static")})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(wn,{})})]})]})]})},{__:In}=wp.i18n,Mn=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isPro:c,isStudio:d}=(0,i.useContext)(l),[u,m]=(0,i.useState)(!1),[h,g]=(0,i.useState)(!1),[x,f]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),[_,v]=(0,i.useState)(!1),[w,S]=(0,i.useState)(!1),[C,j]=(0,i.useState)(!1),[k,R]=(0,i.useState)(!1),[E,N]=(0,i.useState)(!1),[P,B]=(0,i.useState)(!1),[D,T]=(0,i.useState)(!1),[F,I]=(0,i.useState)(!1),[M,A]=(0,i.useState)(!1),[z,O]=(0,i.useState)(!1),[W,U]=(0,i.useState)(!1),[G,$]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{e.use_minify&&m(e.use_minify),e.minify_css&&g(e.minify_css),e.minify_js&&f(e.minify_js),e.use_css_optimize&&b(e.use_css_optimize),e.css_optimize_defer_css&&v(e.css_optimize_defer_css),e.css_optimize_defer_js&&S(e.css_optimize_defer_js),e.css_optimize_google_fonts&&j(e.css_optimize_google_fonts),R(!!e.css_optimize_preconnect_hints),e.css_optimize_delay_js&&N(e.css_optimize_delay_js),e.css_js_aggregate_css&&B(e.css_js_aggregate_css),e.css_js_aggregate_js&&T(e.css_js_aggregate_js),e.css_js_aggregate_protect_jquery&&I(e.css_js_aggregate_protect_jquery),e.use_critical_css&&A(e.use_critical_css),e.version_css&&O(e.version_css),e.version_js&&U(e.version_js)},[e]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[In("Minify & Aggregation","simply-static"),(0,o.jsx)(H,{title:In("How to minify HTML, CSS and JavaScript?","simply-static"),videoUrl:"https://youtu.be/52IKv5ai-i4"})]})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",In("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:In("Minify and aggregate CSS, JavaScript, and HTML files to reduce file sizes and HTTP requests for faster page loads.","simply-static")}),(0,o.jsx)(p.ToggleControl,{label:In("Enable Minify & Aggregation?","simply-static"),__nextHasNoMarginBottom:!0,help:In(u?"Minify and aggregate files on your static website.":"Don't minify or aggregate files on your static website.","simply-static"),disabled:"free"===options.plan||!c(),checked:u,onChange:e=>{m(e),t("use_minify",e)}}),u&&(0,o.jsxs)(o.Fragment,{children:[d()&&(0,o.jsx)(L,{heading:In("Minification is handled by Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:In("Studio prepares optimized build assets automatically, so the low-level CSS and JavaScript minification options are not needed for Studio environments.","simply-static")})}),(0,o.jsx)("h4",{style:{marginTop:"16px",marginBottom:"8px"},children:In("Minify","simply-static")}),(0,o.jsx)(p.ToggleControl,{label:In("Minify CSS","simply-static"),__nextHasNoMarginBottom:!0,help:In(h?"Minify CSS files.":"Don't minify CSS files.","simply-static"),disabled:d()||"free"===options.plan||!c(),checked:h,onChange:e=>{g(e),t("minify_css",e)}}),h&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextareaControl,{label:In("Exclude Stylesheet URLs","simply-static"),__nextHasNoMarginBottom:!0,help:In("Exclude URLs from minification (one per line).","simply-static"),disabled:d()||"free"===options.plan||!c(),value:e.minify_css_exclude,onChange:e=>{t("minify_css_exclude",e)}})}),(0,o.jsx)(p.ToggleControl,{label:In("Minify JavaScript","simply-static"),__nextHasNoMarginBottom:!0,help:In(x?"Minify JavaScript files.":"Don't minify JavaScript files.","simply-static"),disabled:d()||"free"===options.plan||!c(),checked:x,onChange:e=>{f(e),t("minify_js",e)}}),x&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextareaControl,{label:In("Exclude JavaScript URLs","simply-static"),__nextHasNoMarginBottom:!0,help:In("Exclude URLs from minification (one per line).","simply-static"),disabled:d()||"free"===options.plan||!c(),value:e.minify_js_exclude,onChange:e=>{t("minify_js_exclude",e)}})}),(0,o.jsx)(p.ToggleControl,{label:In("Protect jQuery Globals","simply-static"),__nextHasNoMarginBottom:!0,help:In("Prevent mangling of jQuery, $, and wp global variables during JS minification.","simply-static"),disabled:d()||"free"===options.plan||!c(),checked:F,onChange:e=>{I(e),t("css_js_aggregate_protect_jquery",e)}}),(0,o.jsx)("h4",{style:{marginTop:"16px",marginBottom:"8px"},children:In("Aggregate","simply-static")}),(0,o.jsx)(p.ToggleControl,{label:In("Aggregate CSS","simply-static"),__nextHasNoMarginBottom:!0,help:In("Combine multiple CSS files into fewer bundles grouped by media attribute and deferral status.","simply-static"),disabled:"free"===options.plan||!c(),checked:P,onChange:e=>{B(e),t("css_js_aggregate_css",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Aggregate JavaScript","simply-static"),__nextHasNoMarginBottom:!0,help:In("Combine multiple JS files into fewer bundles grouped by loading attributes (defer, async, delayed) and position (head/body).","simply-static"),disabled:"free"===options.plan||!c(),checked:D,onChange:e=>{T(e),t("css_js_aggregate_js",e)}}),(0,o.jsx)(p.TextareaControl,{label:In("Exclude Patterns","simply-static"),__nextHasNoMarginBottom:!0,help:In("Glob patterns for files to exclude from aggregation (one per line). Use this for scripts that break when concatenated, such as Google Maps init scripts, payment gateway SDKs, or scripts using document.write().","simply-static"),disabled:"free"===options.plan||!c(),value:e.css_js_aggregate_exclude_patterns,placeholder:"*maps*\n*stripe*\n*paypal*",onChange:e=>{t("css_js_aggregate_exclude_patterns",e)}})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:In("Defer & Delay","simply-static")})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",In("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:In("Eliminate render-blocking CSS and JavaScript resources to improve Lighthouse scores and page load speed.","simply-static")}),(0,o.jsx)(p.ToggleControl,{label:In("Enable Defer & Delay?","simply-static"),__nextHasNoMarginBottom:!0,help:In(y?"Optimize render-blocking resources during static export.":"Don't optimize render-blocking resources.","simply-static"),disabled:"free"===options.plan||!c(),checked:y,onChange:e=>{b(e),t("use_css_optimize",e)}}),y&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.ToggleControl,{label:In("Defer Non-Critical CSS","simply-static"),__nextHasNoMarginBottom:!0,help:In('Convert non-critical stylesheets to load asynchronously using the media="print" pattern.',"simply-static"),disabled:"free"===options.plan||!c(),checked:_,onChange:e=>{v(e),t("css_optimize_defer_css",e)}}),_&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextareaControl,{label:In("Critical CSS Patterns","simply-static"),__nextHasNoMarginBottom:!0,help:In("Glob patterns for stylesheets that must remain render-blocking (one per line). Default: */style.css, */styles.css, */global.css, */theme*.css, */wp-block-*.css","simply-static"),disabled:"free"===options.plan||!c(),value:e.css_optimize_critical_patterns,placeholder:"*/style.css\n*/styles.css\n*/global.css\n*/theme*.css\n*/wp-block-*.css",onChange:e=>{t("css_optimize_critical_patterns",e)}})}),(0,o.jsx)(p.ToggleControl,{label:In("Defer Synchronous Scripts","simply-static"),__nextHasNoMarginBottom:!0,help:In("Add the defer attribute to render-blocking scripts. Preserves execution order (safe for jQuery dependencies).","simply-static"),disabled:"free"===options.plan||!c(),checked:w,onChange:e=>{S(e),t("css_optimize_defer_js",e)}}),w&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextareaControl,{label:In("Defer Exclude Patterns","simply-static"),__nextHasNoMarginBottom:!0,help:In("Additional glob patterns for scripts to exclude from deferral (one per line). Built-in patterns already exclude WordPress core scripts: jQuery, wp-i18n, wp-hooks, wp-url, wp-api-fetch, and wp-api.","simply-static"),disabled:"free"===options.plan||!c(),value:e.css_optimize_defer_js_excludes,placeholder:"*my-critical-script.js*\n*another-script*",onChange:e=>{t("css_optimize_defer_js_excludes",e)}})}),(0,o.jsx)(p.ToggleControl,{label:In("Optimize Google Fonts","simply-static"),__nextHasNoMarginBottom:!0,help:In("Preload Google Fonts stylesheets, inject the Google Fonts preconnect hint, and add display=swap for faster font loading.","simply-static"),disabled:"free"===options.plan||!c(),checked:C,onChange:e=>{j(e),t("css_optimize_google_fonts",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Add Preconnect Hints","simply-static"),__nextHasNoMarginBottom:!0,help:In("Add preconnect resource hints for high-value third-party font, icon, script, and image origins found in exported pages.","simply-static"),disabled:"free"===options.plan||!c(),checked:k,onChange:e=>{R(e),t("css_optimize_preconnect_hints",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Delay Non-Critical JavaScript","simply-static"),__nextHasNoMarginBottom:!0,help:In("Delay third-party scripts (analytics, tag managers, tracking pixels) until user interaction to reduce Total Blocking Time. Scripts load on first click, scroll, or keypress.","simply-static"),disabled:"free"===options.plan||!c(),checked:E,onChange:e=>{N(e),t("css_optimize_delay_js",e)}}),E&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(p.TextareaControl,{label:In("Additional Delay Patterns","simply-static"),__nextHasNoMarginBottom:!0,help:In("Additional glob patterns for scripts to delay (one per line). Built-in patterns already cover Google (Tag Manager, Analytics, Ads, ReCaptcha), HubSpot, Facebook/Meta Pixel, Hotjar, Clarity, Bing UET, Cloudflare (Insights, Turnstile), CleanTalk, Matomo/Piwik, Plausible, Twitter/X, LinkedIn, Pinterest, Tawk.to, Crisp, LiveChat, Intercom, Drift, Tidio, Segment, Amplitude, Mixpanel, Optimizely, Mouseflow, Lucky Orange, Crazy Egg, FullStory, LogRocket, and Sentry.","simply-static"),disabled:"free"===options.plan||!c(),value:e.css_optimize_delay_js_patterns,placeholder:"*example-tracking.com*\n*custom-analytics*",onChange:e=>{t("css_optimize_delay_js_patterns",e)}})})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[In("Image Optimization","simply-static"),(0,o.jsx)(H,{title:In("How to optimize images with ShortPixel?","simply-static"),videoUrl:"https://youtu.be/OIfKcXz3cxY"})]})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",In("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[d()&&(0,o.jsx)(L,{heading:In("Image optimization is handled by Studio","simply-static"),cta:null,children:(0,o.jsx)("p",{children:In("Studio optimizes the static build pipeline for its hosting environment, so you do not need to connect ShortPixel for Studio deployments.","simply-static")})}),(0,o.jsx)(p.ToggleControl,{label:In("Optimize Images with ShortPixel?","simply-static"),__nextHasNoMarginBottom:!0,help:e.shortpixel_enabled?In("Optimize images with the ShortPixel API.","simply-static"):In("Don't optimize images with the ShortPixel API.","simply-static"),disabled:d()||"free"===options.plan||!c(),checked:!!e.shortpixel_enabled,onChange:e=>{t("shortpixel_enabled",e)}}),e.shortpixel_enabled&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextControl,{label:In("ShortPixel API Key","simply-static"),type:"password",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e.shortpixel_api_key,disabled:d()||"free"===options.plan||!c(),onChange:e=>{t("shortpixel_api_key",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Convert to webP","simply-static"),__nextHasNoMarginBottom:!0,help:e.shortpixel_webp_enabled?In("Convert images to webp format.","simply-static"):In("Don't convert images to webp format","simply-static"),checked:!!e.shortpixel_webp_enabled,disabled:d()||"free"===options.plan||!c(),onChange:e=>{t("shortpixel_webp_enabled",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Backup the original images?","simply-static"),__nextHasNoMarginBottom:!0,help:e.shortpixel_backup_enabled?In("Back original images.","simply-static"):In("Don't backup original images.","simply-static"),checked:!!e.shortpixel_backup_enabled,disabled:d()||"free"===options.plan||!c(),onChange:e=>{t("shortpixel_backup_enabled",e)}}),e.shortpixel_backup_enabled&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,children:In("It will preserve every image which might increase your disk space usage.","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{padding:1}),(0,o.jsxs)(p.Button,{disabled:d()||G,onClick:()=>{$(!0),r()({path:"/simplystatic/v1/shortpixel-restore",method:"POST"}).then(e=>{const t=JSON.parse(e);$(!1),alert(t.message)}).catch(e=>{$(!1),alert(e.message)})},variant:"secondary",children:[!G&&In("Restore Original Images","simply-static"),G&&[(0,o.jsx)(p.Dashicon,{icon:"update spin"}),In("Restoring...","simply-static")]]})]})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:In("Critical CSS","simply-static")})}),!d()&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com/simply-static-studio/",children:[" ",In("Requires Static Studio","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("p",{children:In("Generate critical above-the-fold CSS to eliminate render-blocking stylesheets and improve page load speed. Critical CSS is generated for the homepage and injected into every page.","simply-static")}),(0,o.jsx)(p.ToggleControl,{label:In("Enable Critical CSS Generation?","simply-static"),__nextHasNoMarginBottom:!0,help:In(M?"Critical CSS will be generated during static export.":"Don't generate critical CSS.","simply-static"),disabled:!d(),checked:M,onChange:e=>{A(e),t("use_critical_css",e)}}),M&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.TextareaControl,{label:In("Additional URLs","simply-static"),__nextHasNoMarginBottom:!0,help:In("By default, critical CSS is generated from the homepage only. Add additional page URLs here (one per line) if those pages have significantly different styles.","simply-static"),disabled:!d(),value:e.critical_css_additional_urls,placeholder:"https://example.com/about\nhttps://example.com/contact",onChange:e=>{t("critical_css_additional_urls",e)}}),(0,o.jsx)(p.TextareaControl,{label:In("Custom CSS","simply-static"),__nextHasNoMarginBottom:!0,help:In("Add custom CSS that will be appended to the generated critical CSS. Use this to fix minor visual glitches.","simply-static"),disabled:!d(),value:e.critical_css_custom,placeholder:".header { position: sticky; top: 0; }",onChange:e=>{t("critical_css_custom",e)}})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("b",{children:In("Versioning","simply-static")})}),("free"===options.plan||!c())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",In("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:In("Version CSS?","simply-static"),__nextHasNoMarginBottom:!0,help:In(z?"Appends a version query string to CSS files.":"Don't append a version query string to CSS files.","simply-static"),disabled:"free"===options.plan||!c(),checked:z,onChange:e=>{O(e),t("version_css",e)}}),(0,o.jsx)(p.ToggleControl,{label:In("Version JavaScript?","simply-static"),__nextHasNoMarginBottom:!0,help:In(W?"Appends a version query string to JavaScript files.":"Don't append a version query string to JavaScript files.","simply-static"),disabled:"free"===options.plan||!c(),checked:W,onChange:e=>{U(e),t("version_js",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:In("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:"pro"===options.plan&&c()&&(0,o.jsx)(p.Button,{onClick:()=>{n(),s(!0),setTimeout(function(){s(!1)},2e3)},variant:"primary",children:In("Save Settings","simply-static")})})]})},{__:Hn}=wp.i18n,An=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:r,isPro:s}=(0,i.useContext)(l),[c,d]=(0,i.useState)("wp-content"),[u,m]=(0,i.useState)("wp-includes"),[h,g]=(0,i.useState)("uploads"),[x,f]=(0,i.useState)("plugins"),[y,b]=(0,i.useState)("themes"),[_,v]=(0,i.useState)("style"),[w,S]=(0,i.useState)("author"),[C,j]=(0,i.useState)(!1),[k,R]=(0,i.useState)(!1),[E,N]=(0,i.useState)(!1),[P,B]=(0,i.useState)(!1),[D,T]=(0,i.useState)(!1),[F,I]=(0,i.useState)(!1),[M,A]=(0,i.useState)(!1),[L,z]=(0,i.useState)(!1),[O,W]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{e.wp_content_directory&&d(e.wp_content_directory),e.wp_includes_directory&&m(e.wp_includes_directory),e.wp_uploads_directory&&g(e.wp_uploads_directory),e.wp_plugins_directory&&f(e.wp_plugins_directory),e.wp_themes_directory&&b(e.wp_themes_directory),e.theme_style_name&&v(e.theme_style_name),e.author_url&&S(e.author_url),e.hide_version&&j(e.hide_version),e.hide_generator&&N(e.hide_generator),e.hide_prefetch&&R(e.hide_prefetch),e.hide_rsd&&B(e.hide_rsd),e.hide_emotes&&T(e.hide_emotes),e.disable_xmlrpc&&I(e.disable_xmlrpc),e.disable_embed&&A(e.disable_embed),e.disable_db_debug&&z(e.disable_db_debug),e.disable_wlw_manifest&&W(e.disable_wlw_manifest)},[e]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[Hn("Replace","simply-static"),(0,o.jsx)(H,{title:Hn("How to replace WP default paths","simply-static"),videoUrl:"https://youtu.be/GedyNJJMGaY"})]})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Hn("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:Hn("wp-content directory","simply-static"),help:Hn('Replace the "wp-content" directory.',"simply-static"),disabled:"free"===options.plan||!s(),type:"text",placeholder:"wp-content",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c,onChange:e=>{t("wp_content_directory",e)}}),(0,o.jsx)(p.TextControl,{label:Hn("wp-includes directory","simply-static"),help:Hn('Replace the "wp-includes" directory.',"simply-static"),disabled:"free"===options.plan||!s(),type:"text",placeholder:"wp-includes",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:u,onChange:e=>{t("wp_includes_directory",e)}}),(0,o.jsxs)("div",{className:"ss-directory-input-group",children:[(0,o.jsx)("label",{className:"components-base-control__label",children:Hn("Uploads directory","simply-static")}),(0,o.jsxs)(p.Flex,{align:"flex-start",gap:0,children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.TextControl,{disabled:!0,type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c+"/",className:"ss-directory-prefix"})}),(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsx)(p.TextControl,{disabled:"free"===options.plan||!s(),type:"text",placeholder:"uploads",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:h,onChange:e=>{g(e),t("wp_uploads_directory",e)}})})]}),(0,o.jsx)("p",{className:"components-base-control__help",children:Hn('Replace the "wp-content/uploads" directory.',"simply-static")})]}),(0,o.jsxs)("div",{className:"ss-directory-input-group",children:[(0,o.jsx)("label",{className:"components-base-control__label",children:Hn("Plugins directory","simply-static")}),(0,o.jsxs)(p.Flex,{align:"flex-start",gap:0,children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.TextControl,{disabled:!0,type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c+"/",className:"ss-directory-prefix"})}),(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsx)(p.TextControl,{disabled:"free"===options.plan||!s(),type:"text",placeholder:"plugins",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:x,onChange:e=>{f(e),t("wp_plugins_directory",e)}})})]}),(0,o.jsx)("p",{className:"components-base-control__help",children:Hn('Replace the "wp-content/plugins" directory.',"simply-static")})]}),(0,o.jsxs)("div",{className:"ss-directory-input-group",children:[(0,o.jsx)("label",{className:"components-base-control__label",children:Hn("Themes directory","simply-static")}),(0,o.jsxs)(p.Flex,{align:"flex-start",gap:0,children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.TextControl,{disabled:!0,type:"text",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:c+"/",className:"ss-directory-prefix"})}),(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsx)(p.TextControl,{disabled:"free"===options.plan||!s(),type:"text",placeholder:"themes",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:y,onChange:e=>{b(e),t("wp_themes_directory",e)}})})]}),(0,o.jsx)("p",{className:"components-base-control__help",children:Hn('Replace the "wp-content/themes" directory.',"simply-static")})]}),(0,o.jsx)(p.__experimentalInputControl,{label:Hn("Theme style name","simply-static"),help:Hn("Replace the style.css filename.","simply-static"),disabled:"free"===options.plan||!s(),type:"text",className:"ss-theme-style-name",suffix:".css",placeholder:"style",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:_,onChange:e=>{v(e),t("theme_style_name",e)}}),(0,o.jsx)(p.TextControl,{label:Hn("Author URL","simply-static"),help:Hn("Replace the author url.","simply-static"),disabled:"free"===options.plan||!s(),type:"text",placeholder:"author",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:w,onChange:e=>{S(e),t("author_url",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[Hn("Hide","simply-static"),(0,o.jsx)(H,{title:Hn("How to hide and disable WP core features","simply-static"),videoUrl:"https://youtu.be/GijIsrfFB8o"})]})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Hn("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:Hn("Hide WordPress Version","simply-static"),__nextHasNoMarginBottom:!0,checked:C,disabled:"free"===options.plan||!s(),onChange:e=>{j(e),t("hide_version",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Hide WordPress Generator Meta","simply-static"),__nextHasNoMarginBottom:!0,checked:E,disabled:"free"===options.plan||!s(),onChange:e=>{N(e),t("hide_generator",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Hide DNS Prefetch WordPress link","simply-static"),__nextHasNoMarginBottom:!0,checked:k,disabled:"free"===options.plan||!s(),onChange:e=>{R(e),t("hide_prefetch",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Hide RSD Header","simply-static"),__nextHasNoMarginBottom:!0,checked:P,disabled:"free"===options.plan||!s(),onChange:e=>{B(e),t("hide_rsd",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)("b",{children:[Hn("Disable","simply-static"),(0,o.jsx)(H,{title:Hn("How to hide and disable WP core features","simply-static"),videoUrl:"https://youtu.be/GijIsrfFB8o"})]})}),("free"===options.plan||!s())&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsxs)(p.ExternalLink,{href:"https://simplystatic.com",children:[" ",Hn("Requires Simply Static Pro","simply-static")]})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:Hn("Disable XML-RPC","simply-static"),__nextHasNoMarginBottom:!0,checked:F,disabled:"free"===options.plan||!s(),onChange:e=>{I(e),t("disable_xmlrpc",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Disable Embed Scripts","simply-static"),__nextHasNoMarginBottom:!0,checked:M,disabled:"free"===options.plan||!s(),onChange:e=>{A(e),t("disable_embed",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Disable DB Debug in Frontend","simply-static"),__nextHasNoMarginBottom:!0,checked:L,disabled:"free"===options.plan||!s(),onChange:e=>{z(e),t("disable_db_debug",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Disable WLW Manifest Scripts","simply-static"),__nextHasNoMarginBottom:!0,checked:O,disabled:"free"===options.plan||!s(),onChange:e=>{W(e),t("disable_wlw_manifest",e)}}),(0,o.jsx)(p.ToggleControl,{label:Hn("Disable Emojis","simply-static"),__nextHasNoMarginBottom:!0,checked:D,disabled:"free"===options.plan||!s(),onChange:e=>{T(e),t("hide_emotes",e)}})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:Hn("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),(0,o.jsx)("div",{className:"save-settings",children:"pro"===options.plan&&s()&&(0,o.jsx)(p.Button,{onClick:()=>{n(),r(!0),setTimeout(function(){r(!1)},2e3)},variant:"primary",children:Hn("Save Settings","simply-static")})})]})},{__:Ln}=wp.i18n,zn=function(){const{settings:e,updateSetting:t,saveSettings:n,settingsSaved:a,setSettingsSaved:s,isPro:c}=(0,i.useContext)(l),d="function"!=typeof c||!!c(),[u,m]=(0,i.useState)([]),[h,g]=(0,i.useState)({}),[x,f]=(0,i.useState)([]),[y,b]=(0,i.useState)([]),[_,v]=(0,i.useState)({}),[w,S]=(0,i.useState)([]),[C,j]=(0,i.useState)(!0),[k,R]=(0,i.useState)(!1),[E,N]=(0,i.useState)(!1),[P,B]=(0,i.useState)(3),[D,T]=(0,i.useState)(""),[F,I]=(0,i.useState)(["export","update","build","single"]),[M,H]=(0,i.useState)(!0),[A,L]=(0,i.useState)(!0),[z,O]=(0,i.useState)(!1),[W,U]=(0,i.useState)(!1),[G,$]=(0,i.useState)([]),[q,K]=(0,i.useState)([]),[V,J]=(0,i.useState)({}),[Y,X]=(0,i.useState)([]);return(0,i.useEffect)(()=>{if(j(!1!==e.ss_use_single_exports),R(!!e.ss_single_export_add_xml_sitemap),r()({path:"/simplystatic/v1/pages"}).then(t=>{const n=t.map(e=>e.label),i={};t.forEach(e=>i[e.label]=e.value),m(n),g(i);const a=Array.isArray(e.ss_single_pages)?e.ss_single_pages:[];if(a.length>0){const e=a.map(e=>{const n=t.find(t=>String(t.value)===String(e));return n?n.label:String(e)});f(e)}}),r()({path:"/simplystatic/v1/taxonomies"}).then(t=>{const n=t.map(e=>e.label),i={};t.forEach(e=>i[e.label]=e.value),b(n),v(i);const a=Array.isArray(e.ss_single_taxonomy_archives)?e.ss_single_taxonomy_archives:[];if(a.length>0){const e=a.map(e=>{const n=t.find(t=>String(t.value)===String(e));return n?n.label:String(e)});S(e)}}),r()({path:"/simplystatic/v1/post-types",parse:!0}).then(e=>{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return void $([])}let t=Array.isArray(e)?e:e&&e.data?e.data:[];$(t)}),H(!!e.ss_single_include_archives||void 0===e.ss_single_include_archives),L(!!e.ss_single_include_pagination||void 0===e.ss_single_include_pagination),O(!!e.ss_use_builds),U(!!e.ss_tools_submenu),N(!!e.ss_single_auto_export),void 0!==e.ss_single_auto_export_delay){const t=parseInt(e.ss_single_auto_export_delay,10);B(Number.isNaN(t)?3:Math.max(0,t))}else B(3);T(e.ss_webhook_url||e.ss_single_export_webhook_url||"");Array.isArray(e.ss_webhook_enabled_types)&&e.ss_webhook_enabled_types.length?I(e.ss_webhook_enabled_types):I(e.ss_single_export_webhook_url&&e.ss_single_export_webhook_url.length?["single"]:["export","update","build","single"])},[e.ss_single_pages,e.ss_single_taxonomy_archives,e.ss_use_builds]),(0,i.useEffect)(()=>{if(!G.length)return K([]),void J({});const n=G.map(e=>e.label),i={};G.forEach(e=>i[e.label]=e.name),K(n),J(i);const a=Array.isArray(e.ss_single_auto_export_types)?e.ss_single_auto_export_types:[],r=a.filter(e=>G.some(t=>String(t.name)===String(e))),s=r.map(e=>G.find(t=>String(t.name)===String(e)).label);X(s),Array.isArray(e.ss_single_auto_export_types)&&a.length!==r.length&&t("ss_single_auto_export_types",r)},[G,e.ss_single_auto_export_types]),(0,o.jsxs)("div",{className:"inner-settings",children:[(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("strong",{children:Ln("Single Push","simply-static")})}),("free"===options.plan||!d)&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.ExternalLink,{href:"https://simplystatic.com",children:Ln("Requires Simply Static Pro","simply-static")})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.ToggleControl,{label:Ln("Use Single Push?","simply-static"),help:Ln(C?"Quickly push updates to your static site while editing pages/posts.":"Do not allow quick updates while editing posts/pages.","simply-static"),checked:!!C,disabled:!d,onChange:e=>{d&&(j(e),t("ss_use_single_exports",e))}}),C&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.ToggleControl,{label:Ln("Use Auto Push?","simply-static"),help:Ln(E?"Automatically schedule a Single Push when a post/page is updated/published.":"Do not automatically run Single Push when a post/page is updated/published.","simply-static"),checked:!!E,disabled:!d,onChange:e=>{d&&(N(e),t("ss_single_auto_export",e))}}),E&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.FormTokenField,{label:Ln("Auto Push Post Types","simply-static"),__next40pxDefaultSize:!0,value:Y,suggestions:q,onChange:e=>{if(!d)return;const n=Object.values(V),i=e.map(e=>V[e]?V[e]:n.includes(e)?e:null).filter(Boolean),a=i.map(e=>{const t=Object.entries(V).find(([,t])=>t===e);return t?t[0]:e});X(a),t("ss_single_auto_export_types",i)},help:Ln("Choose which public post types should trigger automatic single pushes when updated. If none is selected, all public post types are used.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field",disabled:!d}),(0,o.jsx)("p",{className:"description",children:Ln("Choose which public post types should trigger automatic single pushes when updated. If none is selected, all public post types are used.","simply-static")})]}),E&&(0,o.jsx)(p.__experimentalInputControl,{label:Ln("Auto push delay (seconds)","simply-static"),help:Ln("Delay before the automatic Single Push starts after a change is detected.","simply-static"),type:"number",min:0,value:P,disabled:!d,onChange:e=>{if(!d)return;const n=parseInt(e,10),i=Number.isNaN(n)?0:Math.max(0,n);B(i),t("ss_single_auto_export_delay",i)}}),(0,o.jsx)(p.FormTokenField,{label:Ln("Pages to update","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:x,suggestions:u,onChange:e=>{if(!d)return;f(e);const n=e.map(e=>{if(h[e])return h[e];const t=parseInt(e,10);return isNaN(t)?null:t}).filter(e=>null!==e);t("ss_single_pages",n)},help:Ln("Select which pages should start a Single Push. If none selected, we use your homepage.","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:200,className:"horizontal-token-field",disabled:!d}),(0,o.jsx)("p",{className:"description",children:Ln("Choose which pages/files should be updated when running a Single Push.","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{margin:2}),(0,o.jsx)(p.FormTokenField,{label:Ln("Taxonomy Archives","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:w,suggestions:y,onChange:e=>{if(!d)return;S(e);const n=e.map(e=>_[e]?_[e]:e).filter(Boolean);t("ss_single_taxonomy_archives",n)},help:Ln("Choose which taxonomy archives to include for selected pages/posts (e.g., Categories, Tags, or custom taxonomies).","simply-static"),tokenizeOnSpace:!1,__experimentalExpandOnFocus:!0,__experimentalShowHowTo:!1,maxSuggestions:100,className:"horizontal-token-field",disabled:!d}),(0,o.jsx)("p",{className:"description",children:Ln("Choose which taxonomies should be updated when running a Single Push.","simply-static")}),(0,o.jsx)(p.__experimentalSpacer,{margin:2}),(0,o.jsx)(p.ToggleControl,{label:Ln("Update archives (author/date/post_type)","simply-static"),help:Ln(M?"Update archive URLs when running a Single Push.":"Do not update archive URLs.","simply-static"),checked:!!M,disabled:!d,onChange:e=>{d&&(H(e),t("ss_single_include_archives",e))}}),(0,o.jsx)(p.ToggleControl,{label:Ln("Update pagination","simply-static"),help:Ln(A?"Update pagination URLs when running a Single Push.":"Do not update pagination URLs.","simply-static"),checked:!!A,disabled:!d,onChange:e=>{d&&(L(e),t("ss_single_include_pagination",e))}}),(0,o.jsx)(p.ToggleControl,{label:Ln("Update XML sitemap","simply-static"),help:Ln(k?"Update XML sitemaps when running a Single Push.":"Do not update XML sitemaps.","simply-static"),checked:!!k,disabled:!d,onChange:e=>{d&&(R(e),t("ss_single_export_add_xml_sitemap",e))}})]})]})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("strong",{children:Ln("Builds","simply-static")})}),("free"===options.plan||!d)&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.ExternalLink,{href:"https://simplystatic.com",children:Ln("Requires Simply Static Pro","simply-static")})})]})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.ToggleControl,{label:Ln("Enable Builds","simply-static"),help:Ln(z?"Use builds to quickly update a list of pages and files on your static site.":"Builds are disabled.","simply-static"),checked:!!z,disabled:!d,onChange:e=>{d&&(O(e),t("ss_use_builds",e))}})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("strong",{children:Ln("Tools Submenu","simply-static")})}),("free"===options.plan||!d)&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.ExternalLink,{href:"https://simplystatic.com",children:Ln("Requires Simply Static Pro","simply-static")})})]})}),(0,o.jsx)(p.CardBody,{children:(0,o.jsx)(p.ToggleControl,{label:Ln("Move menu to Tools submenu","simply-static"),help:Ln(W?"The Simply Static menu is placed under the Tools menu in the admin sidebar.":"The Simply Static menu is shown as a top-level item in the admin sidebar.","simply-static"),checked:!!W,disabled:!d,onChange:e=>{d&&(U(e),t("ss_tools_submenu",e))}})})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Card,{children:[(0,o.jsx)(p.CardHeader,{children:(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)("strong",{children:Ln("Webhook","simply-static")})}),("free"===options.plan||!d)&&(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.ExternalLink,{href:"https://simplystatic.com",children:Ln("Requires Simply Static Pro","simply-static")})})]})}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)(p.TextControl,{label:Ln("Webhook URL","simply-static"),placeholder:"https://example.com/webhook-endpoint",value:D,disabled:!d,onChange:e=>{d&&(T(e),t("ss_webhook_url",e))},help:Ln("Simply Static will POST a JSON payload to this URL after pushes finish.","simply-static")}),(0,o.jsx)("p",{className:"description",children:Ln("Fire for these push types:","simply-static")}),(0,o.jsx)("div",{className:"ss-webhook-types",children:["export","update","build","single"].map(e=>(0,o.jsx)(p.ToggleControl,{label:Ln("export"===e?"Full Site":"update"===e?"Update":"build"===e?"Build":"Single","simply-static"),checked:F.includes(e),disabled:!d,onChange:n=>{if(!d)return;const i=new Set(F);n?i.add(e):i.delete(e);const a=Array.from(i);I(a),t("ss_webhook_enabled_types",a)}},e))}),(0,o.jsx)("p",{className:"description",children:Ln("Payload includes event, site_url, export_type, identifiers (when available), timestamp, and success.","simply-static")})]})]}),a&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"success",isDismissible:!1,children:(0,o.jsx)("p",{children:Ln("Settings saved successfully.","simply-static")})})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5})]}),d&&(0,o.jsx)("div",{className:"save-settings",children:(0,o.jsx)(p.Button,{onClick:()=>{d&&(n(),s(!0),setTimeout(()=>s(!1),2e3))},variant:"primary",children:Ln("Save Settings","simply-static")})})]})},{__:On}=wp.i18n,Wn=function(){const{isPro:e,isStudio:t}=(0,i.useContext)(l);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("h4",{className:"settings-headline",children:On("Version","simply-static")}),"pro"===options.plan&&e()?(0,o.jsx)(o.Fragment,{children:t()?(0,o.jsxs)("p",{className:"version-number",children:["Free: ",(0,o.jsx)("b",{children:options.version}),(0,o.jsx)("br",{}),"Pro: ",(0,o.jsx)("b",{children:options.version_pro}),(0,o.jsx)("br",{}),"Studio: ",(0,o.jsx)("b",{children:options.version_studio})]}):(0,o.jsxs)("p",{className:"version-number",children:["Free: ",(0,o.jsx)("b",{children:options.version}),(0,o.jsx)("br",{}),"Pro: ",(0,o.jsx)("b",{children:options.version_pro})]})}):(0,o.jsxs)("p",{className:"version-number",children:["Version: ",(0,o.jsx)("b",{children:options.version})]})]})},{__:Un}=wp.i18n,Gn=function(e=null){const{isPro:t}=(0,i.useContext)(l);return(0,o.jsxs)(p.Card,{className:"plugin-nav",children:[(0,o.jsx)("div",{className:"plugin-logo",children:(0,o.jsx)("img",{alt:"Logo",src:options.logo})}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsx)(p.__experimentalSpacer,{margin:5}),(0,o.jsxs)(p.Button,{href:"https://simplystatic.com/changelogs/",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"editor-ul"})," ",Un("Changelog","simply-static")]}),(0,o.jsxs)(p.Button,{href:"https://docs.simplystatic.com",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-links"})," ",Un("Documentation","simply-static")]}),"free"===options.plan&&(0,o.jsxs)(p.Button,{href:"https://simplystatic.com",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-site-alt3"}),"Simply Static Pro"]}),(0,o.jsx)(Wn,{})]})},{__:$n}=wp.i18n;function qn({onClose:e,setSelectableEnvironments:t,setSelectedEnvironment:n}){const[a,s]=(0,i.useState)(""),[l,c]=(0,i.useState)(!1);return(0,o.jsxs)("div",{className:"ss-environment-form",children:[(0,o.jsx)(p.TextControl,{label:"Name",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>s(e),value:a}),(0,o.jsx)("p",{children:$n("A new environment will be created with the current configuration.","simply-static")}),(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexBlock,{children:(0,o.jsx)(p.Button,{variant:"primary",onClick:()=>{c(!0),r()({path:"/simplystatic/v1/environment",method:"POST",data:{title:a}}).then(i=>{let a=Object.keys(i.environments).map(function(e){return{label:i.environments[e],value:e}});t(a),n(i.current_environment),e()}).catch(e=>{alert(e.message)}).finally(()=>c(!1))},isBusy:l,children:$n(l?"Creating...":"Create","simply-static")})}),(0,o.jsx)(p.FlexBlock,{children:(0,o.jsx)(p.Button,{variant:"secondary",onClick:e,children:$n("Cancel","simply-static")})})]})]})}const{__:Kn}=wp.i18n;function Vn({onChange:e,current:t,environments:n,disabled:i,onDelete:a,isStudio:r}){const s=Kn(r?"Choose an environment. If you like to create new ones, please set them up in your Static Studio dashboard.":"Choose an environment or create a new one to configure settings.","simply-static");return(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{style:{minWidth:"80%"},children:(0,o.jsx)(p.SelectControl,{disabled:i,value:t,options:n,help:s,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e})}),(0,o.jsx)(p.FlexItem,{children:(0,o.jsx)(p.Button,{className:"environment-delete-button",variant:"tertiary",label:Kn("Delete selected environment","simply-static"),size:"small",icon:"trash",disabled:i,onClick:a})})]})}const{__:Jn}=wp.i18n;function Yn({getSettings:e,isRunning:t}){const{getIntegrationById:n,isStudio:a}=(0,i.useContext)(l),s=()=>{try{if("undefined"==typeof options)return!1;if("pro"!==options.plan)return!1;const e=n?n("environments"):null;return!(!e||!e.active&&!e.can_run)}catch(e){return!1}},[c,d]=(0,i.useState)(""),[u,m]=(0,i.useState)([]),[h,g]=(0,i.useState)(!1),[x,f]=(0,i.useState)(!1),y=!!a&&a();return(0,i.useEffect)(()=>{s()&&r()({path:"/simplystatic/v1/environment",method:"GET"}).then(e=>{let t=Object.keys(e.environments).map(function(t){return{label:e.environments[t],value:t}});m(t),d(e.current_environment)}).catch(e=>{})},[]),(0,i.useEffect)(()=>{y&&g(!1)},[y]),(0,o.jsxs)("div",{className:"environment-container",children:[(0,o.jsxs)("h4",{className:"settings-headline",children:[" ",Jn("Environment","simply-static")]}),!h&&c&&(0,o.jsxs)("p",{children:["Current: ",(0,o.jsx)("strong",{children:x?Jn("Changing ...","simply-static"):u.filter(e=>e.value===c).pop().label})]}),!h&&u.length>0&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Vn,{onChange:t=>{f(!0),s()?r()({path:"/simplystatic/v1/environment",method:"PUT",data:{version:t}}).then(()=>{e(),d(t)}).catch(e=>alert(e.message)).finally(()=>{f(!1)}):f(!1)},environments:u,onDelete:()=>{f(!0),s()?r()({path:"/simplystatic/v1/environment",method:"DELETE",data:{version:c}}).then(t=>{e();let n=Object.keys(t.environments).map(function(e){return{label:t.environments[e],value:e}});m(n),d(t.current_environment)}).catch(e=>alert(e.message)).finally(()=>{f(!1)}):f(!1)},current:c,disabled:t||x,isStudio:y}),(0,o.jsx)("div",{className:"environment-extension-slot","data-ss-environment-sidebar-slot":!0})]}),!h&&!y&&(0,o.jsx)(p.Button,{disabled:t||x,variant:"primary",size:"large",onClick:()=>g(!0),children:"Create an Environment"}),h&&!y&&(0,o.jsx)(qn,{onClose:()=>g(!1),setSelectedEnvironment:d,setSelectableEnvironments:m})]})}function Xn(e){if(!e||"object"!=typeof e)return null;const t=e.snapshot_rollback&&"object"==typeof e.snapshot_rollback?e.snapshot_rollback:{};return e.rollback_running||t.running?{...t,running:!0}:null}const{__:Qn,sprintf:Zn}=wp.i18n,ei=(e,t)=>"string"==typeof e&&e.trim()?e.trim():t,ti=(e,t)=>{if(e&&e.data){const t=ei(e.data.message,"");if(t)return t}return ei(e&&e.message,t)},ni=function(e=null){const{isRunning:t,setIsRunning:n,isResumed:a,setIsResumed:c,isPaused:d,setIsPaused:u,blogId:m,settings:h,updateFromNetwork:g,getSettings:x,isPro:f,canRunIntegration:y,showMobileNav:b,setShowMobileNav:_,isDelayed:v,snapshotRollback:w,setSnapshotRollback:S,isRollbackRunning:C}=(0,i.useContext)(l),{activeItem:j,setActiveItem:k}=e,[R,E]=(0,i.useState)(!1),[N,P]=(0,i.useState)("current"),[B,D]=(0,i.useState)([]),[T,F]=(0,i.useState)(!1),[I,M]=(0,i.useState)("export"),[H,A]=(0,i.useState)(!0),[L,z]=(0,i.useState)(!1),[O,W]=(0,i.useState)(0),U=(0,i.useRef)(!1),G=(0,i.useRef)(!1),$=w&&w.message?w.message:Qn("Rollback in progress. Simply Static export actions are locked until the rollback has finished.","simply-static"),q=w&&w.progress?w.progress:{},K=q.label?`${q.label}${q.total?` (${q.percent||0}%, ${q.completed||0}/${q.total})`:""}`:$,V=()=>{options.is_multisite&&r()({path:"/simplystatic/v1/check-can-run",method:"GET"}).then(e=>{JSON.parse(e).can_run?A(!0):A(!1)}).catch(()=>{})};s(()=>{V()},options.is_multisite&&!t?1e5:null),(0,i.useEffect)(()=>{options.is_multisite&&V()},[]),(0,i.useEffect)(()=>{if(E(t||d||C),options.selectable_sites&&!options.is_network&&options.is_multisite){let e=options.selectable_sites.slice().sort(function(e,t){return(e.name||"").localeCompare(t.name||"")}).map(function(e){return{label:`${e.name} (#${e.blog_id})`,value:e.blog_id}});e.unshift({label:Qn("Use current settings","simply-static"),value:"current"}),D(e)}},[options,t,d,C]),(0,i.useEffect)(()=>{r()({path:"/simplystatic/v1/unpushed-changes",method:"GET"}).then(e=>{const t=JSON.parse(e),n=t.data?t.data.total:0;W(n),U.current||G.current||(n>0&&"pro"===options.plan&&f()?M("update"):M("export"),U.current=!0)}).catch(()=>{W(0),U.current||G.current||(M("export"),U.current=!0)})},[h,t]);const J=(e,t,n)=>r()({path:e,method:"POST",data:{blog_id:m}}).then(e=>(((e,t)=>{let n=e;if("string"==typeof e)try{n=JSON.parse(e)}catch(e){throw new Error(t)}if(!n||"object"!=typeof n||Array.isArray(n))throw new Error(t);const i=Number(n.status);if(!Number.isInteger(i)||i<200||i>=300)throw new Error(ei(n.message,t))})(e,n),t(),!0)).catch(e=>(alert(ti(e,n)),!1));let Y="";if(Object.keys(options.builds).length){const e=Object.keys(options.builds).map(e=>(0,o.jsx)("option",{value:e,children:options.builds[e]},e));e.sort((e,t)=>e.props.children.localeCompare(t.props.children)),Y=(0,o.jsx)("optgroup",{label:"Builds",children:e})}const X=options.integrations&&options.integrations.multilingual?options.integrations.multilingual:{},Q=(void 0===options.can_export_languages||options.can_export_languages)&&"pro"===options.plan&&f()&&y("multilingual")&&X.can_run,Z=Q?(()=>{const e=options.languages||options.multilingual_languages||options.available_languages||[];let t=[];return t=Array.isArray(e)?e.map(e=>"string"==typeof e?{label:e,value:e}:{label:e.label||e.name||e.native_name||e.code||e.slug,value:e.value||e.code||e.slug||e.locale}):Object.keys(e).map(t=>{const n=e[t];return{label:"string"==typeof n?n:n.label||n.name||n.native_name||t,value:"string"==typeof n?t:n.value||n.code||n.slug||n.locale||t}}),t=t.filter(e=>e.label&&e.value),t})():[];let ee="";Z.length&&(ee=(0,o.jsx)("optgroup",{label:Qn("Languages","simply-static"),children:Z.map(e=>(0,o.jsx)("option",{value:`language:${e.value}`,children:e.label},e.value))})),(0,i.useEffect)(()=>{Q||0!==I.indexOf("language:")||M("export")},[Q,I]);const te=e=>{try{return!options.allowed_pages||options.allowed_pages.includes(e)}catch(e){return!0}},ne=["/","/diagnostics"].some(te),ie=["/general","/deployment","/forms","/search","/optimize","/hide-wp","/workflow"].some(te),ae=["/integrations","/utilities","/debug","/uam"].some(te);return(0,o.jsxs)(p.Card,{className:"plugin-nav",children:[(0,o.jsx)("div",{className:"plugin-logo",children:(0,o.jsx)("img",{alt:"Logo",src:options.logo})}),(0,o.jsxs)("div",{className:`generate-container ${R&&!C?"generating":""} ${C?"rollback-locked":""}`,children:[(0,o.jsxs)(p.SelectControl,{className:"generate-type",value:I,disabled:R,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>{G.current=!0,M(e)},children:[(0,o.jsx)("option",{value:"export",children:Qn("Full Site","simply-static")}),"pro"===options.plan&&f()?(0,o.jsx)("option",{value:"update",children:Qn("Changes Only","simply-static")}):(0,o.jsx)("option",{disabled:!0,value:"update",children:Qn("Changes Only (Requires Simply Static Pro)","simply-static")}),Y,ee]}),H&&!C&&(0,o.jsx)(kn,{canGenerate:!R,startExport:()=>{if(C)return void alert($);E(!0),c(!1),u(!1);const e="language:",i=0===I.indexOf(e);r()({path:"/simplystatic/v1/start-export",method:"POST",data:{blog_id:m,type:i?"export":I,language:i?I.replace(e,""):""}}).then(e=>{var i=JSON.parse(e);if(500===i.status)return alert(i.message),void E(!1);if(409===i.status){const e=i.message||$,n=Xn(i);return n&&S({...n,status:n,message:e}),alert(e),void E(!!n||t||d||C)}n(!0)}).catch(e=>{const n=e&&e.data&&409===e.data.status?Xn(e.data):null,i=e.message||$;n&&S({...n,status:n,message:i}),alert(i),E(!!n||t||d||C)})},cancelExport:()=>{const e=Qn("The export could not be cancelled. Please try again.","simply-static");return J("/simplystatic/v1/cancel-export",()=>{c(!1),u(!1),n(!1),E(!1)},e)},pauseExport:()=>{const e=Qn("The export could not be paused. Please try again.","simply-static");return J("/simplystatic/v1/pause-export",()=>{n(!1),c(!1),u(!0)},e)},resumeExport:()=>{const e=Qn("The export could not be resumed. Please try again.","simply-static");return J("/simplystatic/v1/resume-export",()=>{c(!0),u(!1),n(!0)},e)},isRunning:t,isPaused:d,isResumed:a,isDelayed:v,buttonLabel:Qn("Push","simply-static")}),C&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Button,{disabled:!0,className:"generate rollback-locked-button",children:[(0,o.jsx)(p.Dashicon,{icon:"update"}),Qn("Rollback in progress","simply-static")]}),(0,o.jsx)(p.Notice,{status:"warning",isDismissible:!1,className:"rollback-lock-sidebar-notice",children:(0,o.jsx)("p",{children:K})})]}),O>0&&!C&&!t&&!d&&"pro"===options.plan&&f()&&(0,o.jsx)(p.Notice,{status:"info",isDismissible:!1,className:"unpushed-changes-notice",children:(0,o.jsx)("p",{children:Zn(Qn("You have %d unpushed changes.","simply-static"),O)})}),O>0&&!C&&!t&&!d&&!("pro"===options.plan&&f())&&(0,o.jsx)(p.Tooltip,{text:Qn("Upgrade to Simply Static Pro to push only changes.","simply-static"),children:(0,o.jsx)(p.Notice,{status:"info",isDismissible:!1,className:"unpushed-changes-notice",children:(0,o.jsx)("p",{children:Zn(Qn("You have %d unpushed changes.","simply-static"),O)})})}),!C&&!H&&options.is_multisite&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Button,{disabled:!0,className:"generate",children:[(0,o.jsx)(p.Dashicon,{icon:"update"}),Qn("Push","simply-static")]}),(0,o.jsx)(p.Button,{target:"_blank",variant:"link",href:"https://simplystatic.com/pricing/",children:Qn("A push from another site is running. Upgrade to queue them.","simply-static")}),(0,o.jsx)(p.Button,{variant:"link",isBusy:L,disabled:L,onClick:()=>{z(!0),r()({path:"/simplystatic/v1/reset-export-lock",method:"POST"}).then(()=>{A(!0)}).catch(()=>{A(!1)}).finally(()=>{z(!1)})},children:Qn("Reset push lock","simply-static")})]})]}),(0,o.jsxs)(p.CardBody,{children:["pro"===options.plan&&f()&&(0,o.jsx)(o.Fragment,{children:!options.is_network&&y("environments")&&(0,o.jsx)(Yn,{isRunning:t||C,getSettings:x})}),!options.is_network&&options.is_multisite&&(0,o.jsxs)("div",{className:"import-container",children:[(0,o.jsxs)("h4",{className:"settings-headline",children:[" ",Qn("Import","simply-static")]}),(0,o.jsx)(p.SelectControl,{value:N,options:B,help:Qn("Choose a subsite to import settings from.","simply-static"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:e=>{P(e)}}),"current"!==N&&(0,o.jsx)(p.Button,{isPrimary:!0,isBusy:T,disabled:T,onClick:()=>{(e=>{F(!0);const t=Qn("The settings could not be imported. Please try again.","simply-static");Promise.resolve().then(()=>g(e)).then(()=>(window.location.reload(),!0)).catch(e=>(alert(ti(e,t)),!1)).finally(()=>{F(!1)})})(N)},children:Qn("Import Settings","simply-static")}),T?(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsx)(p.Notice,{status:"info",isDismissible:!1,className:"upgrade-network-notice",children:(0,o.jsx)("p",{children:Qn("Importing settings…","simply-static")})})}):""]}),ne&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("h4",{className:"settings-headline",children:[" ",Qn("Tools","simply-static")]}),te("/")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/"),_(!b)},className:"/"===j?"is-active-item generate":"generate",path:"/",children:[(0,o.jsx)(p.Dashicon,{icon:"update"})," ",Qn("Activity Log","simply-static")]}),te("/diagnostics")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/diagnostics"),_(!b)},className:"/diagnostics"===j?"is-active-item":"",path:"/diagnostics",children:[(0,o.jsx)(p.Dashicon,{icon:"bell"})," ",Qn("Diagnostics","simply-static")]})]})]}),ie&&(0,o.jsxs)(p.CardBody,{children:[(0,o.jsxs)("h4",{className:"settings-headline",children:[" ",Qn("Settings","simply-static")]}),te("/general")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/general"),_(!b)},className:"/general"===j?"is-active-item":"",path:"/general",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-generic"})," ",Qn("General","simply-static")]}),!options.is_network&&te("/deployment")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/deployment"),_(!b)},className:"/deployment"===j?"is-active-item":"",path:"/deployment",children:[(0,o.jsx)(p.Dashicon,{icon:"migrate"})," ",Qn("Deploy","simply-static")]}),!options.is_network&&(0,o.jsxs)(o.Fragment,{children:[te("/forms")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/forms"),_(!b)},className:"/forms"===j?"is-active-item":"",path:"/forms",children:[(0,o.jsx)(p.Dashicon,{icon:"align-center"})," ",Qn("Forms","simply-static")]}),te("/search")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/search"),_(!b)},className:"/search"===j?"is-active-item":"",path:"/search",children:[(0,o.jsx)(p.Dashicon,{icon:"search"})," ",Qn("Search","simply-static")]}),te("/optimize")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/optimize"),_(!b)},className:"/optimize"===j?"is-active-item":"",path:"/optimize",children:[(0,o.jsx)(p.Dashicon,{icon:"dashboard"})," ",Qn("Optimize","simply-static")]}),te("/hide-wp")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/hide-wp"),_(!b)},className:"/hide-wp"===j?"is-active-item":"",path:"/hide-wp",children:[(0,o.jsx)(p.Dashicon,{icon:"hidden"})," ",Qn("Hide WP","simply-static")]})]})]}),ae&&(0,o.jsxs)(p.CardBody,{children:[(0,o.jsxs)("h4",{className:"settings-headline",children:[" ",Qn("Advanced","simply-static")]}),te("/integrations")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/integrations"),_(!b)},className:"/integrations"===j?"is-active-item":"",path:"/integrations",children:[(0,o.jsx)(p.Dashicon,{icon:"block-default"})," ",Qn("Integrations","simply-static")]}),te("/workflow")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/workflow"),_(!b)},className:"/workflow"===j?"is-active-item":"",path:"/workflow",children:[(0,o.jsx)(p.Dashicon,{icon:"randomize"})," ",Qn("Workflow","simply-static")]}),te("/utilities")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/utilities"),_(!b)},className:"/utilities"===j?"is-active-item":"",path:"/utilities",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-tools"})," ",Qn("Utilities","simply-static")]}),te("/debug")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/debug"),_(!b)},className:"/debug"===j?"is-active-item":"",path:"/debug",children:[(0,o.jsx)(p.Dashicon,{icon:"editor-help"})," ",Qn("Debug","simply-static")]}),options.uam_enabled&&te("/uam")&&(0,o.jsxs)(p.__experimentalNavigatorButton,{onClick:()=>{k("/uam"),_(!b)},className:"/uam"===j?"is-active-item":"",path:"/uam",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-users"})," ",Qn("UAM","simply-static")]})]}),(0,o.jsxs)(p.CardBody,{children:[(0,o.jsx)("h4",{className:"settings-headline",children:"Learn"}),(0,o.jsxs)(p.Button,{href:"https://docs.simplystatic.com",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"admin-links"})," ",Qn("Documentation","simply-static")]}),(0,o.jsxs)(p.Button,{href:"https://www.youtube.com/playlist?list=PLcpe8_rNg8U5g1gCOa0Ge6T17f50nSvmg",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"format-video"})," ",Qn("Video Course","simply-static")]}),(0,o.jsxs)(p.Button,{href:"https://simplystatic.com/tutorials/",target:"_blank",children:[(0,o.jsx)(p.Dashicon,{icon:"edit"})," ",Qn("Tutorials","simply-static")]})]}),(0,o.jsx)(Wn,{})]})},{__:ii}=wp.i18n;function ai(){return(0,o.jsxs)("div",{className:"promo-sidebar",children:[(0,o.jsx)("div",{className:"promo-card promo-card-pro",children:(0,o.jsxs)("div",{className:"promo-card-inner",children:[(0,o.jsx)("span",{className:"promo-badge",children:ii("Pro","simply-static")}),(0,o.jsx)("h3",{className:"promo-headline",children:ii("Simply Static Pro","simply-static")}),(0,o.jsx)("p",{className:"promo-description",children:ii("Unlock single push, change detection, environments, search, forms, and much more.","simply-static")}),(0,o.jsxs)("ul",{className:"promo-features",children:[(0,o.jsx)("li",{children:ii("Push only changes","simply-static")}),(0,o.jsx)("li",{children:ii("Search integration","simply-static")}),(0,o.jsx)("li",{children:ii("Form handling","simply-static")}),(0,o.jsx)("li",{children:ii("Multilingual support","simply-static")}),(0,o.jsx)("li",{children:ii("Minification and image optimization","simply-static")})]}),(0,o.jsx)(p.Button,{isPrimary:!0,href:"https://simplystatic.com/simply-static-pro/?utm_source=plugin&utm_medium=promo-sidebar&utm_campaign=pro",target:"_blank",rel:"noopener noreferrer",className:"promo-button",children:ii("Get Simply Static Pro →","simply-static")})]})}),(0,o.jsx)("div",{className:"promo-card promo-card-studio",children:(0,o.jsxs)("div",{className:"promo-card-inner",children:[(0,o.jsx)("span",{className:"promo-badge promo-badge-studio",children:ii("Studio","simply-static")}),(0,o.jsx)("h3",{className:"promo-headline",children:ii("Static Studio","simply-static")}),(0,o.jsx)("p",{className:"promo-description",children:ii("The all-in-one WordPress operations platform for static sites, including Site Health, reports, performance checks, uptime monitoring, and hosting.","simply-static")}),(0,o.jsxs)("ul",{className:"promo-features",children:[(0,o.jsx)("li",{children:ii("14-day trial with 3 sites included","simply-static")}),(0,o.jsx)("li",{children:ii("Site Health and reports","simply-static")}),(0,o.jsx)("li",{children:ii("Performance checks and uptime monitoring","simply-static")}),(0,o.jsx)("li",{children:ii("All Pro features included","simply-static")})]}),(0,o.jsx)(p.Button,{isPrimary:!0,href:"https://simplystatic.com/simply-static-studio/?utm_source=plugin&utm_medium=promo-sidebar&utm_campaign=studio",target:"_blank",rel:"noopener noreferrer",className:"promo-button promo-button-studio",children:ii("Start 14-Day Free Trial →","simply-static")})]})})]})}const{__:ri}=wp.i18n,si=["/","/diagnostics","/general","/deployment","/forms","/search","/optimize","/hide-wp","/workflow","/utilities","/debug","/uam","/integrations"],oi={"activity-log":"/",generate:"/",deploy:"/deployment"},li=()=>{if("undefined"==typeof window||!window.location.hash)return null;let e=window.location.hash.replace(/^#\/?/,"").split("?")[0];try{e=decodeURIComponent(e).trim()}catch(e){return null}if(!e)return null;if(oi[e])return oi[e];const t=`/${e}`;return si.includes(t)?t:null},ci=function(){const{isRunning:e,isPaused:t,passedChecks:n,isPro:a,showMobileNav:r,setShowMobileNav:s,settings:c}=(0,i.useContext)(l),d=e=>(e=>{try{return!(!si.includes(e)||options.allowed_pages&&!options.allowed_pages.includes(e)||"/uam"===e&&!options.uam_enabled)}catch(e){return!0}})(e)?e:options.initial,u=()=>{const e=li();return d(e||(localStorage.getItem("ss-initial-page")?localStorage.getItem("ss-initial-page"):options.initial))},[m,h]=(0,i.useState)(u),[g,x]=(0,i.useState)(u),[f,y]=(0,i.useState)(!1),b=e=>{"undefined"!=typeof window&&window.history&&window.history.replaceState&&window.history.replaceState({...window.history.state,ssRoute:e},"",window.location.href)};(0,i.useEffect)(()=>{let e=localStorage.getItem("ss-initial-page");const t=li();if(!f){y(!0);let n=options.initial;t?n=t:e&&(n=e,localStorage.removeItem("ss-initial-page"));const i=d(n);h(i),x(i),b(i)}},[options,e,t]),(0,i.useEffect)(()=>{const e=()=>{const e=d(li()||(()=>{if("undefined"==typeof window||!window.history||!window.history.state)return null;const e=window.history.state.ssRoute;return si.includes(e)?e:null})()||options.initial);h(e),x(e)};return window.addEventListener("hashchange",e),window.addEventListener("popstate",e),()=>{window.removeEventListener("hashchange",e),window.removeEventListener("popstate",e)}},[]);const _=e=>{if(h(e),"undefined"==typeof window||!window.history)return;const t=(e=>"/"===e?"":e.replace(/^\//,""))(e);t?window.location.hash!==`#${t}`?window.history.pushState({...window.history.state,ssRoute:e},"",`#${t}`):b(e):window.location.hash?window.history.pushState({...window.history.state,ssRoute:e},"",`${window.location.pathname}${window.location.search}`):b(e)};return(0,o.jsx)("div",{className:"plugin-settings-container",children:(0,o.jsxs)(p.__experimentalNavigatorProvider,{initialPath:g,style:{minHeight:window.innerHeight-(wpadminbar?wpadminbar.clientHeight:0)-1+"px"},children:[(0,o.jsxs)(p.Button,{type:"button","aria-expanded":r,"aria-controls":"simply-static-mobile-nav",onClick:()=>{s(!0)},className:"show-nav",children:[(0,o.jsx)(p.Dashicon,{icon:"align-center"})," ",ri("Toggle menu","simply-static")]}),r&&(0,o.jsxs)("div",{id:"simply-static-mobile-nav",className:"mobile-nav-overlay",role:"dialog","aria-modal":"true","aria-label":ri("Simply Static menu","simply-static"),children:[(0,o.jsxs)("div",{className:"mobile-nav-header",children:[(0,o.jsx)("span",{children:ri("Menu","simply-static")}),(0,o.jsx)(p.Button,{isSmall:!0,variant:"tertiary","aria-label":ri("Close menu","simply-static"),onClick:()=>s(!1),children:(0,o.jsx)(p.Dashicon,{icon:"no-alt"})})]}),(0,o.jsx)("div",{className:"mobile-nav-content",children:options.is_network?(0,o.jsx)(Gn,{}):(0,o.jsx)(ni,{setActiveItem:_,activeItem:m})})]}),(0,o.jsxs)(p.Flex,{children:[(0,o.jsx)(p.FlexItem,{className:"sidebar",children:options.is_network?(0,o.jsx)(Gn,{}):(0,o.jsx)(ni,{setActiveItem:_,activeItem:m})}),(0,o.jsx)(p.FlexItem,{isBlock:!0,children:(0,o.jsxs)("div",{className:"plugin-settings",children:["no"!==n||options.is_network?"":(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsxs)(p.Notice,{status:"notice",isDismissible:!1,className:"/"==m?"diagnostics-notice diagnostics-notice-generate":"diagnostics-notice",children:[(0,o.jsxs)("p",{children:[ri("There are errors in diagnostics that may negatively affect your static push.","simply-static"),(0,o.jsx)("br",{}),ri("Please review them and get them fixed to avoid problems.","simply-static")]}),(0,o.jsxs)(p.__experimentalNavigatorButton,{isSecondary:!0,onClick:()=>{_("/diagnostics"),s(!r)},className:"/diagnostics"===m?"is-active-item":"",path:"/diagnostics",children:[(0,o.jsx)(p.Dashicon,{icon:"editor-help"})," ",ri("Visit Diagnostics","simply-static")]})]})}),"pro"!==options.plan||a()?"":(0,o.jsx)(p.Animate,{type:"slide-in",options:{origin:"top"},children:()=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(p.Notice,{status:"error",isDismissible:!1,className:"/"==m?"diagnostics-notice diagnostics-notice-generate":"diagnostics-notice",children:[(0,o.jsxs)("p",{children:[ri("You are using the pro version without a valid license.","simply-static"),(0,o.jsx)("br",{}),ri("We have temporarily disabled all the pro features now. Please contact our support to have the problem solved.","simply-static")]}),(0,o.jsx)(p.Button,{isPrimary:!0,href:"https://simplystatic.com/support/",target:"_blank",children:"Contact Support"})]}),(0,o.jsx)(p.__experimentalSpacer,{margin:"5px"})]})}),"/"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/",children:(0,o.jsx)(Fn,{})}),"/diagnostics"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/diagnostics",children:(0,o.jsx)(U,{})}),"/general"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/general",children:(0,o.jsx)(O,{})}),"/deployment"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/deployment",children:(0,o.jsx)(K,{})}),"/forms"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/forms",children:(0,o.jsx)(J,{})}),"/search"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/search",children:(0,o.jsx)(X,{})}),"/optimize"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/optimize",children:(0,o.jsx)(Mn,{})}),"/hide-wp"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/hide-wp",children:(0,o.jsx)(An,{})}),"/workflow"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/workflow",children:(0,o.jsx)(zn,{})}),"/utilities"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/utilities",children:(0,o.jsx)($,{})}),"/debug"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/debug",children:(0,o.jsx)(Z,{})}),"/uam"===m&&options.uam_enabled&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/uam",children:(0,o.jsx)(re,{})}),"/integrations"===m&&(0,o.jsx)(p.__experimentalNavigatorScreen,{path:"/integrations",children:(0,o.jsx)(ie,{})})]})}),"pro"!==options.plan&&(0,o.jsx)(p.FlexItem,{className:"promo-sidebar-container",children:(0,o.jsx)(ai,{})})]})]})})},di=function(){return(0,o.jsx)(d,{children:(0,o.jsx)("div",{children:(0,o.jsx)(ci,{})})})};if(window.options&&"simplystatic-settings"===window.options.screen){const e=document.getElementById("simplystatic-settings");e&&(0,i.createRoot)(e).render((0,o.jsx)(di,{}))}})(); \ No newline at end of file diff --git a/src/admin/inc/class-ss-admin-rest.php b/src/admin/inc/class-ss-admin-rest.php index 8bd60171..a8c41844 100644 --- a/src/admin/inc/class-ss-admin-rest.php +++ b/src/admin/inc/class-ss-admin-rest.php @@ -500,7 +500,12 @@ function () use ( $job ) { $sites = apply_filters( 'ss_rest_multisite_get_sites', $sites ); - return wp_send_json_success( $sites ); + return rest_ensure_response( + array( + 'success' => true, + 'data' => $sites, + ) + ); } /** Multisite: trigger cron on a specific site */ @@ -1568,11 +1573,13 @@ public function get_activity_log( $request ) { $activity_log = Plugin::instance()->get_activity_log( $blog_id ); $running = Plugin::instance()->get_archive_creation_job()->is_running(); - return json_encode( [ - 'status' => 200, - 'data' => $activity_log, - 'running' => $running, - ] ); + return rest_ensure_response( + array( + 'status' => 200, + 'data' => $activity_log, + 'running' => $running, + ) + ); } ); } @@ -1587,7 +1594,7 @@ public function get_export_log( $request ) { return $this->run_in_blog_context( $blog_id, function () use ( $per_page, $page, $blog_id, $search ) { $export_log = Plugin::instance()->get_export_log( $per_page, $page, $blog_id, $search ); - return json_encode( [ 'status' => 200, 'data' => $export_log ] ); + return rest_ensure_response( array( 'status' => 200, 'data' => $export_log ) ); } ); } diff --git a/src/admin/src/settings/components/ActivityLog.jsx b/src/admin/src/settings/components/ActivityLog.jsx index e8d914c3..1985dd0e 100644 --- a/src/admin/src/settings/components/ActivityLog.jsx +++ b/src/admin/src/settings/components/ActivityLog.jsx @@ -11,7 +11,7 @@ import Terminal, { ColorMode, TerminalOutput } from 'react-terminal-ui'; import apiFetch from '@wordpress/api-fetch'; import useInterval from '../../hooks/useInterval'; import { - parseActivityLogMessage, + parseActivityLogEntry, parseLogResponse, toInertLogText, } from '../utils/log'; @@ -110,9 +110,7 @@ function ActivityLog() { const safeEntry = entry && typeof entry === 'object' ? entry : {}; const date = toInertLogText( safeEntry.datetime ); - const content = parseActivityLogMessage( - safeEntry.message - ); + const content = parseActivityLogEntry( safeEntry ); const error = message.includes( 'pause' ) || message.includes( 'cancel' ); diff --git a/src/admin/src/settings/components/LogComponents.test.jsx b/src/admin/src/settings/components/LogComponents.test.jsx index 1b25ee40..62bf2ab8 100644 --- a/src/admin/src/settings/components/LogComponents.test.jsx +++ b/src/admin/src/settings/components/LogComponents.test.jsx @@ -212,6 +212,34 @@ describe( 'ActivityLog', () => { expect( container.querySelector( '[onclick]' ) ).toBeNull(); } ); + it( 'renders a structured destination link without server HTML', async () => { + apiFetch.mockResolvedValue( + { + status: 200, + data: { + destination_url: { + datetime: '2026-07-12 10:00:00', + message: 'Destination URL:', + link: { + url: 'https://static.example.com/', + label: 'https://static.example.com/', + }, + }, + }, + } + ); + + renderWithContext( , activityContext ); + const link = await screen.findByRole( 'link', { + name: 'https://static.example.com/', + } ); + + expect( link.getAttribute( 'href' ) ).toBe( + 'https://static.example.com/' + ); + expect( screen.getByText( /Destination URL:/ ) ).not.toBeNull(); + } ); + it( 'keeps an unsafe completion anchor inert', async () => { apiFetch.mockResolvedValue( JSON.stringify( { diff --git a/src/admin/src/settings/utils/log.js b/src/admin/src/settings/utils/log.js index 869b3537..d4bbf73d 100644 --- a/src/admin/src/settings/utils/log.js +++ b/src/admin/src/settings/utils/log.js @@ -110,6 +110,38 @@ export function parseActivityLogMessage( value ) { }; } +/** + * Convert a complete activity-log entry to safe text and optional link data. + * + * New entries carry structured link data so their rendering does not depend + * on parsing HTML. The message parser remains as a fallback for entries saved + * by older plugin versions and third-party deployment methods. + * + * @param {*} entry Activity-log entry. + * @return {{before: string, after: string, link: {href: string, label: string}|null}} Parsed entry. + */ +export function parseActivityLogEntry( entry ) { + const safeEntry = entry && typeof entry === 'object' ? entry : {}; + const content = parseActivityLogMessage( safeEntry.message ); + + if ( ! safeEntry.link || typeof safeEntry.link !== 'object' ) { + return content; + } + + const safeUrl = getSafeLogUrl( safeEntry.link.url ); + if ( ! safeUrl ) { + return content; + } + + return { + ...content, + link: { + href: safeUrl.href, + label: toInertLogText( safeEntry.link.label ) || safeUrl.label, + }, + }; +} + /** * Parse the tightly allowlisted attributes accepted on a legacy log anchor. * diff --git a/src/admin/src/settings/utils/log.test.js b/src/admin/src/settings/utils/log.test.js index e587184a..1c70a5c7 100644 --- a/src/admin/src/settings/utils/log.test.js +++ b/src/admin/src/settings/utils/log.test.js @@ -1,5 +1,6 @@ import { getSafeLogUrl, + parseActivityLogEntry, parseActivityLogMessage, parseLogResponse, toInertLogText, @@ -84,6 +85,43 @@ describe( 'log utilities', () => { } ); } ); + describe( 'parseActivityLogEntry', () => { + it( 'prefers validated structured link data', () => { + expect( + parseActivityLogEntry( { + message: 'ZIP archive created:', + link: { + url: '/wp-content/uploads/simply-static/archive.zip', + label: 'Click here to download', + }, + } ) + ).toEqual( { + before: 'ZIP archive created:', + after: '', + link: { + href: '/wp-content/uploads/simply-static/archive.zip', + label: 'Click here to download', + }, + } ); + } ); + + it( 'falls back to a legacy link when structured link data is unsafe', () => { + expect( + parseActivityLogEntry( { + message: + 'Destination URL: Static site', + link: { + url: 'javascript:alert(1)', + label: '', + }, + } ).link + ).toEqual( { + href: 'https://static.example.com/', + label: 'Static site', + } ); + } ); + } ); + describe( 'getSafeLogUrl', () => { it.each( [ 'javascript:alert(1)', diff --git a/src/class-ss-plugin.php b/src/class-ss-plugin.php index bfb519ea..6cce7018 100644 --- a/src/class-ss-plugin.php +++ b/src/class-ss-plugin.php @@ -508,6 +508,22 @@ public function get_activity_log( $blog_id = 0 ) { } $log[ $key ]['message'] = wp_kses_post( isset( $entry['message'] ) ? $entry['message'] : '' ); $log[ $key ]['datetime'] = sanitize_text_field( isset( $entry['datetime'] ) ? $entry['datetime'] : '' ); + + if ( isset( $entry['link'] ) && is_array( $entry['link'] ) ) { + $link_url = esc_url_raw( isset( $entry['link']['url'] ) ? $entry['link']['url'] : '' ); + $link_label = sanitize_text_field( isset( $entry['link']['label'] ) ? $entry['link']['label'] : '' ); + + if ( $link_url && preg_match( '#^(?:https?://|/(?!/))#i', $link_url ) ) { + $log[ $key ]['link'] = array( + 'url' => $link_url, + 'label' => $link_label ?: $link_url, + ); + } else { + unset( $log[ $key ]['link'] ); + } + } elseif ( array_key_exists( 'link', $entry ) ) { + unset( $log[ $key ]['link'] ); + } } do_action( 'ss_after_render_activity_log', $blog_id, $this->get_archive_creation_job() ); diff --git a/src/class-ss-util.php b/src/class-ss-util.php index 78a9a2f7..5500432f 100644 --- a/src/class-ss-util.php +++ b/src/class-ss-util.php @@ -2781,10 +2781,11 @@ public static function remove_leading_slash( $path ) { * @param string $task_name Name of the task * @param string $message Message to display about the status of the job * @param boolean $unique If unique, the task_name/key will get a prefix if the same exists. + * @param array|null $link Optional link data with URL and label. * * @return array */ - public static function add_archive_status_message( $messages, $task_name, $message, $unique = false ) { + public static function add_archive_status_message( $messages, $task_name, $message, $unique = false, $link = null ) { if ( ! is_array( $messages ) ) { $messages = array(); } @@ -2802,6 +2803,15 @@ public static function add_archive_status_message( $messages, $task_name, $messa $messages[ $task_name ]['message'] = $message; } + if ( is_array( $link ) && ! empty( $link['url'] ) ) { + $messages[ $task_name ]['link'] = array( + 'url' => $link['url'], + 'label' => isset( $link['label'] ) ? $link['label'] : $link['url'], + ); + } else { + unset( $messages[ $task_name ]['link'] ); + } + return $messages; } diff --git a/src/tasks/class-ss-create-zip-archive.php b/src/tasks/class-ss-create-zip-archive.php index 2ba903d9..7a61438c 100644 --- a/src/tasks/class-ss-create-zip-archive.php +++ b/src/tasks/class-ss-create-zip-archive.php @@ -59,13 +59,15 @@ public function perform() { } $message = __( 'ZIP archive created: ', 'simply-static' ); + $link = array( + 'url' => $download_url, + 'label' => __( 'Click here to download', 'simply-static' ), + ); if ( $this->is_wp_cli_running() ) { $message .= $download_url; - } else { - $message .= ' ' . esc_html__( 'Click here to download', 'simply-static' ) . ''; } - $this->save_status_message( $message ); + $this->save_status_message( $message, null, $link ); return true; } diff --git a/src/tasks/class-ss-task.php b/src/tasks/class-ss-task.php index 94db62cb..4da035b8 100644 --- a/src/tasks/class-ss-task.php +++ b/src/tasks/class-ss-task.php @@ -34,16 +34,18 @@ public function __construct() { * provided, the state_name will be used. Using the same key more than once * will overwrite previous messages. * - * @param string $message Message to display about the status of the job. - * @param string $key Unique key for the message. + * @param string $message Message to display about the status of the job. + * @param string $key Unique key for the message. + * @param array|null $link Optional link data with URL and label. + * * @return void */ - protected function save_status_message( $message, $key = null ) { + protected function save_status_message( $message, $key = null, $link = null ) { $task_name = $key ?: static::$task_name; $messages = $this->options->get( 'archive_status_messages' ); Util::debug_log( 'Status message: [' . $task_name . '] ' . $message ); - $messages = Util::add_archive_status_message( $messages, $task_name, $message ); + $messages = Util::add_archive_status_message( $messages, $task_name, $message, false, $link ); $this->options ->set( 'archive_status_messages', $messages ) diff --git a/src/tasks/class-ss-transfer-files-locally-task.php b/src/tasks/class-ss-transfer-files-locally-task.php index 61a05515..3ef7ee57 100644 --- a/src/tasks/class-ss-transfer-files-locally-task.php +++ b/src/tasks/class-ss-transfer-files-locally-task.php @@ -77,8 +77,14 @@ public function perform() { if ( $this->options->get( 'destination_url_type' ) == 'absolute' ) { $destination_url = trailingslashit( $this->options->get_destination_url() ); - $message = __( 'Destination URL:', 'simply-static' ) . ' ' . esc_html( $destination_url ) . ''; - $this->save_status_message( $message, 'destination_url' ); + $this->save_status_message( + __( 'Destination URL:', 'simply-static' ), + 'destination_url', + array( + 'url' => $destination_url, + 'label' => $destination_url, + ) + ); } // If this is a 404-only export, ensure the activity/export log reflects a single transferred file. diff --git a/tests/Unit/AdminControllerCoverageTest.php b/tests/Unit/AdminControllerCoverageTest.php index 9d841928..563bebcc 100644 --- a/tests/Unit/AdminControllerCoverageTest.php +++ b/tests/Unit/AdminControllerCoverageTest.php @@ -433,28 +433,28 @@ public function get_archive_creation_job() { }; $this->pluginInstanceProperty()->setValue( null, $plugin ); - $activity = json_decode( - (string) $this->rest->get_activity_log( new \WP_REST_Request( array( 'blog_id' => '-9' ) ) ), - true + $activity_response = $this->rest->get_activity_log( + new \WP_REST_Request( array( 'blog_id' => '-9' ) ) ); + self::assertInstanceOf( \WP_REST_Response::class, $activity_response ); + $activity = $activity_response->get_data(); self::assertSame( array( 9 ), $plugin->activity_blog_ids ); self::assertSame( 200, $activity['status'] ?? null ); self::assertTrue( $activity['running'] ?? false ); self::assertSame( 'Ready', $activity['data']['fetch']['message'] ?? null ); - $export = json_decode( - (string) $this->rest->get_export_log( - new \WP_REST_Request( - array( - 'blog_id' => '-3', - 'per_page' => 9999, - 'page' => 0, - 'search' => " needle \nvalue", - ) + $export_response = $this->rest->get_export_log( + new \WP_REST_Request( + array( + 'blog_id' => '-3', + 'per_page' => 9999, + 'page' => 0, + 'search' => " needle \nvalue", ) - ), - true + ) ); + self::assertInstanceOf( \WP_REST_Response::class, $export_response ); + $export = $export_response->get_data(); self::assertSame( array( 200, 1, 3, 'needle value' ), $plugin->export_calls[0] ); self::assertSame( 200, $export['status'] ?? null ); self::assertSame( array(), $export['data']['static_pages'] ?? null ); diff --git a/tests/Unit/PluginTaskLifecycleTest.php b/tests/Unit/PluginTaskLifecycleTest.php index 5dffe0da..f74e63e7 100644 --- a/tests/Unit/PluginTaskLifecycleTest.php +++ b/tests/Unit/PluginTaskLifecycleTest.php @@ -193,6 +193,22 @@ public function test_activity_log_drops_malformed_entries_and_sanitizes_user_vis 'datetime' => "2026-07-12\n12:00:00", ), 'partial' => array(), + 'linked' => array( + 'message' => 'Destination URL:', + 'datetime' => '2026-07-12 12:00:00', + 'link' => array( + 'url' => 'https://static.example.com/', + 'label' => "Static\nsite", + ), + ), + 'unsafe_link' => array( + 'message' => 'Unsafe', + 'datetime' => '2026-07-12 12:00:00', + 'link' => array( + 'url' => 'javascript:alert(1)', + 'label' => 'Unsafe link', + ), + ), ) ); @@ -202,6 +218,14 @@ public function test_activity_log_drops_malformed_entries_and_sanitizes_user_vis self::assertSame( 'Saved', $log['good']['message'] ); self::assertSame( '2026-07-12 12:00:00', $log['good']['datetime'] ); self::assertSame( array( 'message' => '', 'datetime' => '' ), $log['partial'] ); + self::assertSame( + array( + 'url' => 'https://static.example.com/', + 'label' => 'Static site', + ), + $log['linked']['link'] + ); + self::assertArrayNotHasKey( 'link', $log['unsafe_link'] ); self::assertContains( 'ss_before_render_activity_log', WpEnv::$action_log ); self::assertContains( 'ss_after_render_activity_log', WpEnv::$action_log ); } diff --git a/tests/Unit/ZipArchiveTaskTest.php b/tests/Unit/ZipArchiveTaskTest.php index 6931fe1d..d66cb166 100644 --- a/tests/Unit/ZipArchiveTaskTest.php +++ b/tests/Unit/ZipArchiveTaskTest.php @@ -89,6 +89,23 @@ public function test_zero_batch_size_is_clamped_and_cannot_stall_progress(): voi self::assertFileExists( untrailingslashit( $this->archive_dir ) . '.zip' ); } + public function test_perform_publishes_structured_download_link(): void { + file_put_contents( $this->archive_dir . 'index.html', '

Archived

' ); + $zip_file = WP_CONTENT_DIR . '/uploads/simply-static/activity-link-test.zip'; + wp_mkdir_p( dirname( $zip_file ) ); + add_filter( 'ss_zip_filename', static function () use ( $zip_file ) { + return $zip_file; + } ); + + self::assertTrue( ( new Create_Zip_Archive_Task() )->perform() ); + + $status = WpEnv::$options['simply-static']['archive_status_messages']['create_zip_archive']; + self::assertStringStartsWith( 'ZIP archive created: ', $status['message'] ); + self::assertSame( 'Click here to download', $status['link']['label'] ); + self::assertStringStartsWith( 'https://example.test/wp-content/', $status['link']['url'] ); + self::assertStringEndsWith( '/activity-link-test.zip', $status['link']['url'] ); + } + public function test_filtered_files_outside_archive_and_symlink_escapes_are_excluded(): void { file_put_contents( $this->archive_dir . 'safe.txt', 'safe' ); $outside = WpEnv::$upload_dir['basedir'] . '/outside-secret.txt';