"use strict";(self.webpackChunkfont_awesome_admin=self.webpackChunkfont_awesome_admin||[]).push([[85,381,587],{2:(e,s,t)=>{t.d(s,{A:()=>h});var n=t(609),o=t.n(n);var i=t(119),a=t(723),c=t(790);const r=(0,c.jsx)(i.A,{title:(0,a.__)("Whoops, this is embarrassing","font-awesome"),type:"warning",children:(0,c.jsx)("p",{children:(0,a.__)("Some unexpected error has occurred. There might be some additional diagnostic information in the JavaScript console.","font-awesome")})}),l=function(){return(0,c.jsx)("div",{className:"iVV55iNB320NJJLspy7m",children:r})};var d=t(458);class u extends o().Component{constructor(e){super(e),this.state={error:null,errorInfo:null}}componentDidCatch(e,s){console.group(d.V2),console.log(e),console.log(s),console.groupEnd(),this.setState({error:e,errorInfo:s})}render(){return this.state.error?(0,c.jsx)(l,{}):this.props.children}}const h=u},85:(e,s,t)=>{t.r(s),t.d(s,{CONFLICT_DETECTION_SCANNER_DURATION_MIN:()=>u,addPendingOption:()=>w,checkPreferenceConflicts:()=>E,chooseAwayFromKitConfig:()=>C,chooseIntoKitConfig:()=>O,preprocessResponse:()=>j,queryKits:()=>D,reportDetectedConflicts:()=>F,resetOptionsFormState:()=>b,resetPendingBlocklistSubmissionStatus:()=>A,resetPendingOptions:()=>N,resetUnregisteredClientsDeletionStatus:()=>y,setActiveAdminTab:()=>z,setConflictDetectionScanner:()=>W,submitPendingBlocklist:()=>T,submitPendingOptions:()=>I,submitPendingUnregisteredClientDeletions:()=>k,updateApiToken:()=>P,updatePendingBlocklist:()=>S,updatePendingUnregisteredClientsForDeletion:()=>v,userAttemptToStopScanner:()=>R});var n=t(166),o=t(87),i=t(458),a=t(723);function c(e,s=0){let t=null,n=null;if("string"!=typeof e)return null;if(s>=e.length)return null;try{return t=JSON.parse(e.slice(s)),{start:s,parsed:t}}catch(t){const o=e.indexOf("[",s+1),i=e.indexOf("{",s+1);if(-1===o&&-1===i)return null;n=-1!==o&&-1!==i?o0,a=n?r(t):{};n&&a&&(e.data=(0,o.get)(a,"parsed"));const c=(0,o.get)(a,"trimmed",""),l=(0,o.get)(e,"data.errors",null);if(e.status>=400){if(l)e.uiMessage=(0,i.Ay)({error:e.data,confirmed:s,trimmed:c});else{const t=(0,o.get)(e,"config.method","").toUpperCase(),n=(0,o.get)(e,"config.url"),a=e.status,c=(0,o.get)(e,"statusText"),r=(0,i.b3)(e),l=(0,i.cA)((0,o.get)(e,"headers",{})),d=(0,i.cA)((0,o.get)(e,"config.headers",{})),u=(0,o.get)(e,"data");e.uiMessage=(0,i.Ay)({confirmed:s,requestData:r,requestMethod:t,requestUrl:n,responseHeaders:l,requestHeaders:d,responseStatus:a,responseStatusText:c,responseData:u}),405===a&&(e.uiMessage=p)}return e}if(e.status<400&&e.status>=300)return s&&""===c||(e.uiMessage=(0,i.Ay)({error:null,confirmed:s,trimmed:c})),e;if(l){const t=!0;return e.falsePositive=!0,e.uiMessage=(0,i.Ay)({error:e.data,confirmed:s,falsePositive:t,trimmed:c}),e}{const t=(0,o.get)(e,"data.error",null);return t?(e.uiMessage=(0,i.Ay)({error:t,ok:!0,confirmed:s,trimmed:c}),e):(s||(e.uiMessage=(0,i.Ay)({error:null,ok:!0,confirmed:s,trimmed:c})),e)}}function N(){return{type:"RESET_PENDING_OPTIONS"}}function b(){return{type:"OPTIONS_FORM_STATE_RESET"}}function w(e){return function(s,t){const{options:n}=t();for(const[t,i]of(0,o.toPairs)(e))s(n[t]===i?{type:"RESET_PENDING_OPTION",change:{[t]:i}}:{type:"ADD_PENDING_OPTION",change:{[t]:i}})}}function v(e=[]){return{type:"UPDATE_PENDING_UNREGISTERED_CLIENTS_FOR_DELETION",data:e}}function y(){return{type:"DELETE_UNREGISTERED_CLIENTS_RESET"}}function A(){return{type:"BLOCKLIST_UPDATE_RESET"}}function k(){return function(e,s){const{apiNonce:t,apiUrl:n,unregisteredClientsDeletionStatus:i}=s(),a=(0,o.get)(i,"pending",null);if(!a||0===(0,o.size)(a))return;e({type:"DELETE_UNREGISTERED_CLIENTS_START"});const c=({uiMessage:s})=>{e({type:"DELETE_UNREGISTERED_CLIENTS_END",success:!1,message:s||m})};return d.delete(`${n}/conflict-detection/conflicts`,{data:a,headers:{"X-WP-Nonce":t}}).then(s=>{const{status:t,data:n,falsePositive:o}=s;o?c(s):e({type:"DELETE_UNREGISTERED_CLIENTS_END",success:!0,data:204===t?null:n,message:""})}).catch(c)}}function S(e=[]){return{type:"UPDATE_PENDING_BLOCKLIST",data:e}}function T(){return function(e,s){const{apiNonce:t,apiUrl:n,blocklistUpdateStatus:i}=s(),a=(0,o.get)(i,"pending",null);if(!a)return;e({type:"BLOCKLIST_UPDATE_START"});const c=({uiMessage:s})=>{e({type:"BLOCKLIST_UPDATE_END",success:!1,message:s||m})};return d.post(`${n}/conflict-detection/conflicts/blocklist`,a,{headers:{"X-WP-Nonce":t}}).then(s=>{const{status:t,data:n,falsePositive:o}=s;o?c(s):e({type:"BLOCKLIST_UPDATE_END",success:!0,data:204===t?null:n,message:""})}).catch(c)}}function E(){return function(e,s){e({type:"PREFERENCE_CHECK_START"});const{apiNonce:t,apiUrl:n,options:o,pendingOptions:i}=s(),a=({uiMessage:s})=>{e({type:"PREFERENCE_CHECK_END",success:!1,message:s||f})};return d.post(`${n}/preference-check`,{...o,...i},{headers:{"X-WP-Nonce":t}}).then(s=>{const{data:t,falsePositive:n}=s;n?a(s):e({type:"PREFERENCE_CHECK_END",success:!0,message:"",detectedConflicts:t})}).catch(a)}}function C({activeKitToken:e}){return function(s,t){const{releases:n}=t();s({type:"CHOOSE_AWAY_FROM_KIT_CONFIG",activeKitToken:e,concreteVersion:(0,o.get)(n,"latest_version_7")})}}function O(){return{type:"CHOOSE_INTO_KIT_CONFIG"}}function D(){return function(e,s){const{apiNonce:t,apiUrl:n,options:i}=s(),c=(0,o.get)(i,"kitToken",null);e({type:"KITS_QUERY_START"}),function(){if(window?.localStorage&&0!==localStorage.length)for(let e=localStorage.length-1;e>=0;e--){const s=localStorage.key(e);s.startsWith(l)&&localStorage.removeItem(s)}}();const r=({uiMessage:s})=>{e({type:"KITS_QUERY_END",success:!1,message:s||(0,a.__)("Failed to fetch kits","font-awesome")})},u=({uiMessage:s})=>{e({type:"OPTIONS_FORM_SUBMIT_END",success:!1,message:s||(0,a.__)("Couldn't update latest kit settings","font-awesome")})};return d.post(`${n}/api`,"query { me { kits { name version technologySelected licenseSelected minified token shimEnabled autoAccessibilityEnabled status }}}",{headers:{"X-WP-Nonce":t}}).then(s=>{if(s.falsePositive)return r(s);const l=(0,o.get)(s,"data.data");if(!(0,o.get)(l,"me"))return e({type:"KITS_QUERY_END",success:!1,message:(0,a.__)("Failed to fetch kits. Regenerate your API Token and try again.","font-awesome")});if(e({type:"KITS_QUERY_END",data:l,success:!0}),!c)return;const h=(0,o.get)(l,"me.kits",[]),m=(0,o.find)(h,{token:c});if(!m)return;const p={};return i.usePro&&"pro"!==m.licenseSelected?p.usePro=!1:i.usePro||"pro"!==m.licenseSelected||(p.usePro=!0),"svg"===i.technology&&"svg"!==m.technologySelected?(p.technology="webfont",p.pseudoElements=!0):"svg"!==i.technology&&"svg"===m.technologySelected&&(p.technology="svg",p.pseudoElements=!1),i.version!==m.version&&(p.version=m.version),i.compat&&!m.shimEnabled?p.compat=!1:!i.compat&&m.shimEnabled&&(p.compat=!0),e({type:"OPTIONS_FORM_SUBMIT_START"}),d.post(`${n}/config`,{options:{...i,...p}},{headers:{"X-WP-Nonce":t}}).then(s=>{const{data:t,falsePositive:n}=s;if(n)return u(s);e({type:"OPTIONS_FORM_SUBMIT_END",data:t,success:!0,message:(0,a.__)("Kit changes saved","font-awesome")})}).catch(u)}).catch(r)}}function I(){return function(e,s){const{apiNonce:t,apiUrl:n,options:o,pendingOptions:i}=s();e({type:"OPTIONS_FORM_SUBMIT_START"});const c=({uiMessage:s})=>{e({type:"OPTIONS_FORM_SUBMIT_END",success:!1,message:s||m})};return d.post(`${n}/config`,{options:{...o,...i}},{headers:{"X-WP-Nonce":t}}).then(s=>{const{data:t,falsePositive:n}=s;n?c(s):e({type:"OPTIONS_FORM_SUBMIT_END",data:t,success:!0,message:(0,a.__)("Changes saved","font-awesome")})}).catch(c)}}function P({apiToken:e=!1,runQueryKits:s=!1}){return function(t,n){const{apiNonce:o,apiUrl:i,options:c}=n();t({type:"OPTIONS_FORM_SUBMIT_START"});const r=({uiMessage:e})=>{t({type:"OPTIONS_FORM_SUBMIT_END",success:!1,message:e||m})};return d.post(`${i}/config`,{options:{...c,apiToken:e}},{headers:{"X-WP-Nonce":o}}).then(e=>{const{data:n,falsePositive:o}=e;if(o)r(e);else if(t({type:"OPTIONS_FORM_SUBMIT_END",data:n,success:!0,message:(0,a.__)("API Token saved","font-awesome")}),s)return t(D())}).catch(r)}}function R(){return{type:"USER_STOP_SCANNER"}}function F({nodesTested:e={}}){return(s,t)=>{const{apiNonce:n,apiUrl:i,unregisteredClients:a,showConflictDetectionReporter:c}=t();if(c){if((0,o.size)(e.conflict)>0){const t=Object.keys(e.conflict).reduce(function(s,t){return s[t]=e.conflict[t],s},{});s({type:"CONFLICT_DETECTION_SUBMIT_START",unregisteredClientsBeforeDetection:a,recentConflictsDetected:e.conflict});const c=({uiMessage:e})=>{s({type:"CONFLICT_DETECTION_SUBMIT_END",success:!1,message:e||m})};return d.post(`${i}/conflict-detection/conflicts`,t,{headers:{"X-WP-Nonce":n}}).then(e=>{const{status:t,data:n,falsePositive:i}=e;i?c(e):s({type:"CONFLICT_DETECTION_SUBMIT_END",success:!0,data:204===t||0===(0,o.size)(n)?null:n})}).catch(c)}s({type:"CONFLICT_DETECTION_NONE_FOUND"})}}}function z(e){return{type:"SET_ACTIVE_ADMIN_TAB",tab:e}}function W({enable:e=!0}){return function(s,t){const{apiNonce:n,apiUrl:o}=t(),i=e?"ENABLE_CONFLICT_DETECTION_SCANNER_END":"DISABLE_CONFLICT_DETECTION_SCANNER_END";s({type:e?"ENABLE_CONFLICT_DETECTION_SCANNER_START":"DISABLE_CONFLICT_DETECTION_SCANNER_START"});const a=({uiMessage:e})=>{s({type:i,success:!1,message:e||_})};return d.post(`${o}/conflict-detection/until`,e?Math.floor(new Date((new Date).valueOf()+1e3*u*60)/1e3):Math.floor(new Date/1e3)-h,{headers:{"X-WP-Nonce":n}}).then(e=>{const{status:t,data:n,falsePositive:o}=e;o?a(e):s({type:i,data:204===t?null:n,success:!0})}).catch(a)}}(0,a.__)("Couldn't snooze","font-awesome"),d.interceptors.response.use(e=>j(e),e=>{if(e.response)e.response=j(e.response),e.uiMessage=(0,o.get)(e,"response.uiMessage");else if(e.request){const s="fontawesome_request_noresponse",t={errors:{[s]:[g]},error_data:{[s]:{request:e.request}}};e.uiMessage=(0,i.Ay)({error:t})}else{const s="fontawesome_request_failed",t={errors:{[s]:[x]},error_data:{[s]:{failedRequestMessage:e.message}}};e.uiMessage=(0,i.Ay)({error:t})}return Promise.reject(e)})},119:(e,s,t)=>{t.d(s,{A:()=>m}),t(609);var n=t(556),o=t.n(n);const i={alert:"lX8h3LbX6kaLN7_hLhlw","alert-icon":"nx2ZqeD9AnYnPnKHAqKJ","alert-title":"ovRzytWn5jGccLKV78T9","alert-message":"M_C6Dj_EqhO8IuY52iA6","alert-action":"liWjpcvKZkKaYPsJjQPA","alert-warning":"MLwfZfK5uVZOtIHI1cdt"};var a=t(942),c=t.n(a),r=t(784),l=t(188),d=t(790);function u(e={}){switch(e.type){case"info":return(0,d.jsx)(r.g,{icon:l.iW_,title:"info",fixedWidth:!0});case"warning":default:return(0,d.jsx)(r.g,{icon:l.zpE,title:"warning",fixedWidth:!0});case"pending":return(0,d.jsx)(r.g,{icon:l.z1G,title:"pending",spin:!0,fixedWidth:!0});case"success":return(0,d.jsx)(r.g,{icon:l.Wcv,title:"success",fixedWidth:!0})}}function h(e={}){return(0,d.jsxs)("div",{className:c()(i.alert,i[`alert-${e.type}`]),role:"alert",children:[(0,d.jsx)("div",{className:i["alert-icon"],children:u(e)}),(0,d.jsxs)("div",{className:i["alert-message"],children:[(0,d.jsx)("h2",{className:i["alert-title"],children:e.title}),(0,d.jsx)("div",{className:i["alert-copy"],children:e.children})]})]})}h.propTypes={title:o().string.isRequired,type:o().oneOf(["info","warning","success","pending"]),children:o().oneOfType([o().object,o().string,o().arrayOf(o().element)]).isRequired};const m=h},192:(e,s,t)=>{t.d(s,{A:()=>g});var n=t(609),o=t(556),i=t.n(o),a=t(896),c=t(312),r=t(87),l=t(723),d=t(790);const u=86400,h=3600,m=60;function p(e){const s=Math.floor(e/u),t=Math.floor((e-s*u)/h),n=Math.floor((e-(s*u+t*h))/m),o=e-(s*u+t*h+n*m);return(0,r.dropWhile)([s,t,n,o].reduce((e,s,t)=>(0===t&&0!==s?e.push(s.toString()):e.push((0,r.padStart)(s.toString(),2,"0")),e),[]),e=>e.match(/^[0]+$/)).join(":")}function f(e){const s=e-Math.floor(new Date/1e3);return s<0?0:s}function g({addDescription:e,children:s}){const t=(0,a.d4)(e=>e.detectConflictsUntil),[o,i]=(0,n.useState)(f(t)),r=(0,a.wA)();return(0,n.useEffect)(()=>{let e=null;return f(t)>0?e=setTimeout(()=>i(f(t)),1e3):(i(p(0)),r({type:"CONFLICT_DETECTION_TIMER_EXPIRED"})),()=>e&&clearTimeout(e)},[t,o,r]),o<=0?null:(0,d.jsxs)("span",{className:c.A["conflict-detection-timer"],children:[p(o),!!e&&(o>60?/* translators: 1: space */ /* translators: 1: space */
(0,l.sprintf)((0,l.__)("%1$sminutes left to browse your site for trouble","font-awesome")," "):/* translators: 1: space */ /* translators: 1: space */
(0,l.sprintf)((0,l.__)("%1$sseconds left to browse your site for trouble","font-awesome")," ")),s]})}g.propTypes={addDescription:i().bool}},312:(e,s,t)=>{t.d(s,{A:()=>n});const n={"wrapper-div":"xAYNgmh_FT28wOZEe4og","submit-wrapper":"W3wz4Liah2EvWxtTBXN8","submit-status":"OpLLWfmNs6BXGmnmuinK",fail:"q0fCXPnTi1vRhNmP0IEt","fail-icon-container":"A2dLn8oZtVzuXngZMDRp",explanation:"xFoMk9Jc8Ir4n5Olcce1",success:"fQeEY3YNz4yh6R7vdi7J",icon:"JPBgwk6PxfiitLxJLE54","section-title":"VklefjWwawC59yrOPe3e","section-divider":"e8Vu3y2YBkuW8N9IhY2m","table-header":"gNYVG50hxMZs8Gqbj_T0","more-less":"dpYyb_l0GWlAiVkOmmYt","scanner-actions":"WJl_9YHKGkhUvtVwgVco","scanner-runstatus":"HBCEbIhIET1XISEYneSA",faPrimary:"ZXe2iyFqFThwx_UF4CBf","conflict-detection-timer":"HgLyUkphZYd8YsLSMJAZ",warning:"Gu2u4ZSZT25Yqm8zSogj","sr-only":"WOV9bdVrpJVdQWzhBnHZ",flex:"QN_KH8sqi5QFBDqaH1rI","flex-row":"bBMVcUUJf1GW7veG1Zic","flex-column":"pIa2BGO1ABMtYZY185Bf",relative:"h0koIl1zvME7toM3jUk9",status:"kWqY7l_wn27HmdUNz7ZY",good:"q3No9l7YMUEH1xvYTNfI","success-icon":"Y7M4JHzDp7jtCt6MonbK","conflict-icon":"a6qTuZmDiKS_FHgMZawo",conflict:"PwCQsIQEdGz9b0cOj3iA","warning-icon":"rw5FUVRrrdM17WyxcRZ9","space-left":"QEoklKhbCbwOUBs0cspa","input-checkbox-custom":"oWHnpotXuoOIlJoqkkgw","checked-icon":"NzRaF0U8aKPVtS6JIaK8","input-radio-custom":"gIUwcNcpOHhTKG4sTlfg","unchecked-icon":"iemYJRvB4tzF1xnuGiAw","option-label-explanation":"BFR5diS8tiViycbuTDVS"}},381:(e,s,t)=>{t.r(s),t.d(s,{default:()=>Q});var n=t(609),o=t.n(n),i=t(795),a=t.n(i),c=t(338),r=t(2),l=t(896),d=t(942),u=t.n(d);const h={"pseudo-elements-screenshot":"uL1wb8HtJb_0IkG3PeEN","tab-header":"VJ5yoahvOPmye_Iv2x78"};var m=t(85),p=t(784),f=t(188),g=t(897);const x={"release-provider-error":"GfbntzmAC3JXYwdY57Hz","warning-banner":"nkCRdVrm4cTGk23nWmwZ","option-header":"_V54L7D6KbeTsNGQHyuu","option-status":"jH1jbDhGqqv7Grbj6p5p","option-choices":"KYI6mFOoLc2LXE3_WOAV","option-choice":"uMUQXnIQhpFojiorojGR","option-choice-container":"Q3PqTXZI2xQbQuon9Brf","option-explanation":"p0FxJ9gY4EvqdrEJ5pDs","option-label":"rr6y9ViQbhSy0YAp3Svc","option-label-text":"d104q4pTcfNp1fl3EEwj","option-divider":"pFNsNzsa6QtxNtsHMsos","options-setter":"x21UupVYDcbhJEXG_vuB",features:"elGAHNDAzrtnF0LZNYl_","option-label-explanation":"FHOPD8z6_efjfjjQHK9B","checking-option-status-indicator":"kP55KzmQ_7zoJ5baS76k"};var _=t(312),j=t(87),N=t(119),b=t(556),w=t.n(b),v=t(723),y=t(790);const A="";function k({useOption:e,handleSubmit:s}){const t=e("usePro"),n=e("technology"),o=e("version"),i=e("compat"),a=e("pseudoElements"),c=!!o.match(/^6\./),r=!!o.match(/^7\./),d=!c&&!r,h=(0,l.d4)(e=>e.pendingOptions),b=(0,l.d4)(e=>e.pendingOptionConflicts),w=(0,l.d4)(e=>e.preferenceConflictDetection.hasChecked),k=(0,l.d4)(e=>e.preferenceConflictDetection.success),S=(0,l.d4)(e=>e.preferenceConflictDetection.message),T=(0,l.d4)(e=>{const{releases:{available:s,latest_version_5:t,latest_version_6:n,latest_version_7:o}}=e;return s.reduce((e,s)=>(e[s]=t===s?`${s} (latest 5.x)`:n===s?`${s} (latest 6.x)`:o===s?`${s} (latest)`:s,e),{})}),E=(0,l.wA)();function C(e={},s=!0){const t=(0,j.get)(e,"technology"),n=t?"webfont"===t?{...e,pseudoElements:!0}:{...e,pseudoElements:!1}:e;E((0,m.addPendingOption)(n)),s&&E((0,m.checkPreferenceConflicts)())}function O(e){return(0,j.has)(h,e)?w&&!k?(0,y.jsx)(N.A,{title:(0,v.__)("Error checking preferences","font-awesome"),type:"warning",children:(0,y.jsx)("p",{children:S})}):(0,j.has)(b,e)?(0,y.jsx)(N.A,{title:(0,v.__)("Preference Conflict","font-awesome"),type:"warning",children:(0,j.size)(b[e])>1?(0,y.jsxs)("div",{children:[(0,v.__)("This change might cause problems for these themes or plugins","font-awesome"),": ",b[e].join(", "),"."]}):(0,y.jsxs)("div",{children:[(0,v.__)("This change might cause problems for the theme or plugin","font-awesome"),": ",b[e][0],"."]})}):null:null}return(0,y.jsx)("div",{className:u()(x["options-setter"]),children:(0,y.jsxs)("form",{onSubmit:e=>e.preventDefault(),children:[(0,y.jsxs)("div",{className:u()(_.A.flex,_.A["flex-row"]),children:[(0,y.jsx)("div",{className:x["option-header"],children:"Icons"}),(0,y.jsxs)("div",{className:x["option-choice-container"],children:[(0,y.jsxs)("div",{className:x["option-choices"],children:[(0,y.jsxs)("div",{className:x["option-choice"],children:[(0,y.jsx)("input",{id:"code_edit_icons_pro",name:"code_edit_icons",type:"radio",checked:t,onChange:()=>C({usePro:!0}),className:u()(_.A["sr-only"],_.A["input-radio-custom"])}),(0,y.jsxs)("label",{htmlFor:"code_edit_icons_pro",className:x["option-label"],children:[(0,y.jsxs)("span",{className:_.A.relative,children:[(0,y.jsx)(p.g,{icon:f.RVf,className:_.A["checked-icon"],size:"lg",fixedWidth:!0}),(0,y.jsx)(p.g,{icon:g.GEE,className:_.A["unchecked-icon"],size:"lg",fixedWidth:!0})]}),(0,y.jsx)("span",{className:x["option-label-text"],children:"Pro"})]})]}),(0,y.jsxs)("div",{className:x["option-choice"],children:[(0,y.jsx)("input",{id:"code_edit_icons_free",name:"code_edit_icons",type:"radio",checked:!t,onChange:()=>C({usePro:!1}),className:u()(_.A["sr-only"],_.A["input-radio-custom"])}),(0,y.jsxs)("label",{htmlFor:"code_edit_icons_free",className:x["option-label"],children:[(0,y.jsxs)("span",{className:_.A.relative,children:[(0,y.jsx)(p.g,{icon:f.RVf,size:"lg",fixedWidth:!0,className:_.A["checked-icon"]}),(0,y.jsx)(p.g,{icon:g.GEE,size:"lg",fixedWidth:!0,className:_.A["unchecked-icon"]})]}),(0,y.jsx)("span",{className:x["option-label-text"],children:"Free"})]})]})]}),t&&(c||r)&&(0,y.jsx)(N.A,{title:c?(0,v.__)("Heads up! Pro Version 6 is not available from CDN","font-awesome"):(0,v.__)("Heads up! Pro Version 7 is not available from CDN","font-awesome"),type:"warning",children:(0,y.jsx)("p",{children:'You can, however, use a Kit. Make sure you have an active Font Awesome subscription and select "Use a Kit" above. We\'ll walk you through the other details from there.'})}),t&&d&&(0,y.jsxs)(N.A,{title:(0,v.__)("Heads up! Pro requires a Font Awesome subscription","font-awesome"),type:"info",children:[(0,y.jsx)("p",{children:"And you need to add your WordPress site to the allowed domains for your CDN."}),(0,y.jsxs)("ul",{children:[(0,y.jsx)("li",{children:(0,y.jsxs)("a",{rel:"noopener noreferrer",target:"_blank",href:"https://fontawesome.com/account/cdn",children:[(0,v.__)("Manage my allowed domains","font-awesome"),(0,y.jsx)(p.g,{icon:f.AaJ,style:{marginLeft:".5em"}})]})}),(0,y.jsx)("li",{children:(0,y.jsxs)("a",{rel:"noopener noreferrer",target:"_blank",href:"https://fontawesome.com/pro",children:[(0,v.__)("Get Pro","font-awesome"),(0,y.jsx)(p.g,{icon:f.AaJ,style:{marginLeft:".5em"}})]})})]})]}),O("usePro")]})]}),(0,y.jsx)("hr",{className:x["option-divider"]}),(0,y.jsxs)("div",{className:u()(_.A.flex,_.A["flex-row"]),children:[(0,y.jsx)("div",{className:x["option-header"],children:(0,v.__)("Technology","font-awesome")}),(0,y.jsxs)("div",{className:x["option-choice-container"],children:[(0,y.jsxs)("div",{className:x["option-choices"],children:[(0,y.jsxs)("div",{className:x["option-choice"],children:[(0,y.jsx)("input",{id:"code_edit_tech_svg",name:"code_edit_tech",type:"radio",checked:"svg"===n,onChange:()=>C({technology:"svg"}),className:u()(_.A["sr-only"],_.A["input-radio-custom"])}),(0,y.jsxs)("label",{htmlFor:"code_edit_tech_svg",className:x["option-label"],children:[(0,y.jsxs)("span",{className:_.A.relative,children:[(0,y.jsx)(p.g,{icon:f.RVf,className:_.A["checked-icon"],size:"lg",fixedWidth:!0}),(0,y.jsx)(p.g,{icon:g.GEE,className:_.A["unchecked-icon"],size:"lg",fixedWidth:!0})]}),(0,y.jsx)("span",{className:x["option-label-text"],children:(0,v.__)("SVG","font-awesome")})]})]}),(0,y.jsxs)("div",{className:x["option-choice"],children:[(0,y.jsx)("input",{id:"code_edit_tech_webfont",name:"code_edit_tech",type:"radio",checked:"webfont"===n,onChange:()=>C({technology:"webfont",pseudoElements:!1}),className:u()(_.A["sr-only"],_.A["input-radio-custom"])}),(0,y.jsxs)("label",{htmlFor:"code_edit_tech_webfont",className:x["option-label"],children:[(0,y.jsxs)("span",{className:_.A.relative,children:[(0,y.jsx)(p.g,{icon:f.RVf,size:"lg",fixedWidth:!0,className:_.A["checked-icon"]}),(0,y.jsx)(p.g,{icon:g.GEE,size:"lg",fixedWidth:!0,className:_.A["unchecked-icon"]})]}),(0,y.jsxs)("span",{className:x["option-label-text"],children:[(0,v.__)("Web Font","font-awesome"),"webfont"===n&&(0,y.jsx)("span",{className:x["option-label-explanation"],children:(0,v.__)("CSS Pseudo-elements are enabled by default with Web Font","font-awesome")})]})]})]})]}),O("technology")]})]}),(0,y.jsxs)("div",{className:u()(_.A.flex,_.A["flex-row"]),children:[(0,y.jsx)("div",{className:x["option-header"]}),(0,y.jsx)("div",{className:x["option-choice-container"],style:{marginTop:"1em"},children:"svg"===n&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("input",{id:"code_edit_features_pseudo_elements",name:"code_edit_features",type:"checkbox",checked:a,onChange:()=>C({pseudoElements:!a}),className:u()(_.A["sr-only"],_.A["input-checkbox-custom"])}),(0,y.jsxs)("label",{htmlFor:"code_edit_features_pseudo_elements",className:x["option-label"],children:[(0,y.jsxs)("span",{className:_.A.relative,children:[(0,y.jsx)(p.g,{icon:f.rQb,className:_.A["checked-icon"],size:"lg",fixedWidth:!0}),(0,y.jsx)(p.g,{icon:g.Nfw,className:_.A["unchecked-icon"],size:"lg",fixedWidth:!0})]}),(0,y.jsxs)("span",{className:x["option-label-text"],children:[(0,v.__)("Enable CSS Pseudo-elements with SVG","font-awesome"),(0,y.jsxs)("span",{className:x["option-label-explanation"],children:[(0,v.__)("May cause performance issues.","font-awesome")," ",(0,y.jsxs)("a",{rel:"noopener noreferrer",target:"_blank",style:{marginLeft:".5em"},href:"https://fontawesome.com/how-to-use/on-the-web/advanced/css-pseudo-elements",children:[(0,v.__)("Learn more","font-awesome")," ",(0,y.jsx)(p.g,{icon:f.AaJ,style:{marginLeft:".5em"}})]})]})]})]}),O("pseudoElements")]})})]}),(0,y.jsx)("hr",{className:x["option-divider"]}),(0,y.jsxs)("div",{className:u()(_.A.flex,_.A["flex-row"]),children:[(0,y.jsx)("div",{className:x["option-header"],children:"Version"}),(0,y.jsxs)("div",{className:x["option-choice-container"],children:[(0,y.jsx)("div",{className:x["option-choices"],children:(0,y.jsx)("select",{className:x["version-select"],name:"version",onChange:e=>C({version:e.target.value}),value:o,children:Object.keys(T).map((e,s)=>(0,y.jsx)("option",{value:e,children:e===A?"-":T[e]},s))})}),O("version")]})]}),(0,y.jsx)("hr",{className:x["option-divider"]}),(0,y.jsxs)("div",{className:u()(_.A.flex,_.A["flex-row"],x.features),children:[(0,y.jsx)("div",{className:x["option-header"],children:"Older Version Compatibility"}),(0,y.jsxs)("div",{className:x["option-choice-container"],children:[(0,y.jsxs)("div",{className:x["option-choices"],children:[(0,y.jsxs)("div",{className:x["option-choice"],children:[(0,y.jsx)("input",{id:"code_edit_compat_on",name:"code_edit_compat_on",type:"radio",value:i,checked:i,onChange:()=>C({compat:!i}),className:u()(_.A["sr-only"],_.A["input-radio-custom"])}),(0,y.jsxs)("label",{htmlFor:"code_edit_compat_on",className:x["option-label"],children:[(0,y.jsxs)("span",{className:_.A.relative,children:[(0,y.jsx)(p.g,{icon:f.RVf,className:_.A["checked-icon"],size:"lg",fixedWidth:!0}),(0,y.jsx)(p.g,{icon:g.GEE,className:_.A["unchecked-icon"],size:"lg",fixedWidth:!0})]}),(0,y.jsx)("span",{className:x["option-label-text"],children:(0,v.__)("On","font-awesome")})]})]}),(0,y.jsxs)("div",{className:x["option-choice"],children:[(0,y.jsx)("input",{id:"code_edit_v4_compat_off",name:"code_edit_v4_compat_off",type:"radio",value:!i,checked:!i,onChange:()=>C({compat:!i}),className:u()(_.A["sr-only"],_.A["input-radio-custom"])}),(0,y.jsxs)("label",{htmlFor:"code_edit_v4_compat_off",className:x["option-label"],children:[(0,y.jsxs)("span",{className:_.A.relative,children:[(0,y.jsx)(p.g,{icon:f.RVf,size:"lg",fixedWidth:!0,className:_.A["checked-icon"]}),(0,y.jsx)(p.g,{icon:g.GEE,size:"lg",fixedWidth:!0,className:_.A["unchecked-icon"]})]}),(0,y.jsx)("span",{className:x["option-label-text"],children:(0,v.__)("Off","font-awesome")})]})]})]}),O("compat")]})]})]})})}k.propTypes={useOption:w().func.isRequired,handleOptionChange:w().func.isRequired,handleSubmit:w().func.isRequired};const S={"kit-tab-content":"kaJ7ZfPW8LYXB3jcG1xM","field-apitoken":"iw1ugzHiscI8cdqPxDt5","api-token-control-wrapper":"DnA1Iv_lwCTNSAFQGrON","api-token-control":"Pnf8O2SgfIFmVM0PSv3Z","api-token-update":"kjodIeFA7B16RQcru0GW","token-saved":"A0_oAmpyVJ9wdtADndGQ",remove:"HfzrDbHUd_u1i9ndGEBR","button-group":"elgzg717O9Crp2uzkrTD","button-dismissable":"V9u2jF9aJPfN0wX4PDVS","wrap-active-kit":"wziOBkVmZ17vJu2Sz35G","active-kit":"DFhEV9q8j6_YiAqxGCIQ",set:"y9VOhnGapgfPZMY_1Bh6",none:"czVzoPvuSXhcttrzFc9L","wrap-selectkit":"ngog_nfdj6MCATJVipdj","title-selectkit":"S_T55Hlv5ASeRm2CyHmV",selectkit:"fy5GsBzkO8Epk2RR04LH",refresh:"fNJ_UaCGqOZxk72kjIDA","kit-selector-container":"SstVIjmK5UOaiy_ltjXE","kit-select":"vdGJ8TWieYuqqCakSyHG","kit-config-view-container":"gJq7WtlHzhBcjrgjABY8","selected-kit-settings":"o1IZC2E8wgWEslXswxvX",label:"W3xNRcvtnX8v6hHiakrQ",value:"HS7POK_5ddxGDSTzJHun","tip-text":"co95Sqvd5n7VgX7SM5jt"};function T({useOption:e,masterSubmitButtonShowing:s,setMasterSubmitButtonShowing:t}){const o=(0,l.wA)(),i=(0,l.d4)(e=>e.options.kitToken),a=e("kitToken"),[c,r]=(0,n.useState)(null),[d,h]=(0,n.useState)(!1),[x,b]=(0,n.useState)(!1),w=(0,l.d4)(e=>null!==c?c:e.options.apiToken),A=(0,l.d4)(e=>e.kits)||[],k=(0,l.d4)(e=>e.optionsFormState.hasSubmitted),T=(0,l.d4)(e=>e.optionsFormState.success),E=(0,l.d4)(e=>e.optionsFormState.message),C=(0,l.d4)(e=>e.optionsFormState.isSubmitting),O=(0,l.d4)(e=>e.kitsQueryStatus),D=(0,n.createRef)(),[I,P]=(0,n.useState)(!1);(0,n.useEffect)(()=>{D.current&&I&&D.current.focus()});const R=(0,l.d4)(e=>!!e.options.apiToken);function F(){return(0,n.useEffect)(()=>{T&&x&&(b(!1),t(!0))}),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:u()(S["field-apitoken"],{[S["api-token-update"]]:x}),children:[(0,y.jsxs)("label",{htmlFor:"api_token",children:[(0,y.jsx)(p.g,{className:_.A.icon,icon:g.wRm,size:"lg"}),(0,v.__)("API Token","font-awesome")]}),(0,y.jsxs)("div",{children:[(0,y.jsx)("input",{id:"api_token",name:"api_token",type:"text",ref:D,value:c||"",size:"20",onChange:e=>{P(!0),r(e.target.value)}}),(0,y.jsxs)("p",{children:[(0,v.__)("Grab your secure and unique API token from your Font Awesome account page and enter it here so we can securely fetch your kits.","font-awesome")," ",(0,y.jsxs)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://fontawesome.com/account#api-tokens",children:[(0,v.__)("Get your API token on fontawesome.com","font-awesome")," ",(0,y.jsx)(p.g,{icon:f.AaJ,style:{marginLeft:".5em"}})]})]})]})]}),(0,y.jsxs)("div",{className:"submit",children:[(0,y.jsx)("input",{type:"submit",name:"submit",id:"submit",className:"button button-primary",value:(0,v.__)("Save API Token","font-awesome"),disabled:!c,onMouseDown:()=>{o((0,m.updateApiToken)({apiToken:c,runQueryKits:!0})),r(null)}}),k&&!T&&(0,y.jsxs)("div",{className:u()(_.A["submit-status"],_.A.fail),children:[(0,y.jsx)("div",{className:u()(_.A["fail-icon-container"]),children:(0,y.jsx)(p.g,{className:_.A.icon,icon:f.B0L})}),(0,y.jsx)("div",{className:_.A.explanation,children:E})]}),C&&(0,y.jsx)("span",{className:u()(_.A["submit-status"],_.A.submitting),children:(0,y.jsx)(p.g,{className:_.A.icon,icon:f.z1G,spin:!0})}),x&&!C&&(0,y.jsx)("button",{onClick:()=>(b(!1),t(!0),void o((0,m.resetOptionsFormState)())),className:S["button-dismissable"],children:(0,v.__)("Nevermind","font-awesome")})]})]})}function z(){return(0,y.jsxs)("div",{className:S["api-token-control-wrapper"],children:[(0,y.jsx)("div",{className:u()(S["api-token-control"],{[S["api-token-update"]]:x}),children:x?(0,y.jsx)(F,{}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("p",{className:S["token-saved"],children:[(0,y.jsx)("span",{children:(0,y.jsx)(p.g,{className:_.A.icon,icon:g.SGM,size:"lg"})}),(0,v.__)("API Token Saved","font-awesome")]}),!!w&&(0,y.jsxs)("div",{className:S["button-group"],children:[(0,y.jsxs)("button",{onClick:()=>(o((0,m.resetOptionsFormState)()),b(!0),t(!1),void h(!1)),className:S.refresh,type:"button",children:[(0,y.jsx)(p.g,{className:_.A.icon,icon:f.VNe,title:"update",alt:"update"}),(0,y.jsx)("span",{children:(0,v.__)("Update token","font-awesome")})]}),(0,y.jsx)("button",{onClick:()=>{i?h(!0):o((0,m.updateApiToken)({apiToken:!1}))},className:S.remove,type:"button",children:(0,y.jsx)(p.g,{className:_.A.icon,icon:f.BeE,title:"remove",alt:"remove"})})]})]})}),d&&(0,y.jsx)("div",{className:S["api-token-control-alert-wrapper"],children:(0,y.jsx)(N.A,{title:(0,v.__)("Whoa, whoa, whoa!","font-awesome"),type:"warning",children:(0,v.__)('You can\'t remove your API token when "Use a Kit" is active. Switch to "Use CDN" first.',"font-awesome")})})]})}function W(){const e=w?O.isSubmitting?"querying":O.hasSubmitted?O.success?(0,j.size)(A)>0?"kitSelection":"noKitsFoundAfterQuery":"networkError":i?"showingOnlyActiveKit":"apiTokenReadyNoKitsYet":"noApiToken",t=(0,y.jsxs)("button",{onClick:()=>o((0,m.queryKits)()),className:S.refresh,children:[(0,y.jsx)(p.g,{className:_.A.icon,icon:f.yek,title:"refresh",alt:"refresh"}),(0,y.jsx)("span",{children:0===(0,j.size)(A)?(0,v.__)("Get latest kits data","font-awesome"):(0,v.__)("Refresh kits data","font-awesome")})]}),n=i?(0,y.jsx)("div",{className:S["wrap-active-kit"],children:(0,y.jsxs)("p",{className:u()(S["active-kit"],S.set),children:[(0,y.jsx)(p.g,{className:_.A.icon,icon:g.SGM,size:"lg"}),(0,v.sprintf)((0,v.__)("%s Kit is Currently Active"),i)]})}):null;return(0,y.jsxs)("div",{className:S["kit-selector-container"],children:[n,(0,y.jsxs)("div",{className:S["wrap-selectkit"],children:[(0,y.jsxs)("h3",{className:S["title-selectkit"],children:[(0,y.jsx)(p.g,{className:_.A.icon,icon:g.wRm,size:"lg"}),(0,v.__)("Pick a Kit to Use or Check Settings","font-awesome")]}),(0,y.jsxs)("div",{className:S.selectkit,children:[(0,y.jsx)("p",{children:(0,v.__)("Refresh your kits data to get the latest kit settings, then select the kit you would like to use. Remember to save when you're ready to use it.","font-awesome")}),{noApiToken:"noApiToken",apiTokenReadyNoKitsYet:(0,y.jsxs)(y.Fragment,{children:[n," ",t]}),querying:(0,y.jsxs)("div",{children:[(0,y.jsx)("span",{children:(0,v.__)("Loading your kits...","font-awesome")}),(0,y.jsx)("span",{className:u()(_.A["submit-status"],_.A.submitting),children:(0,y.jsx)(p.g,{className:_.A.icon,icon:f.z1G,spin:!0})})]}),networkError:(0,y.jsxs)("div",{className:u()(_.A["submit-status"],_.A.fail),children:[(0,y.jsx)("div",{className:u()(_.A["fail-icon-container"]),children:(0,y.jsx)(p.g,{className:_.A.icon,icon:f.B0L})}),(0,y.jsx)("div",{className:_.A.explanation,children:O.message})]}),noKitsFoundAfterQuery:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(N.A,{title:"Zoinks! Looks like you don't have any kits set up yet.",type:"info",children:(0,y.jsxs)("p",{children:[(0,v.__)("Head over to Font Awesome to create one, then come back here and refresh your kits.","font-awesome")," ",(0,y.jsxs)("a",{rel:"noopener noreferrer",target:"_blank",href:"https://fontawesome.com/kits",children:[(0,v.__)("Create a kit on Font Awesome","font-awesome")," ",(0,y.jsx)(p.g,{icon:f.AaJ})]})]})}),t]}),kitSelection:(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{className:S["field-kitselect"],children:[(0,y.jsxs)("select",{className:S["kit-select"],id:"kits",name:"kit",onChange:e=>function({kitToken:e}){if(""===e)return;const s=(A||[]).find(s=>s.token===e);if(!s)throw new Error((0,v.sprintf)((0,v.__)("When selecting to use kit %s, somehow the information we needed was missing. Try reloading the page."),e));o(i===e?(0,m.resetPendingOptions)():(0,m.addPendingOption)({kitToken:e,technology:"svg"===s.technologySelected?"svg":"webfont",usePro:"pro"===s.licenseSelected,compat:s.shimEnabled,version:s.version,pseudoElements:"svg"!==s.technologySelected})),o((0,m.checkPreferenceConflicts)())}({kitToken:e.target.value}),disabled:!s,value:a||"",children:[(0,y.jsx)("option",{value:"",children:(0,v.__)("Select a kit","font-awesome")},"empty"),A.map((e,s)=>(0,y.jsx)("option",{value:e.token,children:`${e.name} (${e.token})`},s))]}),t]})}),showingOnlyActiveKit:(0,y.jsx)(y.Fragment,{children:t})}[e]]})]})]})}return(0,y.jsx)("div",{children:(0,y.jsx)("div",{className:S["kit-tab-content"],children:R?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(z,{}),(0,y.jsx)(W,{})]}):(0,y.jsx)(F,{})})})}T.propTypes={useOption:w().func.isRequired,handleOptionChange:w().func.isRequired,masterSubmitButtonShowing:w().bool.isRequired,setMasterSubmitButtonShowing:w().func.isRequired};var E=t(780);function C({kitToken:e}){const s=(0,l.d4)(s=>(0,j.get)(s,"options.kitToken")===e),t=(0,l.d4)(s=>(s.kits||[]).find(s=>s.token===e)),n=(0,l.d4)(e=>e.pendingOptionConflicts),o=(0,l.d4)(e=>e.preferenceConflictDetection.hasChecked),i=(0,l.d4)(e=>e.preferenceConflictDetection.success),a=(0,l.d4)(e=>s?e.options.technology:"svg"===t.technologySelected?"svg":"webfont"),c=(0,l.d4)(e=>s?e.options.usePro:"pro"===t.licenseSelected),r=(0,l.d4)(e=>s?e.options.compat:t.shimEnabled),d=(0,l.d4)(e=>s?e.options.version:t.version);function u(e){return o&&i&&(0,j.has)(n,e)?(0,y.jsx)(N.A,{title:(0,v.__)("Preference Conflict","font-awesome"),type:"warning",children:(0,j.size)(n[e])>1?(0,y.jsxs)("div",{children:[(0,v.__)("This change might cause problems for these themes or plugins:","font-awesome")," ",n[e].join(", "),"."]}):(0,y.jsxs)("div",{children:[(0,v.__)("This change might cause problems for the theme or plugin:","font-awesome")," ",n[e][0],"."]})}):null}return s||t?(0,y.jsxs)("div",{className:S["kit-config-view-container"],children:[(0,y.jsx)("table",{className:S["selected-kit-settings"],children:(0,y.jsxs)("tbody",{children:[(0,y.jsxs)("tr",{children:[(0,y.jsx)("th",{className:S.label,children:(0,v.__)("Icons","font-awesome")}),(0,y.jsxs)("td",{className:S.value,children:[c?"Pro":"Free",u("usePro")]})]}),(0,y.jsxs)("tr",{children:[(0,y.jsx)("th",{className:S.label,children:(0,v.__)("Technology","font-awesome")}),(0,y.jsxs)("td",{className:S.value,children:[a,u("technology")]})]}),(0,y.jsxs)("tr",{children:[(0,y.jsx)("th",{className:S.label,children:(0,v.__)("Version","font-awesome")}),(0,y.jsxs)("td",{className:S.value,children:[d,u("version")]})]}),(0,y.jsxs)("tr",{children:[(0,y.jsx)("th",{className:S.label,children:(0,v.__)("Older Version Compatibility","font-awesome")}),(0,y.jsxs)("td",{className:S.value,children:[r?"On":"Off",u("compat")]})]})]})}),(0,y.jsx)("p",{className:S["tip-text"],children:(0,E.A)((0,v.__)("Make changes on fontawesome.com/kits