Files
igny8/frontend/dist/assets/js/vendor-helmet-MZDArkdS.js
Gitea Deploy 961362e088 Add SEO fields to Tasks model, improve content generation response handling, and enhance progress bar animation
- Added primary_keyword, secondary_keywords, tags, and categories fields to Tasks model
- Updated generate_content function to handle full JSON response with all SEO fields
- Improved progress bar animation: smooth 1% increments every 300ms
- Enhanced step detection for content generation vs clustering vs ideas
- Fixed progress modal to show correct messages for each function type
- Added comprehensive logging to Keywords and Tasks pages for AI functions
- Fixed error handling to show meaningful error messages instead of generic failures
2025-11-09 21:22:34 +00:00

2 lines
12 KiB
JavaScript

var Q=Object.defineProperty;var X=(e,t,r)=>t in e?Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var h=(e,t,r)=>X(e,typeof t!="symbol"?t+"":t,r);import{r as _,R as y}from"./vendor-react-core-DjsjKnCi.js";import{f as ee,i as F,s as te}from"./vendor-other-CdRIx1s3.js";var Y=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Y||{}),$={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},K=Object.values(Y),L={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},re=Object.entries(L).reduce((e,[t,r])=>(e[r]=t,e),{}),f="data-rh",A={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},C=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},ne=e=>{let t=C(e,"title");const r=C(e,A.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=C(e,A.DEFAULT_TITLE);return t||n||void 0},se=e=>C(e,A.ON_CHANGE_CLIENT_STATE)||(()=>{}),P=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),ie=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let o=0;o<s.length;o+=1){const i=s[o].toLowerCase();if(e.indexOf(i)!==-1&&n[i])return r.concat(n)}}return r},[]),ae=e=>console&&typeof console.warn=="function"&&console.warn(e),E=(e,t,r)=>{const n={};return r.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&ae(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,o)=>{const c={};o.filter(l=>{let a;const u=Object.keys(l);for(let T=0;T<u.length;T+=1){const p=u[T],g=p.toLowerCase();t.indexOf(g)!==-1&&!(a==="rel"&&l[a].toLowerCase()==="canonical")&&!(g==="rel"&&l[g].toLowerCase()==="stylesheet")&&(a=g),t.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(a=p)}if(!a||!l[a])return!1;const m=l[a].toLowerCase();return n[a]||(n[a]={}),c[a]||(c[a]={}),n[a][m]?!1:(c[a][m]=!0,!0)}).reverse().forEach(l=>s.push(l));const i=Object.keys(c);for(let l=0;l<i.length;l+=1){const a=i[l],u={...n[a],...c[a]};n[a]=u}return s},[]).reverse()},oe=(e,t)=>{if(Array.isArray(e)&&e.length){for(let r=0;r<e.length;r+=1)if(e[r][t])return!0}return!1},le=e=>({baseTag:ie(["href"],e),bodyAttributes:P("bodyAttributes",e),defer:C(e,A.DEFER),encode:C(e,A.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:P("htmlAttributes",e),linkTags:E("link",["rel","href"],e),metaTags:E("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:E("noscript",["innerHTML"],e),onChangeClientState:se(e),scriptTags:E("script",["src","innerHTML"],e),styleTags:E("style",["cssText"],e),title:ne(e),titleAttributes:P("titleAttributes",e),prioritizeSeoTags:oe(e,A.PRIORITIZE_SEO_TAGS)}),B=e=>Array.isArray(e)?e.join(""):e,ce=(e,t)=>{const r=Object.keys(e);for(let n=0;n<r.length;n+=1)if(t[r[n]]&&t[r[n]].includes(e[r[n]]))return!0;return!1},w=(e,t)=>Array.isArray(e)?e.reduce((r,n)=>(ce(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},q=(e,t)=>({...e,[t]:void 0}),ue=["noscript","script","style"],H=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),V=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),pe=(e,t,r,n)=>{const s=V(r),o=B(t);return s?`<${e} ${f}="true" ${s}>${H(o,n)}</${e}>`:`<${e} ${f}="true">${H(o,n)}</${e}>`},me=(e,t,r=!0)=>t.reduce((n,s)=>{const o=s,c=Object.keys(o).filter(a=>!(a==="innerHTML"||a==="cssText")).reduce((a,u)=>{const m=typeof o[u]>"u"?u:`${u}="${H(o[u],r)}"`;return a?`${a} ${m}`:m},""),i=o.innerHTML||o.cssText||"",l=ue.indexOf(e)===-1;return`${n}<${e} ${f}="true" ${c}${l?"/>":`>${i}</${e}>`}`},""),Z=(e,t={})=>Object.keys(e).reduce((r,n)=>{const s=L[n];return r[s||n]=e[n],r},t),de=(e,t,r)=>{const n={key:t,[f]:!0},s=Z(r,n);return[y.createElement("title",s,t)]},I=(e,t)=>t.map((r,n)=>{const s={key:n,[f]:!0};return Object.keys(r).forEach(o=>{const i=L[o]||o;if(i==="innerHTML"||i==="cssText"){const l=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[i]=r[o]}),y.createElement(e,s)}),d=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>de(e,t.title,t.titleAttributes),toString:()=>pe(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Z(t),toString:()=>V(t)};default:return{toComponent:()=>I(e,t),toString:()=>me(e,t,r)}}},fe=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const s=w(e,$.meta),o=w(t,$.link),c=w(r,$.script);return{priorityMethods:{toComponent:()=>[...I("meta",s.priority),...I("link",o.priority),...I("script",c.priority)],toString:()=>`${d("meta",s.priority,n)} ${d("link",o.priority,n)} ${d("script",c.priority,n)}`},metaTags:s.default,linkTags:o.default,scriptTags:c.default}},he=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:o,styleTags:c,title:i="",titleAttributes:l,prioritizeSeoTags:a}=e;let{linkTags:u,metaTags:m,scriptTags:T}=e,p={toComponent:()=>{},toString:()=>""};return a&&({priorityMethods:p,linkTags:u,metaTags:m,scriptTags:T}=fe(e)),{priority:p,base:d("base",t,n),bodyAttributes:d("bodyAttributes",r,n),htmlAttributes:d("htmlAttributes",s,n),link:d("link",u,n),meta:d("meta",m,n),noscript:d("noscript",o,n),script:d("script",T,n),style:d("style",c,n),title:d("title",{title:i,titleAttributes:l},n)}},D=he,x=[],G=!!(typeof window<"u"&&window.document&&window.document.createElement),R=class{constructor(e,t){h(this,"instances",[]);h(this,"canUseDOM",G);h(this,"context");h(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?x:this.instances,add:e=>{(this.canUseDOM?x:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?x:this.instances).indexOf(e);(this.canUseDOM?x:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=D({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Te={},W=y.createContext(Te),b,ye=(b=class extends _.Component{constructor(r){super(r);h(this,"helmetData");this.helmetData=new R(this.props.context||{},b.canUseDOM)}render(){return y.createElement(W.Provider,{value:this.helmetData.value},this.props.children)}},h(b,"canUseDOM",G),b),v=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${f}]`),s=[].slice.call(n),o=[];let c;return t&&t.length&&t.forEach(i=>{const l=document.createElement(e);for(const a in i)if(Object.prototype.hasOwnProperty.call(i,a))if(a==="innerHTML")l.innerHTML=i.innerHTML;else if(a==="cssText")l.styleSheet?l.styleSheet.cssText=i.cssText:l.appendChild(document.createTextNode(i.cssText));else{const u=a,m=typeof i[u]>"u"?"":i[u];l.setAttribute(a,m)}l.setAttribute(f,"true"),s.some((a,u)=>(c=u,l.isEqualNode(a)))?s.splice(c,1):o.push(l)}),s.forEach(i=>{var l;return(l=i.parentNode)==null?void 0:l.removeChild(i)}),o.forEach(i=>r.appendChild(i)),{oldTags:s,newTags:o}},M=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(f),s=n?n.split(","):[],o=[...s],c=Object.keys(t);for(const i of c){const l=t[i]||"";r.getAttribute(i)!==l&&r.setAttribute(i,l),s.indexOf(i)===-1&&s.push(i);const a=o.indexOf(i);a!==-1&&o.splice(a,1)}for(let i=o.length-1;i>=0;i-=1)r.removeAttribute(o[i]);s.length===o.length?r.removeAttribute(f):r.getAttribute(f)!==c.join(",")&&r.setAttribute(f,c.join(","))},ge=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=B(e)),M("title",t)},N=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:o,metaTags:c,noscriptTags:i,onChangeClientState:l,scriptTags:a,styleTags:u,title:m,titleAttributes:T}=e;M("body",n),M("html",s),ge(m,T);const p={baseTag:v("base",r),linkTags:v("link",o),metaTags:v("meta",c),noscriptTags:v("noscript",i),scriptTags:v("script",a),styleTags:v("style",u)},g={},j={};Object.keys(p).forEach(S=>{const{newTags:U,oldTags:J}=p[S];U.length&&(g[S]=U),J.length&&(j[S]=p[S].oldTags)}),t&&t(),l(e,g,j)},O=null,be=e=>{O&&cancelAnimationFrame(O),e.defer?O=requestAnimationFrame(()=>{N(e,()=>{O=null})}):(N(e),O=null)},ve=be,z=class extends _.Component{constructor(){super(...arguments);h(this,"rendered",!1)}shouldComponentUpdate(t){return!te(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const s=le(t.get().map(o=>{const c={...o.props};return delete c.context,c}));ye.canUseDOM?ve(s):D&&(n=D(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},k,Oe=(k=class extends _.Component{shouldComponentUpdate(e){return!ee(q(this.props,"helmetData"),q(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return F(K.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${K.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),F(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return y.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:s,...o}=n.props,c=Object.keys(o).reduce((l,a)=>(l[re[a]||a]=o[a],l),{});let{type:i}=n;switch(typeof i=="symbol"?i=i.toString():this.warnOnInvalidChildren(n,s),i){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,c,s);break;default:t=this.mapObjectTypeChildren(n,t,c,s);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof R)){const s=n;n=new R(s.context,!0),delete r.helmetData}return n?y.createElement(z,{...r,context:n.value}):y.createElement(W.Consumer,null,s=>y.createElement(z,{...r,context:s}))}},h(k,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),k);export{Oe as H,ye as a};