| 1 |
(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__copyProps=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},__toESM=(n,r,a)=>(a=n==null?{}:e(i(n)),__copyProps(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),o=__toESM(__commonJSMin(((e,t)=>{var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})},__copyProps=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of a(t))!s.call(e,c)&&c!==n&&r(e,c,{get:()=>t[c],enumerable:!(o=i(t,c))||o.enumerable});return e},__toESM=(e,t,i)=>(i=e==null?{}:n(o(e)),__copyProps(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)),__toCommonJS=e=>__copyProps(r({},`__esModule`,{value:!0}),e),c={};__export(c,{AGENTS_SITE_SETTINGS_TAB_ID:()=>b,AgentsSettingsTab:()=>AgentsSettingsTab,init:()=>init}),t.exports=__toCommonJS(c);var l=globalThis.elementorV2.editorSiteSettings,u=__toESM(globalThis.React),d=globalThis.React,f=globalThis.elementorV2.editorV1Adapters,p=globalThis.elementorV2.ui,m=globalThis.wp.i18n,h=globalThis.elementorV2.editorDocuments,g=`agents`,_=`llms`;function getSiteSettingsBag(){return(0,h.getV1CurrentDocument)()?.container?.settings||null}function readAgentsSettings(e){let t=e?.get(g);return t&&typeof t==`object`?{...t}:{}}function omitLlms(e){return Object.fromEntries(Object.entries(e).filter(([e])=>e!==_))}function isEmpty(e){return Object.keys(e).length===0}function readLlmsContent(){let e=readAgentsSettings(getSiteSettingsBag())[_];return typeof e==`string`?e:``}function writeLlmsContent(e){let t=getSiteSettingsBag();if(!t)return!1;let n=readAgentsSettings(t);if(e===``){let e=omitLlms(n);t.set(g,isEmpty(e)?void 0:e)}else t.set(g,{...n,[_]:e});return(0,h.setDocumentModifiedStatus)(!0),!0}var v=`settings-agents`,y=`panel/global/${v}`;function AgentsSettingsTab(){let[e,t]=(0,d.useState)(readLlmsContent),[n,r]=(0,d.useState)(()=>getSiteSettingsBag()!==null);(0,f.__privateUseListenTo)([(0,f.routeOpenEvent)(y)],()=>{r(getSiteSettingsBag()!==null),t(readLlmsContent())});let i=(0,d.useCallback)(e=>{let n=e.target.value;t(n),writeLlmsContent(n)},[]);return u.createElement(p.Box,{sx:{p:2}},u.createElement(p.Stack,{spacing:1.5},u.createElement(p.Typography,{variant:`subtitle2`},(0,m.__)(`Agents`,`elementor`)),u.createElement(p.TextField,{label:(0,m.__)(`llms.txt`,`elementor`),value:e,onChange:i,multiline:!0,minRows:12,fullWidth:!0,disabled:!n,helperText:n?(0,m.__)(`Content served at /llms.txt when saved. Leave empty to disable.`,`elementor`):(0,m.__)(`Kit settings are unavailable. Reopen Site Settings and try again.`,`elementor`)})))}var b=v,x=`agents_llms_txt`;function isAgentsExperimentActive(){return!!(window.elementorCommon?.config?.experimentalFeatures??{})[x]}function init(){isAgentsExperimentActive()&&(0,l.injectSiteSettingsTab)({id:b,component:AgentsSettingsTab})}0&&(t.exports={AGENTS_SITE_SETTINGS_TAB_ID:b,AgentsSettingsTab,init})}))());(window.elementorV2=window.elementorV2||{}).editorAgents=o})(),window.elementorV2.editorAgents?.init?.(); |